@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
package/server/index.js
CHANGED
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
registerCommonRequestMiddleware,
|
|
65
65
|
registerServerStatusRoutes,
|
|
66
66
|
} from './lib/opencode/core-routes.js';
|
|
67
|
-
import {
|
|
67
|
+
import { registerAiWorkerRoutes } from './lib/opencode/openchamber-routes.js';
|
|
68
68
|
import { createServerUtilsRuntime } from './lib/opencode/server-utils-runtime.js';
|
|
69
69
|
import { createStaticRoutesRuntime } from './lib/opencode/static-routes-runtime.js';
|
|
70
70
|
import { createSettingsRuntime } from './lib/opencode/settings-runtime.js';
|
|
@@ -91,8 +91,10 @@ import { createPushRuntime } from './lib/notifications/push-runtime.js';
|
|
|
91
91
|
import { createApnsRuntime } from './lib/notifications/apns-runtime.js';
|
|
92
92
|
import { createNotificationTemplateRuntime } from './lib/notifications/template-runtime.js';
|
|
93
93
|
import { createPermissionAutoAcceptRuntime } from './lib/permission-auto-accept/runtime.js';
|
|
94
|
+
import { createMessageQueueRuntime } from './lib/message-queue/runtime.js';
|
|
94
95
|
import { createGracefulShutdownRuntime } from './lib/opencode/shutdown-runtime.js';
|
|
95
96
|
import { createProjectConfigRuntime } from './lib/projects/project-config.js';
|
|
97
|
+
import { migrateLegacyUserDirs } from './lib/data-dir-migration.js';
|
|
96
98
|
import { createProjectContextRuntime } from './lib/project-context/runtime.js';
|
|
97
99
|
import { createAgentMemoryRuntime } from './lib/agent-memory/runtime.js';
|
|
98
100
|
import { createAgentMemoryActions } from './lib/agent-memory/actions.js';
|
|
@@ -110,20 +112,25 @@ import { createDevServerScanner } from './lib/dev-servers/routes.js';
|
|
|
110
112
|
import { createDevTunnelRuntime } from './lib/dev-tunnel/runtime.js';
|
|
111
113
|
import { registerBrowserControlRoutes } from './lib/browser-control/routes.js';
|
|
112
114
|
import { createSystemPromptRuntime } from './lib/system-prompt/runtime.js';
|
|
113
|
-
import {
|
|
115
|
+
import { createMcpReconnectRuntime } from './lib/mcp-reconnect/runtime.js';
|
|
116
|
+
import { createAiWorkerSessionService } from './lib/openchamber-sessions/routes.js';
|
|
114
117
|
import { createScheduledTaskService } from './lib/scheduled-tasks/service.js';
|
|
115
|
-
import {
|
|
116
|
-
import {
|
|
118
|
+
import { createAiWorkerControlService } from './lib/openchamber-control/service.js';
|
|
119
|
+
import { AiWorkerControlError } from './lib/openchamber-control/error.js';
|
|
117
120
|
import webPush from 'web-push';
|
|
121
|
+
import { applyConnectAttemptTimeout } from './lib/network-defaults.js';
|
|
122
|
+
|
|
123
|
+
// Background CLI launches enter here in a fresh process, without CLI defaults.
|
|
124
|
+
applyConnectAttemptTimeout();
|
|
118
125
|
|
|
119
126
|
const __filename = fileURLToPath(import.meta.url);
|
|
120
127
|
const __dirname = path.dirname(__filename);
|
|
121
128
|
|
|
122
129
|
const DEFAULT_PORT = 3000;
|
|
123
|
-
const DESKTOP_NOTIFY_PREFIX = '[
|
|
130
|
+
const DESKTOP_NOTIFY_PREFIX = '[AiWorkerDesktopNotify] ';
|
|
124
131
|
const uiNotificationClients = new Set();
|
|
125
132
|
const uiNotificationWsClients = new Set();
|
|
126
|
-
const
|
|
133
|
+
const uiAiWorkerEventClients = new Set();
|
|
127
134
|
const HEALTH_CHECK_INTERVAL = 15000;
|
|
128
135
|
const SHUTDOWN_TIMEOUT = 10000;
|
|
129
136
|
const MODELS_DEV_API_URL = 'https://models.dev/api.json';
|
|
@@ -168,7 +175,7 @@ const SSE_PATH_PREFIXES = [
|
|
|
168
175
|
];
|
|
169
176
|
|
|
170
177
|
function shouldSkipCompression(req, res) {
|
|
171
|
-
if (process.env.
|
|
178
|
+
if (process.env.AIWORKER_RUNTIME === 'desktop') {
|
|
172
179
|
return true;
|
|
173
180
|
}
|
|
174
181
|
|
|
@@ -190,7 +197,7 @@ function shouldSkipCompression(req, res) {
|
|
|
190
197
|
return headerIncludesEventStream(res.getHeader('Content-Type'));
|
|
191
198
|
}
|
|
192
199
|
|
|
193
|
-
const
|
|
200
|
+
const AIWORKER_VERSION = (() => {
|
|
194
201
|
try {
|
|
195
202
|
const packagePath = path.resolve(__dirname, '..', 'package.json');
|
|
196
203
|
const raw = fs.readFileSync(packagePath, 'utf8');
|
|
@@ -218,13 +225,13 @@ const isEnvFlagDisabled = (value) => {
|
|
|
218
225
|
};
|
|
219
226
|
|
|
220
227
|
const shouldSkipApiCompression = () => {
|
|
221
|
-
if (isEnvFlagEnabled(process.env.
|
|
222
|
-
if (isEnvFlagEnabled(process.env.
|
|
223
|
-
if (isEnvFlagDisabled(process.env.
|
|
224
|
-
return process.env.
|
|
228
|
+
if (isEnvFlagEnabled(process.env.AIWORKER_SKIP_API_COMPRESSION)) return true;
|
|
229
|
+
if (isEnvFlagEnabled(process.env.AIWORKER_COMPRESS_API)) return false;
|
|
230
|
+
if (isEnvFlagDisabled(process.env.AIWORKER_COMPRESS_API)) return true;
|
|
231
|
+
return process.env.AIWORKER_RUNTIME === 'desktop';
|
|
225
232
|
};
|
|
226
233
|
|
|
227
|
-
const
|
|
234
|
+
const AIWORKER_VERBOSE_REQUEST_LOGS = isEnvFlagEnabled(process.env.AIWORKER_VERBOSE_REQUEST_LOGS);
|
|
228
235
|
|
|
229
236
|
const PLAN_MODE_EXPERIMENT_ENABLED =
|
|
230
237
|
isEnvFlagEnabled(process.env.OPENCODE_EXPERIMENTAL_PLAN_MODE)
|
|
@@ -257,16 +264,27 @@ const normalizeManagedRemoteTunnelPresets = (...args) =>
|
|
|
257
264
|
const normalizeManagedRemoteTunnelPresetTokens = (...args) =>
|
|
258
265
|
settingsNormalizationRuntime.normalizeManagedRemoteTunnelPresetTokens(...args);
|
|
259
266
|
const isUnsafeSkillRelativePath = (...args) => settingsNormalizationRuntime.isUnsafeSkillRelativePath(...args);
|
|
260
|
-
const sanitizeTypographySizesPartial = (...args) =>
|
|
261
|
-
settingsNormalizationRuntime.sanitizeTypographySizesPartial(...args);
|
|
262
267
|
const normalizeStringArray = (...args) => settingsNormalizationRuntime.normalizeStringArray(...args);
|
|
263
268
|
const sanitizeModelRefs = (...args) => settingsNormalizationRuntime.sanitizeModelRefs(...args);
|
|
264
269
|
const sanitizeSkillCatalogs = (...args) => settingsNormalizationRuntime.sanitizeSkillCatalogs(...args);
|
|
265
270
|
const sanitizeProjects = (...args) => settingsNormalizationRuntime.sanitizeProjects(...args);
|
|
266
271
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
272
|
+
// Every AiWorker-owned file and folder hangs off one root: the default
|
|
273
|
+
// `~/.config/openchamber`, or `AIWORKER_DATA_DIR` when set. The user
|
|
274
|
+
// folders (`projects/`, `themes/`, `speech-models/`) are copied into a custom
|
|
275
|
+
// root once at startup (`migrateLegacyUserDirs`), because they used to ignore
|
|
276
|
+
// the variable.
|
|
277
|
+
const AIWORKER_DEFAULT_CONFIG_ROOT = path.join(os.homedir(), '.config', 'aiworker');
|
|
278
|
+
const AIWORKER_USER_CONFIG_ROOT = process.env.AIWORKER_DATA_DIR
|
|
279
|
+
? path.resolve(process.env.AIWORKER_DATA_DIR)
|
|
280
|
+
: AIWORKER_DEFAULT_CONFIG_ROOT;
|
|
281
|
+
const AIWORKER_USER_THEMES_DIR = path.join(AIWORKER_USER_CONFIG_ROOT, 'themes');
|
|
282
|
+
const AIWORKER_PROJECTS_CONFIG_DIR = path.join(AIWORKER_USER_CONFIG_ROOT, 'projects');
|
|
283
|
+
// AIWORKER_CHATS_DIR relocates managed chat worktrees — needed when the
|
|
284
|
+
// OpenCode server runs as a separate user that cannot traverse $HOME.
|
|
285
|
+
const AIWORKER_CHATS_DIR = process.env.AIWORKER_CHATS_DIR && process.env.AIWORKER_CHATS_DIR.trim()
|
|
286
|
+
? path.resolve(process.env.AIWORKER_CHATS_DIR.trim())
|
|
287
|
+
: path.join(AIWORKER_USER_CONFIG_ROOT, 'chats');
|
|
270
288
|
|
|
271
289
|
const MAX_THEME_JSON_BYTES = 512 * 1024;
|
|
272
290
|
|
|
@@ -274,7 +292,7 @@ const MAX_THEME_JSON_BYTES = 512 * 1024;
|
|
|
274
292
|
const themeRuntime = createThemeRuntime({
|
|
275
293
|
fsPromises,
|
|
276
294
|
path,
|
|
277
|
-
themesDir:
|
|
295
|
+
themesDir: AIWORKER_USER_THEMES_DIR,
|
|
278
296
|
maxThemeJsonBytes: MAX_THEME_JSON_BYTES,
|
|
279
297
|
logger: console,
|
|
280
298
|
});
|
|
@@ -284,6 +302,7 @@ const readCustomThemesFromDisk = (...args) => themeRuntime.readCustomThemesFromD
|
|
|
284
302
|
let notificationTemplateRuntime = null;
|
|
285
303
|
let agentToolRuntime = null;
|
|
286
304
|
let systemPromptRuntime = null;
|
|
305
|
+
let mcpReconnectRuntime = null;
|
|
287
306
|
|
|
288
307
|
const createTimeoutSignal = (...args) => notificationTemplateRuntime.createTimeoutSignal(...args);
|
|
289
308
|
const formatProjectLabel = (...args) => notificationTemplateRuntime.formatProjectLabel(...args);
|
|
@@ -297,16 +316,14 @@ const maybeCacheSessionInfoFromEvent = (...args) => notificationTemplateRuntime.
|
|
|
297
316
|
const buildTemplateVariables = (...args) => notificationTemplateRuntime.buildTemplateVariables(...args);
|
|
298
317
|
const getCachedZenModels = (...args) => notificationTemplateRuntime.getCachedZenModels(...args);
|
|
299
318
|
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
const
|
|
304
|
-
const
|
|
305
|
-
const
|
|
306
|
-
const
|
|
307
|
-
const
|
|
308
|
-
const CLOUDFLARE_MANAGED_REMOTE_TUNNELS_FILE_PATH = path.join(OPENCHAMBER_DATA_DIR, 'cloudflare-managed-remote-tunnels.json');
|
|
309
|
-
const CLOUDFLARE_LEGACY_NAMED_TUNNELS_FILE_PATH = path.join(OPENCHAMBER_DATA_DIR, 'cloudflare-named-tunnels.json');
|
|
319
|
+
const AIWORKER_DATA_DIR = AIWORKER_USER_CONFIG_ROOT;
|
|
320
|
+
const SETTINGS_FILE_PATH = path.join(AIWORKER_DATA_DIR, 'settings.json');
|
|
321
|
+
const PUSH_SUBSCRIPTIONS_FILE_PATH = path.join(AIWORKER_DATA_DIR, 'push-subscriptions.json');
|
|
322
|
+
const APNS_TOKENS_FILE_PATH = path.join(AIWORKER_DATA_DIR, 'apns-tokens.json');
|
|
323
|
+
const REMOTE_CLIENTS_FILE_PATH = path.join(AIWORKER_DATA_DIR, 'remote-clients.json');
|
|
324
|
+
const CLIENT_PAIRING_SESSIONS_FILE_PATH = path.join(AIWORKER_DATA_DIR, 'client-pairing-sessions.json');
|
|
325
|
+
const CLOUDFLARE_MANAGED_REMOTE_TUNNELS_FILE_PATH = path.join(AIWORKER_DATA_DIR, 'cloudflare-managed-remote-tunnels.json');
|
|
326
|
+
const CLOUDFLARE_LEGACY_NAMED_TUNNELS_FILE_PATH = path.join(AIWORKER_DATA_DIR, 'cloudflare-named-tunnels.json');
|
|
310
327
|
const CLOUDFLARE_MANAGED_REMOTE_TUNNELS_VERSION = 1;
|
|
311
328
|
|
|
312
329
|
const managedTunnelConfigRuntime = createManagedTunnelConfigRuntime({
|
|
@@ -337,7 +354,6 @@ const settingsHelpers = createSettingsHelpers({
|
|
|
337
354
|
normalizeManagedRemoteTunnelHostname,
|
|
338
355
|
normalizeManagedRemoteTunnelPresets,
|
|
339
356
|
normalizeManagedRemoteTunnelPresetTokens,
|
|
340
|
-
sanitizeTypographySizesPartial,
|
|
341
357
|
normalizeStringArray,
|
|
342
358
|
sanitizeModelRefs,
|
|
343
359
|
sanitizeSkillCatalogs,
|
|
@@ -476,23 +492,35 @@ const getUpstreamStallTimeoutMs = () => (
|
|
|
476
492
|
: DEFAULT_UPSTREAM_STALL_TIMEOUT_MS
|
|
477
493
|
);
|
|
478
494
|
|
|
495
|
+
const movedUserDirs = await migrateLegacyUserDirs({
|
|
496
|
+
fsPromises,
|
|
497
|
+
path,
|
|
498
|
+
dataDir: AIWORKER_USER_CONFIG_ROOT,
|
|
499
|
+
legacyRoot: AIWORKER_DEFAULT_CONFIG_ROOT,
|
|
500
|
+
warn: (message) => console.warn(`[data-dir] ${message}`),
|
|
501
|
+
});
|
|
502
|
+
if (movedUserDirs.length > 0) {
|
|
503
|
+
console.log(`[data-dir] Copied ${movedUserDirs.join(', ')} into ${AIWORKER_USER_CONFIG_ROOT}`);
|
|
504
|
+
}
|
|
505
|
+
|
|
479
506
|
const projectConfigRuntime = createProjectConfigRuntime({
|
|
480
507
|
fsPromises,
|
|
481
508
|
path,
|
|
482
|
-
projectsDirPath:
|
|
509
|
+
projectsDirPath: AIWORKER_PROJECTS_CONFIG_DIR,
|
|
483
510
|
});
|
|
484
511
|
|
|
485
512
|
const projectContextRuntime = createProjectContextRuntime({
|
|
486
513
|
fsPromises,
|
|
487
514
|
path,
|
|
488
|
-
projectsDirPath:
|
|
515
|
+
projectsDirPath: AIWORKER_PROJECTS_CONFIG_DIR,
|
|
516
|
+
resolveSharedPlansDir: (projectId) => projectConfigRuntime.resolveSharedPlansDir(projectId),
|
|
489
517
|
});
|
|
490
518
|
|
|
491
519
|
const agentMemoryRuntime = createAgentMemoryRuntime({
|
|
492
520
|
fsPromises,
|
|
493
521
|
path,
|
|
494
|
-
projectsDirPath:
|
|
495
|
-
userConfigRoot:
|
|
522
|
+
projectsDirPath: AIWORKER_PROJECTS_CONFIG_DIR,
|
|
523
|
+
userConfigRoot: AIWORKER_USER_CONFIG_ROOT,
|
|
496
524
|
});
|
|
497
525
|
|
|
498
526
|
/**
|
|
@@ -516,7 +544,7 @@ const hmrStateRuntime = createHmrStateRuntime({
|
|
|
516
544
|
globalThisLike: globalThis,
|
|
517
545
|
os,
|
|
518
546
|
processLike: process,
|
|
519
|
-
stateKey: '
|
|
547
|
+
stateKey: '__aiworkerHmrState',
|
|
520
548
|
});
|
|
521
549
|
const hmrState = hmrStateRuntime.getOrCreateHmrState();
|
|
522
550
|
hmrStateRuntime.ensureUserProvidedOpenCodePassword(hmrState);
|
|
@@ -611,13 +639,13 @@ const {
|
|
|
611
639
|
});
|
|
612
640
|
|
|
613
641
|
const ENV_SKIP_OPENCODE_START = process.env.OPENCODE_SKIP_START === 'true' ||
|
|
614
|
-
process.env.
|
|
642
|
+
process.env.AIWORKER_SKIP_OPENCODE_START === 'true';
|
|
615
643
|
const ENV_DESKTOP_NOTIFY = (() => {
|
|
616
|
-
if (process.env.
|
|
644
|
+
if (process.env.AIWORKER_DESKTOP_NOTIFY === 'true') {
|
|
617
645
|
return true;
|
|
618
646
|
}
|
|
619
647
|
|
|
620
|
-
if (process.env.
|
|
648
|
+
if (process.env.AIWORKER_RUNTIME === 'desktop') {
|
|
621
649
|
return true;
|
|
622
650
|
}
|
|
623
651
|
|
|
@@ -672,7 +700,7 @@ const scheduleOpenCodeApiDetection = (...args) => openCodeNetworkRuntime.schedul
|
|
|
672
700
|
configureOpenCodeRuntimeProviders({ buildOpenCodeUrl, getOpenCodeAuthHeaders });
|
|
673
701
|
|
|
674
702
|
const ENV_CONFIGURED_API_PREFIX = normalizeApiPrefix(
|
|
675
|
-
process.env.OPENCODE_API_PREFIX || process.env.
|
|
703
|
+
process.env.OPENCODE_API_PREFIX || process.env.AIWORKER_API_PREFIX || ''
|
|
676
704
|
);
|
|
677
705
|
|
|
678
706
|
if (ENV_CONFIGURED_API_PREFIX && ENV_CONFIGURED_API_PREFIX !== '') {
|
|
@@ -878,6 +906,25 @@ notificationTriggerRuntime.setGetIsSessionAutoAccepting(
|
|
|
878
906
|
(sessionId, directory) => permissionAutoAcceptRuntime.isSessionAutoAccepting(sessionId, directory),
|
|
879
907
|
);
|
|
880
908
|
|
|
909
|
+
// Queued follow-up messages are delivered by the server so a closed tab or a
|
|
910
|
+
// dropped connection no longer strands them (VS Code keeps its UI-side queue).
|
|
911
|
+
const messageQueueRuntime = createMessageQueueRuntime({
|
|
912
|
+
globalEventHub: globalMessageStreamHub,
|
|
913
|
+
buildOpenCodeUrl,
|
|
914
|
+
getOpenCodeAuthHeaders,
|
|
915
|
+
sessionKnowledgeRuntime,
|
|
916
|
+
// OpenCode's /global/event SSE proxy cannot carry AiWorker-owned events.
|
|
917
|
+
// Use the shared control stream for SSE clients and the existing WS fan-out.
|
|
918
|
+
broadcastGlobalUiEvent: createGlobalUiEventBroadcaster({
|
|
919
|
+
sseClients: uiAiWorkerEventClients,
|
|
920
|
+
wsClients: uiNotificationWsClients,
|
|
921
|
+
writeSseEvent,
|
|
922
|
+
}),
|
|
923
|
+
onPromptSent: (sessionId) => sessionRuntime.markUserMessageSent(sessionId),
|
|
924
|
+
dataDir: AIWORKER_DATA_DIR,
|
|
925
|
+
});
|
|
926
|
+
messageQueueRuntime.start();
|
|
927
|
+
|
|
881
928
|
const openCodeWatcherRuntime = createOpenCodeWatcherRuntime({
|
|
882
929
|
waitForOpenCodePort: (...args) => waitForOpenCodePort(...args),
|
|
883
930
|
buildOpenCodeUrl,
|
|
@@ -931,7 +978,7 @@ const processForwardedEventPayload = (payload, emitSyntheticEvent) => {
|
|
|
931
978
|
}
|
|
932
979
|
|
|
933
980
|
emitSyntheticEvent({
|
|
934
|
-
type: '
|
|
981
|
+
type: 'aiworker:session-status',
|
|
935
982
|
properties: {
|
|
936
983
|
sessionID: sessionId,
|
|
937
984
|
status,
|
|
@@ -952,7 +999,7 @@ const processForwardedEventPayload = (payload, emitSyntheticEvent) => {
|
|
|
952
999
|
});
|
|
953
1000
|
|
|
954
1001
|
emitSyntheticEvent({
|
|
955
|
-
type: '
|
|
1002
|
+
type: 'aiworker:session-activity',
|
|
956
1003
|
properties: {
|
|
957
1004
|
sessionId,
|
|
958
1005
|
phase: status === 'busy' || status === 'retry' ? 'busy' : 'idle',
|
|
@@ -1044,7 +1091,7 @@ const bootstrapRuntime = createBootstrapRuntime({
|
|
|
1044
1091
|
registerAuthAndAccessRoutes,
|
|
1045
1092
|
registerTtsRoutes,
|
|
1046
1093
|
registerNotificationRoutes,
|
|
1047
|
-
|
|
1094
|
+
registerAiWorkerRoutes,
|
|
1048
1095
|
registerAgentToolRoutes: (app, options) => options.agentToolRuntime.registerRoutes(app, options.express),
|
|
1049
1096
|
express,
|
|
1050
1097
|
});
|
|
@@ -1208,11 +1255,15 @@ const openCodeLifecycleRuntime = createOpenCodeLifecycleRuntime({
|
|
|
1208
1255
|
const managedEnv = includeControl || includeWeb || includeMemory
|
|
1209
1256
|
? await (agentToolRuntime?.prepareManagedOpenCodeEnv({ includeControl, includeWeb, includeMemory }) || {})
|
|
1210
1257
|
: {};
|
|
1211
|
-
if (settings?.optimizeSystemPrompt !== true) return managedEnv;
|
|
1212
1258
|
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1259
|
+
// Each managed plugin appends itself to the config the previous one produced.
|
|
1260
|
+
let configContent = managedEnv.OPENCODE_CONFIG_CONTENT ?? process.env.OPENCODE_CONFIG_CONTENT;
|
|
1261
|
+
if (settings?.optimizeSystemPrompt === true) {
|
|
1262
|
+
({ OPENCODE_CONFIG_CONTENT: configContent } = await systemPromptRuntime.prepareManagedOpenCodeEnv(configContent));
|
|
1263
|
+
}
|
|
1264
|
+
// Always on for managed OpenCode: it only retries servers OpenCode gave up on.
|
|
1265
|
+
const mcpReconnectEnv = await mcpReconnectRuntime.prepareManagedOpenCodeEnv(configContent);
|
|
1266
|
+
return { ...managedEnv, ...mcpReconnectEnv };
|
|
1216
1267
|
},
|
|
1217
1268
|
});
|
|
1218
1269
|
|
|
@@ -1246,10 +1297,10 @@ const scheduledTasksRuntime = createScheduledTasksRuntime({
|
|
|
1246
1297
|
sessionKnowledgeRuntime,
|
|
1247
1298
|
setSessionAutoAccept: (sessionId, enabled, directory) => permissionAutoAcceptRuntime.setSessionPolicy(sessionId, enabled, directory),
|
|
1248
1299
|
emitTaskRunEvent: (event) => {
|
|
1249
|
-
for (const client of
|
|
1300
|
+
for (const client of uiAiWorkerEventClients) {
|
|
1250
1301
|
try {
|
|
1251
1302
|
writeSseEvent(client, {
|
|
1252
|
-
type: '
|
|
1303
|
+
type: 'aiworker:scheduled-task-ran',
|
|
1253
1304
|
properties: {
|
|
1254
1305
|
projectId: event.projectID,
|
|
1255
1306
|
taskId: event.taskID,
|
|
@@ -1259,17 +1310,17 @@ const scheduledTasksRuntime = createScheduledTasksRuntime({
|
|
|
1259
1310
|
},
|
|
1260
1311
|
});
|
|
1261
1312
|
} catch {
|
|
1262
|
-
|
|
1313
|
+
uiAiWorkerEventClients.delete(client);
|
|
1263
1314
|
}
|
|
1264
1315
|
}
|
|
1265
1316
|
},
|
|
1266
1317
|
logger: console,
|
|
1267
1318
|
});
|
|
1268
1319
|
const emitSessionCreatedEvent = (event) => {
|
|
1269
|
-
for (const client of
|
|
1320
|
+
for (const client of uiAiWorkerEventClients) {
|
|
1270
1321
|
try {
|
|
1271
1322
|
writeSseEvent(client, {
|
|
1272
|
-
type: '
|
|
1323
|
+
type: 'aiworker:session-created',
|
|
1273
1324
|
properties: {
|
|
1274
1325
|
sessionId: event.sessionID,
|
|
1275
1326
|
directory: event.directory,
|
|
@@ -1281,7 +1332,7 @@ const emitSessionCreatedEvent = (event) => {
|
|
|
1281
1332
|
},
|
|
1282
1333
|
});
|
|
1283
1334
|
} catch {
|
|
1284
|
-
|
|
1335
|
+
uiAiWorkerEventClients.delete(client);
|
|
1285
1336
|
}
|
|
1286
1337
|
}
|
|
1287
1338
|
};
|
|
@@ -1295,7 +1346,7 @@ const resolveMemoryProjectId = createMemoryProjectResolver({
|
|
|
1295
1346
|
return sanitizeProjects(settings?.projects || []).map((project) => project.path);
|
|
1296
1347
|
},
|
|
1297
1348
|
resolvePrimaryWorktreeRoot,
|
|
1298
|
-
managedProjectRoots: [path.join(
|
|
1349
|
+
managedProjectRoots: [...new Set([path.join(AIWORKER_USER_CONFIG_ROOT, 'chats'), AIWORKER_CHATS_DIR])],
|
|
1299
1350
|
});
|
|
1300
1351
|
|
|
1301
1352
|
/**
|
|
@@ -1303,17 +1354,17 @@ const resolveMemoryProjectId = createMemoryProjectResolver({
|
|
|
1303
1354
|
* stored is visible without reopening anything.
|
|
1304
1355
|
*/
|
|
1305
1356
|
const emitAgentMemoryChangedEvent = (event) => {
|
|
1306
|
-
for (const client of
|
|
1357
|
+
for (const client of uiAiWorkerEventClients) {
|
|
1307
1358
|
try {
|
|
1308
1359
|
writeSseEvent(client, {
|
|
1309
|
-
type: '
|
|
1360
|
+
type: 'aiworker:agent-memory-changed',
|
|
1310
1361
|
properties: {
|
|
1311
1362
|
scope: event.scope,
|
|
1312
1363
|
...(event.projectId ? { projectId: event.projectId } : {}),
|
|
1313
1364
|
},
|
|
1314
1365
|
});
|
|
1315
1366
|
} catch {
|
|
1316
|
-
|
|
1367
|
+
uiAiWorkerEventClients.delete(client);
|
|
1317
1368
|
}
|
|
1318
1369
|
}
|
|
1319
1370
|
};
|
|
@@ -1323,7 +1374,7 @@ const scheduledTaskService = createScheduledTaskService({
|
|
|
1323
1374
|
projectConfigRuntime,
|
|
1324
1375
|
scheduledTasksRuntime,
|
|
1325
1376
|
});
|
|
1326
|
-
const openChamberSessionService =
|
|
1377
|
+
const openChamberSessionService = createAiWorkerSessionService({
|
|
1327
1378
|
readSettingsFromDiskMigrated,
|
|
1328
1379
|
sanitizeProjects,
|
|
1329
1380
|
validateDirectoryPath,
|
|
@@ -1333,7 +1384,7 @@ const openChamberSessionService = createOpenChamberSessionService({
|
|
|
1333
1384
|
emitSessionCreatedEvent,
|
|
1334
1385
|
sessionKnowledgeRuntime,
|
|
1335
1386
|
});
|
|
1336
|
-
// Browser actions are published to whichever
|
|
1387
|
+
// Browser actions are published to whichever AiWorker clients are connected;
|
|
1337
1388
|
// the one owning the browser panel answers. `emitRequest` returns the number of
|
|
1338
1389
|
// clients reached so the broker can fail fast when nobody is listening.
|
|
1339
1390
|
const browserControlBroker = createBrowserControlBroker({
|
|
@@ -1344,11 +1395,11 @@ const browserControlBroker = createBrowserControlBroker({
|
|
|
1344
1395
|
// lets the broker say "not here" instead of timing out.
|
|
1345
1396
|
const needsBrowserView = request.action !== 'browser.open';
|
|
1346
1397
|
let delivered = 0;
|
|
1347
|
-
for (const client of
|
|
1348
|
-
if (needsBrowserView && client.
|
|
1398
|
+
for (const client of uiAiWorkerEventClients) {
|
|
1399
|
+
if (needsBrowserView && client.aiworkerBrowserCapable !== true) continue;
|
|
1349
1400
|
try {
|
|
1350
1401
|
writeSseEvent(client, {
|
|
1351
|
-
type: '
|
|
1402
|
+
type: 'aiworker:browser-control-request',
|
|
1352
1403
|
properties: {
|
|
1353
1404
|
requestId: request.requestId,
|
|
1354
1405
|
action: request.action,
|
|
@@ -1357,14 +1408,14 @@ const browserControlBroker = createBrowserControlBroker({
|
|
|
1357
1408
|
});
|
|
1358
1409
|
delivered += 1;
|
|
1359
1410
|
} catch {
|
|
1360
|
-
|
|
1411
|
+
uiAiWorkerEventClients.delete(client);
|
|
1361
1412
|
}
|
|
1362
1413
|
}
|
|
1363
1414
|
return delivered;
|
|
1364
1415
|
},
|
|
1365
1416
|
});
|
|
1366
1417
|
|
|
1367
|
-
const openChamberControlService =
|
|
1418
|
+
const openChamberControlService = createAiWorkerControlService({
|
|
1368
1419
|
readSettingsFromDiskMigrated,
|
|
1369
1420
|
sanitizeProjects,
|
|
1370
1421
|
buildOpenCodeUrl,
|
|
@@ -1375,7 +1426,7 @@ const openChamberControlService = createOpenChamberControlService({
|
|
|
1375
1426
|
browserControl: browserControlBroker,
|
|
1376
1427
|
agentMemoryActions: createAgentMemoryActions({
|
|
1377
1428
|
agentMemoryRuntime,
|
|
1378
|
-
createError: (message, status) => new
|
|
1429
|
+
createError: (message, status) => new AiWorkerControlError(message, status),
|
|
1379
1430
|
onMemoryChanged: emitAgentMemoryChangedEvent,
|
|
1380
1431
|
isAgentMemoryEnabled,
|
|
1381
1432
|
resolveProjectId: resolveMemoryProjectId,
|
|
@@ -1427,6 +1478,7 @@ const gracefulShutdownRuntime = createGracefulShutdownRuntime({
|
|
|
1427
1478
|
sessionAssistRuntime,
|
|
1428
1479
|
sessionGoalRuntime,
|
|
1429
1480
|
contextObligatoryRuntime,
|
|
1481
|
+
messageQueueRuntime,
|
|
1430
1482
|
sessionRuntime,
|
|
1431
1483
|
getHealthCheckInterval: () => healthCheckInterval,
|
|
1432
1484
|
clearHealthCheckInterval: (value) => clearInterval(value),
|
|
@@ -1465,14 +1517,14 @@ async function main(options = {}) {
|
|
|
1465
1517
|
const port = Number.isFinite(options.port) && options.port >= 0 ? Math.trunc(options.port) : DEFAULT_PORT;
|
|
1466
1518
|
const host = typeof options.host === 'string' && options.host.length > 0 ? options.host : undefined;
|
|
1467
1519
|
const effectiveBindHost = host
|
|
1468
|
-
|| (typeof process.env.
|
|
1469
|
-
? process.env.
|
|
1520
|
+
|| (typeof process.env.AIWORKER_HOST === 'string' && process.env.AIWORKER_HOST.trim().length > 0
|
|
1521
|
+
? process.env.AIWORKER_HOST.trim()
|
|
1470
1522
|
: '127.0.0.1');
|
|
1471
1523
|
agentToolRuntime = createAgentToolRuntime({
|
|
1472
1524
|
crypto,
|
|
1473
1525
|
fsPromises,
|
|
1474
1526
|
path,
|
|
1475
|
-
dataDir:
|
|
1527
|
+
dataDir: AIWORKER_DATA_DIR,
|
|
1476
1528
|
env: process.env,
|
|
1477
1529
|
executeAction: (...args) => openChamberControlService.execute(...args),
|
|
1478
1530
|
getActivePort: () => {
|
|
@@ -1483,7 +1535,12 @@ async function main(options = {}) {
|
|
|
1483
1535
|
systemPromptRuntime = createSystemPromptRuntime({
|
|
1484
1536
|
fsPromises,
|
|
1485
1537
|
path,
|
|
1486
|
-
dataDir:
|
|
1538
|
+
dataDir: AIWORKER_DATA_DIR,
|
|
1539
|
+
});
|
|
1540
|
+
mcpReconnectRuntime = createMcpReconnectRuntime({
|
|
1541
|
+
fsPromises,
|
|
1542
|
+
path,
|
|
1543
|
+
dataDir: AIWORKER_DATA_DIR,
|
|
1487
1544
|
});
|
|
1488
1545
|
|
|
1489
1546
|
// Pairing transports advertised to the create-device dialog. LAN reachability is
|
|
@@ -1564,7 +1621,7 @@ async function main(options = {}) {
|
|
|
1564
1621
|
};
|
|
1565
1622
|
const uiPassword = typeof options.uiPassword === 'string'
|
|
1566
1623
|
? options.uiPassword
|
|
1567
|
-
: (typeof process.env.
|
|
1624
|
+
: (typeof process.env.AIWORKER_UI_PASSWORD === 'string' ? process.env.AIWORKER_UI_PASSWORD : null);
|
|
1568
1625
|
if (
|
|
1569
1626
|
isNetworkExposedBindHost(effectiveBindHost)
|
|
1570
1627
|
&& !(typeof uiPassword === 'string' && uiPassword.trim().length > 0)
|
|
@@ -1573,7 +1630,7 @@ async function main(options = {}) {
|
|
|
1573
1630
|
throw new Error(getUnauthenticatedLanErrorMessage(effectiveBindHost));
|
|
1574
1631
|
}
|
|
1575
1632
|
const tryCfTunnel = options.tryCfTunnel === true;
|
|
1576
|
-
const apiOnly = options.apiOnly === true || isEnvFlagEnabled(process.env.
|
|
1633
|
+
const apiOnly = options.apiOnly === true || isEnvFlagEnabled(process.env.AIWORKER_API_ONLY);
|
|
1577
1634
|
const shouldUseCanonicalTunnelConfig = typeof options.tunnelMode === 'string'
|
|
1578
1635
|
|| typeof options.tunnelProvider === 'string'
|
|
1579
1636
|
|| options.tunnelConfigPath === null
|
|
@@ -1611,8 +1668,14 @@ async function main(options = {}) {
|
|
|
1611
1668
|
const getDesktopRuntimeConfig = typeof options.getDesktopRuntimeConfig === 'function'
|
|
1612
1669
|
? options.getDesktopRuntimeConfig
|
|
1613
1670
|
: null;
|
|
1671
|
+
const desktopUpdater = options.desktopUpdater
|
|
1672
|
+
&& typeof options.desktopUpdater.check === 'function'
|
|
1673
|
+
&& typeof options.desktopUpdater.install === 'function'
|
|
1674
|
+
&& typeof options.desktopUpdater.restart === 'function'
|
|
1675
|
+
? options.desktopUpdater
|
|
1676
|
+
: null;
|
|
1614
1677
|
|
|
1615
|
-
console.log(`Starting
|
|
1678
|
+
console.log(`Starting AiWorker on port ${port === 0 ? 'auto' : port}`);
|
|
1616
1679
|
|
|
1617
1680
|
// Voice enumeration is independent from route registration. Start it now,
|
|
1618
1681
|
// but do not hold server listen or managed OpenCode startup on `say -v "?"`.
|
|
@@ -1645,7 +1708,10 @@ async function main(options = {}) {
|
|
|
1645
1708
|
res.setHeader('Access-Control-Allow-Origin', origin);
|
|
1646
1709
|
res.setHeader('Access-Control-Allow-Credentials', 'true');
|
|
1647
1710
|
res.setHeader('Access-Control-Allow-Methods', 'GET,POST,PUT,PATCH,DELETE,OPTIONS');
|
|
1648
|
-
|
|
1711
|
+
// The packaged desktop UI (openchamber-ui://) and the dev UI sit on a
|
|
1712
|
+
// different origin, so every custom request header must be listed here or
|
|
1713
|
+
// the browser refuses the request at preflight, before it reaches a route.
|
|
1714
|
+
res.setHeader('Access-Control-Allow-Headers', 'Content-Type,Authorization,Accept,X-Requested-With,Cache-Control,X-OpenCode-Directory,X-OpenCode-Directory-Encoding,Ngrok-Skip-Browser-Warning,X-AiWorker-Surface');
|
|
1649
1715
|
res.setHeader('Access-Control-Expose-Headers', 'x-next-cursor');
|
|
1650
1716
|
res.setHeader('Vary', 'Origin');
|
|
1651
1717
|
if (req.method === 'OPTIONS') {
|
|
@@ -1677,8 +1743,8 @@ async function main(options = {}) {
|
|
|
1677
1743
|
|
|
1678
1744
|
const bootstrapResult = bootstrapRuntime.setupBaseRoutes(app, {
|
|
1679
1745
|
process,
|
|
1680
|
-
|
|
1681
|
-
runtimeName: process.env.
|
|
1746
|
+
aiworkerVersion: AIWORKER_VERSION,
|
|
1747
|
+
runtimeName: process.env.AIWORKER_RUNTIME || 'web',
|
|
1682
1748
|
serverStartedAt,
|
|
1683
1749
|
gracefulShutdown,
|
|
1684
1750
|
getHealthSnapshot: () => {
|
|
@@ -1723,7 +1789,7 @@ async function main(options = {}) {
|
|
|
1723
1789
|
return Number.isFinite(port) && port > 0 ? port : null;
|
|
1724
1790
|
},
|
|
1725
1791
|
getTunnelUrl: () => tunnelRuntimeContextHolder?.tunnelService?.getPublicUrl?.() ?? null,
|
|
1726
|
-
verboseRequestLogs:
|
|
1792
|
+
verboseRequestLogs: AIWORKER_VERBOSE_REQUEST_LOGS,
|
|
1727
1793
|
uiPassword,
|
|
1728
1794
|
tunnelAuthController,
|
|
1729
1795
|
remoteClientAuthRuntime,
|
|
@@ -1750,9 +1816,9 @@ async function main(options = {}) {
|
|
|
1750
1816
|
getServerLabel: () => {
|
|
1751
1817
|
try {
|
|
1752
1818
|
const name = os.hostname();
|
|
1753
|
-
return typeof name === 'string' && name.trim().length > 0 ? name.trim() : '
|
|
1819
|
+
return typeof name === 'string' && name.trim().length > 0 ? name.trim() : 'AiWorker';
|
|
1754
1820
|
} catch {
|
|
1755
|
-
return '
|
|
1821
|
+
return 'AiWorker';
|
|
1756
1822
|
}
|
|
1757
1823
|
},
|
|
1758
1824
|
readSettingsFromDiskMigrated,
|
|
@@ -1779,13 +1845,14 @@ async function main(options = {}) {
|
|
|
1779
1845
|
path,
|
|
1780
1846
|
server,
|
|
1781
1847
|
__dirname,
|
|
1782
|
-
|
|
1848
|
+
aiworkerDataDir: AIWORKER_DATA_DIR,
|
|
1783
1849
|
modelsDevApiUrl: MODELS_DEV_API_URL,
|
|
1784
1850
|
modelsMetadataCacheTtl: MODELS_METADATA_CACHE_TTL,
|
|
1785
1851
|
fetchFreeZenModels,
|
|
1786
1852
|
getCachedZenModels,
|
|
1787
1853
|
setAutoAcceptSession,
|
|
1788
1854
|
agentToolRuntime,
|
|
1855
|
+
desktopUpdater,
|
|
1789
1856
|
});
|
|
1790
1857
|
uiAuthController = bootstrapResult.uiAuthController;
|
|
1791
1858
|
realtimeProxyRuntime = attachRealtimeProxy({
|
|
@@ -1815,18 +1882,18 @@ async function main(options = {}) {
|
|
|
1815
1882
|
// the relay identity (serverId), so concurrent hosts evict each other at
|
|
1816
1883
|
// the relay worker and devices land on a random local instance.
|
|
1817
1884
|
hostLock: createRelayHostLock({
|
|
1818
|
-
lockFilePath: path.join(
|
|
1885
|
+
lockFilePath: path.join(AIWORKER_DATA_DIR, 'relay-host.lock'),
|
|
1819
1886
|
fs,
|
|
1820
1887
|
process,
|
|
1821
1888
|
}),
|
|
1822
1889
|
// Dev/debug instances share the data dir (and thus the relay identity) with
|
|
1823
1890
|
// the production instance, so they must not host the relay on their own —
|
|
1824
|
-
// paired devices would land on them.
|
|
1891
|
+
// paired devices would land on them. AIWORKER_RELAY_HOST=off disables
|
|
1825
1892
|
// passive hosting explicitly (dev scripts set it); the Electron dev shell is
|
|
1826
|
-
// covered via
|
|
1893
|
+
// covered via AIWORKER_ELECTRON_DEV. AIWORKER_RELAY_HOST=on overrides
|
|
1827
1894
|
// both. Explicit enable/pairing on the instance still hosts regardless.
|
|
1828
|
-
allowPassiveHost: process.env.
|
|
1829
|
-
|| (process.env.
|
|
1895
|
+
allowPassiveHost: process.env.AIWORKER_RELAY_HOST === 'on'
|
|
1896
|
+
|| (process.env.AIWORKER_RELAY_HOST !== 'off' && process.env.AIWORKER_ELECTRON_DEV !== '1'),
|
|
1830
1897
|
// Relay demand = any paired device or pending pairing session that uses the
|
|
1831
1898
|
// relay transport. Drives the auto on/off lifecycle.
|
|
1832
1899
|
hasRelayDemand: async () => {
|
|
@@ -1875,8 +1942,9 @@ async function main(options = {}) {
|
|
|
1875
1942
|
spawn,
|
|
1876
1943
|
resolveGitBinaryForSpawn,
|
|
1877
1944
|
createFsSearchRuntime: createFsSearchRuntimeFactory,
|
|
1878
|
-
|
|
1879
|
-
|
|
1945
|
+
aiworkerDataDir: AIWORKER_DATA_DIR,
|
|
1946
|
+
aiworkerUserConfigRoot: AIWORKER_USER_CONFIG_ROOT,
|
|
1947
|
+
managedChatsRoot: AIWORKER_CHATS_DIR,
|
|
1880
1948
|
normalizeDirectoryPath,
|
|
1881
1949
|
resolveProjectDirectory,
|
|
1882
1950
|
resolveOptionalProjectDirectory,
|
|
@@ -1895,7 +1963,7 @@ async function main(options = {}) {
|
|
|
1895
1963
|
buildOpenCodeUrl,
|
|
1896
1964
|
getOpenCodeAuthHeaders,
|
|
1897
1965
|
getOpenCodePort: () => openCodePort,
|
|
1898
|
-
// Dev-server discovery must not offer
|
|
1966
|
+
// Dev-server discovery must not offer AiWorker's own listeners back to
|
|
1899
1967
|
// the user as something to preview.
|
|
1900
1968
|
getOwnPorts: () => [port, openCodePort].filter((value) => Number.isInteger(value) && value > 0),
|
|
1901
1969
|
devServerScanner,
|
|
@@ -1911,9 +1979,10 @@ async function main(options = {}) {
|
|
|
1911
1979
|
openChamberControlService,
|
|
1912
1980
|
waitForOpenCodeReady,
|
|
1913
1981
|
emitSessionCreatedEvent,
|
|
1914
|
-
|
|
1982
|
+
getAiWorkerEventClients: () => uiAiWorkerEventClients,
|
|
1915
1983
|
writeSseEvent,
|
|
1916
1984
|
permissionAutoAcceptRuntime,
|
|
1985
|
+
messageQueueRuntime,
|
|
1917
1986
|
});
|
|
1918
1987
|
|
|
1919
1988
|
const startupPipelineResult = await startupPipelineRuntime.run({
|
|
@@ -1964,7 +2033,7 @@ async function main(options = {}) {
|
|
|
1964
2033
|
tunnelRuntimeContext,
|
|
1965
2034
|
attachSignals,
|
|
1966
2035
|
apiOnly,
|
|
1967
|
-
dictationModelsDir: path.join(
|
|
2036
|
+
dictationModelsDir: path.join(AIWORKER_USER_CONFIG_ROOT, 'speech-models'),
|
|
1968
2037
|
});
|
|
1969
2038
|
terminalRuntime = startupPipelineResult.terminalRuntime;
|
|
1970
2039
|
dictationRuntime = startupPipelineResult.dictationRuntime;
|
|
@@ -1981,7 +2050,7 @@ async function main(options = {}) {
|
|
|
1981
2050
|
// device/session exists, stop it (and clear a stale enabled flag) otherwise.
|
|
1982
2051
|
void relayService.reconcile();
|
|
1983
2052
|
|
|
1984
|
-
// Relay demand can change outside our routes: `
|
|
2053
|
+
// Relay demand can change outside our routes: `aiworker connect-url
|
|
1985
2054
|
// --relay` writes a pending relay session straight to the on-disk store, and
|
|
1986
2055
|
// pending sessions expire without any request hitting us. Poll reconcile so a
|
|
1987
2056
|
// headless instance picks the relay up (or drops it) within a minute.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Dispatch for the `memory.*` actions the `
|
|
2
|
+
* Dispatch for the `memory.*` actions the `aiworker_memory` tool calls.
|
|
3
3
|
*
|
|
4
4
|
* Kept beside the store rather than inside the control service, because the
|
|
5
5
|
* control service already owns sessions, schedules and the browser; memory
|
|
@@ -226,7 +226,7 @@ export const createAgentMemoryActions = (dependencies) => {
|
|
|
226
226
|
enabled = false;
|
|
227
227
|
}
|
|
228
228
|
if (!enabled) {
|
|
229
|
-
return fail('Agent memory is switched off in
|
|
229
|
+
return fail('Agent memory is switched off in AiWorker settings', 403);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
|