@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
|
@@ -0,0 +1,862 @@
|
|
|
1
|
+
// gsd-pi — Unit tests for additional commands (explore, spike, sketch, …)
|
|
2
|
+
// Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>
|
|
3
|
+
|
|
4
|
+
import { describe, test } from "node:test";
|
|
5
|
+
import assert from "node:assert/strict";
|
|
6
|
+
import { existsSync, mkdirSync, mkdtempSync, rmSync } from "node:fs";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { tmpdir } from "node:os";
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
parseCoreFlags,
|
|
12
|
+
slugify,
|
|
13
|
+
nextArtifactId,
|
|
14
|
+
handleExplore,
|
|
15
|
+
handleSpike,
|
|
16
|
+
handleSketch,
|
|
17
|
+
handleMapCodebase,
|
|
18
|
+
handleDocsUpdate,
|
|
19
|
+
handleGraphify,
|
|
20
|
+
handleStats,
|
|
21
|
+
handleProgress,
|
|
22
|
+
handleHealth,
|
|
23
|
+
handleSurface,
|
|
24
|
+
parsePathsFlag,
|
|
25
|
+
parseProgressMode,
|
|
26
|
+
handleCodeReview,
|
|
27
|
+
handleReview,
|
|
28
|
+
handleAuditMilestone,
|
|
29
|
+
handleAuditUat,
|
|
30
|
+
handleAuditFix,
|
|
31
|
+
handleUiReview,
|
|
32
|
+
handleSecurePhase,
|
|
33
|
+
handleValidatePhase,
|
|
34
|
+
handleVerifyWork,
|
|
35
|
+
handlePlanReviewConvergence,
|
|
36
|
+
parseListFlag,
|
|
37
|
+
nextReviewId,
|
|
38
|
+
handleDiscussPhase,
|
|
39
|
+
handlePlanPhase,
|
|
40
|
+
handleExecutePhase,
|
|
41
|
+
handleSpecPhase,
|
|
42
|
+
handleMvpPhase,
|
|
43
|
+
handleUiPhase,
|
|
44
|
+
handleAiIntegrationPhase,
|
|
45
|
+
handleUltraplanPhase,
|
|
46
|
+
handleAutonomous,
|
|
47
|
+
handlePauseWork,
|
|
48
|
+
handleResumeWork,
|
|
49
|
+
handleManager,
|
|
50
|
+
handlePhase,
|
|
51
|
+
handleThread,
|
|
52
|
+
handleWorkstreams,
|
|
53
|
+
handleWorkspace,
|
|
54
|
+
handleMilestoneSummary,
|
|
55
|
+
handleReviewBacklog,
|
|
56
|
+
handleInbox,
|
|
57
|
+
handleImport,
|
|
58
|
+
handleIngestDocs,
|
|
59
|
+
handleProfileUser,
|
|
60
|
+
handleSettings,
|
|
61
|
+
parseAutonomousScope,
|
|
62
|
+
parseInboxFocus,
|
|
63
|
+
} from "../commands-gsd-core.ts";
|
|
64
|
+
import { handleGSDCommand } from "../commands/dispatcher.ts";
|
|
65
|
+
import { withCommandCwd } from "../commands/context.ts";
|
|
66
|
+
import { loadPrompt } from "../prompt-loader.ts";
|
|
67
|
+
|
|
68
|
+
// ─── Mocks ──────────────────────────────────────────────────────────────────
|
|
69
|
+
|
|
70
|
+
function createMockPi() {
|
|
71
|
+
const sent: any[] = [];
|
|
72
|
+
return {
|
|
73
|
+
sent,
|
|
74
|
+
sendMessage(message: any, _opts?: any) {
|
|
75
|
+
sent.push(message);
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function createMockCtx() {
|
|
81
|
+
const notifications: { message: string; level: string }[] = [];
|
|
82
|
+
return {
|
|
83
|
+
notifications,
|
|
84
|
+
ui: {
|
|
85
|
+
notify(message: string, level: string) {
|
|
86
|
+
notifications.push({ message, level });
|
|
87
|
+
},
|
|
88
|
+
custom: async () => {},
|
|
89
|
+
},
|
|
90
|
+
shutdown: async () => {},
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function createMockCtxWithCwd(cwd: string) {
|
|
95
|
+
return {
|
|
96
|
+
...createMockCtx(),
|
|
97
|
+
cwd,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function createTempGsdProject(prefix: string): string {
|
|
102
|
+
const base = mkdtempSync(join(tmpdir(), prefix));
|
|
103
|
+
mkdirSync(join(base, ".gsd"), { recursive: true });
|
|
104
|
+
return base;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function createTempDirectory(prefix: string): string {
|
|
108
|
+
return mkdtempSync(join(tmpdir(), prefix));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async function withTempCommandCwd(
|
|
112
|
+
fn: (ctx: ReturnType<typeof createMockCtxWithCwd>, base: string) => Promise<void>,
|
|
113
|
+
): Promise<void> {
|
|
114
|
+
const base = createTempGsdProject("gsd-core-handler-");
|
|
115
|
+
const ctx = createMockCtxWithCwd(base);
|
|
116
|
+
await withCommandCwd(base, async () => fn(ctx, base));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ─── Pure helpers ───────────────────────────────────────────────────────────
|
|
120
|
+
|
|
121
|
+
describe("parseCoreFlags", () => {
|
|
122
|
+
test("extracts --quick and --text and leaves the idea text", () => {
|
|
123
|
+
const f = parseCoreFlags("auth via magic links --quick --text");
|
|
124
|
+
assert.equal(f.quick, true);
|
|
125
|
+
assert.equal(f.textMode, true);
|
|
126
|
+
assert.equal(f.frontier, false);
|
|
127
|
+
assert.equal(f.text, "auth via magic links");
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
test("frontier mode when input is empty", () => {
|
|
131
|
+
const f = parseCoreFlags("");
|
|
132
|
+
assert.equal(f.frontier, true);
|
|
133
|
+
assert.equal(f.text, "");
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test("frontier mode when the word 'frontier' is given", () => {
|
|
137
|
+
const f = parseCoreFlags("frontier");
|
|
138
|
+
assert.equal(f.frontier, true);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
test("strips recognized flags but keeps unknown words", () => {
|
|
142
|
+
const f = parseCoreFlags("investigate redis --quick for caching");
|
|
143
|
+
assert.equal(f.quick, true);
|
|
144
|
+
assert.equal(f.text, "investigate redis for caching");
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
test("no flags → all off, text preserved", () => {
|
|
148
|
+
const f = parseCoreFlags("a normal idea");
|
|
149
|
+
assert.equal(f.quick, false);
|
|
150
|
+
assert.equal(f.textMode, false);
|
|
151
|
+
assert.equal(f.frontier, false);
|
|
152
|
+
assert.equal(f.text, "a normal idea");
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
describe("slugify", () => {
|
|
157
|
+
test("lowercases and hyphenates", () => {
|
|
158
|
+
assert.equal(slugify("Auth Via Magic Links!"), "auth-via-magic-links");
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
test("truncates to 40 chars on a boundary", () => {
|
|
162
|
+
const long = "a".repeat(80);
|
|
163
|
+
const out = slugify(long);
|
|
164
|
+
assert.ok(out.length <= 40, `expected <= 40 chars, got ${out.length}`);
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
describe("nextArtifactId", () => {
|
|
169
|
+
test("returns 001 when the directory does not exist", () => {
|
|
170
|
+
const id = nextArtifactId("/definitely/not/a/real/path/xyz");
|
|
171
|
+
assert.equal(id, "001");
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// ─── Prompt templates load with the exact vars each handler passes ──────────
|
|
176
|
+
|
|
177
|
+
describe("prompt templates resolve", () => {
|
|
178
|
+
test("explore.md loads with topic only", () => {
|
|
179
|
+
const out = loadPrompt("explore", { topic: "test topic" });
|
|
180
|
+
assert.match(out, /test topic/);
|
|
181
|
+
assert.match(out, /Socratic/i);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
test("spike.md loads with all four vars", () => {
|
|
185
|
+
const out = loadPrompt("spike", {
|
|
186
|
+
input: "an idea",
|
|
187
|
+
quickFlag: "off",
|
|
188
|
+
textFlag: "off",
|
|
189
|
+
frontierFlag: "off",
|
|
190
|
+
spikeId: "001",
|
|
191
|
+
});
|
|
192
|
+
assert.match(out, /an idea/);
|
|
193
|
+
assert.match(out, /001/);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
test("sketch.md loads with all four vars", () => {
|
|
197
|
+
const out = loadPrompt("sketch", {
|
|
198
|
+
input: "a design",
|
|
199
|
+
quickFlag: "off",
|
|
200
|
+
textFlag: "off",
|
|
201
|
+
frontierFlag: "off",
|
|
202
|
+
sketchId: "002",
|
|
203
|
+
});
|
|
204
|
+
assert.match(out, /a design/);
|
|
205
|
+
assert.match(out, /002/);
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
// ─── Handler dispatch (mocked pi + ctx) ──────────────────────────────────────
|
|
210
|
+
|
|
211
|
+
describe("handleExplore", () => {
|
|
212
|
+
test("dispatches an explore prompt via pi.sendMessage", async () => {
|
|
213
|
+
const pi = createMockPi();
|
|
214
|
+
const ctx = createMockCtx();
|
|
215
|
+
await handleExplore("routing strategy", ctx as any, pi as any);
|
|
216
|
+
|
|
217
|
+
assert.equal(pi.sent.length, 1);
|
|
218
|
+
assert.equal(pi.sent[0].customType, "gsd-explore");
|
|
219
|
+
assert.match(pi.sent[0].content, /routing strategy/);
|
|
220
|
+
assert.equal(ctx.notifications[0].level, "info");
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
describe("handleSpike", () => {
|
|
225
|
+
test("dispatches a spike prompt with parsed flags", async () => {
|
|
226
|
+
const pi = createMockPi();
|
|
227
|
+
await withTempCommandCwd(async (ctx, base) => {
|
|
228
|
+
await handleSpike("validate websocket reconnect --quick", ctx as any, pi as any);
|
|
229
|
+
assert.equal(existsSync(join(base, ".gsd", "spikes")), true);
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
assert.equal(pi.sent.length, 1);
|
|
233
|
+
assert.equal(pi.sent[0].customType, "gsd-spike");
|
|
234
|
+
// The idea text is interpolated into a "Spike Input" block; --quick must be
|
|
235
|
+
// stripped from that block (the template's flag docs still mention --quick).
|
|
236
|
+
const content = pi.sent[0].content as string;
|
|
237
|
+
const inputBlock = content.split("## Spike Input")[1].split("## Flags")[0];
|
|
238
|
+
assert.match(inputBlock, /validate websocket reconnect/);
|
|
239
|
+
assert.doesNotMatch(inputBlock, /--quick/);
|
|
240
|
+
// --quick flag is reported as ON elsewhere in the prompt.
|
|
241
|
+
assert.match(content, /`--quick` — ON/);
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
describe("handleSketch", () => {
|
|
246
|
+
test("dispatches a sketch prompt", async () => {
|
|
247
|
+
const pi = createMockPi();
|
|
248
|
+
await withTempCommandCwd(async (ctx, base) => {
|
|
249
|
+
await handleSketch("dashboard empty state", ctx as any, pi as any);
|
|
250
|
+
assert.equal(existsSync(join(base, ".gsd", "sketches")), true);
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
assert.equal(pi.sent.length, 1);
|
|
254
|
+
assert.equal(pi.sent[0].customType, "gsd-sketch");
|
|
255
|
+
assert.match(pi.sent[0].content, /dashboard empty state/);
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
// ─── Batch 2: codebase intelligence ─────────────────────────────────────────
|
|
260
|
+
|
|
261
|
+
describe("parsePathsFlag", () => {
|
|
262
|
+
test("returns the comma-separated paths when valid", () => {
|
|
263
|
+
assert.equal(parsePathsFlag("--paths apps/api,packages/ui"), "apps/api,packages/ui");
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
test("returns empty when no flag present", () => {
|
|
267
|
+
assert.equal(parsePathsFlag("no flag here"), "");
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
test("rejects absolute paths", () => {
|
|
271
|
+
assert.equal(parsePathsFlag("--paths /etc,apps"), "apps");
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
test("rejects parent traversal", () => {
|
|
275
|
+
assert.equal(parsePathsFlag("--paths ../secret,apps"), "apps");
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
test("rejects shell metacharacters", () => {
|
|
279
|
+
assert.equal(parsePathsFlag("--paths apps;rm -rf"), "");
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
describe("parseProgressMode", () => {
|
|
284
|
+
test("default mode", () => {
|
|
285
|
+
assert.equal(parseProgressMode(""), "default");
|
|
286
|
+
});
|
|
287
|
+
test("forensic mode", () => {
|
|
288
|
+
assert.equal(parseProgressMode("--forensic"), "forensic");
|
|
289
|
+
});
|
|
290
|
+
test("next mode", () => {
|
|
291
|
+
assert.equal(parseProgressMode("--next"), "next");
|
|
292
|
+
});
|
|
293
|
+
test("do mode captures the quoted task", () => {
|
|
294
|
+
assert.equal(parseProgressMode('--do "fix the login bug"'), "do: fix the login bug");
|
|
295
|
+
});
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
describe("Batch 2 prompt templates resolve", () => {
|
|
299
|
+
test("map-codebase.md loads with scope + outputDir", () => {
|
|
300
|
+
const out = loadPrompt("map-codebase", { scope: "whole repo", outputDir: ".gsd/codebase" });
|
|
301
|
+
assert.match(out, /whole repo/);
|
|
302
|
+
assert.match(out, /\.gsd\/codebase/);
|
|
303
|
+
});
|
|
304
|
+
test("docs-update.md loads with mode", () => {
|
|
305
|
+
const out = loadPrompt("docs-update", {
|
|
306
|
+
mode: "Default mode",
|
|
307
|
+
process: "Process steps",
|
|
308
|
+
successCriteria: "Success criteria",
|
|
309
|
+
});
|
|
310
|
+
assert.match(out, /Default mode/);
|
|
311
|
+
});
|
|
312
|
+
test("graphify.md loads with action", () => {
|
|
313
|
+
const out = loadPrompt("graphify", { action: "build" });
|
|
314
|
+
assert.match(out, /build/);
|
|
315
|
+
});
|
|
316
|
+
test("stats.md loads with no vars", () => {
|
|
317
|
+
const out = loadPrompt("stats", {});
|
|
318
|
+
assert.match(out, /Project Statistics/i);
|
|
319
|
+
});
|
|
320
|
+
test("progress.md loads with mode", () => {
|
|
321
|
+
const out = loadPrompt("progress", { mode: "default" });
|
|
322
|
+
assert.match(out, /default/);
|
|
323
|
+
});
|
|
324
|
+
test("health.md loads with both flags", () => {
|
|
325
|
+
const out = loadPrompt("health", { repairFlag: "off", contextFlag: "off" });
|
|
326
|
+
assert.match(out, /repair/i);
|
|
327
|
+
});
|
|
328
|
+
test("surface.md loads with action", () => {
|
|
329
|
+
const out = loadPrompt("surface", { action: "status" });
|
|
330
|
+
assert.match(out, /status/);
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
describe("Batch 2 handlers dispatch", () => {
|
|
335
|
+
test("handleMapCodebase dispatches and creates the output dir", async () => {
|
|
336
|
+
const pi = createMockPi();
|
|
337
|
+
await withTempCommandCwd(async (ctx, base) => {
|
|
338
|
+
await handleMapCodebase("--paths src --focus arch", ctx as any, pi as any);
|
|
339
|
+
assert.equal(existsSync(join(base, ".gsd", "codebase")), true);
|
|
340
|
+
});
|
|
341
|
+
assert.equal(pi.sent.length, 1);
|
|
342
|
+
assert.equal(pi.sent[0].customType, "gsd-map-codebase");
|
|
343
|
+
assert.match(pi.sent[0].content, /src/);
|
|
344
|
+
});
|
|
345
|
+
test("handleMapCodebase --focus captures quoted multi-word string", async () => {
|
|
346
|
+
const pi = createMockPi();
|
|
347
|
+
await withTempCommandCwd(async (ctx) => {
|
|
348
|
+
await handleMapCodebase('--focus "auth and routing layer"', ctx as any, pi as any);
|
|
349
|
+
});
|
|
350
|
+
assert.match(pi.sent[0].content, /auth and routing layer/);
|
|
351
|
+
});
|
|
352
|
+
test("handleMapCodebase --focus captures unquoted multi-word string before next flag", async () => {
|
|
353
|
+
const pi = createMockPi();
|
|
354
|
+
await withTempCommandCwd(async (ctx) => {
|
|
355
|
+
await handleMapCodebase("--focus auth layer --paths src", ctx as any, pi as any);
|
|
356
|
+
});
|
|
357
|
+
// The focus text "auth layer" must appear in full; the next flag must not bleed in
|
|
358
|
+
assert.match(pi.sent[0].content, /auth layer/);
|
|
359
|
+
assert.doesNotMatch(pi.sent[0].content, /auth layer --paths/);
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
test("handleDocsUpdate reflects verify-only mode", async () => {
|
|
363
|
+
const pi = createMockPi();
|
|
364
|
+
const ctx = createMockCtx();
|
|
365
|
+
await handleDocsUpdate("--verify-only", ctx as any, pi as any);
|
|
366
|
+
assert.equal(pi.sent[0].customType, "gsd-docs-update");
|
|
367
|
+
assert.match(pi.sent[0].content, /Verify-only/);
|
|
368
|
+
assert.doesNotMatch(pi.sent[0].content, /Write missing canonical docs/);
|
|
369
|
+
assert.doesNotMatch(pi.sent[0].content, /Correct verified inaccuracies directly/);
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
test("handleGraphify defaults to build action", async () => {
|
|
373
|
+
const pi = createMockPi();
|
|
374
|
+
await withTempCommandCwd(async (ctx, base) => {
|
|
375
|
+
await handleGraphify("", ctx as any, pi as any);
|
|
376
|
+
assert.equal(existsSync(join(base, ".gsd", "knowledge")), true);
|
|
377
|
+
});
|
|
378
|
+
assert.match(pi.sent[0].content, /build/);
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
test("handleStats dispatches with no args", async () => {
|
|
382
|
+
const pi = createMockPi();
|
|
383
|
+
const ctx = createMockCtx();
|
|
384
|
+
await handleStats("", ctx as any, pi as any);
|
|
385
|
+
assert.equal(pi.sent[0].customType, "gsd-stats");
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
test("handleProgress forensic mode", async () => {
|
|
389
|
+
const pi = createMockPi();
|
|
390
|
+
const ctx = createMockCtx();
|
|
391
|
+
await handleProgress("--forensic", ctx as any, pi as any);
|
|
392
|
+
assert.match(pi.sent[0].content, /forensic/);
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
test("handleProgress --next redispatches instead of prompt tunneling", async () => {
|
|
396
|
+
const base = createTempDirectory("gsd-progress-next-no-project-");
|
|
397
|
+
try {
|
|
398
|
+
const pi = createMockPi();
|
|
399
|
+
const ctx = createMockCtxWithCwd(base);
|
|
400
|
+
await handleProgress("--next", ctx as any, pi as any);
|
|
401
|
+
assert.equal(pi.sent.length, 0);
|
|
402
|
+
} finally {
|
|
403
|
+
rmSync(base, { recursive: true, force: true });
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
test("handleProgress --do redispatches as quick task (no prompt tunneling)", async () => {
|
|
408
|
+
const base = createTempDirectory("gsd-progress-do-no-project-");
|
|
409
|
+
const origCwd = process.cwd();
|
|
410
|
+
try {
|
|
411
|
+
// handleQuick uses process.cwd() directly, so chdir to a no-.gsd dir to
|
|
412
|
+
// make it exit early (notification only, no pi.sendMessage call).
|
|
413
|
+
process.chdir(base);
|
|
414
|
+
const pi = createMockPi();
|
|
415
|
+
const ctx = createMockCtxWithCwd(base);
|
|
416
|
+
await handleProgress('--do "fix the login bug"', ctx as any, pi as any);
|
|
417
|
+
assert.equal(pi.sent.length, 0);
|
|
418
|
+
// handleQuick emits a notification when no .gsd/ is found
|
|
419
|
+
assert.match(ctx.notifications[0].message, /No \.gsd\/ directory found/);
|
|
420
|
+
} finally {
|
|
421
|
+
process.chdir(origCwd);
|
|
422
|
+
rmSync(base, { recursive: true, force: true });
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
test("handleHealth repair flag on", async () => {
|
|
427
|
+
const pi = createMockPi();
|
|
428
|
+
const ctx = createMockCtx();
|
|
429
|
+
await handleHealth("--repair", ctx as any, pi as any);
|
|
430
|
+
assert.match(pi.sent[0].content, /`--repair` — ON/);
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
test("handleSurface passes the action", async () => {
|
|
434
|
+
const pi = createMockPi();
|
|
435
|
+
const ctx = createMockCtx();
|
|
436
|
+
await handleSurface("profile minimal", ctx as any, pi as any);
|
|
437
|
+
assert.match(pi.sent[0].content, /profile minimal/);
|
|
438
|
+
});
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
// ─── Batch 3: review / audit ────────────────────────────────────────────────
|
|
442
|
+
|
|
443
|
+
describe("parseListFlag", () => {
|
|
444
|
+
test("extracts the value for --files", () => {
|
|
445
|
+
assert.equal(parseListFlag("--files a.ts,b.ts", "--files"), "a.ts,b.ts");
|
|
446
|
+
});
|
|
447
|
+
test("returns empty when flag absent", () => {
|
|
448
|
+
assert.equal(parseListFlag("nothing here", "--files"), "");
|
|
449
|
+
});
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
describe("nextReviewId", () => {
|
|
453
|
+
test("returns 001 when dir missing", () => {
|
|
454
|
+
assert.equal(nextReviewId("/no/such/review/dir/zzz"), "001");
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
describe("Batch 3 prompt templates resolve", () => {
|
|
459
|
+
test("code-review.md loads with all vars", () => {
|
|
460
|
+
const out = loadPrompt("code-review", { scope: "s", depth: "deep", fixMode: "off", reviewId: "001" });
|
|
461
|
+
assert.match(out, /deep/);
|
|
462
|
+
assert.match(out, /001/);
|
|
463
|
+
});
|
|
464
|
+
test("review.md loads with target + reviewers", () => {
|
|
465
|
+
const out = loadPrompt("review", { target: "t", reviewers: "claude, codex" });
|
|
466
|
+
assert.match(out, /claude, codex/);
|
|
467
|
+
});
|
|
468
|
+
test("audit-milestone.md loads with target", () => {
|
|
469
|
+
const out = loadPrompt("audit-milestone", { target: "M001" });
|
|
470
|
+
assert.match(out, /M001/);
|
|
471
|
+
});
|
|
472
|
+
test("audit-uat.md loads with verifyMode", () => {
|
|
473
|
+
const out = loadPrompt("audit-uat", { verifyMode: "off" });
|
|
474
|
+
assert.match(out, /audit/i);
|
|
475
|
+
});
|
|
476
|
+
test("audit-fix.md loads with all vars", () => {
|
|
477
|
+
const out = loadPrompt("audit-fix", { source: "s", severity: "high", maxFixes: "5", dryRun: "off" });
|
|
478
|
+
assert.match(out, /high/);
|
|
479
|
+
});
|
|
480
|
+
test("ui-review.md loads with target + reviewId", () => {
|
|
481
|
+
const out = loadPrompt("ui-review", { target: "t", reviewId: "002" });
|
|
482
|
+
assert.match(out, /002/);
|
|
483
|
+
});
|
|
484
|
+
test("secure-phase.md loads with target", () => {
|
|
485
|
+
const out = loadPrompt("secure-phase", { target: "active slice" });
|
|
486
|
+
assert.match(out, /threat/i);
|
|
487
|
+
});
|
|
488
|
+
test("validate-phase.md loads with target", () => {
|
|
489
|
+
const out = loadPrompt("validate-phase", { target: "active slice" });
|
|
490
|
+
assert.match(out, /validation/i);
|
|
491
|
+
});
|
|
492
|
+
test("verify-work.md loads with target", () => {
|
|
493
|
+
const out = loadPrompt("verify-work", { target: "active slice" });
|
|
494
|
+
assert.match(out, /UAT/i);
|
|
495
|
+
});
|
|
496
|
+
test("plan-review-convergence.md loads with all vars", () => {
|
|
497
|
+
const out = loadPrompt("plan-review-convergence", { target: "plan", reviewers: "claude", maxCycles: "3" });
|
|
498
|
+
assert.match(out, /3/);
|
|
499
|
+
});
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
describe("Batch 3 handlers dispatch", () => {
|
|
503
|
+
test("handleCodeReview depth flag parsed", async () => {
|
|
504
|
+
const pi = createMockPi();
|
|
505
|
+
await withTempCommandCwd(async (ctx, base) => {
|
|
506
|
+
await handleCodeReview("--depth deep --files a.ts", ctx as any, pi as any);
|
|
507
|
+
assert.equal(existsSync(join(base, ".gsd", "reviews")), true);
|
|
508
|
+
});
|
|
509
|
+
assert.equal(pi.sent[0].customType, "gsd-code-review");
|
|
510
|
+
assert.match(pi.sent[0].content, /deep/);
|
|
511
|
+
assert.match(pi.sent[0].content, /a\.ts/);
|
|
512
|
+
});
|
|
513
|
+
test("handleCodeReview fix flag on", async () => {
|
|
514
|
+
const pi = createMockPi();
|
|
515
|
+
await withTempCommandCwd(async (ctx, base) => {
|
|
516
|
+
await handleCodeReview("--fix", ctx as any, pi as any);
|
|
517
|
+
assert.equal(existsSync(join(base, ".gsd", "reviews")), true);
|
|
518
|
+
});
|
|
519
|
+
assert.match(pi.sent[0].content, /Fix mode[\s\S]*ON/);
|
|
520
|
+
});
|
|
521
|
+
test("handleReview milestone + reviewers", async () => {
|
|
522
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
523
|
+
await handleReview("--milestone M014 --claude --codex", ctx as any, pi as any);
|
|
524
|
+
assert.match(pi.sent[0].content, /M014/);
|
|
525
|
+
assert.match(pi.sent[0].content, /claude, codex/);
|
|
526
|
+
});
|
|
527
|
+
test("handleAuditMilestone passes id", async () => {
|
|
528
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
529
|
+
await handleAuditMilestone("M014", ctx as any, pi as any);
|
|
530
|
+
assert.match(pi.sent[0].content, /M014/);
|
|
531
|
+
});
|
|
532
|
+
test("handleAuditUat verify flag", async () => {
|
|
533
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
534
|
+
await handleAuditUat("--verify", ctx as any, pi as any);
|
|
535
|
+
assert.match(pi.sent[0].content, /Verify mode[\s\S]*ON/);
|
|
536
|
+
});
|
|
537
|
+
test("handleAuditFix severity + max + dry-run", async () => {
|
|
538
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
539
|
+
await handleAuditFix("--severity high --max 3 --dry-run", ctx as any, pi as any);
|
|
540
|
+
const c = pi.sent[0].content;
|
|
541
|
+
assert.match(c, /Severity filter[\s\S]*high/);
|
|
542
|
+
assert.match(c, /Max fixes[\s\S]*3/);
|
|
543
|
+
assert.match(c, /Dry run[\s\S]*ON/);
|
|
544
|
+
});
|
|
545
|
+
test("handleUiReview target + reviewId", async () => {
|
|
546
|
+
const pi = createMockPi();
|
|
547
|
+
await withTempCommandCwd(async (ctx, base) => {
|
|
548
|
+
await handleUiReview("dashboard", ctx as any, pi as any);
|
|
549
|
+
assert.equal(existsSync(join(base, ".gsd", "reviews")), true);
|
|
550
|
+
});
|
|
551
|
+
assert.match(pi.sent[0].content, /dashboard/);
|
|
552
|
+
});
|
|
553
|
+
test("handleSecurePhase default target", async () => {
|
|
554
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
555
|
+
await handleSecurePhase("", ctx as any, pi as any);
|
|
556
|
+
assert.equal(pi.sent[0].customType, "gsd-secure-phase");
|
|
557
|
+
});
|
|
558
|
+
test("handleValidatePhase default target", async () => {
|
|
559
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
560
|
+
await handleValidatePhase("", ctx as any, pi as any);
|
|
561
|
+
assert.equal(pi.sent[0].customType, "gsd-validate-phase");
|
|
562
|
+
});
|
|
563
|
+
test("handleVerifyWork default target", async () => {
|
|
564
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
565
|
+
await handleVerifyWork("", ctx as any, pi as any);
|
|
566
|
+
assert.equal(pi.sent[0].customType, "gsd-verify-work");
|
|
567
|
+
});
|
|
568
|
+
test("handlePlanReviewConvergence max-cycles", async () => {
|
|
569
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
570
|
+
await handlePlanReviewConvergence("--max-cycles 5 --all", ctx as any, pi as any);
|
|
571
|
+
assert.match(pi.sent[0].content, /5/);
|
|
572
|
+
assert.match(pi.sent[0].content, /all/);
|
|
573
|
+
});
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
// ─── Batch 4: workflow phases ───────────────────────────────────────────────
|
|
577
|
+
|
|
578
|
+
describe("parseAutonomousScope", () => {
|
|
579
|
+
test("default scope", () => {
|
|
580
|
+
assert.match(parseAutonomousScope(""), /All remaining work on the active milestone/);
|
|
581
|
+
});
|
|
582
|
+
test("only scope", () => {
|
|
583
|
+
assert.equal(parseAutonomousScope("--only 3"), "Only slice/milestone 3");
|
|
584
|
+
});
|
|
585
|
+
test("from/to scope", () => {
|
|
586
|
+
assert.match(parseAutonomousScope("--from 1 --to 4"), /from 1/);
|
|
587
|
+
assert.match(parseAutonomousScope("--from 1 --to 4"), /to 4/);
|
|
588
|
+
});
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
describe("Batch 4 handlers dispatch", () => {
|
|
592
|
+
test("handleDiscussPhase milestone + auto", async () => {
|
|
593
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
594
|
+
await handleDiscussPhase("--milestone M014 --auto", ctx as any, pi as any);
|
|
595
|
+
assert.match(pi.sent[0].content, /M014/);
|
|
596
|
+
assert.match(pi.sent[0].content, /`--auto` — ON/);
|
|
597
|
+
});
|
|
598
|
+
test("handlePlanPhase research flag", async () => {
|
|
599
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
600
|
+
await handlePlanPhase("--research --tdd", ctx as any, pi as any);
|
|
601
|
+
// The research flag line renders the value (research), not the placeholder name.
|
|
602
|
+
assert.match(pi.sent[0].content, /--research` \/ `--skip-research` — research/);
|
|
603
|
+
assert.match(pi.sent[0].content, /`--tdd` — ON/);
|
|
604
|
+
});
|
|
605
|
+
test("handlePlanPhase skip-research flag", async () => {
|
|
606
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
607
|
+
await handlePlanPhase("--skip-research", ctx as any, pi as any);
|
|
608
|
+
assert.match(pi.sent[0].content, /skip-research/);
|
|
609
|
+
});
|
|
610
|
+
test("handleExecutePhase wave + gaps-only", async () => {
|
|
611
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
612
|
+
await handleExecutePhase("--wave 4 --gaps-only", ctx as any, pi as any);
|
|
613
|
+
assert.match(pi.sent[0].content, /4/);
|
|
614
|
+
assert.match(pi.sent[0].content, /`--gaps-only` — ON/);
|
|
615
|
+
});
|
|
616
|
+
test("handleSpecPhase default target", async () => {
|
|
617
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
618
|
+
await handleSpecPhase("", ctx as any, pi as any);
|
|
619
|
+
assert.equal(pi.sent[0].customType, "gsd-spec-phase");
|
|
620
|
+
});
|
|
621
|
+
test("handleMvpPhase target", async () => {
|
|
622
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
623
|
+
await handleMvpPhase("--milestone M002", ctx as any, pi as any);
|
|
624
|
+
assert.match(pi.sent[0].content, /M002/);
|
|
625
|
+
});
|
|
626
|
+
test("handleUiPhase default", async () => {
|
|
627
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
628
|
+
await handleUiPhase("", ctx as any, pi as any);
|
|
629
|
+
assert.equal(pi.sent[0].customType, "gsd-ui-phase");
|
|
630
|
+
});
|
|
631
|
+
test("handleAiIntegrationPhase default", async () => {
|
|
632
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
633
|
+
await handleAiIntegrationPhase("", ctx as any, pi as any);
|
|
634
|
+
assert.equal(pi.sent[0].customType, "gsd-ai-integration-phase");
|
|
635
|
+
});
|
|
636
|
+
test("handleUltraplanPhase default", async () => {
|
|
637
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
638
|
+
await handleUltraplanPhase("", ctx as any, pi as any);
|
|
639
|
+
assert.equal(pi.sent[0].customType, "gsd-ultraplan-phase");
|
|
640
|
+
});
|
|
641
|
+
test("handleAutonomous converge flag", async () => {
|
|
642
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
643
|
+
await handleAutonomous("--converge", ctx as any, pi as any);
|
|
644
|
+
assert.match(pi.sent[0].content, /`--converge` — ON/);
|
|
645
|
+
});
|
|
646
|
+
test("handlePauseWork report flag", async () => {
|
|
647
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
648
|
+
await handlePauseWork("--report", ctx as any, pi as any);
|
|
649
|
+
assert.match(pi.sent[0].content, /`--report` — ON/);
|
|
650
|
+
});
|
|
651
|
+
test("handleResumeWork dispatches", async () => {
|
|
652
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
653
|
+
await handleResumeWork("", ctx as any, pi as any);
|
|
654
|
+
assert.equal(pi.sent[0].customType, "gsd-resume-work");
|
|
655
|
+
});
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
// ─── Batch 5: project management ────────────────────────────────────────────
|
|
659
|
+
|
|
660
|
+
describe("parseInboxFocus", () => {
|
|
661
|
+
test("default both", () => {
|
|
662
|
+
assert.match(parseInboxFocus(""), /issues and PRs \(default\)/);
|
|
663
|
+
});
|
|
664
|
+
test("issues only", () => {
|
|
665
|
+
assert.equal(parseInboxFocus("--issues"), "issues only");
|
|
666
|
+
});
|
|
667
|
+
test("prs only", () => {
|
|
668
|
+
assert.equal(parseInboxFocus("--prs"), "PRs only");
|
|
669
|
+
});
|
|
670
|
+
test("both explicit", () => {
|
|
671
|
+
assert.equal(parseInboxFocus("--issues --prs"), "issues and PRs");
|
|
672
|
+
});
|
|
673
|
+
});
|
|
674
|
+
|
|
675
|
+
describe("Batch 5 handlers dispatch", () => {
|
|
676
|
+
test("handleManager analyze-deps", async () => {
|
|
677
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
678
|
+
await handleManager("--analyze-deps", ctx as any, pi as any);
|
|
679
|
+
assert.match(pi.sent[0].content, /`--analyze-deps` — ON/);
|
|
680
|
+
});
|
|
681
|
+
test("handleManager dispatches without ctx.cwd (no early exit)", async () => {
|
|
682
|
+
// Regression: resolveManagerVars previously returned early when ctx.cwd was absent,
|
|
683
|
+
// skipping the blocker check entirely. Verify the manager still dispatches normally
|
|
684
|
+
// when ctx.cwd is undefined (no blockers active → normal prompt).
|
|
685
|
+
const pi = createMockPi();
|
|
686
|
+
const ctx = { ...createMockCtx(), cwd: undefined };
|
|
687
|
+
await handleManager("", ctx as any, pi as any);
|
|
688
|
+
assert.equal(pi.sent.length, 1);
|
|
689
|
+
assert.equal(pi.sent[0].customType, "gsd-manager");
|
|
690
|
+
});
|
|
691
|
+
test("handlePhase keeps conversational edits prompt-driven", async () => {
|
|
692
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
693
|
+
await handlePhase("edit M001", ctx as any, pi as any);
|
|
694
|
+
assert.equal(pi.sent[0].customType, "gsd-phase");
|
|
695
|
+
assert.match(pi.sent[0].content, /edit M001/);
|
|
696
|
+
});
|
|
697
|
+
test("handlePhase keeps remove prompt-driven for confirmation", async () => {
|
|
698
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
699
|
+
await handlePhase("remove M001", ctx as any, pi as any);
|
|
700
|
+
assert.equal(pi.sent.length, 1);
|
|
701
|
+
assert.equal(pi.sent[0].customType, "gsd-phase");
|
|
702
|
+
assert.match(pi.sent[0].content, /remove M001/);
|
|
703
|
+
});
|
|
704
|
+
test("handlePhase keeps insert prompt-driven for queue positioning", async () => {
|
|
705
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
706
|
+
await handlePhase("insert M002 after M001", ctx as any, pi as any);
|
|
707
|
+
assert.equal(pi.sent.length, 1);
|
|
708
|
+
assert.equal(pi.sent[0].customType, "gsd-phase");
|
|
709
|
+
assert.match(pi.sent[0].content, /insert M002 after M001/);
|
|
710
|
+
});
|
|
711
|
+
test("handlePhase keeps targeted add prompt-driven", async () => {
|
|
712
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
713
|
+
await handlePhase("add M002 after M001", ctx as any, pi as any);
|
|
714
|
+
assert.equal(pi.sent.length, 1);
|
|
715
|
+
assert.equal(pi.sent[0].customType, "gsd-phase");
|
|
716
|
+
assert.match(pi.sent[0].content, /add M002 after M001/);
|
|
717
|
+
});
|
|
718
|
+
test("handleThread close", async () => {
|
|
719
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
720
|
+
await handleThread("close auth-thread", ctx as any, pi as any);
|
|
721
|
+
assert.match(pi.sent[0].content, /close auth-thread/);
|
|
722
|
+
});
|
|
723
|
+
test("handleWorkstreams keeps unknown actions prompt-driven", async () => {
|
|
724
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
725
|
+
await handleWorkstreams("inspect M001", ctx as any, pi as any);
|
|
726
|
+
assert.equal(pi.sent[0].customType, "gsd-workstreams");
|
|
727
|
+
});
|
|
728
|
+
test("dispatcher routes workstreams status through parallel status", async () => {
|
|
729
|
+
const base = createTempGsdProject("gsd-workstreams-route-");
|
|
730
|
+
const pi = createMockPi(); const ctx = createMockCtxWithCwd(base);
|
|
731
|
+
await handleGSDCommand("workstreams status", ctx as any, pi as any);
|
|
732
|
+
assert.equal(pi.sent.length, 1);
|
|
733
|
+
assert.equal(pi.sent[0].customType, "gsd-parallel");
|
|
734
|
+
assert.match(pi.sent[0].content, /No parallel orchestration/);
|
|
735
|
+
});
|
|
736
|
+
test("dispatcher rejects targeted workstreams create", async () => {
|
|
737
|
+
const base = createTempGsdProject("gsd-workstreams-target-");
|
|
738
|
+
const pi = createMockPi(); const ctx = createMockCtxWithCwd(base);
|
|
739
|
+
await handleGSDCommand("workstreams create M001", ctx as any, pi as any);
|
|
740
|
+
assert.equal(pi.sent.length, 0);
|
|
741
|
+
assert.equal(ctx.notifications[0].level, "warning");
|
|
742
|
+
assert.match(ctx.notifications[0].message, /workstreams create does not accept a milestone target/);
|
|
743
|
+
assert.match(ctx.notifications[0].message, /\/gsd parallel start/);
|
|
744
|
+
});
|
|
745
|
+
test("dispatcher rejects targeted workstreams progress", async () => {
|
|
746
|
+
const base = createTempGsdProject("gsd-workstreams-progress-target-");
|
|
747
|
+
const pi = createMockPi(); const ctx = createMockCtxWithCwd(base);
|
|
748
|
+
await handleGSDCommand("workstreams progress M001", ctx as any, pi as any);
|
|
749
|
+
assert.equal(pi.sent.length, 0);
|
|
750
|
+
assert.equal(ctx.notifications[0].level, "warning");
|
|
751
|
+
assert.match(ctx.notifications[0].message, /workstreams progress does not accept a milestone target/);
|
|
752
|
+
assert.match(ctx.notifications[0].message, /\/gsd parallel status/);
|
|
753
|
+
});
|
|
754
|
+
test("dispatcher rejects targeted workstreams switch", async () => {
|
|
755
|
+
const base = createTempGsdProject("gsd-workstreams-switch-target-");
|
|
756
|
+
const pi = createMockPi(); const ctx = createMockCtxWithCwd(base);
|
|
757
|
+
await handleGSDCommand("workstreams switch M001", ctx as any, pi as any);
|
|
758
|
+
assert.equal(pi.sent.length, 0);
|
|
759
|
+
assert.equal(ctx.notifications[0].level, "warning");
|
|
760
|
+
assert.match(ctx.notifications[0].message, /workstreams switch does not accept a milestone target/);
|
|
761
|
+
assert.match(ctx.notifications[0].message, /\/gsd parallel watch/);
|
|
762
|
+
});
|
|
763
|
+
test("handleWorkspace rejects unsupported new action", async () => {
|
|
764
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
765
|
+
await handleWorkspace("--new experiment", ctx as any, pi as any);
|
|
766
|
+
assert.equal(pi.sent.length, 0);
|
|
767
|
+
assert.equal(ctx.notifications[0].level, "warning");
|
|
768
|
+
assert.match(ctx.notifications[0].message, /Unsupported workspace action/);
|
|
769
|
+
});
|
|
770
|
+
test("dispatcher routes workspace list through worktree list", async () => {
|
|
771
|
+
const base = createTempGsdProject("gsd-workspace-route-");
|
|
772
|
+
const pi = createMockPi(); const ctx = createMockCtxWithCwd(base);
|
|
773
|
+
await handleGSDCommand("workspace --list", ctx as any, pi as any);
|
|
774
|
+
assert.equal(pi.sent.length, 0);
|
|
775
|
+
assert.match(ctx.notifications.at(-1)?.message ?? "", /No worktrees/);
|
|
776
|
+
});
|
|
777
|
+
test("dispatcher routes phase list through queue status", async () => {
|
|
778
|
+
const base = createTempGsdProject("gsd-phase-route-");
|
|
779
|
+
const pi = createMockPi(); const ctx = createMockCtxWithCwd(base);
|
|
780
|
+
await handleGSDCommand("phase list", ctx as any, pi as any);
|
|
781
|
+
assert.equal(pi.sent.length, 0);
|
|
782
|
+
assert.match(ctx.notifications.at(-1)?.message ?? "", /No milestones exist/);
|
|
783
|
+
});
|
|
784
|
+
test("handleMilestoneSummary target", async () => {
|
|
785
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
786
|
+
await handleMilestoneSummary("M014", ctx as any, pi as any);
|
|
787
|
+
assert.match(pi.sent[0].content, /M014/);
|
|
788
|
+
});
|
|
789
|
+
test("handleReviewBacklog dispatches", async () => {
|
|
790
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
791
|
+
await handleReviewBacklog("", ctx as any, pi as any);
|
|
792
|
+
assert.equal(pi.sent[0].customType, "gsd-review-backlog");
|
|
793
|
+
});
|
|
794
|
+
test("handleInbox repo + focus", async () => {
|
|
795
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
796
|
+
await handleInbox("--issues --repo open-gsd/other", ctx as any, pi as any);
|
|
797
|
+
assert.match(pi.sent[0].content, /issues only/);
|
|
798
|
+
assert.match(pi.sent[0].content, /open-gsd\/other/);
|
|
799
|
+
});
|
|
800
|
+
test("handleInbox passes label filter into the prompt", async () => {
|
|
801
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
802
|
+
await handleInbox("--label customer-bug", ctx as any, pi as any);
|
|
803
|
+
assert.match(pi.sent[0].content, /customer-bug/);
|
|
804
|
+
});
|
|
805
|
+
test("handleInbox passes quoted multi-word label filter into the prompt", async () => {
|
|
806
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
807
|
+
await handleInbox('--label "help wanted" --close-incomplete', ctx as any, pi as any);
|
|
808
|
+
assert.match(pi.sent[0].content, /help wanted/);
|
|
809
|
+
assert.doesNotMatch(pi.sent[0].content, /"help/);
|
|
810
|
+
});
|
|
811
|
+
test("handleInbox warns when label value is missing before another flag", async () => {
|
|
812
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
813
|
+
await handleInbox("--label --close-incomplete", ctx as any, pi as any);
|
|
814
|
+
assert.equal(pi.sent.length, 0);
|
|
815
|
+
assert.equal(ctx.notifications[0].level, "warning");
|
|
816
|
+
assert.match(ctx.notifications[0].message, /--label requires a value/);
|
|
817
|
+
});
|
|
818
|
+
test("handleInbox warns when repo value is missing before another flag", async () => {
|
|
819
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
820
|
+
await handleInbox("--repo --close-incomplete", ctx as any, pi as any);
|
|
821
|
+
assert.equal(pi.sent.length, 0);
|
|
822
|
+
assert.equal(ctx.notifications[0].level, "warning");
|
|
823
|
+
assert.match(ctx.notifications[0].message, /--repo requires a value/);
|
|
824
|
+
});
|
|
825
|
+
test("handleImport from file", async () => {
|
|
826
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
827
|
+
await handleImport("--from plan.md", ctx as any, pi as any);
|
|
828
|
+
assert.match(pi.sent[0].content, /plan\.md/);
|
|
829
|
+
});
|
|
830
|
+
test("handleImport from-gsd2", async () => {
|
|
831
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
832
|
+
await handleImport("--from-gsd2", ctx as any, pi as any);
|
|
833
|
+
assert.match(pi.sent[0].content, /\.planning/);
|
|
834
|
+
});
|
|
835
|
+
test("handleImport --resolve auto is threaded into prompt", async () => {
|
|
836
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
837
|
+
await handleImport("--from plan.md --resolve auto", ctx as any, pi as any);
|
|
838
|
+
assert.match(pi.sent[0].content, /auto/);
|
|
839
|
+
});
|
|
840
|
+
test("handleImport defaults to interactive resolve mode", async () => {
|
|
841
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
842
|
+
await handleImport("--from plan.md", ctx as any, pi as any);
|
|
843
|
+
assert.match(pi.sent[0].content, /interactive/);
|
|
844
|
+
});
|
|
845
|
+
test("handleIngestDocs mode + manifest", async () => {
|
|
846
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
847
|
+
await handleIngestDocs("docs/ --mode merge --manifest docs/m.json", ctx as any, pi as any);
|
|
848
|
+
const c = pi.sent[0].content;
|
|
849
|
+
assert.match(c, /merge/);
|
|
850
|
+
assert.match(c, /m\.json/);
|
|
851
|
+
});
|
|
852
|
+
test("handleProfileUser questionnaire", async () => {
|
|
853
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
854
|
+
await handleProfileUser("--questionnaire", ctx as any, pi as any);
|
|
855
|
+
assert.match(pi.sent[0].content, /`--questionnaire` — ON/);
|
|
856
|
+
});
|
|
857
|
+
test("handleSettings dispatches", async () => {
|
|
858
|
+
const pi = createMockPi(); const ctx = createMockCtx();
|
|
859
|
+
await handleSettings("", ctx as any, pi as any);
|
|
860
|
+
assert.equal(pi.sent[0].customType, "gsd-settings");
|
|
861
|
+
});
|
|
862
|
+
});
|