@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/bin/lib/cli-startup.js
CHANGED
|
@@ -8,7 +8,7 @@ import { getDataDir } from './cli-paths.js';
|
|
|
8
8
|
import { hasUiPasswordConfigured } from './cli-network.js';
|
|
9
9
|
import { searchPathFor } from './cli-executables.js';
|
|
10
10
|
|
|
11
|
-
const STARTUP_SERVICE_ID = 'dev.
|
|
11
|
+
const STARTUP_SERVICE_ID = 'dev.aiworker.web';
|
|
12
12
|
|
|
13
13
|
function getStartupServicePaths() {
|
|
14
14
|
if (process.platform === 'darwin') {
|
|
@@ -20,7 +20,7 @@ function getStartupServicePaths() {
|
|
|
20
20
|
if (process.platform === 'linux') {
|
|
21
21
|
return {
|
|
22
22
|
platform: 'linux',
|
|
23
|
-
servicePath: path.join(os.homedir(), '.config', 'systemd', 'user', '
|
|
23
|
+
servicePath: path.join(os.homedir(), '.config', 'systemd', 'user', 'aiworker.service'),
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
if (process.platform === 'win32') {
|
|
@@ -71,11 +71,11 @@ function getStartupEnvFilePath() {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
function getMacosStartupWrapperPath() {
|
|
74
|
-
return path.join(getDataDir(), 'bin', '
|
|
74
|
+
return path.join(getDataDir(), 'bin', 'AiWorker');
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
function getWindowsStartupWrapperPath() {
|
|
78
|
-
return path.join(getDataDir(), 'bin', '
|
|
78
|
+
return path.join(getDataDir(), 'bin', 'AiWorker.ps1');
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
function collectStartupEnv(options = {}) {
|
|
@@ -93,13 +93,13 @@ function collectStartupEnv(options = {}) {
|
|
|
93
93
|
}
|
|
94
94
|
const uiPassword = hasUiPasswordConfigured(options.uiPassword) ? options.uiPassword : undefined;
|
|
95
95
|
if (uiPassword) {
|
|
96
|
-
env.
|
|
96
|
+
env.AIWORKER_UI_PASSWORD = uiPassword;
|
|
97
97
|
}
|
|
98
98
|
if (options.apiOnly === true) {
|
|
99
|
-
env.
|
|
99
|
+
env.AIWORKER_API_ONLY = 'true';
|
|
100
100
|
}
|
|
101
|
-
if (typeof process.env.
|
|
102
|
-
env.
|
|
101
|
+
if (typeof process.env.AIWORKER_DATA_DIR === 'string' && process.env.AIWORKER_DATA_DIR.trim().length > 0) {
|
|
102
|
+
env.AIWORKER_DATA_DIR = path.resolve(process.env.AIWORKER_DATA_DIR.trim());
|
|
103
103
|
}
|
|
104
104
|
return env;
|
|
105
105
|
}
|
|
@@ -215,7 +215,7 @@ function buildMacosLaunchAgent(options = {}) {
|
|
|
215
215
|
const wrapperPath = writeMacosStartupWrapper(options);
|
|
216
216
|
const args = [wrapperPath];
|
|
217
217
|
const env = collectStartupEnv(options);
|
|
218
|
-
const logDir = path.join(os.homedir(), 'Library', 'Logs', '
|
|
218
|
+
const logDir = path.join(os.homedir(), 'Library', 'Logs', 'AiWorker');
|
|
219
219
|
const argXml = args.map((arg) => ` <string>${escapeXml(arg)}</string>`).join('\n');
|
|
220
220
|
const envXml = Object.entries(env).length > 0
|
|
221
221
|
? ` <key>EnvironmentVariables</key>\n <dict>\n${Object.entries(env).map(([key, value]) => ` <key>${escapeXml(key)}</key>\n <string>${escapeXml(value)}</string>`).join('\n')}\n </dict>\n`
|
|
@@ -251,7 +251,7 @@ function buildSystemdUserService(options = {}) {
|
|
|
251
251
|
const args = buildStartupArgs(options).map((arg) => `"${systemdEscapeArg(arg)}"`).join(' ');
|
|
252
252
|
const envFilePath = getStartupEnvFilePath();
|
|
253
253
|
return `[Unit]
|
|
254
|
-
Description=
|
|
254
|
+
Description=AiWorker web server
|
|
255
255
|
After=network-online.target
|
|
256
256
|
|
|
257
257
|
[Service]
|
|
@@ -283,6 +283,52 @@ function runStartupCommand(command, args, options = {}) {
|
|
|
283
283
|
return result;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
+
function parseLingerState(stdout) {
|
|
287
|
+
if (typeof stdout !== 'string') {
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
const match = stdout.match(/^Linger=([A-Za-z]+)\s*$/m);
|
|
291
|
+
if (!match) {
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
const value = match[1].toLowerCase();
|
|
295
|
+
if (value === 'yes') return true;
|
|
296
|
+
if (value === 'no') return false;
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function getCurrentUsername() {
|
|
301
|
+
try {
|
|
302
|
+
const name = os.userInfo().username;
|
|
303
|
+
if (typeof name === 'string' && name.length > 0) {
|
|
304
|
+
return name;
|
|
305
|
+
}
|
|
306
|
+
} catch {
|
|
307
|
+
// userInfo() can throw when the uid has no passwd entry; fall back to env.
|
|
308
|
+
}
|
|
309
|
+
return process.env.USER || process.env.LOGNAME || '';
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// A systemd --user service only keeps running without an active login session
|
|
313
|
+
// when the user has lingering enabled. Detect it so `startup enable` can warn
|
|
314
|
+
// that the service may otherwise stop on logout. Returns null when the state
|
|
315
|
+
// cannot be determined (no username, loginctl unavailable, or odd output).
|
|
316
|
+
function getUserLingerEnabled(user) {
|
|
317
|
+
if (!user) {
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
320
|
+
let result;
|
|
321
|
+
try {
|
|
322
|
+
result = runStartupCommand('loginctl', ['show-user', user, '-p', 'Linger'], { allowFailure: true });
|
|
323
|
+
} catch {
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
if (result.status !== 0) {
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
return parseLingerState(result.stdout);
|
|
330
|
+
}
|
|
331
|
+
|
|
286
332
|
function getStartupStatus() {
|
|
287
333
|
const paths = getStartupServicePaths();
|
|
288
334
|
if (!paths.servicePath) {
|
|
@@ -293,9 +339,10 @@ function getStartupStatus() {
|
|
|
293
339
|
return { supported: true, platform: paths.platform, enabled: result.status === 0, active: null, servicePath: paths.servicePath };
|
|
294
340
|
}
|
|
295
341
|
if (paths.platform === 'linux') {
|
|
296
|
-
const enabledResult = runStartupCommand('systemctl', ['--user', 'is-enabled', '
|
|
297
|
-
const activeResult = runStartupCommand('systemctl', ['--user', 'is-active', '
|
|
342
|
+
const enabledResult = runStartupCommand('systemctl', ['--user', 'is-enabled', 'aiworker.service'], { allowFailure: true });
|
|
343
|
+
const activeResult = runStartupCommand('systemctl', ['--user', 'is-active', 'aiworker.service'], { allowFailure: true });
|
|
298
344
|
const activeState = (activeResult.stdout || '').trim() || 'inactive';
|
|
345
|
+
const lingerUser = getCurrentUsername();
|
|
299
346
|
return {
|
|
300
347
|
supported: true,
|
|
301
348
|
platform: paths.platform,
|
|
@@ -303,6 +350,8 @@ function getStartupStatus() {
|
|
|
303
350
|
active: activeState === 'active',
|
|
304
351
|
activeState,
|
|
305
352
|
servicePath: paths.servicePath,
|
|
353
|
+
lingerEnabled: getUserLingerEnabled(lingerUser),
|
|
354
|
+
lingerUser: lingerUser || null,
|
|
306
355
|
};
|
|
307
356
|
}
|
|
308
357
|
return {
|
|
@@ -323,7 +372,7 @@ function enableStartupService(options = {}) {
|
|
|
323
372
|
if (paths.platform === 'macos') {
|
|
324
373
|
removeStartupEnvFile();
|
|
325
374
|
fs.mkdirSync(path.dirname(paths.servicePath), { recursive: true, mode: 0o700 });
|
|
326
|
-
fs.mkdirSync(path.join(os.homedir(), 'Library', 'Logs', '
|
|
375
|
+
fs.mkdirSync(path.join(os.homedir(), 'Library', 'Logs', 'AiWorker'), { recursive: true, mode: 0o700 });
|
|
327
376
|
fs.writeFileSync(paths.servicePath, buildMacosLaunchAgent(options), { mode: 0o600 });
|
|
328
377
|
runStartupCommand('/bin/launchctl', ['bootout', `gui/${process.getuid()}`, paths.servicePath], { allowFailure: true });
|
|
329
378
|
runStartupCommand('/bin/launchctl', ['bootstrap', `gui/${process.getuid()}`, paths.servicePath]);
|
|
@@ -336,7 +385,7 @@ function enableStartupService(options = {}) {
|
|
|
336
385
|
fs.mkdirSync(path.dirname(paths.servicePath), { recursive: true, mode: 0o700 });
|
|
337
386
|
fs.writeFileSync(paths.servicePath, buildSystemdUserService(options), { mode: 0o600 });
|
|
338
387
|
runStartupCommand('systemctl', ['--user', 'daemon-reload']);
|
|
339
|
-
runStartupCommand('systemctl', ['--user', 'enable', '--now', '
|
|
388
|
+
runStartupCommand('systemctl', ['--user', 'enable', '--now', 'aiworker.service']);
|
|
340
389
|
return getStartupStatus();
|
|
341
390
|
}
|
|
342
391
|
|
|
@@ -368,7 +417,7 @@ function disableStartupService() {
|
|
|
368
417
|
}
|
|
369
418
|
|
|
370
419
|
if (paths.platform === 'linux') {
|
|
371
|
-
runStartupCommand('systemctl', ['--user', 'disable', '--now', '
|
|
420
|
+
runStartupCommand('systemctl', ['--user', 'disable', '--now', 'aiworker.service'], { allowFailure: true });
|
|
372
421
|
try { fs.unlinkSync(paths.servicePath); } catch {}
|
|
373
422
|
runStartupCommand('systemctl', ['--user', 'daemon-reload'], { allowFailure: true });
|
|
374
423
|
return getStartupStatus();
|
|
@@ -337,7 +337,7 @@ function resolveProfileByName(profiles, profileName, provider) {
|
|
|
337
337
|
});
|
|
338
338
|
|
|
339
339
|
if (matches.length === 0) {
|
|
340
|
-
return { profile: null, error: `No tunnel profile found for name '${profileName}'. Run '
|
|
340
|
+
return { profile: null, error: `No tunnel profile found for name '${profileName}'. Run 'aiworker tunnel profile list'.` };
|
|
341
341
|
}
|
|
342
342
|
if (matches.length > 1) {
|
|
343
343
|
return { profile: null, error: `Profile name '${profileName}' exists for multiple providers. Use --provider <id>.` };
|
|
@@ -129,7 +129,7 @@ function buildTunnelStartReplayCommand({
|
|
|
129
129
|
tokenViaStdin,
|
|
130
130
|
tokenFileProvided,
|
|
131
131
|
}) {
|
|
132
|
-
const parts = ['
|
|
132
|
+
const parts = ['aiworker', 'tunnel', 'start'];
|
|
133
133
|
if (Number.isFinite(port) && port > 0) {
|
|
134
134
|
parts.push('--port', String(port));
|
|
135
135
|
}
|
|
@@ -174,7 +174,7 @@ function buildTunnelStartReplayCommand({
|
|
|
174
174
|
|
|
175
175
|
function buildTunnelProfileAddCommand({ provider, hostname }) {
|
|
176
176
|
const parts = [
|
|
177
|
-
'
|
|
177
|
+
'aiworker',
|
|
178
178
|
'tunnel',
|
|
179
179
|
'profile',
|
|
180
180
|
'add',
|
|
@@ -42,10 +42,10 @@ function isValidRelayUrl(value) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// Resolve the relay endpoint the same way the running host does (service.js):
|
|
45
|
-
//
|
|
45
|
+
// AIWORKER_RELAY_URL env override, then the stored setting, then the default —
|
|
46
46
|
// so the pairing link points at the same relay the host connects out to.
|
|
47
47
|
function resolveRelayUrl(settings) {
|
|
48
|
-
const envUrl = process.env.
|
|
48
|
+
const envUrl = process.env.AIWORKER_RELAY_URL;
|
|
49
49
|
if (isValidRelayUrl(envUrl)) return envUrl.trim();
|
|
50
50
|
const stored = settings?.privateRelay?.relayUrl;
|
|
51
51
|
if (isValidRelayUrl(stored)) return stored.trim();
|
|
@@ -64,7 +64,7 @@ function createSettingsAccessors() {
|
|
|
64
64
|
return createSettingsAccessorsModule({
|
|
65
65
|
fsPromises: fs.promises,
|
|
66
66
|
path,
|
|
67
|
-
dataDir:
|
|
67
|
+
dataDir: getAiWorkerDataDir(),
|
|
68
68
|
settingsFileName: 'settings.json',
|
|
69
69
|
});
|
|
70
70
|
}
|
|
@@ -99,7 +99,7 @@ async function buildRelayPairingCandidate() {
|
|
|
99
99
|
// session created here is redeemable by the live server. createPairingSession
|
|
100
100
|
// only writes the store (no server needed to mint); redeem is served by the host.
|
|
101
101
|
function createCliPairingRuntime() {
|
|
102
|
-
const dataDir =
|
|
102
|
+
const dataDir = getAiWorkerDataDir();
|
|
103
103
|
const remoteClientAuthRuntime = createRemoteClientAuthRuntime({
|
|
104
104
|
fsPromises: fs.promises,
|
|
105
105
|
path,
|
|
@@ -115,12 +115,12 @@ function createCliPairingRuntime() {
|
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
// Mirror of encodePairingConnectionPayload in @
|
|
118
|
+
// Mirror of encodePairingConnectionPayload in @aiworker/ui (the bin cannot
|
|
119
119
|
// import the UI package). Keep in sync: v2 payload → base64url(JSON) in the URL
|
|
120
120
|
// query, so the one-time secret rides the link, never the network.
|
|
121
121
|
function encodePairingConnectUrl(payload) {
|
|
122
122
|
const encoded = bytesToBase64Url(new TextEncoder().encode(JSON.stringify(payload)));
|
|
123
|
-
return `
|
|
123
|
+
return `aiworker://connect?v=2&p=${encoded}`;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
function buildPairingPayload({ pairing, label, candidates }) {
|
|
@@ -137,7 +137,7 @@ function buildPairingPayload({ pairing, label, candidates }) {
|
|
|
137
137
|
|
|
138
138
|
async function resolveConnectUrlServerUrl(options) {
|
|
139
139
|
let hostOverride = options.host;
|
|
140
|
-
if (typeof hostOverride !== 'string' && !process.env.
|
|
140
|
+
if (typeof hostOverride !== 'string' && !process.env.AIWORKER_HOST) {
|
|
141
141
|
const storedOptions = readInstanceOptions(await getInstanceFilePath(options.port));
|
|
142
142
|
if (typeof storedOptions?.host === 'string' && storedOptions.host.trim()) {
|
|
143
143
|
hostOverride = storedOptions.host.trim();
|
|
@@ -204,10 +204,10 @@ function normalizeServerUrlForConnection(value) {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
function
|
|
208
|
-
return process.env.
|
|
209
|
-
? path.resolve(process.env.
|
|
210
|
-
: path.join(os.homedir(), '.config', '
|
|
207
|
+
function getAiWorkerDataDir() {
|
|
208
|
+
return process.env.AIWORKER_DATA_DIR
|
|
209
|
+
? path.resolve(process.env.AIWORKER_DATA_DIR)
|
|
210
|
+
: path.join(os.homedir(), '.config', 'aiworker');
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
async function displayTunnelQrCode(url) {
|
|
@@ -223,7 +223,7 @@ async function displayTunnelQrCode(url) {
|
|
|
223
223
|
|
|
224
224
|
function createConnectUrlCommand({ serveCommand }) {
|
|
225
225
|
return async function connectUrlCommand(options = {}) {
|
|
226
|
-
assertSafeBrowserPort(options.port, { context: '
|
|
226
|
+
assertSafeBrowserPort(options.port, { context: 'AiWorker connect-url' });
|
|
227
227
|
const explicitServerUrl = options.server ? normalizeServerUrlForConnection(options.server) : null;
|
|
228
228
|
if (options.server && !explicitServerUrl) {
|
|
229
229
|
throw new TunnelCliError('Invalid --server URL. Use an http:// or https:// URL.', EXIT_CODE.USAGE_ERROR);
|
|
@@ -288,9 +288,9 @@ function createConnectUrlCommand({ serveCommand }) {
|
|
|
288
288
|
return;
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
clackIntro('
|
|
291
|
+
clackIntro('AiWorker pairing link');
|
|
292
292
|
if (serverState.autoStarted) {
|
|
293
|
-
logStatus('success', `started
|
|
293
|
+
logStatus('success', `started AiWorker on port ${options.port}`);
|
|
294
294
|
}
|
|
295
295
|
logStatus('success', connectUrl);
|
|
296
296
|
clackLog.info(`Server URL: ${serverUrl}`);
|
|
@@ -304,20 +304,20 @@ function createConnectUrlCommand({ serveCommand }) {
|
|
|
304
304
|
clackLog.info(`Fingerprint: ${pairing.fingerprint}`);
|
|
305
305
|
}
|
|
306
306
|
if (resolvedServerUrl.source === 'lan-detected') {
|
|
307
|
-
clackLog.info('Detected a LAN address because
|
|
307
|
+
clackLog.info('Detected a LAN address because AiWorker is bound to all interfaces. Use --server to override it.');
|
|
308
308
|
} else if (resolvedServerUrl.source === 'loopback-fallback') {
|
|
309
|
-
clackLog.warn('
|
|
309
|
+
clackLog.warn('AiWorker is bound to all interfaces, but no LAN address was detected. Use --server to provide a reachable URL.');
|
|
310
310
|
} else if (isLoopbackServerUrl(serverUrl)) {
|
|
311
311
|
// The direct candidate points at this machine only — other devices cannot
|
|
312
312
|
// use it. Say so instead of letting a "LAN" link silently not work (or a
|
|
313
313
|
// --relay link silently go relay-only).
|
|
314
314
|
if (options.relay) {
|
|
315
|
-
logStatus('warn', '[LAN_UNREACHABLE]', '
|
|
315
|
+
logStatus('warn', '[LAN_UNREACHABLE]', 'AiWorker only listens on this machine, so devices will always connect through the relay. Restart with --lan to allow direct home-network connections.');
|
|
316
316
|
} else {
|
|
317
|
-
logStatus('warn', '[LAN_UNREACHABLE]', '
|
|
317
|
+
logStatus('warn', '[LAN_UNREACHABLE]', 'AiWorker only listens on this machine, so other devices cannot use this link. Restart with --lan, or use --server to provide a reachable URL.');
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
|
-
clackLog.info('Scan or paste this link into another
|
|
320
|
+
clackLog.info('Scan or paste this link into another AiWorker client. It is single-use and expires.');
|
|
321
321
|
if (options.qr === true) {
|
|
322
322
|
await displayTunnelQrCode(connectUrl);
|
|
323
323
|
}
|
|
@@ -49,7 +49,7 @@ async function stopCommand(options) {
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
if (showOutput) {
|
|
52
|
-
clackIntro('
|
|
52
|
+
clackIntro('AiWorker Stop');
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
let runningInstances = await discoverLifecycleInstances(options);
|
|
@@ -67,7 +67,7 @@ async function stopCommand(options) {
|
|
|
67
67
|
printJson({ stoppedCount: 0, results: jsonResults });
|
|
68
68
|
}
|
|
69
69
|
if (showOutput) {
|
|
70
|
-
logStatus('info', `no
|
|
70
|
+
logStatus('info', `no AiWorker instance found on port ${options.port}`);
|
|
71
71
|
finish('nothing to stop');
|
|
72
72
|
}
|
|
73
73
|
printQuietStopResults();
|
|
@@ -78,10 +78,10 @@ async function stopCommand(options) {
|
|
|
78
78
|
if (explicitInstance.runtime === 'desktop') {
|
|
79
79
|
jsonResults.push({ port: options.port, runtime: 'desktop', stopped: false, reason: 'desktop-managed' });
|
|
80
80
|
if (isJsonMode(options)) {
|
|
81
|
-
printJson({ stoppedCount: 0, results: jsonResults, messages: [{ level: 'warning', code: 'DESKTOP_MANAGED_PORT', message: `Port ${options.port} is managed by
|
|
81
|
+
printJson({ stoppedCount: 0, results: jsonResults, messages: [{ level: 'warning', code: 'DESKTOP_MANAGED_PORT', message: `Port ${options.port} is managed by AiWorker Desktop and cannot be stopped with this command.` }] });
|
|
82
82
|
}
|
|
83
83
|
if (showOutput) {
|
|
84
|
-
logStatus('warning', `port ${options.port} is managed by
|
|
84
|
+
logStatus('warning', `port ${options.port} is managed by AiWorker Desktop`, 'cannot be stopped with this command');
|
|
85
85
|
finish('no changes applied');
|
|
86
86
|
}
|
|
87
87
|
printQuietStopResults();
|
|
@@ -91,9 +91,9 @@ async function stopCommand(options) {
|
|
|
91
91
|
if (explicitInstance.source === 'probe') {
|
|
92
92
|
const unmanagedStopSpin = showOutput ? createSpinner(options) : null;
|
|
93
93
|
if (showOutput && !unmanagedStopSpin) {
|
|
94
|
-
logStatus('info', `found unmanaged
|
|
94
|
+
logStatus('info', `found unmanaged AiWorker instance on port ${options.port}`, 'attempting shutdown');
|
|
95
95
|
}
|
|
96
|
-
unmanagedStopSpin?.start(`Stopping unmanaged
|
|
96
|
+
unmanagedStopSpin?.start(`Stopping unmanaged AiWorker on port ${options.port}...`);
|
|
97
97
|
const requested = await requestServerShutdown(options.port, options.host);
|
|
98
98
|
|
|
99
99
|
if (Number.isFinite(explicitInstance.pid) && isProcessRunning(explicitInstance.pid)) {
|
|
@@ -106,13 +106,13 @@ async function stopCommand(options) {
|
|
|
106
106
|
|
|
107
107
|
const stopped = await isPortAvailable(options.port, options.host);
|
|
108
108
|
if (stopped) {
|
|
109
|
-
unmanagedStopSpin?.stop(`Stopped unmanaged
|
|
109
|
+
unmanagedStopSpin?.stop(`Stopped unmanaged AiWorker on port ${options.port}`);
|
|
110
110
|
jsonResults.push({ port: options.port, runtime: 'unmanaged', stopped: true });
|
|
111
111
|
if (isJsonMode(options)) {
|
|
112
112
|
printJson({ stoppedCount: 1, results: jsonResults });
|
|
113
113
|
}
|
|
114
114
|
if (showOutput && !unmanagedStopSpin) {
|
|
115
|
-
logStatus('success', `stopped
|
|
115
|
+
logStatus('success', `stopped AiWorker on port ${options.port}`);
|
|
116
116
|
finish('stop complete');
|
|
117
117
|
}
|
|
118
118
|
printQuietStopResults();
|
|
@@ -133,18 +133,18 @@ async function stopCommand(options) {
|
|
|
133
133
|
}
|
|
134
134
|
printQuietStopResults();
|
|
135
135
|
} else {
|
|
136
|
-
unmanagedStopSpin?.error(`Could not stop
|
|
136
|
+
unmanagedStopSpin?.error(`Could not stop AiWorker on port ${options.port}`);
|
|
137
137
|
jsonResults.push({ port: options.port, runtime: 'unmanaged', stopped: false, reason: 'stop-failed' });
|
|
138
138
|
if (isJsonMode(options)) {
|
|
139
139
|
printJson({
|
|
140
140
|
status: 'error',
|
|
141
141
|
stoppedCount: 0,
|
|
142
142
|
results: jsonResults,
|
|
143
|
-
messages: [{ level: 'error', code: 'STOP_FAILED', message: `Could not stop
|
|
143
|
+
messages: [{ level: 'error', code: 'STOP_FAILED', message: `Could not stop AiWorker on port ${options.port}.` }],
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
if (showOutput && !unmanagedStopSpin) {
|
|
147
|
-
logStatus('error', `could not stop
|
|
147
|
+
logStatus('error', `could not stop AiWorker on port ${options.port}`);
|
|
148
148
|
finish('failed');
|
|
149
149
|
}
|
|
150
150
|
printQuietStopResults();
|
|
@@ -155,9 +155,9 @@ async function stopCommand(options) {
|
|
|
155
155
|
if (explicitInstance.source === 'registry-unconfirmed') {
|
|
156
156
|
const unconfirmedStopSpin = showOutput ? createSpinner(options) : null;
|
|
157
157
|
if (showOutput && !unconfirmedStopSpin) {
|
|
158
|
-
logStatus('info', `found unconfirmed
|
|
158
|
+
logStatus('info', `found unconfirmed AiWorker pid ${explicitInstance.pid} on port ${options.port}`, 'HTTP shutdown endpoint is unreachable; stopping by PID');
|
|
159
159
|
}
|
|
160
|
-
unconfirmedStopSpin?.start(`Stopping unconfirmed
|
|
160
|
+
unconfirmedStopSpin?.start(`Stopping unconfirmed AiWorker on port ${options.port}...`);
|
|
161
161
|
const stopped = await stopInstanceProcess(explicitInstance.pid, {
|
|
162
162
|
shutdownWaitMs: 0,
|
|
163
163
|
gracefulTimeoutMs: 2500,
|
|
@@ -167,7 +167,7 @@ async function stopCommand(options) {
|
|
|
167
167
|
if (stopped || !isProcessRunning(explicitInstance.pid)) {
|
|
168
168
|
removePidFile(explicitInstance.pidFilePath);
|
|
169
169
|
removeInstanceFile(explicitInstance.instanceFilePath);
|
|
170
|
-
unconfirmedStopSpin?.stop(`Stopped
|
|
170
|
+
unconfirmedStopSpin?.stop(`Stopped AiWorker PID ${explicitInstance.pid}`);
|
|
171
171
|
jsonResults.push({ port: options.port, pid: explicitInstance.pid, runtime: 'unconfirmed', stopped: true });
|
|
172
172
|
if (isJsonMode(options)) {
|
|
173
173
|
printJson({ stoppedCount: 1, results: jsonResults });
|
|
@@ -180,14 +180,14 @@ async function stopCommand(options) {
|
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
unconfirmedStopSpin?.error(`Could not stop
|
|
183
|
+
unconfirmedStopSpin?.error(`Could not stop AiWorker PID ${explicitInstance.pid}`);
|
|
184
184
|
jsonResults.push({ port: options.port, pid: explicitInstance.pid, runtime: 'unconfirmed', stopped: false, reason: 'stop-failed' });
|
|
185
185
|
if (isJsonMode(options)) {
|
|
186
186
|
printJson({
|
|
187
187
|
status: 'error',
|
|
188
188
|
stoppedCount: 0,
|
|
189
189
|
results: jsonResults,
|
|
190
|
-
messages: [{ level: 'error', code: 'STOP_FAILED', message: `Could not stop
|
|
190
|
+
messages: [{ level: 'error', code: 'STOP_FAILED', message: `Could not stop AiWorker PID ${explicitInstance.pid}.` }],
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
if (showOutput && !unconfirmedStopSpin) {
|
|
@@ -202,7 +202,7 @@ async function stopCommand(options) {
|
|
|
202
202
|
printJson({ stoppedCount: 0, results: jsonResults });
|
|
203
203
|
}
|
|
204
204
|
if (showOutput) {
|
|
205
|
-
logStatus('info', 'No running
|
|
205
|
+
logStatus('info', 'No running AiWorker instances found');
|
|
206
206
|
finish('nothing to stop');
|
|
207
207
|
}
|
|
208
208
|
printQuietStopResults();
|
|
@@ -214,7 +214,7 @@ async function stopCommand(options) {
|
|
|
214
214
|
if (showOutput && !stopSpin) {
|
|
215
215
|
logStatus('info', `stopping port ${instance.port} (PID: ${instance.pid})`);
|
|
216
216
|
}
|
|
217
|
-
stopSpin?.start(`Stopping
|
|
217
|
+
stopSpin?.start(`Stopping AiWorker on port ${instance.port}...`);
|
|
218
218
|
try {
|
|
219
219
|
const requested = await requestServerShutdown(instance.port, instance.host || options.host);
|
|
220
220
|
const stopped = await stopInstanceProcess(instance.pid, {
|
|
@@ -227,13 +227,13 @@ async function stopCommand(options) {
|
|
|
227
227
|
}
|
|
228
228
|
removePidFile(instance.pidFilePath);
|
|
229
229
|
removeInstanceFile(instance.instanceFilePath);
|
|
230
|
-
stopSpin?.stop(`Stopped
|
|
230
|
+
stopSpin?.stop(`Stopped AiWorker on port ${instance.port}`);
|
|
231
231
|
jsonResults.push({ port: instance.port, pid: instance.pid, stopped: true });
|
|
232
232
|
if (showOutput && !stopSpin) {
|
|
233
233
|
logStatus('success', `stopped port ${instance.port}`);
|
|
234
234
|
}
|
|
235
235
|
} catch (error) {
|
|
236
|
-
stopSpin?.error(`Failed to stop
|
|
236
|
+
stopSpin?.error(`Failed to stop AiWorker on port ${instance.port}`);
|
|
237
237
|
jsonResults.push({ port: instance.port, pid: instance.pid, stopped: false, reason: error instanceof Error ? error.message : String(error) });
|
|
238
238
|
if (showOutput) {
|
|
239
239
|
logStatus('error', `error stopping port ${instance.port}`, error.message);
|
|
@@ -270,7 +270,7 @@ async function restartCommand(options, serveCommand) {
|
|
|
270
270
|
const restarted = [];
|
|
271
271
|
|
|
272
272
|
if (showOutput) {
|
|
273
|
-
clackIntro('
|
|
273
|
+
clackIntro('AiWorker Restart');
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
let runningInstances = await discoverLifecycleInstances(options);
|
|
@@ -279,7 +279,7 @@ async function restartCommand(options, serveCommand) {
|
|
|
279
279
|
printJson({ restartedCount: 0, results: restarted });
|
|
280
280
|
}
|
|
281
281
|
if (showOutput) {
|
|
282
|
-
logStatus('info', 'No running
|
|
282
|
+
logStatus('info', 'No running AiWorker instances to restart');
|
|
283
283
|
clackOutro('nothing to restart');
|
|
284
284
|
} else if (isQuietMode(options)) {
|
|
285
285
|
process.stdout.write('restarted 0\n');
|
|
@@ -289,7 +289,7 @@ async function restartCommand(options, serveCommand) {
|
|
|
289
289
|
|
|
290
290
|
for (const instance of runningInstances) {
|
|
291
291
|
if (instance.runtime === 'desktop') {
|
|
292
|
-
const message = `Port ${instance.port} is managed by
|
|
292
|
+
const message = `Port ${instance.port} is managed by AiWorker Desktop and cannot be restarted with this command.`;
|
|
293
293
|
if (isJsonMode(options)) {
|
|
294
294
|
printJson({
|
|
295
295
|
status: 'warning',
|
|
@@ -300,7 +300,7 @@ async function restartCommand(options, serveCommand) {
|
|
|
300
300
|
return;
|
|
301
301
|
}
|
|
302
302
|
if (showOutput) {
|
|
303
|
-
logStatus('warning', `port ${instance.port} is managed by
|
|
303
|
+
logStatus('warning', `port ${instance.port} is managed by AiWorker Desktop`, 'cannot be restarted with this command');
|
|
304
304
|
clackOutro('no changes applied');
|
|
305
305
|
} else if (isQuietMode(options)) {
|
|
306
306
|
process.stdout.write('restarted 0\n');
|
|
@@ -321,7 +321,7 @@ async function restartCommand(options, serveCommand) {
|
|
|
321
321
|
if (showOutput && !restartSpin) {
|
|
322
322
|
logStatus('info', `restarting port ${instance.port}`, `mode: ${launchMode}`);
|
|
323
323
|
}
|
|
324
|
-
restartSpin?.start(`Restarting
|
|
324
|
+
restartSpin?.start(`Restarting AiWorker on port ${instance.port}...`);
|
|
325
325
|
try {
|
|
326
326
|
await runStop({
|
|
327
327
|
explicitPort: true,
|
|
@@ -358,13 +358,13 @@ async function restartCommand(options, serveCommand) {
|
|
|
358
358
|
suppressQuietOutput: true,
|
|
359
359
|
});
|
|
360
360
|
restarted.push({ fromPort: instance.port, toPort: restartedPort, launchMode, ok: true });
|
|
361
|
-
restartSpin?.stop(`Restarted
|
|
361
|
+
restartSpin?.stop(`Restarted AiWorker on port ${restartedPort}`);
|
|
362
362
|
if (showOutput && !restartSpin) {
|
|
363
363
|
logStatus('success', `port ${restartedPort} restarted`, `mode: ${launchMode}`);
|
|
364
364
|
}
|
|
365
365
|
} catch (error) {
|
|
366
366
|
const message = error instanceof Error ? error.message : String(error);
|
|
367
|
-
restartSpin?.error(`Failed to restart
|
|
367
|
+
restartSpin?.error(`Failed to restart AiWorker on port ${instance.port}`);
|
|
368
368
|
if (showOutput && !restartSpin) {
|
|
369
369
|
logStatus('error', `failed to restart port ${instance.port}`, message);
|
|
370
370
|
}
|
package/bin/lib/commands-logs.js
CHANGED
|
@@ -19,18 +19,18 @@ async function logsCommand(options) {
|
|
|
19
19
|
if (options.all) {
|
|
20
20
|
targets = running;
|
|
21
21
|
if (targets.length === 0) {
|
|
22
|
-
throw new Error('No running
|
|
22
|
+
throw new Error('No running AiWorker instance found.');
|
|
23
23
|
}
|
|
24
24
|
} else if (options.explicitPort) {
|
|
25
25
|
const found = running.find((entry) => entry.port === options.port);
|
|
26
26
|
if (!found) {
|
|
27
|
-
throw new Error(`No running
|
|
27
|
+
throw new Error(`No running AiWorker instance found on port ${options.port}.`);
|
|
28
28
|
}
|
|
29
29
|
targets = [found];
|
|
30
30
|
} else {
|
|
31
31
|
const latest = getLatestInstance(running);
|
|
32
32
|
if (!latest) {
|
|
33
|
-
throw new Error('No running
|
|
33
|
+
throw new Error('No running AiWorker instance found.');
|
|
34
34
|
}
|
|
35
35
|
targets = [latest];
|
|
36
36
|
if (shouldRenderHumanOutput(options)) {
|
|
@@ -40,7 +40,7 @@ async function logsCommand(options) {
|
|
|
40
40
|
|
|
41
41
|
if (isJsonMode(options)) {
|
|
42
42
|
if (options.follow) {
|
|
43
|
-
throw new Error('`
|
|
43
|
+
throw new Error('`aiworker logs --json` requires `--no-follow` for deterministic JSON output.');
|
|
44
44
|
}
|
|
45
45
|
const entries = targets.map((target) => {
|
|
46
46
|
const logPath = getLogFilePath(target.port);
|
|
@@ -55,7 +55,7 @@ async function logsCommand(options) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
if (showFrames) {
|
|
58
|
-
clackIntro('
|
|
58
|
+
clackIntro('AiWorker Logs');
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
for (const target of targets) {
|
|
@@ -43,7 +43,7 @@ const formatModelsOutput = (settings = {}) => {
|
|
|
43
43
|
|
|
44
44
|
async function modelsCommand(options = {}, action = 'show') {
|
|
45
45
|
if (action === 'help') {
|
|
46
|
-
process.stdout.write(`
|
|
46
|
+
process.stdout.write(`AiWorker Models Commands\n\nUSAGE:\n aiworker models [OPTIONS]\n\nOUTPUT OPTIONS:\n -p, --port <port> AiWorker server port\n --json Output machine-readable JSON\n`);
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
if (action !== 'show') {
|
|
@@ -7,7 +7,7 @@ const formatProjectLine = (project) => `- \`${project.label}\` — \`${project.i
|
|
|
7
7
|
|
|
8
8
|
async function projectsCommand(options = {}, action = 'list') {
|
|
9
9
|
if (action === 'help') {
|
|
10
|
-
process.stdout.write(`
|
|
10
|
+
process.stdout.write(`AiWorker Projects Commands\n\nUSAGE:\n aiworker projects [OPTIONS]\n\nOUTPUT OPTIONS:\n -p, --port <port> AiWorker server port\n --json Output machine-readable JSON\n`);
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
if (action !== 'list') {
|
|
@@ -70,7 +70,7 @@ const outputTasks = (options, tasks) => {
|
|
|
70
70
|
|
|
71
71
|
async function scheduleCommand(options = {}, action = 'help') {
|
|
72
72
|
if (action === 'help') {
|
|
73
|
-
process.stdout.write(`
|
|
73
|
+
process.stdout.write(`AiWorker Schedule Commands\n\nUSAGE:\n aiworker schedule status [OPTIONS]\n aiworker schedule list (--project <projectId> | --dir <path>) [OPTIONS]\n aiworker schedule create (--project <projectId> | --dir <path>) --name <name> --prompt <prompt> --model <provider/model> (--daily <HH:mm> | --weekly <0,1,2> --time <HH:mm> | --once <YYYY-MM-DD> --time <HH:mm> | --cron <expr>) [OPTIONS]\n aiworker schedule run (--project <projectId> | --dir <path>) --task <taskId> [OPTIONS]\n aiworker schedule delete (--project <projectId> | --dir <path>) --task <taskId> [OPTIONS]\n aiworker schedule enable (--project <projectId> | --dir <path>) --task <taskId> [OPTIONS]\n aiworker schedule disable (--project <projectId> | --dir <path>) --task <taskId> [OPTIONS]\n\nOPTIONS:\n --project <projectId> Project id from aiworker projects\n --dir <path> Resolve project by directory\n -p, --port <port> AiWorker server port\n --timezone <zone> IANA timezone for created tasks\n --agent <id> Agent to use when running task\n --variant <id> Model variant to use when running task\n --goal Continue the scheduled session toward a goal\n --goal-token-budget <n> Goal token budget (1000-100000000; requires --goal)\n --disabled Create task disabled\n --json Output machine-readable JSON\n -q, --quiet Print concise output\n`);
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
|