gsd-pi 2.73.0 → 2.73.1-dev.06e4302
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/dist/cli-web-branch.d.ts +4 -3
- package/dist/cli-web-branch.js +10 -7
- package/dist/cli.js +99 -253
- package/dist/help-text.js +1 -1
- package/dist/logo.d.ts +1 -1
- package/dist/logo.js +1 -1
- package/dist/onboarding.js +59 -53
- package/dist/resource-loader.js +2 -2
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +68 -4
- package/dist/resources/extensions/gsd/auto/phases.js +15 -9
- package/dist/resources/extensions/gsd/auto-dispatch.js +16 -6
- package/dist/resources/extensions/gsd/auto-model-selection.js +54 -11
- package/dist/resources/extensions/gsd/auto-post-unit.js +41 -1
- package/dist/resources/extensions/gsd/auto-prompts.js +9 -6
- package/dist/resources/extensions/gsd/auto-start.js +23 -6
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +13 -0
- package/dist/resources/extensions/gsd/auto-verification.js +88 -3
- package/dist/resources/extensions/gsd/auto.js +34 -9
- package/dist/resources/extensions/gsd/bootstrap/crash-log.js +31 -0
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +18 -7
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +6 -1
- package/dist/resources/extensions/gsd/commands-handlers.js +8 -2
- package/dist/resources/extensions/gsd/crash-recovery.js +51 -0
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +1 -1
- package/dist/resources/extensions/gsd/gsd-db.js +36 -2
- package/dist/resources/extensions/gsd/milestone-actions.js +19 -1
- package/dist/resources/extensions/gsd/notification-widget.js +2 -2
- package/dist/resources/extensions/gsd/preferences-models.js +43 -0
- package/dist/resources/extensions/gsd/preferences-types.js +1 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +22 -0
- package/dist/resources/extensions/gsd/state.js +61 -14
- package/dist/startup-model-validation.js +8 -5
- package/dist/update-check.d.ts +1 -0
- package/dist/update-check.js +13 -5
- package/dist/update-cmd.js +4 -3
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +12 -12
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/required-server-files.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +12 -12
- package/dist/web/standalone/.next/server/chunks/63.js +3 -3
- package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
- package/dist/web/standalone/.next/server/middleware.js +2 -2
- package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-f1e30ab6bb269149.js +1 -0
- package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
- package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
- package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
- package/dist/web/standalone/server.js +1 -1
- package/package.json +1 -2
- package/packages/pi-ai/dist/index.d.ts +1 -0
- package/packages/pi-ai/dist/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/index.js +1 -0
- package/packages/pi-ai/dist/index.js.map +1 -1
- package/packages/pi-ai/dist/utils/overflow.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/overflow.js +12 -0
- package/packages/pi-ai/dist/utils/overflow.js.map +1 -1
- package/packages/pi-ai/dist/utils/tests/overflow.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/tests/overflow.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/tests/overflow.test.js +50 -0
- package/packages/pi-ai/dist/utils/tests/overflow.test.js.map +1 -0
- package/packages/pi-ai/src/index.ts +4 -0
- package/packages/pi-ai/src/utils/overflow.ts +14 -1
- package/packages/pi-ai/src/utils/tests/overflow.test.ts +58 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.js +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js +27 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +313 -8
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.js +5 -5
- package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.js +45 -0
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js +25 -68
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts +12 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +61 -28
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts +2 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js +9 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.js +52 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +116 -25
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +63 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +11 -3
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/auth-storage.test.ts +38 -0
- package/packages/pi-coding-agent/src/core/auth-storage.ts +1 -1
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +355 -8
- package/packages/pi-coding-agent/src/core/compaction/utils.ts +5 -5
- package/packages/pi-coding-agent/src/core/compaction-utils.test.ts +50 -0
- package/packages/pi-coding-agent/src/core/model-resolver.ts +26 -70
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +74 -32
- package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.test.ts +73 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.ts +9 -3
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +71 -0
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +136 -30
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +11 -3
- package/packages/pi-tui/dist/__tests__/tui.test.js +60 -1
- package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
- package/packages/pi-tui/dist/tui.d.ts +8 -0
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +32 -3
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/src/__tests__/tui.test.ts +76 -1
- package/packages/pi-tui/src/tui.ts +31 -3
- package/pkg/package.json +1 -1
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +107 -5
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +111 -2
- package/src/resources/extensions/gsd/auto/phases.ts +22 -9
- package/src/resources/extensions/gsd/auto-dispatch.ts +15 -4
- package/src/resources/extensions/gsd/auto-model-selection.ts +85 -11
- package/src/resources/extensions/gsd/auto-post-unit.ts +47 -1
- package/src/resources/extensions/gsd/auto-prompts.ts +9 -3
- package/src/resources/extensions/gsd/auto-start.ts +30 -6
- package/src/resources/extensions/gsd/auto-timeout-recovery.ts +17 -0
- package/src/resources/extensions/gsd/auto-verification.ts +98 -3
- package/src/resources/extensions/gsd/auto.ts +36 -14
- package/src/resources/extensions/gsd/bootstrap/crash-log.ts +32 -0
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +19 -7
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +8 -1
- package/src/resources/extensions/gsd/commands-handlers.ts +8 -2
- package/src/resources/extensions/gsd/crash-recovery.ts +59 -0
- package/src/resources/extensions/gsd/docs/preferences-reference.md +1 -1
- package/src/resources/extensions/gsd/gsd-db.ts +52 -2
- package/src/resources/extensions/gsd/milestone-actions.ts +19 -1
- package/src/resources/extensions/gsd/notification-widget.ts +2 -2
- package/src/resources/extensions/gsd/preferences-models.ts +41 -0
- package/src/resources/extensions/gsd/preferences-types.ts +12 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +23 -0
- package/src/resources/extensions/gsd/state.ts +71 -15
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/auto-post-unit-step-message.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +51 -2
- package/src/resources/extensions/gsd/tests/complete-milestone-false-merge.test.ts +142 -0
- package/src/resources/extensions/gsd/tests/completed-at-reconcile.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/crash-handler-secondary.test.ts +235 -0
- package/src/resources/extensions/gsd/tests/derive-state-crossval.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/derive-state-helpers.test.ts +68 -8
- package/src/resources/extensions/gsd/tests/derive-state.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +137 -1
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +59 -1
- package/src/resources/extensions/gsd/tests/integration/state-machine-edge-cases.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/model-isolation.test.ts +91 -2
- package/src/resources/extensions/gsd/tests/park-milestone.test.ts +64 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/state-machine-full-walkthrough.test.ts +5 -7
- package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +267 -0
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/validate-milestone-stuck-guard.test.ts +179 -0
- package/dist/web/standalone/.next/static/chunks/app/page-7115e62689b5fd84.js +0 -1
- package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
- /package/dist/web/standalone/.next/static/{KSZ2dcC3p4z6lOmUpPpzr → RXD20AQgB9BHSQJ07MDdd}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{KSZ2dcC3p4z6lOmUpPpzr → RXD20AQgB9BHSQJ07MDdd}/_ssgManifest.js +0 -0
package/dist/cli-web-branch.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { launchWebMode, stopWebMode, type WebModeLaunchStatus, type WebModeStopOptions, type WebModeStopResult } from './web-mode.js';
|
|
2
2
|
export interface CliFlags {
|
|
3
|
-
mode?: 'text' | 'json' | 'rpc';
|
|
3
|
+
mode?: 'text' | 'json' | 'rpc' | 'mcp';
|
|
4
4
|
print?: boolean;
|
|
5
5
|
continue?: boolean;
|
|
6
6
|
noSession?: boolean;
|
|
7
|
+
worktree?: boolean | string;
|
|
7
8
|
model?: string;
|
|
8
9
|
listModels?: string | true;
|
|
9
10
|
extensions: string[];
|
|
@@ -19,8 +20,8 @@ export interface CliFlags {
|
|
|
19
20
|
webPort?: number;
|
|
20
21
|
/** Additional allowed origins for CORS: `--allowed-origins http://192.168.1.10:8080` */
|
|
21
22
|
webAllowedOrigins?: string[];
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
/** Set by `gsd sessions` when the user picks a specific session to resume */
|
|
24
|
+
_selectedSessionPath?: string;
|
|
24
25
|
}
|
|
25
26
|
type WritableLike = Pick<typeof process.stderr, 'write'>;
|
|
26
27
|
export interface RunWebCliBranchDeps {
|
package/dist/cli-web-branch.js
CHANGED
|
@@ -10,7 +10,7 @@ export function parseCliArgs(argv) {
|
|
|
10
10
|
const arg = args[i];
|
|
11
11
|
if (arg === '--mode' && i + 1 < args.length) {
|
|
12
12
|
const mode = args[++i];
|
|
13
|
-
if (mode === 'text' || mode === 'json' || mode === 'rpc')
|
|
13
|
+
if (mode === 'text' || mode === 'json' || mode === 'rpc' || mode === 'mcp')
|
|
14
14
|
flags.mode = mode;
|
|
15
15
|
}
|
|
16
16
|
else if (arg === '--print' || arg === '-p') {
|
|
@@ -22,6 +22,15 @@ export function parseCliArgs(argv) {
|
|
|
22
22
|
else if (arg === '--no-session') {
|
|
23
23
|
flags.noSession = true;
|
|
24
24
|
}
|
|
25
|
+
else if (arg === '--worktree' || arg === '-w') {
|
|
26
|
+
// -w with no value → auto-generate name; -w <name> → use that name
|
|
27
|
+
if (i + 1 < args.length && !args[i + 1].startsWith('-')) {
|
|
28
|
+
flags.worktree = args[++i];
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
flags.worktree = true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
25
34
|
else if (arg === '--web') {
|
|
26
35
|
flags.web = true;
|
|
27
36
|
// Peek at next arg — if it looks like a path (not another flag), capture it
|
|
@@ -58,12 +67,6 @@ export function parseCliArgs(argv) {
|
|
|
58
67
|
else if (arg === '--list-models') {
|
|
59
68
|
flags.listModels = (i + 1 < args.length && !args[i + 1].startsWith('-')) ? args[++i] : true;
|
|
60
69
|
}
|
|
61
|
-
else if (arg === '--version' || arg === '-v') {
|
|
62
|
-
flags.version = true;
|
|
63
|
-
}
|
|
64
|
-
else if (arg === '--help' || arg === '-h') {
|
|
65
|
-
flags.help = true;
|
|
66
|
-
}
|
|
67
70
|
else if (!arg.startsWith('--') && !arg.startsWith('-')) {
|
|
68
71
|
flags.messages.push(arg);
|
|
69
72
|
}
|
package/dist/cli.js
CHANGED
|
@@ -5,14 +5,14 @@ import { agentDir, sessionsDir, authFilePath } from './app-paths.js';
|
|
|
5
5
|
import { initResources, buildResourceLoader, getNewerManagedResourceVersion } from './resource-loader.js';
|
|
6
6
|
import { ensureManagedTools } from './tool-bootstrap.js';
|
|
7
7
|
import { loadStoredEnvKeys } from './wizard.js';
|
|
8
|
-
import { migratePiCredentials
|
|
9
|
-
import { shouldMigrateAnthropicToClaudeCode } from './provider-migrations.js';
|
|
8
|
+
import { migratePiCredentials } from './pi-migration.js';
|
|
10
9
|
import { shouldRunOnboarding, runOnboarding } from './onboarding.js';
|
|
11
10
|
import chalk from 'chalk';
|
|
12
11
|
import { checkForUpdates } from './update-check.js';
|
|
13
12
|
import { printHelp, printSubcommandHelp } from './help-text.js';
|
|
14
13
|
import { applySecurityOverrides } from './security-overrides.js';
|
|
15
|
-
import {
|
|
14
|
+
import { validateConfiguredModel } from './startup-model-validation.js';
|
|
15
|
+
import { parseCliArgs, runWebCliBranch, migrateLegacyFlatSessions, } from './cli-web-branch.js';
|
|
16
16
|
import { stopWebMode } from './web-mode.js';
|
|
17
17
|
import { getProjectSessionsDir } from './project-sessions.js';
|
|
18
18
|
import { markStartup, printStartupTimings } from './startup-timings.js';
|
|
@@ -37,112 +37,85 @@ function exitIfManagedResourcesAreNewer(currentAgentDir) {
|
|
|
37
37
|
`[gsd] Run ${chalk.bold('npm install -g gsd-pi@latest')} or ${chalk.bold('gsd update')}, then try again.\n`);
|
|
38
38
|
process.exit(1);
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
flags.extensions.push(args[++i]);
|
|
64
|
-
}
|
|
65
|
-
else if (arg === '--append-system-prompt' && i + 1 < args.length) {
|
|
66
|
-
flags.appendSystemPrompt = args[++i];
|
|
67
|
-
}
|
|
68
|
-
else if (arg === '--tools' && i + 1 < args.length) {
|
|
69
|
-
flags.tools = args[++i].split(',');
|
|
70
|
-
}
|
|
71
|
-
else if (arg === '--list-models') {
|
|
72
|
-
flags.listModels = (i + 1 < args.length && !args[i + 1].startsWith('-')) ? args[++i] : true;
|
|
73
|
-
}
|
|
74
|
-
else if (arg === '--version' || arg === '-v') {
|
|
75
|
-
process.stdout.write((process.env.GSD_VERSION || '0.0.0') + '\n');
|
|
76
|
-
process.exit(0);
|
|
77
|
-
}
|
|
78
|
-
else if (arg === '--worktree' || arg === '-w') {
|
|
79
|
-
// -w with no value → auto-generate name; -w <name> → use that name
|
|
80
|
-
if (i + 1 < args.length && !args[i + 1].startsWith('-')) {
|
|
81
|
-
flags.worktree = args[++i];
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
flags.worktree = true;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
else if (arg === '--help' || arg === '-h') {
|
|
88
|
-
printHelp(process.env.GSD_VERSION || '0.0.0');
|
|
89
|
-
process.exit(0);
|
|
90
|
-
}
|
|
91
|
-
else if (arg === '--web') {
|
|
92
|
-
flags.web = true;
|
|
93
|
-
// Capture optional project path after --web (not a flag)
|
|
94
|
-
if (i + 1 < args.length && !args[i + 1].startsWith('-')) {
|
|
95
|
-
flags.webPath = args[++i];
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
else if (!arg.startsWith('--') && !arg.startsWith('-')) {
|
|
99
|
-
flags.messages.push(arg);
|
|
100
|
-
}
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
// Shared helpers used by both the print and interactive code paths
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
/**
|
|
44
|
+
* Print the non-interactive-mode error and exit. Called both from the early
|
|
45
|
+
* TTY gate (before heavy init) and from the interactive-mode TTY gate right
|
|
46
|
+
* before `InteractiveMode.run()`. The `includeWebHint` variant also lists
|
|
47
|
+
* `--web` and `headless` as alternatives.
|
|
48
|
+
*/
|
|
49
|
+
function printNonTtyErrorAndExit(missing, includeWebHint) {
|
|
50
|
+
const suffix = missing ? ` but ${missing} not a TTY` : '';
|
|
51
|
+
process.stderr.write(`[gsd] Error: Interactive mode requires a terminal (TTY)${suffix}.\n`);
|
|
52
|
+
process.stderr.write('[gsd] Non-interactive alternatives:\n');
|
|
53
|
+
process.stderr.write('[gsd] gsd auto Auto-mode (pipeable, no TUI)\n');
|
|
54
|
+
process.stderr.write('[gsd] gsd --print "your message" Single-shot prompt\n');
|
|
55
|
+
if (includeWebHint) {
|
|
56
|
+
process.stderr.write('[gsd] gsd --web [path] Browser-only web mode\n');
|
|
57
|
+
}
|
|
58
|
+
process.stderr.write('[gsd] gsd --mode rpc JSON-RPC over stdin/stdout\n');
|
|
59
|
+
process.stderr.write('[gsd] gsd --mode mcp MCP server over stdin/stdout\n');
|
|
60
|
+
process.stderr.write('[gsd] gsd --mode text "message" Text output mode\n');
|
|
61
|
+
if (includeWebHint) {
|
|
62
|
+
process.stderr.write('[gsd] gsd headless Auto-mode without TUI\n');
|
|
101
63
|
}
|
|
102
|
-
|
|
64
|
+
process.exit(1);
|
|
103
65
|
}
|
|
104
66
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* providers so that extension models (e.g. pi-claude-cli) are visible.
|
|
67
|
+
* Print extension load/conflict errors from an extensions result. Downgrades
|
|
68
|
+
* conflicts with built-in tools to warnings (#1347).
|
|
108
69
|
*/
|
|
109
|
-
function
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const configuredExists = configuredProvider && configuredModel &&
|
|
115
|
-
allModels.some((m) => m.provider === configuredProvider && m.id === configuredModel);
|
|
116
|
-
const configuredAvailable = configuredProvider && configuredModel &&
|
|
117
|
-
availableModels.some((m) => m.provider === configuredProvider && m.id === configuredModel);
|
|
118
|
-
if (!configuredModel || !configuredExists) {
|
|
119
|
-
// Model not configured at all, or removed from registry — pick a fallback.
|
|
120
|
-
// Only fires when the model is genuinely unknown (not just temporarily unavailable).
|
|
121
|
-
const piDefault = getPiDefaultModelAndProvider();
|
|
122
|
-
const preferred = (piDefault
|
|
123
|
-
? availableModels.find((m) => m.provider === piDefault.provider && m.id === piDefault.model)
|
|
124
|
-
: undefined) ||
|
|
125
|
-
availableModels.find((m) => m.provider === 'openai' && m.id === 'gpt-5.4') ||
|
|
126
|
-
availableModels.find((m) => m.provider === 'openai') ||
|
|
127
|
-
availableModels.find((m) => m.provider === 'anthropic' && m.id === 'claude-opus-4-6') ||
|
|
128
|
-
availableModels.find((m) => m.provider === 'anthropic' && m.id.includes('opus')) ||
|
|
129
|
-
availableModels.find((m) => m.provider === 'anthropic') ||
|
|
130
|
-
availableModels[0];
|
|
131
|
-
if (preferred) {
|
|
132
|
-
settingsManager.setDefaultModelAndProvider(preferred.provider, preferred.id);
|
|
133
|
-
}
|
|
70
|
+
function printExtensionErrors(errors) {
|
|
71
|
+
for (const err of errors) {
|
|
72
|
+
const isConflict = err.error.includes('supersedes') || err.error.includes('conflicts with');
|
|
73
|
+
const prefix = isConflict ? 'Extension conflict' : 'Extension load error';
|
|
74
|
+
process.stderr.write(`[gsd] ${prefix}: ${err.error}\n`);
|
|
134
75
|
}
|
|
135
|
-
|
|
136
|
-
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Re-apply the validated model to the session when `createAgentSession()`
|
|
79
|
+
* reports that it had to use a fallback. Prevents silently overriding the
|
|
80
|
+
* persisted model of resumed conversations (#3534).
|
|
81
|
+
*/
|
|
82
|
+
async function reapplyValidatedModelOnFallback(session, modelRegistry, settingsManager, fallbackMessage) {
|
|
83
|
+
if (!fallbackMessage)
|
|
84
|
+
return;
|
|
85
|
+
const validatedProvider = settingsManager.getDefaultProvider();
|
|
86
|
+
const validatedModelId = settingsManager.getDefaultModel();
|
|
87
|
+
if (!validatedProvider || !validatedModelId)
|
|
88
|
+
return;
|
|
89
|
+
const correctModel = modelRegistry.getAvailable()
|
|
90
|
+
.find((m) => m.provider === validatedProvider && m.id === validatedModelId);
|
|
91
|
+
if (!correctModel)
|
|
92
|
+
return;
|
|
93
|
+
try {
|
|
94
|
+
await session.setModel(correctModel);
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// Provider not ready — leave session on its current model
|
|
137
98
|
}
|
|
138
99
|
}
|
|
139
100
|
const cliFlags = parseCliArgs(process.argv);
|
|
140
101
|
const isPrintMode = cliFlags.print || cliFlags.mode !== undefined;
|
|
141
|
-
//
|
|
142
|
-
//
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
102
|
+
// `gsd [subcommand] --help` / `-h` — print help before any subcommand runs.
|
|
103
|
+
// loader.ts only catches --help/-h as the *first* arg; here we handle the
|
|
104
|
+
// case where it appears later (e.g. `gsd update --help`, `gsd --foo --help`).
|
|
105
|
+
// Prefer subcommand-specific help when the first positional is a known
|
|
106
|
+
// subcommand, otherwise fall back to general help.
|
|
107
|
+
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
108
|
+
const helpSubcommand = cliFlags.messages[0];
|
|
109
|
+
const version = process.env.GSD_VERSION || '0.0.0';
|
|
110
|
+
if (!helpSubcommand || !printSubcommandHelp(helpSubcommand, version)) {
|
|
111
|
+
printHelp(version);
|
|
112
|
+
}
|
|
113
|
+
process.exit(0);
|
|
114
|
+
}
|
|
115
|
+
// RTK bootstrap — runs once per process, memoized via a module-level promise
|
|
116
|
+
// so concurrent callers await the same initialization.
|
|
117
|
+
let rtkBootstrapPromise;
|
|
118
|
+
async function doRtkBootstrap() {
|
|
146
119
|
// RTK is opt-in via experimental.rtk preference. Default: disabled.
|
|
147
120
|
// Honor GSD_RTK_DISABLED if already explicitly set in the environment
|
|
148
121
|
// (env var takes precedence over preferences for manual override).
|
|
@@ -150,16 +123,18 @@ async function ensureRtkBootstrap() {
|
|
|
150
123
|
const prefs = loadEffectiveGSDPreferences();
|
|
151
124
|
const rtkEnabled = prefs?.preferences.experimental?.rtk === true;
|
|
152
125
|
if (!rtkEnabled) {
|
|
153
|
-
process.env[GSD_RTK_DISABLED_ENV] =
|
|
126
|
+
process.env[GSD_RTK_DISABLED_ENV] = '1';
|
|
154
127
|
}
|
|
155
128
|
}
|
|
156
129
|
const rtkStatus = await bootstrapRtk();
|
|
157
|
-
ensureRtkBootstrap._done = true;
|
|
158
130
|
markStartup('bootstrapRtk');
|
|
159
131
|
if (!rtkStatus.available && rtkStatus.supported && rtkStatus.enabled && rtkStatus.reason) {
|
|
160
132
|
process.stderr.write(`[gsd] Warning: RTK unavailable — continuing without shell-command compression (${rtkStatus.reason}).\n`);
|
|
161
133
|
}
|
|
162
134
|
}
|
|
135
|
+
function ensureRtkBootstrap() {
|
|
136
|
+
return (rtkBootstrapPromise ??= doRtkBootstrap());
|
|
137
|
+
}
|
|
163
138
|
// `gsd update` — update to the latest version via npm
|
|
164
139
|
if (cliFlags.messages[0] === 'update') {
|
|
165
140
|
const { runUpdate } = await import('./update-cmd.js');
|
|
@@ -171,21 +146,7 @@ exitIfManagedResourcesAreNewer(agentDir);
|
|
|
171
146
|
// handles that prevent process.exit() from completing promptly.
|
|
172
147
|
const hasSubcommand = cliFlags.messages.length > 0;
|
|
173
148
|
if (!process.stdin.isTTY && !isPrintMode && !hasSubcommand && !cliFlags.listModels && !cliFlags.web) {
|
|
174
|
-
|
|
175
|
-
process.stderr.write('[gsd] Non-interactive alternatives:\n');
|
|
176
|
-
process.stderr.write('[gsd] gsd auto Auto-mode (pipeable, no TUI)\n');
|
|
177
|
-
process.stderr.write('[gsd] gsd --print "your message" Single-shot prompt\n');
|
|
178
|
-
process.stderr.write('[gsd] gsd --mode rpc JSON-RPC over stdin/stdout\n');
|
|
179
|
-
process.stderr.write('[gsd] gsd --mode mcp MCP server over stdin/stdout\n');
|
|
180
|
-
process.stderr.write('[gsd] gsd --mode text "message" Text output mode\n');
|
|
181
|
-
process.exit(1);
|
|
182
|
-
}
|
|
183
|
-
// `gsd <subcommand> --help` — show subcommand-specific help
|
|
184
|
-
const subcommand = cliFlags.messages[0];
|
|
185
|
-
if (subcommand && process.argv.includes('--help')) {
|
|
186
|
-
if (printSubcommandHelp(subcommand, process.env.GSD_VERSION || '0.0.0')) {
|
|
187
|
-
process.exit(0);
|
|
188
|
-
}
|
|
149
|
+
printNonTtyErrorAndExit(undefined, false);
|
|
189
150
|
}
|
|
190
151
|
const packageCommand = await runPackageCommand({
|
|
191
152
|
appName: 'gsd',
|
|
@@ -208,8 +169,7 @@ if (cliFlags.messages[0] === 'config') {
|
|
|
208
169
|
}
|
|
209
170
|
// `gsd web stop [path|all]` — stop web server before anything else
|
|
210
171
|
if (cliFlags.messages[0] === 'web' && cliFlags.messages[1] === 'stop') {
|
|
211
|
-
const
|
|
212
|
-
const webBranch = await runWebCliBranch(webFlags, {
|
|
172
|
+
const webBranch = await runWebCliBranch(cliFlags, {
|
|
213
173
|
stopWebMode,
|
|
214
174
|
stderr: process.stderr,
|
|
215
175
|
baseSessionsDir: sessionsDir,
|
|
@@ -222,8 +182,7 @@ if (cliFlags.messages[0] === 'web' && cliFlags.messages[1] === 'stop') {
|
|
|
222
182
|
// `gsd --web [path]` or `gsd web [start] [path]` — launch browser-only web mode
|
|
223
183
|
if (cliFlags.web || (cliFlags.messages[0] === 'web' && cliFlags.messages[1] !== 'stop')) {
|
|
224
184
|
await ensureRtkBootstrap();
|
|
225
|
-
const
|
|
226
|
-
const webBranch = await runWebCliBranch(webFlags, {
|
|
185
|
+
const webBranch = await runWebCliBranch(cliFlags, {
|
|
227
186
|
stderr: process.stderr,
|
|
228
187
|
baseSessionsDir: sessionsDir,
|
|
229
188
|
agentDir,
|
|
@@ -298,21 +257,23 @@ if (cliFlags.messages[0] === 'headless') {
|
|
|
298
257
|
await runHeadless(parseHeadlessArgs(process.argv));
|
|
299
258
|
process.exit(0);
|
|
300
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* Run a headless command by invoking the headless entrypoint with a synthetic
|
|
262
|
+
* argv. Shared by the `auto` shorthand (#2732) and the auto-piped-stdout
|
|
263
|
+
* redirect so they use the same bootstrap + dynamic-import dance.
|
|
264
|
+
*/
|
|
265
|
+
async function runHeadlessFromAuto(headlessArgs) {
|
|
266
|
+
await ensureRtkBootstrap();
|
|
267
|
+
const { runHeadless, parseHeadlessArgs } = await import('./headless.js');
|
|
268
|
+
const argv = [process.argv[0], process.argv[1], 'headless', ...headlessArgs];
|
|
269
|
+
await runHeadless(parseHeadlessArgs(argv));
|
|
270
|
+
process.exit(0);
|
|
271
|
+
}
|
|
301
272
|
// `gsd auto [args...]` — shorthand for `gsd headless auto [args...]` (#2732)
|
|
302
273
|
// Without this, `gsd auto` falls through to the interactive TUI which hangs
|
|
303
274
|
// when stdin/stdout are piped (non-TTY environments).
|
|
304
275
|
if (cliFlags.messages[0] === 'auto') {
|
|
305
|
-
await
|
|
306
|
-
const { runHeadless, parseHeadlessArgs } = await import('./headless.js');
|
|
307
|
-
// Rewrite argv so parseHeadlessArgs sees: [node, gsd, headless, auto, ...rest]
|
|
308
|
-
const rewrittenArgv = [
|
|
309
|
-
process.argv[0],
|
|
310
|
-
process.argv[1],
|
|
311
|
-
'headless',
|
|
312
|
-
...cliFlags.messages, // ['auto', ...extra args]
|
|
313
|
-
];
|
|
314
|
-
await runHeadless(parseHeadlessArgs(rewrittenArgv));
|
|
315
|
-
process.exit(0);
|
|
276
|
+
await runHeadlessFromAuto(cliFlags.messages);
|
|
316
277
|
}
|
|
317
278
|
// Pi's tool bootstrap can mis-detect already-installed fd/rg on some systems
|
|
318
279
|
// because spawnSync(..., ["--version"]) returns EPERM despite a zero exit code.
|
|
@@ -455,64 +416,12 @@ if (isPrintMode) {
|
|
|
455
416
|
isClaudeCodeReady: () => modelRegistry.isProviderRequestReady('claude-code'),
|
|
456
417
|
});
|
|
457
418
|
markStartup('createAgentSession');
|
|
458
|
-
// Migrate anthropic OAuth users to claude-code provider when CLI is available (#3772).
|
|
459
|
-
// Anthropic blocks third-party apps from using subscription quotas — routing through
|
|
460
|
-
// the local claude CLI binary is TOS-compliant.
|
|
461
|
-
if (shouldMigrateAnthropicToClaudeCode({
|
|
462
|
-
authStorage,
|
|
463
|
-
isClaudeCodeReady: modelRegistry.isProviderRequestReady('claude-code'),
|
|
464
|
-
defaultProvider: settingsManager.getDefaultProvider(),
|
|
465
|
-
})) {
|
|
466
|
-
const currentModelId = settingsManager.getDefaultModel();
|
|
467
|
-
if (currentModelId) {
|
|
468
|
-
const ccModel = modelRegistry.find('claude-code', currentModelId);
|
|
469
|
-
if (ccModel) {
|
|
470
|
-
try {
|
|
471
|
-
await session.setModel(ccModel);
|
|
472
|
-
// Only persist after successful session switch to avoid desync
|
|
473
|
-
settingsManager.setDefaultModelAndProvider('claude-code', currentModelId);
|
|
474
|
-
}
|
|
475
|
-
catch {
|
|
476
|
-
// claude-code provider not ready — leave both session and settings unchanged
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
419
|
// Validate configured model AFTER extensions have registered their models (#2626).
|
|
482
420
|
// Before this, extension-provided models (e.g. claude-code/*) were not yet in the
|
|
483
421
|
// registry, causing the user's valid choice to be silently overwritten.
|
|
484
422
|
validateConfiguredModel(modelRegistry, settingsManager);
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
// overriding the persisted model of resumed conversations (#3534).
|
|
488
|
-
if (modelFallbackMessage) {
|
|
489
|
-
const validatedProvider = settingsManager.getDefaultProvider();
|
|
490
|
-
const validatedModelId = settingsManager.getDefaultModel();
|
|
491
|
-
if (validatedProvider && validatedModelId) {
|
|
492
|
-
const correctModel = modelRegistry.getAvailable()
|
|
493
|
-
.find((m) => m.provider === validatedProvider && m.id === validatedModelId);
|
|
494
|
-
if (correctModel) {
|
|
495
|
-
try {
|
|
496
|
-
await session.setModel(correctModel);
|
|
497
|
-
}
|
|
498
|
-
catch {
|
|
499
|
-
// Provider not ready — leave session on its current model
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
if (extensionsResult.errors.length > 0) {
|
|
505
|
-
for (const err of extensionsResult.errors) {
|
|
506
|
-
// Downgrade conflicts with built-in tools to warnings (#1347)
|
|
507
|
-
const isConflict = err.error.includes("supersedes") || err.error.includes("conflicts with");
|
|
508
|
-
const prefix = isConflict ? "Extension conflict" : "Extension load error";
|
|
509
|
-
process.stderr.write(`[gsd] ${prefix}: ${err.error}\n`);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
// Validate configured model now that extension providers are registered.
|
|
513
|
-
// Must run after createAgentSession() which flushes pendingProviderRegistrations
|
|
514
|
-
// so extension models (e.g. pi-claude-cli) are visible in the registry.
|
|
515
|
-
validateConfiguredModel(modelRegistry, settingsManager);
|
|
423
|
+
await reapplyValidatedModelOnFallback(session, modelRegistry, settingsManager, modelFallbackMessage);
|
|
424
|
+
printExtensionErrors(extensionsResult.errors);
|
|
516
425
|
// Apply --model override if specified
|
|
517
426
|
if (cliFlags.model) {
|
|
518
427
|
const available = modelRegistry.getAvailable();
|
|
@@ -603,11 +512,8 @@ if (!cliFlags.worktree && !isPrintMode) {
|
|
|
603
512
|
// which handles non-interactive output gracefully.
|
|
604
513
|
// ---------------------------------------------------------------------------
|
|
605
514
|
if (cliFlags.messages[0] === 'auto' && !process.stdout.isTTY) {
|
|
606
|
-
await ensureRtkBootstrap();
|
|
607
|
-
const { runHeadless, parseHeadlessArgs } = await import('./headless.js');
|
|
608
515
|
process.stderr.write('[gsd] stdout is not a terminal — running auto-mode in headless mode.\n');
|
|
609
|
-
await
|
|
610
|
-
process.exit(0);
|
|
516
|
+
await runHeadlessFromAuto(cliFlags.messages.slice(1));
|
|
611
517
|
}
|
|
612
518
|
// ---------------------------------------------------------------------------
|
|
613
519
|
// Interactive mode — normal TTY session
|
|
@@ -647,63 +553,12 @@ const { session, extensionsResult, modelFallbackMessage: interactiveFallbackMsg
|
|
|
647
553
|
isClaudeCodeReady: () => modelRegistry.isProviderRequestReady('claude-code'),
|
|
648
554
|
});
|
|
649
555
|
markStartup('createAgentSession');
|
|
650
|
-
// Migrate anthropic OAuth users to claude-code provider when CLI is available (#3772).
|
|
651
|
-
// Anthropic blocks third-party apps from using subscription quotas — routing through
|
|
652
|
-
// the local claude CLI binary is TOS-compliant.
|
|
653
|
-
if (shouldMigrateAnthropicToClaudeCode({
|
|
654
|
-
authStorage,
|
|
655
|
-
isClaudeCodeReady: modelRegistry.isProviderRequestReady('claude-code'),
|
|
656
|
-
defaultProvider: settingsManager.getDefaultProvider(),
|
|
657
|
-
})) {
|
|
658
|
-
const currentModelId = settingsManager.getDefaultModel();
|
|
659
|
-
if (currentModelId) {
|
|
660
|
-
const ccModel = modelRegistry.find('claude-code', currentModelId);
|
|
661
|
-
if (ccModel) {
|
|
662
|
-
try {
|
|
663
|
-
await session.setModel(ccModel);
|
|
664
|
-
// Only persist after successful session switch to avoid desync
|
|
665
|
-
settingsManager.setDefaultModelAndProvider('claude-code', currentModelId);
|
|
666
|
-
}
|
|
667
|
-
catch {
|
|
668
|
-
// claude-code provider not ready — leave both session and settings unchanged
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
556
|
// Validate configured model AFTER extensions have registered their models (#2626).
|
|
674
557
|
// Before this, extension-provided models (e.g. claude-code/*) were not yet in the
|
|
675
558
|
// registry, causing the user's valid choice to be silently overwritten.
|
|
676
559
|
validateConfiguredModel(modelRegistry, settingsManager);
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
// overriding the persisted model of resumed conversations (#3534).
|
|
680
|
-
if (interactiveFallbackMsg) {
|
|
681
|
-
const validatedProvider = settingsManager.getDefaultProvider();
|
|
682
|
-
const validatedModelId = settingsManager.getDefaultModel();
|
|
683
|
-
if (validatedProvider && validatedModelId) {
|
|
684
|
-
const correctModel = modelRegistry.getAvailable()
|
|
685
|
-
.find((m) => m.provider === validatedProvider && m.id === validatedModelId);
|
|
686
|
-
if (correctModel) {
|
|
687
|
-
try {
|
|
688
|
-
await session.setModel(correctModel);
|
|
689
|
-
}
|
|
690
|
-
catch {
|
|
691
|
-
// Provider not ready — leave session on its current model
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
if (extensionsResult.errors.length > 0) {
|
|
697
|
-
for (const err of extensionsResult.errors) {
|
|
698
|
-
const isConflict = err.error.includes("supersedes") || err.error.includes("conflicts with");
|
|
699
|
-
const prefix = isConflict ? "Extension conflict" : "Extension load error";
|
|
700
|
-
process.stderr.write(`[gsd] ${prefix}: ${err.error}\n`);
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
// Validate configured model now that extension providers are registered.
|
|
704
|
-
// Must run after createAgentSession() which flushes pendingProviderRegistrations
|
|
705
|
-
// so extension models (e.g. pi-claude-cli) are visible in the registry.
|
|
706
|
-
validateConfiguredModel(modelRegistry, settingsManager);
|
|
560
|
+
await reapplyValidatedModelOnFallback(session, modelRegistry, settingsManager, interactiveFallbackMsg);
|
|
561
|
+
printExtensionErrors(extensionsResult.errors);
|
|
707
562
|
// Restore scoped models from settings on startup.
|
|
708
563
|
// The upstream InteractiveMode reads enabledModels from settings when /scoped-models is opened,
|
|
709
564
|
// but doesn't apply them to the session at startup — so Ctrl+P cycles all models instead of
|
|
@@ -751,16 +606,7 @@ if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
|
751
606
|
: !process.stdin.isTTY
|
|
752
607
|
? 'stdin is'
|
|
753
608
|
: 'stdout is';
|
|
754
|
-
|
|
755
|
-
process.stderr.write('[gsd] Non-interactive alternatives:\n');
|
|
756
|
-
process.stderr.write('[gsd] gsd auto Auto-mode (pipeable, no TUI)\n');
|
|
757
|
-
process.stderr.write('[gsd] gsd --print "your message" Single-shot prompt\n');
|
|
758
|
-
process.stderr.write('[gsd] gsd --web [path] Browser-only web mode\n');
|
|
759
|
-
process.stderr.write('[gsd] gsd --mode rpc JSON-RPC over stdin/stdout\n');
|
|
760
|
-
process.stderr.write('[gsd] gsd --mode mcp MCP server over stdin/stdout\n');
|
|
761
|
-
process.stderr.write('[gsd] gsd --mode text "message" Text output mode\n');
|
|
762
|
-
process.stderr.write('[gsd] gsd headless Auto-mode without TUI\n');
|
|
763
|
-
process.exit(1);
|
|
609
|
+
printNonTtyErrorAndExit(missing, true);
|
|
764
610
|
}
|
|
765
611
|
// Welcome screen — shown on every fresh interactive session before TUI takes over.
|
|
766
612
|
// Skip when the first-run banner was already printed in loader.ts (prevents double banner).
|
package/dist/help-text.js
CHANGED
|
@@ -148,7 +148,7 @@ export function printHelp(version) {
|
|
|
148
148
|
process.stdout.write(' --print, -p Single-shot print mode\n');
|
|
149
149
|
process.stdout.write(' --continue, -c Resume the most recent session\n');
|
|
150
150
|
process.stdout.write(' --worktree, -w [name] Start in an isolated worktree (auto-named if omitted)\n');
|
|
151
|
-
process.stdout.write(' --model <id> Override model (e.g.
|
|
151
|
+
process.stdout.write(' --model <id> Override model (e.g. provider/model-id)\n');
|
|
152
152
|
process.stdout.write(' --no-session Disable session persistence\n');
|
|
153
153
|
process.stdout.write(' --extension <path> Load additional extension\n');
|
|
154
154
|
process.stdout.write(' --tools <a,b,c> Restrict available tools\n');
|
package/dist/logo.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const GSD_LOGO: readonly string[];
|
|
|
10
10
|
/**
|
|
11
11
|
* Render the logo block with a color function applied to each line.
|
|
12
12
|
*
|
|
13
|
-
* @param color — e.g. `(s) => `\x1b[36m${s}\x1b[0m`` or
|
|
13
|
+
* @param color — e.g. `(s) => `\x1b[36m${s}\x1b[0m`` or chalk.cyan
|
|
14
14
|
* @returns Ready-to-write string with leading/trailing newlines.
|
|
15
15
|
*/
|
|
16
16
|
export declare function renderLogo(color: (s: string) => string): string;
|
package/dist/logo.js
CHANGED
|
@@ -17,7 +17,7 @@ export const GSD_LOGO = [
|
|
|
17
17
|
/**
|
|
18
18
|
* Render the logo block with a color function applied to each line.
|
|
19
19
|
*
|
|
20
|
-
* @param color — e.g. `(s) => `\x1b[36m${s}\x1b[0m`` or
|
|
20
|
+
* @param color — e.g. `(s) => `\x1b[36m${s}\x1b[0m`` or chalk.cyan
|
|
21
21
|
* @returns Ready-to-write string with leading/trailing newlines.
|
|
22
22
|
*/
|
|
23
23
|
export function renderLogo(color) {
|