@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
|
@@ -7,7 +7,7 @@ import { fetchSystemInfoFromPort } from './cli-http.js';
|
|
|
7
7
|
import { isPortAvailable, resolveAvailablePort } from './cli-ports.js';
|
|
8
8
|
import { ensureLogsDir, getLogFilePath } from './cli-paths.js';
|
|
9
9
|
import { rotateLogFile } from './cli-log-files.js';
|
|
10
|
-
import {
|
|
10
|
+
import { discoverAiWorkerInstanceOnPort, isDesktopRuntimeForPort } from './cli-lifecycle.js';
|
|
11
11
|
import { getPidFilePath, getInstanceFilePath, writePidFile, writeInstanceOptions, removePidFile, removeInstanceFile, isProcessRunning, terminateProcessTree } from './cli-process.js';
|
|
12
12
|
import { isNetworkExposedBindHost } from '../../server/lib/security/bind-host.js';
|
|
13
13
|
import {
|
|
@@ -67,34 +67,34 @@ async function serveCommand(options) {
|
|
|
67
67
|
const targetPort = await resolveAvailablePort(options.port, explicitPort, emitNotice);
|
|
68
68
|
|
|
69
69
|
if (targetPort !== 0 && !options.suppressUnsafePortWarning) {
|
|
70
|
-
assertSafeBrowserPort(targetPort, { context: '
|
|
70
|
+
assertSafeBrowserPort(targetPort, { context: 'AiWorker serve' });
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
if (targetPort !== 0) {
|
|
74
|
-
const existingInstance = await
|
|
74
|
+
const existingInstance = await discoverAiWorkerInstanceOnPort(targetPort, { host: effectiveHost });
|
|
75
75
|
if (existingInstance?.runtime === 'desktop') {
|
|
76
76
|
throw new Error(
|
|
77
|
-
`Port ${targetPort} is used by
|
|
77
|
+
`Port ${targetPort} is used by AiWorker Desktop app. Choose another port or stop the desktop app.`
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
80
|
if (existingInstance) {
|
|
81
81
|
const pidSuffix = Number.isFinite(existingInstance.pid) ? ` (PID: ${existingInstance.pid})` : '';
|
|
82
82
|
if (existingInstance.source === 'probe') {
|
|
83
|
-
throw new Error(`
|
|
83
|
+
throw new Error(`AiWorker is already running on port ${targetPort}. Use \`aiworker status\` or \`aiworker stop --port ${targetPort}\`.`);
|
|
84
84
|
}
|
|
85
|
-
throw new Error(`
|
|
85
|
+
throw new Error(`AiWorker is already running on port ${targetPort}${pidSuffix}`);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
if (explicitPort && !(await isPortAvailable(targetPort, effectiveHost))) {
|
|
89
89
|
const systemInfo = await fetchSystemInfoFromPort(targetPort, globalThis.fetch, effectiveHost);
|
|
90
90
|
if (isDesktopRuntimeForPort(systemInfo, targetPort)) {
|
|
91
91
|
throw new Error(
|
|
92
|
-
`Port ${targetPort} is used by
|
|
92
|
+
`Port ${targetPort} is used by AiWorker Desktop app. Choose another port or stop the desktop app.`
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
const systemInfoRuntimeMatchesPort = systemInfo?.runtime !== 'desktop' || isDesktopRuntimeForPort(systemInfo, targetPort);
|
|
96
96
|
if (systemInfo?.runtime && systemInfoRuntimeMatchesPort) {
|
|
97
|
-
throw new Error(`
|
|
97
|
+
throw new Error(`AiWorker is already running on port ${targetPort}. Use \`aiworker status\` or \`aiworker stop --port ${targetPort}\`.`);
|
|
98
98
|
}
|
|
99
99
|
throw new Error(`Port ${targetPort} is already in use by another process.`);
|
|
100
100
|
}
|
|
@@ -124,11 +124,11 @@ async function serveCommand(options) {
|
|
|
124
124
|
if (!effectiveUiPassword && !options.suppressUiPasswordWarning) {
|
|
125
125
|
const bindHost = effectiveHost;
|
|
126
126
|
const networkExposed = isNetworkExposedBindHost(bindHost);
|
|
127
|
-
const warningLine = '
|
|
127
|
+
const warningLine = 'AIWORKER_UI_PASSWORD is not set';
|
|
128
128
|
const warningDetail = networkExposed
|
|
129
129
|
? `server is bound to ${bindHost} and reachable on your network with no UI auth. `
|
|
130
|
-
+ 'Set --ui-password or
|
|
131
|
-
: 'browser UI is unsecured. Use --ui-password or
|
|
130
|
+
+ 'Set --ui-password or AIWORKER_UI_PASSWORD before exposing it over LAN.'
|
|
131
|
+
: 'browser UI is unsecured. Use --ui-password or AIWORKER_UI_PASSWORD.';
|
|
132
132
|
if (showOutput) {
|
|
133
133
|
logStatus('warning', warningLine, warningDetail);
|
|
134
134
|
} else if (isJsonMode(options)) {
|
|
@@ -159,10 +159,10 @@ async function serveCommand(options) {
|
|
|
159
159
|
process.env.OPENCODE_BINARY = opencodeBinary;
|
|
160
160
|
}
|
|
161
161
|
if (effectiveUiPassword) {
|
|
162
|
-
process.env.
|
|
162
|
+
process.env.AIWORKER_UI_PASSWORD = effectiveUiPassword;
|
|
163
163
|
}
|
|
164
|
-
process.env.
|
|
165
|
-
process.env.
|
|
164
|
+
process.env.AIWORKER_HOST = effectiveHost;
|
|
165
|
+
process.env.AIWORKER_RUNTIME = 'web';
|
|
166
166
|
|
|
167
167
|
// In --quiet mode, redirect stdout/stderr to the log file so that
|
|
168
168
|
// server runtime output (console.log calls) does not pollute the
|
|
@@ -190,7 +190,7 @@ async function serveCommand(options) {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
if (!isQuietMode(options)) {
|
|
193
|
-
console.log(`Starting
|
|
193
|
+
console.log(`Starting AiWorker on port ${targetPort === 0 ? 'auto' : targetPort} (foreground)`);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
const { startWebUiServer } = await import(pathToFileURL(serverPath).href);
|
|
@@ -282,18 +282,18 @@ async function serveCommand(options) {
|
|
|
282
282
|
stdio: ['ignore', logFd, logFd, 'ipc'],
|
|
283
283
|
env: {
|
|
284
284
|
...process.env,
|
|
285
|
-
|
|
286
|
-
|
|
285
|
+
AIWORKER_PORT: String(targetPort),
|
|
286
|
+
AIWORKER_RUNTIME: 'web',
|
|
287
287
|
OPENCODE_BINARY: opencodeBinary,
|
|
288
|
-
|
|
289
|
-
...(effectiveUiPassword ? {
|
|
290
|
-
...(options.apiOnly === true ? {
|
|
291
|
-
...(process.env.OPENCODE_SKIP_START ? {
|
|
288
|
+
AIWORKER_HOST: effectiveHost,
|
|
289
|
+
...(effectiveUiPassword ? { AIWORKER_UI_PASSWORD: effectiveUiPassword } : {}),
|
|
290
|
+
...(options.apiOnly === true ? { AIWORKER_API_ONLY: 'true' } : {}),
|
|
291
|
+
...(process.env.OPENCODE_SKIP_START ? { AIWORKER_SKIP_OPENCODE_START: process.env.OPENCODE_SKIP_START } : {}),
|
|
292
292
|
},
|
|
293
293
|
});
|
|
294
294
|
|
|
295
295
|
child.unref();
|
|
296
|
-
serveSpin?.start(`Starting
|
|
296
|
+
serveSpin?.start(`Starting AiWorker on port ${targetPort === 0 ? 'auto' : targetPort}...`);
|
|
297
297
|
|
|
298
298
|
let resolvedPort;
|
|
299
299
|
try {
|
|
@@ -302,12 +302,12 @@ async function serveCommand(options) {
|
|
|
302
302
|
const timeout = setTimeout(() => {
|
|
303
303
|
if (settled) return;
|
|
304
304
|
settled = true;
|
|
305
|
-
reject(new Error(`
|
|
305
|
+
reject(new Error(`AiWorker daemon did not report ready within ${DAEMON_READY_TIMEOUT_MS / 1000}s`));
|
|
306
306
|
}, DAEMON_READY_TIMEOUT_MS);
|
|
307
307
|
|
|
308
308
|
child.on('message', (msg) => {
|
|
309
309
|
if (settled) return;
|
|
310
|
-
if (msg && msg.type === '
|
|
310
|
+
if (msg && msg.type === 'aiworker:ready' && typeof msg.port === 'number') {
|
|
311
311
|
settled = true;
|
|
312
312
|
clearTimeout(timeout);
|
|
313
313
|
resolve(msg.port);
|
|
@@ -325,7 +325,7 @@ async function serveCommand(options) {
|
|
|
325
325
|
if (settled) return;
|
|
326
326
|
settled = true;
|
|
327
327
|
clearTimeout(timeout);
|
|
328
|
-
reject(new Error(`
|
|
328
|
+
reject(new Error(`AiWorker daemon exited before reporting ready${signal ? ` (${signal})` : ` (code ${code ?? 'unknown'})`}`));
|
|
329
329
|
});
|
|
330
330
|
});
|
|
331
331
|
} catch (error) {
|
|
@@ -354,7 +354,7 @@ async function serveCommand(options) {
|
|
|
354
354
|
}
|
|
355
355
|
|
|
356
356
|
if (!isProcessRunning(child.pid)) {
|
|
357
|
-
serveSpin?.error('Failed to start
|
|
357
|
+
serveSpin?.error('Failed to start AiWorker');
|
|
358
358
|
throw new Error('Failed to start server in daemon mode');
|
|
359
359
|
}
|
|
360
360
|
|
|
@@ -373,7 +373,7 @@ async function serveCommand(options) {
|
|
|
373
373
|
port: resolvedPort,
|
|
374
374
|
pid: child.pid,
|
|
375
375
|
url: buildLocalUrl(resolvedPort, '/'),
|
|
376
|
-
logs: `
|
|
376
|
+
logs: `aiworker logs -p ${resolvedPort}`,
|
|
377
377
|
launchMode: 'daemon',
|
|
378
378
|
};
|
|
379
379
|
|
|
@@ -391,7 +391,7 @@ async function serveCommand(options) {
|
|
|
391
391
|
return resolvedPort;
|
|
392
392
|
}
|
|
393
393
|
// A generated password is essential result data for scripts: include it
|
|
394
|
-
// in the same compact `pass:` token form `
|
|
394
|
+
// in the same compact `pass:` token form `aiworker status --quiet`
|
|
395
395
|
// already emits. Configured passwords are never echoed.
|
|
396
396
|
process.stdout.write(
|
|
397
397
|
autoGeneratedUiPassword
|
|
@@ -404,7 +404,7 @@ async function serveCommand(options) {
|
|
|
404
404
|
serveSpin?.clear();
|
|
405
405
|
|
|
406
406
|
if (!options.suppressStartupSummary && showOutput) {
|
|
407
|
-
clackIntro('
|
|
407
|
+
clackIntro('AiWorker Started');
|
|
408
408
|
logStatus('success', `port ${serveResult.port} (PID: ${serveResult.pid})`);
|
|
409
409
|
if (autoGeneratedUiPassword) {
|
|
410
410
|
logStatus('success', 'UI password', effectiveUiPassword);
|
|
@@ -158,7 +158,7 @@ const validateActionWaitOptions = (options, action) => {
|
|
|
158
158
|
|
|
159
159
|
async function sessionCommand(options = {}, action = 'help') {
|
|
160
160
|
if (action === 'help') {
|
|
161
|
-
process.stdout.write(`
|
|
161
|
+
process.stdout.write(`AiWorker Session Commands\n\nUSAGE:\n aiworker session list [--dir <path>] [--limit <count>] [--with-status] [OPTIONS]\n aiworker session create --dir <path> [--title <title>] [--wait] [OPTIONS]\n aiworker session create --project <projectId> [--title <title>] [--wait] [OPTIONS]\n aiworker session send --session <id> --dir <path> --prompt <text> [--wait] [OPTIONS]\n aiworker session fork --session <id> --dir <path> --prompt <text> [--message <id>] [--wait] [OPTIONS]\n aiworker session status --session <id> --dir <path> [OPTIONS]\n aiworker session messages --session <id> --dir <path> [--wait] [OPTIONS]\n\nLIST OPTIONS:\n --dir <path> Filter sessions by directory\n --limit <count> Maximum sessions to show (default: 10)\n --all Include archived sessions\n --with-status Include authoritative idle/busy/retry status\n\nACTION OPTIONS:\n --session <id> Source or target session id\n --dir <path> Authoritative session directory\n --prompt <text> Prompt to send to the session\n --message <id> Fork from this message (fork only; default: latest)\n --model <provider/model> Model for the prompt (defaults to configured selection)\n --agent <id> Agent for the prompt (defaults to configured selection)\n --variant <id> Model variant for the prompt\n --goal Run the prompt as a new goal\n --goal-token-budget <n> Goal token budget (1000-100000000; requires --goal)\n --wait Wait for the dispatched activity to become idle\n --last-assistant Include the last assistant text after waiting\n --timeout <seconds> Wait timeout in seconds (default: 600, max: 86400)\n\nCREATE OPTIONS:\n --worktree <name> Create a git worktree before creating the session\n --branch <name> Branch name for --worktree\n --start-ref, --base <ref> Start ref for --worktree\n --upstream Set upstream for the worktree branch\n --no-upstream Do not set upstream for the worktree branch\n --name <title> Alias for --title\n\nSTATUS/MESSAGES OPTIONS:\n --last Return only the latest text-bearing message\n --last-assistant Shorthand for --last --role assistant\n --limit <count> Maximum text messages to return (default: 10)\n --all Return all text-bearing messages\n --role <role> Filter messages: all, user, assistant\n\nOUTPUT OPTIONS:\n -p, --port <port> AiWorker server port\n --json Output machine-readable JSON\n -q, --quiet Print compact output\n`);
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
164
|
|
|
@@ -9,25 +9,28 @@ import {
|
|
|
9
9
|
logStatus,
|
|
10
10
|
} from '../cli-output.js';
|
|
11
11
|
|
|
12
|
-
async function startupCommand(options, action = 'status') {
|
|
12
|
+
async function startupCommand(options, action = 'status', dependencies = {}) {
|
|
13
|
+
const getStatus = dependencies.getStartupStatus || getStartupStatus;
|
|
14
|
+
const enableService = dependencies.enableStartupService || enableStartupService;
|
|
15
|
+
const disableService = dependencies.disableStartupService || disableStartupService;
|
|
13
16
|
const normalized = typeof action === 'string' ? action.trim().toLowerCase() : 'status';
|
|
14
17
|
if (!['status', 'enable', 'disable'].includes(normalized)) {
|
|
15
18
|
throw new TunnelCliError(
|
|
16
|
-
`Unknown startup subcommand '${action}'. Use '
|
|
19
|
+
`Unknown startup subcommand '${action}'. Use 'aiworker startup --help'.`,
|
|
17
20
|
EXIT_CODE.USAGE_ERROR
|
|
18
21
|
);
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
let status;
|
|
22
25
|
if (normalized === 'enable') {
|
|
23
|
-
status =
|
|
26
|
+
status = enableService(options);
|
|
24
27
|
} else if (normalized === 'disable') {
|
|
25
|
-
status =
|
|
28
|
+
status = disableService();
|
|
26
29
|
} else {
|
|
27
|
-
status =
|
|
30
|
+
status = getStatus();
|
|
28
31
|
}
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
let result = { action: normalized, ...status };
|
|
31
34
|
if (!result.supported) {
|
|
32
35
|
throw new TunnelCliError(
|
|
33
36
|
`Startup integration is not supported on ${result.platform}.`,
|
|
@@ -36,27 +39,59 @@ async function startupCommand(options, action = 'status') {
|
|
|
36
39
|
}
|
|
37
40
|
if (normalized === 'enable' && result.activeState === 'failed') {
|
|
38
41
|
throw new TunnelCliError(
|
|
39
|
-
'Startup service was installed but failed to start. Run `journalctl --user -u
|
|
42
|
+
'Startup service was installed but failed to start. Run `journalctl --user -u aiworker.service -n 80 --no-pager` for details.',
|
|
40
43
|
EXIT_CODE.GENERAL_ERROR
|
|
41
44
|
);
|
|
42
45
|
}
|
|
46
|
+
if (result.platform === 'linux' && result.enabled && result.lingerEnabled !== true) {
|
|
47
|
+
const user = result.lingerUser || '"$USER"';
|
|
48
|
+
const disabled = result.lingerEnabled === false;
|
|
49
|
+
result = {
|
|
50
|
+
...result,
|
|
51
|
+
messages: [{
|
|
52
|
+
level: 'warning',
|
|
53
|
+
code: disabled ? 'LINGER_DISABLED' : 'LINGER_UNKNOWN',
|
|
54
|
+
message: disabled
|
|
55
|
+
? `User lingering is disabled; the startup service may stop after logout. Run \`sudo loginctl enable-linger ${user}\` to keep it running.`
|
|
56
|
+
: `Could not verify user lingering; the startup service may stop after logout. Check with \`loginctl show-user ${user} -p Linger\`.`,
|
|
57
|
+
}],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
43
60
|
if (isJsonMode(options)) {
|
|
44
61
|
printJson(result);
|
|
45
62
|
return;
|
|
46
63
|
}
|
|
47
64
|
|
|
48
65
|
if (isQuietMode(options)) {
|
|
49
|
-
|
|
66
|
+
const lingerToken = result.platform === 'linux'
|
|
67
|
+
? ` linger:${result.lingerEnabled === true ? 'yes' : result.lingerEnabled === false ? 'no' : 'unknown'}`
|
|
68
|
+
: '';
|
|
69
|
+
process.stdout.write(`startup ${result.enabled ? 'enabled' : 'disabled'} platform:${result.platform} supported:${result.supported ? 'yes' : 'no'}${result.servicePath ? ` path:${result.servicePath}` : ''}${lingerToken}\n`);
|
|
50
70
|
return;
|
|
51
71
|
}
|
|
52
72
|
|
|
53
|
-
clackIntro('
|
|
73
|
+
clackIntro('AiWorker Startup');
|
|
54
74
|
logStatus(result.enabled ? 'success' : 'info', `startup ${result.enabled ? 'enabled' : 'disabled'}`, result.servicePath || undefined);
|
|
55
75
|
if (typeof result.activeState === 'string') {
|
|
56
76
|
logStatus(result.active ? 'success' : result.activeState === 'failed' ? 'error' : 'warning', `service ${result.activeState}`);
|
|
57
77
|
}
|
|
58
78
|
if (normalized === 'enable') {
|
|
59
|
-
logStatus('info', 'service command', '
|
|
79
|
+
logStatus('info', 'service command', 'aiworker serve --foreground');
|
|
80
|
+
}
|
|
81
|
+
if (result.platform === 'linux') {
|
|
82
|
+
if (result.lingerEnabled === true) {
|
|
83
|
+
logStatus('success', 'user lingering enabled');
|
|
84
|
+
} else if (result.lingerEnabled === false) {
|
|
85
|
+
logStatus(result.enabled ? 'warning' : 'info', `${result.enabled ? '[LINGER_DISABLED] ' : ''}user lingering is disabled`, result.enabled ? 'startup service may stop after logout' : undefined);
|
|
86
|
+
if (result.enabled) {
|
|
87
|
+
logStatus('info', '[ENABLE_LINGER]', `sudo loginctl enable-linger ${result.lingerUser || '"$USER"'}`);
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
logStatus(result.enabled ? 'warning' : 'info', result.enabled ? '[LINGER_UNKNOWN] could not verify user lingering' : 'user lingering state is unknown', result.enabled ? 'startup service may stop after logout' : undefined);
|
|
91
|
+
if (result.enabled) {
|
|
92
|
+
logStatus('info', '[CHECK_LINGER]', `loginctl show-user ${result.lingerUser || '"$USER"'} -p Linger`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
60
95
|
}
|
|
61
96
|
clackOutro(normalized === 'status' ? 'status complete' : `${normalized} complete`);
|
|
62
97
|
}
|
|
@@ -142,7 +142,7 @@ async function resolveTargetInstance({
|
|
|
142
142
|
|
|
143
143
|
if (options.all && requireAll) {
|
|
144
144
|
if (running.length === 0) {
|
|
145
|
-
throw new Error('No running
|
|
145
|
+
throw new Error('No running AiWorker instance found. Start one with `aiworker serve`.');
|
|
146
146
|
}
|
|
147
147
|
return running;
|
|
148
148
|
}
|
|
@@ -155,11 +155,11 @@ async function resolveTargetInstance({
|
|
|
155
155
|
if (!attachability.attachable) {
|
|
156
156
|
if (attachability.reason === 'desktop') {
|
|
157
157
|
throw new Error(
|
|
158
|
-
`Port ${options.port} is used by
|
|
158
|
+
`Port ${options.port} is used by AiWorker Desktop app. Tunnel attach requires a CLI instance from \`aiworker serve\`.`
|
|
159
159
|
);
|
|
160
160
|
}
|
|
161
161
|
throw new Error(
|
|
162
|
-
`Port ${options.port} is not an attachable
|
|
162
|
+
`Port ${options.port} is not an attachable AiWorker tunnel instance. Ensure it is healthy and running AiWorker CLI runtime.`
|
|
163
163
|
);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
@@ -170,7 +170,7 @@ async function resolveTargetInstance({
|
|
|
170
170
|
const systemInfo = await fetchSystemInfoFromPort(options.port, globalThis.fetch, options.host);
|
|
171
171
|
if (isDesktopRuntimeForPort(systemInfo, options.port)) {
|
|
172
172
|
throw new Error(
|
|
173
|
-
`Port ${options.port} is used by
|
|
173
|
+
`Port ${options.port} is used by AiWorker Desktop app. Tunnel attach requires a CLI instance from \`aiworker serve\`.`
|
|
174
174
|
);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
@@ -190,7 +190,7 @@ async function resolveTargetInstance({
|
|
|
190
190
|
const started = running.find((entry) => entry.port === options.port);
|
|
191
191
|
if (started) return { ...started, autoStarted: true };
|
|
192
192
|
}
|
|
193
|
-
throw new Error(`No running
|
|
193
|
+
throw new Error(`No running AiWorker instance found on port ${options.port}.`);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
if (rejectDesktopRuntime) {
|
|
@@ -212,7 +212,7 @@ async function resolveTargetInstance({
|
|
|
212
212
|
|
|
213
213
|
if (attachableEntries.length > 1) {
|
|
214
214
|
const ports = attachableEntries.map((entry) => entry.port).join(', ');
|
|
215
|
-
throw new Error(`Multiple attachable
|
|
215
|
+
throw new Error(`Multiple attachable AiWorker instances found: ${ports}. Use --port <port> or --all.`);
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
if (allowAutoStart) {
|
|
@@ -229,10 +229,10 @@ async function resolveTargetInstance({
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
if (sawDesktop) {
|
|
232
|
-
throw new Error('Only
|
|
232
|
+
throw new Error('Only AiWorker Desktop instance(s) detected. Tunnel attach requires a CLI instance from `aiworker serve`.');
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
throw new Error('No attachable
|
|
235
|
+
throw new Error('No attachable AiWorker instance found. Start one with `aiworker serve`.');
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
if (running.length === 1) {
|
|
@@ -251,11 +251,11 @@ async function resolveTargetInstance({
|
|
|
251
251
|
const started = running.find((entry) => entry.port === startedPort) || getLatestInstance(running);
|
|
252
252
|
if (started) return { ...started, autoStarted: true };
|
|
253
253
|
}
|
|
254
|
-
throw new Error('No running
|
|
254
|
+
throw new Error('No running AiWorker instance found. Start one with `aiworker serve`.');
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
const ports = running.map((entry) => entry.port).join(', ');
|
|
258
|
-
throw new Error(`Multiple
|
|
258
|
+
throw new Error(`Multiple AiWorker instances found: ${ports}. Use --port <port> or --all.`);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
async function resolveTunnelReadEntries(options) {
|
|
@@ -264,13 +264,13 @@ async function resolveTunnelReadEntries(options) {
|
|
|
264
264
|
if (options.explicitPort) {
|
|
265
265
|
const found = running.find((entry) => entry.port === options.port);
|
|
266
266
|
if (!found) {
|
|
267
|
-
throw new Error(`No running
|
|
267
|
+
throw new Error(`No running AiWorker instance found on port ${options.port}.`);
|
|
268
268
|
}
|
|
269
269
|
return [found];
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
if (running.length === 0) {
|
|
273
|
-
throw new Error('No running
|
|
273
|
+
throw new Error('No running AiWorker instance found. Start one with `aiworker serve`.');
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
return running;
|
|
@@ -329,10 +329,10 @@ async function handleTunnelProfileSubcommand(options, action, { boldText, ensure
|
|
|
329
329
|
if (!isQuietMode(options)) {
|
|
330
330
|
clackIntro('Tunnel Profile');
|
|
331
331
|
logStatus('info', 'Available subcommands', 'list, show, add, remove');
|
|
332
|
-
clackLog.step('List profiles: `
|
|
333
|
-
clackLog.step('Show one profile: `
|
|
334
|
-
clackLog.step('Add profile: `
|
|
335
|
-
clackLog.step('Remove profile: `
|
|
332
|
+
clackLog.step('List profiles: `aiworker tunnel profile list`');
|
|
333
|
+
clackLog.step('Show one profile: `aiworker tunnel profile show --name <name>`');
|
|
334
|
+
clackLog.step('Add profile: `aiworker tunnel profile add --provider cloudflare --mode managed-remote --name <name> --hostname <host> --token <token>`');
|
|
335
|
+
clackLog.step('Remove profile: `aiworker tunnel profile remove --name <name>`');
|
|
336
336
|
clackOutro('Choose a subcommand');
|
|
337
337
|
}
|
|
338
338
|
return;
|
|
@@ -575,7 +575,7 @@ async function handleTunnelProfileSubcommand(options, action, { boldText, ensure
|
|
|
575
575
|
clackIntro(boldText('Tunnel Profile Saved'));
|
|
576
576
|
logStatus('success', `${added.name} (${added.provider}/${added.mode})`, `${added.hostname} ${formatProfileTokenStatus(added, options.showSecrets)}`);
|
|
577
577
|
clackOutro('save complete');
|
|
578
|
-
logStatus('info', '[START_PROFILE]', `
|
|
578
|
+
logStatus('info', '[START_PROFILE]', `aiworker tunnel start --profile ${added.name}`);
|
|
579
579
|
clackOutro('');
|
|
580
580
|
return;
|
|
581
581
|
}
|
|
@@ -615,7 +615,7 @@ async function handleTunnelProfileSubcommand(options, action, { boldText, ensure
|
|
|
615
615
|
const suggestion = findClosestMatch(sub, knownProfileActions);
|
|
616
616
|
const hint = suggestion ? ` Did you mean '${suggestion}'?` : '';
|
|
617
617
|
throw new TunnelCliError(
|
|
618
|
-
`Unknown tunnel profile subcommand '${sub}'.${hint} Use '
|
|
618
|
+
`Unknown tunnel profile subcommand '${sub}'.${hint} Use 'aiworker tunnel help'.`,
|
|
619
619
|
EXIT_CODE.USAGE_ERROR
|
|
620
620
|
);
|
|
621
621
|
}
|
|
@@ -971,16 +971,16 @@ async function tunnelCommand(options, subcommand, action, deps) {
|
|
|
971
971
|
logStatus('error', `port ${entry.port} — No running instance`);
|
|
972
972
|
}
|
|
973
973
|
if (desktopUnavailablePorts.length > 0) {
|
|
974
|
-
clackLog.message('Only CLI instances (
|
|
974
|
+
clackLog.message('Only CLI instances (aiworker serve) support tunneling.');
|
|
975
975
|
}
|
|
976
976
|
|
|
977
977
|
if (cliPorts.length === 0 && unavailablePorts.length === 0) {
|
|
978
|
-
logStatus('warning', 'No running instances found', 'Start one with `
|
|
978
|
+
logStatus('warning', 'No running instances found', 'Start one with `aiworker serve`.');
|
|
979
979
|
clackOutro('No ports available');
|
|
980
980
|
return;
|
|
981
981
|
}
|
|
982
982
|
if (cliPorts.length === 0) {
|
|
983
|
-
logStatus('warning', 'No CLI instances available for tunneling', 'Start one with `
|
|
983
|
+
logStatus('warning', 'No CLI instances available for tunneling', 'Start one with `aiworker serve`.');
|
|
984
984
|
clackOutro('No CLI ports available');
|
|
985
985
|
return;
|
|
986
986
|
}
|
|
@@ -1081,9 +1081,9 @@ async function tunnelCommand(options, subcommand, action, deps) {
|
|
|
1081
1081
|
key: 'managed-remote-port',
|
|
1082
1082
|
code: '[PORT_MISMATCH]',
|
|
1083
1083
|
lines: [
|
|
1084
|
-
'Cloudflare target must match the active
|
|
1084
|
+
'Cloudflare target must match the active AiWorker CLI port.',
|
|
1085
1085
|
'Example: `http://127.0.0.1:<port>`',
|
|
1086
|
-
'If CLI picked a different port, update Cloudflare or run `
|
|
1086
|
+
'If CLI picked a different port, update Cloudflare or run `aiworker serve --port <port>`.',
|
|
1087
1087
|
],
|
|
1088
1088
|
});
|
|
1089
1089
|
}
|
|
@@ -1436,7 +1436,7 @@ async function tunnelCommand(options, subcommand, action, deps) {
|
|
|
1436
1436
|
const safeInstances = runningInstances.filter((entry) => !isUnsafeBrowserPort(entry.port));
|
|
1437
1437
|
if (safeInstances.length === 0) {
|
|
1438
1438
|
throw new TunnelCliError(
|
|
1439
|
-
'All discovered
|
|
1439
|
+
'All discovered AiWorker instance ports are browser-unsafe. Start or target a safe port (3000, 5173, 8080, or high ephemeral).',
|
|
1440
1440
|
EXIT_CODE.USAGE_ERROR,
|
|
1441
1441
|
);
|
|
1442
1442
|
}
|
|
@@ -1453,13 +1453,13 @@ async function tunnelCommand(options, subcommand, action, deps) {
|
|
|
1453
1453
|
|
|
1454
1454
|
if (attachableSafeInstances.length === 0) {
|
|
1455
1455
|
throw new TunnelCliError(
|
|
1456
|
-
'No attachable
|
|
1456
|
+
'No attachable AiWorker CLI instances found on safe ports. Start one with `aiworker serve --port 3000`.',
|
|
1457
1457
|
EXIT_CODE.USAGE_ERROR,
|
|
1458
1458
|
);
|
|
1459
1459
|
}
|
|
1460
1460
|
|
|
1461
1461
|
const selectedPort = await clackSelect({
|
|
1462
|
-
message: 'Select
|
|
1462
|
+
message: 'Select AiWorker instance port',
|
|
1463
1463
|
options: attachableSafeInstances.map((entry) => ({
|
|
1464
1464
|
value: entry.port,
|
|
1465
1465
|
label: `port ${entry.port}`,
|
|
@@ -1479,7 +1479,7 @@ async function tunnelCommand(options, subcommand, action, deps) {
|
|
|
1479
1479
|
logStatus(
|
|
1480
1480
|
'info',
|
|
1481
1481
|
`Using auto-started instance on port ${instance.port}`,
|
|
1482
|
-
`logs:
|
|
1482
|
+
`logs: aiworker logs -p ${instance.port}`,
|
|
1483
1483
|
);
|
|
1484
1484
|
}
|
|
1485
1485
|
|
|
@@ -1494,7 +1494,7 @@ async function tunnelCommand(options, subcommand, action, deps) {
|
|
|
1494
1494
|
|
|
1495
1495
|
if (instance?.autoStarted) {
|
|
1496
1496
|
const healthProgress = await createProgress(options, { max: 60 });
|
|
1497
|
-
healthProgress?.start(`Waiting for
|
|
1497
|
+
healthProgress?.start(`Waiting for AiWorker on port ${instance.port} to become healthy (up to 60s)...`);
|
|
1498
1498
|
let progressedSeconds = 0;
|
|
1499
1499
|
const healthy = await waitForServerHealth(instance.port, {
|
|
1500
1500
|
timeoutMs: 60000,
|
|
@@ -1506,7 +1506,7 @@ async function tunnelCommand(options, subcommand, action, deps) {
|
|
|
1506
1506
|
if (delta > 0) {
|
|
1507
1507
|
healthProgress.advance(delta);
|
|
1508
1508
|
progressedSeconds = elapsedSeconds;
|
|
1509
|
-
healthProgress.message(`Waiting for
|
|
1509
|
+
healthProgress.message(`Waiting for AiWorker health (${progressedSeconds}s / 60s)...`);
|
|
1510
1510
|
}
|
|
1511
1511
|
if (complete && progressedSeconds < 60) {
|
|
1512
1512
|
const remaining = 60 - progressedSeconds;
|
|
@@ -1518,12 +1518,12 @@ async function tunnelCommand(options, subcommand, action, deps) {
|
|
|
1518
1518
|
},
|
|
1519
1519
|
});
|
|
1520
1520
|
if (!healthy) {
|
|
1521
|
-
healthProgress?.stop('
|
|
1521
|
+
healthProgress?.stop('AiWorker is still starting');
|
|
1522
1522
|
throw new Error(
|
|
1523
|
-
`
|
|
1523
|
+
`AiWorker on port ${instance.port} is still starting after 60s. Startup time can vary by machine performance. ` +
|
|
1524
1524
|
`Wait another minute, then check health with \`curl -fsS ${buildLocalUrl(instance.port, '/health')}\`. ` +
|
|
1525
|
-
`If health is OK, retry tunnel start with \`
|
|
1526
|
-
`For diagnostics run \`
|
|
1525
|
+
`If health is OK, retry tunnel start with \`aiworker tunnel start --port ${instance.port}\`. ` +
|
|
1526
|
+
`For diagnostics run \`aiworker logs -p ${instance.port}\`.`
|
|
1527
1527
|
);
|
|
1528
1528
|
}
|
|
1529
1529
|
healthProgress?.stop(`Instance ${instance.port} is healthy`);
|
|
@@ -1575,12 +1575,12 @@ async function tunnelCommand(options, subcommand, action, deps) {
|
|
|
1575
1575
|
if (error instanceof Error && /\/api\/openchamber\/tunnel\/start/.test(error.message) && /timed out/.test(error.message)) {
|
|
1576
1576
|
spin?.error('Tunnel start timed out');
|
|
1577
1577
|
throw new Error(
|
|
1578
|
-
`Tunnel start timed out after 60s. cloudflared may still be starting; check with \`
|
|
1578
|
+
`Tunnel start timed out after 60s. cloudflared may still be starting; check with \`aiworker tunnel status --port ${instance.port}\`. Run \`aiworker logs -p ${instance.port}\` for details.`
|
|
1579
1579
|
);
|
|
1580
1580
|
}
|
|
1581
1581
|
spin?.error('Tunnel start failed');
|
|
1582
1582
|
const message = error instanceof Error ? error.message : String(error);
|
|
1583
|
-
throw new Error(`${message} Run \`
|
|
1583
|
+
throw new Error(`${message} Run \`aiworker logs -p ${instance.port}\` for details.`);
|
|
1584
1584
|
}
|
|
1585
1585
|
|
|
1586
1586
|
if (!response.ok || !body?.ok) {
|
|
@@ -1590,7 +1590,7 @@ async function tunnelCommand(options, subcommand, action, deps) {
|
|
|
1590
1590
|
const userError = isCloudflareTimeout
|
|
1591
1591
|
? `Cloudflare quick tunnel request timed out. ${baseError}`
|
|
1592
1592
|
: baseError;
|
|
1593
|
-
throw new Error(`${userError} Run \`
|
|
1593
|
+
throw new Error(`${userError} Run \`aiworker logs -p ${instance.port}\` for details.`);
|
|
1594
1594
|
}
|
|
1595
1595
|
|
|
1596
1596
|
// Avoid duplicate "Tunnel started" lines: spinner completion is implied by
|
|
@@ -1636,15 +1636,15 @@ async function tunnelCommand(options, subcommand, action, deps) {
|
|
|
1636
1636
|
clackOutro('');
|
|
1637
1637
|
|
|
1638
1638
|
const optionalTips = [
|
|
1639
|
-
{ line: 'Check status', detail: '
|
|
1640
|
-
{ line: 'Stop tunnel', detail: '
|
|
1639
|
+
{ line: 'Check status', detail: 'aiworker tunnel status' },
|
|
1640
|
+
{ line: 'Stop tunnel', detail: 'aiworker tunnel stop' },
|
|
1641
1641
|
{ line: 'If needed, repeat with same settings', detail: replayCommand },
|
|
1642
1642
|
];
|
|
1643
1643
|
|
|
1644
1644
|
if (!selectedProfile && mode === 'managed-remote' && typeof hostname === 'string' && hostname.trim().length > 0) {
|
|
1645
1645
|
const profileSaveCommand = buildTunnelProfileAddCommand({ provider, hostname });
|
|
1646
1646
|
optionalTips.push({ line: 'Optional: save reusable profile (stores hostname + token locally)', detail: profileSaveCommand });
|
|
1647
|
-
optionalTips.push({ line: 'Start from saved profile', detail: '
|
|
1647
|
+
optionalTips.push({ line: 'Start from saved profile', detail: 'aiworker tunnel start --profile <name>' });
|
|
1648
1648
|
}
|
|
1649
1649
|
|
|
1650
1650
|
console.log('');
|
|
@@ -1747,7 +1747,7 @@ async function tunnelCommand(options, subcommand, action, deps) {
|
|
|
1747
1747
|
const suggestion = findClosestMatch(subcommand, knownTunnelSubcommands);
|
|
1748
1748
|
const hint = suggestion ? ` Did you mean '${suggestion}'?` : '';
|
|
1749
1749
|
throw new TunnelCliError(
|
|
1750
|
-
`Unknown tunnel subcommand '${subcommand}'.${hint} Use '
|
|
1750
|
+
`Unknown tunnel subcommand '${subcommand}'.${hint} Use 'aiworker tunnel help'.`,
|
|
1751
1751
|
EXIT_CODE.USAGE_ERROR
|
|
1752
1752
|
);
|
|
1753
1753
|
}
|
|
@@ -32,7 +32,7 @@ function createUpdateCommand({ importFromFilePath, packageManagerPath, serveComm
|
|
|
32
32
|
const currentVersion = getCurrentVersion();
|
|
33
33
|
|
|
34
34
|
if (showOutput) {
|
|
35
|
-
clackIntro('
|
|
35
|
+
clackIntro('AiWorker Update');
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
if (showOutput && !updateSpin) {
|
|
@@ -5,17 +5,17 @@ import { describe, expect, it, vi } from 'vitest';
|
|
|
5
5
|
|
|
6
6
|
import { createUpdateCommand } from './commands-update.js';
|
|
7
7
|
|
|
8
|
-
async function
|
|
9
|
-
const previous = process.env.
|
|
8
|
+
async function withTempAiWorkerDataDir(fn) {
|
|
9
|
+
const previous = process.env.AIWORKER_DATA_DIR;
|
|
10
10
|
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'openchamber-update-test-'));
|
|
11
|
-
process.env.
|
|
11
|
+
process.env.AIWORKER_DATA_DIR = dir;
|
|
12
12
|
try {
|
|
13
13
|
return await fn(dir);
|
|
14
14
|
} finally {
|
|
15
15
|
if (typeof previous === 'string') {
|
|
16
|
-
process.env.
|
|
16
|
+
process.env.AIWORKER_DATA_DIR = previous;
|
|
17
17
|
} else {
|
|
18
|
-
delete process.env.
|
|
18
|
+
delete process.env.AIWORKER_DATA_DIR;
|
|
19
19
|
}
|
|
20
20
|
fs.rmSync(dir, { recursive: true, force: true });
|
|
21
21
|
}
|
|
@@ -23,7 +23,7 @@ async function withTempOpenChamberDataDir(fn) {
|
|
|
23
23
|
|
|
24
24
|
describe('update command', () => {
|
|
25
25
|
it('uses the package-manager helpers on the update-available path', async () => {
|
|
26
|
-
await
|
|
26
|
+
await withTempAiWorkerDataDir(async () => {
|
|
27
27
|
const originalWrite = process.stdout.write;
|
|
28
28
|
process.stdout.write = vi.fn(() => true);
|
|
29
29
|
const executeUpdate = vi.fn(() => ({ success: true, exitCode: 0 }));
|
package/dist/assets/{CodeMirrorCommentWidgets-B3u7UIcE.js → CodeMirrorCommentWidgets-B1Gizi3a.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./vendor-react-BUCujlKS.js";import{I as l,a as I}from"./useInlineCommentController-
|
|
1
|
+
import{j as a}from"./vendor-react-BUCujlKS.js";import{I as l,a as I}from"./useInlineCommentController-BiWz4AVb.js";function E(g){const{drafts:x,editingDraftId:d,commentText:o,onTextChange:r,selection:n,isDragging:u,fileLabel:s,newWidgetId:f,mapDraftToRange:p,onSave:m,onCancel:c,onEdit:C,onDelete:h}=g,t=[];for(const e of x){const i=p(e);if(e.id===d){t.push({afterLine:i.end,id:`edit-${e.id}`,content:a.jsx(l,{initialText:o,onTextChange:r,fileLabel:s,lineRange:i,isEditing:!0,onSave:m,onCancel:c},`edit-${e.id}`)});continue}t.push({afterLine:i.end,id:`card-${e.id}`,content:a.jsx(I,{draft:e,onEdit:()=>C(e),onDelete:()=>h(e)},`card-${e.id}`)})}if(n&&!d&&!u){const e={...n,start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)};t.push({afterLine:e.end,id:f,content:a.jsx(l,{initialText:o,onTextChange:r,fileLabel:s,lineRange:e,isEditing:!1,onSave:m,onCancel:c},f)})}return t}export{E as b};
|