gsd-pi 2.71.0 → 2.72.0-dev.3118184
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 +69 -19
- package/dist/cli.js +88 -6
- package/dist/headless-events.d.ts +2 -0
- package/dist/headless-events.js +7 -0
- package/dist/headless.js +16 -3
- package/dist/mcp-server.js +40 -17
- package/dist/onboarding.js +10 -0
- package/dist/provider-migrations.d.ts +10 -0
- package/dist/provider-migrations.js +12 -0
- package/dist/resource-loader.js +139 -13
- package/dist/resources/GSD-WORKFLOW.md +1 -1
- package/dist/resources/agents/debugger.md +58 -0
- package/dist/resources/agents/doc-writer.md +43 -0
- package/dist/resources/agents/git-ops.md +56 -0
- package/dist/resources/agents/javascript-pro.md +46 -271
- package/dist/resources/agents/planner.md +55 -0
- package/dist/resources/agents/refactorer.md +47 -0
- package/dist/resources/agents/reviewer.md +48 -0
- package/dist/resources/agents/security.md +59 -0
- package/dist/resources/agents/tester.md +50 -0
- package/dist/resources/agents/typescript-pro.md +41 -235
- package/dist/resources/extensions/async-jobs/await-tool.js +7 -4
- package/dist/resources/extensions/async-jobs/job-manager.js +28 -3
- package/dist/resources/extensions/claude-code-cli/partial-builder.js +40 -12
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +142 -14
- package/dist/resources/extensions/gsd/auto/infra-errors.js +34 -0
- package/dist/resources/extensions/gsd/auto/loop.js +116 -2
- package/dist/resources/extensions/gsd/auto/phases.js +5 -1
- package/dist/resources/extensions/gsd/auto/session.js +11 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +22 -16
- package/dist/resources/extensions/gsd/auto-model-selection.js +10 -2
- package/dist/resources/extensions/gsd/auto-post-unit.js +6 -0
- package/dist/resources/extensions/gsd/auto-prompts.js +88 -33
- package/dist/resources/extensions/gsd/auto-recovery.js +11 -0
- package/dist/resources/extensions/gsd/auto-start.js +34 -7
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +1 -1
- package/dist/resources/extensions/gsd/auto-worktree.js +1 -1
- package/dist/resources/extensions/gsd/auto.js +81 -19
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +3 -3
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +11 -11
- package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +63 -51
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +6 -0
- package/dist/resources/extensions/gsd/commands/context.js +15 -6
- package/dist/resources/extensions/gsd/commands/dispatcher.js +12 -2
- package/dist/resources/extensions/gsd/commands/handlers/auto.js +10 -33
- package/dist/resources/extensions/gsd/commands/handlers/core.js +56 -11
- package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +15 -6
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +4 -10
- package/dist/resources/extensions/gsd/commands-handlers.js +4 -1
- package/dist/resources/extensions/gsd/context-injector.js +1 -1
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +3 -7
- package/dist/resources/extensions/gsd/dashboard-overlay.js +8 -3
- package/dist/resources/extensions/gsd/definition-io.js +15 -0
- package/dist/resources/extensions/gsd/dispatch-guard.js +22 -1
- package/dist/resources/extensions/gsd/doctor-providers.js +23 -0
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +6 -3
- package/dist/resources/extensions/gsd/error-classifier.js +5 -2
- package/dist/resources/extensions/gsd/forensics.js +19 -6
- package/dist/resources/extensions/gsd/gate-registry.js +208 -0
- package/dist/resources/extensions/gsd/git-service.js +11 -8
- package/dist/resources/extensions/gsd/gitignore.js +12 -6
- package/dist/resources/extensions/gsd/gsd-db.js +90 -6
- package/dist/resources/extensions/gsd/guided-flow.js +5 -10
- package/dist/resources/extensions/gsd/key-manager.js +2 -0
- package/dist/resources/extensions/gsd/metrics.js +1 -0
- package/dist/resources/extensions/gsd/milestone-actions.js +10 -4
- package/dist/resources/extensions/gsd/milestone-validation-gates.js +11 -12
- package/dist/resources/extensions/gsd/notification-overlay.js +42 -13
- package/dist/resources/extensions/gsd/notification-store.js +56 -5
- package/dist/resources/extensions/gsd/notification-widget.js +5 -13
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +8 -3
- package/dist/resources/extensions/gsd/pre-execution-checks.js +35 -2
- package/dist/resources/extensions/gsd/preferences-skills.js +2 -34
- package/dist/resources/extensions/gsd/preferences-types.js +15 -0
- package/dist/resources/extensions/gsd/preferences.js +16 -3
- package/dist/resources/extensions/gsd/prompt-loader.js +4 -1
- package/dist/resources/extensions/gsd/prompt-validation.js +126 -0
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +5 -3
- package/dist/resources/extensions/gsd/prompts/discuss.md +123 -12
- package/dist/resources/extensions/gsd/prompts/execute-task.md +22 -19
- package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
- package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
- package/dist/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
- package/dist/resources/extensions/gsd/prompts/queue.md +3 -2
- package/dist/resources/extensions/gsd/prompts/system.md +1 -0
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
- package/dist/resources/extensions/gsd/session-model-override.js +25 -0
- package/dist/resources/extensions/gsd/shortcut-defs.js +40 -0
- package/dist/resources/extensions/gsd/state.js +29 -2
- package/dist/resources/extensions/gsd/tools/complete-slice.js +52 -1
- package/dist/resources/extensions/gsd/tools/complete-task.js +51 -1
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +4 -1
- package/dist/resources/extensions/gsd/workflow-projections.js +7 -0
- package/dist/resources/extensions/gsd/worktree-manager.js +30 -3
- package/dist/resources/extensions/gsd/write-intercept.js +10 -1
- package/dist/resources/extensions/ollama/index.js +17 -10
- package/dist/resources/extensions/ollama/ollama-client.js +35 -6
- package/dist/resources/extensions/ollama/ollama-discovery.js +32 -6
- package/dist/resources/extensions/shared/gsd-phase-state.js +35 -0
- package/dist/resources/extensions/subagent/agents.js +8 -0
- package/dist/resources/extensions/subagent/index.js +17 -0
- package/dist/resources/skills/create-skill/SKILL.md +2 -0
- package/dist/startup-model-validation.d.ts +0 -1
- package/dist/startup-model-validation.js +6 -2
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +15 -15
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/required-server-files.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +3 -3
- 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 +15 -15
- package/dist/web/standalone/.next/server/chunks/2331.js +16 -16
- package/dist/web/standalone/.next/server/chunks/4741.js +12 -12
- package/dist/web/standalone/.next/server/chunks/5822.js +2 -2
- package/dist/web/standalone/.next/server/chunks/63.js +8 -8
- package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
- package/dist/web/standalone/.next/server/edge-runtime-webpack.js +2 -0
- package/dist/web/standalone/.next/server/functions-config-manifest.json +0 -9
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +29 -2
- package/dist/web/standalone/.next/server/middleware.js +4 -12
- 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/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-f1e30ab6bb269149.js +1 -0
- package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
- package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
- package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
- package/dist/web/standalone/server.js +1 -1
- package/package.json +1 -1
- package/packages/mcp-server/dist/server.d.ts +12 -1
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +90 -42
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +22 -12
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/server.ts +110 -38
- package/packages/mcp-server/src/workflow-tools.test.ts +110 -0
- package/packages/mcp-server/src/workflow-tools.ts +32 -12
- package/packages/pi-ai/dist/env-api-keys.js +1 -0
- package/packages/pi-ai/dist/env-api-keys.js.map +1 -1
- package/packages/pi-ai/dist/models.custom.d.ts +105 -0
- package/packages/pi-ai/dist/models.custom.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.custom.js +97 -0
- package/packages/pi-ai/dist/models.custom.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.d.ts +648 -140
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +867 -370
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.test.d.ts +2 -0
- package/packages/pi-ai/dist/models.generated.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/models.generated.test.js +334 -0
- package/packages/pi-ai/dist/models.generated.test.js.map +1 -0
- package/packages/pi-ai/dist/models.test.js +105 -0
- package/packages/pi-ai/dist/models.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.js +11 -2
- package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +20 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +4 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +8 -3
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js +44 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +2 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +7 -4
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +11 -0
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/dist/types.d.ts +1 -1
- 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/oauth/github-copilot.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js +5 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +57 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -0
- package/packages/pi-ai/src/env-api-keys.ts +1 -0
- package/packages/pi-ai/src/models.custom.ts +98 -0
- package/packages/pi-ai/src/models.generated.test.ts +373 -0
- package/packages/pi-ai/src/models.generated.ts +867 -370
- package/packages/pi-ai/src/models.test.ts +135 -0
- package/packages/pi-ai/src/providers/amazon-bedrock.ts +13 -1
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +32 -0
- package/packages/pi-ai/src/providers/anthropic-shared.test.ts +55 -1
- package/packages/pi-ai/src/providers/anthropic-shared.ts +14 -3
- package/packages/pi-ai/src/providers/anthropic.ts +8 -4
- package/packages/pi-ai/src/providers/openai-completions.ts +14 -0
- package/packages/pi-ai/src/types.ts +1 -0
- package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +71 -0
- package/packages/pi-ai/src/utils/oauth/github-copilot.ts +4 -1
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js +61 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +2 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +10 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js +27 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js +85 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js +64 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js +23 -18
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts +8 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.js +75 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +5 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js +55 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js +57 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +11 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +47 -5
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.js +71 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js +13 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +36 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +24 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js +9 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +130 -12
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +7 -2
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js +6 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -3
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +4 -2
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-renderable-tools.test.ts +70 -0
- package/packages/pi-coding-agent/src/core/agent-session.ts +2 -1
- package/packages/pi-coding-agent/src/core/auth-storage.test.ts +108 -0
- package/packages/pi-coding-agent/src/core/auth-storage.ts +30 -0
- package/packages/pi-coding-agent/src/core/model-resolver-initial-model-auth.test.ts +78 -0
- package/packages/pi-coding-agent/src/core/model-resolver.test.ts +85 -0
- package/packages/pi-coding-agent/src/core/model-resolver.ts +23 -18
- package/packages/pi-coding-agent/src/core/retry-handler.test.ts +83 -0
- package/packages/pi-coding-agent/src/core/retry-handler.ts +60 -1
- package/packages/pi-coding-agent/src/core/sdk.test.ts +89 -0
- package/packages/pi-coding-agent/src/core/sdk.ts +55 -9
- package/packages/pi-coding-agent/src/index.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/login-dialog.test.ts +24 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +72 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +30 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +15 -6
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +131 -12
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +7 -2
- package/packages/pi-coding-agent/src/modes/interactive/controllers/model-controller.ts +6 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +4 -3
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +4 -2
- package/packages/pi-tui/dist/components/__tests__/editor.test.js +12 -0
- package/packages/pi-tui/dist/components/__tests__/editor.test.js.map +1 -1
- package/packages/pi-tui/dist/components/__tests__/input.test.js +12 -0
- package/packages/pi-tui/dist/components/__tests__/input.test.js.map +1 -1
- package/packages/pi-tui/dist/keys.d.ts.map +1 -1
- package/packages/pi-tui/dist/keys.js +27 -0
- package/packages/pi-tui/dist/keys.js.map +1 -1
- package/packages/pi-tui/src/components/__tests__/editor.test.ts +18 -0
- package/packages/pi-tui/src/components/__tests__/input.test.ts +18 -0
- package/packages/pi-tui/src/keys.ts +32 -0
- package/pkg/package.json +1 -1
- package/src/resources/GSD-WORKFLOW.md +1 -1
- package/src/resources/agents/debugger.md +58 -0
- package/src/resources/agents/doc-writer.md +43 -0
- package/src/resources/agents/git-ops.md +56 -0
- package/src/resources/agents/javascript-pro.md +46 -271
- package/src/resources/agents/planner.md +55 -0
- package/src/resources/agents/refactorer.md +47 -0
- package/src/resources/agents/reviewer.md +48 -0
- package/src/resources/agents/security.md +59 -0
- package/src/resources/agents/tester.md +50 -0
- package/src/resources/agents/typescript-pro.md +41 -235
- package/src/resources/extensions/async-jobs/await-tool.test.ts +40 -7
- package/src/resources/extensions/async-jobs/await-tool.ts +7 -4
- package/src/resources/extensions/async-jobs/job-manager.ts +33 -3
- package/src/resources/extensions/claude-code-cli/partial-builder.ts +45 -12
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +152 -13
- package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +91 -2
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +301 -6
- package/src/resources/extensions/gsd/auto/infra-errors.ts +38 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +2 -0
- package/src/resources/extensions/gsd/auto/loop.ts +134 -2
- package/src/resources/extensions/gsd/auto/phases.ts +6 -0
- package/src/resources/extensions/gsd/auto/session.ts +11 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +29 -18
- package/src/resources/extensions/gsd/auto-model-selection.ts +9 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +7 -0
- package/src/resources/extensions/gsd/auto-prompts.ts +111 -33
- package/src/resources/extensions/gsd/auto-recovery.ts +10 -0
- package/src/resources/extensions/gsd/auto-start.ts +41 -7
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +1 -1
- package/src/resources/extensions/gsd/auto-worktree.ts +1 -1
- package/src/resources/extensions/gsd/auto.ts +97 -20
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +3 -3
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +10 -10
- package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +79 -60
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +7 -0
- package/src/resources/extensions/gsd/commands/context.ts +16 -5
- package/src/resources/extensions/gsd/commands/dispatcher.ts +14 -2
- package/src/resources/extensions/gsd/commands/handlers/auto.ts +10 -36
- package/src/resources/extensions/gsd/commands/handlers/core.ts +58 -11
- package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +17 -7
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +4 -10
- package/src/resources/extensions/gsd/commands-handlers.ts +5 -1
- package/src/resources/extensions/gsd/context-injector.ts +1 -1
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +4 -8
- package/src/resources/extensions/gsd/dashboard-overlay.ts +10 -3
- package/src/resources/extensions/gsd/definition-io.ts +18 -0
- package/src/resources/extensions/gsd/dispatch-guard.ts +23 -1
- package/src/resources/extensions/gsd/doctor-providers.ts +24 -0
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +6 -3
- package/src/resources/extensions/gsd/error-classifier.ts +5 -2
- package/src/resources/extensions/gsd/forensics.ts +23 -7
- package/src/resources/extensions/gsd/gate-registry.ts +251 -0
- package/src/resources/extensions/gsd/git-service.ts +11 -8
- package/src/resources/extensions/gsd/gitignore.ts +12 -6
- package/src/resources/extensions/gsd/gsd-db.ts +105 -6
- package/src/resources/extensions/gsd/guided-flow.ts +5 -10
- package/src/resources/extensions/gsd/interrupted-session.ts +1 -0
- package/src/resources/extensions/gsd/key-manager.ts +2 -0
- package/src/resources/extensions/gsd/metrics.ts +12 -1
- package/src/resources/extensions/gsd/milestone-actions.ts +10 -3
- package/src/resources/extensions/gsd/milestone-validation-gates.ts +11 -13
- package/src/resources/extensions/gsd/notification-overlay.ts +47 -14
- package/src/resources/extensions/gsd/notification-store.ts +54 -5
- package/src/resources/extensions/gsd/notification-widget.ts +5 -14
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +10 -3
- package/src/resources/extensions/gsd/pre-execution-checks.ts +39 -2
- package/src/resources/extensions/gsd/preferences-skills.ts +2 -36
- package/src/resources/extensions/gsd/preferences-types.ts +16 -0
- package/src/resources/extensions/gsd/preferences.ts +19 -6
- package/src/resources/extensions/gsd/prompt-loader.ts +6 -1
- package/src/resources/extensions/gsd/prompt-validation.ts +157 -0
- package/src/resources/extensions/gsd/prompts/complete-slice.md +5 -3
- package/src/resources/extensions/gsd/prompts/discuss.md +123 -12
- package/src/resources/extensions/gsd/prompts/execute-task.md +22 -19
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
- package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
- package/src/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
- package/src/resources/extensions/gsd/prompts/queue.md +3 -2
- package/src/resources/extensions/gsd/prompts/system.md +1 -0
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
- package/src/resources/extensions/gsd/session-model-override.ts +36 -0
- package/src/resources/extensions/gsd/shortcut-defs.ts +56 -0
- package/src/resources/extensions/gsd/state.ts +33 -2
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +25 -9
- package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +28 -0
- package/src/resources/extensions/gsd/tests/block-db-writes.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/complete-slice-gate-closure.test.ts +167 -0
- package/src/resources/extensions/gsd/tests/complete-slice-prompt-task-summary-layout.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/definition-io.test.ts +57 -0
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/doctor-heal-fixable-warnings.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/execute-task-prompt-existing-artifact-guard.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/false-degraded-mode-warning.test.ts +104 -0
- package/src/resources/extensions/gsd/tests/forensics-stuck-loops.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/format-shortcut.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/gate-dispatch.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/gate-registry.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +107 -5
- package/src/resources/extensions/gsd/tests/gsd-no-project-error.test.ts +73 -0
- package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +180 -0
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +66 -1
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +8 -6
- package/src/resources/extensions/gsd/tests/key-manager.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/model-isolation.test.ts +36 -51
- package/src/resources/extensions/gsd/tests/notification-store.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/notification-widget.test.ts +26 -0
- package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/plan-milestone-artifact-verification.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +34 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +49 -0
- package/src/resources/extensions/gsd/tests/preferences-formatting.test.ts +87 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/projection-regression.test.ts +96 -1
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/prompt-loader-working-directory.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/prompt-system-gate-coverage.test.ts +208 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +97 -0
- package/src/resources/extensions/gsd/tests/register-shortcuts.test.ts +63 -5
- package/src/resources/extensions/gsd/tests/session-model-override.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/stale-slice-rows.test.ts +41 -0
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/validate-milestone-prompt-verification-classes.test.ts +18 -0
- package/src/resources/extensions/gsd/tools/complete-slice.ts +63 -0
- package/src/resources/extensions/gsd/tools/complete-task.ts +63 -0
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +4 -1
- package/src/resources/extensions/gsd/types.ts +26 -0
- package/src/resources/extensions/gsd/workflow-projections.ts +8 -0
- package/src/resources/extensions/gsd/worktree-manager.ts +29 -3
- package/src/resources/extensions/gsd/write-intercept.ts +10 -1
- package/src/resources/extensions/ollama/index.ts +17 -8
- package/src/resources/extensions/ollama/ollama-client.ts +35 -6
- package/src/resources/extensions/ollama/ollama-discovery.ts +37 -6
- package/src/resources/extensions/ollama/ollama-status-indicator.test.ts +28 -0
- package/src/resources/extensions/ollama/tests/ollama-discovery.test.ts +54 -0
- package/src/resources/extensions/shared/gsd-phase-state.ts +42 -0
- package/src/resources/extensions/shared/tests/gsd-phase-state.test.ts +48 -0
- package/src/resources/extensions/subagent/agents.ts +10 -0
- package/src/resources/extensions/subagent/index.ts +18 -0
- package/src/resources/extensions/subagent/tests/agents-conflicts.test.ts +33 -0
- package/src/resources/skills/create-skill/SKILL.md +2 -0
- package/dist/web/standalone/.next/static/chunks/app/page-7115e62689b5fd84.js +0 -1
- package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
- /package/dist/web/standalone/.next/static/{nPky_WQC28aBD77eZsRAB → NzO79SOz9jHX-VY5-0t2O}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{nPky_WQC28aBD77eZsRAB → NzO79SOz9jHX-VY5-0t2O}/_ssgManifest.js +0 -0
|
@@ -87,6 +87,10 @@ export class AutoSession {
|
|
|
87
87
|
previousProjectRootEnv: string | null = null;
|
|
88
88
|
hadProjectRootEnv = false;
|
|
89
89
|
projectRootEnvCaptured = false;
|
|
90
|
+
previousMilestoneLockEnv: string | null = null;
|
|
91
|
+
hadMilestoneLockEnv = false;
|
|
92
|
+
milestoneLockEnvCaptured = false;
|
|
93
|
+
sessionMilestoneLock: string | null = null;
|
|
90
94
|
gitService: GitServiceImpl | null = null;
|
|
91
95
|
|
|
92
96
|
// ── Dispatch counters ────────────────────────────────────────────────────
|
|
@@ -107,6 +111,8 @@ export class AutoSession {
|
|
|
107
111
|
|
|
108
112
|
// ── Model state ──────────────────────────────────────────────────────────
|
|
109
113
|
autoModeStartModel: StartModel | null = null;
|
|
114
|
+
/** Explicit /gsd model pin captured at bootstrap (session-scoped policy override). */
|
|
115
|
+
manualSessionModelOverride: StartModel | null = null;
|
|
110
116
|
currentUnitModel: Model<Api> | null = null;
|
|
111
117
|
/** Fully-qualified model ID (provider/id) set after selectAndApplyModel + hook overrides (#2899). */
|
|
112
118
|
currentDispatchedModelId: string | null = null;
|
|
@@ -200,6 +206,10 @@ export class AutoSession {
|
|
|
200
206
|
this.previousProjectRootEnv = null;
|
|
201
207
|
this.hadProjectRootEnv = false;
|
|
202
208
|
this.projectRootEnvCaptured = false;
|
|
209
|
+
this.previousMilestoneLockEnv = null;
|
|
210
|
+
this.hadMilestoneLockEnv = false;
|
|
211
|
+
this.milestoneLockEnvCaptured = false;
|
|
212
|
+
this.sessionMilestoneLock = null;
|
|
203
213
|
this.gitService = null;
|
|
204
214
|
|
|
205
215
|
// Dispatch
|
|
@@ -214,6 +224,7 @@ export class AutoSession {
|
|
|
214
224
|
|
|
215
225
|
// Model
|
|
216
226
|
this.autoModeStartModel = null;
|
|
227
|
+
this.manualSessionModelOverride = null;
|
|
217
228
|
this.currentUnitModel = null;
|
|
218
229
|
this.currentDispatchedModelId = null;
|
|
219
230
|
this.originalModelId = null;
|
|
@@ -6,7 +6,13 @@
|
|
|
6
6
|
* or AutoContext dependency. State accessors are passed as callbacks.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type {
|
|
9
|
+
import type {
|
|
10
|
+
ExtensionContext,
|
|
11
|
+
ExtensionCommandContext,
|
|
12
|
+
SessionMessageEntry,
|
|
13
|
+
ReadonlyFooterDataProvider,
|
|
14
|
+
Theme,
|
|
15
|
+
} from "@gsd/pi-coding-agent";
|
|
10
16
|
import type { GSDState } from "./types.js";
|
|
11
17
|
import { getCurrentBranch } from "./worktree.js";
|
|
12
18
|
import { getActiveHook } from "./post-unit-hooks.js";
|
|
@@ -17,7 +23,6 @@ import {
|
|
|
17
23
|
resolveSliceFile,
|
|
18
24
|
} from "./paths.js";
|
|
19
25
|
import { isDbAvailable, getMilestoneSlices, getSliceTasks } from "./gsd-db.js";
|
|
20
|
-
import { formatShortcut } from "./files.js";
|
|
21
26
|
import { readFileSync, writeFileSync, existsSync } from "node:fs";
|
|
22
27
|
import { execFileSync } from "node:child_process";
|
|
23
28
|
import { truncateToWidth, visibleWidth } from "@gsd/pi-tui";
|
|
@@ -38,6 +43,7 @@ import {
|
|
|
38
43
|
type RtkSessionSavings,
|
|
39
44
|
} from "../shared/rtk-session-stats.js";
|
|
40
45
|
import { logWarning } from "./workflow-logger.js";
|
|
46
|
+
import { formattedShortcutPair } from "./shortcut-defs.js";
|
|
41
47
|
|
|
42
48
|
// ─── UAT Slice Extraction ─────────────────────────────────────────────────────
|
|
43
49
|
|
|
@@ -358,12 +364,23 @@ function getLastCommit(basePath: string): { timeAgo: string; message: string } |
|
|
|
358
364
|
// ─── Footer Factory ───────────────────────────────────────────────────────────
|
|
359
365
|
|
|
360
366
|
/**
|
|
361
|
-
* Footer factory
|
|
362
|
-
*
|
|
363
|
-
* progress widget instead, so there's no gap or redundancy.
|
|
367
|
+
* Footer factory used by auto-mode.
|
|
368
|
+
* Keep footer minimal but preserve extension status context from setStatus().
|
|
364
369
|
*/
|
|
365
|
-
|
|
366
|
-
|
|
370
|
+
function sanitizeFooterStatus(text: string): string {
|
|
371
|
+
return text.replace(/\s+/g, " ").trim();
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export const hideFooter = (_tui: unknown, theme: Theme, footerData: ReadonlyFooterDataProvider) => ({
|
|
375
|
+
render(width: number): string[] {
|
|
376
|
+
const extensionStatuses = footerData.getExtensionStatuses();
|
|
377
|
+
if (extensionStatuses.size === 0) return [];
|
|
378
|
+
const statusLine = Array.from(extensionStatuses.entries())
|
|
379
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
380
|
+
.map(([, text]) => sanitizeFooterStatus(text))
|
|
381
|
+
.join(" ");
|
|
382
|
+
return [truncateToWidth(theme.fg("dim", statusLine), width, theme.fg("dim", "..."))];
|
|
383
|
+
},
|
|
367
384
|
invalidate() {},
|
|
368
385
|
dispose() {},
|
|
369
386
|
});
|
|
@@ -646,14 +663,6 @@ export function updateProgressWidget(
|
|
|
646
663
|
: "";
|
|
647
664
|
lines.push(rightAlign(headerLeft, headerRight, width));
|
|
648
665
|
|
|
649
|
-
// Worktree/branch right-aligned below header
|
|
650
|
-
const branchLabel = worktreeName && cachedBranch
|
|
651
|
-
? `${worktreeName} (${cachedBranch})`
|
|
652
|
-
: cachedBranch ?? "";
|
|
653
|
-
if (branchLabel) {
|
|
654
|
-
lines.push(rightAlign("", theme.fg("dim", branchLabel), width));
|
|
655
|
-
}
|
|
656
|
-
|
|
657
666
|
// Show health signal details when degraded (yellow/red)
|
|
658
667
|
if (score.level !== "green" && score.signals.length > 0 && widgetMode !== "min") {
|
|
659
668
|
// Show up to 3 most relevant signals in compact form
|
|
@@ -917,15 +926,17 @@ export function updateProgressWidget(
|
|
|
917
926
|
// Hints line
|
|
918
927
|
const hintParts: string[] = [];
|
|
919
928
|
hintParts.push("esc pause");
|
|
920
|
-
hintParts.push(`${
|
|
929
|
+
hintParts.push(`${formattedShortcutPair("dashboard")} dashboard`);
|
|
930
|
+
hintParts.push(`${formattedShortcutPair("parallel")} parallel`);
|
|
921
931
|
const hintStr = theme.fg("dim", hintParts.join(" | "));
|
|
922
932
|
const commitStr = lastCommit
|
|
923
933
|
? theme.fg("dim", `${lastCommit.timeAgo} ago: ${commitMsg}`)
|
|
924
934
|
: "";
|
|
935
|
+
const locationStr = theme.fg("dim", widgetPwd);
|
|
925
936
|
if (commitStr) {
|
|
926
|
-
lines.push(rightAlign(`${pad}${commitStr}`, hintStr, width));
|
|
937
|
+
lines.push(rightAlign(`${pad}${locationStr} · ${commitStr}`, hintStr, width));
|
|
927
938
|
} else {
|
|
928
|
-
lines.push(rightAlign(
|
|
939
|
+
lines.push(rightAlign(`${pad}${locationStr}`, hintStr, width));
|
|
929
940
|
}
|
|
930
941
|
|
|
931
942
|
lines.push(...ui.bar());
|
|
@@ -14,6 +14,7 @@ import { classifyUnitComplexity, tierLabel } from "./complexity-classifier.js";
|
|
|
14
14
|
import { resolveModelForComplexity, escalateTier, getEligibleModels, loadCapabilityOverrides, adjustToolSet, filterToolsForProvider } from "./model-router.js";
|
|
15
15
|
import { getLedger, getProjectTotals } from "./metrics.js";
|
|
16
16
|
import { unitPhaseLabel } from "./auto-dashboard.js";
|
|
17
|
+
import { getSessionModelOverride } from "./session-model-override.js";
|
|
17
18
|
|
|
18
19
|
export interface ModelSelectionResult {
|
|
19
20
|
/** Routing metadata for metrics recording */
|
|
@@ -72,8 +73,15 @@ export async function selectAndApplyModel(
|
|
|
72
73
|
/** When false (interactive/guided-flow), skip dynamic routing and use the session model.
|
|
73
74
|
* Dynamic routing only applies in auto-mode where cost optimization is expected. (#3962) */
|
|
74
75
|
isAutoMode = true,
|
|
76
|
+
/** Explicit /gsd model pin captured at bootstrap for long-running auto loops. */
|
|
77
|
+
sessionModelOverride?: { provider: string; id: string } | null,
|
|
75
78
|
): Promise<ModelSelectionResult> {
|
|
76
|
-
const
|
|
79
|
+
const effectiveSessionModelOverride = sessionModelOverride === undefined
|
|
80
|
+
? getSessionModelOverride(ctx.sessionManager.getSessionId())
|
|
81
|
+
: (sessionModelOverride ?? undefined);
|
|
82
|
+
const modelConfig = effectiveSessionModelOverride
|
|
83
|
+
? undefined
|
|
84
|
+
: resolvePreferredModelConfig(unitType, autoModeStartModel, isAutoMode);
|
|
77
85
|
let routing: { tier: string; modelDowngraded: boolean } | null = null;
|
|
78
86
|
let appliedModel: Model<Api> | null = null;
|
|
79
87
|
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
buildTaskFileName,
|
|
26
26
|
} from "./paths.js";
|
|
27
27
|
import { invalidateAllCaches } from "./cache.js";
|
|
28
|
+
import { rebuildState } from "./doctor.js";
|
|
28
29
|
import { parseUnitId } from "./unit-id.js";
|
|
29
30
|
import { closeoutUnit, type CloseoutOptions } from "./auto-unit-closeout.js";
|
|
30
31
|
import {
|
|
@@ -367,6 +368,12 @@ export async function postUnitPreVerification(pctx: PostUnitContext, opts?: PreV
|
|
|
367
368
|
}
|
|
368
369
|
});
|
|
369
370
|
|
|
371
|
+
// Keep the on-disk STATE.md aligned with the live derived state after
|
|
372
|
+
// ordinary unit completion, before any worktree state is synced back.
|
|
373
|
+
await runSafely("postUnit", "state-rebuild", async () => {
|
|
374
|
+
await rebuildState(s.basePath);
|
|
375
|
+
});
|
|
376
|
+
|
|
370
377
|
// Sync worktree state back to project root (skipped for lightweight sidecars)
|
|
371
378
|
if (!opts?.skipWorktreeSync && s.originalBasePath && s.originalBasePath !== s.basePath) {
|
|
372
379
|
await runSafely("postUnit", "worktree-sync", () => {
|
|
@@ -24,7 +24,13 @@ import { getLoadedSkills, type Skill } from "@gsd/pi-coding-agent";
|
|
|
24
24
|
import { join, basename } from "node:path";
|
|
25
25
|
import { existsSync } from "node:fs";
|
|
26
26
|
import { computeBudgets, resolveExecutorContextWindow, truncateAtSectionBoundary } from "./context-budget.js";
|
|
27
|
-
import { getPendingGates } from "./gsd-db.js";
|
|
27
|
+
import { getPendingGates, getPendingGatesForTurn } from "./gsd-db.js";
|
|
28
|
+
import {
|
|
29
|
+
GATE_REGISTRY,
|
|
30
|
+
assertGateCoverage,
|
|
31
|
+
getGatesForTurn,
|
|
32
|
+
type GateDefinition,
|
|
33
|
+
} from "./gate-registry.js";
|
|
28
34
|
import { formatDecisionsCompact, formatRequirementsCompact } from "./structured-data-formatter.js";
|
|
29
35
|
import { readPhaseAnchor, formatAnchorForPrompt } from "./phase-anchor.js";
|
|
30
36
|
import { logWarning } from "./workflow-logger.js";
|
|
@@ -1395,6 +1401,17 @@ export async function buildExecuteTaskPrompt(
|
|
|
1395
1401
|
|
|
1396
1402
|
const phaseAnchorSection = planAnchor ? formatAnchorForPrompt(planAnchor) : "";
|
|
1397
1403
|
|
|
1404
|
+
// Task-scoped gates owned by execute-task (Q5/Q6/Q7). Pull only the
|
|
1405
|
+
// gates that plan-slice actually seeded for this task — tasks with no
|
|
1406
|
+
// external dependencies legitimately skip Q5, tasks with no runtime
|
|
1407
|
+
// load dimension skip Q6, etc.
|
|
1408
|
+
const etPending = getPendingGatesForTurn(mid, sid, "execute-task", tid);
|
|
1409
|
+
assertGateCoverage(etPending, "execute-task", { requireAll: false });
|
|
1410
|
+
const gatesToClose = renderGatesToCloseBlock(
|
|
1411
|
+
getGatesForTurn("execute-task"),
|
|
1412
|
+
{ pending: new Set(etPending.map((g) => g.gate_id)), allowOmit: true },
|
|
1413
|
+
);
|
|
1414
|
+
|
|
1398
1415
|
return loadPrompt("execute-task", {
|
|
1399
1416
|
overridesSection,
|
|
1400
1417
|
runtimeContext,
|
|
@@ -1412,6 +1429,7 @@ export async function buildExecuteTaskPrompt(
|
|
|
1412
1429
|
taskSummaryPath,
|
|
1413
1430
|
inlinedTemplates,
|
|
1414
1431
|
verificationBudget,
|
|
1432
|
+
gatesToClose,
|
|
1415
1433
|
skillActivation: buildSkillActivationBlock({
|
|
1416
1434
|
base,
|
|
1417
1435
|
milestoneId: mid,
|
|
@@ -1477,6 +1495,19 @@ export async function buildCompleteSlicePrompt(
|
|
|
1477
1495
|
const sliceSummaryPath = join(base, `${sliceRel}/${sid}-SUMMARY.md`);
|
|
1478
1496
|
const sliceUatPath = join(base, `${sliceRel}/${sid}-UAT.md`);
|
|
1479
1497
|
|
|
1498
|
+
// Gates owned by complete-slice (e.g. Q8). Pull from the DB so the
|
|
1499
|
+
// prompt only prompts for gates the plan actually seeded. The tool
|
|
1500
|
+
// handler closes each gate based on the SUMMARY.md section content
|
|
1501
|
+
// after the assistant calls gsd_complete_slice.
|
|
1502
|
+
const csPending = getPendingGatesForTurn(mid, sid, "complete-slice");
|
|
1503
|
+
// coverage check: every pending row must be owned by complete-slice.
|
|
1504
|
+
// requireAll:false because a slice may have already closed some gates.
|
|
1505
|
+
assertGateCoverage(csPending, "complete-slice", { requireAll: false });
|
|
1506
|
+
const gatesToClose = renderGatesToCloseBlock(
|
|
1507
|
+
getGatesForTurn("complete-slice"),
|
|
1508
|
+
{ pending: new Set(csPending.map((g) => g.gate_id)), allowOmit: true },
|
|
1509
|
+
);
|
|
1510
|
+
|
|
1480
1511
|
return loadPrompt("complete-slice", {
|
|
1481
1512
|
workingDirectory: base,
|
|
1482
1513
|
milestoneId: mid, sliceId: sid, sliceTitle: sTitle,
|
|
@@ -1485,6 +1516,7 @@ export async function buildCompleteSlicePrompt(
|
|
|
1485
1516
|
inlinedContext,
|
|
1486
1517
|
sliceSummaryPath,
|
|
1487
1518
|
sliceUatPath,
|
|
1519
|
+
gatesToClose,
|
|
1488
1520
|
});
|
|
1489
1521
|
}
|
|
1490
1522
|
|
|
@@ -1675,6 +1707,16 @@ export async function buildValidateMilestonePrompt(
|
|
|
1675
1707
|
const validationOutputPath = join(base, `${relMilestonePath(base, mid)}/${mid}-VALIDATION.md`);
|
|
1676
1708
|
const roadmapOutputPath = `${relMilestonePath(base, mid)}/${mid}-ROADMAP.md`;
|
|
1677
1709
|
|
|
1710
|
+
// Every milestone validation turn owns MV01–MV04 unconditionally: the
|
|
1711
|
+
// registry is the source of truth for which gates the validator must
|
|
1712
|
+
// address, and the block below is what the template renders so the
|
|
1713
|
+
// assistant can never accidentally skip one.
|
|
1714
|
+
const mvGates = getGatesForTurn("validate-milestone");
|
|
1715
|
+
const gatesToEvaluate = renderGatesToCloseBlock(mvGates, {
|
|
1716
|
+
pending: new Set(mvGates.map((g) => g.id)),
|
|
1717
|
+
allowOmit: false,
|
|
1718
|
+
});
|
|
1719
|
+
|
|
1678
1720
|
return loadPrompt("validate-milestone", {
|
|
1679
1721
|
workingDirectory: base,
|
|
1680
1722
|
milestoneId: mid,
|
|
@@ -1683,6 +1725,7 @@ export async function buildValidateMilestonePrompt(
|
|
|
1683
1725
|
inlinedContext,
|
|
1684
1726
|
validationPath: validationOutputPath,
|
|
1685
1727
|
remediationRound: String(remediationRound),
|
|
1728
|
+
gatesToEvaluate,
|
|
1686
1729
|
skillActivation: buildSkillActivationBlock({
|
|
1687
1730
|
base,
|
|
1688
1731
|
milestoneId: mid,
|
|
@@ -1955,27 +1998,51 @@ export async function buildReactiveExecutePrompt(
|
|
|
1955
1998
|
}
|
|
1956
1999
|
|
|
1957
2000
|
// ─── Gate Evaluation ──────────────────────────────────────────────────────
|
|
2001
|
+
//
|
|
2002
|
+
// Gate definitions (question, guidance, owner turn) now live in
|
|
2003
|
+
// gate-registry.ts so that prompt builders, dispatch rules, state
|
|
2004
|
+
// derivation, and tool handlers all consult the same source of truth.
|
|
2005
|
+
// See gate-registry.ts for the full ownership map.
|
|
1958
2006
|
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
2007
|
+
/**
|
|
2008
|
+
* Render a "Gates to Close" block for turns like `complete-slice` and
|
|
2009
|
+
* `validate-milestone` that own gates which are closed as a side-effect
|
|
2010
|
+
* of writing artifact sections (not via a dedicated gate-evaluate
|
|
2011
|
+
* subagent loop).
|
|
2012
|
+
*
|
|
2013
|
+
* Returns a plain-text block or an empty string if there are no gates to
|
|
2014
|
+
* close, so callers can drop it straight into a template variable.
|
|
2015
|
+
*/
|
|
2016
|
+
function renderGatesToCloseBlock(
|
|
2017
|
+
gates: ReadonlyArray<GateDefinition>,
|
|
2018
|
+
opts: { pending: ReadonlySet<string>; allowOmit: boolean },
|
|
2019
|
+
): string {
|
|
2020
|
+
const applicable = gates.filter((g) => opts.pending.has(g.id));
|
|
2021
|
+
if (applicable.length === 0) return "";
|
|
2022
|
+
|
|
2023
|
+
const lines: string[] = [];
|
|
2024
|
+
lines.push("## Gates to Close");
|
|
2025
|
+
lines.push("");
|
|
2026
|
+
lines.push(
|
|
2027
|
+
"These quality gates are still pending for this unit. You MUST address every one before calling the closing tool — the handler closes the DB row based on whether the corresponding artifact section is present.",
|
|
2028
|
+
);
|
|
2029
|
+
lines.push("");
|
|
2030
|
+
for (const def of applicable) {
|
|
2031
|
+
lines.push(`### ${def.id} — ${def.promptSection}`);
|
|
2032
|
+
lines.push("");
|
|
2033
|
+
lines.push(`**Question:** ${def.question}`);
|
|
2034
|
+
lines.push("");
|
|
2035
|
+
lines.push(def.guidance);
|
|
2036
|
+
if (opts.allowOmit) {
|
|
2037
|
+
lines.push("");
|
|
2038
|
+
lines.push(
|
|
2039
|
+
`If this gate genuinely does not apply to this unit, leave the **${def.promptSection}** section empty and the handler will record it as \`omitted\`. Otherwise, fill the section with concrete evidence.`,
|
|
2040
|
+
);
|
|
2041
|
+
}
|
|
2042
|
+
lines.push("");
|
|
2043
|
+
}
|
|
2044
|
+
return lines.join("\n").trimEnd();
|
|
2045
|
+
}
|
|
1979
2046
|
|
|
1980
2047
|
export async function buildParallelResearchSlicesPrompt(
|
|
1981
2048
|
mid: string,
|
|
@@ -2011,28 +2078,39 @@ export async function buildGateEvaluatePrompt(
|
|
|
2011
2078
|
mid: string, midTitle: string, sid: string, sTitle: string,
|
|
2012
2079
|
base: string,
|
|
2013
2080
|
): Promise<string> {
|
|
2014
|
-
|
|
2081
|
+
// Pull only the gates this turn actually owns (Q3/Q4). Filter via the
|
|
2082
|
+
// registry so that scope:"slice" gates owned by other turns (Q8) can't
|
|
2083
|
+
// leak into this prompt and can't block dispatch via silent skip.
|
|
2084
|
+
const pending = getPendingGatesForTurn(mid, sid, "gate-evaluate");
|
|
2085
|
+
|
|
2086
|
+
// Fails loudly if the pending list contains a gate id the registry
|
|
2087
|
+
// doesn't own for this turn. Missing owned gates is allowed here —
|
|
2088
|
+
// `gate-evaluate` is dispatched whenever *any* of its owned gates are
|
|
2089
|
+
// pending, not only when all of them are.
|
|
2090
|
+
assertGateCoverage(pending, "gate-evaluate", { requireAll: false });
|
|
2015
2091
|
|
|
2016
2092
|
// Load the slice plan for context
|
|
2017
2093
|
const planFile = resolveSliceFile(base, mid, sid, "PLAN");
|
|
2018
2094
|
const planContent = planFile ? (await loadFile(planFile)) ?? "(plan file empty)" : "(plan file not found)";
|
|
2019
2095
|
|
|
2020
|
-
// Build per-gate subagent prompts
|
|
2096
|
+
// Build per-gate subagent prompts from the pending rows. Because the
|
|
2097
|
+
// registry has already validated every row, `getGateDefinition` cannot
|
|
2098
|
+
// return undefined here.
|
|
2099
|
+
const pendingIds = new Set(pending.map((g) => g.gate_id));
|
|
2100
|
+
const gateDefs = getGatesForTurn("gate-evaluate").filter((def) => pendingIds.has(def.id));
|
|
2101
|
+
|
|
2021
2102
|
const subagentSections: string[] = [];
|
|
2022
2103
|
const gateListLines: string[] = [];
|
|
2023
2104
|
|
|
2024
|
-
for (const
|
|
2025
|
-
|
|
2026
|
-
if (!meta) continue;
|
|
2027
|
-
|
|
2028
|
-
gateListLines.push(`- **${gate.gate_id}**: ${meta.question}`);
|
|
2105
|
+
for (const def of gateDefs) {
|
|
2106
|
+
gateListLines.push(`- **${def.id}**: ${def.question}`);
|
|
2029
2107
|
|
|
2030
2108
|
const subPrompt = [
|
|
2031
|
-
`You are evaluating quality gate **${
|
|
2109
|
+
`You are evaluating quality gate **${def.id}** for slice ${sid} (${sTitle}).`,
|
|
2032
2110
|
"",
|
|
2033
|
-
`## Question: ${
|
|
2111
|
+
`## Question: ${def.question}`,
|
|
2034
2112
|
"",
|
|
2035
|
-
|
|
2113
|
+
def.guidance,
|
|
2036
2114
|
"",
|
|
2037
2115
|
"## Slice Plan",
|
|
2038
2116
|
"",
|
|
@@ -2044,14 +2122,14 @@ export async function buildGateEvaluatePrompt(
|
|
|
2044
2122
|
`Call the \`gsd_save_gate_result\` tool with:`,
|
|
2045
2123
|
`- \`milestoneId\`: "${mid}"`,
|
|
2046
2124
|
`- \`sliceId\`: "${sid}"`,
|
|
2047
|
-
`- \`gateId\`: "${
|
|
2125
|
+
`- \`gateId\`: "${def.id}"`,
|
|
2048
2126
|
"- `verdict`: \"pass\" (no concerns), \"flag\" (concerns found), or \"omitted\" (not applicable)",
|
|
2049
2127
|
"- `rationale`: one-sentence justification",
|
|
2050
2128
|
"- `findings`: detailed markdown findings (or empty if omitted)",
|
|
2051
2129
|
].join("\n");
|
|
2052
2130
|
|
|
2053
2131
|
subagentSections.push([
|
|
2054
|
-
`### ${
|
|
2132
|
+
`### ${def.id}: ${def.question}`,
|
|
2055
2133
|
"",
|
|
2056
2134
|
"Use this as the prompt for a `subagent` call:",
|
|
2057
2135
|
"",
|
|
@@ -272,6 +272,16 @@ export function verifyExpectedArtifact(
|
|
|
272
272
|
if (!isValidationTerminal(validationContent)) return false;
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
+
if (unitType === "plan-milestone") {
|
|
276
|
+
try {
|
|
277
|
+
const roadmap = parseLegacyRoadmap(readFileSync(absPath, "utf-8"));
|
|
278
|
+
if (roadmap.slices.length === 0) return false;
|
|
279
|
+
} catch (err) {
|
|
280
|
+
logWarning("recovery", `plan-milestone roadmap verification failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
281
|
+
return false;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
275
285
|
// plan-slice must produce a plan with actual task entries, not just a scaffold.
|
|
276
286
|
// The plan file may exist from a prior discussion/context step with only headings
|
|
277
287
|
// but no tasks. Without this check the artifact is considered "complete" and the
|
|
@@ -85,6 +85,7 @@ import { sep as pathSep } from "node:path";
|
|
|
85
85
|
import { resolveProjectRootDbPath } from "./bootstrap/dynamic-tools.js";
|
|
86
86
|
import { resolveDefaultSessionModel, resolveDynamicRoutingConfig } from "./preferences-models.js";
|
|
87
87
|
import type { WorktreeResolver } from "./worktree-resolver.js";
|
|
88
|
+
import { getSessionModelOverride } from "./session-model-override.js";
|
|
88
89
|
|
|
89
90
|
export interface BootstrapDeps {
|
|
90
91
|
shouldUseWorktreeIsolation: () => boolean;
|
|
@@ -266,13 +267,42 @@ export async function bootstrapAutoSession(
|
|
|
266
267
|
// Capture the user's session model before guided-flow dispatch can apply a
|
|
267
268
|
// phase-specific planning model for a discuss turn (#2829).
|
|
268
269
|
//
|
|
269
|
-
//
|
|
270
|
-
//
|
|
271
|
-
//
|
|
272
|
-
//
|
|
270
|
+
// Precedence:
|
|
271
|
+
// 1) Explicit session override via /gsd model (this session)
|
|
272
|
+
// 2) GSD model preferences from PREFERENCES.md (validated against live auth)
|
|
273
|
+
// 3) Current session model from settings/session restore (if provider ready)
|
|
274
|
+
//
|
|
275
|
+
// This preserves #3517 defaults while honoring explicit runtime model
|
|
276
|
+
// selection for subsequent /gsd runs in the same session.
|
|
277
|
+
const manualSessionOverride = getSessionModelOverride(ctx.sessionManager.getSessionId());
|
|
273
278
|
const preferredModel = resolveDefaultSessionModel(ctx.model?.provider);
|
|
274
|
-
|
|
275
|
-
|
|
279
|
+
// Validate the preferred model against the live registry + provider auth so
|
|
280
|
+
// an unconfigured PREFERENCES.md entry (no API key / OAuth) can't become the
|
|
281
|
+
// start-model snapshot. Without this, every subsequent unit would try to
|
|
282
|
+
// fall back to an unusable model.
|
|
283
|
+
let validatedPreferredModel: { provider: string; id: string } | undefined;
|
|
284
|
+
if (preferredModel) {
|
|
285
|
+
const { resolveModelId } = await import("./auto-model-selection.js");
|
|
286
|
+
const available = ctx.modelRegistry.getAvailable();
|
|
287
|
+
const match = resolveModelId(
|
|
288
|
+
`${preferredModel.provider}/${preferredModel.id}`,
|
|
289
|
+
available,
|
|
290
|
+
ctx.model?.provider,
|
|
291
|
+
);
|
|
292
|
+
if (match) {
|
|
293
|
+
validatedPreferredModel = { provider: match.provider, id: match.id };
|
|
294
|
+
} else {
|
|
295
|
+
ctx.ui.notify(
|
|
296
|
+
`Preferred model ${preferredModel.provider}/${preferredModel.id} from PREFERENCES.md is not configured; falling back to session default.`,
|
|
297
|
+
"warning",
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
const sessionModelReady =
|
|
302
|
+
ctx.model && ctx.modelRegistry.isProviderRequestReady(ctx.model.provider);
|
|
303
|
+
const startModelSnapshot = manualSessionOverride
|
|
304
|
+
?? validatedPreferredModel
|
|
305
|
+
?? (sessionModelReady && ctx.model
|
|
276
306
|
? { provider: ctx.model.provider, id: ctx.model.id }
|
|
277
307
|
: null);
|
|
278
308
|
|
|
@@ -594,6 +624,9 @@ export async function bootstrapAutoSession(
|
|
|
594
624
|
s.consecutiveCompleteBootstraps = 0;
|
|
595
625
|
|
|
596
626
|
// ── Initialize session state ──
|
|
627
|
+
// Notify shared phase state so subagent conflict checks can fire
|
|
628
|
+
const { activateGSD: activateGSDPhaseState } = await import("../shared/gsd-phase-state.js");
|
|
629
|
+
activateGSDPhaseState();
|
|
597
630
|
s.active = true;
|
|
598
631
|
s.stepMode = requestedStepMode;
|
|
599
632
|
s.verbose = verboseMode;
|
|
@@ -678,7 +711,7 @@ export async function bootstrapAutoSession(
|
|
|
678
711
|
}
|
|
679
712
|
|
|
680
713
|
// ── DB lifecycle ──
|
|
681
|
-
const gsdDbPath =
|
|
714
|
+
const gsdDbPath = resolveProjectRootDbPath(s.basePath);
|
|
682
715
|
const gsdDirPath = join(s.basePath, ".gsd");
|
|
683
716
|
if (existsSync(gsdDirPath) && !existsSync(gsdDbPath)) {
|
|
684
717
|
const hasDecisions = existsSync(join(gsdDirPath, "DECISIONS.md"));
|
|
@@ -731,6 +764,7 @@ export async function bootstrapAutoSession(
|
|
|
731
764
|
id: startModelSnapshot.id,
|
|
732
765
|
};
|
|
733
766
|
}
|
|
767
|
+
s.manualSessionModelOverride = manualSessionOverride ?? null;
|
|
734
768
|
|
|
735
769
|
// Apply worker model override from parallel orchestrator (#worker-model).
|
|
736
770
|
// GSD_WORKER_MODEL is injected by the coordinator when parallel.worker_model
|
|
@@ -92,7 +92,7 @@ export function clearInFlightTools(): void {
|
|
|
92
92
|
* handler. When these errors occur, retrying the same unit will produce the same
|
|
93
93
|
* failure, so the retry loop must be broken.
|
|
94
94
|
*/
|
|
95
|
-
const TOOL_INVOCATION_ERROR_RE = /Validation failed for tool|Expected ',' or '\}' in JSON
|
|
95
|
+
const TOOL_INVOCATION_ERROR_RE = /Validation failed for tool|Expected ',' or '\}'(?: after property value)?(?: in JSON)?|Unexpected end of JSON|Unexpected token.*in JSON/i;
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
98
|
* Returns true if the error message indicates a tool invocation failure due to
|
|
@@ -2043,7 +2043,7 @@ export function mergeMilestoneToMain(
|
|
|
2043
2043
|
// 12. Remove worktree directory first (must happen before branch deletion)
|
|
2044
2044
|
try {
|
|
2045
2045
|
removeWorktree(originalBasePath_, milestoneId, {
|
|
2046
|
-
branch:
|
|
2046
|
+
branch: milestoneBranch,
|
|
2047
2047
|
deleteBranch: false,
|
|
2048
2048
|
});
|
|
2049
2049
|
} catch (err) {
|