@opengsd/gsd-pi 1.2.0-dev.e8563f58 → 1.2.0-dev.fbdca60b
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 +1 -18
- package/dist/loader.js +6 -4
- 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/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 +85 -15
- package/dist/resources/extensions/gsd/auto/phase-helpers.js +146 -0
- package/dist/resources/extensions/gsd/auto/phases.js +17 -2329
- package/dist/resources/extensions/gsd/auto/pre-dispatch.js +534 -0
- package/dist/resources/extensions/gsd/auto/session.js +3 -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-direct-dispatch.js +3 -2
- package/dist/resources/extensions/gsd/auto-dispatch.js +11 -2
- package/dist/resources/extensions/gsd/auto-post-unit.js +18 -6
- package/dist/resources/extensions/gsd/auto-start.js +23 -3
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +45 -21
- package/dist/resources/extensions/gsd/auto-verification.js +14 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +15 -2
- package/dist/resources/extensions/gsd/auto.js +45 -2
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +37 -7
- package/dist/resources/extensions/gsd/commands/context.js +16 -2
- package/dist/resources/extensions/gsd/commands-mcp-status.js +2 -2
- package/dist/resources/extensions/gsd/commands-workflow-templates.js +9 -2
- package/dist/resources/extensions/gsd/crash-recovery.js +8 -3
- 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-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-engine-checks.js +5 -5
- package/dist/resources/extensions/gsd/doctor-environment.js +256 -125
- package/dist/resources/extensions/gsd/gsd-db.js +15 -20
- package/dist/resources/extensions/gsd/guided-flow.js +93 -4
- 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-planning-persistence.js +2 -2
- package/dist/resources/extensions/gsd/milestone-reopen-events.js +3 -5
- package/dist/resources/extensions/gsd/milestone-settlement.js +2 -2
- package/dist/resources/extensions/gsd/notifications.js +12 -7
- package/dist/resources/extensions/gsd/projection-flush.js +7 -0
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +2 -2
- package/dist/resources/extensions/gsd/prompts/execute-task.md +3 -2
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/quick-task.md +1 -1
- package/dist/resources/extensions/gsd/prompts/reassess-roadmap.md +1 -1
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/replan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/research-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/research-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
- package/dist/resources/extensions/gsd/prompts/run-uat.md +3 -1
- package/dist/resources/extensions/gsd/prompts/triage-captures.md +1 -1
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/workflow-start.md +2 -1
- package/dist/resources/extensions/gsd/roadmap-slices.js +25 -3
- package/dist/resources/extensions/gsd/session-lock.js +1 -1
- package/dist/resources/extensions/gsd/skill-activation.js +3 -6
- package/dist/resources/extensions/gsd/state.js +6 -2
- package/dist/resources/extensions/gsd/tool-contract.js +14 -3
- package/dist/resources/extensions/gsd/tool-surface-readiness.js +83 -31
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +3 -2
- package/dist/resources/extensions/gsd/tools/complete-slice.js +2 -2
- package/dist/resources/extensions/gsd/tools/complete-task.js +65 -2
- package/dist/resources/extensions/gsd/tools/plan-slice.js +2 -2
- package/dist/resources/extensions/gsd/tools/plan-task.js +2 -2
- package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +2 -2
- package/dist/resources/extensions/gsd/tools/reopen-milestone.js +2 -2
- package/dist/resources/extensions/gsd/tools/reopen-slice.js +2 -2
- package/dist/resources/extensions/gsd/tools/reopen-task.js +2 -2
- package/dist/resources/extensions/gsd/tools/replan-slice.js +2 -2
- 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/verification-verdict.js +2 -1
- package/dist/resources/extensions/gsd/workflow-event-ledger.js +91 -0
- package/dist/resources/extensions/gsd/workflow-event-vocabulary.js +46 -0
- package/dist/resources/extensions/gsd/workflow-events.js +6 -18
- 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/workflow-reconcile.js +21 -56
- package/dist/resources/extensions/gsd/worktree-manager.js +7 -1
- package/dist/resources/extensions/gsd/worktree-safety.js +28 -26
- package/dist/resources/extensions/gsd/worktree.js +8 -1
- package/dist/resources/extensions/mcp-client/manager.js +6 -1
- 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 +7 -7
- 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 +7 -7
- 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 +3 -3
- 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 +6 -4
- 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/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/tool-execution.d.ts +8 -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 +50 -6
- 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 +2 -0
- 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 +34 -5
- package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts +1 -0
- 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 +17 -0
- 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/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 -53
- 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 +43 -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/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/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 +7 -7
- package/packages/pi-tui/README.md +15 -0
- 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/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/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 +95 -15
- package/src/resources/extensions/gsd/auto/phase-helpers.ts +199 -0
- package/src/resources/extensions/gsd/auto/phases.ts +58 -3022
- package/src/resources/extensions/gsd/auto/pre-dispatch.ts +704 -0
- package/src/resources/extensions/gsd/auto/session.ts +3 -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-direct-dispatch.ts +10 -16
- package/src/resources/extensions/gsd/auto-dispatch.ts +11 -10
- package/src/resources/extensions/gsd/auto-post-unit.ts +21 -6
- package/src/resources/extensions/gsd/auto-start.ts +24 -4
- package/src/resources/extensions/gsd/auto-unit-closeout.ts +83 -28
- package/src/resources/extensions/gsd/auto-verification.ts +18 -2
- package/src/resources/extensions/gsd/auto-worktree.ts +15 -2
- package/src/resources/extensions/gsd/auto.ts +56 -2
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +56 -6
- package/src/resources/extensions/gsd/commands/context.ts +16 -2
- package/src/resources/extensions/gsd/commands-mcp-status.ts +2 -2
- package/src/resources/extensions/gsd/commands-workflow-templates.ts +11 -4
- package/src/resources/extensions/gsd/crash-recovery.ts +10 -2
- 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-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-engine-checks.ts +5 -4
- package/src/resources/extensions/gsd/doctor-environment.ts +267 -142
- package/src/resources/extensions/gsd/gsd-db.ts +15 -19
- package/src/resources/extensions/gsd/guided-flow.ts +145 -24
- 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-planning-persistence.ts +2 -2
- package/src/resources/extensions/gsd/milestone-reopen-events.ts +3 -6
- package/src/resources/extensions/gsd/milestone-settlement.ts +2 -2
- package/src/resources/extensions/gsd/notifications.ts +13 -6
- package/src/resources/extensions/gsd/projection-flush.ts +20 -0
- package/src/resources/extensions/gsd/prompts/complete-slice.md +2 -2
- package/src/resources/extensions/gsd/prompts/execute-task.md +3 -2
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/quick-task.md +1 -1
- package/src/resources/extensions/gsd/prompts/reassess-roadmap.md +1 -1
- package/src/resources/extensions/gsd/prompts/refine-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/replan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/research-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/research-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
- package/src/resources/extensions/gsd/prompts/run-uat.md +3 -1
- package/src/resources/extensions/gsd/prompts/triage-captures.md +1 -1
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/workflow-start.md +2 -1
- package/src/resources/extensions/gsd/roadmap-slices.ts +28 -3
- package/src/resources/extensions/gsd/session-lock.ts +1 -1
- package/src/resources/extensions/gsd/skill-activation.ts +3 -6
- 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-loop.test.ts +206 -22
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +6 -1
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +76 -12
- 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 +77 -1
- package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/auto-remote-session-lock-cleanup.test.ts +65 -3
- 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/complete-task.test.ts +141 -5
- 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-history.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/dist-redirect.mjs +8 -0
- 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/gsd-db.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/guided-dispatch-root.test.ts +18 -6
- 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/journal-integration.test.ts +47 -16
- 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/notifications.test.ts +64 -9
- 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 +242 -0
- package/src/resources/extensions/gsd/tests/plan-gate-failed-doctor-heal-hint.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +63 -2
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +10 -2
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +2 -4
- package/src/resources/extensions/gsd/tests/remote-notification-from-desktop.test.ts +31 -81
- package/src/resources/extensions/gsd/tests/roadmap-slices.test.ts +68 -0
- package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +26 -2
- 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/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/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/tool-unavailable-retry.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/transport-gate-double-complete.test.ts +139 -0
- package/src/resources/extensions/gsd/tests/uok-audit-unified.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/verification-verdict.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/workflow-events.test.ts +19 -0
- 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-reconcile.test.ts +20 -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-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.test.ts +18 -0
- package/src/resources/extensions/gsd/tool-contract.ts +38 -3
- package/src/resources/extensions/gsd/tool-surface-readiness.ts +126 -19
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +3 -2
- package/src/resources/extensions/gsd/tools/complete-slice.ts +2 -2
- package/src/resources/extensions/gsd/tools/complete-task.ts +90 -2
- package/src/resources/extensions/gsd/tools/plan-slice.ts +2 -2
- package/src/resources/extensions/gsd/tools/plan-task.ts +2 -2
- package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +2 -2
- package/src/resources/extensions/gsd/tools/reopen-milestone.ts +2 -2
- package/src/resources/extensions/gsd/tools/reopen-slice.ts +2 -2
- package/src/resources/extensions/gsd/tools/reopen-task.ts +2 -2
- package/src/resources/extensions/gsd/tools/replan-slice.ts +2 -2
- 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/verification-verdict.ts +4 -2
- package/src/resources/extensions/gsd/workflow-event-ledger.ts +131 -0
- package/src/resources/extensions/gsd/workflow-event-vocabulary.ts +59 -0
- package/src/resources/extensions/gsd/workflow-events.ts +12 -20
- 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/workflow-reconcile.ts +29 -62
- package/src/resources/extensions/gsd/worktree-manager.ts +6 -1
- package/src/resources/extensions/gsd/worktree-safety.ts +41 -39
- package/src/resources/extensions/gsd/worktree.ts +7 -1
- package/src/resources/extensions/mcp-client/manager.ts +7 -1
- 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/{LDHRKiRBIVZmiuMjrL1Vy → 2T9IOdiiM3o3gZ4UbPi8E}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{LDHRKiRBIVZmiuMjrL1Vy → 2T9IOdiiM3o3gZ4UbPi8E}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// Project/App: gsd-pi
|
|
2
|
+
// File Purpose: Share recent workflow MCP probe results across guided-flow and Claude Code SDK preflight.
|
|
3
|
+
|
|
4
|
+
import { testMcpServerConnection } from "../mcp-client/manager.js";
|
|
5
|
+
import { mcpToolMatchesBaseName } from "./mcp-tool-name.js";
|
|
6
|
+
import {
|
|
7
|
+
detectWorkflowMcpLaunchConfig,
|
|
8
|
+
resolveWorkflowMcpProjectRoot,
|
|
9
|
+
} from "./workflow-mcp.js";
|
|
10
|
+
import { isWorkflowToolSurfaceName } from "./workflow-tool-surface.js";
|
|
11
|
+
|
|
12
|
+
/** Reuse a recent successful probe instead of spawning another stdio server. */
|
|
13
|
+
export const WORKFLOW_MCP_PROBE_CACHE_TTL_MS = 120_000;
|
|
14
|
+
/** Per-probe connect + tools/list budget (server typically ready in ~1–2s). */
|
|
15
|
+
export const WORKFLOW_MCP_PROBE_TIMEOUT_MS = 5_000;
|
|
16
|
+
|
|
17
|
+
export interface WorkflowMcpProbeCacheEntry {
|
|
18
|
+
serverName: string;
|
|
19
|
+
tools: readonly string[];
|
|
20
|
+
probedAt: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type WorkflowMcpProbeResult = {
|
|
24
|
+
ok: boolean;
|
|
25
|
+
tools: readonly string[];
|
|
26
|
+
serverName?: string;
|
|
27
|
+
error?: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const cacheByProject = new Map<string, WorkflowMcpProbeCacheEntry>();
|
|
31
|
+
const probeInFlightByProject = new Map<string, Promise<WorkflowMcpProbeResult>>();
|
|
32
|
+
let activeWorkflowMcpSdkSessions = 0;
|
|
33
|
+
|
|
34
|
+
function cacheKey(projectRoot: string): string {
|
|
35
|
+
return resolveWorkflowMcpProjectRoot(projectRoot);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function beginWorkflowMcpSdkSession(): void {
|
|
39
|
+
activeWorkflowMcpSdkSessions++;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function endWorkflowMcpSdkSession(): void {
|
|
43
|
+
activeWorkflowMcpSdkSessions = Math.max(0, activeWorkflowMcpSdkSessions - 1);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function getCachedWorkflowMcpProbe(projectRoot: string): WorkflowMcpProbeCacheEntry | null {
|
|
47
|
+
const entry = cacheByProject.get(cacheKey(projectRoot));
|
|
48
|
+
if (!entry) return null;
|
|
49
|
+
if (Date.now() - entry.probedAt > WORKFLOW_MCP_PROBE_CACHE_TTL_MS) {
|
|
50
|
+
cacheByProject.delete(cacheKey(projectRoot));
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
return entry;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function recordWorkflowMcpProbe(
|
|
57
|
+
projectRoot: string,
|
|
58
|
+
serverName: string,
|
|
59
|
+
tools: readonly string[],
|
|
60
|
+
): void {
|
|
61
|
+
cacheByProject.set(cacheKey(projectRoot), {
|
|
62
|
+
serverName,
|
|
63
|
+
tools: [...tools],
|
|
64
|
+
probedAt: Date.now(),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function clearWorkflowMcpProbeCache(projectRoot?: string): void {
|
|
69
|
+
if (projectRoot === undefined) {
|
|
70
|
+
cacheByProject.clear();
|
|
71
|
+
probeInFlightByProject.clear();
|
|
72
|
+
activeWorkflowMcpSdkSessions = 0;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const key = cacheKey(projectRoot);
|
|
76
|
+
cacheByProject.delete(key);
|
|
77
|
+
probeInFlightByProject.delete(key);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function workflowMcpProbeAdvertisesSurface(tools: readonly string[]): boolean {
|
|
81
|
+
return tools.some((tool) => isWorkflowToolSurfaceName(tool));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function cachedWorkflowMcpCoversRequired(
|
|
85
|
+
projectRoot: string,
|
|
86
|
+
serverName: string,
|
|
87
|
+
required: readonly string[],
|
|
88
|
+
): boolean {
|
|
89
|
+
const entry = getCachedWorkflowMcpProbe(projectRoot);
|
|
90
|
+
if (!entry || entry.serverName !== serverName) return false;
|
|
91
|
+
return required.every((tool) =>
|
|
92
|
+
entry.tools.some((name) => name === tool || mcpToolMatchesBaseName(name, tool)),
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async function runProbeAndCacheWorkflowMcp(
|
|
97
|
+
projectRoot: string,
|
|
98
|
+
options: { timeoutMs?: number } = {},
|
|
99
|
+
): Promise<WorkflowMcpProbeResult> {
|
|
100
|
+
const root = cacheKey(projectRoot);
|
|
101
|
+
const launch = detectWorkflowMcpLaunchConfig(root);
|
|
102
|
+
const serverName = launch?.name ?? "gsd-workflow";
|
|
103
|
+
|
|
104
|
+
const cached = getCachedWorkflowMcpProbe(projectRoot);
|
|
105
|
+
if (cached && workflowMcpProbeAdvertisesSurface(cached.tools)) {
|
|
106
|
+
return { ok: true, tools: cached.tools, serverName: cached.serverName };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const result = await testMcpServerConnection(serverName, {
|
|
110
|
+
projectDir: root,
|
|
111
|
+
timeoutMs: options.timeoutMs ?? WORKFLOW_MCP_PROBE_TIMEOUT_MS,
|
|
112
|
+
});
|
|
113
|
+
if (result.ok && workflowMcpProbeAdvertisesSurface(result.tools)) {
|
|
114
|
+
recordWorkflowMcpProbe(projectRoot, serverName, result.tools);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
ok: result.ok,
|
|
118
|
+
tools: result.tools,
|
|
119
|
+
serverName,
|
|
120
|
+
error: result.error,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export async function probeAndCacheWorkflowMcp(
|
|
125
|
+
projectRoot: string,
|
|
126
|
+
options: { timeoutMs?: number } = {},
|
|
127
|
+
): Promise<WorkflowMcpProbeResult> {
|
|
128
|
+
const key = cacheKey(projectRoot);
|
|
129
|
+
const inFlight = probeInFlightByProject.get(key);
|
|
130
|
+
if (inFlight) return inFlight;
|
|
131
|
+
|
|
132
|
+
const promise = runProbeAndCacheWorkflowMcp(projectRoot, options).finally(() => {
|
|
133
|
+
probeInFlightByProject.delete(key);
|
|
134
|
+
});
|
|
135
|
+
probeInFlightByProject.set(key, promise);
|
|
136
|
+
return promise;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** Fire-and-forget probe so /gsd dispatch often hits a warm cache. */
|
|
140
|
+
export function warmWorkflowMcpProbeInBackground(projectRoot: string): void {
|
|
141
|
+
if (activeWorkflowMcpSdkSessions > 0) return;
|
|
142
|
+
|
|
143
|
+
const key = cacheKey(projectRoot);
|
|
144
|
+
if (getCachedWorkflowMcpProbe(projectRoot)) return;
|
|
145
|
+
if (probeInFlightByProject.has(key)) return;
|
|
146
|
+
|
|
147
|
+
void probeAndCacheWorkflowMcp(projectRoot).catch(() => {
|
|
148
|
+
// Background warm is best-effort.
|
|
149
|
+
});
|
|
150
|
+
}
|
|
@@ -3,6 +3,16 @@ import { mkdirSync, existsSync, readFileSync, unlinkSync } from "node:fs";
|
|
|
3
3
|
import { logWarning, logError } from "./workflow-logger.js";
|
|
4
4
|
import { readEvents, findForkPoint, getSessionId } from "./workflow-events.js";
|
|
5
5
|
import type { WorkflowEvent } from "./workflow-events.js";
|
|
6
|
+
import {
|
|
7
|
+
normalizeWorkflowEventCommand,
|
|
8
|
+
workflowEventEntityKey,
|
|
9
|
+
} from "./workflow-event-vocabulary.js";
|
|
10
|
+
import {
|
|
11
|
+
readWorktreeEventLogPath,
|
|
12
|
+
workflowEventLogPath,
|
|
13
|
+
writeWorkflowEventLog,
|
|
14
|
+
writeWorktreeEventLog,
|
|
15
|
+
} from "./workflow-event-ledger.js";
|
|
6
16
|
import {
|
|
7
17
|
transaction,
|
|
8
18
|
updateTaskStatus,
|
|
@@ -82,14 +92,11 @@ function replayEvents(events: WorkflowEvent[]): void {
|
|
|
82
92
|
transaction(() => {
|
|
83
93
|
for (const event of events) {
|
|
84
94
|
const p = event.params;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
// Type guard: malformed event lines with non-string cmd are skipped.
|
|
88
|
-
if (typeof event.cmd !== "string") {
|
|
95
|
+
const cmd = normalizeWorkflowEventCommand(event.cmd);
|
|
96
|
+
if (!cmd) {
|
|
89
97
|
logWarning("reconcile", `Event with non-string cmd skipped: ${JSON.stringify(event.cmd)}`);
|
|
90
98
|
continue;
|
|
91
99
|
}
|
|
92
|
-
const cmd = event.cmd.replace(/-/g, "_");
|
|
93
100
|
switch (cmd) {
|
|
94
101
|
case "complete_task": {
|
|
95
102
|
const milestoneId = p["milestoneId"] as string;
|
|
@@ -235,48 +242,7 @@ function replayEvents(events: WorkflowEvent[]): void {
|
|
|
235
242
|
export function extractEntityKey(
|
|
236
243
|
event: WorkflowEvent,
|
|
237
244
|
): { type: string; id: string } | null {
|
|
238
|
-
|
|
239
|
-
// Normalize cmd format: accept both hyphens and underscores
|
|
240
|
-
if (typeof event.cmd !== "string") return null;
|
|
241
|
-
const cmd = event.cmd.replace(/-/g, "_");
|
|
242
|
-
|
|
243
|
-
switch (cmd) {
|
|
244
|
-
case "complete_task":
|
|
245
|
-
case "start_task":
|
|
246
|
-
case "skip_task":
|
|
247
|
-
case "report_blocker":
|
|
248
|
-
case "record_verification":
|
|
249
|
-
case "plan_task":
|
|
250
|
-
return typeof p["taskId"] === "string"
|
|
251
|
-
? { type: "task", id: p["taskId"] }
|
|
252
|
-
: null;
|
|
253
|
-
|
|
254
|
-
case "complete_slice":
|
|
255
|
-
case "replan_slice":
|
|
256
|
-
return typeof p["sliceId"] === "string"
|
|
257
|
-
? { type: "slice", id: p["sliceId"] }
|
|
258
|
-
: null;
|
|
259
|
-
|
|
260
|
-
case "plan_slice":
|
|
261
|
-
return typeof p["sliceId"] === "string"
|
|
262
|
-
? { type: "slice_plan", id: p["sliceId"] }
|
|
263
|
-
: null;
|
|
264
|
-
|
|
265
|
-
case "complete_milestone":
|
|
266
|
-
case "plan_milestone":
|
|
267
|
-
return typeof p["milestoneId"] === "string"
|
|
268
|
-
? { type: "milestone", id: p["milestoneId"] }
|
|
269
|
-
: null;
|
|
270
|
-
|
|
271
|
-
case "save_decision":
|
|
272
|
-
if (typeof p["scope"] === "string" && typeof p["decision"] === "string") {
|
|
273
|
-
return { type: "decision", id: `${p["scope"]}:${p["decision"]}` };
|
|
274
|
-
}
|
|
275
|
-
return null;
|
|
276
|
-
|
|
277
|
-
default:
|
|
278
|
-
return null;
|
|
279
|
-
}
|
|
245
|
+
return workflowEventEntityKey(event);
|
|
280
246
|
}
|
|
281
247
|
|
|
282
248
|
// ─── detectConflicts ──────────────────────────────────────────────────────────
|
|
@@ -360,13 +326,6 @@ function rewriteDivergedEventsForEntity(
|
|
|
360
326
|
return rewritten;
|
|
361
327
|
}
|
|
362
328
|
|
|
363
|
-
function writeEventLog(basePath: string, events: WorkflowEvent[]): void {
|
|
364
|
-
const dir = join(basePath, ".gsd");
|
|
365
|
-
mkdirSync(dir, { recursive: true });
|
|
366
|
-
const content = events.map((e) => JSON.stringify(e)).join("\n") + (events.length > 0 ? "\n" : "");
|
|
367
|
-
atomicWriteSync(join(dir, "event-log.jsonl"), content);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
329
|
// ─── writeConflictsFile ───────────────────────────────────────────────────────
|
|
371
330
|
|
|
372
331
|
/**
|
|
@@ -450,12 +409,18 @@ function _reconcileWorktreeLogsInner(
|
|
|
450
409
|
worktreeBasePath: string,
|
|
451
410
|
): ReconcileResult {
|
|
452
411
|
// Step 1: Read both logs
|
|
453
|
-
const mainLogPath =
|
|
454
|
-
const wtLogPath =
|
|
412
|
+
const mainLogPath = workflowEventLogPath(mainBasePath);
|
|
413
|
+
const wtLogPath = readWorktreeEventLogPath(worktreeBasePath);
|
|
455
414
|
|
|
456
415
|
const mainEvents = readEvents(mainLogPath);
|
|
457
416
|
const wtEvents = readEvents(wtLogPath);
|
|
458
417
|
|
|
418
|
+
// Canonical worktree appends are already durable in the project ledger.
|
|
419
|
+
// Empty/missing worktree shards are legacy-only absence, not divergence.
|
|
420
|
+
if (wtEvents.length === 0) {
|
|
421
|
+
return { autoMerged: 0, conflicts: [] };
|
|
422
|
+
}
|
|
423
|
+
|
|
459
424
|
// Step 2: Find fork point
|
|
460
425
|
const forkPoint = findForkPoint(mainEvents, wtEvents);
|
|
461
426
|
|
|
@@ -495,9 +460,7 @@ function _reconcileWorktreeLogsInner(
|
|
|
495
460
|
|
|
496
461
|
const baseEvents = mainEvents.slice(0, forkPoint + 1);
|
|
497
462
|
const mergedLog = baseEvents.concat(merged);
|
|
498
|
-
|
|
499
|
-
mkdirSync(join(mainBasePath, ".gsd"), { recursive: true });
|
|
500
|
-
atomicWriteSync(join(mainBasePath, ".gsd", "event-log.jsonl"), logContent);
|
|
463
|
+
writeWorkflowEventLog(mainBasePath, mergedLog);
|
|
501
464
|
|
|
502
465
|
// Step 8: Replay into DB (wrapped in a transaction by replayEvents)
|
|
503
466
|
openWorkflowDatabasePath(resolveGsdPathContract(mainBasePath).projectDb);
|
|
@@ -636,8 +599,8 @@ export function resolveConflict(
|
|
|
636
599
|
const conflict = conflicts[idx]!;
|
|
637
600
|
const eventsToReplay = pick === "main" ? conflict.mainSideEvents : conflict.worktreeSideEvents;
|
|
638
601
|
|
|
639
|
-
const mainLogPath =
|
|
640
|
-
const wtLogPath =
|
|
602
|
+
const mainLogPath = workflowEventLogPath(basePath);
|
|
603
|
+
const wtLogPath = readWorktreeEventLogPath(worktreeBasePath);
|
|
641
604
|
const mainEvents = readEvents(mainLogPath);
|
|
642
605
|
const wtEvents = readEvents(wtLogPath);
|
|
643
606
|
const forkPoint = findForkPoint(mainEvents, wtEvents);
|
|
@@ -652,7 +615,11 @@ export function resolveConflict(
|
|
|
652
615
|
|
|
653
616
|
const targetBasePath = pick === "main" ? worktreeBasePath : basePath;
|
|
654
617
|
const targetBaseEvents = pick === "main" ? wtBaseEvents : mainBaseEvents;
|
|
655
|
-
|
|
618
|
+
if (pick === "main") {
|
|
619
|
+
writeWorktreeEventLog(targetBasePath, targetBaseEvents.concat(rewrittenTargetEvents));
|
|
620
|
+
} else {
|
|
621
|
+
writeWorkflowEventLog(targetBasePath, targetBaseEvents.concat(rewrittenTargetEvents));
|
|
622
|
+
}
|
|
656
623
|
|
|
657
624
|
// Replay resolved events through the DB (updates DB state)
|
|
658
625
|
openWorkflowDatabasePath(resolveGsdPathContract(basePath).projectDb);
|
|
@@ -656,7 +656,12 @@ export function removeWorktree(
|
|
|
656
656
|
const resolvedPathSafe = isInsideWorktreesDir(basePath, resolvedWtPath);
|
|
657
657
|
|
|
658
658
|
// If we're inside the worktree, move out first — git can't remove an in-use directory
|
|
659
|
-
|
|
659
|
+
let cwd: string;
|
|
660
|
+
try {
|
|
661
|
+
cwd = process.cwd();
|
|
662
|
+
} catch {
|
|
663
|
+
cwd = basePath;
|
|
664
|
+
}
|
|
660
665
|
const resolvedCwd = existsSync(cwd) ? realpathSync(cwd) : cwd;
|
|
661
666
|
if (resolvedCwd === resolvedWtPath || resolvedCwd.startsWith(resolvedWtPath + sep)) {
|
|
662
667
|
process.chdir(basePath);
|
|
@@ -218,52 +218,54 @@ export function createWorktreeSafetyModule(
|
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
let registered: readonly RegisteredWorktree[] | undefined;
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
221
|
+
if (isolationMode === "worktree") {
|
|
222
|
+
try {
|
|
223
|
+
registered = deps.listRegisteredWorktrees?.(projectRoot);
|
|
224
|
+
} catch (error) {
|
|
225
|
+
return failure(
|
|
226
|
+
"worktree-git-probe-failed",
|
|
227
|
+
`Unable to list registered worktrees for project root ${projectRoot}.`,
|
|
228
|
+
"Recover or recreate the milestone worktree before dispatching the source-writing Unit.",
|
|
229
|
+
{ projectRoot, error: errorMessage(error) },
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
if (registered && !registered.some((worktree) => samePath(worktree.path, unitRoot))) {
|
|
233
|
+
const wasPreviouslyTracked = unregisteredRecoveryFailed.has(unitRoot);
|
|
234
|
+
let attemptedPrune = false;
|
|
234
235
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
236
|
+
if (!wasPreviouslyTracked && deps.pruneRegisteredWorktrees) {
|
|
237
|
+
attemptedPrune = true;
|
|
238
|
+
try {
|
|
239
|
+
deps.pruneRegisteredWorktrees(projectRoot);
|
|
240
|
+
const rechecked = deps.listRegisteredWorktrees?.(projectRoot);
|
|
241
|
+
if (rechecked?.some((worktree) => samePath(worktree.path, unitRoot))) {
|
|
242
|
+
unregisteredRecoveryFailed.delete(unitRoot);
|
|
243
|
+
registered = rechecked;
|
|
244
|
+
} else {
|
|
245
|
+
unregisteredRecoveryFailed.add(unitRoot);
|
|
246
|
+
}
|
|
247
|
+
} catch (error) {
|
|
244
248
|
unregisteredRecoveryFailed.add(unitRoot);
|
|
249
|
+
return failure(
|
|
250
|
+
"worktree-git-probe-failed",
|
|
251
|
+
`Unable to recover unregistered worktree root ${unitRoot}.`,
|
|
252
|
+
"Run 'git worktree prune', then recreate or re-register the milestone worktree before dispatching the source-writing Unit.",
|
|
253
|
+
{ projectRoot, unitRoot, error: errorMessage(error) },
|
|
254
|
+
);
|
|
245
255
|
}
|
|
246
|
-
}
|
|
247
|
-
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (!registered?.some((worktree) => samePath(worktree.path, unitRoot))) {
|
|
248
259
|
return failure(
|
|
249
|
-
"worktree-
|
|
250
|
-
`
|
|
251
|
-
|
|
252
|
-
|
|
260
|
+
"worktree-unregistered",
|
|
261
|
+
`Worktree root ${unitRoot} is not registered with git worktree list.`,
|
|
262
|
+
attemptedPrune || wasPreviouslyTracked
|
|
263
|
+
? "Worktree recovery was attempted but the root is still unregistered. Recreate or re-register the milestone worktree before dispatching the source-writing Unit."
|
|
264
|
+
: "Run 'git worktree prune'. If still unregistered, recreate or re-register the milestone worktree before dispatching the source-writing Unit.",
|
|
265
|
+
{ unitRoot, attemptedPrune, trackedAsFailed: unregisteredRecoveryFailed.has(unitRoot) },
|
|
253
266
|
);
|
|
254
267
|
}
|
|
255
268
|
}
|
|
256
|
-
|
|
257
|
-
if (!registered?.some((worktree) => samePath(worktree.path, unitRoot))) {
|
|
258
|
-
return failure(
|
|
259
|
-
"worktree-unregistered",
|
|
260
|
-
`Worktree root ${unitRoot} is not registered with git worktree list.`,
|
|
261
|
-
attemptedPrune || wasPreviouslyTracked
|
|
262
|
-
? "Worktree recovery was attempted but the root is still unregistered. Recreate or re-register the milestone worktree before dispatching the source-writing Unit."
|
|
263
|
-
: "Run 'git worktree prune'. If still unregistered, recreate or re-register the milestone worktree before dispatching the source-writing Unit.",
|
|
264
|
-
{ unitRoot, attemptedPrune, trackedAsFailed: unregisteredRecoveryFailed.has(unitRoot) },
|
|
265
|
-
);
|
|
266
|
-
}
|
|
267
269
|
}
|
|
268
270
|
|
|
269
271
|
if (input.emptyWorktreeWithProjectContent) {
|
|
@@ -224,7 +224,13 @@ export function resolveGitHeadPath(dir: string): string | null {
|
|
|
224
224
|
*/
|
|
225
225
|
export function nudgeGitBranchCache(previousCwd: string): void {
|
|
226
226
|
const now = new Date();
|
|
227
|
-
|
|
227
|
+
let currentCwd: string | null = null;
|
|
228
|
+
try {
|
|
229
|
+
currentCwd = process.cwd();
|
|
230
|
+
} catch {
|
|
231
|
+
currentCwd = null;
|
|
232
|
+
}
|
|
233
|
+
for (const dir of [previousCwd, currentCwd].filter((dir): dir is string => Boolean(dir))) {
|
|
228
234
|
try {
|
|
229
235
|
const headPath = resolveGitHeadPath(dir);
|
|
230
236
|
if (headPath) utimesSync(headPath, now, now);
|
|
@@ -105,6 +105,9 @@ const CHILD_ENV_ALLOWLIST = new Set([
|
|
|
105
105
|
|
|
106
106
|
const MCP_STDERR_MAX_BYTES = 4096;
|
|
107
107
|
|
|
108
|
+
/** Short-lived stdio probes must not register/kill production MCP PIDs (see probe-mode.ts). */
|
|
109
|
+
export const GSD_MCP_PROBE_ENV = "GSD_MCP_PROBE";
|
|
110
|
+
|
|
108
111
|
let cachedStatus: ManagedMcpStatus | null = null;
|
|
109
112
|
let cachedStatusKey = "";
|
|
110
113
|
|
|
@@ -385,7 +388,10 @@ export async function testMcpServerConnection(
|
|
|
385
388
|
transport = new StdioClientTransport({
|
|
386
389
|
command: config.command ?? "",
|
|
387
390
|
args: config.args,
|
|
388
|
-
env:
|
|
391
|
+
env: {
|
|
392
|
+
...buildMcpChildEnv(config.env),
|
|
393
|
+
[GSD_MCP_PROBE_ENV]: "1",
|
|
394
|
+
},
|
|
389
395
|
cwd: config.cwd,
|
|
390
396
|
stderr: "pipe",
|
|
391
397
|
});
|
|
@@ -174,6 +174,9 @@ description: ... # What it does AND when to use it (third person)
|
|
|
174
174
|
---
|
|
175
175
|
```
|
|
176
176
|
|
|
177
|
+
Frontmatter must parse as YAML. Quote description values containing `:` or use
|
|
178
|
+
a folded block (`description: >`) for longer trigger descriptions.
|
|
179
|
+
|
|
177
180
|
Name conventions: `create-*`, `manage-*`, `setup-*`, `generate-*`, `build-*`
|
|
178
181
|
</yaml_requirements>
|
|
179
182
|
|
|
@@ -109,6 +109,7 @@ description: What it does and when to use it (third person, specific triggers)
|
|
|
109
109
|
- No XML tags
|
|
110
110
|
- Third person (never first or second person)
|
|
111
111
|
- Include what it does AND when to use it
|
|
112
|
+
- Must parse as YAML; quote values containing `:` or use `description: >`
|
|
112
113
|
|
|
113
114
|
**Critical rule**: Always write in third person.
|
|
114
115
|
- ✅ "Processes Excel files and generates reports"
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: gsd-browser
|
|
3
|
-
description: "Use gsd-browser for browser automation and UAT: navigating local apps, inspecting pages, clicking or filling controls, taking screenshots, asserting UI behavior, collecting console/network diagnostics, visual diffing, and creating evidence bundles. Prefer this over legacy Playwright browser tooling when both are available."
|
|
4
|
-
allowed-tools: Bash(gsd-browser:*), Bash(gsd-browser *)
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# gsd-browser
|
|
8
|
-
|
|
9
|
-
Use `gsd-browser` as the default browser surface for automated UAT and real UI verification.
|
|
10
|
-
|
|
11
|
-
## MCP First
|
|
12
|
-
|
|
13
|
-
When MCP tools are available, prefer the `gsd-browser` server:
|
|
14
|
-
|
|
15
|
-
- Discovery: `browser_snapshot_refs`, `browser_find`, `browser_get_accessibility_tree`
|
|
16
|
-
- Actions: `browser_act`, `browser_batch`, `browser_click_ref`, `browser_fill_ref`
|
|
17
|
-
- Verification: `browser_assert`, `browser_screenshot`, `browser_visual_diff`
|
|
18
|
-
- Diagnostics: `browser_get_console_logs`, `browser_get_network_logs`, `browser_debug_bundle`
|
|
19
|
-
|
|
20
|
-
If the host namespaces MCP tools, use names like `mcp__gsd-browser__browser_snapshot_refs`.
|
|
21
|
-
|
|
22
|
-
## CLI Fallback
|
|
23
|
-
|
|
24
|
-
The daemon starts automatically on first browser command.
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
gsd-browser navigate http://localhost:3000
|
|
28
|
-
gsd-browser snapshot
|
|
29
|
-
gsd-browser click-ref @v1:e1
|
|
30
|
-
gsd-browser wait-for --condition network_idle
|
|
31
|
-
gsd-browser assert --checks '[{"kind":"url_contains","text":"dashboard"}]'
|
|
32
|
-
gsd-browser screenshot --output /tmp/gsd-browser-uat.png --format png
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
After any navigation, submit, or dynamic DOM change, take a fresh snapshot before using refs again. Refs are versioned, such as `@v1:e1` and `@v2:e3`, and old refs can become stale.
|
|
36
|
-
|
|
37
|
-
Use `--json` when parsing output programmatically. Use named sessions for parallel or project-specific work:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
gsd-browser --session gsd-pi navigate http://localhost:3000
|
|
41
|
-
```
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: gsd-browser
|
|
3
|
-
description: "Use gsd-browser for browser automation and UAT: navigating local apps, inspecting pages, clicking or filling controls, taking screenshots, asserting UI behavior, collecting console/network diagnostics, visual diffing, and creating evidence bundles. Prefer this over legacy Playwright browser tooling when both are available."
|
|
4
|
-
allowed-tools: Bash(gsd-browser:*), Bash(gsd-browser *)
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# gsd-browser
|
|
8
|
-
|
|
9
|
-
Use `gsd-browser` as the default browser surface for automated UAT and real UI verification.
|
|
10
|
-
|
|
11
|
-
## MCP First
|
|
12
|
-
|
|
13
|
-
When MCP tools are available, prefer the `gsd-browser` server:
|
|
14
|
-
|
|
15
|
-
- Discovery: `browser_snapshot_refs`, `browser_find`, `browser_get_accessibility_tree`
|
|
16
|
-
- Actions: `browser_act`, `browser_batch`, `browser_click_ref`, `browser_fill_ref`
|
|
17
|
-
- Verification: `browser_assert`, `browser_screenshot`, `browser_visual_diff`
|
|
18
|
-
- Diagnostics: `browser_get_console_logs`, `browser_get_network_logs`, `browser_debug_bundle`
|
|
19
|
-
|
|
20
|
-
If the host namespaces MCP tools, use names like `mcp__gsd-browser__browser_snapshot_refs`.
|
|
21
|
-
|
|
22
|
-
## CLI Fallback
|
|
23
|
-
|
|
24
|
-
The daemon starts automatically on first browser command.
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
gsd-browser navigate http://localhost:3000
|
|
28
|
-
gsd-browser snapshot
|
|
29
|
-
gsd-browser click-ref @v1:e1
|
|
30
|
-
gsd-browser wait-for --condition network_idle
|
|
31
|
-
gsd-browser assert --checks '[{"kind":"url_contains","text":"dashboard"}]'
|
|
32
|
-
gsd-browser screenshot --output /tmp/gsd-browser-uat.png --format png
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
After any navigation, submit, or dynamic DOM change, take a fresh snapshot before using refs again. Refs are versioned, such as `@v1:e1` and `@v2:e3`, and old refs can become stale.
|
|
36
|
-
|
|
37
|
-
Use `--json` when parsing output programmatically. Use named sessions for parallel or project-specific work:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
gsd-browser --session gsd-pi navigate http://localhost:3000
|
|
41
|
-
```
|
|
File without changes
|
|
File without changes
|