From 2c023b403704b32ec6eeb420a2e63b6ab96a593c Mon Sep 17 00:00:00 2001 From: QQ Date: Tue, 17 Nov 2026 08:31:36 +0800 Subject: [PATCH] Import apps/android/src/services/remote-runtime.ts --- apps/android/src/services/remote-runtime.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/android/src/services/remote-runtime.ts b/apps/android/src/services/remote-runtime.ts index 8b19044..5d7d99a 100644 --- a/apps/android/src/services/remote-runtime.ts +++ b/apps/android/src/services/remote-runtime.ts @@ -56,6 +56,17 @@ export class AndroidRemoteRuntime { } } + supportsBinaryUpload(): boolean { return this.connected && this.client.supportsBinaryUpload?.() === true } + + /** A file upload must not continue against a replacement Host/carrier. */ + createRpcCaller() { + const generation = this.generation + return Object.assign((method:string, params:unknown, signal?:AbortSignal):Promise => { + if (generation !== this.generation || !this.connected) return Promise.reject(new Error('The upload connection was replaced or closed.')) + return this.client.rpc(method, params, signal) + }, { supportsBinaryUpload: this.supportsBinaryUpload() }) + } + async refreshBackends(): Promise { await this.client.refreshBackends() } rpc(method: string, params: unknown, signal?: AbortSignal): Promise { return this.client.rpc(method, params, signal) @@ -68,6 +79,7 @@ export class AndroidRemoteRuntime { requireBotClient() { return this.client.requireBotClient() } requireCodex() { return this.client.requireCodex() } requireSessionTools(sessionId?: string) { return this.client.requireSessionTools(sessionId) } + hasSessionEvents() { return typeof this.client.hasSessionEvents === 'function' ? this.client.hasSessionEvents() : false } hasCodex() { return this.client.hasCodex() } requireCursor() { return this.client.requireCursor() } hasCursor() { return this.client.hasCursor() } @@ -83,6 +95,7 @@ export class AndroidRemoteRuntime { hasHermes() { return this.client.hasHermes() } getStats() { return this.client.getStats() } getNetworkDetails() { return this.client.getNetworkDetails() } + promoteTransport(options?: { preferLan?: boolean }) { return this.client.promoteTransport?.(options) ?? Promise.resolve(false) } checkHealth() { return this.client.checkHealth() } async close(options: { preserveRecovery?: boolean } = {}): Promise {