gsd-pi 2.76.0 → 2.77.0
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 +45 -25
- package/dist/claude-cli-check.js +32 -3
- package/dist/mcp-server.d.ts +7 -0
- package/dist/mcp-server.js +35 -1
- package/dist/onboarding.js +45 -0
- package/dist/resource-loader.d.ts +1 -1
- package/dist/resource-loader.js +2 -8
- package/dist/resources/agents/researcher.md +1 -1
- package/dist/resources/extensions/claude-code-cli/readiness.js +31 -8
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +77 -17
- package/dist/resources/extensions/gsd/auto/loop.js +9 -0
- package/dist/resources/extensions/gsd/auto/phases.js +104 -11
- package/dist/resources/extensions/gsd/auto/run-unit.js +38 -2
- package/dist/resources/extensions/gsd/auto/session.js +22 -1
- package/dist/resources/extensions/gsd/auto-dispatch.js +16 -3
- package/dist/resources/extensions/gsd/auto-model-selection.js +53 -16
- package/dist/resources/extensions/gsd/auto-post-unit.js +25 -2
- package/dist/resources/extensions/gsd/auto-prompts.js +14 -0
- package/dist/resources/extensions/gsd/auto-recovery.js +32 -1
- package/dist/resources/extensions/gsd/auto-start.js +58 -57
- package/dist/resources/extensions/gsd/auto-verification.js +33 -0
- package/dist/resources/extensions/gsd/auto-worktree.js +51 -53
- package/dist/resources/extensions/gsd/auto.js +70 -28
- package/dist/resources/extensions/gsd/blocked-models.js +68 -0
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +93 -1
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +39 -9
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +93 -0
- package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +3 -0
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +12 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +52 -6
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +84 -23
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +34 -2
- package/dist/resources/extensions/gsd/clean-root-preflight.js +93 -0
- package/dist/resources/extensions/gsd/commands-extract-learnings.js +54 -89
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +968 -23
- package/dist/resources/extensions/gsd/compaction-snapshot.js +121 -0
- package/dist/resources/extensions/gsd/complexity-classifier.js +5 -3
- package/dist/resources/extensions/gsd/db-writer.js +88 -16
- package/dist/resources/extensions/gsd/doctor-git-checks.js +23 -29
- package/dist/resources/extensions/gsd/doctor-providers.js +51 -5
- package/dist/resources/extensions/gsd/ecosystem/gsd-extension-api.js +1 -0
- package/dist/resources/extensions/gsd/error-classifier.js +31 -3
- package/dist/resources/extensions/gsd/exec-history.js +120 -0
- package/dist/resources/extensions/gsd/exec-sandbox.js +258 -0
- package/dist/resources/extensions/gsd/gitignore.js +1 -0
- package/dist/resources/extensions/gsd/gsd-db.js +168 -23
- package/dist/resources/extensions/gsd/guided-flow.js +190 -1
- package/dist/resources/extensions/gsd/health-widget.js +4 -1
- package/dist/resources/extensions/gsd/hook-emitter.js +108 -0
- package/dist/resources/extensions/gsd/init-wizard.js +15 -1
- package/dist/resources/extensions/gsd/key-manager.js +28 -0
- package/dist/resources/extensions/gsd/memory-backfill.js +126 -0
- package/dist/resources/extensions/gsd/memory-store.js +19 -0
- package/dist/resources/extensions/gsd/model-router.js +36 -3
- package/dist/resources/extensions/gsd/pre-execution-checks.js +44 -9
- package/dist/resources/extensions/gsd/preferences-types.js +9 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +83 -0
- package/dist/resources/extensions/gsd/preferences.js +17 -17
- package/dist/resources/extensions/gsd/prompt-loader.js +22 -7
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +2 -2
- package/dist/resources/extensions/gsd/prompts/debug-diagnose.md +2 -0
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +8 -0
- package/dist/resources/extensions/gsd/prompts/discuss.md +29 -2
- package/dist/resources/extensions/gsd/prompts/execute-task.md +3 -2
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +5 -2
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -0
- package/dist/resources/extensions/gsd/prompts/research-slice.md +1 -0
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +96 -0
- package/dist/resources/extensions/gsd/safety/file-change-validator.js +13 -5
- package/dist/resources/extensions/gsd/safety/safety-harness.js +5 -1
- package/dist/resources/extensions/gsd/state.js +43 -4
- package/dist/resources/extensions/gsd/token-counter.js +22 -5
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +16 -10
- package/dist/resources/extensions/gsd/tools/exec-search-tool.js +59 -0
- package/dist/resources/extensions/gsd/tools/exec-tool.js +126 -0
- package/dist/resources/extensions/gsd/tools/memory-tools.js +26 -1
- package/dist/resources/extensions/gsd/tools/resume-tool.js +23 -0
- package/dist/resources/extensions/gsd/uok/plan-v2.js +20 -3
- package/dist/resources/extensions/gsd/workflow-mcp.js +3 -0
- package/dist/resources/extensions/gsd/workflow-templates/spike.md +6 -0
- package/dist/resources/extensions/gsd/worktree-resolver.js +50 -10
- package/dist/resources/extensions/search-the-web/command-search-provider.js +5 -4
- package/dist/resources/extensions/search-the-web/native-search.js +45 -13
- package/dist/resources/skills/api-design/SKILL.md +190 -0
- package/dist/resources/skills/create-mcp-server/SKILL.md +121 -0
- package/dist/resources/skills/decompose-into-slices/SKILL.md +139 -0
- package/dist/resources/skills/dependency-upgrade/SKILL.md +158 -0
- package/dist/resources/skills/design-an-interface/SKILL.md +102 -0
- package/dist/resources/skills/forensics/SKILL.md +153 -0
- package/dist/resources/skills/grill-me/SKILL.md +93 -0
- package/dist/resources/skills/handoff/SKILL.md +121 -0
- package/dist/resources/skills/observability/SKILL.md +174 -0
- package/dist/resources/skills/security-review/SKILL.md +181 -0
- package/dist/resources/skills/spike-wrap-up/SKILL.md +138 -0
- package/dist/resources/skills/tdd/SKILL.md +112 -0
- package/dist/resources/skills/verify-before-complete/SKILL.md +98 -0
- package/dist/resources/skills/write-docs/SKILL.md +82 -0
- package/dist/resources/skills/write-milestone-brief/SKILL.md +135 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +10 -10
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- package/dist/web/standalone/.next/required-server-files.json +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.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +10 -10
- package/dist/web/standalone/.next/server/chunks/6897.js +2 -2
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +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/server.js +1 -1
- package/dist/welcome-screen.js +6 -1
- package/dist/wizard.js +2 -0
- package/package.json +1 -1
- package/packages/daemon/package.json +2 -2
- package/packages/mcp-server/dist/remote-questions.d.ts +45 -0
- package/packages/mcp-server/dist/remote-questions.d.ts.map +1 -0
- package/packages/mcp-server/dist/remote-questions.js +732 -0
- package/packages/mcp-server/dist/remote-questions.js.map +1 -0
- package/packages/mcp-server/dist/server.d.ts +7 -0
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +70 -8
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/session-manager.d.ts +14 -0
- package/packages/mcp-server/dist/session-manager.d.ts.map +1 -1
- package/packages/mcp-server/dist/session-manager.js +49 -1
- package/packages/mcp-server/dist/session-manager.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +163 -25
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +4 -3
- package/packages/mcp-server/src/mcp-server.test.ts +67 -0
- package/packages/mcp-server/src/remote-questions.test.ts +294 -0
- package/packages/mcp-server/src/remote-questions.ts +916 -0
- package/packages/mcp-server/src/server.ts +89 -14
- package/packages/mcp-server/src/session-manager.ts +43 -1
- package/packages/mcp-server/src/workflow-tools.test.ts +146 -1
- package/packages/mcp-server/src/workflow-tools.ts +215 -43
- package/packages/mcp-server/tsconfig.test.json +19 -0
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/package.json +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +12 -0
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/dist/types.d.ts +30 -0
- package/packages/pi-agent-core/dist/types.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/types.js.map +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-agent-core/src/agent-loop.ts +14 -0
- package/packages/pi-agent-core/src/types.ts +34 -0
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/models/custom.d.ts +38 -0
- package/packages/pi-ai/dist/models/custom.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/custom.js +41 -0
- package/packages/pi-ai/dist/models/custom.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js +13 -0
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +27 -4
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +13 -4
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js +80 -0
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +60 -15
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/dist/providers/simple-options.d.ts +10 -0
- package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/simple-options.js +16 -1
- package/packages/pi-ai/dist/providers/simple-options.js.map +1 -1
- package/packages/pi-ai/dist/providers/think-tag-parser.d.ts +17 -0
- package/packages/pi-ai/dist/providers/think-tag-parser.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/think-tag-parser.js +75 -0
- package/packages/pi-ai/dist/providers/think-tag-parser.js.map +1 -0
- package/packages/pi-ai/dist/providers/think-tag-parser.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/think-tag-parser.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/think-tag-parser.test.js +41 -0
- package/packages/pi-ai/dist/providers/think-tag-parser.test.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js +12 -2
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +164 -14
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.js +15 -3
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js +67 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js +16 -3
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js +67 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.js +289 -0
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.js.map +1 -0
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/src/models/custom.ts +42 -0
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +1 -1
- package/packages/pi-ai/src/providers/anthropic-bearer-auth.test.ts +26 -0
- package/packages/pi-ai/src/providers/anthropic-shared.ts +26 -5
- package/packages/pi-ai/src/providers/anthropic.ts +15 -4
- package/packages/pi-ai/src/providers/minimax-tool-name.test.ts +98 -0
- package/packages/pi-ai/src/providers/openai-completions.ts +57 -16
- package/packages/pi-ai/src/providers/simple-options.ts +17 -1
- package/packages/pi-ai/src/providers/think-tag-parser.test.ts +44 -0
- package/packages/pi-ai/src/providers/think-tag-parser.ts +94 -0
- package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +200 -23
- package/packages/pi-ai/src/utils/oauth/github-copilot.ts +12 -2
- package/packages/pi-ai/src/utils/oauth/google-antigravity.test.ts +84 -0
- package/packages/pi-ai/src/utils/oauth/google-antigravity.ts +15 -5
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.test.ts +84 -0
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.ts +16 -5
- package/packages/pi-ai/src/utils/oauth/oauth-providers.test.ts +363 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +3 -2
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +32 -2
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +4 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +35 -2
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +233 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +205 -2
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/hooks-runner.d.ts +53 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.js +337 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js +234 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/index.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/index.js +1 -0
- package/packages/pi-coding-agent/dist/core/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-discovery.d.ts +3 -1
- package/packages/pi-coding-agent/dist/core/model-discovery.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-discovery.js +92 -12
- package/packages/pi-coding-agent/dist/core/model-discovery.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-discovery.test.js +16 -1
- package/packages/pi-coding-agent/dist/core/model-discovery.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.js +40 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.js +203 -0
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-discovery.test.js +61 -1
- package/packages/pi-coding-agent/dist/core/model-registry-discovery.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts +5 -0
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +90 -10
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/redact-secrets.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/redact-secrets.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/redact-secrets.js +49 -0
- package/packages/pi-coding-agent/dist/core/redact-secrets.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/redact-secrets.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/redact-secrets.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/redact-secrets.test.js +67 -0
- package/packages/pi-coding-agent/dist/core/redact-secrets.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.js +10 -6
- package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.test.js +45 -1
- package/packages/pi-coding-agent/dist/core/session-manager.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +55 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts +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 +5 -4
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.js +13 -7
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +7 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +29 -21
- package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +13 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +3 -2
- package/packages/pi-coding-agent/src/core/agent-session.ts +38 -2
- package/packages/pi-coding-agent/src/core/extensions/index.ts +16 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +5 -0
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +351 -0
- package/packages/pi-coding-agent/src/core/extensions/types.ts +258 -0
- package/packages/pi-coding-agent/src/core/hooks-runner.test.ts +269 -0
- package/packages/pi-coding-agent/src/core/hooks-runner.ts +460 -0
- package/packages/pi-coding-agent/src/core/index.ts +10 -0
- package/packages/pi-coding-agent/src/core/model-discovery.test.ts +19 -0
- package/packages/pi-coding-agent/src/core/model-discovery.ts +99 -12
- package/packages/pi-coding-agent/src/core/model-registry-auth-header.test.ts +44 -0
- package/packages/pi-coding-agent/src/core/model-registry-custom-caps.test.ts +245 -0
- package/packages/pi-coding-agent/src/core/model-registry-discovery.test.ts +75 -0
- package/packages/pi-coding-agent/src/core/model-registry.ts +102 -10
- package/packages/pi-coding-agent/src/core/redact-secrets.test.ts +86 -0
- package/packages/pi-coding-agent/src/core/redact-secrets.ts +58 -0
- package/packages/pi-coding-agent/src/core/session-manager.test.ts +65 -1
- package/packages/pi-coding-agent/src/core/session-manager.ts +10 -6
- package/packages/pi-coding-agent/src/core/settings-manager.ts +57 -0
- package/packages/pi-coding-agent/src/index.ts +16 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +6 -6
- package/packages/pi-coding-agent/src/modes/interactive/components/provider-manager.ts +16 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/skill-invocation-message.ts +36 -22
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +13 -1
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/package.json +1 -1
- package/packages/rpc-client/package.json +1 -1
- package/pkg/package.json +1 -1
- package/scripts/link-workspace-packages.cjs +1 -0
- package/src/resources/agents/researcher.md +1 -1
- package/src/resources/extensions/claude-code-cli/readiness.ts +32 -8
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +78 -17
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +149 -5
- package/src/resources/extensions/gsd/auto/loop-deps.ts +14 -0
- package/src/resources/extensions/gsd/auto/loop.ts +9 -0
- package/src/resources/extensions/gsd/auto/phases.ts +131 -10
- package/src/resources/extensions/gsd/auto/run-unit.ts +40 -2
- package/src/resources/extensions/gsd/auto/session.ts +35 -2
- package/src/resources/extensions/gsd/auto-dispatch.ts +16 -3
- package/src/resources/extensions/gsd/auto-model-selection.ts +71 -15
- package/src/resources/extensions/gsd/auto-post-unit.ts +29 -3
- package/src/resources/extensions/gsd/auto-prompts.ts +28 -1
- package/src/resources/extensions/gsd/auto-recovery.ts +26 -1
- package/src/resources/extensions/gsd/auto-start.ts +60 -68
- package/src/resources/extensions/gsd/auto-verification.ts +33 -0
- package/src/resources/extensions/gsd/auto-worktree.ts +62 -63
- package/src/resources/extensions/gsd/auto.ts +73 -28
- package/src/resources/extensions/gsd/blocked-models.ts +98 -0
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +120 -1
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +40 -9
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +109 -0
- package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +5 -0
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +15 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +54 -6
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +89 -26
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +35 -2
- package/src/resources/extensions/gsd/clean-root-preflight.ts +111 -0
- package/src/resources/extensions/gsd/commands-extract-learnings.ts +55 -90
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +898 -32
- package/src/resources/extensions/gsd/compaction-snapshot.ts +165 -0
- package/src/resources/extensions/gsd/complexity-classifier.ts +5 -3
- package/src/resources/extensions/gsd/db-writer.ts +88 -17
- package/src/resources/extensions/gsd/doctor-git-checks.ts +23 -27
- package/src/resources/extensions/gsd/doctor-providers.ts +59 -6
- package/src/resources/extensions/gsd/ecosystem/gsd-extension-api.ts +2 -0
- package/src/resources/extensions/gsd/error-classifier.ts +36 -3
- package/src/resources/extensions/gsd/exec-history.ts +153 -0
- package/src/resources/extensions/gsd/exec-sandbox.ts +326 -0
- package/src/resources/extensions/gsd/gitignore.ts +1 -1
- package/src/resources/extensions/gsd/gsd-db.ts +186 -23
- package/src/resources/extensions/gsd/guided-flow.ts +222 -1
- package/src/resources/extensions/gsd/health-widget.ts +3 -1
- package/src/resources/extensions/gsd/hook-emitter.ts +188 -0
- package/src/resources/extensions/gsd/init-wizard.ts +15 -1
- package/src/resources/extensions/gsd/journal.ts +2 -1
- package/src/resources/extensions/gsd/key-manager.ts +28 -0
- package/src/resources/extensions/gsd/memory-backfill.ts +140 -0
- package/src/resources/extensions/gsd/memory-store.ts +26 -0
- package/src/resources/extensions/gsd/model-router.ts +42 -1
- package/src/resources/extensions/gsd/pre-execution-checks.ts +46 -10
- package/src/resources/extensions/gsd/preferences-types.ts +46 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +79 -0
- package/src/resources/extensions/gsd/preferences.ts +17 -17
- package/src/resources/extensions/gsd/prompt-loader.ts +30 -7
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/complete-slice.md +2 -2
- package/src/resources/extensions/gsd/prompts/debug-diagnose.md +2 -0
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +8 -0
- package/src/resources/extensions/gsd/prompts/discuss.md +29 -2
- package/src/resources/extensions/gsd/prompts/execute-task.md +3 -2
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +5 -2
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -0
- package/src/resources/extensions/gsd/prompts/research-slice.md +1 -0
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +119 -0
- package/src/resources/extensions/gsd/safety/file-change-validator.ts +17 -4
- package/src/resources/extensions/gsd/safety/safety-harness.ts +9 -0
- package/src/resources/extensions/gsd/state.ts +45 -4
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +188 -2
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +95 -1
- package/src/resources/extensions/gsd/tests/auto-paused-session-validation.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +49 -0
- package/src/resources/extensions/gsd/tests/auto-start-bootstrap-await-3420.test.ts +141 -0
- package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +33 -3
- package/src/resources/extensions/gsd/tests/auto-thinking-restore.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/blocked-models.test.ts +98 -0
- package/src/resources/extensions/gsd/tests/bundled-skill-triggers.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +186 -0
- package/src/resources/extensions/gsd/tests/commands-extract-learnings.test.ts +68 -66
- package/src/resources/extensions/gsd/tests/compaction-snapshot.test.ts +123 -0
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +61 -1
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/complexity-classifier.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/derive-state-helpers.test.ts +8 -4
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +148 -3
- package/src/resources/extensions/gsd/tests/double-merge-guard.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/ensure-db-open.test.ts +306 -1
- package/src/resources/extensions/gsd/tests/escalation.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/exec-history.test.ts +237 -0
- package/src/resources/extensions/gsd/tests/exec-sandbox.test.ts +210 -0
- package/src/resources/extensions/gsd/tests/file-change-validator.test.ts +58 -0
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +40 -9
- package/src/resources/extensions/gsd/tests/freeform-decisions.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +447 -1
- package/src/resources/extensions/gsd/tests/init-wizard.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-git-symlink-cwd.test.ts +11 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-git.test.ts +78 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/integration/gitignore-tracked-gsd.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/integration/idle-recovery.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/interactive-routing-bypass.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/isolation-none-branch-guard.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/issue-4540-regressions.test.ts +288 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/key-manager.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/load-memory-block.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/parallel-research-dispatch.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/plan-gate-failed-doctor-heal-hint.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/pre-exec-backtick-strip.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/pre-exec-gate-loop.test.ts +272 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +356 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +110 -0
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/prompt-loader-extension-dir.test.ts +49 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +103 -4
- package/src/resources/extensions/gsd/tests/ready-phrase-no-files-4573.test.ts +388 -0
- package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +9 -3
- package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +230 -0
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +205 -0
- package/src/resources/extensions/gsd/tests/save-gate-result-render.test.ts +95 -0
- package/src/resources/extensions/gsd/tests/schema-v21-sequence.test.ts +413 -0
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +32 -40
- package/src/resources/extensions/gsd/tests/stash-queued-context-files.test.ts +56 -0
- package/src/resources/extensions/gsd/tests/token-counter.test.ts +105 -1
- package/src/resources/extensions/gsd/tests/tool-compatibility.test.ts +107 -0
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +9 -3
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +65 -2
- package/src/resources/extensions/gsd/tests/worktree-db.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +6 -1
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +78 -5
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +64 -0
- package/src/resources/extensions/gsd/tests/zombie-gsd-state.test.ts +3 -1
- package/src/resources/extensions/gsd/token-counter.ts +22 -5
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +15 -9
- package/src/resources/extensions/gsd/tools/exec-search-tool.ts +81 -0
- package/src/resources/extensions/gsd/tools/exec-tool.ts +183 -0
- package/src/resources/extensions/gsd/tools/memory-tools.ts +31 -1
- package/src/resources/extensions/gsd/tools/resume-tool.ts +40 -0
- package/src/resources/extensions/gsd/uok/plan-v2.ts +26 -3
- package/src/resources/extensions/gsd/workflow-logger.ts +4 -1
- package/src/resources/extensions/gsd/workflow-mcp.ts +3 -0
- package/src/resources/extensions/gsd/workflow-templates/spike.md +6 -0
- package/src/resources/extensions/gsd/worktree-resolver.ts +54 -9
- package/src/resources/extensions/search-the-web/command-search-provider.ts +5 -4
- package/src/resources/extensions/search-the-web/native-search.ts +48 -12
- package/src/resources/skills/api-design/SKILL.md +190 -0
- package/src/resources/skills/create-mcp-server/SKILL.md +121 -0
- package/src/resources/skills/decompose-into-slices/SKILL.md +139 -0
- package/src/resources/skills/dependency-upgrade/SKILL.md +158 -0
- package/src/resources/skills/design-an-interface/SKILL.md +102 -0
- package/src/resources/skills/forensics/SKILL.md +153 -0
- package/src/resources/skills/grill-me/SKILL.md +93 -0
- package/src/resources/skills/handoff/SKILL.md +121 -0
- package/src/resources/skills/observability/SKILL.md +174 -0
- package/src/resources/skills/security-review/SKILL.md +181 -0
- package/src/resources/skills/spike-wrap-up/SKILL.md +138 -0
- package/src/resources/skills/tdd/SKILL.md +112 -0
- package/src/resources/skills/verify-before-complete/SKILL.md +98 -0
- package/src/resources/skills/write-docs/SKILL.md +82 -0
- package/src/resources/skills/write-milestone-brief/SKILL.md +135 -0
- /package/dist/web/standalone/.next/static/{ssX7BLv3Dw9Fb4CtrCGeR → pV-mPo7rYGb5JBC09C8GG}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{ssX7BLv3Dw9Fb4CtrCGeR → pV-mPo7rYGb5JBC09C8GG}/_ssgManifest.js +0 -0
|
@@ -15,6 +15,7 @@ import { readFile, readdir, stat } from 'node:fs/promises';
|
|
|
15
15
|
import { join, resolve } from 'node:path';
|
|
16
16
|
import { z } from 'zod';
|
|
17
17
|
import type { SessionManager } from './session-manager.js';
|
|
18
|
+
import { isRemoteConfigured, tryRemoteQuestions } from './remote-questions.js';
|
|
18
19
|
import { readProgress } from './readers/state.js';
|
|
19
20
|
import { readRoadmap } from './readers/roadmap.js';
|
|
20
21
|
import { readHistory } from './readers/metrics.js';
|
|
@@ -34,6 +35,34 @@ const MCP_PKG = '@modelcontextprotocol/sdk';
|
|
|
34
35
|
const SERVER_NAME = 'gsd';
|
|
35
36
|
const SERVER_VERSION = '2.53.0';
|
|
36
37
|
|
|
38
|
+
/** User-interaction timeout — generous but bounded so elicitation can't hang indefinitely (#4586). */
|
|
39
|
+
const ELICIT_TIMEOUT_MS = 10 * 60 * 1000; // 10 minutes
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Race a promise against a timeout. Rejects with a typed error on timeout so
|
|
43
|
+
* callers can return a specific MCP error response rather than hanging.
|
|
44
|
+
*
|
|
45
|
+
* @param timeoutMs - override for testing; defaults to ELICIT_TIMEOUT_MS
|
|
46
|
+
*/
|
|
47
|
+
export async function withElicitTimeout<T>(
|
|
48
|
+
promise: Promise<T>,
|
|
49
|
+
label: string,
|
|
50
|
+
timeoutMs = ELICIT_TIMEOUT_MS,
|
|
51
|
+
): Promise<T> {
|
|
52
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
53
|
+
const timeout = new Promise<never>((_, reject) => {
|
|
54
|
+
timer = setTimeout(
|
|
55
|
+
() => reject(new Error(`${label} timed out after ${timeoutMs / 60000} minutes — no user response received`)),
|
|
56
|
+
timeoutMs,
|
|
57
|
+
);
|
|
58
|
+
});
|
|
59
|
+
try {
|
|
60
|
+
return await Promise.race([promise, timeout]);
|
|
61
|
+
} finally {
|
|
62
|
+
clearTimeout(timer);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
37
66
|
// ---------------------------------------------------------------------------
|
|
38
67
|
// Tool result helpers
|
|
39
68
|
// ---------------------------------------------------------------------------
|
|
@@ -458,17 +487,40 @@ export async function createMcpServer(sessionManager: SessionManager): Promise<{
|
|
|
458
487
|
|
|
459
488
|
// -----------------------------------------------------------------------
|
|
460
489
|
// gsd_cancel — cancel a running session
|
|
490
|
+
//
|
|
491
|
+
// Supports two lookup strategies:
|
|
492
|
+
// 1. sessionId — the ID returned from gsd_execute (primary)
|
|
493
|
+
// 2. projectDir — absolute path to the project directory (fallback)
|
|
494
|
+
//
|
|
495
|
+
// The projectDir fallback handles interactive sessions (started via
|
|
496
|
+
// `/gsd auto` in the terminal) and post-restart MCP sessions that were
|
|
497
|
+
// never registered with a sessionId in this server instance.
|
|
461
498
|
// -----------------------------------------------------------------------
|
|
462
499
|
server.tool(
|
|
463
500
|
'gsd_cancel',
|
|
464
|
-
'Cancel a running GSD session. Aborts the current operation and stops the process.',
|
|
501
|
+
'Cancel a running GSD session. Aborts the current operation and stops the process. Provide sessionId (from gsd_execute) or projectDir as a fallback for interactive/restarted sessions.',
|
|
465
502
|
{
|
|
466
|
-
sessionId: z.string().describe('Session ID returned from gsd_execute'),
|
|
503
|
+
sessionId: z.string().optional().describe('Session ID returned from gsd_execute'),
|
|
504
|
+
projectDir: z.string().optional().describe('Absolute path to the project directory (fallback when sessionId is unavailable)'),
|
|
467
505
|
},
|
|
468
506
|
async (args: Record<string, unknown>) => {
|
|
469
|
-
const { sessionId } = args as { sessionId
|
|
507
|
+
const { sessionId, projectDir } = args as { sessionId?: string; projectDir?: string };
|
|
470
508
|
try {
|
|
471
|
-
|
|
509
|
+
if (!sessionId && !projectDir) {
|
|
510
|
+
return errorContent('Either sessionId or projectDir must be provided');
|
|
511
|
+
}
|
|
512
|
+
if (sessionId) {
|
|
513
|
+
try {
|
|
514
|
+
await sessionManager.cancelSession(sessionId);
|
|
515
|
+
} catch (err) {
|
|
516
|
+
if (!projectDir || !(err instanceof Error) || !err.message.includes('Session not found')) {
|
|
517
|
+
throw err;
|
|
518
|
+
}
|
|
519
|
+
await sessionManager.cancelSessionByDir(projectDir);
|
|
520
|
+
}
|
|
521
|
+
} else if (projectDir) {
|
|
522
|
+
await sessionManager.cancelSessionByDir(projectDir);
|
|
523
|
+
}
|
|
472
524
|
return jsonContent({ cancelled: true });
|
|
473
525
|
} catch (err) {
|
|
474
526
|
return errorContent(err instanceof Error ? err.message : String(err));
|
|
@@ -545,13 +597,33 @@ export async function createMcpServer(sessionManager: SessionManager): Promise<{
|
|
|
545
597
|
allowMultiple: z.boolean().optional().describe('If true, the user can select multiple options. No "None of the above" option is added.'),
|
|
546
598
|
})).describe('Questions to show the user. Prefer 1 and do not exceed 3.'),
|
|
547
599
|
},
|
|
548
|
-
async (args: Record<string, unknown
|
|
600
|
+
async (args: Record<string, unknown>, extra?: McpToolExtra) => {
|
|
549
601
|
const { questions } = args as unknown as AskUserQuestionsParams;
|
|
550
602
|
try {
|
|
551
603
|
const validationError = validateAskUserQuestionsPayload(questions);
|
|
552
604
|
if (validationError) return errorContent(validationError);
|
|
553
605
|
|
|
554
|
-
|
|
606
|
+
// Delegate to remote-questions manager when a remote channel is configured
|
|
607
|
+
// (Discord, Slack, Telegram). This path is the only one reachable for
|
|
608
|
+
// Claude Code-under-gsd sessions, which have no local TUI.
|
|
609
|
+
if (isRemoteConfigured()) {
|
|
610
|
+
const remoteResult = await tryRemoteQuestions(questions, extra?.signal);
|
|
611
|
+
if (remoteResult) {
|
|
612
|
+
const details = remoteResult.details as Record<string, unknown> | undefined;
|
|
613
|
+
if (details?.['timed_out'] || details?.['error']) {
|
|
614
|
+
// Surface timeout/error as plain text so the LLM knows to retry
|
|
615
|
+
return textContent(remoteResult.content[0]?.text ?? 'Remote questions timed out or failed');
|
|
616
|
+
}
|
|
617
|
+
return textContent(remoteResult.content[0]?.text ?? '');
|
|
618
|
+
}
|
|
619
|
+
// resolveRemoteConfig() returned null between isRemoteConfigured() and
|
|
620
|
+
// tryRemoteQuestions() (e.g. env var was cleared) — fall through to local.
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
const elicitation = await withElicitTimeout(
|
|
624
|
+
server.server.elicitInput(buildAskUserQuestionsElicitRequest(questions)),
|
|
625
|
+
'ask_user_questions',
|
|
626
|
+
);
|
|
555
627
|
if (elicitation.action !== 'accept' || !elicitation.content) {
|
|
556
628
|
return textContent('ask_user_questions was cancelled before receiving a response');
|
|
557
629
|
}
|
|
@@ -627,14 +699,17 @@ export async function createMcpServer(sessionManager: SessionManager): Promise<{
|
|
|
627
699
|
}
|
|
628
700
|
|
|
629
701
|
// (3) Elicit input from the MCP client
|
|
630
|
-
const elicitation = await
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
702
|
+
const elicitation = await withElicitTimeout(
|
|
703
|
+
server.server.elicitInput({
|
|
704
|
+
message: `Enter values for ${pendingKeys.length} environment variable(s). Values are written directly to the project and never shown to the AI.`,
|
|
705
|
+
requestedSchema: {
|
|
706
|
+
type: 'object',
|
|
707
|
+
properties,
|
|
708
|
+
required,
|
|
709
|
+
},
|
|
710
|
+
}),
|
|
711
|
+
'secure_env_collect',
|
|
712
|
+
);
|
|
638
713
|
|
|
639
714
|
if (elicitation.action !== 'accept' || !elicitation.content) {
|
|
640
715
|
return textContent('secure_env_collect was cancelled by user.');
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { execSync } from 'node:child_process';
|
|
10
|
-
import {
|
|
10
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
11
|
+
import { resolve, join } from 'node:path';
|
|
11
12
|
import { RpcClient } from '@gsd-build/rpc-client';
|
|
12
13
|
import type { SdkAgentEvent, RpcInitResult, RpcCostUpdateEvent, RpcExtensionUIRequest } from '@gsd-build/rpc-client';
|
|
13
14
|
import type {
|
|
@@ -188,7 +189,48 @@ export class SessionManager {
|
|
|
188
189
|
async cancelSession(sessionId: string): Promise<void> {
|
|
189
190
|
const session = this.getSession(sessionId);
|
|
190
191
|
if (!session) throw new Error(`Session not found: ${sessionId}`);
|
|
192
|
+
await this._cancelSessionObject(session);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Cancel a session looked up by project directory.
|
|
197
|
+
*
|
|
198
|
+
* This is the fallback path for interactive sessions (started via `/gsd auto`
|
|
199
|
+
* in the terminal) and sessions from a restarted MCP server that have no
|
|
200
|
+
* registered sessionId. The sessions map is keyed by projectDir, so this
|
|
201
|
+
* lookup always succeeds for any tracked session regardless of sessionId.
|
|
202
|
+
*/
|
|
203
|
+
async cancelSessionByDir(projectDir: string): Promise<void> {
|
|
204
|
+
const session = this.getSessionByDir(projectDir);
|
|
205
|
+
if (session) {
|
|
206
|
+
await this._cancelSessionObject(session);
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
const stopped = await this.stopDetachedAutoProcess(projectDir);
|
|
210
|
+
if (!stopped) {
|
|
211
|
+
throw new Error(`Session not found for projectDir: ${projectDir}`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
private async stopDetachedAutoProcess(projectDir: string): Promise<boolean> {
|
|
216
|
+
const lockPath = join(projectDir, '.gsd', 'auto.lock');
|
|
217
|
+
if (!existsSync(lockPath)) return false;
|
|
218
|
+
try {
|
|
219
|
+
const lockData = JSON.parse(readFileSync(lockPath, 'utf-8')) as { pid?: number };
|
|
220
|
+
const pid = lockData.pid;
|
|
221
|
+
if (typeof pid !== 'number') return false;
|
|
222
|
+
try { process.kill(pid, 0); } catch { return false; }
|
|
223
|
+
process.kill(pid, 'SIGTERM');
|
|
224
|
+
return true;
|
|
225
|
+
} catch {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
191
229
|
|
|
230
|
+
/**
|
|
231
|
+
* Internal: perform abort + stop + mark cancelled on a resolved session object.
|
|
232
|
+
*/
|
|
233
|
+
private async _cancelSessionObject(session: ManagedSession): Promise<void> {
|
|
192
234
|
try {
|
|
193
235
|
await session.client.abort();
|
|
194
236
|
} catch { /* may already be stopped */ }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it } from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
|
-
import { mkdirSync, rmSync, writeFileSync, existsSync } from "node:fs";
|
|
3
|
+
import { mkdirSync, rmSync, writeFileSync, readFileSync, existsSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
@@ -288,6 +288,136 @@ describe("workflow MCP tools", () => {
|
|
|
288
288
|
}
|
|
289
289
|
});
|
|
290
290
|
|
|
291
|
+
it("#4477 gsd_task_complete forwards every schema field to the executor (regression for destructure-rebuild bug class)", async () => {
|
|
292
|
+
// Locks in the class-fix from PR #4477 review: handleTaskComplete previously
|
|
293
|
+
// destructured args into a hand-listed set of fields and rebuilt the call
|
|
294
|
+
// payload, which silently dropped ADR-011's `escalation` field (and any
|
|
295
|
+
// future schema field added without updating the rebuild). The fix passes
|
|
296
|
+
// `args` through directly, matching the spread pattern of sibling
|
|
297
|
+
// handlers. This test verifies the contract by injecting a mock executor
|
|
298
|
+
// module that captures the args, calling gsd_task_complete with an
|
|
299
|
+
// `escalation` payload, and asserting the field reached the executor.
|
|
300
|
+
const base = makeTmpBase();
|
|
301
|
+
const capturePath = join(base, "captured-args.json");
|
|
302
|
+
const mockModulePath = join(base, "mock-executors.mjs");
|
|
303
|
+
const prevModule = process.env.GSD_WORKFLOW_EXECUTORS_MODULE;
|
|
304
|
+
const prevCapture = process.env.GSD_TEST_TASK_COMPLETE_CAPTURE_PATH;
|
|
305
|
+
try {
|
|
306
|
+
// Mock module: implements the WorkflowToolExecutors shape.
|
|
307
|
+
// executeTaskComplete writes its received args to disk for assertion.
|
|
308
|
+
// Other executors are no-op stubs to satisfy isWorkflowToolExecutors.
|
|
309
|
+
const mockSource = `
|
|
310
|
+
import { writeFileSync } from "node:fs";
|
|
311
|
+
|
|
312
|
+
const noop = async () => ({ content: [{ type: "text", text: "noop" }] });
|
|
313
|
+
|
|
314
|
+
export const SUPPORTED_SUMMARY_ARTIFACT_TYPES = ["SUMMARY", "UAT", "CONTEXT", "PLAN"];
|
|
315
|
+
export const executeMilestoneStatus = noop;
|
|
316
|
+
export const executePlanMilestone = noop;
|
|
317
|
+
export const executePlanSlice = noop;
|
|
318
|
+
export const executeReplanSlice = noop;
|
|
319
|
+
export const executeSliceComplete = noop;
|
|
320
|
+
export const executeCompleteMilestone = noop;
|
|
321
|
+
export const executeValidateMilestone = noop;
|
|
322
|
+
export const executeReassessRoadmap = noop;
|
|
323
|
+
export const executeSaveGateResult = noop;
|
|
324
|
+
export const executeSummarySave = noop;
|
|
325
|
+
|
|
326
|
+
export const executeTaskComplete = async (params, projectDir) => {
|
|
327
|
+
const capturePath = process.env.GSD_TEST_TASK_COMPLETE_CAPTURE_PATH;
|
|
328
|
+
if (capturePath) {
|
|
329
|
+
writeFileSync(capturePath, JSON.stringify({ params, projectDir }, null, 2));
|
|
330
|
+
}
|
|
331
|
+
return {
|
|
332
|
+
content: [{ type: "text", text: "mock task complete" }],
|
|
333
|
+
details: { taskId: params.taskId },
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
`;
|
|
337
|
+
writeFileSync(mockModulePath, mockSource, "utf-8");
|
|
338
|
+
process.env.GSD_WORKFLOW_EXECUTORS_MODULE = mockModulePath;
|
|
339
|
+
process.env.GSD_TEST_TASK_COMPLETE_CAPTURE_PATH = capturePath;
|
|
340
|
+
|
|
341
|
+
// Fresh import bypasses the cached workflowToolExecutorsPromise so the
|
|
342
|
+
// mock module is actually loaded for this test.
|
|
343
|
+
const { registerWorkflowTools: freshRegisterWorkflowTools } = await import(
|
|
344
|
+
`./workflow-tools.ts?escalation-test=${randomUUID()}`
|
|
345
|
+
);
|
|
346
|
+
const server = makeMockServer();
|
|
347
|
+
freshRegisterWorkflowTools(server as any);
|
|
348
|
+
const taskTool = server.tools.find((t) => t.name === "gsd_task_complete");
|
|
349
|
+
assert.ok(taskTool, "task tool should be registered");
|
|
350
|
+
|
|
351
|
+
// Mirrors the ADR-011 escalation schema: question + 2-4 options
|
|
352
|
+
// (each with id/label/tradeoffs) + recommendation + rationale +
|
|
353
|
+
// continueWithDefault flag.
|
|
354
|
+
const escalationPayload = {
|
|
355
|
+
question: "Should the auth flow use OAuth or PAT?",
|
|
356
|
+
options: [
|
|
357
|
+
{ id: "A", label: "OAuth", tradeoffs: "Best UX; requires more setup." },
|
|
358
|
+
{ id: "B", label: "PAT", tradeoffs: "Simpler; weaker rotation story." },
|
|
359
|
+
],
|
|
360
|
+
recommendation: "A",
|
|
361
|
+
recommendationRationale: "Initial requirement implied multi-user; OAuth fits better.",
|
|
362
|
+
continueWithDefault: true,
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
await taskTool!.handler({
|
|
366
|
+
projectDir: base,
|
|
367
|
+
taskId: "T01",
|
|
368
|
+
sliceId: "S01",
|
|
369
|
+
milestoneId: "M001",
|
|
370
|
+
oneLiner: "Completed task with escalation",
|
|
371
|
+
narrative: "Did the work but flagged an ambiguity",
|
|
372
|
+
verification: "npm test",
|
|
373
|
+
escalation: escalationPayload,
|
|
374
|
+
verificationEvidence: [
|
|
375
|
+
{ command: "npm test", exitCode: 0, verdict: "pass", durationMs: 1234 },
|
|
376
|
+
],
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
assert.ok(existsSync(capturePath), "mock executor should have written captured args to disk");
|
|
380
|
+
const captured = JSON.parse(readFileSync(capturePath, "utf-8"));
|
|
381
|
+
|
|
382
|
+
// The handler resolves projectDir via realpathSync (security/symlink check),
|
|
383
|
+
// so on macOS where /var symlinks to /private/var, the captured path will
|
|
384
|
+
// be the realpath form. Normalize both sides.
|
|
385
|
+
assert.equal(captured.projectDir, realpathSync(base), "projectDir should be passed as second arg");
|
|
386
|
+
assert.deepEqual(
|
|
387
|
+
captured.params.escalation,
|
|
388
|
+
escalationPayload,
|
|
389
|
+
"escalation payload must reach the executor verbatim — regression guard for the destructure-rebuild bug class (#4477 review)",
|
|
390
|
+
);
|
|
391
|
+
// Spot-check a couple of other fields to ensure the spread pattern
|
|
392
|
+
// doesn't accidentally exclude the rest while including escalation.
|
|
393
|
+
assert.equal(captured.params.taskId, "T01", "taskId must be forwarded");
|
|
394
|
+
assert.equal(captured.params.milestoneId, "M001", "milestoneId must be forwarded");
|
|
395
|
+
assert.deepEqual(
|
|
396
|
+
captured.params.verificationEvidence,
|
|
397
|
+
[{ command: "npm test", exitCode: 0, verdict: "pass", durationMs: 1234 }],
|
|
398
|
+
"verificationEvidence must be forwarded (existing field)",
|
|
399
|
+
);
|
|
400
|
+
// Ensure no projectDir leak into params (it should be the second arg only).
|
|
401
|
+
assert.equal(
|
|
402
|
+
captured.params.projectDir,
|
|
403
|
+
undefined,
|
|
404
|
+
"projectDir must NOT appear in params — it's stripped via the spread destructure",
|
|
405
|
+
);
|
|
406
|
+
} finally {
|
|
407
|
+
if (prevModule === undefined) {
|
|
408
|
+
delete process.env.GSD_WORKFLOW_EXECUTORS_MODULE;
|
|
409
|
+
} else {
|
|
410
|
+
process.env.GSD_WORKFLOW_EXECUTORS_MODULE = prevModule;
|
|
411
|
+
}
|
|
412
|
+
if (prevCapture === undefined) {
|
|
413
|
+
delete process.env.GSD_TEST_TASK_COMPLETE_CAPTURE_PATH;
|
|
414
|
+
} else {
|
|
415
|
+
process.env.GSD_TEST_TASK_COMPLETE_CAPTURE_PATH = prevCapture;
|
|
416
|
+
}
|
|
417
|
+
cleanup(base);
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
|
|
291
421
|
it("gsd_complete_task alias delegates to gsd_task_complete behavior", async () => {
|
|
292
422
|
const base = makeTmpBase();
|
|
293
423
|
try {
|
|
@@ -1237,6 +1367,21 @@ describe("workflow MCP tools", () => {
|
|
|
1237
1367
|
findings: "No new attack surface was introduced.",
|
|
1238
1368
|
});
|
|
1239
1369
|
assert.match((gateResult as any).content[0].text as string, /Gate Q3 result saved/);
|
|
1370
|
+
// #4472: executor `details` must be adapted to MCP `structuredContent`
|
|
1371
|
+
// so it survives the protocol transport intact. Asserting property
|
|
1372
|
+
// *absence* rather than `=== undefined` so a future regression that
|
|
1373
|
+
// explicitly sets `details: undefined` (rather than removing it) still
|
|
1374
|
+
// fails this contract test.
|
|
1375
|
+
assert.equal(
|
|
1376
|
+
Object.prototype.hasOwnProperty.call(gateResult, "details"),
|
|
1377
|
+
false,
|
|
1378
|
+
"executor `details` field must be stripped from MCP tool result",
|
|
1379
|
+
);
|
|
1380
|
+
assert.deepEqual(
|
|
1381
|
+
(gateResult as any).structuredContent,
|
|
1382
|
+
{ operation: "save_gate_result", gateId: "Q3", verdict: "pass" },
|
|
1383
|
+
"executor details must be forwarded on the MCP `structuredContent` channel",
|
|
1384
|
+
);
|
|
1240
1385
|
const gateRows = _getAdapter()!.prepare(
|
|
1241
1386
|
"SELECT status, verdict, rationale FROM quality_gates WHERE milestone_id = ? AND slice_id = ? AND gate_id = ?",
|
|
1242
1387
|
).all("M006", "S06", "Q3") as Array<Record<string, unknown>>;
|