gsd-pi 2.70.1 → 2.71.0-dev.246c32d
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 +57 -17
- package/dist/cli.js +29 -3
- 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/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/claude-code-cli/stream-adapter.js +242 -40
- package/dist/resources/extensions/get-secrets-from-user.js +17 -1
- package/dist/resources/extensions/gsd/auto/infra-errors.js +34 -0
- package/dist/resources/extensions/gsd/auto/loop.js +32 -1
- 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-prompts.js +88 -33
- package/dist/resources/extensions/gsd/auto-start.js +37 -18
- 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 +56 -0
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +3 -3
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +6 -0
- 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/custom-workflow-engine.js +16 -12
- package/dist/resources/extensions/gsd/dashboard-overlay.js +8 -3
- package/dist/resources/extensions/gsd/dispatch-guard.js +18 -1
- package/dist/resources/extensions/gsd/doctor-providers.js +23 -0
- package/dist/resources/extensions/gsd/error-classifier.js +5 -2
- package/dist/resources/extensions/gsd/file-lock.js +60 -0
- package/dist/resources/extensions/gsd/forensics.js +19 -6
- package/dist/resources/extensions/gsd/gate-registry.js +208 -0
- package/dist/resources/extensions/gsd/gsd-db.js +41 -0
- package/dist/resources/extensions/gsd/guided-flow.js +17 -20
- package/dist/resources/extensions/gsd/init-wizard.js +3 -11
- 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/prompt-validation.js +126 -0
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +5 -3
- package/dist/resources/extensions/gsd/prompts/discuss.md +33 -13
- 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 +241 -332
- 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 +38 -1
- package/dist/resources/extensions/gsd/workflow-events.js +25 -13
- package/dist/resources/extensions/gsd/workflow-mcp-auto-prep.js +56 -0
- package/dist/resources/extensions/gsd/workflow-mcp.js +1 -1
- package/dist/resources/extensions/ollama/index.js +13 -5
- 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 +19 -19
- 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 +1 -1
- package/dist/web/standalone/.next/required-server-files.json +4 -4
- 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 +1 -1
- 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 +1 -1
- 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 +2 -2
- 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 +19 -19
- 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-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/static/chunks/2826.dd3dc8bbd3025fa5.js +9 -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-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/.next/static/chunks/{webpack-6e4d7e9a4f57bed4.js → webpack-b868033a5834586d.js} +1 -1
- 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/env-writer.d.ts +39 -0
- package/packages/mcp-server/dist/env-writer.d.ts.map +1 -0
- package/packages/mcp-server/dist/env-writer.js +158 -0
- package/packages/mcp-server/dist/env-writer.js.map +1 -0
- package/packages/mcp-server/dist/server.d.ts +23 -3
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +192 -44
- 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/env-writer.test.ts +280 -0
- package/packages/mcp-server/src/env-writer.ts +183 -0
- package/packages/mcp-server/src/secure-env-collect.test.ts +265 -0
- package/packages/mcp-server/src/server.ts +247 -41
- 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/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/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-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/chat-controller-ordering.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +388 -0
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.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 +22 -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 +38 -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/dynamic-border.d.ts +19 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js +50 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.js +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.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 +43 -0
- 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 +175 -25
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/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-state.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +6 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +62 -5
- 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/dist/modes/rpc/rpc-mode.js +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.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/chat-controller-ordering.test.ts +468 -0
- package/packages/pi-coding-agent/src/core/extensions/types.ts +2 -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 +22 -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 +45 -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/dynamic-border.ts +58 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/extension-input.ts +2 -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 +47 -0
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +205 -31
- package/packages/pi-coding-agent/src/modes/interactive/controllers/model-controller.ts +6 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-state.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +70 -5
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +4 -2
- package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +1 -1
- package/packages/pi-coding-agent/src/modes/rpc/rpc-types.ts +1 -0
- package/packages/pi-tui/dist/components/__tests__/input.test.js +9 -0
- package/packages/pi-tui/dist/components/__tests__/input.test.js.map +1 -1
- package/packages/pi-tui/dist/components/__tests__/markdown-maxlines.test.d.ts +2 -0
- package/packages/pi-tui/dist/components/__tests__/markdown-maxlines.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/__tests__/markdown-maxlines.test.js +66 -0
- package/packages/pi-tui/dist/components/__tests__/markdown-maxlines.test.js.map +1 -0
- package/packages/pi-tui/dist/components/input.d.ts +2 -0
- package/packages/pi-tui/dist/components/input.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/input.js +7 -4
- package/packages/pi-tui/dist/components/input.js.map +1 -1
- package/packages/pi-tui/dist/components/markdown.d.ts +3 -0
- package/packages/pi-tui/dist/components/markdown.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/markdown.js +17 -1
- package/packages/pi-tui/dist/components/markdown.js.map +1 -1
- package/packages/pi-tui/src/components/__tests__/input.test.ts +11 -0
- package/packages/pi-tui/src/components/__tests__/markdown-maxlines.test.ts +75 -0
- package/packages/pi-tui/src/components/input.ts +7 -4
- package/packages/pi-tui/src/components/markdown.ts +22 -1
- 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/claude-code-cli/stream-adapter.ts +288 -39
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +330 -2
- package/src/resources/extensions/get-secrets-from-user.ts +24 -1
- 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 +45 -1
- 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-prompts.ts +111 -33
- package/src/resources/extensions/gsd/auto-start.ts +44 -20
- 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 +72 -0
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +3 -3
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +6 -0
- 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/custom-workflow-engine.ts +19 -14
- package/src/resources/extensions/gsd/dashboard-overlay.ts +10 -3
- package/src/resources/extensions/gsd/dispatch-guard.ts +18 -1
- package/src/resources/extensions/gsd/doctor-providers.ts +24 -0
- package/src/resources/extensions/gsd/error-classifier.ts +5 -2
- package/src/resources/extensions/gsd/file-lock.ts +59 -0
- package/src/resources/extensions/gsd/forensics.ts +23 -7
- package/src/resources/extensions/gsd/gate-registry.ts +251 -0
- package/src/resources/extensions/gsd/gsd-db.ts +51 -0
- package/src/resources/extensions/gsd/guided-flow.ts +17 -19
- package/src/resources/extensions/gsd/init-wizard.ts +3 -13
- package/src/resources/extensions/gsd/interrupted-session.ts +1 -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/prompt-validation.ts +157 -0
- package/src/resources/extensions/gsd/prompts/complete-slice.md +5 -3
- package/src/resources/extensions/gsd/prompts/discuss.md +33 -13
- 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 +285 -344
- 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/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/derive-state-helpers.test.ts +436 -0
- package/src/resources/extensions/gsd/tests/discuss-incremental-persistence.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +27 -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/file-lock.test.ts +103 -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-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/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/pre-execution-checks.test.ts +49 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.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-shortcuts.test.ts +63 -5
- package/src/resources/extensions/gsd/tests/secure-env-collect.test.ts +45 -0
- package/src/resources/extensions/gsd/tests/session-model-override.test.ts +35 -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/tests/workflow-mcp-auto-prep.test.ts +76 -0
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +155 -1
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +22 -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 +64 -26
- package/src/resources/extensions/gsd/types.ts +26 -0
- package/src/resources/extensions/gsd/workflow-events.ts +34 -25
- package/src/resources/extensions/gsd/workflow-mcp-auto-prep.ts +76 -0
- package/src/resources/extensions/gsd/workflow-mcp.ts +1 -1
- package/src/resources/extensions/ollama/index.ts +13 -3
- package/src/resources/extensions/ollama/ollama-status-indicator.test.ts +28 -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/2826.821e01b07d92e948.js +0 -9
- 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/{9pw9EXtXjdM7EFrCXUEPf → hnGGkVMxIGGpxSJkf5jIV}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{9pw9EXtXjdM7EFrCXUEPf → hnGGkVMxIGGpxSJkf5jIV}/_ssgManifest.js +0 -0
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
import { join } from "node:path";
|
|
10
10
|
import { mkdirSync } from "node:fs";
|
|
11
11
|
import { isClosedStatus } from "../status-guards.js";
|
|
12
|
-
import { transaction, insertMilestone, insertSlice, getSlice, getSliceTasks, getMilestone, updateSliceStatus, setSliceSummaryMd, } from "../gsd-db.js";
|
|
12
|
+
import { transaction, insertMilestone, insertSlice, getSlice, getSliceTasks, getMilestone, updateSliceStatus, setSliceSummaryMd, saveGateResult, getPendingGatesForTurn, } from "../gsd-db.js";
|
|
13
|
+
import { getGatesForTurn } from "../gate-registry.js";
|
|
13
14
|
import { resolveSlicePath, clearPathCache } from "../paths.js";
|
|
14
15
|
import { checkOwnership, sliceUnitKey } from "../unit-ownership.js";
|
|
15
16
|
import { saveFile, clearParseCache } from "../files.js";
|
|
@@ -19,6 +20,19 @@ import { renderAllProjections } from "../workflow-projections.js";
|
|
|
19
20
|
import { writeManifest } from "../workflow-manifest.js";
|
|
20
21
|
import { appendEvent } from "../workflow-events.js";
|
|
21
22
|
import { logWarning, logError } from "../workflow-logger.js";
|
|
23
|
+
/**
|
|
24
|
+
* Map a complete-slice-owned gate id to the CompleteSliceParams field
|
|
25
|
+
* whose presence drives `pass` vs. `omitted`. Keep this in lockstep with
|
|
26
|
+
* the gates declared in gate-registry.ts under ownerTurn "complete-slice".
|
|
27
|
+
*/
|
|
28
|
+
function sliceGateFieldForId(id, params) {
|
|
29
|
+
switch (id) {
|
|
30
|
+
case "Q8":
|
|
31
|
+
return params.operationalReadiness;
|
|
32
|
+
default:
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
22
36
|
/**
|
|
23
37
|
* Render slice summary markdown matching the template format.
|
|
24
38
|
* YAML frontmatter uses snake_case keys for parseSummary() compatibility.
|
|
@@ -134,6 +148,10 @@ ${reqSurfaced}
|
|
|
134
148
|
|
|
135
149
|
${reqInvalidated}
|
|
136
150
|
|
|
151
|
+
## Operational Readiness
|
|
152
|
+
|
|
153
|
+
${params.operationalReadiness?.trim() || "None."}
|
|
154
|
+
|
|
137
155
|
## Deviations
|
|
138
156
|
|
|
139
157
|
${params.deviations || "None."}
|
|
@@ -271,6 +289,39 @@ export async function handleCompleteSlice(params, basePath) {
|
|
|
271
289
|
}
|
|
272
290
|
// Store rendered markdown in DB for D004 recovery
|
|
273
291
|
setSliceSummaryMd(params.milestoneId, params.sliceId, summaryMd, uatMd);
|
|
292
|
+
// ── Close gates owned by complete-slice (Q8) ───────────────────────────
|
|
293
|
+
// Each owned gate maps to a specific summary section via the registry.
|
|
294
|
+
// If the caller populated the corresponding field, record `pass`; if the
|
|
295
|
+
// field is empty, record `omitted`. Without this loop, Q8 would stay
|
|
296
|
+
// pending forever and block future state derivation (see gate-registry).
|
|
297
|
+
try {
|
|
298
|
+
const pendingGates = getPendingGatesForTurn(params.milestoneId, params.sliceId, "complete-slice");
|
|
299
|
+
if (pendingGates.length > 0) {
|
|
300
|
+
const ownedDefs = new Map(getGatesForTurn("complete-slice").map((g) => [g.id, g]));
|
|
301
|
+
for (const row of pendingGates) {
|
|
302
|
+
const def = ownedDefs.get(row.gate_id);
|
|
303
|
+
if (!def)
|
|
304
|
+
continue;
|
|
305
|
+
// Map gate id → param field it maps to. Keep the map local so
|
|
306
|
+
// adding a new complete-slice gate is a single place change.
|
|
307
|
+
const field = sliceGateFieldForId(def.id, params);
|
|
308
|
+
const hasContent = typeof field === "string" && field.trim().length > 0;
|
|
309
|
+
saveGateResult({
|
|
310
|
+
milestoneId: params.milestoneId,
|
|
311
|
+
sliceId: params.sliceId,
|
|
312
|
+
gateId: def.id,
|
|
313
|
+
verdict: hasContent ? "pass" : "omitted",
|
|
314
|
+
rationale: hasContent
|
|
315
|
+
? `${def.promptSection} section populated in slice summary`
|
|
316
|
+
: `${def.promptSection} section left empty — recorded as omitted`,
|
|
317
|
+
findings: hasContent ? field.trim() : "",
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
catch (gateErr) {
|
|
323
|
+
logWarning("tool", `complete-slice gate close warning for ${params.milestoneId}/${params.sliceId}: ${gateErr.message}`);
|
|
324
|
+
}
|
|
274
325
|
// Invalidate all caches
|
|
275
326
|
invalidateStateCache();
|
|
276
327
|
clearPathCache();
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
import { join } from "node:path";
|
|
10
10
|
import { mkdirSync } from "node:fs";
|
|
11
11
|
import { isClosedStatus } from "../status-guards.js";
|
|
12
|
-
import { transaction, insertMilestone, insertSlice, insertTask, insertVerificationEvidence, getMilestone, getSlice, getTask, updateTaskStatus, setTaskSummaryMd, deleteVerificationEvidence, } from "../gsd-db.js";
|
|
12
|
+
import { transaction, insertMilestone, insertSlice, insertTask, insertVerificationEvidence, getMilestone, getSlice, getTask, updateTaskStatus, setTaskSummaryMd, deleteVerificationEvidence, saveGateResult, getPendingGatesForTurn, } from "../gsd-db.js";
|
|
13
|
+
import { getGatesForTurn } from "../gate-registry.js";
|
|
13
14
|
import { resolveSliceFile, resolveTasksDir, clearPathCache } from "../paths.js";
|
|
14
15
|
import { checkOwnership, taskUnitKey } from "../unit-ownership.js";
|
|
15
16
|
import { saveFile, clearParseCache } from "../files.js";
|
|
@@ -19,6 +20,23 @@ import { renderAllProjections, renderSummaryContent } from "../workflow-projecti
|
|
|
19
20
|
import { writeManifest } from "../workflow-manifest.js";
|
|
20
21
|
import { appendEvent } from "../workflow-events.js";
|
|
21
22
|
import { logWarning, logError } from "../workflow-logger.js";
|
|
23
|
+
/**
|
|
24
|
+
* Map an execute-task-owned gate id to the CompleteTaskParams field whose
|
|
25
|
+
* presence drives `pass` vs. `omitted`. Keep in lockstep with the gates
|
|
26
|
+
* declared in gate-registry.ts under ownerTurn "execute-task".
|
|
27
|
+
*/
|
|
28
|
+
function taskGateFieldForId(id, params) {
|
|
29
|
+
switch (id) {
|
|
30
|
+
case "Q5":
|
|
31
|
+
return params.failureModes;
|
|
32
|
+
case "Q6":
|
|
33
|
+
return params.loadProfile;
|
|
34
|
+
case "Q7":
|
|
35
|
+
return params.negativeTests;
|
|
36
|
+
default:
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
22
40
|
/**
|
|
23
41
|
* Normalize a list parameter that may arrive as a string (newline-delimited
|
|
24
42
|
* bullet list from the LLM) into a string array (#3361).
|
|
@@ -189,6 +207,38 @@ export async function handleCompleteTask(params, basePath) {
|
|
|
189
207
|
}
|
|
190
208
|
// Store rendered markdown in DB for D004 recovery
|
|
191
209
|
setTaskSummaryMd(params.milestoneId, params.sliceId, params.taskId, summaryMd);
|
|
210
|
+
// ── Close gates owned by execute-task (Q5/Q6/Q7) for this task ────────
|
|
211
|
+
// Each gate id maps to a specific params field via taskGateFieldForId.
|
|
212
|
+
// When the model populates the field, record `pass`; when it's empty,
|
|
213
|
+
// record `omitted`. Task-scoped rows are filtered by taskId so a single
|
|
214
|
+
// task's completion doesn't touch sibling tasks' gate rows.
|
|
215
|
+
try {
|
|
216
|
+
const pendingGates = getPendingGatesForTurn(params.milestoneId, params.sliceId, "execute-task", params.taskId);
|
|
217
|
+
if (pendingGates.length > 0) {
|
|
218
|
+
const ownedDefs = new Map(getGatesForTurn("execute-task").map((g) => [g.id, g]));
|
|
219
|
+
for (const row of pendingGates) {
|
|
220
|
+
const def = ownedDefs.get(row.gate_id);
|
|
221
|
+
if (!def)
|
|
222
|
+
continue;
|
|
223
|
+
const field = taskGateFieldForId(def.id, params);
|
|
224
|
+
const hasContent = typeof field === "string" && field.trim().length > 0;
|
|
225
|
+
saveGateResult({
|
|
226
|
+
milestoneId: params.milestoneId,
|
|
227
|
+
sliceId: params.sliceId,
|
|
228
|
+
taskId: params.taskId,
|
|
229
|
+
gateId: def.id,
|
|
230
|
+
verdict: hasContent ? "pass" : "omitted",
|
|
231
|
+
rationale: hasContent
|
|
232
|
+
? `${def.promptSection} section populated in task summary`
|
|
233
|
+
: `${def.promptSection} section left empty — recorded as omitted`,
|
|
234
|
+
findings: hasContent ? field.trim() : "",
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
catch (gateErr) {
|
|
240
|
+
logWarning("tool", `complete-task gate close warning for ${params.milestoneId}/${params.sliceId}/${params.taskId}: ${gateErr.message}`);
|
|
241
|
+
}
|
|
192
242
|
// Invalidate all caches
|
|
193
243
|
invalidateStateCache();
|
|
194
244
|
clearPathCache();
|
|
@@ -2,6 +2,7 @@ import { ensureDbOpen } from "../bootstrap/dynamic-tools.js";
|
|
|
2
2
|
import { sanitizeCompleteMilestoneParams } from "../bootstrap/sanitize-complete-milestone.js";
|
|
3
3
|
import { loadWriteGateSnapshot, shouldBlockContextArtifactSaveInSnapshot } from "../bootstrap/write-gate.js";
|
|
4
4
|
import { getMilestone, getSliceStatusSummary, getSliceTaskCounts, _getAdapter, saveGateResult, } from "../gsd-db.js";
|
|
5
|
+
import { GATE_REGISTRY } from "../gate-registry.js";
|
|
5
6
|
import { saveArtifactToDb } from "../db-writer.js";
|
|
6
7
|
import { handleCompleteMilestone } from "./complete-milestone.js";
|
|
7
8
|
import { handleCompleteTask } from "./complete-task.js";
|
|
@@ -23,12 +24,14 @@ export async function executeSummarySave(params, basePath = process.cwd()) {
|
|
|
23
24
|
return {
|
|
24
25
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot save artifact." }],
|
|
25
26
|
details: { operation: "save_summary", error: "db_unavailable" },
|
|
27
|
+
isError: true,
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
30
|
if (!isSupportedSummaryArtifactType(params.artifact_type)) {
|
|
29
31
|
return {
|
|
30
32
|
content: [{ type: "text", text: `Error: Invalid artifact_type "${params.artifact_type}". Must be one of: ${SUPPORTED_SUMMARY_ARTIFACT_TYPES.join(", ")}` }],
|
|
31
33
|
details: { operation: "save_summary", error: "invalid_artifact_type" },
|
|
34
|
+
isError: true,
|
|
32
35
|
};
|
|
33
36
|
}
|
|
34
37
|
const contextGuard = shouldBlockContextArtifactSaveInSnapshot(loadWriteGateSnapshot(basePath), params.artifact_type, params.milestone_id ?? null, params.slice_id ?? null);
|
|
@@ -36,6 +39,7 @@ export async function executeSummarySave(params, basePath = process.cwd()) {
|
|
|
36
39
|
return {
|
|
37
40
|
content: [{ type: "text", text: `Error saving artifact: ${contextGuard.reason ?? "context write blocked"}` }],
|
|
38
41
|
details: { operation: "save_summary", error: "context_write_blocked" },
|
|
42
|
+
isError: true,
|
|
39
43
|
};
|
|
40
44
|
}
|
|
41
45
|
try {
|
|
@@ -68,6 +72,7 @@ export async function executeSummarySave(params, basePath = process.cwd()) {
|
|
|
68
72
|
return {
|
|
69
73
|
content: [{ type: "text", text: `Error saving artifact: ${msg}` }],
|
|
70
74
|
details: { operation: "save_summary", error: msg },
|
|
75
|
+
isError: true,
|
|
71
76
|
};
|
|
72
77
|
}
|
|
73
78
|
}
|
|
@@ -77,6 +82,7 @@ export async function executeTaskComplete(params, basePath = process.cwd()) {
|
|
|
77
82
|
return {
|
|
78
83
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot complete task." }],
|
|
79
84
|
details: { operation: "complete_task", error: "db_unavailable" },
|
|
85
|
+
isError: true,
|
|
80
86
|
};
|
|
81
87
|
}
|
|
82
88
|
try {
|
|
@@ -87,6 +93,7 @@ export async function executeTaskComplete(params, basePath = process.cwd()) {
|
|
|
87
93
|
return {
|
|
88
94
|
content: [{ type: "text", text: `Error completing task: ${result.error}` }],
|
|
89
95
|
details: { operation: "complete_task", error: result.error },
|
|
96
|
+
isError: true,
|
|
90
97
|
};
|
|
91
98
|
}
|
|
92
99
|
return {
|
|
@@ -106,6 +113,7 @@ export async function executeTaskComplete(params, basePath = process.cwd()) {
|
|
|
106
113
|
return {
|
|
107
114
|
content: [{ type: "text", text: `Error completing task: ${msg}` }],
|
|
108
115
|
details: { operation: "complete_task", error: msg },
|
|
116
|
+
isError: true,
|
|
109
117
|
};
|
|
110
118
|
}
|
|
111
119
|
}
|
|
@@ -115,6 +123,7 @@ export async function executeSliceComplete(params, basePath = process.cwd()) {
|
|
|
115
123
|
return {
|
|
116
124
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot complete slice." }],
|
|
117
125
|
details: { operation: "complete_slice", error: "db_unavailable" },
|
|
126
|
+
isError: true,
|
|
118
127
|
};
|
|
119
128
|
}
|
|
120
129
|
try {
|
|
@@ -167,6 +176,7 @@ export async function executeSliceComplete(params, basePath = process.cwd()) {
|
|
|
167
176
|
return {
|
|
168
177
|
content: [{ type: "text", text: `Error completing slice: ${result.error}` }],
|
|
169
178
|
details: { operation: "complete_slice", error: result.error },
|
|
179
|
+
isError: true,
|
|
170
180
|
};
|
|
171
181
|
}
|
|
172
182
|
return {
|
|
@@ -186,6 +196,7 @@ export async function executeSliceComplete(params, basePath = process.cwd()) {
|
|
|
186
196
|
return {
|
|
187
197
|
content: [{ type: "text", text: `Error completing slice: ${msg}` }],
|
|
188
198
|
details: { operation: "complete_slice", error: msg },
|
|
199
|
+
isError: true,
|
|
189
200
|
};
|
|
190
201
|
}
|
|
191
202
|
}
|
|
@@ -195,6 +206,7 @@ export async function executeCompleteMilestone(params, basePath = process.cwd())
|
|
|
195
206
|
return {
|
|
196
207
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot complete milestone." }],
|
|
197
208
|
details: { operation: "complete_milestone", error: "db_unavailable" },
|
|
209
|
+
isError: true,
|
|
198
210
|
};
|
|
199
211
|
}
|
|
200
212
|
try {
|
|
@@ -204,6 +216,7 @@ export async function executeCompleteMilestone(params, basePath = process.cwd())
|
|
|
204
216
|
return {
|
|
205
217
|
content: [{ type: "text", text: `Error completing milestone: ${result.error}` }],
|
|
206
218
|
details: { operation: "complete_milestone", error: result.error },
|
|
219
|
+
isError: true,
|
|
207
220
|
};
|
|
208
221
|
}
|
|
209
222
|
return {
|
|
@@ -221,6 +234,7 @@ export async function executeCompleteMilestone(params, basePath = process.cwd())
|
|
|
221
234
|
return {
|
|
222
235
|
content: [{ type: "text", text: `Error completing milestone: ${msg}` }],
|
|
223
236
|
details: { operation: "complete_milestone", error: msg },
|
|
237
|
+
isError: true,
|
|
224
238
|
};
|
|
225
239
|
}
|
|
226
240
|
}
|
|
@@ -230,6 +244,7 @@ export async function executeValidateMilestone(params, basePath = process.cwd())
|
|
|
230
244
|
return {
|
|
231
245
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot validate milestone." }],
|
|
232
246
|
details: { operation: "validate_milestone", error: "db_unavailable" },
|
|
247
|
+
isError: true,
|
|
233
248
|
};
|
|
234
249
|
}
|
|
235
250
|
try {
|
|
@@ -238,6 +253,7 @@ export async function executeValidateMilestone(params, basePath = process.cwd())
|
|
|
238
253
|
return {
|
|
239
254
|
content: [{ type: "text", text: `Error validating milestone: ${result.error}` }],
|
|
240
255
|
details: { operation: "validate_milestone", error: result.error },
|
|
256
|
+
isError: true,
|
|
241
257
|
};
|
|
242
258
|
}
|
|
243
259
|
return {
|
|
@@ -256,6 +272,7 @@ export async function executeValidateMilestone(params, basePath = process.cwd())
|
|
|
256
272
|
return {
|
|
257
273
|
content: [{ type: "text", text: `Error validating milestone: ${msg}` }],
|
|
258
274
|
details: { operation: "validate_milestone", error: msg },
|
|
275
|
+
isError: true,
|
|
259
276
|
};
|
|
260
277
|
}
|
|
261
278
|
}
|
|
@@ -265,6 +282,7 @@ export async function executeReassessRoadmap(params, basePath = process.cwd()) {
|
|
|
265
282
|
return {
|
|
266
283
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot reassess roadmap." }],
|
|
267
284
|
details: { operation: "reassess_roadmap", error: "db_unavailable" },
|
|
285
|
+
isError: true,
|
|
268
286
|
};
|
|
269
287
|
}
|
|
270
288
|
try {
|
|
@@ -273,6 +291,7 @@ export async function executeReassessRoadmap(params, basePath = process.cwd()) {
|
|
|
273
291
|
return {
|
|
274
292
|
content: [{ type: "text", text: `Error reassessing roadmap: ${result.error}` }],
|
|
275
293
|
details: { operation: "reassess_roadmap", error: result.error },
|
|
294
|
+
isError: true,
|
|
276
295
|
};
|
|
277
296
|
}
|
|
278
297
|
return {
|
|
@@ -292,6 +311,7 @@ export async function executeReassessRoadmap(params, basePath = process.cwd()) {
|
|
|
292
311
|
return {
|
|
293
312
|
content: [{ type: "text", text: `Error reassessing roadmap: ${msg}` }],
|
|
294
313
|
details: { operation: "reassess_roadmap", error: msg },
|
|
314
|
+
isError: true,
|
|
295
315
|
};
|
|
296
316
|
}
|
|
297
317
|
}
|
|
@@ -301,13 +321,17 @@ export async function executeSaveGateResult(params, basePath = process.cwd()) {
|
|
|
301
321
|
return {
|
|
302
322
|
content: [{ type: "text", text: "Error: GSD database is not available." }],
|
|
303
323
|
details: { operation: "save_gate_result", error: "db_unavailable" },
|
|
324
|
+
isError: true,
|
|
304
325
|
};
|
|
305
326
|
}
|
|
306
|
-
|
|
327
|
+
// Source of truth: gate-registry.ts. Every declared GateId is accepted,
|
|
328
|
+
// so adding a new gate in one place automatically flows through here.
|
|
329
|
+
const validGates = Object.keys(GATE_REGISTRY);
|
|
307
330
|
if (!validGates.includes(params.gateId)) {
|
|
308
331
|
return {
|
|
309
332
|
content: [{ type: "text", text: `Error: Invalid gateId "${params.gateId}". Must be one of: ${validGates.join(", ")}` }],
|
|
310
333
|
details: { operation: "save_gate_result", error: "invalid_gate_id" },
|
|
334
|
+
isError: true,
|
|
311
335
|
};
|
|
312
336
|
}
|
|
313
337
|
const validVerdicts = ["pass", "flag", "omitted"];
|
|
@@ -315,6 +339,7 @@ export async function executeSaveGateResult(params, basePath = process.cwd()) {
|
|
|
315
339
|
return {
|
|
316
340
|
content: [{ type: "text", text: `Error: Invalid verdict "${params.verdict}". Must be one of: ${validVerdicts.join(", ")}` }],
|
|
317
341
|
details: { operation: "save_gate_result", error: "invalid_verdict" },
|
|
342
|
+
isError: true,
|
|
318
343
|
};
|
|
319
344
|
}
|
|
320
345
|
try {
|
|
@@ -339,6 +364,7 @@ export async function executeSaveGateResult(params, basePath = process.cwd()) {
|
|
|
339
364
|
return {
|
|
340
365
|
content: [{ type: "text", text: `Error saving gate result: ${msg}` }],
|
|
341
366
|
details: { operation: "save_gate_result", error: msg },
|
|
367
|
+
isError: true,
|
|
342
368
|
};
|
|
343
369
|
}
|
|
344
370
|
}
|
|
@@ -348,6 +374,7 @@ export async function executePlanMilestone(params, basePath = process.cwd()) {
|
|
|
348
374
|
return {
|
|
349
375
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot plan milestone." }],
|
|
350
376
|
details: { operation: "plan_milestone", error: "db_unavailable" },
|
|
377
|
+
isError: true,
|
|
351
378
|
};
|
|
352
379
|
}
|
|
353
380
|
try {
|
|
@@ -356,6 +383,7 @@ export async function executePlanMilestone(params, basePath = process.cwd()) {
|
|
|
356
383
|
return {
|
|
357
384
|
content: [{ type: "text", text: `Error planning milestone: ${result.error}` }],
|
|
358
385
|
details: { operation: "plan_milestone", error: result.error },
|
|
386
|
+
isError: true,
|
|
359
387
|
};
|
|
360
388
|
}
|
|
361
389
|
return {
|
|
@@ -373,6 +401,7 @@ export async function executePlanMilestone(params, basePath = process.cwd()) {
|
|
|
373
401
|
return {
|
|
374
402
|
content: [{ type: "text", text: `Error planning milestone: ${msg}` }],
|
|
375
403
|
details: { operation: "plan_milestone", error: msg },
|
|
404
|
+
isError: true,
|
|
376
405
|
};
|
|
377
406
|
}
|
|
378
407
|
}
|
|
@@ -382,6 +411,7 @@ export async function executePlanSlice(params, basePath = process.cwd()) {
|
|
|
382
411
|
return {
|
|
383
412
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot plan slice." }],
|
|
384
413
|
details: { operation: "plan_slice", error: "db_unavailable" },
|
|
414
|
+
isError: true,
|
|
385
415
|
};
|
|
386
416
|
}
|
|
387
417
|
try {
|
|
@@ -390,6 +420,7 @@ export async function executePlanSlice(params, basePath = process.cwd()) {
|
|
|
390
420
|
return {
|
|
391
421
|
content: [{ type: "text", text: `Error planning slice: ${result.error}` }],
|
|
392
422
|
details: { operation: "plan_slice", error: result.error },
|
|
423
|
+
isError: true,
|
|
393
424
|
};
|
|
394
425
|
}
|
|
395
426
|
return {
|
|
@@ -409,6 +440,7 @@ export async function executePlanSlice(params, basePath = process.cwd()) {
|
|
|
409
440
|
return {
|
|
410
441
|
content: [{ type: "text", text: `Error planning slice: ${msg}` }],
|
|
411
442
|
details: { operation: "plan_slice", error: msg },
|
|
443
|
+
isError: true,
|
|
412
444
|
};
|
|
413
445
|
}
|
|
414
446
|
}
|
|
@@ -418,6 +450,7 @@ export async function executeReplanSlice(params, basePath = process.cwd()) {
|
|
|
418
450
|
return {
|
|
419
451
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot replan slice." }],
|
|
420
452
|
details: { operation: "replan_slice", error: "db_unavailable" },
|
|
453
|
+
isError: true,
|
|
421
454
|
};
|
|
422
455
|
}
|
|
423
456
|
try {
|
|
@@ -426,6 +459,7 @@ export async function executeReplanSlice(params, basePath = process.cwd()) {
|
|
|
426
459
|
return {
|
|
427
460
|
content: [{ type: "text", text: `Error replanning slice: ${result.error}` }],
|
|
428
461
|
details: { operation: "replan_slice", error: result.error },
|
|
462
|
+
isError: true,
|
|
429
463
|
};
|
|
430
464
|
}
|
|
431
465
|
return {
|
|
@@ -445,6 +479,7 @@ export async function executeReplanSlice(params, basePath = process.cwd()) {
|
|
|
445
479
|
return {
|
|
446
480
|
content: [{ type: "text", text: `Error replanning slice: ${msg}` }],
|
|
447
481
|
details: { operation: "replan_slice", error: msg },
|
|
482
|
+
isError: true,
|
|
448
483
|
};
|
|
449
484
|
}
|
|
450
485
|
}
|
|
@@ -455,6 +490,7 @@ export async function executeMilestoneStatus(params, basePath = process.cwd()) {
|
|
|
455
490
|
return {
|
|
456
491
|
content: [{ type: "text", text: "Error: GSD database is not available." }],
|
|
457
492
|
details: { operation: "milestone_status", error: "db_unavailable" },
|
|
493
|
+
isError: true,
|
|
458
494
|
};
|
|
459
495
|
}
|
|
460
496
|
const adapter = _getAdapter();
|
|
@@ -503,6 +539,7 @@ export async function executeMilestoneStatus(params, basePath = process.cwd()) {
|
|
|
503
539
|
return {
|
|
504
540
|
content: [{ type: "text", text: `Error querying milestone status: ${msg}` }],
|
|
505
541
|
details: { operation: "milestone_status", error: msg },
|
|
542
|
+
isError: true,
|
|
506
543
|
};
|
|
507
544
|
}
|
|
508
545
|
}
|
|
@@ -2,6 +2,7 @@ import { createHash, randomUUID } from "node:crypto";
|
|
|
2
2
|
import { appendFileSync, readFileSync, existsSync, mkdirSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { atomicWriteSync } from "./atomic-write.js";
|
|
5
|
+
import { withFileLockSync } from "./file-lock.js";
|
|
5
6
|
import { logWarning } from "./workflow-logger.js";
|
|
6
7
|
// ─── Session ID ───────────────────────────────────────────────────────────
|
|
7
8
|
/**
|
|
@@ -88,17 +89,28 @@ export function findForkPoint(logA, logB) {
|
|
|
88
89
|
export function compactMilestoneEvents(basePath, milestoneId) {
|
|
89
90
|
const logPath = join(basePath, ".gsd", "event-log.jsonl");
|
|
90
91
|
const archivePath = join(basePath, ".gsd", `event-log-${milestoneId}.jsonl.archived`);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
92
|
+
return withFileLockSync(logPath, () => {
|
|
93
|
+
const allEvents = readEvents(logPath);
|
|
94
|
+
// Single-pass partition to halve the work (per reviewer agent)
|
|
95
|
+
const toArchive = [];
|
|
96
|
+
const remaining = [];
|
|
97
|
+
for (const e of allEvents) {
|
|
98
|
+
if (e.params.milestoneId === milestoneId) {
|
|
99
|
+
toArchive.push(e);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
remaining.push(e);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (toArchive.length === 0) {
|
|
106
|
+
return { archived: 0 };
|
|
107
|
+
}
|
|
108
|
+
// Write archived events to .jsonl.archived file (crash-safe)
|
|
109
|
+
atomicWriteSync(archivePath, toArchive.map((e) => JSON.stringify(e)).join("\n") + "\n");
|
|
110
|
+
// Truncate active log to remaining events only
|
|
111
|
+
atomicWriteSync(logPath, remaining.length > 0
|
|
112
|
+
? remaining.map((e) => JSON.stringify(e)).join("\n") + "\n"
|
|
113
|
+
: "");
|
|
114
|
+
return { archived: toArchive.length };
|
|
115
|
+
});
|
|
104
116
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ensureProjectWorkflowMcpConfig, } from "./mcp-project-config.js";
|
|
2
|
+
import { usesWorkflowMcpTransport } from "./workflow-mcp.js";
|
|
3
|
+
function getAuthModeSafe(ctx, provider) {
|
|
4
|
+
if (!provider)
|
|
5
|
+
return undefined;
|
|
6
|
+
const getAuthMode = ctx.modelRegistry?.getProviderAuthMode;
|
|
7
|
+
if (typeof getAuthMode !== "function")
|
|
8
|
+
return undefined;
|
|
9
|
+
try {
|
|
10
|
+
return getAuthMode(provider);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function hasClaudeCodeProvider(ctx) {
|
|
17
|
+
return getAuthModeSafe(ctx, "claude-code") === "externalCli";
|
|
18
|
+
}
|
|
19
|
+
function isClaudeCodeProviderReady(ctx) {
|
|
20
|
+
const readyCheck = ctx.modelRegistry?.isProviderRequestReady;
|
|
21
|
+
if (typeof readyCheck !== "function")
|
|
22
|
+
return false;
|
|
23
|
+
try {
|
|
24
|
+
return readyCheck("claude-code");
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function shouldAutoPrepareWorkflowMcp(ctx) {
|
|
31
|
+
const provider = ctx.model?.provider;
|
|
32
|
+
const baseUrl = ctx.model?.baseUrl;
|
|
33
|
+
const authMode = getAuthModeSafe(ctx, provider);
|
|
34
|
+
if (usesWorkflowMcpTransport(authMode, baseUrl))
|
|
35
|
+
return true;
|
|
36
|
+
if (provider === "claude-code")
|
|
37
|
+
return true;
|
|
38
|
+
if (hasClaudeCodeProvider(ctx))
|
|
39
|
+
return true;
|
|
40
|
+
return isClaudeCodeProviderReady(ctx);
|
|
41
|
+
}
|
|
42
|
+
export function prepareWorkflowMcpForProject(ctx, projectRoot) {
|
|
43
|
+
if (!shouldAutoPrepareWorkflowMcp(ctx))
|
|
44
|
+
return null;
|
|
45
|
+
try {
|
|
46
|
+
const result = ensureProjectWorkflowMcpConfig(projectRoot);
|
|
47
|
+
if (result.status !== "unchanged") {
|
|
48
|
+
ctx.ui?.notify?.(`Claude Code MCP prepared at ${result.configPath}`, "info");
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
ctx.ui?.notify?.(`Claude Code MCP prep failed: ${err instanceof Error ? err.message : String(err)}. Detected Claude Code model but no workflow MCP. Please run /gsd mcp init . from your project root.`, "warning");
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -310,7 +310,7 @@ export function getWorkflowTransportSupportError(provider, requiredTools, option
|
|
|
310
310
|
const unitLabel = options.unitType ? ` for ${options.unitType}` : "";
|
|
311
311
|
const providerLabel = `"${provider}"`;
|
|
312
312
|
if (!launch) {
|
|
313
|
-
return `Provider ${providerLabel} cannot run ${surface}${unitLabel}: the GSD workflow MCP server is not configured or discoverable.
|
|
313
|
+
return `Provider ${providerLabel} cannot run ${surface}${unitLabel}: the GSD workflow MCP server is not configured or discoverable. Detected Claude Code model but no workflow MCP. Please run /gsd mcp init . from your project root. You can also configure GSD_WORKFLOW_MCP_COMMAND, build packages/mcp-server/dist/cli.js, or install gsd-mcp-server on PATH.`;
|
|
314
314
|
}
|
|
315
315
|
const missing = [...new Set(requiredTools)].filter((tool) => !MCP_WORKFLOW_TOOL_SURFACE.has(tool));
|
|
316
316
|
if (missing.length === 0)
|
|
@@ -49,8 +49,15 @@ async function probeAndRegister(pi) {
|
|
|
49
49
|
return false;
|
|
50
50
|
}
|
|
51
51
|
const models = await discoverModels();
|
|
52
|
-
if (models.length === 0)
|
|
53
|
-
|
|
52
|
+
if (models.length === 0) {
|
|
53
|
+
// No local models means there's nothing usable to register in GSD.
|
|
54
|
+
// Keep the footer/status clean instead of advertising Ollama availability.
|
|
55
|
+
if (providerRegistered) {
|
|
56
|
+
pi.unregisterProvider("ollama");
|
|
57
|
+
providerRegistered = false;
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
54
61
|
const baseUrl = client.getOllamaHost();
|
|
55
62
|
// Use authMode "apiKey" with a dummy key (#3440).
|
|
56
63
|
// authMode "none" requires a custom streamSimple handler, but Ollama uses
|
|
@@ -102,10 +109,11 @@ export default function ollama(pi) {
|
|
|
102
109
|
else {
|
|
103
110
|
probeAndRegister(pi)
|
|
104
111
|
.then((found) => {
|
|
105
|
-
|
|
106
|
-
ctx.ui.setStatus("ollama", "Ollama");
|
|
112
|
+
ctx.ui.setStatus("ollama", found ? "Ollama" : undefined);
|
|
107
113
|
})
|
|
108
|
-
.catch(() => {
|
|
114
|
+
.catch(() => {
|
|
115
|
+
ctx.ui.setStatus("ollama", undefined);
|
|
116
|
+
});
|
|
109
117
|
}
|
|
110
118
|
});
|
|
111
119
|
pi.on("session_shutdown", async () => {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GSD Phase State — cross-extension coordination
|
|
3
|
+
* Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>
|
|
4
|
+
*
|
|
5
|
+
* Lightweight module-level state that GSD auto-mode writes to and the
|
|
6
|
+
* subagent tool reads from. Both extensions run in the same process so
|
|
7
|
+
* a module variable is sufficient — no file I/O needed.
|
|
8
|
+
*/
|
|
9
|
+
let _active = false;
|
|
10
|
+
let _currentPhase = null;
|
|
11
|
+
/** Mark GSD auto-mode as active. */
|
|
12
|
+
export function activateGSD() {
|
|
13
|
+
_active = true;
|
|
14
|
+
}
|
|
15
|
+
/** Mark GSD auto-mode as inactive and clear the current phase. */
|
|
16
|
+
export function deactivateGSD() {
|
|
17
|
+
_active = false;
|
|
18
|
+
_currentPhase = null;
|
|
19
|
+
}
|
|
20
|
+
/** Set the currently dispatched GSD phase (e.g. "plan-milestone"). */
|
|
21
|
+
export function setCurrentPhase(phase) {
|
|
22
|
+
_currentPhase = phase;
|
|
23
|
+
}
|
|
24
|
+
/** Clear the current phase (unit completed or aborted). */
|
|
25
|
+
export function clearCurrentPhase() {
|
|
26
|
+
_currentPhase = null;
|
|
27
|
+
}
|
|
28
|
+
/** Returns true if GSD auto-mode is currently active. */
|
|
29
|
+
export function isGSDActive() {
|
|
30
|
+
return _active;
|
|
31
|
+
}
|
|
32
|
+
/** Returns the current GSD phase, or null if none is active. */
|
|
33
|
+
export function getCurrentPhase() {
|
|
34
|
+
return _active ? _currentPhase : null;
|
|
35
|
+
}
|
|
@@ -5,6 +5,12 @@ import * as fs from "node:fs";
|
|
|
5
5
|
import * as path from "node:path";
|
|
6
6
|
import { getAgentDir, parseFrontmatter } from "@gsd/pi-coding-agent";
|
|
7
7
|
const PROJECT_AGENT_DIR_CANDIDATES = [".gsd", ".pi"];
|
|
8
|
+
export function parseConflictsWith(value) {
|
|
9
|
+
if (typeof value !== "string")
|
|
10
|
+
return undefined;
|
|
11
|
+
const conflicts = value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
12
|
+
return conflicts.length > 0 ? conflicts : undefined;
|
|
13
|
+
}
|
|
8
14
|
function parseAgentTools(value) {
|
|
9
15
|
if (typeof value === "string") {
|
|
10
16
|
const tools = value
|
|
@@ -52,11 +58,13 @@ function loadAgentsFromDir(dir, source) {
|
|
|
52
58
|
continue;
|
|
53
59
|
}
|
|
54
60
|
const tools = parseAgentTools(frontmatter.tools);
|
|
61
|
+
const conflictsWith = parseConflictsWith(frontmatter.conflicts_with);
|
|
55
62
|
agents.push({
|
|
56
63
|
name: frontmatter.name,
|
|
57
64
|
description: frontmatter.description,
|
|
58
65
|
tools: tools && tools.length > 0 ? tools : undefined,
|
|
59
66
|
model: frontmatter.model,
|
|
67
|
+
conflictsWith,
|
|
60
68
|
systemPrompt: body,
|
|
61
69
|
source,
|
|
62
70
|
filePath,
|
|
@@ -21,6 +21,7 @@ import { getMarkdownTheme } from "@gsd/pi-coding-agent";
|
|
|
21
21
|
import { Container, Markdown, Spacer, Text } from "@gsd/pi-tui";
|
|
22
22
|
import { Type } from "@sinclair/typebox";
|
|
23
23
|
import { formatTokenCount } from "../shared/mod.js";
|
|
24
|
+
import { getCurrentPhase } from "../shared/gsd-phase-state.js";
|
|
24
25
|
import { discoverAgents } from "./agents.js";
|
|
25
26
|
import { createIsolation, mergeDeltaPatches, readIsolationMode, } from "./isolation.js";
|
|
26
27
|
import { registerWorker, updateWorker } from "./worker-registry.js";
|
|
@@ -268,6 +269,22 @@ async function runSingleAgent(defaultCwd, agents, agentName, task, cwd, step, si
|
|
|
268
269
|
step,
|
|
269
270
|
};
|
|
270
271
|
}
|
|
272
|
+
// GSD phase guard: block agents that conflict with the active GSD phase
|
|
273
|
+
if (agent.conflictsWith && agent.conflictsWith.length > 0) {
|
|
274
|
+
const activePhase = getCurrentPhase();
|
|
275
|
+
if (activePhase && agent.conflictsWith.includes(activePhase)) {
|
|
276
|
+
return {
|
|
277
|
+
agent: agentName,
|
|
278
|
+
agentSource: agent.source,
|
|
279
|
+
task,
|
|
280
|
+
exitCode: 1,
|
|
281
|
+
messages: [],
|
|
282
|
+
stderr: `Agent "${agentName}" is blocked: it conflicts with the active GSD phase "${activePhase}". Use the built-in GSD workflow instead.`,
|
|
283
|
+
usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, cost: 0, contextTokens: 0, turns: 0 },
|
|
284
|
+
step,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
}
|
|
271
288
|
let tmpPromptDir = null;
|
|
272
289
|
let tmpPromptPath = null;
|
|
273
290
|
const currentResult = {
|