@aiworker/web 1.22.0 → 1.23.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 +4 -4
- package/bin/cli.js +14 -4
- package/bin/cli.test.js +165 -73
- package/bin/lib/cli-api-target.js +2 -2
- package/bin/lib/cli-args.js +119 -119
- package/bin/lib/cli-lifecycle.js +9 -9
- package/bin/lib/cli-network.js +3 -3
- package/bin/lib/cli-paths.js +3 -3
- package/bin/lib/cli-ports.js +2 -2
- package/bin/lib/cli-process.js +4 -4
- package/bin/lib/cli-startup.js +64 -15
- package/bin/lib/cli-tunnel-profiles.js +1 -1
- package/bin/lib/cli-tunnel-utils.js +2 -2
- package/bin/lib/commands-connect-url.js +19 -19
- package/bin/lib/commands-lifecycle.js +27 -27
- package/bin/lib/commands-logs.js +5 -5
- package/bin/lib/commands-models.js +1 -1
- package/bin/lib/commands-projects.js +1 -1
- package/bin/lib/commands-schedule.js +1 -1
- package/bin/lib/commands-serve.js +29 -29
- package/bin/lib/commands-session.js +1 -1
- package/bin/lib/commands-startup.js +45 -10
- package/bin/lib/commands-status.js +1 -1
- package/bin/lib/commands-tunnel.js +40 -40
- package/bin/lib/commands-update.js +1 -1
- package/bin/lib/commands-update.test.js +6 -6
- package/dist/assets/{CodeMirrorCommentWidgets-B3u7UIcE.js → CodeMirrorCommentWidgets-B1Gizi3a.js} +1 -1
- package/dist/assets/DiffView-DXjVsEOw.js +4 -0
- package/dist/assets/DirtyBranchSwitchDialog-aig6zJjg.js +1 -0
- package/dist/assets/FilesView-CJdG0-wk.js +17 -0
- package/dist/assets/GitView-BXsS3jG6.js +6 -0
- package/dist/assets/{JsonTreeView-B0BdZEHG.js → JsonTreeView-D_hpXBnF.js} +1 -1
- package/dist/assets/LinearIssuesView-BoUiLQG1.js +1 -0
- package/dist/assets/MarkdownImageGallery-B_B_a9KS.js +1 -0
- package/dist/assets/MarkdownRendererImpl-xgyyLiBM.js +12 -0
- package/dist/assets/OnboardingScreen-DIp84OWt.js +1 -0
- package/dist/assets/{PatchDiff-DvfqDql7.js → PatchDiff-8p6nLJaU.js} +1 -1
- package/dist/assets/PierreDiffViewer-DjC8nTk9.js +161 -0
- package/dist/assets/PlanView-CJTmOF6I.js +5 -0
- package/dist/assets/SettingsView-DD-JqIJx.js +28 -0
- package/dist/assets/{SettingsWindow-i45U1Cy1.js → SettingsWindow-Cpb4hM6q.js} +1 -1
- package/dist/assets/SymbolsNerdFontMono-Regular-aK5vsLov.woff2 +0 -0
- package/dist/assets/{ToolOutputDialog-BTwyh5OF.js → ToolOutputDialog-DfaKZXNU.js} +6 -6
- package/dist/assets/ToolPartDiffPreview-DtZLzrSK.js +8 -0
- package/dist/assets/{VirtualizedFileDiff-DD8lDVej.js → VirtualizedFileDiff-C8i9HpTB.js} +1 -1
- package/dist/assets/WalkthroughView-DeKMvZlL.js +4 -0
- package/dist/assets/{computeVirtualFileMetrics-BMIRgMHv.js → computeVirtualFileMetrics-BBI7ZwrC.js} +2 -2
- package/dist/assets/contextPanelEmbeddedChat-BdA6bdky.js +1 -0
- package/dist/assets/de-DCrsQ5zS.js +10 -0
- package/dist/assets/es-Dwv4YfH6.js +16 -0
- package/dist/assets/fr-BCWg4Cnx.js +14 -0
- package/dist/assets/ghostty-vt-DdA0Zryv.wasm +0 -0
- package/dist/assets/index-B68h5S5B.css +1 -0
- package/dist/assets/index-DVwMarHI.js +39 -0
- package/dist/assets/{index-CODwDsU_.js → index-jXSK5RrB.js} +1 -1
- package/dist/assets/{isDiffPlainText-BqayB8d3.js → isDiffPlainText-B_x_rVon.js} +1 -1
- package/dist/assets/{isFilePlainText-QfoiKJNY.js → isFilePlainText-DW_xMer1.js} +1 -1
- package/dist/assets/ja-Bruw3RYC.js +16 -0
- package/dist/assets/ko-idhXGF8j.js +16 -0
- package/dist/assets/main-BkyaQhJX.js +930 -0
- package/dist/assets/{main-C5DVOxc6.js → main-CzdPuL0s.js} +2 -2
- package/dist/assets/markdownCore-Cn4Tyejo.js +5 -0
- package/dist/assets/{miniChat-DUJ4irZc.js → miniChat-CCkqKOLp.js} +2 -2
- package/dist/assets/{mobile-CcaxB0n4.js → mobile-mvxTo055.js} +2 -2
- package/dist/assets/patchFileDiff-Csk4iNUi.js +13 -0
- package/dist/assets/pl-CGZWUqZJ.js +16 -0
- package/dist/assets/pt-BR-B8V7u7tA.js +16 -0
- package/dist/assets/renderElectronMiniChatApp-BxoyujA5.js +2 -0
- package/dist/assets/renderMobileApp-B48CsP4r.js +25 -0
- package/dist/assets/runtimeEndpointReset-Bg5gx18H.js +17 -0
- package/dist/assets/scheduledTasksApi-BW0Etzwz.js +1 -0
- package/dist/assets/{shikiHighlight-DYOWuY65.js → shikiHighlight-CRl0SUC9.js} +1 -1
- package/dist/assets/surface-oMvhsog3.js +1 -0
- package/dist/assets/tr-BK_KiO2V.js +7 -0
- package/dist/assets/uk-CG74xV8N.js +16 -0
- package/dist/assets/useAppFontEffects-CPKeOpUo.js +7284 -0
- package/dist/assets/useGitComparison-DH220WmO.js +1 -0
- package/dist/assets/useInlineCommentController-BiWz4AVb.js +2 -0
- package/dist/assets/useRootScrollLock-BS4-kr7P.js +1 -0
- package/dist/assets/{vendor-base-ui-BeMD8X_w.js → vendor-base-ui-DdV8vhHn.js} +1 -1
- package/dist/assets/{vendor-codemirror-language-data-DFZik9R2.js → vendor-codemirror-language-data-Bg4AEeCr.js} +2 -2
- package/dist/assets/vendor-zod-BPAANqvH.js +39 -0
- package/dist/assets/{web-components-Bhg83tjf.js → web-components-z7hfnS8n.js} +1 -1
- package/dist/assets/zh-CN-T4AXofZI.js +16 -0
- package/dist/assets/zh-TW-Dte40sxp.js +16 -0
- package/dist/index.html +21 -59
- package/dist/mini-chat.html +7 -7
- package/dist/mobile.html +5 -5
- package/package.json +3 -4
- package/server/index.d.ts +15 -0
- package/server/index.js +158 -89
- package/server/lib/agent-memory/actions.js +2 -2
- package/server/lib/agent-memory/feature-flag.js +1 -1
- package/server/lib/agent-memory/feature-flag.test.js +8 -8
- package/server/lib/agent-memory/routes.js +2 -2
- package/server/lib/agent-tool/runtime.js +37 -54
- package/server/lib/agent-tool/runtime.test.js +59 -59
- package/server/lib/browser-control/broker.js +3 -3
- package/server/lib/browser-control/broker.test.js +1 -1
- package/server/lib/changelog/update-notes.js +82 -0
- package/server/lib/changelog/update-notes.test.js +59 -0
- package/server/lib/client-auth/remote-clients.test.js +5 -5
- package/server/lib/context-obligatory/runtime.js +7 -7
- package/server/lib/context-obligatory/runtime.test.js +5 -5
- package/server/lib/data-dir-migration.js +40 -0
- package/server/lib/data-dir-migration.test.js +59 -0
- package/server/lib/dev-servers/parse.js +2 -2
- package/server/lib/dev-servers/parse.test.js +2 -2
- package/server/lib/dev-servers/routes.js +1 -1
- package/server/lib/dev-tunnel/DOCUMENTATION.md +13 -4
- package/server/lib/dev-tunnel/client.js +1 -1
- package/server/lib/dev-tunnel/runtime.js +5 -5
- package/server/lib/dev-tunnel/tunnel.test.js +21 -1
- package/server/lib/dictation/local/model-catalog.js +1 -1
- package/server/lib/dictation/local/worker-process.js +2 -2
- package/server/lib/event-stream/directory-ws-bridge.js +1 -1
- package/server/lib/event-stream/global-ws-bridge.js +1 -1
- package/server/lib/event-stream/protocol.test.js +4 -4
- package/server/lib/event-stream/runtime.test.js +18 -18
- package/server/lib/fs/DOCUMENTATION.md +5 -0
- package/server/lib/fs/routes.js +68 -26
- package/server/lib/fs/routes.test.js +208 -22
- package/server/lib/git/DOCUMENTATION.md +32 -6
- package/server/lib/git/identity-storage.js +1 -1
- package/server/lib/git/issue-2746-longpaths.test.js +4 -4
- package/server/lib/git/routes.js +41 -5
- package/server/lib/git/service.js +300 -224
- package/server/lib/git/service.test.js +596 -28
- package/server/lib/github/auth.js +8 -8
- package/server/lib/github/pr-status.js +1 -1
- package/server/lib/github/routes.js +2 -2
- package/server/lib/inherited-env.js +17 -10
- package/server/lib/inherited-env.test.js +10 -11
- package/server/lib/linear/auth.js +8 -8
- package/server/lib/linear/auth.test.js +24 -24
- package/server/lib/linear/issues.test.js +6 -6
- package/server/lib/linear/mapping.test.js +4 -4
- package/server/lib/linear/oauth.js +2 -2
- package/server/lib/linear/oauth.test.js +14 -14
- package/server/lib/linear/routes.js +5 -5
- package/server/lib/linear/routes.test.js +16 -16
- package/server/lib/linear/status-runtime.test.js +9 -9
- package/server/lib/linear/status.js +1 -1
- package/server/lib/linear/status.test.js +15 -15
- package/server/lib/linear/teams.test.js +4 -4
- package/server/lib/magic-prompts/routes.js +2 -2
- package/server/lib/mcp-reconnect/DOCUMENTATION.md +55 -0
- package/server/lib/mcp-reconnect/runtime.js +122 -0
- package/server/lib/mcp-reconnect/runtime.test.js +140 -0
- package/server/lib/message-queue/DOCUMENTATION.md +161 -0
- package/server/lib/message-queue/runtime.js +870 -0
- package/server/lib/message-queue/runtime.test.js +482 -0
- package/server/lib/network-defaults.js +23 -0
- package/server/lib/network-defaults.test.js +52 -0
- package/server/lib/notifications/apns-runtime.js +17 -17
- package/server/lib/notifications/apns-runtime.test.js +11 -11
- package/server/lib/notifications/emitter-runtime.js +1 -1
- package/server/lib/notifications/emitter-runtime.test.js +1 -1
- package/server/lib/notifications/push-runtime.js +7 -7
- package/server/lib/notifications/routes.js +1 -1
- package/server/lib/notifications/runtime.js +1 -1
- package/server/lib/openchamber-control/action-resolution.test.js +10 -10
- package/server/lib/openchamber-control/actions.js +24 -24
- package/server/lib/openchamber-control/error.js +4 -4
- package/server/lib/openchamber-control/routes.js +2 -2
- package/server/lib/openchamber-control/routes.test.js +5 -5
- package/server/lib/openchamber-control/screenshots.js +1 -1
- package/server/lib/openchamber-control/screenshots.test.js +1 -1
- package/server/lib/openchamber-control/service.js +50 -50
- package/server/lib/openchamber-control/service.test.js +5 -5
- package/server/lib/openchamber-sessions/routes.js +124 -22
- package/server/lib/openchamber-sessions/routes.test.js +99 -11
- package/server/lib/opencode/DOCUMENTATION.md +30 -6
- package/server/lib/opencode/auth.js +1 -1
- package/server/lib/opencode/bootstrap-runtime.js +8 -6
- package/server/lib/opencode/cli-options.js +8 -8
- package/server/lib/opencode/config-paths.test.js +116 -0
- package/server/lib/opencode/core-routes.js +8 -7
- package/server/lib/opencode/core-routes.test.js +11 -11
- package/server/lib/opencode/env-config.js +5 -5
- package/server/lib/opencode/env-config.test.js +7 -7
- package/server/lib/opencode/env-runtime.js +10 -10
- package/server/lib/opencode/env-runtime.test.js +18 -18
- package/server/lib/opencode/feature-routes-runtime.js +19 -12
- package/server/lib/opencode/hmr-state-runtime.js +2 -2
- package/server/lib/opencode/hmr-state-runtime.test.js +1 -1
- package/server/lib/opencode/input-history-scope.js +14 -0
- package/server/lib/opencode/lifecycle.js +8 -8
- package/server/lib/opencode/lifecycle.test.js +4 -4
- package/server/lib/opencode/managed-plugin-config.js +35 -0
- package/server/lib/opencode/managed-process-registry.js +3 -3
- package/server/lib/opencode/mcp-oauth-callback.test.js +2 -2
- package/server/lib/opencode/openchamber-routes.js +79 -19
- package/server/lib/opencode/openchamber-routes.test.js +139 -12
- package/server/lib/opencode/plugins.js +2 -2
- package/server/lib/opencode/plugins.test.js +1 -1
- package/server/lib/opencode/project-icon-routes.js +2 -2
- package/server/lib/opencode/project-icon-routes.test.js +1 -1
- package/server/lib/opencode/providers.js +44 -2
- package/server/lib/opencode/providers.test.js +131 -4
- package/server/lib/opencode/proxy.js +2 -2
- package/server/lib/opencode/pwa-manifest-routes.js +1 -1
- package/server/lib/opencode/restart-session-recovery.test.js +1 -1
- package/server/lib/opencode/routes-upgrade.test.js +4 -4
- package/server/lib/opencode/routes.js +19 -17
- package/server/lib/opencode/server-startup-runtime.js +6 -6
- package/server/lib/opencode/session-runtime.js +3 -3
- package/server/lib/opencode/session-runtime.test.js +6 -6
- package/server/lib/opencode/settings-files.js +214 -0
- package/server/lib/opencode/settings-helpers.js +116 -44
- package/server/lib/opencode/settings-helpers.test.js +354 -12
- package/server/lib/opencode/settings-registry.json +747 -0
- package/server/lib/opencode/settings-runtime.js +141 -20
- package/server/lib/opencode/settings-runtime.test.js +191 -4
- package/server/lib/opencode/shared.js +5 -2
- package/server/lib/opencode/shared.test.js +7 -7
- package/server/lib/opencode/shutdown-runtime.js +2 -0
- package/server/lib/opencode/skill-routes.js +2 -1
- package/server/lib/opencode/snippets.js +1 -2
- package/server/lib/opencode/startup-performance.js +1 -1
- package/server/lib/opencode/startup-performance.test.js +6 -6
- package/server/lib/opencode/static-routes-runtime.js +8 -8
- package/server/lib/opencode/static-routes-runtime.test.js +7 -7
- package/server/lib/opencode/upgrade-capability.js +2 -2
- package/server/lib/opencode/upgrade-capability.test.js +3 -3
- package/server/lib/package-manager.js +17 -42
- package/server/lib/package-manager.test.js +19 -19
- package/server/lib/permission-auto-accept/runtime.js +1 -1
- package/server/lib/project-context/DOCUMENTATION.md +25 -1
- package/server/lib/project-context/routes.http.test.js +18 -0
- package/server/lib/project-context/routes.js +16 -1
- package/server/lib/project-context/runtime.js +248 -23
- package/server/lib/project-context/runtime.test.js +106 -3
- package/server/lib/projects/DOCUMENTATION.md +76 -0
- package/server/lib/projects/project-config.js +144 -11
- package/server/lib/projects/project-id.js +17 -0
- package/server/lib/projects/project-setup.js +409 -0
- package/server/lib/projects/project-setup.test.js +557 -0
- package/server/lib/projects/routes.js +59 -0
- package/server/lib/quota/DOCUMENTATION.md +40 -2
- package/server/lib/quota/credentials/providers.js +4 -0
- package/server/lib/quota/credentials/store.js +4 -4
- package/server/lib/quota/credentials/store.test.js +8 -8
- package/server/lib/quota/index.js +1 -0
- package/server/lib/quota/providers/cline-pass.js +125 -0
- package/server/lib/quota/providers/cline-pass.test.js +103 -0
- package/server/lib/quota/providers/exe-dev.js +75 -0
- package/server/lib/quota/providers/exe-dev.test.js +47 -0
- package/server/lib/quota/providers/hyper.js +118 -0
- package/server/lib/quota/providers/hyper.test.js +126 -0
- package/server/lib/quota/providers/index.js +22 -0
- package/server/lib/quota/providers/neuralwatt.js +3 -6
- package/server/lib/quota/providers/neuralwatt.test.js +7 -7
- package/server/lib/quota/providers/ollama-cloud.js +32 -1
- package/server/lib/quota/providers/ollama-cloud.test.js +33 -1
- package/server/lib/quota/providers/opencode-go.js +3 -2
- package/server/lib/quota/providers/opencode-go.test.js +35 -6
- package/server/lib/quota/providers/openrouter.js +119 -24
- package/server/lib/quota/providers/openrouter.test.js +330 -0
- package/server/lib/quota/providers/xai.js +1 -1
- package/server/lib/quota/routes.js +2 -0
- package/server/lib/quota/utils/auth.js +1 -1
- package/server/lib/relay/DOCUMENTATION.md +56 -1
- package/server/lib/relay/cross-compat.test.js +26 -0
- package/server/lib/relay/downstream-scheduler.js +154 -0
- package/server/lib/relay/downstream-scheduler.test.js +162 -0
- package/server/lib/relay/e2ee.js +10 -8
- package/server/lib/relay/flow-control.test.js +177 -0
- package/server/lib/relay/host-client.js +38 -9
- package/server/lib/relay/host-client.test.js +9 -1
- package/server/lib/relay/host-lock.js +1 -1
- package/server/lib/relay/service.js +5 -5
- package/server/lib/relay/tunnel-codec.js +9 -0
- package/server/lib/relay/tunnel-host.js +69 -18
- package/server/lib/relay/tunnel-host.test.js +9 -1
- package/server/lib/scheduled-tasks/issue-2710-double-execution.test.js +2 -2
- package/server/lib/scheduled-tasks/routes.js +5 -5
- package/server/lib/scheduled-tasks/service.js +25 -25
- package/server/lib/scheduled-tasks/service.test.js +1 -1
- package/server/lib/security/bind-host.js +4 -4
- package/server/lib/security/bind-host.test.js +1 -1
- package/server/lib/security/request-security.js +11 -5
- package/server/lib/security/request-security.test.js +14 -14
- package/server/lib/session-assist/runtime.js +15 -18
- package/server/lib/session-folders/routes.js +2 -2
- package/server/lib/session-folders/routes.test.js +8 -8
- package/server/lib/session-goal/DOCUMENTATION.md +20 -7
- package/server/lib/session-goal/create.js +4 -2
- package/server/lib/session-goal/create.test.js +1 -1
- package/server/lib/session-goal/objectives.js +4 -4
- package/server/lib/session-goal/routes.js +1 -1
- package/server/lib/session-goal/runtime.js +91 -30
- package/server/lib/session-goal/runtime.test.js +428 -2
- package/server/lib/session-knowledge/runtime.js +11 -11
- package/server/lib/session-knowledge/runtime.test.js +5 -5
- package/server/lib/skills-catalog/DOCUMENTATION.md +1 -1
- package/server/lib/skills-catalog/cache.test.js +2 -2
- package/server/lib/skills-catalog/disk-cache.js +5 -5
- package/server/lib/skills-catalog/github-meta.test.js +2 -2
- package/server/lib/skills-catalog/install.js +3 -2
- package/server/lib/small-model/DOCUMENTATION.md +7 -2
- package/server/lib/small-model/call.js +18 -7
- package/server/lib/small-model/call.test.js +58 -6
- package/server/lib/small-model/index.js +12 -16
- package/server/lib/small-model/index.test.js +1 -1
- package/server/lib/small-model/resolve.js +1 -1
- package/server/lib/small-model/resolve.test.js +1 -1
- package/server/lib/small-model/routes.js +2 -1
- package/server/lib/small-model/runtime-providers.js +15 -7
- package/server/lib/small-model/runtime-providers.test.js +7 -1
- package/server/lib/system-prompt/runtime.js +3 -22
- package/server/lib/system-prompt/runtime.test.js +3 -3
- package/server/lib/terminal/DOCUMENTATION.md +14 -10
- package/server/lib/terminal/runtime.js +190 -31
- package/server/lib/terminal/runtime.test.js +572 -38
- package/server/lib/terminal/shells.js +20 -3
- package/server/lib/terminal/shells.test.js +33 -2
- package/server/lib/tts/base-url.js +3 -3
- package/server/lib/tts/routes.test.js +20 -20
- package/server/lib/ui-auth/ui-auth.js +12 -9
- package/server/lib/ui-auth/ui-auth.test.js +19 -3
- package/server/lib/ui-auth/ui-passkeys.js +7 -7
- package/server/lib/walkthrough/DOCUMENTATION.md +33 -14
- package/server/lib/walkthrough/index.js +1 -0
- package/server/lib/walkthrough/jobs.test.js +1 -1
- package/server/lib/walkthrough/language.test.js +1 -1
- package/server/lib/walkthrough/model-settings.js +11 -15
- package/server/lib/walkthrough/model-settings.test.js +1 -1
- package/server/lib/walkthrough/prompt.js +3 -1
- package/server/lib/walkthrough/pull-request.test.js +5 -5
- package/server/lib/walkthrough/reproduce-2607.test.js +2 -2
- package/server/lib/walkthrough/routes.test.js +26 -5
- package/server/lib/walkthrough/sources.js +23 -2
- package/server/lib/walkthrough/store.js +3 -3
- package/server/lib/walkthrough/store.test.js +1 -1
- package/server/opencode-proxy.test.js +2 -2
- package/server/proxy-headers.js +1 -1
- package/server/sse-routes.test.js +4 -4
- package/README.md.bak +0 -250
- package/bin/lib/DOCUMENTATION.md.bak +0 -163
- package/dist/assets/CommitSection-SGBCAW0w.js +0 -1
- package/dist/assets/DiffView-DluiRSla.js +0 -4
- package/dist/assets/FilesView-Bdq8ppva.js +0 -17
- package/dist/assets/GitView-Znn7VJcP.js +0 -6
- package/dist/assets/LinearIssuesView-jP-hXyac.js +0 -1
- package/dist/assets/MarkdownImageGallery-ClOvuZxC.js +0 -1
- package/dist/assets/MarkdownRendererImpl-Dt9mjTRN.js +0 -12
- package/dist/assets/OnboardingScreen-D2DG7K6b.js +0 -1
- package/dist/assets/PierreDiffViewer-B7m3f0d7.js +0 -157
- package/dist/assets/PlanView-B0F3BtPZ.js +0 -5
- package/dist/assets/SettingsView-BBW-S-gh.js +0 -28
- package/dist/assets/ToolPartDiffPreview-CUNe28U1.js +0 -8
- package/dist/assets/WalkthroughView-egQgxel3.js +0 -4
- package/dist/assets/contextPanelEmbeddedChat-C3fjDbdg.js +0 -1
- package/dist/assets/de-C1P6X5Rs.js +0 -9
- package/dist/assets/es-CDgaF1_t.js +0 -15
- package/dist/assets/fr-Bgxqvvz_.js +0 -13
- package/dist/assets/index-C57jT0Sa.css +0 -1
- package/dist/assets/index-DW_E3rnL.js +0 -7
- package/dist/assets/ja-BDRrEcNP.js +0 -15
- package/dist/assets/ko-Ba8sQV79.js +0 -15
- package/dist/assets/main-Bv5Pkngh.js +0 -928
- package/dist/assets/markdownCore-CZwzz5gw.js +0 -3
- package/dist/assets/patchFileDiff-yNfWXN4E.js +0 -10
- package/dist/assets/pl-Dioz29BI.js +0 -15
- package/dist/assets/pt-BR-DIs6ElwV.js +0 -15
- package/dist/assets/renderElectronMiniChatApp-BcKLHXKe.js +0 -2
- package/dist/assets/renderMobileApp-D9yQJy0L.js +0 -25
- package/dist/assets/runtimeEndpointReset-CjhvxLH0.js +0 -16
- package/dist/assets/scheduledTasksApi-DLW0mkQK.js +0 -1
- package/dist/assets/tr-DFnMlPxY.js +0 -6
- package/dist/assets/uk-ZrCNjM7Y.js +0 -15
- package/dist/assets/useAppFontEffects-CjrntdL0.js +0 -7310
- package/dist/assets/useInlineCommentController-CDEuSlPH.js +0 -2
- package/dist/assets/useRootScrollLock-BHYPkrLv.js +0 -1
- package/dist/assets/vendor-ghostty-web-CrxinGGH.js +0 -13
- package/dist/assets/vendor-zod-BLfBSgBh.js +0 -39
- package/dist/assets/zh-CN-iv_AV4EC.js +0 -15
- package/dist/assets/zh-TW-CzEUk38j.js +0 -15
- package/server/index.d.ts.bak +0 -39
- package/server/lib/agent-tool/DOCUMENTATION.md.bak +0 -119
- package/server/lib/browser-control/DOCUMENTATION.md.bak +0 -50
- package/server/lib/context-obligatory/DOCUMENTATION.md.bak +0 -19
- package/server/lib/dev-tunnel/DOCUMENTATION.md.bak +0 -57
- package/server/lib/dictation/DOCUMENTATION.md.bak +0 -100
- package/server/lib/event-stream/DOCUMENTATION.md.bak +0 -62
- package/server/lib/fs/DOCUMENTATION.md.bak +0 -47
- package/server/lib/git/DOCUMENTATION.md.bak +0 -193
- package/server/lib/github/DOCUMENTATION.md.bak +0 -183
- package/server/lib/linear/DOCUMENTATION.md.bak +0 -97
- package/server/lib/linear/OAUTH-BROKER-HANDOFF.md.bak +0 -91
- package/server/lib/markdown-image-grants/DOCUMENTATION.md.bak +0 -40
- package/server/lib/notifications/APNS.md.bak +0 -135
- package/server/lib/notifications/DOCUMENTATION.md.bak +0 -138
- package/server/lib/openchamber-control/DOCUMENTATION.md.bak +0 -64
- package/server/lib/opencode/DOCUMENTATION.md.bak +0 -431
- package/server/lib/opencode/managed-process-registry.d.ts.bak +0 -13
- package/server/lib/opencode/provider-env-aliases.d.ts.bak +0 -3
- package/server/lib/permission-auto-accept/DOCUMENTATION.md.bak +0 -34
- package/server/lib/project-context/DOCUMENTATION.md.bak +0 -160
- package/server/lib/quota/DOCUMENTATION.md.bak +0 -123
- package/server/lib/relay/DOCUMENTATION.md.bak +0 -100
- package/server/lib/scheduled-tasks/DOCUMENTATION.md.bak +0 -182
- package/server/lib/session-assist/DOCUMENTATION.md.bak +0 -66
- package/server/lib/session-goal/DOCUMENTATION.md.bak +0 -213
- package/server/lib/session-knowledge/DOCUMENTATION.md.bak +0 -89
- package/server/lib/skills-catalog/DOCUMENTATION.md.bak +0 -151
- package/server/lib/small-model/DOCUMENTATION.md.bak +0 -212
- package/server/lib/system-prompt/DOCUMENTATION.md.bak +0 -36
- package/server/lib/terminal/DOCUMENTATION.md.bak +0 -50
- package/server/lib/text/DOCUMENTATION.md.bak +0 -35
- package/server/lib/tts/DOCUMENTATION.md.bak +0 -147
- package/server/lib/tunnels/DOCUMENTATION.md.bak +0 -21
- package/server/lib/ui-auth/DOCUMENTATION.md.bak +0 -44
- package/server/lib/walkthrough/DOCUMENTATION.md.bak +0 -411
|
@@ -6,7 +6,7 @@ import { createApnsRuntime } from './apns-runtime.js';
|
|
|
6
6
|
// A real P-256 key so the ES256 signing path (direct mode) runs for real.
|
|
7
7
|
const { privateKey } = crypto.generateKeyPairSync('ec', { namedCurve: 'P-256' });
|
|
8
8
|
const P8 = privateKey.export({ type: 'pkcs8', format: 'pem' }).toString();
|
|
9
|
-
const APNS_CONFIG = { keyId: 'KEY123', teamId: 'TEAM123', p8: P8, bundleId: 'com.
|
|
9
|
+
const APNS_CONFIG = { keyId: 'KEY123', teamId: 'TEAM123', p8: P8, bundleId: 'com.aiworker.app', environment: 'sandbox' };
|
|
10
10
|
|
|
11
11
|
// In-memory fs so add-then-read reflects within a test.
|
|
12
12
|
const createMemoryFs = () => {
|
|
@@ -67,9 +67,9 @@ const isSend = ([url]) => String(url) === 'https://relay.test/v1/push/send';
|
|
|
67
67
|
|
|
68
68
|
afterEach(() => {
|
|
69
69
|
vi.unstubAllGlobals();
|
|
70
|
-
delete process.env.
|
|
71
|
-
delete process.env.
|
|
72
|
-
delete process.env.
|
|
70
|
+
delete process.env.AIWORKER_PUSH_RELAY_URL;
|
|
71
|
+
delete process.env.AIWORKER_PUSH_RELAY_DISABLED;
|
|
72
|
+
delete process.env.AIWORKER_APNS_ENVIRONMENT;
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
describe('apns runtime relay mode (default)', () => {
|
|
@@ -85,7 +85,7 @@ describe('apns runtime relay mode (default)', () => {
|
|
|
85
85
|
}),
|
|
86
86
|
);
|
|
87
87
|
vi.stubGlobal('fetch', fetchMock);
|
|
88
|
-
process.env.
|
|
88
|
+
process.env.AIWORKER_PUSH_RELAY_URL = 'https://relay.test/v1/push/send';
|
|
89
89
|
|
|
90
90
|
const runtime = createApnsRuntime(makeDeps());
|
|
91
91
|
await runtime.addOrUpdateApnsToken('s1', 'tokenA');
|
|
@@ -132,7 +132,7 @@ describe('apns runtime relay mode (default)', () => {
|
|
|
132
132
|
it('reuses one persisted keypair (same serverId) across register + send', async () => {
|
|
133
133
|
const fetchMock = vi.fn(async () => jsonResponse({ ok: true, results: [] }));
|
|
134
134
|
vi.stubGlobal('fetch', fetchMock);
|
|
135
|
-
process.env.
|
|
135
|
+
process.env.AIWORKER_PUSH_RELAY_URL = 'https://relay.test/v1/push/send';
|
|
136
136
|
|
|
137
137
|
const deps = makeDeps();
|
|
138
138
|
const runtime = createApnsRuntime(deps);
|
|
@@ -149,8 +149,8 @@ describe('apns runtime relay mode (default)', () => {
|
|
|
149
149
|
it('honors an explicit sandbox environment override for every token', async () => {
|
|
150
150
|
const fetchMock = vi.fn(async () => jsonResponse({ ok: true, results: [] }));
|
|
151
151
|
vi.stubGlobal('fetch', fetchMock);
|
|
152
|
-
process.env.
|
|
153
|
-
process.env.
|
|
152
|
+
process.env.AIWORKER_PUSH_RELAY_URL = 'https://relay.test/v1/push/send';
|
|
153
|
+
process.env.AIWORKER_APNS_ENVIRONMENT = 'sandbox';
|
|
154
154
|
|
|
155
155
|
const runtime = createApnsRuntime(makeDeps());
|
|
156
156
|
await runtime.addOrUpdateApnsToken('s1', 'tokenA', undefined, 'ios', 'production');
|
|
@@ -163,7 +163,7 @@ describe('apns runtime relay mode (default)', () => {
|
|
|
163
163
|
it('routes each token to its registered environment (dev build sandbox, release production)', async () => {
|
|
164
164
|
const fetchMock = vi.fn(async () => jsonResponse({ ok: true, results: [] }));
|
|
165
165
|
vi.stubGlobal('fetch', fetchMock);
|
|
166
|
-
process.env.
|
|
166
|
+
process.env.AIWORKER_PUSH_RELAY_URL = 'https://relay.test/v1/push/send';
|
|
167
167
|
|
|
168
168
|
const runtime = createApnsRuntime(makeDeps());
|
|
169
169
|
await runtime.addOrUpdateApnsToken('s1', 'tokenXcode', undefined, 'ios', 'sandbox');
|
|
@@ -200,7 +200,7 @@ describe('apns runtime direct fallback (relay disabled)', () => {
|
|
|
200
200
|
});
|
|
201
201
|
|
|
202
202
|
it('sends each token to the APNs host of its registered environment', async () => {
|
|
203
|
-
process.env.
|
|
203
|
+
process.env.AIWORKER_PUSH_RELAY_DISABLED = 'true';
|
|
204
204
|
const { environment: _environment, ...configWithoutEnvironment } = APNS_CONFIG;
|
|
205
205
|
const hosts = [];
|
|
206
206
|
const http2 = {
|
|
@@ -241,7 +241,7 @@ describe('apns runtime direct fallback (relay disabled)', () => {
|
|
|
241
241
|
});
|
|
242
242
|
|
|
243
243
|
it('signs an ES256 JWT and sends over http2 when relay is disabled', async () => {
|
|
244
|
-
process.env.
|
|
244
|
+
process.env.AIWORKER_PUSH_RELAY_DISABLED = 'true';
|
|
245
245
|
const targeted = [];
|
|
246
246
|
const http2 = {
|
|
247
247
|
connect: () => ({
|
|
@@ -66,7 +66,7 @@ export const createNotificationEmitterRuntime = (dependencies) => {
|
|
|
66
66
|
const desktopNotificationDelivered = options.desktopNotificationDelivered === true;
|
|
67
67
|
|
|
68
68
|
const syntheticPayload = {
|
|
69
|
-
type: '
|
|
69
|
+
type: 'aiworker:notification',
|
|
70
70
|
properties: {
|
|
71
71
|
...payload,
|
|
72
72
|
// Tell local desktop UI whether a native channel already accepted this
|
|
@@ -36,7 +36,7 @@ describe('notification emitter runtime', () => {
|
|
|
36
36
|
runtime.broadcastUiNotification({ title: 'Ready' }, { desktopNotificationDelivered: true });
|
|
37
37
|
|
|
38
38
|
expect(broadcastGlobalUiEvent).toHaveBeenCalledWith({
|
|
39
|
-
type: '
|
|
39
|
+
type: 'aiworker:notification',
|
|
40
40
|
properties: {
|
|
41
41
|
title: 'Ready',
|
|
42
42
|
desktopNotificationDelivered: true,
|
|
@@ -305,16 +305,16 @@ export const createPushRuntime = (deps) => {
|
|
|
305
305
|
};
|
|
306
306
|
|
|
307
307
|
const resolveVapidSubject = async () => {
|
|
308
|
-
const configured = process.env.
|
|
308
|
+
const configured = process.env.AIWORKER_VAPID_SUBJECT;
|
|
309
309
|
if (typeof configured === 'string' && configured.trim().length > 0) {
|
|
310
310
|
return configured.trim();
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
const originEnv = process.env.
|
|
313
|
+
const originEnv = process.env.AIWORKER_PUBLIC_ORIGIN;
|
|
314
314
|
if (typeof originEnv === 'string' && originEnv.trim().length > 0) {
|
|
315
315
|
const trimmed = originEnv.trim();
|
|
316
316
|
if (isLoopbackHttpOrigin(trimmed)) {
|
|
317
|
-
return 'mailto:
|
|
317
|
+
return 'mailto:aiworker@localhost';
|
|
318
318
|
}
|
|
319
319
|
return trimmed;
|
|
320
320
|
}
|
|
@@ -325,14 +325,14 @@ export const createPushRuntime = (deps) => {
|
|
|
325
325
|
if (typeof stored === 'string' && stored.trim().length > 0) {
|
|
326
326
|
const trimmed = stored.trim();
|
|
327
327
|
if (isLoopbackHttpOrigin(trimmed)) {
|
|
328
|
-
return 'mailto:
|
|
328
|
+
return 'mailto:aiworker@localhost';
|
|
329
329
|
}
|
|
330
330
|
return trimmed;
|
|
331
331
|
}
|
|
332
332
|
} catch {
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
-
return 'mailto:
|
|
335
|
+
return 'mailto:aiworker@localhost';
|
|
336
336
|
};
|
|
337
337
|
|
|
338
338
|
const ensurePushInitialized = async () => {
|
|
@@ -340,8 +340,8 @@ export const createPushRuntime = (deps) => {
|
|
|
340
340
|
const keys = await getOrCreateVapidKeys();
|
|
341
341
|
const subject = await resolveVapidSubject();
|
|
342
342
|
|
|
343
|
-
if (subject === 'mailto:
|
|
344
|
-
console.warn('[Push] No public origin configured for VAPID; set
|
|
343
|
+
if (subject === 'mailto:aiworker@localhost') {
|
|
344
|
+
console.warn('[Push] No public origin configured for VAPID; set AIWORKER_VAPID_SUBJECT or enable push once from a real origin.');
|
|
345
345
|
}
|
|
346
346
|
|
|
347
347
|
webPush.setVapidDetails(subject, keys.publicKey, keys.privateKey);
|
|
@@ -272,7 +272,7 @@ export const registerNotificationRoutes = (app, dependencies) => {
|
|
|
272
272
|
|
|
273
273
|
try {
|
|
274
274
|
writeSseEvent(res, {
|
|
275
|
-
type: '
|
|
275
|
+
type: 'aiworker:notification-stream-ready',
|
|
276
276
|
properties: { uiToken },
|
|
277
277
|
});
|
|
278
278
|
flushSse();
|
|
@@ -293,7 +293,7 @@ export const createNotificationTriggerRuntime = (deps) => {
|
|
|
293
293
|
});
|
|
294
294
|
if (!response.ok) return false;
|
|
295
295
|
const session = await response.json().catch(() => null);
|
|
296
|
-
const goal = session?.metadata?.
|
|
296
|
+
const goal = session?.metadata?.aiworker?.goal;
|
|
297
297
|
return Boolean(goal && typeof goal === 'object' && goal.status === 'active');
|
|
298
298
|
} catch {
|
|
299
299
|
return false;
|
|
@@ -4,28 +4,28 @@ import { resolveAgentToolAction } from './actions.js';
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Both cases here are from one real conversation: the model called `read` and
|
|
7
|
-
* then `get` on `
|
|
7
|
+
* then `get` on `aiworker_memory`, having dropped the namespace its own tool
|
|
8
8
|
* name appeared to supply, and gave up after the second bare "unsupported".
|
|
9
9
|
*/
|
|
10
10
|
describe('a namespace the tool name already implies', () => {
|
|
11
11
|
test('resolves a bare action inside the calling tool', () => {
|
|
12
|
-
expect(resolveAgentToolAction('read', '
|
|
13
|
-
expect(resolveAgentToolAction('save', '
|
|
12
|
+
expect(resolveAgentToolAction('read', 'aiworker_memory')).toEqual({ action: 'memory.read' });
|
|
13
|
+
expect(resolveAgentToolAction('save', 'aiworker_memory')).toEqual({ action: 'memory.save' });
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
test('resolves a bare name that is ambiguous only across tools', () => {
|
|
17
17
|
// `delete` belongs to schedule and to memory; inside one tool it is plain.
|
|
18
|
-
expect(resolveAgentToolAction('delete', '
|
|
19
|
-
expect(resolveAgentToolAction('delete', '
|
|
18
|
+
expect(resolveAgentToolAction('delete', 'aiworker_memory')).toEqual({ action: 'memory.delete' });
|
|
19
|
+
expect(resolveAgentToolAction('delete', 'aiworker')).toEqual({ action: 'schedule.delete' });
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
test('keeps a fully qualified action as it is', () => {
|
|
23
|
-
expect(resolveAgentToolAction('memory.read', '
|
|
23
|
+
expect(resolveAgentToolAction('memory.read', 'aiworker_memory')).toEqual({ action: 'memory.read' });
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
test('does not reach outside the tool that asked', () => {
|
|
27
27
|
// The memory tool asking for `open` must fail, not drive the browser.
|
|
28
|
-
expect(resolveAgentToolAction('open', '
|
|
28
|
+
expect(resolveAgentToolAction('open', 'aiworker_memory').action).toBeUndefined();
|
|
29
29
|
});
|
|
30
30
|
});
|
|
31
31
|
|
|
@@ -41,7 +41,7 @@ describe('an unidentified caller', () => {
|
|
|
41
41
|
|
|
42
42
|
describe('what an unresolvable action reports', () => {
|
|
43
43
|
test('names the actions the calling tool actually has', () => {
|
|
44
|
-
const { error } = resolveAgentToolAction('get', '
|
|
44
|
+
const { error } = resolveAgentToolAction('get', 'aiworker_memory');
|
|
45
45
|
|
|
46
46
|
expect(error).toContain('memory.read');
|
|
47
47
|
expect(error).toContain('memory.save');
|
|
@@ -50,14 +50,14 @@ describe('what an unresolvable action reports', () => {
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
test('reports a missing action rather than resolving to something', () => {
|
|
53
|
-
const { error, action } = resolveAgentToolAction('', '
|
|
53
|
+
const { error, action } = resolveAgentToolAction('', 'aiworker_memory');
|
|
54
54
|
|
|
55
55
|
expect(action).toBeUndefined();
|
|
56
56
|
expect(error).toContain('missing');
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
test('an unknown tool falls back to the full action list', () => {
|
|
60
|
-
const { error } = resolveAgentToolAction('nonsense', '
|
|
60
|
+
const { error } = resolveAgentToolAction('nonsense', 'aiworker_future');
|
|
61
61
|
|
|
62
62
|
expect(error).toContain('memory.read');
|
|
63
63
|
expect(error).toContain('browser.open');
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* removes it entirely, parameters included, rather than leaving its inputs
|
|
8
8
|
* visible in a shared schema.
|
|
9
9
|
*/
|
|
10
|
-
export const
|
|
10
|
+
export const AIWORKER_CONTROL_ACTION_DEFINITIONS = Object.freeze([
|
|
11
11
|
{ action: 'projects.list', title: 'List configured projects', description: 'List configured projects; no parameters' },
|
|
12
12
|
{ action: 'models.list', title: 'Show model preferences', description: 'Show default, favorite, and recent model preferences; no parameters' },
|
|
13
13
|
{ action: 'session.list', title: 'List sessions', description: 'List sessions; optional directory, limit (default 10), all, or withStatus' },
|
|
@@ -24,19 +24,19 @@ export const OPENCHAMBER_CONTROL_ACTION_DEFINITIONS = Object.freeze([
|
|
|
24
24
|
{ action: 'schedule.toggle', title: 'Enable or disable a scheduled task', description: 'Enable or disable taskId; requires the disabled boolean' },
|
|
25
25
|
]);
|
|
26
26
|
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const AIWORKER_CONTROL_ACTIONS = Object.freeze(
|
|
28
|
+
AIWORKER_CONTROL_ACTION_DEFINITIONS.map(({ action }) => action),
|
|
29
29
|
);
|
|
30
30
|
|
|
31
|
-
export const
|
|
32
|
-
|
|
31
|
+
export const AIWORKER_AGENT_TOOL_ACTION_DEFINITIONS = Object.freeze(
|
|
32
|
+
AIWORKER_CONTROL_ACTION_DEFINITIONS.filter(({ agentExposed }) => agentExposed !== false),
|
|
33
33
|
);
|
|
34
34
|
|
|
35
|
-
export const
|
|
36
|
-
|
|
35
|
+
export const AIWORKER_AGENT_TOOL_ACTIONS = Object.freeze(
|
|
36
|
+
AIWORKER_AGENT_TOOL_ACTION_DEFINITIONS.map(({ action }) => action),
|
|
37
37
|
);
|
|
38
38
|
|
|
39
|
-
export const
|
|
39
|
+
export const AIWORKER_WEB_ACTION_DEFINITIONS = Object.freeze([
|
|
40
40
|
{ action: 'browser.open', title: 'Open a page in the browser panel', description: 'Open url in the in-app browser panel; use it to look at the running app. Set viewport to mobile, tablet or desktop to lay the page out at that size' },
|
|
41
41
|
{ action: 'browser.snapshot', title: 'Read the open page', description: 'Read the open page: url, title, visible text, and interactive elements with the selectors the other browser actions accept. Pass selector to read only that part of a long page. Reports any errors the page logged' },
|
|
42
42
|
{ action: 'browser.click', title: 'Click on the open page', description: 'Click an element; give selector, or text to match a link or button by its visible label' },
|
|
@@ -49,8 +49,8 @@ export const OPENCHAMBER_WEB_ACTION_DEFINITIONS = Object.freeze([
|
|
|
49
49
|
{ action: 'browser.resize', title: 'Change the page viewport', description: 'Lay the open page out at a different size; viewport is mobile, tablet, desktop, or fill to use the whole panel' },
|
|
50
50
|
]);
|
|
51
51
|
|
|
52
|
-
export const
|
|
53
|
-
|
|
52
|
+
export const AIWORKER_WEB_ACTIONS = Object.freeze(
|
|
53
|
+
AIWORKER_WEB_ACTION_DEFINITIONS.map(({ action }) => action),
|
|
54
54
|
);
|
|
55
55
|
|
|
56
56
|
/**
|
|
@@ -64,31 +64,31 @@ export const OPENCHAMBER_WEB_ACTIONS = Object.freeze(
|
|
|
64
64
|
* listing everything again — and toward reading it at all, since a title that
|
|
65
65
|
* reads as a complete fact is exactly the one whose conditions get lost.
|
|
66
66
|
*/
|
|
67
|
-
export const
|
|
67
|
+
export const AIWORKER_MEMORY_ACTION_DEFINITIONS = Object.freeze([
|
|
68
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
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
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
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
72
|
]);
|
|
73
73
|
|
|
74
|
-
export const
|
|
75
|
-
|
|
74
|
+
export const AIWORKER_MEMORY_ACTIONS = Object.freeze(
|
|
75
|
+
AIWORKER_MEMORY_ACTION_DEFINITIONS.map(({ action }) => action),
|
|
76
76
|
);
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* Which actions each managed tool may ask for.
|
|
80
80
|
*
|
|
81
81
|
* The callback needs this because models routinely drop the namespace: asked
|
|
82
|
-
* for `memory.read` from a tool already called `
|
|
82
|
+
* for `memory.read` from a tool already called `aiworker_memory`, they send
|
|
83
83
|
* `read`, since the tool's own name appears to have said "memory" already. The
|
|
84
84
|
* name is unambiguous inside one tool's action set even when it is not across
|
|
85
85
|
* all of them (`delete` belongs to both schedule and memory), so resolution
|
|
86
86
|
* starts from the tool that asked.
|
|
87
87
|
*/
|
|
88
88
|
const ACTIONS_BY_TOOL = Object.freeze({
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
aiworker: AIWORKER_AGENT_TOOL_ACTIONS,
|
|
90
|
+
aiworker_web: AIWORKER_WEB_ACTIONS,
|
|
91
|
+
aiworker_memory: AIWORKER_MEMORY_ACTIONS,
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
const bareName = (action) => {
|
|
@@ -110,7 +110,7 @@ const uniqueMatch = (candidates, requested) => {
|
|
|
110
110
|
export const resolveAgentToolAction = (requested, toolName) => {
|
|
111
111
|
const value = typeof requested === 'string' ? requested.trim() : '';
|
|
112
112
|
const scoped = ACTIONS_BY_TOOL[toolName] ?? null;
|
|
113
|
-
const known = scoped ??
|
|
113
|
+
const known = scoped ?? AIWORKER_ALL_ACTIONS;
|
|
114
114
|
|
|
115
115
|
if (value && known.includes(value)) {
|
|
116
116
|
return { action: value };
|
|
@@ -119,20 +119,20 @@ export const resolveAgentToolAction = (requested, toolName) => {
|
|
|
119
119
|
const resolved = uniqueMatch(known, value)
|
|
120
120
|
// A tool that did not identify itself still gets the benefit when the
|
|
121
121
|
// bare name means only one thing across every action.
|
|
122
|
-
?? (scoped ? null : uniqueMatch(
|
|
122
|
+
?? (scoped ? null : uniqueMatch(AIWORKER_ALL_ACTIONS, value));
|
|
123
123
|
if (resolved) {
|
|
124
124
|
return { action: resolved };
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
return {
|
|
129
|
-
error: `Unsupported
|
|
129
|
+
error: `Unsupported AiWorker action: ${value || 'missing'}. Use one of: ${known.join(', ')}`,
|
|
130
130
|
};
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
/** Everything the callback route will dispatch, whichever tool asked. */
|
|
134
|
-
export const
|
|
135
|
-
...
|
|
136
|
-
...
|
|
137
|
-
...
|
|
134
|
+
export const AIWORKER_ALL_ACTIONS = Object.freeze([
|
|
135
|
+
...AIWORKER_CONTROL_ACTIONS,
|
|
136
|
+
...AIWORKER_WEB_ACTIONS,
|
|
137
|
+
...AIWORKER_MEMORY_ACTIONS,
|
|
138
138
|
]);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export class
|
|
1
|
+
export class AiWorkerControlError extends Error {
|
|
2
2
|
constructor(message, statusCode = 500, details = {}) {
|
|
3
3
|
super(message);
|
|
4
|
-
this.name = '
|
|
4
|
+
this.name = 'AiWorkerControlError';
|
|
5
5
|
this.statusCode = statusCode;
|
|
6
6
|
Object.assign(this, details);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export const asControlError = (error, fallbackMessage, fallbackStatus = 500) => {
|
|
11
|
-
if (error instanceof
|
|
11
|
+
if (error instanceof AiWorkerControlError) return error;
|
|
12
12
|
const message = error instanceof Error ? error.message : fallbackMessage;
|
|
13
|
-
return new
|
|
13
|
+
return new AiWorkerControlError(message || fallbackMessage, Number(error?.statusCode) || fallbackStatus, {
|
|
14
14
|
...(error?.goalConfigured === true ? { goalConfigured: true } : {}),
|
|
15
15
|
});
|
|
16
16
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { asControlError } from './error.js';
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const registerAiWorkerControlRoutes = (app, { controlService }) => {
|
|
5
5
|
app.post('/api/openchamber/control', express.json({ limit: '1mb' }), async (req, res) => {
|
|
6
6
|
const controller = new AbortController();
|
|
7
7
|
const abortOnDisconnect = () => {
|
|
@@ -18,7 +18,7 @@ export const registerOpenChamberControlRoutes = (app, { controlService }) => {
|
|
|
18
18
|
const data = await controlService.execute(action, input, req.body?.contextDirectory, { signal: controller.signal });
|
|
19
19
|
return res.json(data);
|
|
20
20
|
} catch (error) {
|
|
21
|
-
const controlError = asControlError(error, '
|
|
21
|
+
const controlError = asControlError(error, 'AiWorker control action failed');
|
|
22
22
|
return res.status(controlError.statusCode).json({
|
|
23
23
|
error: controlError.message,
|
|
24
24
|
...(controlError.partial === true ? {
|
|
@@ -2,16 +2,16 @@ import express from 'express';
|
|
|
2
2
|
import request from 'supertest';
|
|
3
3
|
import { describe, expect, it, vi } from 'vitest';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { AiWorkerControlError } from './error.js';
|
|
6
|
+
import { registerAiWorkerControlRoutes } from './routes.js';
|
|
7
7
|
|
|
8
8
|
const createApp = (execute) => {
|
|
9
9
|
const app = express();
|
|
10
|
-
|
|
10
|
+
registerAiWorkerControlRoutes(app, { controlService: { execute } });
|
|
11
11
|
return app;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
describe('
|
|
14
|
+
describe('AiWorker control route', () => {
|
|
15
15
|
it('is a thin adapter over the control service', async () => {
|
|
16
16
|
const execute = vi.fn(async () => ({ projects: [] }));
|
|
17
17
|
const response = await request(createApp(execute))
|
|
@@ -24,7 +24,7 @@ describe('OpenChamber control route', () => {
|
|
|
24
24
|
|
|
25
25
|
it('preserves service status and partial-result details', async () => {
|
|
26
26
|
const execute = vi.fn(async () => {
|
|
27
|
-
throw new
|
|
27
|
+
throw new AiWorkerControlError('dispatch failed', 500, {
|
|
28
28
|
partial: true,
|
|
29
29
|
partialAction: 'fork-created',
|
|
30
30
|
sessionId: 'ses_fork',
|
|
@@ -15,7 +15,7 @@ import path from 'node:path';
|
|
|
15
15
|
import fsPromises from 'node:fs/promises';
|
|
16
16
|
|
|
17
17
|
/** Project-relative home for agent screenshots. */
|
|
18
|
-
export const SCREENSHOT_DIRECTORY = path.join('.
|
|
18
|
+
export const SCREENSHOT_DIRECTORY = path.join('.aiworker', 'screenshots');
|
|
19
19
|
|
|
20
20
|
const MAX_LABEL_LENGTH = 48;
|
|
21
21
|
|
|
@@ -47,7 +47,7 @@ describe('writing a screenshot', () => {
|
|
|
47
47
|
fs,
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
expect(result.path).toBe('.
|
|
50
|
+
expect(result.path).toBe('.aiworker/screenshots/after-fix-2026-08-13T09-37-00-000.jpg');
|
|
51
51
|
expect(result.path.includes('\\')).toBe(false);
|
|
52
52
|
expect(result.absolutePath).toBe(path.join('/work/project', SCREENSHOT_DIRECTORY, 'after-fix-2026-08-13T09-37-00-000.jpg'));
|
|
53
53
|
expect(fs.written.get(result.absolutePath).toString()).toBe('image-bytes');
|