From f9f498939031fef3a5ef6a4dd80159b0f7736500 Mon Sep 17 00:00:00 2001 From: pikastech Date: Tue, 21 Jul 2026 15:14:29 +0200 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E8=A1=A5=E9=BD=90=20Webterm=20?= =?UTF-8?q?=E4=BD=8E=E9=A2=91=E5=90=8E=E5=8F=B0=E6=A8=A1=E5=BC=8F=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/platform-infra/webterm.yaml | 4 ++++ scripts/src/platform-infra-webterm.ts | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/config/platform-infra/webterm.yaml b/config/platform-infra/webterm.yaml index 695bd1ad..db632607 100644 --- a/config/platform-infra/webterm.yaml +++ b/config/platform-infra/webterm.yaml @@ -54,9 +54,13 @@ browserPerformance: label: 断开后台连接 receive-only: label: 只接收数据 + low-frequency: + label: 低频绘制 live: label: 实时渲染 deferredOutputMaxBytes: 524288 + lowFrequencyRenderIntervalMs: 10000 + lowFrequencyRenderJitterMs: 2000 dashboardSampleWindowSeconds: 60 dashboardRefreshIntervalMs: 1000 diff --git a/scripts/src/platform-infra-webterm.ts b/scripts/src/platform-infra-webterm.ts index 99dd54db..d49a14a8 100644 --- a/scripts/src/platform-infra-webterm.ts +++ b/scripts/src/platform-infra-webterm.ts @@ -66,9 +66,11 @@ interface BrowserOutputPolicy { interface BrowserPerformance { animationsEnabled: boolean; - defaultBackgroundMode: "disconnect" | "receive-only" | "live"; - backgroundModes: Array<{ id: "disconnect" | "receive-only" | "live"; label: string }>; + defaultBackgroundMode: "disconnect" | "receive-only" | "low-frequency" | "live"; + backgroundModes: Array<{ id: "disconnect" | "receive-only" | "low-frequency" | "live"; label: string }>; deferredOutputMaxBytes: number; + lowFrequencyRenderIntervalMs: number; + lowFrequencyRenderJitterMs: number; dashboardSampleWindowSeconds: number; dashboardRefreshIntervalMs: number; } @@ -881,10 +883,10 @@ function parseBrowserOutputPolicy(record: Record, path: string) } function parseBrowserPerformance(record: Record, path: string): BrowserPerformance { - const allowedModes = ["disconnect", "receive-only", "live"] as const; + const allowedModes = ["disconnect", "receive-only", "low-frequency", "live"] as const; const defaultBackgroundMode = stringField(record, "defaultBackgroundMode", path); if (!allowedModes.includes(defaultBackgroundMode as typeof allowedModes[number])) { - throw new Error(`${path}.defaultBackgroundMode must be disconnect, receive-only or live`); + throw new Error(`${path}.defaultBackgroundMode must reference a supported mode`); } const modesRecord = recordField(record, "backgroundModes", path); const backgroundModes = allowedModes.map((id) => ({ @@ -898,6 +900,8 @@ function parseBrowserPerformance(record: Record, path: string): defaultBackgroundMode: defaultBackgroundMode as BrowserPerformance["defaultBackgroundMode"], backgroundModes, deferredOutputMaxBytes: positiveIntegerField(record, "deferredOutputMaxBytes", path), + lowFrequencyRenderIntervalMs: positiveIntegerField(record, "lowFrequencyRenderIntervalMs", path), + lowFrequencyRenderJitterMs: integerField(record, "lowFrequencyRenderJitterMs", path), dashboardSampleWindowSeconds: positiveIntegerField(record, "dashboardSampleWindowSeconds", path), dashboardRefreshIntervalMs: positiveIntegerField(record, "dashboardRefreshIntervalMs", path), }; From c3361278647c7516edc2ecee24f5c0b89f4fbebd Mon Sep 17 00:00:00 2001 From: pikastech Date: Tue, 21 Jul 2026 15:16:23 +0200 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E5=A3=B0=E6=98=8E=20Webterm=20?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E7=BB=88=E7=AB=AF=E6=AF=94=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/platform-infra/webterm.yaml | 1 + scripts/src/platform-infra-webterm.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/config/platform-infra/webterm.yaml b/config/platform-infra/webterm.yaml index db632607..d3339a65 100644 --- a/config/platform-infra/webterm.yaml +++ b/config/platform-infra/webterm.yaml @@ -49,6 +49,7 @@ browserOutputPolicy: browserPerformance: animationsEnabled: true defaultBackgroundMode: receive-only + defaultMobileTerminalPercent: 40 backgroundModes: disconnect: label: 断开后台连接 diff --git a/scripts/src/platform-infra-webterm.ts b/scripts/src/platform-infra-webterm.ts index d49a14a8..f9de54e8 100644 --- a/scripts/src/platform-infra-webterm.ts +++ b/scripts/src/platform-infra-webterm.ts @@ -67,6 +67,7 @@ interface BrowserOutputPolicy { interface BrowserPerformance { animationsEnabled: boolean; defaultBackgroundMode: "disconnect" | "receive-only" | "low-frequency" | "live"; + defaultMobileTerminalPercent: number; backgroundModes: Array<{ id: "disconnect" | "receive-only" | "low-frequency" | "live"; label: string }>; deferredOutputMaxBytes: number; lowFrequencyRenderIntervalMs: number; @@ -898,6 +899,7 @@ function parseBrowserPerformance(record: Record, path: string): return { animationsEnabled: booleanField(record, "animationsEnabled", path), defaultBackgroundMode: defaultBackgroundMode as BrowserPerformance["defaultBackgroundMode"], + defaultMobileTerminalPercent: integerInRangeField(record, "defaultMobileTerminalPercent", path, 20, 70), backgroundModes, deferredOutputMaxBytes: positiveIntegerField(record, "deferredOutputMaxBytes", path), lowFrequencyRenderIntervalMs: positiveIntegerField(record, "lowFrequencyRenderIntervalMs", path), @@ -913,6 +915,12 @@ function positiveIntegerField(record: Record, key: string, path return value; } +function integerInRangeField(record: Record, key: string, path: string, min: number, max: number): number { + const value = integerField(record, key, path); + if (value < min || value > max) throw new Error(`${path}.${key} must be from ${min} to ${max}`); + return value; +} + function parseLiteral(value: string, expected: T, path: string): T { if (value !== expected) throw new Error(`${path} must be ${expected}`); return expected; From ce6468888669511eefd8c330a72499c372c08d0a Mon Sep 17 00:00:00 2001 From: pikastech Date: Tue, 21 Jul 2026 15:18:00 +0200 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E6=B8=B2=E6=9F=93=20Webterm=20?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E6=8F=90=E7=A4=BA=E8=AF=8D=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/src/platform-infra-webterm.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/src/platform-infra-webterm.ts b/scripts/src/platform-infra-webterm.ts index f9de54e8..9c62c2a2 100644 --- a/scripts/src/platform-infra-webterm.ts +++ b/scripts/src/platform-infra-webterm.ts @@ -480,6 +480,7 @@ function renderCompose(target: WebtermTarget): string { ...target.runtime.environment, WEBTERM_DATA_DOMAIN: target.runtime.runtimeDataDomain, WEBTERM_DATABASE_URL: "${WEBTERM_DATABASE_URL}", + AUTO_RESUME_CLI_PROMPT: target.runtime.autoResumePrompt.prompt, AUTO_START_SESSIONS_JSON: JSON.stringify(target.runtime.autoStartSessions.map((session) => ({ ...session, command: resumeCommandWithPrompt(session, target.runtime.autoResumePrompt),