@openchamber/web 1.24.2 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/lib/commands-connect-url.js +3 -8
- package/bin/lib/commands-tunnel.js +3 -0
- package/dist/assets/{CodeMirrorCommentWidgets-B_vBPQYm.js → CodeMirrorCommentWidgets-zm3C1FvM.js} +1 -1
- package/dist/assets/DiffView-DNExNi1z.js +4 -0
- package/dist/assets/FilesView-DUCLmHBi.js +17 -0
- package/dist/assets/{GitView-k0hUF8KB.js → GitView-Bz9z6gZA.js} +4 -4
- package/dist/assets/{GuestAttachDialog-DIf2U85Z.js → GuestAttachDialog-UGp4KDlK.js} +1 -1
- package/dist/assets/GuestSurfacePane-B3pdB_2u.js +1 -0
- package/dist/assets/{JsonTreeView-4AnJ04Pw.js → JsonTreeView-7lVecnZl.js} +1 -1
- package/dist/assets/LinearIssuesView-CTGRS9Vq.js +1 -0
- package/dist/assets/MarkdownImageGallery-DQk5adUs.js +1 -0
- package/dist/assets/MarkdownRendererImpl-DPF8fZpX.js +12 -0
- package/dist/assets/OnboardingScreen-CBx6cXPP.js +1 -0
- package/dist/assets/{PatchDiff-DpGmHRnV.js → PatchDiff-D7VVpR_l.js} +1 -1
- package/dist/assets/{PierreDiffViewer-CgLl_tp7.js → PierreDiffViewer-Gbfks1pk.js} +3 -3
- package/dist/assets/PlanView-CPSK0x97.js +5 -0
- package/dist/assets/PluginPane-BIGsUx69.js +3 -0
- package/dist/assets/SettingsView-Dql7z6Ww.js +30 -0
- package/dist/assets/SettingsWindow-D6oi-UmV.js +1 -0
- package/dist/assets/SubmoduleDiffSummary-BXA0FAWj.js +1 -0
- package/dist/assets/ToolOutputDialog-BQJsSbDm.js +15 -0
- package/dist/assets/ToolPartDiffPreview-FY9w0TVT.js +8 -0
- package/dist/assets/{VirtualizedFileDiff-BK4aU5qJ.js → VirtualizedFileDiff-B9YhAya5.js} +4 -4
- package/dist/assets/{WalkthroughView-Bk6TPNFw.js → WalkthroughView-CmFgOUFN.js} +2 -2
- package/dist/assets/appThemeRegistry-BebxalUt.js +1 -0
- package/dist/assets/changesTree-CePHbFcj.js +1 -0
- package/dist/assets/commitAndPush-Wfxng_IK.js +1 -0
- package/dist/assets/{computeVirtualFileMetrics-BVTujWSX.js → computeVirtualFileMetrics-BCOqgixN.js} +2 -2
- package/dist/assets/de-CMA45TC-.js +10 -0
- package/dist/assets/es-DPL4fBtl.js +16 -0
- package/dist/assets/fr-OHBKBseP.js +14 -0
- package/dist/assets/index-3TiDNtfN.js +1 -0
- package/dist/assets/index-BLUZa5u0.js +41 -0
- package/dist/assets/index-Cm2rrq69.css +1 -0
- package/dist/assets/{isDiffPlainText-D3yX_vx4.js → isDiffPlainText-DnDYQmWK.js} +1 -1
- package/dist/assets/{isFilePlainText-CZR9TcHV.js → isFilePlainText-BA_AHX7d.js} +1 -1
- package/dist/assets/ja-DvX4WSRf.js +16 -0
- package/dist/assets/ko-BUcLd8YZ.js +16 -0
- package/dist/assets/main-B_jri4i-.js +896 -0
- package/dist/assets/main-DtUmJp9B.js +2 -0
- package/dist/assets/{markdown-shiki.worker-CahLvHIq.js → markdown-shiki.worker-Bg8SoAJJ.js} +8 -5
- package/dist/assets/markdownCore-BSnlUXBf.js +7 -0
- package/dist/assets/miniChat-BYfLUnDK.js +2 -0
- package/dist/assets/mobile-DH3hI6gd.js +2 -0
- package/dist/assets/patchFileDiff--L7lt_GZ.js +13 -0
- package/dist/assets/pl-BkI_xHqz.js +16 -0
- package/dist/assets/pt-BR-7wFtQlV9.js +16 -0
- package/dist/assets/renderElectronMiniChatApp-C7kpNW_-.js +2 -0
- package/dist/assets/renderMobileApp-i0nq7Dwy.js +25 -0
- package/dist/assets/runtimeEndpointReset-CfEYbcCc.js +27 -0
- package/dist/assets/scheduledTasksApi-Cy7uZCaI.js +1 -0
- package/dist/assets/{shikiHighlight-BfjuB3CD.js → shikiHighlight-D4vxipfr.js} +1 -1
- package/dist/assets/{textMateThemeFromAppTheme-BP60t9SX.js → textMateThemeFromAppTheme-BYAHtJwQ.js} +1 -1
- package/dist/assets/tr-TsD-AqEH.js +7 -0
- package/dist/assets/uk-B-qspCmD.js +16 -0
- package/dist/assets/useAppFontEffects-DHZ9-L30.js +7338 -0
- package/dist/assets/useInlineCommentController-CvpOMK-R.js +2 -0
- package/dist/assets/useRootScrollLock-DzNFi-fn.js +2 -0
- package/dist/assets/{vendor-codemirror-language-data-BFm1Ju2w.js → vendor-codemirror-language-data-j3fhlwUM.js} +2 -2
- package/dist/assets/vendor-cron-parser-CjvYVigk.js +2 -0
- package/dist/assets/vendor-opencode-client-DYdsLbCM.js +12 -0
- package/dist/assets/{vendor-remixicon-react-BDmGmFCA.js → vendor-remixicon-react-D6dZ0UwF.js} +1 -1
- package/dist/assets/vendor-zod-BSoePkpP.js +39 -0
- package/dist/assets/{web-components-2vo9YsZc.js → web-components-BvHNFSEG.js} +2 -2
- package/dist/assets/zh-CN-DYuPJV5i.js +16 -0
- package/dist/assets/zh-TW-BX_2D_lV.js +16 -0
- package/dist/index.html +13 -7
- package/dist/mini-chat.html +5 -5
- package/dist/mobile.html +5 -5
- package/package.json +6 -5
- package/server/index.d.ts +1 -0
- package/server/index.js +264 -91
- package/server/lib/agent-tool/DOCUMENTATION.md +38 -16
- package/server/lib/agent-tool/runtime.js +167 -58
- package/server/lib/agent-tool/runtime.test.js +170 -87
- package/server/lib/browser-control/DOCUMENTATION.md +51 -4
- package/server/lib/browser-control/provider.js +217 -0
- package/server/lib/browser-control/provider.test.js +251 -0
- package/server/lib/context-obligatory/runtime.js +61 -50
- package/server/lib/context-obligatory/runtime.test.js +62 -162
- package/server/lib/event-stream/DOCUMENTATION.md +12 -1
- package/server/lib/event-stream/delta-coalescer.js +0 -0
- package/server/lib/event-stream/delta-coalescer.test.js +68 -57
- package/server/lib/event-stream/directory-ws-bridge.js +1 -1
- package/server/lib/event-stream/global-hub.js +10 -1
- package/server/lib/event-stream/global-hub.test.js +27 -26
- package/server/lib/event-stream/index.js +6 -0
- package/server/lib/event-stream/protocol.js +26 -19
- package/server/lib/event-stream/protocol.test.js +18 -7
- package/server/lib/event-stream/rebind.test.js +5 -5
- package/server/lib/event-stream/runtime.test.js +17 -15
- package/server/lib/event-stream/translate-v2.js +313 -0
- package/server/lib/event-stream/translate-v2.test.js +209 -0
- package/server/lib/event-stream/upstream-reader.test.js +16 -16
- package/server/lib/fs/DOCUMENTATION.md +4 -2
- package/server/lib/fs/byte-range.js +35 -0
- package/server/lib/fs/byte-range.test.js +31 -0
- package/server/lib/fs/routes.js +47 -42
- package/server/lib/fs/routes.test.js +123 -18
- package/server/lib/git/DOCUMENTATION.md +1 -1
- package/server/lib/git/service.js +34 -0
- package/server/lib/git/service.test.js +8 -0
- package/server/lib/github/DOCUMENTATION.md +1 -1
- package/server/lib/github/pr-status.js +22 -2
- package/server/lib/github/pr-status.test.js +27 -14
- package/server/lib/guests/DOCUMENTATION.md +16 -2
- package/server/lib/guests/catalog.js +31 -1
- package/server/lib/guests/catalog.test.js +55 -0
- package/server/lib/guests/html-styles.js +5 -3
- package/server/lib/guests/html-styles.test.js +3 -1
- package/server/lib/guests/routes.js +21 -4
- package/server/lib/guests/service.js +197 -14
- package/server/lib/guests/service.test.js +201 -1
- package/server/lib/guests/surface.js +676 -0
- package/server/lib/guests/surface.test.js +536 -0
- package/server/lib/markdown-image-grants/routes.js +18 -5
- package/server/lib/markdown-image-grants/routes.test.js +9 -6
- package/server/lib/message-queue/DOCUMENTATION.md +33 -22
- package/server/lib/message-queue/runtime.js +155 -100
- package/server/lib/message-queue/runtime.test.js +168 -82
- package/server/lib/notifications/DOCUMENTATION.md +38 -0
- package/server/lib/notifications/control-stream.http.test.js +68 -0
- package/server/lib/notifications/emit-route.js +118 -0
- package/server/lib/notifications/emit-route.test.js +112 -0
- package/server/lib/notifications/emitter-runtime.js +15 -0
- package/server/lib/notifications/emitter-runtime.test.js +32 -0
- package/server/lib/notifications/push-runtime.js +5 -1
- package/server/lib/notifications/push-runtime.test.js +2 -2
- package/server/lib/notifications/routes.js +1 -1
- package/server/lib/notifications/runtime.js +115 -26
- package/server/lib/notifications/template-runtime.js +13 -15
- package/server/lib/notifications/template-runtime.test.js +16 -9
- package/server/lib/notifications/trigger-runtime.test.js +187 -0
- package/server/lib/openchamber-control/DOCUMENTATION.md +10 -0
- package/server/lib/openchamber-control/actions.js +19 -4
- package/server/lib/openchamber-control/error.js +1 -1
- package/server/lib/openchamber-control/file-open.js +59 -0
- package/server/lib/openchamber-control/file-open.test.js +57 -0
- package/server/lib/openchamber-control/routes.test.js +12 -0
- package/server/lib/openchamber-control/service.js +125 -49
- package/server/lib/openchamber-control/service.test.js +115 -44
- package/server/lib/openchamber-sessions/archive-store.js +224 -0
- package/server/lib/openchamber-sessions/archive-store.test.js +187 -0
- package/server/lib/openchamber-sessions/fork-inheritance.js +103 -0
- package/server/lib/openchamber-sessions/fork-inheritance.test.js +69 -0
- package/server/lib/openchamber-sessions/opencode-client.js +22 -0
- package/server/lib/openchamber-sessions/routes.js +409 -328
- package/server/lib/openchamber-sessions/routes.test.js +795 -740
- package/server/lib/openchamber-sessions/session-metadata-store.js +285 -0
- package/server/lib/openchamber-sessions/session-metadata-store.test.js +259 -0
- package/server/lib/opencode/DOCUMENTATION.md +458 -29
- package/server/lib/opencode/agents.js +233 -327
- package/server/lib/opencode/auth.js +41 -44
- package/server/lib/opencode/auth.test.js +92 -0
- package/server/lib/opencode/bootstrap-runtime.js +12 -0
- package/server/lib/opencode/cli-upgrade.d.ts +4 -0
- package/server/lib/opencode/cli-upgrade.js +18 -0
- package/server/lib/opencode/cli-upgrade.test.js +36 -0
- package/server/lib/opencode/commands.js +164 -145
- package/server/lib/opencode/compatibility.d.ts +16 -0
- package/server/lib/opencode/compatibility.js +91 -0
- package/server/lib/opencode/compatibility.test.js +70 -0
- package/server/lib/opencode/config-entity-routes.js +58 -29
- package/server/lib/opencode/config-entity-v2.test.js +290 -0
- package/server/lib/opencode/config-mutation-response.js +17 -7
- package/server/lib/opencode/config-mutation-response.test.js +4 -7
- package/server/lib/opencode/config-paths.test.js +2 -2
- package/server/lib/opencode/config-v2.d.ts +185 -0
- package/server/lib/opencode/config-v2.js +843 -0
- package/server/lib/opencode/config-v2.test.js +483 -0
- package/server/lib/opencode/core-routes.js +3 -0
- package/server/lib/opencode/core-routes.test.js +15 -0
- package/server/lib/opencode/credential-db.js +144 -0
- package/server/lib/opencode/credential-db.test.js +104 -0
- package/server/lib/opencode/env-runtime.js +47 -15
- package/server/lib/opencode/env-runtime.test.js +45 -0
- package/server/lib/opencode/feature-routes-runtime.js +16 -5
- package/server/lib/opencode/lifecycle-process.test.js +7 -4
- package/server/lib/opencode/lifecycle.js +113 -30
- package/server/lib/opencode/lifecycle.test.js +107 -8
- package/server/lib/opencode/login-shell-env.js +27 -0
- package/server/lib/opencode/managed-config-file.js +131 -0
- package/server/lib/opencode/managed-config-file.test.js +168 -0
- package/server/lib/opencode/managed-plugin-config.js +33 -13
- package/server/lib/opencode/mcp.js +43 -149
- package/server/lib/opencode/network-runtime.js +6 -7
- package/server/lib/opencode/openchamber-routes.js +29 -11
- package/server/lib/opencode/openchamber-routes.test.js +18 -1
- package/server/lib/opencode/plugin-routes.js +3 -3
- package/server/lib/opencode/plugin-routes.test.js +6 -24
- package/server/lib/opencode/plugins.js +91 -40
- package/server/lib/opencode/plugins.test.js +28 -15
- package/server/lib/opencode/provider-source-route.test.js +59 -0
- package/server/lib/opencode/providers.js +66 -83
- package/server/lib/opencode/providers.test.js +190 -59
- package/server/lib/opencode/proxy-agent-wiring.test.js +4 -2
- package/server/lib/opencode/proxy.js +179 -129
- package/server/lib/opencode/pwa-manifest-routes.js +4 -2
- package/server/lib/opencode/pwa-manifest-routes.test.js +3 -2
- package/server/lib/opencode/response-envelope.js +14 -0
- package/server/lib/opencode/response-envelope.test.js +23 -0
- package/server/lib/opencode/routes-upgrade.test.js +73 -116
- package/server/lib/opencode/routes.js +138 -428
- package/server/lib/opencode/server-utils-runtime.js +10 -4
- package/server/lib/opencode/session-activity.js +78 -0
- package/server/lib/opencode/session-runtime.js +21 -10
- package/server/lib/opencode/session-runtime.test.js +9 -9
- package/server/lib/opencode/settings-helpers.js +15 -8
- package/server/lib/opencode/settings-helpers.test.js +7 -12
- package/server/lib/opencode/settings-registry.json +20 -8
- package/server/lib/opencode/settings-runtime.js +19 -1
- package/server/lib/opencode/settings-runtime.test.js +31 -2
- package/server/lib/opencode/shared.js +86 -24
- package/server/lib/opencode/shared.test.js +87 -5
- package/server/lib/opencode/shutdown-runtime.js +54 -7
- package/server/lib/opencode/shutdown-runtime.test.js +224 -30
- package/server/lib/opencode/skill-routes.js +51 -36
- package/server/lib/opencode/skill-routes.test.js +121 -1
- package/server/lib/opencode/skills.js +7 -5
- package/server/lib/opencode/tunnel-wiring-runtime.js +2 -1
- package/server/lib/opencode/upgrade-capability.js +0 -14
- package/server/lib/opencode/upgrade-capability.test.js +1 -1
- package/server/lib/opencode/v1-migration-topup.js +294 -0
- package/server/lib/opencode/v1-migration-topup.test.js +274 -0
- package/server/lib/opencode/v2-install.d.ts +9 -0
- package/server/lib/opencode/v2-install.js +159 -0
- package/server/lib/opencode/v2-install.test.js +133 -0
- package/server/lib/opencode/watcher.js +10 -3
- package/server/lib/opencode/watcher.test.js +17 -21
- package/server/lib/opencode/websearch-config.js +78 -0
- package/server/lib/permission-auto-accept/runtime.js +38 -22
- package/server/lib/permission-auto-accept/runtime.test.js +39 -17
- package/server/lib/quota/DOCUMENTATION.md +4 -0
- package/server/lib/quota/providers/kimi.js +1 -1
- package/server/lib/quota/providers/xai.js +4 -4
- package/server/lib/relay/tunnel-host.js +4 -1
- package/server/lib/relay/tunnel-host.test.js +7 -0
- package/server/lib/routing/DOCUMENTATION.md +52 -21
- package/server/lib/routing/defaults.js +23 -6
- package/server/lib/routing/jev.js +17 -7
- package/server/lib/routing/routes.http.test.js +68 -33
- package/server/lib/routing/routes.js +65 -22
- package/server/lib/routing/runtime.js +145 -48
- package/server/lib/routing/runtime.test.js +79 -55
- package/server/lib/scheduled-tasks/DOCUMENTATION.md +4 -0
- package/server/lib/scheduled-tasks/issue-2710-double-execution.test.js +51 -46
- package/server/lib/scheduled-tasks/runtime.js +81 -74
- package/server/lib/scheduled-tasks/runtime.test.js +53 -1
- package/server/lib/session-assist/DOCUMENTATION.md +25 -8
- package/server/lib/session-assist/context.js +122 -46
- package/server/lib/session-assist/context.test.js +117 -49
- package/server/lib/session-assist/runtime.js +71 -24
- package/server/lib/session-assist/runtime.test.js +153 -173
- package/server/lib/session-goal/DOCUMENTATION.md +34 -15
- package/server/lib/session-goal/create.js +9 -12
- package/server/lib/session-goal/create.test.js +27 -28
- package/server/lib/session-goal/runtime.js +164 -77
- package/server/lib/session-goal/runtime.test.js +271 -519
- package/server/lib/session-knowledge/DOCUMENTATION.md +5 -0
- package/server/lib/session-knowledge/runtime.js +59 -41
- package/server/lib/session-knowledge/runtime.test.js +90 -20
- package/server/lib/small-model/DOCUMENTATION.md +154 -208
- package/server/lib/small-model/client.js +113 -0
- package/server/lib/small-model/index.js +296 -158
- package/server/lib/small-model/index.test.js +423 -256
- package/server/lib/small-model/routes.js +1 -1
- package/server/lib/spaces/DOCUMENTATION.md +807 -0
- package/server/lib/spaces/code-in-bait.js +185 -0
- package/server/lib/spaces/code-in.js +641 -0
- package/server/lib/spaces/code-in.test.js +1048 -0
- package/server/lib/spaces/errors.js +8 -0
- package/server/lib/spaces/exec-http.js +94 -0
- package/server/lib/spaces/gatekeeper-channel.js +202 -0
- package/server/lib/spaces/gatekeeper-channel.test.js +215 -0
- package/server/lib/spaces/gatekeeper-program.cjs +914 -0
- package/server/lib/spaces/gatekeeper-program.test.js +1391 -0
- package/server/lib/spaces/hardening.js +457 -0
- package/server/lib/spaces/hardening.test.js +368 -0
- package/server/lib/spaces/host-git.js +127 -0
- package/server/lib/spaces/host-git.test.js +137 -0
- package/server/lib/spaces/labels.js +234 -0
- package/server/lib/spaces/labels.test.js +219 -0
- package/server/lib/spaces/layout.js +184 -0
- package/server/lib/spaces/layout.test.js +30 -0
- package/server/lib/spaces/manager.js +82 -0
- package/server/lib/spaces/manager.test.js +114 -0
- package/server/lib/spaces/places/code-in.docker.live.test.js +216 -0
- package/server/lib/spaces/places/contract-suite.js +156 -0
- package/server/lib/spaces/places/contract.docker.live.test.js +7 -0
- package/server/lib/spaces/places/contract.test.js +6 -0
- package/server/lib/spaces/places/docker-engine.js +126 -0
- package/server/lib/spaces/places/docker-live-support.js +202 -0
- package/server/lib/spaces/places/docker-tools.js +186 -0
- package/server/lib/spaces/places/docker.js +587 -0
- package/server/lib/spaces/places/docker.test.js +1610 -0
- package/server/lib/spaces/places/escape-suite.js +1018 -0
- package/server/lib/spaces/places/escape.docker.live.test.js +7 -0
- package/server/lib/spaces/places/fake-docker.js +375 -0
- package/server/lib/spaces/places/memory-place.js +103 -0
- package/server/lib/spaces/places/packed.docker.live.test.js +77 -0
- package/server/lib/spaces/places/registry.js +43 -0
- package/server/lib/spaces/places/registry.test.js +50 -0
- package/server/lib/spaces/places/server.docker.live.test.js +225 -0
- package/server/lib/spaces/run-command.js +261 -0
- package/server/lib/spaces/run-command.test.js +396 -0
- package/server/lib/spaces/space-server.js +190 -0
- package/server/lib/spaces/space-server.test.js +335 -0
- package/server/lib/spaces/tools-filler.js +82 -0
- package/server/lib/spaces/tools-filler.test.js +148 -0
- package/server/lib/spaces/tools-pack.js +49 -0
- package/server/lib/spaces/tools-pack.test.js +57 -0
- package/server/lib/spaces/tools.js +137 -0
- package/server/lib/spaces/tools.test.js +153 -0
- package/server/lib/tts/openai-sdk.js +11 -0
- package/server/lib/tts/service.js +7 -5
- package/server/lib/tts/stt.js +3 -2
- package/server/lib/tunnels/DOCUMENTATION.md +2 -0
- package/server/lib/tunnels/routes.js +7 -0
- package/server/lib/tunnels/routes.test.js +55 -0
- package/server/lib/ui-auth/ui-auth.js +38 -2
- package/server/lib/ui-auth/ui-auth.test.js +42 -0
- package/server/lib/ui-auth/ui-passkeys.js +12 -10
- package/server/lib/walkthrough/DOCUMENTATION.md +10 -1
- package/server/lib/walkthrough/pull-request.js +61 -8
- package/server/lib/walkthrough/pull-request.test.js +54 -1
- package/server/lib/walkthrough/routes.js +20 -0
- package/server/lib/walkthrough/routes.test.js +19 -0
- package/server/opencode-proxy.test.js +190 -166
- package/server/opencode-worktree-readiness.test.js +5 -4
- package/dist/assets/DiffView-Ce0oBXXQ.js +0 -4
- package/dist/assets/FilesView-DtXueAWP.js +0 -13
- package/dist/assets/LinearIssuesView-z_9p2GuO.js +0 -1
- package/dist/assets/MarkdownImageGallery-BC-BNN-s.js +0 -1
- package/dist/assets/MarkdownRendererImpl-DyaBTUbH.js +0 -12
- package/dist/assets/OnboardingScreen-DKU_yTb6.js +0 -1
- package/dist/assets/PlanView-CrfB4qqY.js +0 -5
- package/dist/assets/PluginPane-B5cn-jPy.js +0 -3
- package/dist/assets/SettingsView-DMKKwezx.js +0 -29
- package/dist/assets/SettingsWindow-DwbnVzOC.js +0 -1
- package/dist/assets/SubmoduleDiffSummary-hkGcvs0E.js +0 -1
- package/dist/assets/ToolOutputDialog-DuoIOc0j.js +0 -15
- package/dist/assets/ToolPartDiffPreview-t1Bvq_2Y.js +0 -8
- package/dist/assets/appThemeRegistry-DnOVbJjF.js +0 -1
- package/dist/assets/commitAndPush-DLWNZkkY.js +0 -1
- package/dist/assets/de-zEHaAIi3.js +0 -10
- package/dist/assets/es-CBDgEzgk.js +0 -16
- package/dist/assets/fr-DjiTptT_.js +0 -14
- package/dist/assets/index-AgOdanig.css +0 -1
- package/dist/assets/index-B-2_X4DD.js +0 -40
- package/dist/assets/index-CkA4p2IK.js +0 -1
- package/dist/assets/ja-CerMgj3r.js +0 -16
- package/dist/assets/ko-DHYDAze5.js +0 -16
- package/dist/assets/main-BDka4W43.js +0 -896
- package/dist/assets/main-Dl7Dyge_.js +0 -2
- package/dist/assets/markdownCore-DFmr0rUR.js +0 -5
- package/dist/assets/miniChat-CLKQPPpO.js +0 -2
- package/dist/assets/mobile--giD2Q1L.js +0 -2
- package/dist/assets/patchFileDiff-DRh-AQvd.js +0 -13
- package/dist/assets/pl-BTB_93bq.js +0 -16
- package/dist/assets/pt-BR-BwA3oyCK.js +0 -16
- package/dist/assets/renderElectronMiniChatApp-DmB7zpVK.js +0 -2
- package/dist/assets/renderMobileApp-pMfOuQfl.js +0 -25
- package/dist/assets/runtimeEndpointReset-Gqhmkm3U.js +0 -25
- package/dist/assets/scheduledTasksApi-CeRAIUmW.js +0 -1
- package/dist/assets/tr-CcPsJoNM.js +0 -7
- package/dist/assets/uk-B68WibXi.js +0 -16
- package/dist/assets/useAppFontEffects-DcdrFv2Z.js +0 -7333
- package/dist/assets/useInlineCommentController-Cq4SUjsA.js +0 -2
- package/dist/assets/useRootScrollLock-CSdR6Wnm.js +0 -2
- package/dist/assets/vendor-cron-parser-CUcP7OfX.js +0 -2
- package/dist/assets/vendor-opencode-sdk-BJ73u-bH.js +0 -7
- package/dist/assets/vendor-zod-CgAdXWZO.js +0 -39
- package/dist/assets/zh-CN-DbFHYXwP.js +0 -16
- package/dist/assets/zh-TW-DmXAwdty.js +0 -16
- package/server/lib/opencode/mcp-oauth-callback.test.js +0 -111
- package/server/lib/routing/feature-flag.js +0 -11
- package/server/lib/small-model/call.js +0 -851
- package/server/lib/small-model/call.test.js +0 -1292
- package/server/lib/small-model/catalog.js +0 -13
- package/server/lib/small-model/resolve.js +0 -131
- package/server/lib/small-model/resolve.test.js +0 -197
- package/server/lib/small-model/runtime-providers.js +0 -164
- package/server/lib/small-model/runtime-providers.test.js +0 -118
- package/server/lib/system-prompt/DOCUMENTATION.md +0 -36
- package/server/lib/system-prompt/runtime.js +0 -49
- package/server/lib/system-prompt/runtime.test.js +0 -76
- package/server/lib/walkthrough/reproduce-2607.test.js +0 -148
package/server/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { installOpenCodeV2, supportsOpenCodeV2Install } from './lib/opencode/v2-install.js';
|
|
2
|
+
import { describeOpenCodeCompatibility, readOpenCodeCliVersion, readExternalOpenCodeVersion } from './lib/opencode/compatibility.js';
|
|
1
3
|
import 'reflect-metadata';
|
|
2
4
|
import express from 'express';
|
|
3
5
|
import compression from 'compression';
|
|
@@ -41,6 +43,7 @@ import { createTerminalRuntime } from './lib/terminal/runtime.js';
|
|
|
41
43
|
import { createDictationRuntime } from './lib/dictation/runtime.js';
|
|
42
44
|
import {
|
|
43
45
|
createGlobalUiEventBroadcaster,
|
|
46
|
+
translateWireEvent,
|
|
44
47
|
createGlobalMessageStreamHub,
|
|
45
48
|
createMessageStreamWsRuntime,
|
|
46
49
|
resolveDeltaCoalesceWindowMs,
|
|
@@ -50,6 +53,7 @@ import {
|
|
|
50
53
|
import { createFsSearchRuntime as createFsSearchRuntimeFactory } from './lib/fs/search.js';
|
|
51
54
|
import { createOpenCodeLifecycleRuntime } from './lib/opencode/lifecycle.js';
|
|
52
55
|
import { createOpenCodeEnvRuntime } from './lib/opencode/env-runtime.js';
|
|
56
|
+
import { providedLoginShellEnvSnapshot } from './lib/opencode/login-shell-env.js';
|
|
53
57
|
import { resolveOpenCodeEnvConfig } from './lib/opencode/env-config.js';
|
|
54
58
|
import { createHmrStateRuntime } from './lib/opencode/hmr-state-runtime.js';
|
|
55
59
|
import { createOpenCodeNetworkRuntime } from './lib/opencode/network-runtime.js';
|
|
@@ -70,10 +74,11 @@ import { createServerUtilsRuntime } from './lib/opencode/server-utils-runtime.js
|
|
|
70
74
|
import { createStaticRoutesRuntime } from './lib/opencode/static-routes-runtime.js';
|
|
71
75
|
import { createSettingsRuntime } from './lib/opencode/settings-runtime.js';
|
|
72
76
|
import { createOpenCodeResolutionRuntime } from './lib/opencode/opencode-resolution-runtime.js';
|
|
77
|
+
import { runOpenCodeCliUpgrade } from './lib/opencode/cli-upgrade.js';
|
|
73
78
|
import { resolveOpenCodeUpgradeCapability } from './lib/opencode/upgrade-capability.js';
|
|
74
79
|
import { createBootstrapRuntime } from './lib/opencode/bootstrap-runtime.js';
|
|
75
80
|
import { createSessionRuntime } from './lib/opencode/session-runtime.js';
|
|
76
|
-
import { configureOpenCodeRuntimeProviders, resetOpenCodeRuntimeProviders } from './lib/small-model/
|
|
81
|
+
import { configureOpenCodeRuntimeProviders, resetOpenCodeRuntimeProviders } from './lib/small-model/client.js';
|
|
77
82
|
import { createOpenCodeWatcherRuntime } from './lib/opencode/watcher.js';
|
|
78
83
|
import { createSessionAssistRuntime } from './lib/session-assist/runtime.js';
|
|
79
84
|
import { createSessionGoalRuntime } from './lib/session-goal/runtime.js';
|
|
@@ -95,7 +100,11 @@ import { createPermissionAutoAcceptRuntime } from './lib/permission-auto-accept/
|
|
|
95
100
|
import { createMessageQueueRuntime } from './lib/message-queue/runtime.js';
|
|
96
101
|
import { createRoutingRuntime } from './lib/routing/runtime.js';
|
|
97
102
|
import { createGracefulShutdownRuntime } from './lib/opencode/shutdown-runtime.js';
|
|
98
|
-
import { stopAllGuestServices } from './lib/guests/service.js';
|
|
103
|
+
import { beginGuestServiceHost, beginGuestServiceShutdown, stopAllGuestServices } from './lib/guests/service.js';
|
|
104
|
+
import { findInstalledGuest } from './lib/guests/catalog.js';
|
|
105
|
+
import { extensionsPersistPath } from './lib/guests/persist.js';
|
|
106
|
+
import { createGuestSurfaceRuntime } from './lib/guests/surface.js';
|
|
107
|
+
import { BROWSER_PROVIDER_IDLE_MS } from '@openchamber/sdk';
|
|
99
108
|
import { createProjectConfigRuntime } from './lib/projects/project-config.js';
|
|
100
109
|
import { migrateLegacyUserDirs } from './lib/data-dir-migration.js';
|
|
101
110
|
import { createProjectContextRuntime } from './lib/project-context/runtime.js';
|
|
@@ -111,15 +120,18 @@ import { createRelayService } from './lib/relay/service.js';
|
|
|
111
120
|
import { createRelayHostLock } from './lib/relay/host-lock.js';
|
|
112
121
|
import { createAgentToolRuntime } from './lib/agent-tool/runtime.js';
|
|
113
122
|
import { createBrowserControlBroker } from './lib/browser-control/broker.js';
|
|
123
|
+
import { createBrowserControlRouter } from './lib/browser-control/provider.js';
|
|
114
124
|
import { createDevServerScanner } from './lib/dev-servers/routes.js';
|
|
115
125
|
import { createDevTunnelRuntime } from './lib/dev-tunnel/runtime.js';
|
|
116
126
|
import { registerBrowserControlRoutes } from './lib/browser-control/routes.js';
|
|
117
|
-
import {
|
|
127
|
+
import { createManagedConfigRuntime } from './lib/opencode/managed-config-file.js';
|
|
118
128
|
import { createOpenChamberSessionService } from './lib/openchamber-sessions/routes.js';
|
|
129
|
+
import { createSessionMetadataStore, createOpenCodeSessionMetadata } from './lib/openchamber-sessions/session-metadata-store.js';
|
|
119
130
|
import { createScheduledTaskService } from './lib/scheduled-tasks/service.js';
|
|
120
131
|
import { createOpenChamberControlService } from './lib/openchamber-control/service.js';
|
|
132
|
+
import { createPluginNotificationEmitter } from './lib/notifications/emit-route.js';
|
|
121
133
|
import { OpenChamberControlError } from './lib/openchamber-control/error.js';
|
|
122
|
-
import
|
|
134
|
+
import { createFileOpenRequester } from './lib/openchamber-control/file-open.js';
|
|
123
135
|
import { applyConnectAttemptTimeout } from './lib/network-defaults.js';
|
|
124
136
|
|
|
125
137
|
// Background CLI launches enter here in a fresh process, without CLI defaults.
|
|
@@ -305,7 +317,7 @@ const deleteImportedTheme = (...args) => themeRuntime.deleteImportedTheme(...arg
|
|
|
305
317
|
|
|
306
318
|
let notificationTemplateRuntime = null;
|
|
307
319
|
let agentToolRuntime = null;
|
|
308
|
-
let
|
|
320
|
+
let managedConfigRuntime = null;
|
|
309
321
|
|
|
310
322
|
const createTimeoutSignal = (...args) => notificationTemplateRuntime.createTimeoutSignal(...args);
|
|
311
323
|
const formatProjectLabel = (...args) => notificationTemplateRuntime.formatProjectLabel(...args);
|
|
@@ -399,6 +411,7 @@ const settingsRuntime = createSettingsRuntime({
|
|
|
399
411
|
normalizeManagedRemoteTunnelPresetTokens,
|
|
400
412
|
syncManagedRemoteTunnelConfigWithPresets,
|
|
401
413
|
upsertManagedRemoteTunnelToken,
|
|
414
|
+
onManagedPluginSettingsChanged: () => managedConfigRuntime?.refreshManagedConfigFile(),
|
|
402
415
|
});
|
|
403
416
|
|
|
404
417
|
const readSettingsFromDiskMigrated = (...args) => settingsRuntime.readSettingsFromDiskMigrated(...args);
|
|
@@ -416,7 +429,7 @@ const getUiSessionTokenFromRequest = (...args) => requestSecurityRuntime.getUiSe
|
|
|
416
429
|
const pushRuntime = createPushRuntime({
|
|
417
430
|
fsPromises,
|
|
418
431
|
path,
|
|
419
|
-
|
|
432
|
+
loadWebPush: () => import('web-push').then((module) => module.default),
|
|
420
433
|
PUSH_SUBSCRIPTIONS_FILE_PATH,
|
|
421
434
|
readSettingsFromDiskMigrated,
|
|
422
435
|
writeSettingsToDisk,
|
|
@@ -469,6 +482,7 @@ const notificationEmitterRuntime = createNotificationEmitterRuntime({
|
|
|
469
482
|
getDesktopNotifyEnabled: () => ENV_DESKTOP_NOTIFY,
|
|
470
483
|
desktopNotifyPrefix: DESKTOP_NOTIFY_PREFIX,
|
|
471
484
|
getUiNotificationClients: () => uiNotificationClients,
|
|
485
|
+
getOpenChamberEventClients: () => uiOpenChamberEventClients,
|
|
472
486
|
getBroadcastGlobalUiEvent: () => broadcastGlobalUiEvent,
|
|
473
487
|
});
|
|
474
488
|
|
|
@@ -481,6 +495,51 @@ const broadcastGlobalUiEvent = createGlobalUiEventBroadcaster({
|
|
|
481
495
|
});
|
|
482
496
|
const broadcastUiNotification = (...args) => notificationEmitterRuntime.broadcastUiNotification(...args);
|
|
483
497
|
|
|
498
|
+
// OpenChamber-owned events (queue changes, archive state) travel on the shared
|
|
499
|
+
// control stream, not on OpenCode's event proxy. One broadcaster so every owner
|
|
500
|
+
// reaches the same clients.
|
|
501
|
+
const broadcastOpenChamberUiEvent = createGlobalUiEventBroadcaster({
|
|
502
|
+
sseClients: uiOpenChamberEventClients,
|
|
503
|
+
wsClients: uiNotificationWsClients,
|
|
504
|
+
writeSseEvent,
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Per-session OpenChamber state (goal progress, the assist recap, the
|
|
509
|
+
* obligatory-context cursor, pinned notes) lives in OpenCode's session
|
|
510
|
+
* metadata. The store merge-patches it there and migrates what older
|
|
511
|
+
* OpenChamber versions kept in `sessions-metadata.json`.
|
|
512
|
+
*/
|
|
513
|
+
const sessionMetadataStore = createSessionMetadataStore({
|
|
514
|
+
dataDir: OPENCHAMBER_DATA_DIR,
|
|
515
|
+
// Called, not captured: the OpenCode URL and auth helpers are declared
|
|
516
|
+
// further down and only ever used once a request arrives.
|
|
517
|
+
openCode: {
|
|
518
|
+
read: (...args) => createOpenCodeSessionMetadata({ buildOpenCodeUrl, getOpenCodeAuthHeaders }).read(...args),
|
|
519
|
+
write: (...args) => createOpenCodeSessionMetadata({ buildOpenCodeUrl, getOpenCodeAuthHeaders }).write(...args),
|
|
520
|
+
},
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
const readStoredSessionMetadata = (sessionID) => sessionMetadataStore.get(sessionID);
|
|
524
|
+
|
|
525
|
+
const persistSessionMetadataPatch = async (sessionID, patch, { directory = '' } = {}) => {
|
|
526
|
+
const metadata = await sessionMetadataStore.setSessionMetadata(sessionID, patch, { directory });
|
|
527
|
+
// The full merged object, so a client that missed an earlier patch does not
|
|
528
|
+
// have to reconstruct it.
|
|
529
|
+
broadcastOpenChamberUiEvent({
|
|
530
|
+
type: 'openchamber:session-metadata',
|
|
531
|
+
properties: { sessionID, metadata },
|
|
532
|
+
});
|
|
533
|
+
// The write itself arms the goal loop: it is the authoritative signal and
|
|
534
|
+
// does not depend on the event stream being connected.
|
|
535
|
+
// Called, not captured: the runtime is declared further down.
|
|
536
|
+
if (patch?.openchamber && 'goal' in patch.openchamber) {
|
|
537
|
+
void Promise.resolve(sessionGoalRuntime.notifyGoalChanged(sessionID, directory, metadata))
|
|
538
|
+
.catch((error) => console.warn('[session-goal] could not arm after a goal change:', error?.message ?? error));
|
|
539
|
+
}
|
|
540
|
+
return metadata;
|
|
541
|
+
};
|
|
542
|
+
|
|
484
543
|
const sessionRuntime = createSessionRuntime({
|
|
485
544
|
writeSseEvent,
|
|
486
545
|
getNotificationClients: () => uiNotificationClients,
|
|
@@ -583,6 +642,12 @@ let runtimeManagedRemoteTunnelToken = '';
|
|
|
583
642
|
let runtimeManagedRemoteTunnelHostname = '';
|
|
584
643
|
let terminalRuntime = null;
|
|
585
644
|
let dictationRuntime = null;
|
|
645
|
+
// Built once the HTTP server exists (it hooks `upgrade`); the browser
|
|
646
|
+
// provider router is built earlier and reaches it through this holder.
|
|
647
|
+
let guestSurfaceRuntime = null;
|
|
648
|
+
let realtimeProxyRuntime = null;
|
|
649
|
+
let relayServiceInstance = null;
|
|
650
|
+
let relayReconcileTimer = null;
|
|
586
651
|
let messageStreamRuntime = null;
|
|
587
652
|
const userProvidedOpenCodePassword = hmrStateRuntime.getUserProvidedOpenCodePassword(hmrState);
|
|
588
653
|
const initialOpenCodeAuthState = hmrStateRuntime.resolveOpenCodeAuthFromState({
|
|
@@ -739,6 +804,7 @@ const openCodeEnvRuntime = createOpenCodeEnvRuntime({
|
|
|
739
804
|
state: openCodeEnvState,
|
|
740
805
|
normalizeDirectoryPath,
|
|
741
806
|
readSettingsFromDiskMigrated,
|
|
807
|
+
providedLoginShellEnvSnapshot,
|
|
742
808
|
});
|
|
743
809
|
|
|
744
810
|
const applyLoginShellEnvSnapshot = (...args) => openCodeEnvRuntime.applyLoginShellEnvSnapshot(...args);
|
|
@@ -800,6 +866,7 @@ const notificationTriggerRuntime = createNotificationTriggerRuntime({
|
|
|
800
866
|
isAnyInteractiveClientVisible,
|
|
801
867
|
buildOpenCodeUrl,
|
|
802
868
|
getOpenCodeAuthHeaders,
|
|
869
|
+
readSessionMetadata: readStoredSessionMetadata,
|
|
803
870
|
});
|
|
804
871
|
|
|
805
872
|
const maybeSendPushForTrigger = (...args) => notificationTriggerRuntime.maybeSendPushForTrigger(...args);
|
|
@@ -810,12 +877,19 @@ const sessionAssistRuntime = createSessionAssistRuntime({
|
|
|
810
877
|
buildOpenCodeUrl,
|
|
811
878
|
getOpenCodeAuthHeaders,
|
|
812
879
|
getSmallModelService: async () => import('./lib/small-model/index.js'),
|
|
880
|
+
persistSessionAssist: (sessionID, directory, assist) =>
|
|
881
|
+
persistSessionMetadataPatch(sessionID, { openchamber: { assist } }, { directory }),
|
|
882
|
+
// Declared further down; only ever called after startup.
|
|
883
|
+
isSessionArchived: (sessionID) => openChamberSessionService.archiveStore.isArchived(sessionID),
|
|
813
884
|
});
|
|
814
885
|
|
|
815
886
|
const sessionGoalRuntime = createSessionGoalRuntime({
|
|
816
887
|
buildOpenCodeUrl,
|
|
817
888
|
getOpenCodeAuthHeaders,
|
|
818
889
|
getSmallModelService: async () => import('./lib/small-model/index.js'),
|
|
890
|
+
readSessionMetadata: readStoredSessionMetadata,
|
|
891
|
+
persistSessionGoal: (sessionID, directory, goal) =>
|
|
892
|
+
persistSessionMetadataPatch(sessionID, { openchamber: { goal } }, { directory }),
|
|
819
893
|
emitGoalNotification: async ({ sessionId, directory, status, goal }) => {
|
|
820
894
|
// The goal settle notification replaces the per-turn ready notifications
|
|
821
895
|
// (suppressed while the goal is active) — so it obeys the same toggle.
|
|
@@ -863,29 +937,18 @@ const sessionKnowledgeRuntime = createSessionKnowledgeRuntime({
|
|
|
863
937
|
// reference here would read it before it exists.
|
|
864
938
|
resolveProjectId: (directory) => resolveMemoryProjectId(directory),
|
|
865
939
|
isAgentMemoryEnabled,
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
const response = await fetch(`${buildOpenCodeUrl(fetchPath, '')}${search ? `?${search}` : ''}`, {
|
|
871
|
-
method,
|
|
872
|
-
headers: {
|
|
873
|
-
Accept: 'application/json',
|
|
874
|
-
...(body ? { 'Content-Type': 'application/json' } : {}),
|
|
875
|
-
...getOpenCodeAuthHeaders(),
|
|
876
|
-
},
|
|
877
|
-
...(body ? { body: JSON.stringify(body) } : {}),
|
|
878
|
-
signal: AbortSignal.timeout(15_000),
|
|
879
|
-
});
|
|
880
|
-
if (!response.ok) throw new Error(`OpenCode ${method} ${fetchPath} failed with ${response.status}`);
|
|
881
|
-
return response.json().catch(() => null);
|
|
882
|
-
},
|
|
940
|
+
readSessionMetadata: readStoredSessionMetadata,
|
|
941
|
+
// Pins and the delivered-signature cursor are read from and written to
|
|
942
|
+
// OpenChamber's own store; nothing here talks to OpenCode any more.
|
|
943
|
+
persistSessionMetadata: (sessionID, directory, patch) => persistSessionMetadataPatch(sessionID, patch, { directory }),
|
|
883
944
|
});
|
|
884
945
|
|
|
885
946
|
const contextObligatoryRuntime = createContextObligatoryRuntime({
|
|
886
947
|
buildOpenCodeUrl,
|
|
887
948
|
getOpenCodeAuthHeaders,
|
|
888
949
|
sessionKnowledgeRuntime,
|
|
950
|
+
readSessionMetadata: readStoredSessionMetadata,
|
|
951
|
+
persistContextCursor: (sessionID, directory, patch) => persistSessionMetadataPatch(sessionID, patch, { directory }),
|
|
889
952
|
});
|
|
890
953
|
|
|
891
954
|
const linearSessionStatusRuntime = createLinearSessionStatusRuntime();
|
|
@@ -897,17 +960,8 @@ const globalMessageStreamHub = createGlobalMessageStreamHub({
|
|
|
897
960
|
deltaCoalesceWindowMs: resolveDeltaCoalesceWindowMs(),
|
|
898
961
|
});
|
|
899
962
|
|
|
900
|
-
//
|
|
901
|
-
//
|
|
902
|
-
const broadcastOpenChamberUiEvent = createGlobalUiEventBroadcaster({
|
|
903
|
-
sseClients: uiOpenChamberEventClients,
|
|
904
|
-
wsClients: uiNotificationWsClients,
|
|
905
|
-
writeSseEvent,
|
|
906
|
-
});
|
|
907
|
-
|
|
908
|
-
// Jev model routing and the permission safety net. Dark unless
|
|
909
|
-
// OPENCHAMBER_ROUTING_ENABLE is set; every failure keeps the user's own model
|
|
910
|
-
// or the auto-accept reply it was asked about.
|
|
963
|
+
// Jev model routing and the permission safety net. Every failure keeps the
|
|
964
|
+
// user's own model or the auto-accept reply it was asked about.
|
|
911
965
|
const routingRuntime = createRoutingRuntime({
|
|
912
966
|
dataDir: OPENCHAMBER_DATA_DIR,
|
|
913
967
|
buildOpenCodeUrl,
|
|
@@ -937,8 +991,10 @@ const messageQueueRuntime = createMessageQueueRuntime({
|
|
|
937
991
|
buildOpenCodeUrl,
|
|
938
992
|
getOpenCodeAuthHeaders,
|
|
939
993
|
sessionKnowledgeRuntime,
|
|
994
|
+
// OpenCode's event SSE proxy cannot carry OpenChamber-owned events. Use the
|
|
995
|
+
// shared control stream for SSE clients and the existing WS fan-out.
|
|
940
996
|
broadcastGlobalUiEvent: broadcastOpenChamberUiEvent,
|
|
941
|
-
|
|
997
|
+
resolveAutoSelection: (send) => routingRuntime.resolveAutoSelection(send),
|
|
942
998
|
onPromptSent: (sessionId) => sessionRuntime.markUserMessageSent(sessionId),
|
|
943
999
|
dataDir: OPENCHAMBER_DATA_DIR,
|
|
944
1000
|
});
|
|
@@ -961,23 +1017,41 @@ const openCodeWatcherRuntime = createOpenCodeWatcherRuntime({
|
|
|
961
1017
|
// directory to route its own OpenCode calls to the right instance.
|
|
962
1018
|
console.log('[session-assist] listening for session events');
|
|
963
1019
|
globalMessageStreamHub.subscribeEvent((event) => {
|
|
964
|
-
const raw = event?.payload;
|
|
965
|
-
const payload = raw?.payload && typeof raw.payload === 'object' ? raw.payload : raw;
|
|
966
|
-
if (!payload || typeof payload !== 'object') return;
|
|
967
1020
|
const directory = typeof event?.directory === 'string' && event.directory && event.directory !== 'global'
|
|
968
1021
|
? event.directory
|
|
969
1022
|
: '';
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
1023
|
+
// The hub translates v2 wire events into the server's vocabulary once; these
|
|
1024
|
+
// consumers were written against it and stay unaware of the wire shape.
|
|
1025
|
+
for (const payload of event?.translated?.() ?? []) {
|
|
1026
|
+
// The user cancelled the turn: stop the OpenChamber tool actions that
|
|
1027
|
+
// turn still has running (a browser action, a memory write). OpenCode 2
|
|
1028
|
+
// gives the plugin no abort signal, so this is where the cancel lands.
|
|
1029
|
+
if (payload.type === 'session.idle' && payload.properties?.aborted === true) {
|
|
1030
|
+
agentToolRuntime?.abortSession?.(payload.properties.sessionID);
|
|
1031
|
+
}
|
|
1032
|
+
sessionAssistRuntime.processPayload(payload, directory || payload.properties?.directory || '');
|
|
1033
|
+
sessionGoalRuntime.processPayload(payload, directory || payload.properties?.directory || '');
|
|
1034
|
+
contextObligatoryRuntime.processPayload(payload, directory || payload.properties?.directory || '');
|
|
1035
|
+
linearSessionStatusRuntime.processPayload(payload);
|
|
1036
|
+
}
|
|
974
1037
|
});
|
|
975
1038
|
|
|
1039
|
+
/**
|
|
1040
|
+
* Browser bridges hand us the raw v2 wire payload (they forward it untouched to
|
|
1041
|
+
* the client). The synthetic OpenChamber frames the UI also expects are derived
|
|
1042
|
+
* from the translated event, so the translation happens here.
|
|
1043
|
+
*/
|
|
976
1044
|
const processForwardedEventPayload = (payload, emitSyntheticEvent) => {
|
|
977
1045
|
if (!payload || typeof payload !== 'object' || typeof emitSyntheticEvent !== 'function') {
|
|
978
1046
|
return;
|
|
979
1047
|
}
|
|
980
1048
|
|
|
1049
|
+
for (const translated of translateWireEvent(payload)) {
|
|
1050
|
+
processForwardedServerEvent(translated, emitSyntheticEvent);
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
|
|
1054
|
+
const processForwardedServerEvent = (payload, emitSyntheticEvent) => {
|
|
981
1055
|
maybeCacheSessionInfoFromEvent(payload);
|
|
982
1056
|
|
|
983
1057
|
if (payload.type !== 'session.status') {
|
|
@@ -1028,6 +1102,10 @@ const processForwardedEventPayload = (payload, emitSyntheticEvent) => {
|
|
|
1028
1102
|
|
|
1029
1103
|
|
|
1030
1104
|
const serverUtilsRuntime = createServerUtilsRuntime({
|
|
1105
|
+
// Read lazily: the archive store is created with the session service further
|
|
1106
|
+
// down, while the proxy is registered later still.
|
|
1107
|
+
getArchivedSessions: () => openChamberSessionService.archiveStore.getAll(),
|
|
1108
|
+
getStoredSessionMetadata: () => sessionMetadataStore.listUnmigrated(),
|
|
1031
1109
|
fs,
|
|
1032
1110
|
os,
|
|
1033
1111
|
path,
|
|
@@ -1264,25 +1342,21 @@ const openCodeLifecycleRuntime = createOpenCodeLifecycleRuntime({
|
|
|
1264
1342
|
console.warn('Failed to reconcile sessions after OpenCode restart:', error?.message ?? error);
|
|
1265
1343
|
}
|
|
1266
1344
|
},
|
|
1267
|
-
getManagedOpenCodeEnv: async () => {
|
|
1268
|
-
const settings = await readSettingsFromDiskMigrated().catch(() => null);
|
|
1269
|
-
// Each capability is its own tool and its own switch; the plugin is only
|
|
1270
|
-
// injected while at least one of them is on.
|
|
1271
|
-
const includeControl = settings?.agentControlToolEnabled !== false;
|
|
1272
|
-
const includeWeb = settings?.agentWebToolEnabled !== false;
|
|
1273
|
-
const includeMemory = isAgentMemoryFeatureAvailable() && settings?.agentMemoryToolEnabled === true;
|
|
1274
|
-
const managedEnv = includeControl || includeWeb || includeMemory
|
|
1275
|
-
? await (agentToolRuntime?.prepareManagedOpenCodeEnv({ includeControl, includeWeb, includeMemory }) || {})
|
|
1276
|
-
: {};
|
|
1277
|
-
|
|
1278
|
-
if (settings?.optimizeSystemPrompt === true) {
|
|
1279
|
-
const configContent = managedEnv.OPENCODE_CONFIG_CONTENT ?? process.env.OPENCODE_CONFIG_CONTENT;
|
|
1280
|
-
Object.assign(managedEnv, await systemPromptRuntime.prepareManagedOpenCodeEnv(configContent));
|
|
1281
|
-
}
|
|
1282
|
-
return managedEnv;
|
|
1283
|
-
},
|
|
1345
|
+
getManagedOpenCodeEnv: async () => (managedConfigRuntime ? managedConfigRuntime.buildManagedChildEnv() : {}),
|
|
1284
1346
|
});
|
|
1285
1347
|
|
|
1348
|
+
const getOpenCodeCompatibility = async () => {
|
|
1349
|
+
if (isExternalOpenCode || ENV_SKIP_OPENCODE_START) {
|
|
1350
|
+
const base = ENV_CONFIGURED_OPENCODE_HOST?.origin || openCodeBaseUrl || `http://127.0.0.1:${openCodePort || ENV_EFFECTIVE_PORT}`;
|
|
1351
|
+
const version = await readExternalOpenCodeVersion(base, getOpenCodeAuthHeaders()).catch(() => null);
|
|
1352
|
+
return describeOpenCodeCompatibility(version, 'external', false);
|
|
1353
|
+
}
|
|
1354
|
+
const binary = ensureOpencodeCliEnv();
|
|
1355
|
+
const installation = isBundledOpenCodeCliPath(binary) ? 'bundled' : 'managed';
|
|
1356
|
+
const version = await readOpenCodeCliVersion(resolveManagedOpenCodeLaunchSpec(binary)).catch(() => null);
|
|
1357
|
+
return describeOpenCodeCompatibility(version, installation, supportsOpenCodeV2Install());
|
|
1358
|
+
};
|
|
1359
|
+
|
|
1286
1360
|
const getOpenCodeUpgradeCapability = () => {
|
|
1287
1361
|
const activeBinary = lastOpenCodeLaunchDiagnostics?.sourceBinary
|
|
1288
1362
|
|| lastOpenCodeLaunchDiagnostics?.binary
|
|
@@ -1311,6 +1385,8 @@ const scheduledTasksRuntime = createScheduledTasksRuntime({
|
|
|
1311
1385
|
getOpenCodeAuthHeaders,
|
|
1312
1386
|
waitForOpenCodeReady,
|
|
1313
1387
|
sessionKnowledgeRuntime,
|
|
1388
|
+
persistSessionGoal: (sessionID, directory, goal) =>
|
|
1389
|
+
persistSessionMetadataPatch(sessionID, { openchamber: { goal } }, { directory }),
|
|
1314
1390
|
setSessionAutoAccept: (sessionId, enabled, directory) => permissionAutoAcceptRuntime.setSessionPolicy(sessionId, enabled, directory),
|
|
1315
1391
|
emitTaskRunEvent: (event) => {
|
|
1316
1392
|
for (const client of uiOpenChamberEventClients) {
|
|
@@ -1399,7 +1475,13 @@ const openChamberSessionService = createOpenChamberSessionService({
|
|
|
1399
1475
|
waitForOpenCodeReady,
|
|
1400
1476
|
emitSessionCreatedEvent,
|
|
1401
1477
|
sessionKnowledgeRuntime,
|
|
1402
|
-
|
|
1478
|
+
// OpenCode 2.x has no archive route, so the state is OpenChamber's own and
|
|
1479
|
+
// lives beside the instance it describes.
|
|
1480
|
+
dataDir: OPENCHAMBER_DATA_DIR,
|
|
1481
|
+
sessionMetadataStore,
|
|
1482
|
+
persistSessionMetadata: persistSessionMetadataPatch,
|
|
1483
|
+
broadcastGlobalUiEvent: broadcastOpenChamberUiEvent,
|
|
1484
|
+
resolveAutoSelection: (input) => routingRuntime.resolveAutoSelection(input),
|
|
1403
1485
|
});
|
|
1404
1486
|
// Browser actions are published to whichever OpenChamber clients are connected;
|
|
1405
1487
|
// the one owning the browser panel answers. `emitRequest` returns the number of
|
|
@@ -1432,6 +1514,62 @@ const browserControlBroker = createBrowserControlBroker({
|
|
|
1432
1514
|
},
|
|
1433
1515
|
});
|
|
1434
1516
|
|
|
1517
|
+
/**
|
|
1518
|
+
* Tells every client the selected browser provider was dropped back to the
|
|
1519
|
+
* in-app browser, so Settings shows the change and the user hears why.
|
|
1520
|
+
*/
|
|
1521
|
+
const emitBrowserProviderResetEvent = ({ guestId, guestName }) => {
|
|
1522
|
+
for (const client of uiOpenChamberEventClients) {
|
|
1523
|
+
try {
|
|
1524
|
+
writeSseEvent(client, {
|
|
1525
|
+
type: 'openchamber:browser-provider-reset',
|
|
1526
|
+
properties: { guestId, guestName },
|
|
1527
|
+
});
|
|
1528
|
+
} catch {
|
|
1529
|
+
uiOpenChamberEventClients.delete(client);
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
};
|
|
1533
|
+
// Every browser action passes through here: the in-app view by default, or an
|
|
1534
|
+
// extension service chosen in Settings → OpenChamber Tools.
|
|
1535
|
+
const browserControlRouter = createBrowserControlRouter({
|
|
1536
|
+
broker: browserControlBroker,
|
|
1537
|
+
readSettings: () => readSettingsFromDiskMigrated(),
|
|
1538
|
+
persistSettings: (changes) => persistSettings(changes),
|
|
1539
|
+
findGuest: (id) => findInstalledGuest(id, extensionsPersistPath(OPENCHAMBER_DATA_DIR)),
|
|
1540
|
+
persistPath: extensionsPersistPath(OPENCHAMBER_DATA_DIR),
|
|
1541
|
+
emitProviderReset: emitBrowserProviderResetEvent,
|
|
1542
|
+
createId: () => `browser-${crypto.randomUUID()}`,
|
|
1543
|
+
surfaceControl: {
|
|
1544
|
+
userControls: (guestId) => guestSurfaceRuntime?.userControls(guestId) ?? false,
|
|
1545
|
+
noteAgentActivity: (guestId) => guestSurfaceRuntime?.noteAgentActivity(guestId),
|
|
1546
|
+
},
|
|
1547
|
+
});
|
|
1548
|
+
|
|
1549
|
+
// "Show this file" reaches every connected client; the ones showing that
|
|
1550
|
+
// project open it. Nothing comes back, so the count of clients reached is the
|
|
1551
|
+
// only signal the agent gets.
|
|
1552
|
+
const fileOpenRequester = createFileOpenRequester({
|
|
1553
|
+
emit: (request) => {
|
|
1554
|
+
let delivered = 0;
|
|
1555
|
+
for (const client of uiOpenChamberEventClients) {
|
|
1556
|
+
try {
|
|
1557
|
+
writeSseEvent(client, { type: 'openchamber:file-open-request', properties: request });
|
|
1558
|
+
delivered += 1;
|
|
1559
|
+
} catch {
|
|
1560
|
+
uiOpenChamberEventClients.delete(client);
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
return delivered;
|
|
1564
|
+
},
|
|
1565
|
+
});
|
|
1566
|
+
|
|
1567
|
+
const pluginNotificationEmitter = createPluginNotificationEmitter({
|
|
1568
|
+
readSettingsFromDiskMigrated,
|
|
1569
|
+
emitDesktopNotification,
|
|
1570
|
+
broadcastUiNotification,
|
|
1571
|
+
});
|
|
1572
|
+
|
|
1435
1573
|
const openChamberControlService = createOpenChamberControlService({
|
|
1436
1574
|
readSettingsFromDiskMigrated,
|
|
1437
1575
|
sanitizeProjects,
|
|
@@ -1440,7 +1578,17 @@ const openChamberControlService = createOpenChamberControlService({
|
|
|
1440
1578
|
waitForOpenCodeReady,
|
|
1441
1579
|
sessionService: openChamberSessionService,
|
|
1442
1580
|
scheduledTaskService,
|
|
1443
|
-
browserControl:
|
|
1581
|
+
browserControl: browserControlRouter,
|
|
1582
|
+
fileOpen: fileOpenRequester,
|
|
1583
|
+
// The tool is off by default; a plugin generated before it was switched off
|
|
1584
|
+
// must not keep paging the user.
|
|
1585
|
+
notifyUser: async (input) => {
|
|
1586
|
+
const settings = await readSettingsFromDiskMigrated().catch(() => null);
|
|
1587
|
+
if (settings?.agentNotifyToolEnabled !== true) {
|
|
1588
|
+
return { status: 403, body: { error: 'The notify tool is turned off in OpenChamber settings' } };
|
|
1589
|
+
}
|
|
1590
|
+
return pluginNotificationEmitter.emit(input);
|
|
1591
|
+
},
|
|
1444
1592
|
agentMemoryActions: createAgentMemoryActions({
|
|
1445
1593
|
agentMemoryRuntime,
|
|
1446
1594
|
createError: (message, status) => new OpenChamberControlError(message, status),
|
|
@@ -1474,6 +1622,11 @@ const bootstrapOpenCodeAtStartup = async (...args) => {
|
|
|
1474
1622
|
void ensureGlobalWatcherStarted().catch((error) => {
|
|
1475
1623
|
console.warn(`Global event watcher startup failed: ${error?.message || error}`);
|
|
1476
1624
|
});
|
|
1625
|
+
// Entries the sweep cannot push now stay in the legacy file and are pushed on
|
|
1626
|
+
// the session's next write or the next start.
|
|
1627
|
+
void waitForOpenCodeReady()
|
|
1628
|
+
.then(() => sessionMetadataStore.migrateLegacy())
|
|
1629
|
+
.catch((error) => console.warn('[openchamber-sessions] session metadata migration failed:', error?.message ?? error));
|
|
1477
1630
|
};
|
|
1478
1631
|
const killProcessOnPort = (...args) => openCodeLifecycleRuntime.killProcessOnPort(...args);
|
|
1479
1632
|
const waitForPortRelease = (...args) => openCodeLifecycleRuntime.waitForPortRelease(...args);
|
|
@@ -1526,11 +1679,19 @@ const gracefulShutdownRuntime = createGracefulShutdownRuntime({
|
|
|
1526
1679
|
},
|
|
1527
1680
|
tunnelAuthController,
|
|
1528
1681
|
scheduledTasksRuntime,
|
|
1682
|
+
beginGuestServiceShutdown,
|
|
1683
|
+
stopAllGuestServices,
|
|
1684
|
+
getGuestSurfaceRuntime: () => guestSurfaceRuntime,
|
|
1685
|
+
getRealtimeProxyRuntime: () => realtimeProxyRuntime,
|
|
1686
|
+
getDictationRuntime: () => dictationRuntime,
|
|
1687
|
+
getRelayService: () => relayServiceInstance,
|
|
1688
|
+
getRelayReconcileTimer: () => relayReconcileTimer,
|
|
1529
1689
|
});
|
|
1530
1690
|
|
|
1531
1691
|
const gracefulShutdown = (...args) => gracefulShutdownRuntime.gracefulShutdown(...args);
|
|
1532
1692
|
|
|
1533
1693
|
async function main(options = {}) {
|
|
1694
|
+
beginGuestServiceHost();
|
|
1534
1695
|
const port = Number.isFinite(options.port) && options.port >= 0 ? Math.trunc(options.port) : DEFAULT_PORT;
|
|
1535
1696
|
const host = typeof options.host === 'string' && options.host.length > 0 ? options.host : undefined;
|
|
1536
1697
|
const effectiveBindHost = host
|
|
@@ -1544,6 +1705,8 @@ async function main(options = {}) {
|
|
|
1544
1705
|
dataDir: OPENCHAMBER_DATA_DIR,
|
|
1545
1706
|
env: process.env,
|
|
1546
1707
|
executeAction: (...args) => openChamberControlService.execute(...args),
|
|
1708
|
+
// A v2 tool call carries no directory, only the session it runs in.
|
|
1709
|
+
resolveSessionDirectory: (sessionID) => openChamberControlService.resolveSessionDirectory(sessionID),
|
|
1547
1710
|
getActivePort: () => {
|
|
1548
1711
|
const address = server?.address?.();
|
|
1549
1712
|
return typeof address === 'object' && address ? address.port : null;
|
|
@@ -1551,10 +1714,14 @@ async function main(options = {}) {
|
|
|
1551
1714
|
// A pipe listener reports a string here, which has no address to bind back to.
|
|
1552
1715
|
getActiveHost: () => server?.address?.()?.address ?? null,
|
|
1553
1716
|
});
|
|
1554
|
-
|
|
1717
|
+
managedConfigRuntime = createManagedConfigRuntime({
|
|
1555
1718
|
fsPromises,
|
|
1556
1719
|
path,
|
|
1557
1720
|
dataDir: OPENCHAMBER_DATA_DIR,
|
|
1721
|
+
env: process.env,
|
|
1722
|
+
agentToolRuntime,
|
|
1723
|
+
readSettings: () => readSettingsFromDiskMigrated(),
|
|
1724
|
+
isAgentMemoryAvailable: isAgentMemoryFeatureAvailable,
|
|
1558
1725
|
});
|
|
1559
1726
|
|
|
1560
1727
|
// Pairing transports advertised to the create-device dialog. LAN reachability is
|
|
@@ -1744,13 +1911,7 @@ async function main(options = {}) {
|
|
|
1744
1911
|
}));
|
|
1745
1912
|
expressApp = app;
|
|
1746
1913
|
server = http.createServer(app);
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
// The relay service is constructed further below (it depends on the tunnel
|
|
1750
|
-
// runtime's active port). The pairing routes registered here only read the
|
|
1751
|
-
// relay candidate lazily at request time, so a late-bound holder is enough.
|
|
1752
|
-
let relayServiceInstance = null;
|
|
1753
|
-
|
|
1914
|
+
gracefulShutdownRuntime.trackServerConnections(server);
|
|
1754
1915
|
// Same pattern for the tunnel runtime: created after the base routes so
|
|
1755
1916
|
// /api/system/info resolves port + tunnel URL lazily at request time.
|
|
1756
1917
|
let tunnelRuntimeContextHolder = null;
|
|
@@ -1852,6 +2013,7 @@ async function main(options = {}) {
|
|
|
1852
2013
|
isUiVisible,
|
|
1853
2014
|
getUiNotificationClients: () => uiNotificationClients,
|
|
1854
2015
|
writeSseEvent,
|
|
2016
|
+
pluginNotificationEmitter,
|
|
1855
2017
|
sessionRuntime,
|
|
1856
2018
|
setPushInitialized,
|
|
1857
2019
|
fs,
|
|
@@ -1877,7 +2039,7 @@ async function main(options = {}) {
|
|
|
1877
2039
|
isRequestOriginAllowed,
|
|
1878
2040
|
});
|
|
1879
2041
|
|
|
1880
|
-
const tunnelRuntimeContext = tunnelWiringRuntime.initialize(app, port);
|
|
2042
|
+
const tunnelRuntimeContext = tunnelWiringRuntime.initialize(app, port, Boolean(uiPassword?.trim()));
|
|
1881
2043
|
const { tunnelService, startTunnelWithNormalizedRequest } = tunnelRuntimeContext;
|
|
1882
2044
|
tunnelRuntimeContextHolder = tunnelRuntimeContext;
|
|
1883
2045
|
|
|
@@ -1958,6 +2120,11 @@ async function main(options = {}) {
|
|
|
1958
2120
|
createFsSearchRuntime: createFsSearchRuntimeFactory,
|
|
1959
2121
|
openchamberDataDir: OPENCHAMBER_DATA_DIR,
|
|
1960
2122
|
openchamberVersion: OPENCHAMBER_VERSION,
|
|
2123
|
+
onGuestDeactivated: async (event) => {
|
|
2124
|
+
guestSurfaceRuntime?.endForGuest(event.guestId);
|
|
2125
|
+
return browserControlRouter.handleGuestDeactivated(event);
|
|
2126
|
+
},
|
|
2127
|
+
surfaceViewerHeaders: (guestId, viewerId) => guestSurfaceRuntime?.viewerHeaders(guestId, viewerId) ?? null,
|
|
1961
2128
|
builtInExtensionsDir: options.builtInExtensionsDir,
|
|
1962
2129
|
openchamberUserConfigRoot: OPENCHAMBER_USER_CONFIG_ROOT,
|
|
1963
2130
|
managedChatsRoot: OPENCHAMBER_CHATS_DIR,
|
|
@@ -1971,6 +2138,19 @@ async function main(options = {}) {
|
|
|
1971
2138
|
refreshOpenCodeAfterConfigChange,
|
|
1972
2139
|
getOpenCodeResolutionSnapshot,
|
|
1973
2140
|
getOpenCodeUpgradeCapability,
|
|
2141
|
+
getOpenCodeCompatibility,
|
|
2142
|
+
installOpenCodeV2: async () => {
|
|
2143
|
+
const binary = await installOpenCodeV2({
|
|
2144
|
+
env: { ...getLoginShellEnvSnapshot(), ...process.env, PATH: buildManagedOpenCodePath() },
|
|
2145
|
+
});
|
|
2146
|
+
await persistSettings({ opencodeBinary: binary });
|
|
2147
|
+
await refreshOpenCodeAfterConfigChange('OpenCode v2 installation');
|
|
2148
|
+
await waitForOpenCodeReady();
|
|
2149
|
+
},
|
|
2150
|
+
upgradeOpenCodeCli: () => runOpenCodeCliUpgrade(
|
|
2151
|
+
resolveManagedOpenCodeLaunchSpec(lastOpenCodeLaunchDiagnostics?.sourceBinary || resolvedOpencodeBinary),
|
|
2152
|
+
{ env: { ...getLoginShellEnvSnapshot(), ...process.env, PATH: buildManagedOpenCodePath() }, cwd: os.homedir() },
|
|
2153
|
+
),
|
|
1974
2154
|
formatSettingsResponse,
|
|
1975
2155
|
readSettingsFromDisk,
|
|
1976
2156
|
readSettingsFromDiskMigrated,
|
|
@@ -2004,6 +2184,17 @@ async function main(options = {}) {
|
|
|
2004
2184
|
routingRuntime,
|
|
2005
2185
|
});
|
|
2006
2186
|
|
|
2187
|
+
// After bootstrap: the upgrade gate needs the real UI auth controller.
|
|
2188
|
+
guestSurfaceRuntime = createGuestSurfaceRuntime({
|
|
2189
|
+
server,
|
|
2190
|
+
uiAuthController,
|
|
2191
|
+
isRequestOriginAllowed,
|
|
2192
|
+
rejectWebSocketUpgrade,
|
|
2193
|
+
persistPath: extensionsPersistPath(OPENCHAMBER_DATA_DIR),
|
|
2194
|
+
findGuest: (id) => findInstalledGuest(id, extensionsPersistPath(OPENCHAMBER_DATA_DIR)),
|
|
2195
|
+
idleStopMs: BROWSER_PROVIDER_IDLE_MS,
|
|
2196
|
+
});
|
|
2197
|
+
|
|
2007
2198
|
const startupPipelineResult = await startupPipelineRuntime.run({
|
|
2008
2199
|
app,
|
|
2009
2200
|
server,
|
|
@@ -2073,7 +2264,7 @@ async function main(options = {}) {
|
|
|
2073
2264
|
// --relay` writes a pending relay session straight to the on-disk store, and
|
|
2074
2265
|
// pending sessions expire without any request hitting us. Poll reconcile so a
|
|
2075
2266
|
// headless instance picks the relay up (or drops it) within a minute.
|
|
2076
|
-
|
|
2267
|
+
relayReconcileTimer = setInterval(() => {
|
|
2077
2268
|
void relayService.reconcile();
|
|
2078
2269
|
}, 60_000);
|
|
2079
2270
|
relayReconcileTimer.unref?.();
|
|
@@ -2091,6 +2282,7 @@ async function main(options = {}) {
|
|
|
2091
2282
|
scheduledTasks: scheduledTasksRuntime.getStatus(),
|
|
2092
2283
|
}),
|
|
2093
2284
|
isReady: () => isOpenCodeReady,
|
|
2285
|
+
getManagedOpenCodePreflight: () => openCodeLifecycleRuntime.getManagedOpenCodePreflight(),
|
|
2094
2286
|
restartOpenCode: () => restartOpenCode(),
|
|
2095
2287
|
getOpenCodeProcessInfo: () => {
|
|
2096
2288
|
const managed = Boolean((openCodeProcess || openCodePort) && !ENV_SKIP_OPENCODE_START && !isExternalOpenCode);
|
|
@@ -2106,26 +2298,7 @@ async function main(options = {}) {
|
|
|
2106
2298
|
port: managed ? openCodePort : null,
|
|
2107
2299
|
};
|
|
2108
2300
|
},
|
|
2109
|
-
stop:
|
|
2110
|
-
realtimeProxyRuntime.stop();
|
|
2111
|
-
clearInterval(relayReconcileTimer);
|
|
2112
|
-
try {
|
|
2113
|
-
relayService.stop();
|
|
2114
|
-
} catch {
|
|
2115
|
-
// best-effort teardown of the relay host client
|
|
2116
|
-
}
|
|
2117
|
-
try {
|
|
2118
|
-
dictationRuntime?.stop?.();
|
|
2119
|
-
} catch {
|
|
2120
|
-
// best-effort shutdown of the dictation worker
|
|
2121
|
-
}
|
|
2122
|
-
// Guest services are child processes; leaving before SIGTERM lands
|
|
2123
|
-
// (and the SIGKILL fallback fires) orphans them on the user's machine.
|
|
2124
|
-
await stopAllGuestServices().catch(() => {
|
|
2125
|
-
// best-effort teardown of guest service processes
|
|
2126
|
-
});
|
|
2127
|
-
return gracefulShutdown({ exitProcess: shutdownOptions.exitProcess ?? false });
|
|
2128
|
-
}
|
|
2301
|
+
stop: (shutdownOptions = {}) => gracefulShutdown({ exitProcess: shutdownOptions.exitProcess ?? false }),
|
|
2129
2302
|
};
|
|
2130
2303
|
}
|
|
2131
2304
|
|