gsd-pi 2.82.0-dev.2841a1e44 → 2.82.0-dev.3a3c6509d
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 +3 -3
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/GSD-WORKFLOW.md +7 -0
- package/dist/resources/extensions/claude-code-cli/partial-builder.js +2 -1
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +1 -1
- package/dist/resources/extensions/gsd/auto/infra-errors.js +9 -3
- package/dist/resources/extensions/gsd/auto/loop.js +5 -5
- package/dist/resources/extensions/gsd/auto/orchestrator.js +11 -0
- package/dist/resources/extensions/gsd/auto/phases.js +81 -31
- package/dist/resources/extensions/gsd/auto/workflow-memory-pressure.js +12 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +66 -1
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +1 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +20 -19
- package/dist/resources/extensions/gsd/auto-model-selection.js +2 -0
- package/dist/resources/extensions/gsd/auto-post-unit.js +71 -10
- package/dist/resources/extensions/gsd/auto-recovery.js +71 -14
- package/dist/resources/extensions/gsd/auto-start.js +87 -14
- package/dist/resources/extensions/gsd/auto-verification.js +17 -4
- package/dist/resources/extensions/gsd/auto-worktree.js +176 -10
- package/dist/resources/extensions/gsd/auto.js +37 -5
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +31 -7
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +10 -9
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +4 -2
- package/dist/resources/extensions/gsd/bootstrap/subagent-input.js +5 -2
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +14 -2
- package/dist/resources/extensions/gsd/commands/handlers/core.js +17 -1
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +7 -2
- package/dist/resources/extensions/gsd/crash-recovery.js +43 -5
- package/dist/resources/extensions/gsd/db/milestone-leases.js +24 -0
- package/dist/resources/extensions/gsd/db/unit-dispatches.js +3 -2
- package/dist/resources/extensions/gsd/dispatch-guard.js +2 -2
- package/dist/resources/extensions/gsd/doctor-git-checks.js +46 -1
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +28 -11
- package/dist/resources/extensions/gsd/doctor.js +2 -28
- package/dist/resources/extensions/gsd/export-html.js +27 -425
- package/dist/resources/extensions/gsd/forensics.js +3 -3
- package/dist/resources/extensions/gsd/git-service.js +45 -3
- package/dist/resources/extensions/gsd/gsd-db.js +21 -6
- package/dist/resources/extensions/gsd/guided-flow-queue.js +4 -3
- package/dist/resources/extensions/gsd/guided-flow.js +101 -116
- package/dist/resources/extensions/gsd/guided-unit-context.js +23 -0
- package/dist/resources/extensions/gsd/migrate/parsers.js +10 -0
- package/dist/resources/extensions/gsd/migration-auto-check.js +12 -17
- package/dist/resources/extensions/gsd/milestone-actions.js +11 -4
- package/dist/resources/extensions/gsd/native-git-bridge.js +48 -12
- package/dist/resources/extensions/gsd/pending-auto-start.js +52 -0
- package/dist/resources/extensions/gsd/post-execution-checks.js +73 -2
- package/dist/resources/extensions/gsd/pre-execution-checks.js +28 -1
- package/dist/resources/extensions/gsd/prompt-loader.js +1 -1
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +8 -8
- package/dist/resources/extensions/gsd/prompts/discuss.md +9 -9
- package/dist/resources/extensions/gsd/prompts/guided-discuss-project.md +4 -4
- package/dist/resources/extensions/gsd/prompts/guided-discuss-requirements.md +3 -3
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +4 -4
- package/dist/resources/extensions/gsd/prompts/queue.md +4 -4
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +2 -2
- package/dist/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
- package/dist/resources/extensions/gsd/queue-reorder-ui.js +30 -13
- package/dist/resources/extensions/gsd/smart-entry-routing.js +36 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/merge-state.js +6 -1
- package/dist/resources/extensions/gsd/state-reconciliation/drift/project-md.js +9 -14
- package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +19 -24
- package/dist/resources/extensions/gsd/state.js +1 -1
- package/dist/resources/extensions/gsd/status-guards.js +11 -0
- package/dist/resources/extensions/gsd/templates/plan.md +8 -5
- package/dist/resources/extensions/gsd/templates/task-plan.md +4 -2
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +6 -8
- package/dist/resources/extensions/gsd/tools/complete-slice.js +6 -8
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +7 -1
- package/dist/resources/extensions/gsd/tools/plan-slice.js +89 -14
- package/dist/resources/extensions/gsd/unit-context-manifest.js +7 -8
- package/dist/resources/extensions/gsd/validation.js +23 -1
- package/dist/resources/extensions/gsd/verification-gate.js +68 -7
- package/dist/resources/extensions/gsd/workflow-mcp.js +17 -1
- package/dist/resources/extensions/gsd/workflow-projections.js +6 -8
- package/dist/resources/extensions/gsd/worktree-lifecycle.js +33 -8
- package/dist/resources/extensions/gsd/worktree-manager.js +1 -1
- package/dist/resources/extensions/shared/html-shell.js +388 -0
- package/dist/resources/extensions/visual-brief/page-contract.js +2 -0
- package/dist/resources/extensions/visual-brief/prompts.js +29 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +11 -11
- 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/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.js.nft.json +1 -1
- 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 +4 -7
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -7
- 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 +4 -5
- 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 +2 -5
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +4 -7
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -7
- 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 +4 -5
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -5
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +11 -11
- package/dist/web/standalone/.next/server/chunks/4266.js +2 -0
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/app/layout-8c10ec293ae0f1d5.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-6a95bc41e0f7ec89.js → webpack-9a4db269f9ed63ad.js} +1 -1
- package/dist/web/standalone/.next/static/css/746ee28c929d1880.css +1 -0
- package/package.json +2 -2
- package/packages/mcp-server/src/workflow-tools.test.ts +1 -1
- package/packages/native/tsconfig.json +2 -1
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.js +5 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.js.map +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.js +41 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.js +82 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.test.js +52 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/simple-options.d.ts +2 -4
- package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/simple-options.js +5 -6
- package/packages/pi-ai/dist/providers/simple-options.js.map +1 -1
- package/packages/pi-ai/dist/providers/simple-options.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/simple-options.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/simple-options.test.js +50 -0
- package/packages/pi-ai/dist/providers/simple-options.test.js.map +1 -0
- package/packages/pi-ai/src/providers/google-gemini-cli.test.ts +49 -0
- package/packages/pi-ai/src/providers/google-gemini-cli.ts +7 -0
- package/packages/pi-ai/src/providers/openai-codex-responses.test.ts +63 -0
- package/packages/pi-ai/src/providers/openai-codex-responses.ts +91 -1
- package/packages/pi-ai/src/providers/simple-options.test.ts +60 -0
- package/packages/pi-ai/src/providers/simple-options.ts +5 -6
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.js +66 -0
- package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session.js +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +44 -3
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +24 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.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 +71 -97
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.js +12 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.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 +19 -8
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-thinking-level.test.ts +79 -0
- package/packages/pi-coding-agent/src/core/agent-session.ts +1 -1
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +53 -3
- package/packages/pi-coding-agent/src/core/sdk.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +23 -7
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +75 -102
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-ordering.test.ts +14 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +23 -8
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/terminal.test.d.ts +2 -0
- package/packages/pi-tui/dist/__tests__/terminal.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/__tests__/terminal.test.js +103 -0
- package/packages/pi-tui/dist/__tests__/terminal.test.js.map +1 -0
- package/packages/pi-tui/dist/terminal.d.ts +2 -0
- package/packages/pi-tui/dist/terminal.d.ts.map +1 -1
- package/packages/pi-tui/dist/terminal.js +12 -0
- package/packages/pi-tui/dist/terminal.js.map +1 -1
- package/packages/pi-tui/src/__tests__/terminal.test.ts +121 -0
- package/packages/pi-tui/src/terminal.ts +11 -0
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/src/resources/GSD-WORKFLOW.md +7 -0
- package/src/resources/extensions/claude-code-cli/partial-builder.ts +2 -1
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +1 -1
- package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +19 -2
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +9 -0
- package/src/resources/extensions/gsd/auto/contracts.ts +14 -6
- package/src/resources/extensions/gsd/auto/infra-errors.ts +9 -3
- package/src/resources/extensions/gsd/auto/loop.ts +8 -5
- package/src/resources/extensions/gsd/auto/orchestrator.ts +11 -0
- package/src/resources/extensions/gsd/auto/phases.ts +90 -38
- package/src/resources/extensions/gsd/auto/workflow-memory-pressure.ts +13 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +72 -1
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +1 -0
- package/src/resources/extensions/gsd/auto-dispatch.ts +21 -19
- package/src/resources/extensions/gsd/auto-model-selection.ts +2 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +78 -8
- package/src/resources/extensions/gsd/auto-recovery.ts +74 -11
- package/src/resources/extensions/gsd/auto-start.ts +94 -12
- package/src/resources/extensions/gsd/auto-verification.ts +22 -2
- package/src/resources/extensions/gsd/auto-worktree.ts +193 -10
- package/src/resources/extensions/gsd/auto.ts +40 -5
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +42 -7
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +10 -9
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +4 -2
- package/src/resources/extensions/gsd/bootstrap/subagent-input.ts +3 -1
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +17 -2
- package/src/resources/extensions/gsd/commands/handlers/core.ts +17 -1
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +8 -3
- package/src/resources/extensions/gsd/crash-recovery.ts +44 -4
- package/src/resources/extensions/gsd/db/milestone-leases.ts +26 -0
- package/src/resources/extensions/gsd/db/unit-dispatches.ts +4 -3
- package/src/resources/extensions/gsd/dispatch-guard.ts +2 -2
- package/src/resources/extensions/gsd/doctor-git-checks.ts +45 -1
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +25 -13
- package/src/resources/extensions/gsd/doctor-types.ts +1 -0
- package/src/resources/extensions/gsd/doctor.ts +2 -27
- package/src/resources/extensions/gsd/export-html.ts +27 -427
- package/src/resources/extensions/gsd/forensics.ts +3 -3
- package/src/resources/extensions/gsd/git-service.ts +51 -4
- package/src/resources/extensions/gsd/gsd-db.ts +21 -6
- package/src/resources/extensions/gsd/guided-flow-queue.ts +4 -3
- package/src/resources/extensions/gsd/guided-flow.ts +134 -133
- package/src/resources/extensions/gsd/guided-unit-context.ts +30 -0
- package/src/resources/extensions/gsd/migrate/parsers.ts +11 -0
- package/src/resources/extensions/gsd/migration-auto-check.ts +15 -23
- package/src/resources/extensions/gsd/milestone-actions.ts +10 -4
- package/src/resources/extensions/gsd/native-git-bridge.ts +54 -12
- package/src/resources/extensions/gsd/pending-auto-start.ts +79 -0
- package/src/resources/extensions/gsd/post-execution-checks.ts +87 -2
- package/src/resources/extensions/gsd/pre-execution-checks.ts +32 -1
- package/src/resources/extensions/gsd/prompt-loader.ts +1 -1
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +8 -8
- package/src/resources/extensions/gsd/prompts/discuss.md +9 -9
- package/src/resources/extensions/gsd/prompts/guided-discuss-project.md +4 -4
- package/src/resources/extensions/gsd/prompts/guided-discuss-requirements.md +3 -3
- package/src/resources/extensions/gsd/prompts/plan-slice.md +4 -4
- package/src/resources/extensions/gsd/prompts/queue.md +4 -4
- package/src/resources/extensions/gsd/prompts/refine-slice.md +2 -2
- package/src/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
- package/src/resources/extensions/gsd/queue-reorder-ui.ts +31 -13
- package/src/resources/extensions/gsd/smart-entry-routing.ts +77 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/merge-state.ts +8 -1
- package/src/resources/extensions/gsd/state-reconciliation/drift/project-md.ts +12 -15
- package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +17 -25
- package/src/resources/extensions/gsd/state.ts +1 -1
- package/src/resources/extensions/gsd/status-guards.ts +13 -0
- package/src/resources/extensions/gsd/templates/plan.md +8 -5
- package/src/resources/extensions/gsd/templates/task-plan.md +4 -2
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +71 -0
- package/src/resources/extensions/gsd/tests/auto-deterministic-error-classification-4973.test.ts +116 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +56 -0
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +80 -1
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +35 -7
- package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +53 -2
- package/src/resources/extensions/gsd/tests/auto-post-unit-step-message.test.ts +12 -1
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +91 -6
- package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/auto-stop-notification.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-registry.test.ts +69 -1
- package/src/resources/extensions/gsd/tests/checkout-branch-stash-guard.test.ts +87 -0
- package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +11 -2
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +4 -1
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +5 -9
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +3 -1
- package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +86 -2
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/db-authority-regression.test.ts +208 -0
- package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +59 -2
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/doctor-empty-worktree.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/export-html-enhancements.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +11 -0
- package/src/resources/extensions/gsd/tests/guided-discuss-project-prompt-rendering.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/guided-dispatch-root.test.ts +106 -0
- package/src/resources/extensions/gsd/tests/guided-flow-session-isolation.test.ts +59 -11
- package/src/resources/extensions/gsd/tests/guided-flow.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/guided-tool-contract.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +7 -7
- package/src/resources/extensions/gsd/tests/hook-model-resolution.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/infra-error.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-runtime.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +112 -1
- package/src/resources/extensions/gsd/tests/integration/state-machine-runtime-failures.test.ts +6 -1
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/merge-db-cycle.test.ts +179 -0
- package/src/resources/extensions/gsd/tests/migrate-validator-parsers.test.ts +24 -1
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +26 -18
- package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +63 -2
- package/src/resources/extensions/gsd/tests/orphaned-worktree-audit.test.ts +121 -1
- package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +55 -1
- package/src/resources/extensions/gsd/tests/pending-autostart-scope.test.ts +29 -5
- package/src/resources/extensions/gsd/tests/pipeline-variant-dispatch.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +26 -0
- package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +225 -1
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +17 -0
- package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +86 -0
- package/src/resources/extensions/gsd/tests/post-unit-git-failure.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/prompt-loader.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +37 -1
- package/src/resources/extensions/gsd/tests/queue-reorder-ui.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/remediation-completion-guard.test.ts +89 -2
- package/src/resources/extensions/gsd/tests/run-uat-replay-cap.test.ts +2 -3
- package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +10 -0
- package/src/resources/extensions/gsd/tests/smart-entry-routing.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +53 -2
- package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +119 -23
- package/src/resources/extensions/gsd/tests/status-guards.test.ts +13 -1
- package/src/resources/extensions/gsd/tests/stuck-state-via-db.test.ts +64 -1
- package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +7 -3
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +82 -7
- package/src/resources/extensions/gsd/tests/validate-milestone-stuck-guard.test.ts +29 -2
- package/src/resources/extensions/gsd/tests/verification-gate.test.ts +110 -1
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +19 -1
- package/src/resources/extensions/gsd/tests/workflow-memory-pressure.test.ts +21 -1
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-git-pathspec.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +64 -12
- package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +38 -0
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +8 -10
- package/src/resources/extensions/gsd/tools/complete-slice.ts +6 -8
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +5 -1
- package/src/resources/extensions/gsd/tools/plan-slice.ts +98 -12
- package/src/resources/extensions/gsd/types.ts +1 -1
- package/src/resources/extensions/gsd/unit-context-manifest.ts +12 -9
- package/src/resources/extensions/gsd/validation.ts +23 -1
- package/src/resources/extensions/gsd/verification-gate.ts +78 -6
- package/src/resources/extensions/gsd/workflow-mcp.ts +18 -1
- package/src/resources/extensions/gsd/workflow-projections.ts +6 -8
- package/src/resources/extensions/gsd/worktree-lifecycle.ts +41 -8
- package/src/resources/extensions/gsd/worktree-manager.ts +1 -1
- package/src/resources/extensions/shared/html-shell.ts +412 -0
- package/src/resources/extensions/visual-brief/page-contract.ts +2 -0
- package/src/resources/extensions/visual-brief/prompts.ts +37 -1
- package/src/resources/extensions/visual-brief/tests/visual-brief.test.ts +40 -0
- package/dist/web/standalone/.next/server/chunks/5822.js +0 -2
- package/dist/web/standalone/.next/static/chunks/app/layout-a16c7a7ecdf0c2cf.js +0 -1
- package/dist/web/standalone/.next/static/css/0262768ec1b89d34.css +0 -1
- package/dist/web/standalone/.next/static/css/de70bee13400563f.css +0 -1
- package/dist/web/standalone/.next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/747892c23ea88013-s.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/8d697b304b401681-s.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/93f479601ee12b01-s.p.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/9610d9e46709d722-s.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
- /package/dist/web/standalone/.next/static/{Qgr2B_MRhPxC0z8fwv4vT → O6femb9LLl3nlgsDaYwS-}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{Qgr2B_MRhPxC0z8fwv4vT → O6femb9LLl3nlgsDaYwS-}/_ssgManifest.js +0 -0
|
@@ -44,10 +44,11 @@ import { readSessionLockData, isSessionLockProcessAlive } from "./session-lock.j
|
|
|
44
44
|
import { nativeAddAll, nativeCommit, nativeHasCommittedHead, nativeIsRepo, nativeInit } from "./native-git-bridge.js";
|
|
45
45
|
import { isInheritedRepo } from "./repo-identity.js";
|
|
46
46
|
import { ensureGitignore, ensurePreferences, untrackRuntimeFiles } from "./gitignore.js";
|
|
47
|
-
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
47
|
+
import { getIsolationMode, loadEffectiveGSDPreferences } from "./preferences.js";
|
|
48
48
|
import { resolveUokFlags } from "./uok/flags.js";
|
|
49
49
|
import { ensurePlanV2Graph, isMissingFinalizedContextResult } from "./uok/plan-v2.js";
|
|
50
50
|
import { detectProjectState, hasGsdBootstrapArtifacts } from "./detection.js";
|
|
51
|
+
import { isFutureMilestoneStatus } from "./status-guards.js";
|
|
51
52
|
import { showProjectInit, offerMigration } from "./init-wizard.js";
|
|
52
53
|
import { validateDirectory } from "./validate-directory.js";
|
|
53
54
|
import { showConfirm } from "../shared/tui.js";
|
|
@@ -69,8 +70,24 @@ import {
|
|
|
69
70
|
formatPriorContextBrief,
|
|
70
71
|
} from "./preparation.js";
|
|
71
72
|
import { verifyExpectedArtifact } from "./auto-recovery.js";
|
|
72
|
-
import {
|
|
73
|
+
import type { MilestoneScope } from "./workspace.js";
|
|
73
74
|
import { getPendingGate, extractDepthVerificationMilestoneId } from "./bootstrap/write-gate.js";
|
|
75
|
+
import {
|
|
76
|
+
_getPendingAutoStart,
|
|
77
|
+
clearPendingAutoStart,
|
|
78
|
+
deletePendingAutoStart,
|
|
79
|
+
getDiscussionMilestoneId,
|
|
80
|
+
hasPendingAutoStart,
|
|
81
|
+
setPendingAutoStart,
|
|
82
|
+
} from "./pending-auto-start.js";
|
|
83
|
+
import { clearGuidedUnitContext, setGuidedUnitContext } from "./guided-unit-context.js";
|
|
84
|
+
|
|
85
|
+
export {
|
|
86
|
+
_getPendingAutoStart,
|
|
87
|
+
clearPendingAutoStart,
|
|
88
|
+
getDiscussionMilestoneId,
|
|
89
|
+
setPendingAutoStart,
|
|
90
|
+
} from "./pending-auto-start.js";
|
|
74
91
|
|
|
75
92
|
export function shouldSkipGitBootstrapAfterInit(result: { gitEnabled?: boolean }): boolean {
|
|
76
93
|
return result.gitEnabled === false;
|
|
@@ -92,6 +109,12 @@ import { deleteRuntimeKv } from "./db/runtime-kv.js";
|
|
|
92
109
|
import { PAUSED_SESSION_KV_KEY } from "./interrupted-session.js";
|
|
93
110
|
import { buildWorkflowDispatchContent } from "./workflow-protocol.js";
|
|
94
111
|
import { isFullGsdToolSurfaceRequested, restoreGsdWorkflowTools, scopeGsdWorkflowToolsForDispatch } from "./bootstrap/register-hooks.js";
|
|
112
|
+
import {
|
|
113
|
+
resolveActiveTaskChoiceRoute,
|
|
114
|
+
type ActiveTaskChoice,
|
|
115
|
+
} from "./smart-entry-routing.js";
|
|
116
|
+
|
|
117
|
+
export { resolveGuidedExecuteLaunchMode } from "./smart-entry-routing.js";
|
|
95
118
|
|
|
96
119
|
type AutoStartOptions = Parameters<typeof startAutoDetached>[4];
|
|
97
120
|
type AutoStartLauncher = typeof startAutoDetached;
|
|
@@ -228,26 +251,6 @@ function buildDocsCommitInstruction(_message: string): string {
|
|
|
228
251
|
|
|
229
252
|
// ─── Auto-start after discuss ─────────────────────────────────────────────────
|
|
230
253
|
|
|
231
|
-
/** Pending auto-start context, keyed by basePath for session isolation (#2985). */
|
|
232
|
-
interface PendingAutoStartEntry {
|
|
233
|
-
ctx: ExtensionCommandContext;
|
|
234
|
-
pi: ExtensionAPI;
|
|
235
|
-
basePath: string;
|
|
236
|
-
milestoneId: string; // the milestone being discussed
|
|
237
|
-
step?: boolean; // preserve step mode through discuss → auto transition
|
|
238
|
-
createdAt: number; // timestamp for staleness detection (#3274)
|
|
239
|
-
// #4573: counter for how many times the LLM emitted the ready phrase
|
|
240
|
-
// without writing the required artifacts. Cleared on entry delete/recreate.
|
|
241
|
-
readyRejectCount?: number;
|
|
242
|
-
// C1: scope is pinned at reservation time so path resolution is immune to
|
|
243
|
-
// cwd-drift between discuss and checkAutoStartAfterDiscuss.
|
|
244
|
-
// TODO(C3): basePath becomes redundant once all consumers migrate to scope.
|
|
245
|
-
scope: MilestoneScope;
|
|
246
|
-
// H1: retry counter for Gate 1b plan-blocked recovery. Capped at
|
|
247
|
-
// MAX_PLAN_BLOCKED_RECOVERIES to prevent infinite recovery loops (#5012).
|
|
248
|
-
planBlockedRecoveryCount: number;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
254
|
interface PendingDeepProjectSetupEntry {
|
|
252
255
|
ctx: ExtensionCommandContext;
|
|
253
256
|
pi: ExtensionAPI;
|
|
@@ -273,7 +276,6 @@ const MAX_PLAN_BLOCKED_RECOVERIES = 3;
|
|
|
273
276
|
// suffix) with optional trailing punctuation.
|
|
274
277
|
const READY_PHRASE_RE = /\bMilestone\s+M\d{3}[A-Z0-9-]*\s+ready\.?/i;
|
|
275
278
|
|
|
276
|
-
const pendingAutoStartMap = new Map<string, PendingAutoStartEntry>();
|
|
277
279
|
const pendingDeepProjectSetupMap = new Map<string, PendingDeepProjectSetupEntry>();
|
|
278
280
|
const USER_DRIVEN_DEEP_SETUP_UNITS = new Set([
|
|
279
281
|
"discuss-project",
|
|
@@ -300,17 +302,6 @@ This stage is running inside the foreground \`/gsd new-project --deep\` intervie
|
|
|
300
302
|
- Do NOT call \`ask_user_questions\`, \`AskUserQuestion\`, or ToolSearch to discover user-input tools.
|
|
301
303
|
- Ask one focused round, then stop and wait for the user's normal chat response.`;
|
|
302
304
|
|
|
303
|
-
/**
|
|
304
|
-
* Backward-compat bridge: returns a mutable reference to the entry matching
|
|
305
|
-
* basePath, or the sole entry when only one session exists.
|
|
306
|
-
* Exported for testing — internal use only in production code.
|
|
307
|
-
*/
|
|
308
|
-
export function _getPendingAutoStart(basePath?: string): PendingAutoStartEntry | null {
|
|
309
|
-
if (basePath) return pendingAutoStartMap.get(basePath) ?? null;
|
|
310
|
-
if (pendingAutoStartMap.size === 1) return pendingAutoStartMap.values().next().value!;
|
|
311
|
-
return null;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
305
|
function hasNestedFileOrSymlink(dir: string): boolean {
|
|
315
306
|
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
316
307
|
if (entry.isFile() || entry.isSymbolicLink()) return true;
|
|
@@ -344,29 +335,6 @@ function clearEmptyLegacyDeepSetupPseudoMilestones(basePath: string, entries: st
|
|
|
344
335
|
return remaining;
|
|
345
336
|
}
|
|
346
337
|
|
|
347
|
-
/**
|
|
348
|
-
* Store pending auto-start state for a project.
|
|
349
|
-
* Exported for testing (#2985).
|
|
350
|
-
*/
|
|
351
|
-
export function setPendingAutoStart(basePath: string, entry: { basePath: string; milestoneId: string; ctx?: ExtensionCommandContext; pi?: ExtensionAPI; step?: boolean; createdAt?: number }): void {
|
|
352
|
-
const ws = createWorkspace(entry.basePath);
|
|
353
|
-
const scope = scopeMilestone(ws, entry.milestoneId);
|
|
354
|
-
pendingAutoStartMap.set(basePath, { createdAt: Date.now(), planBlockedRecoveryCount: 0, ...entry, scope } as PendingAutoStartEntry);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* Clear pending auto-start state.
|
|
359
|
-
* If basePath is given, clears only that project. Otherwise clears all.
|
|
360
|
-
* Exported for testing (#2985).
|
|
361
|
-
*/
|
|
362
|
-
export function clearPendingAutoStart(basePath?: string): void {
|
|
363
|
-
if (basePath) {
|
|
364
|
-
pendingAutoStartMap.delete(basePath);
|
|
365
|
-
} else {
|
|
366
|
-
pendingAutoStartMap.clear();
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
338
|
export function clearPendingDeepProjectSetup(basePath?: string): void {
|
|
371
339
|
if (basePath) {
|
|
372
340
|
pendingDeepProjectSetupMap.delete(basePath);
|
|
@@ -375,23 +343,6 @@ export function clearPendingDeepProjectSetup(basePath?: string): void {
|
|
|
375
343
|
}
|
|
376
344
|
}
|
|
377
345
|
|
|
378
|
-
/**
|
|
379
|
-
* Returns the milestoneId being discussed for the given project.
|
|
380
|
-
* When basePath is omitted and only one session is active, returns that
|
|
381
|
-
* session's milestoneId for backward compatibility. Returns null when
|
|
382
|
-
* multiple sessions exist and basePath is not specified (#2985 Bug 4).
|
|
383
|
-
*/
|
|
384
|
-
export function getDiscussionMilestoneId(basePath?: string): string | null {
|
|
385
|
-
if (basePath) {
|
|
386
|
-
return pendingAutoStartMap.get(basePath)?.milestoneId ?? null;
|
|
387
|
-
}
|
|
388
|
-
// Backward compat: return the sole entry's milestoneId, or null if ambiguous
|
|
389
|
-
if (pendingAutoStartMap.size === 1) {
|
|
390
|
-
return pendingAutoStartMap.values().next().value!.milestoneId;
|
|
391
|
-
}
|
|
392
|
-
return null;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
346
|
function _getPendingDeepProjectSetup(basePath?: string): PendingDeepProjectSetupEntry | null {
|
|
396
347
|
if (basePath) return pendingDeepProjectSetupMap.get(basePath) ?? null;
|
|
397
348
|
if (pendingDeepProjectSetupMap.size === 1) return pendingDeepProjectSetupMap.values().next().value!;
|
|
@@ -544,13 +495,14 @@ async function dispatchNextDeepProjectSetupStage(entry: PendingDeepProjectSetupE
|
|
|
544
495
|
"gsd-run",
|
|
545
496
|
entry.ctx,
|
|
546
497
|
result.unitType,
|
|
498
|
+
{ basePath: entry.basePath },
|
|
547
499
|
);
|
|
548
500
|
return true;
|
|
549
501
|
}
|
|
550
502
|
|
|
551
503
|
/** Called from agent_end to check if auto-mode should start after discuss */
|
|
552
|
-
export function checkAutoStartAfterDiscuss(): boolean {
|
|
553
|
-
const entry = _getPendingAutoStart();
|
|
504
|
+
export function checkAutoStartAfterDiscuss(lookupBasePath?: string): boolean {
|
|
505
|
+
const entry = _getPendingAutoStart(lookupBasePath);
|
|
554
506
|
if (!entry) return false;
|
|
555
507
|
|
|
556
508
|
const { ctx, pi, basePath, milestoneId, step } = entry;
|
|
@@ -735,7 +687,7 @@ export function checkAutoStartAfterDiscuss(): boolean {
|
|
|
735
687
|
}
|
|
736
688
|
}
|
|
737
689
|
|
|
738
|
-
|
|
690
|
+
deletePendingAutoStart(basePath);
|
|
739
691
|
ctx.ui.notify(`Milestone ${milestoneId} ready.`, "success");
|
|
740
692
|
scheduleAutoStartAfterIdle(ctx, pi, basePath, false, { step });
|
|
741
693
|
return true;
|
|
@@ -806,8 +758,8 @@ function hasToolUse(msg: any): boolean {
|
|
|
806
758
|
* Returns true when a nudge (or give-up) was emitted, signaling the caller to
|
|
807
759
|
* skip `resolveAgentEnd`.
|
|
808
760
|
*/
|
|
809
|
-
export function maybeHandleReadyPhraseWithoutFiles(event: { messages: any[] }): boolean {
|
|
810
|
-
const entry = _getPendingAutoStart();
|
|
761
|
+
export function maybeHandleReadyPhraseWithoutFiles(event: { messages: any[] }, lookupBasePath?: string): boolean {
|
|
762
|
+
const entry = _getPendingAutoStart(lookupBasePath);
|
|
811
763
|
if (!entry) return false;
|
|
812
764
|
const { ctx, pi, basePath, milestoneId } = entry;
|
|
813
765
|
|
|
@@ -854,7 +806,7 @@ export function maybeHandleReadyPhraseWithoutFiles(event: { messages: any[] }):
|
|
|
854
806
|
if (entry.readyRejectCount > MAX_READY_REJECTS) {
|
|
855
807
|
// Give up: clear state and tell the user to re-run /gsd. Avoids an
|
|
856
808
|
// infinite nudge loop when the LLM never produces the writes.
|
|
857
|
-
|
|
809
|
+
deletePendingAutoStart(basePath);
|
|
858
810
|
ctx.ui.notify(
|
|
859
811
|
`Milestone ${milestoneId}: LLM signaled "ready" ${entry.readyRejectCount} times without writing files. ` +
|
|
860
812
|
`Stopping auto-nudge. Run /gsd to try again.`,
|
|
@@ -935,10 +887,11 @@ export function resetEmptyTurnCounter(basePath?: string): void {
|
|
|
935
887
|
export function maybeHandleEmptyIntentTurn(
|
|
936
888
|
event: { messages: any[] },
|
|
937
889
|
isAuto: boolean,
|
|
890
|
+
lookupBasePath?: string,
|
|
938
891
|
): boolean {
|
|
939
892
|
// Gate: only fire when there is system-driven work in flight. Interactive
|
|
940
893
|
// /gsd discuss (user-driven) produces legitimate text-only turns.
|
|
941
|
-
if (!isAuto &&
|
|
894
|
+
if (!isAuto && !hasPendingAutoStart(lookupBasePath)) return false;
|
|
942
895
|
|
|
943
896
|
const lastMsg = event.messages[event.messages.length - 1];
|
|
944
897
|
if (!lastMsg) return false;
|
|
@@ -965,7 +918,7 @@ export function maybeHandleEmptyIntentTurn(
|
|
|
965
918
|
|
|
966
919
|
// Resolve the target basePath + pi for injection. Prefer the pending
|
|
967
920
|
// autostart entry (discuss flow); otherwise we cannot inject.
|
|
968
|
-
const entry = _getPendingAutoStart();
|
|
921
|
+
const entry = _getPendingAutoStart(lookupBasePath);
|
|
969
922
|
if (!entry) return false;
|
|
970
923
|
const { ctx, pi, basePath } = entry;
|
|
971
924
|
|
|
@@ -1024,6 +977,19 @@ type UIContext = ExtensionContext;
|
|
|
1024
977
|
|
|
1025
978
|
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
1026
979
|
|
|
980
|
+
interface DispatchWorkflowOptions {
|
|
981
|
+
basePath?: string;
|
|
982
|
+
deps?: {
|
|
983
|
+
loadPreferences?: typeof loadEffectiveGSDPreferences;
|
|
984
|
+
selectModel?: typeof selectAndApplyModel;
|
|
985
|
+
getTransportSupportError?: typeof getWorkflowTransportSupportError;
|
|
986
|
+
};
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
export function resolveGuidedDispatchProjectRoot(basePath?: string): string {
|
|
990
|
+
return basePath ?? process.cwd();
|
|
991
|
+
}
|
|
992
|
+
|
|
1027
993
|
/**
|
|
1028
994
|
* Read GSD-WORKFLOW.md and dispatch it to the LLM with a contextual note.
|
|
1029
995
|
* This is the only way the wizard triggers work — everything else is the LLM's job.
|
|
@@ -1039,13 +1005,20 @@ async function dispatchWorkflow(
|
|
|
1039
1005
|
customType = "gsd-run",
|
|
1040
1006
|
ctx?: ExtensionContext,
|
|
1041
1007
|
unitType?: string,
|
|
1008
|
+
options?: DispatchWorkflowOptions,
|
|
1042
1009
|
): Promise<void> {
|
|
1010
|
+
const resolvedOptions = options ?? {};
|
|
1011
|
+
const projectRoot = resolveGuidedDispatchProjectRoot(resolvedOptions.basePath);
|
|
1012
|
+
const loadPreferences = resolvedOptions.deps?.loadPreferences ?? loadEffectiveGSDPreferences;
|
|
1013
|
+
const selectModel = resolvedOptions.deps?.selectModel ?? selectAndApplyModel;
|
|
1014
|
+
const getTransportSupportError = resolvedOptions.deps?.getTransportSupportError ?? getWorkflowTransportSupportError;
|
|
1015
|
+
|
|
1043
1016
|
// Route through the dynamic routing pipeline (complexity classification,
|
|
1044
1017
|
// tier downgrade, fallback chains) — same path as auto-mode dispatches (#2958).
|
|
1045
1018
|
if (ctx && unitType) {
|
|
1046
|
-
const prefs =
|
|
1047
|
-
const result = await
|
|
1048
|
-
ctx, pi, unitType, /* unitId */ "",
|
|
1019
|
+
const prefs = loadPreferences(projectRoot)?.preferences;
|
|
1020
|
+
const result = await selectModel(
|
|
1021
|
+
ctx, pi, unitType, /* unitId */ "", projectRoot,
|
|
1049
1022
|
prefs, /* verbose */ false, /* autoModeStartModel */ null,
|
|
1050
1023
|
/* retryContext */ undefined, /* isAutoMode */ false,
|
|
1051
1024
|
);
|
|
@@ -1057,11 +1030,11 @@ async function dispatchWorkflow(
|
|
|
1057
1030
|
});
|
|
1058
1031
|
}
|
|
1059
1032
|
|
|
1060
|
-
const compatibilityError =
|
|
1033
|
+
const compatibilityError = getTransportSupportError(
|
|
1061
1034
|
result.appliedModel?.provider ?? ctx.model?.provider,
|
|
1062
1035
|
getRequiredWorkflowToolsForGuidedUnit(unitType),
|
|
1063
1036
|
{
|
|
1064
|
-
projectRoot
|
|
1037
|
+
projectRoot,
|
|
1065
1038
|
surface: "guided flow",
|
|
1066
1039
|
unitType,
|
|
1067
1040
|
authMode: result.appliedModel?.provider
|
|
@@ -1070,6 +1043,7 @@ async function dispatchWorkflow(
|
|
|
1070
1043
|
? ctx.modelRegistry.getProviderAuthMode(ctx.model.provider)
|
|
1071
1044
|
: undefined,
|
|
1072
1045
|
baseUrl: result.appliedModel?.baseUrl ?? ctx.model?.baseUrl,
|
|
1046
|
+
activeTools: typeof pi.getActiveTools === "function" ? pi.getActiveTools() : [],
|
|
1073
1047
|
},
|
|
1074
1048
|
);
|
|
1075
1049
|
if (compatibilityError) {
|
|
@@ -1119,14 +1093,20 @@ async function dispatchWorkflow(
|
|
|
1119
1093
|
const workflowPath = process.env.GSD_WORKFLOW_PATH ?? join(gsdHome(), "agent", "GSD-WORKFLOW.md");
|
|
1120
1094
|
const workflow = readFileSync(workflowPath, "utf-8");
|
|
1121
1095
|
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1096
|
+
if (unitType) setGuidedUnitContext(projectRoot, unitType);
|
|
1097
|
+
try {
|
|
1098
|
+
pi.sendMessage(
|
|
1099
|
+
{
|
|
1100
|
+
customType,
|
|
1101
|
+
content: buildWorkflowDispatchContent({ workflow, workflowPath, task: note }),
|
|
1102
|
+
display: false,
|
|
1103
|
+
},
|
|
1104
|
+
{ triggerTurn: true },
|
|
1105
|
+
);
|
|
1106
|
+
} catch (err) {
|
|
1107
|
+
clearGuidedUnitContext(projectRoot);
|
|
1108
|
+
throw err;
|
|
1109
|
+
}
|
|
1130
1110
|
} finally {
|
|
1131
1111
|
// Restore full tool set after the message is queued. The LLM turn has
|
|
1132
1112
|
// already captured the scoped set — restoring prevents the narrowed
|
|
@@ -1357,7 +1337,7 @@ export async function showHeadlessMilestoneCreation(
|
|
|
1357
1337
|
// model/tool routing to skip discuss-flow tool scoping and
|
|
1358
1338
|
// `checkAutoStartAfterDiscuss` guardrails that rely on the
|
|
1359
1339
|
// "discuss-"-prefixed unitType.
|
|
1360
|
-
await dispatchWorkflow(pi, prompt, "gsd-run", ctx, "discuss-milestone");
|
|
1340
|
+
await dispatchWorkflow(pi, prompt, "gsd-run", ctx, "discuss-milestone", { basePath });
|
|
1361
1341
|
}
|
|
1362
1342
|
|
|
1363
1343
|
|
|
@@ -1493,7 +1473,7 @@ export async function showDiscuss(
|
|
|
1493
1473
|
// No active milestone (or corrupted milestone with undefined id) —
|
|
1494
1474
|
// check for pending milestones to discuss instead
|
|
1495
1475
|
if (!state.activeMilestone?.id) {
|
|
1496
|
-
const pendingMilestones = state.registry.filter(m => m.status
|
|
1476
|
+
const pendingMilestones = state.registry.filter(m => isFutureMilestoneStatus(m.status));
|
|
1497
1477
|
if (pendingMilestones.length === 0) {
|
|
1498
1478
|
ctx.ui.notify("No active milestone. Run /gsd to create one first.", "warning");
|
|
1499
1479
|
return;
|
|
@@ -1539,6 +1519,7 @@ export async function showDiscuss(
|
|
|
1539
1519
|
const discussMilestoneTemplates = inlineTemplate("context", "Context");
|
|
1540
1520
|
const structuredQuestionsAvailable = getStructuredQuestionsAvailability(pi, ctx);
|
|
1541
1521
|
const basePrompt = loadPrompt("guided-discuss-milestone", {
|
|
1522
|
+
workingDirectory: basePath,
|
|
1542
1523
|
milestoneId: mid, milestoneTitle, inlinedTemplates: discussMilestoneTemplates, structuredQuestionsAvailable,
|
|
1543
1524
|
commitInstruction: buildDocsCommitInstruction(`docs(${mid}): milestone context from discuss`),
|
|
1544
1525
|
fastPathInstruction: "",
|
|
@@ -1547,16 +1528,17 @@ export async function showDiscuss(
|
|
|
1547
1528
|
? `${basePrompt}\n\n## Prior Discussion (Draft Seed)\n\n${draftContent}`
|
|
1548
1529
|
: basePrompt;
|
|
1549
1530
|
setPendingAutoStart(basePath, { ctx, pi, basePath, milestoneId: mid, step: false });
|
|
1550
|
-
await dispatchWorkflow(pi, seed, "gsd-discuss", ctx, "discuss-milestone");
|
|
1531
|
+
await dispatchWorkflow(pi, seed, "gsd-discuss", ctx, "discuss-milestone", { basePath });
|
|
1551
1532
|
} else if (choice === "discuss_fresh") {
|
|
1552
1533
|
const discussMilestoneTemplates = inlineTemplate("context", "Context");
|
|
1553
1534
|
const structuredQuestionsAvailable = getStructuredQuestionsAvailability(pi, ctx);
|
|
1554
1535
|
setPendingAutoStart(basePath, { ctx, pi, basePath, milestoneId: mid, step: false });
|
|
1555
1536
|
await dispatchWorkflow(pi, loadPrompt("guided-discuss-milestone", {
|
|
1537
|
+
workingDirectory: basePath,
|
|
1556
1538
|
milestoneId: mid, milestoneTitle, inlinedTemplates: discussMilestoneTemplates, structuredQuestionsAvailable,
|
|
1557
1539
|
commitInstruction: buildDocsCommitInstruction(`docs(${mid}): milestone context from discuss`),
|
|
1558
1540
|
fastPathInstruction: "",
|
|
1559
|
-
}), "gsd-discuss", ctx, "discuss-milestone");
|
|
1541
|
+
}), "gsd-discuss", ctx, "discuss-milestone", { basePath });
|
|
1560
1542
|
} else if (choice === "skip_milestone") {
|
|
1561
1543
|
const { ensureDbOpen } = await import("./bootstrap/dynamic-tools.js");
|
|
1562
1544
|
await ensureDbOpen(basePath);
|
|
@@ -1564,7 +1546,7 @@ export async function showDiscuss(
|
|
|
1564
1546
|
const uniqueMilestoneIds = !!loadEffectiveGSDPreferences()?.preferences?.unique_milestone_ids;
|
|
1565
1547
|
const nextId = nextMilestoneIdReserved(milestoneIds, uniqueMilestoneIds, basePath);
|
|
1566
1548
|
setPendingAutoStart(basePath, { ctx, pi, basePath, milestoneId: nextId, step: false });
|
|
1567
|
-
await dispatchWorkflow(pi, await prepareAndBuildDiscussPrompt(ctx, pi, nextId, `New milestone ${nextId}.`, basePath), "gsd-run", ctx, "discuss-milestone");
|
|
1549
|
+
await dispatchWorkflow(pi, await prepareAndBuildDiscussPrompt(ctx, pi, nextId, `New milestone ${nextId}.`, basePath), "gsd-run", ctx, "discuss-milestone", { basePath });
|
|
1568
1550
|
}
|
|
1569
1551
|
return;
|
|
1570
1552
|
}
|
|
@@ -1603,7 +1585,7 @@ export async function showDiscuss(
|
|
|
1603
1585
|
|
|
1604
1586
|
if (pendingSlices.length === 0) {
|
|
1605
1587
|
// All slices complete — but queued milestones may still need discussion (#3150)
|
|
1606
|
-
const pendingMilestones = state.registry.filter(m => m.status
|
|
1588
|
+
const pendingMilestones = state.registry.filter(m => isFutureMilestoneStatus(m.status));
|
|
1607
1589
|
if (pendingMilestones.length > 0) {
|
|
1608
1590
|
await showDiscussQueuedMilestone(ctx, pi, basePath, pendingMilestones);
|
|
1609
1591
|
return;
|
|
@@ -1627,7 +1609,7 @@ export async function showDiscuss(
|
|
|
1627
1609
|
// If all pending slices are discussed, check for queued milestones before exiting (#3150)
|
|
1628
1610
|
const allDiscussed = pendingSlices.every(s => discussedMap.get(s.id));
|
|
1629
1611
|
if (allDiscussed) {
|
|
1630
|
-
const pendingMilestones = state.registry.filter(m => m.status
|
|
1612
|
+
const pendingMilestones = state.registry.filter(m => isFutureMilestoneStatus(m.status));
|
|
1631
1613
|
if (pendingMilestones.length > 0) {
|
|
1632
1614
|
await showDiscussQueuedMilestone(ctx, pi, basePath, pendingMilestones);
|
|
1633
1615
|
return;
|
|
@@ -1663,7 +1645,7 @@ export async function showDiscuss(
|
|
|
1663
1645
|
});
|
|
1664
1646
|
|
|
1665
1647
|
// Offer access to queued milestones when any exist
|
|
1666
|
-
const pendingMilestones = state.registry.filter(m => m.status
|
|
1648
|
+
const pendingMilestones = state.registry.filter(m => isFutureMilestoneStatus(m.status));
|
|
1667
1649
|
if (pendingMilestones.length > 0) {
|
|
1668
1650
|
actions.push({
|
|
1669
1651
|
id: "discuss_queued_milestone",
|
|
@@ -1712,7 +1694,7 @@ export async function showDiscuss(
|
|
|
1712
1694
|
|
|
1713
1695
|
const sqAvail = getStructuredQuestionsAvailability(pi, ctx);
|
|
1714
1696
|
const prompt = await buildDiscussSlicePrompt(mid, chosen.id, chosen.title, basePath, { rediscuss: isRediscuss, structuredQuestionsAvailable: sqAvail });
|
|
1715
|
-
await dispatchWorkflow(pi, prompt, "gsd-discuss", ctx, "discuss-slice");
|
|
1697
|
+
await dispatchWorkflow(pi, prompt, "gsd-discuss", ctx, "discuss-slice", { basePath });
|
|
1716
1698
|
|
|
1717
1699
|
// Wait for the discuss session to finish, then loop back to the picker
|
|
1718
1700
|
await ctx.waitForIdle();
|
|
@@ -1738,10 +1720,11 @@ async function showDiscussQueuedMilestone(
|
|
|
1738
1720
|
const hasContext = !!resolveMilestoneFile(basePath, m.id, "CONTEXT");
|
|
1739
1721
|
const hasDraft = !hasContext && !!resolveMilestoneFile(basePath, m.id, "CONTEXT-DRAFT");
|
|
1740
1722
|
const contextStatus = hasContext ? "context ✓" : hasDraft ? "draft context" : "no context yet";
|
|
1723
|
+
const statusLabel = m.status === "planned" ? "planned" : "queued";
|
|
1741
1724
|
return {
|
|
1742
1725
|
id: m.id,
|
|
1743
1726
|
label: `${m.id}: ${m.title}`,
|
|
1744
|
-
description: `[
|
|
1727
|
+
description: `[${statusLabel}] · ${contextStatus}`,
|
|
1745
1728
|
recommended: i === 0,
|
|
1746
1729
|
};
|
|
1747
1730
|
});
|
|
@@ -1822,6 +1805,7 @@ async function dispatchDiscussForMilestone(
|
|
|
1822
1805
|
const discussMilestoneTemplates = inlineTemplate("context", "Context");
|
|
1823
1806
|
const structuredQuestionsAvailable = getStructuredQuestionsAvailability(pi, ctx);
|
|
1824
1807
|
const basePrompt = loadPrompt("guided-discuss-milestone", {
|
|
1808
|
+
workingDirectory: basePath,
|
|
1825
1809
|
milestoneId: mid,
|
|
1826
1810
|
milestoneTitle,
|
|
1827
1811
|
inlinedTemplates: discussMilestoneTemplates,
|
|
@@ -1832,7 +1816,7 @@ async function dispatchDiscussForMilestone(
|
|
|
1832
1816
|
const prompt = draftContent
|
|
1833
1817
|
? `${basePrompt}\n\n## Prior Discussion (Draft Seed)\n\n${draftContent}`
|
|
1834
1818
|
: basePrompt;
|
|
1835
|
-
await dispatchWorkflow(pi, prompt, "gsd-discuss", ctx, "discuss-milestone");
|
|
1819
|
+
await dispatchWorkflow(pi, prompt, "gsd-discuss", ctx, "discuss-milestone", { basePath });
|
|
1836
1820
|
}
|
|
1837
1821
|
|
|
1838
1822
|
// ─── Smart Entry Point ────────────────────────────────────────────────────────
|
|
@@ -1975,7 +1959,7 @@ async function handleMilestoneActions(
|
|
|
1975
1959
|
await dispatchWorkflow(pi, await prepareAndBuildDiscussPrompt(ctx, pi, nextId,
|
|
1976
1960
|
`New milestone ${nextId}.`,
|
|
1977
1961
|
basePath
|
|
1978
|
-
), "gsd-run", ctx, "discuss-milestone");
|
|
1962
|
+
), "gsd-run", ctx, "discuss-milestone", { basePath });
|
|
1979
1963
|
return true;
|
|
1980
1964
|
}
|
|
1981
1965
|
|
|
@@ -2121,18 +2105,19 @@ export async function showSmartEntry(
|
|
|
2121
2105
|
|
|
2122
2106
|
if (interrupted.classification !== "recoverable") {
|
|
2123
2107
|
try {
|
|
2124
|
-
const {
|
|
2125
|
-
const result = await
|
|
2126
|
-
if (result.action === "
|
|
2108
|
+
const { checkMarkdownHierarchyAgainstDb } = await import("./migration-auto-check.js");
|
|
2109
|
+
const result = await checkMarkdownHierarchyAgainstDb(basePath);
|
|
2110
|
+
if (result.action === "recovery-required") {
|
|
2127
2111
|
ctx.ui.notify(
|
|
2128
|
-
|
|
2129
|
-
|
|
2112
|
+
result.message ??
|
|
2113
|
+
`Markdown planning artifacts do not match the authoritative DB. Run \`${result.recoveryCommand ?? "gsd recover"}\` to import markdown explicitly.`,
|
|
2114
|
+
"warning",
|
|
2130
2115
|
);
|
|
2131
2116
|
}
|
|
2132
2117
|
} catch (err) {
|
|
2133
2118
|
const message = err instanceof Error ? err.message : String(err);
|
|
2134
|
-
ctx.ui.notify(`GSD could not
|
|
2135
|
-
logWarning("guided", `planning state
|
|
2119
|
+
ctx.ui.notify(`GSD could not compare markdown planning artifacts with gsd.db: ${message}`, "warning");
|
|
2120
|
+
logWarning("guided", `planning state DB/markdown comparison failed: ${message}`, { file: "guided-flow.ts" });
|
|
2136
2121
|
}
|
|
2137
2122
|
}
|
|
2138
2123
|
|
|
@@ -2173,17 +2158,17 @@ export async function showSmartEntry(
|
|
|
2173
2158
|
// Both /gsd and /gsd auto reach this branch when no milestone exists yet.
|
|
2174
2159
|
// Without this guard, every subsequent /gsd call overwrites the pending auto-start
|
|
2175
2160
|
// and fires another dispatchWorkflow, resetting the conversation mid-interview.
|
|
2176
|
-
if (
|
|
2161
|
+
if (hasPendingAutoStart(basePath)) {
|
|
2177
2162
|
// #3274: If /clear interrupted the discussion, the pending entry is stale.
|
|
2178
2163
|
// Detect staleness: no manifest, no milestone CONTEXT artifact, AND entry is older than
|
|
2179
2164
|
// 30s (avoids race between .set() and LLM writing first artifact).
|
|
2180
|
-
const entry =
|
|
2165
|
+
const entry = _getPendingAutoStart(basePath)!;
|
|
2181
2166
|
const ageMs = Date.now() - (entry.createdAt || 0);
|
|
2182
2167
|
const manifestExists = existsSync(join(gsdRoot(basePath), "DISCUSSION-MANIFEST.json"));
|
|
2183
2168
|
const milestoneHasContext = !!resolveMilestoneFile(basePath, entry.milestoneId, "CONTEXT");
|
|
2184
2169
|
if (!manifestExists && !milestoneHasContext && ageMs > 30_000) {
|
|
2185
2170
|
// Stale entry from an interrupted discussion — clear and continue
|
|
2186
|
-
|
|
2171
|
+
deletePendingAutoStart(basePath);
|
|
2187
2172
|
} else {
|
|
2188
2173
|
ctx.ui.notify("Discussion already in progress — answer the question above to continue.", "info");
|
|
2189
2174
|
return;
|
|
@@ -2223,7 +2208,7 @@ export async function showSmartEntry(
|
|
|
2223
2208
|
await dispatchWorkflow(pi, await prepareAndBuildDiscussPrompt(ctx, pi, nextId,
|
|
2224
2209
|
`New project, milestone ${nextId}. Do NOT read or explore .gsd/ — it's empty scaffolding.`,
|
|
2225
2210
|
basePath
|
|
2226
|
-
), "gsd-run", ctx, "discuss-milestone");
|
|
2211
|
+
), "gsd-run", ctx, "discuss-milestone", { basePath });
|
|
2227
2212
|
} else {
|
|
2228
2213
|
const choice = await showNextAction(ctx, {
|
|
2229
2214
|
title: "GSD — Get Shit Done",
|
|
@@ -2252,7 +2237,7 @@ export async function showSmartEntry(
|
|
|
2252
2237
|
await dispatchWorkflow(pi, await prepareAndBuildDiscussPrompt(ctx, pi, nextId,
|
|
2253
2238
|
`New milestone ${nextId}.`,
|
|
2254
2239
|
basePath
|
|
2255
|
-
), "gsd-run", ctx, "discuss-milestone");
|
|
2240
|
+
), "gsd-run", ctx, "discuss-milestone", { basePath });
|
|
2256
2241
|
}
|
|
2257
2242
|
}
|
|
2258
2243
|
return;
|
|
@@ -2274,6 +2259,7 @@ export async function showSmartEntry(
|
|
|
2274
2259
|
"gsd-discuss",
|
|
2275
2260
|
ctx,
|
|
2276
2261
|
"discuss-milestone",
|
|
2262
|
+
{ basePath },
|
|
2277
2263
|
);
|
|
2278
2264
|
return;
|
|
2279
2265
|
}
|
|
@@ -2315,7 +2301,7 @@ export async function showSmartEntry(
|
|
|
2315
2301
|
await dispatchWorkflow(pi, await prepareAndBuildDiscussPrompt(ctx, pi, nextId,
|
|
2316
2302
|
`New milestone ${nextId}.`,
|
|
2317
2303
|
basePath
|
|
2318
|
-
), "gsd-run", ctx, "discuss-milestone");
|
|
2304
|
+
), "gsd-run", ctx, "discuss-milestone", { basePath });
|
|
2319
2305
|
} else if (choice === "status") {
|
|
2320
2306
|
const { fireStatusViaCommand } = await import("./commands.js");
|
|
2321
2307
|
await fireStatusViaCommand(ctx);
|
|
@@ -2356,6 +2342,7 @@ export async function showSmartEntry(
|
|
|
2356
2342
|
const discussMilestoneTemplates = inlineTemplate("context", "Context");
|
|
2357
2343
|
const structuredQuestionsAvailable = getStructuredQuestionsAvailability(pi, ctx);
|
|
2358
2344
|
const basePrompt = loadPrompt("guided-discuss-milestone", {
|
|
2345
|
+
workingDirectory: basePath,
|
|
2359
2346
|
milestoneId, milestoneTitle, inlinedTemplates: discussMilestoneTemplates, structuredQuestionsAvailable,
|
|
2360
2347
|
commitInstruction: buildDocsCommitInstruction(`docs(${milestoneId}): milestone context from discuss`),
|
|
2361
2348
|
fastPathInstruction: "",
|
|
@@ -2364,16 +2351,17 @@ export async function showSmartEntry(
|
|
|
2364
2351
|
? `${basePrompt}\n\n## Prior Discussion (Draft Seed)\n\n${draftContent}`
|
|
2365
2352
|
: basePrompt;
|
|
2366
2353
|
setPendingAutoStart(basePath, { ctx, pi, basePath, milestoneId, step: stepMode });
|
|
2367
|
-
await dispatchWorkflow(pi, seed, "gsd-discuss", ctx, "discuss-milestone");
|
|
2354
|
+
await dispatchWorkflow(pi, seed, "gsd-discuss", ctx, "discuss-milestone", { basePath });
|
|
2368
2355
|
} else if (choice === "discuss_fresh") {
|
|
2369
2356
|
const discussMilestoneTemplates = inlineTemplate("context", "Context");
|
|
2370
2357
|
const structuredQuestionsAvailable = getStructuredQuestionsAvailability(pi, ctx);
|
|
2371
2358
|
setPendingAutoStart(basePath, { ctx, pi, basePath, milestoneId, step: stepMode });
|
|
2372
2359
|
await dispatchWorkflow(pi, loadPrompt("guided-discuss-milestone", {
|
|
2360
|
+
workingDirectory: basePath,
|
|
2373
2361
|
milestoneId, milestoneTitle, inlinedTemplates: discussMilestoneTemplates, structuredQuestionsAvailable,
|
|
2374
2362
|
commitInstruction: buildDocsCommitInstruction(`docs(${milestoneId}): milestone context from discuss`),
|
|
2375
2363
|
fastPathInstruction: "",
|
|
2376
|
-
}), "gsd-discuss", ctx, "discuss-milestone");
|
|
2364
|
+
}), "gsd-discuss", ctx, "discuss-milestone", { basePath });
|
|
2377
2365
|
} else if (choice === "skip_milestone") {
|
|
2378
2366
|
const milestoneIds = findMilestoneIds(basePath);
|
|
2379
2367
|
const uniqueMilestoneIds = !!loadEffectiveGSDPreferences()?.preferences?.unique_milestone_ids;
|
|
@@ -2382,7 +2370,7 @@ export async function showSmartEntry(
|
|
|
2382
2370
|
await dispatchWorkflow(pi, await prepareAndBuildDiscussPrompt(ctx, pi, nextId,
|
|
2383
2371
|
`New milestone ${nextId}.`,
|
|
2384
2372
|
basePath
|
|
2385
|
-
), "gsd-run", ctx, "discuss-milestone");
|
|
2373
|
+
), "gsd-run", ctx, "discuss-milestone", { basePath });
|
|
2386
2374
|
}
|
|
2387
2375
|
return;
|
|
2388
2376
|
}
|
|
@@ -2457,15 +2445,17 @@ export async function showSmartEntry(
|
|
|
2457
2445
|
"gsd-run",
|
|
2458
2446
|
ctx,
|
|
2459
2447
|
"plan-milestone",
|
|
2448
|
+
{ basePath },
|
|
2460
2449
|
);
|
|
2461
2450
|
} else if (choice === "discuss") {
|
|
2462
2451
|
const discussMilestoneTemplates = inlineTemplate("context", "Context");
|
|
2463
2452
|
const structuredQuestionsAvailable = getStructuredQuestionsAvailability(pi, ctx);
|
|
2464
2453
|
await dispatchWorkflow(pi, loadPrompt("guided-discuss-milestone", {
|
|
2454
|
+
workingDirectory: basePath,
|
|
2465
2455
|
milestoneId, milestoneTitle, inlinedTemplates: discussMilestoneTemplates, structuredQuestionsAvailable,
|
|
2466
2456
|
commitInstruction: buildDocsCommitInstruction(`docs(${milestoneId}): milestone context from discuss`),
|
|
2467
2457
|
fastPathInstruction: "",
|
|
2468
|
-
}), "gsd-run", ctx, "discuss-milestone");
|
|
2458
|
+
}), "gsd-run", ctx, "discuss-milestone", { basePath });
|
|
2469
2459
|
} else if (choice === "skip_milestone") {
|
|
2470
2460
|
const milestoneIds = findMilestoneIds(basePath);
|
|
2471
2461
|
const uniqueMilestoneIds = !!loadEffectiveGSDPreferences()?.preferences?.unique_milestone_ids;
|
|
@@ -2474,7 +2464,7 @@ export async function showSmartEntry(
|
|
|
2474
2464
|
await dispatchWorkflow(pi, await prepareAndBuildDiscussPrompt(ctx, pi, nextId,
|
|
2475
2465
|
`New milestone ${nextId}.`,
|
|
2476
2466
|
basePath
|
|
2477
|
-
), "gsd-run", ctx, "discuss-milestone");
|
|
2467
|
+
), "gsd-run", ctx, "discuss-milestone", { basePath });
|
|
2478
2468
|
} else if (choice === "discard_milestone") {
|
|
2479
2469
|
const confirmed = await showConfirm(ctx, {
|
|
2480
2470
|
title: "Discard milestone?",
|
|
@@ -2589,10 +2579,11 @@ export async function showSmartEntry(
|
|
|
2589
2579
|
"gsd-run",
|
|
2590
2580
|
ctx,
|
|
2591
2581
|
"plan-slice",
|
|
2582
|
+
{ basePath },
|
|
2592
2583
|
);
|
|
2593
2584
|
} else if (choice === "discuss") {
|
|
2594
2585
|
const sqAvail = getStructuredQuestionsAvailability(pi, ctx);
|
|
2595
|
-
await dispatchWorkflow(pi, await buildDiscussSlicePrompt(milestoneId, sliceId, sliceTitle, basePath, { rediscuss: hasContext, structuredQuestionsAvailable: sqAvail }), "gsd-run", ctx, "discuss-slice");
|
|
2586
|
+
await dispatchWorkflow(pi, await buildDiscussSlicePrompt(milestoneId, sliceId, sliceTitle, basePath, { rediscuss: hasContext, structuredQuestionsAvailable: sqAvail }), "gsd-run", ctx, "discuss-slice", { basePath });
|
|
2596
2587
|
} else if (choice === "research") {
|
|
2597
2588
|
const researchTemplates = inlineTemplate("research", "Research");
|
|
2598
2589
|
await dispatchWorkflow(pi, loadPrompt("guided-research-slice", {
|
|
@@ -2607,7 +2598,7 @@ export async function showSmartEntry(
|
|
|
2607
2598
|
sliceTitle,
|
|
2608
2599
|
extraContext: [researchTemplates],
|
|
2609
2600
|
}),
|
|
2610
|
-
}), "gsd-run", ctx, "research-slice");
|
|
2601
|
+
}), "gsd-run", ctx, "research-slice", { basePath });
|
|
2611
2602
|
} else if (choice === "status") {
|
|
2612
2603
|
const { fireStatusViaCommand } = await import("./commands.js");
|
|
2613
2604
|
await fireStatusViaCommand(ctx);
|
|
@@ -2652,6 +2643,7 @@ export async function showSmartEntry(
|
|
|
2652
2643
|
"gsd-run",
|
|
2653
2644
|
ctx,
|
|
2654
2645
|
"complete-slice",
|
|
2646
|
+
{ basePath },
|
|
2655
2647
|
);
|
|
2656
2648
|
} else if (choice === "status") {
|
|
2657
2649
|
const { fireStatusViaCommand } = await import("./commands.js");
|
|
@@ -2708,12 +2700,20 @@ export async function showSmartEntry(
|
|
|
2708
2700
|
notYetMessage: "Run /gsd when ready.",
|
|
2709
2701
|
});
|
|
2710
2702
|
|
|
2711
|
-
if (choice === "
|
|
2712
|
-
|
|
2703
|
+
if (choice === "not_yet") return;
|
|
2704
|
+
|
|
2705
|
+
const route = resolveActiveTaskChoiceRoute({
|
|
2706
|
+
choice: choice as ActiveTaskChoice,
|
|
2707
|
+
isolationMode: getIsolationMode(basePath),
|
|
2708
|
+
milestoneId,
|
|
2709
|
+
});
|
|
2710
|
+
|
|
2711
|
+
if (route.kind === "auto-bootstrap") {
|
|
2712
|
+
startAutoDetached(ctx, pi, basePath, route.verboseMode, route.options);
|
|
2713
2713
|
return;
|
|
2714
2714
|
}
|
|
2715
2715
|
|
|
2716
|
-
if (
|
|
2716
|
+
if (route.kind === "guided-dispatch") {
|
|
2717
2717
|
ctx.ui.setStatus("gsd-step", "Executing Task · follow progress above");
|
|
2718
2718
|
if (hasInterrupted) {
|
|
2719
2719
|
await dispatchWorkflow(pi, loadPrompt("guided-resume-task", {
|
|
@@ -2726,7 +2726,7 @@ export async function showSmartEntry(
|
|
|
2726
2726
|
taskId,
|
|
2727
2727
|
taskTitle,
|
|
2728
2728
|
}),
|
|
2729
|
-
}), "gsd-run", ctx, "execute-task");
|
|
2729
|
+
}), "gsd-run", ctx, "execute-task", { basePath });
|
|
2730
2730
|
} else {
|
|
2731
2731
|
await dispatchWorkflow(
|
|
2732
2732
|
pi,
|
|
@@ -2734,12 +2734,13 @@ export async function showSmartEntry(
|
|
|
2734
2734
|
"gsd-run",
|
|
2735
2735
|
ctx,
|
|
2736
2736
|
"execute-task",
|
|
2737
|
+
{ basePath },
|
|
2737
2738
|
);
|
|
2738
2739
|
}
|
|
2739
|
-
} else if (
|
|
2740
|
+
} else if (route.kind === "status") {
|
|
2740
2741
|
const { fireStatusViaCommand } = await import("./commands.js");
|
|
2741
2742
|
await fireStatusViaCommand(ctx);
|
|
2742
|
-
} else if (
|
|
2743
|
+
} else if (route.kind === "milestone-actions") {
|
|
2743
2744
|
const acted = await handleMilestoneActions(ctx, pi, basePath, milestoneId, milestoneTitle, options);
|
|
2744
2745
|
if (acted) return showSmartEntry(ctx, pi, basePath, options);
|
|
2745
2746
|
}
|