gsd-pi 2.78.0 → 2.78.1-dev.0fdacd524
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 +60 -23
- package/dist/bundled-resource-path.d.ts +7 -0
- package/dist/bundled-resource-path.js +34 -2
- package/dist/claude-cli-check.js +104 -33
- package/dist/cli-policy.d.ts +13 -0
- package/dist/cli-policy.js +17 -0
- package/dist/cli.js +95 -55
- package/dist/headless-query.d.ts +22 -0
- package/dist/headless-query.js +43 -8
- package/dist/headless.d.ts +10 -0
- package/dist/headless.js +16 -1
- package/dist/loader.js +9 -13
- package/dist/onboarding.d.ts +10 -0
- package/dist/onboarding.js +2 -2
- package/dist/provider-migrations.d.ts +2 -2
- package/dist/provider-migrations.js +5 -2
- package/dist/resource-loader.d.ts +5 -2
- package/dist/resource-loader.js +30 -13
- package/dist/resources/.managed-resources-content-hash +1 -0
- package/dist/resources/extensions/claude-code-cli/readiness.js +128 -32
- package/dist/resources/extensions/google-search/index.js +2 -6
- package/dist/resources/extensions/gsd/auto/loop.js +23 -0
- package/dist/resources/extensions/gsd/auto/phases.js +5 -13
- package/dist/resources/extensions/gsd/auto/run-unit.js +26 -12
- package/dist/resources/extensions/gsd/auto/session.js +5 -6
- package/dist/resources/extensions/gsd/auto-dashboard.js +3 -2
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +55 -21
- package/dist/resources/extensions/gsd/auto-dispatch.js +18 -6
- package/dist/resources/extensions/gsd/auto-prompts.js +69 -2
- package/dist/resources/extensions/gsd/auto-recovery.js +43 -4
- package/dist/resources/extensions/gsd/auto-runtime-state.js +31 -0
- 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 +60 -13
- package/dist/resources/extensions/gsd/auto.js +39 -14
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +14 -2
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +7 -5
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +2 -2
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +5 -4
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +112 -31
- package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +11 -6
- package/dist/resources/extensions/gsd/bootstrap/subagent-input.js +22 -0
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +45 -8
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +121 -3
- package/dist/resources/extensions/gsd/commands/catalog.js +76 -5
- package/dist/resources/extensions/gsd/commands/handlers/core.js +23 -1
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +8 -0
- package/dist/resources/extensions/gsd/commands-config.js +3 -2
- package/dist/resources/extensions/gsd/commands-extensions.js +46 -3
- package/dist/resources/extensions/gsd/commands-handlers.js +3 -2
- package/dist/resources/extensions/gsd/commands-mcp-status.js +3 -1
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +10 -1
- package/dist/resources/extensions/gsd/commands-worktree.js +309 -0
- package/dist/resources/extensions/gsd/dashboard-overlay.js +1 -1
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +10 -0
- package/dist/resources/extensions/gsd/doctor-providers.js +2 -1
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +39 -1
- package/dist/resources/extensions/gsd/error-classifier.js +1 -1
- package/dist/resources/extensions/gsd/forensics.js +10 -8
- package/dist/resources/extensions/gsd/git-service.js +12 -5
- package/dist/resources/extensions/gsd/gsd-db.js +11 -2
- package/dist/resources/extensions/gsd/guided-flow.js +25 -24
- package/dist/resources/extensions/gsd/home-dir.js +16 -0
- package/dist/resources/extensions/gsd/key-manager.js +2 -1
- package/dist/resources/extensions/gsd/memory-store.js +66 -31
- package/dist/resources/extensions/gsd/migrate/command.js +3 -2
- package/dist/resources/extensions/gsd/milestone-id-reservation.js +36 -0
- package/dist/resources/extensions/gsd/model-router.js +114 -9
- package/dist/resources/extensions/gsd/native-git-bridge.js +7 -1
- package/dist/resources/extensions/gsd/preferences-models.js +91 -15
- package/dist/resources/extensions/gsd/preferences-types.js +2 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +32 -0
- package/dist/resources/extensions/gsd/preferences.js +5 -3
- package/dist/resources/extensions/gsd/prompt-loader.js +23 -12
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +10 -0
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +10 -0
- package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +2 -0
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +10 -0
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +10 -0
- package/dist/resources/extensions/gsd/prompts/rewrite-docs.md +2 -0
- package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +9 -3
- package/dist/resources/extensions/gsd/state.js +42 -0
- package/dist/resources/extensions/gsd/templates/PREFERENCES.md +1 -0
- package/dist/resources/extensions/gsd/tools/memory-tools.js +18 -1
- package/dist/resources/extensions/gsd/unit-context-manifest.js +29 -4
- package/dist/resources/extensions/gsd/visualizer-overlay.js +1 -1
- package/dist/resources/extensions/gsd/watch/header-renderer.js +3 -1
- package/dist/resources/extensions/gsd/worktree-command.js +26 -46
- package/dist/resources/extensions/gsd/worktree-manager.js +20 -1
- package/dist/resources/extensions/gsd/worktree-resolver.js +4 -13
- package/dist/resources/extensions/gsd/worktree-root.js +124 -0
- package/dist/resources/extensions/gsd/worktree-session-state.js +33 -0
- package/dist/resources/extensions/gsd/worktree.js +4 -115
- package/dist/resources/extensions/mcp-client/index.js +6 -9
- package/dist/resources/extensions/ollama/index.js +15 -2
- package/dist/resources/extensions/ollama/model-capabilities.js +31 -0
- package/dist/resources/extensions/ollama/ollama-client.js +40 -4
- package/dist/resources/extensions/slash-commands/create-extension.js +36 -22
- package/dist/resources/extensions/subagent/index.js +324 -178
- package/dist/resources/skills/create-gsd-extension/SKILL.md +9 -5
- 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 +32 -12
- package/dist/resources/skills/lint/SKILL.md +4 -0
- package/dist/resources/skills/review/SKILL.md +4 -0
- package/dist/resources/skills/test/SKILL.md +3 -0
- package/dist/rtk-shared.d.ts +3 -0
- package/dist/rtk-shared.js +17 -0
- package/dist/rtk.d.ts +2 -5
- package/dist/rtk.js +3 -20
- package/dist/runtime-checks.d.ts +27 -0
- package/dist/runtime-checks.js +38 -0
- 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 +14 -14
- 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 +44 -4
- 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 +4 -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 +14 -14
- 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/2556.0527fea66e123b7f.js +1 -0
- package/dist/web/standalone/.next/static/chunks/2824.08296bc2f9654698.js +1 -0
- package/dist/web/standalone/.next/static/chunks/3026.3af53b279375f082.js +1 -0
- package/dist/web/standalone/.next/static/chunks/315.6f68ae79b67d25cf.js +1 -0
- package/dist/web/standalone/.next/static/chunks/3497.4bfc60a3b3dea717.js +1 -0
- package/dist/web/standalone/.next/static/chunks/5516.4a07c872b5c3a663.js +1 -0
- package/dist/web/standalone/.next/static/chunks/8336.31b019697882acfb.js +10 -0
- package/dist/web/standalone/.next/static/chunks/8845.c9702695e8c5a9c5.js +2 -0
- package/dist/web/standalone/.next/static/chunks/9058.01ef3a463bda88f1.js +20 -0
- package/dist/web/standalone/.next/static/chunks/9441.1081da1125d1764f.js +1 -0
- 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-9bf2e0c50fb2ca05.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/.next/static/chunks/webpack-f9f0dc45e4f3ac10.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 +2 -1
- package/dist/web/standalone/server.js +1 -1
- package/dist/welcome-screen.js +27 -1
- package/dist/worktree-cli.d.ts +1 -0
- package/dist/worktree-cli.js +9 -3
- package/dist/worktree-status-banner.d.ts +1 -0
- package/dist/worktree-status-banner.js +132 -0
- package/package.json +1 -3
- package/packages/daemon/package.json +2 -2
- package/packages/mcp-server/dist/alias-telemetry.d.ts +8 -0
- package/packages/mcp-server/dist/alias-telemetry.d.ts.map +1 -0
- package/packages/mcp-server/dist/alias-telemetry.js +30 -0
- package/packages/mcp-server/dist/alias-telemetry.js.map +1 -0
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +74 -46
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +2 -2
- package/packages/mcp-server/src/alias-telemetry.test.ts +78 -0
- package/packages/mcp-server/src/alias-telemetry.ts +30 -0
- package/packages/mcp-server/src/workflow-tools.test.ts +78 -0
- package/packages/mcp-server/src/workflow-tools.ts +93 -58
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/package.json +1 -1
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.cache-breakpoint.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.cache-breakpoint.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.cache-breakpoint.test.js +231 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.cache-breakpoint.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +48 -19
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/types.d.ts +13 -0
- 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 +24 -3
- 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 +26 -0
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/src/providers/anthropic-shared.cache-breakpoint.test.ts +289 -0
- package/packages/pi-ai/src/providers/anthropic-shared.ts +52 -20
- package/packages/pi-ai/src/types.ts +13 -0
- package/packages/pi-ai/src/utils/repair-tool-json.ts +24 -3
- package/packages/pi-ai/src/utils/tests/repair-tool-json.test.ts +32 -0
- 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 +6 -0
- 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 +4 -0
- 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 +19 -2
- 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 +10 -0
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +18 -0
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts +13 -0
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +20 -16
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/token-telemetry.d.ts +37 -0
- package/packages/pi-coding-agent/dist/core/token-telemetry.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/token-telemetry.js +49 -0
- package/packages/pi-coding-agent/dist/core/token-telemetry.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +133 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -0
- 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 +14 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/tests/system-prompt-cache-stability.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-cache-stability.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-cache-stability.test.js +78 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-cache-stability.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/tests/token-telemetry.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/tests/token-telemetry.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/tests/token-telemetry.test.js +181 -0
- package/packages/pi-coding-agent/dist/tests/token-telemetry.test.js.map +1 -0
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +7 -0
- package/packages/pi-coding-agent/src/core/messages.ts +4 -0
- package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +32 -2
- package/packages/pi-coding-agent/src/core/model-registry.ts +21 -0
- package/packages/pi-coding-agent/src/core/system-prompt.ts +33 -15
- package/packages/pi-coding-agent/src/core/token-telemetry.ts +77 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +212 -0
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +17 -1
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.ts +1 -1
- package/packages/pi-coding-agent/src/tests/system-prompt-cache-stability.test.ts +102 -0
- package/packages/pi-coding-agent/src/tests/token-telemetry.test.ts +200 -0
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js +17 -3
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js.map +1 -1
- package/packages/pi-tui/dist/components/__tests__/leak-fixes-runtime.test.d.ts +2 -0
- package/packages/pi-tui/dist/components/__tests__/leak-fixes-runtime.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/__tests__/leak-fixes-runtime.test.js +161 -0
- package/packages/pi-tui/dist/components/__tests__/leak-fixes-runtime.test.js.map +1 -0
- package/packages/pi-tui/package.json +1 -1
- package/packages/pi-tui/src/__tests__/autocomplete.test.ts +20 -3
- package/packages/pi-tui/src/components/__tests__/leak-fixes-runtime.test.ts +219 -0
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/package.json +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/claude-code-cli/readiness.ts +130 -30
- package/src/resources/extensions/google-search/index.ts +2 -9
- package/src/resources/extensions/gsd/auto/loop.ts +24 -2
- package/src/resources/extensions/gsd/auto/phases.ts +6 -14
- package/src/resources/extensions/gsd/auto/run-unit.ts +26 -12
- package/src/resources/extensions/gsd/auto/session.ts +5 -6
- package/src/resources/extensions/gsd/auto/types.ts +1 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +3 -2
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +60 -24
- package/src/resources/extensions/gsd/auto-dispatch.ts +18 -6
- package/src/resources/extensions/gsd/auto-prompts.ts +66 -2
- package/src/resources/extensions/gsd/auto-recovery.ts +46 -8
- package/src/resources/extensions/gsd/auto-runtime-state.ts +51 -0
- package/src/resources/extensions/gsd/auto-start.ts +1 -1
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +2 -4
- package/src/resources/extensions/gsd/auto-worktree.ts +82 -12
- package/src/resources/extensions/gsd/auto.ts +37 -10
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +15 -13
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +8 -7
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +2 -2
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +10 -9
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +121 -31
- package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +12 -6
- package/src/resources/extensions/gsd/bootstrap/subagent-input.ts +20 -0
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +50 -8
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +141 -11
- package/src/resources/extensions/gsd/commands/catalog.ts +82 -5
- package/src/resources/extensions/gsd/commands/handlers/core.ts +23 -1
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +10 -0
- package/src/resources/extensions/gsd/commands-config.ts +3 -2
- package/src/resources/extensions/gsd/commands-extensions.ts +43 -3
- package/src/resources/extensions/gsd/commands-handlers.ts +3 -2
- package/src/resources/extensions/gsd/commands-mcp-status.ts +3 -1
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +15 -1
- package/src/resources/extensions/gsd/commands-worktree.ts +383 -0
- package/src/resources/extensions/gsd/dashboard-overlay.ts +1 -1
- package/src/resources/extensions/gsd/docs/preferences-reference.md +10 -0
- package/src/resources/extensions/gsd/doctor-providers.ts +2 -1
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +39 -1
- package/src/resources/extensions/gsd/doctor-types.ts +3 -1
- package/src/resources/extensions/gsd/error-classifier.ts +1 -1
- package/src/resources/extensions/gsd/forensics.ts +12 -7
- package/src/resources/extensions/gsd/git-service.ts +13 -5
- package/src/resources/extensions/gsd/gsd-db.ts +12 -2
- package/src/resources/extensions/gsd/guided-flow.ts +27 -26
- package/src/resources/extensions/gsd/home-dir.ts +19 -0
- package/src/resources/extensions/gsd/journal.ts +4 -1
- package/src/resources/extensions/gsd/key-manager.ts +2 -1
- package/src/resources/extensions/gsd/memory-store.ts +81 -28
- package/src/resources/extensions/gsd/migrate/command.ts +3 -2
- package/src/resources/extensions/gsd/milestone-id-reservation.ts +47 -0
- package/src/resources/extensions/gsd/model-router.ts +172 -9
- package/src/resources/extensions/gsd/native-git-bridge.ts +7 -1
- package/src/resources/extensions/gsd/preferences-models.ts +101 -15
- package/src/resources/extensions/gsd/preferences-types.ts +6 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +35 -0
- package/src/resources/extensions/gsd/preferences.ts +16 -2
- package/src/resources/extensions/gsd/prompt-loader.ts +26 -12
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +10 -0
- package/src/resources/extensions/gsd/prompts/complete-slice.md +10 -0
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +2 -0
- package/src/resources/extensions/gsd/prompts/plan-slice.md +10 -0
- package/src/resources/extensions/gsd/prompts/refine-slice.md +10 -0
- package/src/resources/extensions/gsd/prompts/rewrite-docs.md +2 -0
- package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +9 -3
- package/src/resources/extensions/gsd/state.ts +42 -0
- package/src/resources/extensions/gsd/templates/PREFERENCES.md +1 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +179 -1
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +58 -0
- package/src/resources/extensions/gsd/tests/auto-session-encapsulation.test.ts +24 -5
- package/src/resources/extensions/gsd/tests/auto-supervisor.test.mjs +21 -4
- 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 +138 -211
- package/src/resources/extensions/gsd/tests/bundled-skill-triggers.test.ts +50 -27
- package/src/resources/extensions/gsd/tests/commands-extensions-version-compare.test.ts +58 -0
- package/src/resources/extensions/gsd/tests/commands-worktree-clean.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/complete-slice-verification-gate.test.ts +142 -59
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +7 -4
- package/src/resources/extensions/gsd/tests/completed-at-reconcile.test.ts +89 -32
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +41 -23
- package/src/resources/extensions/gsd/tests/db-path-worktree-symlink.test.ts +3 -43
- package/src/resources/extensions/gsd/tests/debug-logger.test.ts +5 -3
- package/src/resources/extensions/gsd/tests/deferred-milestone-dir-4996.test.ts +116 -0
- package/src/resources/extensions/gsd/tests/discuss-empty-db-fallback.test.ts +22 -87
- package/src/resources/extensions/gsd/tests/discuss-queued-milestones.test.ts +7 -118
- package/src/resources/extensions/gsd/tests/discuss-tool-scope-leak.test.ts +18 -60
- package/src/resources/extensions/gsd/tests/doctor-orphan-milestone-4996.test.ts +100 -0
- package/src/resources/extensions/gsd/tests/double-merge-guard.test.ts +14 -76
- package/src/resources/extensions/gsd/tests/ensure-preconditions-guard-4996.test.ts +93 -0
- package/src/resources/extensions/gsd/tests/false-degraded-mode-warning.test.ts +22 -83
- package/src/resources/extensions/gsd/tests/finalize-timeout-guard.test.ts +1 -63
- package/src/resources/extensions/gsd/tests/find-missing-summaries-closed-runtime.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/forensics-stuck-loops.test.ts +26 -1
- package/src/resources/extensions/gsd/tests/gitignore-bg-shell-runtime.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/google-search-stub.test.ts +25 -65
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/gsd-no-project-error-runtime.test.ts +81 -0
- package/src/resources/extensions/gsd/tests/headless-answers.test.ts +14 -4
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +22 -12
- package/src/resources/extensions/gsd/tests/help-menu-coverage.test.ts +57 -0
- package/src/resources/extensions/gsd/tests/home-dir.test.ts +52 -0
- package/src/resources/extensions/gsd/tests/import-done-milestones-runtime.test.ts +145 -0
- package/src/resources/extensions/gsd/tests/init-prefs-routing.test.ts +64 -1
- package/src/resources/extensions/gsd/tests/integration/auto-worktree.test.ts +72 -1
- package/src/resources/extensions/gsd/tests/integration/token-savings.test.ts +0 -23
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +128 -0
- package/src/resources/extensions/gsd/tests/memory-tools.test.ts +33 -1
- package/src/resources/extensions/gsd/tests/merge-self-branch-guard.test.ts +124 -0
- package/src/resources/extensions/gsd/tests/milestone-id-gap-reuse-4996.test.ts +152 -0
- package/src/resources/extensions/gsd/tests/milestone-report-path.test.ts +18 -1
- package/src/resources/extensions/gsd/tests/model-router.test.ts +169 -8
- package/src/resources/extensions/gsd/tests/native-git-infra-errors.test.ts +50 -0
- package/src/resources/extensions/gsd/tests/orphaned-worktree-audit.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/parallel-crash-recovery.test.ts +32 -43
- package/src/resources/extensions/gsd/tests/phases-merge-error-stops-auto.test.ts +4 -10
- package/src/resources/extensions/gsd/tests/preferences.test.ts +127 -0
- package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/quick-turn-end-cleanup.test.ts +6 -6
- package/src/resources/extensions/gsd/tests/register-hooks-compaction-checkpoint.test.ts +93 -0
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +34 -0
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +168 -19
- package/src/resources/extensions/gsd/tests/slice-parallel-orchestrator.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/smart-entry-complete.test.ts +23 -1
- package/src/resources/extensions/gsd/tests/steer-worktree-path.test.ts +17 -1
- package/src/resources/extensions/gsd/tests/system-context-message-routing.test.ts +101 -0
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +51 -4
- package/src/resources/extensions/gsd/tests/turn-epoch.test.ts +7 -16
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +38 -3
- package/src/resources/extensions/gsd/tests/unstructured-continue-context-injection.test.ts +5 -7
- package/src/resources/extensions/gsd/tests/uok-gitops-turn-action.test.ts +15 -1
- package/src/resources/extensions/gsd/tests/visualizer-overlay.test.ts +6 -6
- package/src/resources/extensions/gsd/tests/worktree-path-injection.test.ts +235 -0
- package/src/resources/extensions/gsd/tests/worktree-symlink-removal.test.ts +34 -33
- package/src/resources/extensions/gsd/tests/worktree.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +131 -1
- package/src/resources/extensions/gsd/tools/memory-tools.ts +17 -1
- package/src/resources/extensions/gsd/unit-context-manifest.ts +44 -12
- package/src/resources/extensions/gsd/visualizer-overlay.ts +1 -1
- package/src/resources/extensions/gsd/watch/header-renderer.ts +3 -1
- package/src/resources/extensions/gsd/workflow-logger.ts +1 -0
- package/src/resources/extensions/gsd/worktree-command.ts +31 -44
- package/src/resources/extensions/gsd/worktree-manager.ts +40 -1
- package/src/resources/extensions/gsd/worktree-resolver.ts +4 -14
- package/src/resources/extensions/gsd/worktree-root.ts +144 -0
- package/src/resources/extensions/gsd/worktree-session-state.ts +35 -0
- package/src/resources/extensions/gsd/worktree.ts +8 -119
- package/src/resources/extensions/mcp-client/index.ts +6 -10
- package/src/resources/extensions/mcp-client/tests/global-config.test.ts +91 -0
- package/src/resources/extensions/ollama/index.ts +16 -2
- package/src/resources/extensions/ollama/model-capabilities.ts +34 -0
- package/src/resources/extensions/ollama/ollama-client.ts +41 -4
- package/src/resources/extensions/ollama/tests/model-capabilities.test.ts +96 -0
- package/src/resources/extensions/ollama/tests/ollama-client-timeout-env.test.ts +147 -0
- package/src/resources/extensions/slash-commands/create-extension.ts +38 -24
- package/src/resources/extensions/subagent/index.ts +165 -7
- package/src/resources/skills/create-gsd-extension/SKILL.md +9 -5
- 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/templates/templates.test.ts +58 -0
- package/src/resources/skills/create-gsd-extension/workflows/create-extension.md +32 -12
- package/src/resources/skills/lint/SKILL.md +4 -0
- package/src/resources/skills/review/SKILL.md +4 -0
- package/src/resources/skills/test/SKILL.md +3 -0
- package/dist/resources/extensions/browser-tools/tests/browser-tools-integration.test.mjs +0 -601
- package/dist/resources/extensions/browser-tools/tests/browser-tools-unit.test.cjs +0 -651
- package/dist/resources/extensions/browser-tools/tests/capture-sharp-optional.test.cjs +0 -91
- package/dist/resources/extensions/gsd/tests/auto-supervisor.test.mjs +0 -53
- package/dist/resources/extensions/gsd/tests/dist-redirect.mjs +0 -112
- package/dist/resources/extensions/gsd/tests/resolve-ts-hooks.mjs +0 -23
- package/dist/resources/extensions/gsd/tests/resolve-ts.mjs +0 -5
- 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 +0 -608
- package/dist/web/standalone/.next/static/chunks/2826.e9f5195e91f9cad2.js +0 -11
- package/dist/web/standalone/.next/static/chunks/3621.fc7480022c972438.js +0 -20
- package/dist/web/standalone/.next/static/chunks/app/page-151349214571e2b6.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/chunks/webpack-2e68521d7c82f7c2.js +0 -1
- package/src/resources/extensions/gsd/tests/copy-planning-artifacts-samepath.test.ts +0 -22
- package/src/resources/extensions/gsd/tests/discuss-slice-structured-questions.test.ts +0 -47
- package/src/resources/extensions/gsd/tests/empty-content-abort-loop.test.ts +0 -75
- /package/dist/web/standalone/.next/static/{C1zT2kEfoLhDdbWPWKrXd → 4iu6IYeYfxOq8OidlDqp6}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{C1zT2kEfoLhDdbWPWKrXd → 4iu6IYeYfxOq8OidlDqp6}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4ec0444c08b7f2ca
|
|
@@ -5,10 +5,30 @@
|
|
|
5
5
|
* Results are cached for 30 seconds to avoid shelling out on every
|
|
6
6
|
* model-availability check.
|
|
7
7
|
*
|
|
8
|
-
* Auth verification
|
|
9
|
-
*
|
|
8
|
+
* Auth verification runs `claude auth status --json` and inspects the
|
|
9
|
+
* `loggedIn` field, falling back to plain `claude auth status` and a text
|
|
10
|
+
* heuristic when the JSON shape is unavailable (older Claude CLI builds).
|
|
11
|
+
*
|
|
12
|
+
* Set GSD_CLAUDE_DEBUG=1 to print the probe's binary selection and auth
|
|
13
|
+
* outputs to stderr — useful when diagnosing platform-specific detection
|
|
14
|
+
* failures (Issue #4997).
|
|
10
15
|
*/
|
|
11
16
|
import { execFileSync } from "node:child_process";
|
|
17
|
+
/**
|
|
18
|
+
* Spawn the Claude CLI without triggering Node's DEP0190.
|
|
19
|
+
*
|
|
20
|
+
* Passing `args` together with `shell: true` is deprecated in Node 22+
|
|
21
|
+
* because the args are concatenated into the command string without
|
|
22
|
+
* escaping. On Windows we still need a shell to resolve `.cmd` shims, so
|
|
23
|
+
* we invoke `cmd /c <command> <args...>` explicitly. On POSIX we don't
|
|
24
|
+
* need a shell at all.
|
|
25
|
+
*/
|
|
26
|
+
function spawnClaude(command, args, opts) {
|
|
27
|
+
if (process.platform === "win32") {
|
|
28
|
+
return execFileSync("cmd", ["/c", command, ...args], opts);
|
|
29
|
+
}
|
|
30
|
+
return execFileSync(command, args, opts);
|
|
31
|
+
}
|
|
12
32
|
/**
|
|
13
33
|
* Candidate executable names for the Claude Code CLI.
|
|
14
34
|
*
|
|
@@ -23,33 +43,114 @@ const CLAUDE_COMMAND = process.platform === "win32" ? "claude.cmd" : "claude";
|
|
|
23
43
|
* installed" results in readiness checks.
|
|
24
44
|
*/
|
|
25
45
|
const CLAUDE_COMMAND_CANDIDATES = process.platform === "win32" ? [CLAUDE_COMMAND, "claude.exe", "claude"] : [CLAUDE_COMMAND];
|
|
26
|
-
|
|
27
|
-
|
|
46
|
+
// Keep the version probe snappy — `claude --version` is a quick path.
|
|
47
|
+
const VERSION_TIMEOUT_MS = 5_000;
|
|
48
|
+
// Auth status can be much slower on Windows because the spawn goes through
|
|
49
|
+
// cmd.exe → claude.cmd → node → Claude CLI. 15s leaves headroom on cold spawns
|
|
50
|
+
// without making startup feel hung when the CLI is genuinely missing.
|
|
51
|
+
const AUTH_TIMEOUT_MS = 15_000;
|
|
52
|
+
function debugLog(...parts) {
|
|
53
|
+
if (process.env.GSD_CLAUDE_DEBUG) {
|
|
54
|
+
process.stderr.write(`[claude-readiness] ${parts.map((p) => (typeof p === "string" ? p : JSON.stringify(p))).join(" ")}\n`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Find the first candidate that responds to `--version`. Returns the
|
|
59
|
+
* candidate name on success, null if none worked.
|
|
60
|
+
*
|
|
61
|
+
* On Windows with `cmd /c`, a missing candidate surfaces as a
|
|
62
|
+
* non-zero exit from cmd.exe rather than ENOENT — so we cannot rely on
|
|
63
|
+
* the error code to decide "try next". Treat any failure as "try next"
|
|
64
|
+
* for the version probe; the only thing that matters for binary
|
|
65
|
+
* detection is whether *some* candidate produces a `claude --version`
|
|
66
|
+
* line.
|
|
67
|
+
*/
|
|
68
|
+
function findWorkingCommand() {
|
|
28
69
|
for (const command of CLAUDE_COMMAND_CANDIDATES) {
|
|
29
70
|
try {
|
|
30
|
-
|
|
31
|
-
timeout:
|
|
71
|
+
spawnClaude(command, ["--version"], {
|
|
72
|
+
timeout: VERSION_TIMEOUT_MS,
|
|
32
73
|
stdio: "pipe",
|
|
33
|
-
shell: process.platform === "win32",
|
|
34
74
|
});
|
|
75
|
+
debugLog("version probe ok via", command);
|
|
76
|
+
return command;
|
|
35
77
|
}
|
|
36
78
|
catch (error) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
79
|
+
debugLog("version probe failed for", command, "code=", error?.code);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Decide auth state from `claude auth status` output.
|
|
87
|
+
*
|
|
88
|
+
* Newer Claude CLI builds emit JSON by default with a `loggedIn` boolean.
|
|
89
|
+
* Older builds emit free-form text. We prefer the structured signal and fall
|
|
90
|
+
* back to a text heuristic. Note: the text heuristic only covers English
|
|
91
|
+
* phrasing — the JSON path is the durable signal.
|
|
92
|
+
*/
|
|
93
|
+
function parseAuthStatus(output) {
|
|
94
|
+
const trimmed = output.trim();
|
|
95
|
+
if (!trimmed)
|
|
96
|
+
return null;
|
|
97
|
+
if (trimmed.startsWith("{")) {
|
|
98
|
+
try {
|
|
99
|
+
const parsed = JSON.parse(trimmed);
|
|
100
|
+
if (typeof parsed.loggedIn === "boolean") {
|
|
101
|
+
return parsed.loggedIn;
|
|
43
102
|
}
|
|
44
|
-
throw error;
|
|
45
103
|
}
|
|
104
|
+
catch {
|
|
105
|
+
// Fall through to text heuristic.
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const lower = trimmed.toLowerCase();
|
|
109
|
+
if (/not logged in|no credentials|unauthenticated|not authenticated/.test(lower)) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
if (/logged in|authenticated|signed in|email|subscription/.test(lower)) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
function probeAuth(command) {
|
|
118
|
+
// Try --json first (newer CLIs).
|
|
119
|
+
try {
|
|
120
|
+
const out = spawnClaude(command, ["auth", "status", "--json"], {
|
|
121
|
+
timeout: AUTH_TIMEOUT_MS,
|
|
122
|
+
stdio: "pipe",
|
|
123
|
+
}).toString();
|
|
124
|
+
debugLog("auth status --json output:", out.slice(0, 200));
|
|
125
|
+
const parsed = parseAuthStatus(out);
|
|
126
|
+
if (parsed !== null)
|
|
127
|
+
return parsed;
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
debugLog("auth status --json threw:", error.message?.slice(0, 200));
|
|
131
|
+
}
|
|
132
|
+
// Fallback: plain `auth status` (older CLIs that don't accept --json).
|
|
133
|
+
try {
|
|
134
|
+
const out = spawnClaude(command, ["auth", "status"], {
|
|
135
|
+
timeout: AUTH_TIMEOUT_MS,
|
|
136
|
+
stdio: "pipe",
|
|
137
|
+
}).toString();
|
|
138
|
+
debugLog("auth status output:", out.slice(0, 200));
|
|
139
|
+
return parseAuthStatus(out);
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
debugLog("auth status threw:", error.message?.slice(0, 200));
|
|
143
|
+
return null;
|
|
46
144
|
}
|
|
47
|
-
throw lastError ?? new Error(`Claude CLI executable not found (tried: ${CLAUDE_COMMAND_CANDIDATES.join(", ")})`);
|
|
48
145
|
}
|
|
49
146
|
let cachedBinaryPresent = null;
|
|
50
147
|
let cachedAuthed = null;
|
|
51
148
|
let lastCheckMs = 0;
|
|
52
149
|
const CHECK_INTERVAL_MS = 30_000;
|
|
150
|
+
/**
|
|
151
|
+
* Refresh the cached binary/auth state when the cache window has expired.
|
|
152
|
+
* Preserves a known auth state across soft-fail auth probes.
|
|
153
|
+
*/
|
|
53
154
|
function refreshCache() {
|
|
54
155
|
const now = Date.now();
|
|
55
156
|
if (cachedBinaryPresent !== null && now - lastCheckMs < CHECK_INTERVAL_MS) {
|
|
@@ -57,28 +158,23 @@ function refreshCache() {
|
|
|
57
158
|
}
|
|
58
159
|
// Set timestamp first to prevent re-entrant checks during the same window
|
|
59
160
|
lastCheckMs = now;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
execClaude(["--version"]);
|
|
63
|
-
cachedBinaryPresent = true;
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
161
|
+
const command = findWorkingCommand();
|
|
162
|
+
if (!command) {
|
|
66
163
|
cachedBinaryPresent = false;
|
|
67
164
|
cachedAuthed = false;
|
|
68
165
|
return;
|
|
69
166
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
// Non-zero exit code means not authenticated
|
|
80
|
-
cachedAuthed = false;
|
|
167
|
+
cachedBinaryPresent = true;
|
|
168
|
+
const authed = probeAuth(command);
|
|
169
|
+
if (authed === null) {
|
|
170
|
+
// Couldn't determine auth state from CLI output. Don't clobber a
|
|
171
|
+
// previously known-good cache; otherwise default to false so we don't
|
|
172
|
+
// silently route requests to an unauthenticated CLI.
|
|
173
|
+
if (cachedAuthed === null)
|
|
174
|
+
cachedAuthed = false;
|
|
175
|
+
return;
|
|
81
176
|
}
|
|
177
|
+
cachedAuthed = authed;
|
|
82
178
|
}
|
|
83
179
|
/**
|
|
84
180
|
* Whether the `claude` binary is installed (regardless of auth state).
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export default function (
|
|
2
|
-
|
|
3
|
-
ctx.ui.notify("google_search is being extracted to @gsd-extensions/google-search " +
|
|
4
|
-
"(not yet published to npm). This stub will be replaced once the " +
|
|
5
|
-
"package is available. No action needed for now.", "warning");
|
|
6
|
-
});
|
|
1
|
+
export default function (_pi) {
|
|
2
|
+
// Deprecation notice intentionally suppressed until @gsd-extensions/google-search ships.
|
|
7
3
|
}
|
|
@@ -163,6 +163,17 @@ function resolveDispatchNodeKind(unitType, sidecarItem) {
|
|
|
163
163
|
}
|
|
164
164
|
return "unit";
|
|
165
165
|
}
|
|
166
|
+
async function enforceMinRequestInterval(s, prefs) {
|
|
167
|
+
const minInterval = prefs?.min_request_interval_ms ?? 0;
|
|
168
|
+
if (minInterval > 0 && s.lastRequestTimestamp > 0) {
|
|
169
|
+
const elapsed = Date.now() - s.lastRequestTimestamp;
|
|
170
|
+
if (elapsed < minInterval) {
|
|
171
|
+
const waitMs = minInterval - elapsed;
|
|
172
|
+
debugLog("autoLoop", { phase: "rate-limit-wait", waitMs });
|
|
173
|
+
await new Promise(r => setTimeout(r, waitMs));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
166
177
|
async function runUnitPhaseViaContract(dispatchContract, ic, iterData, loopState, sidecarItem) {
|
|
167
178
|
if (dispatchContract === "legacy-direct") {
|
|
168
179
|
return runUnitPhase(ic, iterData, loopState, sidecarItem);
|
|
@@ -392,7 +403,13 @@ export async function autoLoop(ctx, pi, s, deps, options) {
|
|
|
392
403
|
break;
|
|
393
404
|
}
|
|
394
405
|
// ── Unit execution (shared with dev path) ──
|
|
406
|
+
await enforceMinRequestInterval(s, prefs);
|
|
395
407
|
const unitPhaseResult = await runUnitPhaseViaContract(dispatchContract, ic, iterData, loopState);
|
|
408
|
+
if (unitPhaseResult.action === "next") {
|
|
409
|
+
const requestTimestamp = unitPhaseResult.data.requestDispatchedAt ?? unitPhaseResult.data.unitStartedAt;
|
|
410
|
+
if (typeof requestTimestamp === "number")
|
|
411
|
+
s.lastRequestTimestamp = requestTimestamp;
|
|
412
|
+
}
|
|
396
413
|
deps.uokObserver?.onPhaseResult("unit", unitPhaseResult.action, {
|
|
397
414
|
unitType: iterData.unitType,
|
|
398
415
|
unitId: iterData.unitId,
|
|
@@ -555,7 +572,13 @@ export async function autoLoop(ctx, pi, s, deps, options) {
|
|
|
555
572
|
sidecarKind: sidecarItem.kind,
|
|
556
573
|
});
|
|
557
574
|
}
|
|
575
|
+
await enforceMinRequestInterval(s, prefs);
|
|
558
576
|
const unitPhaseResult = await runUnitPhaseViaContract(dispatchContract, ic, iterData, loopState, sidecarItem);
|
|
577
|
+
if (unitPhaseResult.action === "next") {
|
|
578
|
+
const requestTimestamp = unitPhaseResult.data.requestDispatchedAt ?? unitPhaseResult.data.unitStartedAt;
|
|
579
|
+
if (typeof requestTimestamp === "number")
|
|
580
|
+
s.lastRequestTimestamp = requestTimestamp;
|
|
581
|
+
}
|
|
559
582
|
deps.uokObserver?.onPhaseResult("unit", unitPhaseResult.action, {
|
|
560
583
|
unitType: iterData.unitType,
|
|
561
584
|
unitId: iterData.unitId,
|
|
@@ -11,6 +11,7 @@ import { MAX_RECOVERY_CHARS, BUDGET_THRESHOLDS, MAX_FINALIZE_TIMEOUTS, } from ".
|
|
|
11
11
|
import { detectStuck } from "./detect-stuck.js";
|
|
12
12
|
import { runUnit } from "./run-unit.js";
|
|
13
13
|
import { debugLog } from "../debug-logger.js";
|
|
14
|
+
import { resolveWorktreeProjectRoot } from "../worktree-root.js";
|
|
14
15
|
import { PROJECT_FILES, hasProjectFileInAncestor } from "../detection.js";
|
|
15
16
|
import { MergeConflictError } from "../git-service.js";
|
|
16
17
|
import { setCurrentPhase, clearCurrentPhase } from "../../shared/gsd-phase-state.js";
|
|
@@ -48,11 +49,7 @@ export function resetSessionTimeoutState() {
|
|
|
48
49
|
* Exported for testing as _resolveReportBasePath.
|
|
49
50
|
*/
|
|
50
51
|
export function _resolveReportBasePath(s) {
|
|
51
|
-
|
|
52
|
-
// originalBasePath is falsy — prevents reports landing in the worktree (#3729).
|
|
53
|
-
const resolved = s.originalBasePath || s.basePath;
|
|
54
|
-
const markerIdx = resolved.indexOf("/.gsd/worktrees/");
|
|
55
|
-
return markerIdx !== -1 ? resolved.slice(0, markerIdx) : resolved;
|
|
52
|
+
return resolveWorktreeProjectRoot(s.basePath, s.originalBasePath);
|
|
56
53
|
}
|
|
57
54
|
/**
|
|
58
55
|
* Resolve the authoritative project base for dispatch guards.
|
|
@@ -60,12 +57,7 @@ export function _resolveReportBasePath(s) {
|
|
|
60
57
|
* unit is running inside an auto worktree.
|
|
61
58
|
*/
|
|
62
59
|
export function _resolveDispatchGuardBasePath(s) {
|
|
63
|
-
|
|
64
|
-
// originalBasePath is falsy — prevents guard checks running against the
|
|
65
|
-
// worktree instead of the project root (#3729).
|
|
66
|
-
const resolved = s.originalBasePath || s.basePath;
|
|
67
|
-
const markerIdx = resolved.indexOf("/.gsd/worktrees/");
|
|
68
|
-
return markerIdx !== -1 ? resolved.slice(0, markerIdx) : resolved;
|
|
60
|
+
return resolveWorktreeProjectRoot(s.basePath, s.originalBasePath);
|
|
69
61
|
}
|
|
70
62
|
const PLAN_V2_GATE_PHASES = new Set([
|
|
71
63
|
"executing",
|
|
@@ -1365,7 +1357,7 @@ export async function runUnitPhase(ic, iterData, loopState, sidecarItem) {
|
|
|
1365
1357
|
ctx.ui.notify(`${unitType} ${unitId} completed with 0 tool calls — context exhaustion, will retry`, "warning");
|
|
1366
1358
|
// Fall through to next iteration where dispatch will re-derive
|
|
1367
1359
|
// and re-dispatch this unit.
|
|
1368
|
-
return { action: "next", data: { unitStartedAt: s.currentUnit?.startedAt } };
|
|
1360
|
+
return { action: "next", data: { unitStartedAt: s.currentUnit?.startedAt, requestDispatchedAt: unitResult.requestDispatchedAt } };
|
|
1369
1361
|
}
|
|
1370
1362
|
}
|
|
1371
1363
|
}
|
|
@@ -1418,7 +1410,7 @@ export async function runUnitPhase(ic, iterData, loopState, sidecarItem) {
|
|
|
1418
1410
|
}
|
|
1419
1411
|
s.checkpointSha = null;
|
|
1420
1412
|
}
|
|
1421
|
-
return { action: "next", data: { unitStartedAt: s.currentUnit?.startedAt } };
|
|
1413
|
+
return { action: "next", data: { unitStartedAt: s.currentUnit?.startedAt, requestDispatchedAt: unitResult.requestDispatchedAt } };
|
|
1422
1414
|
}
|
|
1423
1415
|
// ─── runFinalize ──────────────────────────────────────────────────────────────
|
|
1424
1416
|
/**
|
|
@@ -22,6 +22,29 @@ let sessionSwitchGeneration = 0;
|
|
|
22
22
|
*/
|
|
23
23
|
export async function runUnit(ctx, pi, s, unitType, unitId, prompt) {
|
|
24
24
|
debugLog("runUnit", { phase: "start", unitType, unitId });
|
|
25
|
+
// Ensure cwd matches basePath BEFORE newSession() captures it. The new
|
|
26
|
+
// session reads process.cwd() during construction to anchor its tool
|
|
27
|
+
// runtime and system prompt; if cwd has drifted (async_bash, background
|
|
28
|
+
// jobs, prior unit cleanup), the session would otherwise be rooted to
|
|
29
|
+
// the wrong directory. Must be synchronous — no awaits between chdir
|
|
30
|
+
// and newSession (#1389, #4762 follow-up).
|
|
31
|
+
try {
|
|
32
|
+
if (process.cwd() !== s.basePath) {
|
|
33
|
+
process.chdir(s.basePath);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
const msg = `Failed to chdir to basePath before newSession (basePath: ${s.basePath}): ${String(e)}`;
|
|
38
|
+
logWarning("engine", msg, { basePath: s.basePath, error: String(e) });
|
|
39
|
+
return {
|
|
40
|
+
status: "cancelled",
|
|
41
|
+
errorContext: {
|
|
42
|
+
message: msg,
|
|
43
|
+
category: "session-failed",
|
|
44
|
+
isTransient: true,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
25
48
|
// ── Session creation with timeout ──
|
|
26
49
|
debugLog("runUnit", { phase: "session-create", unitType, unitId });
|
|
27
50
|
let sessionResult;
|
|
@@ -91,17 +114,6 @@ export async function runUnit(ctx, pi, s, unitType, unitId, prompt) {
|
|
|
91
114
|
const unitPromise = new Promise((resolve) => {
|
|
92
115
|
_setCurrentResolve(resolve);
|
|
93
116
|
});
|
|
94
|
-
// Ensure cwd matches basePath before dispatch (#1389).
|
|
95
|
-
// async_bash and background jobs can drift cwd away from the worktree.
|
|
96
|
-
// Realigning here prevents commits from landing on the wrong branch.
|
|
97
|
-
try {
|
|
98
|
-
if (process.cwd() !== s.basePath) {
|
|
99
|
-
process.chdir(s.basePath);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
catch (e) {
|
|
103
|
-
logWarning("engine", "Failed to chdir to basePath before dispatch", { basePath: s.basePath, error: String(e) });
|
|
104
|
-
}
|
|
105
117
|
// ── Provider request-readiness pre-check (#4555) ──
|
|
106
118
|
// Verify the provider can accept requests before dispatching. If the token
|
|
107
119
|
// has expired since bootstrap, return cancelled immediately so the unit is
|
|
@@ -138,6 +150,7 @@ export async function runUnit(ctx, pi, s, unitType, unitId, prompt) {
|
|
|
138
150
|
const capturedTurnGen = getCurrentTurnGeneration();
|
|
139
151
|
// ── Send the prompt ──
|
|
140
152
|
debugLog("runUnit", { phase: "send-message", unitType, unitId });
|
|
153
|
+
const requestDispatchedAt = Date.now();
|
|
141
154
|
pi.sendMessage({ customType: "gsd-auto", content: prompt, display: s.verbose }, { triggerTurn: true });
|
|
142
155
|
// ── Await agent_end with absolute timeout (H4 fix) ──
|
|
143
156
|
// If supervision fails to resolve unitPromise within 30s, treat as cancelled.
|
|
@@ -160,6 +173,7 @@ export async function runUnit(ctx, pi, s, unitType, unitId, prompt) {
|
|
|
160
173
|
unitId,
|
|
161
174
|
status: result.status,
|
|
162
175
|
});
|
|
176
|
+
const finalResult = { ...result, requestDispatchedAt };
|
|
163
177
|
// Discard trailing follow-up messages (e.g. async_job_result notifications)
|
|
164
178
|
// from the completed unit. Without this, queued follow-ups trigger wasteful
|
|
165
179
|
// LLM turns before the next session can start (#1642).
|
|
@@ -174,5 +188,5 @@ export async function runUnit(ctx, pi, s, unitType, unitId, prompt) {
|
|
|
174
188
|
catch (e) {
|
|
175
189
|
logWarning("engine", "clearQueue failed after unit completion", { error: String(e) });
|
|
176
190
|
}
|
|
177
|
-
return
|
|
191
|
+
return finalResult;
|
|
178
192
|
}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* auto-session-encapsulation.test.ts enforce that auto.ts has no module-level
|
|
16
16
|
* `let` or `var` declarations.
|
|
17
17
|
*/
|
|
18
|
+
import { resolveWorktreeProjectRoot } from "../worktree-root.js";
|
|
18
19
|
// ─── Constants ───────────────────────────────────────────────────────────────
|
|
19
20
|
export const STUB_RECOVERY_THRESHOLD = 2;
|
|
20
21
|
export const NEW_SESSION_TIMEOUT_MS = 120_000;
|
|
@@ -118,6 +119,8 @@ export class AutoSession {
|
|
|
118
119
|
lastPromptCharCount;
|
|
119
120
|
lastBaselineCharCount;
|
|
120
121
|
pendingQuickTasks = [];
|
|
122
|
+
/** Timestamp of the last LLM request dispatch (ms since epoch). Used for proactive rate limiting. */
|
|
123
|
+
lastRequestTimestamp = 0;
|
|
121
124
|
// ── Safety harness ───────────────────────────────────────────────────────
|
|
122
125
|
/** SHA of the pre-unit git checkpoint ref. Cleared on success or rollback. */
|
|
123
126
|
checkpointSha = null;
|
|
@@ -153,12 +156,7 @@ export class AutoSession {
|
|
|
153
156
|
this.unitLifetimeDispatches.clear();
|
|
154
157
|
}
|
|
155
158
|
get lockBasePath() {
|
|
156
|
-
|
|
157
|
-
// Strip /.gsd/worktrees/ suffix if basePath is itself a worktree path
|
|
158
|
-
// to avoid reading/writing the lock inside the worktree (#3729).
|
|
159
|
-
const resolved = this.originalBasePath || this.basePath;
|
|
160
|
-
const markerIdx = resolved.indexOf("/.gsd/worktrees/");
|
|
161
|
-
return markerIdx !== -1 ? resolved.slice(0, markerIdx) : resolved;
|
|
159
|
+
return resolveWorktreeProjectRoot(this.basePath, this.originalBasePath);
|
|
162
160
|
}
|
|
163
161
|
reset() {
|
|
164
162
|
this.clearTimers();
|
|
@@ -215,6 +213,7 @@ export class AutoSession {
|
|
|
215
213
|
this.lastPromptCharCount = undefined;
|
|
216
214
|
this.lastBaselineCharCount = undefined;
|
|
217
215
|
this.pendingQuickTasks = [];
|
|
216
|
+
this.lastRequestTimestamp = 0;
|
|
218
217
|
this.sidecarQueue = [];
|
|
219
218
|
this.rewriteAttemptCount = 0;
|
|
220
219
|
this.consecutiveCompleteBootstraps = 0;
|
|
@@ -10,6 +10,7 @@ import { getActiveHook } from "./post-unit-hooks.js";
|
|
|
10
10
|
import { getLedger, getProjectTotals } from "./metrics.js";
|
|
11
11
|
import { getErrorMessage } from "./error-utils.js";
|
|
12
12
|
import { nativeIsRepo } from "./native-git-bridge.js";
|
|
13
|
+
import { getHomeDir } from "./home-dir.js";
|
|
13
14
|
import { isDbAvailable, getMilestoneSlices, getSliceTasks } from "./gsd-db.js";
|
|
14
15
|
import { readFileSync, writeFileSync, existsSync } from "node:fs";
|
|
15
16
|
import { execFileSync } from "node:child_process";
|
|
@@ -461,8 +462,8 @@ export function updateProgressWidget(ctx, unitType, unitId, state, accessors, ti
|
|
|
461
462
|
let widgetPwd;
|
|
462
463
|
{
|
|
463
464
|
let fullPwd = process.cwd();
|
|
464
|
-
const widgetHome =
|
|
465
|
-
if (widgetHome && fullPwd.startsWith(widgetHome)) {
|
|
465
|
+
const widgetHome = getHomeDir();
|
|
466
|
+
if (widgetHome && (fullPwd === widgetHome || fullPwd.startsWith(widgetHome + "/") || fullPwd.startsWith(widgetHome + "\\"))) {
|
|
466
467
|
fullPwd = `~${fullPwd.slice(widgetHome.length)}`;
|
|
467
468
|
}
|
|
468
469
|
const parts = fullPwd.split("/");
|
|
@@ -10,6 +10,8 @@ import { resolveMilestoneFile, resolveSliceFile, relSliceFile, } from "./paths.j
|
|
|
10
10
|
import { buildResearchSlicePrompt, buildResearchMilestonePrompt, buildPlanSlicePrompt, buildPlanMilestonePrompt, buildExecuteTaskPrompt, buildCompleteSlicePrompt, buildCompleteMilestonePrompt, buildReassessRoadmapPrompt, buildRunUatPrompt, buildReplanSlicePrompt, } from "./auto-prompts.js";
|
|
11
11
|
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
12
12
|
import { pauseAuto } from "./auto.js";
|
|
13
|
+
import { resolveCanonicalMilestoneRoot } from "./worktree-manager.js";
|
|
14
|
+
import { logWarning } from "./workflow-logger.js";
|
|
13
15
|
import { getWorkflowTransportSupportError, getRequiredWorkflowToolsForAutoUnit, } from "./workflow-mcp.js";
|
|
14
16
|
export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
15
17
|
const state = await deriveState(base);
|
|
@@ -19,6 +21,12 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
19
21
|
ctx.ui.notify("Cannot dispatch: no active milestone.", "warning");
|
|
20
22
|
return;
|
|
21
23
|
}
|
|
24
|
+
const projectRoot = base;
|
|
25
|
+
// Switch the dispatch base to the canonical milestone worktree if one
|
|
26
|
+
// exists. Without this, /gsd dispatch invoked from the project root would
|
|
27
|
+
// build prompts and create a session anchored to the project root even
|
|
28
|
+
// though the milestone's actual code lives in the worktree.
|
|
29
|
+
const dispatchBase = resolveCanonicalMilestoneRoot(base, mid);
|
|
22
30
|
const normalized = phase.toLowerCase();
|
|
23
31
|
let unitType;
|
|
24
32
|
let unitId;
|
|
@@ -37,7 +45,7 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
37
45
|
}
|
|
38
46
|
// When require_slice_discussion is enabled, pause auto-mode before
|
|
39
47
|
// each new slice so the user can discuss requirements first (#789).
|
|
40
|
-
const sliceContextFile = resolveSliceFile(
|
|
48
|
+
const sliceContextFile = resolveSliceFile(dispatchBase, mid, sid, "CONTEXT");
|
|
41
49
|
const requireDiscussion = loadEffectiveGSDPreferences()?.preferences?.phases?.require_slice_discussion;
|
|
42
50
|
if (requireDiscussion && !sliceContextFile) {
|
|
43
51
|
ctx.ui.notify(`Slice ${sid} requires discussion before planning. Run /gsd discuss to discuss this slice, then /gsd auto to resume.`, "info");
|
|
@@ -46,12 +54,12 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
46
54
|
}
|
|
47
55
|
unitType = "research-slice";
|
|
48
56
|
unitId = `${mid}/${sid}`;
|
|
49
|
-
prompt = await buildResearchSlicePrompt(mid, midTitle, sid, sTitle,
|
|
57
|
+
prompt = await buildResearchSlicePrompt(mid, midTitle, sid, sTitle, dispatchBase);
|
|
50
58
|
}
|
|
51
59
|
else {
|
|
52
60
|
unitType = "research-milestone";
|
|
53
61
|
unitId = mid;
|
|
54
|
-
prompt = await buildResearchMilestonePrompt(mid, midTitle,
|
|
62
|
+
prompt = await buildResearchMilestonePrompt(mid, midTitle, dispatchBase);
|
|
55
63
|
}
|
|
56
64
|
break;
|
|
57
65
|
}
|
|
@@ -68,7 +76,7 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
68
76
|
}
|
|
69
77
|
unitType = "plan-slice";
|
|
70
78
|
unitId = `${mid}/${sid}`;
|
|
71
|
-
prompt = await buildPlanSlicePrompt(mid, midTitle, sid, sTitle,
|
|
79
|
+
prompt = await buildPlanSlicePrompt(mid, midTitle, sid, sTitle, dispatchBase, undefined, {
|
|
72
80
|
sessionContextWindow: ctx.model?.contextWindow,
|
|
73
81
|
modelRegistry: ctx.modelRegistry,
|
|
74
82
|
});
|
|
@@ -76,7 +84,7 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
76
84
|
else {
|
|
77
85
|
unitType = "plan-milestone";
|
|
78
86
|
unitId = mid;
|
|
79
|
-
prompt = await buildPlanMilestonePrompt(mid, midTitle,
|
|
87
|
+
prompt = await buildPlanMilestonePrompt(mid, midTitle, dispatchBase);
|
|
80
88
|
}
|
|
81
89
|
break;
|
|
82
90
|
}
|
|
@@ -96,7 +104,7 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
96
104
|
}
|
|
97
105
|
unitType = "execute-task";
|
|
98
106
|
unitId = `${mid}/${sid}/${tid}`;
|
|
99
|
-
prompt = await buildExecuteTaskPrompt(mid, sid, sTitle, tid, tTitle,
|
|
107
|
+
prompt = await buildExecuteTaskPrompt(mid, sid, sTitle, tid, tTitle, dispatchBase, {
|
|
100
108
|
sessionContextWindow: ctx.model?.contextWindow,
|
|
101
109
|
modelRegistry: ctx.modelRegistry,
|
|
102
110
|
});
|
|
@@ -115,12 +123,12 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
115
123
|
}
|
|
116
124
|
unitType = "complete-slice";
|
|
117
125
|
unitId = `${mid}/${sid}`;
|
|
118
|
-
prompt = await buildCompleteSlicePrompt(mid, midTitle, sid, sTitle,
|
|
126
|
+
prompt = await buildCompleteSlicePrompt(mid, midTitle, sid, sTitle, dispatchBase);
|
|
119
127
|
}
|
|
120
128
|
else {
|
|
121
129
|
unitType = "complete-milestone";
|
|
122
130
|
unitId = mid;
|
|
123
|
-
prompt = await buildCompleteMilestonePrompt(mid, midTitle,
|
|
131
|
+
prompt = await buildCompleteMilestonePrompt(mid, midTitle, dispatchBase);
|
|
124
132
|
}
|
|
125
133
|
break;
|
|
126
134
|
}
|
|
@@ -133,7 +141,7 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
133
141
|
}
|
|
134
142
|
if (completedSliceIds.length === 0) {
|
|
135
143
|
// File-based fallback: parse roadmap checkboxes
|
|
136
|
-
const roadmapPath = resolveMilestoneFile(
|
|
144
|
+
const roadmapPath = resolveMilestoneFile(dispatchBase, mid, "ROADMAP");
|
|
137
145
|
if (roadmapPath) {
|
|
138
146
|
const roadmapContent = await loadFile(roadmapPath);
|
|
139
147
|
if (roadmapContent) {
|
|
@@ -148,7 +156,7 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
148
156
|
const completedSliceId = completedSliceIds[completedSliceIds.length - 1];
|
|
149
157
|
unitType = "reassess-roadmap";
|
|
150
158
|
unitId = `${mid}/${completedSliceId}`;
|
|
151
|
-
prompt = await buildReassessRoadmapPrompt(mid, midTitle, completedSliceId,
|
|
159
|
+
prompt = await buildReassessRoadmapPrompt(mid, midTitle, completedSliceId, dispatchBase);
|
|
152
160
|
break;
|
|
153
161
|
}
|
|
154
162
|
case "uat":
|
|
@@ -163,7 +171,7 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
163
171
|
}
|
|
164
172
|
if (uatCompletedSliceIds.length === 0) {
|
|
165
173
|
// File-based fallback: parse roadmap checkboxes
|
|
166
|
-
const roadmapPath = resolveMilestoneFile(
|
|
174
|
+
const roadmapPath = resolveMilestoneFile(dispatchBase, mid, "ROADMAP");
|
|
167
175
|
if (roadmapPath) {
|
|
168
176
|
const roadmapContent = await loadFile(roadmapPath);
|
|
169
177
|
if (roadmapContent) {
|
|
@@ -176,7 +184,7 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
176
184
|
return;
|
|
177
185
|
}
|
|
178
186
|
const sid = uatCompletedSliceIds[uatCompletedSliceIds.length - 1];
|
|
179
|
-
const uatFile = resolveSliceFile(
|
|
187
|
+
const uatFile = resolveSliceFile(dispatchBase, mid, sid, "UAT");
|
|
180
188
|
if (!uatFile) {
|
|
181
189
|
ctx.ui.notify("Cannot dispatch run-uat: no UAT file found.", "warning");
|
|
182
190
|
return;
|
|
@@ -186,10 +194,10 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
186
194
|
ctx.ui.notify("Cannot dispatch run-uat: UAT file is empty.", "warning");
|
|
187
195
|
return;
|
|
188
196
|
}
|
|
189
|
-
const uatPath = relSliceFile(
|
|
197
|
+
const uatPath = relSliceFile(dispatchBase, mid, sid, "UAT");
|
|
190
198
|
unitType = "run-uat";
|
|
191
199
|
unitId = `${mid}/${sid}`;
|
|
192
|
-
prompt = await buildRunUatPrompt(mid, sid, uatPath, uatContent,
|
|
200
|
+
prompt = await buildRunUatPrompt(mid, sid, uatPath, uatContent, dispatchBase);
|
|
193
201
|
break;
|
|
194
202
|
}
|
|
195
203
|
case "replan":
|
|
@@ -202,7 +210,7 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
202
210
|
}
|
|
203
211
|
unitType = "replan-slice";
|
|
204
212
|
unitId = `${mid}/${sid}`;
|
|
205
|
-
prompt = await buildReplanSlicePrompt(mid, midTitle, sid, sTitle,
|
|
213
|
+
prompt = await buildReplanSlicePrompt(mid, midTitle, sid, sTitle, dispatchBase);
|
|
206
214
|
break;
|
|
207
215
|
}
|
|
208
216
|
default:
|
|
@@ -210,7 +218,7 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
210
218
|
return;
|
|
211
219
|
}
|
|
212
220
|
const compatibilityError = getWorkflowTransportSupportError(ctx.model?.provider, getRequiredWorkflowToolsForAutoUnit(unitType), {
|
|
213
|
-
projectRoot
|
|
221
|
+
projectRoot,
|
|
214
222
|
surface: "direct phase dispatch",
|
|
215
223
|
unitType,
|
|
216
224
|
authMode: ctx.model?.provider ? ctx.modelRegistry.getProviderAuthMode(ctx.model.provider) : undefined,
|
|
@@ -221,10 +229,36 @@ export async function dispatchDirectPhase(ctx, pi, phase, base) {
|
|
|
221
229
|
return;
|
|
222
230
|
}
|
|
223
231
|
ctx.ui.notify(`Dispatching ${unitType} for ${unitId}...`, "info");
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
232
|
+
const originalCwd = process.cwd();
|
|
233
|
+
try {
|
|
234
|
+
// Ensure cwd matches dispatchBase BEFORE newSession() captures it. Synchronous —
|
|
235
|
+
// no awaits between chdir and newSession.
|
|
236
|
+
try {
|
|
237
|
+
if (process.cwd() !== dispatchBase) {
|
|
238
|
+
process.chdir(dispatchBase);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
catch (err) {
|
|
242
|
+
const msg = `Failed to chdir before direct-dispatch newSession (basePath: ${dispatchBase}): ${err instanceof Error ? err.message : String(err)}`;
|
|
243
|
+
logWarning("engine", msg, { file: "auto-direct-dispatch.ts", basePath: dispatchBase, error: err instanceof Error ? err.message : String(err) });
|
|
244
|
+
ctx.ui.notify(`${msg}. Cancelling dispatch to avoid running in the wrong directory.`, "error");
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
const result = await ctx.newSession();
|
|
248
|
+
if (result.cancelled) {
|
|
249
|
+
ctx.ui.notify("Session creation cancelled.", "warning");
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
pi.sendMessage({ customType: "gsd-dispatch", content: prompt, display: false }, { triggerTurn: true });
|
|
253
|
+
}
|
|
254
|
+
finally {
|
|
255
|
+
try {
|
|
256
|
+
if (process.cwd() !== originalCwd) {
|
|
257
|
+
process.chdir(originalCwd);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
catch (err) {
|
|
261
|
+
logWarning("engine", `Failed to restore cwd after direct dispatch: ${err instanceof Error ? err.message : String(err)}`, { file: "auto-direct-dispatch.ts", basePath: originalCwd });
|
|
262
|
+
}
|
|
228
263
|
}
|
|
229
|
-
pi.sendMessage({ customType: "gsd-dispatch", content: prompt, display: false }, { triggerTurn: true });
|
|
230
264
|
}
|