@opengsd/gsd-pi 1.2.0 → 1.3.0-dev.eed73bea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -7
- package/dist/cli-model-override.d.ts +15 -0
- package/dist/cli-model-override.js +21 -0
- package/dist/cli-style.d.ts +17 -0
- package/dist/cli-style.js +28 -0
- package/dist/cli-web-branch.d.ts +2 -0
- package/dist/cli-web-branch.js +9 -2
- package/dist/cli.js +30 -20
- package/dist/headless-context.js +0 -1
- package/dist/headless-events.d.ts +20 -3
- package/dist/headless-events.js +33 -36
- package/dist/headless.js +8 -1
- package/dist/help-text.js +34 -0
- package/dist/hermes-integration-install.d.ts +17 -0
- package/dist/hermes-integration-install.js +199 -0
- package/dist/jiti-workspace-aliases.d.ts +11 -2
- package/dist/jiti-workspace-aliases.js +19 -3
- package/dist/loader.js +6 -4
- package/dist/mcp-server.js +2 -1
- package/dist/models-resolver.d.ts +3 -13
- package/dist/models-resolver.js +3 -22
- package/dist/onboarding.js +9 -4
- package/dist/provider-migrations.d.ts +23 -0
- package/dist/provider-migrations.js +41 -0
- package/dist/read-cli.d.ts +23 -0
- package/dist/read-cli.js +90 -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 -27
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/GSD-WORKFLOW.md +27 -26
- package/dist/resources/extensions/ask-user-questions.js +81 -25
- package/dist/resources/extensions/async-jobs/async-bash-tool.js +30 -64
- package/dist/resources/extensions/async-jobs/await-tool.js +80 -12
- package/dist/resources/extensions/async-jobs/index.js +65 -0
- package/dist/resources/extensions/async-jobs/job-manager.js +12 -1
- package/dist/resources/extensions/bg-shell/bg-shell-command.js +6 -6
- package/dist/resources/extensions/bg-shell/bg-shell-tool.js +10 -7
- package/dist/resources/extensions/bg-shell/overlay.js +9 -6
- package/dist/resources/extensions/bg-shell/process-manager.js +54 -25
- package/dist/resources/extensions/bg-shell/readiness-detector.js +11 -0
- package/dist/resources/extensions/bg-shell/utilities.js +5 -2
- package/dist/resources/extensions/browser-tools/engine/managed-gsd-browser.js +209 -88
- package/dist/resources/extensions/browser-tools/engine/selection.js +73 -5
- package/dist/resources/extensions/browser-tools/index.js +69 -12
- package/dist/resources/extensions/claude-code-cli/index.js +7 -1
- package/dist/resources/extensions/claude-code-cli/models.js +9 -0
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +622 -440
- package/dist/resources/extensions/claude-code-cli/turn-assembler.js +256 -0
- package/dist/resources/extensions/github-sync/templates.js +3 -3
- package/dist/resources/extensions/google-cli/stream-adapter.js +98 -16
- package/dist/resources/extensions/gsd/artifact-projection.js +14 -0
- package/dist/resources/extensions/gsd/auto/closeout.js +215 -0
- package/dist/resources/extensions/gsd/auto/custom-verify-retry-store.js +17 -2
- package/dist/resources/extensions/gsd/auto/detect-stuck.js +33 -13
- package/dist/resources/extensions/gsd/auto/dispatch-history.js +125 -0
- package/dist/resources/extensions/gsd/auto/dispatch-key.js +37 -0
- 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 +147 -58
- package/dist/resources/extensions/gsd/auto/milestone-lease-reclaim.js +56 -0
- package/dist/resources/extensions/gsd/auto/orchestrator.js +361 -80
- package/dist/resources/extensions/gsd/auto/phase-helpers.js +146 -0
- package/dist/resources/extensions/gsd/auto/phases.js +17 -2299
- package/dist/resources/extensions/gsd/auto/pre-dispatch.js +542 -0
- package/dist/resources/extensions/gsd/auto/run-unit.js +2 -1
- package/dist/resources/extensions/gsd/auto/session.js +6 -0
- package/dist/resources/extensions/gsd/auto/unit-phase.js +694 -0
- package/dist/resources/extensions/gsd/auto/workflow-kernel.js +15 -1
- 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-artifact-paths.js +81 -19
- package/dist/resources/extensions/gsd/auto-closeout-messaging.js +90 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +271 -435
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +26 -37
- package/dist/resources/extensions/gsd/auto-dispatch.js +119 -84
- package/dist/resources/extensions/gsd/auto-model-selection.js +56 -19
- package/dist/resources/extensions/gsd/auto-post-unit.js +85 -45
- package/dist/resources/extensions/gsd/auto-prompts.js +238 -58
- package/dist/resources/extensions/gsd/auto-recovery.js +173 -89
- package/dist/resources/extensions/gsd/auto-runtime-state.js +27 -0
- package/dist/resources/extensions/gsd/auto-start.js +116 -82
- package/dist/resources/extensions/gsd/auto-timers.js +16 -2
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +50 -0
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +45 -21
- package/dist/resources/extensions/gsd/auto-unit-tool-scope.js +14 -47
- package/dist/resources/extensions/gsd/auto-verification.js +34 -38
- package/dist/resources/extensions/gsd/auto-worktree-repair.js +10 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +230 -467
- package/dist/resources/extensions/gsd/auto.js +158 -50
- package/dist/resources/extensions/gsd/blocked-models.js +28 -0
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +161 -62
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +34 -38
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +74 -50
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +4 -2
- package/dist/resources/extensions/gsd/bootstrap/fallback-continuation.js +25 -0
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +2 -2
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +42 -1
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +429 -170
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +190 -43
- package/dist/resources/extensions/gsd/bootstrap/tool-call-loop-guard.js +75 -1
- package/dist/resources/extensions/gsd/bootstrap/tool-search-shim.js +22 -3
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +476 -83
- package/dist/resources/extensions/gsd/branch-patterns.js +2 -0
- package/dist/resources/extensions/gsd/browser-daemon-auto-prep.js +83 -0
- package/dist/resources/extensions/gsd/browser-evidence.js +8 -2
- package/dist/resources/extensions/gsd/captures.js +5 -15
- package/dist/resources/extensions/gsd/closeout-consistency-gate.js +110 -5
- package/dist/resources/extensions/gsd/closeout-recovery.js +3 -2
- package/dist/resources/extensions/gsd/closeout-wizard.js +97 -0
- package/dist/resources/extensions/gsd/codebase-generator.js +1 -0
- package/dist/resources/extensions/gsd/commands/catalog.js +12 -62
- package/dist/resources/extensions/gsd/commands/context.js +16 -2
- package/dist/resources/extensions/gsd/commands/dispatcher.js +3 -0
- package/dist/resources/extensions/gsd/commands/gsd-core-aliases-handler.js +39 -0
- package/dist/resources/extensions/gsd/commands/gsd-core-aliases.js +44 -0
- package/dist/resources/extensions/gsd/commands/handlers/auto.js +3 -0
- package/dist/resources/extensions/gsd/commands/handlers/core.js +52 -8
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +227 -3
- package/dist/resources/extensions/gsd/commands-cmux.js +3 -1
- package/dist/resources/extensions/gsd/commands-context.js +19 -1
- package/dist/resources/extensions/gsd/commands-gsd-core.js +868 -0
- package/dist/resources/extensions/gsd/commands-handlers.js +133 -4
- package/dist/resources/extensions/gsd/commands-inspect.js +4 -8
- package/dist/resources/extensions/gsd/commands-maintenance.js +140 -43
- package/dist/resources/extensions/gsd/commands-mcp-status.js +2 -2
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +30 -11
- package/dist/resources/extensions/gsd/commands-ship.js +2 -2
- package/dist/resources/extensions/gsd/commands-verdict.js +21 -5
- package/dist/resources/extensions/gsd/commands-workflow-templates.js +9 -2
- package/dist/resources/extensions/gsd/commands-worktree.js +12 -10
- package/dist/resources/extensions/gsd/compat/compat-marker.js +172 -0
- package/dist/resources/extensions/gsd/compat/index.js +3 -0
- package/dist/resources/extensions/gsd/compat/planning-compat.js +142 -0
- package/dist/resources/extensions/gsd/config-overlay.js +11 -8
- package/dist/resources/extensions/gsd/consent-question.js +365 -0
- package/dist/resources/extensions/gsd/consent-verdict.js +73 -0
- package/dist/resources/extensions/gsd/constants.js +0 -2
- package/dist/resources/extensions/gsd/crash-recovery.js +12 -15
- package/dist/resources/extensions/gsd/dashboard-overlay.js +71 -6
- package/dist/resources/extensions/gsd/db/engine.js +800 -0
- package/dist/resources/extensions/gsd/db/queries.js +542 -0
- package/dist/resources/extensions/gsd/db/sql-constants.js +11 -0
- package/dist/resources/extensions/gsd/db/unit-dispatches.js +22 -1
- package/dist/resources/extensions/gsd/db/writers/cascades.js +194 -0
- package/dist/resources/extensions/gsd/db/writers/import-restore.js +182 -0
- package/dist/resources/extensions/gsd/db/writers/memory.js +149 -0
- package/dist/resources/extensions/gsd/db/writers/reconcile.js +476 -0
- package/dist/resources/extensions/gsd/db/writers/status.js +70 -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-workspace.js +115 -0
- package/dist/resources/extensions/gsd/db-writer.js +8 -17
- package/dist/resources/extensions/gsd/delegation-policy.js +2 -10
- package/dist/resources/extensions/gsd/discussion-handoff.js +222 -0
- package/dist/resources/extensions/gsd/dispatch-guard.js +10 -35
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +9 -0
- package/dist/resources/extensions/gsd/doctor-engine-checks.js +5 -5
- package/dist/resources/extensions/gsd/doctor-environment.js +261 -136
- package/dist/resources/extensions/gsd/doctor-format.js +9 -6
- package/dist/resources/extensions/gsd/doctor-git-checks.js +36 -25
- package/dist/resources/extensions/gsd/doctor-providers.js +93 -9
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +34 -40
- package/dist/resources/extensions/gsd/doctor.js +43 -15
- package/dist/resources/extensions/gsd/engine-hook-contract.js +70 -0
- package/dist/resources/extensions/gsd/error-classifier.js +22 -1
- package/dist/resources/extensions/gsd/escalation.js +11 -4
- package/dist/resources/extensions/gsd/exec-sandbox.js +75 -19
- package/dist/resources/extensions/gsd/export-html.js +10 -3
- package/dist/resources/extensions/gsd/export.js +73 -0
- package/dist/resources/extensions/gsd/file-lock.js +1 -1
- package/dist/resources/extensions/gsd/files.js +33 -19
- package/dist/resources/extensions/gsd/flat-phase-migration.js +176 -0
- package/dist/resources/extensions/gsd/forensics.js +4 -33
- package/dist/resources/extensions/gsd/git-conflict-state.js +16 -1
- package/dist/resources/extensions/gsd/git-service.js +12 -8
- package/dist/resources/extensions/gsd/gitignore.js +9 -2
- package/dist/resources/extensions/gsd/gsd-command-home.js +22 -12
- package/dist/resources/extensions/gsd/gsd-db.js +185 -2054
- package/dist/resources/extensions/gsd/guidance.js +158 -0
- package/dist/resources/extensions/gsd/guided-flow-queue.js +59 -5
- package/dist/resources/extensions/gsd/guided-flow.js +184 -478
- package/dist/resources/extensions/gsd/guided-unit-completion.js +225 -0
- package/dist/resources/extensions/gsd/health-widget.js +117 -32
- package/dist/resources/extensions/gsd/layout-policy.js +75 -0
- package/dist/resources/extensions/gsd/markdown-renderer.js +408 -118
- package/dist/resources/extensions/gsd/mcp-bridge.js +10 -0
- package/dist/resources/extensions/gsd/mcp-filter.js +48 -30
- package/dist/resources/extensions/gsd/mcp-tool-name.js +18 -0
- package/dist/resources/extensions/gsd/md-importer.js +157 -54
- package/dist/resources/extensions/gsd/memory-consolidation-scanner.js +45 -22
- package/dist/resources/extensions/gsd/memory-relations.js +1 -1
- package/dist/resources/extensions/gsd/metrics.js +19 -11
- package/dist/resources/extensions/gsd/migrate/layout-detect.js +32 -0
- package/dist/resources/extensions/gsd/migrate/planning-writer.js +203 -0
- package/dist/resources/extensions/gsd/migrate/safety.js +22 -11
- package/dist/resources/extensions/gsd/migrate-external.js +51 -6
- package/dist/resources/extensions/gsd/migration-auto-check.js +32 -19
- package/dist/resources/extensions/gsd/milestone-actions.js +5 -3
- package/dist/resources/extensions/gsd/milestone-closeout-proof.js +72 -0
- package/dist/resources/extensions/gsd/milestone-closeout.js +108 -29
- package/dist/resources/extensions/gsd/milestone-ids.js +50 -19
- package/dist/resources/extensions/gsd/milestone-implementation-evidence.js +26 -20
- package/dist/resources/extensions/gsd/milestone-merge-transaction.js +10 -0
- package/dist/resources/extensions/gsd/milestone-planning-persistence.js +164 -0
- package/dist/resources/extensions/gsd/milestone-readiness.js +77 -0
- package/dist/resources/extensions/gsd/milestone-reopen-events.js +3 -5
- package/dist/resources/extensions/gsd/milestone-settlement.js +50 -0
- package/dist/resources/extensions/gsd/milestone-validation-evidence.js +73 -0
- package/dist/resources/extensions/gsd/milestone-validation-verdict.js +60 -0
- package/dist/resources/extensions/gsd/model-cost-table.js +1 -0
- package/dist/resources/extensions/gsd/model-router.js +82 -20
- package/dist/resources/extensions/gsd/native-git-bridge.js +36 -0
- package/dist/resources/extensions/gsd/notification-store.js +33 -33
- package/dist/resources/extensions/gsd/notifications.js +48 -14
- package/dist/resources/extensions/gsd/observability-validator.js +12 -4
- package/dist/resources/extensions/gsd/parallel-eligibility.js +3 -6
- package/dist/resources/extensions/gsd/parallel-merge.js +14 -11
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +144 -42
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +3 -2
- package/dist/resources/extensions/gsd/parsers-legacy.js +56 -18
- package/dist/resources/extensions/gsd/paths.js +393 -68
- package/dist/resources/extensions/gsd/planning-depth.js +2 -1
- package/dist/resources/extensions/gsd/post-execution-checks.js +26 -3
- package/dist/resources/extensions/gsd/pre-execution-checks.js +91 -3
- package/dist/resources/extensions/gsd/preferences-diagnostics.js +67 -0
- package/dist/resources/extensions/gsd/preferences-models.js +46 -60
- package/dist/resources/extensions/gsd/preferences.js +302 -35
- package/dist/resources/extensions/gsd/projection-flush.js +7 -0
- package/dist/resources/extensions/gsd/prompts/ai-integration-phase.md +28 -0
- package/dist/resources/extensions/gsd/prompts/audit-fix.md +39 -0
- package/dist/resources/extensions/gsd/prompts/audit-milestone.md +26 -0
- package/dist/resources/extensions/gsd/prompts/audit-uat.md +24 -0
- package/dist/resources/extensions/gsd/prompts/autonomous.md +31 -0
- package/dist/resources/extensions/gsd/prompts/code-review.md +37 -0
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +8 -2
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +25 -15
- package/dist/resources/extensions/gsd/prompts/discuss-phase.md +31 -0
- package/dist/resources/extensions/gsd/prompts/docs-update.md +13 -0
- package/dist/resources/extensions/gsd/prompts/execute-phase.md +33 -0
- package/dist/resources/extensions/gsd/prompts/execute-task.md +9 -2
- package/dist/resources/extensions/gsd/prompts/explore.md +58 -0
- package/dist/resources/extensions/gsd/prompts/graphify.md +27 -0
- package/dist/resources/extensions/gsd/prompts/guided-discuss-project.md +3 -1
- package/dist/resources/extensions/gsd/prompts/health.md +37 -0
- package/dist/resources/extensions/gsd/prompts/import.md +30 -0
- package/dist/resources/extensions/gsd/prompts/inbox.md +27 -0
- package/dist/resources/extensions/gsd/prompts/ingest-docs.md +30 -0
- package/dist/resources/extensions/gsd/prompts/manager.md +21 -0
- package/dist/resources/extensions/gsd/prompts/map-codebase.md +42 -0
- package/dist/resources/extensions/gsd/prompts/milestone-summary.md +27 -0
- package/dist/resources/extensions/gsd/prompts/mvp-phase.md +23 -0
- package/dist/resources/extensions/gsd/prompts/pause-work.md +24 -0
- package/dist/resources/extensions/gsd/prompts/phase.md +22 -0
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +3 -1
- package/dist/resources/extensions/gsd/prompts/plan-phase.md +34 -0
- package/dist/resources/extensions/gsd/prompts/plan-review-convergence.md +34 -0
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +3 -2
- package/dist/resources/extensions/gsd/prompts/profile-user.md +28 -0
- package/dist/resources/extensions/gsd/prompts/progress.md +30 -0
- 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/reassess-roadmap.md +1 -1
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +3 -2
- package/dist/resources/extensions/gsd/prompts/replan-slice.md +2 -2
- 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/resume-work.md +20 -0
- package/dist/resources/extensions/gsd/prompts/review-backlog.md +21 -0
- package/dist/resources/extensions/gsd/prompts/review.md +27 -0
- package/dist/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
- package/dist/resources/extensions/gsd/prompts/run-uat.md +13 -5
- package/dist/resources/extensions/gsd/prompts/secure-phase.md +24 -0
- package/dist/resources/extensions/gsd/prompts/settings.md +24 -0
- package/dist/resources/extensions/gsd/prompts/sketch.md +59 -0
- package/dist/resources/extensions/gsd/prompts/spec-phase.md +29 -0
- package/dist/resources/extensions/gsd/prompts/spike.md +59 -0
- package/dist/resources/extensions/gsd/prompts/stats.md +43 -0
- package/dist/resources/extensions/gsd/prompts/surface.md +25 -0
- package/dist/resources/extensions/gsd/prompts/system.md +6 -3
- package/dist/resources/extensions/gsd/prompts/thread.md +24 -0
- package/dist/resources/extensions/gsd/prompts/triage-captures.md +1 -1
- package/dist/resources/extensions/gsd/prompts/ui-phase.md +29 -0
- package/dist/resources/extensions/gsd/prompts/ui-review.md +29 -0
- package/dist/resources/extensions/gsd/prompts/ultraplan-phase.md +24 -0
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/validate-phase.md +26 -0
- package/dist/resources/extensions/gsd/prompts/verify-work.md +24 -0
- package/dist/resources/extensions/gsd/prompts/workflow-start.md +2 -1
- package/dist/resources/extensions/gsd/prompts/workspace.md +22 -0
- package/dist/resources/extensions/gsd/prompts/workstreams.md +24 -0
- package/dist/resources/extensions/gsd/provider-error-guidance.js +25 -5
- package/dist/resources/extensions/gsd/provider-payload-policy.js +83 -0
- package/dist/resources/extensions/gsd/provider-switch-observer.js +1 -1
- package/dist/resources/extensions/gsd/publication.js +87 -0
- package/dist/resources/extensions/gsd/pull-request-process.js +13 -0
- package/dist/resources/extensions/gsd/quality-gate-closure.js +109 -0
- package/dist/resources/extensions/gsd/question-transport.js +86 -0
- package/dist/resources/extensions/gsd/queue-order.js +3 -2
- package/dist/resources/extensions/gsd/quick.js +45 -2
- package/dist/resources/extensions/gsd/reactive-graph.js +8 -1
- package/dist/resources/extensions/gsd/recovery-classification.js +49 -87
- package/dist/resources/extensions/gsd/roadmap-slices.js +34 -6
- package/dist/resources/extensions/gsd/safety/content-validator.js +2 -1
- package/dist/resources/extensions/gsd/safety/destructive-confirmation.js +108 -0
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +37 -4
- package/dist/resources/extensions/gsd/safety/evidence-cross-ref.js +50 -3
- package/dist/resources/extensions/gsd/safety/file-change-validator.js +10 -0
- package/dist/resources/extensions/gsd/service-tier.js +2 -1
- package/dist/resources/extensions/gsd/session-forensics.js +11 -1
- package/dist/resources/extensions/gsd/session-lock.js +12 -10
- package/dist/resources/extensions/gsd/skill-activation.js +3 -6
- package/dist/resources/extensions/gsd/skills/gsd-headless/SKILL.md +3 -0
- package/dist/resources/extensions/gsd/skills/gsd-headless/references/commands.md +51 -0
- package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +3 -2
- package/dist/resources/extensions/gsd/state-reconciliation/drift/artifact-db.js +51 -10
- package/dist/resources/extensions/gsd/state-reconciliation/drift/completion.js +24 -3
- package/dist/resources/extensions/gsd/state-reconciliation/drift/external-markdown-edit.js +82 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/external-planning-edit.js +142 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/project-md.js +19 -6
- package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +2 -2
- package/dist/resources/extensions/gsd/state-reconciliation/drift/stale-render.js +143 -18
- package/dist/resources/extensions/gsd/state-reconciliation/index.js +36 -3
- package/dist/resources/extensions/gsd/state-reconciliation/registry.js +12 -0
- package/dist/resources/extensions/gsd/state-transition-matrix.js +38 -0
- package/dist/resources/extensions/gsd/state.js +70 -41
- package/dist/resources/extensions/gsd/status-guards.js +56 -8
- package/dist/resources/extensions/gsd/stop-notice.js +57 -0
- package/dist/resources/extensions/gsd/sync-lock.js +11 -18
- package/dist/resources/extensions/gsd/templates/plan.md +7 -0
- package/dist/resources/extensions/gsd/templates/project.md +1 -0
- package/dist/resources/extensions/gsd/templates/roadmap.md +1 -1
- package/dist/resources/extensions/gsd/templates/uat.md +5 -1
- package/dist/resources/extensions/gsd/tool-contract.js +66 -11
- package/dist/resources/extensions/gsd/tool-presentation-plan.js +17 -36
- package/dist/resources/extensions/gsd/tool-surface-readiness.js +297 -0
- package/dist/resources/extensions/gsd/tool-surface-snapshot.js +17 -0
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +7 -4
- package/dist/resources/extensions/gsd/tools/complete-slice.js +90 -58
- package/dist/resources/extensions/gsd/tools/complete-task.js +153 -14
- package/dist/resources/extensions/gsd/tools/exec-tool.js +14 -114
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +15 -143
- package/dist/resources/extensions/gsd/tools/plan-slice.js +13 -9
- package/dist/resources/extensions/gsd/tools/plan-task.js +18 -3
- package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +50 -5
- package/dist/resources/extensions/gsd/tools/reopen-milestone.js +13 -31
- package/dist/resources/extensions/gsd/tools/reopen-slice.js +16 -35
- 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/tools/skip-slice.js +18 -36
- package/dist/resources/extensions/gsd/tools/validate-milestone.js +21 -79
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +110 -6
- package/dist/resources/extensions/gsd/triage-resolution.js +14 -7
- package/dist/resources/extensions/gsd/tui/render-kit.js +38 -13
- package/dist/resources/extensions/gsd/uat-policy.js +57 -25
- package/dist/resources/extensions/gsd/uat-run.js +9 -14
- package/dist/resources/extensions/gsd/undo.js +16 -16
- package/dist/resources/extensions/gsd/unit-closeout.js +138 -0
- package/dist/resources/extensions/gsd/unit-context-composer.js +130 -21
- package/dist/resources/extensions/gsd/unit-context-manifest.js +4 -27
- package/dist/resources/extensions/gsd/unit-registry.js +413 -0
- package/dist/resources/extensions/gsd/unit-runtime.js +3 -2
- package/dist/resources/extensions/gsd/unit-tool-contracts.js +9 -181
- package/dist/resources/extensions/gsd/unmerged-milestone-guard.js +91 -5
- package/dist/resources/extensions/gsd/validation-block-guard.js +55 -3
- package/dist/resources/extensions/gsd/verdict-parser.js +1 -1
- package/dist/resources/extensions/gsd/verification-verdict.js +2 -1
- package/dist/resources/extensions/gsd/visualizer-data.js +35 -0
- package/dist/resources/extensions/gsd/visualizer-views.js +21 -2
- package/dist/resources/extensions/gsd/web-app-uat.js +117 -0
- 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-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/workflow-mcp.js +24 -103
- package/dist/resources/extensions/gsd/workflow-projections.js +25 -4
- package/dist/resources/extensions/gsd/workflow-reconcile.js +25 -59
- package/dist/resources/extensions/gsd/workflow-tool-surface.js +46 -0
- package/dist/resources/extensions/gsd/workspace-git-guard.js +2 -0
- package/dist/resources/extensions/gsd/workspace-git-preflight.js +30 -1
- package/dist/resources/extensions/gsd/worktree-command.js +6 -6
- package/dist/resources/extensions/gsd/worktree-git-recovery.js +293 -0
- package/dist/resources/extensions/gsd/worktree-health.js +6 -3
- package/dist/resources/extensions/gsd/worktree-lifecycle.js +12 -3
- package/dist/resources/extensions/gsd/worktree-manager.js +161 -45
- package/dist/resources/extensions/gsd/worktree-placement.js +59 -0
- package/dist/resources/extensions/gsd/worktree-reentry.js +12 -8
- package/dist/resources/extensions/gsd/worktree-root.js +28 -6
- package/dist/resources/extensions/gsd/worktree-safety.js +48 -34
- package/dist/resources/extensions/gsd/worktree-session-state.js +12 -11
- package/dist/resources/extensions/gsd/worktree-shell-guard.js +113 -0
- package/dist/resources/extensions/gsd/worktree-state-projection.js +33 -4
- package/dist/resources/extensions/gsd/worktree-telemetry.js +12 -0
- package/dist/resources/extensions/gsd/worktree.js +8 -1
- package/dist/resources/extensions/mcp-client/manager.js +9 -4
- package/dist/resources/extensions/search-the-web/index.js +41 -9
- package/dist/resources/extensions/search-the-web/native-search.js +23 -7
- package/dist/resources/extensions/shared/browser-contract.js +59 -0
- package/dist/resources/extensions/shared/gsd-browser-cli.js +156 -8
- package/dist/resources/extensions/shared/interview-ui.js +2 -2
- package/dist/resources/extensions/subagent/index.js +20 -15
- package/dist/resources/extensions/subagent/worktree-cwd.js +31 -0
- package/dist/resources/shared/claude-runtime-floor.js +182 -0
- package/dist/resources/shared/gsd-browser-path-sync.js +214 -0
- package/dist/resources/shared/package-manager-detection.js +1 -1
- package/dist/resources/shared/package.json +3 -0
- package/dist/resources/skills/create-skill/SKILL.md +3 -0
- package/dist/resources/skills/create-skill/references/executable-code.md +1 -1
- package/dist/resources/skills/create-skill/references/skill-structure.md +1 -0
- package/dist/resources/skills/create-skill/workflows/add-reference.md +8 -3
- package/dist/resources/skills/create-skill/workflows/add-script.md +4 -2
- package/dist/resources/skills/create-skill/workflows/add-template.md +3 -1
- package/dist/resources/skills/create-skill/workflows/add-workflow.md +8 -3
- package/dist/resources/skills/create-skill/workflows/upgrade-to-router.md +10 -5
- package/dist/resources/skills/create-skill/workflows/verify-skill.md +9 -4
- package/dist/resources/skills/spike-wrap-up/SKILL.md +9 -9
- package/dist/runtime-checks.d.ts +10 -0
- package/dist/runtime-checks.js +27 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -0
- package/dist/update-check.d.ts +2 -0
- package/dist/update-check.js +39 -5
- package/dist/update-cmd.js +40 -3
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +14 -14
- package/dist/web/standalone/.next/build-manifest.json +4 -4
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +8 -8
- package/dist/web/standalone/.next/required-server-files.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/mcp-connections/route.js +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/mcp-connections/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +14 -14
- package/dist/web/standalone/.next/server/chunks/1128.js +2 -0
- package/dist/web/standalone/.next/server/chunks/2842.js +4 -4
- package/dist/web/standalone/.next/server/chunks/5124.js +1 -1
- package/dist/web/standalone/.next/server/chunks/8357.js +3 -3
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware.js +3 -3
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/2659.b7b129ee6a769448.js +1 -0
- package/dist/web/standalone/.next/static/chunks/2772.bfa657f49f955239.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{3616.4113d484a994e411.js → 3616.3c60753b8ffcbd2e.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/4283.8e446784528ed9dc.js +2 -0
- package/dist/web/standalone/.next/static/chunks/5826.a46ecdd1cfe8dabc.js +1 -0
- package/dist/web/standalone/.next/static/chunks/796.3976108148518f7d.js +10 -0
- package/dist/web/standalone/.next/static/chunks/8785.481aa5869991b760.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/_not-found/page-a6fb1847f67f167c.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/{layout-b35cbfff38aaf4cf.js → layout-4ae2d68984392bbf.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-6644fc6ee8ca1247.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{main-app-590a74400e35f685.js → main-app-90d1d8d5e5d2dc6b.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-1115d46ac61b9823.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-dda80a1ef5587410.js → webpack-7c1d97e39be2da11.js} +1 -1
- package/dist/web/standalone/node_modules/@gsd/native/package.json +1 -1
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
- package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
- package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
- package/dist/web/standalone/node_modules/postcss/lib/container.js +26 -18
- package/dist/web/standalone/node_modules/postcss/lib/css-syntax-error.js +47 -14
- package/dist/web/standalone/node_modules/postcss/lib/declaration.js +4 -4
- package/dist/web/standalone/node_modules/postcss/lib/fromJSON.js +3 -3
- package/dist/web/standalone/node_modules/postcss/lib/input.js +54 -29
- package/dist/web/standalone/node_modules/postcss/lib/lazy-result.js +47 -37
- package/dist/web/standalone/node_modules/postcss/lib/map-generator.js +26 -9
- package/dist/web/standalone/node_modules/postcss/lib/no-work-result.js +57 -55
- package/dist/web/standalone/node_modules/postcss/lib/node.js +99 -31
- package/dist/web/standalone/node_modules/postcss/lib/parse.js +1 -1
- package/dist/web/standalone/node_modules/postcss/lib/parser.js +10 -9
- package/dist/web/standalone/node_modules/postcss/lib/postcss.js +12 -12
- package/dist/web/standalone/node_modules/postcss/lib/previous-map.js +30 -11
- package/dist/web/standalone/node_modules/postcss/lib/processor.js +7 -7
- package/dist/web/standalone/node_modules/postcss/lib/result.js +5 -5
- package/dist/web/standalone/node_modules/postcss/lib/rule.js +6 -6
- package/dist/web/standalone/node_modules/postcss/lib/stringifier.js +69 -28
- package/dist/web/standalone/node_modules/postcss/lib/tokenize.js +6 -2
- package/dist/web/standalone/node_modules/postcss/package.json +48 -48
- package/dist/web/standalone/package.json +1 -1
- package/dist/web/standalone/server.js +1 -1
- package/dist/web-mode.d.ts +5 -1
- package/dist/web-mode.js +27 -13
- package/dist/worktree-cli.js +3 -6
- package/dist/worktree-status-banner.js +7 -11
- package/integrations/hermes/README.md +48 -0
- package/integrations/hermes/docs/setup.md +272 -0
- package/integrations/hermes/docs/upstream-hermes-pr.md +40 -0
- package/integrations/hermes/open_gsd_hermes/__init__.py +105 -0
- package/integrations/hermes/open_gsd_hermes/binding.py +107 -0
- package/integrations/hermes/open_gsd_hermes/commands.py +186 -0
- package/integrations/hermes/open_gsd_hermes/config.py +59 -0
- package/integrations/hermes/open_gsd_hermes/credentials.py +51 -0
- package/integrations/hermes/open_gsd_hermes/cron.py +85 -0
- package/integrations/hermes/open_gsd_hermes/formatting.py +13 -0
- package/integrations/hermes/open_gsd_hermes/gsd_client.py +269 -0
- package/integrations/hermes/open_gsd_hermes/inject.py +31 -0
- package/integrations/hermes/open_gsd_hermes/memory.py +66 -0
- package/integrations/hermes/open_gsd_hermes/notifications.py +71 -0
- package/integrations/hermes/open_gsd_hermes/snapshot.py +42 -0
- package/integrations/hermes/open_gsd_hermes/supervisor.py +180 -0
- package/integrations/hermes/open_gsd_hermes/types.py +100 -0
- package/integrations/hermes/plugin.yaml +38 -0
- package/integrations/hermes/pyproject.toml +32 -0
- package/integrations/hermes/scripts/preflight.sh +92 -0
- package/integrations/hermes/tests/fixtures/minimal-project/.gsd/STATE.md +17 -0
- package/integrations/hermes/tests/golden/memory_prefetch.txt +5 -0
- package/integrations/hermes/tests/golden/snapshot.txt +8 -0
- package/integrations/hermes/tests/test_binding.py +103 -0
- package/integrations/hermes/tests/test_config.py +36 -0
- package/integrations/hermes/tests/test_cron.py +34 -0
- package/integrations/hermes/tests/test_gsd_client_cache.py +120 -0
- package/integrations/hermes/tests/test_memory.py +59 -0
- package/integrations/hermes/tests/test_read_cli_contract.py +50 -0
- package/integrations/hermes/tests/test_register.py +56 -0
- package/integrations/hermes/tests/test_snapshot.py +53 -0
- package/integrations/hermes/tests/test_supervisor_fsm.py +581 -0
- package/package.json +19 -14
- package/packages/cloud-mcp-gateway/dist/runtime-registry.d.ts +8 -0
- package/packages/cloud-mcp-gateway/dist/runtime-registry.d.ts.map +1 -1
- package/packages/cloud-mcp-gateway/dist/runtime-registry.js +19 -2
- package/packages/cloud-mcp-gateway/dist/runtime-registry.js.map +1 -1
- package/packages/cloud-mcp-gateway/dist/runtime-registry.test.js +71 -2
- package/packages/cloud-mcp-gateway/dist/runtime-registry.test.js.map +1 -1
- package/packages/cloud-mcp-gateway/package.json +2 -2
- package/packages/contracts/dist/rpc.d.ts +1 -0
- package/packages/contracts/dist/rpc.d.ts.map +1 -1
- package/packages/contracts/dist/rpc.js.map +1 -1
- package/packages/contracts/dist/workflow.d.ts +5 -0
- package/packages/contracts/dist/workflow.d.ts.map +1 -1
- package/packages/contracts/dist/workflow.js +2 -0
- package/packages/contracts/dist/workflow.js.map +1 -1
- 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/dist/session/agent-session-extensions.d.ts +2 -0
- package/packages/gsd-agent-core/dist/session/agent-session-extensions.d.ts.map +1 -1
- package/packages/gsd-agent-core/dist/session/agent-session-extensions.js +14 -0
- package/packages/gsd-agent-core/dist/session/agent-session-extensions.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 +16 -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 +93 -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 +157 -56
- 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 +13 -1
- 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 +14 -6
- 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 +31 -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-auth.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-selectors-auth.js +4 -4
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-selectors-auth.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 +6 -1
- 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 +23 -4
- package/packages/mcp-server/dist/cli-errors.d.ts +11 -0
- package/packages/mcp-server/dist/cli-errors.d.ts.map +1 -1
- package/packages/mcp-server/dist/cli-errors.js +12 -0
- package/packages/mcp-server/dist/cli-errors.js.map +1 -1
- 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 +170 -0
- package/packages/mcp-server/dist/cli-runner.js.map +1 -0
- package/packages/mcp-server/dist/cli.d.ts +1 -0
- package/packages/mcp-server/dist/cli.d.ts.map +1 -1
- package/packages/mcp-server/dist/cli.js +3 -50
- package/packages/mcp-server/dist/cli.js.map +1 -1
- package/packages/mcp-server/dist/moonshot-tool-schema.d.ts +29 -0
- package/packages/mcp-server/dist/moonshot-tool-schema.d.ts.map +1 -0
- package/packages/mcp-server/dist/moonshot-tool-schema.js +50 -0
- package/packages/mcp-server/dist/moonshot-tool-schema.js.map +1 -0
- 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/server.d.ts +40 -1
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +97 -6
- package/packages/mcp-server/dist/server.js.map +1 -1
- 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 +62 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +243 -123
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +21 -4
- 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/dist/harness/env/nodejs.d.ts +1 -0
- package/packages/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/harness/env/nodejs.js +34 -3
- package/packages/pi-agent-core/dist/harness/env/nodejs.js.map +1 -1
- package/packages/pi-agent-core/dist/index.d.ts +1 -0
- package/packages/pi-agent-core/dist/index.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/index.js +3 -0
- package/packages/pi-agent-core/dist/index.js.map +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-ai/README.md +1 -0
- package/packages/pi-ai/dist/index.d.ts +2 -0
- package/packages/pi-ai/dist/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/index.js +2 -0
- package/packages/pi-ai/dist/index.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.d.ts +183 -76
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +205 -124
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +12 -7
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/google-shared.d.ts +5 -0
- package/packages/pi-ai/dist/providers/google-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/google-shared.js +12 -3
- package/packages/pi-ai/dist/providers/google-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +7 -3
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/dist/utils/moonshot-tool-schema.d.ts +9 -0
- package/packages/pi-ai/dist/utils/moonshot-tool-schema.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/moonshot-tool-schema.js +34 -0
- package/packages/pi-ai/dist/utils/moonshot-tool-schema.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js +6 -2
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
- package/packages/pi-ai/package.json +3 -2
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +2 -2
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js +19 -13
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/capability-patches.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/capability-patches.js +3 -1
- package/packages/pi-coding-agent/dist/core/capability-patches.js.map +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/provider-readiness.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/provider-readiness.js +13 -6
- package/packages/pi-coding-agent/dist/core/provider-readiness.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/core/tools/bash.d.ts +11 -0
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.js +53 -11
- package/packages/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts +2 -2
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/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/dist/utils/shell.d.ts +28 -2
- package/packages/pi-coding-agent/dist/utils/shell.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/utils/shell.js +56 -10
- package/packages/pi-coding-agent/dist/utils/shell.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 +2 -2
- 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/keys.d.ts.map +1 -1
- package/packages/pi-tui/dist/keys.js +39 -30
- package/packages/pi-tui/dist/keys.js.map +1 -1
- package/packages/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
- package/packages/pi-tui/dist/stdin-buffer.js +22 -0
- package/packages/pi-tui/dist/stdin-buffer.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 +115 -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/scripts/install/deps.js +10 -0
- package/scripts/link-workspace-packages.cjs +7 -40
- package/src/resources/GSD-WORKFLOW.md +27 -26
- package/src/resources/extensions/ask-user-questions.ts +94 -26
- package/src/resources/extensions/async-jobs/async-bash-cancel.test.ts +360 -0
- package/src/resources/extensions/async-jobs/async-bash-tool.ts +33 -56
- package/src/resources/extensions/async-jobs/await-tool.test.ts +139 -0
- package/src/resources/extensions/async-jobs/await-tool.ts +82 -12
- package/src/resources/extensions/async-jobs/index.ts +79 -0
- package/src/resources/extensions/async-jobs/job-manager.ts +21 -1
- package/src/resources/extensions/bg-shell/bg-shell-command.ts +6 -6
- package/src/resources/extensions/bg-shell/bg-shell-tool.ts +10 -6
- package/src/resources/extensions/bg-shell/overlay.ts +9 -5
- package/src/resources/extensions/bg-shell/process-manager.ts +50 -25
- package/src/resources/extensions/bg-shell/readiness-detector.ts +12 -0
- package/src/resources/extensions/bg-shell/tests/lifecycle-and-utilities.test.ts +48 -1
- package/src/resources/extensions/bg-shell/utilities.ts +5 -2
- package/src/resources/extensions/browser-tools/engine/managed-gsd-browser.ts +265 -98
- package/src/resources/extensions/browser-tools/engine/selection.ts +90 -4
- package/src/resources/extensions/browser-tools/index.ts +71 -13
- package/src/resources/extensions/browser-tools/tests/browser-engine-selection.test.mjs +83 -13
- package/src/resources/extensions/browser-tools/tests/gsd-browser-launch-config.test.mjs +120 -1
- package/src/resources/extensions/browser-tools/tests/managed-gsd-browser-tools.test.mjs +136 -0
- package/src/resources/extensions/claude-code-cli/index.ts +8 -1
- package/src/resources/extensions/claude-code-cli/models.ts +9 -0
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +744 -495
- package/src/resources/extensions/claude-code-cli/tests/index.test.ts +47 -0
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +1192 -7
- package/src/resources/extensions/claude-code-cli/turn-assembler.ts +324 -0
- package/src/resources/extensions/github-sync/templates.ts +3 -3
- package/src/resources/extensions/github-sync/tests/templates.test.ts +2 -2
- package/src/resources/extensions/google-cli/stream-adapter.ts +128 -20
- package/src/resources/extensions/gsd/artifact-projection.ts +31 -0
- package/src/resources/extensions/gsd/auto/closeout.ts +309 -0
- package/src/resources/extensions/gsd/auto/contracts.ts +32 -2
- package/src/resources/extensions/gsd/auto/custom-verify-retry-store.ts +21 -3
- package/src/resources/extensions/gsd/auto/detect-stuck.ts +32 -9
- package/src/resources/extensions/gsd/auto/dispatch-history.ts +186 -0
- package/src/resources/extensions/gsd/auto/dispatch-key.ts +39 -0
- 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-deps.ts +3 -1
- package/src/resources/extensions/gsd/auto/loop.ts +158 -63
- package/src/resources/extensions/gsd/auto/milestone-lease-reclaim.ts +74 -0
- package/src/resources/extensions/gsd/auto/orchestrator.ts +418 -82
- package/src/resources/extensions/gsd/auto/phase-helpers.ts +199 -0
- package/src/resources/extensions/gsd/auto/phases.ts +58 -2981
- package/src/resources/extensions/gsd/auto/pre-dispatch.ts +716 -0
- package/src/resources/extensions/gsd/auto/run-unit.ts +2 -1
- package/src/resources/extensions/gsd/auto/session.ts +7 -0
- package/src/resources/extensions/gsd/auto/unit-phase.ts +910 -0
- package/src/resources/extensions/gsd/auto/workflow-kernel.ts +25 -3
- 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-artifact-paths.ts +83 -20
- package/src/resources/extensions/gsd/auto-closeout-messaging.ts +90 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +328 -458
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +33 -50
- package/src/resources/extensions/gsd/auto-dispatch.ts +144 -98
- package/src/resources/extensions/gsd/auto-model-selection.ts +74 -15
- package/src/resources/extensions/gsd/auto-post-unit.ts +107 -46
- package/src/resources/extensions/gsd/auto-prompts.ts +314 -76
- package/src/resources/extensions/gsd/auto-recovery.ts +183 -87
- package/src/resources/extensions/gsd/auto-runtime-state.ts +39 -0
- package/src/resources/extensions/gsd/auto-start.ts +146 -88
- package/src/resources/extensions/gsd/auto-timers.ts +16 -2
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +54 -0
- package/src/resources/extensions/gsd/auto-unit-closeout.ts +83 -28
- package/src/resources/extensions/gsd/auto-unit-tool-scope.ts +21 -49
- package/src/resources/extensions/gsd/auto-verification.ts +37 -42
- package/src/resources/extensions/gsd/auto-worktree-repair.ts +13 -2
- package/src/resources/extensions/gsd/auto-worktree.ts +180 -407
- package/src/resources/extensions/gsd/auto.ts +220 -54
- package/src/resources/extensions/gsd/blocked-models.ts +49 -0
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +194 -70
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +35 -38
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +93 -49
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +4 -2
- package/src/resources/extensions/gsd/bootstrap/fallback-continuation.ts +31 -0
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +2 -2
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +46 -1
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +504 -186
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +219 -46
- package/src/resources/extensions/gsd/bootstrap/tool-call-loop-guard.ts +82 -1
- package/src/resources/extensions/gsd/bootstrap/tool-search-shim.ts +21 -3
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +586 -83
- package/src/resources/extensions/gsd/branch-patterns.ts +3 -0
- package/src/resources/extensions/gsd/browser-daemon-auto-prep.ts +108 -0
- package/src/resources/extensions/gsd/browser-evidence.ts +18 -2
- package/src/resources/extensions/gsd/captures.ts +5 -16
- package/src/resources/extensions/gsd/closeout-consistency-gate.ts +132 -6
- package/src/resources/extensions/gsd/closeout-recovery.ts +2 -1
- package/src/resources/extensions/gsd/closeout-wizard.ts +111 -0
- package/src/resources/extensions/gsd/codebase-generator.ts +1 -0
- package/src/resources/extensions/gsd/commands/catalog.ts +12 -68
- package/src/resources/extensions/gsd/commands/context.ts +16 -2
- package/src/resources/extensions/gsd/commands/dispatcher.ts +3 -0
- package/src/resources/extensions/gsd/commands/gsd-core-aliases-handler.ts +48 -0
- package/src/resources/extensions/gsd/commands/gsd-core-aliases.ts +63 -0
- package/src/resources/extensions/gsd/commands/handlers/auto.ts +3 -0
- package/src/resources/extensions/gsd/commands/handlers/core.ts +58 -8
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +230 -3
- package/src/resources/extensions/gsd/commands-cmux.ts +3 -0
- package/src/resources/extensions/gsd/commands-context.ts +18 -1
- package/src/resources/extensions/gsd/commands-gsd-core.ts +1142 -0
- package/src/resources/extensions/gsd/commands-handlers.ts +140 -4
- package/src/resources/extensions/gsd/commands-inspect.ts +7 -8
- package/src/resources/extensions/gsd/commands-maintenance.ts +172 -42
- package/src/resources/extensions/gsd/commands-mcp-status.ts +2 -2
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +27 -9
- package/src/resources/extensions/gsd/commands-ship.ts +2 -2
- package/src/resources/extensions/gsd/commands-verdict.ts +22 -4
- package/src/resources/extensions/gsd/commands-workflow-templates.ts +11 -4
- package/src/resources/extensions/gsd/commands-worktree.ts +12 -10
- package/src/resources/extensions/gsd/compat/compat-marker.ts +210 -0
- package/src/resources/extensions/gsd/compat/index.ts +12 -0
- package/src/resources/extensions/gsd/compat/planning-compat.ts +168 -0
- package/src/resources/extensions/gsd/config-overlay.ts +24 -9
- package/src/resources/extensions/gsd/consent-question.ts +441 -0
- package/src/resources/extensions/gsd/consent-verdict.ts +115 -0
- package/src/resources/extensions/gsd/constants.ts +0 -3
- package/src/resources/extensions/gsd/crash-recovery.ts +13 -11
- package/src/resources/extensions/gsd/dashboard-overlay.ts +73 -7
- package/src/resources/extensions/gsd/db/engine.ts +855 -0
- package/src/resources/extensions/gsd/db/queries.ts +676 -0
- package/src/resources/extensions/gsd/db/sql-constants.ts +12 -0
- package/src/resources/extensions/gsd/db/unit-dispatches.ts +24 -0
- package/src/resources/extensions/gsd/db/writers/cascades.ts +237 -0
- package/src/resources/extensions/gsd/db/writers/import-restore.ts +310 -0
- package/src/resources/extensions/gsd/db/writers/memory.ts +220 -0
- package/src/resources/extensions/gsd/db/writers/reconcile.ts +523 -0
- package/src/resources/extensions/gsd/db/writers/status.ts +88 -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-workspace.ts +185 -0
- package/src/resources/extensions/gsd/db-writer.ts +11 -19
- package/src/resources/extensions/gsd/delegation-policy.ts +3 -11
- package/src/resources/extensions/gsd/discussion-handoff.ts +280 -0
- package/src/resources/extensions/gsd/dispatch-guard.ts +8 -31
- package/src/resources/extensions/gsd/docs/preferences-reference.md +9 -0
- package/src/resources/extensions/gsd/doctor-engine-checks.ts +5 -4
- package/src/resources/extensions/gsd/doctor-environment.ts +272 -155
- package/src/resources/extensions/gsd/doctor-format.ts +12 -7
- package/src/resources/extensions/gsd/doctor-git-checks.ts +33 -25
- package/src/resources/extensions/gsd/doctor-providers.ts +104 -10
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +34 -42
- package/src/resources/extensions/gsd/doctor-types.ts +1 -0
- package/src/resources/extensions/gsd/doctor.ts +45 -12
- package/src/resources/extensions/gsd/engine-hook-contract.ts +79 -0
- package/src/resources/extensions/gsd/error-classifier.ts +25 -1
- package/src/resources/extensions/gsd/escalation.ts +9 -4
- package/src/resources/extensions/gsd/exec-sandbox.ts +98 -18
- package/src/resources/extensions/gsd/export-html.ts +11 -4
- package/src/resources/extensions/gsd/export.ts +88 -1
- package/src/resources/extensions/gsd/file-lock.ts +1 -1
- package/src/resources/extensions/gsd/files.ts +33 -12
- package/src/resources/extensions/gsd/flat-phase-migration.ts +205 -0
- package/src/resources/extensions/gsd/forensics.ts +4 -34
- package/src/resources/extensions/gsd/git-conflict-state.ts +17 -1
- package/src/resources/extensions/gsd/git-constants.ts +1 -1
- package/src/resources/extensions/gsd/git-service.ts +13 -7
- package/src/resources/extensions/gsd/gitignore.ts +10 -3
- package/src/resources/extensions/gsd/gsd-command-home.ts +13 -3
- package/src/resources/extensions/gsd/gsd-db.ts +189 -2380
- package/src/resources/extensions/gsd/guidance.ts +217 -0
- package/src/resources/extensions/gsd/guided-flow-queue.ts +82 -4
- package/src/resources/extensions/gsd/guided-flow.ts +250 -590
- package/src/resources/extensions/gsd/guided-unit-completion.ts +275 -0
- package/src/resources/extensions/gsd/health-widget.ts +133 -32
- package/src/resources/extensions/gsd/layout-policy.ts +85 -0
- package/src/resources/extensions/gsd/markdown-renderer.ts +423 -106
- package/src/resources/extensions/gsd/mcp-bridge.ts +39 -0
- package/src/resources/extensions/gsd/mcp-filter.ts +63 -34
- package/src/resources/extensions/gsd/mcp-tool-name.ts +30 -0
- package/src/resources/extensions/gsd/md-importer.ts +218 -68
- package/src/resources/extensions/gsd/memory-consolidation-scanner.ts +52 -20
- package/src/resources/extensions/gsd/memory-relations.ts +1 -1
- package/src/resources/extensions/gsd/metrics.ts +23 -10
- package/src/resources/extensions/gsd/migrate/layout-detect.ts +38 -0
- package/src/resources/extensions/gsd/migrate/planning-writer.ts +259 -0
- package/src/resources/extensions/gsd/migrate/safety.ts +20 -9
- package/src/resources/extensions/gsd/migrate-external.ts +49 -6
- package/src/resources/extensions/gsd/migration-auto-check.ts +34 -18
- package/src/resources/extensions/gsd/milestone-actions.ts +5 -2
- package/src/resources/extensions/gsd/milestone-closeout-proof.ts +131 -0
- package/src/resources/extensions/gsd/milestone-closeout.ts +133 -29
- package/src/resources/extensions/gsd/milestone-ids.ts +49 -19
- package/src/resources/extensions/gsd/milestone-implementation-evidence.ts +35 -21
- package/src/resources/extensions/gsd/milestone-merge-transaction.ts +47 -0
- package/src/resources/extensions/gsd/milestone-planning-persistence.ts +232 -0
- package/src/resources/extensions/gsd/milestone-readiness.ts +125 -0
- package/src/resources/extensions/gsd/milestone-reopen-events.ts +3 -6
- package/src/resources/extensions/gsd/milestone-settlement.ts +81 -0
- package/src/resources/extensions/gsd/milestone-validation-evidence.ts +95 -0
- package/src/resources/extensions/gsd/milestone-validation-verdict.ts +78 -0
- package/src/resources/extensions/gsd/model-cost-table.ts +1 -0
- package/src/resources/extensions/gsd/model-router.ts +101 -18
- package/src/resources/extensions/gsd/native-git-bridge.ts +39 -0
- package/src/resources/extensions/gsd/notification-store.ts +43 -31
- package/src/resources/extensions/gsd/notifications.ts +50 -12
- package/src/resources/extensions/gsd/observability-validator.ts +12 -4
- package/src/resources/extensions/gsd/parallel-eligibility.ts +4 -5
- package/src/resources/extensions/gsd/parallel-merge.ts +12 -9
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +161 -38
- package/src/resources/extensions/gsd/parallel-orchestrator.ts +6 -2
- package/src/resources/extensions/gsd/parsers-legacy.ts +58 -19
- package/src/resources/extensions/gsd/paths.ts +390 -61
- package/src/resources/extensions/gsd/planning-depth.ts +2 -1
- package/src/resources/extensions/gsd/post-execution-checks.ts +43 -3
- package/src/resources/extensions/gsd/pre-execution-checks.ts +109 -3
- package/src/resources/extensions/gsd/preferences-diagnostics.ts +98 -0
- package/src/resources/extensions/gsd/preferences-models.ts +58 -59
- package/src/resources/extensions/gsd/preferences-types.ts +16 -0
- package/src/resources/extensions/gsd/preferences.ts +372 -35
- package/src/resources/extensions/gsd/projection-flush.ts +20 -0
- package/src/resources/extensions/gsd/prompts/ai-integration-phase.md +28 -0
- package/src/resources/extensions/gsd/prompts/audit-fix.md +39 -0
- package/src/resources/extensions/gsd/prompts/audit-milestone.md +26 -0
- package/src/resources/extensions/gsd/prompts/audit-uat.md +24 -0
- package/src/resources/extensions/gsd/prompts/autonomous.md +31 -0
- package/src/resources/extensions/gsd/prompts/code-review.md +37 -0
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +8 -2
- package/src/resources/extensions/gsd/prompts/complete-slice.md +25 -15
- package/src/resources/extensions/gsd/prompts/discuss-phase.md +31 -0
- package/src/resources/extensions/gsd/prompts/docs-update.md +13 -0
- package/src/resources/extensions/gsd/prompts/execute-phase.md +33 -0
- package/src/resources/extensions/gsd/prompts/execute-task.md +9 -2
- package/src/resources/extensions/gsd/prompts/explore.md +58 -0
- package/src/resources/extensions/gsd/prompts/graphify.md +27 -0
- package/src/resources/extensions/gsd/prompts/guided-discuss-project.md +3 -1
- package/src/resources/extensions/gsd/prompts/health.md +37 -0
- package/src/resources/extensions/gsd/prompts/import.md +30 -0
- package/src/resources/extensions/gsd/prompts/inbox.md +27 -0
- package/src/resources/extensions/gsd/prompts/ingest-docs.md +30 -0
- package/src/resources/extensions/gsd/prompts/manager.md +21 -0
- package/src/resources/extensions/gsd/prompts/map-codebase.md +42 -0
- package/src/resources/extensions/gsd/prompts/milestone-summary.md +27 -0
- package/src/resources/extensions/gsd/prompts/mvp-phase.md +23 -0
- package/src/resources/extensions/gsd/prompts/pause-work.md +24 -0
- package/src/resources/extensions/gsd/prompts/phase.md +22 -0
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +3 -1
- package/src/resources/extensions/gsd/prompts/plan-phase.md +34 -0
- package/src/resources/extensions/gsd/prompts/plan-review-convergence.md +34 -0
- package/src/resources/extensions/gsd/prompts/plan-slice.md +3 -2
- package/src/resources/extensions/gsd/prompts/profile-user.md +28 -0
- package/src/resources/extensions/gsd/prompts/progress.md +30 -0
- 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/reassess-roadmap.md +1 -1
- package/src/resources/extensions/gsd/prompts/refine-slice.md +3 -2
- package/src/resources/extensions/gsd/prompts/replan-slice.md +2 -2
- 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/resume-work.md +20 -0
- package/src/resources/extensions/gsd/prompts/review-backlog.md +21 -0
- package/src/resources/extensions/gsd/prompts/review.md +27 -0
- package/src/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
- package/src/resources/extensions/gsd/prompts/run-uat.md +13 -5
- package/src/resources/extensions/gsd/prompts/secure-phase.md +24 -0
- package/src/resources/extensions/gsd/prompts/settings.md +24 -0
- package/src/resources/extensions/gsd/prompts/sketch.md +59 -0
- package/src/resources/extensions/gsd/prompts/spec-phase.md +29 -0
- package/src/resources/extensions/gsd/prompts/spike.md +59 -0
- package/src/resources/extensions/gsd/prompts/stats.md +43 -0
- package/src/resources/extensions/gsd/prompts/surface.md +25 -0
- package/src/resources/extensions/gsd/prompts/system.md +6 -3
- package/src/resources/extensions/gsd/prompts/thread.md +24 -0
- package/src/resources/extensions/gsd/prompts/triage-captures.md +1 -1
- package/src/resources/extensions/gsd/prompts/ui-phase.md +29 -0
- package/src/resources/extensions/gsd/prompts/ui-review.md +29 -0
- package/src/resources/extensions/gsd/prompts/ultraplan-phase.md +24 -0
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/validate-phase.md +26 -0
- package/src/resources/extensions/gsd/prompts/verify-work.md +24 -0
- package/src/resources/extensions/gsd/prompts/workflow-start.md +2 -1
- package/src/resources/extensions/gsd/prompts/workspace.md +22 -0
- package/src/resources/extensions/gsd/prompts/workstreams.md +24 -0
- package/src/resources/extensions/gsd/provider-error-guidance.ts +36 -9
- package/src/resources/extensions/gsd/provider-payload-policy.ts +140 -0
- package/src/resources/extensions/gsd/provider-switch-observer.ts +1 -1
- package/src/resources/extensions/gsd/publication.ts +122 -0
- package/src/resources/extensions/gsd/pull-request-process.ts +41 -0
- package/src/resources/extensions/gsd/quality-gate-closure.ts +140 -0
- package/src/resources/extensions/gsd/question-transport.ts +138 -0
- package/src/resources/extensions/gsd/queue-order.ts +3 -2
- package/src/resources/extensions/gsd/quick.ts +43 -2
- package/src/resources/extensions/gsd/reactive-graph.ts +11 -1
- package/src/resources/extensions/gsd/recovery-classification.ts +54 -88
- package/src/resources/extensions/gsd/roadmap-slices.ts +37 -6
- package/src/resources/extensions/gsd/safety/content-validator.ts +2 -1
- package/src/resources/extensions/gsd/safety/destructive-confirmation.ts +134 -0
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +36 -4
- package/src/resources/extensions/gsd/safety/evidence-cross-ref.ts +52 -3
- package/src/resources/extensions/gsd/safety/file-change-validator.ts +14 -0
- package/src/resources/extensions/gsd/service-tier.ts +2 -0
- package/src/resources/extensions/gsd/session-forensics.ts +11 -1
- package/src/resources/extensions/gsd/session-lock.ts +16 -14
- package/src/resources/extensions/gsd/skill-activation.ts +3 -6
- package/src/resources/extensions/gsd/skills/gsd-headless/SKILL.md +3 -0
- package/src/resources/extensions/gsd/skills/gsd-headless/references/commands.md +51 -0
- package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +6 -2
- package/src/resources/extensions/gsd/state-reconciliation/drift/artifact-db.ts +58 -14
- package/src/resources/extensions/gsd/state-reconciliation/drift/completion.ts +22 -2
- package/src/resources/extensions/gsd/state-reconciliation/drift/external-markdown-edit.ts +105 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/external-planning-edit.ts +180 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/project-md.ts +19 -6
- package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +2 -2
- package/src/resources/extensions/gsd/state-reconciliation/drift/stale-render.ts +169 -29
- package/src/resources/extensions/gsd/state-reconciliation/index.ts +36 -3
- package/src/resources/extensions/gsd/state-reconciliation/registry.ts +12 -0
- package/src/resources/extensions/gsd/state-reconciliation/types.ts +19 -0
- package/src/resources/extensions/gsd/state-transition-matrix.ts +42 -0
- package/src/resources/extensions/gsd/state.ts +87 -41
- package/src/resources/extensions/gsd/status-guards.ts +59 -8
- package/src/resources/extensions/gsd/stop-notice.ts +75 -0
- package/src/resources/extensions/gsd/sync-lock.ts +11 -20
- package/src/resources/extensions/gsd/templates/plan.md +7 -0
- package/src/resources/extensions/gsd/templates/project.md +1 -0
- package/src/resources/extensions/gsd/templates/roadmap.md +1 -1
- package/src/resources/extensions/gsd/templates/uat.md +5 -1
- package/src/resources/extensions/gsd/tests/__fixtures__/flat-phase/.gsd/phases/01-foundation/01-01-PLAN.md +13 -0
- package/src/resources/extensions/gsd/tests/__fixtures__/flat-phase/.gsd/phases/01-foundation/01-ROADMAP.md +8 -0
- package/src/resources/extensions/gsd/tests/__fixtures__/round-trip/m001-basic/.gsd/milestones/M001/M001-ROADMAP.md +13 -0
- package/src/resources/extensions/gsd/tests/__fixtures__/round-trip/m001-basic/.gsd/milestones/M001/slices/S01/S01-PLAN.md +5 -0
- package/src/resources/extensions/gsd/tests/__fixtures__/round-trip/planning-flat-phases/.planning/PROJECT.md +1 -0
- package/src/resources/extensions/gsd/tests/__fixtures__/round-trip/planning-flat-phases/.planning/ROADMAP.md +5 -0
- package/src/resources/extensions/gsd/tests/__fixtures__/round-trip/planning-flat-phases/.planning/STATE.md +10 -0
- package/src/resources/extensions/gsd/tests/__fixtures__/round-trip/planning-flat-phases/.planning/phases/01-foundation/01-01-PLAN.md +13 -0
- package/src/resources/extensions/gsd/tests/ask-user-questions-render.test.ts +92 -0
- package/src/resources/extensions/gsd/tests/auto-abort-pause-regression.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-artifact-paths.test.ts +322 -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 +97 -117
- package/src/resources/extensions/gsd/tests/auto-direct-dispatch-parse.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +753 -26
- package/src/resources/extensions/gsd/tests/auto-migrating-recovery.test.ts +32 -1
- package/src/resources/extensions/gsd/tests/auto-milestone-target.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/auto-model-selection-tool-poisoning.test.ts +25 -2
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +107 -1
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +409 -38
- package/src/resources/extensions/gsd/tests/auto-pause-double-entry-guard.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-paused-session-validation.test.ts +11 -2
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +100 -5
- package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/auto-post-unit-evidence-crossref-4909.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +111 -1
- package/src/resources/extensions/gsd/tests/auto-remote-session-lock-cleanup.test.ts +65 -3
- package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +34 -0
- 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/auto-worktree-auto-resolve.test.ts +17 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-registry.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/auto-worktree-repair.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/blocked-models.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/blocker-placeholder-logs.test.ts +218 -0
- package/src/resources/extensions/gsd/tests/browser-automation-contract-fixture.ts +39 -0
- package/src/resources/extensions/gsd/tests/browser-contract.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/browser-daemon-auto-prep.test.ts +144 -0
- package/src/resources/extensions/gsd/tests/canonical-milestone-root.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/checkout-branch-stash-guard.test.ts +66 -1
- package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/codebase-generator.test.ts +26 -0
- package/src/resources/extensions/gsd/tests/commands-context.test.ts +26 -0
- package/src/resources/extensions/gsd/tests/commands-dispatcher-unmerged-milestone.test.ts +89 -0
- package/src/resources/extensions/gsd/tests/commands-dispatcher-validation-block.test.ts +37 -1
- package/src/resources/extensions/gsd/tests/commands-dispatcher-workspace-git.test.ts +11 -0
- package/src/resources/extensions/gsd/tests/commands-eval-review.test.ts +31 -30
- package/src/resources/extensions/gsd/tests/commands-gsd-core.test.ts +862 -0
- package/src/resources/extensions/gsd/tests/commands-verdict.test.ts +47 -9
- package/src/resources/extensions/gsd/tests/commands-worktree-clean.test.ts +80 -0
- package/src/resources/extensions/gsd/tests/compat-health-line.test.ts +102 -0
- package/src/resources/extensions/gsd/tests/compat-marker-invalidation.test.ts +51 -0
- package/src/resources/extensions/gsd/tests/compat-marker.test.ts +105 -0
- package/src/resources/extensions/gsd/tests/complete-milestone-prompt-rendering.test.ts +6 -2
- package/src/resources/extensions/gsd/tests/complete-slice-reopen-handoff.test.ts +82 -0
- package/src/resources/extensions/gsd/tests/complete-slice-verification-gate.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +18 -7
- package/src/resources/extensions/gsd/tests/complete-task-rollback-evidence.test.ts +48 -8
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +223 -12
- package/src/resources/extensions/gsd/tests/consent-question.test.ts +396 -0
- package/src/resources/extensions/gsd/tests/core-overlay-fallback.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/custom-verify-retry-store.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/dashboard-overlay.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/db-authority-regression.test.ts +1 -1
- 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 +12 -11
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +63 -1
- package/src/resources/extensions/gsd/tests/derive-state-helpers.test.ts +111 -5
- package/src/resources/extensions/gsd/tests/destructive-confirmation.test.ts +303 -0
- package/src/resources/extensions/gsd/tests/discuss-cold-start-db-open.test.ts +10 -27
- package/src/resources/extensions/gsd/tests/discuss-routing-fixes.test.ts +12 -2
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +54 -4
- package/src/resources/extensions/gsd/tests/dispatch-db-degradation-logs.test.ts +98 -0
- package/src/resources/extensions/gsd/tests/dispatch-history.test.ts +430 -0
- package/src/resources/extensions/gsd/tests/dispatch-logs.test.ts +103 -0
- package/src/resources/extensions/gsd/tests/dispatch-missing-task-plans.test.ts +38 -49
- package/src/resources/extensions/gsd/tests/dispatch-reactive-logs.test.ts +98 -0
- package/src/resources/extensions/gsd/tests/dispatch-rule-coverage.test.ts +26 -1
- package/src/resources/extensions/gsd/tests/dispatch-run-uat-browser-tools.test.ts +89 -0
- package/src/resources/extensions/gsd/tests/dist-redirect.mjs +15 -0
- package/src/resources/extensions/gsd/tests/doctor-forensics-db-open-regression.test.ts +70 -2
- package/src/resources/extensions/gsd/tests/doctor-git-checks-autoresolve.test.ts +149 -0
- package/src/resources/extensions/gsd/tests/doctor-git-checks-terminal.test.ts +73 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +113 -4
- package/src/resources/extensions/gsd/tests/doctor-scope-db-unavailable.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/dynamic-bash-no-cap.test.ts +132 -0
- package/src/resources/extensions/gsd/tests/engine-hook-contract.test.ts +148 -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/ensure-preconditions-guard-4996.test.ts +17 -10
- package/src/resources/extensions/gsd/tests/evidence-cross-ref.test.ts +95 -0
- package/src/resources/extensions/gsd/tests/evidence-xref-gsd-exec.test.ts +157 -0
- package/src/resources/extensions/gsd/tests/exec-graceful-kill.test.ts +231 -0
- package/src/resources/extensions/gsd/tests/exec-tool.test.ts +74 -2
- package/src/resources/extensions/gsd/tests/execute-task-rendering.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/export-html-enhancements.test.ts +25 -0
- package/src/resources/extensions/gsd/tests/export-memory.test.ts +179 -0
- package/src/resources/extensions/gsd/tests/extension-bootstrap-isolation.test.ts +88 -1
- package/src/resources/extensions/gsd/tests/external-markdown-edit.test.ts +137 -0
- package/src/resources/extensions/gsd/tests/external-planning-edit.test.ts +199 -0
- package/src/resources/extensions/gsd/tests/fallback-continuation.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/file-change-validator.test.ts +33 -1
- package/src/resources/extensions/gsd/tests/file-lock.test.ts +43 -0
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-no-blockers.md +1 -5
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-with-blockers.md +1 -5
- package/src/resources/extensions/gsd/tests/flat-phase-migration.test.ts +114 -0
- package/src/resources/extensions/gsd/tests/flat-phase-renderer.test.ts +83 -0
- package/src/resources/extensions/gsd/tests/flat-phase-round-trip.test.ts +72 -0
- package/src/resources/extensions/gsd/tests/flat-phase-validation-integration.test.ts +120 -0
- package/src/resources/extensions/gsd/tests/flat-phase-validation-path.test.ts +74 -0
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/forensics-error-filter.test.ts +88 -0
- package/src/resources/extensions/gsd/tests/gate-state-canonicalization.test.ts +48 -1
- package/src/resources/extensions/gsd/tests/gsd-command-home.test.ts +154 -1
- package/src/resources/extensions/gsd/tests/gsd-core-parity-routing.test.ts +183 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/guidance.test.ts +173 -0
- package/src/resources/extensions/gsd/tests/guided-discuss-milestone-prompt-rendering.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/guided-dispatch-root.test.ts +18 -6
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +268 -3
- package/src/resources/extensions/gsd/tests/integration/auto-recovery.test.ts +19 -11
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +133 -15
- package/src/resources/extensions/gsd/tests/integration/auto-worktree.test.ts +89 -59
- package/src/resources/extensions/gsd/tests/integration/commands-eval-review.integration.test.ts +6 -2
- package/src/resources/extensions/gsd/tests/integration/doctor-environment-async.test.ts +104 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +122 -3
- package/src/resources/extensions/gsd/tests/integration/gitignore-tracked-gsd.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/integration/gsd-integration-fixture.ts +80 -0
- package/src/resources/extensions/gsd/tests/integration/idle-recovery.test.ts +4 -3
- package/src/resources/extensions/gsd/tests/integration/integration-proof.test.ts +11 -7
- package/src/resources/extensions/gsd/tests/integration/merge-strategy-regular.test.ts +157 -0
- package/src/resources/extensions/gsd/tests/integration/queue-active-milestone-context-budget.test.ts +93 -0
- package/src/resources/extensions/gsd/tests/integration/quick-branch-lifecycle.test.ts +56 -9
- package/src/resources/extensions/gsd/tests/integration/run-uat.test.ts +217 -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/knowledge-cold-start.test.ts +386 -0
- package/src/resources/extensions/gsd/tests/layout-policy.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/loop.test.ts +60 -0
- package/src/resources/extensions/gsd/tests/markdown-renderer-parse-cache.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/markdown-renderer.test.ts +214 -82
- package/src/resources/extensions/gsd/tests/mcp-filter.test.ts +74 -1
- package/src/resources/extensions/gsd/tests/mcp-project-config.test.ts +3 -1
- 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/mcp-tool-name.test.ts +34 -0
- package/src/resources/extensions/gsd/tests/memory-consolidation-scanner.test.ts +78 -0
- package/src/resources/extensions/gsd/tests/metrics-ledger-cap.test.ts +239 -0
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +143 -1
- package/src/resources/extensions/gsd/tests/milestone-closeout-proof.test.ts +99 -0
- package/src/resources/extensions/gsd/tests/milestone-closeout.test.ts +125 -4
- package/src/resources/extensions/gsd/tests/milestone-merge-stash-restore.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/milestone-merge-transaction.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/milestone-readiness.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/milestone-report-path.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/milestone-settlement.test.ts +97 -0
- package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/milestone-validation-evidence.test.ts +41 -0
- package/src/resources/extensions/gsd/tests/milestone-validation-verdict.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/model-router.test.ts +343 -7
- package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +32 -1
- package/src/resources/extensions/gsd/tests/native-merge-regular.test.ts +139 -0
- package/src/resources/extensions/gsd/tests/notification-store.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/notifications.test.ts +97 -9
- package/src/resources/extensions/gsd/tests/oauth-api-model-routing.test.ts +179 -0
- package/src/resources/extensions/gsd/tests/observability-validator-boundary.test.ts +194 -0
- package/src/resources/extensions/gsd/tests/orchestrator-legacy-parity.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/orchestrator-logs.test.ts +381 -0
- package/src/resources/extensions/gsd/tests/orphaned-worktree-audit.test.ts +52 -1
- package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +91 -0
- package/src/resources/extensions/gsd/tests/parallel-research-dispatch.test.ts +44 -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 +143 -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/pipeline-variant-dispatch.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/plan-milestone-boundary-map-preservation.test.ts +7 -2
- package/src/resources/extensions/gsd/tests/plan-milestone-sketch-render.test.ts +7 -2
- package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +54 -6
- package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +58 -23
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/planning-crossval.test.ts +64 -0
- package/src/resources/extensions/gsd/tests/planning-layout-detect.test.ts +84 -0
- package/src/resources/extensions/gsd/tests/planning-marker.test.ts +107 -0
- package/src/resources/extensions/gsd/tests/planning-projection-hook.test.ts +123 -0
- package/src/resources/extensions/gsd/tests/planning-round-trip-property.test.ts +164 -0
- package/src/resources/extensions/gsd/tests/planning-writer.test.ts +82 -0
- package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +63 -2
- package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +48 -1
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +193 -1
- package/src/resources/extensions/gsd/tests/preferences-diagnostics.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +230 -1
- package/src/resources/extensions/gsd/tests/prefs-missing-models-crash.test.ts +35 -4
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +54 -1
- 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 +72 -2
- package/src/resources/extensions/gsd/tests/prompt-db.test.ts +124 -6
- package/src/resources/extensions/gsd/tests/provider-error-guidance.test.ts +18 -3
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +312 -4
- package/src/resources/extensions/gsd/tests/provider-payload-policy.test.ts +165 -0
- package/src/resources/extensions/gsd/tests/publication.test.ts +120 -0
- package/src/resources/extensions/gsd/tests/pull-request-process.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/read-uat-gate-verdict.test.ts +185 -0
- package/src/resources/extensions/gsd/tests/ready-phrase-no-files-4573.test.ts +22 -13
- package/src/resources/extensions/gsd/tests/reassess-handler.test.ts +9 -8
- package/src/resources/extensions/gsd/tests/reconcile-logs.test.ts +244 -0
- package/src/resources/extensions/gsd/tests/recovery-classification-illegal-transition.test.ts +30 -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/register-hooks-depth-verification.test.ts +508 -5
- package/src/resources/extensions/gsd/tests/remote-notification-from-desktop.test.ts +31 -81
- package/src/resources/extensions/gsd/tests/replan-handler.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/resume-missing-worktree-warning.test.ts +5 -5
- package/src/resources/extensions/gsd/tests/roadmap-parse-regression.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/roadmap-slices.test.ts +68 -0
- package/src/resources/extensions/gsd/tests/round-trip-property.test.ts +137 -0
- package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +51 -2
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/session-lock-transient-read.test.ts +28 -2
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +148 -0
- package/src/resources/extensions/gsd/tests/session-switch-clears-pending-autostart.test.ts +108 -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 +301 -41
- package/src/resources/extensions/gsd/tests/skill-activation.test.ts +20 -17
- package/src/resources/extensions/gsd/tests/stale-dirlistcache-4648.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/stale-queued-milestone.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +9 -4
- package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +231 -58
- package/src/resources/extensions/gsd/tests/state-transition-matrix.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/status-guards.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/stop-auto-race-null-unit.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/stop-backtrack.test.ts +6 -2
- package/src/resources/extensions/gsd/tests/stop-notice.test.ts +70 -0
- package/src/resources/extensions/gsd/tests/stuck-state-via-db.test.ts +85 -0
- package/src/resources/extensions/gsd/tests/sync-lock.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/system-context-message-routing.test.ts +29 -1
- package/src/resources/extensions/gsd/tests/teardown-chdir-failure-clears-registry.test.ts +17 -0
- package/src/resources/extensions/gsd/tests/terminal-tool-surface-classification.test.ts +80 -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 +80 -2
- package/src/resources/extensions/gsd/tests/tool-availability-audit.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/tool-call-loop-guard.test.ts +68 -0
- package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/tool-naming.test.ts +35 -42
- package/src/resources/extensions/gsd/tests/tool-param-optionality.test.ts +26 -0
- package/src/resources/extensions/gsd/tests/tool-schema-model-fallback.test.ts +64 -0
- package/src/resources/extensions/gsd/tests/tool-search-shim.test.ts +71 -0
- package/src/resources/extensions/gsd/tests/tool-surface-readiness.test.ts +348 -0
- package/src/resources/extensions/gsd/tests/tool-unavailable-retry.test.ts +56 -0
- package/src/resources/extensions/gsd/tests/transport-gate-double-complete.test.ts +139 -0
- 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/uat-policy.test.ts +112 -6
- package/src/resources/extensions/gsd/tests/undo.test.ts +39 -37
- package/src/resources/extensions/gsd/tests/unit-closeout.test.ts +209 -0
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +319 -6
- package/src/resources/extensions/gsd/tests/unit-registry.test.ts +163 -0
- package/src/resources/extensions/gsd/tests/unmerged-milestone-guard.test.ts +87 -0
- package/src/resources/extensions/gsd/tests/uok-audit-unified.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/uok-audit.test.ts +194 -0
- package/src/resources/extensions/gsd/tests/uok-gitops-turn-action.test.ts +72 -1
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/validate-milestone-stuck-guard.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/validate-milestone-write-order.test.ts +9 -1
- package/src/resources/extensions/gsd/tests/validation-block-guard.test.ts +130 -0
- package/src/resources/extensions/gsd/tests/validation-gate-patterns.test.ts +34 -6
- package/src/resources/extensions/gsd/tests/verification-verdict.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/verify-artifact-tightened.test.ts +156 -0
- package/src/resources/extensions/gsd/tests/visualizer-data.test.ts +87 -0
- package/src/resources/extensions/gsd/tests/visualizer-views.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/web-app-uat.test.ts +193 -0
- package/src/resources/extensions/gsd/tests/workflow-events.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/workflow-kernel.test.ts +51 -0
- package/src/resources/extensions/gsd/tests/workflow-mcp-preflight.test.ts +133 -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 +227 -21
- package/src/resources/extensions/gsd/tests/workflow-phase-contract-matrix.test.ts +332 -0
- package/src/resources/extensions/gsd/tests/workflow-projections.test.ts +3 -4
- 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/workflow-tool-executors.test.ts +339 -48
- package/src/resources/extensions/gsd/tests/workspace-git-preflight.test.ts +166 -2
- package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-health.test.ts +43 -3
- package/src/resources/extensions/gsd/tests/worktree-lifecycle.test.ts +41 -4
- package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +105 -1
- package/src/resources/extensions/gsd/tests/worktree-placement.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/worktree-project-root-degrade.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-projection-writers.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-reentry.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 +114 -19
- package/src/resources/extensions/gsd/tests/worktree-symlink-removal.test.ts +12 -6
- package/src/resources/extensions/gsd/tests/worktree-teardown-safety.test.ts +24 -2
- package/src/resources/extensions/gsd/tests/worktree-telemetry.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/tests/write-gate-planning-unit.test.ts +4 -1
- package/src/resources/extensions/gsd/tests/write-gate-seam.test.ts +358 -0
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +291 -1
- package/src/resources/extensions/gsd/tool-contract.ts +124 -11
- package/src/resources/extensions/gsd/tool-presentation-plan.ts +18 -35
- package/src/resources/extensions/gsd/tool-surface-readiness.ts +393 -0
- package/src/resources/extensions/gsd/tool-surface-snapshot.ts +47 -0
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +7 -9
- package/src/resources/extensions/gsd/tools/complete-slice.ts +85 -80
- package/src/resources/extensions/gsd/tools/complete-task.ts +186 -14
- package/src/resources/extensions/gsd/tools/exec-tool.ts +13 -124
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +19 -160
- package/src/resources/extensions/gsd/tools/plan-slice.ts +13 -9
- package/src/resources/extensions/gsd/tools/plan-task.ts +19 -3
- package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +54 -12
- package/src/resources/extensions/gsd/tools/reopen-milestone.ts +13 -40
- package/src/resources/extensions/gsd/tools/reopen-slice.ts +16 -44
- 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/tools/skip-slice.ts +18 -44
- package/src/resources/extensions/gsd/tools/validate-milestone.ts +26 -90
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +123 -5
- package/src/resources/extensions/gsd/triage-resolution.ts +14 -7
- package/src/resources/extensions/gsd/tui/render-kit.ts +56 -13
- package/src/resources/extensions/gsd/uat-policy.ts +80 -25
- package/src/resources/extensions/gsd/uat-run.ts +10 -14
- package/src/resources/extensions/gsd/undo.ts +17 -17
- package/src/resources/extensions/gsd/unit-closeout.ts +201 -0
- package/src/resources/extensions/gsd/unit-context-composer.ts +222 -21
- package/src/resources/extensions/gsd/unit-context-manifest.ts +4 -28
- package/src/resources/extensions/gsd/unit-registry.ts +488 -0
- package/src/resources/extensions/gsd/unit-runtime.ts +3 -2
- package/src/resources/extensions/gsd/unit-tool-contracts.ts +27 -191
- package/src/resources/extensions/gsd/unmerged-milestone-guard.ts +101 -6
- package/src/resources/extensions/gsd/validation-block-guard.ts +60 -6
- package/src/resources/extensions/gsd/verdict-parser.ts +1 -1
- package/src/resources/extensions/gsd/verification-verdict.ts +4 -2
- package/src/resources/extensions/gsd/visualizer-data.ts +55 -0
- package/src/resources/extensions/gsd/visualizer-views.ts +27 -2
- package/src/resources/extensions/gsd/web-app-uat.ts +144 -0
- 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-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/workflow-mcp.ts +34 -111
- package/src/resources/extensions/gsd/workflow-projections.ts +24 -4
- package/src/resources/extensions/gsd/workflow-reconcile.ts +32 -65
- package/src/resources/extensions/gsd/workflow-tool-surface.ts +76 -0
- package/src/resources/extensions/gsd/workspace-git-guard.ts +1 -0
- package/src/resources/extensions/gsd/workspace-git-preflight.ts +31 -0
- package/src/resources/extensions/gsd/worktree-command.ts +6 -6
- package/src/resources/extensions/gsd/worktree-git-recovery.ts +314 -0
- package/src/resources/extensions/gsd/worktree-health.ts +6 -3
- package/src/resources/extensions/gsd/worktree-lifecycle.ts +20 -25
- package/src/resources/extensions/gsd/worktree-manager.ts +175 -45
- package/src/resources/extensions/gsd/worktree-placement.ts +63 -0
- package/src/resources/extensions/gsd/worktree-reentry.ts +10 -7
- package/src/resources/extensions/gsd/worktree-root.ts +29 -6
- package/src/resources/extensions/gsd/worktree-safety.ts +73 -48
- package/src/resources/extensions/gsd/worktree-session-state.ts +11 -11
- package/src/resources/extensions/gsd/worktree-shell-guard.ts +123 -0
- package/src/resources/extensions/gsd/worktree-state-projection.ts +55 -7
- package/src/resources/extensions/gsd/worktree-telemetry.ts +16 -0
- package/src/resources/extensions/gsd/worktree.ts +7 -1
- package/src/resources/extensions/mcp-client/manager.ts +10 -4
- package/src/resources/extensions/search-the-web/index.ts +45 -9
- package/src/resources/extensions/search-the-web/native-search.ts +21 -7
- package/src/resources/extensions/shared/browser-contract.ts +66 -0
- package/src/resources/extensions/shared/gsd-browser-cli.ts +182 -8
- package/src/resources/extensions/shared/interview-ui.ts +15 -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/shared/claude-runtime-floor.ts +248 -0
- package/src/resources/shared/gsd-browser-path-sync.ts +273 -0
- package/src/resources/shared/package-manager-detection.ts +1 -1
- package/src/resources/shared/package.json +3 -0
- package/src/resources/skills/create-skill/SKILL.md +3 -0
- package/src/resources/skills/create-skill/references/executable-code.md +1 -1
- package/src/resources/skills/create-skill/references/skill-structure.md +1 -0
- package/src/resources/skills/create-skill/workflows/add-reference.md +8 -3
- package/src/resources/skills/create-skill/workflows/add-script.md +4 -2
- package/src/resources/skills/create-skill/workflows/add-template.md +3 -1
- package/src/resources/skills/create-skill/workflows/add-workflow.md +8 -3
- package/src/resources/skills/create-skill/workflows/upgrade-to-router.md +10 -5
- package/src/resources/skills/create-skill/workflows/verify-skill.md +9 -4
- package/src/resources/skills/spike-wrap-up/SKILL.md +9 -9
- package/dist/resources/extensions/gsd/user-input-boundary.js +0 -195
- package/dist/resources/skills/gsd-browser/SKILL.md +0 -41
- package/dist/web/standalone/.next/server/chunks/5047.js +0 -2
- package/dist/web/standalone/.next/static/chunks/2659.feb6499ca863ebfc.js +0 -1
- package/dist/web/standalone/.next/static/chunks/2772.151789db0edea835.js +0 -1
- package/dist/web/standalone/.next/static/chunks/4283.10a065467b5340d8.js +0 -2
- package/dist/web/standalone/.next/static/chunks/5826.960dc4634cc9b0d3.js +0 -1
- package/dist/web/standalone/.next/static/chunks/796.46f811c0fac23aab.js +0 -10
- package/dist/web/standalone/.next/static/chunks/8785.d32f7a61f55c1600.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/_not-found/page-49f565245e1e4afe.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/page-a48b7c48333b31c8.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ec3eaffc9785ba48.js +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/gsd-widget-prototype.d.ts +0 -21
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/gsd-widget-prototype.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/gsd-widget-prototype.js +0 -213
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/gsd-widget-prototype.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/transcript-density-prototype.d.ts +0 -28
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/transcript-density-prototype.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/transcript-density-prototype.js +0 -249
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/transcript-density-prototype.js.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/transcript-design-prototype.d.ts +0 -19
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/transcript-design-prototype.d.ts.map +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/transcript-design-prototype.js +0 -797
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/transcript-design-prototype.js.map +0 -1
- package/scripts/ensure-workspace-builds.cjs +0 -129
- package/src/resources/extensions/gsd/tests/user-input-boundary.test.ts +0 -88
- package/src/resources/extensions/gsd/user-input-boundary.ts +0 -198
- package/src/resources/skills/gsd-browser/SKILL.md +0 -41
- /package/dist/web/standalone/.next/static/{TA5o9SHAnCdK6Umm1MYxb → SzEuqWX37DR9MEpEuQjP1}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{TA5o9SHAnCdK6Umm1MYxb → SzEuqWX37DR9MEpEuQjP1}/_ssgManifest.js +0 -0
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
// gsd-pi - Claude Code stream adapter regression tests
|
|
2
2
|
import { describe, test } from "node:test";
|
|
3
|
+
import { clearGuidedUnitContext, setGuidedUnitContext } from "../../gsd/guided-unit-context.ts";
|
|
3
4
|
import assert from "node:assert/strict";
|
|
4
5
|
import { existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { createRequire } from "node:module";
|
|
5
7
|
import { join, resolve } from "node:path";
|
|
6
8
|
import { tmpdir } from "node:os";
|
|
9
|
+
import { pathToFileURL } from "node:url";
|
|
7
10
|
import {
|
|
11
|
+
streamViaClaudeCode,
|
|
8
12
|
makeStreamExhaustedErrorMessage,
|
|
9
13
|
isClaudeCodeAbortErrorMessage,
|
|
10
14
|
resolveClaudeCodeAbortedMessageText,
|
|
@@ -35,9 +39,22 @@ import {
|
|
|
35
39
|
roundResultToElicitationContent,
|
|
36
40
|
autoInitClaudeCodeWorkflowMcp,
|
|
37
41
|
inferGsdPhaseFromContext,
|
|
42
|
+
resolveGsdPhaseForSdk,
|
|
43
|
+
resolveClaudeCodeToolSurfaceReadinessError,
|
|
44
|
+
resolveClaudeCodeToolSurfaceReadinessRetryDelayMs,
|
|
45
|
+
shouldRetryClaudeCodeToolSurfaceReadiness,
|
|
46
|
+
buildWorkflowMcpReadinessProgressMessage,
|
|
47
|
+
pushWorkflowMcpReadinessProgressEvent,
|
|
48
|
+
resolveWorkflowMcpPreflightServerConfig,
|
|
38
49
|
} from "../stream-adapter.ts";
|
|
50
|
+
import { CLAUDE_CODE_MODELS } from "../models.ts";
|
|
39
51
|
import type { AssistantMessage, Context, Message } from "@gsd/pi-ai";
|
|
40
52
|
import type { SDKUserMessage } from "../sdk-types.ts";
|
|
53
|
+
import { _setAutoActiveForTest } from "../../gsd/auto.ts";
|
|
54
|
+
import { autoSession } from "../../gsd/auto-runtime-state.ts";
|
|
55
|
+
import { getInFlightToolCount, hasInteractiveToolInFlight, clearInFlightTools, isInteractiveElicitationInFlight } from "../../gsd/auto-tool-tracking.ts";
|
|
56
|
+
import { clearMcpConfigCache } from "../../mcp-client/manager.ts";
|
|
57
|
+
import { UNIT_TOOL_CONTRACTS } from "../../gsd/unit-tool-contracts.ts";
|
|
41
58
|
|
|
42
59
|
// ---------------------------------------------------------------------------
|
|
43
60
|
// Env helpers — `GSD_WORKFLOW_MCP_*` save/restore
|
|
@@ -58,6 +75,7 @@ const WORKFLOW_MCP_ENV_KEYS = [
|
|
|
58
75
|
"GSD_WORKFLOW_MCP_ARGS",
|
|
59
76
|
"GSD_WORKFLOW_MCP_ENV",
|
|
60
77
|
"GSD_WORKFLOW_MCP_CWD",
|
|
78
|
+
"GSD_WORKFLOW_MCP_STRUCTURED_QUESTIONS",
|
|
61
79
|
"GSD_PROJECT_ROOT",
|
|
62
80
|
"GSD_WORKFLOW_PROJECT_ROOT",
|
|
63
81
|
] as const;
|
|
@@ -352,6 +370,120 @@ describe("stream-adapter — image prompt forwarding (#4183)", () => {
|
|
|
352
370
|
parent_tool_use_id: null,
|
|
353
371
|
});
|
|
354
372
|
});
|
|
373
|
+
|
|
374
|
+
test("buildSdkQueryPrompt image iterable can be consumed for each SDK retry", async () => {
|
|
375
|
+
const context: Context = {
|
|
376
|
+
messages: [
|
|
377
|
+
{
|
|
378
|
+
role: "user",
|
|
379
|
+
content: [
|
|
380
|
+
{ type: "image", data: "ZmFrZQ==", mimeType: "image/jpeg" },
|
|
381
|
+
{ type: "text", text: "Retry with this image." },
|
|
382
|
+
],
|
|
383
|
+
} as Message,
|
|
384
|
+
],
|
|
385
|
+
};
|
|
386
|
+
const textPrompt = buildPromptFromContext(context);
|
|
387
|
+
const prompt = buildSdkQueryPrompt(context, textPrompt);
|
|
388
|
+
|
|
389
|
+
const firstAttempt = [];
|
|
390
|
+
for await (const item of prompt as AsyncIterable<any>) {
|
|
391
|
+
firstAttempt.push(item);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const retryAttempt = [];
|
|
395
|
+
for await (const item of prompt as AsyncIterable<any>) {
|
|
396
|
+
retryAttempt.push(item);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
assert.equal(firstAttempt.length, 1);
|
|
400
|
+
assert.deepEqual(retryAttempt, firstAttempt);
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
test("SDK readiness retries do not leak partial content into the next attempt", async () => {
|
|
404
|
+
let queryCalls = 0;
|
|
405
|
+
const cwd = mkdtempSync(join(tmpdir(), "claude-sdk-retry-state-"));
|
|
406
|
+
const context: Context = {
|
|
407
|
+
systemPrompt: "UNIT: Run UAT",
|
|
408
|
+
messages: [{ role: "user", content: "Run UAT." } as Message],
|
|
409
|
+
};
|
|
410
|
+
// The test requires a resolved GSD phase so the readiness gate fires.
|
|
411
|
+
// Auto-mode with a currentUnit provides the authoritative phase signal.
|
|
412
|
+
_setAutoActiveForTest(true);
|
|
413
|
+
autoSession.currentUnit = { type: "run-uat", id: "M001/S001", startedAt: 0, workspaceRoot: cwd } as never;
|
|
414
|
+
try {
|
|
415
|
+
const stream = streamViaClaudeCode(
|
|
416
|
+
{ id: "claude-sonnet-4-6" } as any,
|
|
417
|
+
context,
|
|
418
|
+
{
|
|
419
|
+
cwd,
|
|
420
|
+
_skipWorkflowMcpPreflightForTest: true,
|
|
421
|
+
async *_sdkQueryForTest() {
|
|
422
|
+
queryCalls += 1;
|
|
423
|
+
if (queryCalls === 1) {
|
|
424
|
+
yield {
|
|
425
|
+
type: "stream_event",
|
|
426
|
+
event: { type: "message_start", message: { model: "claude-sonnet-4-6" } },
|
|
427
|
+
parent_tool_use_id: null,
|
|
428
|
+
uuid: "partial-1",
|
|
429
|
+
session_id: "session-1",
|
|
430
|
+
};
|
|
431
|
+
yield {
|
|
432
|
+
type: "stream_event",
|
|
433
|
+
event: { type: "content_block_start", index: 0, content_block: { type: "text", text: "" } },
|
|
434
|
+
parent_tool_use_id: null,
|
|
435
|
+
uuid: "partial-1",
|
|
436
|
+
session_id: "session-1",
|
|
437
|
+
};
|
|
438
|
+
yield {
|
|
439
|
+
type: "stream_event",
|
|
440
|
+
event: { type: "content_block_delta", index: 0, delta: { type: "text_delta", text: "stale retry text" } },
|
|
441
|
+
parent_tool_use_id: null,
|
|
442
|
+
uuid: "partial-1",
|
|
443
|
+
session_id: "session-1",
|
|
444
|
+
};
|
|
445
|
+
yield {
|
|
446
|
+
type: "system",
|
|
447
|
+
subtype: "init",
|
|
448
|
+
tools: ["Read"],
|
|
449
|
+
mcp_servers: [{ name: "gsd-workflow", status: "connected" }],
|
|
450
|
+
};
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
yield {
|
|
455
|
+
type: "result",
|
|
456
|
+
subtype: "success",
|
|
457
|
+
uuid: "result-2",
|
|
458
|
+
session_id: "session-2",
|
|
459
|
+
duration_ms: 1,
|
|
460
|
+
duration_api_ms: 1,
|
|
461
|
+
is_error: false,
|
|
462
|
+
num_turns: 1,
|
|
463
|
+
result: "fresh retry result",
|
|
464
|
+
stop_reason: "end_turn",
|
|
465
|
+
total_cost_usd: 0,
|
|
466
|
+
usage: {
|
|
467
|
+
input_tokens: 0,
|
|
468
|
+
output_tokens: 0,
|
|
469
|
+
cache_read_input_tokens: 0,
|
|
470
|
+
cache_creation_input_tokens: 0,
|
|
471
|
+
},
|
|
472
|
+
};
|
|
473
|
+
},
|
|
474
|
+
} as any,
|
|
475
|
+
);
|
|
476
|
+
|
|
477
|
+
const message = await stream.result();
|
|
478
|
+
|
|
479
|
+
assert.equal(queryCalls, 2);
|
|
480
|
+
assert.deepEqual(message.content, [{ type: "text", text: "fresh retry result" }]);
|
|
481
|
+
} finally {
|
|
482
|
+
autoSession.currentUnit = null;
|
|
483
|
+
_setAutoActiveForTest(false);
|
|
484
|
+
rmSync(cwd, { recursive: true, force: true });
|
|
485
|
+
}
|
|
486
|
+
});
|
|
355
487
|
});
|
|
356
488
|
|
|
357
489
|
// ---------------------------------------------------------------------------
|
|
@@ -457,6 +589,33 @@ describe("stream-adapter — no transcript fabrication (#4102)", () => {
|
|
|
457
589
|
assert.ok(!prompt.includes("mcp__gsd-workflow__<tool_name>"));
|
|
458
590
|
});
|
|
459
591
|
|
|
592
|
+
test("buildPromptFromContext remaps structured user input to the workflow MCP question tool", () => {
|
|
593
|
+
const context: Context = {
|
|
594
|
+
systemPrompt: "Use ask_user_questions for structured user input.",
|
|
595
|
+
messages: [{ role: "user", content: "Ask the user what comes next" } as Message],
|
|
596
|
+
};
|
|
597
|
+
|
|
598
|
+
const prompt = buildPromptFromContext(context, { workflowMcpServerName: "gsd-workflow" });
|
|
599
|
+
|
|
600
|
+
assert.ok(prompt.includes("mcp__gsd-workflow__ask_user_questions"));
|
|
601
|
+
assert.ok(prompt.includes("Do not call bare ask_user_questions"));
|
|
602
|
+
assert.ok(prompt.includes("Do not call native AskUserQuestion"));
|
|
603
|
+
});
|
|
604
|
+
|
|
605
|
+
test("buildPromptFromContext allows ToolSearch only for deferred workflow MCP hydration", () => {
|
|
606
|
+
const context: Context = {
|
|
607
|
+
messages: [{ role: "user", content: "Plan the slice" } as Message],
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
const prompt = buildPromptFromContext(context, { workflowMcpServerName: "gsd-workflow" });
|
|
611
|
+
|
|
612
|
+
assert.ok(prompt.includes("ToolSearch is available only for Claude Code deferred workflow MCP hydration"));
|
|
613
|
+
assert.ok(prompt.includes("use ToolSearch with select:mcp__gsd-workflow__<tool_name> or the base tool name"));
|
|
614
|
+
assert.ok(prompt.includes("then call the returned MCP tool directly"));
|
|
615
|
+
assert.ok(prompt.includes("Do not use ToolSearch for browser_* tools or general discovery"));
|
|
616
|
+
assert.ok(!prompt.includes("ToolSearch is NOT available"));
|
|
617
|
+
});
|
|
618
|
+
|
|
460
619
|
test("buildPromptFromContext does not advertise workflow MCP tools when unavailable", () => {
|
|
461
620
|
const context: Context = {
|
|
462
621
|
messages: [{ role: "user", content: "Check status" } as Message],
|
|
@@ -756,6 +915,91 @@ describe("stream-adapter — Claude Code external tool results", () => {
|
|
|
756
915
|
assert.deepEqual(finalContent[1], { type: "text", text: "All done." });
|
|
757
916
|
});
|
|
758
917
|
|
|
918
|
+
test("buildFinalAssistantContent suppresses duplicate empty MCP tool-unavailable failures after same-turn success", () => {
|
|
919
|
+
const finalContent = buildFinalAssistantContent({
|
|
920
|
+
intermediateToolBlocks: [
|
|
921
|
+
{
|
|
922
|
+
type: "toolCall",
|
|
923
|
+
id: "tool-empty-uat",
|
|
924
|
+
name: "gsd_uat_exec",
|
|
925
|
+
arguments: {},
|
|
926
|
+
mcpServer: "gsd-workflow",
|
|
927
|
+
} as any,
|
|
928
|
+
{
|
|
929
|
+
type: "toolCall",
|
|
930
|
+
id: "tool-real-uat",
|
|
931
|
+
name: "gsd_uat_exec",
|
|
932
|
+
arguments: {
|
|
933
|
+
milestoneId: "M004",
|
|
934
|
+
sliceId: "S01",
|
|
935
|
+
checkId: "S01-UAT-01-smoke",
|
|
936
|
+
intent: "uat-runtime-check",
|
|
937
|
+
script: "npx playwright test e2e/priority.spec.js --reporter=line",
|
|
938
|
+
},
|
|
939
|
+
mcpServer: "gsd-workflow",
|
|
940
|
+
} as any,
|
|
941
|
+
],
|
|
942
|
+
pendingContent: [{ type: "text", text: "UAT S01 complete." }],
|
|
943
|
+
toolResultsById: new Map([
|
|
944
|
+
[
|
|
945
|
+
"tool-empty-uat",
|
|
946
|
+
{
|
|
947
|
+
content: [{
|
|
948
|
+
type: "text",
|
|
949
|
+
text: "<tool_use_error>Error: No such tool available: mcp__gsd-workflow__gsd_uat_exec</tool_use_error>",
|
|
950
|
+
}],
|
|
951
|
+
isError: true,
|
|
952
|
+
},
|
|
953
|
+
],
|
|
954
|
+
[
|
|
955
|
+
"tool-real-uat",
|
|
956
|
+
{
|
|
957
|
+
content: [{ type: "text", text: "{\"operation\":\"gsd_uat_exec\",\"exit_code\":0}" }],
|
|
958
|
+
isError: false,
|
|
959
|
+
},
|
|
960
|
+
],
|
|
961
|
+
]),
|
|
962
|
+
});
|
|
963
|
+
|
|
964
|
+
assert.equal(finalContent.length, 2);
|
|
965
|
+
assert.equal((finalContent[0] as any).id, "tool-real-uat");
|
|
966
|
+
assert.deepEqual((finalContent[0] as any).externalResult, {
|
|
967
|
+
content: [{ type: "text", text: "{\"operation\":\"gsd_uat_exec\",\"exit_code\":0}" }],
|
|
968
|
+
isError: false,
|
|
969
|
+
});
|
|
970
|
+
assert.deepEqual(finalContent[1], { type: "text", text: "UAT S01 complete." });
|
|
971
|
+
});
|
|
972
|
+
|
|
973
|
+
test("buildFinalAssistantContent keeps lone MCP tool-unavailable failures", () => {
|
|
974
|
+
const finalContent = buildFinalAssistantContent({
|
|
975
|
+
intermediateToolBlocks: [
|
|
976
|
+
{
|
|
977
|
+
type: "toolCall",
|
|
978
|
+
id: "tool-empty-uat",
|
|
979
|
+
name: "gsd_uat_exec",
|
|
980
|
+
arguments: {},
|
|
981
|
+
mcpServer: "gsd-workflow",
|
|
982
|
+
} as any,
|
|
983
|
+
],
|
|
984
|
+
toolResultsById: new Map([
|
|
985
|
+
[
|
|
986
|
+
"tool-empty-uat",
|
|
987
|
+
{
|
|
988
|
+
content: [{
|
|
989
|
+
type: "text",
|
|
990
|
+
text: "<tool_use_error>Error: No such tool available: mcp__gsd-workflow__gsd_uat_exec</tool_use_error>",
|
|
991
|
+
}],
|
|
992
|
+
isError: true,
|
|
993
|
+
},
|
|
994
|
+
],
|
|
995
|
+
]),
|
|
996
|
+
});
|
|
997
|
+
|
|
998
|
+
assert.equal(finalContent.length, 1);
|
|
999
|
+
assert.equal((finalContent[0] as any).id, "tool-empty-uat");
|
|
1000
|
+
assert.equal((finalContent[0] as any).externalResult.isError, true);
|
|
1001
|
+
});
|
|
1002
|
+
|
|
759
1003
|
test("buildFinalAssistantContent keeps final-turn tool calls when result arrives without a synthetic user boundary", () => {
|
|
760
1004
|
const finalContent = buildFinalAssistantContent({
|
|
761
1005
|
intermediateToolBlocks: [],
|
|
@@ -790,6 +1034,33 @@ describe("stream-adapter — Claude Code external tool results", () => {
|
|
|
790
1034
|
});
|
|
791
1035
|
});
|
|
792
1036
|
|
|
1037
|
+
describe("claude-code-cli — Claude Fable 5 Opus-tier support", () => {
|
|
1038
|
+
test("Fable 5 is exposed in the Claude Code model picker list", () => {
|
|
1039
|
+
const fable = CLAUDE_CODE_MODELS.find((m) => m.id === "claude-fable-5");
|
|
1040
|
+
assert.ok(fable, "claude-fable-5 must appear in CLAUDE_CODE_MODELS");
|
|
1041
|
+
assert.equal(fable!.reasoning, true);
|
|
1042
|
+
assert.equal(fable!.contextWindow, 1_000_000);
|
|
1043
|
+
assert.equal(fable!.maxTokens, 128_000);
|
|
1044
|
+
});
|
|
1045
|
+
|
|
1046
|
+
test("Fable 5 gets Opus-tier gates: xhigh effort, adaptive thinking, 1M-context beta", () => {
|
|
1047
|
+
const options = buildSdkOptions("claude-fable-5", "test prompt", undefined, { reasoning: "xhigh" });
|
|
1048
|
+
assert.equal(options.effort, "xhigh", "xhigh must pass through natively for Fable 5");
|
|
1049
|
+
assert.deepEqual(options.thinking, { type: "adaptive" }, "Fable 5 must use adaptive thinking");
|
|
1050
|
+
assert.ok(
|
|
1051
|
+
Array.isArray(options.betas) && (options.betas as string[]).includes("context-1m-2025-08-07"),
|
|
1052
|
+
"Fable 5 must enable the 1M-context beta",
|
|
1053
|
+
);
|
|
1054
|
+
});
|
|
1055
|
+
|
|
1056
|
+
test("non-Opus models do not receive Fable 5's Opus-tier gates", () => {
|
|
1057
|
+
// Failure/contrast path: Haiku supports adaptive thinking but is not xhigh/1M-tier.
|
|
1058
|
+
const options = buildSdkOptions("claude-haiku-4-5", "test prompt", undefined, { reasoning: "xhigh" });
|
|
1059
|
+
assert.equal(options.effort, "high", "xhigh must clamp to high for non-Opus-tier models");
|
|
1060
|
+
assert.deepEqual(options.betas, [], "Haiku must not enable the 1M-context beta");
|
|
1061
|
+
});
|
|
1062
|
+
});
|
|
1063
|
+
|
|
793
1064
|
describe("stream-adapter — session persistence (#2859)", () => {
|
|
794
1065
|
test("buildSdkOptions enables persistSession by default", () => {
|
|
795
1066
|
const options = buildSdkOptions("claude-sonnet-4-20250514", "test prompt");
|
|
@@ -1022,7 +1293,7 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
1022
1293
|
assert.equal(srv.env.GSD_CLI_PATH, "/tmp/gsd");
|
|
1023
1294
|
assert.equal(srv.env.GSD_PERSIST_WRITE_GATE_STATE, "1");
|
|
1024
1295
|
assert.equal(srv.env.GSD_WORKFLOW_PROJECT_ROOT, "/tmp/project");
|
|
1025
|
-
assert.deepEqual(options.disallowedTools, ["
|
|
1296
|
+
assert.deepEqual(options.disallowedTools, ["AskUserQuestion"]);
|
|
1026
1297
|
assert.deepEqual(options.allowedTools, [
|
|
1027
1298
|
"Read",
|
|
1028
1299
|
"Write",
|
|
@@ -1043,6 +1314,31 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
1043
1314
|
}
|
|
1044
1315
|
});
|
|
1045
1316
|
|
|
1317
|
+
test("buildSdkOptions can disable workflow MCP ask_user_questions explicitly", () => {
|
|
1318
|
+
const restore = setWorkflowMcpEnv({
|
|
1319
|
+
GSD_WORKFLOW_MCP_COMMAND: "node",
|
|
1320
|
+
GSD_WORKFLOW_MCP_NAME: "gsd-workflow",
|
|
1321
|
+
GSD_WORKFLOW_MCP_ARGS: JSON.stringify(["packages/mcp-server/dist/cli.js"]),
|
|
1322
|
+
GSD_WORKFLOW_MCP_CWD: "/tmp/project",
|
|
1323
|
+
GSD_WORKFLOW_MCP_STRUCTURED_QUESTIONS: "0",
|
|
1324
|
+
});
|
|
1325
|
+
const originalCwd = process.cwd();
|
|
1326
|
+
const emptyDir = mkdtempSync(join(tmpdir(), "claude-mcp-ask-disabled-"));
|
|
1327
|
+
try {
|
|
1328
|
+
process.chdir(emptyDir);
|
|
1329
|
+
const options = buildSdkOptions("claude-sonnet-4-20250514", "test");
|
|
1330
|
+
assert.ok(
|
|
1331
|
+
(options.disallowedTools as string[]).includes("mcp__gsd-workflow__ask_user_questions"),
|
|
1332
|
+
"explicit opt-out must block the MCP question tool even when workflow wildcard is allowed",
|
|
1333
|
+
);
|
|
1334
|
+
assert.ok((options.disallowedTools as string[]).includes("AskUserQuestion"));
|
|
1335
|
+
} finally {
|
|
1336
|
+
process.chdir(originalCwd);
|
|
1337
|
+
rmSync(emptyDir, { recursive: true, force: true });
|
|
1338
|
+
restore();
|
|
1339
|
+
}
|
|
1340
|
+
});
|
|
1341
|
+
|
|
1046
1342
|
test("buildSdkOptions scopes run-uat to exact workflow MCP tools", () => {
|
|
1047
1343
|
const restore = setWorkflowMcpEnv({
|
|
1048
1344
|
GSD_WORKFLOW_MCP_COMMAND: "node",
|
|
@@ -1117,8 +1413,8 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
1117
1413
|
"plan-milestone must expose exact milestone status helper before ToolSearch is needed",
|
|
1118
1414
|
);
|
|
1119
1415
|
assert.ok(
|
|
1120
|
-
allowedTools.includes("mcp__gsd-workflow__*"),
|
|
1121
|
-
"
|
|
1416
|
+
!allowedTools.includes("mcp__gsd-workflow__*"),
|
|
1417
|
+
"strict GSD phases must not rely on a workflow wildcard that can mask missing exact tools",
|
|
1122
1418
|
);
|
|
1123
1419
|
assert.ok((options.disallowedTools as string[]).includes("AskUserQuestion"));
|
|
1124
1420
|
assert.equal(options.strictMcpConfig, true);
|
|
@@ -1130,6 +1426,121 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
1130
1426
|
}
|
|
1131
1427
|
});
|
|
1132
1428
|
|
|
1429
|
+
test("buildSdkOptions leaves ToolSearch available for complete-milestone workflow MCP hydration", () => {
|
|
1430
|
+
const restore = setWorkflowMcpEnv({
|
|
1431
|
+
GSD_WORKFLOW_MCP_COMMAND: "node",
|
|
1432
|
+
GSD_WORKFLOW_MCP_NAME: "gsd-workflow",
|
|
1433
|
+
GSD_WORKFLOW_MCP_ARGS: JSON.stringify(["packages/mcp-server/dist/cli.js"]),
|
|
1434
|
+
GSD_WORKFLOW_MCP_ENV: JSON.stringify({ GSD_CLI_PATH: "/tmp/gsd" }),
|
|
1435
|
+
GSD_WORKFLOW_MCP_CWD: "/tmp/project",
|
|
1436
|
+
});
|
|
1437
|
+
const originalCwd = process.cwd();
|
|
1438
|
+
const emptyDir = mkdtempSync(join(tmpdir(), "claude-mcp-complete-milestone-"));
|
|
1439
|
+
try {
|
|
1440
|
+
process.chdir(emptyDir);
|
|
1441
|
+
const options = buildSdkOptions("claude-sonnet-4-20250514", "test", undefined, { gsdPhase: "complete-milestone" });
|
|
1442
|
+
const disallowedTools = options.disallowedTools as string[];
|
|
1443
|
+
|
|
1444
|
+
assert.ok(!disallowedTools.includes("ToolSearch"));
|
|
1445
|
+
assert.ok(disallowedTools.includes("Skill"));
|
|
1446
|
+
assert.ok(disallowedTools.includes("AskUserQuestion"));
|
|
1447
|
+
assert.equal(options.strictMcpConfig, true);
|
|
1448
|
+
} finally {
|
|
1449
|
+
process.chdir(originalCwd);
|
|
1450
|
+
rmSync(emptyDir, { recursive: true, force: true });
|
|
1451
|
+
restore();
|
|
1452
|
+
}
|
|
1453
|
+
});
|
|
1454
|
+
|
|
1455
|
+
test("buildSdkOptions scopes complete-slice away from native write and shell tools", () => {
|
|
1456
|
+
const restore = setWorkflowMcpEnv({
|
|
1457
|
+
GSD_WORKFLOW_MCP_COMMAND: "node",
|
|
1458
|
+
GSD_WORKFLOW_MCP_NAME: "gsd-workflow",
|
|
1459
|
+
GSD_WORKFLOW_MCP_ARGS: JSON.stringify(["packages/mcp-server/dist/cli.js"]),
|
|
1460
|
+
GSD_WORKFLOW_MCP_ENV: JSON.stringify({ GSD_CLI_PATH: "/tmp/gsd" }),
|
|
1461
|
+
GSD_WORKFLOW_MCP_CWD: "/tmp/project",
|
|
1462
|
+
});
|
|
1463
|
+
const originalCwd = process.cwd();
|
|
1464
|
+
const emptyDir = mkdtempSync(join(tmpdir(), "claude-mcp-complete-slice-"));
|
|
1465
|
+
try {
|
|
1466
|
+
process.chdir(emptyDir);
|
|
1467
|
+
const options = buildSdkOptions("claude-sonnet-4-20250514", "test", undefined, { gsdPhase: "complete-slice" });
|
|
1468
|
+
const allowedTools = options.allowedTools as string[];
|
|
1469
|
+
|
|
1470
|
+
assert.ok(allowedTools.includes("Read"));
|
|
1471
|
+
assert.ok(allowedTools.includes("Glob"));
|
|
1472
|
+
assert.ok(allowedTools.includes("Grep"));
|
|
1473
|
+
assert.ok(allowedTools.includes("mcp__gsd-workflow__gsd_exec"));
|
|
1474
|
+
assert.ok(allowedTools.includes("mcp__gsd-workflow__gsd_slice_complete"));
|
|
1475
|
+
assert.ok(!allowedTools.includes("Bash"));
|
|
1476
|
+
assert.ok(!allowedTools.includes("Write"));
|
|
1477
|
+
assert.ok(!allowedTools.includes("Edit"));
|
|
1478
|
+
assert.ok(!allowedTools.includes("mcp__gsd-workflow__*"));
|
|
1479
|
+
} finally {
|
|
1480
|
+
process.chdir(originalCwd);
|
|
1481
|
+
rmSync(emptyDir, { recursive: true, force: true });
|
|
1482
|
+
restore();
|
|
1483
|
+
}
|
|
1484
|
+
});
|
|
1485
|
+
|
|
1486
|
+
test("buildSdkOptions blocks native Skill tool during GSD phases", () => {
|
|
1487
|
+
const restore = setWorkflowMcpEnv({
|
|
1488
|
+
GSD_WORKFLOW_MCP_COMMAND: "node",
|
|
1489
|
+
GSD_WORKFLOW_MCP_NAME: "gsd-workflow",
|
|
1490
|
+
GSD_WORKFLOW_MCP_ARGS: JSON.stringify(["packages/mcp-server/dist/cli.js"]),
|
|
1491
|
+
GSD_WORKFLOW_MCP_ENV: JSON.stringify({ GSD_CLI_PATH: "/tmp/gsd" }),
|
|
1492
|
+
GSD_WORKFLOW_MCP_CWD: "/tmp/project",
|
|
1493
|
+
});
|
|
1494
|
+
const originalCwd = process.cwd();
|
|
1495
|
+
const emptyDir = mkdtempSync(join(tmpdir(), "claude-mcp-no-native-skill-"));
|
|
1496
|
+
try {
|
|
1497
|
+
process.chdir(emptyDir);
|
|
1498
|
+
const options = buildSdkOptions("claude-sonnet-4-20250514", "test", undefined, { gsdPhase: "complete-slice" });
|
|
1499
|
+
const allowedTools = options.allowedTools as string[];
|
|
1500
|
+
const disallowedTools = options.disallowedTools as string[];
|
|
1501
|
+
|
|
1502
|
+
assert.ok(!allowedTools.includes("Skill"));
|
|
1503
|
+
assert.ok(disallowedTools.includes("Skill"));
|
|
1504
|
+
} finally {
|
|
1505
|
+
process.chdir(originalCwd);
|
|
1506
|
+
rmSync(emptyDir, { recursive: true, force: true });
|
|
1507
|
+
restore();
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1510
|
+
|
|
1511
|
+
test("buildSdkOptions presents every unit's required workflow MCP tools", () => {
|
|
1512
|
+
const restore = setWorkflowMcpEnv({
|
|
1513
|
+
GSD_WORKFLOW_MCP_COMMAND: "node",
|
|
1514
|
+
GSD_WORKFLOW_MCP_NAME: "gsd-workflow",
|
|
1515
|
+
GSD_WORKFLOW_MCP_ARGS: JSON.stringify(["packages/mcp-server/dist/cli.js"]),
|
|
1516
|
+
GSD_WORKFLOW_MCP_CWD: "/tmp/project",
|
|
1517
|
+
});
|
|
1518
|
+
const originalCwd = process.cwd();
|
|
1519
|
+
const emptyDir = mkdtempSync(join(tmpdir(), "claude-mcp-all-units-"));
|
|
1520
|
+
try {
|
|
1521
|
+
process.chdir(emptyDir);
|
|
1522
|
+
for (const [unitType, contract] of Object.entries(UNIT_TOOL_CONTRACTS)) {
|
|
1523
|
+
const requiredTools = contract.requiredWorkflowTools.filter(
|
|
1524
|
+
(tool) => tool.startsWith("gsd_") || tool === "ask_user_questions",
|
|
1525
|
+
);
|
|
1526
|
+
if (requiredTools.length === 0) continue;
|
|
1527
|
+
|
|
1528
|
+
const options = buildSdkOptions("claude-sonnet-4-20250514", "test", undefined, { gsdPhase: unitType });
|
|
1529
|
+
const allowedTools = options.allowedTools as string[];
|
|
1530
|
+
for (const toolName of requiredTools) {
|
|
1531
|
+
assert.ok(
|
|
1532
|
+
allowedTools.includes(`mcp__gsd-workflow__${toolName}`) || allowedTools.includes("mcp__gsd-workflow__*"),
|
|
1533
|
+
`${unitType} must allow ${toolName}; allowed=${JSON.stringify(allowedTools)}`,
|
|
1534
|
+
);
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
} finally {
|
|
1538
|
+
process.chdir(originalCwd);
|
|
1539
|
+
rmSync(emptyDir, { recursive: true, force: true });
|
|
1540
|
+
restore();
|
|
1541
|
+
}
|
|
1542
|
+
});
|
|
1543
|
+
|
|
1133
1544
|
test("inferGsdPhaseFromContext recognizes non-UAT unit prompts", () => {
|
|
1134
1545
|
const context = {
|
|
1135
1546
|
messages: [
|
|
@@ -1140,6 +1551,165 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
1140
1551
|
assert.equal(inferGsdPhaseFromContext(context), "plan-milestone");
|
|
1141
1552
|
});
|
|
1142
1553
|
|
|
1554
|
+
test("inferGsdPhaseFromContext recognizes the refine-slice UNIT header", () => {
|
|
1555
|
+
const refineSlice = {
|
|
1556
|
+
messages: [{ role: "user", content: "## UNIT: Refine Slice S001 (\"Auth\") - Milestone M001" }],
|
|
1557
|
+
} as Context;
|
|
1558
|
+
|
|
1559
|
+
assert.equal(inferGsdPhaseFromContext(refineSlice), "refine-slice");
|
|
1560
|
+
});
|
|
1561
|
+
|
|
1562
|
+
test("inferGsdPhaseFromContext ignores bare phase slugs and prose (only the UNIT header counts)", () => {
|
|
1563
|
+
// Prose mentioning a phase must NOT classify the turn — this was the leak
|
|
1564
|
+
// that stripped tools the moment a user said "slice" or "UAT".
|
|
1565
|
+
const prose = {
|
|
1566
|
+
messages: [{ role: "user", content: "Can you discuss the slice S001 and then run UAT for me?" }],
|
|
1567
|
+
} as Context;
|
|
1568
|
+
const bareSlug = {
|
|
1569
|
+
messages: [{ role: "user", content: "I edited e2e/m039-s05-comparison-legibility.spec.ts (plan-slice, run-uat)" }],
|
|
1570
|
+
} as Context;
|
|
1571
|
+
|
|
1572
|
+
assert.equal(inferGsdPhaseFromContext(prose), undefined);
|
|
1573
|
+
assert.equal(inferGsdPhaseFromContext(bareSlug), undefined);
|
|
1574
|
+
});
|
|
1575
|
+
|
|
1576
|
+
test("inferGsdPhaseFromContext does not match a UNIT header buried in scrollback", () => {
|
|
1577
|
+
// A UNIT header from a prior turn (e.g. a SUMMARY the agent read) must not
|
|
1578
|
+
// re-classify later ad-hoc turns. Only the system prompt + latest user
|
|
1579
|
+
// message are scanned.
|
|
1580
|
+
const context = {
|
|
1581
|
+
messages: [
|
|
1582
|
+
{ role: "user", content: "## UNIT: Run UAT — M001/S001" },
|
|
1583
|
+
{ role: "assistant", content: "Done." },
|
|
1584
|
+
{ role: "user", content: "Thanks, now what files changed?" },
|
|
1585
|
+
],
|
|
1586
|
+
} as Context;
|
|
1587
|
+
|
|
1588
|
+
assert.equal(inferGsdPhaseFromContext(context), undefined);
|
|
1589
|
+
});
|
|
1590
|
+
|
|
1591
|
+
test("resolveGsdPhaseForSdk prefers guided unit context over prompt inference", () => {
|
|
1592
|
+
const projectRoot = "/tmp/gsd-guided-phase-project";
|
|
1593
|
+
clearGuidedUnitContext();
|
|
1594
|
+
setGuidedUnitContext(projectRoot, "discuss-slice");
|
|
1595
|
+
try {
|
|
1596
|
+
const context = {
|
|
1597
|
+
messages: [{ role: "user", content: "Generic workflow task with no phase slug." }],
|
|
1598
|
+
} as Context;
|
|
1599
|
+
assert.equal(resolveGsdPhaseForSdk(context, projectRoot), "discuss-slice");
|
|
1600
|
+
} finally {
|
|
1601
|
+
clearGuidedUnitContext(projectRoot);
|
|
1602
|
+
}
|
|
1603
|
+
});
|
|
1604
|
+
|
|
1605
|
+
test("resolveGsdPhaseForSdk matches guided context across milestone worktrees", () => {
|
|
1606
|
+
const projectRoot = "/tmp/gsd-guided-phase-root";
|
|
1607
|
+
const worktreeRoot = `${projectRoot}/.gsd/worktrees/m001-wt`;
|
|
1608
|
+
clearGuidedUnitContext();
|
|
1609
|
+
setGuidedUnitContext(worktreeRoot, "refine-slice");
|
|
1610
|
+
try {
|
|
1611
|
+
const context = { messages: [{ role: "user", content: "No UNIT header here." }] } as Context;
|
|
1612
|
+
assert.equal(resolveGsdPhaseForSdk(context, projectRoot), "refine-slice");
|
|
1613
|
+
} finally {
|
|
1614
|
+
clearGuidedUnitContext(worktreeRoot);
|
|
1615
|
+
}
|
|
1616
|
+
});
|
|
1617
|
+
|
|
1618
|
+
test("resolveGsdPhaseForSdk returns undefined for ad-hoc turns (no guided context, auto inactive)", () => {
|
|
1619
|
+
// The core bug: an ad-hoc turn must keep the full tool surface even when
|
|
1620
|
+
// its text contains a UNIT header (e.g. pasted from a prior unit). No
|
|
1621
|
+
// guided context + auto inactive => no phase, no preflight, no stripping.
|
|
1622
|
+
clearGuidedUnitContext();
|
|
1623
|
+
_setAutoActiveForTest(false);
|
|
1624
|
+
try {
|
|
1625
|
+
const context = {
|
|
1626
|
+
messages: [{ role: "user", content: "## UNIT: Run UAT — M001/S001 (pasted from earlier)" }],
|
|
1627
|
+
} as Context;
|
|
1628
|
+
assert.equal(resolveGsdPhaseForSdk(context, "/tmp/unrelated-project"), undefined);
|
|
1629
|
+
} finally {
|
|
1630
|
+
_setAutoActiveForTest(false);
|
|
1631
|
+
}
|
|
1632
|
+
});
|
|
1633
|
+
|
|
1634
|
+
test("resolveGsdPhaseForSdk uses the authoritative auto currentUnit, even with no UNIT header in the prompt", () => {
|
|
1635
|
+
// gate-evaluate / validate-milestone dispatch prompts have no `UNIT:`
|
|
1636
|
+
// header, so header inference alone would drop their phase (and their
|
|
1637
|
+
// workflow-MCP preflight). The dispatched unit type is authoritative.
|
|
1638
|
+
clearGuidedUnitContext();
|
|
1639
|
+
_setAutoActiveForTest(true);
|
|
1640
|
+
autoSession.currentUnit = { type: "gate-evaluate", id: "M001/S001", startedAt: 0, workspaceRoot: "/tmp/p" } as never;
|
|
1641
|
+
try {
|
|
1642
|
+
const context = {
|
|
1643
|
+
messages: [{ role: "user", content: "Quality Gate Evaluation — Parallel Dispatch. Call gsd_save_gate_result." }],
|
|
1644
|
+
} as Context;
|
|
1645
|
+
assert.equal(resolveGsdPhaseForSdk(context, "/tmp/p"), "gate-evaluate");
|
|
1646
|
+
} finally {
|
|
1647
|
+
autoSession.currentUnit = null;
|
|
1648
|
+
_setAutoActiveForTest(false);
|
|
1649
|
+
}
|
|
1650
|
+
});
|
|
1651
|
+
|
|
1652
|
+
test("resolveGsdPhaseForSdk ignores hook/* pseudo-units from currentUnit", () => {
|
|
1653
|
+
clearGuidedUnitContext();
|
|
1654
|
+
_setAutoActiveForTest(true);
|
|
1655
|
+
autoSession.currentUnit = { type: "hook/agent-end", id: "x", startedAt: 0, workspaceRoot: "/tmp/p" } as never;
|
|
1656
|
+
try {
|
|
1657
|
+
const context = { messages: [{ role: "user", content: "no phase here" }] } as Context;
|
|
1658
|
+
assert.equal(resolveGsdPhaseForSdk(context, "/tmp/p"), undefined);
|
|
1659
|
+
} finally {
|
|
1660
|
+
autoSession.currentUnit = null;
|
|
1661
|
+
_setAutoActiveForTest(false);
|
|
1662
|
+
}
|
|
1663
|
+
});
|
|
1664
|
+
|
|
1665
|
+
test("resolveGsdPhaseForSdk infers from the UNIT header only while auto-mode is active and no currentUnit is recorded", () => {
|
|
1666
|
+
// Last-resort fallback: auto running but currentUnit unexpectedly absent.
|
|
1667
|
+
// Classifies from the `UNIT:` dispatch header only.
|
|
1668
|
+
clearGuidedUnitContext();
|
|
1669
|
+
_setAutoActiveForTest(true);
|
|
1670
|
+
autoSession.currentUnit = null;
|
|
1671
|
+
try {
|
|
1672
|
+
const context = {
|
|
1673
|
+
messages: [{ role: "user", content: "## UNIT: Run UAT — M001/S001" }],
|
|
1674
|
+
} as Context;
|
|
1675
|
+
assert.equal(resolveGsdPhaseForSdk(context, "/tmp/unrelated-project"), "run-uat");
|
|
1676
|
+
} finally {
|
|
1677
|
+
_setAutoActiveForTest(false);
|
|
1678
|
+
}
|
|
1679
|
+
});
|
|
1680
|
+
|
|
1681
|
+
test("buildSdkOptions presents ask_user_questions for discuss phases", () => {
|
|
1682
|
+
const restore = setWorkflowMcpEnv({
|
|
1683
|
+
GSD_WORKFLOW_MCP_COMMAND: "node",
|
|
1684
|
+
GSD_WORKFLOW_MCP_NAME: "gsd-workflow",
|
|
1685
|
+
GSD_WORKFLOW_MCP_ARGS: JSON.stringify(["packages/mcp-server/dist/cli.js"]),
|
|
1686
|
+
GSD_WORKFLOW_MCP_ENV: JSON.stringify({ GSD_CLI_PATH: "/tmp/gsd" }),
|
|
1687
|
+
GSD_WORKFLOW_MCP_CWD: "/tmp/project",
|
|
1688
|
+
});
|
|
1689
|
+
const originalCwd = process.cwd();
|
|
1690
|
+
const emptyDir = mkdtempSync(join(tmpdir(), "claude-mcp-discuss-"));
|
|
1691
|
+
try {
|
|
1692
|
+
process.chdir(emptyDir);
|
|
1693
|
+
const options = buildSdkOptions("claude-sonnet-4-20250514", "test", undefined, { gsdPhase: "discuss-milestone" });
|
|
1694
|
+
const allowedTools = options.allowedTools as string[];
|
|
1695
|
+
const disallowedTools = options.disallowedTools as string[];
|
|
1696
|
+
|
|
1697
|
+
assert.ok(
|
|
1698
|
+
allowedTools.includes("mcp__gsd-workflow__ask_user_questions"),
|
|
1699
|
+
"discuss phases must expose the exact workflow MCP question tool",
|
|
1700
|
+
);
|
|
1701
|
+
assert.ok(disallowedTools.includes("AskUserQuestion"));
|
|
1702
|
+
assert.ok(
|
|
1703
|
+
!disallowedTools.includes("mcp__gsd-workflow__ask_user_questions"),
|
|
1704
|
+
"workflow MCP ask_user_questions should remain enabled by default",
|
|
1705
|
+
);
|
|
1706
|
+
} finally {
|
|
1707
|
+
process.chdir(originalCwd);
|
|
1708
|
+
rmSync(emptyDir, { recursive: true, force: true });
|
|
1709
|
+
restore();
|
|
1710
|
+
}
|
|
1711
|
+
});
|
|
1712
|
+
|
|
1143
1713
|
test("buildSdkOptions prefers custom workflow MCP question tools over native AskUserQuestion", () => {
|
|
1144
1714
|
const restore = setWorkflowMcpEnv({
|
|
1145
1715
|
GSD_WORKFLOW_MCP_COMMAND: "node",
|
|
@@ -1157,7 +1727,7 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
1157
1727
|
const mcpServers = options.mcpServers as Record<string, any>;
|
|
1158
1728
|
assert.ok(mcpServers?.["custom-workflow"], "expected custom workflow server config");
|
|
1159
1729
|
assert.ok(mcpServers?.["gsd-browser"], "expected gsd-browser server config");
|
|
1160
|
-
assert.deepEqual(options.disallowedTools, ["
|
|
1730
|
+
assert.deepEqual(options.disallowedTools, ["AskUserQuestion"]);
|
|
1161
1731
|
assert.deepEqual(options.allowedTools, [
|
|
1162
1732
|
"Read",
|
|
1163
1733
|
"Write",
|
|
@@ -1203,7 +1773,7 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
1203
1773
|
if (mcpServers) {
|
|
1204
1774
|
assert.ok(mcpServers["gsd-workflow"], "if present, must include gsd-workflow");
|
|
1205
1775
|
assert.ok(mcpServers["gsd-browser"], "if present, must include gsd-browser");
|
|
1206
|
-
assert.deepEqual((options as any).disallowedTools, ["
|
|
1776
|
+
assert.deepEqual((options as any).disallowedTools, ["AskUserQuestion"]);
|
|
1207
1777
|
} else {
|
|
1208
1778
|
assert.deepEqual((options as any).disallowedTools, ["ToolSearch"]);
|
|
1209
1779
|
}
|
|
@@ -1245,7 +1815,7 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
1245
1815
|
assert.equal(srv.env.GSD_CLI_PATH, "/tmp/gsd");
|
|
1246
1816
|
assert.equal(srv.env.GSD_PERSIST_WRITE_GATE_STATE, "1");
|
|
1247
1817
|
assert.equal(srv.env.GSD_WORKFLOW_PROJECT_ROOT, resolvedRepoDir);
|
|
1248
|
-
assert.deepEqual(options.disallowedTools, ["
|
|
1818
|
+
assert.deepEqual(options.disallowedTools, ["AskUserQuestion"]);
|
|
1249
1819
|
} finally {
|
|
1250
1820
|
process.chdir(originalCwd);
|
|
1251
1821
|
rmSync(repoDir, { recursive: true, force: true });
|
|
@@ -1315,7 +1885,7 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
1315
1885
|
const allowedTools = options.allowedTools as string[];
|
|
1316
1886
|
assert.ok(allowedTools.includes("mcp__gsd-workflow__gsd_plan_milestone"));
|
|
1317
1887
|
assert.ok(allowedTools.includes("mcp__gsd-workflow__gsd_milestone_status"));
|
|
1318
|
-
assert.ok(allowedTools.includes("mcp__gsd-workflow__*"));
|
|
1888
|
+
assert.ok(!allowedTools.includes("mcp__gsd-workflow__*"));
|
|
1319
1889
|
} finally {
|
|
1320
1890
|
process.chdir(originalCwd);
|
|
1321
1891
|
rmSync(projectDir, { recursive: true, force: true });
|
|
@@ -1430,6 +2000,441 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
1430
2000
|
});
|
|
1431
2001
|
});
|
|
1432
2002
|
|
|
2003
|
+
describe("stream-adapter — workflow MCP readiness", () => {
|
|
2004
|
+
test("strict slice phase prompt omits workflow MCP question guidance when allowedTools omit it", async () => {
|
|
2005
|
+
const cwd = realpathSync(mkdtempSync(join(tmpdir(), "claude-sdk-strict-question-prompt-")));
|
|
2006
|
+
const restore = setWorkflowMcpEnv({
|
|
2007
|
+
GSD_WORKFLOW_MCP_COMMAND: process.execPath,
|
|
2008
|
+
GSD_WORKFLOW_MCP_NAME: "gsd-workflow",
|
|
2009
|
+
GSD_WORKFLOW_MCP_ARGS: JSON.stringify(["-e", ""]),
|
|
2010
|
+
GSD_WORKFLOW_MCP_CWD: cwd,
|
|
2011
|
+
});
|
|
2012
|
+
const phases = [
|
|
2013
|
+
{ type: "research-slice", label: "Research Slice", expectedTool: "mcp__gsd-workflow__gsd_summary_save" },
|
|
2014
|
+
{ type: "plan-slice", label: "Plan Slice", expectedTool: "mcp__gsd-workflow__gsd_plan_slice" },
|
|
2015
|
+
{ type: "refine-slice", label: "Refine Slice", expectedTool: "mcp__gsd-workflow__gsd_plan_slice" },
|
|
2016
|
+
] as const;
|
|
2017
|
+
clearGuidedUnitContext();
|
|
2018
|
+
_setAutoActiveForTest(true);
|
|
2019
|
+
try {
|
|
2020
|
+
for (const phase of phases) {
|
|
2021
|
+
let capturedPrompt: unknown;
|
|
2022
|
+
let capturedAllowedTools: string[] | undefined;
|
|
2023
|
+
autoSession.currentUnit = { type: phase.type, id: "M001/S001", startedAt: 0, workspaceRoot: cwd } as never;
|
|
2024
|
+
const stream = streamViaClaudeCode(
|
|
2025
|
+
{ id: "claude-sonnet-4-6" } as any,
|
|
2026
|
+
{
|
|
2027
|
+
systemPrompt: `UNIT: ${phase.label}`,
|
|
2028
|
+
messages: [{ role: "user", content: "Complete the strict slice phase." } as Message],
|
|
2029
|
+
},
|
|
2030
|
+
{
|
|
2031
|
+
cwd,
|
|
2032
|
+
_skipWorkflowMcpPreflightForTest: true,
|
|
2033
|
+
async *_sdkQueryForTest(args: {
|
|
2034
|
+
prompt: string | AsyncIterable<unknown>;
|
|
2035
|
+
options?: Record<string, unknown>;
|
|
2036
|
+
}) {
|
|
2037
|
+
capturedPrompt = args.prompt;
|
|
2038
|
+
capturedAllowedTools = args.options?.allowedTools as string[] | undefined;
|
|
2039
|
+
yield {
|
|
2040
|
+
type: "result",
|
|
2041
|
+
subtype: "success",
|
|
2042
|
+
uuid: `result-${phase.type}`,
|
|
2043
|
+
session_id: `session-${phase.type}`,
|
|
2044
|
+
duration_ms: 1,
|
|
2045
|
+
duration_api_ms: 1,
|
|
2046
|
+
is_error: false,
|
|
2047
|
+
num_turns: 1,
|
|
2048
|
+
result: "completed",
|
|
2049
|
+
stop_reason: "end_turn",
|
|
2050
|
+
total_cost_usd: 0,
|
|
2051
|
+
usage: {
|
|
2052
|
+
input_tokens: 0,
|
|
2053
|
+
output_tokens: 0,
|
|
2054
|
+
cache_read_input_tokens: 0,
|
|
2055
|
+
cache_creation_input_tokens: 0,
|
|
2056
|
+
},
|
|
2057
|
+
};
|
|
2058
|
+
},
|
|
2059
|
+
} as any,
|
|
2060
|
+
);
|
|
2061
|
+
|
|
2062
|
+
await stream.result();
|
|
2063
|
+
|
|
2064
|
+
assert.equal(typeof capturedPrompt, "string", phase.type);
|
|
2065
|
+
const prompt = capturedPrompt as string;
|
|
2066
|
+
assert.ok(capturedAllowedTools?.includes(phase.expectedTool), phase.type);
|
|
2067
|
+
assert.ok(!capturedAllowedTools?.includes("mcp__gsd-workflow__ask_user_questions"), phase.type);
|
|
2068
|
+
assert.ok(!prompt.includes("mcp__gsd-workflow__ask_user_questions"), phase.type);
|
|
2069
|
+
assert.ok(!prompt.includes("Do not call bare ask_user_questions"), phase.type);
|
|
2070
|
+
assert.ok(
|
|
2071
|
+
prompt.includes("ToolSearch is available only for Claude Code deferred workflow MCP hydration"),
|
|
2072
|
+
phase.type,
|
|
2073
|
+
);
|
|
2074
|
+
}
|
|
2075
|
+
} finally {
|
|
2076
|
+
autoSession.currentUnit = null;
|
|
2077
|
+
_setAutoActiveForTest(false);
|
|
2078
|
+
restore();
|
|
2079
|
+
rmSync(cwd, { recursive: true, force: true });
|
|
2080
|
+
clearMcpConfigCache();
|
|
2081
|
+
}
|
|
2082
|
+
});
|
|
2083
|
+
|
|
2084
|
+
test("resolves the workflow MCP preflight config from SDK mcpServers", () => {
|
|
2085
|
+
const workflowConfig = { command: "node", args: ["workflow-server.js"] };
|
|
2086
|
+
const browserConfig = { command: "gsd-browser" };
|
|
2087
|
+
|
|
2088
|
+
assert.equal(
|
|
2089
|
+
resolveWorkflowMcpPreflightServerConfig(
|
|
2090
|
+
{ "gsd-workflow": workflowConfig, "gsd-browser": browserConfig },
|
|
2091
|
+
"gsd-workflow",
|
|
2092
|
+
),
|
|
2093
|
+
workflowConfig,
|
|
2094
|
+
);
|
|
2095
|
+
assert.equal(resolveWorkflowMcpPreflightServerConfig({ "gsd-workflow": "invalid" }, "gsd-workflow"), undefined);
|
|
2096
|
+
assert.equal(resolveWorkflowMcpPreflightServerConfig({ "gsd-workflow": workflowConfig }, undefined), undefined);
|
|
2097
|
+
});
|
|
2098
|
+
|
|
2099
|
+
test("workflow MCP preflight uses the same inline config passed to the SDK", async () => {
|
|
2100
|
+
const projectRoot = realpathSync(mkdtempSync(join(tmpdir(), "claude-sdk-inline-preflight-")));
|
|
2101
|
+
const restore = setWorkflowMcpEnv({});
|
|
2102
|
+
let queryCalls = 0;
|
|
2103
|
+
try {
|
|
2104
|
+
const require = createRequire(import.meta.url);
|
|
2105
|
+
const mcpModuleUrl = pathToFileURL(require.resolve("@modelcontextprotocol/sdk/server/mcp.js")).href;
|
|
2106
|
+
const stdioModuleUrl = pathToFileURL(require.resolve("@modelcontextprotocol/sdk/server/stdio.js")).href;
|
|
2107
|
+
const serverPath = join(projectRoot, "fake-workflow-mcp-server.mjs");
|
|
2108
|
+
writeFileSync(
|
|
2109
|
+
serverPath,
|
|
2110
|
+
[
|
|
2111
|
+
`const { McpServer } = await import(${JSON.stringify(mcpModuleUrl)});`,
|
|
2112
|
+
`const { StdioServerTransport } = await import(${JSON.stringify(stdioModuleUrl)});`,
|
|
2113
|
+
'const server = new McpServer({ name: "fake", version: "1.0.0" }, { capabilities: { tools: {} } });',
|
|
2114
|
+
'server.tool("gsd_plan_slice", "Plan slice", {}, async () => ({ content: [{ type: "text", text: "ok" }] }));',
|
|
2115
|
+
'server.tool("gsd_reassess_roadmap", "Reassess roadmap", {}, async () => ({ content: [{ type: "text", text: "ok" }] }));',
|
|
2116
|
+
'await server.connect(new StdioServerTransport());',
|
|
2117
|
+
].join("\n"),
|
|
2118
|
+
"utf-8",
|
|
2119
|
+
);
|
|
2120
|
+
process.env.GSD_WORKFLOW_MCP_COMMAND = process.execPath;
|
|
2121
|
+
process.env.GSD_WORKFLOW_MCP_ARGS = JSON.stringify([serverPath]);
|
|
2122
|
+
process.env.GSD_WORKFLOW_MCP_NAME = "gsd-workflow";
|
|
2123
|
+
|
|
2124
|
+
const stream = streamViaClaudeCode(
|
|
2125
|
+
{ id: "claude-sonnet-4-6" } as any,
|
|
2126
|
+
{
|
|
2127
|
+
systemPrompt: "UNIT: Plan Slice",
|
|
2128
|
+
messages: [{ role: "user", content: "Plan the next slice." } as Message],
|
|
2129
|
+
},
|
|
2130
|
+
{
|
|
2131
|
+
cwd: projectRoot,
|
|
2132
|
+
async *_sdkQueryForTest() {
|
|
2133
|
+
queryCalls += 1;
|
|
2134
|
+
yield {
|
|
2135
|
+
type: "result",
|
|
2136
|
+
subtype: "success",
|
|
2137
|
+
uuid: "result-1",
|
|
2138
|
+
session_id: "session-1",
|
|
2139
|
+
duration_ms: 1,
|
|
2140
|
+
duration_api_ms: 1,
|
|
2141
|
+
is_error: false,
|
|
2142
|
+
num_turns: 1,
|
|
2143
|
+
result: "planned",
|
|
2144
|
+
stop_reason: "end_turn",
|
|
2145
|
+
total_cost_usd: 0,
|
|
2146
|
+
usage: {
|
|
2147
|
+
input_tokens: 0,
|
|
2148
|
+
output_tokens: 0,
|
|
2149
|
+
cache_read_input_tokens: 0,
|
|
2150
|
+
cache_creation_input_tokens: 0,
|
|
2151
|
+
},
|
|
2152
|
+
};
|
|
2153
|
+
},
|
|
2154
|
+
} as any,
|
|
2155
|
+
);
|
|
2156
|
+
|
|
2157
|
+
const message = await stream.result();
|
|
2158
|
+
|
|
2159
|
+
assert.equal(queryCalls, 1);
|
|
2160
|
+
assert.deepEqual(message.content, [{ type: "text", text: "planned" }]);
|
|
2161
|
+
} finally {
|
|
2162
|
+
restore();
|
|
2163
|
+
rmSync(projectRoot, { recursive: true, force: true });
|
|
2164
|
+
clearMcpConfigCache();
|
|
2165
|
+
}
|
|
2166
|
+
});
|
|
2167
|
+
|
|
2168
|
+
test("emits visible progress text before workflow MCP readiness waits", () => {
|
|
2169
|
+
const partial: AssistantMessage = {
|
|
2170
|
+
role: "assistant",
|
|
2171
|
+
content: [],
|
|
2172
|
+
api: "anthropic-messages",
|
|
2173
|
+
provider: "claude-code",
|
|
2174
|
+
model: "claude-sonnet-4-6",
|
|
2175
|
+
usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 0, cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 } },
|
|
2176
|
+
stopReason: "stop",
|
|
2177
|
+
timestamp: Date.now(),
|
|
2178
|
+
};
|
|
2179
|
+
const events: any[] = [];
|
|
2180
|
+
const state = {};
|
|
2181
|
+
const message = buildWorkflowMcpReadinessProgressMessage({
|
|
2182
|
+
unitType: "complete-milestone",
|
|
2183
|
+
workflowServerName: "gsd-workflow",
|
|
2184
|
+
stage: "preflight",
|
|
2185
|
+
});
|
|
2186
|
+
|
|
2187
|
+
pushWorkflowMcpReadinessProgressEvent({
|
|
2188
|
+
stream: { push: (event: any) => events.push(event) } as any,
|
|
2189
|
+
partial,
|
|
2190
|
+
state,
|
|
2191
|
+
message,
|
|
2192
|
+
});
|
|
2193
|
+
const retryMessage = buildWorkflowMcpReadinessProgressMessage({
|
|
2194
|
+
unitType: "complete-milestone",
|
|
2195
|
+
workflowServerName: "gsd-workflow",
|
|
2196
|
+
stage: "retry",
|
|
2197
|
+
attempt: 1,
|
|
2198
|
+
delayMs: 1_000,
|
|
2199
|
+
});
|
|
2200
|
+
pushWorkflowMcpReadinessProgressEvent({
|
|
2201
|
+
stream: { push: (event: any) => events.push(event) } as any,
|
|
2202
|
+
partial,
|
|
2203
|
+
state,
|
|
2204
|
+
message: retryMessage,
|
|
2205
|
+
});
|
|
2206
|
+
|
|
2207
|
+
assert.deepEqual(events.map((event) => event.type), ["text_start", "text_delta", "text_delta"]);
|
|
2208
|
+
assert.match(events[1].delta, /Starting gsd-workflow MCP/);
|
|
2209
|
+
assert.match(events[1].delta, /complete-milestone/);
|
|
2210
|
+
assert.match(events[2].delta, /Still waiting for gsd-workflow MCP tools/);
|
|
2211
|
+
assert.match(events[2].delta, /Retrying in 1s/);
|
|
2212
|
+
assert.deepEqual(partial.content, [{ type: "text", text: `${message}\n${retryMessage}` }]);
|
|
2213
|
+
});
|
|
2214
|
+
|
|
2215
|
+
test("execute-task requires gsd_exec before the model follows verification guidance", async () => {
|
|
2216
|
+
const error = await resolveClaudeCodeToolSurfaceReadinessError({
|
|
2217
|
+
unitType: "execute-task",
|
|
2218
|
+
workflowServerName: "gsd-workflow",
|
|
2219
|
+
observation: {
|
|
2220
|
+
tools: [
|
|
2221
|
+
"Read",
|
|
2222
|
+
"Bash",
|
|
2223
|
+
"mcp__gsd-workflow__gsd_task_complete",
|
|
2224
|
+
"mcp__gsd-workflow__gsd_exec_search",
|
|
2225
|
+
"mcp__gsd-workflow__gsd_resume",
|
|
2226
|
+
"mcp__gsd-workflow__gsd_capture_thought",
|
|
2227
|
+
],
|
|
2228
|
+
mcpServers: [{ name: "gsd-workflow", status: "connected" }],
|
|
2229
|
+
},
|
|
2230
|
+
});
|
|
2231
|
+
|
|
2232
|
+
assert.match(error ?? "", /gsd_exec/);
|
|
2233
|
+
});
|
|
2234
|
+
|
|
2235
|
+
test("complete-slice requires gsd_exec before the model follows closeout verification guidance", async () => {
|
|
2236
|
+
const error = await resolveClaudeCodeToolSurfaceReadinessError({
|
|
2237
|
+
unitType: "complete-slice",
|
|
2238
|
+
workflowServerName: "gsd-workflow",
|
|
2239
|
+
observation: {
|
|
2240
|
+
tools: [
|
|
2241
|
+
"Read",
|
|
2242
|
+
"mcp__gsd-workflow__gsd_slice_complete",
|
|
2243
|
+
"mcp__gsd-workflow__gsd_task_reopen",
|
|
2244
|
+
"mcp__gsd-workflow__gsd_replan_slice",
|
|
2245
|
+
"mcp__gsd-workflow__gsd_requirement_update",
|
|
2246
|
+
"mcp__gsd-workflow__gsd_summary_save",
|
|
2247
|
+
"mcp__gsd-workflow__gsd_capture_thought",
|
|
2248
|
+
"mcp__gsd-workflow__gsd_exec_search",
|
|
2249
|
+
],
|
|
2250
|
+
mcpServers: [{ name: "gsd-workflow", status: "connected" }],
|
|
2251
|
+
},
|
|
2252
|
+
});
|
|
2253
|
+
|
|
2254
|
+
assert.match(error ?? "", /gsd_exec/);
|
|
2255
|
+
});
|
|
2256
|
+
|
|
2257
|
+
test("complete-slice requires workflow MCP memory capture before closeout guidance can use it", async () => {
|
|
2258
|
+
const error = await resolveClaudeCodeToolSurfaceReadinessError({
|
|
2259
|
+
unitType: "complete-slice",
|
|
2260
|
+
workflowServerName: "gsd-workflow",
|
|
2261
|
+
observation: {
|
|
2262
|
+
tools: [
|
|
2263
|
+
"Read",
|
|
2264
|
+
"capture_thought",
|
|
2265
|
+
"mcp__gsd-workflow__gsd_exec",
|
|
2266
|
+
"mcp__gsd-workflow__gsd_slice_complete",
|
|
2267
|
+
"mcp__gsd-workflow__gsd_task_reopen",
|
|
2268
|
+
"mcp__gsd-workflow__gsd_replan_slice",
|
|
2269
|
+
"mcp__gsd-workflow__gsd_requirement_update",
|
|
2270
|
+
"mcp__gsd-workflow__gsd_summary_save",
|
|
2271
|
+
],
|
|
2272
|
+
mcpServers: [{ name: "gsd-workflow", status: "connected" }],
|
|
2273
|
+
},
|
|
2274
|
+
});
|
|
2275
|
+
|
|
2276
|
+
assert.match(error ?? "", /gsd_capture_thought/);
|
|
2277
|
+
});
|
|
2278
|
+
|
|
2279
|
+
test("terminal init surface remains not ready even when configured workflow MCP probes available", async () => {
|
|
2280
|
+
const previousGsdHome = process.env.GSD_HOME;
|
|
2281
|
+
const projectRoot = realpathSync(mkdtempSync(join(tmpdir(), "claude-sdk-mcp-pending-ready-")));
|
|
2282
|
+
const gsdHomeDir = realpathSync(mkdtempSync(join(tmpdir(), "claude-sdk-mcp-pending-home-")));
|
|
2283
|
+
try {
|
|
2284
|
+
process.env.GSD_HOME = gsdHomeDir;
|
|
2285
|
+
|
|
2286
|
+
const require = createRequire(import.meta.url);
|
|
2287
|
+
const mcpModuleUrl = pathToFileURL(require.resolve("@modelcontextprotocol/sdk/server/mcp.js")).href;
|
|
2288
|
+
const stdioModuleUrl = pathToFileURL(require.resolve("@modelcontextprotocol/sdk/server/stdio.js")).href;
|
|
2289
|
+
const serverPath = join(projectRoot, "fake-workflow-mcp-server.mjs");
|
|
2290
|
+
writeFileSync(
|
|
2291
|
+
serverPath,
|
|
2292
|
+
[
|
|
2293
|
+
`const { McpServer } = await import(${JSON.stringify(mcpModuleUrl)});`,
|
|
2294
|
+
`const { StdioServerTransport } = await import(${JSON.stringify(stdioModuleUrl)});`,
|
|
2295
|
+
'const server = new McpServer({ name: "fake", version: "1.0.0" }, { capabilities: { tools: {} } });',
|
|
2296
|
+
'server.tool("gsd_plan_slice", "Plan slice", {}, async () => ({ content: [{ type: "text", text: "ok" }] }));',
|
|
2297
|
+
'server.tool("gsd_reassess_roadmap", "Reassess roadmap", {}, async () => ({ content: [{ type: "text", text: "ok" }] }));',
|
|
2298
|
+
'await server.connect(new StdioServerTransport());',
|
|
2299
|
+
].join("\n"),
|
|
2300
|
+
"utf-8",
|
|
2301
|
+
);
|
|
2302
|
+
writeFileSync(
|
|
2303
|
+
join(projectRoot, ".mcp.json"),
|
|
2304
|
+
JSON.stringify({ mcpServers: { "gsd-workflow": { command: process.execPath, args: [serverPath] } } }),
|
|
2305
|
+
"utf-8",
|
|
2306
|
+
);
|
|
2307
|
+
|
|
2308
|
+
const error = await resolveClaudeCodeToolSurfaceReadinessError({
|
|
2309
|
+
unitType: "plan-slice",
|
|
2310
|
+
workflowServerName: "gsd-workflow",
|
|
2311
|
+
observation: {
|
|
2312
|
+
tools: ["Read", "Bash"],
|
|
2313
|
+
mcpServers: [{ name: "gsd-workflow", status: "failed" }],
|
|
2314
|
+
},
|
|
2315
|
+
});
|
|
2316
|
+
|
|
2317
|
+
assert.match(error ?? "", /status is "failed"/);
|
|
2318
|
+
assert.match(error ?? "", /gsd_plan_slice/);
|
|
2319
|
+
} finally {
|
|
2320
|
+
if (previousGsdHome === undefined) {
|
|
2321
|
+
delete process.env.GSD_HOME;
|
|
2322
|
+
} else {
|
|
2323
|
+
process.env.GSD_HOME = previousGsdHome;
|
|
2324
|
+
}
|
|
2325
|
+
rmSync(projectRoot, { recursive: true, force: true });
|
|
2326
|
+
rmSync(gsdHomeDir, { recursive: true, force: true });
|
|
2327
|
+
clearMcpConfigCache();
|
|
2328
|
+
}
|
|
2329
|
+
});
|
|
2330
|
+
|
|
2331
|
+
test("pending init surface is not accepted until the live Claude session exposes plan-slice tools", async () => {
|
|
2332
|
+
const projectRoot = realpathSync(mkdtempSync(join(tmpdir(), "claude-sdk-mcp-plan-pending-")));
|
|
2333
|
+
try {
|
|
2334
|
+
const require = createRequire(import.meta.url);
|
|
2335
|
+
const mcpModuleUrl = pathToFileURL(require.resolve("@modelcontextprotocol/sdk/server/mcp.js")).href;
|
|
2336
|
+
const stdioModuleUrl = pathToFileURL(require.resolve("@modelcontextprotocol/sdk/server/stdio.js")).href;
|
|
2337
|
+
const serverPath = join(projectRoot, "fake-workflow-mcp-server.mjs");
|
|
2338
|
+
writeFileSync(
|
|
2339
|
+
serverPath,
|
|
2340
|
+
[
|
|
2341
|
+
`const { McpServer } = await import(${JSON.stringify(mcpModuleUrl)});`,
|
|
2342
|
+
`const { StdioServerTransport } = await import(${JSON.stringify(stdioModuleUrl)});`,
|
|
2343
|
+
'const server = new McpServer({ name: "fake", version: "1.0.0" }, { capabilities: { tools: {} } });',
|
|
2344
|
+
'server.tool("gsd_plan_slice", "Plan slice", {}, async () => ({ content: [{ type: "text", text: "ok" }] }));',
|
|
2345
|
+
'server.tool("gsd_reassess_roadmap", "Reassess roadmap", {}, async () => ({ content: [{ type: "text", text: "ok" }] }));',
|
|
2346
|
+
'await server.connect(new StdioServerTransport());',
|
|
2347
|
+
].join("\n"),
|
|
2348
|
+
"utf-8",
|
|
2349
|
+
);
|
|
2350
|
+
writeFileSync(
|
|
2351
|
+
join(projectRoot, ".mcp.json"),
|
|
2352
|
+
JSON.stringify({ mcpServers: { "gsd-workflow": { command: process.execPath, args: [serverPath] } } }),
|
|
2353
|
+
"utf-8",
|
|
2354
|
+
);
|
|
2355
|
+
|
|
2356
|
+
const error = await resolveClaudeCodeToolSurfaceReadinessError({
|
|
2357
|
+
unitType: "plan-slice",
|
|
2358
|
+
workflowServerName: "gsd-workflow",
|
|
2359
|
+
projectRoot,
|
|
2360
|
+
observation: {
|
|
2361
|
+
tools: ["Read", "Bash"],
|
|
2362
|
+
mcpServers: [{ name: "gsd-workflow", status: "pending" }],
|
|
2363
|
+
},
|
|
2364
|
+
});
|
|
2365
|
+
|
|
2366
|
+
assert.match(error ?? "", /status is "pending"/);
|
|
2367
|
+
assert.match(error ?? "", /gsd_plan_slice/);
|
|
2368
|
+
} finally {
|
|
2369
|
+
rmSync(projectRoot, { recursive: true, force: true });
|
|
2370
|
+
clearMcpConfigCache();
|
|
2371
|
+
}
|
|
2372
|
+
});
|
|
2373
|
+
|
|
2374
|
+
test("pending init surface can be deferred to Claude Code ToolSearch hydration", async () => {
|
|
2375
|
+
const error = await resolveClaudeCodeToolSurfaceReadinessError({
|
|
2376
|
+
unitType: "plan-slice",
|
|
2377
|
+
workflowServerName: "gsd-workflow",
|
|
2378
|
+
allowPendingToolSearchHydration: true,
|
|
2379
|
+
observation: {
|
|
2380
|
+
tools: ["Read", "Bash"],
|
|
2381
|
+
mcpServers: [{ name: "gsd-workflow", status: "pending" }],
|
|
2382
|
+
},
|
|
2383
|
+
});
|
|
2384
|
+
|
|
2385
|
+
assert.equal(error, null);
|
|
2386
|
+
});
|
|
2387
|
+
|
|
2388
|
+
test("complete-milestone pending init surface defers to Claude Code ToolSearch hydration", async () => {
|
|
2389
|
+
const error = await resolveClaudeCodeToolSurfaceReadinessError({
|
|
2390
|
+
unitType: "complete-milestone",
|
|
2391
|
+
workflowServerName: "gsd-workflow",
|
|
2392
|
+
allowPendingToolSearchHydration: true,
|
|
2393
|
+
observation: {
|
|
2394
|
+
tools: ["Read", "Bash"],
|
|
2395
|
+
mcpServers: [{ name: "gsd-workflow", status: "pending" }],
|
|
2396
|
+
},
|
|
2397
|
+
});
|
|
2398
|
+
|
|
2399
|
+
assert.equal(error, null);
|
|
2400
|
+
});
|
|
2401
|
+
|
|
2402
|
+
test("retries transient readiness errors internally but not terminal MCP failures", () => {
|
|
2403
|
+
const pendingError =
|
|
2404
|
+
'workflow tool surface not ready for run-uat: MCP server "gsd-workflow" status is "pending" (not yet connected): gsd_uat_exec';
|
|
2405
|
+
const partialError =
|
|
2406
|
+
'workflow tool surface not ready for run-uat: MCP server "gsd-workflow" is connected but has not registered: gsd_uat_exec';
|
|
2407
|
+
const terminalError =
|
|
2408
|
+
'workflow tool surface not ready for run-uat: MCP server "gsd-workflow" status is "failed" (terminal) — cannot register: gsd_uat_exec';
|
|
2409
|
+
|
|
2410
|
+
assert.equal(shouldRetryClaudeCodeToolSurfaceReadiness(pendingError), true);
|
|
2411
|
+
assert.equal(shouldRetryClaudeCodeToolSurfaceReadiness(partialError), true);
|
|
2412
|
+
assert.equal(shouldRetryClaudeCodeToolSurfaceReadiness(terminalError), false);
|
|
2413
|
+
assert.equal(
|
|
2414
|
+
resolveClaudeCodeToolSurfaceReadinessRetryDelayMs(pendingError, 0),
|
|
2415
|
+
500,
|
|
2416
|
+
);
|
|
2417
|
+
assert.equal(
|
|
2418
|
+
resolveClaudeCodeToolSurfaceReadinessRetryDelayMs(pendingError, 1),
|
|
2419
|
+
1_000,
|
|
2420
|
+
);
|
|
2421
|
+
assert.equal(
|
|
2422
|
+
resolveClaudeCodeToolSurfaceReadinessRetryDelayMs(partialError, 2),
|
|
2423
|
+
2_000,
|
|
2424
|
+
);
|
|
2425
|
+
assert.equal(resolveClaudeCodeToolSurfaceReadinessRetryDelayMs(pendingError, 3), 4_000);
|
|
2426
|
+
assert.equal(resolveClaudeCodeToolSurfaceReadinessRetryDelayMs(pendingError, 4), 8_000);
|
|
2427
|
+
assert.equal(resolveClaudeCodeToolSurfaceReadinessRetryDelayMs(pendingError, 5), 15_000);
|
|
2428
|
+
assert.equal(resolveClaudeCodeToolSurfaceReadinessRetryDelayMs(pendingError, 6), 15_000);
|
|
2429
|
+
assert.equal(resolveClaudeCodeToolSurfaceReadinessRetryDelayMs(pendingError, 7), 15_000);
|
|
2430
|
+
assert.equal(resolveClaudeCodeToolSurfaceReadinessRetryDelayMs(pendingError, 8), null);
|
|
2431
|
+
assert.equal(resolveClaudeCodeToolSurfaceReadinessRetryDelayMs(pendingError, 0, true), 1_000);
|
|
2432
|
+
assert.equal(resolveClaudeCodeToolSurfaceReadinessRetryDelayMs(pendingError, 9, true), 15_000);
|
|
2433
|
+
assert.equal(resolveClaudeCodeToolSurfaceReadinessRetryDelayMs(pendingError, 10, true), null);
|
|
2434
|
+
assert.equal(resolveClaudeCodeToolSurfaceReadinessRetryDelayMs(terminalError, 0), null);
|
|
2435
|
+
});
|
|
2436
|
+
});
|
|
2437
|
+
|
|
1433
2438
|
describe("stream-adapter — MCP elicitation bridge", () => {
|
|
1434
2439
|
const askUserQuestionsRequest = {
|
|
1435
2440
|
serverName: "gsd-workflow",
|
|
@@ -1662,6 +2667,26 @@ describe("stream-adapter — MCP elicitation bridge", () => {
|
|
|
1662
2667
|
});
|
|
1663
2668
|
});
|
|
1664
2669
|
|
|
2670
|
+
test("createClaudeCodeElicitationHandler returns cancel when custom UI is dismissed", async () => {
|
|
2671
|
+
let selectCalls = 0;
|
|
2672
|
+
const handler = createClaudeCodeElicitationHandler({
|
|
2673
|
+
custom: async () => ({
|
|
2674
|
+
endInterview: false,
|
|
2675
|
+
answers: {},
|
|
2676
|
+
}),
|
|
2677
|
+
select: async () => {
|
|
2678
|
+
selectCalls++;
|
|
2679
|
+
return "Cloud-synced";
|
|
2680
|
+
},
|
|
2681
|
+
} as any);
|
|
2682
|
+
assert.ok(handler);
|
|
2683
|
+
|
|
2684
|
+
const result = await handler!(askUserQuestionsRequest, { signal: new AbortController().signal });
|
|
2685
|
+
|
|
2686
|
+
assert.deepEqual(result, { action: "cancel" });
|
|
2687
|
+
assert.equal(selectCalls, 0, "dismissed custom question must not re-open dialog fallback");
|
|
2688
|
+
});
|
|
2689
|
+
|
|
1665
2690
|
test("parseTextInputElicitation recognizes secure free-text MCP forms", () => {
|
|
1666
2691
|
const request = {
|
|
1667
2692
|
serverName: "gsd-workflow",
|
|
@@ -1773,6 +2798,166 @@ describe("stream-adapter — MCP elicitation bridge", () => {
|
|
|
1773
2798
|
assert.equal(inputCalls.length, 1);
|
|
1774
2799
|
assert.equal(inputCalls[0]?.opts?.secure, true, "secure_env_collect fields should request secure input");
|
|
1775
2800
|
});
|
|
2801
|
+
|
|
2802
|
+
// -- self-cancel loop fix (#2676 / claude-code-cli) ----------------------
|
|
2803
|
+
//
|
|
2804
|
+
// Under claude-code-cli, ask_user_questions arrives as an SDK elicitation,
|
|
2805
|
+
// not an MCP tool dispatch, so the auto-mode watchdogs never saw an in-flight
|
|
2806
|
+
// tool during the human wait and re-dispatched/aborted the turn hosting the
|
|
2807
|
+
// question (the "self-cancel loop"). The fix brackets the human wait with the
|
|
2808
|
+
// interactive-tool guard and disambiguates a system-teardown abort (decline)
|
|
2809
|
+
// from a deliberate user dismissal (cancel).
|
|
2810
|
+
|
|
2811
|
+
test("makes the SDK elicitation visible to the interactive-tool guard during the human wait", async () => {
|
|
2812
|
+
_setAutoActiveForTest(true);
|
|
2813
|
+
clearInFlightTools();
|
|
2814
|
+
try {
|
|
2815
|
+
let countDuringWait = -1;
|
|
2816
|
+
let interactiveDuringWait = false;
|
|
2817
|
+
const handler = createClaudeCodeElicitationHandler({
|
|
2818
|
+
custom: async () => {
|
|
2819
|
+
// Observe the in-flight guard state WHILE the question is open —
|
|
2820
|
+
// this is the window where the watchdogs previously saw 0 tools.
|
|
2821
|
+
countDuringWait = getInFlightToolCount();
|
|
2822
|
+
interactiveDuringWait = hasInteractiveToolInFlight();
|
|
2823
|
+
return {
|
|
2824
|
+
endInterview: false,
|
|
2825
|
+
answers: { storage_scope: { selected: "Cloud-synced", notes: "" }, platform: { selected: ["Web"], notes: "" } },
|
|
2826
|
+
};
|
|
2827
|
+
},
|
|
2828
|
+
} as any);
|
|
2829
|
+
assert.ok(handler);
|
|
2830
|
+
|
|
2831
|
+
const result = await handler!(askUserQuestionsRequest, { signal: new AbortController().signal });
|
|
2832
|
+
|
|
2833
|
+
assert.equal(countDuringWait, 1, "elicitation must register as an in-flight tool during the human wait");
|
|
2834
|
+
assert.equal(interactiveDuringWait, true, "elicitation must be recognized as an interactive tool during the wait");
|
|
2835
|
+
assert.equal(result.action, "accept");
|
|
2836
|
+
assert.equal(getInFlightToolCount(), 0, "in-flight tool must be cleared after the elicitation resolves");
|
|
2837
|
+
} finally {
|
|
2838
|
+
_setAutoActiveForTest(false);
|
|
2839
|
+
clearInFlightTools();
|
|
2840
|
+
}
|
|
2841
|
+
});
|
|
2842
|
+
|
|
2843
|
+
test("clears the in-flight tool even when the interview UI throws (finally)", async () => {
|
|
2844
|
+
_setAutoActiveForTest(true);
|
|
2845
|
+
clearInFlightTools();
|
|
2846
|
+
try {
|
|
2847
|
+
const handler = createClaudeCodeElicitationHandler({
|
|
2848
|
+
// custom throws -> showInterviewRound rejects -> handler falls back
|
|
2849
|
+
// to dialogs; the in-flight entry must still be cleared via finally.
|
|
2850
|
+
custom: async () => {
|
|
2851
|
+
throw new Error("simulated UI failure");
|
|
2852
|
+
},
|
|
2853
|
+
select: async (_title: string, options: string[], opts?: { allowMultiple?: boolean }) => {
|
|
2854
|
+
if (opts?.allowMultiple) return ["Web"];
|
|
2855
|
+
return options[0];
|
|
2856
|
+
},
|
|
2857
|
+
input: async () => "note",
|
|
2858
|
+
} as any);
|
|
2859
|
+
assert.ok(handler);
|
|
2860
|
+
|
|
2861
|
+
await handler!(askUserQuestionsRequest, { signal: new AbortController().signal });
|
|
2862
|
+
assert.equal(getInFlightToolCount(), 0, "in-flight tool must be cleared even when the UI throws");
|
|
2863
|
+
} finally {
|
|
2864
|
+
_setAutoActiveForTest(false);
|
|
2865
|
+
clearInFlightTools();
|
|
2866
|
+
}
|
|
2867
|
+
});
|
|
2868
|
+
|
|
2869
|
+
test("returns decline (not cancel) when an interrupt empties the answers", async () => {
|
|
2870
|
+
// A system/host teardown that aborts the signal mid-wait surfaces as
|
|
2871
|
+
// interrupted:true -> the handler must return decline so the model does
|
|
2872
|
+
// not re-ask against a clean user-declined cancel (the re-ask amplifier).
|
|
2873
|
+
const handler = createClaudeCodeElicitationHandler({
|
|
2874
|
+
custom: async () => ({ endInterview: false, answers: {}, interrupted: true }),
|
|
2875
|
+
select: async () => {
|
|
2876
|
+
throw new Error("interrupted elicitation must not re-open dialogs");
|
|
2877
|
+
},
|
|
2878
|
+
} as any);
|
|
2879
|
+
assert.ok(handler);
|
|
2880
|
+
|
|
2881
|
+
const result = await handler!(askUserQuestionsRequest, { signal: new AbortController().signal });
|
|
2882
|
+
assert.deepEqual(result, { action: "decline" });
|
|
2883
|
+
});
|
|
2884
|
+
|
|
2885
|
+
test("returns cancel (today's semantics) when the user genuinely dismisses", async () => {
|
|
2886
|
+
const handler = createClaudeCodeElicitationHandler({
|
|
2887
|
+
custom: async () => ({ endInterview: false, answers: {} }),
|
|
2888
|
+
} as any);
|
|
2889
|
+
assert.ok(handler);
|
|
2890
|
+
|
|
2891
|
+
const result = await handler!(askUserQuestionsRequest, { signal: new AbortController().signal });
|
|
2892
|
+
assert.deepEqual(result, { action: "cancel" });
|
|
2893
|
+
});
|
|
2894
|
+
|
|
2895
|
+
test("does not register an in-flight tool outside auto-mode (wrapper self-gates)", async () => {
|
|
2896
|
+
_setAutoActiveForTest(false);
|
|
2897
|
+
clearInFlightTools();
|
|
2898
|
+
let countDuringWait = -1;
|
|
2899
|
+
const handler = createClaudeCodeElicitationHandler({
|
|
2900
|
+
custom: async () => {
|
|
2901
|
+
countDuringWait = getInFlightToolCount();
|
|
2902
|
+
return { endInterview: false, answers: { storage_scope: { selected: "Cloud-synced", notes: "" }, platform: { selected: ["Web"], notes: "" } } };
|
|
2903
|
+
},
|
|
2904
|
+
} as any);
|
|
2905
|
+
assert.ok(handler);
|
|
2906
|
+
|
|
2907
|
+
await handler!(askUserQuestionsRequest, { signal: new AbortController().signal });
|
|
2908
|
+
assert.equal(countDuringWait, 0, "foreground/non-auto elicitation must not touch the in-flight guard");
|
|
2909
|
+
});
|
|
2910
|
+
|
|
2911
|
+
// The FOREGROUND self-cancel regression guard: the s.active-gated in-flight
|
|
2912
|
+
// guard above is a no-op in foreground, so the foreground approval-gate pause
|
|
2913
|
+
// path needs a SEPARATE, ungated signal to see the elicitation as the active
|
|
2914
|
+
// human boundary. isInteractiveElicitationInFlight() must be true DURING the
|
|
2915
|
+
// wait and false after, even with auto inactive (#cc-elicitation-self-cancel).
|
|
2916
|
+
test("sets the ungated interactive-elicitation marker in FOREGROUND (auto inactive)", async () => {
|
|
2917
|
+
_setAutoActiveForTest(false);
|
|
2918
|
+
clearInFlightTools();
|
|
2919
|
+
try {
|
|
2920
|
+
let markerDuringWait = false;
|
|
2921
|
+
let countDuringWait = -1;
|
|
2922
|
+
const handler = createClaudeCodeElicitationHandler({
|
|
2923
|
+
custom: async () => {
|
|
2924
|
+
markerDuringWait = isInteractiveElicitationInFlight();
|
|
2925
|
+
countDuringWait = getInFlightToolCount();
|
|
2926
|
+
return {
|
|
2927
|
+
endInterview: false,
|
|
2928
|
+
answers: { storage_scope: { selected: "Cloud-synced", notes: "" }, platform: { selected: ["Web"], notes: "" } },
|
|
2929
|
+
};
|
|
2930
|
+
},
|
|
2931
|
+
} as any);
|
|
2932
|
+
assert.ok(handler);
|
|
2933
|
+
|
|
2934
|
+
const result = await handler!(askUserQuestionsRequest, { signal: new AbortController().signal });
|
|
2935
|
+
|
|
2936
|
+
assert.equal(markerDuringWait, true, "ungated marker must be true during the foreground human wait");
|
|
2937
|
+
assert.equal(countDuringWait, 0, "the separate marker must NOT touch the in-flight tool count in foreground");
|
|
2938
|
+
assert.equal(result.action, "accept");
|
|
2939
|
+
assert.equal(isInteractiveElicitationInFlight(), false, "marker must clear after the elicitation resolves");
|
|
2940
|
+
} finally {
|
|
2941
|
+
clearInFlightTools();
|
|
2942
|
+
}
|
|
2943
|
+
});
|
|
2944
|
+
|
|
2945
|
+
test("clears the ungated marker even when the interview UI throws in FOREGROUND (finally)", async () => {
|
|
2946
|
+
_setAutoActiveForTest(false);
|
|
2947
|
+
clearInFlightTools();
|
|
2948
|
+
try {
|
|
2949
|
+
const handler = createClaudeCodeElicitationHandler({
|
|
2950
|
+
custom: async () => {
|
|
2951
|
+
throw new Error("ui exploded");
|
|
2952
|
+
},
|
|
2953
|
+
} as any);
|
|
2954
|
+
assert.ok(handler);
|
|
2955
|
+
await handler!(askUserQuestionsRequest, { signal: new AbortController().signal }).catch(() => undefined);
|
|
2956
|
+
assert.equal(isInteractiveElicitationInFlight(), false, "marker must clear via finally on throw");
|
|
2957
|
+
} finally {
|
|
2958
|
+
clearInFlightTools();
|
|
2959
|
+
}
|
|
2960
|
+
});
|
|
1776
2961
|
});
|
|
1777
2962
|
|
|
1778
2963
|
// ---------------------------------------------------------------------------
|