@openchamber/web 2.3.0 → 2.3.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/dist/assets/AboutDialog-C1ulAXh5.js +1 -0
- package/dist/assets/ArchiveView-DJo1Bpw_.js +1 -0
- package/dist/assets/{CommandPalette-1VlA7PbL.js → CommandPalette-B6r6DPF9.js} +2 -2
- package/dist/assets/{DiffView-SHdJJ6tl.js → DiffView-mJuVm7Z4.js} +2 -2
- package/dist/assets/{FilePreviewCommentMenu-DlVgwRsr.js → FilePreviewCommentMenu-Ca4ziuof.js} +1 -1
- package/dist/assets/{FilesView-BeMtsSlV.js → FilesView-BBFbfDp9.js} +3 -3
- package/dist/assets/{GitView-npRGKKx8.js → GitView-WL1wkRFF.js} +3 -3
- package/dist/assets/GuestSurfacePane-peVDY5gW.js +1 -0
- package/dist/assets/HelpDialog-Dxc2yneu.js +1 -0
- package/dist/assets/{InProgressOperationBanner-B6iO22_7.js → InProgressOperationBanner-Dy0RiPsD.js} +1 -1
- package/dist/assets/JsonTreeView-BKUmh7Iw.js +1 -0
- package/dist/assets/MarkdownImageGallery-Cd6hLNmi.js +1 -0
- package/dist/assets/MarkdownRendererImpl-C-3B3mBt.js +1 -0
- package/dist/assets/MemoryDebugPanel-b116r1SF.js +1 -0
- package/dist/assets/OnboardingScreen-vBEhpU3q.js +1 -0
- package/dist/assets/OpenCodeStatusDialog-DH7dJ6MH.js +1 -0
- package/dist/assets/{PatchDiff-Du2s7T3U.js → PatchDiff-yM7vgQgi.js} +1 -1
- package/dist/assets/{PierreDiffViewer-B9K0gBvV.js → PierreDiffViewer-DnHKbYGl.js} +1 -1
- package/dist/assets/{PlanView-IkTcPrbw.js → PlanView-j0hLJmto.js} +2 -2
- package/dist/assets/RunOverview-ZuFZvDcu.js +2 -0
- package/dist/assets/ScheduledTasksDialog-UKXFFI91.js +5 -0
- package/dist/assets/{SettingsView-DIy5ZL4-.js → SettingsView-gB_NvyX4.js} +8 -8
- package/dist/assets/SettingsWindow-Dfb_RFpD.js +1 -0
- package/dist/assets/SourceBoardView-BjaL0nKs.js +1 -0
- package/dist/assets/SpaceAccessDialog-XzHRmIdT.js +1 -0
- package/dist/assets/SpaceApplyDialog-CxX9mrzT.js +1 -0
- package/dist/assets/{SpaceRow-YPmKQKeD.js → SpaceRow-vCpOCANO.js} +1 -1
- package/dist/assets/SpaceSetupOutput-CDZvJCf_.js +1 -0
- package/dist/assets/SpacesView-D3a9bCzn.js +1 -0
- package/dist/assets/{SubmoduleDiffSummary-RDY5md3p.js → SubmoduleDiffSummary-CQyRcvDZ.js} +1 -1
- package/dist/assets/{ToolOutputDialog-Dx85XZJs.js → ToolOutputDialog-judR_5mS.js} +2 -2
- package/dist/assets/{ToolPartDiffPreview-Dtv0xF9O.js → ToolPartDiffPreview-Ca9ISxfg.js} +1 -1
- package/dist/assets/UsageStatsView-C63Emjfj.js +1 -0
- package/dist/assets/{Virtualizer-DL535kyR.js → Virtualizer-DNgIEKcx.js} +1 -1
- package/dist/assets/{WalkthroughView-DcxbT5tc.js → WalkthroughView-D74b_7sC.js} +2 -2
- package/dist/assets/WorktreesView-hcm8Eb_C.js +1 -0
- package/dist/assets/appThemeRegistry-COeayQaQ.js +1 -0
- package/dist/assets/{ar-lP51qqz9.js → ar-1_zdYVV5.js} +2 -2
- package/dist/assets/computeVirtualFileMetrics-MZqvCQy0.js +3 -0
- package/dist/assets/{de-CpROAvTV.js → de-Ci7SGEQP.js} +3 -3
- package/dist/assets/{decorate-BNB7jeKg.js → decorate-CZeRRVC7.js} +1 -1
- package/dist/assets/{es-Bb8LKRhE.js → es-ZJii-6Tt.js} +2 -2
- package/dist/assets/{fr-BlNN9FC2.js → fr-C-hK8mvI.js} +2 -2
- package/dist/assets/{he-r546pCuc.js → he-t07CylP8.js} +2 -2
- package/dist/assets/index-D2tPUss-.js +1 -0
- package/dist/assets/{initializeSharedPreferences-dCHO04bl.js → initializeSharedPreferences-FxFkTjgn.js} +1 -1
- package/dist/assets/{isDiffPlainText-BwicHPpI.js → isDiffPlainText-C1F9opE5.js} +1 -1
- package/dist/assets/{isFilePlainText-Dk2R7BJo.js → isFilePlainText-B4SyJ-ni.js} +1 -1
- package/dist/assets/{ja-evNvJAHz.js → ja-iJr8aONy.js} +2 -2
- package/dist/assets/{katex-CMY-1eWf.css → katex-BEX7X_K8.css} +1 -1
- package/dist/assets/{katex.min-Iw9WSgM9.js → katex.min-C-51hS9A.js} +18 -18
- package/dist/assets/{ko-BPQP7lXe.js → ko-D5ow_yz-.js} +2 -2
- package/dist/assets/main-BtGnuno4.js +1048 -0
- package/dist/assets/main-uj5954n5.js +2 -0
- package/dist/assets/markdownCore-rBXCnAJp.js +9 -0
- package/dist/assets/miniChat-yWQmT2OS.js +2 -0
- package/dist/assets/mobile-NDAeGtzL.js +2 -0
- package/dist/assets/{moveWorkspacePath-B31RGdgu.js → moveWorkspacePath-BINgpJ9S.js} +1 -1
- package/dist/assets/{nl-CkQXd1nU.js → nl-CfqYrSVe.js} +2 -2
- package/dist/assets/{parseDiffFromFile-DcsKSY0J.js → parseDiffFromFile--DE4eHIp.js} +2 -2
- package/dist/assets/{patchFileDiff-Cx-HpjyI.js → patchFileDiff-BfFUmWgS.js} +1 -1
- package/dist/assets/pierreDiffTint-D9K6_CVD.js +29 -0
- package/dist/assets/{pl-C4i9Aizi.js → pl-Bn2_jAhL.js} +4 -4
- package/dist/assets/{pt-BR-CoYnG1CH.js → pt-BR-ZSDgn6cI.js} +2 -2
- package/dist/assets/relocateRestoredSession-C85Tk2y9.js +1 -0
- package/dist/assets/renderElectronMiniChatApp-BvAEmWhZ.js +2 -0
- package/dist/assets/{renderMobileApp-gDKxRJQi.js → renderMobileApp-T20l8ise.js} +7 -7
- package/dist/assets/{restartOpenCode-dq-SGun3.js → restartOpenCode-VEmIrLer.js} +1 -1
- package/dist/assets/runtimeEndpointReset-ExJsaWzA.js +55 -0
- package/dist/assets/scheduledTasksApi-NSyxVfHu.js +1 -0
- package/dist/assets/{selectionMarkdown-sDTBbKLh.js → selectionMarkdown-BJ2RhTXc.js} +2 -2
- package/dist/assets/{sessionOwnership-kZAtwMQd.js → sessionOwnership-BAX1xEJC.js} +1 -1
- package/dist/assets/{shikiHighlight-BRNXPlF-.js → shikiHighlight-DOzrE7BE.js} +1 -1
- package/dist/assets/{space-apply-CCOKLfrX.js → space-apply-DB_ZfJBW.js} +1 -1
- package/dist/assets/space-close-1kNlTkW1.js +1 -0
- package/dist/assets/{spaceNetwork-DUxJClu3.js → spaceNetwork-DA16ov_y.js} +1 -1
- package/dist/assets/{textMateThemeFromAppTheme-B6UJwdZz.js → textMateThemeFromAppTheme-BfIrjFAU.js} +1 -1
- package/dist/assets/{tr-D-_lz-lC.js → tr-C89uz1hs.js} +2 -2
- package/dist/assets/{uk-B49PGMYB.js → uk-uTYVPFrO.js} +2 -2
- package/dist/assets/{useAppFontEffects-3EN8Ava3.js → useAppFontEffects-C1ceAD51.js} +185 -185
- package/dist/assets/useCallableModelProviders-BkLsgs6y.js +1 -0
- package/dist/assets/{useInlineCommentController-l9cWyfuR.js → useInlineCommentController-ynkUsoVA.js} +1 -1
- package/dist/assets/{useRootScrollLock-UAQn24Y8.js → useRootScrollLock-DnoKH1HE.js} +2 -2
- package/dist/assets/{vendor-codemirror-autocomplete-C8FBSI9t.js → vendor-codemirror-autocomplete-BRKmCSiY.js} +1 -1
- package/dist/assets/{vendor-codemirror-commands-BhRb6jns.js → vendor-codemirror-commands-MmBpgSOc.js} +1 -1
- package/dist/assets/vendor-codemirror-lang-angular-Bj5Pk8sp.js +1 -0
- package/dist/assets/vendor-codemirror-lang-cpp-tZt-BOgi.js +1 -0
- package/dist/assets/vendor-codemirror-lang-css-DfdrZ848.js +1 -0
- package/dist/assets/{vendor-codemirror-lang-go-BHJEONih.js → vendor-codemirror-lang-go-C9OcoXdP.js} +2 -2
- package/dist/assets/vendor-codemirror-lang-html-C5kFuJzc.js +1 -0
- package/dist/assets/vendor-codemirror-lang-java-Divn2dnj.js +1 -0
- package/dist/assets/{vendor-codemirror-lang-javascript-CUmSxayT.js → vendor-codemirror-lang-javascript-DmPuKUEa.js} +2 -2
- package/dist/assets/vendor-codemirror-lang-jinja-B-8miA-Q.js +1 -0
- package/dist/assets/vendor-codemirror-lang-json-L0wsFFxi.js +1 -0
- package/dist/assets/vendor-codemirror-lang-less-CWlCIxCI.js +1 -0
- package/dist/assets/vendor-codemirror-lang-liquid-Dm8xthAW.js +1 -0
- package/dist/assets/vendor-codemirror-lang-markdown-CPn-qinN.js +1 -0
- package/dist/assets/vendor-codemirror-lang-php-DKIOifjN.js +1 -0
- package/dist/assets/vendor-codemirror-lang-python-BAVa3Hg5.js +3 -0
- package/dist/assets/vendor-codemirror-lang-rust-Dab90hdg.js +1 -0
- package/dist/assets/vendor-codemirror-lang-sass-eezaHFBZ.js +1 -0
- package/dist/assets/{vendor-codemirror-lang-sql-C1Jj9uuJ.js → vendor-codemirror-lang-sql-Vu-PR7cv.js} +2 -2
- package/dist/assets/vendor-codemirror-lang-vue-BthRGZHy.js +1 -0
- package/dist/assets/vendor-codemirror-lang-wast-Db6KSic0.js +1 -0
- package/dist/assets/vendor-codemirror-lang-xml-DQkh4sc1.js +1 -0
- package/dist/assets/vendor-codemirror-lang-yaml-Bt2N__AW.js +1 -0
- package/dist/assets/vendor-codemirror-language-DkBxRck3.js +3 -0
- package/dist/assets/vendor-codemirror-language-data-CTYHXywt.js +2 -0
- package/dist/assets/{vendor-codemirror-search-CvXM_pZg.js → vendor-codemirror-search-BKAwkhkm.js} +1 -1
- package/dist/assets/vendor-codemirror-streamparser-CmlTsbN2.js +1 -0
- package/dist/assets/vendor-codemirror-view-B66jUSmE.js +4 -0
- package/dist/assets/{vendor-replit-codemirror-vim-Ck2X_WZC.js → vendor-replit-codemirror-vim-D0bqFa1D.js} +5 -5
- package/dist/assets/{worker-DdhrXE7g.js → worker-BbEdJ2Oi.js} +18 -18
- package/dist/assets/workerFactory-Bw5qLmrM.js +1 -0
- package/dist/assets/{zh-CN-CS-9Os9n.js → zh-CN-DdTNG52a.js} +2 -2
- package/dist/assets/{zh-TW-D0XYVdcl.js → zh-TW-DPm_33Fi.js} +2 -2
- package/dist/index.html +3 -3
- package/dist/mini-chat.html +3 -3
- package/dist/mobile.html +3 -3
- package/package.json +2 -2
- package/server/index.js +4 -0
- package/server/lib/environment/store.js +3 -4
- package/server/lib/environment/store.test.js +17 -0
- package/server/lib/fs/DOCUMENTATION.md +4 -2
- package/server/lib/fs/routes.js +48 -13
- package/server/lib/fs/routes.test.js +118 -5
- package/server/lib/git/DOCUMENTATION.md +3 -1
- package/server/lib/git/contributor-remote.js +4 -0
- package/server/lib/git/contributor-remote.test.js +21 -0
- package/server/lib/git/service.js +20 -25
- package/server/lib/git/service.test.js +99 -0
- package/server/lib/git/worktree-creation.js +4 -5
- package/server/lib/github/DOCUMENTATION.md +1 -1
- package/server/lib/github/routes.auth.test.js +14 -0
- package/server/lib/github/routes.js +13 -5
- package/server/lib/github/routes.mutations.test.js +18 -2
- package/server/lib/message-queue/DOCUMENTATION.md +8 -2
- package/server/lib/message-queue/runtime.js +3 -2
- package/server/lib/message-queue/runtime.test.js +64 -2
- package/server/lib/openchamber-control/service.js +48 -13
- package/server/lib/openchamber-control/service.test.js +42 -0
- package/server/lib/opencode/DOCUMENTATION.md +3 -1
- package/server/lib/opencode/project-start-command.d.ts +11 -0
- package/server/lib/opencode/project-start-command.js +56 -0
- package/server/lib/opencode/project-start-command.test.js +80 -0
- package/server/lib/opencode/session-activity.js +43 -3
- package/server/lib/opencode/session-activity.test.js +97 -0
- package/server/lib/opencode/settings-runtime.js +19 -1
- package/server/lib/opencode/settings-runtime.test.js +23 -0
- package/server/lib/opencode/skill-routes.js +34 -1
- package/server/lib/opencode/skill-routes.test.js +99 -0
- package/server/lib/quota/DOCUMENTATION.md +13 -1
- package/server/lib/quota/providers/antigravity/api.js +104 -0
- package/server/lib/quota/providers/antigravity/auth.js +45 -0
- package/server/lib/quota/providers/antigravity/index.js +76 -0
- package/server/lib/quota/providers/antigravity/transforms.js +168 -0
- package/server/lib/quota/providers/antigravity/transforms.test.js +162 -0
- package/server/lib/quota/providers/codex.js +28 -4
- package/server/lib/quota/providers/codex.test.js +29 -0
- package/server/lib/quota/providers/google/auth.js +4 -49
- package/server/lib/quota/providers/google/transforms.js +3 -22
- package/server/lib/quota/providers/index.js +8 -0
- package/server/lib/quota/providers/opencode-go.js +3 -1
- package/server/lib/quota/providers/opencode-go.test.js +12 -0
- package/server/lib/routing/DOCUMENTATION.md +3 -1
- package/server/lib/routing/runtime.js +34 -1
- package/server/lib/routing/runtime.test.js +43 -1
- package/server/lib/scheduled-tasks/DOCUMENTATION.md +11 -0
- package/server/lib/scheduled-tasks/existing-session.js +52 -8
- package/server/lib/scheduled-tasks/existing-session.test.js +121 -0
- package/server/lib/scheduled-tasks/routes.js +26 -0
- package/server/lib/scheduled-tasks/runtime.js +1 -0
- package/server/lib/session-assist/runtime.js +3 -0
- package/server/lib/session-assist/runtime.test.js +47 -0
- package/server/lib/skills-catalog/DOCUMENTATION.md +10 -1
- package/server/lib/skills-catalog/install.js +1 -1
- package/server/lib/skills-catalog/installed-sources.d.ts +17 -0
- package/server/lib/skills-catalog/installed-sources.js +112 -0
- package/server/lib/skills-catalog/installed-sources.test.js +94 -0
- package/server/lib/small-model/DOCUMENTATION.md +12 -5
- package/server/lib/small-model/index.js +6 -4
- package/server/lib/small-model/index.test.js +40 -0
- package/server/lib/small-model/routes.js +3 -2
- package/server/lib/source-control/change-request-worktree.js +2 -6
- package/server/lib/source-control/mutation-storage.js +4 -1
- package/server/lib/source-control/mutation-storage.test.js +21 -0
- package/server/lib/spaces/DOCUMENTATION.md +1 -1
- package/server/lib/spaces/journey.js +10 -3
- package/server/lib/spaces/journey.test.js +13 -1
- package/server/lib/terminal/history.js +22 -2
- package/server/lib/terminal/history.test.js +23 -0
- package/server/lib/terminal/theme-response.js +14 -0
- package/server/lib/terminal/theme-response.test.js +10 -0
- package/dist/assets/AboutDialog-e8ek_kPI.js +0 -1
- package/dist/assets/ArchiveView-CjF4_TFg.js +0 -1
- package/dist/assets/GuestSurfacePane-4kmEXPLD.js +0 -1
- package/dist/assets/HelpDialog-CITMqPDK.js +0 -1
- package/dist/assets/JsonTreeView-xGikhCtL.js +0 -1
- package/dist/assets/MarkdownImageGallery-D0FJyr7C.js +0 -1
- package/dist/assets/MarkdownRendererImpl-BIM7Pjwk.js +0 -1
- package/dist/assets/MemoryDebugPanel-CBk8QW-M.js +0 -1
- package/dist/assets/OnboardingScreen-Cy6ARiMS.js +0 -1
- package/dist/assets/OpenCodeStatusDialog-YMHuJzwt.js +0 -1
- package/dist/assets/RunOverview-CHkGSW1x.js +0 -2
- package/dist/assets/ScheduledTasksDialog-77SO8zdJ.js +0 -4
- package/dist/assets/SettingsWindow-X74FIkdo.js +0 -1
- package/dist/assets/SourceBoardView-Cff2ejOW.js +0 -1
- package/dist/assets/SpaceAccessDialog-BXMZNRei.js +0 -1
- package/dist/assets/SpaceApplyDialog-BEJd2ryu.js +0 -1
- package/dist/assets/SpaceSetupOutput-Cb3XcIII.js +0 -1
- package/dist/assets/SpacesView-I3HaRKtW.js +0 -1
- package/dist/assets/UsageStatsView-DwTt9zIz.js +0 -1
- package/dist/assets/WorktreesView-Bh7GLvrR.js +0 -1
- package/dist/assets/appThemeRegistry-Bzb67M9O.js +0 -1
- package/dist/assets/computeVirtualFileMetrics-WAp98Bb7.js +0 -3
- package/dist/assets/index-BsupKM40.js +0 -1
- package/dist/assets/main-C_QGhDBL.js +0 -1048
- package/dist/assets/main-pWZ7F_hy.js +0 -2
- package/dist/assets/markdownCore-6gz4uJDQ.js +0 -9
- package/dist/assets/miniChat-DnaTfdYh.js +0 -2
- package/dist/assets/mobile-C7DIJqP8.js +0 -2
- package/dist/assets/pierreDiffTint-B297eqF0.js +0 -28
- package/dist/assets/relocateRestoredSession-D3lujODj.js +0 -1
- package/dist/assets/renderElectronMiniChatApp-BF4hNe69.js +0 -2
- package/dist/assets/runtimeEndpointReset-D6Lxhk0S.js +0 -55
- package/dist/assets/scheduledTasksApi-DUbAMrjW.js +0 -1
- package/dist/assets/space-close-CWcWwH4_.js +0 -1
- package/dist/assets/useCallableModelProviders-BB9xkUzM.js +0 -1
- package/dist/assets/vendor-codemirror-lang-angular-BpYCRJSk.js +0 -1
- package/dist/assets/vendor-codemirror-lang-cpp-BI3uPyjT.js +0 -1
- package/dist/assets/vendor-codemirror-lang-css-B2_PZTBl.js +0 -1
- package/dist/assets/vendor-codemirror-lang-html-BpvvTxbZ.js +0 -1
- package/dist/assets/vendor-codemirror-lang-java-BM5LQZ4u.js +0 -1
- package/dist/assets/vendor-codemirror-lang-jinja-D8nLZQPK.js +0 -1
- package/dist/assets/vendor-codemirror-lang-json-VDxF27mO.js +0 -1
- package/dist/assets/vendor-codemirror-lang-less-BecU2BJP.js +0 -1
- package/dist/assets/vendor-codemirror-lang-liquid-DCw83Anh.js +0 -1
- package/dist/assets/vendor-codemirror-lang-markdown-CimQAQbQ.js +0 -1
- package/dist/assets/vendor-codemirror-lang-php-C5Kpnpyb.js +0 -1
- package/dist/assets/vendor-codemirror-lang-python-BFE1OJNx.js +0 -3
- package/dist/assets/vendor-codemirror-lang-rust-hqZDyGIJ.js +0 -1
- package/dist/assets/vendor-codemirror-lang-sass-CAZML-Jl.js +0 -1
- package/dist/assets/vendor-codemirror-lang-vue-BHOTXcKp.js +0 -1
- package/dist/assets/vendor-codemirror-lang-wast-DcCHfPUI.js +0 -1
- package/dist/assets/vendor-codemirror-lang-xml-BO_V-1wZ.js +0 -1
- package/dist/assets/vendor-codemirror-lang-yaml-CPimap_N.js +0 -1
- package/dist/assets/vendor-codemirror-language-BBADuAkg.js +0 -3
- package/dist/assets/vendor-codemirror-language-data-Cu5ZbrPm.js +0 -2
- package/dist/assets/vendor-codemirror-view-1e0FQ6Wn.js +0 -4
- package/dist/assets/workerFactory-De9YXIdE.js +0 -1
package/dist/index.html
CHANGED
|
@@ -492,15 +492,15 @@
|
|
|
492
492
|
pointer-events: none;
|
|
493
493
|
}
|
|
494
494
|
</style>
|
|
495
|
-
<script type="module" crossorigin src="/assets/main-
|
|
495
|
+
<script type="module" crossorigin src="/assets/main-uj5954n5.js"></script>
|
|
496
496
|
<link rel="modulepreload" crossorigin href="/assets/vendor-vite-runtime-DD1OZmLC.js">
|
|
497
497
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zod-CVhJ1Zpv.js">
|
|
498
498
|
<link rel="modulepreload" crossorigin href="/assets/vendor-scheduler-7OC5HNn7.js">
|
|
499
499
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BUCujlKS.js">
|
|
500
500
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-BAGL70zf.js">
|
|
501
501
|
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-DgOf1DP0.js">
|
|
502
|
-
<link rel="modulepreload" crossorigin href="/assets/katex.min-
|
|
503
|
-
<link rel="stylesheet" crossorigin href="/assets/katex-
|
|
502
|
+
<link rel="modulepreload" crossorigin href="/assets/katex.min-C-51hS9A.js">
|
|
503
|
+
<link rel="stylesheet" crossorigin href="/assets/katex-BEX7X_K8.css">
|
|
504
504
|
</head>
|
|
505
505
|
<body class="h-full bg-background text-foreground">
|
|
506
506
|
<div id="root" class="h-full">
|
package/dist/mini-chat.html
CHANGED
|
@@ -74,15 +74,15 @@
|
|
|
74
74
|
}
|
|
75
75
|
</style>
|
|
76
76
|
|
|
77
|
-
<script type="module" crossorigin src="/assets/miniChat-
|
|
77
|
+
<script type="module" crossorigin src="/assets/miniChat-yWQmT2OS.js"></script>
|
|
78
78
|
<link rel="modulepreload" crossorigin href="/assets/vendor-vite-runtime-DD1OZmLC.js">
|
|
79
79
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zod-CVhJ1Zpv.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
83
|
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-DgOf1DP0.js">
|
|
84
|
-
<link rel="modulepreload" crossorigin href="/assets/katex.min-
|
|
85
|
-
<link rel="stylesheet" crossorigin href="/assets/katex-
|
|
84
|
+
<link rel="modulepreload" crossorigin href="/assets/katex.min-C-51hS9A.js">
|
|
85
|
+
<link rel="stylesheet" crossorigin href="/assets/katex-BEX7X_K8.css">
|
|
86
86
|
</head>
|
|
87
87
|
<body class="h-full bg-background text-foreground">
|
|
88
88
|
<div id="root" class="h-full">
|
package/dist/mobile.html
CHANGED
|
@@ -63,15 +63,15 @@
|
|
|
63
63
|
})();
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
|
-
<script type="module" crossorigin src="/assets/mobile-
|
|
66
|
+
<script type="module" crossorigin src="/assets/mobile-NDAeGtzL.js"></script>
|
|
67
67
|
<link rel="modulepreload" crossorigin href="/assets/vendor-vite-runtime-DD1OZmLC.js">
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zod-CVhJ1Zpv.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
72
|
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-DgOf1DP0.js">
|
|
73
|
-
<link rel="modulepreload" crossorigin href="/assets/katex.min-
|
|
74
|
-
<link rel="stylesheet" crossorigin href="/assets/katex-
|
|
73
|
+
<link rel="modulepreload" crossorigin href="/assets/katex.min-C-51hS9A.js">
|
|
74
|
+
<link rel="stylesheet" crossorigin href="/assets/katex-BEX7X_K8.css">
|
|
75
75
|
</head>
|
|
76
76
|
<body class="h-full bg-background text-foreground">
|
|
77
77
|
<div id="root" class="h-full"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openchamber/web",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./server/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@clack/prompts": "^1.1.0",
|
|
32
32
|
"@gitbeaker/rest": "43.8.0",
|
|
33
33
|
"@octokit/rest": "^22.0.1",
|
|
34
|
-
"@openchamber/sdk": "2.3.
|
|
34
|
+
"@openchamber/sdk": "2.3.1",
|
|
35
35
|
"@opencode/client": "2.0.27",
|
|
36
36
|
"@opencode/schema": "2.0.27",
|
|
37
37
|
"@simplewebauthn/server": "13.3.3",
|
package/server/index.js
CHANGED
|
@@ -84,6 +84,7 @@ import { createBootstrapRuntime } from './lib/opencode/bootstrap-runtime.js';
|
|
|
84
84
|
import { createSessionRuntime } from './lib/opencode/session-runtime.js';
|
|
85
85
|
import { configureOpenCodeRuntimeProviders, resetOpenCodeRuntimeProviders } from './lib/small-model/client.js';
|
|
86
86
|
import { configureOpenCodeCredentials, openCodeCredentialSource } from './lib/opencode/auth.js';
|
|
87
|
+
import { configureProjectStartCommandSource, openCodeProjectStartCommandSource } from './lib/opencode/project-start-command.js';
|
|
87
88
|
import { createOpenCodeWatcherRuntime } from './lib/opencode/watcher.js';
|
|
88
89
|
import { createSessionAssistRuntime } from './lib/session-assist/runtime.js';
|
|
89
90
|
import { createSessionGoalRuntime } from './lib/session-goal/runtime.js';
|
|
@@ -446,6 +447,7 @@ const settingsRuntime = createSettingsRuntime({
|
|
|
446
447
|
normalizeManagedRemoteTunnelPresetTokens,
|
|
447
448
|
syncManagedRemoteTunnelConfigWithPresets,
|
|
448
449
|
upsertManagedRemoteTunnelToken,
|
|
450
|
+
chatRoots: [path.join(OPENCHAMBER_USER_CONFIG_ROOT, 'chats'), OPENCHAMBER_CHATS_DIR],
|
|
449
451
|
onManagedPluginSettingsChanged: () => managedConfigRuntime?.refreshManagedConfigFile(),
|
|
450
452
|
// Declared further down; settings are only saved once the server serves requests.
|
|
451
453
|
onMessageSearchEnabledChanged: (enabled) => messageSearchRuntime.setEnabled(enabled),
|
|
@@ -1525,6 +1527,8 @@ configureOpenCodeCredentials(openCodeCredentialSource({
|
|
|
1525
1527
|
getLaunchEnvironment: () => openCodeLifecycleRuntime.getManagedOpenCodeProcessEnv(),
|
|
1526
1528
|
getDefaultDirectory: () => openCodeLifecycleRuntime.getDefaultOpenCodeDirectory(),
|
|
1527
1529
|
}));
|
|
1530
|
+
// A new worktree runs the start command OpenCode keeps on the project record.
|
|
1531
|
+
configureProjectStartCommandSource(openCodeProjectStartCommandSource({ buildOpenCodeUrl, getOpenCodeAuthHeaders }));
|
|
1528
1532
|
|
|
1529
1533
|
const getOpenCodeCompatibility = async () => {
|
|
1530
1534
|
if (isExternalOpenCode || ENV_SKIP_OPENCODE_START) {
|
|
@@ -172,10 +172,9 @@ export const createEnvironmentStore = ({ filePath }) => {
|
|
|
172
172
|
const current = storedProject(document, projectId) ?? {};
|
|
173
173
|
const variables = applyVariablesPatch(current.variables, patch.variables);
|
|
174
174
|
const command = patch.command === undefined ? current.command : (patch.command || undefined);
|
|
175
|
-
const entry = {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
};
|
|
175
|
+
const entry = {};
|
|
176
|
+
if (Object.keys(variables).length > 0) entry.variables = variables;
|
|
177
|
+
if (command) entry.command = command;
|
|
179
178
|
const projects = { ...(document.projects ?? {}) };
|
|
180
179
|
if (Object.keys(entry).length > 0) projects[projectId] = entry;
|
|
181
180
|
else delete projects[projectId];
|
|
@@ -49,6 +49,23 @@ describe('environment store', () => {
|
|
|
49
49
|
expect(store.describeProject('path_abc')).toEqual({ names: [], command: null });
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
+
it.each([
|
|
53
|
+
[{ variables: { DEBUG: '1' }, command: 'env' }, { variables: { DEBUG: '1' }, command: 'env' }],
|
|
54
|
+
[{ variables: { DEBUG: '1' } }, { variables: { DEBUG: '1' } }],
|
|
55
|
+
[{ command: 'env' }, { command: 'env' }],
|
|
56
|
+
[{}, undefined],
|
|
57
|
+
])('preserves optional project fields for %j', async (patch, expected) => {
|
|
58
|
+
const store = createEnvironmentStore({ filePath });
|
|
59
|
+
await store.updateProject('path_abc', patch);
|
|
60
|
+
const stored = JSON.parse(fs.readFileSync(filePath, 'utf8')).projects?.path_abc;
|
|
61
|
+
expect(stored).toEqual(expected);
|
|
62
|
+
expect(JSON.stringify(stored)).toBe(JSON.stringify(expected));
|
|
63
|
+
const fresh = createEnvironmentStore({ filePath });
|
|
64
|
+
expect(fresh.projectEntry('path_abc')).toEqual({
|
|
65
|
+
variables: expected?.variables ?? {}, command: expected?.command ?? null,
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
52
69
|
it('refuses a malformed patch without writing', async () => {
|
|
53
70
|
const store = createEnvironmentStore({ filePath });
|
|
54
71
|
await store.updateUser({ variables: { KEEP: 'x' } });
|
|
@@ -37,7 +37,9 @@ Own filesystem API behavior for the web server runtime, including workspace-boun
|
|
|
37
37
|
- `GET /api/fs/exec/:jobId`
|
|
38
38
|
- `GET /api/fs/list`
|
|
39
39
|
- `GET /api/fs/git-dirs` — shallow nested git repository discovery for the
|
|
40
|
-
Git tab (
|
|
40
|
+
Git tab (breadth-first readdir walk, capped at depth 3 and 100 visited
|
|
41
|
+
directories so shallow repositories are checked before deeper folders;
|
|
42
|
+
`.git` directory, file, or
|
|
41
43
|
symlink marks a repository boundary; junk directories are skipped;
|
|
42
44
|
symlinked directories are followed, each real directory walked once,
|
|
43
45
|
and repositories are reported under the link path)
|
|
@@ -73,7 +75,7 @@ The Git service validates a selected commit identity before planning or spawning
|
|
|
73
75
|
## Notes for contributors
|
|
74
76
|
- Keep filesystem policy (workspace root checks, error mapping, exec timeout behavior) inside this module, not in the composition root.
|
|
75
77
|
- Keep Git process, transport, credential, cancellation, and clone cleanup policy in the Git network operation service. The legacy clone handler may resolve its compatibility target and map the service result, but must not spawn Git.
|
|
76
|
-
- Workspace checks accept, besides the active workspace and its worktrees, the **managed roots**: the OpenChamber config root and the managed chats root (`managedChatsRoot` dependency; `OPENCHAMBER_CHATS_DIR` upstream, default `<config root>/chats`). Chat worktrees may legitimately live outside every project workspace.
|
|
78
|
+
- Workspace checks accept, besides the active workspace and its worktrees, the **managed roots**: the OpenChamber config root and the managed chats root (`managedChatsRoot` dependency; `OPENCHAMBER_CHATS_DIR` upstream, default `<config root>/chats`). Chat worktrees may legitimately live outside every project workspace. With no project directory resolved, only the chats roots are accepted: the managed chats root and `<config root>/chats`, each also by its canonical path. A first chat then works on an install with no project; the rest of the config root still needs a resolved project.
|
|
77
79
|
- `GET /api/fs/home` preserves `{ home, chatsRoot }` and adds `canonicalChatsRoot` and `canonicalLegacyChatsRoot`, resolved by the server's filesystem. If a root does not exist yet, it resolves the nearest existing ancestor and appends the missing segments, without creating directories. Errors resolving the configured root fail the request. A failed legacy lookup warns and omits only that optional alias, retaining exact legacy matching without blocking an accessible relocated root. Clients use confirmed aliases for exact membership while keeping the original roots as folder/scope identities. `chatsRoot` is the server-resolved managed chats root; clients must use it instead of joining `home` + the well-known segment (a relocated root does not contain that segment).
|
|
78
80
|
- The server creates the managed chats root at startup (`ensureChatsDir` in `lib/data-dir-migration.js`, called from `main`). The UI reads that folder as soon as a new chat opens, and OpenCode fails every read of a missing folder, so on a fresh install the sidebar used to report "Could not initialize workspace" until the first chat created it. A root that cannot be created only logs a warning.
|
|
79
81
|
- Workspace authorization accepts both the configured managed paths and their filesystem-confirmed canonical roots. Canonical lookup runs only when lexical workspace/managed-root checks fail. One failed managed-root lookup cannot reject an independently authorized root or worktree. Path comparisons remain case-sensitive on POSIX: distinct Linux directories named `chats` and `Chats` never become aliases through string folding. Shared UI keeps exact root membership for classification and directory cleanup.
|
package/server/lib/fs/routes.js
CHANGED
|
@@ -313,10 +313,31 @@ const resolveWorkspacePathFromWorktrees = async ({ targetPath, baseDirectory, pa
|
|
|
313
313
|
return { ok: false, error: 'Path is outside of active workspace' };
|
|
314
314
|
};
|
|
315
315
|
|
|
316
|
-
|
|
316
|
+
// Chats belong to no project, so with no project open the chats roots are the
|
|
317
|
+
// only place a path may resolve. The config root stays behind a project.
|
|
318
|
+
const resolveChatsPathWithoutProject = async ({ targetPath, chatsRoots, path, os, fsPromises, normalizeDirectoryPath }) => {
|
|
319
|
+
const resolveIn = (baseDirectory) => resolveWorkspacePath({ targetPath, baseDirectory, path, os, normalizeDirectoryPath, managedRoots: [] });
|
|
320
|
+
for (const root of chatsRoots) {
|
|
321
|
+
const lexical = resolveIn(root);
|
|
322
|
+
if (lexical.ok) return lexical;
|
|
323
|
+
if (lexical.error !== 'Path is outside of active workspace') return null;
|
|
324
|
+
}
|
|
325
|
+
for (const root of chatsRoots) {
|
|
326
|
+
try {
|
|
327
|
+
const canonical = resolveIn(await canonicalDirectoryPath(root, fsPromises, path));
|
|
328
|
+
if (canonical.ok) return canonical;
|
|
329
|
+
} catch (error) {
|
|
330
|
+
console.warn('Failed to resolve chats root:', error);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return null;
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
const resolveWorkspacePathFromContext = async ({ req, targetPath, resolveProjectDirectory, path, os, fsPromises, normalizeDirectoryPath, managedRoots, chatsRoots }) => {
|
|
317
337
|
const resolvedProject = await resolveProjectDirectory(req);
|
|
318
338
|
if (!resolvedProject.directory) {
|
|
319
|
-
|
|
339
|
+
const chatsPath = await resolveChatsPathWithoutProject({ targetPath, chatsRoots, path, os, fsPromises, normalizeDirectoryPath });
|
|
340
|
+
return chatsPath ?? { ok: false, error: resolvedProject.error || 'Active workspace is required' };
|
|
320
341
|
}
|
|
321
342
|
|
|
322
343
|
const resolved = resolveWorkspacePath({
|
|
@@ -395,16 +416,15 @@ const GIT_DIRS_SKIP_LIST = new Set(['node_modules', 'dist', 'build', '.venv', 't
|
|
|
395
416
|
// group them into one project. Each real directory is walked once, so a link
|
|
396
417
|
// loop or two links to one repository cannot repeat it, and repositories are
|
|
397
418
|
// reported under the path the link gives them inside the project.
|
|
419
|
+
// Breadth-first traversal checks shallow siblings before deeper subtrees can
|
|
420
|
+
// exhaust the visit cap.
|
|
398
421
|
const findGitDirectories = async ({ rootPath, fsPromises, path: pathModule, maxDepth, maxDirs }) => {
|
|
399
422
|
const results = [];
|
|
400
423
|
const walkedRealPaths = new Set();
|
|
424
|
+
const queue = [{ dir: rootPath, depth: 0 }];
|
|
401
425
|
let visited = 0;
|
|
402
426
|
|
|
403
|
-
const
|
|
404
|
-
if (visited >= maxDirs) {
|
|
405
|
-
return;
|
|
406
|
-
}
|
|
407
|
-
|
|
427
|
+
const scanDirectory = async (dir, depth) => {
|
|
408
428
|
let realPath;
|
|
409
429
|
try {
|
|
410
430
|
realPath = await fsPromises.realpath(dir);
|
|
@@ -467,14 +487,14 @@ const findGitDirectories = async ({ rootPath, fsPromises, path: pathModule, maxD
|
|
|
467
487
|
|
|
468
488
|
subdirectories.sort();
|
|
469
489
|
for (const name of subdirectories) {
|
|
470
|
-
|
|
471
|
-
break;
|
|
472
|
-
}
|
|
473
|
-
await walk(pathModule.join(dir, name), depth + 1);
|
|
490
|
+
queue.push({ dir: pathModule.join(dir, name), depth: depth + 1 });
|
|
474
491
|
}
|
|
475
492
|
};
|
|
476
493
|
|
|
477
|
-
|
|
494
|
+
for (let index = 0; index < queue.length && visited < maxDirs; index += 1) {
|
|
495
|
+
const { dir, depth } = queue[index];
|
|
496
|
+
await scanDirectory(dir, depth);
|
|
497
|
+
}
|
|
478
498
|
return results;
|
|
479
499
|
};
|
|
480
500
|
|
|
@@ -486,7 +506,7 @@ const deriveCloneDirectoryName = (remoteUrl) => {
|
|
|
486
506
|
return match?.[1]?.trim() || '';
|
|
487
507
|
};
|
|
488
508
|
|
|
489
|
-
const resolveReadPathFromContext = async ({ req, targetPath, scope, resolveProjectDirectory, path, os, fsPromises, normalizeDirectoryPath, managedRoots }) => {
|
|
509
|
+
const resolveReadPathFromContext = async ({ req, targetPath, scope, resolveProjectDirectory, path, os, fsPromises, normalizeDirectoryPath, managedRoots, chatsRoots }) => {
|
|
490
510
|
if (req.query?.allowOutsideWorkspace === 'true') {
|
|
491
511
|
const normalized = normalizeDirectoryPath(targetPath);
|
|
492
512
|
if (!normalized || typeof normalized !== 'string') {
|
|
@@ -505,6 +525,7 @@ const resolveReadPathFromContext = async ({ req, targetPath, scope, resolveProje
|
|
|
505
525
|
fsPromises,
|
|
506
526
|
normalizeDirectoryPath,
|
|
507
527
|
managedRoots,
|
|
528
|
+
chatsRoots,
|
|
508
529
|
});
|
|
509
530
|
};
|
|
510
531
|
|
|
@@ -597,6 +618,8 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
597
618
|
? path.resolve(managedChatsRoot.trim())
|
|
598
619
|
: path.join(openchamberUserConfigRoot, 'chats');
|
|
599
620
|
const managedRoots = [path.resolve(openchamberUserConfigRoot), chatsRoot];
|
|
621
|
+
// A relocated chats root keeps the chats created under the config root valid.
|
|
622
|
+
const chatsRoots = [...new Set([chatsRoot, path.join(openchamberUserConfigRoot, 'chats')])];
|
|
600
623
|
const previewGrants = createPreviewGrants({ crypto });
|
|
601
624
|
const realpathCache = createRealpathCache({
|
|
602
625
|
realpath: fsPromises.realpath.bind(fsPromises),
|
|
@@ -818,6 +841,7 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
818
841
|
os,
|
|
819
842
|
normalizeDirectoryPath,
|
|
820
843
|
managedRoots,
|
|
844
|
+
chatsRoots,
|
|
821
845
|
});
|
|
822
846
|
if (!resolved.ok) {
|
|
823
847
|
return res.status(400).json({ error: resolved.error });
|
|
@@ -1050,6 +1074,7 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
1050
1074
|
fsPromises,
|
|
1051
1075
|
normalizeDirectoryPath,
|
|
1052
1076
|
managedRoots,
|
|
1077
|
+
chatsRoots,
|
|
1053
1078
|
});
|
|
1054
1079
|
if (!resolved.ok) {
|
|
1055
1080
|
if (req.query?.allowOutsideWorkspace === 'true') {
|
|
@@ -1100,6 +1125,7 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
1100
1125
|
fsPromises,
|
|
1101
1126
|
normalizeDirectoryPath,
|
|
1102
1127
|
managedRoots,
|
|
1128
|
+
chatsRoots,
|
|
1103
1129
|
});
|
|
1104
1130
|
if (!resolved.ok) {
|
|
1105
1131
|
if (req.query?.allowOutsideWorkspace === 'true') {
|
|
@@ -1164,6 +1190,7 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
1164
1190
|
fsPromises,
|
|
1165
1191
|
normalizeDirectoryPath,
|
|
1166
1192
|
managedRoots,
|
|
1193
|
+
chatsRoots,
|
|
1167
1194
|
});
|
|
1168
1195
|
if (!resolved.ok) {
|
|
1169
1196
|
if (req.query?.allowOutsideWorkspace === 'true') {
|
|
@@ -1269,6 +1296,7 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
1269
1296
|
fsPromises,
|
|
1270
1297
|
normalizeDirectoryPath,
|
|
1271
1298
|
managedRoots,
|
|
1299
|
+
chatsRoots,
|
|
1272
1300
|
});
|
|
1273
1301
|
if (!resolved.ok) {
|
|
1274
1302
|
return res.status(400).json({ error: resolved.error });
|
|
@@ -1370,6 +1398,7 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
1370
1398
|
os,
|
|
1371
1399
|
normalizeDirectoryPath,
|
|
1372
1400
|
managedRoots,
|
|
1401
|
+
chatsRoots,
|
|
1373
1402
|
});
|
|
1374
1403
|
if (!resolved.ok) {
|
|
1375
1404
|
return res.status(400).json({ error: resolved.error });
|
|
@@ -1441,6 +1470,7 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
1441
1470
|
os,
|
|
1442
1471
|
normalizeDirectoryPath,
|
|
1443
1472
|
managedRoots,
|
|
1473
|
+
chatsRoots,
|
|
1444
1474
|
});
|
|
1445
1475
|
if (!resolved.ok) {
|
|
1446
1476
|
return res.status(400).json({ error: resolved.error });
|
|
@@ -1549,6 +1579,7 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
1549
1579
|
os,
|
|
1550
1580
|
normalizeDirectoryPath,
|
|
1551
1581
|
managedRoots,
|
|
1582
|
+
chatsRoots,
|
|
1552
1583
|
});
|
|
1553
1584
|
if (!resolved.ok) {
|
|
1554
1585
|
return res.status(400).json({ error: resolved.error });
|
|
@@ -1588,6 +1619,7 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
1588
1619
|
os,
|
|
1589
1620
|
normalizeDirectoryPath,
|
|
1590
1621
|
managedRoots,
|
|
1622
|
+
chatsRoots,
|
|
1591
1623
|
});
|
|
1592
1624
|
if (!resolvedOld.ok) {
|
|
1593
1625
|
return res.status(400).json({ error: resolvedOld.error });
|
|
@@ -1602,6 +1634,7 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
1602
1634
|
os,
|
|
1603
1635
|
normalizeDirectoryPath,
|
|
1604
1636
|
managedRoots,
|
|
1637
|
+
chatsRoots,
|
|
1605
1638
|
});
|
|
1606
1639
|
if (!resolvedNew.ok) {
|
|
1607
1640
|
return res.status(400).json({ error: resolvedNew.error });
|
|
@@ -1732,6 +1765,7 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
1732
1765
|
os,
|
|
1733
1766
|
normalizeDirectoryPath,
|
|
1734
1767
|
managedRoots,
|
|
1768
|
+
chatsRoots,
|
|
1735
1769
|
});
|
|
1736
1770
|
if (!resolvedForWorkspace.ok) {
|
|
1737
1771
|
console.warn(`Rejected /api/fs/exec outside workspace: ${resolvedForWorkspace.error}`);
|
|
@@ -1972,6 +2006,7 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
1972
2006
|
os,
|
|
1973
2007
|
normalizeDirectoryPath,
|
|
1974
2008
|
managedRoots,
|
|
2009
|
+
chatsRoots,
|
|
1975
2010
|
});
|
|
1976
2011
|
if (!resolved.ok) {
|
|
1977
2012
|
return res.status(400).json({ error: resolved.error });
|
|
@@ -1743,6 +1743,44 @@ describe('fs git-dirs', () => {
|
|
|
1743
1743
|
]);
|
|
1744
1744
|
});
|
|
1745
1745
|
|
|
1746
|
+
it('finds direct child repositories before an early subtree exhausts the visit cap', async () => {
|
|
1747
|
+
const tree = {
|
|
1748
|
+
'/workspace': [['a-artifacts', 'dir'], ['z-service', 'dir']],
|
|
1749
|
+
'/workspace/a-artifacts': [],
|
|
1750
|
+
'/workspace/z-service': [['.git', 'dir']],
|
|
1751
|
+
};
|
|
1752
|
+
for (let index = 0; index < 120; index += 1) {
|
|
1753
|
+
const name = `output-${index}`;
|
|
1754
|
+
tree['/workspace/a-artifacts'].push([name, 'dir']);
|
|
1755
|
+
tree[`/workspace/a-artifacts/${name}`] = [];
|
|
1756
|
+
}
|
|
1757
|
+
const { handler, readdir } = registerGitDirs(tree);
|
|
1758
|
+
|
|
1759
|
+
const res = await callGitDirs(handler, { path: '/workspace' });
|
|
1760
|
+
|
|
1761
|
+
expect(res.statusCode).toBe(200);
|
|
1762
|
+
expect(res.body.repositories).toEqual([{ path: '/workspace/z-service', name: 'z-service' }]);
|
|
1763
|
+
expect(readdir).toHaveBeenCalledTimes(100);
|
|
1764
|
+
});
|
|
1765
|
+
|
|
1766
|
+
it('returns shallower repositories before deeper ones in deterministic sibling order', async () => {
|
|
1767
|
+
const { handler } = registerGitDirs({
|
|
1768
|
+
'/workspace': [['z-service', 'dir'], ['a-group', 'dir'], ['m-service', 'dir']],
|
|
1769
|
+
'/workspace/a-group': [['nested', 'dir']],
|
|
1770
|
+
'/workspace/a-group/nested': [['.git', 'dir']],
|
|
1771
|
+
'/workspace/m-service': [['.git', 'dir']],
|
|
1772
|
+
'/workspace/z-service': [['.git', 'dir']],
|
|
1773
|
+
});
|
|
1774
|
+
|
|
1775
|
+
const res = await callGitDirs(handler, { path: '/workspace' });
|
|
1776
|
+
|
|
1777
|
+
expect(res.body.repositories.map((repo) => repo.path)).toEqual([
|
|
1778
|
+
'/workspace/m-service',
|
|
1779
|
+
'/workspace/z-service',
|
|
1780
|
+
'/workspace/a-group/nested',
|
|
1781
|
+
]);
|
|
1782
|
+
});
|
|
1783
|
+
|
|
1746
1784
|
it('treats a .git file (linked worktree) as a repository boundary', async () => {
|
|
1747
1785
|
const { handler } = registerGitDirs({
|
|
1748
1786
|
'/workspace': [['worktree', 'dir']],
|
|
@@ -2148,7 +2186,7 @@ describe('fs stat directory error handling', () => {
|
|
|
2148
2186
|
});
|
|
2149
2187
|
|
|
2150
2188
|
describe('fs managed chats root', () => {
|
|
2151
|
-
const registerWithChatsRoot = ({ managedChatsRoot, fsPromises = {} } = {}) => {
|
|
2189
|
+
const registerWithChatsRoot = ({ managedChatsRoot, fsPromises = {}, resolveProjectDirectory = async () => ({ directory: '/repo' }) } = {}) => {
|
|
2152
2190
|
const { app, getRoute } = createRouteRegistry();
|
|
2153
2191
|
registerFsRoutes(app, {
|
|
2154
2192
|
os: { homedir: () => '/home/user' },
|
|
@@ -2161,7 +2199,7 @@ describe('fs managed chats root', () => {
|
|
|
2161
2199
|
spawn: vi.fn(),
|
|
2162
2200
|
crypto: { randomUUID: () => 'job-0' },
|
|
2163
2201
|
normalizeDirectoryPath: (p) => p,
|
|
2164
|
-
resolveProjectDirectory
|
|
2202
|
+
resolveProjectDirectory,
|
|
2165
2203
|
buildAugmentedPath: () => '/usr/bin',
|
|
2166
2204
|
resolveGitBinaryForSpawn: () => 'git',
|
|
2167
2205
|
openchamberUserConfigRoot: '/home/user/.config/openchamber',
|
|
@@ -2272,10 +2310,58 @@ describe('fs managed chats root', () => {
|
|
|
2272
2310
|
expect(res.statusCode).toBe(400);
|
|
2273
2311
|
expect(res.body).toEqual({ error: 'Path is outside of active workspace' });
|
|
2274
2312
|
});
|
|
2313
|
+
|
|
2314
|
+
describe('with no project open', () => {
|
|
2315
|
+
const noProject = async () => ({ directory: null, error: 'Directory parameter or active project is required' });
|
|
2316
|
+
|
|
2317
|
+
it('allows mkdir inside the chats root', async () => {
|
|
2318
|
+
const mkdirCalls = [];
|
|
2319
|
+
const { mkdir } = registerWithChatsRoot({
|
|
2320
|
+
resolveProjectDirectory: noProject,
|
|
2321
|
+
fsPromises: { mkdir: async (targetPath) => { mkdirCalls.push(targetPath); } },
|
|
2322
|
+
});
|
|
2323
|
+
|
|
2324
|
+
const res = createMockResponse();
|
|
2325
|
+
await mkdir({ body: { path: '/home/user/.config/openchamber/chats/2026-10-12/session-a' } }, res);
|
|
2326
|
+
|
|
2327
|
+
expect(res.statusCode).toBe(200);
|
|
2328
|
+
expect(mkdirCalls).toEqual(['/home/user/.config/openchamber/chats/2026-10-12/session-a']);
|
|
2329
|
+
});
|
|
2330
|
+
|
|
2331
|
+
it('allows mkdir inside the canonical chats root', async () => {
|
|
2332
|
+
const { mkdir } = registerWithChatsRoot({
|
|
2333
|
+
managedChatsRoot: '/srv/chat-alias',
|
|
2334
|
+
resolveProjectDirectory: noProject,
|
|
2335
|
+
fsPromises: { realpath: async (directory) => (directory === '/srv/chat-alias' ? '/storage/chats' : directory) },
|
|
2336
|
+
});
|
|
2337
|
+
|
|
2338
|
+
const res = createMockResponse();
|
|
2339
|
+
await mkdir({ body: { path: '/storage/chats/day/session-a' } }, res);
|
|
2340
|
+
|
|
2341
|
+
expect(res.statusCode).toBe(200);
|
|
2342
|
+
expect(res.body.path).toBe('/storage/chats/day/session-a');
|
|
2343
|
+
});
|
|
2344
|
+
|
|
2345
|
+
it('rejects the config root and everything else outside the chats root', async () => {
|
|
2346
|
+
const mkdirCalls = [];
|
|
2347
|
+
const { mkdir } = registerWithChatsRoot({
|
|
2348
|
+
resolveProjectDirectory: noProject,
|
|
2349
|
+
fsPromises: { mkdir: async (targetPath) => { mkdirCalls.push(targetPath); } },
|
|
2350
|
+
});
|
|
2351
|
+
|
|
2352
|
+
for (const target of ['/home/user/.config/openchamber/extensions', '/home/user/.config/openchamber', '/home/user/projects/app']) {
|
|
2353
|
+
const res = createMockResponse();
|
|
2354
|
+
await mkdir({ body: { path: target } }, res);
|
|
2355
|
+
expect(res.statusCode).toBe(400);
|
|
2356
|
+
expect(res.body).toEqual({ error: 'Directory parameter or active project is required' });
|
|
2357
|
+
}
|
|
2358
|
+
expect(mkdirCalls).toEqual([]);
|
|
2359
|
+
});
|
|
2360
|
+
});
|
|
2275
2361
|
});
|
|
2276
2362
|
|
|
2277
2363
|
describe('canonical managed roots with real filesystem aliases', () => {
|
|
2278
|
-
const setup = async (context, { relocated = false, caseAlias = false } = {}) => {
|
|
2364
|
+
const setup = async (context, { relocated = false, caseAlias = false, project = true } = {}) => {
|
|
2279
2365
|
const root = await nativeFs.mkdtemp(path.join(tmpdir(), 'oc-canonical-chats-'));
|
|
2280
2366
|
context.onTestFinished(() => nativeFs.rm(root, { recursive: true, force: true }));
|
|
2281
2367
|
const home = path.join(root, 'Home');
|
|
@@ -2293,10 +2379,12 @@ describe('canonical managed roots with real filesystem aliases', () => {
|
|
|
2293
2379
|
registerFsRoutes(app, {
|
|
2294
2380
|
os: { homedir: () => reportedHome }, path, fsPromises: nativeFs,
|
|
2295
2381
|
normalizeDirectoryPath: value => value,
|
|
2296
|
-
resolveProjectDirectory: async () => (
|
|
2382
|
+
resolveProjectDirectory: async () => (project
|
|
2383
|
+
? { directory: path.join(root, 'unrelated-project') }
|
|
2384
|
+
: { directory: null, error: 'Directory parameter or active project is required' }),
|
|
2297
2385
|
openchamberUserConfigRoot: config, managedChatsRoot: rawChats,
|
|
2298
2386
|
});
|
|
2299
|
-
return { getRoute, canonicalHome, canonicalChats, rawChats, reportedHome };
|
|
2387
|
+
return { getRoute, canonicalHome, canonicalChats, rawChats, reportedHome, config };
|
|
2300
2388
|
};
|
|
2301
2389
|
|
|
2302
2390
|
for (const relocated of [false, true]) {
|
|
@@ -2328,6 +2416,31 @@ describe('canonical managed roots with real filesystem aliases', () => {
|
|
|
2328
2416
|
});
|
|
2329
2417
|
}
|
|
2330
2418
|
|
|
2419
|
+
it('with no project, writes inside the canonical chats root and the old chats root, and nowhere else', async context => {
|
|
2420
|
+
const { getRoute, canonicalChats, config } = await setup(context, { relocated: true, project: false });
|
|
2421
|
+
const mkdir = getRoute('POST', '/api/fs/mkdir');
|
|
2422
|
+
const write = getRoute('POST', '/api/fs/write');
|
|
2423
|
+
|
|
2424
|
+
const chat = path.join(canonicalChats, 'day/session-a');
|
|
2425
|
+
const created = createMockResponse();
|
|
2426
|
+
await mkdir({ body: { path: chat } }, created);
|
|
2427
|
+
expect(created.statusCode).toBe(200);
|
|
2428
|
+
const written = createMockResponse();
|
|
2429
|
+
await write({ body: { path: path.join(chat, 'notes.md'), content: 'hi' } }, written);
|
|
2430
|
+
expect(written.statusCode).toBe(200);
|
|
2431
|
+
expect(await nativeFs.readFile(path.join(chat, 'notes.md'), 'utf8')).toBe('hi');
|
|
2432
|
+
|
|
2433
|
+
const oldChat = path.join(config, 'chats/day/session-b');
|
|
2434
|
+
const oldCreated = createMockResponse();
|
|
2435
|
+
await mkdir({ body: { path: oldChat } }, oldCreated);
|
|
2436
|
+
expect(oldCreated.statusCode).toBe(200);
|
|
2437
|
+
|
|
2438
|
+
const outside = createMockResponse();
|
|
2439
|
+
await write({ body: { path: path.join(config, 'settings.json'), content: '{}' } }, outside);
|
|
2440
|
+
expect(outside.statusCode).toBe(400);
|
|
2441
|
+
expect(outside.body).toEqual({ error: 'Directory parameter or active project is required' });
|
|
2442
|
+
});
|
|
2443
|
+
|
|
2331
2444
|
it('reports on-disk home casing on a case-insensitive macOS volume', { skip: process.platform !== 'darwin' }, async context => {
|
|
2332
2445
|
const { getRoute, canonicalChats, rawChats, reportedHome } = await setup(context, { caseAlias: true });
|
|
2333
2446
|
const response = createMockResponse();
|
|
@@ -18,6 +18,7 @@ This module provides Git repository operations for the web server runtime, inclu
|
|
|
18
18
|
- `submodule-discovery.js`, `lfs-discovery.js`, and `discovery-endpoint.js`: bounded pure parsers for committed checkout metadata and endpoint resolution.
|
|
19
19
|
- `contributor-provenance-storage.js`: strict bounded persistence for contributor-fork worktree identity and push-safety authority.
|
|
20
20
|
- `worktree-creation.js`: worktree creation with the server's authority checks, including the change-request pipeline (resolve, exact account, managed head transfer, contributor remote and provenance). `POST /api/git/worktrees` and the session service (`session.create` with `pullRequest`) both create through it; `registerGitRoutes` returns its `createWorktree` for that.
|
|
21
|
+
- `contributor-remote.js`: the `forkRemoteName` rule shared by change-request source construction and contributor transfer. It preserves the `pr-<owner>` normalization and `pr-head` fallback.
|
|
21
22
|
- `credential-resolver.js` and `credential-broker.js`: resolve opaque managed credential references and provide one-operation Git authentication without returning secrets to clients.
|
|
22
23
|
- `redaction.js`: bounded Git output and error redaction.
|
|
23
24
|
- `helper-launch.js`: how Git reaches this module's helper scripts through `sh`, telling Electron to run as Node inside the command itself.
|
|
@@ -401,7 +402,7 @@ The following functions are internal helpers used by exported functions:
|
|
|
401
402
|
- `normalizeDirectoryPath(value)`: Normalize directory paths (supports ~ expansion).
|
|
402
403
|
- `cleanBranchName(branch)`: Remove refs/heads/ or refs/ prefixes.
|
|
403
404
|
- `parseWorktreePorcelain(raw)`: Parse `git worktree list --porcelain` output.
|
|
404
|
-
- `resolveWorktreeProjectContext(directory)`: Resolve project context (projectID, primaryWorktree, worktreeRoot, legacyWorktreeRoot); `worktreeRoot` honors OpenCode's `worktree.directory` and falls back to the data-dir folder keyed by project ID.
|
|
405
|
+
- `resolveWorktreeProjectContext(directory)`: Resolve project context (projectID, requestedDirectory, primaryWorktree, worktreeRoot, legacyWorktreeRoot); `requestedDirectory` is the folder the worktree was requested from, where the project start command is read; `worktreeRoot` honors OpenCode's `worktree.directory` and falls back to the data-dir folder keyed by project ID.
|
|
405
406
|
- `resolveCandidateDirectory(...)`: Generate unique worktree directory candidates.
|
|
406
407
|
- `resolveBranchForExistingMode(...)`: Resolve branch for existing-mode worktree creation.
|
|
407
408
|
- `applyUpstreamConfiguration(...)`: Set upstream tracking for new branches.
|
|
@@ -458,6 +459,7 @@ The following functions are internal helpers used by exported functions:
|
|
|
458
459
|
Commit snapshots never expose hunk mutations. Mobile uses its separate Changes
|
|
459
460
|
surface and VS Code does not mount these controls.
|
|
460
461
|
- Untracked patches from `getDiff` and `getUntrackedDiffs` use `git diff --no-index` with separate stdout, stderr, and process exit status. Exit codes 0 and 1 return stdout only, so line-ending warnings never become patch text or request failures. Other exits and process failures reject the single-file request; the batch keeps an empty entry for the failed path and preserves the other results.
|
|
462
|
+
- Patch-producing calls (`getDiff`, `getPathDiff`, `getRangeDiff`, untracked `--no-index` diffs, conflict summaries, `getCommitDiff`) pass `--no-ext-diff`, so an external diff driver configured by the repository or the session (`diff.external`, `GIT_EXTERNAL_DIFF`, difftastic) cannot replace unified patch text with the driver's own format. The UI parses patches as unified diffs; numstat and name-only queries never run external diffs and need no flag.
|
|
461
463
|
- `status.files` exposes both `index` and `working_dir` codes. Shared UI uses these as separate scopes: staged rows are derived from non-empty `index` statuses, while unstaged rows are derived from `working_dir` statuses and untracked files.
|
|
462
464
|
- `status.diffStats` follows the same scopes (`staged`, `working`), so a staged row shows HEAD → index counts and an unstaged row shows index → working-tree counts. A file with edits in both scopes reports each part in its own row instead of one combined total.
|
|
463
465
|
- A file with both staged and unstaged changes can appear in both UI sections. Staged rows request diffs with `staged: true`; unstaged rows request normal working-tree diffs.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Shared by change-request source construction and the contributor transfer
|
|
2
|
+
// pipeline, which derives the owner again from the provider's current answer.
|
|
3
|
+
export const forkRemoteName = (owner) => `pr-${String(owner || '').trim().toLowerCase()
|
|
4
|
+
.replace(/[^a-z0-9._-]+/g, '-').replace(/-+/g, '-').replace(/^-+|-+$/g, '') || 'head'}`;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { forkRemoteName } from './contributor-remote.js';
|
|
3
|
+
|
|
4
|
+
describe('contributor fork remote names', () => {
|
|
5
|
+
it.each([
|
|
6
|
+
['Alice', 'pr-alice'],
|
|
7
|
+
[' Team/Sub Group ', 'pr-team-sub-group'],
|
|
8
|
+
['---Alice---', 'pr-alice'],
|
|
9
|
+
['a...b__c', 'pr-a...b__c'],
|
|
10
|
+
['a---b', 'pr-a-b'],
|
|
11
|
+
['你好', 'pr-head'],
|
|
12
|
+
['', 'pr-head'],
|
|
13
|
+
[null, 'pr-head'],
|
|
14
|
+
[undefined, 'pr-head'],
|
|
15
|
+
[false, 'pr-head'],
|
|
16
|
+
[0, 'pr-head'],
|
|
17
|
+
[42, 'pr-42'],
|
|
18
|
+
])('normalizes %s to %s', (owner, expected) => {
|
|
19
|
+
expect(forkRemoteName(owner)).toBe(expected);
|
|
20
|
+
});
|
|
21
|
+
});
|