@openchamber/web 2.0.2 → 2.0.4
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/DOCUMENTATION.md +1 -1
- package/bin/lib/commands-connect-url.js +6 -5
- package/bin/lib/commands-tunnel.js +24 -5
- package/dist/assets/{CodeMirrorCommentWidgets-CmKmyb9T.js → CodeMirrorCommentWidgets-C_zL-eri.js} +1 -1
- package/dist/assets/{DiffView-8-PFpZ2p.js → DiffView-BeN2_YYF.js} +3 -3
- package/dist/assets/FilesView-CN34wm_N.js +17 -0
- package/dist/assets/{GitView-DNUSu00w.js → GitView-DLDazOo1.js} +4 -4
- package/dist/assets/{GuestAttachDialog-Cv6QzjHC.js → GuestAttachDialog-C0xe_Lyy.js} +1 -1
- package/dist/assets/{GuestSurfacePane-Bt3jB_Ye.js → GuestSurfacePane-BdaurnDr.js} +1 -1
- package/dist/assets/{JsonTreeView-BlyHTRhM.js → JsonTreeView-B1Xq-k2t.js} +1 -1
- package/dist/assets/LinearIssuesView-BryoAHow.js +1 -0
- package/dist/assets/{MarkdownImageGallery-2UXJF-5B.js → MarkdownImageGallery-DfuEoaGq.js} +1 -1
- package/dist/assets/MarkdownRendererImpl-B_ZcWOvX.js +12 -0
- package/dist/assets/OnboardingScreen-C22bGmnP.js +1 -0
- package/dist/assets/{PatchDiff-ByvnbG5T.js → PatchDiff-0xd6UeFB.js} +1 -1
- package/dist/assets/{PierreDiffViewer-BXieg0mH.js → PierreDiffViewer-BC950e3F.js} +3 -3
- package/dist/assets/PlanView-B7Xgihqk.js +5 -0
- package/dist/assets/PluginPane-2C71F8uF.js +3 -0
- package/dist/assets/SettingsView-m_zoFiaT.js +30 -0
- package/dist/assets/{SettingsWindow-BIz224xs.js → SettingsWindow-CofS020b.js} +1 -1
- package/dist/assets/{SubmoduleDiffSummary-CXKmlps9.js → SubmoduleDiffSummary-BSA9gnIO.js} +1 -1
- package/dist/assets/{ToolOutputDialog-BsgAK8xu.js → ToolOutputDialog-DprkVKcj.js} +7 -7
- package/dist/assets/{ToolPartDiffPreview-vdPObXOf.js → ToolPartDiffPreview-Dq0go_fX.js} +2 -2
- package/dist/assets/{VirtualizedFileDiff-BkFNKWS5.js → VirtualizedFileDiff-Kp8hKJdT.js} +1 -1
- package/dist/assets/WalkthroughView-DGnTzqIU.js +4 -0
- package/dist/assets/{appThemeRegistry-aHUNHoqP.js → appThemeRegistry-BdEHBA4s.js} +1 -1
- package/dist/assets/{commitAndPush-Bon9r94r.js → commitAndPush-LwtVa2Oc.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-DKqr_1AQ.js → computeVirtualFileMetrics-6V1xNpO9.js} +2 -2
- package/dist/assets/de-DlgBHUAI.js +10 -0
- package/dist/assets/es-BC8G41U8.js +16 -0
- package/dist/assets/fr-I0z3vVjy.js +14 -0
- package/dist/assets/index-CgR5rJq_.js +41 -0
- package/dist/assets/{index-DpFttslC.js → index-CmNPYddV.js} +1 -1
- package/dist/assets/index-adyy_sEk.css +1 -0
- package/dist/assets/{isDiffPlainText-kzAgpIgi.js → isDiffPlainText-1bXcWCrw.js} +1 -1
- package/dist/assets/{isFilePlainText-Uj6y-jzz.js → isFilePlainText-CBAppvy1.js} +1 -1
- package/dist/assets/ja-BIElEsY8.js +16 -0
- package/dist/assets/ko-DRnnHetA.js +16 -0
- package/dist/assets/{main-CbfMxn-I.js → main-CzjTMTfW.js} +2 -2
- package/dist/assets/main-DVX34beR.js +886 -0
- package/dist/assets/markdownCore-Cxbkn5NR.js +7 -0
- package/dist/assets/{miniChat-CiAKBC10.js → miniChat-CP68IL8Q.js} +2 -2
- package/dist/assets/{mobile-CsT4sJwC.js → mobile-BrlBrNfZ.js} +2 -2
- package/dist/assets/nl-DzUV-kwp.js +16 -0
- package/dist/assets/{patchFileDiff-DeaE08W0.js → patchFileDiff-pqRSHLHI.js} +2 -2
- package/dist/assets/pl-Bb-cb7k7.js +16 -0
- package/dist/assets/pt-BR-CyIWrTcE.js +16 -0
- package/dist/assets/renderElectronMiniChatApp-DKIilR7N.js +2 -0
- package/dist/assets/renderMobileApp-B0z6-x58.js +25 -0
- package/dist/assets/runtimeEndpointReset-uu1DBwLL.js +52 -0
- package/dist/assets/{scheduledTasksApi-BZCNJ588.js → scheduledTasksApi-BuzWT445.js} +1 -1
- package/dist/assets/{shikiHighlight-BSUEa3yF.js → shikiHighlight-BWGrY5YU.js} +1 -1
- package/dist/assets/{textMateThemeFromAppTheme-CsATFZIV.js → textMateThemeFromAppTheme-BSUFChBY.js} +1 -1
- package/dist/assets/tr-DXEDSoYO.js +7 -0
- package/dist/assets/uk-C8hN--q_.js +16 -0
- package/dist/assets/useAppFontEffects-Dsl_sLrj.js +7366 -0
- package/dist/assets/useInlineCommentController-d5vntsQ_.js +2 -0
- package/dist/assets/{useRootScrollLock-Cp1eFoM2.js → useRootScrollLock-2rd5Y6gR.js} +2 -2
- package/dist/assets/{vendor-base-ui-CsXYnR5c.js → vendor-base-ui-DnNniUWp.js} +1 -1
- package/dist/assets/{vendor-codemirror-language-data-BwwommM0.js → vendor-codemirror-language-data-B1EetJur.js} +2 -2
- package/dist/assets/vendor-opencode-client-DSZl7jSi.js +12 -0
- package/dist/assets/{vendor-tanstack-react-virtual-ClYN8CzB.js → vendor-tanstack-react-virtual--0sBrLRh.js} +1 -1
- package/dist/assets/{vendor-tanstack-virtual-core-BewVQryB.js → vendor-tanstack-virtual-core-BoA4iGMw.js} +1 -1
- package/dist/assets/{vendor-zod-BSoePkpP.js → vendor-zod-CxRSdNoV.js} +4 -4
- package/dist/assets/{web-components-D3Yjr4Zx.js → web-components-ngpHPEDU.js} +1 -1
- package/dist/assets/zh-CN-CtzXdjMZ.js +16 -0
- package/dist/assets/zh-TW-Ds0CADSz.js +16 -0
- package/dist/index.html +5 -5
- package/dist/mini-chat.html +5 -5
- package/dist/mobile.html +5 -5
- package/package.json +5 -5
- package/server/index.js +82 -4
- package/server/lib/agent-tool/DOCUMENTATION.md +8 -1
- package/server/lib/agent-tool/runtime.js +13 -4
- package/server/lib/agent-tool/runtime.test.js +15 -0
- package/server/lib/context-obligatory/DOCUMENTATION.md +10 -7
- package/server/lib/context-obligatory/runtime.js +2 -1
- package/server/lib/context-obligatory/runtime.test.js +76 -30
- package/server/lib/dictation/DOCUMENTATION.md +4 -1
- package/server/lib/dictation/openai-compatible-session.js +7 -0
- package/server/lib/enterprise-mode.d.ts +30 -0
- package/server/lib/enterprise-mode.js +253 -0
- package/server/lib/enterprise-mode.test.js +247 -0
- package/server/lib/event-stream/translate-v2.js +6 -0
- package/server/lib/event-stream/translate-v2.test.js +6 -0
- package/server/lib/git/DOCUMENTATION.md +2 -1
- package/server/lib/git/routes.js +44 -1
- package/server/lib/git/routes.test.js +98 -1
- package/server/lib/git/service.js +146 -11
- package/server/lib/git/service.test.js +195 -0
- package/server/lib/github/routes.js +9 -19
- package/server/lib/github/routes.test.js +112 -0
- package/server/lib/guests/DOCUMENTATION.md +4 -2
- package/server/lib/guests/background.test.js +1 -1
- package/server/lib/guests/catalog.js +56 -2
- package/server/lib/guests/catalog.test.js +24 -1
- package/server/lib/guests/clone-network.test.js +52 -0
- package/server/lib/guests/clone.js +30 -4
- package/server/lib/guests/enterprise.js +68 -0
- package/server/lib/guests/enterprise.test.js +106 -0
- package/server/lib/guests/grant-scope.js +8 -2
- package/server/lib/guests/grant-scope.test.js +9 -0
- package/server/lib/guests/html-styles.js +16 -2
- package/server/lib/guests/html-styles.test.js +53 -4
- package/server/lib/guests/install.js +10 -0
- package/server/lib/guests/persist.js +1 -0
- package/server/lib/guests/routes.js +40 -5
- package/server/lib/guests/updates.js +9 -2
- package/server/lib/notifications/DOCUMENTATION.md +1 -1
- package/server/lib/notifications/runtime.js +22 -8
- package/server/lib/notifications/trigger-runtime.test.js +45 -0
- package/server/lib/openchamber-sessions/session-metadata-store.js +27 -0
- package/server/lib/openchamber-sessions/session-metadata-store.test.js +18 -0
- package/server/lib/opencode/DOCUMENTATION.md +13 -9
- package/server/lib/opencode/auth-state-runtime.js +2 -2
- package/server/lib/opencode/config-paths.test.js +1 -0
- package/server/lib/opencode/env-runtime.js +26 -3
- package/server/lib/opencode/env-runtime.test.js +57 -0
- package/server/lib/opencode/feature-routes-runtime.js +2 -0
- package/server/lib/opencode/hmr-state-runtime.js +4 -3
- package/server/lib/opencode/lifecycle.js +10 -5
- package/server/lib/opencode/lifecycle.test.js +6 -2
- package/server/lib/opencode/managed-config-file.js +2 -1
- package/server/lib/opencode/managed-config-file.test.js +18 -0
- package/server/lib/opencode/npm-registry-config.d.ts +1 -0
- package/server/lib/opencode/npm-registry-config.js +123 -0
- package/server/lib/opencode/npm-registry-config.test.js +167 -0
- package/server/lib/opencode/npm-registry.js +5 -6
- package/server/lib/opencode/npm-registry.test.js +30 -0
- package/server/lib/opencode/openchamber-routes.js +8 -0
- package/server/lib/opencode/project-icon-routes.js +2 -2
- package/server/lib/opencode/project-icon-routes.test.js +44 -0
- package/server/lib/opencode/provider-source-route.test.js +32 -0
- package/server/lib/opencode/routes.js +17 -2
- package/server/lib/opencode/settings-helpers.js +26 -3
- package/server/lib/opencode/settings-helpers.test.js +12 -5
- package/server/lib/opencode/settings-registry.json +35 -1
- package/server/lib/opencode/settings-runtime.js +1 -0
- package/server/lib/opencode/shutdown-runtime.js +2 -0
- package/server/lib/opencode/static-routes-runtime.js +9 -1
- package/server/lib/opencode/static-routes-runtime.test.js +58 -1
- package/server/lib/package-manager.js +4 -1
- package/server/lib/package-manager.test.js +24 -0
- package/server/lib/permission-auto-accept/DOCUMENTATION.md +23 -15
- package/server/lib/permission-auto-accept/modes.js +26 -0
- package/server/lib/permission-auto-accept/runtime.js +146 -40
- package/server/lib/permission-auto-accept/runtime.test.js +93 -9
- package/server/lib/quota/DOCUMENTATION.md +6 -0
- package/server/lib/quota/providers/zhipuai-coding-plan.js +74 -30
- package/server/lib/quota/providers/zhipuai-coding-plan.test.js +124 -0
- package/server/lib/relay/DOCUMENTATION.md +1 -1
- package/server/lib/relay/service.js +32 -12
- package/server/lib/relay/service.test.js +30 -0
- package/server/lib/routing/DOCUMENTATION.md +150 -41
- package/server/lib/routing/classifier.js +156 -0
- package/server/lib/routing/defaults.js +27 -0
- package/server/lib/routing/jev.js +5 -17
- package/server/lib/routing/routes.http.test.js +9 -0
- package/server/lib/routing/routes.js +27 -1
- package/server/lib/routing/runtime.js +199 -33
- package/server/lib/routing/runtime.test.js +299 -15
- package/server/lib/routing/store.js +57 -0
- package/server/lib/routing/store.test.js +37 -0
- package/server/lib/session-assist/DOCUMENTATION.md +17 -7
- package/server/lib/session-assist/context.js +42 -2
- package/server/lib/session-assist/context.test.js +38 -1
- package/server/lib/session-assist/runtime.js +57 -13
- package/server/lib/session-assist/runtime.test.js +45 -0
- package/server/lib/session-goal/DOCUMENTATION.md +47 -22
- package/server/lib/session-goal/audit.js +112 -0
- package/server/lib/session-goal/audit.test.js +58 -0
- package/server/lib/session-goal/runtime.js +113 -134
- package/server/lib/session-goal/runtime.test.js +146 -13
- package/server/lib/session-lineage.js +52 -0
- package/server/lib/session-lineage.test.js +45 -0
- package/server/lib/session-work/DOCUMENTATION.md +108 -0
- package/server/lib/session-work/questions.js +126 -0
- package/server/lib/session-work/runtime.js +278 -0
- package/server/lib/session-work/runtime.test.js +255 -0
- package/server/lib/session-work/state.js +48 -0
- package/server/lib/session-work/state.test.js +34 -0
- package/server/lib/small-model/DOCUMENTATION.md +14 -7
- package/server/lib/small-model/client.js +7 -4
- package/server/lib/small-model/index.js +11 -21
- package/server/lib/small-model/index.test.js +13 -26
- package/server/lib/spaces/DOCUMENTATION.md +79 -25
- package/server/lib/spaces/gatekeeper-channel.js +63 -11
- package/server/lib/spaces/gatekeeper-channel.test.js +34 -4
- package/server/lib/spaces/gatekeeper-program.cjs +64 -13
- package/server/lib/spaces/gatekeeper-program.test.js +115 -3
- package/server/lib/spaces/host.js +58 -13
- package/server/lib/spaces/host.test.js +34 -1
- package/server/lib/spaces/idle-stop.js +98 -0
- package/server/lib/spaces/idle-stop.test.js +130 -0
- package/server/lib/spaces/journey.js +427 -17
- package/server/lib/spaces/journey.test.js +592 -5
- package/server/lib/spaces/layout.js +27 -6
- package/server/lib/spaces/manager.test.js +1 -1
- package/server/lib/spaces/places/contract-suite.js +4 -2
- package/server/lib/spaces/places/docker-live-support.js +27 -4
- package/server/lib/spaces/places/docker.js +32 -5
- package/server/lib/spaces/places/docker.test.js +38 -8
- package/server/lib/spaces/places/escape-suite.js +32 -0
- package/server/lib/spaces/places/fake-docker.js +3 -1
- package/server/lib/spaces/places/grants.docker.live.test.js +197 -0
- package/server/lib/spaces/places/memory-place.js +3 -3
- package/server/lib/spaces/places/sessions.docker.live.test.js +4 -2
- package/server/lib/spaces/routes.js +49 -1
- package/server/lib/spaces/routes.test.js +31 -3
- package/server/lib/spaces/space-opencode.js +52 -0
- package/server/lib/spaces/space-opencode.test.js +41 -0
- package/server/lib/spaces/space-records.js +90 -2
- package/server/lib/spaces/space-records.test.js +58 -1
- package/server/lib/spaces/space-server.js +13 -1
- package/server/lib/spaces/space-server.test.js +13 -0
- package/server/lib/spaces/space-setup.js +173 -0
- package/server/lib/spaces/space-setup.test.js +174 -0
- package/server/lib/tts/DOCUMENTATION.md +3 -0
- package/server/lib/tts/base-url.js +8 -0
- package/server/lib/tts/routes.js +13 -1
- package/server/lib/tts/routes.test.js +26 -0
- package/server/lib/tunnels/DOCUMENTATION.md +2 -0
- package/server/lib/tunnels/routes.js +14 -0
- package/server/lib/tunnels/routes.test.js +26 -0
- package/server/lib/walkthrough/index.js +11 -7
- package/server/lib/walkthrough/jobs.test.js +8 -0
- package/server/lib/walkthrough/languages.js +1 -0
- package/server/lib/walkthrough/routes.js +7 -1
- package/dist/assets/FilesView-0Ie20mEk.js +0 -17
- package/dist/assets/LinearIssuesView-CSl2MUfA.js +0 -1
- package/dist/assets/MarkdownRendererImpl-DVHqZoug.js +0 -12
- package/dist/assets/OnboardingScreen-CIdXJpfc.js +0 -1
- package/dist/assets/PlanView-DEIi3Q7M.js +0 -5
- package/dist/assets/PluginPane-BEPUWVho.js +0 -3
- package/dist/assets/SettingsView-CiNh-RbW.js +0 -30
- package/dist/assets/WalkthroughView-6oE-MuDL.js +0 -4
- package/dist/assets/de-CgAJ51z7.js +0 -10
- package/dist/assets/es-zGi_ravM.js +0 -16
- package/dist/assets/fr-CPfogrWx.js +0 -14
- package/dist/assets/index-CHfphYL3.js +0 -41
- package/dist/assets/index-DvMJ3w6V.css +0 -1
- package/dist/assets/ja-DMk6wd-U.js +0 -16
- package/dist/assets/ko-BFpzJ8jc.js +0 -16
- package/dist/assets/main-anyZFMIs.js +0 -896
- package/dist/assets/markdownCore-CmM47cAE.js +0 -7
- package/dist/assets/pl-VdRPcZrB.js +0 -16
- package/dist/assets/pt-BR-BRys_lOW.js +0 -16
- package/dist/assets/renderElectronMiniChatApp-C5677jy0.js +0 -2
- package/dist/assets/renderMobileApp-D4dBBAqQ.js +0 -25
- package/dist/assets/runtimeEndpointReset-5r0hkd-2.js +0 -27
- package/dist/assets/tr-CA9ckNnm.js +0 -7
- package/dist/assets/uk-byjR-y8D.js +0 -16
- package/dist/assets/useAppFontEffects-BWQZ5DeI.js +0 -7341
- package/dist/assets/useInlineCommentController-DlFyVfBu.js +0 -2
- package/dist/assets/vendor-opencode-client-DYdsLbCM.js +0 -12
- package/dist/assets/zh-CN-DRabgxdG.js +0 -16
- package/dist/assets/zh-TW-rbY5c9UK.js +0 -16
package/dist/index.html
CHANGED
|
@@ -515,17 +515,17 @@
|
|
|
515
515
|
pointer-events: none;
|
|
516
516
|
}
|
|
517
517
|
</style>
|
|
518
|
-
<script type="module" crossorigin src="/assets/main-
|
|
518
|
+
<script type="module" crossorigin src="/assets/main-CzjTMTfW.js"></script>
|
|
519
519
|
<link rel="modulepreload" crossorigin href="/assets/vendor-vite-runtime-DD1OZmLC.js">
|
|
520
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-zod-
|
|
520
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-zod-CxRSdNoV.js">
|
|
521
521
|
<link rel="modulepreload" crossorigin href="/assets/vendor-scheduler-7OC5HNn7.js">
|
|
522
522
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BUCujlKS.js">
|
|
523
523
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-BAGL70zf.js">
|
|
524
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
525
|
-
<link rel="modulepreload" crossorigin href="/assets/index-
|
|
524
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-DSZl7jSi.js">
|
|
525
|
+
<link rel="modulepreload" crossorigin href="/assets/index-CgR5rJq_.js">
|
|
526
526
|
<link rel="modulepreload" crossorigin href="/assets/contextPanelEmbeddedChat-CirXEPJq.js">
|
|
527
527
|
<link rel="modulepreload" crossorigin href="/assets/vendor-katex-CHD9BdDO.js">
|
|
528
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
528
|
+
<link rel="stylesheet" crossorigin href="/assets/index-adyy_sEk.css">
|
|
529
529
|
<link rel="stylesheet" crossorigin href="/assets/vendor-katex-Cp579UoJ.css">
|
|
530
530
|
</head>
|
|
531
531
|
<body class="h-full bg-background text-foreground">
|
package/dist/mini-chat.html
CHANGED
|
@@ -74,16 +74,16 @@
|
|
|
74
74
|
}
|
|
75
75
|
</style>
|
|
76
76
|
|
|
77
|
-
<script type="module" crossorigin src="/assets/miniChat-
|
|
77
|
+
<script type="module" crossorigin src="/assets/miniChat-CP68IL8Q.js"></script>
|
|
78
78
|
<link rel="modulepreload" crossorigin href="/assets/vendor-vite-runtime-DD1OZmLC.js">
|
|
79
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-zod-
|
|
79
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-zod-CxRSdNoV.js">
|
|
80
80
|
<link rel="modulepreload" crossorigin href="/assets/vendor-scheduler-7OC5HNn7.js">
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BUCujlKS.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-BAGL70zf.js">
|
|
83
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
84
|
-
<link rel="modulepreload" crossorigin href="/assets/index-
|
|
83
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-DSZl7jSi.js">
|
|
84
|
+
<link rel="modulepreload" crossorigin href="/assets/index-CgR5rJq_.js">
|
|
85
85
|
<link rel="modulepreload" crossorigin href="/assets/vendor-katex-CHD9BdDO.js">
|
|
86
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
86
|
+
<link rel="stylesheet" crossorigin href="/assets/index-adyy_sEk.css">
|
|
87
87
|
<link rel="stylesheet" crossorigin href="/assets/vendor-katex-Cp579UoJ.css">
|
|
88
88
|
</head>
|
|
89
89
|
<body class="h-full bg-background text-foreground">
|
package/dist/mobile.html
CHANGED
|
@@ -63,16 +63,16 @@
|
|
|
63
63
|
})();
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
|
-
<script type="module" crossorigin src="/assets/mobile-
|
|
66
|
+
<script type="module" crossorigin src="/assets/mobile-BrlBrNfZ.js"></script>
|
|
67
67
|
<link rel="modulepreload" crossorigin href="/assets/vendor-vite-runtime-DD1OZmLC.js">
|
|
68
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-zod-
|
|
68
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-zod-CxRSdNoV.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/vendor-scheduler-7OC5HNn7.js">
|
|
70
70
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BUCujlKS.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-BAGL70zf.js">
|
|
72
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
73
|
-
<link rel="modulepreload" crossorigin href="/assets/index-
|
|
72
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-DSZl7jSi.js">
|
|
73
|
+
<link rel="modulepreload" crossorigin href="/assets/index-CgR5rJq_.js">
|
|
74
74
|
<link rel="modulepreload" crossorigin href="/assets/vendor-katex-CHD9BdDO.js">
|
|
75
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
75
|
+
<link rel="stylesheet" crossorigin href="/assets/index-adyy_sEk.css">
|
|
76
76
|
<link rel="stylesheet" crossorigin href="/assets/vendor-katex-Cp579UoJ.css">
|
|
77
77
|
</head>
|
|
78
78
|
<body class="h-full bg-background text-foreground">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openchamber/web",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./server/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dev": "bun run build:watch",
|
|
16
16
|
"dev:server": "bun ../../scripts/build-builtin-extensions.mjs && OPENCHAMBER_RELAY_HOST=${OPENCHAMBER_RELAY_HOST:-off} bun server/index.js --port ${OPENCHAMBER_PORT:-3001}",
|
|
17
17
|
"dev:server:watch": "bun ../../scripts/build-builtin-extensions.mjs && node ./scripts/dev-server-watch.mjs",
|
|
18
|
-
"build": "bun ../../scripts/build-builtin-extensions.mjs && vite build",
|
|
18
|
+
"build": "bun ../../scripts/build-builtin-extensions.mjs && NODE_OPTIONS=--max-old-space-size=6144 vite build",
|
|
19
19
|
"build:watch": "bun ../../scripts/build-builtin-extensions.mjs && vite build --watch",
|
|
20
20
|
"prepack": "bun ../../scripts/build-builtin-extensions.mjs",
|
|
21
21
|
"type-check": "tsc --noEmit",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@clack/prompts": "^1.1.0",
|
|
28
28
|
"@octokit/rest": "^22.0.1",
|
|
29
|
-
"@openchamber/sdk": "2.0.
|
|
30
|
-
"@opencode/client": "2.0.
|
|
31
|
-
"@opencode/schema": "2.0.
|
|
29
|
+
"@openchamber/sdk": "2.0.4",
|
|
30
|
+
"@opencode/client": "2.0.18",
|
|
31
|
+
"@opencode/schema": "2.0.18",
|
|
32
32
|
"@simplewebauthn/server": "13.3.3",
|
|
33
33
|
"bun-pty": "^0.4.5",
|
|
34
34
|
"compression": "^1.8.1",
|
package/server/index.js
CHANGED
|
@@ -21,9 +21,11 @@ import { createNgrokTunnelProvider } from './lib/tunnels/providers/ngrok.js';
|
|
|
21
21
|
import { createRequestSecurityRuntime } from './lib/security/request-security.js';
|
|
22
22
|
import {
|
|
23
23
|
getUnauthenticatedLanErrorMessage,
|
|
24
|
+
isLoopbackBindHost,
|
|
24
25
|
isNetworkExposedBindHost,
|
|
25
26
|
isUnsafeUnauthenticatedLanAllowed,
|
|
26
27
|
} from './lib/security/bind-host.js';
|
|
28
|
+
import { isNetworkAccessBlocked, NETWORK_ACCESS_BLOCKED_ERROR } from './lib/enterprise-mode.js';
|
|
27
29
|
import {
|
|
28
30
|
TUNNEL_MODE_MANAGED_LOCAL,
|
|
29
31
|
TUNNEL_MODE_MANAGED_REMOTE,
|
|
@@ -99,6 +101,9 @@ import { createNotificationTemplateRuntime } from './lib/notifications/template-
|
|
|
99
101
|
import { createPermissionAutoAcceptRuntime } from './lib/permission-auto-accept/runtime.js';
|
|
100
102
|
import { createMessageQueueRuntime } from './lib/message-queue/runtime.js';
|
|
101
103
|
import { createRoutingRuntime } from './lib/routing/runtime.js';
|
|
104
|
+
import { createJevClient } from './lib/routing/jev.js';
|
|
105
|
+
import { createSessionWorkRuntime } from './lib/session-work/runtime.js';
|
|
106
|
+
import { createSessionLineage } from './lib/session-lineage.js';
|
|
102
107
|
import { createGracefulShutdownRuntime } from './lib/opencode/shutdown-runtime.js';
|
|
103
108
|
import { beginGuestServiceHost, beginGuestServiceShutdown, stopAllGuestServices } from './lib/guests/service.js';
|
|
104
109
|
import { findInstalledGuest } from './lib/guests/catalog.js';
|
|
@@ -113,12 +118,14 @@ import { createAgentMemoryActions } from './lib/agent-memory/actions.js';
|
|
|
113
118
|
import { createMemoryProjectResolver } from './lib/agent-memory/project-resolution.js';
|
|
114
119
|
import { isAgentMemoryFeatureAvailable } from './lib/agent-memory/feature-flag.js';
|
|
115
120
|
import { createSpacesHost } from './lib/spaces/host.js';
|
|
121
|
+
import { readIdleStopSetting, startIdleStop } from './lib/spaces/idle-stop.js';
|
|
122
|
+
import { SPACE_IDLE_EXIT_CODE } from './lib/spaces/layout.js';
|
|
116
123
|
import { createSwitchController, registerSpaceRoutes } from './lib/spaces/routes.js';
|
|
117
124
|
import { resolvePrimaryWorktreeRoot } from './lib/git/service.js';
|
|
118
125
|
import { createRemoteClientAuthRuntime } from './lib/client-auth/remote-clients.js';
|
|
119
126
|
import { createClientPairingRuntime } from './lib/client-auth/pairing.js';
|
|
120
127
|
import { attachRealtimeProxy } from './lib/realtime-proxy.js';
|
|
121
|
-
import { createRelayService } from './lib/relay/service.js';
|
|
128
|
+
import { createRelayService, relayBlockedByEnterprise } from './lib/relay/service.js';
|
|
122
129
|
import { createRelayHostLock } from './lib/relay/host-lock.js';
|
|
123
130
|
import { createAgentToolRuntime } from './lib/agent-tool/runtime.js';
|
|
124
131
|
import { createBrowserControlBroker } from './lib/browser-control/broker.js';
|
|
@@ -544,6 +551,18 @@ const persistSessionMetadataPatch = async (sessionID, patch, { directory = '' }
|
|
|
544
551
|
return metadata;
|
|
545
552
|
};
|
|
546
553
|
|
|
554
|
+
/** A metadata change decided against the record at write time; broadcast only when it changed. */
|
|
555
|
+
const updateSessionMetadataWith = async (sessionID, decide, { directory = '' } = {}) => {
|
|
556
|
+
const result = await sessionMetadataStore.updateSessionMetadata(sessionID, decide, { directory });
|
|
557
|
+
if (result.changed) {
|
|
558
|
+
broadcastOpenChamberUiEvent({
|
|
559
|
+
type: 'openchamber:session-metadata',
|
|
560
|
+
properties: { sessionID, metadata: result.metadata },
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
return result;
|
|
564
|
+
};
|
|
565
|
+
|
|
547
566
|
const sessionRuntime = createSessionRuntime({
|
|
548
567
|
writeSseEvent,
|
|
549
568
|
getNotificationClients: () => uiNotificationClients,
|
|
@@ -880,6 +899,9 @@ const maybeSendPushForTrigger = (...args) => notificationTriggerRuntime.maybeSen
|
|
|
880
899
|
const setAutoAcceptSession = (sessionId, enabled) => permissionAutoAcceptRuntime.setSessionPolicy(sessionId, enabled);
|
|
881
900
|
clearPendingPushBadge = () => notificationTriggerRuntime.clearPendingPushBadge();
|
|
882
901
|
|
|
902
|
+
// Which sessions are subsessions: per-turn work skips them without reading.
|
|
903
|
+
const sessionLineage = createSessionLineage();
|
|
904
|
+
|
|
883
905
|
const sessionAssistRuntime = createSessionAssistRuntime({
|
|
884
906
|
buildOpenCodeUrl,
|
|
885
907
|
getOpenCodeAuthHeaders,
|
|
@@ -888,12 +910,17 @@ const sessionAssistRuntime = createSessionAssistRuntime({
|
|
|
888
910
|
persistSessionMetadataPatch(sessionID, { openchamber: { assist } }, { directory }),
|
|
889
911
|
// Declared further down; only ever called after startup.
|
|
890
912
|
isSessionArchived: (sessionID) => openChamberSessionService.archiveStore.isArchived(sessionID),
|
|
913
|
+
// Declared further down; only ever called after startup.
|
|
914
|
+
evaluateTurn: (input) => sessionWorkRuntime.evaluateTurnEnd(input),
|
|
915
|
+
lineage: sessionLineage,
|
|
891
916
|
});
|
|
892
917
|
|
|
893
918
|
const sessionGoalRuntime = createSessionGoalRuntime({
|
|
894
919
|
buildOpenCodeUrl,
|
|
895
920
|
getOpenCodeAuthHeaders,
|
|
896
921
|
getSmallModelService: async () => import('./lib/small-model/index.js'),
|
|
922
|
+
classifierEndpoint: () => routingRuntime.classifierEndpoint(),
|
|
923
|
+
jev: createJevClient(),
|
|
897
924
|
readSessionMetadata: readStoredSessionMetadata,
|
|
898
925
|
persistSessionGoal: (sessionID, directory, goal) =>
|
|
899
926
|
persistSessionMetadataPatch(sessionID, { openchamber: { goal } }, { directory }),
|
|
@@ -909,7 +936,7 @@ const sessionGoalRuntime = createSessionGoalRuntime({
|
|
|
909
936
|
: (status === 'budgetLimited' ? 'Goal reached its token budget' : 'Goal blocked');
|
|
910
937
|
const detail = goal?.statusReason && goal.statusReason !== 'verified by audit' && goal.statusReason !== 'reported by agent'
|
|
911
938
|
? goal.statusReason
|
|
912
|
-
:
|
|
939
|
+
: '';
|
|
913
940
|
const objective = typeof goal?.objective === 'string' ? goal.objective.slice(0, 140) : '';
|
|
914
941
|
const notificationPayload = {
|
|
915
942
|
title,
|
|
@@ -976,6 +1003,20 @@ const routingRuntime = createRoutingRuntime({
|
|
|
976
1003
|
broadcastGlobalUiEvent: broadcastOpenChamberUiEvent,
|
|
977
1004
|
});
|
|
978
1005
|
|
|
1006
|
+
// "In work": Jev opens a session when real work starts in it and hints when a
|
|
1007
|
+
// turn looks like the end of it. The same turn-end call gates session assist.
|
|
1008
|
+
const sessionWorkRuntime = createSessionWorkRuntime({
|
|
1009
|
+
buildOpenCodeUrl,
|
|
1010
|
+
getOpenCodeAuthHeaders,
|
|
1011
|
+
classifierEndpoint: () => routingRuntime.classifierEndpoint(),
|
|
1012
|
+
jev: createJevClient(),
|
|
1013
|
+
readMetadata: (sessionID, directory) => sessionMetadataStore.get(sessionID, { directory }),
|
|
1014
|
+
updateMetadata: updateSessionMetadataWith,
|
|
1015
|
+
isSessionArchived: (sessionID) => openChamberSessionService.archiveStore.isArchived(sessionID),
|
|
1016
|
+
chatRoots: [path.join(OPENCHAMBER_USER_CONFIG_ROOT, 'chats'), OPENCHAMBER_CHATS_DIR],
|
|
1017
|
+
lineage: sessionLineage,
|
|
1018
|
+
});
|
|
1019
|
+
|
|
979
1020
|
const permissionAutoAcceptRuntime = createPermissionAutoAcceptRuntime({
|
|
980
1021
|
globalEventHub: globalMessageStreamHub,
|
|
981
1022
|
buildOpenCodeUrl,
|
|
@@ -985,10 +1026,13 @@ const permissionAutoAcceptRuntime = createPermissionAutoAcceptRuntime({
|
|
|
985
1026
|
broadcastGlobalUiEvent,
|
|
986
1027
|
evaluatePermission: (permission, directory) => routingRuntime.evaluatePermission(permission, directory),
|
|
987
1028
|
onPermissionReplied: (permissionId) => routingRuntime.forgetPermission(permissionId),
|
|
1029
|
+
resolveLegacyEnabledMode: async () => ((await routingRuntime.legacySafetyNetEnabled()) ? 'safety' : 'auto'),
|
|
988
1030
|
});
|
|
989
1031
|
permissionAutoAcceptRuntime.start();
|
|
1032
|
+
// A request the safety net held still needs the user, so only one that was
|
|
1033
|
+
// actually answered automatically skips the notification.
|
|
990
1034
|
notificationTriggerRuntime.setGetIsSessionAutoAccepting(
|
|
991
|
-
(sessionId, directory) => permissionAutoAcceptRuntime.
|
|
1035
|
+
(sessionId, directory, permissionId) => permissionAutoAcceptRuntime.isPermissionAutoAnswered(sessionId, directory, permissionId),
|
|
992
1036
|
);
|
|
993
1037
|
|
|
994
1038
|
// Queued follow-up messages are delivered by the server so a closed tab or a
|
|
@@ -1036,7 +1080,9 @@ globalMessageStreamHub.subscribeEvent((event) => {
|
|
|
1036
1080
|
if (payload.type === 'session.idle' && payload.properties?.aborted === true) {
|
|
1037
1081
|
agentToolRuntime?.abortSession?.(payload.properties.sessionID);
|
|
1038
1082
|
}
|
|
1083
|
+
sessionLineage.observe(payload);
|
|
1039
1084
|
sessionAssistRuntime.processPayload(payload, directory || payload.properties?.directory || '');
|
|
1085
|
+
sessionWorkRuntime.processPayload(payload, directory || payload.properties?.directory || '');
|
|
1040
1086
|
sessionGoalRuntime.processPayload(payload, directory || payload.properties?.directory || '');
|
|
1041
1087
|
contextObligatoryRuntime.processPayload(payload, directory || payload.properties?.directory || '');
|
|
1042
1088
|
linearSessionStatusRuntime.processPayload(payload);
|
|
@@ -1657,6 +1703,7 @@ const gracefulShutdownRuntime = createGracefulShutdownRuntime({
|
|
|
1657
1703
|
syncToHmrState,
|
|
1658
1704
|
openCodeWatcherRuntime,
|
|
1659
1705
|
sessionAssistRuntime,
|
|
1706
|
+
sessionWorkRuntime,
|
|
1660
1707
|
sessionGoalRuntime,
|
|
1661
1708
|
contextObligatoryRuntime,
|
|
1662
1709
|
messageQueueRuntime,
|
|
@@ -1779,7 +1826,7 @@ async function main(options = {}) {
|
|
|
1779
1826
|
if (h && h !== '127.0.0.1' && h !== 'localhost' && h !== '::1') lanHost = effectiveBindHost;
|
|
1780
1827
|
}
|
|
1781
1828
|
const lan = lanHost ? `http://${lanHost.includes(':') ? `[${lanHost}]` : lanHost}:${activePort}` : null;
|
|
1782
|
-
return { local, lan, relayAvailable:
|
|
1829
|
+
return { local, lan, relayAvailable: !relayBlockedByEnterprise() };
|
|
1783
1830
|
};
|
|
1784
1831
|
// ALL direct LAN URLs this server is currently reachable on, for the
|
|
1785
1832
|
// candidates-refresh endpoint: the address the requesting client already
|
|
@@ -1822,6 +1869,12 @@ async function main(options = {}) {
|
|
|
1822
1869
|
) {
|
|
1823
1870
|
throw new Error(getUnauthenticatedLanErrorMessage(effectiveBindHost));
|
|
1824
1871
|
}
|
|
1872
|
+
// Enterprise mode keeps the server on this machine unless the administrator
|
|
1873
|
+
// allowed network access. The server is a package anyone can install, so
|
|
1874
|
+
// this holds for the CLI and --host as much as for the desktop toggle.
|
|
1875
|
+
if (isNetworkExposedBindHost(effectiveBindHost) && isNetworkAccessBlocked()) {
|
|
1876
|
+
throw new Error(NETWORK_ACCESS_BLOCKED_ERROR);
|
|
1877
|
+
}
|
|
1825
1878
|
const tryCfTunnel = options.tryCfTunnel === true;
|
|
1826
1879
|
const apiOnly = options.apiOnly === true || isEnvFlagEnabled(process.env.OPENCHAMBER_API_ONLY);
|
|
1827
1880
|
const shouldUseCanonicalTunnelConfig = typeof options.tunnelMode === 'string'
|
|
@@ -1887,6 +1940,8 @@ async function main(options = {}) {
|
|
|
1887
1940
|
const settings = await readSettingsFromDiskMigrated();
|
|
1888
1941
|
return sanitizeProjects(settings?.projects || []).map((project) => project.path);
|
|
1889
1942
|
},
|
|
1943
|
+
readIdleStop: async () => readIdleStopSetting((await readSettingsFromDiskMigrated())?.isolatedSpacesIdleStop),
|
|
1944
|
+
saveIdleStop: (setting) => persistSettings({ isolatedSpacesIdleStop: setting }),
|
|
1890
1945
|
});
|
|
1891
1946
|
const startupSettings = await readSettingsFromDiskMigrated().catch(() => null);
|
|
1892
1947
|
if (startupSettings?.isolatedSpacesEnabled === true) {
|
|
@@ -1949,6 +2004,13 @@ async function main(options = {}) {
|
|
|
1949
2004
|
expressApp = app;
|
|
1950
2005
|
server = http.createServer(app);
|
|
1951
2006
|
gracefulShutdownRuntime.trackServerConnections(server);
|
|
2007
|
+
// A policy placed while the server runs cannot rebind it, so connections
|
|
2008
|
+
// from other machines are dropped until the next start binds loopback.
|
|
2009
|
+
if (isNetworkExposedBindHost(effectiveBindHost)) {
|
|
2010
|
+
server.on('connection', (socket) => {
|
|
2011
|
+
if (!isLoopbackBindHost(socket.remoteAddress ?? '') && isNetworkAccessBlocked()) socket.destroy();
|
|
2012
|
+
});
|
|
2013
|
+
}
|
|
1952
2014
|
// Same pattern for the tunnel runtime: created after the base routes so
|
|
1953
2015
|
// /api/system/info resolves port + tunnel URL lazily at request time.
|
|
1954
2016
|
let tunnelRuntimeContextHolder = null;
|
|
@@ -2333,6 +2395,22 @@ async function main(options = {}) {
|
|
|
2333
2395
|
}, 60_000);
|
|
2334
2396
|
relayReconcileTimer.unref?.();
|
|
2335
2397
|
|
|
2398
|
+
// The server inside an isolated space stops itself after the user's idle hours, and the space's
|
|
2399
|
+
// container with it (DESIGN.md, decision 11). Only a space's environment names the setting's
|
|
2400
|
+
// file, so this never runs anywhere else. The exit code tells the host why it stopped.
|
|
2401
|
+
const spaceIdleStopFile = process.env.OPENCHAMBER_SPACE_IDLE_STOP_FILE;
|
|
2402
|
+
if (spaceIdleStopFile) {
|
|
2403
|
+
startIdleStop({
|
|
2404
|
+
settingsPath: spaceIdleStopFile,
|
|
2405
|
+
readSessionStates: () => sessionRuntime.getSessionStateSnapshot(),
|
|
2406
|
+
readPendingRequests: () => sessionRuntime.getPendingBlockingRequestsSnapshot(),
|
|
2407
|
+
stopSpace: async () => {
|
|
2408
|
+
await gracefulShutdown({ exitProcess: false }).catch(() => {});
|
|
2409
|
+
process.exit(SPACE_IDLE_EXIT_CODE);
|
|
2410
|
+
},
|
|
2411
|
+
});
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2336
2414
|
return {
|
|
2337
2415
|
expressApp: app,
|
|
2338
2416
|
httpServer: server,
|
|
@@ -17,7 +17,7 @@ the user can want independently:
|
|
|
17
17
|
`agentNotifyToolEnabled` is `true`, and the control service refuses the
|
|
18
18
|
action when the setting is off, so a stale plugin cannot keep paging.
|
|
19
19
|
|
|
20
|
-
Both default to on, are toggled in Settings → General →
|
|
20
|
+
Both default to on, are toggled in Settings → General → OpenChamber Tools, and take
|
|
21
21
|
effect in the running OpenCode within a couple of seconds — OpenChamber rewrites
|
|
22
22
|
the managed config file OpenCode watches (see
|
|
23
23
|
`lib/opencode/managed-config-file.js`). Installs where the user's own
|
|
@@ -28,6 +28,13 @@ from the schema rather than leaving them visible. The plugin is injected only
|
|
|
28
28
|
when OpenChamber launches and owns the OpenCode process, and not at all when
|
|
29
29
|
both settings are `false`.
|
|
30
30
|
|
|
31
|
+
- Every tool is registered with `options: { codemode: false }`, so it is a
|
|
32
|
+
direct tool in the model's tool list. OpenCode 2 otherwise puts plugin tools
|
|
33
|
+
behind its Code Mode `execute` tool, where the model sees only a
|
|
34
|
+
size-limited catalog; with a few large MCP servers ours dropped out of it and
|
|
35
|
+
agents concluded the tool did not exist. `agentToolsCodeMode: true` (the
|
|
36
|
+
"Run through Code Mode" checkbox in the same section, off by default) flips
|
|
37
|
+
all of them to `codemode: true`.
|
|
31
38
|
- The plugin accepts the action's inputs either inside `parameters` or beside
|
|
32
39
|
`action`, because models produce both shapes; an explicit `parameters` object
|
|
33
40
|
wins on a conflict. Rejecting the flattened shape turned a call that plainly
|
|
@@ -186,9 +186,14 @@ const resolveConcreteBoundAddress = (value) => {
|
|
|
186
186
|
* answer with an empty completion instead of an error, and the `oneOf` branches
|
|
187
187
|
* are what carry the per-action descriptions the model reads.
|
|
188
188
|
*/
|
|
189
|
-
const createToolEntry = ({ name, description, definitions, parameters }) => String.raw` tools.add({
|
|
189
|
+
const createToolEntry = ({ name, description, definitions, parameters, codeMode }) => String.raw` tools.add({
|
|
190
190
|
name: ${JSON.stringify(name)},
|
|
191
191
|
description: ${JSON.stringify(description)},
|
|
192
|
+
// OpenCode 2 puts a plugin tool behind its Code Mode execute tool
|
|
193
|
+
// unless told otherwise. There the model sees only a size-limited
|
|
194
|
+
// catalog, and with a few large MCP servers ours dropped out of it, so
|
|
195
|
+
// agents concluded the tool did not exist. Direct is the default.
|
|
196
|
+
options: { codemode: ${codeMode ? 'true' : 'false'} },
|
|
192
197
|
input: {
|
|
193
198
|
type: "object",
|
|
194
199
|
properties: {
|
|
@@ -259,7 +264,7 @@ const createToolEntry = ({ name, description, definitions, parameters }) => Stri
|
|
|
259
264
|
})
|
|
260
265
|
`;
|
|
261
266
|
|
|
262
|
-
const createPluginSource = ({ includeControl, includeWeb, includeMemory, includeNotify }) => {
|
|
267
|
+
const createPluginSource = ({ includeControl, includeWeb, includeMemory, includeNotify, codeMode }) => {
|
|
263
268
|
const entries = [];
|
|
264
269
|
if (includeControl) {
|
|
265
270
|
entries.push(createToolEntry({
|
|
@@ -267,6 +272,7 @@ const createPluginSource = ({ includeControl, includeWeb, includeMemory, include
|
|
|
267
272
|
description: CONTROL_TOOL_DESCRIPTION,
|
|
268
273
|
definitions: OPENCHAMBER_AGENT_TOOL_ACTION_DEFINITIONS,
|
|
269
274
|
parameters: CONTROL_PARAMETER_PROPERTIES,
|
|
275
|
+
codeMode,
|
|
270
276
|
}));
|
|
271
277
|
}
|
|
272
278
|
if (includeWeb) {
|
|
@@ -275,6 +281,7 @@ const createPluginSource = ({ includeControl, includeWeb, includeMemory, include
|
|
|
275
281
|
description: WEB_TOOL_DESCRIPTION,
|
|
276
282
|
definitions: OPENCHAMBER_WEB_ACTION_DEFINITIONS,
|
|
277
283
|
parameters: WEB_PARAMETER_PROPERTIES,
|
|
284
|
+
codeMode,
|
|
278
285
|
}));
|
|
279
286
|
}
|
|
280
287
|
if (includeMemory) {
|
|
@@ -283,6 +290,7 @@ const createPluginSource = ({ includeControl, includeWeb, includeMemory, include
|
|
|
283
290
|
description: MEMORY_TOOL_DESCRIPTION,
|
|
284
291
|
definitions: OPENCHAMBER_MEMORY_ACTION_DEFINITIONS,
|
|
285
292
|
parameters: MEMORY_PARAMETER_PROPERTIES,
|
|
293
|
+
codeMode,
|
|
286
294
|
}));
|
|
287
295
|
}
|
|
288
296
|
if (includeNotify) {
|
|
@@ -291,6 +299,7 @@ const createPluginSource = ({ includeControl, includeWeb, includeMemory, include
|
|
|
291
299
|
description: NOTIFY_TOOL_DESCRIPTION,
|
|
292
300
|
definitions: OPENCHAMBER_NOTIFY_ACTION_DEFINITIONS,
|
|
293
301
|
parameters: NOTIFY_PARAMETER_PROPERTIES,
|
|
302
|
+
codeMode,
|
|
294
303
|
}));
|
|
295
304
|
}
|
|
296
305
|
|
|
@@ -356,13 +365,13 @@ export const createAgentToolRuntime = (dependencies) => {
|
|
|
356
365
|
* change while it runs, so the source on disk always matches the settings —
|
|
357
366
|
* the running OpenCode reloads the directory it already has configured.
|
|
358
367
|
*/
|
|
359
|
-
const materializePlugin = async ({ includeControl = true, includeWeb = true, includeMemory = true, includeNotify = false } = {}) => {
|
|
368
|
+
const materializePlugin = async ({ includeControl = true, includeWeb = true, includeMemory = true, includeNotify = false, codeMode = false } = {}) => {
|
|
360
369
|
if (!includeControl && !includeWeb && !includeMemory && !includeNotify) {
|
|
361
370
|
throw new Error('At least one OpenChamber managed tool must be enabled to inject the plugin');
|
|
362
371
|
}
|
|
363
372
|
await fsPromises.mkdir(pluginDirectory, { recursive: true });
|
|
364
373
|
await fsPromises.writeFile(pluginManifestPath, PLUGIN_PACKAGE_JSON, { mode: 0o600 });
|
|
365
|
-
await fsPromises.writeFile(pluginPath, createPluginSource({ includeControl, includeWeb, includeMemory, includeNotify }), { mode: 0o600 });
|
|
374
|
+
await fsPromises.writeFile(pluginPath, createPluginSource({ includeControl, includeWeb, includeMemory, includeNotify, codeMode }), { mode: 0o600 });
|
|
366
375
|
return pluginDirectory;
|
|
367
376
|
};
|
|
368
377
|
|
|
@@ -264,6 +264,21 @@ describe('managed agent tool runtime', () => {
|
|
|
264
264
|
expect(Object.keys(await loadTools(plainDir, 'nonotify'))).toEqual(['openchamber']);
|
|
265
265
|
});
|
|
266
266
|
|
|
267
|
+
it('registers every tool as a direct tool unless Code Mode is asked for', async () => {
|
|
268
|
+
const { runtime, dataDir } = await createRuntime();
|
|
269
|
+
await prepareManagedEnv(runtime, { includeControl: true, includeWeb: true, includeMemory: true, includeNotify: true });
|
|
270
|
+
const direct = await loadTools(dataDir, 'direct');
|
|
271
|
+
for (const tool of Object.values(direct)) {
|
|
272
|
+
expect(tool.options).toEqual({ codemode: false });
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
await prepareManagedEnv(runtime, { includeControl: true, includeWeb: true, includeMemory: true, includeNotify: true, codeMode: true });
|
|
276
|
+
const behindExecute = await loadTools(dataDir, 'codemode');
|
|
277
|
+
for (const tool of Object.values(behindExecute)) {
|
|
278
|
+
expect(tool.options).toEqual({ codemode: true });
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
|
|
267
282
|
it('refuses to inject a plugin with no tools in it', async () => {
|
|
268
283
|
const { runtime } = await createRuntime();
|
|
269
284
|
let failed = false;
|
|
@@ -4,13 +4,16 @@ Messages explicitly pinned by the user are stored under
|
|
|
4
4
|
`session.metadata.openchamber.context_obligatory_messages` as `{ id, createdAt,
|
|
5
5
|
role }`. The UI uses a fresh-read metadata merge when pinning or unpinning.
|
|
6
6
|
|
|
7
|
-
The server runtime listens for
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
The server runtime listens for `session.compacted`. OpenCode 2.x declares that
|
|
8
|
+
event but never publishes it; the server's wire translator
|
|
9
|
+
(`event-stream/translate-v2.js`) produces it from `session.compaction.ended`.
|
|
10
|
+
The runtime finds the newest completed `compaction` message,
|
|
11
|
+
fetches every pinned message by ID, keeps non-empty text content, sorts them by
|
|
12
|
+
the stored creation time, and posts one message to
|
|
13
|
+
`/api/session/:id/synthetic` with `resume: false`, together with the session's
|
|
14
|
+
pinned project knowledge. Missing individual messages are skipped without
|
|
15
|
+
discarding the remaining context. Other events perform no work and make no
|
|
16
|
+
requests.
|
|
14
17
|
|
|
15
18
|
After a successful send, the runtime merge-writes
|
|
16
19
|
`context_obligatory_last_compaction_message_id`. This cursor prevents a
|
|
@@ -104,7 +104,8 @@ export const createContextObligatoryRuntime = ({
|
|
|
104
104
|
const recentMessages = Array.isArray(recent?.data) ? recent.data : [];
|
|
105
105
|
if (recentMessages.length === 0) return;
|
|
106
106
|
const summary = recentMessages.find((message) => message?.type === 'compaction' && message?.status === 'completed');
|
|
107
|
-
|
|
107
|
+
// A v2 compaction message has only `time.created`; `status` says it finished.
|
|
108
|
+
if (!summary?.id) return;
|
|
108
109
|
if (state.openchamber.context_obligatory_last_compaction_message_id === summary.id) return;
|
|
109
110
|
|
|
110
111
|
const fetched = await Promise.allSettled(state.messages.map(async (pinned) => {
|
|
@@ -4,15 +4,12 @@ import { createContextObligatoryRuntime } from './runtime.js';
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Pinned messages and the compaction cursor live in OpenChamber's own session
|
|
7
|
-
* metadata store
|
|
8
|
-
*
|
|
9
|
-
* compaction is now recognised by the `compaction` message role rather than by
|
|
10
|
-
* `info.summary`.
|
|
7
|
+
* metadata store. `readSessionMetadata` and `persistContextCursor` are the
|
|
8
|
+
* seams; without both the runtime stays inert and says so once.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* because every shape it asserted on belongs to v1.
|
|
10
|
+
* `session.compacted` is the hub's translation of OpenCode 2's
|
|
11
|
+
* `session.compaction.ended`. The v2 compaction message carries only
|
|
12
|
+
* `time.created`, so the fake below has no `time.completed` on purpose.
|
|
16
13
|
*/
|
|
17
14
|
|
|
18
15
|
const runtimes = [];
|
|
@@ -28,42 +25,91 @@ const makeRuntime = (overrides = {}) => {
|
|
|
28
25
|
return { runtime, buildOpenCodeUrl };
|
|
29
26
|
};
|
|
30
27
|
|
|
28
|
+
const compactionEvent = () => ({ type: 'session.compacted', properties: { sessionID: 'ses_1' } });
|
|
29
|
+
|
|
30
|
+
const json = (body) => new Response(JSON.stringify(body), { status: 200, headers: { 'content-type': 'application/json' } });
|
|
31
|
+
|
|
32
|
+
/** A v2 OpenCode holding one finished compaction and two pinned messages. */
|
|
33
|
+
const fakeOpenCode = () => {
|
|
34
|
+
const synthetic = [];
|
|
35
|
+
const fetchMock = vi.fn(async (url, init) => {
|
|
36
|
+
const path = new URL(url).pathname;
|
|
37
|
+
if (path === '/api/session/ses_1') return json({ data: { id: 'ses_1' } });
|
|
38
|
+
if (path === '/api/session/ses_1/message') {
|
|
39
|
+
return json({
|
|
40
|
+
data: [
|
|
41
|
+
{ id: 'msg_compact', type: 'compaction', status: 'completed', reason: 'auto', summary: 'S', recent: '', time: { created: 5 } },
|
|
42
|
+
{ id: 'msg_a', type: 'assistant', content: [{ type: 'text', text: 'Old answer' }], time: { created: 2 } },
|
|
43
|
+
],
|
|
44
|
+
cursor: {},
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (path === '/api/session/ses_1/message/msg_u') return json({ data: { id: 'msg_u', type: 'user', text: 'Keep this rule', time: { created: 1 } } });
|
|
48
|
+
if (path === '/api/session/ses_1/message/msg_a') {
|
|
49
|
+
return json({ data: { id: 'msg_a', type: 'assistant', content: [{ type: 'reasoning', text: 'x' }, { type: 'text', text: 'Old answer' }], time: { created: 2 } } });
|
|
50
|
+
}
|
|
51
|
+
if (path === '/api/session/ses_1/synthetic') {
|
|
52
|
+
synthetic.push(JSON.parse(init.body));
|
|
53
|
+
return json({ data: {} });
|
|
54
|
+
}
|
|
55
|
+
return new Response('not found', { status: 404 });
|
|
56
|
+
});
|
|
57
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
58
|
+
return { synthetic, fetchMock };
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const pinnedMetadata = (extra = {}) => ({
|
|
62
|
+
openchamber: {
|
|
63
|
+
context_obligatory_messages: [
|
|
64
|
+
{ id: 'msg_a', createdAt: 2, role: 'assistant' },
|
|
65
|
+
{ id: 'msg_u', createdAt: 1, role: 'user' },
|
|
66
|
+
],
|
|
67
|
+
...extra,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
31
71
|
afterEach(() => {
|
|
32
72
|
while (runtimes.length > 0) runtimes.pop().stop();
|
|
33
73
|
vi.restoreAllMocks();
|
|
74
|
+
vi.unstubAllGlobals();
|
|
34
75
|
});
|
|
35
76
|
|
|
36
77
|
describe('context obligatory runtime', () => {
|
|
37
|
-
it('
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
78
|
+
it('re-sends pinned messages after a finished compaction and records the cursor', async () => {
|
|
79
|
+
const { synthetic } = fakeOpenCode();
|
|
80
|
+
const persistContextCursor = vi.fn(async () => undefined);
|
|
81
|
+
const { runtime } = makeRuntime({ readSessionMetadata: async () => pinnedMetadata(), persistContextCursor });
|
|
82
|
+
|
|
83
|
+
await runtime.processPayload(compactionEvent(), '/repo');
|
|
84
|
+
|
|
85
|
+
expect(synthetic).toHaveLength(1);
|
|
86
|
+
expect(synthetic[0].resume).toBe(false);
|
|
87
|
+
const text = synthetic[0].text;
|
|
88
|
+
expect(text.indexOf('Keep this rule')).toBeGreaterThan(-1);
|
|
89
|
+
expect(text.indexOf('Keep this rule')).toBeLessThan(text.indexOf('Old answer'));
|
|
90
|
+
expect(text).not.toContain('\nx\n');
|
|
91
|
+
expect(persistContextCursor).toHaveBeenCalledWith('ses_1', '/repo', {
|
|
92
|
+
openchamber: { context_obligatory_last_compaction_message_id: 'msg_compact' },
|
|
93
|
+
});
|
|
44
94
|
});
|
|
45
95
|
|
|
46
|
-
it('
|
|
47
|
-
const
|
|
48
|
-
const { runtime
|
|
49
|
-
readSessionMetadata,
|
|
96
|
+
it('does not re-send for a compaction it already handled', async () => {
|
|
97
|
+
const { synthetic } = fakeOpenCode();
|
|
98
|
+
const { runtime } = makeRuntime({
|
|
99
|
+
readSessionMetadata: async () => pinnedMetadata({ context_obligatory_last_compaction_message_id: 'msg_compact' }),
|
|
50
100
|
persistContextCursor: vi.fn(async () => undefined),
|
|
51
101
|
});
|
|
52
|
-
vi.stubGlobal('fetch', vi.fn(async () => new Response(JSON.stringify({ id: 'ses_1' }), {
|
|
53
|
-
status: 200, headers: { 'content-type': 'application/json' },
|
|
54
|
-
})));
|
|
55
102
|
|
|
56
|
-
await runtime.processPayload(
|
|
103
|
+
await runtime.processPayload(compactionEvent(), '/repo');
|
|
57
104
|
|
|
58
|
-
expect(
|
|
59
|
-
expect(readSessionMetadata).toHaveBeenCalledWith('ses_1');
|
|
105
|
+
expect(synthetic).toHaveLength(0);
|
|
60
106
|
});
|
|
61
107
|
|
|
62
|
-
it('
|
|
108
|
+
it('needs both seams: a read alone leaves it inert', async () => {
|
|
63
109
|
vi.spyOn(console, 'log').mockImplementation(() => {});
|
|
64
|
-
const { runtime, buildOpenCodeUrl } = makeRuntime();
|
|
110
|
+
const { runtime, buildOpenCodeUrl } = makeRuntime({ readSessionMetadata: async () => ({}) });
|
|
65
111
|
|
|
66
|
-
await runtime.processPayload(
|
|
112
|
+
await runtime.processPayload(compactionEvent());
|
|
67
113
|
|
|
68
114
|
expect(buildOpenCodeUrl).not.toHaveBeenCalled();
|
|
69
115
|
});
|
|
@@ -72,7 +118,7 @@ describe('context obligatory runtime', () => {
|
|
|
72
118
|
const log = vi.spyOn(console, 'log').mockImplementation(() => {});
|
|
73
119
|
const { runtime } = makeRuntime();
|
|
74
120
|
|
|
75
|
-
runtime.processPayload(
|
|
121
|
+
runtime.processPayload(compactionEvent());
|
|
76
122
|
runtime.processPayload({ type: 'session.idle', properties: { sessionID: 'ses_2' } });
|
|
77
123
|
|
|
78
124
|
const notices = log.mock.calls.filter(([line]) => String(line).includes('[context-obligatory] parked'));
|
|
@@ -84,7 +130,7 @@ describe('context obligatory runtime', () => {
|
|
|
84
130
|
const { runtime } = makeRuntime();
|
|
85
131
|
|
|
86
132
|
runtime.stop();
|
|
87
|
-
runtime.processPayload(
|
|
133
|
+
runtime.processPayload(compactionEvent());
|
|
88
134
|
|
|
89
135
|
expect(log).not.toHaveBeenCalled();
|
|
90
136
|
});
|
|
@@ -50,7 +50,10 @@ response carries `X-Speech-Model` and `X-Speech-Language`.
|
|
|
50
50
|
status route reports per-model install/download state.
|
|
51
51
|
- `openai-compatible`: buffered per-segment transcription against any
|
|
52
52
|
OpenAI-compatible `/v1/audio/transcriptions` endpoint
|
|
53
|
-
(`openai-compatible-session.js`, reuses `../tts/stt.js`).
|
|
53
|
+
(`openai-compatible-session.js`, reuses `../tts/stt.js`). `connect()`
|
|
54
|
+
runs the same URL check as every transcription
|
|
55
|
+
(`normalizeCustomOpenAIBaseURL`), so a refused host — any remote one in
|
|
56
|
+
enterprise mode — fails before the user dictates.
|
|
54
57
|
- `local/` — worker process + client (IPC, idle shutdown TTL), sherpa
|
|
55
58
|
recognizer engine and segment session (one decode per committed segment),
|
|
56
59
|
model catalog and downloader. The native `sherpa-onnx-node` addon is only
|