gsd-pi 2.70.1 → 2.71.0-dev.246c32d
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 +57 -17
- package/dist/cli.js +29 -3
- package/dist/headless-events.d.ts +2 -0
- package/dist/headless-events.js +7 -0
- package/dist/headless.js +16 -3
- package/dist/mcp-server.js +40 -17
- package/dist/provider-migrations.d.ts +10 -0
- package/dist/provider-migrations.js +12 -0
- package/dist/resource-loader.js +139 -13
- package/dist/resources/GSD-WORKFLOW.md +1 -1
- package/dist/resources/agents/debugger.md +58 -0
- package/dist/resources/agents/doc-writer.md +43 -0
- package/dist/resources/agents/git-ops.md +56 -0
- package/dist/resources/agents/javascript-pro.md +46 -271
- package/dist/resources/agents/planner.md +55 -0
- package/dist/resources/agents/refactorer.md +47 -0
- package/dist/resources/agents/reviewer.md +48 -0
- package/dist/resources/agents/security.md +59 -0
- package/dist/resources/agents/tester.md +50 -0
- package/dist/resources/agents/typescript-pro.md +41 -235
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +242 -40
- package/dist/resources/extensions/get-secrets-from-user.js +17 -1
- package/dist/resources/extensions/gsd/auto/infra-errors.js +34 -0
- package/dist/resources/extensions/gsd/auto/loop.js +32 -1
- package/dist/resources/extensions/gsd/auto/phases.js +5 -1
- package/dist/resources/extensions/gsd/auto/session.js +11 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +22 -16
- package/dist/resources/extensions/gsd/auto-model-selection.js +10 -2
- package/dist/resources/extensions/gsd/auto-prompts.js +88 -33
- package/dist/resources/extensions/gsd/auto-start.js +37 -18
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +1 -1
- package/dist/resources/extensions/gsd/auto-worktree.js +1 -1
- package/dist/resources/extensions/gsd/auto.js +56 -0
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +3 -3
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +6 -0
- package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +63 -51
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +6 -0
- package/dist/resources/extensions/gsd/commands/context.js +15 -6
- package/dist/resources/extensions/gsd/commands/dispatcher.js +12 -2
- package/dist/resources/extensions/gsd/commands/handlers/auto.js +10 -33
- package/dist/resources/extensions/gsd/commands/handlers/core.js +56 -11
- package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +15 -6
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +4 -10
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +16 -12
- package/dist/resources/extensions/gsd/dashboard-overlay.js +8 -3
- package/dist/resources/extensions/gsd/dispatch-guard.js +18 -1
- package/dist/resources/extensions/gsd/doctor-providers.js +23 -0
- package/dist/resources/extensions/gsd/error-classifier.js +5 -2
- package/dist/resources/extensions/gsd/file-lock.js +60 -0
- package/dist/resources/extensions/gsd/forensics.js +19 -6
- package/dist/resources/extensions/gsd/gate-registry.js +208 -0
- package/dist/resources/extensions/gsd/gsd-db.js +41 -0
- package/dist/resources/extensions/gsd/guided-flow.js +17 -20
- package/dist/resources/extensions/gsd/init-wizard.js +3 -11
- package/dist/resources/extensions/gsd/metrics.js +1 -0
- package/dist/resources/extensions/gsd/milestone-actions.js +10 -4
- package/dist/resources/extensions/gsd/milestone-validation-gates.js +11 -12
- package/dist/resources/extensions/gsd/notification-overlay.js +42 -13
- package/dist/resources/extensions/gsd/notification-store.js +56 -5
- package/dist/resources/extensions/gsd/notification-widget.js +5 -13
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +8 -3
- package/dist/resources/extensions/gsd/pre-execution-checks.js +35 -2
- package/dist/resources/extensions/gsd/prompt-validation.js +126 -0
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +5 -3
- package/dist/resources/extensions/gsd/prompts/discuss.md +33 -13
- package/dist/resources/extensions/gsd/prompts/execute-task.md +22 -19
- package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
- package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
- package/dist/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
- package/dist/resources/extensions/gsd/prompts/queue.md +3 -2
- package/dist/resources/extensions/gsd/prompts/system.md +1 -0
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
- package/dist/resources/extensions/gsd/session-model-override.js +25 -0
- package/dist/resources/extensions/gsd/shortcut-defs.js +40 -0
- package/dist/resources/extensions/gsd/state.js +241 -332
- package/dist/resources/extensions/gsd/tools/complete-slice.js +52 -1
- package/dist/resources/extensions/gsd/tools/complete-task.js +51 -1
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +38 -1
- package/dist/resources/extensions/gsd/workflow-events.js +25 -13
- package/dist/resources/extensions/gsd/workflow-mcp-auto-prep.js +56 -0
- package/dist/resources/extensions/gsd/workflow-mcp.js +1 -1
- package/dist/resources/extensions/ollama/index.js +13 -5
- package/dist/resources/extensions/shared/gsd-phase-state.js +35 -0
- package/dist/resources/extensions/subagent/agents.js +8 -0
- package/dist/resources/extensions/subagent/index.js +17 -0
- package/dist/resources/skills/create-skill/SKILL.md +2 -0
- package/dist/startup-model-validation.d.ts +0 -1
- package/dist/startup-model-validation.js +6 -2
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +19 -19
- package/dist/web/standalone/.next/build-manifest.json +4 -4
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
- package/dist/web/standalone/.next/required-server-files.json +4 -4
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +19 -19
- package/dist/web/standalone/.next/server/chunks/63.js +3 -3
- package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware.js +2 -2
- package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-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/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/2826.dd3dc8bbd3025fa5.js +9 -0
- package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-f1e30ab6bb269149.js +1 -0
- package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-6e4d7e9a4f57bed4.js → webpack-b868033a5834586d.js} +1 -1
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
- package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
- package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
- package/dist/web/standalone/server.js +1 -1
- package/package.json +1 -1
- package/packages/mcp-server/dist/env-writer.d.ts +39 -0
- package/packages/mcp-server/dist/env-writer.d.ts.map +1 -0
- package/packages/mcp-server/dist/env-writer.js +158 -0
- package/packages/mcp-server/dist/env-writer.js.map +1 -0
- package/packages/mcp-server/dist/server.d.ts +23 -3
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +192 -44
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +22 -12
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/env-writer.test.ts +280 -0
- package/packages/mcp-server/src/env-writer.ts +183 -0
- package/packages/mcp-server/src/secure-env-collect.test.ts +265 -0
- package/packages/mcp-server/src/server.ts +247 -41
- package/packages/mcp-server/src/workflow-tools.test.ts +110 -0
- package/packages/mcp-server/src/workflow-tools.ts +32 -12
- package/packages/pi-ai/dist/providers/amazon-bedrock.js +11 -2
- package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +20 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +4 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +8 -3
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js +44 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +2 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +7 -4
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +11 -0
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/src/providers/amazon-bedrock.ts +13 -1
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +32 -0
- package/packages/pi-ai/src/providers/anthropic-shared.test.ts +55 -1
- package/packages/pi-ai/src/providers/anthropic-shared.ts +14 -3
- package/packages/pi-ai/src/providers/anthropic.ts +8 -4
- package/packages/pi-ai/src/providers/openai-completions.ts +14 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js +61 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js.map +1 -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 +2 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +10 -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 +27 -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 +85 -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.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +388 -0
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +2 -0
- 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/model-resolver-initial-model-auth.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js +64 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js +22 -18
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts +8 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.js +75 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +5 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js +55 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js +57 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +11 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +38 -5
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.js +71 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.js.map +1 -0
- 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 +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js +13 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts +19 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js +50 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.js +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +24 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js +9 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +43 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- 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 +175 -25
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js +6 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +6 -0
- 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 +62 -5
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +4 -2
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-renderable-tools.test.ts +70 -0
- package/packages/pi-coding-agent/src/core/agent-session.ts +2 -1
- package/packages/pi-coding-agent/src/core/auth-storage.test.ts +108 -0
- package/packages/pi-coding-agent/src/core/auth-storage.ts +30 -0
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +468 -0
- package/packages/pi-coding-agent/src/core/extensions/types.ts +2 -0
- package/packages/pi-coding-agent/src/core/model-resolver-initial-model-auth.test.ts +78 -0
- package/packages/pi-coding-agent/src/core/model-resolver.test.ts +85 -0
- package/packages/pi-coding-agent/src/core/model-resolver.ts +22 -18
- package/packages/pi-coding-agent/src/core/retry-handler.test.ts +83 -0
- package/packages/pi-coding-agent/src/core/retry-handler.ts +60 -1
- package/packages/pi-coding-agent/src/core/sdk.test.ts +89 -0
- package/packages/pi-coding-agent/src/core/sdk.ts +45 -9
- package/packages/pi-coding-agent/src/index.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/login-dialog.test.ts +24 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.ts +58 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/extension-input.ts +2 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +30 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +15 -6
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +47 -0
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +205 -31
- package/packages/pi-coding-agent/src/modes/interactive/controllers/model-controller.ts +6 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-state.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +70 -5
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +4 -2
- package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +1 -1
- package/packages/pi-coding-agent/src/modes/rpc/rpc-types.ts +1 -0
- package/packages/pi-tui/dist/components/__tests__/input.test.js +9 -0
- package/packages/pi-tui/dist/components/__tests__/input.test.js.map +1 -1
- package/packages/pi-tui/dist/components/__tests__/markdown-maxlines.test.d.ts +2 -0
- package/packages/pi-tui/dist/components/__tests__/markdown-maxlines.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/__tests__/markdown-maxlines.test.js +66 -0
- package/packages/pi-tui/dist/components/__tests__/markdown-maxlines.test.js.map +1 -0
- package/packages/pi-tui/dist/components/input.d.ts +2 -0
- package/packages/pi-tui/dist/components/input.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/input.js +7 -4
- package/packages/pi-tui/dist/components/input.js.map +1 -1
- package/packages/pi-tui/dist/components/markdown.d.ts +3 -0
- package/packages/pi-tui/dist/components/markdown.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/markdown.js +17 -1
- package/packages/pi-tui/dist/components/markdown.js.map +1 -1
- package/packages/pi-tui/src/components/__tests__/input.test.ts +11 -0
- package/packages/pi-tui/src/components/__tests__/markdown-maxlines.test.ts +75 -0
- package/packages/pi-tui/src/components/input.ts +7 -4
- package/packages/pi-tui/src/components/markdown.ts +22 -1
- package/pkg/package.json +1 -1
- package/src/resources/GSD-WORKFLOW.md +1 -1
- package/src/resources/agents/debugger.md +58 -0
- package/src/resources/agents/doc-writer.md +43 -0
- package/src/resources/agents/git-ops.md +56 -0
- package/src/resources/agents/javascript-pro.md +46 -271
- package/src/resources/agents/planner.md +55 -0
- package/src/resources/agents/refactorer.md +47 -0
- package/src/resources/agents/reviewer.md +48 -0
- package/src/resources/agents/security.md +59 -0
- package/src/resources/agents/tester.md +50 -0
- package/src/resources/agents/typescript-pro.md +41 -235
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +288 -39
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +330 -2
- package/src/resources/extensions/get-secrets-from-user.ts +24 -1
- package/src/resources/extensions/gsd/auto/infra-errors.ts +38 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +2 -0
- package/src/resources/extensions/gsd/auto/loop.ts +45 -1
- package/src/resources/extensions/gsd/auto/phases.ts +6 -0
- package/src/resources/extensions/gsd/auto/session.ts +11 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +29 -18
- package/src/resources/extensions/gsd/auto-model-selection.ts +9 -1
- package/src/resources/extensions/gsd/auto-prompts.ts +111 -33
- package/src/resources/extensions/gsd/auto-start.ts +44 -20
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +1 -1
- package/src/resources/extensions/gsd/auto-worktree.ts +1 -1
- package/src/resources/extensions/gsd/auto.ts +72 -0
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +3 -3
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +6 -0
- package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +79 -60
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +7 -0
- package/src/resources/extensions/gsd/commands/context.ts +16 -5
- package/src/resources/extensions/gsd/commands/dispatcher.ts +14 -2
- package/src/resources/extensions/gsd/commands/handlers/auto.ts +10 -36
- package/src/resources/extensions/gsd/commands/handlers/core.ts +58 -11
- package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +17 -7
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +4 -10
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +19 -14
- package/src/resources/extensions/gsd/dashboard-overlay.ts +10 -3
- package/src/resources/extensions/gsd/dispatch-guard.ts +18 -1
- package/src/resources/extensions/gsd/doctor-providers.ts +24 -0
- package/src/resources/extensions/gsd/error-classifier.ts +5 -2
- package/src/resources/extensions/gsd/file-lock.ts +59 -0
- package/src/resources/extensions/gsd/forensics.ts +23 -7
- package/src/resources/extensions/gsd/gate-registry.ts +251 -0
- package/src/resources/extensions/gsd/gsd-db.ts +51 -0
- package/src/resources/extensions/gsd/guided-flow.ts +17 -19
- package/src/resources/extensions/gsd/init-wizard.ts +3 -13
- package/src/resources/extensions/gsd/interrupted-session.ts +1 -0
- package/src/resources/extensions/gsd/metrics.ts +12 -1
- package/src/resources/extensions/gsd/milestone-actions.ts +10 -3
- package/src/resources/extensions/gsd/milestone-validation-gates.ts +11 -13
- package/src/resources/extensions/gsd/notification-overlay.ts +47 -14
- package/src/resources/extensions/gsd/notification-store.ts +54 -5
- package/src/resources/extensions/gsd/notification-widget.ts +5 -14
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +10 -3
- package/src/resources/extensions/gsd/pre-execution-checks.ts +39 -2
- package/src/resources/extensions/gsd/prompt-validation.ts +157 -0
- package/src/resources/extensions/gsd/prompts/complete-slice.md +5 -3
- package/src/resources/extensions/gsd/prompts/discuss.md +33 -13
- package/src/resources/extensions/gsd/prompts/execute-task.md +22 -19
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
- package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
- package/src/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
- package/src/resources/extensions/gsd/prompts/queue.md +3 -2
- package/src/resources/extensions/gsd/prompts/system.md +1 -0
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
- package/src/resources/extensions/gsd/session-model-override.ts +36 -0
- package/src/resources/extensions/gsd/shortcut-defs.ts +56 -0
- package/src/resources/extensions/gsd/state.ts +285 -344
- package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +25 -9
- package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +28 -0
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/complete-slice-gate-closure.test.ts +167 -0
- package/src/resources/extensions/gsd/tests/complete-slice-prompt-task-summary-layout.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/derive-state-helpers.test.ts +436 -0
- package/src/resources/extensions/gsd/tests/discuss-incremental-persistence.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/execute-task-prompt-existing-artifact-guard.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/file-lock.test.ts +103 -0
- package/src/resources/extensions/gsd/tests/forensics-stuck-loops.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/format-shortcut.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/gate-dispatch.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/gate-registry.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/gsd-no-project-error.test.ts +73 -0
- package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +180 -0
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +66 -1
- package/src/resources/extensions/gsd/tests/model-isolation.test.ts +36 -51
- package/src/resources/extensions/gsd/tests/notification-store.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/notification-widget.test.ts +26 -0
- package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +49 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/prompt-system-gate-coverage.test.ts +208 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/register-shortcuts.test.ts +63 -5
- package/src/resources/extensions/gsd/tests/secure-env-collect.test.ts +45 -0
- package/src/resources/extensions/gsd/tests/session-model-override.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/validate-milestone-prompt-verification-classes.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/workflow-mcp-auto-prep.test.ts +76 -0
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +155 -1
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +22 -0
- package/src/resources/extensions/gsd/tools/complete-slice.ts +63 -0
- package/src/resources/extensions/gsd/tools/complete-task.ts +63 -0
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +64 -26
- package/src/resources/extensions/gsd/types.ts +26 -0
- package/src/resources/extensions/gsd/workflow-events.ts +34 -25
- package/src/resources/extensions/gsd/workflow-mcp-auto-prep.ts +76 -0
- package/src/resources/extensions/gsd/workflow-mcp.ts +1 -1
- package/src/resources/extensions/ollama/index.ts +13 -3
- package/src/resources/extensions/ollama/ollama-status-indicator.test.ts +28 -0
- package/src/resources/extensions/shared/gsd-phase-state.ts +42 -0
- package/src/resources/extensions/shared/tests/gsd-phase-state.test.ts +48 -0
- package/src/resources/extensions/subagent/agents.ts +10 -0
- package/src/resources/extensions/subagent/index.ts +18 -0
- package/src/resources/extensions/subagent/tests/agents-conflicts.test.ts +33 -0
- package/src/resources/skills/create-skill/SKILL.md +2 -0
- package/dist/web/standalone/.next/static/chunks/2826.821e01b07d92e948.js +0 -9
- package/dist/web/standalone/.next/static/chunks/app/page-7115e62689b5fd84.js +0 -1
- package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
- /package/dist/web/standalone/.next/static/{9pw9EXtXjdM7EFrCXUEPf → hnGGkVMxIGGpxSJkf5jIV}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{9pw9EXtXjdM7EFrCXUEPf → hnGGkVMxIGGpxSJkf5jIV}/_ssgManifest.js +0 -0
|
@@ -60,6 +60,8 @@ interface SdkElicitationFieldSchema {
|
|
|
60
60
|
type?: string;
|
|
61
61
|
title?: string;
|
|
62
62
|
description?: string;
|
|
63
|
+
format?: string;
|
|
64
|
+
writeOnly?: boolean;
|
|
63
65
|
oneOf?: SdkElicitationRequestOption[];
|
|
64
66
|
items?: {
|
|
65
67
|
anyOf?: SdkElicitationRequestOption[];
|
|
@@ -73,6 +75,7 @@ interface SdkElicitationRequest {
|
|
|
73
75
|
requestedSchema?: {
|
|
74
76
|
type?: string;
|
|
75
77
|
properties?: Record<string, SdkElicitationFieldSchema>;
|
|
78
|
+
required?: string[];
|
|
76
79
|
};
|
|
77
80
|
}
|
|
78
81
|
|
|
@@ -85,7 +88,16 @@ interface ParsedElicitationQuestion extends Question {
|
|
|
85
88
|
noteFieldId?: string;
|
|
86
89
|
}
|
|
87
90
|
|
|
91
|
+
interface ParsedTextInputField {
|
|
92
|
+
id: string;
|
|
93
|
+
title: string;
|
|
94
|
+
description: string;
|
|
95
|
+
required: boolean;
|
|
96
|
+
secure: boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
88
99
|
const OTHER_OPTION_LABEL = "None of the above";
|
|
100
|
+
const SENSITIVE_FIELD_PATTERN = /(password|passphrase|secret|token|api[_\s-]*key|private[_\s-]*key|credential)/i;
|
|
89
101
|
|
|
90
102
|
// ---------------------------------------------------------------------------
|
|
91
103
|
// Stream factory
|
|
@@ -106,6 +118,18 @@ function createAssistantStream(): AssistantMessageEventStream {
|
|
|
106
118
|
) as AssistantMessageEventStream;
|
|
107
119
|
}
|
|
108
120
|
|
|
121
|
+
export function getResultErrorMessage(result: SDKResultMessage): string {
|
|
122
|
+
if ("errors" in result && Array.isArray(result.errors) && result.errors.length > 0) {
|
|
123
|
+
return result.errors.join("; ");
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if ("result" in result && typeof result.result === "string" && result.result.trim().length > 0) {
|
|
127
|
+
return result.result.trim();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return result.subtype === "success" ? "claude_code_request_failed" : result.subtype;
|
|
131
|
+
}
|
|
132
|
+
|
|
109
133
|
// ---------------------------------------------------------------------------
|
|
110
134
|
// Claude binary resolution
|
|
111
135
|
// ---------------------------------------------------------------------------
|
|
@@ -274,6 +298,67 @@ export function parseAskUserQuestionsElicitation(
|
|
|
274
298
|
return questions.length > 0 ? questions : null;
|
|
275
299
|
}
|
|
276
300
|
|
|
301
|
+
function isSecureElicitationField(
|
|
302
|
+
requestMessage: string,
|
|
303
|
+
fieldId: string,
|
|
304
|
+
field: SdkElicitationFieldSchema,
|
|
305
|
+
): boolean {
|
|
306
|
+
if (field.format === "password") return true;
|
|
307
|
+
if (field.writeOnly === true) return true;
|
|
308
|
+
|
|
309
|
+
const rawField = field as Record<string, unknown>;
|
|
310
|
+
if (rawField.sensitive === true || rawField["x-sensitive"] === true) return true;
|
|
311
|
+
|
|
312
|
+
const haystack = [
|
|
313
|
+
requestMessage,
|
|
314
|
+
fieldId.replace(/[_-]+/g, " "),
|
|
315
|
+
typeof field.title === "string" ? field.title : "",
|
|
316
|
+
typeof field.description === "string" ? field.description : "",
|
|
317
|
+
]
|
|
318
|
+
.join(" ")
|
|
319
|
+
.toLowerCase();
|
|
320
|
+
|
|
321
|
+
return SENSITIVE_FIELD_PATTERN.test(haystack);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export function parseTextInputElicitation(
|
|
325
|
+
request: Pick<SdkElicitationRequest, "message" | "mode" | "requestedSchema">,
|
|
326
|
+
): ParsedTextInputField[] | null {
|
|
327
|
+
if (request.mode && request.mode !== "form") return null;
|
|
328
|
+
const schema = request.requestedSchema as
|
|
329
|
+
| ({ properties?: Record<string, SdkElicitationFieldSchema>; keys?: Record<string, SdkElicitationFieldSchema> } & Record<string, unknown>)
|
|
330
|
+
| undefined;
|
|
331
|
+
const fieldsSource = schema?.properties && typeof schema.properties === "object"
|
|
332
|
+
? schema.properties
|
|
333
|
+
: schema?.keys && typeof schema.keys === "object"
|
|
334
|
+
? schema.keys
|
|
335
|
+
: undefined;
|
|
336
|
+
if (!fieldsSource) return null;
|
|
337
|
+
|
|
338
|
+
const requiredSet = new Set(
|
|
339
|
+
Array.isArray(request.requestedSchema?.required)
|
|
340
|
+
? request.requestedSchema.required.filter((value): value is string => typeof value === "string")
|
|
341
|
+
: [],
|
|
342
|
+
);
|
|
343
|
+
|
|
344
|
+
const fields: ParsedTextInputField[] = [];
|
|
345
|
+
for (const [fieldId, field] of Object.entries(fieldsSource)) {
|
|
346
|
+
if (!field || typeof field !== "object") continue;
|
|
347
|
+
if (field.type !== "string") continue;
|
|
348
|
+
if (Array.isArray(field.oneOf) && field.oneOf.length > 0) continue;
|
|
349
|
+
|
|
350
|
+
fields.push({
|
|
351
|
+
id: fieldId,
|
|
352
|
+
title: typeof field.title === "string" && field.title.length > 0 ? field.title : fieldId,
|
|
353
|
+
description: typeof field.description === "string" ? field.description : "",
|
|
354
|
+
required: requiredSet.has(fieldId),
|
|
355
|
+
secure: isSecureElicitationField(request.message, fieldId, field),
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
return fields.length > 0 ? fields : null;
|
|
360
|
+
}
|
|
361
|
+
|
|
277
362
|
export function roundResultToElicitationContent(
|
|
278
363
|
questions: ParsedElicitationQuestion[],
|
|
279
364
|
result: RoundResult,
|
|
@@ -355,6 +440,52 @@ async function promptElicitationWithDialogs(
|
|
|
355
440
|
return { action: "accept", content };
|
|
356
441
|
}
|
|
357
442
|
|
|
443
|
+
function buildTextInputPromptTitle(request: SdkElicitationRequest, field: ParsedTextInputField): string {
|
|
444
|
+
const parts = [
|
|
445
|
+
request.serverName ? `[${request.serverName}]` : "",
|
|
446
|
+
field.title,
|
|
447
|
+
field.description,
|
|
448
|
+
].filter((part) => typeof part === "string" && part.trim().length > 0);
|
|
449
|
+
return parts.join("\n\n");
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function buildTextInputPlaceholder(field: ParsedTextInputField): string | undefined {
|
|
453
|
+
const desc = field.description.trim();
|
|
454
|
+
if (!desc) return field.required ? "Required" : "Leave empty to skip";
|
|
455
|
+
|
|
456
|
+
const formatLine = desc
|
|
457
|
+
.split(/\r?\n/)
|
|
458
|
+
.map((line) => line.trim())
|
|
459
|
+
.find((line) => /^format:/i.test(line));
|
|
460
|
+
|
|
461
|
+
if (!formatLine) return field.required ? "Required" : "Leave empty to skip";
|
|
462
|
+
const hint = formatLine.replace(/^format:\s*/i, "").trim();
|
|
463
|
+
return hint.length > 0 ? hint : field.required ? "Required" : "Leave empty to skip";
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
async function promptTextInputElicitation(
|
|
467
|
+
request: SdkElicitationRequest,
|
|
468
|
+
fields: ParsedTextInputField[],
|
|
469
|
+
ui: ExtensionUIContext,
|
|
470
|
+
signal: AbortSignal,
|
|
471
|
+
): Promise<SdkElicitationResult> {
|
|
472
|
+
const content: Record<string, string | string[]> = {};
|
|
473
|
+
|
|
474
|
+
for (const field of fields) {
|
|
475
|
+
const value = await ui.input(
|
|
476
|
+
buildTextInputPromptTitle(request, field),
|
|
477
|
+
buildTextInputPlaceholder(field),
|
|
478
|
+
{ signal, ...(field.secure ? { secure: true } : {}) },
|
|
479
|
+
);
|
|
480
|
+
if (value === undefined) {
|
|
481
|
+
return { action: "cancel" };
|
|
482
|
+
}
|
|
483
|
+
content[field.id] = value;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
return { action: "accept", content };
|
|
487
|
+
}
|
|
488
|
+
|
|
358
489
|
export function createClaudeCodeElicitationHandler(
|
|
359
490
|
ui: ExtensionUIContext | undefined,
|
|
360
491
|
): ((request: SdkElicitationRequest, options: { signal: AbortSignal }) => Promise<SdkElicitationResult>) | undefined {
|
|
@@ -366,48 +497,116 @@ export function createClaudeCodeElicitationHandler(
|
|
|
366
497
|
}
|
|
367
498
|
|
|
368
499
|
const questions = parseAskUserQuestionsElicitation(request);
|
|
369
|
-
if (
|
|
370
|
-
|
|
500
|
+
if (questions) {
|
|
501
|
+
const interviewResult = await showInterviewRound(questions, { signal }, { ui } as any).catch(() => undefined);
|
|
502
|
+
if (interviewResult && Object.keys(interviewResult.answers).length > 0) {
|
|
503
|
+
return {
|
|
504
|
+
action: "accept",
|
|
505
|
+
content: roundResultToElicitationContent(questions, interviewResult),
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
return promptElicitationWithDialogs(request, questions, ui, signal);
|
|
371
510
|
}
|
|
372
511
|
|
|
373
|
-
const
|
|
374
|
-
if (
|
|
375
|
-
return
|
|
376
|
-
action: "accept",
|
|
377
|
-
content: roundResultToElicitationContent(questions, interviewResult),
|
|
378
|
-
};
|
|
512
|
+
const textFields = parseTextInputElicitation(request);
|
|
513
|
+
if (textFields) {
|
|
514
|
+
return promptTextInputElicitation(request, textFields, ui, signal);
|
|
379
515
|
}
|
|
380
516
|
|
|
381
|
-
return
|
|
517
|
+
return { action: "decline" };
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Aborted by the caller's AbortSignal — distinct from exhaustion. GSD's
|
|
523
|
+
* agent loop keys off `stopReason === "aborted"` to treat this as a clean
|
|
524
|
+
* user cancel instead of a retry-eligible provider failure.
|
|
525
|
+
*/
|
|
526
|
+
export function makeAbortedMessage(model: string, lastTextContent: string): AssistantMessage {
|
|
527
|
+
const message: AssistantMessage = {
|
|
528
|
+
role: "assistant",
|
|
529
|
+
content: lastTextContent
|
|
530
|
+
? [{ type: "text", text: lastTextContent }]
|
|
531
|
+
: [{ type: "text", text: "Claude Code stream aborted by caller" }],
|
|
532
|
+
api: "anthropic-messages",
|
|
533
|
+
provider: "claude-code",
|
|
534
|
+
model,
|
|
535
|
+
usage: { ...ZERO_USAGE },
|
|
536
|
+
stopReason: "aborted",
|
|
537
|
+
timestamp: Date.now(),
|
|
382
538
|
};
|
|
539
|
+
return message;
|
|
383
540
|
}
|
|
384
541
|
|
|
385
542
|
// ---------------------------------------------------------------------------
|
|
386
543
|
// SDK options builder
|
|
387
544
|
// ---------------------------------------------------------------------------
|
|
388
545
|
|
|
546
|
+
/**
|
|
547
|
+
* Resolve the Claude Code permission mode for the current run.
|
|
548
|
+
*
|
|
549
|
+
* - Auto-mode / headless runs bypass permissions so tool calls don't block
|
|
550
|
+
* on prompts the user isn't watching.
|
|
551
|
+
* - Interactive runs default to `acceptEdits` so file/bash writes still
|
|
552
|
+
* land quickly but the SDK retains a permission gate.
|
|
553
|
+
* - `GSD_CLAUDE_CODE_PERMISSION_MODE` forces a specific mode when set.
|
|
554
|
+
*
|
|
555
|
+
* Cross-extension coupling is kept minimal by dynamically importing
|
|
556
|
+
* `isAutoActive` and falling back to the bypass default if the import
|
|
557
|
+
* fails (e.g. in unit tests that load stream-adapter in isolation).
|
|
558
|
+
*/
|
|
559
|
+
export async function resolveClaudePermissionMode(
|
|
560
|
+
env: NodeJS.ProcessEnv = process.env,
|
|
561
|
+
): Promise<"bypassPermissions" | "acceptEdits" | "default" | "plan"> {
|
|
562
|
+
const override = env.GSD_CLAUDE_CODE_PERMISSION_MODE?.trim();
|
|
563
|
+
if (override === "bypassPermissions" || override === "acceptEdits" || override === "default" || override === "plan") {
|
|
564
|
+
return override;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
try {
|
|
568
|
+
const autoMod = (await import("../gsd/auto.js")) as { isAutoActive?: () => boolean };
|
|
569
|
+
if (typeof autoMod.isAutoActive === "function" && autoMod.isAutoActive()) {
|
|
570
|
+
return "bypassPermissions";
|
|
571
|
+
}
|
|
572
|
+
return "acceptEdits";
|
|
573
|
+
} catch {
|
|
574
|
+
// auto.ts unavailable (tests, non-GSD contexts) — stay permissive.
|
|
575
|
+
return "bypassPermissions";
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
389
579
|
/**
|
|
390
580
|
* Build the options object passed to the Claude Agent SDK's `query()` call.
|
|
391
581
|
*
|
|
392
582
|
* Extracted for testability — callers can verify session persistence,
|
|
393
583
|
* beta flags, and other configuration without mocking the full SDK.
|
|
584
|
+
*
|
|
585
|
+
* `permissionMode` / `allowDangerouslySkipPermissions` are resolved through
|
|
586
|
+
* {@link resolveClaudePermissionMode} so interactive runs don't silently
|
|
587
|
+
* bypass the SDK's permission gate. Callers that want the old always-bypass
|
|
588
|
+
* behaviour pass `permissionMode: "bypassPermissions"` explicitly.
|
|
394
589
|
*/
|
|
395
590
|
export function buildSdkOptions(
|
|
396
591
|
modelId: string,
|
|
397
592
|
prompt: string,
|
|
593
|
+
overrides?: { permissionMode?: "bypassPermissions" | "acceptEdits" | "default" | "plan" },
|
|
398
594
|
extraOptions: Record<string, unknown> = {},
|
|
399
595
|
): Record<string, unknown> {
|
|
400
596
|
const mcpServers = buildWorkflowMcpServers();
|
|
597
|
+
const permissionMode = overrides?.permissionMode ?? "bypassPermissions";
|
|
598
|
+
const disallowedTools = ["AskUserQuestion"];
|
|
401
599
|
return {
|
|
402
600
|
pathToClaudeCodeExecutable: getClaudePath(),
|
|
403
601
|
model: modelId,
|
|
404
602
|
includePartialMessages: true,
|
|
405
603
|
persistSession: true,
|
|
406
604
|
cwd: process.cwd(),
|
|
407
|
-
permissionMode
|
|
408
|
-
allowDangerouslySkipPermissions:
|
|
605
|
+
permissionMode,
|
|
606
|
+
allowDangerouslySkipPermissions: permissionMode === "bypassPermissions",
|
|
409
607
|
settingSources: ["project"],
|
|
410
608
|
systemPrompt: { type: "preset", preset: "claude_code" },
|
|
609
|
+
disallowedTools,
|
|
411
610
|
...(mcpServers ? { mcpServers } : {}),
|
|
412
611
|
betas: modelId.includes("sonnet") ? ["context-1m-2025-08-07"] : [],
|
|
413
612
|
...extraOptions,
|
|
@@ -506,16 +705,39 @@ export function extractToolResultsFromSdkUserMessage(message: SDKUserMessage): A
|
|
|
506
705
|
return extracted;
|
|
507
706
|
}
|
|
508
707
|
|
|
509
|
-
function
|
|
510
|
-
|
|
708
|
+
function attachExternalResultsToToolBlocks(
|
|
709
|
+
toolBlocks: AssistantMessage["content"],
|
|
511
710
|
toolResultsById: ReadonlyMap<string, ExternalToolResultPayload>,
|
|
512
711
|
): void {
|
|
513
|
-
for (const block of
|
|
514
|
-
if (block.type !== "toolCall") continue;
|
|
712
|
+
for (const block of toolBlocks) {
|
|
713
|
+
if (block.type !== "toolCall" && block.type !== "serverToolUse") continue;
|
|
515
714
|
const externalResult = toolResultsById.get(block.id);
|
|
516
715
|
if (!externalResult) continue;
|
|
517
|
-
(block as ToolCallWithExternalResult).externalResult = externalResult;
|
|
716
|
+
(block as ToolCallWithExternalResult & { id: string }).externalResult = externalResult;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* Merge tool-call blocks from the active partial-message builder into the
|
|
722
|
+
* running list of intermediate tool calls, preserving order and de-duping
|
|
723
|
+
* by tool-call id. Exposed for testing the F3 fix (final-turn tool calls
|
|
724
|
+
* dropped when `result` arrives without a preceding synthetic `user`).
|
|
725
|
+
*/
|
|
726
|
+
export function mergePendingToolCalls(
|
|
727
|
+
intermediate: AssistantMessage["content"],
|
|
728
|
+
pending: AssistantMessage["content"],
|
|
729
|
+
): AssistantMessage["content"] {
|
|
730
|
+
const alreadyIncluded = new Set<string>();
|
|
731
|
+
for (const block of intermediate) {
|
|
732
|
+
if (block.type === "toolCall") alreadyIncluded.add(block.id);
|
|
518
733
|
}
|
|
734
|
+
for (const block of pending) {
|
|
735
|
+
if (block.type !== "toolCall") continue;
|
|
736
|
+
if (alreadyIncluded.has(block.id)) continue;
|
|
737
|
+
alreadyIncluded.add(block.id);
|
|
738
|
+
intermediate.push(block);
|
|
739
|
+
}
|
|
740
|
+
return intermediate;
|
|
519
741
|
}
|
|
520
742
|
|
|
521
743
|
// ---------------------------------------------------------------------------
|
|
@@ -552,8 +774,8 @@ async function pumpSdkMessages(
|
|
|
552
774
|
/** Track the last text content seen across all assistant turns for the final message. */
|
|
553
775
|
let lastTextContent = "";
|
|
554
776
|
let lastThinkingContent = "";
|
|
555
|
-
/** Collect tool
|
|
556
|
-
const
|
|
777
|
+
/** Collect tool blocks from intermediate SDK turns for tool execution rendering. */
|
|
778
|
+
const intermediateToolBlocks: AssistantMessage["content"] = [];
|
|
557
779
|
/** Preserve real external tool results from Claude Code's synthetic user messages. */
|
|
558
780
|
const toolResultsById = new Map<string, ExternalToolResultPayload>();
|
|
559
781
|
|
|
@@ -574,9 +796,11 @@ async function pumpSdkMessages(
|
|
|
574
796
|
}
|
|
575
797
|
|
|
576
798
|
const prompt = buildPromptFromContext(context);
|
|
799
|
+
const permissionMode = await resolveClaudePermissionMode();
|
|
577
800
|
const sdkOpts = buildSdkOptions(
|
|
578
801
|
modelId,
|
|
579
802
|
prompt,
|
|
803
|
+
{ permissionMode },
|
|
580
804
|
typeof (options as ClaudeCodeStreamOptions | undefined)?.extensionUIContext === "object"
|
|
581
805
|
? {
|
|
582
806
|
onElicitation: createClaudeCodeElicitationHandler(
|
|
@@ -608,7 +832,17 @@ async function pumpSdkMessages(
|
|
|
608
832
|
stream.push({ type: "start", partial: initialPartial });
|
|
609
833
|
|
|
610
834
|
for await (const msg of queryResult as AsyncIterable<SDKMessage>) {
|
|
611
|
-
if (options?.signal?.aborted)
|
|
835
|
+
if (options?.signal?.aborted) {
|
|
836
|
+
// User-initiated cancel — emit an aborted error so the agent
|
|
837
|
+
// loop classifies this as a deliberate stop, not a transient
|
|
838
|
+
// provider failure that should be retried.
|
|
839
|
+
stream.push({
|
|
840
|
+
type: "error",
|
|
841
|
+
reason: "aborted",
|
|
842
|
+
error: makeAbortedMessage(modelId, lastTextContent),
|
|
843
|
+
});
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
612
846
|
|
|
613
847
|
switch (msg.type) {
|
|
614
848
|
// -- Init --
|
|
@@ -664,9 +898,9 @@ async function pumpSdkMessages(
|
|
|
664
898
|
lastTextContent = block.text;
|
|
665
899
|
} else if (block.type === "thinking" && block.thinking) {
|
|
666
900
|
lastThinkingContent = block.thinking;
|
|
667
|
-
} else if (block.type === "toolCall") {
|
|
668
|
-
// Collect tool
|
|
669
|
-
|
|
901
|
+
} else if (block.type === "toolCall" || block.type === "serverToolUse") {
|
|
902
|
+
// Collect tool blocks for externalToolExecution rendering
|
|
903
|
+
intermediateToolBlocks.push(block);
|
|
670
904
|
}
|
|
671
905
|
}
|
|
672
906
|
}
|
|
@@ -676,24 +910,33 @@ async function pumpSdkMessages(
|
|
|
676
910
|
for (const { toolUseId, result } of extractToolResultsFromSdkUserMessage(msg as SDKUserMessage)) {
|
|
677
911
|
toolResultsById.set(toolUseId, result);
|
|
678
912
|
}
|
|
679
|
-
|
|
913
|
+
attachExternalResultsToToolBlocks(intermediateToolBlocks, toolResultsById);
|
|
680
914
|
|
|
681
915
|
// Push a synthetic toolcall_end for each tool call from this turn
|
|
682
916
|
// so the TUI can render tool results in real-time during the SDK
|
|
683
917
|
// session instead of waiting until the entire session completes.
|
|
684
918
|
if (builder) {
|
|
685
919
|
for (const block of builder.message.content) {
|
|
686
|
-
if (block.type !== "toolCall") continue;
|
|
687
920
|
const extResult = (block as ToolCallWithExternalResult).externalResult;
|
|
688
921
|
if (!extResult) continue;
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
922
|
+
const contentIndex = builder.message.content.indexOf(block);
|
|
923
|
+
if (contentIndex < 0) continue;
|
|
924
|
+
// Push synthetic completion events with result attached so the
|
|
925
|
+
// chat-controller can update pending ToolExecutionComponents.
|
|
926
|
+
if (block.type === "toolCall") {
|
|
927
|
+
stream.push({
|
|
928
|
+
type: "toolcall_end",
|
|
929
|
+
contentIndex,
|
|
930
|
+
toolCall: block,
|
|
931
|
+
partial: builder.message,
|
|
932
|
+
});
|
|
933
|
+
} else if (block.type === "serverToolUse") {
|
|
934
|
+
stream.push({
|
|
935
|
+
type: "server_tool_use",
|
|
936
|
+
contentIndex,
|
|
937
|
+
partial: builder.message,
|
|
938
|
+
});
|
|
939
|
+
}
|
|
697
940
|
}
|
|
698
941
|
}
|
|
699
942
|
|
|
@@ -710,9 +953,19 @@ async function pumpSdkMessages(
|
|
|
710
953
|
// events for proper TUI rendering, followed by the text response.
|
|
711
954
|
const finalContent: AssistantMessage["content"] = [];
|
|
712
955
|
|
|
956
|
+
// If the final turn ended without a synthetic user message
|
|
957
|
+
// (e.g. stop_reason: "tool_use" followed directly by result,
|
|
958
|
+
// or a turn with text but no tool execution), the `builder`
|
|
959
|
+
// still holds toolCall blocks that were never pushed into
|
|
960
|
+
// `intermediateToolBlocks`. Fold them in here so they aren't
|
|
961
|
+
// dropped from the final AssistantMessage.
|
|
962
|
+
if (builder) {
|
|
963
|
+
mergePendingToolCalls(intermediateToolBlocks, builder.message.content);
|
|
964
|
+
}
|
|
965
|
+
|
|
713
966
|
// Add tool calls from intermediate turns first (renders above text)
|
|
714
|
-
|
|
715
|
-
finalContent.push(...
|
|
967
|
+
attachExternalResultsToToolBlocks(intermediateToolBlocks, toolResultsById);
|
|
968
|
+
finalContent.push(...intermediateToolBlocks);
|
|
716
969
|
|
|
717
970
|
// Add text/thinking from the last turn
|
|
718
971
|
if (builder && builder.message.content.length > 0) {
|
|
@@ -747,11 +1000,7 @@ async function pumpSdkMessages(
|
|
|
747
1000
|
};
|
|
748
1001
|
|
|
749
1002
|
if (result.is_error) {
|
|
750
|
-
|
|
751
|
-
"errors" in result
|
|
752
|
-
? (result as any).errors?.join("; ")
|
|
753
|
-
: result.subtype;
|
|
754
|
-
finalMessage.errorMessage = errText;
|
|
1003
|
+
finalMessage.errorMessage = getResultErrorMessage(result);
|
|
755
1004
|
stream.push({ type: "error", reason: "error", error: finalMessage });
|
|
756
1005
|
} else {
|
|
757
1006
|
stream.push({ type: "done", reason: "stop", message: finalMessage });
|