@openchamber/web 1.18.4 → 1.20.0
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/README.md +1 -0
- package/dist/assets/{CodeMirrorCommentWidgets-4qZbrEXU.js → CodeMirrorCommentWidgets-C36E738Y.js} +1 -1
- package/dist/assets/{CommitSection-MJmntVPJ.js → CommitSection-C-F3AX6D.js} +1 -1
- package/dist/assets/{DiagramEditor-jnG3Hbxg.js → DiagramEditor-BPECg1jS.js} +1 -1
- package/dist/assets/DiagramView-D0YNMix8.js +1 -0
- package/dist/assets/DiffView-BHWaMYCC.js +4 -0
- package/dist/assets/FilesView-NMBCW2Tm.js +14 -0
- package/dist/assets/{GitView-DBFrDDBv.js → GitView-Rp8P1KEI.js} +4 -4
- package/dist/assets/{JsonTreeView-DLW2Wy1g.js → JsonTreeView-KnXFN2A-.js} +1 -1
- package/dist/assets/MarkdownImageGallery-BMn3mtor.js +1 -0
- package/dist/assets/MarkdownRendererImpl-kD6N03pH.js +12 -0
- package/dist/assets/OnboardingScreen-CenIeD4v.js +1 -0
- package/dist/assets/{PatchDiff-BuLPx7AN.js → PatchDiff-BzVOVog8.js} +1 -1
- package/dist/assets/{PierreDiffViewer-BHm4Yr0X.js → PierreDiffViewer-Dlby4XqT.js} +2 -2
- package/dist/assets/PlanView-Czu1KMJa.js +4 -0
- package/dist/assets/SessionSwitcherDropdown-IETz58DB.js +1 -0
- package/dist/assets/SettingsView-B6vmuf-c.js +28 -0
- package/dist/assets/SettingsWindow-CauZpdD3.js +1 -0
- package/dist/assets/ToolOutputDialog-BB1c--Zr.js +15 -0
- package/dist/assets/ToolPartDiffPreview-DaOIDISD.js +8 -0
- package/dist/assets/{VirtualizedFileDiff-CwGocYQd.js → VirtualizedFileDiff-lESMT-2b.js} +4 -4
- package/dist/assets/{WalkthroughView-5DyvN03T.js → WalkthroughView-CaSYE0lw.js} +2 -2
- package/dist/assets/{computeVirtualFileMetrics-Da00Jg7M.js → computeVirtualFileMetrics-DkRR5b75.js} +2 -2
- package/dist/assets/contextPanelEmbeddedChat-BEARQjgn.js +1 -0
- package/dist/assets/de-DFdX3ABv.js +9 -0
- package/dist/assets/document-attachments-DFAWlG3U.js +31 -0
- package/dist/assets/es-iC-FKvV9.js +15 -0
- package/dist/assets/fr-BBbi_1AL.js +13 -0
- package/dist/assets/index-BiEgzzkg.js +1 -0
- package/dist/assets/index-Cwmuwk3V.js +7 -0
- package/dist/assets/index-GNm1wgUH.css +1 -0
- package/dist/assets/{isDiffPlainText-D9YpoLrV.js → isDiffPlainText-BG53Ixxy.js} +1 -1
- package/dist/assets/{isFilePlainText-gTibdNIe.js → isFilePlainText-BbV-39jl.js} +1 -1
- package/dist/assets/ja-DQLQJL2J.js +15 -0
- package/dist/assets/ko-BeElEB4Y.js +15 -0
- package/dist/assets/{lua-BgMRiT3U.js → lua-VAEuO923.js} +1 -1
- package/dist/assets/main-Dpzo18z7.js +2 -0
- package/dist/assets/main-WMjtYzJs.js +921 -0
- package/dist/assets/markdownCore--tDmyI_v.js +2 -0
- package/dist/assets/miniChat-ldEghBLB.js +2 -0
- package/dist/assets/mobile-Dk-VGreF.js +2 -0
- package/dist/assets/{patchFileDiff-KNkxM1C1.js → patchFileDiff-BcFaMtMu.js} +1 -1
- package/dist/assets/pl-CLHt2_vV.js +15 -0
- package/dist/assets/pt-BR-C_MPUq7e.js +15 -0
- package/dist/assets/renderElectronMiniChatApp-DIgCOmXY.js +2 -0
- package/dist/assets/renderMobileApp-CDfHS5rr.js +25 -0
- package/dist/assets/runtimeEndpointReset-ovNbaZ-x.js +15 -0
- package/dist/assets/scheduledTasksApi-BFSlqgnG.js +1 -0
- package/dist/assets/{shikiHighlight-C7LTbwFx.js → shikiHighlight-DCT2Sq_z.js} +1 -1
- package/dist/assets/uk-PhsC-c4-.js +15 -0
- package/dist/assets/{useAppFontEffects-BikB6enL.js → useAppFontEffects-B53Rb6m7.js} +168 -164
- package/dist/assets/useInlineCommentController-DSfrIBKT.js +2 -0
- package/dist/assets/{vendor-base-ui-D_V6hAcE.js → vendor-base-ui-DsHmyMwp.js} +1 -1
- package/dist/assets/vendor-codemirror-autocomplete-DzPz9Wgq.js +1 -0
- package/dist/assets/vendor-codemirror-commands-B7H_j0iU.js +1 -0
- package/dist/assets/{vendor-codemirror-lang-angular-CgY7_gQ1.js → vendor-codemirror-lang-angular-DEPs2M5t.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-cpp-B5Ta4enQ.js → vendor-codemirror-lang-cpp-DhkseaMo.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-css-VgNqFSH-.js → vendor-codemirror-lang-css-O0cZX78y.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-go-LxLz62pp.js → vendor-codemirror-lang-go-fMdQYcON.js} +1 -1
- package/dist/assets/vendor-codemirror-lang-html-CfgK872x.js +1 -0
- package/dist/assets/{vendor-codemirror-lang-java-Bksi1PH4.js → vendor-codemirror-lang-java-CQj4S3zl.js} +1 -1
- package/dist/assets/vendor-codemirror-lang-javascript-Cc2ZYbgX.js +13 -0
- package/dist/assets/{vendor-codemirror-lang-jinja-C7npuDD7.js → vendor-codemirror-lang-jinja-BmZZv8g-.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-json-ryCw7nab.js → vendor-codemirror-lang-json-CMBS2tG9.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-less-BxsZJD6N.js → vendor-codemirror-lang-less-C6Eo8hVS.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-liquid-De6qch10.js → vendor-codemirror-lang-liquid-DSTR47-H.js} +1 -1
- package/dist/assets/vendor-codemirror-lang-markdown-BPGOH9ye.js +1 -0
- package/dist/assets/{vendor-codemirror-lang-php-Cm1es33p.js → vendor-codemirror-lang-php-DD9udfPH.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-python-N414WYK-.js → vendor-codemirror-lang-python-HahnQaAS.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-rust-C_WuUStH.js → vendor-codemirror-lang-rust-nLTovbjv.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-sass-8UHTCAOM.js → vendor-codemirror-lang-sass-pL2Yc72v.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-sql-CV3sMA5D.js → vendor-codemirror-lang-sql-BVBnan19.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-vue-DzvC1Dhk.js → vendor-codemirror-lang-vue-BqGzJVm1.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-wast-jlr-LDdA.js → vendor-codemirror-lang-wast-B0_m5DqU.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-xml-CrO63OVp.js → vendor-codemirror-lang-xml-Dj3voadT.js} +1 -1
- package/dist/assets/{vendor-codemirror-lang-yaml-dxi6CISW.js → vendor-codemirror-lang-yaml-yu-9Z5u7.js} +1 -1
- package/dist/assets/vendor-codemirror-language-BgPj_McA.js +3 -0
- package/dist/assets/{vendor-codemirror-language-data-CLHw8NWn.js → vendor-codemirror-language-data-vch3tJ4c.js} +2 -2
- package/dist/assets/vendor-codemirror-search-BmS-GmcX.js +2 -0
- package/dist/assets/{vendor-codemirror-state-CNWM3Q8V.js → vendor-codemirror-state-C9awkmn-.js} +5 -5
- package/dist/assets/vendor-codemirror-view-CiLROUVV.js +4 -0
- package/dist/assets/vendor-replit-codemirror-vim-B2DJlAhT.js +6 -0
- package/dist/assets/vendor-replit-codemirror-vim-core-FHzKdNUS.js +34 -0
- package/dist/assets/vendor-zod-C9ioTTSo.js +39 -0
- package/dist/assets/{web-components-GMc3oR3i.js → web-components-pcwCTWjC.js} +4 -4
- package/dist/assets/zh-CN-wF-NOFHM.js +15 -0
- package/dist/assets/zh-TW-4m4-A7rT.js +15 -0
- package/dist/index.html +5 -4
- package/dist/mini-chat.html +4 -3
- package/dist/mobile.html +4 -3
- package/package.json +3 -5
- package/server/index.js +152 -3
- package/server/lib/agent-memory/actions.js +243 -0
- package/server/lib/agent-memory/actions.test.js +343 -0
- package/server/lib/agent-memory/feature-flag.js +19 -0
- package/server/lib/agent-memory/feature-flag.test.js +38 -0
- package/server/lib/agent-memory/project-resolution.js +65 -0
- package/server/lib/agent-memory/project-resolution.test.js +94 -0
- package/server/lib/agent-memory/routes.http.test.js +270 -0
- package/server/lib/agent-memory/routes.js +169 -0
- package/server/lib/agent-memory/runtime.js +432 -0
- package/server/lib/agent-memory/runtime.test.js +344 -0
- package/server/lib/agent-memory/threat-patterns.js +61 -0
- package/server/lib/agent-memory/threat-patterns.test.js +61 -0
- package/server/lib/agent-tool/DOCUMENTATION.md +14 -0
- package/server/lib/agent-tool/runtime.js +63 -13
- package/server/lib/agent-tool/runtime.test.js +85 -2
- package/server/lib/context-obligatory/runtime.js +34 -3
- package/server/lib/context-obligatory/runtime.test.js +114 -0
- package/server/lib/dictation/DOCUMENTATION.md +32 -8
- package/server/lib/dictation/local/sherpa-recognizer.js +35 -78
- package/server/lib/dictation/local/worker-process.js +2 -2
- package/server/lib/dictation/openai-compatible-session.js +3 -2
- package/server/lib/dictation/stream-manager.js +77 -34
- package/server/lib/dictation/stream-manager.test.js +60 -2
- package/server/lib/fs/DOCUMENTATION.md +3 -0
- package/server/lib/fs/routes.js +149 -32
- package/server/lib/fs/routes.test.js +301 -0
- package/server/lib/git/DOCUMENTATION.md +8 -0
- package/server/lib/git/routes.js +43 -0
- package/server/lib/git/service.js +206 -72
- package/server/lib/git/service.test.js +222 -0
- package/server/lib/github/DOCUMENTATION.md +14 -3
- package/server/lib/github/pr-status.js +188 -83
- package/server/lib/github/pr-status.test.js +182 -0
- package/server/lib/github/routes.js +36 -30
- package/server/lib/notifications/template-runtime.js +2 -3
- package/server/lib/openchamber-control/action-resolution.test.js +65 -0
- package/server/lib/openchamber-control/actions.js +78 -0
- package/server/lib/openchamber-control/service.js +7 -0
- package/server/lib/openchamber-sessions/routes.js +14 -0
- package/server/lib/opencode/DOCUMENTATION.md +12 -6
- package/server/lib/opencode/claude-cli-auth.js +60 -0
- package/server/lib/opencode/claude-cli-auth.test.js +54 -0
- package/server/lib/opencode/feature-routes-runtime.js +16 -9
- package/server/lib/opencode/lifecycle.js +202 -26
- package/server/lib/opencode/lifecycle.test.js +179 -1
- package/server/lib/opencode/plugins.js +12 -3
- package/server/lib/opencode/plugins.test.js +18 -0
- package/server/lib/opencode/providers.js +9 -4
- package/server/lib/opencode/providers.test.js +27 -0
- package/server/lib/opencode/proxy-agent-wiring.test.js +152 -0
- package/server/lib/opencode/proxy.js +116 -6
- package/server/lib/opencode/proxy.test.js +158 -1
- package/server/lib/opencode/restart-session-recovery.test.js +59 -0
- package/server/lib/opencode/routes.js +4 -1
- package/server/lib/opencode/session-runtime.js +39 -2
- package/server/lib/opencode/session-runtime.test.js +74 -0
- package/server/lib/opencode/settings-helpers.js +26 -0
- package/server/lib/opencode/settings-helpers.test.js +57 -0
- package/server/lib/opencode/settings-normalization-runtime.js +3 -0
- package/server/lib/opencode/settings-normalization-runtime.test.js +16 -0
- package/server/lib/opencode/settings-runtime.js +83 -10
- package/server/lib/opencode/settings-runtime.test.js +85 -0
- package/server/lib/opencode/shared.js +120 -16
- package/server/lib/opencode/shared.test.js +185 -1
- package/server/lib/opencode/skill-routes.js +29 -73
- package/server/lib/opencode/skill-routes.test.js +2 -5
- package/server/lib/project-context/DOCUMENTATION.md +160 -0
- package/server/lib/project-context/routes.http.test.js +264 -0
- package/server/lib/project-context/routes.js +237 -0
- package/server/lib/project-context/runtime.js +672 -0
- package/server/lib/project-context/runtime.test.js +498 -0
- package/server/lib/projects/project-config.js +7 -2
- package/server/lib/quota/DOCUMENTATION.md +17 -2
- package/server/lib/quota/providers/claude/auth.js +113 -0
- package/server/lib/quota/providers/claude/auth.test.js +117 -0
- package/server/lib/quota/providers/claude/index.js +151 -0
- package/server/lib/quota/providers/claude/index.test.js +147 -0
- package/server/lib/quota/providers/claude/transforms.js +127 -0
- package/server/lib/quota/providers/claude/transforms.test.js +82 -0
- package/server/lib/quota/providers/command-code.js +90 -0
- package/server/lib/quota/providers/command-code.test.js +85 -0
- package/server/lib/quota/providers/index.js +30 -2
- package/server/lib/quota/providers/index.test.js +10 -1
- package/server/lib/quota/providers/zai.js +26 -6
- package/server/lib/quota/providers/zai.test.js +33 -0
- package/server/lib/quota/utils/formatters.js +2 -1
- package/server/lib/scheduled-tasks/runtime.js +21 -2
- package/server/lib/session-knowledge/DOCUMENTATION.md +89 -0
- package/server/lib/session-knowledge/routes.js +107 -0
- package/server/lib/session-knowledge/runtime.js +331 -0
- package/server/lib/session-knowledge/runtime.test.js +275 -0
- package/server/lib/skills-catalog/DOCUMENTATION.md +18 -45
- package/server/lib/skills-catalog/cache.js +120 -1
- package/server/lib/skills-catalog/cache.test.js +77 -0
- package/server/lib/skills-catalog/curated-sources.js +21 -5
- package/server/lib/skills-catalog/curated-sources.test.js +10 -0
- package/server/lib/skills-catalog/disk-cache.js +52 -0
- package/server/lib/skills-catalog/github-meta.js +139 -0
- package/server/lib/skills-catalog/github-meta.test.js +71 -0
- package/server/lib/skills-catalog/source.js +0 -5
- package/server/lib/small-model/DOCUMENTATION.md +74 -6
- package/server/lib/small-model/call.js +46 -12
- package/server/lib/small-model/call.test.js +79 -0
- package/server/lib/small-model/index.js +57 -6
- package/server/lib/small-model/index.test.js +102 -2
- package/server/lib/small-model/routes.js +4 -2
- package/server/lib/small-model/runtime-providers.js +156 -0
- package/server/lib/small-model/runtime-providers.test.js +112 -0
- package/dist/assets/DiagramView-CFXxgg_a.js +0 -1
- package/dist/assets/DiffView-DZIoOnV7.js +0 -4
- package/dist/assets/FilesView-BKL6YlKG.js +0 -14
- package/dist/assets/MarkdownImageGallery-DKIylIK7.js +0 -1
- package/dist/assets/MarkdownRendererImpl-CLv8hxvv.js +0 -12
- package/dist/assets/OnboardingScreen-D2Y6djMw.js +0 -1
- package/dist/assets/PlanView-ZYEJn8A_.js +0 -4
- package/dist/assets/SessionSwitcherDropdown-rro-SsaO.js +0 -1
- package/dist/assets/SettingsView-5RmswFZe.js +0 -28
- package/dist/assets/SettingsWindow-BZhAYFdS.js +0 -1
- package/dist/assets/ToolOutputDialog-Za6V4VMJ.js +0 -15
- package/dist/assets/ToolPartDiffPreview-BL-9ixyC.js +0 -8
- package/dist/assets/contextPanelEmbeddedChat-B-bSg3P5.js +0 -1
- package/dist/assets/de-u7gSnqWs.js +0 -9
- package/dist/assets/document-attachments-CX_YaDsu.js +0 -30
- package/dist/assets/es-T9O7aAOr.js +0 -15
- package/dist/assets/fr-Oor7ewbE.js +0 -13
- package/dist/assets/index-BzIpNlNE.css +0 -1
- package/dist/assets/index-C0yNhuZw.js +0 -1
- package/dist/assets/index-DRpChWux.js +0 -7
- package/dist/assets/ja-DHpqbVmr.js +0 -15
- package/dist/assets/ko-CwLkS3nx.js +0 -15
- package/dist/assets/main-D7UcL3VQ.js +0 -2
- package/dist/assets/main-DPMd2iKS.js +0 -915
- package/dist/assets/markdownCore-DDrHVneM.js +0 -2
- package/dist/assets/miniChat-O_GVoEbc.js +0 -2
- package/dist/assets/mobile-Br4TtAqc.js +0 -2
- package/dist/assets/pl-CcZILN8q.js +0 -15
- package/dist/assets/pt-BR-DYHhVK6o.js +0 -15
- package/dist/assets/renderElectronMiniChatApp-CJpdxTT1.js +0 -2
- package/dist/assets/renderMobileApp-toj9cXoh.js +0 -25
- package/dist/assets/runtimeEndpointReset-BVmispdD.js +0 -13
- package/dist/assets/scheduledTasksApi-ByKya3Un.js +0 -1
- package/dist/assets/uk-BA2kZR38.js +0 -15
- package/dist/assets/useInlineCommentController-CYPvYJDt.js +0 -2
- package/dist/assets/vendor-codemirror-autocomplete-BjbBRsUA.js +0 -1
- package/dist/assets/vendor-codemirror-commands-ARAOgp1x.js +0 -1
- package/dist/assets/vendor-codemirror-lang-html-B3Qe3OpS.js +0 -1
- package/dist/assets/vendor-codemirror-lang-javascript-Bbw3D7r0.js +0 -13
- package/dist/assets/vendor-codemirror-lang-markdown-FGQydhTc.js +0 -1
- package/dist/assets/vendor-codemirror-language-DUOssd4j.js +0 -3
- package/dist/assets/vendor-codemirror-search-8kyQdB3f.js +0 -2
- package/dist/assets/vendor-codemirror-view-DSzLbZiS.js +0 -4
- package/dist/assets/vendor-replit-codemirror-vim-B0Ecqnlh.js +0 -39
- package/dist/assets/zh-CN-dlOQK6v9.js +0 -15
- package/dist/assets/zh-TW-BnqQ-WL5.js +0 -15
- package/server/lib/quota/providers/claude.js +0 -107
- package/server/lib/skills-catalog/clawdhub/api.js +0 -126
- package/server/lib/skills-catalog/clawdhub/install.js +0 -238
- package/server/lib/skills-catalog/clawdhub/install.test.js +0 -100
- package/server/lib/skills-catalog/clawdhub/scan.js +0 -61
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
import { resolveAgentToolAction } from './actions.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Both cases here are from one real conversation: the model called `read` and
|
|
7
|
+
* then `get` on `openchamber_memory`, having dropped the namespace its own tool
|
|
8
|
+
* name appeared to supply, and gave up after the second bare "unsupported".
|
|
9
|
+
*/
|
|
10
|
+
describe('a namespace the tool name already implies', () => {
|
|
11
|
+
test('resolves a bare action inside the calling tool', () => {
|
|
12
|
+
expect(resolveAgentToolAction('read', 'openchamber_memory')).toEqual({ action: 'memory.read' });
|
|
13
|
+
expect(resolveAgentToolAction('save', 'openchamber_memory')).toEqual({ action: 'memory.save' });
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('resolves a bare name that is ambiguous only across tools', () => {
|
|
17
|
+
// `delete` belongs to schedule and to memory; inside one tool it is plain.
|
|
18
|
+
expect(resolveAgentToolAction('delete', 'openchamber_memory')).toEqual({ action: 'memory.delete' });
|
|
19
|
+
expect(resolveAgentToolAction('delete', 'openchamber')).toEqual({ action: 'schedule.delete' });
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('keeps a fully qualified action as it is', () => {
|
|
23
|
+
expect(resolveAgentToolAction('memory.read', 'openchamber_memory')).toEqual({ action: 'memory.read' });
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('does not reach outside the tool that asked', () => {
|
|
27
|
+
// The memory tool asking for `open` must fail, not drive the browser.
|
|
28
|
+
expect(resolveAgentToolAction('open', 'openchamber_memory').action).toBeUndefined();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe('an unidentified caller', () => {
|
|
33
|
+
test('still resolves a bare name that means one thing everywhere', () => {
|
|
34
|
+
expect(resolveAgentToolAction('snapshot', null)).toEqual({ action: 'browser.snapshot' });
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('refuses a bare name that several actions share', () => {
|
|
38
|
+
expect(resolveAgentToolAction('list', null).action).toBeUndefined();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
describe('what an unresolvable action reports', () => {
|
|
43
|
+
test('names the actions the calling tool actually has', () => {
|
|
44
|
+
const { error } = resolveAgentToolAction('get', 'openchamber_memory');
|
|
45
|
+
|
|
46
|
+
expect(error).toContain('memory.read');
|
|
47
|
+
expect(error).toContain('memory.save');
|
|
48
|
+
// Listing every action of every tool would bury the four that apply.
|
|
49
|
+
expect(error).not.toContain('browser.open');
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test('reports a missing action rather than resolving to something', () => {
|
|
53
|
+
const { error, action } = resolveAgentToolAction('', 'openchamber_memory');
|
|
54
|
+
|
|
55
|
+
expect(action).toBeUndefined();
|
|
56
|
+
expect(error).toContain('missing');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('an unknown tool falls back to the full action list', () => {
|
|
60
|
+
const { error } = resolveAgentToolAction('nonsense', 'openchamber_future');
|
|
61
|
+
|
|
62
|
+
expect(error).toContain('memory.read');
|
|
63
|
+
expect(error).toContain('browser.open');
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -53,8 +53,86 @@ export const OPENCHAMBER_WEB_ACTIONS = Object.freeze(
|
|
|
53
53
|
OPENCHAMBER_WEB_ACTION_DEFINITIONS.map(({ action }) => action),
|
|
54
54
|
);
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Memory is its own tool for the same reason web is: remembering across
|
|
58
|
+
* sessions is a distinct intent from controlling one, and a shared description
|
|
59
|
+
* would blur both. It also has to switch off cleanly and completely, which a
|
|
60
|
+
* shared schema cannot do.
|
|
61
|
+
*
|
|
62
|
+
* The session already carries an index of stored titles, so the descriptions
|
|
63
|
+
* push the model toward reading one entry it can already see rather than
|
|
64
|
+
* listing everything again — and toward reading it at all, since a title that
|
|
65
|
+
* reads as a complete fact is exactly the one whose conditions get lost.
|
|
66
|
+
*/
|
|
67
|
+
export const OPENCHAMBER_MEMORY_ACTION_DEFINITIONS = Object.freeze([
|
|
68
|
+
{ action: 'memory.read', title: 'Read a stored memory', description: 'Read the full text of one memory listed in the session index. The index shows titles only, and a title omits the conditions that decide how the memory applies, so read before acting rather than working from the title. Requires title (as the index spells it) or memoryId; scope is optional and both stores are searched without it' },
|
|
69
|
+
{ action: 'memory.list', title: 'List stored memories', description: 'List stored memory titles when the session index is missing or stale; scope is global, project, or both (default)' },
|
|
70
|
+
{ action: 'memory.save', title: 'Remember something', description: 'Store a durable fact, preference, or reference; requires title and body, plus scope global (about the user) or project (about this codebase). Restating something already stored updates it. Do not store secrets, one-off task state, or anything the user asked you not to keep' },
|
|
71
|
+
{ action: 'memory.delete', title: 'Forget a memory', description: 'Delete a memory that turned out to be wrong or obsolete; requires memoryId and scope' },
|
|
72
|
+
]);
|
|
73
|
+
|
|
74
|
+
export const OPENCHAMBER_MEMORY_ACTIONS = Object.freeze(
|
|
75
|
+
OPENCHAMBER_MEMORY_ACTION_DEFINITIONS.map(({ action }) => action),
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Which actions each managed tool may ask for.
|
|
80
|
+
*
|
|
81
|
+
* The callback needs this because models routinely drop the namespace: asked
|
|
82
|
+
* for `memory.read` from a tool already called `openchamber_memory`, they send
|
|
83
|
+
* `read`, since the tool's own name appears to have said "memory" already. The
|
|
84
|
+
* name is unambiguous inside one tool's action set even when it is not across
|
|
85
|
+
* all of them (`delete` belongs to both schedule and memory), so resolution
|
|
86
|
+
* starts from the tool that asked.
|
|
87
|
+
*/
|
|
88
|
+
const ACTIONS_BY_TOOL = Object.freeze({
|
|
89
|
+
openchamber: OPENCHAMBER_AGENT_TOOL_ACTIONS,
|
|
90
|
+
openchamber_web: OPENCHAMBER_WEB_ACTIONS,
|
|
91
|
+
openchamber_memory: OPENCHAMBER_MEMORY_ACTIONS,
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const bareName = (action) => {
|
|
95
|
+
const separator = action.indexOf('.');
|
|
96
|
+
return separator === -1 ? action : action.slice(separator + 1);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const uniqueMatch = (candidates, requested) => {
|
|
100
|
+
const matches = candidates.filter((candidate) => bareName(candidate) === requested);
|
|
101
|
+
return matches.length === 1 ? matches[0] : null;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The canonical action for what a tool asked, or the reason it could not be
|
|
106
|
+
* resolved. The reason lists what the tool can actually do: an error that only
|
|
107
|
+
* says "unsupported" leaves the model to guess again, which is how one wrong
|
|
108
|
+
* name becomes three.
|
|
109
|
+
*/
|
|
110
|
+
export const resolveAgentToolAction = (requested, toolName) => {
|
|
111
|
+
const value = typeof requested === 'string' ? requested.trim() : '';
|
|
112
|
+
const scoped = ACTIONS_BY_TOOL[toolName] ?? null;
|
|
113
|
+
const known = scoped ?? OPENCHAMBER_ALL_ACTIONS;
|
|
114
|
+
|
|
115
|
+
if (value && known.includes(value)) {
|
|
116
|
+
return { action: value };
|
|
117
|
+
}
|
|
118
|
+
if (value) {
|
|
119
|
+
const resolved = uniqueMatch(known, value)
|
|
120
|
+
// A tool that did not identify itself still gets the benefit when the
|
|
121
|
+
// bare name means only one thing across every action.
|
|
122
|
+
?? (scoped ? null : uniqueMatch(OPENCHAMBER_ALL_ACTIONS, value));
|
|
123
|
+
if (resolved) {
|
|
124
|
+
return { action: resolved };
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
error: `Unsupported OpenChamber action: ${value || 'missing'}. Use one of: ${known.join(', ')}`,
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
|
|
56
133
|
/** Everything the callback route will dispatch, whichever tool asked. */
|
|
57
134
|
export const OPENCHAMBER_ALL_ACTIONS = Object.freeze([
|
|
58
135
|
...OPENCHAMBER_CONTROL_ACTIONS,
|
|
59
136
|
...OPENCHAMBER_WEB_ACTIONS,
|
|
137
|
+
...OPENCHAMBER_MEMORY_ACTIONS,
|
|
60
138
|
]);
|
|
@@ -144,6 +144,7 @@ export const createOpenChamberControlService = (dependencies) => {
|
|
|
144
144
|
sessionService,
|
|
145
145
|
scheduledTaskService,
|
|
146
146
|
browserControl = null,
|
|
147
|
+
agentMemoryActions = null,
|
|
147
148
|
createClient = createOpencodeClient,
|
|
148
149
|
sleep = (duration) => new Promise((resolve) => setTimeout(resolve, duration)),
|
|
149
150
|
now = Date.now,
|
|
@@ -458,6 +459,12 @@ export const createOpenChamberControlService = (dependencies) => {
|
|
|
458
459
|
if (!CONTROL_ACTIONS.has(action)) {
|
|
459
460
|
throw new OpenChamberControlError(`Unsupported OpenChamber action: ${action || 'missing'}`, 400);
|
|
460
461
|
}
|
|
462
|
+
if (action.startsWith('memory.')) {
|
|
463
|
+
if (!agentMemoryActions) {
|
|
464
|
+
throw new OpenChamberControlError('Agent memory is not available on this server', 503);
|
|
465
|
+
}
|
|
466
|
+
return agentMemoryActions.execute(action, input, contextDirectory);
|
|
467
|
+
}
|
|
461
468
|
if (action.startsWith('browser.')) {
|
|
462
469
|
if (!browserControl) {
|
|
463
470
|
throw new OpenChamberControlError('The in-app browser is not available on this server', 503);
|
|
@@ -357,6 +357,7 @@ export const createOpenChamberSessionService = (dependencies) => {
|
|
|
357
357
|
waitForOpenCodeReady,
|
|
358
358
|
emitSessionCreatedEvent,
|
|
359
359
|
createSessionGoal: createSessionGoalOverride,
|
|
360
|
+
sessionKnowledgeRuntime = null,
|
|
360
361
|
} = dependencies;
|
|
361
362
|
|
|
362
363
|
// Last user message of an existing session, as a selection to reuse. Returns
|
|
@@ -520,6 +521,13 @@ export const createOpenChamberSessionService = (dependencies) => {
|
|
|
520
521
|
}
|
|
521
522
|
} else {
|
|
522
523
|
const baseline = await latestUserMessageID({ client, sessionID, directory });
|
|
524
|
+
// A session the agent dispatched has no UI to attach the project's
|
|
525
|
+
// standing context, so it is asked for here. Never fails the dispatch:
|
|
526
|
+
// a session that runs without its background beats one that never runs.
|
|
527
|
+
const knowledge = sessionKnowledgeRuntime
|
|
528
|
+
? await sessionKnowledgeRuntime.resolvePendingForSession(sessionID, directory)
|
|
529
|
+
.catch(() => ({ text: '', signature: '' }))
|
|
530
|
+
: { text: '', signature: '' };
|
|
523
531
|
try {
|
|
524
532
|
await runPromptAsync({
|
|
525
533
|
baseUrl,
|
|
@@ -531,6 +539,7 @@ export const createOpenChamberSessionService = (dependencies) => {
|
|
|
531
539
|
...(agent ? { agent } : {}),
|
|
532
540
|
...(variant ? { variant } : {}),
|
|
533
541
|
parts: [
|
|
542
|
+
...(knowledge.text ? [{ type: 'text', text: knowledge.text, synthetic: true }] : []),
|
|
534
543
|
{ type: 'text', text: expandedPrompt },
|
|
535
544
|
...(goalInput.enabled
|
|
536
545
|
? [{ type: 'text', text: buildGoalIntroText(goalInput.tokenBudget), synthetic: true }]
|
|
@@ -541,6 +550,11 @@ export const createOpenChamberSessionService = (dependencies) => {
|
|
|
541
550
|
} catch (error) {
|
|
542
551
|
throw markGoalPartial(error);
|
|
543
552
|
}
|
|
553
|
+
if (knowledge.text && sessionKnowledgeRuntime) {
|
|
554
|
+
// After the prompt is accepted, so a rejected dispatch carries it again.
|
|
555
|
+
await sessionKnowledgeRuntime.recordDelivered(sessionID, directory, knowledge.signature)
|
|
556
|
+
.catch(() => undefined);
|
|
557
|
+
}
|
|
544
558
|
const landed = await waitForPromptLanded({
|
|
545
559
|
client,
|
|
546
560
|
sessionID,
|
|
@@ -70,10 +70,12 @@ This module provides OpenCode server integration utilities for the web server ru
|
|
|
70
70
|
- `AGENT_SCOPE`, `COMMAND_SCOPE`, `SKILL_SCOPE`: Scope constants with USER and PROJECT values.
|
|
71
71
|
- `ensureDirs()`: Creates required OpenCode directories.
|
|
72
72
|
- `parseMdFile(filePath)`, `writeMdFile(filePath, frontmatter, body)`: Markdown file operations with YAML frontmatter.
|
|
73
|
-
- `getConfigPaths(workingDirectory)`, `readConfigLayers(workingDirectory)`, `readConfig(workingDirectory)`: Config file operations with layer merging (user, project, custom).
|
|
74
|
-
- `
|
|
75
|
-
- `
|
|
76
|
-
- `
|
|
73
|
+
- `getConfigPaths(workingDirectory)`, `readConfigLayers(workingDirectory)`, `readConfig(workingDirectory)`: Config file operations with layer merging (user, project, custom). `readConfigLayers` isolates `INVALID_JSONC` per layer: a broken file is omitted from the merge (`{}` for that layer only), recorded on `layerErrors`, and does not block valid sibling layers. Writes still refuse to overwrite the broken file.
|
|
74
|
+
- `readConfigFile(filePath)`: Reads one config file. Missing, whitespace-only, and comment-only files return `{}`; a comment-only file is recognized by `ValueExpected` being the only parse error. A `jsonc-parser` error that produces a partial or non-object tree throws `INVALID_JSONC` — partial parse trees must never be treated as authoritative (avoids rewriting a `$schema`-only stub over a full config). Content that yields no JSON value for any other reason (YAML, plain text) also throws instead of reading as empty.
|
|
75
|
+
- `readConfigLayer(filePath)`: Same parse as `readConfigFile`, but isolates `INVALID_JSONC` to `{ config: {}, error }` so plugin/MCP/agent readers can skip one broken layer without aborting valid siblings. Writes still refuse to overwrite the broken file.
|
|
76
|
+
- `writeConfig(config, filePath)`: Writes config with automatic backup. Refuses to overwrite an existing non-empty file that fails the same JSONC parse check.
|
|
77
|
+
- `getJsonEntrySource(layers, sectionKey, entryName)`: Resolves which config layer provides an entry. A failed custom or user layer throws `INVALID_JSONC` instead of treating that file as empty. A failed project layer is skipped so a valid user/custom entry can still be found.
|
|
78
|
+
- `getJsonWriteTarget(layers, preferredScope)`: Determines write target for config updates. Throws `INVALID_JSONC` when the chosen target file is the unparseable layer.
|
|
77
79
|
- `getAncestors(startDir, stopDir)`, `findWorktreeRoot(startDir)`: Git worktree helpers.
|
|
78
80
|
- `isPromptFileReference(value)`, `resolvePromptFilePath(reference)`, `writePromptFile(filePath, content)`: Prompt file reference handling.
|
|
79
81
|
- `walkSkillMdFiles(rootDir)`: Recursively finds all SKILL.md files.
|
|
@@ -109,12 +111,13 @@ This module provides OpenCode server integration utilities for the web server ru
|
|
|
109
111
|
- `markSessionUnviewed(sessionId, clientId)`
|
|
110
112
|
- `markUserMessageSent(sessionId)`
|
|
111
113
|
- `resetAllSessionActivityToIdle()`
|
|
114
|
+
- `interruptBusySessionsAfterRestart()`: settles every session whose authoritative status is `busy`/`retry` or whose activity phase is still busy, broadcasts `openchamber:session-status` idle plus an OpenCode-shaped `session.error`, resets leftover activity/cooldowns, and returns the interrupted session IDs in stable order.
|
|
112
115
|
- `dispose()`
|
|
113
116
|
|
|
114
117
|
The runtime maintains active-session count incrementally from idempotent activity phase transitions. Upstream stall-timeout and lifecycle health checks read it in O(1); the hourly cleanup removes activity phases older than 24 hours without broadcasting synthetic state transitions. Snapshot generation remains reserved for the session-activity API.
|
|
115
118
|
|
|
116
119
|
## Public exports (lifecycle.js)
|
|
117
|
-
- `createOpenCodeLifecycleRuntime(dependencies)`: creates lifecycle runtime for managed/external OpenCode process orchestration. The optional `onOpenCodeRestarted` dependency (default `null`) is fired after a successful managed restart
|
|
120
|
+
- `createOpenCodeLifecycleRuntime(dependencies)`: creates lifecycle runtime for managed/external OpenCode process orchestration. The optional `onOpenCodeRestarted` dependency (default `null`) is fired after a successful managed restart. `index.js` rebinds event-stream readers to the possibly-new port (#2638), then calls `interruptBusySessionsAfterRestart()` and broadcasts one `opencode-restart-interrupted` UI notification when interrupted turns exist (#2943).
|
|
118
121
|
- Returned API:
|
|
119
122
|
- `startOpenCode()`
|
|
120
123
|
- `restartOpenCode()`
|
|
@@ -145,6 +148,8 @@ macOS `say` voice enumeration starts concurrently with server composition. The s
|
|
|
145
148
|
|
|
146
149
|
Transport-triggered health checks share the periodic monitor's failure accounting interval. Rapid WS reconnect callbacks therefore cannot exhaust the managed-process restart threshold using one cached unhealthy result; an exited managed process still restarts immediately.
|
|
147
150
|
|
|
151
|
+
Managed health failures are classified as `timeout`, `connection_refused`, `connection_reset`, `invalid_response`, or `error`. The lifecycle retains the latest counted failure with a bounded detail string and source. Managed process wrappers continue capturing a sanitized, bounded stderr tail after readiness and retain exit code/signal. Before replacing a managed process, lifecycle snapshots the reason, latest health failure, process diagnostics/aliveness, busy-session count, and timestamp into `lastOpenCodeRestartDiagnostics`; successful startup does not clear this snapshot, and `/health` exposes it for post-restart diagnosis without process environment or credentials.
|
|
152
|
+
|
|
148
153
|
## Public exports (env-runtime.js)
|
|
149
154
|
- `createOpenCodeEnvRuntime(dependencies)`: creates runtime that owns OpenCode CLI environment and binary discovery state.
|
|
150
155
|
- OpenCode CLI resolution order is persisted settings, environment overrides, bundled Desktop CLI when available, PATH, known install locations, then platform shell discovery.
|
|
@@ -202,7 +207,8 @@ Transport-triggered health checks share the periodic monitor's failure accountin
|
|
|
202
207
|
- `readSettingsFromDiskMigrated()`
|
|
203
208
|
- `writeSettingsToDisk(settings)`
|
|
204
209
|
- `persistSettings(changes)`
|
|
205
|
-
|
|
210
|
+
- Persistent permission auto-accept policy is stored under `permissionAutoAccept`; execution ownership lives in `lib/permission-auto-accept/`.
|
|
211
|
+
- Shared sidebar preferences are stored as validated top-level fields: `sidebarProjectDisplayMode`, `sidebarSessionGroupingMode`, `sidebarProjectSortOrder`, and `sidebarShowRecentSection`. Device-local picker selection and sticky-header state do not enter `settings.json`.
|
|
206
212
|
|
|
207
213
|
## Public exports (settings-helpers.js)
|
|
208
214
|
- `createSettingsHelpers(dependencies)`: creates settings helper runtime for settings request/response shaping.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
|
|
3
|
+
const readStatus = (spawnSyncFn, command, env) => spawnSyncFn(command, ['auth', 'status', '--json'], {
|
|
4
|
+
encoding: 'utf8',
|
|
5
|
+
timeout: 6000,
|
|
6
|
+
env,
|
|
7
|
+
windowsHide: true,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const resolveFromLoginShell = (spawnSyncFn, env, platform) => {
|
|
11
|
+
if (platform === 'win32') {
|
|
12
|
+
const result = spawnSyncFn('where', ['claude'], {
|
|
13
|
+
encoding: 'utf8',
|
|
14
|
+
timeout: 6000,
|
|
15
|
+
env,
|
|
16
|
+
windowsHide: true,
|
|
17
|
+
});
|
|
18
|
+
return `${result.stdout || ''}`.split(/\r?\n/).map((line) => line.trim()).find(Boolean) || null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const shell = env.SHELL || '/bin/zsh';
|
|
22
|
+
const result = spawnSyncFn(shell, ['-lic', 'command -v claude'], {
|
|
23
|
+
encoding: 'utf8',
|
|
24
|
+
timeout: 6000,
|
|
25
|
+
env,
|
|
26
|
+
windowsHide: true,
|
|
27
|
+
});
|
|
28
|
+
return `${result.stdout || ''}`.trim().split(/\s+/).pop() || null;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const getClaudeCliAuthStatus = ({
|
|
32
|
+
spawnSyncFn = spawnSync,
|
|
33
|
+
env = process.env,
|
|
34
|
+
platform = process.platform,
|
|
35
|
+
} = {}) => {
|
|
36
|
+
const childEnv = { ...env };
|
|
37
|
+
delete childEnv.ANTHROPIC_API_KEY;
|
|
38
|
+
delete childEnv.ANTHROPIC_AUTH_TOKEN;
|
|
39
|
+
delete childEnv.CLAUDE_CODE_OAUTH_TOKEN;
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
let result = readStatus(spawnSyncFn, 'claude', childEnv);
|
|
43
|
+
if (!`${result.stdout || ''}`.trim() && result.error) {
|
|
44
|
+
const resolved = resolveFromLoginShell(spawnSyncFn, childEnv, platform);
|
|
45
|
+
if (resolved) result = readStatus(spawnSyncFn, resolved, childEnv);
|
|
46
|
+
}
|
|
47
|
+
const output = `${result.stdout || ''}`.trim();
|
|
48
|
+
if (!output) return { connected: false, reason: 'empty-status' };
|
|
49
|
+
const payload = JSON.parse(output);
|
|
50
|
+
return {
|
|
51
|
+
connected: payload?.loggedIn === true,
|
|
52
|
+
reason: payload?.loggedIn === true ? 'logged-in' : 'logged-out',
|
|
53
|
+
};
|
|
54
|
+
} catch (error) {
|
|
55
|
+
return {
|
|
56
|
+
connected: false,
|
|
57
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
import { getClaudeCliAuthStatus } from './claude-cli-auth.js';
|
|
4
|
+
|
|
5
|
+
describe('getClaudeCliAuthStatus', () => {
|
|
6
|
+
test('reports the authoritative Claude CLI login state', () => {
|
|
7
|
+
let invocation = null;
|
|
8
|
+
const status = getClaudeCliAuthStatus({
|
|
9
|
+
env: {
|
|
10
|
+
PATH: '/usr/bin',
|
|
11
|
+
CLAUDE_CODE_OAUTH_TOKEN: 'must-not-leak',
|
|
12
|
+
},
|
|
13
|
+
spawnSyncFn(command, args, options) {
|
|
14
|
+
invocation = { command, args, options };
|
|
15
|
+
return { stdout: JSON.stringify({ loggedIn: true, authMethod: 'oauth' }) };
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
expect(status).toEqual({ connected: true, reason: 'logged-in' });
|
|
20
|
+
expect(invocation.command).toBe('claude');
|
|
21
|
+
expect(invocation.args).toEqual(['auth', 'status', '--json']);
|
|
22
|
+
expect(invocation.options.env.CLAUDE_CODE_OAUTH_TOKEN).toBeUndefined();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('ignores a stale OpenCode marker when the CLI is logged out', () => {
|
|
26
|
+
const status = getClaudeCliAuthStatus({
|
|
27
|
+
spawnSyncFn: () => ({ stdout: JSON.stringify({ loggedIn: false }) }),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
expect(status).toEqual({ connected: false, reason: 'logged-out' });
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('finds Claude through a login shell when a desktop PATH cannot', () => {
|
|
34
|
+
const invocations = [];
|
|
35
|
+
const status = getClaudeCliAuthStatus({
|
|
36
|
+
env: { HOME: '/Users/test', PATH: '/usr/bin:/bin', SHELL: '/bin/zsh' },
|
|
37
|
+
platform: 'darwin',
|
|
38
|
+
spawnSyncFn(command, args, options) {
|
|
39
|
+
invocations.push({ command, args, options });
|
|
40
|
+
if (command === 'claude') return { stdout: '', error: new Error('spawnSync claude ENOENT') };
|
|
41
|
+
if (command === '/bin/zsh') return { stdout: '/Users/test/.local/bin/claude\n' };
|
|
42
|
+
return { stdout: JSON.stringify({ loggedIn: true, authMethod: 'claude.ai' }) };
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
expect(status).toEqual({ connected: true, reason: 'logged-in' });
|
|
47
|
+
expect(invocations.map(({ command }) => command)).toEqual([
|
|
48
|
+
'claude',
|
|
49
|
+
'/bin/zsh',
|
|
50
|
+
'/Users/test/.local/bin/claude',
|
|
51
|
+
]);
|
|
52
|
+
expect(invocations[1].args).toEqual(['-lic', 'command -v claude']);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -8,6 +8,9 @@ import { registerGitRoutes } from '../git/routes.js';
|
|
|
8
8
|
import { registerDevServerRoutes } from '../dev-servers/routes.js';
|
|
9
9
|
import { registerMagicPromptRoutes } from '../magic-prompts/routes.js';
|
|
10
10
|
import { registerSessionFoldersRoutes } from '../session-folders/routes.js';
|
|
11
|
+
import { registerProjectContextRoutes } from '../project-context/routes.js';
|
|
12
|
+
import { registerAgentMemoryRoutes } from '../agent-memory/routes.js';
|
|
13
|
+
import { registerSessionKnowledgeRoutes } from '../session-knowledge/routes.js';
|
|
11
14
|
import { registerPermissionAutoAcceptRoutes } from '../permission-auto-accept/runtime.js';
|
|
12
15
|
import { registerConfigEntityRoutes } from './config-entity-routes.js';
|
|
13
16
|
import { registerSettingsUtilityRoutes } from './core-routes.js';
|
|
@@ -42,12 +45,11 @@ import {
|
|
|
42
45
|
import { SKILL_DIR, SKILL_SCOPE, readSkillSupportingFile, writeSkillSupportingFile, deleteSkillSupportingFile } from './shared.js';
|
|
43
46
|
import { getSkillSources, discoverSkills, mergeDiscoveredSkills, createSkill, updateSkill, deleteSkill, renameSkill, isManagedSkillPath } from './skills.js';
|
|
44
47
|
import { getCuratedSkillsSources } from '../skills-catalog/curated-sources.js';
|
|
45
|
-
import { getCacheKey,
|
|
46
|
-
import {
|
|
48
|
+
import { getCacheKey, scanWithCache } from '../skills-catalog/cache.js';
|
|
49
|
+
import { parseSkillRepoSource } from '../skills-catalog/source.js';
|
|
47
50
|
import { scanSkillsRepository } from '../skills-catalog/scan.js';
|
|
48
51
|
import { installSkillsFromRepository } from '../skills-catalog/install.js';
|
|
49
|
-
import {
|
|
50
|
-
import { installSkillsFromClawdHub } from '../skills-catalog/clawdhub/install.js';
|
|
52
|
+
import { fetchGitHubRepoMetas } from '../skills-catalog/github-meta.js';
|
|
51
53
|
|
|
52
54
|
export const createFeatureRoutesRuntime = (dependencies) => {
|
|
53
55
|
const {
|
|
@@ -116,6 +118,10 @@ export const createFeatureRoutesRuntime = (dependencies) => {
|
|
|
116
118
|
devServerScanner,
|
|
117
119
|
buildAugmentedPath,
|
|
118
120
|
projectConfigRuntime,
|
|
121
|
+
projectContextRuntime,
|
|
122
|
+
agentMemoryRuntime,
|
|
123
|
+
isAgentMemoryEnabled,
|
|
124
|
+
sessionKnowledgeRuntime,
|
|
119
125
|
scheduledTasksRuntime,
|
|
120
126
|
scheduledTaskService,
|
|
121
127
|
openChamberSessionService,
|
|
@@ -280,14 +286,11 @@ export const createFeatureRoutesRuntime = (dependencies) => {
|
|
|
280
286
|
SKILL_DIR,
|
|
281
287
|
getCuratedSkillsSources,
|
|
282
288
|
getCacheKey,
|
|
283
|
-
|
|
284
|
-
setCachedScan,
|
|
289
|
+
scanWithCache,
|
|
285
290
|
parseSkillRepoSource,
|
|
286
291
|
scanSkillsRepository,
|
|
287
292
|
installSkillsFromRepository,
|
|
288
|
-
|
|
289
|
-
installSkillsFromClawdHub,
|
|
290
|
-
isClawdHubSource,
|
|
293
|
+
fetchGitHubRepoMetas,
|
|
291
294
|
getProfiles,
|
|
292
295
|
getProfile,
|
|
293
296
|
});
|
|
@@ -304,6 +307,10 @@ export const createFeatureRoutesRuntime = (dependencies) => {
|
|
|
304
307
|
path,
|
|
305
308
|
openchamberDataDir,
|
|
306
309
|
});
|
|
310
|
+
registerProjectContextRoutes(app, { projectContextRuntime });
|
|
311
|
+
registerAgentMemoryRoutes(app, { agentMemoryRuntime, isAgentMemoryEnabled });
|
|
312
|
+
registerSessionKnowledgeRoutes(app, { sessionKnowledgeRuntime });
|
|
313
|
+
|
|
307
314
|
registerSessionFoldersRoutes(app, {
|
|
308
315
|
fsPromises,
|
|
309
316
|
path,
|