gsd-pi 2.76.0-dev.fe143342a → 2.77.0-dev.1d17f366c
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 +17 -35
- package/dist/claude-cli-check.js +32 -3
- package/dist/cli-web-branch.d.ts +1 -0
- package/dist/cli-web-branch.js +3 -0
- package/dist/cli.js +38 -2
- package/dist/extension-discovery.d.ts +6 -0
- package/dist/extension-discovery.js +37 -0
- package/dist/extension-registry.d.ts +3 -0
- package/dist/extension-sort.d.ts +18 -0
- package/dist/extension-sort.js +114 -0
- package/dist/extension-validator.d.ts +47 -0
- package/dist/extension-validator.js +127 -0
- package/dist/loader.js +35 -7
- package/dist/onboarding.js +45 -0
- package/dist/provider-migrations.d.ts +18 -0
- package/dist/provider-migrations.js +14 -0
- package/dist/resources/extensions/claude-code-cli/readiness.js +4 -3
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +78 -59
- package/dist/resources/extensions/cmux/index.js +20 -0
- package/dist/resources/extensions/github-sync/templates.js +103 -0
- package/dist/resources/extensions/google-search/extension-manifest.json +5 -4
- package/dist/resources/extensions/google-search/index.js +3 -375
- package/dist/resources/extensions/gsd/abandon-detect.js +44 -0
- package/dist/resources/extensions/gsd/auto/loop.js +90 -2
- package/dist/resources/extensions/gsd/auto/phases.js +95 -21
- package/dist/resources/extensions/gsd/auto/resolve.js +24 -0
- package/dist/resources/extensions/gsd/auto/run-unit.js +48 -4
- package/dist/resources/extensions/gsd/auto/session.js +18 -1
- package/dist/resources/extensions/gsd/auto/turn-epoch.js +95 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +115 -17
- package/dist/resources/extensions/gsd/auto-loop.js +1 -1
- package/dist/resources/extensions/gsd/auto-model-selection.js +1 -1
- package/dist/resources/extensions/gsd/auto-post-unit.js +90 -2
- package/dist/resources/extensions/gsd/auto-prompts.js +14 -0
- package/dist/resources/extensions/gsd/auto-recovery.js +46 -1
- package/dist/resources/extensions/gsd/auto-start.js +45 -39
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +11 -5
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +11 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +109 -61
- package/dist/resources/extensions/gsd/auto.js +97 -31
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +27 -1
- package/dist/resources/extensions/gsd/bootstrap/provider-error-resume.js +4 -2
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +11 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +17 -6
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +11 -6
- 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/handlers/workflow.js +31 -4
- package/dist/resources/extensions/gsd/commands-cmux.js +9 -6
- package/dist/resources/extensions/gsd/commands-extensions.js +634 -43
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +968 -23
- package/dist/resources/extensions/gsd/dispatch-guard.js +29 -3
- package/dist/resources/extensions/gsd/file-lock.js +49 -9
- package/dist/resources/extensions/gsd/git-service.js +1 -0
- package/dist/resources/extensions/gsd/gitignore.js +2 -0
- package/dist/resources/extensions/gsd/gsd-db.js +90 -30
- package/dist/resources/extensions/gsd/guided-flow-queue.js +4 -1
- package/dist/resources/extensions/gsd/guided-flow.js +212 -9
- package/dist/resources/extensions/gsd/health-widget.js +4 -1
- package/dist/resources/extensions/gsd/journal.js +17 -2
- package/dist/resources/extensions/gsd/key-manager.js +22 -0
- package/dist/resources/extensions/gsd/milestone-actions.js +15 -0
- package/dist/resources/extensions/gsd/milestone-summary-classifier.js +37 -0
- package/dist/resources/extensions/gsd/model-router.js +36 -3
- package/dist/resources/extensions/gsd/notifications.js +30 -16
- package/dist/resources/extensions/gsd/pre-execution-checks.js +31 -6
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +29 -2
- package/dist/resources/extensions/gsd/prompts/discuss.md +29 -2
- package/dist/resources/extensions/gsd/prompts/doctor-heal.md +5 -4
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +5 -2
- package/dist/resources/extensions/gsd/prompts/system.md +1 -0
- package/dist/resources/extensions/gsd/reports.js +5 -4
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +96 -0
- package/dist/resources/extensions/gsd/safety/file-change-validator.js +12 -4
- package/dist/resources/extensions/gsd/safety/safety-harness.js +5 -1
- package/dist/resources/extensions/gsd/state-transition-matrix.js +118 -0
- package/dist/resources/extensions/gsd/state.js +25 -25
- 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/complete-slice.js +21 -0
- package/dist/resources/extensions/gsd/tools/complete-task.js +31 -0
- package/dist/resources/extensions/gsd/uok/audit.js +18 -2
- package/dist/resources/extensions/gsd/uok/dispatch-envelope.js +33 -0
- package/dist/resources/extensions/gsd/uok/execution-graph.js +10 -0
- package/dist/resources/extensions/gsd/uok/gitops.js +2 -1
- package/dist/resources/extensions/gsd/uok/loop-adapter.js +37 -10
- package/dist/resources/extensions/gsd/uok/parity-report.js +58 -0
- package/dist/resources/extensions/gsd/uok/plan-v2.js +30 -7
- package/dist/resources/extensions/gsd/uok/writer.js +82 -0
- package/dist/resources/extensions/gsd/workflow-logger.js +10 -2
- package/dist/resources/extensions/gsd/worktree-manager.js +1 -0
- package/dist/resources/extensions/gsd/worktree-resolver.js +50 -10
- package/dist/resources/extensions/mcp-client/auth.js +10 -1
- package/dist/resources/extensions/mcp-client/index.js +118 -9
- package/dist/resources/extensions/shared/cmux-events.js +12 -0
- package/dist/resources/extensions/shared/rtk-session-stats.js +1 -2
- package/dist/resources/skills/create-skill/SKILL.md +2 -2
- package/dist/resources/skills/create-skill/references/gsd-skill-ecosystem.md +4 -4
- package/dist/resources/skills/create-skill/workflows/audit-skill.md +4 -4
- package/dist/resources/skills/create-skill/workflows/create-new-skill.md +5 -5
- package/dist/resources/skills/verify-before-complete/SKILL.md +2 -1
- package/dist/resources/skills/write-docs/SKILL.md +2 -1
- 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 +9 -9
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +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/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +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 +9 -9
- package/dist/web/standalone/.next/server/chunks/1926.js +1 -0
- 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 +5 -5
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/2826.e9f5195e91f9cad2.js +11 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-5fc74f13a25fa1bb.js → webpack-2e68521d7c82f7c2.js} +1 -1
- package/dist/welcome-screen.js +6 -1
- package/dist/wizard.js +2 -0
- package/package.json +16 -14
- package/packages/daemon/package.json +2 -2
- package/packages/mcp-server/README.md +3 -3
- package/packages/mcp-server/dist/env-writer.d.ts +1 -0
- package/packages/mcp-server/dist/env-writer.d.ts.map +1 -1
- package/packages/mcp-server/dist/env-writer.js +74 -6
- package/packages/mcp-server/dist/env-writer.js.map +1 -1
- 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 +95 -10
- 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.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +15 -6
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +9 -3
- package/packages/mcp-server/src/env-writer.test.ts +79 -1
- package/packages/mcp-server/src/env-writer.ts +76 -6
- package/packages/mcp-server/src/mcp-server.test.ts +67 -0
- package/packages/mcp-server/src/readers/readers.test.ts +5 -1
- 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 +118 -16
- package/packages/mcp-server/src/session-manager.ts +43 -1
- package/packages/mcp-server/src/workflow-tools.test.ts +44 -0
- package/packages/mcp-server/src/workflow-tools.ts +19 -6
- package/packages/mcp-server/tsconfig.test.json +19 -0
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/package.json +6 -1
- package/packages/native/src/__tests__/clipboard.test.mjs +69 -23
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/package.json +6 -1
- package/packages/pi-agent-core/src/agent-loop.test.ts +220 -15
- 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-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 +8 -3
- 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/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/package.json +6 -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-shared.ts +26 -5
- package/packages/pi-ai/src/providers/anthropic.ts +9 -3
- package/packages/pi-ai/src/providers/minimax-tool-name.test.ts +98 -0
- package/packages/pi-ai/src/providers/simple-options.ts +17 -1
- 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 +7 -0
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +25 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js +105 -6
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js +230 -28
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts +30 -2
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.js +113 -12
- package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js +29 -18
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.js +130 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.js +56 -1
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/discovery-cache.test.js +8 -15
- package/packages/pi-coding-agent/dist/core/discovery-cache.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.d.ts +25 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.js +109 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-registry.d.ts +67 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-registry.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-registry.js +167 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-registry.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +3 -2
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +24 -8
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +14 -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/lsp/lsp-integration.test.js +11 -0
- package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +2 -2
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -1
- 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.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +14 -0
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.js +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +4 -1
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.test.js +19 -1
- package/packages/pi-coding-agent/dist/core/sdk.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.js +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.test.js +21 -1
- package/packages/pi-coding-agent/dist/core/session-manager.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +3 -3
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/path-utils.test.js +2 -1
- package/packages/pi-coding-agent/dist/core/tools/path-utils.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/provider-display-name.test.js +15 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/provider-display-name.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +14 -5
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts +7 -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 +31 -9
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +14 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.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 +6 -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 +11 -0
- package/packages/pi-coding-agent/src/core/compaction/compaction.test.ts +368 -28
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +122 -6
- package/packages/pi-coding-agent/src/core/compaction/utils.ts +111 -13
- package/packages/pi-coding-agent/src/core/compaction-orchestrator.test.ts +154 -0
- package/packages/pi-coding-agent/src/core/compaction-orchestrator.ts +32 -18
- package/packages/pi-coding-agent/src/core/compaction-utils.test.ts +68 -1
- package/packages/pi-coding-agent/src/core/discovery-cache.test.ts +9 -18
- package/packages/pi-coding-agent/src/core/extensions/extension-discovery.ts +119 -0
- package/packages/pi-coding-agent/src/core/extensions/extension-registry.ts +222 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +24 -11
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +2 -0
- package/packages/pi-coding-agent/src/core/extensions/types.ts +15 -0
- package/packages/pi-coding-agent/src/core/lsp/lsp-integration.test.ts +13 -0
- package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +2 -2
- package/packages/pi-coding-agent/src/core/model-registry-custom-caps.test.ts +245 -0
- package/packages/pi-coding-agent/src/core/model-registry.ts +16 -0
- package/packages/pi-coding-agent/src/core/resource-loader.ts +1 -1
- package/packages/pi-coding-agent/src/core/sdk.test.ts +25 -1
- package/packages/pi-coding-agent/src/core/sdk.ts +10 -3
- package/packages/pi-coding-agent/src/core/session-manager.test.ts +30 -1
- package/packages/pi-coding-agent/src/core/session-manager.ts +1 -1
- package/packages/pi-coding-agent/src/core/system-prompt.ts +3 -3
- package/packages/pi-coding-agent/src/core/tools/path-utils.test.ts +2 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/provider-display-name.test.ts +17 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +14 -5
- package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +45 -11
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +14 -0
- 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/dist/__tests__/autocomplete.test.js +12 -5
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js.map +1 -1
- package/packages/pi-tui/dist/__tests__/stdin-buffer.test.js +21 -0
- package/packages/pi-tui/dist/__tests__/stdin-buffer.test.js.map +1 -1
- package/packages/pi-tui/dist/stdin-buffer.d.ts +7 -0
- package/packages/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
- package/packages/pi-tui/dist/stdin-buffer.js +20 -0
- package/packages/pi-tui/dist/stdin-buffer.js.map +1 -1
- package/packages/pi-tui/package.json +6 -1
- package/packages/pi-tui/src/__tests__/autocomplete.test.ts +20 -5
- package/packages/pi-tui/src/__tests__/stdin-buffer.test.ts +27 -0
- package/packages/pi-tui/src/stdin-buffer.ts +26 -0
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/package.json +6 -1
- package/pkg/package.json +1 -1
- package/scripts/install.js +512 -0
- package/scripts/lib/workspace-manifest.cjs +86 -0
- package/scripts/link-workspace-packages.cjs +5 -17
- package/scripts/postinstall.js +9 -178
- package/src/resources/extensions/claude-code-cli/readiness.ts +4 -3
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +91 -63
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +114 -12
- package/src/resources/extensions/cmux/index.ts +35 -10
- package/src/resources/extensions/github-sync/templates.ts +151 -0
- package/src/resources/extensions/github-sync/tests/templates.test.ts +59 -0
- package/src/resources/extensions/google-search/extension-manifest.json +5 -4
- package/src/resources/extensions/google-search/index.ts +9 -470
- package/src/resources/extensions/gsd/abandon-detect.ts +62 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +14 -1
- package/src/resources/extensions/gsd/auto/loop.ts +104 -2
- package/src/resources/extensions/gsd/auto/phases.ts +123 -21
- package/src/resources/extensions/gsd/auto/resolve.ts +29 -0
- package/src/resources/extensions/gsd/auto/run-unit.ts +56 -4
- package/src/resources/extensions/gsd/auto/session.ts +28 -1
- package/src/resources/extensions/gsd/auto/turn-epoch.ts +108 -0
- package/src/resources/extensions/gsd/auto/types.ts +1 -1
- package/src/resources/extensions/gsd/auto-dispatch.ts +117 -16
- package/src/resources/extensions/gsd/auto-loop.ts +1 -1
- package/src/resources/extensions/gsd/auto-model-selection.ts +1 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +92 -3
- package/src/resources/extensions/gsd/auto-prompts.ts +28 -1
- package/src/resources/extensions/gsd/auto-recovery.ts +40 -1
- package/src/resources/extensions/gsd/auto-start.ts +48 -52
- package/src/resources/extensions/gsd/auto-timeout-recovery.ts +12 -5
- package/src/resources/extensions/gsd/auto-unit-closeout.ts +14 -3
- package/src/resources/extensions/gsd/auto-worktree.ts +122 -68
- package/src/resources/extensions/gsd/auto.ts +105 -35
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +34 -1
- package/src/resources/extensions/gsd/bootstrap/provider-error-resume.ts +6 -2
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +11 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +18 -6
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +13 -9
- 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/handlers/workflow.ts +27 -8
- package/src/resources/extensions/gsd/commands-cmux.ts +10 -6
- package/src/resources/extensions/gsd/commands-extensions.ts +747 -41
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +898 -32
- package/src/resources/extensions/gsd/dispatch-guard.ts +26 -2
- package/src/resources/extensions/gsd/file-lock.ts +84 -11
- package/src/resources/extensions/gsd/git-service.ts +1 -0
- package/src/resources/extensions/gsd/gitignore.ts +2 -1
- package/src/resources/extensions/gsd/gsd-db.ts +92 -32
- package/src/resources/extensions/gsd/guided-flow-queue.ts +4 -1
- package/src/resources/extensions/gsd/guided-flow.ts +259 -10
- package/src/resources/extensions/gsd/health-widget.ts +3 -1
- package/src/resources/extensions/gsd/journal.ts +29 -3
- package/src/resources/extensions/gsd/key-manager.ts +22 -0
- package/src/resources/extensions/gsd/milestone-actions.ts +18 -0
- package/src/resources/extensions/gsd/milestone-summary-classifier.ts +42 -0
- package/src/resources/extensions/gsd/model-router.ts +42 -1
- package/src/resources/extensions/gsd/notifications.ts +27 -15
- package/src/resources/extensions/gsd/pre-execution-checks.ts +33 -7
- package/src/resources/extensions/gsd/preferences-types.ts +8 -0
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +29 -2
- package/src/resources/extensions/gsd/prompts/discuss.md +29 -2
- package/src/resources/extensions/gsd/prompts/doctor-heal.md +5 -4
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +5 -2
- package/src/resources/extensions/gsd/prompts/system.md +1 -0
- package/src/resources/extensions/gsd/reports.ts +5 -4
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +119 -0
- package/src/resources/extensions/gsd/safety/file-change-validator.ts +16 -3
- package/src/resources/extensions/gsd/safety/safety-harness.ts +9 -0
- package/src/resources/extensions/gsd/state-transition-matrix.ts +152 -0
- package/src/resources/extensions/gsd/state.ts +35 -30
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +238 -4
- package/src/resources/extensions/gsd/tests/auto-mode-guards.test.ts +79 -0
- package/src/resources/extensions/gsd/tests/auto-paused-session-validation.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +122 -0
- package/src/resources/extensions/gsd/tests/auto-start-bootstrap-await-3420.test.ts +141 -0
- package/src/resources/extensions/gsd/tests/auto-start-clean-runtime-db-gated.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +186 -0
- package/src/resources/extensions/gsd/tests/cmux.test.ts +5 -9
- package/src/resources/extensions/gsd/tests/complete-milestone-false-merge.test.ts +15 -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/custom-engine-loop-integration.test.ts +161 -0
- package/src/resources/extensions/gsd/tests/db-access-guardrails.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/derive-state.test.ts +1 -2
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +14 -9
- package/src/resources/extensions/gsd/tests/dispatch-guard-summary-db-mismatch.test.ts +77 -0
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +25 -0
- package/src/resources/extensions/gsd/tests/dispatch-missing-task-plans.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/double-merge-guard.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/ensure-db-open.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/escalation.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/exec-history.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/execution-entry-missing-context-4671.test.ts +173 -0
- package/src/resources/extensions/gsd/tests/file-change-validator.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/file-lock.test.ts +86 -12
- package/src/resources/extensions/gsd/tests/google-search-stub.test.ts +131 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +296 -1
- package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +117 -0
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +4 -2
- 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/integration/worktree-e2e.test.ts +11 -0
- package/src/resources/extensions/gsd/tests/issue-4540-regressions.test.ts +288 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/key-manager.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/mcp-client-security.test.ts +76 -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/milestone-status-authoritative.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/milestone-summary-classifier.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/parallel-commit-scope.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/parallel-research-dispatch.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/parallel-skill-prompt-integration.test.ts +150 -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-gate-loop.test.ts +272 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +337 -0
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +39 -25
- package/src/resources/extensions/gsd/tests/queue-auto-guard.test.ts +181 -0
- package/src/resources/extensions/gsd/tests/quick-auto-guard.test.ts +13 -7
- package/src/resources/extensions/gsd/tests/ready-phrase-no-files-4573.test.ts +388 -0
- package/src/resources/extensions/gsd/tests/require-slice-discussion-dispatch.test.ts +170 -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/rewrite-docs-abandon-detect.test.ts +195 -0
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +205 -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/stale-dirlistcache-4648.test.ts +112 -0
- package/src/resources/extensions/gsd/tests/stash-queued-context-files.test.ts +56 -0
- package/src/resources/extensions/gsd/tests/state-machine-full-walkthrough.test.ts +24 -0
- package/src/resources/extensions/gsd/tests/state-transition-matrix.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +2 -2
- 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/triage-resolution.test.ts +50 -2
- package/src/resources/extensions/gsd/tests/turn-epoch.test.ts +162 -0
- package/src/resources/extensions/gsd/tests/uok-contracts.test.ts +51 -0
- package/src/resources/extensions/gsd/tests/uok-execution-graph.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/uok-loop-adapter-writer.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/uok-parity-report.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +42 -2
- package/src/resources/extensions/gsd/tests/uok-writer.test.ts +75 -0
- package/src/resources/extensions/gsd/tests/validate-extension-package.test.ts +168 -0
- package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +138 -5
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +25 -2
- 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/token-counter.ts +22 -5
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +15 -9
- package/src/resources/extensions/gsd/tools/complete-slice.ts +38 -0
- package/src/resources/extensions/gsd/tools/complete-task.ts +49 -0
- package/src/resources/extensions/gsd/uok/audit.ts +20 -2
- package/src/resources/extensions/gsd/uok/contracts.ts +65 -0
- package/src/resources/extensions/gsd/uok/dispatch-envelope.ts +56 -0
- package/src/resources/extensions/gsd/uok/execution-graph.ts +22 -0
- package/src/resources/extensions/gsd/uok/gitops.ts +6 -1
- package/src/resources/extensions/gsd/uok/loop-adapter.ts +45 -10
- package/src/resources/extensions/gsd/uok/parity-report.ts +84 -0
- package/src/resources/extensions/gsd/uok/plan-v2.ts +39 -8
- package/src/resources/extensions/gsd/uok/writer.ts +113 -0
- package/src/resources/extensions/gsd/workflow-logger.ts +23 -3
- package/src/resources/extensions/gsd/worktree-manager.ts +1 -0
- package/src/resources/extensions/gsd/worktree-resolver.ts +54 -9
- package/src/resources/extensions/mcp-client/auth.ts +12 -1
- package/src/resources/extensions/mcp-client/index.ts +129 -10
- package/src/resources/extensions/shared/cmux-events.ts +59 -0
- package/src/resources/extensions/shared/rtk-session-stats.ts +1 -2
- package/src/resources/skills/create-skill/SKILL.md +2 -2
- package/src/resources/skills/create-skill/references/gsd-skill-ecosystem.md +4 -4
- package/src/resources/skills/create-skill/workflows/audit-skill.md +4 -4
- package/src/resources/skills/create-skill/workflows/create-new-skill.md +5 -5
- package/src/resources/skills/verify-before-complete/SKILL.md +2 -1
- package/src/resources/skills/write-docs/SKILL.md +2 -1
- package/dist/web/standalone/.next/server/chunks/7461.js +0 -1
- package/dist/web/standalone/.next/static/chunks/2826.e59e8578e2e28639.js +0 -9
- /package/dist/web/standalone/.next/static/{n21VtX2hZlkpdEUO_nU4z → vidAVJkURvTJ0_V2-64ro}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{n21VtX2hZlkpdEUO_nU4z → vidAVJkURvTJ0_V2-64ro}/_ssgManifest.js +0 -0
package/scripts/postinstall.js
CHANGED
|
@@ -1,180 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
14
|
-
const cwd = resolve(__dirname, '..')
|
|
15
|
-
const PLAYWRIGHT_SKIP =
|
|
16
|
-
process.env.PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD === '1' ||
|
|
17
|
-
process.env.PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD === 'true'
|
|
18
|
-
const RTK_SKIP =
|
|
19
|
-
process.env.GSD_SKIP_RTK_INSTALL === '1' ||
|
|
20
|
-
process.env.GSD_SKIP_RTK_INSTALL === 'true' ||
|
|
21
|
-
process.env.GSD_RTK_DISABLED === '1' ||
|
|
22
|
-
process.env.GSD_RTK_DISABLED === 'true'
|
|
23
|
-
|
|
24
|
-
const RTK_VERSION = '0.33.1'
|
|
25
|
-
const RTK_REPO = 'rtk-ai/rtk'
|
|
26
|
-
const RTK_ENV = { ...process.env, RTK_TELEMETRY_DISABLED: '1' }
|
|
27
|
-
const managedBinDir = join(process.env.GSD_HOME || join(homedir(), '.gsd'), 'agent', 'bin')
|
|
28
|
-
const managedBinaryPath = join(managedBinDir, platform() === 'win32' ? 'rtk.exe' : 'rtk')
|
|
29
|
-
|
|
30
|
-
function run(cmd) {
|
|
31
|
-
return new Promise((resolvePromise) => {
|
|
32
|
-
execCb(cmd, { cwd }, (error, stdout, stderr) => {
|
|
33
|
-
resolvePromise({ ok: !error, stdout, stderr })
|
|
34
|
-
})
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function logWarn(message) {
|
|
39
|
-
process.stderr.write(`[gsd] postinstall: ${message}\n`)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function resolveAssetName() {
|
|
43
|
-
const currentPlatform = platform()
|
|
44
|
-
const currentArch = arch()
|
|
45
|
-
if (currentPlatform === 'darwin' && currentArch === 'arm64') return 'rtk-aarch64-apple-darwin.tar.gz'
|
|
46
|
-
if (currentPlatform === 'darwin' && currentArch === 'x64') return 'rtk-x86_64-apple-darwin.tar.gz'
|
|
47
|
-
if (currentPlatform === 'linux' && currentArch === 'arm64') return 'rtk-aarch64-unknown-linux-gnu.tar.gz'
|
|
48
|
-
if (currentPlatform === 'linux' && currentArch === 'x64') return 'rtk-x86_64-unknown-linux-musl.tar.gz'
|
|
49
|
-
if (currentPlatform === 'win32' && currentArch === 'x64') return 'rtk-x86_64-pc-windows-msvc.zip'
|
|
50
|
-
return null
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function parseChecksums(text) {
|
|
54
|
-
const checksums = new Map()
|
|
55
|
-
for (const rawLine of text.split(/\r?\n/)) {
|
|
56
|
-
const line = rawLine.trim()
|
|
57
|
-
if (!line) continue
|
|
58
|
-
const match = line.match(/^([a-f0-9]{64})\s+(.+)$/i)
|
|
59
|
-
if (!match) continue
|
|
60
|
-
checksums.set(match[2], match[1].toLowerCase())
|
|
61
|
-
}
|
|
62
|
-
return checksums
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function sha256File(path) {
|
|
66
|
-
const hash = createHash('sha256')
|
|
67
|
-
hash.update(readFileSync(path))
|
|
68
|
-
return hash.digest('hex')
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async function downloadToFile(url, destination) {
|
|
72
|
-
const response = await fetch(url, { headers: { 'User-Agent': 'gsd-pi-postinstall' } })
|
|
73
|
-
if (!response.ok) {
|
|
74
|
-
throw new Error(`download failed (${response.status}) for ${url}`)
|
|
75
|
-
}
|
|
76
|
-
if (!response.body) {
|
|
77
|
-
throw new Error(`download returned no body for ${url}`)
|
|
78
|
-
}
|
|
79
|
-
const output = createWriteStream(destination)
|
|
80
|
-
await finished(Readable.fromWeb(response.body).pipe(output))
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function findBinaryRecursively(rootDir, binaryName) {
|
|
84
|
-
const stack = [rootDir]
|
|
85
|
-
while (stack.length > 0) {
|
|
86
|
-
const current = stack.pop()
|
|
87
|
-
if (!current) continue
|
|
88
|
-
const entries = readdirSync(current, { withFileTypes: true })
|
|
89
|
-
for (const entry of entries) {
|
|
90
|
-
const fullPath = join(current, entry.name)
|
|
91
|
-
if (entry.isFile() && entry.name === binaryName) return fullPath
|
|
92
|
-
if (entry.isDirectory()) stack.push(fullPath)
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return null
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function validateRtkBinary(binaryPath) {
|
|
99
|
-
const result = spawnSync(binaryPath, ['rewrite', 'git status'], {
|
|
100
|
-
encoding: 'utf-8',
|
|
101
|
-
env: RTK_ENV,
|
|
102
|
-
stdio: ['ignore', 'pipe', 'ignore'],
|
|
103
|
-
timeout: 5000,
|
|
104
|
-
})
|
|
105
|
-
return !result.error && result.status === 0 && (result.stdout || '').trim() === 'rtk git status'
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
async function ensureRtkInstalled() {
|
|
109
|
-
if (RTK_SKIP) return
|
|
110
|
-
const assetName = resolveAssetName()
|
|
111
|
-
if (!assetName) return
|
|
112
|
-
if (existsSync(managedBinaryPath) && validateRtkBinary(managedBinaryPath)) return
|
|
113
|
-
|
|
114
|
-
const tempRoot = join(managedBinDir, `.rtk-postinstall-${randomUUID().slice(0, 8)}`)
|
|
115
|
-
const archivePath = join(tempRoot, assetName)
|
|
116
|
-
const extractDir = join(tempRoot, 'extract')
|
|
117
|
-
const releaseBase = `https://github.com/${RTK_REPO}/releases/download/v${RTK_VERSION}`
|
|
118
|
-
|
|
119
|
-
mkdirSync(tempRoot, { recursive: true })
|
|
120
|
-
mkdirSync(managedBinDir, { recursive: true })
|
|
121
|
-
|
|
122
|
-
try {
|
|
123
|
-
const checksumsResponse = await fetch(`${releaseBase}/checksums.txt`, {
|
|
124
|
-
headers: { 'User-Agent': 'gsd-pi-postinstall' },
|
|
125
|
-
})
|
|
126
|
-
if (!checksumsResponse.ok) {
|
|
127
|
-
throw new Error(`failed to fetch RTK checksums (${checksumsResponse.status})`)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const checksums = parseChecksums(await checksumsResponse.text())
|
|
131
|
-
const expectedSha = checksums.get(assetName)
|
|
132
|
-
if (!expectedSha) {
|
|
133
|
-
throw new Error(`missing checksum for ${assetName}`)
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
await downloadToFile(`${releaseBase}/${assetName}`, archivePath)
|
|
137
|
-
const actualSha = sha256File(archivePath)
|
|
138
|
-
if (actualSha !== expectedSha) {
|
|
139
|
-
throw new Error(`checksum mismatch for ${assetName}`)
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
mkdirSync(extractDir, { recursive: true })
|
|
143
|
-
if (assetName.endsWith('.zip')) {
|
|
144
|
-
await extractZip(archivePath, { dir: extractDir })
|
|
145
|
-
} else {
|
|
146
|
-
const extractResult = spawnSync('tar', ['xzf', archivePath, '-C', extractDir], {
|
|
147
|
-
encoding: 'utf-8',
|
|
148
|
-
timeout: 30000,
|
|
149
|
-
})
|
|
150
|
-
if (extractResult.error || extractResult.status !== 0) {
|
|
151
|
-
throw new Error(extractResult.error?.message || extractResult.stderr?.trim() || `failed to extract ${assetName}`)
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const extractedBinary = findBinaryRecursively(extractDir, platform() === 'win32' ? 'rtk.exe' : 'rtk')
|
|
156
|
-
if (!extractedBinary) {
|
|
157
|
-
throw new Error(`RTK binary not found in ${assetName}`)
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
copyFileSync(extractedBinary, managedBinaryPath)
|
|
161
|
-
if (platform() !== 'win32') {
|
|
162
|
-
chmodSync(managedBinaryPath, 0o755)
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
if (!validateRtkBinary(managedBinaryPath)) {
|
|
166
|
-
rmSync(managedBinaryPath, { force: true })
|
|
167
|
-
throw new Error('downloaded RTK binary failed validation')
|
|
168
|
-
}
|
|
169
|
-
} catch (error) {
|
|
170
|
-
logWarn(`RTK install skipped: ${error instanceof Error ? error.message : String(error)}`)
|
|
171
|
-
} finally {
|
|
172
|
-
rmSync(tempRoot, { recursive: true, force: true })
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
if (!PLAYWRIGHT_SKIP) {
|
|
177
|
-
await run('npx playwright install chromium')
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
await ensureRtkInstalled()
|
|
3
|
+
/**
|
|
4
|
+
* GSD Postinstall
|
|
5
|
+
*
|
|
6
|
+
* Thin wrapper that delegates to install.js in postinstall mode
|
|
7
|
+
* (workspace linking + deps only, no global/local npm install).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
process.env.npm_lifecycle_event = process.env.npm_lifecycle_event || 'postinstall'
|
|
11
|
+
import('./install.js')
|
|
@@ -21,10 +21,11 @@ const CLAUDE_COMMAND = process.platform === "win32" ? "claude.cmd" : "claude";
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Windows installs vary: some environments expose `claude.cmd` (npm shim),
|
|
24
|
-
*
|
|
25
|
-
* Try
|
|
24
|
+
* `claude.exe` (direct binary install), or a bare `claude` shim on PATH
|
|
25
|
+
* (for example Git Bash wrappers). Try all three to avoid false "not
|
|
26
|
+
* installed" results in readiness checks.
|
|
26
27
|
*/
|
|
27
|
-
const CLAUDE_COMMAND_CANDIDATES = process.platform === "win32" ? [CLAUDE_COMMAND, "claude"] : [CLAUDE_COMMAND];
|
|
28
|
+
const CLAUDE_COMMAND_CANDIDATES = process.platform === "win32" ? [CLAUDE_COMMAND, "claude.exe", "claude"] : [CLAUDE_COMMAND];
|
|
28
29
|
|
|
29
30
|
function execClaude(args: string[]): Buffer {
|
|
30
31
|
let lastError: unknown;
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The SDK runs the full agentic loop (multi-turn, tool execution, compaction)
|
|
5
5
|
* in one call. This adapter translates the SDK's streaming output into
|
|
6
|
-
* AssistantMessageEvents for TUI rendering, then
|
|
7
|
-
* the final AssistantMessage so
|
|
6
|
+
* AssistantMessageEvents for TUI rendering, then preserves externally executed
|
|
7
|
+
* tool-call blocks on the final AssistantMessage so Agent Core can render them
|
|
8
|
+
* while `externalToolExecution` prevents local redispatch.
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
import type {
|
|
@@ -692,18 +693,22 @@ export function makeAbortedMessage(model: string, lastTextContent: string): Assi
|
|
|
692
693
|
/**
|
|
693
694
|
* Resolve the Claude Code permission mode for the current run.
|
|
694
695
|
*
|
|
695
|
-
*
|
|
696
|
-
*
|
|
697
|
-
*
|
|
698
|
-
*
|
|
699
|
-
*
|
|
700
|
-
*
|
|
701
|
-
* users opt into a stricter mode (`acceptEdits`, `default`, `plan`).
|
|
696
|
+
* Defaults to `acceptEdits`, which auto-approves file reads/edits but
|
|
697
|
+
* surfaces a permission dialog for dangerous operations (e.g. general Bash,
|
|
698
|
+
* Agent, WebFetch). This prevents tools outside the allowlist from being
|
|
699
|
+
* silently denied — the SDK emits an `extension_ui_request` event so the
|
|
700
|
+
* user sees a prompt instead of a silent refusal that Claude Code mistakes
|
|
701
|
+
* for user rejection (#4383).
|
|
702
702
|
*
|
|
703
|
-
*
|
|
704
|
-
*
|
|
705
|
-
*
|
|
706
|
-
*
|
|
703
|
+
* Set `GSD_CLAUDE_CODE_PERMISSION_MODE` to `bypassPermissions` to restore
|
|
704
|
+
* the old always-approve behaviour, or to `default` / `plan` for stricter
|
|
705
|
+
* modes.
|
|
706
|
+
*
|
|
707
|
+
* When `GSD_HEADLESS=1` is set (auto-mode / non-interactive runs), the
|
|
708
|
+
* default flips to `bypassPermissions` because there is no UI to approve
|
|
709
|
+
* permission dialogs — `acceptEdits` would hang verification commands like
|
|
710
|
+
* `npx tsc --noEmit` or `npx vitest run` indefinitely (#4657). Explicit
|
|
711
|
+
* overrides still win, so users can opt back into `acceptEdits` in headless.
|
|
707
712
|
*/
|
|
708
713
|
export async function resolveClaudePermissionMode(
|
|
709
714
|
env: NodeJS.ProcessEnv = process.env,
|
|
@@ -712,6 +717,12 @@ export async function resolveClaudePermissionMode(
|
|
|
712
717
|
if (override === "bypassPermissions" || override === "acceptEdits" || override === "default" || override === "plan") {
|
|
713
718
|
return override;
|
|
714
719
|
}
|
|
720
|
+
if (env.GSD_HEADLESS === "1") {
|
|
721
|
+
console.warn(
|
|
722
|
+
"[claude-code-cli] Headless mode detected (GSD_HEADLESS=1): defaulting permissionMode to 'bypassPermissions' so verification Bash commands can run. Set GSD_CLAUDE_CODE_PERMISSION_MODE=acceptEdits to opt out.",
|
|
723
|
+
);
|
|
724
|
+
return "bypassPermissions";
|
|
725
|
+
}
|
|
715
726
|
return "bypassPermissions";
|
|
716
727
|
}
|
|
717
728
|
|
|
@@ -773,20 +784,24 @@ export function buildSdkOptions(
|
|
|
773
784
|
const { reasoning, ...sdkExtraOptions } = extraOptions;
|
|
774
785
|
const mcpServers = buildWorkflowMcpServers();
|
|
775
786
|
const permissionMode = overrides?.permissionMode ?? "bypassPermissions";
|
|
776
|
-
|
|
777
|
-
//
|
|
778
|
-
//
|
|
779
|
-
//
|
|
780
|
-
// every `
|
|
781
|
-
//
|
|
787
|
+
// Globally unblock all tools. Users reported that the `acceptEdits` default
|
|
788
|
+
// plus a narrow allowlist silently declined most Bash/Agent/WebFetch calls
|
|
789
|
+
// when `extensionUIContext` wasn't threaded through. Default to
|
|
790
|
+
// bypassPermissions and an empty disallow list so every tool — including
|
|
791
|
+
// `AskUserQuestion` and every `mcp__*` workflow tool — is auto-approved.
|
|
792
|
+
// Opt back into gated mode with GSD_CLAUDE_CODE_PERMISSION_MODE=acceptEdits.
|
|
793
|
+
const disallowedTools: string[] = [];
|
|
782
794
|
const allowedTools = [
|
|
783
795
|
"Read",
|
|
784
796
|
"Write",
|
|
785
797
|
"Edit",
|
|
786
798
|
"Glob",
|
|
787
799
|
"Grep",
|
|
788
|
-
"Bash
|
|
789
|
-
"
|
|
800
|
+
"Bash",
|
|
801
|
+
"Agent",
|
|
802
|
+
"WebFetch",
|
|
803
|
+
"WebSearch",
|
|
804
|
+
"AskUserQuestion",
|
|
790
805
|
...(mcpServers ? Object.keys(mcpServers).map((serverName) => `mcp__${serverName}__*`) : []),
|
|
791
806
|
];
|
|
792
807
|
const supportsAdaptive = modelSupportsAdaptiveThinking(modelId);
|
|
@@ -994,6 +1009,49 @@ function attachExternalResultsToToolBlocks(
|
|
|
994
1009
|
}
|
|
995
1010
|
}
|
|
996
1011
|
|
|
1012
|
+
/**
|
|
1013
|
+
* Build the final assistant content that Agent Core consumes in
|
|
1014
|
+
* `externalToolExecution` mode. This preserves tool-call blocks, attaches any
|
|
1015
|
+
* SDK-produced external results by tool-call id, and then appends the final
|
|
1016
|
+
* text/thinking blocks for the completed turn.
|
|
1017
|
+
*/
|
|
1018
|
+
export function buildFinalAssistantContent(params: {
|
|
1019
|
+
intermediateToolBlocks: AssistantMessage["content"];
|
|
1020
|
+
pendingContent?: AssistantMessage["content"];
|
|
1021
|
+
toolResultsById: ReadonlyMap<string, ExternalToolResultPayload>;
|
|
1022
|
+
lastThinkingContent?: string;
|
|
1023
|
+
lastTextContent?: string;
|
|
1024
|
+
fallbackResultText?: string;
|
|
1025
|
+
}): AssistantMessage["content"] {
|
|
1026
|
+
const mergedToolBlocks = [...params.intermediateToolBlocks];
|
|
1027
|
+
if (params.pendingContent) {
|
|
1028
|
+
mergePendingToolCalls(mergedToolBlocks, params.pendingContent);
|
|
1029
|
+
}
|
|
1030
|
+
attachExternalResultsToToolBlocks(mergedToolBlocks, params.toolResultsById);
|
|
1031
|
+
|
|
1032
|
+
const finalContent: AssistantMessage["content"] = [...mergedToolBlocks];
|
|
1033
|
+
if (params.pendingContent && params.pendingContent.length > 0) {
|
|
1034
|
+
for (const block of params.pendingContent) {
|
|
1035
|
+
if (block.type === "text" || block.type === "thinking") {
|
|
1036
|
+
finalContent.push(block);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
} else {
|
|
1040
|
+
if (params.lastThinkingContent) {
|
|
1041
|
+
finalContent.push({ type: "thinking", thinking: params.lastThinkingContent });
|
|
1042
|
+
}
|
|
1043
|
+
if (params.lastTextContent) {
|
|
1044
|
+
finalContent.push({ type: "text", text: params.lastTextContent });
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
if (finalContent.length === 0 && params.fallbackResultText) {
|
|
1049
|
+
finalContent.push({ type: "text", text: params.fallbackResultText });
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
return finalContent;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
997
1055
|
/**
|
|
998
1056
|
* Merge tool-call blocks from the active partial-message builder into the
|
|
999
1057
|
* running list of intermediate tool calls, preserving order and de-duping
|
|
@@ -1025,8 +1083,9 @@ export function mergePendingToolCalls(
|
|
|
1025
1083
|
* GSD streamSimple function that delegates to the Claude Agent SDK.
|
|
1026
1084
|
*
|
|
1027
1085
|
* Emits AssistantMessageEvent deltas for real-time TUI rendering
|
|
1028
|
-
* (thinking, text, tool calls). The final AssistantMessage
|
|
1029
|
-
*
|
|
1086
|
+
* (thinking, text, tool calls). The final AssistantMessage preserves
|
|
1087
|
+
* SDK-executed tool-call blocks for Agent Core's `externalToolExecution`
|
|
1088
|
+
* path, which renders the results without dispatching the tools locally.
|
|
1030
1089
|
*/
|
|
1031
1090
|
export function streamViaClaudeCode(
|
|
1032
1091
|
model: Model<any>,
|
|
@@ -1227,46 +1286,15 @@ async function pumpSdkMessages(
|
|
|
1227
1286
|
// -- Result (terminal) --
|
|
1228
1287
|
case "result": {
|
|
1229
1288
|
const result = msg as SDKResultMessage;
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
// still holds toolCall blocks that were never pushed into
|
|
1240
|
-
// `intermediateToolBlocks`. Fold them in here so they aren't
|
|
1241
|
-
// dropped from the final AssistantMessage.
|
|
1242
|
-
if (builder) {
|
|
1243
|
-
mergePendingToolCalls(intermediateToolBlocks, builder.message.content);
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
// Add tool calls from intermediate turns first (renders above text)
|
|
1247
|
-
attachExternalResultsToToolBlocks(intermediateToolBlocks, toolResultsById);
|
|
1248
|
-
finalContent.push(...intermediateToolBlocks);
|
|
1249
|
-
|
|
1250
|
-
// Add text/thinking from the last turn
|
|
1251
|
-
if (builder && builder.message.content.length > 0) {
|
|
1252
|
-
for (const block of builder.message.content) {
|
|
1253
|
-
if (block.type === "text" || block.type === "thinking") {
|
|
1254
|
-
finalContent.push(block);
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
} else {
|
|
1258
|
-
if (lastThinkingContent) {
|
|
1259
|
-
finalContent.push({ type: "thinking", thinking: lastThinkingContent });
|
|
1260
|
-
}
|
|
1261
|
-
if (lastTextContent) {
|
|
1262
|
-
finalContent.push({ type: "text", text: lastTextContent });
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
// Fallback: use the SDK's result text if we have no content
|
|
1267
|
-
if (finalContent.length === 0 && result.subtype === "success" && result.result) {
|
|
1268
|
-
finalContent.push({ type: "text", text: result.result });
|
|
1269
|
-
}
|
|
1289
|
+
const finalContent = buildFinalAssistantContent({
|
|
1290
|
+
intermediateToolBlocks,
|
|
1291
|
+
pendingContent: builder?.message.content,
|
|
1292
|
+
toolResultsById,
|
|
1293
|
+
lastThinkingContent,
|
|
1294
|
+
lastTextContent,
|
|
1295
|
+
fallbackResultText:
|
|
1296
|
+
result.subtype === "success" && result.result ? result.result : undefined,
|
|
1297
|
+
});
|
|
1270
1298
|
|
|
1271
1299
|
const finalMessage: AssistantMessage = {
|
|
1272
1300
|
role: "assistant",
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
getResultErrorMessage,
|
|
9
9
|
makeAbortedMessage,
|
|
10
10
|
mergePendingToolCalls,
|
|
11
|
+
buildFinalAssistantContent,
|
|
11
12
|
resolveClaudePermissionMode,
|
|
12
13
|
buildPromptFromContext,
|
|
13
14
|
buildSdkQueryPrompt,
|
|
@@ -539,6 +540,71 @@ describe("stream-adapter — Claude Code external tool results", () => {
|
|
|
539
540
|
},
|
|
540
541
|
]);
|
|
541
542
|
});
|
|
543
|
+
|
|
544
|
+
test("buildFinalAssistantContent preserves intermediate tool calls with attached external results", () => {
|
|
545
|
+
const finalContent = buildFinalAssistantContent({
|
|
546
|
+
intermediateToolBlocks: [
|
|
547
|
+
{
|
|
548
|
+
type: "toolCall",
|
|
549
|
+
id: "tool-bash-1",
|
|
550
|
+
name: "bash",
|
|
551
|
+
arguments: { command: "echo hi" },
|
|
552
|
+
} as any,
|
|
553
|
+
],
|
|
554
|
+
pendingContent: [{ type: "text", text: "All done." }],
|
|
555
|
+
toolResultsById: new Map([
|
|
556
|
+
[
|
|
557
|
+
"tool-bash-1",
|
|
558
|
+
{
|
|
559
|
+
content: [{ type: "text", text: "hi\n" }],
|
|
560
|
+
details: { source: "claude-code" },
|
|
561
|
+
isError: false,
|
|
562
|
+
},
|
|
563
|
+
],
|
|
564
|
+
]),
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
assert.equal(finalContent[0]?.type, "toolCall");
|
|
568
|
+
assert.deepEqual((finalContent[0] as any).externalResult, {
|
|
569
|
+
content: [{ type: "text", text: "hi\n" }],
|
|
570
|
+
details: { source: "claude-code" },
|
|
571
|
+
isError: false,
|
|
572
|
+
});
|
|
573
|
+
assert.deepEqual(finalContent[1], { type: "text", text: "All done." });
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
test("buildFinalAssistantContent keeps final-turn tool calls when result arrives without a synthetic user boundary", () => {
|
|
577
|
+
const finalContent = buildFinalAssistantContent({
|
|
578
|
+
intermediateToolBlocks: [],
|
|
579
|
+
pendingContent: [
|
|
580
|
+
{
|
|
581
|
+
type: "toolCall",
|
|
582
|
+
id: "tool-read-1",
|
|
583
|
+
name: "read",
|
|
584
|
+
arguments: { path: "README.md" },
|
|
585
|
+
} as any,
|
|
586
|
+
{ type: "text", text: "Read complete." },
|
|
587
|
+
],
|
|
588
|
+
toolResultsById: new Map([
|
|
589
|
+
[
|
|
590
|
+
"tool-read-1",
|
|
591
|
+
{
|
|
592
|
+
content: [{ type: "text", text: "file contents" }],
|
|
593
|
+
details: { path: "README.md" },
|
|
594
|
+
isError: false,
|
|
595
|
+
},
|
|
596
|
+
],
|
|
597
|
+
]),
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
assert.equal(finalContent[0]?.type, "toolCall");
|
|
601
|
+
assert.deepEqual((finalContent[0] as any).externalResult, {
|
|
602
|
+
content: [{ type: "text", text: "file contents" }],
|
|
603
|
+
details: { path: "README.md" },
|
|
604
|
+
isError: false,
|
|
605
|
+
});
|
|
606
|
+
assert.deepEqual(finalContent[1], { type: "text", text: "Read complete." });
|
|
607
|
+
});
|
|
542
608
|
});
|
|
543
609
|
|
|
544
610
|
describe("stream-adapter — session persistence (#2859)", () => {
|
|
@@ -695,15 +761,18 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
695
761
|
assert.equal(srv.env.GSD_CLI_PATH, "/tmp/gsd");
|
|
696
762
|
assert.equal(srv.env.GSD_PERSIST_WRITE_GATE_STATE, "1");
|
|
697
763
|
assert.equal(srv.env.GSD_WORKFLOW_PROJECT_ROOT, "/tmp/project");
|
|
698
|
-
assert.deepEqual(options.disallowedTools, [
|
|
764
|
+
assert.deepEqual(options.disallowedTools, []);
|
|
699
765
|
assert.deepEqual(options.allowedTools, [
|
|
700
766
|
"Read",
|
|
701
767
|
"Write",
|
|
702
768
|
"Edit",
|
|
703
769
|
"Glob",
|
|
704
770
|
"Grep",
|
|
705
|
-
"Bash
|
|
706
|
-
"
|
|
771
|
+
"Bash",
|
|
772
|
+
"Agent",
|
|
773
|
+
"WebFetch",
|
|
774
|
+
"WebSearch",
|
|
775
|
+
"AskUserQuestion",
|
|
707
776
|
"mcp__gsd-workflow__*",
|
|
708
777
|
]);
|
|
709
778
|
} finally {
|
|
@@ -715,7 +784,7 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
715
784
|
}
|
|
716
785
|
});
|
|
717
786
|
|
|
718
|
-
test("buildSdkOptions
|
|
787
|
+
test("buildSdkOptions auto-approves every tool for custom workflow MCP server names", () => {
|
|
719
788
|
const prev = {
|
|
720
789
|
GSD_WORKFLOW_MCP_COMMAND: process.env.GSD_WORKFLOW_MCP_COMMAND,
|
|
721
790
|
GSD_WORKFLOW_MCP_NAME: process.env.GSD_WORKFLOW_MCP_NAME,
|
|
@@ -733,15 +802,18 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
733
802
|
const options = buildSdkOptions("claude-sonnet-4-20250514", "test");
|
|
734
803
|
const mcpServers = options.mcpServers as Record<string, any>;
|
|
735
804
|
assert.ok(mcpServers?.["custom-workflow"], "expected custom workflow server config");
|
|
736
|
-
assert.deepEqual(options.disallowedTools, [
|
|
805
|
+
assert.deepEqual(options.disallowedTools, []);
|
|
737
806
|
assert.deepEqual(options.allowedTools, [
|
|
738
807
|
"Read",
|
|
739
808
|
"Write",
|
|
740
809
|
"Edit",
|
|
741
810
|
"Glob",
|
|
742
811
|
"Grep",
|
|
743
|
-
"Bash
|
|
744
|
-
"
|
|
812
|
+
"Bash",
|
|
813
|
+
"Agent",
|
|
814
|
+
"WebFetch",
|
|
815
|
+
"WebSearch",
|
|
816
|
+
"AskUserQuestion",
|
|
745
817
|
"mcp__custom-workflow__*",
|
|
746
818
|
]);
|
|
747
819
|
} finally {
|
|
@@ -779,9 +851,9 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
779
851
|
const mcpServers = (options as any).mcpServers;
|
|
780
852
|
if (mcpServers) {
|
|
781
853
|
assert.ok(mcpServers["gsd-workflow"], "if present, must be gsd-workflow");
|
|
782
|
-
assert.deepEqual((options as any).disallowedTools, [
|
|
854
|
+
assert.deepEqual((options as any).disallowedTools, []);
|
|
783
855
|
} else {
|
|
784
|
-
assert.deepEqual((options as any).disallowedTools, [
|
|
856
|
+
assert.deepEqual((options as any).disallowedTools, []);
|
|
785
857
|
}
|
|
786
858
|
rmSync(emptyDir, { recursive: true, force: true });
|
|
787
859
|
} finally {
|
|
@@ -828,7 +900,7 @@ describe("stream-adapter — session persistence (#2859)", () => {
|
|
|
828
900
|
assert.equal(srv.env.GSD_CLI_PATH, "/tmp/gsd");
|
|
829
901
|
assert.equal(srv.env.GSD_PERSIST_WRITE_GATE_STATE, "1");
|
|
830
902
|
assert.equal(srv.env.GSD_WORKFLOW_PROJECT_ROOT, resolvedRepoDir);
|
|
831
|
-
assert.deepEqual(options.disallowedTools, [
|
|
903
|
+
assert.deepEqual(options.disallowedTools, []);
|
|
832
904
|
} finally {
|
|
833
905
|
process.chdir(originalCwd);
|
|
834
906
|
rmSync(repoDir, { recursive: true, force: true });
|
|
@@ -1216,11 +1288,15 @@ describe("stream-adapter — permission mode (F10)", () => {
|
|
|
1216
1288
|
}
|
|
1217
1289
|
}
|
|
1218
1290
|
|
|
1219
|
-
test("buildSdkOptions defaults to bypassPermissions
|
|
1291
|
+
test("buildSdkOptions defaults to bypassPermissions (globally unblocks all tools)", () => {
|
|
1220
1292
|
clearWorkflowMcpEnv();
|
|
1221
1293
|
const opts = buildSdkOptions("claude-sonnet-4-6", "test");
|
|
1222
1294
|
assert.equal(opts.permissionMode, "bypassPermissions");
|
|
1223
|
-
assert.equal(
|
|
1295
|
+
assert.equal(
|
|
1296
|
+
opts.allowDangerouslySkipPermissions,
|
|
1297
|
+
true,
|
|
1298
|
+
"allowDangerouslySkipPermissions must be true when permissionMode is bypassPermissions",
|
|
1299
|
+
);
|
|
1224
1300
|
});
|
|
1225
1301
|
|
|
1226
1302
|
test("buildSdkOptions respects explicit acceptEdits override", () => {
|
|
@@ -1234,6 +1310,11 @@ describe("stream-adapter — permission mode (F10)", () => {
|
|
|
1234
1310
|
);
|
|
1235
1311
|
});
|
|
1236
1312
|
|
|
1313
|
+
test("resolveClaudePermissionMode defaults to bypassPermissions when no env var is set (globally unblocks all tools)", async () => {
|
|
1314
|
+
const mode = await resolveClaudePermissionMode({});
|
|
1315
|
+
assert.equal(mode, "bypassPermissions");
|
|
1316
|
+
});
|
|
1317
|
+
|
|
1237
1318
|
test("resolveClaudePermissionMode honours the GSD_CLAUDE_CODE_PERMISSION_MODE env override", async () => {
|
|
1238
1319
|
const env = { GSD_CLAUDE_CODE_PERMISSION_MODE: "acceptEdits" } as NodeJS.ProcessEnv;
|
|
1239
1320
|
const mode = await resolveClaudePermissionMode(env);
|
|
@@ -1249,6 +1330,27 @@ describe("stream-adapter — permission mode (F10)", () => {
|
|
|
1249
1330
|
`expected bypass or acceptEdits, got ${mode}`,
|
|
1250
1331
|
);
|
|
1251
1332
|
});
|
|
1333
|
+
|
|
1334
|
+
test("resolveClaudePermissionMode flips to bypassPermissions when GSD_HEADLESS=1 (#4657)", async () => {
|
|
1335
|
+
const originalWarn = console.warn;
|
|
1336
|
+
console.warn = () => {};
|
|
1337
|
+
try {
|
|
1338
|
+
const env = { GSD_HEADLESS: "1" } as NodeJS.ProcessEnv;
|
|
1339
|
+
const mode = await resolveClaudePermissionMode(env);
|
|
1340
|
+
assert.equal(mode, "bypassPermissions");
|
|
1341
|
+
} finally {
|
|
1342
|
+
console.warn = originalWarn;
|
|
1343
|
+
}
|
|
1344
|
+
});
|
|
1345
|
+
|
|
1346
|
+
test("resolveClaudePermissionMode: explicit override wins over GSD_HEADLESS=1", async () => {
|
|
1347
|
+
const env = {
|
|
1348
|
+
GSD_HEADLESS: "1",
|
|
1349
|
+
GSD_CLAUDE_CODE_PERMISSION_MODE: "acceptEdits",
|
|
1350
|
+
} as NodeJS.ProcessEnv;
|
|
1351
|
+
const mode = await resolveClaudePermissionMode(env);
|
|
1352
|
+
assert.equal(mode, "acceptEdits");
|
|
1353
|
+
});
|
|
1252
1354
|
});
|
|
1253
1355
|
|
|
1254
1356
|
describe("stream-adapter — Windows Claude path lookup (#3770)", () => {
|