@opengsd/gsd-pi 1.2.0-dev.0b870afa → 1.2.0-dev.23d85b63
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/dist/cli-model-override.d.ts +15 -0
- package/dist/cli-model-override.js +21 -0
- package/dist/cli.js +14 -19
- package/dist/headless-events.d.ts +16 -1
- package/dist/headless-events.js +19 -2
- package/dist/headless.js +8 -1
- package/dist/loader.js +6 -4
- package/dist/onboarding.js +9 -4
- package/dist/provider-migrations.d.ts +23 -0
- package/dist/provider-migrations.js +41 -0
- package/dist/register-agent-bundles.d.ts +11 -2
- package/dist/register-agent-bundles.js +18 -4
- package/dist/resource-loader.d.ts +10 -5
- package/dist/resource-loader.js +121 -6
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/ask-user-questions.js +3 -2
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +447 -215
- package/dist/resources/extensions/claude-code-cli/turn-assembler.js +33 -1
- package/dist/resources/extensions/google-cli/stream-adapter.js +16 -1
- package/dist/resources/extensions/gsd/auto/closeout.js +215 -0
- package/dist/resources/extensions/gsd/auto/dispatch-history.js +21 -6
- package/dist/resources/extensions/gsd/auto/dispatch.js +365 -0
- package/dist/resources/extensions/gsd/auto/finalize.js +347 -0
- package/dist/resources/extensions/gsd/auto/loop.js +4 -1
- package/dist/resources/extensions/gsd/auto/milestone-lease-reclaim.js +56 -0
- package/dist/resources/extensions/gsd/auto/orchestrator.js +119 -18
- package/dist/resources/extensions/gsd/auto/phase-helpers.js +146 -0
- package/dist/resources/extensions/gsd/auto/phases.js +17 -2372
- package/dist/resources/extensions/gsd/auto/pre-dispatch.js +542 -0
- package/dist/resources/extensions/gsd/auto/unit-phase.js +694 -0
- package/dist/resources/extensions/gsd/auto/workflow-unit-dispatch.js +1 -1
- package/dist/resources/extensions/gsd/auto/worktree-safety-phase.js +125 -0
- package/dist/resources/extensions/gsd/auto-closeout-messaging.js +90 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +255 -431
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +15 -3
- package/dist/resources/extensions/gsd/auto-dispatch.js +19 -1
- package/dist/resources/extensions/gsd/auto-model-selection.js +9 -6
- package/dist/resources/extensions/gsd/auto-post-unit.js +12 -8
- package/dist/resources/extensions/gsd/auto-prompts.js +5 -1
- package/dist/resources/extensions/gsd/auto-recovery.js +52 -6
- package/dist/resources/extensions/gsd/auto-start.js +28 -7
- package/dist/resources/extensions/gsd/auto-worktree.js +48 -3
- package/dist/resources/extensions/gsd/auto.js +83 -19
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +4 -2
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +37 -7
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +3 -1
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +32 -3
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +56 -16
- package/dist/resources/extensions/gsd/closeout-wizard.js +8 -3
- package/dist/resources/extensions/gsd/commands/handlers/core.js +22 -8
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +2 -2
- package/dist/resources/extensions/gsd/commands-mcp-status.js +2 -2
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +8 -0
- package/dist/resources/extensions/gsd/commands-workflow-templates.js +9 -2
- package/dist/resources/extensions/gsd/config-overlay.js +11 -8
- package/dist/resources/extensions/gsd/db/engine.js +24 -6
- package/dist/resources/extensions/gsd/db/queries.js +30 -0
- package/dist/resources/extensions/gsd/db/writers/reconcile.js +19 -1
- package/dist/resources/extensions/gsd/db-migration-backup.js +51 -8
- package/dist/resources/extensions/gsd/db-transaction.js +27 -23
- package/dist/resources/extensions/gsd/db-writer.js +8 -17
- package/dist/resources/extensions/gsd/doctor-environment.js +256 -125
- package/dist/resources/extensions/gsd/doctor-git-checks.js +5 -1
- package/dist/resources/extensions/gsd/doctor-providers.js +1 -1
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +11 -9
- package/dist/resources/extensions/gsd/gsd-db.js +15 -20
- package/dist/resources/extensions/gsd/guided-flow.js +88 -2
- package/dist/resources/extensions/gsd/health-widget.js +87 -28
- package/dist/resources/extensions/gsd/mcp-bridge.js +10 -0
- package/dist/resources/extensions/gsd/memory-relations.js +1 -1
- package/dist/resources/extensions/gsd/milestone-settlement.js +2 -2
- package/dist/resources/extensions/gsd/notifications.js +12 -7
- package/dist/resources/extensions/gsd/preferences-models.js +17 -9
- package/dist/resources/extensions/gsd/preferences.js +91 -5
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +8 -2
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +6 -2
- package/dist/resources/extensions/gsd/prompts/execute-task.md +7 -2
- package/dist/resources/extensions/gsd/prompts/quick-task.md +1 -1
- package/dist/resources/extensions/gsd/prompts/reactive-execute.md +2 -2
- package/dist/resources/extensions/gsd/prompts/run-uat.md +7 -1
- package/dist/resources/extensions/gsd/prompts/triage-captures.md +1 -1
- package/dist/resources/extensions/gsd/prompts/workflow-start.md +2 -1
- package/dist/resources/extensions/gsd/provider-error-guidance.js +24 -0
- package/dist/resources/extensions/gsd/session-lock.js +4 -3
- package/dist/resources/extensions/gsd/skill-activation.js +3 -6
- package/dist/resources/extensions/gsd/state-reconciliation/drift/artifact-db.js +13 -6
- package/dist/resources/extensions/gsd/state.js +6 -2
- package/dist/resources/extensions/gsd/tool-surface-readiness.js +83 -31
- package/dist/resources/extensions/gsd/tools/complete-task.js +62 -0
- package/dist/resources/extensions/gsd/tools/exec-tool.js +2 -109
- package/dist/resources/extensions/gsd/tui/render-kit.js +38 -13
- package/dist/resources/extensions/gsd/unit-context-composer.js +1 -1
- package/dist/resources/extensions/gsd/unit-registry.js +34 -4
- package/dist/resources/extensions/gsd/workflow-logger.js +4 -0
- package/dist/resources/extensions/gsd/workflow-mcp-auto-prep.js +2 -0
- package/dist/resources/extensions/gsd/workflow-mcp-readiness-cache.js +105 -0
- package/dist/resources/extensions/gsd/worktree-manager.js +101 -2
- package/dist/resources/extensions/gsd/worktree-safety.js +28 -26
- package/dist/resources/extensions/gsd/worktree-shell-guard.js +113 -0
- package/dist/resources/extensions/gsd/worktree.js +8 -1
- package/dist/resources/extensions/mcp-client/manager.js +6 -1
- package/dist/resources/extensions/search-the-web/index.js +41 -9
- package/dist/resources/extensions/search-the-web/native-search.js +18 -4
- package/dist/resources/extensions/shared/gsd-browser-cli.js +40 -2
- package/dist/resources/extensions/subagent/index.js +20 -15
- package/dist/resources/extensions/subagent/worktree-cwd.js +31 -0
- package/dist/resources/skills/create-skill/SKILL.md +3 -0
- package/dist/resources/skills/create-skill/references/skill-structure.md +1 -0
- package/dist/runtime-checks.d.ts +10 -0
- package/dist/runtime-checks.js +27 -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 +10 -10
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- 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.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- 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 +1 -1
- 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.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/mcp-connections/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +10 -10
- package/dist/web/standalone/.next/server/chunks/{5942.js → 1128.js} +1 -1
- package/dist/web/standalone/.next/server/chunks/8357.js +1 -1
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +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/node_modules/node-pty/build/Makefile +1 -1
- package/package.json +4 -4
- package/packages/cloud-mcp-gateway/package.json +2 -2
- package/packages/contracts/package.json +1 -1
- package/packages/daemon/package.json +4 -4
- package/packages/gsd-agent-core/dist/sdk.d.ts.map +1 -1
- package/packages/gsd-agent-core/dist/sdk.js +12 -6
- package/packages/gsd-agent-core/dist/sdk.js.map +1 -1
- package/packages/gsd-agent-core/package.json +5 -5
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts +5 -5
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js +12 -24
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js +5 -5
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts +3 -3
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js +20 -11
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-turn-connect.d.ts +4 -3
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-turn-connect.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-turn-connect.js +5 -54
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-turn-connect.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -4
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js +2 -4
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts +2 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js +4 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts +9 -12
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js +100 -166
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-progress-state.d.ts +2 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-progress-state.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-progress-state.js +4 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-progress-state.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-status-widget.d.ts +23 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-status-widget.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-status-widget.js +178 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-status-widget.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts +8 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js +21 -9
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js +10 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -3
- package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.js +2 -3
- package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts +11 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js +85 -19
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.d.ts +71 -3
- package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.js +257 -37
- package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts +3 -3
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js +19 -19
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts +3 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js +26 -10
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js +12 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js +5 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-autocomplete.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-autocomplete.js +3 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.js +3 -5
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-dialogs.js +2 -2
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.d.ts +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.js +25 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-key-handlers.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-key-handlers.js +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-key-handlers.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-init.d.ts +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-init.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-init.js +20 -49
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-init.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts +4 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts +10 -2
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js +48 -6
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-selectors-settings.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-selectors-settings.js +4 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-selectors-settings.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-ui-messaging.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-ui-messaging.js +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-ui-messaging.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js +3 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/packages/gsd-agent-modes/package.json +7 -7
- package/packages/mcp-server/README.md +12 -3
- package/packages/mcp-server/dist/cli-runner.d.ts +40 -0
- package/packages/mcp-server/dist/cli-runner.d.ts.map +1 -0
- package/packages/mcp-server/dist/cli-runner.js +137 -0
- package/packages/mcp-server/dist/cli-runner.js.map +1 -0
- package/packages/mcp-server/dist/cli.js +2 -58
- package/packages/mcp-server/dist/cli.js.map +1 -1
- package/packages/mcp-server/dist/pid-registry.d.ts +46 -0
- package/packages/mcp-server/dist/pid-registry.d.ts.map +1 -0
- package/packages/mcp-server/dist/pid-registry.js +459 -0
- package/packages/mcp-server/dist/pid-registry.js.map +1 -0
- package/packages/mcp-server/dist/probe-mode.d.ts +4 -0
- package/packages/mcp-server/dist/probe-mode.d.ts.map +1 -0
- package/packages/mcp-server/dist/probe-mode.js +10 -0
- package/packages/mcp-server/dist/probe-mode.js.map +1 -0
- package/packages/mcp-server/dist/stdio-watchdog.d.ts +8 -0
- package/packages/mcp-server/dist/stdio-watchdog.d.ts.map +1 -0
- package/packages/mcp-server/dist/stdio-watchdog.js +40 -0
- package/packages/mcp-server/dist/stdio-watchdog.js.map +1 -0
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +62 -43
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +5 -5
- package/packages/native/package.json +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +52 -2
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-upstream-types.d.ts +28 -2
- package/packages/pi-coding-agent/dist/core/extensions/extension-upstream-types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-upstream-types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +5 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +3 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +3 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +11 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- 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.map +1 -1
- package/packages/pi-coding-agent/dist/theme/theme.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/theme/theme.js +45 -17
- package/packages/pi-coding-agent/dist/theme/theme.js.map +1 -1
- package/packages/pi-coding-agent/package.json +8 -8
- package/packages/pi-tui/README.md +15 -0
- package/packages/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/packages/pi-tui/dist/autocomplete.js +6 -1
- package/packages/pi-tui/dist/autocomplete.js.map +1 -1
- package/packages/pi-tui/dist/components/input.js +1 -1
- package/packages/pi-tui/dist/components/input.js.map +1 -1
- package/packages/pi-tui/dist/components/loader.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/loader.js +1 -0
- package/packages/pi-tui/dist/components/loader.js.map +1 -1
- package/packages/pi-tui/dist/components/select-list.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/select-list.js +8 -2
- package/packages/pi-tui/dist/components/select-list.js.map +1 -1
- package/packages/pi-tui/dist/index.d.ts +2 -2
- package/packages/pi-tui/dist/index.d.ts.map +1 -1
- package/packages/pi-tui/dist/index.js +2 -2
- package/packages/pi-tui/dist/index.js.map +1 -1
- package/packages/pi-tui/dist/terminal-image.d.ts +33 -0
- package/packages/pi-tui/dist/terminal-image.d.ts.map +1 -1
- package/packages/pi-tui/dist/terminal-image.js +54 -2
- package/packages/pi-tui/dist/terminal-image.js.map +1 -1
- package/packages/pi-tui/dist/terminal.d.ts +12 -0
- package/packages/pi-tui/dist/terminal.d.ts.map +1 -1
- package/packages/pi-tui/dist/terminal.js +70 -25
- package/packages/pi-tui/dist/terminal.js.map +1 -1
- package/packages/pi-tui/dist/tui.d.ts +15 -0
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +106 -21
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/dist/utils.d.ts.map +1 -1
- package/packages/pi-tui/dist/utils.js +110 -36
- package/packages/pi-tui/dist/utils.js.map +1 -1
- package/packages/pi-tui/package.json +2 -2
- package/packages/rpc-client/package.json +2 -2
- package/pkg/dist/theme/theme.d.ts.map +1 -1
- package/pkg/dist/theme/theme.js +45 -17
- package/pkg/dist/theme/theme.js.map +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/ask-user-questions.ts +7 -2
- package/src/resources/extensions/browser-tools/tests/gsd-browser-launch-config.test.mjs +80 -0
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +531 -226
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +672 -7
- package/src/resources/extensions/claude-code-cli/turn-assembler.ts +38 -1
- package/src/resources/extensions/google-cli/stream-adapter.ts +22 -1
- package/src/resources/extensions/gsd/auto/closeout.ts +309 -0
- package/src/resources/extensions/gsd/auto/dispatch-history.ts +22 -6
- package/src/resources/extensions/gsd/auto/dispatch.ts +449 -0
- package/src/resources/extensions/gsd/auto/finalize.ts +445 -0
- package/src/resources/extensions/gsd/auto/loop.ts +4 -1
- package/src/resources/extensions/gsd/auto/milestone-lease-reclaim.ts +74 -0
- package/src/resources/extensions/gsd/auto/orchestrator.ts +140 -18
- package/src/resources/extensions/gsd/auto/phase-helpers.ts +199 -0
- package/src/resources/extensions/gsd/auto/phases.ts +58 -3061
- package/src/resources/extensions/gsd/auto/pre-dispatch.ts +716 -0
- package/src/resources/extensions/gsd/auto/unit-phase.ts +910 -0
- package/src/resources/extensions/gsd/auto/workflow-unit-dispatch.ts +1 -1
- package/src/resources/extensions/gsd/auto/worktree-safety-phase.ts +149 -0
- package/src/resources/extensions/gsd/auto-closeout-messaging.ts +90 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +310 -454
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +15 -2
- package/src/resources/extensions/gsd/auto-dispatch.ts +24 -2
- package/src/resources/extensions/gsd/auto-model-selection.ts +20 -5
- package/src/resources/extensions/gsd/auto-post-unit.ts +16 -9
- package/src/resources/extensions/gsd/auto-prompts.ts +5 -1
- package/src/resources/extensions/gsd/auto-recovery.ts +62 -8
- package/src/resources/extensions/gsd/auto-start.ts +44 -7
- package/src/resources/extensions/gsd/auto-worktree.ts +51 -3
- package/src/resources/extensions/gsd/auto.ts +118 -18
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +6 -2
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +56 -6
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +2 -1
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +36 -3
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +69 -16
- package/src/resources/extensions/gsd/closeout-wizard.ts +11 -2
- package/src/resources/extensions/gsd/commands/handlers/core.ts +27 -8
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +5 -2
- package/src/resources/extensions/gsd/commands-mcp-status.ts +2 -2
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +7 -0
- package/src/resources/extensions/gsd/commands-workflow-templates.ts +11 -4
- package/src/resources/extensions/gsd/config-overlay.ts +22 -9
- package/src/resources/extensions/gsd/db/engine.ts +26 -6
- package/src/resources/extensions/gsd/db/queries.ts +29 -0
- package/src/resources/extensions/gsd/db/writers/reconcile.ts +24 -1
- package/src/resources/extensions/gsd/db-migration-backup.ts +56 -7
- package/src/resources/extensions/gsd/db-transaction.ts +37 -20
- package/src/resources/extensions/gsd/db-writer.ts +11 -19
- package/src/resources/extensions/gsd/doctor-environment.ts +267 -142
- package/src/resources/extensions/gsd/doctor-git-checks.ts +4 -1
- package/src/resources/extensions/gsd/doctor-providers.ts +1 -1
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +10 -10
- package/src/resources/extensions/gsd/gsd-db.ts +15 -19
- package/src/resources/extensions/gsd/guided-flow.ts +128 -2
- package/src/resources/extensions/gsd/health-widget.ts +91 -27
- package/src/resources/extensions/gsd/mcp-bridge.ts +39 -0
- package/src/resources/extensions/gsd/memory-relations.ts +1 -1
- package/src/resources/extensions/gsd/milestone-settlement.ts +2 -2
- package/src/resources/extensions/gsd/notifications.ts +13 -6
- package/src/resources/extensions/gsd/preferences-models.ts +26 -8
- package/src/resources/extensions/gsd/preferences.ts +111 -5
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +8 -2
- package/src/resources/extensions/gsd/prompts/complete-slice.md +6 -2
- package/src/resources/extensions/gsd/prompts/execute-task.md +7 -2
- package/src/resources/extensions/gsd/prompts/quick-task.md +1 -1
- package/src/resources/extensions/gsd/prompts/reactive-execute.md +2 -2
- package/src/resources/extensions/gsd/prompts/run-uat.md +7 -1
- package/src/resources/extensions/gsd/prompts/triage-captures.md +1 -1
- package/src/resources/extensions/gsd/prompts/workflow-start.md +2 -1
- package/src/resources/extensions/gsd/provider-error-guidance.ts +32 -0
- package/src/resources/extensions/gsd/session-lock.ts +8 -7
- package/src/resources/extensions/gsd/skill-activation.ts +3 -6
- package/src/resources/extensions/gsd/state-reconciliation/drift/artifact-db.ts +23 -10
- package/src/resources/extensions/gsd/state.ts +7 -1
- package/src/resources/extensions/gsd/tests/auto-abort-pause-regression.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-blocked-remediation-message.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-closeout-messaging.test.ts +71 -0
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +68 -116
- package/src/resources/extensions/gsd/tests/auto-direct-dispatch-parse.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +206 -22
- package/src/resources/extensions/gsd/tests/auto-model-selection-tool-poisoning.test.ts +7 -2
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +16 -1
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +89 -22
- package/src/resources/extensions/gsd/tests/auto-pause-double-entry-guard.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +97 -4
- package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +236 -0
- package/src/resources/extensions/gsd/tests/auto-unit-closeout.test.ts +169 -1
- package/src/resources/extensions/gsd/tests/auto-verification.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/blocker-placeholder-logs.test.ts +218 -0
- package/src/resources/extensions/gsd/tests/complete-milestone-prompt-rendering.test.ts +6 -2
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +141 -5
- package/src/resources/extensions/gsd/tests/core-overlay-fallback.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/db-engine-logs.test.ts +207 -0
- package/src/resources/extensions/gsd/tests/db-migration-backup.test.ts +68 -19
- package/src/resources/extensions/gsd/tests/db-transaction.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/db-writer.test.ts +15 -4
- package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/derive-state-helpers.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/discuss-routing-fixes.test.ts +12 -2
- package/src/resources/extensions/gsd/tests/dispatch-db-degradation-logs.test.ts +98 -0
- package/src/resources/extensions/gsd/tests/dispatch-history.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/dispatch-logs.test.ts +103 -0
- package/src/resources/extensions/gsd/tests/dispatch-reactive-logs.test.ts +98 -0
- package/src/resources/extensions/gsd/tests/dist-redirect.mjs +8 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +6 -4
- package/src/resources/extensions/gsd/tests/engine-interfaces-contract.test.ts +117 -91
- package/src/resources/extensions/gsd/tests/ensure-db-open.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/gsd-command-home.test.ts +40 -7
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/guided-dispatch-root.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +75 -0
- package/src/resources/extensions/gsd/tests/integration/auto-worktree.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-environment-async.test.ts +104 -0
- package/src/resources/extensions/gsd/tests/integration/run-uat.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/interactive-routing-bypass.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +47 -16
- package/src/resources/extensions/gsd/tests/loop.test.ts +60 -0
- package/src/resources/extensions/gsd/tests/mcp-readiness-preflight.test.ts +205 -0
- package/src/resources/extensions/gsd/tests/mcp-status.test.ts +6 -5
- package/src/resources/extensions/gsd/tests/milestone-merge-stash-restore.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/milestone-report-path.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/milestone-settlement.test.ts +92 -0
- package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/model-router.test.ts +139 -0
- package/src/resources/extensions/gsd/tests/notifications.test.ts +64 -9
- package/src/resources/extensions/gsd/tests/oauth-api-model-routing.test.ts +13 -1
- package/src/resources/extensions/gsd/tests/orchestrator-legacy-parity.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/orchestrator-logs.test.ts +335 -0
- package/src/resources/extensions/gsd/tests/parallel-skill-prompt-integration.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/parsers-legacy-importers.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/phases-merge-error-stops-auto.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/phases-terminal-complete-idempotent.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/plan-gate-failed-doctor-heal-hint.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/prefs-missing-models-crash.test.ts +35 -4
- package/src/resources/extensions/gsd/tests/progress-strip-test-helpers.ts +79 -0
- package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +11 -2
- package/src/resources/extensions/gsd/tests/provider-error-guidance.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +2 -4
- package/src/resources/extensions/gsd/tests/reconcile-logs.test.ts +244 -0
- package/src/resources/extensions/gsd/tests/recovery-finalize-logs.test.ts +119 -0
- package/src/resources/extensions/gsd/tests/recovery-verify-logs.test.ts +428 -0
- package/src/resources/extensions/gsd/tests/register-extension-guard.test.ts +25 -0
- package/src/resources/extensions/gsd/tests/remote-notification-from-desktop.test.ts +31 -81
- package/src/resources/extensions/gsd/tests/resume-missing-worktree-warning.test.ts +5 -5
- package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +68 -0
- package/src/resources/extensions/gsd/tests/show-config-command.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/single-writer-invariant.test.ts +170 -48
- package/src/resources/extensions/gsd/tests/skill-activation.test.ts +20 -17
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +7 -3
- package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +17 -1
- package/src/resources/extensions/gsd/tests/stop-auto-race-null-unit.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/teardown-chdir-failure-clears-registry.test.ts +17 -0
- package/src/resources/extensions/gsd/tests/thinking-level-resolution.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/tool-surface-readiness.test.ts +184 -10
- package/src/resources/extensions/gsd/tests/tui-header-lifecycle.test.ts +40 -86
- package/src/resources/extensions/gsd/tests/tui-render-kit.test.ts +44 -6
- package/src/resources/extensions/gsd/tests/uok-audit.test.ts +194 -0
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/workflow-mcp-readiness-cache.test.ts +119 -0
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +65 -2
- package/src/resources/extensions/gsd/tests/workflow-phase-contract-matrix.test.ts +332 -0
- package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +92 -0
- package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/worktree-project-root-degrade.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-safety-phase.test.ts +100 -0
- package/src/resources/extensions/gsd/tests/worktree-safety.test.ts +72 -0
- package/src/resources/extensions/gsd/tests/worktree-teardown-safety.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/worktree-write-gate.test.ts +75 -3
- package/src/resources/extensions/gsd/tests/worktree.test.ts +18 -0
- package/src/resources/extensions/gsd/tool-surface-readiness.ts +126 -19
- package/src/resources/extensions/gsd/tools/complete-task.ts +87 -0
- package/src/resources/extensions/gsd/tools/exec-tool.ts +2 -118
- package/src/resources/extensions/gsd/tui/render-kit.ts +56 -13
- package/src/resources/extensions/gsd/unit-context-composer.ts +1 -1
- package/src/resources/extensions/gsd/unit-registry.ts +34 -4
- package/src/resources/extensions/gsd/workflow-logger.ts +5 -0
- package/src/resources/extensions/gsd/workflow-mcp-auto-prep.ts +2 -0
- package/src/resources/extensions/gsd/workflow-mcp-readiness-cache.ts +150 -0
- package/src/resources/extensions/gsd/worktree-manager.ts +97 -2
- package/src/resources/extensions/gsd/worktree-safety.ts +41 -39
- package/src/resources/extensions/gsd/worktree-shell-guard.ts +123 -0
- package/src/resources/extensions/gsd/worktree.ts +7 -1
- package/src/resources/extensions/mcp-client/manager.ts +7 -1
- package/src/resources/extensions/search-the-web/index.ts +45 -9
- package/src/resources/extensions/search-the-web/native-search.ts +16 -4
- package/src/resources/extensions/shared/gsd-browser-cli.ts +41 -2
- package/src/resources/extensions/subagent/index.ts +20 -15
- package/src/resources/extensions/subagent/tests/worktree-cwd.test.ts +57 -0
- package/src/resources/extensions/subagent/worktree-cwd.ts +35 -0
- package/src/resources/skills/create-skill/SKILL.md +3 -0
- package/src/resources/skills/create-skill/references/skill-structure.md +1 -0
- package/dist/resources/skills/gsd-browser/SKILL.md +0 -41
- package/src/resources/skills/gsd-browser/SKILL.md +0 -41
- /package/dist/web/standalone/.next/static/{T-LTxEw5wir5Lm5T3qEVd → Wn9u2NYq0cyUigB_3Z0_N}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{T-LTxEw5wir5Lm5T3qEVd → Wn9u2NYq0cyUigB_3Z0_N}/_ssgManifest.js +0 -0
|
@@ -37,4 +37,4 @@ You are executing a GSD quick task — a lightweight, focused unit of work outsi
|
|
|
37
37
|
- <what was tested/verified>
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
When done, say: "Quick task {{taskNum}}
|
|
40
|
+
When done, say: "Quick task {{taskNum}} closeout submitted." Do not say the task is complete. Say this exactly once — if you already said it in a prior message, do not repeat it.
|
|
@@ -10,7 +10,7 @@ You are executing **multiple tasks in parallel** for this slice. The task graph
|
|
|
10
10
|
|
|
11
11
|
**Critical rule:** Use the `subagent` tool in **parallel mode** to dispatch all ready tasks simultaneously. Each subagent gets a task-specific execution packet (task plan + dependency carry-forward + completion contract) and is responsible for its own implementation, verification, task summary, and completion tool calls. The parent batch agent orchestrates, verifies, and records failures only when a dispatched task failed before it could leave its own summary behind.
|
|
12
12
|
|
|
13
|
-
**Tool call format:** Call `subagent` with `tasks: [...]` as a **native JSON array** — one object per ready task. Do NOT JSON.stringify the array into a string; the tool validates that `tasks` is an array, and a serialized string will be rejected with "must be array".
|
|
13
|
+
**Tool call format:** Call `subagent` with `tasks: [...]` as a **native JSON array** — one object per ready task. Each task object MUST include `cwd: "{{workingDirectory}}"` so child agents inherit the milestone worktree, not the project root. Do NOT JSON.stringify the array into a string; the tool validates that `tasks` is an array, and a serialized string will be rejected with "must be array".
|
|
14
14
|
|
|
15
15
|
## Task Dependency Graph
|
|
16
16
|
|
|
@@ -24,7 +24,7 @@ You are executing **multiple tasks in parallel** for this slice. The task graph
|
|
|
24
24
|
|
|
25
25
|
## Execution Protocol
|
|
26
26
|
|
|
27
|
-
1. **Dispatch all ready tasks** using `subagent` in parallel mode. Call `subagent` with `tasks: [{ agent: "worker", task: "<prompt>" }, ...]` — one object per ready task. Each subagent prompt is provided below.
|
|
27
|
+
1. **Dispatch all ready tasks** using `subagent` in parallel mode. Call `subagent` with `tasks: [{ agent: "worker", cwd: "{{workingDirectory}}", task: "<prompt>" }, ...]` — one object per ready task. Each subagent prompt is provided below.
|
|
28
28
|
2. **Wait for all subagents** to complete.
|
|
29
29
|
3. **Verify each dispatched task's outputs** — check that expected files were created/modified, that verification commands pass where applicable, and that each task wrote its own `T##-SUMMARY.md`.
|
|
30
30
|
4. **Do not rewrite successful task summaries or duplicate completion tool calls.** Treat a subagent-written summary as authoritative for that task.
|
|
@@ -10,6 +10,8 @@ If any inlined plan, summary, verification command, or prior artifact names an a
|
|
|
10
10
|
|
|
11
11
|
All relevant context has been preloaded below. Start working immediately without re-reading these files.
|
|
12
12
|
|
|
13
|
+
If a `.gsd/**` or `.gsd/**/*` glob returns no matches, treat that as a possible symlink-backed traversal limitation; do not infer that the GSD harness is missing. Use the preloaded UAT context and direct `.gsd/...` file paths named in this prompt instead.
|
|
14
|
+
|
|
13
15
|
{{inlinedContext}}
|
|
14
16
|
|
|
15
17
|
{{skillActivation}}
|
|
@@ -100,4 +102,8 @@ checks: [{
|
|
|
100
102
|
|
|
101
103
|
**You MUST call `gsd_uat_result_save` before finishing. Do not write the assessment file directly, and do not call `gsd_summary_save` as a substitute.**
|
|
102
104
|
|
|
103
|
-
|
|
105
|
+
### Closeout messaging (auto-mode)
|
|
106
|
+
|
|
107
|
+
You submit UAT results; **GSD auto-mode** decides when UAT is actually **done**. Never say "UAT {{sliceId}} complete" in this unit — not even after `gsd_uat_result_save` succeeds. GSD announces completion only after post-unit verification passes.
|
|
108
|
+
|
|
109
|
+
When done, say: "UAT {{sliceId}} results submitted." Do not say UAT is complete. Say this exactly once — if you already said it in a prior message, do not repeat it.
|
|
@@ -65,4 +65,4 @@ Classify each capture as one of:
|
|
|
65
65
|
|
|
66
66
|
**Important:** Do NOT execute any resolutions. Only classify and update CAPTURES.md. Resolution execution happens separately (in auto-mode dispatch or manually by the user).
|
|
67
67
|
|
|
68
|
-
When done, say: "Triage
|
|
68
|
+
When done, say: "Triage closeout submitted." Do not say triage is complete — GSD announces completion only after post-unit verification passes. Say this exactly once — if you already said it in a prior message, do not repeat it.
|
|
@@ -25,4 +25,5 @@ Follow the workflow defined below. Execute each phase in order, completing one b
|
|
|
25
25
|
3. **Atomic commits.** Commit working code after each meaningful change. Use conventional commit format: `<type>(<scope>): <description>`.
|
|
26
26
|
4. **Verify before shipping.** Run the project's test suite and build before marking the workflow complete.
|
|
27
27
|
5. **Decision gates, not ceremony.** After each phase, summarize what changed. For low/medium complexity, ask for confirmation only when the next phase depends on a real user choice or external approval. For high complexity, confirm before proceeding to each new phase.
|
|
28
|
-
6. **
|
|
28
|
+
6. **Persist workflow state.** If the artifact directory contains `STATE.json`, update it after each phase: mark the finished phase `completed`, mark the next phase `active`, set `currentPhase` to the active phase index, and refresh `updatedAt`. When every phase is completed, set `completedAt` to the completion timestamp.
|
|
29
|
+
7. **Stay focused.** This is a {{complexity}}-complexity workflow. Match your ceremony level to the task — don't over-engineer or under-deliver.
|
|
@@ -44,11 +44,35 @@ function defaultAlternateModel(provider, modelId) {
|
|
|
44
44
|
}
|
|
45
45
|
return undefined;
|
|
46
46
|
}
|
|
47
|
+
function isGeminiCliDeprecatedError(errorMsg) {
|
|
48
|
+
return (/IneligibleTierError/i.test(errorMsg)
|
|
49
|
+
|| /UNSUPPORTED_CLIENT/i.test(errorMsg)
|
|
50
|
+
|| /no longer supported for Gemini Code Assist for individuals/i.test(errorMsg)
|
|
51
|
+
|| /migrate to the Antigravity suite/i.test(errorMsg));
|
|
52
|
+
}
|
|
53
|
+
function resolveGeminiCliDeprecationGuidance(input) {
|
|
54
|
+
const { provider, modelId, unitType } = input;
|
|
55
|
+
const modelLabel = provider && modelId ? `${provider}/${modelId}` : modelId ?? provider ?? "google-gemini-cli";
|
|
56
|
+
const unitSuffix = unitType ? ` during ${unitType}` : "";
|
|
57
|
+
return {
|
|
58
|
+
summary: `Provider error on ${modelLabel}${unitSuffix}. ` +
|
|
59
|
+
"Google no longer supports Gemini CLI for individual-tier users — migrate to Antigravity CLI.",
|
|
60
|
+
steps: [
|
|
61
|
+
"Install Antigravity CLI: curl -fsSL https://antigravity.google/cli/install.sh | bash",
|
|
62
|
+
"Run `agy` in a terminal and complete authentication.",
|
|
63
|
+
"In GSD, run `/login` and select Antigravity, or restart GSD to auto-migrate when `agy` is on PATH.",
|
|
64
|
+
"Run /gsd next to resume the paused unit.",
|
|
65
|
+
],
|
|
66
|
+
};
|
|
67
|
+
}
|
|
47
68
|
/**
|
|
48
69
|
* Build concrete next steps for a provider/model rejection pause.
|
|
49
70
|
*/
|
|
50
71
|
export function resolveProviderErrorGuidance(input) {
|
|
51
72
|
const { errorMsg, provider, modelId, unitType, preferencesPath, hasConfiguredFallbacks, } = input;
|
|
73
|
+
if (isGeminiCliDeprecatedError(errorMsg)) {
|
|
74
|
+
return resolveGeminiCliDeprecationGuidance(input);
|
|
75
|
+
}
|
|
52
76
|
const modelLabel = provider && modelId ? `${provider}/${modelId}` : modelId ?? provider ?? "current model";
|
|
53
77
|
const phaseKey = unitTypeToPrefsPhaseKey(unitType);
|
|
54
78
|
const prefsFile = preferencesPath ?? ".gsd/PREFERENCES.md";
|
|
@@ -21,6 +21,7 @@ import { join, dirname } from "node:path";
|
|
|
21
21
|
import { gsdRoot, normalizeRealPath } from "./paths.js";
|
|
22
22
|
import { atomicWriteSync } from "./atomic-write.js";
|
|
23
23
|
import { markWorkerStoppingByPid } from "./db/auto-workers.js";
|
|
24
|
+
import { logWarning } from "./workflow-logger.js";
|
|
24
25
|
const _require = createRequire(import.meta.url);
|
|
25
26
|
// ─── Module State ───────────────────────────────────────────────────────────
|
|
26
27
|
/** Release function from proper-lockfile — calling it releases the OS lock. */
|
|
@@ -175,12 +176,12 @@ function createLockCompromisedHandler(lockFilePath) {
|
|
|
175
176
|
return () => {
|
|
176
177
|
const elapsed = Date.now() - _lockAcquiredAt;
|
|
177
178
|
if (elapsed < 1_800_000) {
|
|
178
|
-
|
|
179
|
+
logWarning("session", `Lock heartbeat caught up after ${Math.round(elapsed / 1000)}s — long LLM call, no action needed.`);
|
|
179
180
|
return;
|
|
180
181
|
}
|
|
181
182
|
const existing = readExistingLockDataWithRetry(lockFilePath);
|
|
182
183
|
if (existing && existing.pid === process.pid) {
|
|
183
|
-
|
|
184
|
+
logWarning("session", `Lock heartbeat mismatch after ${Math.round(elapsed / 1000)}s — lock file still owned by PID ${process.pid}, treating as false positive.`);
|
|
184
185
|
return;
|
|
185
186
|
}
|
|
186
187
|
_lockCompromised = true;
|
|
@@ -404,7 +405,7 @@ export function getSessionLockStatus(basePath) {
|
|
|
404
405
|
try {
|
|
405
406
|
const result = acquireSessionLock(basePath);
|
|
406
407
|
if (result.acquired) {
|
|
407
|
-
|
|
408
|
+
logWarning("session", "Lock recovered after onCompromised — lock file PID matched, re-acquired.");
|
|
408
409
|
return { valid: true, recovered: true };
|
|
409
410
|
}
|
|
410
411
|
}
|
|
@@ -108,11 +108,8 @@ function formatSkillActivationBlock(skillNames) {
|
|
|
108
108
|
const safe = skillNames.filter(name => SAFE_SKILL_NAME.test(name));
|
|
109
109
|
if (safe.length === 0)
|
|
110
110
|
return "";
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
// parameter name, causing tool validation failures — see #2224.
|
|
114
|
-
const calls = safe.map(name => `Call Skill({ skill: '${name}' })`).join('. ');
|
|
115
|
-
return `<skill_activation>${calls}.</skill_activation>`;
|
|
111
|
+
const reads = safe.map(name => `Read the installed '${name}' skill file from <available_skills>`).join(". ");
|
|
112
|
+
return `<skill_activation>${reads}.</skill_activation>`;
|
|
116
113
|
}
|
|
117
114
|
/**
|
|
118
115
|
* Manifest-driven recommendations block — informational only, does NOT
|
|
@@ -132,7 +129,7 @@ function formatSkillRecommendationsBlock(unitType, skillNames) {
|
|
|
132
129
|
const safe = skillNames.filter(name => SAFE_SKILL_NAME.test(name));
|
|
133
130
|
if (safe.length === 0)
|
|
134
131
|
return "";
|
|
135
|
-
return `<skill_recommendations unit="${unitType}">For this unit type, also consider
|
|
132
|
+
return `<skill_recommendations unit="${unitType}">For this unit type, also consider reading these installed skill files from <available_skills>: ${safe.join(", ")}. These are recommendations, not requirements.</skill_recommendations>`;
|
|
136
133
|
}
|
|
137
134
|
export function buildSkillActivationBlock(params) {
|
|
138
135
|
const prefs = params.preferences ?? loadEffectiveGSDPreferences(params.base)?.preferences;
|
|
@@ -300,6 +300,17 @@ function quarantineSliceDir(record, basePath) {
|
|
|
300
300
|
const target = join(quarantineDir, `${basename(record.sliceDir)}-${stamp}`);
|
|
301
301
|
renameSync(record.sliceDir, target);
|
|
302
302
|
}
|
|
303
|
+
export function completedMilestoneReopenedGuidance(record) {
|
|
304
|
+
const when = record.completedDispatchAt ?? "time unknown";
|
|
305
|
+
const intro = `Milestone ${record.milestoneId} has completed closeout dispatch history (${when}) ` +
|
|
306
|
+
`but DB status is still ${record.dbStatus}.`;
|
|
307
|
+
if (isClosedStatus(record.dbStatus)) {
|
|
308
|
+
return (`${intro} Use gsd_milestone_reopen for ${record.milestoneId} to redo this milestone, then run /gsd next.`);
|
|
309
|
+
}
|
|
310
|
+
return (`${intro} Finish closeout with \`/gsd dispatch complete-milestone ${record.milestoneId}\`, ` +
|
|
311
|
+
`review with \`/gsd status ${record.milestoneId}\`, then run /gsd next. ` +
|
|
312
|
+
"Running /gsd next again before fixing this will pause immediately.");
|
|
313
|
+
}
|
|
303
314
|
function diskSliceIdDivergenceGuidance(record) {
|
|
304
315
|
const quarantineExample = `.gsd/quarantine/milestones/${record.milestoneId}/slices/${record.sliceId}-manual-review`;
|
|
305
316
|
return (`Slice ID drift in ${record.milestoneId}: ${record.reason}. ` +
|
|
@@ -326,9 +337,7 @@ export function repairArtifactDbDrift(record, ctx) {
|
|
|
326
337
|
return;
|
|
327
338
|
}
|
|
328
339
|
if (record.kind === "completed-milestone-reopened") {
|
|
329
|
-
throw new Error(
|
|
330
|
-
` (${record.completedDispatchAt ?? "time unknown"}) but the DB status is ${record.dbStatus}. ` +
|
|
331
|
-
"Refusing to plan it again without an explicit reopen or recovery.");
|
|
340
|
+
throw new Error(completedMilestoneReopenedGuidance(record));
|
|
332
341
|
}
|
|
333
342
|
throw new Error(`Artifact/DB status drift in ${record.milestoneId}` +
|
|
334
343
|
`${record.sliceId ? `/${record.sliceId}` : ""}` +
|
|
@@ -343,9 +352,7 @@ export function describeArtifactDbDriftBlocker(record) {
|
|
|
343
352
|
return diskSliceIdDivergenceGuidance(record);
|
|
344
353
|
}
|
|
345
354
|
if (record.kind === "completed-milestone-reopened") {
|
|
346
|
-
return (
|
|
347
|
-
` (${record.completedDispatchAt ?? "time unknown"}) but the DB status is ${record.dbStatus}. ` +
|
|
348
|
-
"Refusing to plan it again without an explicit reopen or recovery.");
|
|
355
|
+
return completedMilestoneReopenedGuidance(record);
|
|
349
356
|
}
|
|
350
357
|
return (`Artifact/DB status drift in ${record.milestoneId}` +
|
|
351
358
|
`${record.sliceId ? `/${record.sliceId}` : ""}` +
|
|
@@ -23,7 +23,7 @@ import { logWarning } from './workflow-logger.js';
|
|
|
23
23
|
import { extractVerdict } from './verdict-parser.js';
|
|
24
24
|
import { detectPendingEscalation } from './escalation.js';
|
|
25
25
|
import { isTerminalMilestoneSummaryContent } from './milestone-summary-classifier.js';
|
|
26
|
-
import { isDbAvailable, getAllMilestones, getMilestone,
|
|
26
|
+
import { isDbAvailable, getAllMilestones, getMilestone, getSlicesByMilestoneIds, getSliceTasks, getReplanHistory, getSlice, getRequirementCounts, getLatestAssessmentByScope, getPendingGateCountForTurn, } from './gsd-db.js';
|
|
27
27
|
import { wasWorkflowDatabaseOpenAttempted } from './db-workspace.js';
|
|
28
28
|
import { formatCompletePhaseNextAction, countUnmappedActiveRequirements } from './requirements-backlog.js';
|
|
29
29
|
import { classifyMilestoneReadiness, readinessNeedsDiscussion, } from './milestone-readiness.js';
|
|
@@ -366,12 +366,16 @@ async function buildRegistryAndFindActive(basePath, milestones, completeMileston
|
|
|
366
366
|
let activeMilestoneFound = false;
|
|
367
367
|
let activeMilestoneHasDraft = false;
|
|
368
368
|
let firstDeferredQueuedShell = null;
|
|
369
|
+
const activeMilestoneIds = milestones
|
|
370
|
+
.filter((m) => !parkedMilestoneIds.has(m.id))
|
|
371
|
+
.map((m) => m.id);
|
|
372
|
+
const slicesByMilestone = getSlicesByMilestoneIds(activeMilestoneIds);
|
|
369
373
|
for (const m of milestones) {
|
|
370
374
|
if (parkedMilestoneIds.has(m.id)) {
|
|
371
375
|
registry.push({ id: m.id, title: stripMilestonePrefix(m.title) || m.id, status: 'parked' });
|
|
372
376
|
continue;
|
|
373
377
|
}
|
|
374
|
-
const slices =
|
|
378
|
+
const slices = slicesByMilestone.get(m.id) ?? [];
|
|
375
379
|
// DB-authoritative completeness (#4179): only trust completeMilestoneIds,
|
|
376
380
|
// which is itself derived from DB status. SUMMARY-file presence alone must
|
|
377
381
|
// not imply completion.
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// Project/App: gsd-pi
|
|
2
2
|
// File Purpose: Tool Contract module's runtime face — verify the live SDK tool surface covers a Unit's required workflow tools.
|
|
3
|
+
import { testMcpServerConnection } from "../mcp-client/manager.js";
|
|
3
4
|
import { mcpToolMatchesBaseName } from "./mcp-tool-name.js";
|
|
4
5
|
import { getRequiredWorkflowToolsForUnit } from "./unit-tool-contracts.js";
|
|
6
|
+
import { recordWorkflowMcpProbe, WORKFLOW_MCP_PROBE_TIMEOUT_MS, } from "./workflow-mcp-readiness-cache.js";
|
|
7
|
+
import { resolveWorkflowMcpProjectRoot } from "./workflow-mcp.js";
|
|
5
8
|
import { isWorkflowToolSurfaceName } from "./workflow-tool-surface.js";
|
|
6
9
|
/**
|
|
7
10
|
* Stable phrase recognized as transient by auto-tool-tracking's
|
|
@@ -11,20 +14,73 @@ import { isWorkflowToolSurfaceName } from "./workflow-tool-surface.js";
|
|
|
11
14
|
export const TOOL_SURFACE_NOT_READY = "workflow tool surface not ready";
|
|
12
15
|
/** MCP server statuses that will not self-heal within the session. */
|
|
13
16
|
const TERMINAL_MCP_SERVER_STATUSES = new Set(["failed", "needs-auth", "disabled"]);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
export const DEFAULT_WORKFLOW_MCP_PREFLIGHT_TIMEOUT_MS = 30_000;
|
|
18
|
+
export const DEFAULT_WORKFLOW_MCP_PREFLIGHT_POLL_MS = 200;
|
|
19
|
+
const RUN_UAT_PREFLIGHT_TIMEOUT_MS = 90_000;
|
|
20
|
+
function resolveWorkflowMcpPreflightTimeoutMs(unitType) {
|
|
21
|
+
if (unitType === "run-uat")
|
|
22
|
+
return RUN_UAT_PREFLIGHT_TIMEOUT_MS;
|
|
23
|
+
return DEFAULT_WORKFLOW_MCP_PREFLIGHT_TIMEOUT_MS;
|
|
24
|
+
}
|
|
25
|
+
export function probeCoversRequiredWorkflowTools(tools, required) {
|
|
26
|
+
return required.every((tool) => tools.some((name) => name === tool || mcpToolMatchesBaseName(name, tool)));
|
|
27
|
+
}
|
|
28
|
+
export async function awaitWorkflowMcpToolRegistration(input) {
|
|
29
|
+
const { unitType, workflowServerName, projectRoot } = input;
|
|
30
|
+
if (!unitType || !workflowServerName)
|
|
31
|
+
return null;
|
|
32
|
+
const required = getRequiredWorkflowToolsForUnit(unitType).filter(isWorkflowToolSurfaceName);
|
|
33
|
+
if (required.length === 0)
|
|
34
|
+
return null;
|
|
35
|
+
const probe = input.probe ?? (async (serverName, root) => {
|
|
36
|
+
const result = await testMcpServerConnection(serverName, {
|
|
37
|
+
projectDir: resolveWorkflowMcpProjectRoot(root),
|
|
38
|
+
timeoutMs: WORKFLOW_MCP_PROBE_TIMEOUT_MS,
|
|
39
|
+
});
|
|
40
|
+
return { ok: result.ok, tools: result.tools };
|
|
41
|
+
});
|
|
42
|
+
const deadline = Date.now() + (input.timeoutMs ?? resolveWorkflowMcpPreflightTimeoutMs(unitType));
|
|
43
|
+
const pollMs = input.pollMs ?? DEFAULT_WORKFLOW_MCP_PREFLIGHT_POLL_MS;
|
|
44
|
+
while (Date.now() < deadline) {
|
|
45
|
+
throwIfAborted(input.signal);
|
|
46
|
+
const result = await probe(workflowServerName, projectRoot);
|
|
47
|
+
throwIfAborted(input.signal);
|
|
48
|
+
if (result.ok && probeCoversRequiredWorkflowTools(result.tools, required)) {
|
|
49
|
+
recordWorkflowMcpProbe(projectRoot, workflowServerName, result.tools);
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
await sleep(pollMs, input.signal);
|
|
53
|
+
}
|
|
54
|
+
return `${TOOL_SURFACE_NOT_READY} for ${unitType}: MCP server "${workflowServerName}" did not register required tools before session start: ${required.join(", ")}`;
|
|
55
|
+
}
|
|
56
|
+
function makeAbortError() {
|
|
57
|
+
const error = new Error("AbortError: The operation was aborted");
|
|
58
|
+
error.name = "AbortError";
|
|
59
|
+
return error;
|
|
60
|
+
}
|
|
61
|
+
function throwIfAborted(signal) {
|
|
62
|
+
if (signal?.aborted)
|
|
63
|
+
throw makeAbortError();
|
|
64
|
+
}
|
|
65
|
+
function sleep(ms, signal) {
|
|
66
|
+
throwIfAborted(signal);
|
|
67
|
+
return new Promise((resolve, reject) => {
|
|
68
|
+
const timeout = setTimeout(() => {
|
|
69
|
+
signal?.removeEventListener("abort", onAbort);
|
|
70
|
+
resolve();
|
|
71
|
+
}, ms);
|
|
72
|
+
const onAbort = () => {
|
|
73
|
+
clearTimeout(timeout);
|
|
74
|
+
reject(makeAbortError());
|
|
75
|
+
};
|
|
76
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/** Brief pause after a successful preflight before SDK query (race with MCP attach). */
|
|
80
|
+
export const POST_PREFLIGHT_SDK_SETTLE_MS = 750;
|
|
81
|
+
export const POST_PREFLIGHT_READINESS_RETRY_DELAYS_MS = [
|
|
82
|
+
1_000, 2_000, 3_000, 5_000, 8_000, 10_000, 15_000, 15_000, 15_000, 15_000,
|
|
83
|
+
];
|
|
28
84
|
export function getToolSurfaceReadinessError(input) {
|
|
29
85
|
const { unitType, workflowServerName, observation } = input;
|
|
30
86
|
if (!unitType || !workflowServerName)
|
|
@@ -33,24 +89,20 @@ export function getToolSurfaceReadinessError(input) {
|
|
|
33
89
|
if (required.length === 0)
|
|
34
90
|
return null;
|
|
35
91
|
const server = observation.mcpServers.find((entry) => entry.name === workflowServerName);
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// server reports "pending" there routinely, then registers within seconds,
|
|
41
|
-
// usually well before the Unit's first workflow tool call. Aborting on
|
|
42
|
-
// "pending" would fail the common healthy session, so it passes through;
|
|
43
|
-
// a genuine miss after pass-through still surfaces in-session as
|
|
44
|
-
// "No such tool available" and classifies tool-unavailable → bounded retry.
|
|
45
|
-
// Only statuses that cannot self-heal abort here.
|
|
46
|
-
if (server.status !== "connected" && !TERMINAL_MCP_SERVER_STATUSES.has(server.status)) {
|
|
47
|
-
return null;
|
|
92
|
+
if (server && TERMINAL_MCP_SERVER_STATUSES.has(server.status)) {
|
|
93
|
+
const missing = required.filter((tool) => !observation.tools.some((name) => name === tool || mcpToolMatchesBaseName(name, tool)));
|
|
94
|
+
const tools = missing.length > 0 ? missing : required;
|
|
95
|
+
return `${TOOL_SURFACE_NOT_READY} for ${unitType}: MCP server "${workflowServerName}" status is "${server.status}" (terminal) — cannot register: ${tools.join(", ")}`;
|
|
48
96
|
}
|
|
49
97
|
const missing = required.filter((tool) => !observation.tools.some((name) => name === tool || mcpToolMatchesBaseName(name, tool)));
|
|
50
|
-
if (missing.length === 0)
|
|
98
|
+
if (missing.length === 0) {
|
|
51
99
|
return null;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
:
|
|
55
|
-
|
|
100
|
+
}
|
|
101
|
+
if (!server) {
|
|
102
|
+
return `${TOOL_SURFACE_NOT_READY} for ${unitType}: MCP server "${workflowServerName}" is absent from the init surface (not yet connected): ${missing.join(", ")}`;
|
|
103
|
+
}
|
|
104
|
+
if (server.status !== "connected") {
|
|
105
|
+
return `${TOOL_SURFACE_NOT_READY} for ${unitType}: MCP server "${workflowServerName}" status is "${server.status}" (not yet connected): ${missing.join(", ")}`;
|
|
106
|
+
}
|
|
107
|
+
return `${TOOL_SURFACE_NOT_READY} for ${unitType}: MCP server "${workflowServerName}" is connected but has not registered: ${missing.join(", ")}`;
|
|
56
108
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* Projection write failures are reported as stale projections and do not roll
|
|
9
9
|
* back committed DB state.
|
|
10
10
|
*/
|
|
11
|
+
import { existsSync } from "node:fs";
|
|
11
12
|
import { join } from "node:path";
|
|
12
13
|
import { isClosedStatus } from "../status-guards.js";
|
|
13
14
|
import { transaction, insertMilestone, insertSlice, insertTask, insertVerificationEvidence, getMilestone, getSlice, getTask, updateTaskStatus, deleteVerificationEvidence, saveGateResult, getPendingGatesForTurn, } from "../gsd-db.js";
|
|
@@ -29,6 +30,35 @@ import { buildEscalationArtifact, writeEscalationArtifact } from "../escalation.
|
|
|
29
30
|
function taskSummaryPath(basePath, milestoneId, sliceId, taskId) {
|
|
30
31
|
return join(gsdProjectionRoot(basePath), "milestones", milestoneId, "slices", sliceId, "tasks", `${taskId}-SUMMARY.md`);
|
|
31
32
|
}
|
|
33
|
+
async function repairMissingTaskSummaryProjection(artifactBasePath, taskRow) {
|
|
34
|
+
const summaryPath = taskSummaryPath(artifactBasePath, taskRow.milestone_id, taskRow.slice_id, taskRow.id);
|
|
35
|
+
const summaryMd = renderSummaryContent(taskRow, taskRow.slice_id, taskRow.milestone_id, []);
|
|
36
|
+
let stale = false;
|
|
37
|
+
try {
|
|
38
|
+
await saveFile(summaryPath, summaryMd);
|
|
39
|
+
await renderPlanCheckboxes(artifactBasePath, taskRow.milestone_id, taskRow.slice_id);
|
|
40
|
+
}
|
|
41
|
+
catch (renderErr) {
|
|
42
|
+
stale = true;
|
|
43
|
+
logWarning("projection", `complete_task missing-summary repair failed for ${taskRow.milestone_id}/${taskRow.slice_id}/${taskRow.id}`, { error: renderErr.message });
|
|
44
|
+
}
|
|
45
|
+
invalidateStateCache();
|
|
46
|
+
clearPathCache();
|
|
47
|
+
clearParseCache();
|
|
48
|
+
try {
|
|
49
|
+
await flushWorkflowProjections(artifactBasePath, { milestoneId: taskRow.milestone_id });
|
|
50
|
+
}
|
|
51
|
+
catch (projErr) {
|
|
52
|
+
logWarning("tool", `complete-task repair projection warning: ${projErr.message}`);
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
writeManifest(artifactBasePath);
|
|
56
|
+
}
|
|
57
|
+
catch (mfErr) {
|
|
58
|
+
logWarning("tool", `complete-task repair manifest warning: ${mfErr.message}`);
|
|
59
|
+
}
|
|
60
|
+
return { summaryPath, stale };
|
|
61
|
+
}
|
|
32
62
|
/**
|
|
33
63
|
* Map an execute-task-owned gate id to the CompleteTaskParams field whose
|
|
34
64
|
* presence drives `pass` vs. `omitted`. Keep in lockstep with the gates
|
|
@@ -136,6 +166,7 @@ export async function handleCompleteTask(params, basePath) {
|
|
|
136
166
|
const completedAt = new Date().toISOString();
|
|
137
167
|
let guardError = null;
|
|
138
168
|
let summaryMd = "";
|
|
169
|
+
let repairTaskSummaryRow = null;
|
|
139
170
|
// ── ADR-011 Phase 2: validate escalation payload BEFORE any side effects ─
|
|
140
171
|
// Building the artifact runs the full shape validation (2-4 options, unique
|
|
141
172
|
// ids, recommendation references a real id). If the payload is malformed
|
|
@@ -197,6 +228,12 @@ export async function handleCompleteTask(params, basePath) {
|
|
|
197
228
|
guardError = "__stale_duplicate__";
|
|
198
229
|
return;
|
|
199
230
|
}
|
|
231
|
+
const existingSummaryPath = taskSummaryPath(artifactBasePath, params.milestoneId, params.sliceId, params.taskId);
|
|
232
|
+
if (existingTask.full_summary_md.trim() && !existsSync(existingSummaryPath)) {
|
|
233
|
+
repairTaskSummaryRow = existingTask;
|
|
234
|
+
guardError = "__repair_missing_summary__";
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
200
237
|
guardError = `task ${params.taskId} is already complete — use gsd_task_reopen first if you need to redo it`;
|
|
201
238
|
return;
|
|
202
239
|
}
|
|
@@ -252,6 +289,17 @@ export async function handleCompleteTask(params, basePath) {
|
|
|
252
289
|
stale: true,
|
|
253
290
|
};
|
|
254
291
|
}
|
|
292
|
+
if (guardError === "__repair_missing_summary__" && repairTaskSummaryRow) {
|
|
293
|
+
const repair = await repairMissingTaskSummaryProjection(artifactBasePath, repairTaskSummaryRow);
|
|
294
|
+
return {
|
|
295
|
+
taskId: params.taskId,
|
|
296
|
+
sliceId: params.sliceId,
|
|
297
|
+
milestoneId: params.milestoneId,
|
|
298
|
+
summaryPath: repair.summaryPath,
|
|
299
|
+
duplicate: true,
|
|
300
|
+
...(repair.stale ? { stale: true } : {}),
|
|
301
|
+
};
|
|
302
|
+
}
|
|
255
303
|
if (guardError) {
|
|
256
304
|
return { error: guardError };
|
|
257
305
|
}
|
|
@@ -349,6 +397,20 @@ export async function handleCompleteTask(params, basePath) {
|
|
|
349
397
|
}
|
|
350
398
|
}
|
|
351
399
|
else if (params.escalation && !escalationWriteEnabled) {
|
|
400
|
+
if (params.escalation.continueWithDefault === false) {
|
|
401
|
+
const msg = `complete-task received a hard-blocker escalation (continueWithDefault=false) but phases.mid_execution_escalation is disabled for ${params.milestoneId}/${params.sliceId}/${params.taskId}; reverting to pending instead of silently advancing.`;
|
|
402
|
+
logWarning("tool", msg);
|
|
403
|
+
try {
|
|
404
|
+
deleteVerificationEvidence(params.milestoneId, params.sliceId, params.taskId);
|
|
405
|
+
updateTaskStatus(params.milestoneId, params.sliceId, params.taskId, 'pending');
|
|
406
|
+
invalidateStateCache();
|
|
407
|
+
logWarning("tool", `complete-task rolled back DB completion for ${params.milestoneId}/${params.sliceId}/${params.taskId} because hard-blocker escalation handling is disabled; SUMMARY.md left on disk for retry.`);
|
|
408
|
+
}
|
|
409
|
+
catch (rollbackErr) {
|
|
410
|
+
logWarning("tool", `complete-task rollback failed after disabled hard-blocker escalation for ${params.milestoneId}/${params.sliceId}/${params.taskId}: ${rollbackErr.message}`);
|
|
411
|
+
}
|
|
412
|
+
return { error: msg };
|
|
413
|
+
}
|
|
352
414
|
logWarning("tool", `complete-task received escalation payload but phases.mid_execution_escalation is not enabled; ignoring (${params.milestoneId}/${params.sliceId}/${params.taskId})`);
|
|
353
415
|
}
|
|
354
416
|
// Invalidate all caches
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
// Project/App: gsd-pi
|
|
2
2
|
// File Purpose: Executor for the gsd_exec MCP tool.
|
|
3
3
|
import { EXEC_DEFAULTS, runExecSandbox, } from "../exec-sandbox.js";
|
|
4
|
-
import { realpathSync } from "node:fs";
|
|
5
|
-
import path from "node:path";
|
|
6
4
|
import { isContextModeEnabled } from "../preferences-types.js";
|
|
7
|
-
import {
|
|
5
|
+
import { bashReferencesProjectRootOutsideWorktree } from "../worktree-shell-guard.js";
|
|
8
6
|
import { contextModeDisabledResult } from "./context-mode-tool-result.js";
|
|
9
7
|
const UAT_EXEC_INTENTS = [
|
|
10
8
|
"uat-artifact-check",
|
|
@@ -131,110 +129,6 @@ function rejectUatScript(script) {
|
|
|
131
129
|
function isToolExecutionResult(value) {
|
|
132
130
|
return typeof value === "object" && value !== null && Array.isArray(value.content);
|
|
133
131
|
}
|
|
134
|
-
function escapeRegExp(value) {
|
|
135
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
136
|
-
}
|
|
137
|
-
function normalizeScanPath(value) {
|
|
138
|
-
const normalized = value.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
139
|
-
return normalized.startsWith("/private/var/")
|
|
140
|
-
? normalized.slice("/private".length)
|
|
141
|
-
: normalized;
|
|
142
|
-
}
|
|
143
|
-
function parseWorktreeBase(baseDir) {
|
|
144
|
-
const normalizedBase = normalizeScanPath(baseDir);
|
|
145
|
-
const originalRoot = projectRootFromWorktreePath(normalizedBase);
|
|
146
|
-
if (!originalRoot)
|
|
147
|
-
return null;
|
|
148
|
-
return { originalRoot, worktreeRoot: normalizedBase };
|
|
149
|
-
}
|
|
150
|
-
function pathInside(parent, target) {
|
|
151
|
-
const parentWithSep = parent.endsWith("/") ? parent : `${parent}/`;
|
|
152
|
-
return target === parent || target.startsWith(parentWithSep);
|
|
153
|
-
}
|
|
154
|
-
function comparablePathVariants(value) {
|
|
155
|
-
const variants = new Set();
|
|
156
|
-
const normalized = normalizeScanPath(path.resolve(value));
|
|
157
|
-
variants.add(normalized);
|
|
158
|
-
try {
|
|
159
|
-
variants.add(normalizeScanPath(realpathSync(normalized)));
|
|
160
|
-
}
|
|
161
|
-
catch {
|
|
162
|
-
// Nonexistent paths are still compared lexically.
|
|
163
|
-
}
|
|
164
|
-
if (normalized.startsWith("/private/var/")) {
|
|
165
|
-
variants.add(normalized.replace(/^\/private\/var\//, "/var/"));
|
|
166
|
-
}
|
|
167
|
-
else if (normalized.startsWith("/var/")) {
|
|
168
|
-
variants.add(`/private${normalized}`);
|
|
169
|
-
}
|
|
170
|
-
return [...variants];
|
|
171
|
-
}
|
|
172
|
-
function pathInsideAny(parents, targets) {
|
|
173
|
-
return targets.some((target) => parents.some((parent) => pathInside(parent, target)));
|
|
174
|
-
}
|
|
175
|
-
function stripWrappingQuotes(value) {
|
|
176
|
-
const trimmed = value.trim();
|
|
177
|
-
if (trimmed.length < 2)
|
|
178
|
-
return trimmed;
|
|
179
|
-
const first = trimmed[0];
|
|
180
|
-
const last = trimmed[trimmed.length - 1];
|
|
181
|
-
if ((first === "'" || first === '"' || first === "`") && last === first) {
|
|
182
|
-
return trimmed.slice(1, -1).trim();
|
|
183
|
-
}
|
|
184
|
-
return trimmed;
|
|
185
|
-
}
|
|
186
|
-
function extractPathLikeValues(script) {
|
|
187
|
-
const values = [];
|
|
188
|
-
const push = (candidate) => {
|
|
189
|
-
const cleaned = stripWrappingQuotes(candidate).trim();
|
|
190
|
-
if (!cleaned)
|
|
191
|
-
return;
|
|
192
|
-
values.push(cleaned);
|
|
193
|
-
};
|
|
194
|
-
const pushQuotedLiterals = (source, depth = 0) => {
|
|
195
|
-
for (const match of source.matchAll(/(["'`])((?:\\.|(?!\1).)*)\1/g)) {
|
|
196
|
-
push(match[2]);
|
|
197
|
-
if (depth < 2 && /["'`]/.test(match[2])) {
|
|
198
|
-
pushQuotedLiterals(match[2], depth + 1);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
for (const match of script.matchAll(/(?:^|[;\n\r]|\&\&|\|\|)\s*cd\s+([^\n\r;|&]+)/g)) {
|
|
203
|
-
push(match[1]);
|
|
204
|
-
}
|
|
205
|
-
for (const match of script.matchAll(/process\.chdir\(\s*([^\n\r;]+?)\s*\)/g)) {
|
|
206
|
-
push(match[1]);
|
|
207
|
-
pushQuotedLiterals(match[1]);
|
|
208
|
-
}
|
|
209
|
-
pushQuotedLiterals(script);
|
|
210
|
-
return values;
|
|
211
|
-
}
|
|
212
|
-
function resolvesToOriginalRootOutsideWorktree(script, baseDir) {
|
|
213
|
-
const parsed = parseWorktreeBase(baseDir);
|
|
214
|
-
if (!parsed)
|
|
215
|
-
return false;
|
|
216
|
-
const normalizedWorktree = normalizeScanPath(path.resolve(parsed.worktreeRoot));
|
|
217
|
-
const normalizedOriginalRoot = normalizeScanPath(path.resolve(parsed.originalRoot));
|
|
218
|
-
const worktreeRoots = comparablePathVariants(normalizedWorktree);
|
|
219
|
-
const originalRoots = comparablePathVariants(normalizedOriginalRoot);
|
|
220
|
-
for (const value of extractPathLikeValues(script)) {
|
|
221
|
-
const resolved = comparablePathVariants(path.resolve(normalizedWorktree, value));
|
|
222
|
-
if (pathInsideAny(originalRoots, resolved) && !pathInsideAny(worktreeRoots, resolved)) {
|
|
223
|
-
return true;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
return false;
|
|
227
|
-
}
|
|
228
|
-
function scriptReferencesOriginalRootFromWorktree(script, baseDir) {
|
|
229
|
-
const parsed = parseWorktreeBase(baseDir);
|
|
230
|
-
if (!parsed)
|
|
231
|
-
return false;
|
|
232
|
-
const normalizedScript = script.replace(/\\/g, "/");
|
|
233
|
-
return comparablePathVariants(parsed.originalRoot).some((originalRoot) => {
|
|
234
|
-
const originalRootPattern = new RegExp(`${escapeRegExp(originalRoot)}(?=$|[\\s'"\\\`;)&|<>]|/(?!\\.gsd(?:-worktrees|/worktrees)(?:/|$)))`);
|
|
235
|
-
return originalRootPattern.test(normalizedScript);
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
132
|
export async function executeGsdExec(params, deps) {
|
|
239
133
|
if (!isEnabled(deps.preferences))
|
|
240
134
|
return contextModeDisabledResult("gsd_exec");
|
|
@@ -247,8 +141,7 @@ export async function executeGsdExec(params, deps) {
|
|
|
247
141
|
if (Buffer.byteLength(script, "utf8") > 200_000) {
|
|
248
142
|
return paramError("script exceeds the 200 KB length limit");
|
|
249
143
|
}
|
|
250
|
-
if (
|
|
251
|
-
|| scriptReferencesOriginalRootFromWorktree(script, deps.baseDir)) {
|
|
144
|
+
if (bashReferencesProjectRootOutsideWorktree(script, deps.baseDir)) {
|
|
252
145
|
return paramError("script references the original project root while running inside a milestone worktree; use the active worktree path or relative paths");
|
|
253
146
|
}
|
|
254
147
|
const opts = buildExecOptions(deps.baseDir, deps.preferences?.context_mode, { env: deps.env, now: deps.now, generateId: deps.generateId });
|