@opengsd/gsd-pi 1.2.0-dev.fbdca60b → 1.3.0-dev.65546769
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.js +28 -1
- package/dist/headless-context.js +0 -1
- package/dist/headless-events.d.ts +16 -1
- package/dist/headless-events.js +19 -2
- package/dist/headless.js +8 -1
- package/dist/help-text.js +29 -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/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/resource-loader.d.ts +3 -3
- package/dist/resource-loader.js +4 -13
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/GSD-WORKFLOW.md +22 -22
- package/dist/resources/extensions/claude-code-cli/index.js +7 -1
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +73 -20
- package/dist/resources/extensions/google-cli/stream-adapter.js +16 -1
- package/dist/resources/extensions/gsd/auto/dispatch-history.js +6 -1
- package/dist/resources/extensions/gsd/auto/loop.js +67 -2
- package/dist/resources/extensions/gsd/auto/orchestrator.js +50 -10
- package/dist/resources/extensions/gsd/auto/pre-dispatch.js +8 -0
- package/dist/resources/extensions/gsd/auto/workflow-kernel.js +15 -1
- 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 +255 -431
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +15 -3
- package/dist/resources/extensions/gsd/auto-dispatch.js +47 -8
- package/dist/resources/extensions/gsd/auto-model-selection.js +14 -8
- package/dist/resources/extensions/gsd/auto-post-unit.js +39 -29
- package/dist/resources/extensions/gsd/auto-prompts.js +44 -30
- package/dist/resources/extensions/gsd/auto-recovery.js +118 -40
- package/dist/resources/extensions/gsd/auto-runtime-state.js +13 -0
- package/dist/resources/extensions/gsd/auto-start.js +58 -31
- package/dist/resources/extensions/gsd/auto-verification.js +5 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +149 -91
- package/dist/resources/extensions/gsd/auto.js +97 -31
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +42 -54
- package/dist/resources/extensions/gsd/bootstrap/fallback-continuation.js +25 -0
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +24 -2
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +108 -9
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +164 -44
- package/dist/resources/extensions/gsd/bootstrap/tool-search-shim.js +22 -3
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +113 -27
- package/dist/resources/extensions/gsd/closeout-consistency-gate.js +92 -4
- package/dist/resources/extensions/gsd/closeout-wizard.js +8 -3
- package/dist/resources/extensions/gsd/codebase-generator.js +5 -8
- package/dist/resources/extensions/gsd/commands/catalog.js +6 -0
- 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/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-gsd-core.js +868 -0
- package/dist/resources/extensions/gsd/commands-handlers.js +67 -1
- package/dist/resources/extensions/gsd/commands-maintenance.js +79 -2
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +14 -1
- package/dist/resources/extensions/gsd/commands-verdict.js +17 -11
- 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 +12 -0
- package/dist/resources/extensions/gsd/consent-verdict.js +10 -0
- package/dist/resources/extensions/gsd/dashboard-overlay.js +39 -3
- package/dist/resources/extensions/gsd/db/engine.js +27 -0
- package/dist/resources/extensions/gsd/db/queries.js +54 -0
- package/dist/resources/extensions/gsd/db/unit-dispatches.js +22 -1
- package/dist/resources/extensions/gsd/db/writers/reconcile.js +19 -1
- package/dist/resources/extensions/gsd/db-workspace.js +13 -1
- package/dist/resources/extensions/gsd/discussion-handoff.js +9 -5
- package/dist/resources/extensions/gsd/doctor-git-checks.js +30 -4
- package/dist/resources/extensions/gsd/doctor-providers.js +1 -1
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +13 -24
- package/dist/resources/extensions/gsd/doctor.js +28 -7
- package/dist/resources/extensions/gsd/error-classifier.js +13 -1
- package/dist/resources/extensions/gsd/escalation.js +11 -4
- 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/flat-phase-migration.js +176 -0
- package/dist/resources/extensions/gsd/forensics.js +2 -1
- package/dist/resources/extensions/gsd/git-service.js +7 -4
- package/dist/resources/extensions/gsd/gitignore.js +6 -2
- package/dist/resources/extensions/gsd/guidance.js +7 -7
- package/dist/resources/extensions/gsd/guided-flow.js +11 -6
- package/dist/resources/extensions/gsd/layout-policy.js +75 -0
- package/dist/resources/extensions/gsd/markdown-renderer.js +391 -116
- package/dist/resources/extensions/gsd/mcp-filter.js +44 -10
- package/dist/resources/extensions/gsd/md-importer.js +153 -51
- 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-external.js +51 -6
- package/dist/resources/extensions/gsd/migration-auto-check.js +5 -14
- package/dist/resources/extensions/gsd/milestone-actions.js +5 -3
- package/dist/resources/extensions/gsd/milestone-closeout.js +12 -2
- package/dist/resources/extensions/gsd/milestone-ids.js +50 -19
- package/dist/resources/extensions/gsd/milestone-planning-persistence.js +8 -0
- package/dist/resources/extensions/gsd/milestone-validation-verdict.js +7 -4
- package/dist/resources/extensions/gsd/model-router.js +79 -20
- package/dist/resources/extensions/gsd/notification-store.js +22 -29
- package/dist/resources/extensions/gsd/notifications.js +36 -7
- package/dist/resources/extensions/gsd/observability-validator.js +12 -4
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +133 -35
- package/dist/resources/extensions/gsd/parsers-legacy.js +40 -14
- package/dist/resources/extensions/gsd/paths.js +356 -44
- 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/preferences-models.js +34 -14
- package/dist/resources/extensions/gsd/preferences.js +148 -13
- 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 +24 -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 +5 -1
- 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/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-phase.md +34 -0
- package/dist/resources/extensions/gsd/prompts/plan-review-convergence.md +34 -0
- 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/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/run-uat.md +5 -1
- 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/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-phase.md +26 -0
- package/dist/resources/extensions/gsd/prompts/verify-work.md +24 -0
- 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 +24 -0
- package/dist/resources/extensions/gsd/queue-order.js +3 -2
- package/dist/resources/extensions/gsd/recovery-classification.js +8 -0
- package/dist/resources/extensions/gsd/roadmap-slices.js +1 -1
- package/dist/resources/extensions/gsd/safety/content-validator.js +2 -1
- package/dist/resources/extensions/gsd/safety/evidence-cross-ref.js +43 -1
- package/dist/resources/extensions/gsd/service-tier.js +2 -1
- package/dist/resources/extensions/gsd/session-lock.js +11 -9
- 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/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 +95 -19
- 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.js +48 -17
- package/dist/resources/extensions/gsd/sync-lock.js +11 -18
- package/dist/resources/extensions/gsd/tool-surface-readiness.js +205 -16
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +4 -2
- package/dist/resources/extensions/gsd/tools/complete-slice.js +12 -2
- package/dist/resources/extensions/gsd/tools/complete-task.js +15 -1
- package/dist/resources/extensions/gsd/tools/exec-tool.js +2 -109
- package/dist/resources/extensions/gsd/tools/plan-slice.js +1 -3
- package/dist/resources/extensions/gsd/tools/plan-task.js +16 -1
- package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +9 -3
- package/dist/resources/extensions/gsd/tools/validate-milestone.js +8 -3
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +44 -5
- 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/undo.js +8 -9
- package/dist/resources/extensions/gsd/unit-registry.js +27 -3
- package/dist/resources/extensions/gsd/unmerged-milestone-guard.js +58 -2
- package/dist/resources/extensions/gsd/validation-block-guard.js +45 -0
- 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/workflow-logger.js +4 -0
- package/dist/resources/extensions/gsd/workflow-mcp.js +9 -1
- package/dist/resources/extensions/gsd/workflow-projections.js +25 -4
- package/dist/resources/extensions/gsd/worktree-command.js +6 -6
- package/dist/resources/extensions/gsd/worktree-health.js +6 -3
- package/dist/resources/extensions/gsd/worktree-manager.js +109 -16
- package/dist/resources/extensions/gsd/worktree-safety.js +20 -11
- package/dist/resources/extensions/gsd/worktree-shell-guard.js +113 -0
- package/dist/resources/extensions/mcp-client/manager.js +3 -3
- package/dist/resources/extensions/search-the-web/index.js +41 -9
- package/dist/resources/extensions/search-the-web/native-search.js +18 -4
- package/dist/resources/extensions/shared/gsd-browser-cli.js +40 -2
- package/dist/resources/extensions/subagent/index.js +20 -15
- package/dist/resources/extensions/subagent/worktree-cwd.js +31 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/update-check.js +15 -4
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +8 -8
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +8 -8
- package/dist/web/standalone/.next/server/chunks/1128.js +1 -1
- package/dist/web/standalone/.next/server/chunks/5124.js +1 -1
- package/dist/web/standalone/.next/server/chunks/8357.js +1 -1
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/{4283.e4873b058df143a1.js → 4283.8e446784528ed9dc.js} +2 -2
- package/dist/web/standalone/.next/static/chunks/8785.481aa5869991b760.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-f0285ce91d4ec9ef.js → webpack-f46ea08200a0227e.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/pty.target.mk +14 -14
- package/dist/web-mode.d.ts +3 -1
- package/dist/web-mode.js +7 -5
- 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 +8 -7
- 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/package.json +1 -1
- package/packages/daemon/package.json +4 -4
- package/packages/gsd-agent-core/dist/sdk.d.ts.map +1 -1
- package/packages/gsd-agent-core/dist/sdk.js +6 -2
- package/packages/gsd-agent-core/dist/sdk.js.map +1 -1
- package/packages/gsd-agent-core/package.json +5 -5
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts +5 -5
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js +12 -24
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js +5 -5
- package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts +3 -3
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js +20 -11
- package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-turn-connect.d.ts +4 -3
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-turn-connect.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-turn-connect.js +5 -54
- package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-turn-connect.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -4
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js +2 -4
- package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts +2 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js +4 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts +9 -12
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js +100 -166
- package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-progress-state.d.ts +2 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-progress-state.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-progress-state.js +4 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-progress-state.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-status-widget.d.ts +23 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-status-widget.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-status-widget.js +178 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-status-widget.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts +8 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js +21 -9
- package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/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 +3 -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 +37 -15
- 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 +69 -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 +223 -32
- package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts +3 -3
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js +19 -19
- package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts +3 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js +26 -10
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js +12 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js +5 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-autocomplete.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-autocomplete.js +3 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.js +3 -5
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-dialogs.js +2 -2
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.d.ts +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.js +25 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-key-handlers.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-key-handlers.js +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-key-handlers.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-init.d.ts +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-init.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-init.js +20 -49
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-init.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts +4 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts +9 -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 +31 -6
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-ui-messaging.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-ui-messaging.js +0 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-ui-messaging.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js +3 -0
- package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/packages/gsd-agent-modes/package.json +7 -7
- package/packages/mcp-server/README.md +10 -0
- 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.map +1 -1
- package/packages/mcp-server/dist/cli-runner.js +33 -0
- package/packages/mcp-server/dist/cli-runner.js.map +1 -1
- 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 +1 -0
- package/packages/mcp-server/dist/cli.js.map +1 -1
- package/packages/mcp-server/dist/server.d.ts +29 -0
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +82 -3
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/package.json +21 -5
- package/packages/native/package.json +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +9 -0
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-upstream-types.d.ts +28 -2
- package/packages/pi-coding-agent/dist/core/extensions/extension-upstream-types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-upstream-types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +5 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +3 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/package.json +8 -8
- package/packages/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/packages/pi-tui/dist/autocomplete.js +6 -1
- package/packages/pi-tui/dist/autocomplete.js.map +1 -1
- package/packages/pi-tui/dist/components/input.js +1 -1
- package/packages/pi-tui/dist/components/input.js.map +1 -1
- package/packages/pi-tui/dist/components/loader.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/loader.js +1 -0
- package/packages/pi-tui/dist/components/loader.js.map +1 -1
- package/packages/pi-tui/dist/components/select-list.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/select-list.js +8 -2
- package/packages/pi-tui/dist/components/select-list.js.map +1 -1
- package/packages/pi-tui/package.json +2 -2
- package/packages/rpc-client/package.json +2 -2
- package/pkg/package.json +1 -1
- package/src/resources/GSD-WORKFLOW.md +22 -22
- package/src/resources/extensions/browser-tools/tests/gsd-browser-launch-config.test.mjs +80 -0
- package/src/resources/extensions/claude-code-cli/index.ts +8 -1
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +83 -20
- 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 +182 -10
- package/src/resources/extensions/google-cli/stream-adapter.ts +22 -1
- package/src/resources/extensions/gsd/auto/dispatch-history.ts +19 -1
- package/src/resources/extensions/gsd/auto/loop.ts +69 -2
- package/src/resources/extensions/gsd/auto/orchestrator.ts +63 -10
- package/src/resources/extensions/gsd/auto/pre-dispatch.ts +13 -1
- package/src/resources/extensions/gsd/auto/workflow-kernel.ts +25 -3
- 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 +310 -454
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +15 -2
- package/src/resources/extensions/gsd/auto-dispatch.ts +57 -12
- package/src/resources/extensions/gsd/auto-model-selection.ts +27 -5
- package/src/resources/extensions/gsd/auto-post-unit.ts +52 -31
- package/src/resources/extensions/gsd/auto-prompts.ts +45 -30
- package/src/resources/extensions/gsd/auto-recovery.ts +126 -37
- package/src/resources/extensions/gsd/auto-runtime-state.ts +13 -0
- package/src/resources/extensions/gsd/auto-start.ts +82 -36
- package/src/resources/extensions/gsd/auto-verification.ts +5 -7
- package/src/resources/extensions/gsd/auto-worktree.ts +83 -15
- package/src/resources/extensions/gsd/auto.ts +133 -32
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +45 -61
- package/src/resources/extensions/gsd/bootstrap/fallback-continuation.ts +31 -0
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +23 -2
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +123 -9
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +185 -46
- package/src/resources/extensions/gsd/bootstrap/tool-search-shim.ts +21 -3
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +138 -29
- package/src/resources/extensions/gsd/closeout-consistency-gate.ts +107 -3
- package/src/resources/extensions/gsd/closeout-wizard.ts +11 -2
- package/src/resources/extensions/gsd/codebase-generator.ts +6 -9
- package/src/resources/extensions/gsd/commands/catalog.ts +6 -0
- 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/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-gsd-core.ts +1142 -0
- package/src/resources/extensions/gsd/commands-handlers.ts +76 -1
- package/src/resources/extensions/gsd/commands-maintenance.ts +98 -2
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +13 -0
- package/src/resources/extensions/gsd/commands-verdict.ts +16 -15
- 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 +11 -1
- package/src/resources/extensions/gsd/consent-verdict.ts +30 -1
- package/src/resources/extensions/gsd/dashboard-overlay.ts +41 -4
- package/src/resources/extensions/gsd/db/engine.ts +26 -0
- package/src/resources/extensions/gsd/db/queries.ts +78 -0
- package/src/resources/extensions/gsd/db/unit-dispatches.ts +24 -0
- package/src/resources/extensions/gsd/db/writers/reconcile.ts +24 -1
- package/src/resources/extensions/gsd/db-workspace.ts +15 -0
- package/src/resources/extensions/gsd/discussion-handoff.ts +9 -5
- package/src/resources/extensions/gsd/doctor-git-checks.ts +28 -3
- package/src/resources/extensions/gsd/doctor-providers.ts +1 -1
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +12 -25
- package/src/resources/extensions/gsd/doctor-types.ts +1 -0
- package/src/resources/extensions/gsd/doctor.ts +30 -7
- package/src/resources/extensions/gsd/error-classifier.ts +14 -1
- package/src/resources/extensions/gsd/escalation.ts +9 -4
- 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/flat-phase-migration.ts +205 -0
- package/src/resources/extensions/gsd/forensics.ts +2 -1
- package/src/resources/extensions/gsd/git-constants.ts +1 -1
- package/src/resources/extensions/gsd/git-service.ts +7 -2
- package/src/resources/extensions/gsd/gitignore.ts +7 -3
- package/src/resources/extensions/gsd/guidance.ts +7 -7
- package/src/resources/extensions/gsd/guided-flow.ts +11 -6
- package/src/resources/extensions/gsd/layout-policy.ts +85 -0
- package/src/resources/extensions/gsd/markdown-renderer.ts +404 -104
- package/src/resources/extensions/gsd/mcp-filter.ts +59 -10
- package/src/resources/extensions/gsd/md-importer.ts +215 -65
- 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-external.ts +49 -6
- package/src/resources/extensions/gsd/migration-auto-check.ts +4 -13
- package/src/resources/extensions/gsd/milestone-actions.ts +5 -2
- package/src/resources/extensions/gsd/milestone-closeout.ts +13 -2
- package/src/resources/extensions/gsd/milestone-ids.ts +49 -19
- package/src/resources/extensions/gsd/milestone-planning-persistence.ts +8 -0
- package/src/resources/extensions/gsd/milestone-validation-verdict.ts +7 -9
- package/src/resources/extensions/gsd/model-router.ts +98 -18
- package/src/resources/extensions/gsd/notification-store.ts +17 -28
- package/src/resources/extensions/gsd/notifications.ts +37 -6
- package/src/resources/extensions/gsd/observability-validator.ts +12 -4
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +151 -31
- package/src/resources/extensions/gsd/parsers-legacy.ts +42 -15
- package/src/resources/extensions/gsd/paths.ts +348 -39
- 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/preferences-models.ts +47 -13
- package/src/resources/extensions/gsd/preferences.ts +188 -14
- 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 +24 -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 +5 -1
- 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/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-phase.md +34 -0
- package/src/resources/extensions/gsd/prompts/plan-review-convergence.md +34 -0
- 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/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/run-uat.md +5 -1
- 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/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-phase.md +26 -0
- package/src/resources/extensions/gsd/prompts/verify-work.md +24 -0
- 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 +32 -0
- package/src/resources/extensions/gsd/queue-order.ts +3 -2
- package/src/resources/extensions/gsd/recovery-classification.ts +7 -0
- package/src/resources/extensions/gsd/roadmap-slices.ts +1 -1
- package/src/resources/extensions/gsd/safety/content-validator.ts +2 -1
- package/src/resources/extensions/gsd/safety/evidence-cross-ref.ts +45 -1
- package/src/resources/extensions/gsd/service-tier.ts +2 -0
- package/src/resources/extensions/gsd/session-lock.ts +15 -13
- 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/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 +98 -26
- 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.ts +57 -15
- package/src/resources/extensions/gsd/sync-lock.ts +11 -20
- 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/auto-artifact-paths.test.ts +322 -1
- package/src/resources/extensions/gsd/tests/auto-closeout-messaging.test.ts +71 -0
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +68 -116
- package/src/resources/extensions/gsd/tests/auto-direct-dispatch-parse.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +104 -0
- package/src/resources/extensions/gsd/tests/auto-migrating-recovery.test.ts +32 -1
- package/src/resources/extensions/gsd/tests/auto-model-selection-tool-poisoning.test.ts +7 -2
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +10 -0
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +28 -22
- 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 +19 -2
- 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/blocker-placeholder-logs.test.ts +218 -0
- package/src/resources/extensions/gsd/tests/codebase-generator.test.ts +15 -11
- 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-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 +1 -1
- 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.test.ts +7 -7
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +7 -7
- package/src/resources/extensions/gsd/tests/consent-question.test.ts +45 -0
- package/src/resources/extensions/gsd/tests/core-overlay-fallback.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/dashboard-overlay.test.ts +37 -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/derive-state-db.test.ts +63 -1
- package/src/resources/extensions/gsd/tests/derive-state-helpers.test.ts +49 -5
- package/src/resources/extensions/gsd/tests/discuss-cold-start-db-open.test.ts +10 -27
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +20 -1
- package/src/resources/extensions/gsd/tests/dispatch-db-degradation-logs.test.ts +98 -0
- package/src/resources/extensions/gsd/tests/dispatch-history.test.ts +102 -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/dist-redirect.mjs +7 -0
- package/src/resources/extensions/gsd/tests/doctor-git-checks-autoresolve.test.ts +149 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +6 -4
- 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/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 +53 -0
- 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-lock.test.ts +43 -0
- 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/gsd-command-home.test.ts +40 -7
- package/src/resources/extensions/gsd/tests/gsd-core-parity-routing.test.ts +183 -0
- package/src/resources/extensions/gsd/tests/guidance.test.ts +25 -0
- 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 +75 -0
- package/src/resources/extensions/gsd/tests/integration/commands-eval-review.integration.test.ts +6 -2
- package/src/resources/extensions/gsd/tests/integration/gitignore-tracked-gsd.test.ts +55 -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/interactive-routing-bypass.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/knowledge-cold-start.test.ts +372 -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/metrics-ledger-cap.test.ts +239 -0
- package/src/resources/extensions/gsd/tests/milestone-closeout.test.ts +7 -2
- package/src/resources/extensions/gsd/tests/milestone-settlement.test.ts +6 -1
- package/src/resources/extensions/gsd/tests/model-router.test.ts +343 -7
- package/src/resources/extensions/gsd/tests/notification-store.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/notifications.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/oauth-api-model-routing.test.ts +13 -1
- 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 +339 -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/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 +9 -6
- 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 +19 -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-execution-checks.test.ts +48 -1
- package/src/resources/extensions/gsd/tests/preferences.test.ts +47 -1
- package/src/resources/extensions/gsd/tests/prefs-missing-models-crash.test.ts +35 -4
- package/src/resources/extensions/gsd/tests/progress-strip-test-helpers.ts +79 -0
- package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/provider-error-guidance.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +107 -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-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 +79 -4
- 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/round-trip-property.test.ts +137 -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 +68 -0
- package/src/resources/extensions/gsd/tests/show-config-command.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/single-writer-invariant.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/stale-dirlistcache-4648.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +155 -58
- package/src/resources/extensions/gsd/tests/stop-backtrack.test.ts +6 -2
- 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/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/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 +26 -7
- package/src/resources/extensions/gsd/tests/tool-unavailable-retry.test.ts +23 -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/undo.test.ts +39 -37
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/unmerged-milestone-guard.test.ts +62 -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/validate-milestone-write-order.test.ts +9 -1
- package/src/resources/extensions/gsd/tests/validation-block-guard.test.ts +51 -0
- package/src/resources/extensions/gsd/tests/validation-gate-patterns.test.ts +34 -6
- package/src/resources/extensions/gsd/tests/verify-artifact-tightened.test.ts +90 -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/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.test.ts +34 -8
- package/src/resources/extensions/gsd/tests/workflow-projections.test.ts +3 -4
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +64 -8
- package/src/resources/extensions/gsd/tests/worktree-health.test.ts +43 -3
- package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/worktree-safety.test.ts +39 -18
- package/src/resources/extensions/gsd/tests/worktree-write-gate.test.ts +75 -3
- package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +4 -1
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +103 -0
- package/src/resources/extensions/gsd/tool-surface-readiness.ts +226 -16
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +4 -7
- package/src/resources/extensions/gsd/tools/complete-slice.ts +12 -9
- package/src/resources/extensions/gsd/tools/complete-task.ts +15 -1
- package/src/resources/extensions/gsd/tools/exec-tool.ts +2 -118
- package/src/resources/extensions/gsd/tools/plan-slice.ts +1 -3
- package/src/resources/extensions/gsd/tools/plan-task.ts +17 -1
- package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +9 -10
- package/src/resources/extensions/gsd/tools/validate-milestone.ts +8 -13
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +43 -4
- 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/undo.ts +8 -9
- package/src/resources/extensions/gsd/unit-registry.ts +27 -3
- package/src/resources/extensions/gsd/unmerged-milestone-guard.ts +60 -1
- package/src/resources/extensions/gsd/validation-block-guard.ts +46 -0
- 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/workflow-logger.ts +5 -0
- package/src/resources/extensions/gsd/workflow-mcp.ts +12 -1
- package/src/resources/extensions/gsd/workflow-projections.ts +24 -4
- package/src/resources/extensions/gsd/worktree-command.ts +6 -6
- package/src/resources/extensions/gsd/worktree-health.ts +6 -3
- package/src/resources/extensions/gsd/worktree-manager.ts +122 -16
- package/src/resources/extensions/gsd/worktree-safety.ts +31 -11
- package/src/resources/extensions/gsd/worktree-shell-guard.ts +123 -0
- package/src/resources/extensions/mcp-client/manager.ts +3 -3
- package/src/resources/extensions/search-the-web/index.ts +45 -9
- package/src/resources/extensions/search-the-web/native-search.ts +16 -4
- package/src/resources/extensions/shared/gsd-browser-cli.ts +41 -2
- package/src/resources/extensions/subagent/index.ts +20 -15
- package/src/resources/extensions/subagent/tests/worktree-cwd.test.ts +57 -0
- package/src/resources/extensions/subagent/worktree-cwd.ts +35 -0
- package/dist/web/standalone/.next/static/chunks/8785.2e5a118797fb2dd2.js +0 -1
- /package/dist/web/standalone/.next/static/{2T9IOdiiM3o3gZ4UbPi8E → BTKtGFF1Y-hvVJEGhBRo9}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{2T9IOdiiM3o3gZ4UbPi8E → BTKtGFF1Y-hvVJEGhBRo9}/_ssgManifest.js +0 -0
|
@@ -23,6 +23,9 @@ const DEFAULT_KNOWLEDGE_MAX_CHARS = 12_000;
|
|
|
23
23
|
const DEFAULT_CODEBASE_MAX_CHARS = 8_000;
|
|
24
24
|
const MIN_CONTEXT_MESSAGE_MAX_CHARS = 1_000;
|
|
25
25
|
const MIN_KNOWLEDGE_MAX_CHARS = 1_000;
|
|
26
|
+
const contextMaintenanceCompletedForBasePath = new Set();
|
|
27
|
+
const contextMaintenanceInFlightByBasePath = new Map();
|
|
28
|
+
const deferredContextMaintenanceByBasePath = new Map();
|
|
26
29
|
/**
|
|
27
30
|
* Bundled skill triggers — resolved dynamically at runtime instead of
|
|
28
31
|
* hardcoding absolute paths in the system prompt template. Only skills
|
|
@@ -65,6 +68,24 @@ export const BUNDLED_SKILL_TRIGGERS = [
|
|
|
65
68
|
{ trigger: "Author a YAML workflow definition — steps, triggers, and templates", skill: "create-workflow" },
|
|
66
69
|
{ trigger: "Deep code optimization audit — perf anti-patterns, memory leaks, algorithmic complexity, bundle size, I/O, caching, dead code (parallel pattern-based hunt)", skill: "code-optimizer" },
|
|
67
70
|
];
|
|
71
|
+
/**
|
|
72
|
+
* Remove the volatile lines from a CODEBASE.md map before it is injected into
|
|
73
|
+
* the cached system-prompt prefix: the human-readable `Generated: <timestamp>`
|
|
74
|
+
* header and the `<!-- gsd:codebase-meta {...} -->` comment. Both carry a
|
|
75
|
+
* per-regeneration timestamp (and fingerprint) that change whenever the map is
|
|
76
|
+
* refreshed, which would otherwise invalidate the provider KV cache prefix on
|
|
77
|
+
* every turn even when the underlying file structure is identical. (#847)
|
|
78
|
+
*/
|
|
79
|
+
export function stripVolatileCodebaseMetadata(content) {
|
|
80
|
+
return content
|
|
81
|
+
.split("\n")
|
|
82
|
+
.filter((line) => {
|
|
83
|
+
const trimmed = line.trimStart();
|
|
84
|
+
return !trimmed.startsWith("Generated:") && !trimmed.startsWith("<!-- gsd:codebase-meta");
|
|
85
|
+
})
|
|
86
|
+
.join("\n")
|
|
87
|
+
.trim();
|
|
88
|
+
}
|
|
68
89
|
function warnDeprecatedAgentInstructions() {
|
|
69
90
|
const paths = [
|
|
70
91
|
join(gsdHome(), "agent-instructions.md"),
|
|
@@ -78,45 +99,69 @@ function warnDeprecatedAgentInstructions() {
|
|
|
78
99
|
}
|
|
79
100
|
}
|
|
80
101
|
}
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
shortcutShell: formatShortcut("Ctrl+Alt+B"),
|
|
89
|
-
});
|
|
90
|
-
let loadedPreferences = loadEffectiveGSDPreferences();
|
|
91
|
-
try {
|
|
92
|
-
const { markCmuxPromptShown, shouldPromptToEnableCmux } = await import("../../cmux/index.js");
|
|
93
|
-
if (shouldPromptToEnableCmux(loadedPreferences?.preferences)) {
|
|
94
|
-
markCmuxPromptShown();
|
|
95
|
-
if (autoEnableCmuxPreferences()) {
|
|
96
|
-
loadedPreferences = loadEffectiveGSDPreferences();
|
|
97
|
-
ctx.ui.notify("cmux detected — auto-enabled. Run /gsd cmux off to disable.", "info");
|
|
98
|
-
}
|
|
102
|
+
async function runSessionStartupMaintenanceOnce(basePath, ctx) {
|
|
103
|
+
if (contextMaintenanceCompletedForBasePath.has(basePath)) {
|
|
104
|
+
// Backfills are session-once, but memory queries and other DB-backed
|
|
105
|
+
// prompt assembly still need an active adapter on every turn.
|
|
106
|
+
try {
|
|
107
|
+
const { ensureDbOpen } = await import("./dynamic-tools.js");
|
|
108
|
+
await ensureDbOpen(basePath);
|
|
99
109
|
}
|
|
110
|
+
catch (e) {
|
|
111
|
+
logWarning("bootstrap", `project DB open failed: ${e.message}`);
|
|
112
|
+
}
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
const existing = contextMaintenanceInFlightByBasePath.get(basePath);
|
|
116
|
+
const isInitiator = !existing;
|
|
117
|
+
// Use a definite Promise<boolean> so `await inFlight` has a known return type.
|
|
118
|
+
let inFlight;
|
|
119
|
+
if (isInitiator) {
|
|
120
|
+
inFlight = performSessionStartupMaintenance(basePath, ctx);
|
|
121
|
+
contextMaintenanceInFlightByBasePath.set(basePath, inFlight);
|
|
122
|
+
void inFlight.finally(() => {
|
|
123
|
+
if (contextMaintenanceInFlightByBasePath.get(basePath) === inFlight) {
|
|
124
|
+
contextMaintenanceInFlightByBasePath.delete(basePath);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
100
127
|
}
|
|
101
|
-
|
|
102
|
-
|
|
128
|
+
else {
|
|
129
|
+
inFlight = existing;
|
|
103
130
|
}
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
131
|
+
const result = await inFlight;
|
|
132
|
+
return isInitiator ? result : false;
|
|
133
|
+
}
|
|
134
|
+
async function performSessionStartupMaintenance(basePath, ctx) {
|
|
135
|
+
// DB-backed memory backfills run below. On a cold session the database file
|
|
136
|
+
// may exist without an active in-process adapter, so open the canonical
|
|
137
|
+
// project DB before those best-effort operations inspect it.
|
|
138
|
+
let dbOpen = false;
|
|
139
|
+
try {
|
|
140
|
+
const { ensureDbOpen } = await import("./dynamic-tools.js");
|
|
141
|
+
dbOpen = await ensureDbOpen(basePath);
|
|
116
142
|
}
|
|
143
|
+
catch (e) {
|
|
144
|
+
logWarning("bootstrap", `project DB open failed before memory projection: ${e.message}`);
|
|
145
|
+
}
|
|
146
|
+
if (!dbOpen)
|
|
147
|
+
return false;
|
|
148
|
+
// These backfills are independent idempotent migrations. Keep them on the
|
|
149
|
+
// startup path because their rows can affect the MEMORY block for this turn,
|
|
150
|
+
// but do not make their import/IO latencies add serially.
|
|
151
|
+
await Promise.allSettled([
|
|
152
|
+
runDecisionsMemoryBackfill(ctx),
|
|
153
|
+
runKnowledgeMemoryBackfill(basePath, ctx),
|
|
154
|
+
]);
|
|
155
|
+
// Mark session complete before scheduling deferred work so any concurrent
|
|
156
|
+
// caller that observes the completed state does not re-enter maintenance.
|
|
157
|
+
contextMaintenanceCompletedForBasePath.add(basePath);
|
|
158
|
+
scheduleDeferredContextMaintenance(basePath);
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
async function runDecisionsMemoryBackfill(ctx) {
|
|
117
162
|
// ADR-013 step 5: opportunistic decisions->memories backfill. Idempotent
|
|
118
163
|
// and best-effort — first run absorbs the existing decisions table into
|
|
119
|
-
// the memory store;
|
|
164
|
+
// the memory store; repeated turns skip this session-once maintenance.
|
|
120
165
|
try {
|
|
121
166
|
const { backfillDecisionsToMemories } = await import("../memory-backfill.js");
|
|
122
167
|
const written = backfillDecisionsToMemories();
|
|
@@ -127,10 +172,11 @@ export async function buildBeforeAgentStartResult(event, ctx) {
|
|
|
127
172
|
catch (e) {
|
|
128
173
|
logWarning("bootstrap", `decisions backfill failed: ${e.message}`);
|
|
129
174
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
//
|
|
133
|
-
//
|
|
175
|
+
}
|
|
176
|
+
async function runKnowledgeMemoryBackfill(basePath, ctx) {
|
|
177
|
+
// ADR-013 Stage 2b: KNOWLEDGE.md Patterns + Lessons backfill. Idempotent
|
|
178
|
+
// and best-effort — first run migrates rows into memories; repeated turns
|
|
179
|
+
// skip this session-once maintenance.
|
|
134
180
|
try {
|
|
135
181
|
const { backfillKnowledgeToMemories } = await import("../knowledge-backfill.js");
|
|
136
182
|
const writtenK = backfillKnowledgeToMemories(basePath);
|
|
@@ -141,6 +187,32 @@ export async function buildBeforeAgentStartResult(event, ctx) {
|
|
|
141
187
|
catch (e) {
|
|
142
188
|
logWarning("bootstrap", `KNOWLEDGE.md backfill failed: ${e.message}`);
|
|
143
189
|
}
|
|
190
|
+
}
|
|
191
|
+
function scheduleDeferredContextMaintenance(basePath) {
|
|
192
|
+
if (deferredContextMaintenanceByBasePath.has(basePath))
|
|
193
|
+
return;
|
|
194
|
+
const task = new Promise((resolve) => {
|
|
195
|
+
setTimeout(() => {
|
|
196
|
+
void runDeferredContextMaintenance(basePath).finally(resolve);
|
|
197
|
+
}, 0);
|
|
198
|
+
});
|
|
199
|
+
deferredContextMaintenanceByBasePath.set(basePath, task);
|
|
200
|
+
void task.finally(() => {
|
|
201
|
+
if (deferredContextMaintenanceByBasePath.get(basePath) === task) {
|
|
202
|
+
deferredContextMaintenanceByBasePath.delete(basePath);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
async function runDeferredContextMaintenance(basePath) {
|
|
207
|
+
// Projection rendering and consolidation-gap reporting do not contribute to
|
|
208
|
+
// the returned system prompt. Run them after startup context is assembled so
|
|
209
|
+
// their DB/file scans do not block the first response.
|
|
210
|
+
await Promise.allSettled([
|
|
211
|
+
renderKnowledgeProjectionDeferred(basePath),
|
|
212
|
+
reportConsolidationGapsDeferred(basePath),
|
|
213
|
+
]);
|
|
214
|
+
}
|
|
215
|
+
async function renderKnowledgeProjectionDeferred(basePath) {
|
|
144
216
|
try {
|
|
145
217
|
const { renderKnowledgeProjection } = await import("../knowledge-projection.js");
|
|
146
218
|
renderKnowledgeProjection(basePath);
|
|
@@ -148,9 +220,8 @@ export async function buildBeforeAgentStartResult(event, ctx) {
|
|
|
148
220
|
catch (e) {
|
|
149
221
|
logWarning("bootstrap", `KNOWLEDGE.md projection render failed: ${e.message}`);
|
|
150
222
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
// backfills above so the gap report reflects post-backfill state.
|
|
223
|
+
}
|
|
224
|
+
async function reportConsolidationGapsDeferred(basePath) {
|
|
154
225
|
try {
|
|
155
226
|
const { reportConsolidationGaps } = await import("../memory-consolidation-scanner.js");
|
|
156
227
|
reportConsolidationGaps(basePath);
|
|
@@ -158,6 +229,50 @@ export async function buildBeforeAgentStartResult(event, ctx) {
|
|
|
158
229
|
catch (e) {
|
|
159
230
|
logWarning("bootstrap", `memory consolidation scan failed: ${e.message}`);
|
|
160
231
|
}
|
|
232
|
+
}
|
|
233
|
+
export async function _flushDeferredContextMaintenanceForTest(basePath) {
|
|
234
|
+
const tasks = basePath
|
|
235
|
+
? [deferredContextMaintenanceByBasePath.get(basePath)].filter((task) => Boolean(task))
|
|
236
|
+
: [...deferredContextMaintenanceByBasePath.values()];
|
|
237
|
+
await Promise.allSettled(tasks);
|
|
238
|
+
}
|
|
239
|
+
export async function buildBeforeAgentStartResult(event, ctx) {
|
|
240
|
+
if (!existsSync(join(process.cwd(), ".gsd")))
|
|
241
|
+
return undefined;
|
|
242
|
+
const stopContextTimer = debugTime("context-inject");
|
|
243
|
+
const systemContent = loadPrompt("system", {
|
|
244
|
+
templatesDir: getTemplatesDir(),
|
|
245
|
+
shortcutDashboard: formatShortcut("Ctrl+Alt+G"),
|
|
246
|
+
shortcutShell: formatShortcut("Ctrl+Alt+B"),
|
|
247
|
+
});
|
|
248
|
+
let loadedPreferences = loadEffectiveGSDPreferences();
|
|
249
|
+
try {
|
|
250
|
+
const { markCmuxPromptShown, shouldPromptToEnableCmux } = await import("../../cmux/index.js");
|
|
251
|
+
if (shouldPromptToEnableCmux(loadedPreferences?.preferences)) {
|
|
252
|
+
markCmuxPromptShown();
|
|
253
|
+
if (autoEnableCmuxPreferences()) {
|
|
254
|
+
loadedPreferences = loadEffectiveGSDPreferences();
|
|
255
|
+
ctx.ui.notify("cmux detected — auto-enabled. Run /gsd cmux off to disable.", "info");
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
catch (e) {
|
|
260
|
+
logWarning("bootstrap", `cmux prompt setup skipped: ${e.message}`);
|
|
261
|
+
}
|
|
262
|
+
const ctxProjectRoot = ctx.projectRoot;
|
|
263
|
+
const basePath = typeof ctxProjectRoot === "string" && ctxProjectRoot.length > 0
|
|
264
|
+
? ctxProjectRoot
|
|
265
|
+
: process.cwd();
|
|
266
|
+
let preferenceBlock = "";
|
|
267
|
+
if (loadedPreferences) {
|
|
268
|
+
const cwd = basePath;
|
|
269
|
+
const report = resolveAllSkillReferences(loadedPreferences.preferences, cwd);
|
|
270
|
+
preferenceBlock = `\n\n${renderPreferencesForSystemPrompt(loadedPreferences.preferences, report.resolutions, { includeResolvedPaths: false })}`;
|
|
271
|
+
if (report.warnings.length > 0) {
|
|
272
|
+
ctx.ui.notify(`GSD skill preferences: ${report.warnings.length} unresolved skill${report.warnings.length === 1 ? "" : "s"}: ${report.warnings.join(", ")}`, "warning");
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
await runSessionStartupMaintenanceOnce(basePath, ctx);
|
|
161
276
|
const { block: knowledgeBlock, globalSizeKb } = loadKnowledgeBlock(gsdHome(), basePath);
|
|
162
277
|
if (globalSizeKb > 4) {
|
|
163
278
|
ctx.ui.notify(`GSD: ~/.gsd/agent/KNOWLEDGE.md is ${globalSizeKb.toFixed(1)}KB — consider trimming to keep system prompt lean.`, "warning");
|
|
@@ -180,16 +295,21 @@ export async function buildBeforeAgentStartResult(event, ctx) {
|
|
|
180
295
|
const rawCodebase = readCodebaseMap(process.cwd());
|
|
181
296
|
if (existsSync(codebasePath) && rawCodebase) {
|
|
182
297
|
try {
|
|
183
|
-
|
|
298
|
+
// Strip the volatile `Generated: <timestamp>` header line and the
|
|
299
|
+
// machine-readable `gsd:codebase-meta` comment before injecting. Both
|
|
300
|
+
// embed a per-regeneration timestamp/fingerprint; because this block
|
|
301
|
+
// rides the cached system-prompt prefix, leaving the timestamp in would
|
|
302
|
+
// invalidate the provider KV cache on every map refresh even when the
|
|
303
|
+
// file structure is unchanged. The full map (with timestamp) remains at
|
|
304
|
+
// .gsd/CODEBASE.md. (#847)
|
|
305
|
+
const rawContent = stripVolatileCodebaseMetadata(rawCodebase.trim());
|
|
184
306
|
if (rawContent) {
|
|
185
307
|
// Cap injection size to ~2 000 tokens to avoid bloating every request.
|
|
186
308
|
// Full map is always available at .gsd/CODEBASE.md.
|
|
187
|
-
const generatedMatch = rawContent.match(/Generated: (\S+)/);
|
|
188
|
-
const generatedAt = generatedMatch?.[1] ?? "unknown";
|
|
189
309
|
const content = rawContent.length > DEFAULT_CODEBASE_MAX_CHARS
|
|
190
310
|
? rawContent.slice(0, DEFAULT_CODEBASE_MAX_CHARS) + "\n\n*(truncated — see .gsd/CODEBASE.md for full map)*"
|
|
191
311
|
: rawContent;
|
|
192
|
-
codebaseBlock = `\n\n[PROJECT CODEBASE — File structure and descriptions (
|
|
312
|
+
codebaseBlock = `\n\n[PROJECT CODEBASE — File structure and descriptions (auto-refreshed when GSD detects tracked file changes; use /gsd codebase stats for status)]\n\n${content}`;
|
|
193
313
|
}
|
|
194
314
|
}
|
|
195
315
|
catch (e) {
|
|
@@ -26,8 +26,27 @@ export function registerToolSearchShim(pi) {
|
|
|
26
26
|
return new Text(theme.fg("warning", text), 0, 0);
|
|
27
27
|
},
|
|
28
28
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
// Ensure the shim is part of the active tool set. registerTool() is valid
|
|
30
|
+
// during extension loading, but getActiveTools()/setActiveTools() are stubs
|
|
31
|
+
// that throw "Extension runtime not initialized" until runner.bindCore() runs
|
|
32
|
+
// (after all registerExtension() calls return). When the throw was hit, the
|
|
33
|
+
// catch in register-extension.ts swallowed it — leaving the whole bootstrap
|
|
34
|
+
// partially failed and, under Claude Code CLI, the workflow tools could end
|
|
35
|
+
// up missing from the model's surface, which traps plan-milestone in a
|
|
36
|
+
// finalize-retry loop with no gsd_plan_milestone available.
|
|
37
|
+
//
|
|
38
|
+
// The activation here is also redundant post-bind: ToolSearch is in
|
|
39
|
+
// MINIMAL_AUTO_BASE_TOOL_NAMES, so buildMinimalAutoGsdToolSet adds it during
|
|
40
|
+
// adjust_tool_set (before_agent_start). Tolerate the loading-stub throw so
|
|
41
|
+
// the shim always registers; activation is completed by post-bind scoping.
|
|
42
|
+
try {
|
|
43
|
+
const active = pi.getActiveTools();
|
|
44
|
+
if (!active.includes("ToolSearch")) {
|
|
45
|
+
pi.setActiveTools([...active, "ToolSearch"]);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// Pre-bind runtime: getActiveTools/setActiveTools are not yet wired.
|
|
50
|
+
// The tool is registered; activation happens at adjust_tool_set.
|
|
32
51
|
}
|
|
33
52
|
}
|
|
@@ -10,6 +10,7 @@ import { compileSubagentPermissionContract } from "../unit-context-manifest.js";
|
|
|
10
10
|
import { logWarning } from "../workflow-logger.js";
|
|
11
11
|
import { isGsdWorktreePath, resolveWorktreeProjectRoot } from "../worktree-root.js";
|
|
12
12
|
import { worktreesDirs } from "../worktree-placement.js";
|
|
13
|
+
import { bashReferencesProjectRootOutsideWorktree } from "../worktree-shell-guard.js";
|
|
13
14
|
import { evaluateGateAnswer } from "../consent-verdict.js";
|
|
14
15
|
/**
|
|
15
16
|
* Regex matching milestone CONTEXT.md file names in both legacy M001
|
|
@@ -20,6 +21,12 @@ import { evaluateGateAnswer } from "../consent-verdict.js";
|
|
|
20
21
|
export const MILESTONE_CONTEXT_RE = /M\d+(?:-[a-z0-9]{6})?-CONTEXT\.md$/;
|
|
21
22
|
const CONTEXT_MILESTONE_RE = /(?:^|[/\\])(M\d+(?:-[a-z0-9]{6})?)-CONTEXT\.md$/i;
|
|
22
23
|
const DEPTH_VERIFICATION_MILESTONE_RE = /depth_verification[_-](M\d+(?:-[a-z0-9]{6})?)/i;
|
|
24
|
+
function normalizeMilestoneId(milestoneId) {
|
|
25
|
+
const match = milestoneId.match(/^(M)(\d+)(?:-([a-z0-9]{6}))?$/i);
|
|
26
|
+
if (!match)
|
|
27
|
+
return milestoneId;
|
|
28
|
+
return `M${match[2]}${match[3] ? `-${match[3].toLowerCase()}` : ""}`;
|
|
29
|
+
}
|
|
23
30
|
/**
|
|
24
31
|
* Path segment that identifies .gsd/ planning artifacts.
|
|
25
32
|
* Writes to these paths are allowed during queue mode.
|
|
@@ -189,7 +196,9 @@ function clearPersistedWriteGateSnapshot(basePath) {
|
|
|
189
196
|
function normalizeWriteGateSnapshot(value) {
|
|
190
197
|
const record = value && typeof value === "object" ? value : {};
|
|
191
198
|
const verified = Array.isArray(record.verifiedDepthMilestones)
|
|
192
|
-
? record.verifiedDepthMilestones
|
|
199
|
+
? record.verifiedDepthMilestones
|
|
200
|
+
.filter((item) => typeof item === "string")
|
|
201
|
+
.map(normalizeMilestoneId)
|
|
193
202
|
: [];
|
|
194
203
|
const verifiedGates = Array.isArray(record.verifiedApprovalGates)
|
|
195
204
|
? record.verifiedApprovalGates.filter((item) => typeof item === "string")
|
|
@@ -245,7 +254,7 @@ export function loadWriteGateSnapshot(basePath) {
|
|
|
245
254
|
*/
|
|
246
255
|
function mergeSnapshotIntoState(state, disk) {
|
|
247
256
|
for (const milestone of disk.verifiedDepthMilestones)
|
|
248
|
-
state.verifiedDepthMilestones.add(milestone);
|
|
257
|
+
state.verifiedDepthMilestones.add(normalizeMilestoneId(milestone));
|
|
249
258
|
for (const gate of disk.verifiedApprovalGates ?? [])
|
|
250
259
|
state.verifiedApprovalGates.add(gate);
|
|
251
260
|
state.activeQueuePhase = disk.activeQueuePhase;
|
|
@@ -343,12 +352,12 @@ export function isMilestoneDepthVerified(milestoneId, basePath = process.cwd())
|
|
|
343
352
|
if (!milestoneId)
|
|
344
353
|
return false;
|
|
345
354
|
refreshWriteGateStateFromDisk(basePath);
|
|
346
|
-
return getWriteGateState(basePath).verifiedDepthMilestones.has(milestoneId);
|
|
355
|
+
return getWriteGateState(basePath).verifiedDepthMilestones.has(normalizeMilestoneId(milestoneId));
|
|
347
356
|
}
|
|
348
357
|
export function isMilestoneDepthVerifiedInSnapshot(snapshot, milestoneId) {
|
|
349
358
|
if (!milestoneId)
|
|
350
359
|
return false;
|
|
351
|
-
return snapshot.verifiedDepthMilestones.includes(milestoneId);
|
|
360
|
+
return snapshot.verifiedDepthMilestones.includes(normalizeMilestoneId(milestoneId));
|
|
352
361
|
}
|
|
353
362
|
export function isQueuePhaseActive(basePath = process.cwd()) {
|
|
354
363
|
return getWriteGateState(basePath).activeQueuePhase;
|
|
@@ -400,14 +409,14 @@ export function isGateQuestionId(questionId) {
|
|
|
400
409
|
*/
|
|
401
410
|
export function extractDepthVerificationMilestoneId(questionId) {
|
|
402
411
|
const match = questionId.match(DEPTH_VERIFICATION_MILESTONE_RE);
|
|
403
|
-
return match?.[1]
|
|
412
|
+
return match?.[1] ? normalizeMilestoneId(match[1]) : null;
|
|
404
413
|
}
|
|
405
414
|
/**
|
|
406
415
|
* Extract the milestone ID from a milestone CONTEXT file path.
|
|
407
416
|
*/
|
|
408
417
|
function extractContextMilestoneId(inputPath) {
|
|
409
418
|
const match = inputPath.match(CONTEXT_MILESTONE_RE);
|
|
410
|
-
return match?.[1]
|
|
419
|
+
return match?.[1] ? normalizeMilestoneId(match[1]) : null;
|
|
411
420
|
}
|
|
412
421
|
/**
|
|
413
422
|
* Mark a gate as pending (called when ask_user_questions is invoked with a
|
|
@@ -464,7 +473,7 @@ export const hostWriteGateAdapter = {
|
|
|
464
473
|
if (!milestoneId)
|
|
465
474
|
return;
|
|
466
475
|
mutateWriteGateState(basePath, (state) => {
|
|
467
|
-
state.verifiedDepthMilestones.add(milestoneId);
|
|
476
|
+
state.verifiedDepthMilestones.add(normalizeMilestoneId(milestoneId));
|
|
468
477
|
}, { writer: "host" });
|
|
469
478
|
},
|
|
470
479
|
markApprovalGateVerified(gateId, basePath) {
|
|
@@ -508,7 +517,7 @@ export const childWriteGateAdapter = {
|
|
|
508
517
|
if (!milestoneId)
|
|
509
518
|
return;
|
|
510
519
|
childMutate(basePath, (state) => {
|
|
511
|
-
state.verifiedDepthMilestones.add(milestoneId);
|
|
520
|
+
state.verifiedDepthMilestones.add(normalizeMilestoneId(milestoneId));
|
|
512
521
|
});
|
|
513
522
|
},
|
|
514
523
|
markApprovalGateVerified(gateId, basePath) {
|
|
@@ -621,6 +630,17 @@ function verifyAnsweredGate(basePath, question, fallbackMilestoneId) {
|
|
|
621
630
|
function unresolvedGateResult(verdict, gateId, details) {
|
|
622
631
|
if (verdict === "declined")
|
|
623
632
|
return { status: "declined", gateId };
|
|
633
|
+
if (verdict === "timeout") {
|
|
634
|
+
// Host elicitation expired before the user answered. The gate stays
|
|
635
|
+
// pending (fail-closed — a timeout is never approval), but the status is
|
|
636
|
+
// "timeout" so the caller pauses-and-waits instead of re-asking into the
|
|
637
|
+
// same timeout loop (#852).
|
|
638
|
+
return {
|
|
639
|
+
status: "timeout",
|
|
640
|
+
pendingGateId: gateId,
|
|
641
|
+
interrupted: details.interrupted === true,
|
|
642
|
+
};
|
|
643
|
+
}
|
|
624
644
|
// "waiting" (and the unreachable post-cancel case): an empty selection is
|
|
625
645
|
// not an answer — keep the gate pending and make the caller pause.
|
|
626
646
|
return {
|
|
@@ -645,6 +665,16 @@ export function applyAskUserQuestionsGateResult(options) {
|
|
|
645
665
|
const { basePath, questions, details, fallbackMilestoneId } = options;
|
|
646
666
|
const currentPendingGate = getPendingGate(basePath);
|
|
647
667
|
if (currentPendingGate) {
|
|
668
|
+
if (details.timed_out) {
|
|
669
|
+
// Host elicitation timed out before the user answered. Keep the gate
|
|
670
|
+
// pending (fail-closed) but report "timeout" so the caller pauses-and-
|
|
671
|
+
// waits instead of re-asking into the same timeout loop (#852).
|
|
672
|
+
return {
|
|
673
|
+
status: "timeout",
|
|
674
|
+
pendingGateId: currentPendingGate,
|
|
675
|
+
interrupted: details.interrupted === true,
|
|
676
|
+
};
|
|
677
|
+
}
|
|
648
678
|
if (details.cancelled || !details.response) {
|
|
649
679
|
return {
|
|
650
680
|
status: "waiting",
|
|
@@ -661,6 +691,8 @@ export function applyAskUserQuestionsGateResult(options) {
|
|
|
661
691
|
return unresolvedGateResult(verdict, currentPendingGate, details);
|
|
662
692
|
}
|
|
663
693
|
}
|
|
694
|
+
if (details.timed_out)
|
|
695
|
+
return { status: "not-gate" };
|
|
664
696
|
if (details.cancelled || !details.response)
|
|
665
697
|
return { status: "not-gate" };
|
|
666
698
|
for (const question of questions) {
|
|
@@ -690,12 +722,27 @@ export function formatPendingAskUserQuestionsGateMessage(pendingGateId, interrup
|
|
|
690
722
|
`Re-call ask_user_questions with the same gate question id ("${pendingGateId}") and wait for the user's response.`,
|
|
691
723
|
].join(" ");
|
|
692
724
|
}
|
|
725
|
+
/**
|
|
726
|
+
* Format the LLM-facing message returned when a depth-confirmation gate
|
|
727
|
+
* elicitation times out. Distinct from {@link formatPendingAskUserQuestionsGateMessage}:
|
|
728
|
+
* a timeout must NOT tell the model to immediately re-ask (that re-triggers
|
|
729
|
+
* the same timeout loop). Instead it tells the model to stop, that auto-mode
|
|
730
|
+
* is paused, and that the user will respond on their own (#852).
|
|
731
|
+
*/
|
|
732
|
+
export function formatTimedOutAskUserQuestionsGateMessage(pendingGateId) {
|
|
733
|
+
return [
|
|
734
|
+
`Depth confirmation on gate "${pendingGateId}" timed out waiting for a response.`,
|
|
735
|
+
"The user did not answer within the host elicitation window — do not re-ask in this turn, it will time out again.",
|
|
736
|
+
"Auto-mode is paused. Stop calling tools and wait for the user to respond on a new turn.",
|
|
737
|
+
"When the user replies with confirmation, the gate will be satisfied and work will resume.",
|
|
738
|
+
].join(" ");
|
|
739
|
+
}
|
|
693
740
|
export function shouldBlockContextWrite(toolName, inputPath, milestoneId, _queuePhaseActive, basePath = process.cwd()) {
|
|
694
741
|
if (toolName !== "write")
|
|
695
742
|
return { block: false };
|
|
696
743
|
if (!MILESTONE_CONTEXT_RE.test(inputPath))
|
|
697
744
|
return { block: false };
|
|
698
|
-
const targetMilestoneId = extractContextMilestoneId(inputPath) ?? milestoneId;
|
|
745
|
+
const targetMilestoneId = extractContextMilestoneId(inputPath) ?? (milestoneId ? normalizeMilestoneId(milestoneId) : null);
|
|
699
746
|
if (!targetMilestoneId) {
|
|
700
747
|
return {
|
|
701
748
|
block: true,
|
|
@@ -713,8 +760,8 @@ export function shouldBlockContextWrite(toolName, inputPath, milestoneId, _queue
|
|
|
713
760
|
reason: [
|
|
714
761
|
`HARD BLOCK: Cannot write to milestone CONTEXT.md without depth verification.`,
|
|
715
762
|
`This is a mechanical gate — you MUST NOT proceed, retry, or rationalize past this block.`,
|
|
716
|
-
`Required action: call ask_user_questions with question id
|
|
717
|
-
`The user MUST select the "(Recommended)" confirmation option to unlock this gate.`,
|
|
763
|
+
`Required action: call ask_user_questions with question id "depth_verification_${targetMilestoneId}_confirm".`,
|
|
764
|
+
`The user MUST select the first "(Recommended)" confirmation option to unlock this gate.`,
|
|
718
765
|
`If the user declines, cancels, or the tool fails, you must re-ask — not bypass.`,
|
|
719
766
|
].join(" "),
|
|
720
767
|
};
|
|
@@ -1116,6 +1163,30 @@ function isPathContained(target, container) {
|
|
|
1116
1163
|
return true;
|
|
1117
1164
|
return target.startsWith(container.endsWith(sep) ? container : container + sep);
|
|
1118
1165
|
}
|
|
1166
|
+
function formatWorktreeIsolationBlockReason(tool, displayTarget, isAutoLive, effectiveBasePath) {
|
|
1167
|
+
if (isGsdWorktreePath(effectiveBasePath)) {
|
|
1168
|
+
return [
|
|
1169
|
+
`HARD BLOCK: ${tool} target "${displayTarget}" is outside the active milestone worktree`,
|
|
1170
|
+
`while \`git.isolation: worktree\` is configured. Source edits must stay inside`,
|
|
1171
|
+
`\`.gsd-worktrees/<MID>/\` (or \`.gsd/\` planning artifacts) so the auto-mode commit`,
|
|
1172
|
+
`pipeline captures them. Writing to the project root leaks changes that block milestone merge.`,
|
|
1173
|
+
`Use a relative path under the worktree cwd or an absolute path inside the worktree directory.`,
|
|
1174
|
+
...(isAutoLive ? [] : [
|
|
1175
|
+
"This guard also applies to subagent children spawned from the worktree — do not",
|
|
1176
|
+
"`cd` to the project root or reference its paths in shell commands.",
|
|
1177
|
+
]),
|
|
1178
|
+
].join(" ");
|
|
1179
|
+
}
|
|
1180
|
+
return [
|
|
1181
|
+
`HARD BLOCK: Worktree isolation is configured (\`git.isolation: worktree\`) but auto-mode is`,
|
|
1182
|
+
`not running and the target "${displayTarget}" is not inside \`.gsd/worktrees/<MID>/\`.`,
|
|
1183
|
+
`Code edits at the project root would be lost — only the auto-mode commit pipeline`,
|
|
1184
|
+
`(auto-post-unit) commits work, and it never runs outside the loop.`,
|
|
1185
|
+
`Required action: start auto-mode with \`/gsd\` so the milestone worktree is created,`,
|
|
1186
|
+
`then write inside it. To disable this guard for self-hosting development, set`,
|
|
1187
|
+
`GSD_DISABLE_WORKTREE_WRITE_GUARD=1.`,
|
|
1188
|
+
].join(" ");
|
|
1189
|
+
}
|
|
1119
1190
|
/**
|
|
1120
1191
|
* Block planning-write tool calls that would land code at the project root
|
|
1121
1192
|
* while `git.isolation: worktree` is in effect and auto-mode hasn't created
|
|
@@ -1133,10 +1204,9 @@ function isPathContained(target, container) {
|
|
|
1133
1204
|
* 5. Target is inside `<projectRoot>/.gsd/worktrees/` (a real worktree).
|
|
1134
1205
|
* 6. Target is inside `<projectRoot>/.gsd/` and isn't masquerading as a
|
|
1135
1206
|
* worktrees sibling (rejects the `.gsd/worktrees-extra/…` prefix trick).
|
|
1136
|
-
* 7. Auto is live AND `effectiveBasePath` is itself a `.gsd/worktrees/…` path.
|
|
1137
1207
|
*
|
|
1138
|
-
* Otherwise: block with a message that points the agent at
|
|
1139
|
-
* auto-mode.
|
|
1208
|
+
* Otherwise: block with a message that points the agent at the active worktree
|
|
1209
|
+
* or `/gsd` to start auto-mode.
|
|
1140
1210
|
*/
|
|
1141
1211
|
export function shouldBlockWorktreeWrite(toolName, targetPath, effectiveBasePath, isAutoLive, currentUnitType) {
|
|
1142
1212
|
const tool = canonicalToolName(toolName);
|
|
@@ -1180,24 +1250,40 @@ export function shouldBlockWorktreeWrite(toolName, targetPath, effectiveBasePath
|
|
|
1180
1250
|
return { block: false };
|
|
1181
1251
|
// fall through: looks like worktrees<something> sibling — block
|
|
1182
1252
|
}
|
|
1183
|
-
// Auto is live and the caller is operating inside a worktree path —
|
|
1184
|
-
// host tool's write happens in worktree context; let it through.
|
|
1185
|
-
if (isAutoLive && isGsdWorktreePath(effectiveBasePath))
|
|
1186
|
-
return { block: false };
|
|
1187
1253
|
// Block. Provide enough context that the agent can self-correct.
|
|
1188
1254
|
const displayTarget = isPathContained(realTarget, realRoot)
|
|
1189
1255
|
? relative(realRoot, realTarget) || "."
|
|
1190
1256
|
: realTarget;
|
|
1191
1257
|
return {
|
|
1192
1258
|
block: true,
|
|
1193
|
-
reason:
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1259
|
+
reason: formatWorktreeIsolationBlockReason(tool, displayTarget, isAutoLive, effectiveBasePath),
|
|
1260
|
+
};
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* Block bash commands that reference the project root while executing inside an
|
|
1264
|
+
* active milestone worktree under `git.isolation: worktree`.
|
|
1265
|
+
*
|
|
1266
|
+
* Mirrors the gsd_exec sandbox rule so native bash cannot bypass write/edit gates.
|
|
1267
|
+
*/
|
|
1268
|
+
export function shouldBlockWorktreeBash(command, effectiveBasePath, isAutoLive, currentUnitType) {
|
|
1269
|
+
if (process.env.GSD_DISABLE_WORKTREE_WRITE_GUARD === "1")
|
|
1270
|
+
return { block: false };
|
|
1271
|
+
if (getIsolationMode(effectiveBasePath) !== "worktree")
|
|
1272
|
+
return { block: false };
|
|
1273
|
+
if (currentUnitType && WORKTREE_GATE_BOOTSTRAP_UNITS.has(currentUnitType))
|
|
1274
|
+
return { block: false };
|
|
1275
|
+
// Block whenever the effective cwd is inside a milestone worktree — not only
|
|
1276
|
+
// during live auto-mode. Reactive-execute subagents run as fresh pi children
|
|
1277
|
+
// without an auto session, but still inherit the worktree cwd and must not
|
|
1278
|
+
// shell out to the project root (the native bash bypass that caused root-write leaks).
|
|
1279
|
+
if (!isGsdWorktreePath(effectiveBasePath))
|
|
1280
|
+
return { block: false };
|
|
1281
|
+
if (!command.trim())
|
|
1282
|
+
return { block: false };
|
|
1283
|
+
if (!bashReferencesProjectRootOutsideWorktree(command, effectiveBasePath))
|
|
1284
|
+
return { block: false };
|
|
1285
|
+
return {
|
|
1286
|
+
block: true,
|
|
1287
|
+
reason: formatWorktreeIsolationBlockReason("bash", "project root path reference in shell command", isAutoLive, effectiveBasePath),
|
|
1202
1288
|
};
|
|
1203
1289
|
}
|