gsd-pi 2.75.0-dev.063e5a3 → 2.75.0-dev.96d4bb599
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 +186 -149
- package/dist/claude-cli-check.d.ts +10 -0
- package/dist/claude-cli-check.js +13 -3
- package/dist/headless-events.d.ts +1 -1
- package/dist/headless-events.js +5 -2
- package/dist/headless.js +5 -6
- package/dist/loader.js +0 -0
- package/dist/onboarding.d.ts +20 -1
- package/dist/onboarding.js +99 -39
- package/dist/resources/extensions/ask-user-questions.js +17 -5
- package/dist/resources/extensions/claude-code-cli/models.js +9 -0
- package/dist/resources/extensions/claude-code-cli/readiness.js +12 -2
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +76 -4
- package/dist/resources/extensions/gsd/auto/detect-stuck.js +9 -0
- package/dist/resources/extensions/gsd/auto/loop.js +67 -4
- package/dist/resources/extensions/gsd/auto/phases.js +70 -47
- package/dist/resources/extensions/gsd/auto/resolve.js +1 -1
- package/dist/resources/extensions/gsd/auto/run-unit.js +10 -1
- package/dist/resources/extensions/gsd/auto/session.js +5 -0
- package/dist/resources/extensions/gsd/auto-artifact-paths.js +20 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +15 -7
- package/dist/resources/extensions/gsd/auto-dispatch.js +112 -6
- package/dist/resources/extensions/gsd/auto-loop.js +1 -1
- package/dist/resources/extensions/gsd/auto-model-selection.js +11 -3
- package/dist/resources/extensions/gsd/auto-post-unit.js +10 -8
- package/dist/resources/extensions/gsd/auto-prompts.js +173 -39
- package/dist/resources/extensions/gsd/auto-recovery.js +57 -0
- package/dist/resources/extensions/gsd/auto-start.js +5 -3
- package/dist/resources/extensions/gsd/auto-verification.js +3 -3
- package/dist/resources/extensions/gsd/auto-worktree.js +55 -1
- package/dist/resources/extensions/gsd/auto.js +57 -25
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +8 -21
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +45 -23
- package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +128 -0
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +29 -0
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +2 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +22 -0
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +17 -4
- package/dist/resources/extensions/gsd/commands/catalog.js +81 -9
- package/dist/resources/extensions/gsd/commands/handlers/core.js +64 -24
- package/dist/resources/extensions/gsd/commands/handlers/escalate.js +171 -0
- package/dist/resources/extensions/gsd/commands/handlers/onboarding.js +159 -0
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +21 -0
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +228 -29
- package/dist/resources/extensions/gsd/commands-cmux.js +5 -2
- package/dist/resources/extensions/gsd/commands-config.js +5 -0
- package/dist/resources/extensions/gsd/commands-debug.js +388 -0
- package/dist/resources/extensions/gsd/commands-do.js +1 -0
- package/dist/resources/extensions/gsd/commands-extract-learnings.js +233 -75
- package/dist/resources/extensions/gsd/commands-handlers.js +21 -2
- package/dist/resources/extensions/gsd/commands-memory.js +462 -0
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +40 -12
- package/dist/resources/extensions/gsd/commands-scan.js +94 -0
- package/dist/resources/extensions/gsd/commands-workflow-templates.js +101 -2
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +74 -54
- package/dist/resources/extensions/gsd/db-writer.js +1 -0
- package/dist/resources/extensions/gsd/debug-session-store.js +238 -0
- package/dist/resources/extensions/gsd/definition-loader.js +7 -0
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +9 -9
- package/dist/resources/extensions/gsd/doctor-environment.js +2 -1
- package/dist/resources/extensions/gsd/doctor-git-checks.js +5 -1
- package/dist/resources/extensions/gsd/doctor-proactive.js +4 -1
- package/dist/resources/extensions/gsd/doctor-providers.js +48 -20
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +22 -4
- package/dist/resources/extensions/gsd/doctor.js +7 -1
- package/dist/resources/extensions/gsd/error-classifier.js +6 -3
- package/dist/resources/extensions/gsd/escalation.js +321 -0
- package/dist/resources/extensions/gsd/forensics.js +26 -29
- package/dist/resources/extensions/gsd/git-service.js +0 -1
- package/dist/resources/extensions/gsd/graph.js +26 -2
- package/dist/resources/extensions/gsd/gsd-db.js +490 -32
- package/dist/resources/extensions/gsd/health-widget-core.js +42 -14
- package/dist/resources/extensions/gsd/health-widget.js +7 -4
- package/dist/resources/extensions/gsd/init-wizard.js +86 -45
- package/dist/resources/extensions/gsd/markdown-renderer.js +5 -5
- package/dist/resources/extensions/gsd/memory-embeddings.js +219 -0
- package/dist/resources/extensions/gsd/memory-extractor.js +78 -27
- package/dist/resources/extensions/gsd/memory-ingest.js +218 -0
- package/dist/resources/extensions/gsd/memory-relations.js +189 -0
- package/dist/resources/extensions/gsd/memory-source-store.js +113 -0
- package/dist/resources/extensions/gsd/memory-store.js +299 -6
- package/dist/resources/extensions/gsd/metrics.js +1 -0
- package/dist/resources/extensions/gsd/model-cost-table.js +3 -1
- package/dist/resources/extensions/gsd/model-router.js +16 -6
- package/dist/resources/extensions/gsd/native-git-bridge.js +137 -5
- package/dist/resources/extensions/gsd/notification-overlay.js +7 -22
- package/dist/resources/extensions/gsd/notification-widget.js +24 -39
- package/dist/resources/extensions/gsd/notifications.js +4 -0
- package/dist/resources/extensions/gsd/onboarding-state.js +133 -0
- package/dist/resources/extensions/gsd/post-execution-checks.js +27 -11
- package/dist/resources/extensions/gsd/pre-execution-checks.js +97 -4
- package/dist/resources/extensions/gsd/preferences-models.js +1 -0
- package/dist/resources/extensions/gsd/preferences-types.js +2 -1
- package/dist/resources/extensions/gsd/preferences-validation.js +42 -8
- package/dist/resources/extensions/gsd/preferences.js +10 -10
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +4 -1
- package/dist/resources/extensions/gsd/prompts/debug-diagnose.md +25 -0
- package/dist/resources/extensions/gsd/prompts/debug-session-manager.md +80 -0
- package/dist/resources/extensions/gsd/prompts/execute-task.md +12 -0
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +12 -0
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +69 -0
- package/dist/resources/extensions/gsd/prompts/scan.md +79 -0
- package/dist/resources/extensions/gsd/prompts/workflow-oneshot.md +26 -0
- package/dist/resources/extensions/gsd/python-resolver.js +70 -0
- package/dist/resources/extensions/gsd/run-manager.js +37 -17
- package/dist/resources/extensions/gsd/setup-catalog.js +75 -0
- package/dist/resources/extensions/gsd/state.js +47 -3
- package/dist/resources/extensions/gsd/templates/PREFERENCES.md +7 -7
- package/dist/resources/extensions/gsd/tools/complete-task.js +80 -0
- package/dist/resources/extensions/gsd/tools/memory-tools.js +306 -0
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +37 -12
- package/dist/resources/extensions/gsd/tools/plan-slice.js +5 -2
- package/dist/resources/extensions/gsd/tools/skip-slice.js +78 -0
- package/dist/resources/extensions/gsd/uok/flags.js +7 -7
- package/dist/resources/extensions/gsd/uok/kernel.js +8 -3
- package/dist/resources/extensions/gsd/verification-gate.js +2 -1
- package/dist/resources/extensions/gsd/workflow-dispatch.js +64 -0
- package/dist/resources/extensions/gsd/workflow-install.js +327 -0
- package/dist/resources/extensions/gsd/workflow-manifest.js +8 -0
- package/dist/resources/extensions/gsd/workflow-mcp.js +1 -6
- package/dist/resources/extensions/gsd/workflow-plugins.js +346 -0
- package/dist/resources/extensions/gsd/workflow-projections.js +17 -15
- package/dist/resources/extensions/gsd/workflow-templates/accessibility-audit.md +88 -0
- package/dist/resources/extensions/gsd/workflow-templates/api-breaking-change.md +117 -0
- package/dist/resources/extensions/gsd/workflow-templates/bugfix.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/changelog-gen.md +82 -0
- package/dist/resources/extensions/gsd/workflow-templates/ci-bootstrap.md +144 -0
- package/dist/resources/extensions/gsd/workflow-templates/dead-code.md +81 -0
- package/dist/resources/extensions/gsd/workflow-templates/dep-upgrade.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/docs-sync.yaml +76 -0
- package/dist/resources/extensions/gsd/workflow-templates/env-audit.yaml +88 -0
- package/dist/resources/extensions/gsd/workflow-templates/full-project.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/hotfix.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/issue-triage.md +84 -0
- package/dist/resources/extensions/gsd/workflow-templates/observability-setup.md +133 -0
- package/dist/resources/extensions/gsd/workflow-templates/onboarding-check.md +74 -0
- package/dist/resources/extensions/gsd/workflow-templates/performance-audit.md +125 -0
- package/dist/resources/extensions/gsd/workflow-templates/pr-review.md +67 -0
- package/dist/resources/extensions/gsd/workflow-templates/pr-triage.md +83 -0
- package/dist/resources/extensions/gsd/workflow-templates/refactor.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/registry.json +184 -0
- package/dist/resources/extensions/gsd/workflow-templates/release.md +118 -0
- package/dist/resources/extensions/gsd/workflow-templates/rename-symbol.yaml +99 -0
- package/dist/resources/extensions/gsd/workflow-templates/security-audit.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/small-feature.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/spike.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/test-backfill.yaml +73 -0
- package/dist/resources/extensions/gsd/worktree-resolver.js +42 -1
- package/dist/resources/extensions/remote-questions/commands.js +380 -0
- package/dist/resources/extensions/remote-questions/manager.js +39 -5
- package/dist/resources/extensions/remote-questions/telegram-adapter.js +79 -4
- package/dist/resources/extensions/shared/interview-ui.js +189 -1
- package/dist/resources/extensions/shared/layout-utils.js +17 -0
- package/dist/resources/extensions/shared/rtk-shared.js +47 -0
- package/dist/resources/extensions/shared/rtk.js +3 -46
- package/dist/resources/skills/create-workflow/SKILL.md +33 -6
- package/dist/rtk-shared.d.ts +10 -0
- package/dist/rtk-shared.js +47 -0
- package/dist/rtk.d.ts +2 -6
- package/dist/rtk.js +3 -48
- package/dist/shared/workspace-types.d.ts +52 -0
- package/dist/shared/workspace-types.js +1 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/update-check.d.ts +10 -0
- package/dist/update-check.js +24 -3
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +5 -5
- 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 +2 -2
- package/dist/web/standalone/.next/required-server-files.json +1 -1
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +2 -2
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +3 -3
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- 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 +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +5 -5
- package/dist/web/standalone/.next/server/chunks/6897.js +2 -2
- package/dist/web/standalone/.next/server/chunks/7461.js +1 -0
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
- 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/2826.e59e8578e2e28639.js +9 -0
- package/dist/web/standalone/.next/static/chunks/{2008.71ee9230ad78df21.js → 3621.fc7480022c972438.js} +2 -2
- package/dist/web/standalone/.next/static/chunks/app/{page-f1e30ab6bb269149.js → page-5b113fd32bc2a1c3.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/{webpack-b868033a5834586d.js → webpack-5fc74f13a25fa1bb.js} +1 -1
- package/dist/web/standalone/.next/static/css/632cd626b1731d88.css +1 -0
- package/dist/web/standalone/server.js +1 -1
- package/dist/welcome-screen.js +48 -24
- package/dist/wizard.js +2 -2
- package/dist/worktree-cli.d.ts +6 -5
- package/dist/worktree-cli.js +23 -7
- package/package.json +3 -3
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +12 -10
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/session-manager.d.ts.map +1 -1
- package/packages/mcp-server/dist/session-manager.js +8 -1
- package/packages/mcp-server/dist/session-manager.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts +1 -0
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +113 -14
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/mcp-server.test.ts +40 -4
- package/packages/mcp-server/src/server.ts +12 -10
- package/packages/mcp-server/src/session-manager.ts +10 -3
- package/packages/mcp-server/src/workflow-tools.test.ts +91 -1
- package/packages/mcp-server/src/workflow-tools.ts +128 -18
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/models/capability-patches.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/capability-patches.js +3 -2
- package/packages/pi-ai/dist/models/capability-patches.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts +68 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.js +68 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/anthropic.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/anthropic.js +17 -0
- package/packages/pi-ai/dist/models/generated/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/google-antigravity.js +17 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/groq.d.ts +0 -153
- package/packages/pi-ai/dist/models/generated/groq.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/groq.js +0 -153
- package/packages/pi-ai/dist/models/generated/groq.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/index.d.ts +136 -153
- package/packages/pi-ai/dist/models/generated/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openai-codex.js +17 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/openrouter.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/openrouter.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openrouter.js +17 -0
- package/packages/pi-ai/dist/models/generated/openrouter.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.test.js +17 -0
- package/packages/pi-ai/dist/models.generated.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts +22 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.js +40 -6
- package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.js +106 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +42 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +20 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +32 -2
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js +12 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +11 -0
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +18 -1
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/openai-codex.js +12 -0
- package/packages/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/scripts/generate-models.ts +50 -0
- package/packages/pi-ai/src/models/capability-patches.ts +5 -2
- package/packages/pi-ai/src/models/generated/amazon-bedrock.ts +68 -0
- package/packages/pi-ai/src/models/generated/anthropic.ts +17 -0
- package/packages/pi-ai/src/models/generated/google-antigravity.ts +17 -0
- package/packages/pi-ai/src/models/generated/groq.ts +0 -153
- package/packages/pi-ai/src/models/generated/openai-codex.ts +17 -0
- package/packages/pi-ai/src/models/generated/openrouter.ts +17 -0
- package/packages/pi-ai/src/models.generated.test.ts +17 -0
- package/packages/pi-ai/src/providers/amazon-bedrock.test.ts +164 -0
- package/packages/pi-ai/src/providers/amazon-bedrock.ts +41 -7
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +47 -1
- package/packages/pi-ai/src/providers/anthropic-shared.test.ts +15 -1
- package/packages/pi-ai/src/providers/anthropic-shared.ts +36 -3
- package/packages/pi-ai/src/providers/anthropic.ts +19 -1
- package/packages/pi-ai/src/utils/oauth/openai-codex.ts +15 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +38 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +14 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js +34 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js +74 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +4 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +32 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +32 -0
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js +2 -2
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +17 -7
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +48 -34
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +83 -33
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +70 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +77 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +1 -66
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +1 -75
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +192 -24
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +56 -0
- package/packages/pi-coding-agent/src/core/auth-storage.test.ts +83 -0
- package/packages/pi-coding-agent/src/core/auth-storage.ts +35 -0
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +4 -1
- package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +37 -1
- package/packages/pi-coding-agent/src/core/sdk.ts +41 -0
- package/packages/pi-coding-agent/src/core/skill-tool.test.ts +2 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +19 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +53 -31
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +88 -36
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.ts +83 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +2 -83
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +208 -27
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
- package/pkg/dist/modes/interactive/theme/theme-schema.d.ts +70 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.js +77 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.js.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme.d.ts +1 -66
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +1 -75
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.js +192 -24
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
- package/src/resources/extensions/ask-user-questions.ts +24 -6
- package/src/resources/extensions/claude-code-cli/models.ts +9 -0
- package/src/resources/extensions/claude-code-cli/readiness.ts +13 -2
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +94 -4
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +84 -0
- package/src/resources/extensions/gsd/auto/detect-stuck.ts +10 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +1 -0
- package/src/resources/extensions/gsd/auto/loop.ts +109 -3
- package/src/resources/extensions/gsd/auto/phases.ts +94 -60
- package/src/resources/extensions/gsd/auto/resolve.ts +1 -1
- package/src/resources/extensions/gsd/auto/run-unit.ts +11 -1
- package/src/resources/extensions/gsd/auto/session.ts +7 -0
- package/src/resources/extensions/gsd/auto-artifact-paths.ts +20 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +21 -4
- package/src/resources/extensions/gsd/auto-dispatch.ts +123 -5
- package/src/resources/extensions/gsd/auto-loop.ts +1 -1
- package/src/resources/extensions/gsd/auto-model-selection.ts +14 -3
- package/src/resources/extensions/gsd/auto-post-unit.ts +10 -8
- package/src/resources/extensions/gsd/auto-prompts.ts +201 -40
- package/src/resources/extensions/gsd/auto-recovery.ts +63 -1
- package/src/resources/extensions/gsd/auto-start.ts +8 -6
- package/src/resources/extensions/gsd/auto-verification.ts +3 -3
- package/src/resources/extensions/gsd/auto-worktree.ts +65 -0
- package/src/resources/extensions/gsd/auto.ts +61 -28
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +8 -21
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +46 -24
- package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +158 -0
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +31 -0
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +2 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +22 -0
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +20 -4
- package/src/resources/extensions/gsd/commands/catalog.ts +74 -9
- package/src/resources/extensions/gsd/commands/handlers/core.ts +69 -27
- package/src/resources/extensions/gsd/commands/handlers/escalate.ts +216 -0
- package/src/resources/extensions/gsd/commands/handlers/onboarding.ts +196 -0
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +21 -0
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +279 -29
- package/src/resources/extensions/gsd/commands-cmux.ts +6 -2
- package/src/resources/extensions/gsd/commands-config.ts +10 -0
- package/src/resources/extensions/gsd/commands-debug.ts +484 -0
- package/src/resources/extensions/gsd/commands-do.ts +1 -0
- package/src/resources/extensions/gsd/commands-extract-learnings.ts +295 -76
- package/src/resources/extensions/gsd/commands-handlers.ts +19 -2
- package/src/resources/extensions/gsd/commands-memory.ts +551 -0
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +49 -12
- package/src/resources/extensions/gsd/commands-scan.ts +125 -0
- package/src/resources/extensions/gsd/commands-workflow-templates.ts +129 -2
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +85 -60
- package/src/resources/extensions/gsd/db-writer.ts +3 -0
- package/src/resources/extensions/gsd/debug-session-store.ts +377 -0
- package/src/resources/extensions/gsd/definition-loader.ts +7 -0
- package/src/resources/extensions/gsd/docs/preferences-reference.md +9 -9
- package/src/resources/extensions/gsd/doctor-environment.ts +2 -1
- package/src/resources/extensions/gsd/doctor-git-checks.ts +5 -1
- package/src/resources/extensions/gsd/doctor-proactive.ts +4 -1
- package/src/resources/extensions/gsd/doctor-providers.ts +52 -22
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +23 -4
- package/src/resources/extensions/gsd/doctor-types.ts +1 -0
- package/src/resources/extensions/gsd/doctor.ts +7 -1
- package/src/resources/extensions/gsd/error-classifier.ts +6 -3
- package/src/resources/extensions/gsd/escalation.ts +367 -0
- package/src/resources/extensions/gsd/forensics.ts +25 -29
- package/src/resources/extensions/gsd/git-service.ts +0 -1
- package/src/resources/extensions/gsd/graph.ts +33 -3
- package/src/resources/extensions/gsd/gsd-db.ts +578 -32
- package/src/resources/extensions/gsd/health-widget-core.ts +43 -14
- package/src/resources/extensions/gsd/health-widget.ts +7 -3
- package/src/resources/extensions/gsd/init-wizard.ts +87 -54
- package/src/resources/extensions/gsd/markdown-renderer.ts +5 -5
- package/src/resources/extensions/gsd/memory-embeddings.ts +235 -0
- package/src/resources/extensions/gsd/memory-extractor.ts +100 -34
- package/src/resources/extensions/gsd/memory-ingest.ts +286 -0
- package/src/resources/extensions/gsd/memory-relations.ts +240 -0
- package/src/resources/extensions/gsd/memory-source-store.ts +138 -0
- package/src/resources/extensions/gsd/memory-store.ts +351 -7
- package/src/resources/extensions/gsd/metrics.ts +1 -0
- package/src/resources/extensions/gsd/model-cost-table.ts +3 -1
- package/src/resources/extensions/gsd/model-router.ts +25 -6
- package/src/resources/extensions/gsd/native-git-bridge.ts +134 -6
- package/src/resources/extensions/gsd/notification-overlay.ts +9 -19
- package/src/resources/extensions/gsd/notification-widget.ts +25 -43
- package/src/resources/extensions/gsd/notifications.ts +6 -0
- package/src/resources/extensions/gsd/onboarding-state.ts +146 -0
- package/src/resources/extensions/gsd/post-execution-checks.ts +37 -14
- package/src/resources/extensions/gsd/pre-execution-checks.ts +98 -8
- package/src/resources/extensions/gsd/preferences-models.ts +1 -0
- package/src/resources/extensions/gsd/preferences-types.ts +10 -2
- package/src/resources/extensions/gsd/preferences-validation.ts +33 -7
- package/src/resources/extensions/gsd/preferences.ts +10 -10
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +4 -1
- package/src/resources/extensions/gsd/prompts/debug-diagnose.md +25 -0
- package/src/resources/extensions/gsd/prompts/debug-session-manager.md +80 -0
- package/src/resources/extensions/gsd/prompts/execute-task.md +12 -0
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +12 -0
- package/src/resources/extensions/gsd/prompts/refine-slice.md +69 -0
- package/src/resources/extensions/gsd/prompts/scan.md +79 -0
- package/src/resources/extensions/gsd/prompts/workflow-oneshot.md +26 -0
- package/src/resources/extensions/gsd/python-resolver.ts +76 -0
- package/src/resources/extensions/gsd/run-manager.ts +53 -19
- package/src/resources/extensions/gsd/setup-catalog.ts +105 -0
- package/src/resources/extensions/gsd/state.ts +50 -2
- package/src/resources/extensions/gsd/templates/PREFERENCES.md +7 -7
- package/src/resources/extensions/gsd/tests/agent-end-retry.test.ts +1 -34
- package/src/resources/extensions/gsd/tests/artifact-corruption-2630.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +45 -31
- package/src/resources/extensions/gsd/tests/auto-migrating-recovery.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/auto-prompts-fallback.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +123 -1
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/autocomplete-regressions-1675.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/commands-do.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/commands-extract-learnings.test.ts +333 -21
- package/src/resources/extensions/gsd/tests/commands-scan.test.ts +351 -0
- package/src/resources/extensions/gsd/tests/commands-workflow-custom.test.ts +8 -6
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +6 -8
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/custom-workflow-engine.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/debug-command-handler.test.ts +905 -0
- package/src/resources/extensions/gsd/tests/debug-command-lifecycle.integration.test.ts +1229 -0
- package/src/resources/extensions/gsd/tests/debug-session-store.test.ts +565 -0
- package/src/resources/extensions/gsd/tests/discuss-milestone-structured-questions.test.ts +64 -0
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +62 -18
- package/src/resources/extensions/gsd/tests/enhanced-verification-integration.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/escalation.test.ts +818 -0
- package/src/resources/extensions/gsd/tests/finalize-timeout-guard.test.ts +29 -12
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +106 -0
- package/src/resources/extensions/gsd/tests/forensics-hook-key-parse.test.ts +74 -0
- package/src/resources/extensions/gsd/tests/graph-operations.test.ts +0 -4
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +44 -1
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +8 -2
- package/src/resources/extensions/gsd/tests/init-prefs-routing.test.ts +190 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-git.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-proactive.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-runtime.test.ts +68 -1
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +109 -11
- package/src/resources/extensions/gsd/tests/integration/idle-recovery.test.ts +51 -0
- package/src/resources/extensions/gsd/tests/integration/integration-proof.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/integration/test-isolation.ts +53 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +171 -1
- package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/memory-embeddings.test.ts +213 -0
- package/src/resources/extensions/gsd/tests/memory-ingest.test.ts +153 -0
- package/src/resources/extensions/gsd/tests/memory-maintenance.test.ts +107 -0
- package/src/resources/extensions/gsd/tests/memory-relations.test.ts +175 -0
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/memory-tools.test.ts +295 -0
- package/src/resources/extensions/gsd/tests/milestone-status-tool.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/model-cost-table.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/model-router.test.ts +51 -1
- package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/notification-overlay.test.ts +56 -37
- package/src/resources/extensions/gsd/tests/notification-widget.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/onboarding-state.test.ts +105 -0
- package/src/resources/extensions/gsd/tests/plan-milestone-boundary-map-preservation.test.ts +114 -0
- package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +4 -5
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +17 -0
- package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +105 -1
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +275 -6
- package/src/resources/extensions/gsd/tests/preferences.test.ts +69 -1
- package/src/resources/extensions/gsd/tests/progressive-planning.test.ts +539 -0
- package/src/resources/extensions/gsd/tests/projection-no-plan-overwrite.test.ts +11 -2
- package/src/resources/extensions/gsd/tests/projection-regression.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +24 -0
- package/src/resources/extensions/gsd/tests/prompt-db.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/python-resolver.test.ts +131 -0
- package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/remote-notification-from-desktop.test.ts +107 -0
- package/src/resources/extensions/gsd/tests/requirements.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +153 -0
- package/src/resources/extensions/gsd/tests/skip-slice-cascades-tasks.test.ts +125 -0
- package/src/resources/extensions/gsd/tests/slice-context-injection.test.ts +16 -4
- package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/uok-contracts.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/uok-flags.test.ts +31 -1
- package/src/resources/extensions/gsd/tests/uok-kernel-path.test.ts +166 -0
- package/src/resources/extensions/gsd/tests/verification-gate.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/workflow-install.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +15 -6
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/workflow-plugins.test.ts +310 -0
- package/src/resources/extensions/gsd/tests/workflow-projections.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +8 -2
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +77 -2
- package/src/resources/extensions/gsd/tools/complete-task.ts +87 -0
- package/src/resources/extensions/gsd/tools/memory-tools.ts +380 -0
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +42 -8
- package/src/resources/extensions/gsd/tools/plan-slice.ts +6 -1
- package/src/resources/extensions/gsd/tools/skip-slice.ts +133 -0
- package/src/resources/extensions/gsd/types.ts +62 -0
- package/src/resources/extensions/gsd/unit-runtime.ts +1 -0
- package/src/resources/extensions/gsd/uok/contracts.ts +2 -1
- package/src/resources/extensions/gsd/uok/flags.ts +7 -7
- package/src/resources/extensions/gsd/uok/kernel.ts +16 -4
- package/src/resources/extensions/gsd/verification-gate.ts +2 -1
- package/src/resources/extensions/gsd/workflow-dispatch.ts +106 -0
- package/src/resources/extensions/gsd/workflow-install.ts +423 -0
- package/src/resources/extensions/gsd/workflow-logger.ts +3 -1
- package/src/resources/extensions/gsd/workflow-manifest.ts +8 -0
- package/src/resources/extensions/gsd/workflow-mcp.ts +1 -6
- package/src/resources/extensions/gsd/workflow-plugins.ts +403 -0
- package/src/resources/extensions/gsd/workflow-projections.ts +18 -16
- package/src/resources/extensions/gsd/workflow-templates/accessibility-audit.md +88 -0
- package/src/resources/extensions/gsd/workflow-templates/api-breaking-change.md +117 -0
- package/src/resources/extensions/gsd/workflow-templates/bugfix.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/changelog-gen.md +82 -0
- package/src/resources/extensions/gsd/workflow-templates/ci-bootstrap.md +144 -0
- package/src/resources/extensions/gsd/workflow-templates/dead-code.md +81 -0
- package/src/resources/extensions/gsd/workflow-templates/dep-upgrade.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/docs-sync.yaml +76 -0
- package/src/resources/extensions/gsd/workflow-templates/env-audit.yaml +88 -0
- package/src/resources/extensions/gsd/workflow-templates/full-project.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/hotfix.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/issue-triage.md +84 -0
- package/src/resources/extensions/gsd/workflow-templates/observability-setup.md +133 -0
- package/src/resources/extensions/gsd/workflow-templates/onboarding-check.md +74 -0
- package/src/resources/extensions/gsd/workflow-templates/performance-audit.md +125 -0
- package/src/resources/extensions/gsd/workflow-templates/pr-review.md +67 -0
- package/src/resources/extensions/gsd/workflow-templates/pr-triage.md +83 -0
- package/src/resources/extensions/gsd/workflow-templates/refactor.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/registry.json +184 -0
- package/src/resources/extensions/gsd/workflow-templates/release.md +118 -0
- package/src/resources/extensions/gsd/workflow-templates/rename-symbol.yaml +99 -0
- package/src/resources/extensions/gsd/workflow-templates/security-audit.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/small-feature.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/spike.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/test-backfill.yaml +73 -0
- package/src/resources/extensions/gsd/workflow-templates.ts +7 -0
- package/src/resources/extensions/gsd/workspace-index.ts +9 -4
- package/src/resources/extensions/gsd/worktree-resolver.ts +47 -1
- package/src/resources/extensions/remote-questions/commands.ts +480 -0
- package/src/resources/extensions/remote-questions/manager.ts +49 -4
- package/src/resources/extensions/remote-questions/telegram-adapter.ts +86 -4
- package/src/resources/extensions/remote-questions/tests/command-polling.test.ts +246 -0
- package/src/resources/extensions/remote-questions/tests/remote-answer-normalization.test.ts +92 -0
- package/src/resources/extensions/remote-questions/tests/telegram-commands.test.ts +267 -0
- package/src/resources/extensions/shared/interview-ui.ts +195 -1
- package/src/resources/extensions/shared/layout-utils.ts +26 -0
- package/src/resources/extensions/shared/rtk-shared.ts +58 -0
- package/src/resources/extensions/shared/rtk.ts +12 -52
- package/src/resources/extensions/shared/tests/interview-preview.test.ts +177 -0
- package/src/resources/extensions/shared/tests/preview-layout.test.ts +120 -0
- package/src/resources/skills/create-workflow/SKILL.md +33 -6
- package/dist/web/standalone/.next/static/chunks/2826.dd3dc8bbd3025fa5.js +0 -9
- package/dist/web/standalone/.next/static/css/f6e8833d46e738d8.css +0 -1
- package/packages/native/dist/ps/types.d.ts +0 -5
- package/packages/native/dist/ps/types.js +0 -2
- package/packages/native/src/ps/types.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/LICENSE +0 -201
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/README.md +0 -9
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-cjs/index.js +0 -762
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +0 -19
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/constants.js +0 -1
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +0 -9
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/index.js +0 -3
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +0 -230
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +0 -87
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +0 -32
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +0 -169
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +0 -21
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/server.mock.js +0 -88
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +0 -36
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +0 -21
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +0 -22
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +0 -23
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +0 -8
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +0 -41
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +0 -21
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/timing.js +0 -4
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +0 -63
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +0 -10
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +0 -4
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +0 -3
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +0 -46
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +0 -24
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +0 -63
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/server.mock.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +0 -8
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +0 -10
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +0 -4
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +0 -3
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +0 -46
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +0 -24
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +0 -63
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/server.mock.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +0 -8
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/package.json +0 -68
- package/packages/pi-ai/oauth.d.ts +0 -1
- package/packages/pi-ai/oauth.js +0 -1
- /package/dist/web/standalone/.next/static/{j7IBD35UgrL2b298GLK3V → o61X3klsB6C0UE0X1x3PA}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{j7IBD35UgrL2b298GLK3V → o61X3klsB6C0UE0X1x3PA}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,905 @@
|
|
|
1
|
+
import test, { describe } from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { tmpdir } from "node:os";
|
|
6
|
+
|
|
7
|
+
import { handleDebug, parseDebugCommand } from "../commands-debug.ts";
|
|
8
|
+
import { createDebugSession, debugSessionArtifactPath, updateDebugSession } from "../debug-session-store.ts";
|
|
9
|
+
import { loadPrompt } from "../prompt-loader.ts";
|
|
10
|
+
|
|
11
|
+
function makeBase(): string {
|
|
12
|
+
const base = mkdtempSync(join(tmpdir(), "gsd-debug-command-"));
|
|
13
|
+
mkdirSync(join(base, ".gsd"), { recursive: true });
|
|
14
|
+
return base;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function createMockCtx() {
|
|
18
|
+
const notifications: Array<{ message: string; level: string }> = [];
|
|
19
|
+
return {
|
|
20
|
+
notifications,
|
|
21
|
+
ui: {
|
|
22
|
+
notify(message: string, level: string) {
|
|
23
|
+
notifications.push({ message, level });
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
describe("parseDebugCommand", () => {
|
|
30
|
+
test("supports strict subcommands and issue-start fallback", () => {
|
|
31
|
+
assert.deepEqual(parseDebugCommand("list"), { type: "list" });
|
|
32
|
+
assert.deepEqual(parseDebugCommand("status auth-flake"), { type: "status", slug: "auth-flake" });
|
|
33
|
+
assert.deepEqual(parseDebugCommand("continue auth-flake"), { type: "continue", slug: "auth-flake" });
|
|
34
|
+
assert.deepEqual(parseDebugCommand("--diagnose"), { type: "diagnose" });
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("treats ambiguous reserved-word phrases as issue text unless strict syntax matches", () => {
|
|
38
|
+
assert.deepEqual(parseDebugCommand("status login fails on safari"), {
|
|
39
|
+
type: "issue-start",
|
|
40
|
+
issue: "status login fails on safari",
|
|
41
|
+
});
|
|
42
|
+
assert.deepEqual(parseDebugCommand("continue flaky checkout flow"), {
|
|
43
|
+
type: "issue-start",
|
|
44
|
+
issue: "continue flaky checkout flow",
|
|
45
|
+
});
|
|
46
|
+
assert.deepEqual(parseDebugCommand("list broken retry behavior"), {
|
|
47
|
+
type: "issue-start",
|
|
48
|
+
issue: "list broken retry behavior",
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test("returns actionable errors for malformed subcommand invocations", () => {
|
|
53
|
+
assert.equal(parseDebugCommand("status").type, "error");
|
|
54
|
+
assert.equal(parseDebugCommand("continue").type, "error");
|
|
55
|
+
assert.equal(parseDebugCommand("--diagnose not/a-slug").type, "error");
|
|
56
|
+
assert.equal(parseDebugCommand("--wat").type, "error");
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test("routes multi-token --diagnose to diagnose-issue with root-cause-only intent", () => {
|
|
60
|
+
assert.deepEqual(parseDebugCommand("--diagnose login fails on safari"), {
|
|
61
|
+
type: "diagnose-issue",
|
|
62
|
+
issue: "login fails on safari",
|
|
63
|
+
});
|
|
64
|
+
assert.deepEqual(parseDebugCommand("--diagnose flaky checkout flow"), {
|
|
65
|
+
type: "diagnose-issue",
|
|
66
|
+
issue: "flaky checkout flow",
|
|
67
|
+
});
|
|
68
|
+
assert.deepEqual(parseDebugCommand("--diagnose status is returning 500"), {
|
|
69
|
+
type: "diagnose-issue",
|
|
70
|
+
issue: "status is returning 500",
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test("--diagnose with valid slug remains slug-targeted diagnose", () => {
|
|
75
|
+
assert.deepEqual(parseDebugCommand("--diagnose auth-flake"), {
|
|
76
|
+
type: "diagnose",
|
|
77
|
+
slug: "auth-flake",
|
|
78
|
+
});
|
|
79
|
+
assert.deepEqual(parseDebugCommand("--diagnose ci-flake-2"), {
|
|
80
|
+
type: "diagnose",
|
|
81
|
+
slug: "ci-flake-2",
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test("--diagnose with no args returns store-health diagnose", () => {
|
|
86
|
+
assert.deepEqual(parseDebugCommand("--diagnose"), { type: "diagnose" });
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test("single invalid slug token after --diagnose is an error not issue-start", () => {
|
|
90
|
+
assert.equal(parseDebugCommand("--diagnose not/a-slug").type, "error");
|
|
91
|
+
assert.equal(parseDebugCommand("--diagnose UPPERCASE").type, "error");
|
|
92
|
+
assert.equal(parseDebugCommand("--diagnose has space").type, "diagnose-issue");
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
test("issue text starting with reserved words falls through to issue-start", () => {
|
|
96
|
+
assert.deepEqual(parseDebugCommand("list broken retry behavior"), {
|
|
97
|
+
type: "issue-start",
|
|
98
|
+
issue: "list broken retry behavior",
|
|
99
|
+
});
|
|
100
|
+
assert.deepEqual(parseDebugCommand("status login is flaky"), {
|
|
101
|
+
type: "issue-start",
|
|
102
|
+
issue: "status login is flaky",
|
|
103
|
+
});
|
|
104
|
+
assert.deepEqual(parseDebugCommand("continue flaky checkout flow"), {
|
|
105
|
+
type: "issue-start",
|
|
106
|
+
issue: "continue flaky checkout flow",
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
describe("handleDebug lifecycle", () => {
|
|
112
|
+
test("creates new session and persists mode/phase metadata", async () => {
|
|
113
|
+
const base = makeBase();
|
|
114
|
+
const ctx = createMockCtx();
|
|
115
|
+
const saved = process.cwd();
|
|
116
|
+
process.chdir(base);
|
|
117
|
+
|
|
118
|
+
try {
|
|
119
|
+
await handleDebug("Login fails on Safari", ctx as any);
|
|
120
|
+
assert.equal(ctx.notifications.length, 1);
|
|
121
|
+
const note = ctx.notifications[0];
|
|
122
|
+
assert.equal(note.level, "info");
|
|
123
|
+
assert.match(note.message, /Debug session started: login-fails-on-safari/);
|
|
124
|
+
assert.match(note.message, /mode=debug/);
|
|
125
|
+
assert.match(note.message, /phase=queued/);
|
|
126
|
+
|
|
127
|
+
const artifact = debugSessionArtifactPath(base, "login-fails-on-safari");
|
|
128
|
+
const statusCtx = createMockCtx();
|
|
129
|
+
await handleDebug("status login-fails-on-safari", statusCtx as any);
|
|
130
|
+
assert.match(statusCtx.notifications[0].message, new RegExp(artifact.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")));
|
|
131
|
+
assert.match(statusCtx.notifications[0].message, /status=active/);
|
|
132
|
+
assert.match(statusCtx.notifications[0].message, /phase=queued/);
|
|
133
|
+
} finally {
|
|
134
|
+
process.chdir(saved);
|
|
135
|
+
rmSync(base, { recursive: true, force: true });
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
test("list shows persisted session summaries with lifecycle metadata", async () => {
|
|
140
|
+
const base = makeBase();
|
|
141
|
+
const ctx = createMockCtx();
|
|
142
|
+
const saved = process.cwd();
|
|
143
|
+
process.chdir(base);
|
|
144
|
+
|
|
145
|
+
try {
|
|
146
|
+
createDebugSession(base, { issue: "Auth timeout", createdAt: 10 });
|
|
147
|
+
createDebugSession(base, { issue: "Billing webhook", createdAt: 20 });
|
|
148
|
+
|
|
149
|
+
await handleDebug("list", ctx as any);
|
|
150
|
+
assert.equal(ctx.notifications.length, 1);
|
|
151
|
+
const note = ctx.notifications[0].message;
|
|
152
|
+
assert.match(note, /Debug sessions:/);
|
|
153
|
+
assert.match(note, /mode=debug status=active phase=queued/);
|
|
154
|
+
assert.match(note, /auth-timeout/);
|
|
155
|
+
assert.match(note, /billing-webhook/);
|
|
156
|
+
} finally {
|
|
157
|
+
process.chdir(saved);
|
|
158
|
+
rmSync(base, { recursive: true, force: true });
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
test("continue updates session lifecycle state", async () => {
|
|
163
|
+
const base = makeBase();
|
|
164
|
+
const ctx = createMockCtx();
|
|
165
|
+
const saved = process.cwd();
|
|
166
|
+
process.chdir(base);
|
|
167
|
+
|
|
168
|
+
try {
|
|
169
|
+
createDebugSession(base, { issue: "CI flake", createdAt: 10, status: "paused", phase: "blocked" });
|
|
170
|
+
|
|
171
|
+
await handleDebug("continue ci-flake", ctx as any);
|
|
172
|
+
assert.equal(ctx.notifications.length, 1);
|
|
173
|
+
const note = ctx.notifications[0].message;
|
|
174
|
+
assert.match(note, /Resumed debug session: ci-flake/);
|
|
175
|
+
assert.match(note, /status=active/);
|
|
176
|
+
assert.match(note, /phase=continued/);
|
|
177
|
+
|
|
178
|
+
const statusCtx = createMockCtx();
|
|
179
|
+
await handleDebug("status ci-flake", statusCtx as any);
|
|
180
|
+
assert.match(statusCtx.notifications[0].message, /status=active/);
|
|
181
|
+
assert.match(statusCtx.notifications[0].message, /phase=continued/);
|
|
182
|
+
} finally {
|
|
183
|
+
process.chdir(saved);
|
|
184
|
+
rmSync(base, { recursive: true, force: true });
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
test("unknown slug and missing slug paths provide actionable warnings", async () => {
|
|
189
|
+
const base = makeBase();
|
|
190
|
+
const saved = process.cwd();
|
|
191
|
+
process.chdir(base);
|
|
192
|
+
|
|
193
|
+
try {
|
|
194
|
+
const missingSlugCtx = createMockCtx();
|
|
195
|
+
await handleDebug("status", missingSlugCtx as any);
|
|
196
|
+
assert.equal(missingSlugCtx.notifications[0].level, "warning");
|
|
197
|
+
assert.match(missingSlugCtx.notifications[0].message, /Missing slug/);
|
|
198
|
+
|
|
199
|
+
const unknownSlugCtx = createMockCtx();
|
|
200
|
+
await handleDebug("status no-such-session", unknownSlugCtx as any);
|
|
201
|
+
assert.equal(unknownSlugCtx.notifications[0].level, "warning");
|
|
202
|
+
assert.match(unknownSlugCtx.notifications[0].message, /Unknown debug session slug/);
|
|
203
|
+
assert.match(unknownSlugCtx.notifications[0].message, /\/gsd debug list/);
|
|
204
|
+
} finally {
|
|
205
|
+
process.chdir(saved);
|
|
206
|
+
rmSync(base, { recursive: true, force: true });
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
test("detects malformed artifacts and surfaces remediation in list/diagnose", async () => {
|
|
211
|
+
const base = makeBase();
|
|
212
|
+
const saved = process.cwd();
|
|
213
|
+
process.chdir(base);
|
|
214
|
+
|
|
215
|
+
try {
|
|
216
|
+
createDebugSession(base, { issue: "Healthy issue", createdAt: 1 });
|
|
217
|
+
writeFileSync(join(base, ".gsd", "debug", "sessions", "broken.json"), "{ nope", "utf-8");
|
|
218
|
+
|
|
219
|
+
const listCtx = createMockCtx();
|
|
220
|
+
await handleDebug("list", listCtx as any);
|
|
221
|
+
assert.match(listCtx.notifications[0].message, /Malformed artifacts: 1/);
|
|
222
|
+
assert.match(listCtx.notifications[0].message, /Run \/gsd debug --diagnose/);
|
|
223
|
+
|
|
224
|
+
const diagnoseCtx = createMockCtx();
|
|
225
|
+
await handleDebug("--diagnose", diagnoseCtx as any);
|
|
226
|
+
assert.equal(diagnoseCtx.notifications[0].level, "warning");
|
|
227
|
+
assert.match(diagnoseCtx.notifications[0].message, /Malformed artifacts/);
|
|
228
|
+
assert.match(diagnoseCtx.notifications[0].message, /Remediation:/);
|
|
229
|
+
} finally {
|
|
230
|
+
process.chdir(saved);
|
|
231
|
+
rmSync(base, { recursive: true, force: true });
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
test("reserved-word boundary condition still creates session when syntax is not strict", async () => {
|
|
236
|
+
const base = makeBase();
|
|
237
|
+
const saved = process.cwd();
|
|
238
|
+
process.chdir(base);
|
|
239
|
+
|
|
240
|
+
try {
|
|
241
|
+
const ctx = createMockCtx();
|
|
242
|
+
await handleDebug("status login is flaky on prod", ctx as any);
|
|
243
|
+
assert.equal(ctx.notifications[0].level, "info");
|
|
244
|
+
assert.match(ctx.notifications[0].message, /Debug session started:/);
|
|
245
|
+
|
|
246
|
+
const slug = "status-login-is-flaky-on-prod";
|
|
247
|
+
const statusCtx = createMockCtx();
|
|
248
|
+
await handleDebug(`status ${slug}`, statusCtx as any);
|
|
249
|
+
assert.equal(statusCtx.notifications[0].level, "info");
|
|
250
|
+
assert.match(statusCtx.notifications[0].message, /mode=debug/);
|
|
251
|
+
} finally {
|
|
252
|
+
process.chdir(saved);
|
|
253
|
+
rmSync(base, { recursive: true, force: true });
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
test("--diagnose <issue text> creates diagnose session with mode=diagnose and find_root_cause_only dispatch", async () => {
|
|
258
|
+
const base = makeBase();
|
|
259
|
+
const ctx = createMockCtx();
|
|
260
|
+
const saved = process.cwd();
|
|
261
|
+
process.chdir(base);
|
|
262
|
+
|
|
263
|
+
try {
|
|
264
|
+
await handleDebug("--diagnose login fails on safari", ctx as any);
|
|
265
|
+
assert.equal(ctx.notifications.length, 1);
|
|
266
|
+
const note = ctx.notifications[0];
|
|
267
|
+
assert.equal(note.level, "info");
|
|
268
|
+
assert.match(note.message, /Diagnose session started: login-fails-on-safari/);
|
|
269
|
+
assert.match(note.message, /mode=diagnose/);
|
|
270
|
+
assert.match(note.message, /dispatchMode=find_root_cause_only/);
|
|
271
|
+
assert.match(note.message, /phase=queued/);
|
|
272
|
+
assert.match(note.message, /status=active/);
|
|
273
|
+
|
|
274
|
+
const statusCtx = createMockCtx();
|
|
275
|
+
await handleDebug("status login-fails-on-safari", statusCtx as any);
|
|
276
|
+
assert.match(statusCtx.notifications[0].message, /mode=diagnose/);
|
|
277
|
+
assert.match(statusCtx.notifications[0].message, /status=active/);
|
|
278
|
+
} finally {
|
|
279
|
+
process.chdir(saved);
|
|
280
|
+
rmSync(base, { recursive: true, force: true });
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
test("--diagnose <slug> targets existing session for targeted diagnose", async () => {
|
|
285
|
+
const base = makeBase();
|
|
286
|
+
const saved = process.cwd();
|
|
287
|
+
process.chdir(base);
|
|
288
|
+
|
|
289
|
+
try {
|
|
290
|
+
createDebugSession(base, { issue: "CI flake on main", createdAt: 1 });
|
|
291
|
+
|
|
292
|
+
const ctx = createMockCtx();
|
|
293
|
+
await handleDebug("--diagnose ci-flake-on-main", ctx as any);
|
|
294
|
+
assert.equal(ctx.notifications.length, 1);
|
|
295
|
+
assert.equal(ctx.notifications[0].level, "info");
|
|
296
|
+
assert.match(ctx.notifications[0].message, /Diagnose session: ci-flake-on-main/);
|
|
297
|
+
assert.match(ctx.notifications[0].message, /status=active/);
|
|
298
|
+
assert.match(ctx.notifications[0].message, /malformedArtifactsInStore=0/);
|
|
299
|
+
} finally {
|
|
300
|
+
process.chdir(saved);
|
|
301
|
+
rmSync(base, { recursive: true, force: true });
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
test("--diagnose with unknown slug emits actionable warning", async () => {
|
|
306
|
+
const base = makeBase();
|
|
307
|
+
const saved = process.cwd();
|
|
308
|
+
process.chdir(base);
|
|
309
|
+
|
|
310
|
+
try {
|
|
311
|
+
const ctx = createMockCtx();
|
|
312
|
+
await handleDebug("--diagnose no-such-session", ctx as any);
|
|
313
|
+
assert.equal(ctx.notifications[0].level, "warning");
|
|
314
|
+
assert.match(ctx.notifications[0].message, /not found/);
|
|
315
|
+
assert.match(ctx.notifications[0].message, /\/gsd debug list/);
|
|
316
|
+
} finally {
|
|
317
|
+
process.chdir(saved);
|
|
318
|
+
rmSync(base, { recursive: true, force: true });
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
test("diagnose-issue tolerates malformed artifact in store and still creates session", async () => {
|
|
323
|
+
const base = makeBase();
|
|
324
|
+
const saved = process.cwd();
|
|
325
|
+
process.chdir(base);
|
|
326
|
+
|
|
327
|
+
try {
|
|
328
|
+
createDebugSession(base, { issue: "Healthy issue", createdAt: 1 });
|
|
329
|
+
writeFileSync(join(base, ".gsd", "debug", "sessions", "broken.json"), "{ nope", "utf-8");
|
|
330
|
+
|
|
331
|
+
const ctx = createMockCtx();
|
|
332
|
+
await handleDebug("--diagnose billing webhook is dropping events", ctx as any);
|
|
333
|
+
assert.equal(ctx.notifications[0].level, "info");
|
|
334
|
+
assert.match(ctx.notifications[0].message, /Diagnose session started:/);
|
|
335
|
+
assert.match(ctx.notifications[0].message, /mode=diagnose/);
|
|
336
|
+
} finally {
|
|
337
|
+
process.chdir(saved);
|
|
338
|
+
rmSync(base, { recursive: true, force: true });
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
test("continue blocks on resolved session with actionable warning", async () => {
|
|
343
|
+
const base = makeBase();
|
|
344
|
+
const saved = process.cwd();
|
|
345
|
+
process.chdir(base);
|
|
346
|
+
|
|
347
|
+
try {
|
|
348
|
+
createDebugSession(base, { issue: "Done issue", createdAt: 1, status: "resolved", phase: "complete" });
|
|
349
|
+
|
|
350
|
+
const ctx = createMockCtx();
|
|
351
|
+
await handleDebug("continue done-issue", ctx as any);
|
|
352
|
+
assert.equal(ctx.notifications[0].level, "warning");
|
|
353
|
+
assert.match(ctx.notifications[0].message, /resolved/);
|
|
354
|
+
} finally {
|
|
355
|
+
process.chdir(saved);
|
|
356
|
+
rmSync(base, { recursive: true, force: true });
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
test("unknown flag returns error without silently routing to wrong path", async () => {
|
|
361
|
+
const base = makeBase();
|
|
362
|
+
const saved = process.cwd();
|
|
363
|
+
process.chdir(base);
|
|
364
|
+
|
|
365
|
+
try {
|
|
366
|
+
const ctx = createMockCtx();
|
|
367
|
+
await handleDebug("--unknown-flag some text", ctx as any);
|
|
368
|
+
assert.equal(ctx.notifications[0].level, "warning");
|
|
369
|
+
assert.match(ctx.notifications[0].message, /Unknown debug flag/);
|
|
370
|
+
} finally {
|
|
371
|
+
process.chdir(saved);
|
|
372
|
+
rmSync(base, { recursive: true, force: true });
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
test("diagnose-issue dispatches find_root_cause_only goal with slug and issue in payload", async () => {
|
|
377
|
+
const base = makeBase();
|
|
378
|
+
const ctx = createMockCtx();
|
|
379
|
+
const dispatched: Array<{ customType: string; content: string; display: boolean }> = [];
|
|
380
|
+
const mockPi = {
|
|
381
|
+
sendMessage(msg: { customType: string; content: string; display: boolean }) {
|
|
382
|
+
dispatched.push(msg);
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
const saved = process.cwd();
|
|
386
|
+
process.chdir(base);
|
|
387
|
+
|
|
388
|
+
try {
|
|
389
|
+
await handleDebug("--diagnose memory leak in worker pool", ctx as any, mockPi as any);
|
|
390
|
+
// Session creation notification still fires
|
|
391
|
+
assert.equal(ctx.notifications[0].level, "info");
|
|
392
|
+
assert.match(ctx.notifications[0].message, /dispatchMode=find_root_cause_only/);
|
|
393
|
+
|
|
394
|
+
// Exactly one dispatch was emitted
|
|
395
|
+
assert.equal(dispatched.length, 1);
|
|
396
|
+
const dispatch = dispatched[0];
|
|
397
|
+
assert.equal(dispatch.customType, "gsd-debug-diagnose");
|
|
398
|
+
assert.equal(dispatch.display, false);
|
|
399
|
+
// Goal line must carry root-cause-only value
|
|
400
|
+
assert.match(dispatch.content, /`find_root_cause_only`/);
|
|
401
|
+
// do-NOT-fix instruction must be present
|
|
402
|
+
assert.match(dispatch.content, /do \*\*NOT\*\* apply code changes/);
|
|
403
|
+
assert.match(dispatch.content, /memory-leak-in-worker-pool/);
|
|
404
|
+
assert.match(dispatch.content, /memory leak in worker pool/);
|
|
405
|
+
} finally {
|
|
406
|
+
process.chdir(saved);
|
|
407
|
+
rmSync(base, { recursive: true, force: true });
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
test("diagnose-issue dispatch never advertises fix-application in payload", async () => {
|
|
412
|
+
const base = makeBase();
|
|
413
|
+
const dispatched: Array<{ content: string }> = [];
|
|
414
|
+
const mockPi = {
|
|
415
|
+
sendMessage(msg: { customType: string; content: string; display: boolean }) {
|
|
416
|
+
dispatched.push(msg);
|
|
417
|
+
},
|
|
418
|
+
};
|
|
419
|
+
const saved = process.cwd();
|
|
420
|
+
process.chdir(base);
|
|
421
|
+
|
|
422
|
+
try {
|
|
423
|
+
await handleDebug("--diagnose flaky checkout flow after payment", createMockCtx() as any, mockPi as any);
|
|
424
|
+
assert.equal(dispatched.length, 1);
|
|
425
|
+
// Goal must be root-cause-only and include no-fix instruction
|
|
426
|
+
assert.match(dispatched[0].content, /`find_root_cause_only`/);
|
|
427
|
+
assert.match(dispatched[0].content, /do \*\*NOT\*\* apply code changes/);
|
|
428
|
+
} finally {
|
|
429
|
+
process.chdir(saved);
|
|
430
|
+
rmSync(base, { recursive: true, force: true });
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
test("continue dispatches find_and_fix goal scoped to the target slug only", async () => {
|
|
435
|
+
const base = makeBase();
|
|
436
|
+
const ctx = createMockCtx();
|
|
437
|
+
const dispatched: Array<{ customType: string; content: string; display: boolean }> = [];
|
|
438
|
+
const mockPi = {
|
|
439
|
+
sendMessage(msg: { customType: string; content: string; display: boolean }) {
|
|
440
|
+
dispatched.push(msg);
|
|
441
|
+
},
|
|
442
|
+
};
|
|
443
|
+
const saved = process.cwd();
|
|
444
|
+
process.chdir(base);
|
|
445
|
+
|
|
446
|
+
try {
|
|
447
|
+
createDebugSession(base, { issue: "Auth timeout", createdAt: 10, status: "paused", phase: "blocked" });
|
|
448
|
+
createDebugSession(base, { issue: "Billing webhook", createdAt: 20, status: "paused", phase: "blocked" });
|
|
449
|
+
|
|
450
|
+
await handleDebug("continue auth-timeout", ctx as any, mockPi as any);
|
|
451
|
+
// Notification shows dispatched mode
|
|
452
|
+
assert.match(ctx.notifications[0].message, /dispatchMode=find_and_fix/);
|
|
453
|
+
|
|
454
|
+
// Exactly one dispatch for the targeted slug
|
|
455
|
+
assert.equal(dispatched.length, 1);
|
|
456
|
+
const dispatch = dispatched[0];
|
|
457
|
+
assert.equal(dispatch.customType, "gsd-debug-continue");
|
|
458
|
+
assert.equal(dispatch.display, false);
|
|
459
|
+
// Goal line must carry find-and-fix value
|
|
460
|
+
assert.match(dispatch.content, /`find_and_fix`/);
|
|
461
|
+
// Session slug is scoped correctly
|
|
462
|
+
assert.match(dispatch.content, /auth-timeout/);
|
|
463
|
+
// Must NOT mention the other session slug — no cross-session bleed
|
|
464
|
+
assert.doesNotMatch(dispatch.content, /billing-webhook/);
|
|
465
|
+
} finally {
|
|
466
|
+
process.chdir(saved);
|
|
467
|
+
rmSync(base, { recursive: true, force: true });
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
test("continue dispatch failure surfaces warning without corrupting session state", async () => {
|
|
472
|
+
const base = makeBase();
|
|
473
|
+
const ctx = createMockCtx();
|
|
474
|
+
const mockPi = {
|
|
475
|
+
sendMessage() {
|
|
476
|
+
throw new Error("transport unavailable");
|
|
477
|
+
},
|
|
478
|
+
};
|
|
479
|
+
const saved = process.cwd();
|
|
480
|
+
process.chdir(base);
|
|
481
|
+
|
|
482
|
+
try {
|
|
483
|
+
createDebugSession(base, { issue: "CI flake", createdAt: 10, status: "paused", phase: "blocked" });
|
|
484
|
+
|
|
485
|
+
await handleDebug("continue ci-flake", ctx as any, mockPi as any);
|
|
486
|
+
// Session update notification still fires first
|
|
487
|
+
assert.match(ctx.notifications[0].message, /Resumed debug session/);
|
|
488
|
+
|
|
489
|
+
// Dispatch error notification follows
|
|
490
|
+
assert.equal(ctx.notifications.length, 2);
|
|
491
|
+
assert.equal(ctx.notifications[1].level, "warning");
|
|
492
|
+
assert.match(ctx.notifications[1].message, /Continue dispatch failed/);
|
|
493
|
+
assert.match(ctx.notifications[1].message, /ci-flake/);
|
|
494
|
+
|
|
495
|
+
// Session state was persisted despite dispatch failure
|
|
496
|
+
const statusCtx = createMockCtx();
|
|
497
|
+
await handleDebug("status ci-flake", statusCtx as any);
|
|
498
|
+
assert.match(statusCtx.notifications[0].message, /status=active/);
|
|
499
|
+
assert.match(statusCtx.notifications[0].message, /phase=continued/);
|
|
500
|
+
} finally {
|
|
501
|
+
process.chdir(saved);
|
|
502
|
+
rmSync(base, { recursive: true, force: true });
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
test("diagnose-issue dispatch failure surfaces warning without losing session", async () => {
|
|
507
|
+
const base = makeBase();
|
|
508
|
+
const ctx = createMockCtx();
|
|
509
|
+
const mockPi = {
|
|
510
|
+
sendMessage() {
|
|
511
|
+
throw new Error("dispatch error");
|
|
512
|
+
},
|
|
513
|
+
};
|
|
514
|
+
const saved = process.cwd();
|
|
515
|
+
process.chdir(base);
|
|
516
|
+
|
|
517
|
+
try {
|
|
518
|
+
await handleDebug("--diagnose auth token expiry race condition", ctx as any, mockPi as any);
|
|
519
|
+
// First notification: session created
|
|
520
|
+
assert.equal(ctx.notifications[0].level, "info");
|
|
521
|
+
assert.match(ctx.notifications[0].message, /Diagnose session started/);
|
|
522
|
+
|
|
523
|
+
// Second notification: dispatch error
|
|
524
|
+
assert.equal(ctx.notifications.length, 2);
|
|
525
|
+
assert.equal(ctx.notifications[1].level, "warning");
|
|
526
|
+
assert.match(ctx.notifications[1].message, /Diagnose dispatch failed/);
|
|
527
|
+
assert.match(ctx.notifications[1].message, /auth-token-expiry-race-condition/);
|
|
528
|
+
|
|
529
|
+
// Session artifact still exists
|
|
530
|
+
const statusCtx = createMockCtx();
|
|
531
|
+
await handleDebug("status auth-token-expiry-race-condition", statusCtx as any);
|
|
532
|
+
assert.equal(statusCtx.notifications[0].level, "info");
|
|
533
|
+
assert.match(statusCtx.notifications[0].message, /mode=diagnose/);
|
|
534
|
+
} finally {
|
|
535
|
+
process.chdir(saved);
|
|
536
|
+
rmSync(base, { recursive: true, force: true });
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
test("continue with unknown slug emits warning without dispatching", async () => {
|
|
541
|
+
const base = makeBase();
|
|
542
|
+
const ctx = createMockCtx();
|
|
543
|
+
const dispatched: Array<unknown> = [];
|
|
544
|
+
const mockPi = {
|
|
545
|
+
sendMessage(msg: unknown) { dispatched.push(msg); },
|
|
546
|
+
};
|
|
547
|
+
const saved = process.cwd();
|
|
548
|
+
process.chdir(base);
|
|
549
|
+
|
|
550
|
+
try {
|
|
551
|
+
await handleDebug("continue no-such-slug", ctx as any, mockPi as any);
|
|
552
|
+
assert.equal(ctx.notifications[0].level, "warning");
|
|
553
|
+
assert.match(ctx.notifications[0].message, /Unknown debug session slug/);
|
|
554
|
+
assert.equal(dispatched.length, 0);
|
|
555
|
+
} finally {
|
|
556
|
+
process.chdir(saved);
|
|
557
|
+
rmSync(base, { recursive: true, force: true });
|
|
558
|
+
}
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
test("diagnose-issue with issue text containing reserved command words dispatches correctly", async () => {
|
|
562
|
+
const base = makeBase();
|
|
563
|
+
const dispatched: Array<{ content: string }> = [];
|
|
564
|
+
const mockPi = {
|
|
565
|
+
sendMessage(msg: { customType: string; content: string; display: boolean }) {
|
|
566
|
+
dispatched.push(msg);
|
|
567
|
+
},
|
|
568
|
+
};
|
|
569
|
+
const saved = process.cwd();
|
|
570
|
+
process.chdir(base);
|
|
571
|
+
|
|
572
|
+
try {
|
|
573
|
+
// 'status' and 'continue' are reserved words but in multi-token --diagnose context they become issue text
|
|
574
|
+
await handleDebug("--diagnose status endpoint continues to return 500", createMockCtx() as any, mockPi as any);
|
|
575
|
+
assert.equal(dispatched.length, 1);
|
|
576
|
+
assert.match(dispatched[0].content, /find_root_cause_only/);
|
|
577
|
+
assert.match(dispatched[0].content, /status-endpoint-continues-to-return-500/);
|
|
578
|
+
} finally {
|
|
579
|
+
process.chdir(saved);
|
|
580
|
+
rmSync(base, { recursive: true, force: true });
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
test("continue with checkpoint state dispatches debug-session-manager template with checkpoint context", async () => {
|
|
585
|
+
const base = makeBase();
|
|
586
|
+
const ctx = createMockCtx();
|
|
587
|
+
const dispatched: Array<{ customType: string; content: string; display: boolean }> = [];
|
|
588
|
+
const mockPi = {
|
|
589
|
+
sendMessage(msg: { customType: string; content: string; display: boolean }) {
|
|
590
|
+
dispatched.push(msg);
|
|
591
|
+
},
|
|
592
|
+
};
|
|
593
|
+
const saved = process.cwd();
|
|
594
|
+
process.chdir(base);
|
|
595
|
+
|
|
596
|
+
try {
|
|
597
|
+
createDebugSession(base, { issue: "Auth timeout", createdAt: 10 });
|
|
598
|
+
updateDebugSession(base, "auth-timeout", {
|
|
599
|
+
checkpoint: {
|
|
600
|
+
type: "human-verify",
|
|
601
|
+
summary: "Confirm the network trace shows the right headers",
|
|
602
|
+
awaitingResponse: true,
|
|
603
|
+
},
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
await handleDebug("continue auth-timeout", ctx as any, mockPi as any);
|
|
607
|
+
|
|
608
|
+
assert.equal(dispatched.length, 1);
|
|
609
|
+
const dispatch = dispatched[0];
|
|
610
|
+
assert.equal(dispatch.customType, "gsd-debug-continue");
|
|
611
|
+
assert.equal(dispatch.display, false);
|
|
612
|
+
// Uses debug-session-manager template (has structured return headers)
|
|
613
|
+
assert.match(dispatch.content, /## CHECKPOINT REACHED/);
|
|
614
|
+
// Checkpoint context is populated
|
|
615
|
+
assert.match(dispatch.content, /## Active Checkpoint/);
|
|
616
|
+
assert.match(dispatch.content, /type: human-verify/);
|
|
617
|
+
assert.match(dispatch.content, /Confirm the network trace/);
|
|
618
|
+
// Notification includes checkpoint hint
|
|
619
|
+
assert.match(ctx.notifications[0].message, /checkpointType=human-verify/);
|
|
620
|
+
} finally {
|
|
621
|
+
process.chdir(saved);
|
|
622
|
+
rmSync(base, { recursive: true, force: true });
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
|
|
626
|
+
test("continue with TDD gate pending dispatches find_root_cause_only and does not dispatch find_and_fix", async () => {
|
|
627
|
+
const base = makeBase();
|
|
628
|
+
const ctx = createMockCtx();
|
|
629
|
+
const dispatched: Array<{ customType: string; content: string; display: boolean }> = [];
|
|
630
|
+
const mockPi = {
|
|
631
|
+
sendMessage(msg: { customType: string; content: string; display: boolean }) {
|
|
632
|
+
dispatched.push(msg);
|
|
633
|
+
},
|
|
634
|
+
};
|
|
635
|
+
const saved = process.cwd();
|
|
636
|
+
process.chdir(base);
|
|
637
|
+
|
|
638
|
+
try {
|
|
639
|
+
createDebugSession(base, { issue: "Flaky auth", createdAt: 10 });
|
|
640
|
+
updateDebugSession(base, "flaky-auth", {
|
|
641
|
+
tddGate: { enabled: true, phase: "pending", testFile: "auth.test.ts" },
|
|
642
|
+
});
|
|
643
|
+
|
|
644
|
+
await handleDebug("continue flaky-auth", ctx as any, mockPi as any);
|
|
645
|
+
|
|
646
|
+
assert.equal(dispatched.length, 1);
|
|
647
|
+
const dispatch = dispatched[0];
|
|
648
|
+
// Active goal line must be find_root_cause_only — the template always lists both goal names in
|
|
649
|
+
// its semantics section, so we check the specific "## Goal\n`…`" line, not the whole content.
|
|
650
|
+
assert.match(dispatch.content, /## Goal\s+`find_root_cause_only`/);
|
|
651
|
+
assert.doesNotMatch(dispatch.content, /## Goal\s+`find_and_fix`/);
|
|
652
|
+
// TDD context appears
|
|
653
|
+
assert.match(dispatch.content, /TDD Gate/);
|
|
654
|
+
assert.match(dispatch.content, /phase: pending/);
|
|
655
|
+
// Notification shows TDD hint
|
|
656
|
+
assert.match(ctx.notifications[0].message, /tddPhase=pending/);
|
|
657
|
+
} finally {
|
|
658
|
+
process.chdir(saved);
|
|
659
|
+
rmSync(base, { recursive: true, force: true });
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
|
|
663
|
+
test("continue with TDD gate red dispatches find_and_fix and advances phase to green before dispatch", async () => {
|
|
664
|
+
const base = makeBase();
|
|
665
|
+
const ctx = createMockCtx();
|
|
666
|
+
const dispatched: Array<{ customType: string; content: string; display: boolean }> = [];
|
|
667
|
+
const mockPi = {
|
|
668
|
+
sendMessage(msg: { customType: string; content: string; display: boolean }) {
|
|
669
|
+
dispatched.push(msg);
|
|
670
|
+
},
|
|
671
|
+
};
|
|
672
|
+
const saved = process.cwd();
|
|
673
|
+
process.chdir(base);
|
|
674
|
+
|
|
675
|
+
try {
|
|
676
|
+
createDebugSession(base, { issue: "Cache miss", createdAt: 10 });
|
|
677
|
+
updateDebugSession(base, "cache-miss", {
|
|
678
|
+
tddGate: {
|
|
679
|
+
enabled: true,
|
|
680
|
+
phase: "red",
|
|
681
|
+
testFile: "cache.test.ts",
|
|
682
|
+
testName: "returns stale entry",
|
|
683
|
+
failureOutput: "Expected 'fresh' to equal 'stale'",
|
|
684
|
+
},
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
await handleDebug("continue cache-miss", ctx as any, mockPi as any);
|
|
688
|
+
|
|
689
|
+
// Dispatch uses find_and_fix
|
|
690
|
+
assert.equal(dispatched.length, 1);
|
|
691
|
+
assert.match(dispatched[0].content, /`find_and_fix`/);
|
|
692
|
+
assert.match(dispatched[0].content, /TDD Gate/);
|
|
693
|
+
assert.match(dispatched[0].content, /red → green/);
|
|
694
|
+
// Session artifact must have tddGate.phase === "green" after dispatch
|
|
695
|
+
const statusCtx = createMockCtx();
|
|
696
|
+
await handleDebug("status cache-miss", statusCtx as any);
|
|
697
|
+
// Load the artifact directly to verify phase was updated
|
|
698
|
+
const { loadDebugSession: load } = await import("../debug-session-store.ts");
|
|
699
|
+
const record = load(base, "cache-miss");
|
|
700
|
+
assert.ok(record != null);
|
|
701
|
+
assert.equal(record!.session.tddGate?.phase, "green");
|
|
702
|
+
// Notification shows red→green transition
|
|
703
|
+
assert.match(ctx.notifications[0].message, /tddPhase=red→green/);
|
|
704
|
+
} finally {
|
|
705
|
+
process.chdir(saved);
|
|
706
|
+
rmSync(base, { recursive: true, force: true });
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
|
|
710
|
+
test("continue without checkpoint or TDD gate uses debug-diagnose template with find_and_fix (regression guard)", async () => {
|
|
711
|
+
const base = makeBase();
|
|
712
|
+
const ctx = createMockCtx();
|
|
713
|
+
const dispatched: Array<{ customType: string; content: string; display: boolean }> = [];
|
|
714
|
+
const mockPi = {
|
|
715
|
+
sendMessage(msg: { customType: string; content: string; display: boolean }) {
|
|
716
|
+
dispatched.push(msg);
|
|
717
|
+
},
|
|
718
|
+
};
|
|
719
|
+
const saved = process.cwd();
|
|
720
|
+
process.chdir(base);
|
|
721
|
+
|
|
722
|
+
try {
|
|
723
|
+
createDebugSession(base, { issue: "Login broken", createdAt: 10, status: "paused", phase: "blocked" });
|
|
724
|
+
|
|
725
|
+
await handleDebug("continue login-broken", ctx as any, mockPi as any);
|
|
726
|
+
|
|
727
|
+
assert.equal(dispatched.length, 1);
|
|
728
|
+
const dispatch = dispatched[0];
|
|
729
|
+
assert.equal(dispatch.customType, "gsd-debug-continue");
|
|
730
|
+
// Plain continue uses debug-diagnose — no structured return headers like ## TDD CHECKPOINT
|
|
731
|
+
assert.match(dispatch.content, /`find_and_fix`/);
|
|
732
|
+
assert.doesNotMatch(dispatch.content, /## Active Checkpoint/);
|
|
733
|
+
assert.doesNotMatch(dispatch.content, /## TDD Gate/);
|
|
734
|
+
// Notification shows plain dispatchMode
|
|
735
|
+
assert.match(ctx.notifications[0].message, /dispatchMode=find_and_fix/);
|
|
736
|
+
} finally {
|
|
737
|
+
process.chdir(saved);
|
|
738
|
+
rmSync(base, { recursive: true, force: true });
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
});
|
|
742
|
+
|
|
743
|
+
describe("debug-session-manager prompt template", () => {
|
|
744
|
+
test("loadPrompt('debug-session-manager') returns content with all structured return header keywords", () => {
|
|
745
|
+
const content = loadPrompt("debug-session-manager", {
|
|
746
|
+
slug: "auth-flake",
|
|
747
|
+
mode: "debug",
|
|
748
|
+
issue: "Login fails on Safari",
|
|
749
|
+
workingDirectory: "/repo",
|
|
750
|
+
goal: "find_root_cause_only",
|
|
751
|
+
checkpointContext: "",
|
|
752
|
+
tddContext: "",
|
|
753
|
+
specialistContext: "",
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
assert.match(content, /## ROOT CAUSE FOUND/);
|
|
757
|
+
assert.match(content, /## TDD CHECKPOINT/);
|
|
758
|
+
assert.match(content, /## CHECKPOINT REACHED/);
|
|
759
|
+
assert.match(content, /## DEBUG COMPLETE/);
|
|
760
|
+
assert.match(content, /## INVESTIGATION INCONCLUSIVE/);
|
|
761
|
+
});
|
|
762
|
+
|
|
763
|
+
test("template contains specialist mapping table keywords", () => {
|
|
764
|
+
const content = loadPrompt("debug-session-manager", {
|
|
765
|
+
slug: "auth-flake",
|
|
766
|
+
mode: "debug",
|
|
767
|
+
issue: "Login fails on Safari",
|
|
768
|
+
workingDirectory: "/repo",
|
|
769
|
+
goal: "find_root_cause_only",
|
|
770
|
+
checkpointContext: "",
|
|
771
|
+
tddContext: "",
|
|
772
|
+
specialistContext: "",
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
assert.match(content, /typescript-expert/);
|
|
776
|
+
assert.match(content, /supabase-postgres-best-practices/);
|
|
777
|
+
assert.match(content, /LOOKS_GOOD/);
|
|
778
|
+
assert.match(content, /SUGGEST_CHANGE/);
|
|
779
|
+
});
|
|
780
|
+
});
|
|
781
|
+
|
|
782
|
+
describe("continue handler — specialist review dispatch", () => {
|
|
783
|
+
test("continue with specialistReview present — dispatch payload contains specialist hint and verdict", async () => {
|
|
784
|
+
const base = makeBase();
|
|
785
|
+
const ctx = createMockCtx();
|
|
786
|
+
const dispatched: Array<{ customType: string; content: string; display: boolean }> = [];
|
|
787
|
+
const mockPi = {
|
|
788
|
+
sendMessage(msg: { customType: string; content: string; display: boolean }) {
|
|
789
|
+
dispatched.push(msg);
|
|
790
|
+
},
|
|
791
|
+
};
|
|
792
|
+
const saved = process.cwd();
|
|
793
|
+
process.chdir(base);
|
|
794
|
+
|
|
795
|
+
try {
|
|
796
|
+
createDebugSession(base, { issue: "Null pointer on login", createdAt: 10 });
|
|
797
|
+
updateDebugSession(base, "null-pointer-on-login", {
|
|
798
|
+
checkpoint: { type: "human-action", summary: "Check DB schema", awaitingResponse: true },
|
|
799
|
+
specialistReview: {
|
|
800
|
+
hint: "typescript",
|
|
801
|
+
skill: "typescript-expert",
|
|
802
|
+
verdict: "SUGGEST_CHANGE",
|
|
803
|
+
detail: "Use optional chaining instead of null checks",
|
|
804
|
+
reviewedAt: 1000,
|
|
805
|
+
},
|
|
806
|
+
});
|
|
807
|
+
|
|
808
|
+
await handleDebug("continue null-pointer-on-login", ctx as any, mockPi as any);
|
|
809
|
+
|
|
810
|
+
assert.equal(dispatched.length, 1);
|
|
811
|
+
const content = dispatched[0].content;
|
|
812
|
+
// specialistContext block appears in the dispatch
|
|
813
|
+
assert.match(content, /Prior Specialist Review/);
|
|
814
|
+
assert.match(content, /hint: typescript/);
|
|
815
|
+
assert.match(content, /verdict: SUGGEST_CHANGE/);
|
|
816
|
+
assert.match(content, /Use optional chaining/);
|
|
817
|
+
// Notification includes specialistHint label
|
|
818
|
+
assert.match(ctx.notifications[0].message, /specialistHint=typescript/);
|
|
819
|
+
} finally {
|
|
820
|
+
process.chdir(saved);
|
|
821
|
+
rmSync(base, { recursive: true, force: true });
|
|
822
|
+
}
|
|
823
|
+
});
|
|
824
|
+
|
|
825
|
+
test("continue with specialistReview absent — specialistContext is empty and notification has no specialistHint", async () => {
|
|
826
|
+
const base = makeBase();
|
|
827
|
+
const ctx = createMockCtx();
|
|
828
|
+
const dispatched: Array<{ customType: string; content: string; display: boolean }> = [];
|
|
829
|
+
const mockPi = {
|
|
830
|
+
sendMessage(msg: { customType: string; content: string; display: boolean }) {
|
|
831
|
+
dispatched.push(msg);
|
|
832
|
+
},
|
|
833
|
+
};
|
|
834
|
+
const saved = process.cwd();
|
|
835
|
+
process.chdir(base);
|
|
836
|
+
|
|
837
|
+
try {
|
|
838
|
+
createDebugSession(base, { issue: "Slow query", createdAt: 10 });
|
|
839
|
+
updateDebugSession(base, "slow-query", {
|
|
840
|
+
checkpoint: { type: "human-action", summary: "Verify index exists", awaitingResponse: true },
|
|
841
|
+
});
|
|
842
|
+
|
|
843
|
+
await handleDebug("continue slow-query", ctx as any, mockPi as any);
|
|
844
|
+
|
|
845
|
+
assert.equal(dispatched.length, 1);
|
|
846
|
+
const content = dispatched[0].content;
|
|
847
|
+
// No specialist content
|
|
848
|
+
assert.doesNotMatch(content, /Prior Specialist Review/);
|
|
849
|
+
assert.doesNotMatch(ctx.notifications[0].message, /specialistHint/);
|
|
850
|
+
} finally {
|
|
851
|
+
process.chdir(saved);
|
|
852
|
+
rmSync(base, { recursive: true, force: true });
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
|
|
856
|
+
test("continue with checkpoint + specialistReview — both contexts appear in dispatch", async () => {
|
|
857
|
+
const base = makeBase();
|
|
858
|
+
const ctx = createMockCtx();
|
|
859
|
+
const dispatched: Array<{ customType: string; content: string; display: boolean }> = [];
|
|
860
|
+
const mockPi = {
|
|
861
|
+
sendMessage(msg: { customType: string; content: string; display: boolean }) {
|
|
862
|
+
dispatched.push(msg);
|
|
863
|
+
},
|
|
864
|
+
};
|
|
865
|
+
const saved = process.cwd();
|
|
866
|
+
process.chdir(base);
|
|
867
|
+
|
|
868
|
+
try {
|
|
869
|
+
createDebugSession(base, { issue: "Memory leak in cache", createdAt: 10 });
|
|
870
|
+
updateDebugSession(base, "memory-leak-in-cache", {
|
|
871
|
+
checkpoint: {
|
|
872
|
+
type: "human-verify",
|
|
873
|
+
summary: "Verify heap snapshot shows leak",
|
|
874
|
+
awaitingResponse: true,
|
|
875
|
+
userResponse: "Yes, confirmed leak at line 42",
|
|
876
|
+
},
|
|
877
|
+
specialistReview: {
|
|
878
|
+
hint: "database",
|
|
879
|
+
skill: "supabase-postgres-best-practices",
|
|
880
|
+
verdict: "LOOKS_GOOD",
|
|
881
|
+
detail: "Query plan is optimal",
|
|
882
|
+
reviewedAt: 2000,
|
|
883
|
+
},
|
|
884
|
+
});
|
|
885
|
+
|
|
886
|
+
await handleDebug("continue memory-leak-in-cache", ctx as any, mockPi as any);
|
|
887
|
+
|
|
888
|
+
assert.equal(dispatched.length, 1);
|
|
889
|
+
const content = dispatched[0].content;
|
|
890
|
+
// Checkpoint context present
|
|
891
|
+
assert.match(content, /Active Checkpoint/);
|
|
892
|
+
assert.match(content, /Verify heap snapshot/);
|
|
893
|
+
// Specialist context present
|
|
894
|
+
assert.match(content, /Prior Specialist Review/);
|
|
895
|
+
assert.match(content, /hint: database/);
|
|
896
|
+
assert.match(content, /verdict: LOOKS_GOOD/);
|
|
897
|
+
// Notification includes both checkpoint type and specialist hint
|
|
898
|
+
assert.match(ctx.notifications[0].message, /checkpointType=human-verify/);
|
|
899
|
+
assert.match(ctx.notifications[0].message, /specialistHint=database/);
|
|
900
|
+
} finally {
|
|
901
|
+
process.chdir(saved);
|
|
902
|
+
rmSync(base, { recursive: true, force: true });
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
});
|