gsd-pi 2.78.1-dev.84a383f51 → 2.78.1
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 +7 -7
- package/dist/cli.js +55 -95
- package/dist/headless-query.d.ts +0 -22
- package/dist/headless-query.js +4 -24
- package/dist/headless.d.ts +0 -10
- package/dist/headless.js +1 -16
- package/dist/loader.js +10 -7
- package/dist/onboarding.d.ts +0 -10
- package/dist/onboarding.js +2 -2
- package/dist/provider-migrations.d.ts +2 -2
- package/dist/provider-migrations.js +2 -5
- package/dist/resource-loader.d.ts +2 -5
- package/dist/resource-loader.js +5 -28
- package/dist/resources/extensions/browser-tools/tests/browser-tools-integration.test.mjs +601 -0
- package/dist/resources/extensions/browser-tools/tests/browser-tools-unit.test.cjs +651 -0
- package/dist/resources/extensions/browser-tools/tests/capture-sharp-optional.test.cjs +91 -0
- package/dist/resources/extensions/gsd/auto/loop.js +0 -23
- package/dist/resources/extensions/gsd/auto/phases.js +2 -2
- package/dist/resources/extensions/gsd/auto/run-unit.js +1 -3
- package/dist/resources/extensions/gsd/auto/session.js +0 -3
- package/dist/resources/extensions/gsd/auto-recovery.js +4 -43
- package/dist/resources/extensions/gsd/auto-start.js +1 -1
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +2 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +0 -30
- package/dist/resources/extensions/gsd/auto.js +5 -14
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +2 -14
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +5 -7
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +2 -2
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +4 -5
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +31 -94
- package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +6 -11
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +8 -34
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +2 -38
- package/dist/resources/extensions/gsd/commands/catalog.js +5 -69
- package/dist/resources/extensions/gsd/commands/handlers/core.js +1 -22
- package/dist/resources/extensions/gsd/commands-mcp-status.js +1 -3
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +1 -10
- package/dist/resources/extensions/gsd/dashboard-overlay.js +1 -1
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +0 -4
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +1 -39
- package/dist/resources/extensions/gsd/error-classifier.js +1 -1
- package/dist/resources/extensions/gsd/forensics.js +2 -2
- package/dist/resources/extensions/gsd/git-service.js +5 -12
- package/dist/resources/extensions/gsd/gsd-db.js +2 -11
- package/dist/resources/extensions/gsd/guided-flow.js +23 -23
- package/dist/resources/extensions/gsd/memory-store.js +31 -66
- package/dist/resources/extensions/gsd/model-router.js +9 -114
- package/dist/resources/extensions/gsd/native-git-bridge.js +1 -7
- package/dist/resources/extensions/gsd/preferences-models.js +15 -91
- package/dist/resources/extensions/gsd/preferences-types.js +0 -2
- package/dist/resources/extensions/gsd/preferences-validation.js +0 -32
- package/dist/resources/extensions/gsd/preferences.js +3 -5
- package/dist/resources/extensions/gsd/prompt-loader.js +12 -23
- package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +3 -9
- package/dist/resources/extensions/gsd/state.js +0 -42
- package/dist/resources/extensions/gsd/templates/PREFERENCES.md +0 -1
- package/dist/resources/extensions/gsd/tests/auto-supervisor.test.mjs +53 -0
- package/dist/resources/extensions/gsd/tests/dist-redirect.mjs +112 -0
- package/dist/resources/extensions/gsd/tests/resolve-ts-hooks.mjs +23 -0
- package/dist/resources/extensions/gsd/tests/resolve-ts.mjs +5 -0
- package/dist/resources/extensions/gsd/tools/memory-tools.js +1 -18
- package/dist/resources/extensions/gsd/visualizer-overlay.js +1 -1
- package/dist/resources/extensions/gsd/watch/header-renderer.js +1 -3
- package/dist/resources/extensions/gsd/worktree-command.js +46 -26
- package/dist/resources/extensions/mcp-client/index.js +3 -6
- package/dist/resources/extensions/slash-commands/create-extension.js +22 -36
- package/dist/resources/skills/create-gsd-extension/SKILL.md +5 -9
- package/dist/resources/skills/create-gsd-extension/references/custom-commands.md +1 -1
- package/dist/resources/skills/create-gsd-extension/references/custom-rendering.md +5 -5
- package/dist/resources/skills/create-gsd-extension/references/custom-tools.md +4 -4
- package/dist/resources/skills/create-gsd-extension/references/custom-ui.md +6 -6
- package/dist/resources/skills/create-gsd-extension/references/events-reference.md +3 -3
- package/dist/resources/skills/create-gsd-extension/references/packaging-distribution.md +1 -1
- package/dist/resources/skills/create-gsd-extension/references/remote-execution-overrides.md +3 -3
- package/dist/resources/skills/create-gsd-extension/workflows/create-extension.md +12 -32
- package/dist/resources/skills/github-workflows/references/gh/tests/__init__.py +0 -0
- package/dist/resources/skills/github-workflows/references/gh/tests/test_github_project_setup.py +608 -0
- package/dist/rtk-shared.d.ts +0 -3
- package/dist/rtk-shared.js +0 -17
- package/dist/rtk.d.ts +5 -2
- package/dist/rtk.js +20 -3
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +13 -13
- package/dist/web/standalone/.next/build-manifest.json +4 -4
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +4 -44
- 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 -4
- 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 +13 -13
- 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-react-loadable-manifest.js +1 -1
- 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/server/webpack-runtime.js +1 -1
- package/dist/web/standalone/.next/static/chunks/2826.e9f5195e91f9cad2.js +11 -0
- package/dist/web/standalone/.next/static/chunks/3621.fc7480022c972438.js +20 -0
- package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-f2a7482d42a5614b.js → page-2f24283c162b6ab3.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/{layout-a16c7a7ecdf0c2cf.js → layout-9ecfd95f343793f0.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-151349214571e2b6.js +1 -0
- package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +1 -0
- package/dist/web/standalone/.next/static/chunks/webpack-2e68521d7c82f7c2.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/package.json +1 -2
- package/dist/web/standalone/server.js +1 -1
- package/package.json +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +46 -74
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/workflow-tools.test.ts +0 -26
- package/packages/mcp-server/src/workflow-tools.ts +58 -93
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +19 -48
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/types.d.ts +0 -13
- package/packages/pi-ai/dist/types.d.ts.map +1 -1
- package/packages/pi-ai/dist/types.js.map +1 -1
- package/packages/pi-ai/dist/utils/repair-tool-json.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/repair-tool-json.js +3 -24
- package/packages/pi-ai/dist/utils/repair-tool-json.js.map +1 -1
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.js +0 -26
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.js.map +1 -1
- package/packages/pi-ai/src/providers/anthropic-shared.ts +20 -52
- package/packages/pi-ai/src/types.ts +0 -13
- package/packages/pi-ai/src/utils/repair-tool-json.ts +3 -24
- package/packages/pi-ai/src/utils/tests/repair-tool-json.test.ts +0 -32
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +0 -6
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/messages.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/messages.js +0 -4
- package/packages/pi-coding-agent/dist/core/messages.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +2 -19
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts +0 -10
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +0 -18
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts +0 -13
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +16 -20
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +1 -14
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +0 -7
- package/packages/pi-coding-agent/src/core/messages.ts +0 -4
- package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +2 -32
- package/packages/pi-coding-agent/src/core/model-registry.ts +0 -21
- package/packages/pi-coding-agent/src/core/system-prompt.ts +15 -33
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +1 -17
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.ts +1 -1
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js +3 -17
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js.map +1 -1
- package/packages/pi-tui/src/__tests__/autocomplete.test.ts +3 -20
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/src/resources/extensions/gsd/auto/loop.ts +2 -24
- package/src/resources/extensions/gsd/auto/phases.ts +3 -3
- package/src/resources/extensions/gsd/auto/run-unit.ts +1 -3
- package/src/resources/extensions/gsd/auto/session.ts +0 -3
- package/src/resources/extensions/gsd/auto/types.ts +0 -1
- package/src/resources/extensions/gsd/auto-recovery.ts +8 -46
- package/src/resources/extensions/gsd/auto-start.ts +1 -1
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +4 -2
- package/src/resources/extensions/gsd/auto-worktree.ts +0 -38
- package/src/resources/extensions/gsd/auto.ts +4 -14
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +13 -15
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +7 -8
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +2 -2
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +9 -10
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +31 -102
- package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +6 -12
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +8 -39
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +11 -39
- package/src/resources/extensions/gsd/commands/catalog.ts +5 -75
- package/src/resources/extensions/gsd/commands/handlers/core.ts +1 -22
- package/src/resources/extensions/gsd/commands-mcp-status.ts +1 -3
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +1 -15
- package/src/resources/extensions/gsd/dashboard-overlay.ts +1 -1
- package/src/resources/extensions/gsd/docs/preferences-reference.md +0 -4
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +1 -39
- package/src/resources/extensions/gsd/doctor-types.ts +1 -3
- package/src/resources/extensions/gsd/error-classifier.ts +1 -1
- package/src/resources/extensions/gsd/forensics.ts +2 -2
- package/src/resources/extensions/gsd/git-service.ts +5 -13
- package/src/resources/extensions/gsd/gsd-db.ts +2 -12
- package/src/resources/extensions/gsd/guided-flow.ts +25 -25
- package/src/resources/extensions/gsd/memory-store.ts +28 -81
- package/src/resources/extensions/gsd/model-router.ts +9 -172
- package/src/resources/extensions/gsd/native-git-bridge.ts +1 -7
- package/src/resources/extensions/gsd/preferences-models.ts +15 -101
- package/src/resources/extensions/gsd/preferences-types.ts +0 -6
- package/src/resources/extensions/gsd/preferences-validation.ts +0 -35
- package/src/resources/extensions/gsd/preferences.ts +2 -16
- package/src/resources/extensions/gsd/prompt-loader.ts +12 -26
- package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +3 -9
- package/src/resources/extensions/gsd/state.ts +0 -42
- package/src/resources/extensions/gsd/templates/PREFERENCES.md +0 -1
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +1 -178
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +0 -58
- package/src/resources/extensions/gsd/tests/auto-session-encapsulation.test.ts +5 -9
- package/src/resources/extensions/gsd/tests/auto-supervisor.test.mjs +4 -21
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/budget-prediction.test.ts +211 -138
- package/src/resources/extensions/gsd/tests/complete-slice-verification-gate.test.ts +59 -142
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +4 -7
- package/src/resources/extensions/gsd/tests/completed-at-reconcile.test.ts +32 -89
- package/src/resources/extensions/gsd/tests/copy-planning-artifacts-samepath.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +23 -41
- package/src/resources/extensions/gsd/tests/db-path-worktree-symlink.test.ts +43 -3
- package/src/resources/extensions/gsd/tests/debug-logger.test.ts +3 -5
- package/src/resources/extensions/gsd/tests/discuss-empty-db-fallback.test.ts +87 -22
- package/src/resources/extensions/gsd/tests/discuss-queued-milestones.test.ts +118 -7
- package/src/resources/extensions/gsd/tests/discuss-slice-structured-questions.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/discuss-tool-scope-leak.test.ts +60 -18
- package/src/resources/extensions/gsd/tests/double-merge-guard.test.ts +76 -14
- package/src/resources/extensions/gsd/tests/empty-content-abort-loop.test.ts +75 -0
- package/src/resources/extensions/gsd/tests/false-degraded-mode-warning.test.ts +83 -22
- package/src/resources/extensions/gsd/tests/finalize-timeout-guard.test.ts +63 -1
- package/src/resources/extensions/gsd/tests/forensics-stuck-loops.test.ts +1 -26
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +0 -30
- package/src/resources/extensions/gsd/tests/headless-answers.test.ts +4 -14
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +12 -22
- package/src/resources/extensions/gsd/tests/init-prefs-routing.test.ts +1 -64
- package/src/resources/extensions/gsd/tests/integration/auto-worktree.test.ts +0 -22
- package/src/resources/extensions/gsd/tests/integration/token-savings.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +0 -128
- package/src/resources/extensions/gsd/tests/memory-tools.test.ts +1 -33
- package/src/resources/extensions/gsd/tests/model-router.test.ts +8 -169
- package/src/resources/extensions/gsd/tests/orphaned-worktree-audit.test.ts +0 -8
- package/src/resources/extensions/gsd/tests/parallel-crash-recovery.test.ts +43 -32
- package/src/resources/extensions/gsd/tests/phases-merge-error-stops-auto.test.ts +10 -4
- package/src/resources/extensions/gsd/tests/preferences.test.ts +0 -127
- package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +0 -16
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +0 -7
- package/src/resources/extensions/gsd/tests/quick-turn-end-cleanup.test.ts +6 -6
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +19 -168
- package/src/resources/extensions/gsd/tests/slice-parallel-orchestrator.test.ts +1 -7
- package/src/resources/extensions/gsd/tests/smart-entry-complete.test.ts +1 -23
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +4 -51
- package/src/resources/extensions/gsd/tests/turn-epoch.test.ts +16 -7
- package/src/resources/extensions/gsd/tests/unstructured-continue-context-injection.test.ts +7 -5
- package/src/resources/extensions/gsd/tests/uok-gitops-turn-action.test.ts +1 -15
- package/src/resources/extensions/gsd/tests/visualizer-overlay.test.ts +6 -6
- package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +0 -15
- package/src/resources/extensions/gsd/tools/memory-tools.ts +1 -17
- package/src/resources/extensions/gsd/unit-context-manifest.ts +8 -8
- package/src/resources/extensions/gsd/visualizer-overlay.ts +1 -1
- package/src/resources/extensions/gsd/watch/header-renderer.ts +1 -3
- package/src/resources/extensions/gsd/workflow-logger.ts +0 -1
- package/src/resources/extensions/gsd/worktree-command.ts +44 -31
- package/src/resources/extensions/mcp-client/index.ts +3 -6
- package/src/resources/extensions/slash-commands/create-extension.ts +24 -38
- package/src/resources/skills/create-gsd-extension/SKILL.md +5 -9
- package/src/resources/skills/create-gsd-extension/references/custom-commands.md +1 -1
- package/src/resources/skills/create-gsd-extension/references/custom-rendering.md +5 -5
- package/src/resources/skills/create-gsd-extension/references/custom-tools.md +4 -4
- package/src/resources/skills/create-gsd-extension/references/custom-ui.md +6 -6
- package/src/resources/skills/create-gsd-extension/references/events-reference.md +3 -3
- package/src/resources/skills/create-gsd-extension/references/packaging-distribution.md +1 -1
- package/src/resources/skills/create-gsd-extension/references/remote-execution-overrides.md +3 -3
- package/src/resources/skills/create-gsd-extension/templates/extension-skeleton.ts +2 -2
- package/src/resources/skills/create-gsd-extension/templates/stateful-tool-skeleton.ts +3 -3
- package/src/resources/skills/create-gsd-extension/workflows/create-extension.md +12 -32
- package/dist/cli-policy.d.ts +0 -13
- package/dist/cli-policy.js +0 -17
- package/dist/resources/.managed-resources-content-hash +0 -1
- package/dist/resources/extensions/gsd/auto-runtime-state.js +0 -31
- package/dist/resources/extensions/gsd/milestone-id-reservation.js +0 -36
- package/dist/resources/extensions/gsd/worktree-session-state.js +0 -33
- package/dist/runtime-checks.d.ts +0 -27
- package/dist/runtime-checks.js +0 -38
- package/dist/web/standalone/.next/static/chunks/2556.0527fea66e123b7f.js +0 -1
- package/dist/web/standalone/.next/static/chunks/2824.08296bc2f9654698.js +0 -1
- package/dist/web/standalone/.next/static/chunks/3026.3af53b279375f082.js +0 -1
- package/dist/web/standalone/.next/static/chunks/315.6f68ae79b67d25cf.js +0 -1
- package/dist/web/standalone/.next/static/chunks/3497.4bfc60a3b3dea717.js +0 -1
- package/dist/web/standalone/.next/static/chunks/5516.4a07c872b5c3a663.js +0 -1
- package/dist/web/standalone/.next/static/chunks/8336.31b019697882acfb.js +0 -10
- package/dist/web/standalone/.next/static/chunks/8845.c9702695e8c5a9c5.js +0 -2
- package/dist/web/standalone/.next/static/chunks/9058.01ef3a463bda88f1.js +0 -20
- package/dist/web/standalone/.next/static/chunks/9441.1081da1125d1764f.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/page-9bf2e0c50fb2ca05.js +0 -1
- package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +0 -1
- package/dist/web/standalone/.next/static/chunks/webpack-f9f0dc45e4f3ac10.js +0 -1
- package/dist/worktree-status-banner.d.ts +0 -1
- package/dist/worktree-status-banner.js +0 -132
- package/packages/mcp-server/dist/alias-telemetry.d.ts +0 -8
- package/packages/mcp-server/dist/alias-telemetry.d.ts.map +0 -1
- package/packages/mcp-server/dist/alias-telemetry.js +0 -30
- package/packages/mcp-server/dist/alias-telemetry.js.map +0 -1
- package/packages/mcp-server/src/alias-telemetry.test.ts +0 -78
- package/packages/mcp-server/src/alias-telemetry.ts +0 -30
- package/packages/pi-ai/dist/providers/anthropic-shared.cache-breakpoint.test.d.ts +0 -2
- package/packages/pi-ai/dist/providers/anthropic-shared.cache-breakpoint.test.d.ts.map +0 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.cache-breakpoint.test.js +0 -231
- package/packages/pi-ai/dist/providers/anthropic-shared.cache-breakpoint.test.js.map +0 -1
- package/packages/pi-ai/src/providers/anthropic-shared.cache-breakpoint.test.ts +0 -289
- package/packages/pi-coding-agent/dist/core/token-telemetry.d.ts +0 -37
- package/packages/pi-coding-agent/dist/core/token-telemetry.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/core/token-telemetry.js +0 -49
- package/packages/pi-coding-agent/dist/core/token-telemetry.js.map +0 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.d.ts +0 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +0 -133
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +0 -1
- package/packages/pi-coding-agent/dist/tests/system-prompt-cache-stability.test.d.ts +0 -2
- package/packages/pi-coding-agent/dist/tests/system-prompt-cache-stability.test.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/tests/system-prompt-cache-stability.test.js +0 -78
- package/packages/pi-coding-agent/dist/tests/system-prompt-cache-stability.test.js.map +0 -1
- package/packages/pi-coding-agent/dist/tests/token-telemetry.test.d.ts +0 -2
- package/packages/pi-coding-agent/dist/tests/token-telemetry.test.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/tests/token-telemetry.test.js +0 -181
- package/packages/pi-coding-agent/dist/tests/token-telemetry.test.js.map +0 -1
- package/packages/pi-coding-agent/src/core/token-telemetry.ts +0 -77
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +0 -212
- package/packages/pi-coding-agent/src/tests/system-prompt-cache-stability.test.ts +0 -102
- package/packages/pi-coding-agent/src/tests/token-telemetry.test.ts +0 -200
- package/packages/pi-tui/dist/components/__tests__/leak-fixes-runtime.test.d.ts +0 -2
- package/packages/pi-tui/dist/components/__tests__/leak-fixes-runtime.test.d.ts.map +0 -1
- package/packages/pi-tui/dist/components/__tests__/leak-fixes-runtime.test.js +0 -161
- package/packages/pi-tui/dist/components/__tests__/leak-fixes-runtime.test.js.map +0 -1
- package/packages/pi-tui/src/components/__tests__/leak-fixes-runtime.test.ts +0 -219
- package/src/resources/extensions/gsd/auto-runtime-state.ts +0 -51
- package/src/resources/extensions/gsd/milestone-id-reservation.ts +0 -47
- package/src/resources/extensions/gsd/tests/deferred-milestone-dir-4996.test.ts +0 -116
- package/src/resources/extensions/gsd/tests/doctor-orphan-milestone-4996.test.ts +0 -100
- package/src/resources/extensions/gsd/tests/ensure-preconditions-guard-4996.test.ts +0 -93
- package/src/resources/extensions/gsd/tests/find-missing-summaries-closed-runtime.test.ts +0 -47
- package/src/resources/extensions/gsd/tests/gitignore-bg-shell-runtime.test.ts +0 -63
- package/src/resources/extensions/gsd/tests/gsd-no-project-error-runtime.test.ts +0 -81
- package/src/resources/extensions/gsd/tests/help-menu-coverage.test.ts +0 -57
- package/src/resources/extensions/gsd/tests/import-done-milestones-runtime.test.ts +0 -145
- package/src/resources/extensions/gsd/tests/merge-self-branch-guard.test.ts +0 -124
- package/src/resources/extensions/gsd/tests/milestone-id-gap-reuse-4996.test.ts +0 -152
- package/src/resources/extensions/gsd/tests/native-git-infra-errors.test.ts +0 -50
- package/src/resources/extensions/gsd/tests/register-hooks-compaction-checkpoint.test.ts +0 -93
- package/src/resources/extensions/gsd/tests/system-context-message-routing.test.ts +0 -101
- package/src/resources/extensions/gsd/worktree-session-state.ts +0 -35
- package/src/resources/extensions/mcp-client/tests/global-config.test.ts +0 -91
- package/src/resources/skills/create-gsd-extension/templates/templates.test.ts +0 -58
- /package/dist/web/standalone/.next/static/{UF5VF4F1tB0miEtJS7LyX → 7afp7gq8-DVbxum83zRQ-}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{UF5VF4F1tB0miEtJS7LyX → 7afp7gq8-DVbxum83zRQ-}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -625,19 +625,19 @@ Start GSD with `gsd --debug` to enable structured JSONL diagnostic logging. Debu
|
|
|
625
625
|
|
|
626
626
|
### Token Optimization
|
|
627
627
|
|
|
628
|
-
GSD includes a coordinated token optimization system that reduces usage by 40-60% on cost-sensitive workloads. Set a single preference to coordinate model
|
|
628
|
+
GSD includes a coordinated token optimization system that reduces usage by 40-60% on cost-sensitive workloads. Set a single preference to coordinate model selection, phase skipping, and context compression:
|
|
629
629
|
|
|
630
630
|
```yaml
|
|
631
631
|
token_profile: budget # or balanced (default), quality
|
|
632
632
|
```
|
|
633
633
|
|
|
634
|
-
| Profile | Savings | What It Does
|
|
635
|
-
| ---------- | ------- |
|
|
636
|
-
| `budget` | 40-60% |
|
|
637
|
-
| `balanced` | 10-20% |
|
|
638
|
-
| `quality` | 0% |
|
|
634
|
+
| Profile | Savings | What It Does |
|
|
635
|
+
| ---------- | ------- | -------------------------------------------------------------- |
|
|
636
|
+
| `budget` | 40-60% | Cheap models, skip research/reassess, minimal context inlining |
|
|
637
|
+
| `balanced` | 10-20% | Default models, skip slice research, standard context |
|
|
638
|
+
| `quality` | 0% | All phases, all context, full model power |
|
|
639
639
|
|
|
640
|
-
**Complexity-based routing** automatically classifies tasks as simple/standard/complex and routes to appropriate
|
|
640
|
+
**Complexity-based routing** automatically classifies tasks as simple/standard/complex and routes to appropriate models. Simple docs tasks get Haiku; complex architectural work gets Opus. The classification is heuristic (sub-millisecond, no LLM calls) and learns from outcomes via a persistent routing history.
|
|
641
641
|
|
|
642
642
|
**Budget pressure** graduates model downgrading as you approach your budget ceiling — 50%, 75%, and 90% thresholds progressively shift work to cheaper tiers.
|
|
643
643
|
|
package/dist/cli.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AuthStorage, DefaultResourceLoader, ModelRegistry, runPackageCommand, SettingsManager, SessionManager, createAgentSession, InteractiveMode, runPrintMode, runRpcMode, } from '@gsd/pi-coding-agent';
|
|
1
2
|
import { readFileSync } from 'node:fs';
|
|
2
3
|
import { join } from 'node:path';
|
|
3
4
|
import { agentDir, sessionsDir, authFilePath } from './app-paths.js';
|
|
@@ -8,7 +9,6 @@ import { migratePiCredentials } from './pi-migration.js';
|
|
|
8
9
|
import { shouldRunOnboarding, runOnboarding } from './onboarding.js';
|
|
9
10
|
import chalk from 'chalk';
|
|
10
11
|
import { checkForUpdates } from './update-check.js';
|
|
11
|
-
import { shouldBypassManagedResourceMismatchGate } from './cli-policy.js';
|
|
12
12
|
import { printHelp, printSubcommandHelp } from './help-text.js';
|
|
13
13
|
import { applySecurityOverrides } from './security-overrides.js';
|
|
14
14
|
import { validateConfiguredModel } from './startup-model-validation.js';
|
|
@@ -17,11 +17,8 @@ import { buildHeadlessAutoArgs, parseCliArgs, runWebCliBranch, migrateLegacyFlat
|
|
|
17
17
|
import { stopWebMode } from './web-mode.js';
|
|
18
18
|
import { getProjectSessionsDir } from './project-sessions.js';
|
|
19
19
|
import { markStartup, printStartupTimings } from './startup-timings.js';
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
function loadPiCodingAgentModule() {
|
|
23
|
-
return (piCodingAgentModulePromise ??= import('@gsd/pi-coding-agent'));
|
|
24
|
-
}
|
|
20
|
+
import { bootstrapRtk, GSD_RTK_DISABLED_ENV } from './rtk.js';
|
|
21
|
+
import { loadEffectiveGSDPreferences } from './resources/extensions/gsd/preferences.js';
|
|
25
22
|
// ---------------------------------------------------------------------------
|
|
26
23
|
// V8 compile cache — Node 22+ can cache compiled bytecode across runs,
|
|
27
24
|
// eliminating repeated parse/compile overhead for unchanged modules.
|
|
@@ -132,53 +129,27 @@ if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
|
132
129
|
// so concurrent callers await the same initialization.
|
|
133
130
|
let rtkBootstrapPromise;
|
|
134
131
|
async function doRtkBootstrap() {
|
|
135
|
-
let rtkStatus;
|
|
136
|
-
let rtkDisabled = isTruthy(process.env[GSD_RTK_DISABLED_ENV]);
|
|
137
132
|
// RTK is opt-in via experimental.rtk preference. Default: disabled.
|
|
138
133
|
// Honor GSD_RTK_DISABLED if already explicitly set in the environment
|
|
139
134
|
// (env var takes precedence over preferences for manual override).
|
|
140
|
-
if (!
|
|
141
|
-
const { loadEffectiveGSDPreferences } = await import('./resources/extensions/gsd/preferences.js');
|
|
135
|
+
if (!process.env[GSD_RTK_DISABLED_ENV]) {
|
|
142
136
|
const prefs = loadEffectiveGSDPreferences();
|
|
143
137
|
const rtkEnabled = prefs?.preferences.experimental?.rtk === true;
|
|
144
138
|
if (!rtkEnabled) {
|
|
145
139
|
process.env[GSD_RTK_DISABLED_ENV] = '1';
|
|
146
|
-
rtkDisabled = true;
|
|
147
140
|
}
|
|
148
141
|
}
|
|
149
|
-
|
|
150
|
-
if (rtkDisabled) {
|
|
151
|
-
applyRtkProcessEnv(process.env);
|
|
152
|
-
rtkStatus = {
|
|
153
|
-
enabled: false,
|
|
154
|
-
supported: true,
|
|
155
|
-
available: false,
|
|
156
|
-
source: 'disabled',
|
|
157
|
-
reason: `${GSD_RTK_DISABLED_ENV} is set`,
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
const { bootstrapRtk } = await import('./rtk.js');
|
|
162
|
-
rtkStatus = await bootstrapRtk();
|
|
163
|
-
}
|
|
142
|
+
const rtkStatus = await bootstrapRtk();
|
|
164
143
|
markStartup('bootstrapRtk');
|
|
165
144
|
if (!rtkStatus.available && rtkStatus.supported && rtkStatus.enabled && rtkStatus.reason) {
|
|
166
145
|
process.stderr.write(`[gsd] Warning: RTK unavailable — continuing without shell-command compression (${rtkStatus.reason}).\n`);
|
|
167
146
|
}
|
|
168
147
|
}
|
|
169
148
|
function ensureRtkBootstrap() {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
return rtkBootstrapPromise;
|
|
175
|
-
}
|
|
176
|
-
// `gsd update` — update to the latest version via npm.
|
|
177
|
-
// MUST run before exitIfManagedResourcesAreNewer(): when the bundled resource
|
|
178
|
-
// manifest is from a newer version than the running binary, every other
|
|
179
|
-
// command is blocked — only `update` should bypass the gate so the user can
|
|
180
|
-
// actually upgrade out of the broken state. See shouldBypassManagedResourceMismatchGate.
|
|
181
|
-
if (shouldBypassManagedResourceMismatchGate(cliFlags.messages[0])) {
|
|
149
|
+
return (rtkBootstrapPromise ??= doRtkBootstrap());
|
|
150
|
+
}
|
|
151
|
+
// `gsd update` — update to the latest version via npm
|
|
152
|
+
if (cliFlags.messages[0] === 'update') {
|
|
182
153
|
const { runUpdate } = await import('./update-cmd.js');
|
|
183
154
|
await runUpdate();
|
|
184
155
|
process.exit(0);
|
|
@@ -275,25 +246,20 @@ const hasSubcommand = cliFlags.messages.length > 0;
|
|
|
275
246
|
if (!process.stdin.isTTY && !isPrintMode && !hasSubcommand && !cliFlags.listModels && !cliFlags.web) {
|
|
276
247
|
printNonTtyErrorAndExit(undefined, false);
|
|
277
248
|
}
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
});
|
|
290
|
-
if (packageCommand.handled) {
|
|
291
|
-
process.exit(packageCommand.exitCode);
|
|
292
|
-
}
|
|
249
|
+
const packageCommand = await runPackageCommand({
|
|
250
|
+
appName: 'gsd',
|
|
251
|
+
args: process.argv.slice(2),
|
|
252
|
+
cwd: process.cwd(),
|
|
253
|
+
agentDir,
|
|
254
|
+
stdout: process.stdout,
|
|
255
|
+
stderr: process.stderr,
|
|
256
|
+
allowedCommands: new Set(['install', 'remove', 'list']),
|
|
257
|
+
});
|
|
258
|
+
if (packageCommand.handled) {
|
|
259
|
+
process.exit(packageCommand.exitCode);
|
|
293
260
|
}
|
|
294
261
|
// `gsd config` — replay the setup wizard and exit
|
|
295
262
|
if (cliFlags.messages[0] === 'config') {
|
|
296
|
-
const { AuthStorage } = await loadPiCodingAgentModule();
|
|
297
263
|
const authStorage = AuthStorage.create(authFilePath);
|
|
298
264
|
loadStoredEnvKeys(authStorage);
|
|
299
265
|
await runOnboarding(authStorage);
|
|
@@ -325,7 +291,6 @@ if (cliFlags.web || (cliFlags.messages[0] === 'web' && cliFlags.messages[1] !==
|
|
|
325
291
|
}
|
|
326
292
|
// `gsd sessions` — list past sessions and pick one to resume
|
|
327
293
|
if (cliFlags.messages[0] === 'sessions') {
|
|
328
|
-
const { SessionManager } = await loadPiCodingAgentModule();
|
|
329
294
|
const cwd = process.cwd();
|
|
330
295
|
const safePath = `--${cwd.replace(/^[/\\]/, '').replace(/[/\\:]/g, '-')}--`;
|
|
331
296
|
const projectSessionsDir = join(sessionsDir, safePath);
|
|
@@ -415,35 +380,6 @@ function flushPendingProviderRegistrations(resourceLoader, modelRegistry) {
|
|
|
415
380
|
if (cliFlags.messages[0] === 'auto') {
|
|
416
381
|
await runHeadlessFromAuto(buildHeadlessAutoArgs(cliFlags));
|
|
417
382
|
}
|
|
418
|
-
// ---------------------------------------------------------------------------
|
|
419
|
-
// Worktree subcommand — `gsd worktree <list|merge|clean|remove>`
|
|
420
|
-
// ---------------------------------------------------------------------------
|
|
421
|
-
if (!isPrintMode &&
|
|
422
|
-
cliFlags.listModels === undefined &&
|
|
423
|
-
(cliFlags.messages[0] === 'worktree' || cliFlags.messages[0] === 'wt')) {
|
|
424
|
-
const { handleList, handleMerge, handleClean, handleRemove } = await import('./worktree-cli.js');
|
|
425
|
-
const sub = cliFlags.messages[1];
|
|
426
|
-
const subArgs = cliFlags.messages.slice(2);
|
|
427
|
-
if (!sub || sub === 'list') {
|
|
428
|
-
await handleList(process.cwd());
|
|
429
|
-
}
|
|
430
|
-
else if (sub === 'merge') {
|
|
431
|
-
await handleMerge(process.cwd(), subArgs);
|
|
432
|
-
}
|
|
433
|
-
else if (sub === 'clean') {
|
|
434
|
-
await handleClean(process.cwd());
|
|
435
|
-
}
|
|
436
|
-
else if (sub === 'remove' || sub === 'rm') {
|
|
437
|
-
await handleRemove(process.cwd(), subArgs);
|
|
438
|
-
}
|
|
439
|
-
else {
|
|
440
|
-
process.stderr.write(`Unknown worktree command: ${sub}\n`);
|
|
441
|
-
process.stderr.write('Commands: list, merge [name], clean, remove <name>\n');
|
|
442
|
-
}
|
|
443
|
-
process.exit(0);
|
|
444
|
-
}
|
|
445
|
-
const { AuthStorage, DefaultResourceLoader, ModelRegistry, SettingsManager, SessionManager, createAgentSession, InteractiveMode, runPrintMode, runRpcMode, } = await loadPiCodingAgentModule();
|
|
446
|
-
markStartup('loadPiCodingAgent');
|
|
447
383
|
// Pi's tool bootstrap can mis-detect already-installed fd/rg on some systems
|
|
448
384
|
// because spawnSync(..., ["--version"]) returns EPERM despite a zero exit code.
|
|
449
385
|
// Provision local managed binaries first so Pi sees them without probing PATH.
|
|
@@ -495,7 +431,11 @@ if (cliFlags.listModels !== undefined) {
|
|
|
495
431
|
additionalExtensionPaths: cliFlags.extensions.length > 0 ? cliFlags.extensions : undefined,
|
|
496
432
|
});
|
|
497
433
|
await listModelsLoader.reload();
|
|
498
|
-
|
|
434
|
+
const listModelsExtensions = listModelsLoader.getExtensions();
|
|
435
|
+
for (const { name, config } of listModelsExtensions.runtime.pendingProviderRegistrations) {
|
|
436
|
+
modelRegistry.registerProvider(name, config);
|
|
437
|
+
}
|
|
438
|
+
listModelsExtensions.runtime.pendingProviderRegistrations = [];
|
|
499
439
|
const models = modelRegistry.getAvailable();
|
|
500
440
|
if (models.length === 0) {
|
|
501
441
|
console.log('No models available. Set API keys in environment variables.');
|
|
@@ -543,7 +483,6 @@ if (!settingsManager.getQuietStartup()) {
|
|
|
543
483
|
if (!settingsManager.getCollapseChangelog()) {
|
|
544
484
|
settingsManager.setCollapseChangelog(true);
|
|
545
485
|
}
|
|
546
|
-
markStartup('startupSettings');
|
|
547
486
|
// ---------------------------------------------------------------------------
|
|
548
487
|
// Print / subagent mode — single-shot execution, no TTY required
|
|
549
488
|
// ---------------------------------------------------------------------------
|
|
@@ -576,7 +515,7 @@ if (isPrintMode) {
|
|
|
576
515
|
flushPendingProviderRegistrations(resourceLoader, modelRegistry);
|
|
577
516
|
migrateAnthropicDefaultToClaudeCode({
|
|
578
517
|
authStorage,
|
|
579
|
-
isClaudeCodeReady:
|
|
518
|
+
isClaudeCodeReady: modelRegistry.isProviderRequestReady('claude-code'),
|
|
580
519
|
settingsManager,
|
|
581
520
|
modelRegistry,
|
|
582
521
|
});
|
|
@@ -638,6 +577,31 @@ if (isPrintMode) {
|
|
|
638
577
|
process.exit(0);
|
|
639
578
|
}
|
|
640
579
|
// ---------------------------------------------------------------------------
|
|
580
|
+
// Worktree subcommand — `gsd worktree <list|merge|clean|remove>`
|
|
581
|
+
// ---------------------------------------------------------------------------
|
|
582
|
+
if (cliFlags.messages[0] === 'worktree' || cliFlags.messages[0] === 'wt') {
|
|
583
|
+
const { handleList, handleMerge, handleClean, handleRemove } = await import('./worktree-cli.js');
|
|
584
|
+
const sub = cliFlags.messages[1];
|
|
585
|
+
const subArgs = cliFlags.messages.slice(2);
|
|
586
|
+
if (!sub || sub === 'list') {
|
|
587
|
+
await handleList(process.cwd());
|
|
588
|
+
}
|
|
589
|
+
else if (sub === 'merge') {
|
|
590
|
+
await handleMerge(process.cwd(), subArgs);
|
|
591
|
+
}
|
|
592
|
+
else if (sub === 'clean') {
|
|
593
|
+
await handleClean(process.cwd());
|
|
594
|
+
}
|
|
595
|
+
else if (sub === 'remove' || sub === 'rm') {
|
|
596
|
+
await handleRemove(process.cwd(), subArgs);
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
process.stderr.write(`Unknown worktree command: ${sub}\n`);
|
|
600
|
+
process.stderr.write('Commands: list, merge [name], clean, remove <name>\n');
|
|
601
|
+
}
|
|
602
|
+
process.exit(0);
|
|
603
|
+
}
|
|
604
|
+
// ---------------------------------------------------------------------------
|
|
641
605
|
// Worktree flag (-w) — create/resume a worktree for the interactive session
|
|
642
606
|
// ---------------------------------------------------------------------------
|
|
643
607
|
if (cliFlags.worktree) {
|
|
@@ -649,12 +613,11 @@ if (cliFlags.worktree) {
|
|
|
649
613
|
// ---------------------------------------------------------------------------
|
|
650
614
|
if (!cliFlags.worktree && !isPrintMode) {
|
|
651
615
|
try {
|
|
652
|
-
const {
|
|
653
|
-
|
|
616
|
+
const { handleStatusBanner } = await import('./worktree-cli.js');
|
|
617
|
+
await handleStatusBanner(process.cwd());
|
|
654
618
|
}
|
|
655
619
|
catch { /* non-fatal */ }
|
|
656
620
|
}
|
|
657
|
-
markStartup('worktreeStatusBanner');
|
|
658
621
|
// ---------------------------------------------------------------------------
|
|
659
622
|
// Auto-redirect: `gsd auto` with piped stdout → headless mode (#2732)
|
|
660
623
|
// When stdout is not a TTY (e.g. `gsd auto | cat`, `gsd auto > file`),
|
|
@@ -688,9 +651,7 @@ markStartup('initResources');
|
|
|
688
651
|
// Overlap resource loading with session manager setup — both are independent.
|
|
689
652
|
// resourceLoader.reload() is the most expensive step (jiti compilation), so
|
|
690
653
|
// starting it early shaves ~50-200ms off interactive startup.
|
|
691
|
-
const resourceLoader =
|
|
692
|
-
additionalExtensionPaths: cliFlags.extensions.length > 0 ? cliFlags.extensions : undefined,
|
|
693
|
-
});
|
|
654
|
+
const resourceLoader = buildResourceLoader(agentDir);
|
|
694
655
|
const resourceLoadPromise = resourceLoader.reload();
|
|
695
656
|
// While resources load, let session manager finish any async I/O it needs.
|
|
696
657
|
// Then await the resource promise before creating the agent session.
|
|
@@ -699,11 +660,10 @@ markStartup('resourceLoader.reload');
|
|
|
699
660
|
flushPendingProviderRegistrations(resourceLoader, modelRegistry);
|
|
700
661
|
migrateAnthropicDefaultToClaudeCode({
|
|
701
662
|
authStorage,
|
|
702
|
-
isClaudeCodeReady:
|
|
663
|
+
isClaudeCodeReady: modelRegistry.isProviderRequestReady('claude-code'),
|
|
703
664
|
settingsManager,
|
|
704
665
|
modelRegistry,
|
|
705
666
|
});
|
|
706
|
-
markStartup('providerMigrations');
|
|
707
667
|
const { session, extensionsResult, modelFallbackMessage: interactiveFallbackMsg } = await createAgentSession({
|
|
708
668
|
authStorage,
|
|
709
669
|
modelRegistry,
|
package/dist/headless-query.d.ts
CHANGED
|
@@ -14,28 +14,6 @@
|
|
|
14
14
|
* bypassing the extension loader's jiti setup (#1137).
|
|
15
15
|
*/
|
|
16
16
|
import type { GSDState } from './resources/extensions/gsd/types.js';
|
|
17
|
-
/**
|
|
18
|
-
* Resolve the GSD extensions root for headless-query. Prefers the synced
|
|
19
|
-
* agent directory (so headless-query loads the same extension copy as
|
|
20
|
-
* interactive/auto modes — #3471) and falls back to the bundled source
|
|
21
|
-
* resource for source-tree dev workflows.
|
|
22
|
-
*
|
|
23
|
-
* Pure on the given inputs (env + fs probe + bundled resolver) so the
|
|
24
|
-
* #3471 contract can be exercised in tests without spawning a subprocess.
|
|
25
|
-
*/
|
|
26
|
-
export declare function resolveGsdAgentExtensionsDir(env?: NodeJS.ProcessEnv): string;
|
|
27
|
-
/**
|
|
28
|
-
* Decide whether headless-query should load extensions from the agent
|
|
29
|
-
* sync directory (#3471) or fall back to bundled source. Returns the
|
|
30
|
-
* agent dir alongside the decision so a caller can use it directly.
|
|
31
|
-
*/
|
|
32
|
-
export declare function shouldUseAgentExtensionsDir(opts: {
|
|
33
|
-
env?: NodeJS.ProcessEnv;
|
|
34
|
-
fileExists?: (path: string) => boolean;
|
|
35
|
-
}): {
|
|
36
|
-
agentDir: string;
|
|
37
|
-
useAgentDir: boolean;
|
|
38
|
-
};
|
|
39
17
|
export interface QuerySnapshot {
|
|
40
18
|
state: GSDState;
|
|
41
19
|
next: {
|
package/dist/headless-query.js
CHANGED
|
@@ -19,31 +19,11 @@ import { join } from 'node:path';
|
|
|
19
19
|
import { homedir } from 'node:os';
|
|
20
20
|
import { resolveBundledSourceResource } from './bundled-resource-path.js';
|
|
21
21
|
const jiti = createJiti(fileURLToPath(import.meta.url), { interopDefault: true, debug: false });
|
|
22
|
+
// Resolve extensions from the synced agent directory so headless-query
|
|
23
|
+
// loads the same extension copy as interactive/auto modes (#3471).
|
|
24
|
+
// Falls back to bundled source for source-tree dev workflows.
|
|
25
|
+
const agentExtensionsDir = join(process.env.GSD_AGENT_DIR || join(homedir(), '.gsd', 'agent'), 'extensions', 'gsd');
|
|
22
26
|
const { existsSync } = await import('node:fs');
|
|
23
|
-
/**
|
|
24
|
-
* Resolve the GSD extensions root for headless-query. Prefers the synced
|
|
25
|
-
* agent directory (so headless-query loads the same extension copy as
|
|
26
|
-
* interactive/auto modes — #3471) and falls back to the bundled source
|
|
27
|
-
* resource for source-tree dev workflows.
|
|
28
|
-
*
|
|
29
|
-
* Pure on the given inputs (env + fs probe + bundled resolver) so the
|
|
30
|
-
* #3471 contract can be exercised in tests without spawning a subprocess.
|
|
31
|
-
*/
|
|
32
|
-
export function resolveGsdAgentExtensionsDir(env = process.env) {
|
|
33
|
-
return join(env.GSD_AGENT_DIR || join(homedir(), '.gsd', 'agent'), 'extensions', 'gsd');
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Decide whether headless-query should load extensions from the agent
|
|
37
|
-
* sync directory (#3471) or fall back to bundled source. Returns the
|
|
38
|
-
* agent dir alongside the decision so a caller can use it directly.
|
|
39
|
-
*/
|
|
40
|
-
export function shouldUseAgentExtensionsDir(opts) {
|
|
41
|
-
const env = opts.env ?? process.env;
|
|
42
|
-
const fileExists = opts.fileExists ?? existsSync;
|
|
43
|
-
const agentDir = resolveGsdAgentExtensionsDir(env);
|
|
44
|
-
return { agentDir, useAgentDir: fileExists(join(agentDir, 'state.ts')) };
|
|
45
|
-
}
|
|
46
|
-
const agentExtensionsDir = resolveGsdAgentExtensionsDir();
|
|
47
27
|
const useAgentDir = existsSync(join(agentExtensionsDir, 'state.ts'));
|
|
48
28
|
const gsdExtensionPath = (...segments) => useAgentDir
|
|
49
29
|
? join(agentExtensionsDir, ...segments)
|
package/dist/headless.d.ts
CHANGED
|
@@ -32,16 +32,6 @@ export interface HeadlessOptions {
|
|
|
32
32
|
resumeSession?: string;
|
|
33
33
|
bare?: boolean;
|
|
34
34
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Commands classified as multi-turn in headless mode: they involve multiple
|
|
37
|
-
* question rounds, codebase scanning, and artifact writing before the workflow
|
|
38
|
-
* completes (#3547). Multi-turn commands suppress single-execution-complete
|
|
39
|
-
* exit and disable the default 5-minute timeout.
|
|
40
|
-
*
|
|
41
|
-
* Exported so the regression test can exercise the real classifier rather
|
|
42
|
-
* than grepping the source for identifier names.
|
|
43
|
-
*/
|
|
44
|
-
export declare function isMultiTurnHeadlessCommand(command: string): boolean;
|
|
45
35
|
export interface ResumeSessionResult {
|
|
46
36
|
session?: SessionInfo;
|
|
47
37
|
error?: string;
|
package/dist/headless.js
CHANGED
|
@@ -21,21 +21,6 @@ import { isTerminalNotification, isBlockedNotification, isMilestoneReadyNotifica
|
|
|
21
21
|
import { VALID_OUTPUT_FORMATS } from './headless-types.js';
|
|
22
22
|
import { handleExtensionUIRequest, formatProgress, formatThinkingLine, formatTextStart, formatTextEnd, formatThinkingStart, formatThinkingEnd, startSupervisedStdinReader, } from './headless-ui.js';
|
|
23
23
|
import { loadContext, bootstrapGsdProject, } from './headless-context.js';
|
|
24
|
-
/**
|
|
25
|
-
* Commands classified as multi-turn in headless mode: they involve multiple
|
|
26
|
-
* question rounds, codebase scanning, and artifact writing before the workflow
|
|
27
|
-
* completes (#3547). Multi-turn commands suppress single-execution-complete
|
|
28
|
-
* exit and disable the default 5-minute timeout.
|
|
29
|
-
*
|
|
30
|
-
* Exported so the regression test can exercise the real classifier rather
|
|
31
|
-
* than grepping the source for identifier names.
|
|
32
|
-
*/
|
|
33
|
-
export function isMultiTurnHeadlessCommand(command) {
|
|
34
|
-
return (command === 'auto' ||
|
|
35
|
-
command === 'next' ||
|
|
36
|
-
command === 'discuss' ||
|
|
37
|
-
command === 'plan');
|
|
38
|
-
}
|
|
39
24
|
/**
|
|
40
25
|
* Resolve a session prefix to a single session.
|
|
41
26
|
* Exact id match is preferred over prefix match.
|
|
@@ -201,7 +186,7 @@ async function runHeadlessOnce(options, restartCount) {
|
|
|
201
186
|
const isAutoMode = options.command === 'auto';
|
|
202
187
|
// discuss and plan are multi-turn: they involve multiple question rounds,
|
|
203
188
|
// codebase scanning, and artifact writing before the workflow completes (#3547).
|
|
204
|
-
const isMultiTurnCommand =
|
|
189
|
+
const isMultiTurnCommand = options.command === 'auto' || options.command === 'next' || options.command === 'discuss' || options.command === 'plan';
|
|
205
190
|
if (isAutoMode && options.timeout === 300_000) {
|
|
206
191
|
options.timeout = 0;
|
|
207
192
|
}
|
package/dist/loader.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// GSD Startup Loader
|
|
3
|
+
// Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>
|
|
3
4
|
import { fileURLToPath } from 'url';
|
|
4
5
|
import { dirname, resolve, join, relative, delimiter } from 'path';
|
|
5
6
|
import { existsSync, readFileSync, readdirSync, statSync, mkdirSync, symlinkSync, cpSync } from 'fs';
|
|
@@ -31,14 +32,14 @@ if (firstArg === '--help' || firstArg === '-h') {
|
|
|
31
32
|
// package.json (already parsed above) and verifies git is available.
|
|
32
33
|
// ---------------------------------------------------------------------------
|
|
33
34
|
{
|
|
34
|
-
const
|
|
35
|
+
const MIN_NODE_MAJOR = 22;
|
|
35
36
|
const red = '\x1b[31m';
|
|
36
37
|
const bold = '\x1b[1m';
|
|
37
38
|
const dim = '\x1b[2m';
|
|
38
39
|
const reset = '\x1b[0m';
|
|
39
40
|
// -- Node version --
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
41
|
+
const nodeMajor = parseInt(process.versions.node.split('.')[0], 10);
|
|
42
|
+
if (nodeMajor < MIN_NODE_MAJOR) {
|
|
42
43
|
process.stderr.write(`\n${red}${bold}Error:${reset} GSD requires Node.js >= ${MIN_NODE_MAJOR}.0.0\n` +
|
|
43
44
|
` You are running Node.js ${process.versions.node}\n\n` +
|
|
44
45
|
`${dim}Install a supported version:${reset}\n` +
|
|
@@ -48,9 +49,11 @@ if (firstArg === '--help' || firstArg === '-h') {
|
|
|
48
49
|
process.exit(1);
|
|
49
50
|
}
|
|
50
51
|
// -- git --
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
try {
|
|
53
|
+
const { execFileSync } = await import('child_process');
|
|
54
|
+
execFileSync('git', ['--version'], { stdio: 'ignore' });
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
54
57
|
process.stderr.write(`\n${red}${bold}Error:${reset} GSD requires git but it was not found on PATH.\n\n` +
|
|
55
58
|
`${dim}Install git:${reset}\n` +
|
|
56
59
|
` https://git-scm.com/downloads\n\n`);
|
|
@@ -58,7 +61,7 @@ if (firstArg === '--help' || firstArg === '-h') {
|
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
63
|
import { agentDir, appRoot } from './app-paths.js';
|
|
61
|
-
import { applyRtkProcessEnv } from './rtk
|
|
64
|
+
import { applyRtkProcessEnv } from './rtk.js';
|
|
62
65
|
import { serializeBundledExtensionPaths } from './bundled-extension-paths.js';
|
|
63
66
|
import { discoverExtensionEntryPaths } from './extension-discovery.js';
|
|
64
67
|
import { loadRegistry, readManifestFromEntryPath, isExtensionEnabled } from './extension-registry.js';
|
package/dist/onboarding.d.ts
CHANGED
|
@@ -24,16 +24,6 @@ interface RunOnboardingOptions {
|
|
|
24
24
|
/** Show logo + intro banner. Disable when onboarding is launched inside an active TUI session. */
|
|
25
25
|
showIntro?: boolean;
|
|
26
26
|
}
|
|
27
|
-
export declare const OTHER_PROVIDERS: ({
|
|
28
|
-
value: string;
|
|
29
|
-
label: string;
|
|
30
|
-
hint: string;
|
|
31
|
-
} | {
|
|
32
|
-
value: string;
|
|
33
|
-
label: string;
|
|
34
|
-
hint?: undefined;
|
|
35
|
-
})[];
|
|
36
|
-
export declare function detectNativeProviderFromBaseUrl(baseUrl: string): 'minimax' | 'minimax-cn' | null;
|
|
37
27
|
/**
|
|
38
28
|
* Determine if the onboarding wizard should run.
|
|
39
29
|
*
|
package/dist/onboarding.js
CHANGED
|
@@ -54,7 +54,7 @@ const API_KEY_PREFIXES = {
|
|
|
54
54
|
anthropic: ['sk-ant-'],
|
|
55
55
|
openai: ['sk-'],
|
|
56
56
|
};
|
|
57
|
-
|
|
57
|
+
const OTHER_PROVIDERS = [
|
|
58
58
|
{ value: 'google', label: 'Google (Gemini)', hint: 'aistudio.google.com/app/apikey' },
|
|
59
59
|
{ value: 'groq', label: 'Groq', hint: 'console.groq.com/keys' },
|
|
60
60
|
{ value: 'xai', label: 'xAI (Grok)', hint: 'console.x.ai' },
|
|
@@ -148,7 +148,7 @@ function persistDefaultModel(modelId) {
|
|
|
148
148
|
// Non-fatal: startup fallback logic will still run.
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
function detectNativeProviderFromBaseUrl(baseUrl) {
|
|
152
152
|
try {
|
|
153
153
|
const hostname = new URL(baseUrl).hostname.toLowerCase();
|
|
154
154
|
if (hostname === 'api.minimax.io' || hostname.endsWith('.minimax.io')) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AuthStorage } from "@gsd/pi-coding-agent";
|
|
2
2
|
type AnthropicMigrationDeps = {
|
|
3
3
|
authStorage: Pick<AuthStorage, "getCredentialsForProvider">;
|
|
4
|
-
isClaudeCodeReady: boolean
|
|
4
|
+
isClaudeCodeReady: boolean;
|
|
5
5
|
defaultProvider: string | undefined;
|
|
6
6
|
env?: NodeJS.ProcessEnv;
|
|
7
7
|
};
|
|
@@ -11,7 +11,7 @@ type MigrationModel = {
|
|
|
11
11
|
};
|
|
12
12
|
type AnthropicDefaultMigrationDeps = {
|
|
13
13
|
authStorage: Pick<AuthStorage, "getCredentialsForProvider">;
|
|
14
|
-
isClaudeCodeReady: boolean
|
|
14
|
+
isClaudeCodeReady: boolean;
|
|
15
15
|
settingsManager: {
|
|
16
16
|
getDefaultProvider(): string | undefined;
|
|
17
17
|
getDefaultModel(): string | undefined;
|
|
@@ -5,13 +5,10 @@ export function hasDirectAnthropicApiKey(authStorage, env = process.env) {
|
|
|
5
5
|
return authStorage.getCredentialsForProvider("anthropic").some((credential) => credential?.type === "api_key" && typeof credential?.key === "string" && credential.key.trim().length > 0);
|
|
6
6
|
}
|
|
7
7
|
export function shouldMigrateAnthropicToClaudeCode({ authStorage, isClaudeCodeReady, defaultProvider, env = process.env, }) {
|
|
8
|
-
if (defaultProvider !== "anthropic") {
|
|
8
|
+
if (!isClaudeCodeReady || defaultProvider !== "anthropic") {
|
|
9
9
|
return false;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
return typeof isClaudeCodeReady === "function" ? isClaudeCodeReady() : isClaudeCodeReady;
|
|
11
|
+
return !hasDirectAnthropicApiKey(authStorage, env);
|
|
15
12
|
}
|
|
16
13
|
export function migrateAnthropicDefaultToClaudeCode({ authStorage, isClaudeCodeReady, settingsManager, modelRegistry, env = process.env, }) {
|
|
17
14
|
const defaultProvider = settingsManager.getDefaultProvider();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DefaultResourceLoader } from '@gsd/pi-coding-agent';
|
|
2
2
|
export { discoverExtensionEntryPaths } from './extension-discovery.js';
|
|
3
3
|
export declare function getExtensionKey(entryPath: string, extensionsDir: string): string;
|
|
4
4
|
export declare function readManagedResourceVersion(agentDir: string): string | null;
|
|
@@ -63,7 +63,4 @@ export declare function mergedFingerprint(hoisted: string, internal: string): st
|
|
|
63
63
|
*/
|
|
64
64
|
export declare function initResources(agentDir: string, skillsDir?: string): void;
|
|
65
65
|
export declare function hasStaleCompiledExtensionSiblings(extensionsDir: string, sourceDir?: string): boolean;
|
|
66
|
-
|
|
67
|
-
additionalExtensionPaths?: string[];
|
|
68
|
-
}
|
|
69
|
-
export declare function buildResourceLoader(agentDir: string, options?: BuildResourceLoaderOptions): Promise<DefaultResourceLoaderType>;
|
|
66
|
+
export declare function buildResourceLoader(agentDir: string): DefaultResourceLoader;
|
package/dist/resource-loader.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DefaultResourceLoader, sortExtensionPaths } from '@gsd/pi-coding-agent';
|
|
1
2
|
import { createHash } from 'node:crypto';
|
|
2
3
|
import { homedir } from 'node:os';
|
|
3
4
|
import { chmodSync, copyFileSync, cpSync, existsSync, lstatSync, mkdirSync, openSync, closeSync, readFileSync, readlinkSync, readdirSync, rmSync, statSync, symlinkSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
@@ -6,10 +7,6 @@ import { fileURLToPath } from 'node:url';
|
|
|
6
7
|
import { compareSemver } from './update-check.js';
|
|
7
8
|
import { discoverExtensionEntryPaths } from './extension-discovery.js';
|
|
8
9
|
import { loadRegistry, readManifestFromEntryPath, isExtensionEnabled, ensureRegistryEntries } from './extension-registry.js';
|
|
9
|
-
let piCodingAgentModulePromise;
|
|
10
|
-
function loadPiCodingAgentModule() {
|
|
11
|
-
return (piCodingAgentModulePromise ??= import('@gsd/pi-coding-agent'));
|
|
12
|
-
}
|
|
13
10
|
// Resolve resources directory — prefer dist/resources/ (stable, set at build time)
|
|
14
11
|
// over src/resources/ (live working tree, changes with git branch).
|
|
15
12
|
//
|
|
@@ -29,7 +26,6 @@ const resourcesDir = (existsSync(distResources) && existsSync(join(distResources
|
|
|
29
26
|
: srcResources;
|
|
30
27
|
const bundledExtensionsDir = join(resourcesDir, 'extensions');
|
|
31
28
|
const resourceVersionManifestName = 'managed-resources.json';
|
|
32
|
-
const resourceFingerprintFileName = '.managed-resources-content-hash';
|
|
33
29
|
export { discoverExtensionEntryPaths } from './extension-discovery.js';
|
|
34
30
|
export function getExtensionKey(entryPath, extensionsDir) {
|
|
35
31
|
const relPath = relative(extensionsDir, entryPath);
|
|
@@ -81,7 +77,7 @@ function writeManagedResourceManifest(agentDir) {
|
|
|
81
77
|
const manifest = {
|
|
82
78
|
gsdVersion: getBundledGsdVersion(),
|
|
83
79
|
syncedAt: Date.now(),
|
|
84
|
-
contentHash:
|
|
80
|
+
contentHash: computeResourceFingerprint(),
|
|
85
81
|
installedExtensionRootFiles,
|
|
86
82
|
installedExtensionDirs,
|
|
87
83
|
};
|
|
@@ -129,24 +125,10 @@ export function computeResourceFingerprint(rootDir = resourcesDir) {
|
|
|
129
125
|
entries.sort();
|
|
130
126
|
return createHash('sha256').update(entries.join('\n')).digest('hex').slice(0, 16);
|
|
131
127
|
}
|
|
132
|
-
function getCurrentResourceFingerprint() {
|
|
133
|
-
try {
|
|
134
|
-
const precomputed = readFileSync(join(resourcesDir, resourceFingerprintFileName), 'utf-8').trim();
|
|
135
|
-
if (/^[a-f0-9]{16}$/i.test(precomputed)) {
|
|
136
|
-
return precomputed;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
catch {
|
|
140
|
-
// Source-tree and partial-build workflows may not have a precomputed hash.
|
|
141
|
-
}
|
|
142
|
-
return computeResourceFingerprint();
|
|
143
|
-
}
|
|
144
128
|
function collectFileEntries(dir, root, out) {
|
|
145
129
|
if (!existsSync(dir))
|
|
146
130
|
return;
|
|
147
131
|
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
148
|
-
if (entry.name === resourceFingerprintFileName)
|
|
149
|
-
continue;
|
|
150
132
|
const fullPath = join(dir, entry.name);
|
|
151
133
|
if (entry.isDirectory()) {
|
|
152
134
|
collectFileEntries(fullPath, root, out);
|
|
@@ -566,7 +548,7 @@ export function initResources(agentDir, skillsDir = join(homedir(), '.agents', '
|
|
|
566
548
|
// hotfixes within a release). The content hash catches those at ~1ms cost.
|
|
567
549
|
if (manifest && manifest.gsdVersion === currentVersion) {
|
|
568
550
|
// Version matches — check content fingerprint for same-version staleness.
|
|
569
|
-
const currentHash =
|
|
551
|
+
const currentHash = computeResourceFingerprint();
|
|
570
552
|
const hasStaleExtensionFiles = hasStaleCompiledExtensionSiblings(extensionsDir, bundledExtensionsDir);
|
|
571
553
|
if (manifest.contentHash && manifest.contentHash === currentHash && !hasStaleExtensionFiles) {
|
|
572
554
|
return;
|
|
@@ -754,8 +736,7 @@ function getBundledExtensionKeys() {
|
|
|
754
736
|
}
|
|
755
737
|
return _bundledExtensionKeys;
|
|
756
738
|
}
|
|
757
|
-
export
|
|
758
|
-
const { DefaultResourceLoader, sortExtensionPaths } = await loadPiCodingAgentModule();
|
|
739
|
+
export function buildResourceLoader(agentDir) {
|
|
759
740
|
const registry = loadRegistry();
|
|
760
741
|
const piAgentDir = join(homedir(), '.pi', 'agent');
|
|
761
742
|
const piExtensionsDir = join(piAgentDir, 'extensions');
|
|
@@ -768,13 +749,9 @@ export async function buildResourceLoader(agentDir, options = {}) {
|
|
|
768
749
|
return true;
|
|
769
750
|
return isExtensionEnabled(registry, manifest.id);
|
|
770
751
|
});
|
|
771
|
-
const additionalExtensionPaths = [
|
|
772
|
-
...piExtensionPaths,
|
|
773
|
-
...(options.additionalExtensionPaths ?? []),
|
|
774
|
-
];
|
|
775
752
|
return new DefaultResourceLoader({
|
|
776
753
|
agentDir,
|
|
777
|
-
additionalExtensionPaths,
|
|
754
|
+
additionalExtensionPaths: piExtensionPaths,
|
|
778
755
|
bundledExtensionKeys: bundledKeys,
|
|
779
756
|
extensionPathsTransform: (paths) => {
|
|
780
757
|
// 1. Filter community extensions through the GSD registry
|