gsd-pi 2.80.0-dev.4ea7d80e7 → 2.80.0-dev.7582bf37a
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 +4 -2
- package/dist/claude-cli-check.d.ts +30 -0
- package/dist/claude-cli-check.js +18 -7
- package/dist/cli.js +0 -19
- package/dist/headless-query.d.ts +10 -0
- package/dist/headless-query.js +6 -4
- package/dist/loader-entrypoint.d.ts +8 -0
- package/dist/loader-entrypoint.js +27 -0
- package/dist/loader.js +2 -11
- package/dist/mcp-server.d.ts +1 -0
- package/dist/mcp-server.js +6 -3
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/GSD-WORKFLOW.md +2 -2
- package/dist/resources/extensions/claude-code-cli/readiness.js +18 -7
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +40 -3
- package/dist/resources/extensions/github-sync/sync.js +4 -1
- package/dist/resources/extensions/gsd/auto/loop.js +103 -9
- package/dist/resources/extensions/gsd/auto/phases.js +240 -139
- package/dist/resources/extensions/gsd/auto/resolve.js +29 -0
- package/dist/resources/extensions/gsd/auto/run-unit.js +22 -30
- package/dist/resources/extensions/gsd/auto/session.js +8 -0
- package/dist/resources/extensions/gsd/auto/workflow-dispatch-claim.js +33 -1
- package/dist/resources/extensions/gsd/auto/workflow-worker-heartbeat.js +9 -1
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +5 -32
- package/dist/resources/extensions/gsd/auto-dispatch.js +16 -0
- package/dist/resources/extensions/gsd/auto-post-unit.js +104 -86
- package/dist/resources/extensions/gsd/auto-prompts.js +214 -17
- package/dist/resources/extensions/gsd/auto-recovery.js +43 -1
- package/dist/resources/extensions/gsd/auto-start.js +238 -12
- package/dist/resources/extensions/gsd/auto-supervisor.js +8 -1
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +2 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +209 -81
- package/dist/resources/extensions/gsd/auto.js +159 -44
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +99 -10
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +44 -37
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +37 -10
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +30 -20
- package/dist/resources/extensions/gsd/bootstrap/journal-tools.js +4 -1
- package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +6 -4
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +5 -3
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +1 -1
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +319 -54
- package/dist/resources/extensions/gsd/bootstrap/sanitize-complete-milestone.js +4 -0
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +82 -23
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +19 -2
- package/dist/resources/extensions/gsd/clean-root-preflight.js +65 -9
- package/dist/resources/extensions/gsd/commands/dispatcher.js +5 -0
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +2 -2
- package/dist/resources/extensions/gsd/commands-config.js +1 -1
- package/dist/resources/extensions/gsd/commands-eval-review.js +2 -2
- package/dist/resources/extensions/gsd/commands-handlers.js +23 -9
- package/dist/resources/extensions/gsd/context-budget.js +37 -2
- package/dist/resources/extensions/gsd/crash-recovery.js +56 -10
- package/dist/resources/extensions/gsd/dashboard-overlay.js +1 -1
- package/dist/resources/extensions/gsd/db/unit-dispatches.js +92 -0
- package/dist/resources/extensions/gsd/db-base-schema.js +4 -2
- package/dist/resources/extensions/gsd/db-migration-steps.js +6 -0
- package/dist/resources/extensions/gsd/detection.js +106 -0
- package/dist/resources/extensions/gsd/ecosystem/gsd-extension-api.js +2 -0
- package/dist/resources/extensions/gsd/git-service.js +73 -5
- package/dist/resources/extensions/gsd/gsd-db.js +46 -13
- package/dist/resources/extensions/gsd/guided-flow.js +141 -46
- package/dist/resources/extensions/gsd/init-wizard.js +4 -1
- package/dist/resources/extensions/gsd/memory-store.js +69 -12
- package/dist/resources/extensions/gsd/migrate/command.js +40 -1
- package/dist/resources/extensions/gsd/migration-auto-check.js +87 -0
- package/dist/resources/extensions/gsd/native-git-bridge.js +32 -8
- package/dist/resources/extensions/gsd/orphan-stash-audit.js +101 -0
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +13 -3
- package/dist/resources/extensions/gsd/planning-path-scope.js +26 -0
- package/dist/resources/extensions/gsd/pre-execution-checks.js +22 -0
- package/dist/resources/extensions/gsd/prompt-loader.js +28 -2
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +27 -23
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/execute-task.md +4 -2
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +1 -1
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +3 -1
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/quick-task.md +1 -5
- package/dist/resources/extensions/gsd/prompts/replan-slice.md +2 -2
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +2 -2
- package/dist/resources/extensions/gsd/quick.js +34 -2
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +10 -2
- package/dist/resources/extensions/gsd/slice-cadence.js +45 -2
- package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +15 -9
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +6 -7
- package/dist/resources/extensions/gsd/tools/complete-task.js +1 -1
- package/dist/resources/extensions/gsd/tools/context-mode-tool-result.js +15 -0
- package/dist/resources/extensions/gsd/tools/exec-search-tool.js +5 -0
- package/dist/resources/extensions/gsd/tools/exec-tool.js +3 -15
- package/dist/resources/extensions/gsd/tools/memory-tools.js +1 -0
- package/dist/resources/extensions/gsd/tools/plan-slice.js +9 -0
- package/dist/resources/extensions/gsd/tools/plan-task.js +9 -0
- package/dist/resources/extensions/gsd/tools/resume-tool.js +5 -0
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +1 -1
- package/dist/resources/extensions/gsd/unit-context-composer.js +12 -3
- package/dist/resources/extensions/gsd/unit-runtime.js +22 -0
- package/dist/resources/extensions/gsd/workflow-protocol.js +131 -0
- package/dist/resources/extensions/gsd/worktree-manager.js +16 -14
- package/dist/resources/extensions/gsd/worktree-resolver.js +90 -22
- package/dist/resources/skills/web-quality-audit/scripts/analyze.sh +0 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +14 -14
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +2 -2
- package/dist/web/standalone/.next/required-server-files.json +1 -1
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +2 -2
- 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 +2 -2
- 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/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +14 -14
- 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 +3 -3
- 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/8359.e059d86b255fce1c.js +10 -0
- package/dist/web/standalone/.next/static/chunks/app/{page-fab3ebb85b006001.js → page-752f1e2ebdaa3e45.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/{webpack-0481f1221120a7c6.js → webpack-de742b64187e13fe.js} +1 -1
- package/dist/web/standalone/server.js +1 -1
- package/dist/welcome-screen.d.ts +2 -0
- package/dist/welcome-screen.js +9 -7
- package/package.json +3 -3
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +22 -17
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/workflow-tools.test.ts +75 -2
- package/packages/mcp-server/src/workflow-tools.ts +30 -16
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +4 -1
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/dist/agent.d.ts +5 -0
- package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent.js +2 -0
- package/packages/pi-agent-core/dist/agent.js.map +1 -1
- package/packages/pi-agent-core/dist/index.d.ts +1 -0
- package/packages/pi-agent-core/dist/index.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/index.js +2 -0
- package/packages/pi-agent-core/dist/index.js.map +1 -1
- package/packages/pi-agent-core/dist/token-audit.d.ts +47 -0
- package/packages/pi-agent-core/dist/token-audit.d.ts.map +1 -0
- package/packages/pi-agent-core/dist/token-audit.js +221 -0
- package/packages/pi-agent-core/dist/token-audit.js.map +1 -0
- package/packages/pi-agent-core/dist/types.d.ts +9 -0
- package/packages/pi-agent-core/dist/types.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/types.js.map +1 -1
- package/packages/pi-agent-core/src/agent-loop.test.ts +128 -0
- package/packages/pi-agent-core/src/agent-loop.ts +4 -1
- package/packages/pi-agent-core/src/agent.ts +8 -0
- package/packages/pi-agent-core/src/index.ts +2 -0
- package/packages/pi-agent-core/src/token-audit.test.ts +189 -0
- package/packages/pi-agent-core/src/token-audit.ts +287 -0
- package/packages/pi-agent-core/src/types.ts +14 -0
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +35 -13
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js +21 -11
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +7 -0
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +9 -7
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js +23 -14
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js.map +1 -1
- package/packages/pi-ai/dist/types.d.ts +2 -0
- package/packages/pi-ai/dist/types.d.ts.map +1 -1
- package/packages/pi-ai/dist/types.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +48 -21
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js +22 -21
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js +22 -21
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js.map +1 -1
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +39 -25
- package/packages/pi-ai/src/providers/anthropic-bearer-auth.test.ts +26 -22
- package/packages/pi-ai/src/providers/anthropic.ts +22 -9
- package/packages/pi-ai/src/providers/minimax-tool-name.test.ts +34 -21
- package/packages/pi-ai/src/types.ts +3 -0
- package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +56 -22
- package/packages/pi-ai/src/utils/oauth/google-antigravity.test.ts +24 -28
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.test.ts +24 -28
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +32 -0
- 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-tool-refresh.test.js +30 -1
- package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +17 -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 +52 -7
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +6 -2
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +11 -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 +9 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.js +103 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts +15 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.js +66 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.js +24 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +8 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +3 -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 +6 -6
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js +5 -3
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +41 -3
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js +2 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.js +46 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +10 -2
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +81 -4
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +20 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +25 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js +22 -0
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts +6 -7
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +2 -3
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash-spawn-windows.test.js +22 -56
- package/packages/pi-coding-agent/dist/core/tools/bash-spawn-windows.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.js +12 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/find.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/find.js +14 -6
- package/packages/pi-coding-agent/dist/core/tools/find.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/grep.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/grep.js +12 -3
- package/packages/pi-coding-agent/dist/core/tools/grep.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts +2 -1
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.js +1 -0
- package/packages/pi-coding-agent/dist/core/tools/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/ls.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/ls.js +10 -3
- package/packages/pi-coding-agent/dist/core/tools/ls.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/read.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/read.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/read.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js +7 -62
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.js +115 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.d.ts +19 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.js +20 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/write.d.ts +4 -0
- package/packages/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/write.js +9 -1
- package/packages/pi-coding-agent/dist/core/tools/write.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +89 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +25 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +6 -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 +155 -7
- 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 +31 -6
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +71 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +2 -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 +22 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js +28 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js +3 -2
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +36 -0
- package/packages/pi-coding-agent/src/core/agent-session-tool-refresh.test.ts +40 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +59 -7
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +6 -2
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +18 -0
- package/packages/pi-coding-agent/src/core/compaction-threshold.test.ts +121 -0
- package/packages/pi-coding-agent/src/core/db-snapshot.test.ts +32 -0
- package/packages/pi-coding-agent/src/core/db-snapshot.ts +66 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +10 -0
- package/packages/pi-coding-agent/src/core/extensions/runner.test.ts +5 -3
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +8 -5
- package/packages/pi-coding-agent/src/core/extensions/types.ts +44 -2
- package/packages/pi-coding-agent/src/core/hooks-runner.test.ts +2 -0
- package/packages/pi-coding-agent/src/core/sdk-tool-filter.test.ts +60 -0
- package/packages/pi-coding-agent/src/core/sdk.ts +92 -4
- package/packages/pi-coding-agent/src/core/settings-manager.ts +39 -1
- package/packages/pi-coding-agent/src/core/skill-tool.test.ts +28 -0
- package/packages/pi-coding-agent/src/core/system-prompt.ts +8 -10
- package/packages/pi-coding-agent/src/core/tools/bash-spawn-windows.test.ts +22 -66
- package/packages/pi-coding-agent/src/core/tools/bash.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/edit.ts +13 -1
- package/packages/pi-coding-agent/src/core/tools/find.ts +15 -6
- package/packages/pi-coding-agent/src/core/tools/grep.ts +13 -3
- package/packages/pi-coding-agent/src/core/tools/hashline-read.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/index.ts +8 -0
- package/packages/pi-coding-agent/src/core/tools/ls.ts +11 -3
- package/packages/pi-coding-agent/src/core/tools/read.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/spawn-shell-windows.test.ts +11 -72
- package/packages/pi-coding-agent/src/core/tools/tool-target-metadata.test.ts +127 -0
- package/packages/pi-coding-agent/src/core/tools/tool-target.ts +48 -0
- package/packages/pi-coding-agent/src/core/tools/write.ts +14 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +119 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +31 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +180 -7
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +75 -0
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +39 -8
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +24 -0
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage-safety-guard.test.ts +31 -0
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage.ts +3 -2
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +18 -8
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/src/tui.ts +20 -8
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/src/resources/GSD-WORKFLOW.md +2 -2
- package/src/resources/extensions/claude-code-cli/readiness.ts +25 -7
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +42 -3
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +67 -0
- package/src/resources/extensions/github-sync/sync.ts +8 -1
- package/src/resources/extensions/github-sync/tests/sync-source.test.ts +6 -18
- package/src/resources/extensions/gsd/auto/loop-deps.ts +3 -2
- package/src/resources/extensions/gsd/auto/loop.ts +134 -16
- package/src/resources/extensions/gsd/auto/phases.ts +328 -200
- package/src/resources/extensions/gsd/auto/resolve.ts +42 -1
- package/src/resources/extensions/gsd/auto/run-unit.ts +28 -30
- package/src/resources/extensions/gsd/auto/session.ts +8 -0
- package/src/resources/extensions/gsd/auto/workflow-dispatch-claim.ts +63 -1
- package/src/resources/extensions/gsd/auto/workflow-worker-heartbeat.ts +14 -1
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +8 -34
- package/src/resources/extensions/gsd/auto-dispatch.ts +16 -0
- package/src/resources/extensions/gsd/auto-post-unit.ts +117 -88
- package/src/resources/extensions/gsd/auto-prompts.ts +228 -16
- package/src/resources/extensions/gsd/auto-recovery.ts +54 -0
- package/src/resources/extensions/gsd/auto-start.ts +286 -15
- package/src/resources/extensions/gsd/auto-supervisor.ts +7 -0
- package/src/resources/extensions/gsd/auto-timeout-recovery.ts +2 -2
- package/src/resources/extensions/gsd/auto-worktree.ts +241 -72
- package/src/resources/extensions/gsd/auto.ts +208 -39
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +120 -8
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +45 -37
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +36 -10
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +32 -19
- package/src/resources/extensions/gsd/bootstrap/journal-tools.ts +5 -1
- package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +7 -4
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +6 -3
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +1 -1
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +369 -54
- package/src/resources/extensions/gsd/bootstrap/sanitize-complete-milestone.ts +4 -0
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +90 -22
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +19 -2
- package/src/resources/extensions/gsd/clean-root-preflight.ts +72 -9
- package/src/resources/extensions/gsd/commands/dispatcher.ts +6 -0
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +4 -2
- package/src/resources/extensions/gsd/commands-config.ts +1 -1
- package/src/resources/extensions/gsd/commands-eval-review.ts +2 -2
- package/src/resources/extensions/gsd/commands-handlers.ts +34 -15
- package/src/resources/extensions/gsd/context-budget.ts +44 -2
- package/src/resources/extensions/gsd/crash-recovery.ts +67 -10
- package/src/resources/extensions/gsd/dashboard-overlay.ts +1 -1
- package/src/resources/extensions/gsd/db/unit-dispatches.ts +107 -0
- package/src/resources/extensions/gsd/db-base-schema.ts +4 -2
- package/src/resources/extensions/gsd/db-migration-steps.ts +8 -0
- package/src/resources/extensions/gsd/detection.ts +128 -0
- package/src/resources/extensions/gsd/ecosystem/gsd-extension-api.ts +3 -0
- package/src/resources/extensions/gsd/git-service.ts +87 -10
- package/src/resources/extensions/gsd/gsd-db.ts +50 -13
- package/src/resources/extensions/gsd/guided-flow.ts +167 -53
- package/src/resources/extensions/gsd/init-wizard.ts +5 -1
- package/src/resources/extensions/gsd/memory-store.ts +77 -12
- package/src/resources/extensions/gsd/migrate/command.ts +47 -1
- package/src/resources/extensions/gsd/migration-auto-check.ts +129 -0
- package/src/resources/extensions/gsd/native-git-bridge.ts +39 -6
- package/src/resources/extensions/gsd/orphan-stash-audit.ts +117 -0
- package/src/resources/extensions/gsd/parallel-orchestrator.ts +13 -3
- package/src/resources/extensions/gsd/planning-path-scope.ts +35 -0
- package/src/resources/extensions/gsd/pre-execution-checks.ts +23 -0
- package/src/resources/extensions/gsd/preferences-types.ts +1 -1
- package/src/resources/extensions/gsd/prompt-loader.ts +27 -2
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +27 -23
- package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/execute-task.md +4 -2
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +1 -1
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +3 -1
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/quick-task.md +1 -5
- package/src/resources/extensions/gsd/prompts/replan-slice.md +2 -2
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +2 -2
- package/src/resources/extensions/gsd/quick.ts +37 -2
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +11 -2
- package/src/resources/extensions/gsd/slice-cadence.ts +49 -2
- package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +23 -9
- package/src/resources/extensions/gsd/tests/agent-end-retry.test.ts +59 -89
- package/src/resources/extensions/gsd/tests/artifact-retry-cap.test.ts +47 -172
- package/src/resources/extensions/gsd/tests/artifacts-table-preserved-on-cache-invalidate.test.ts +0 -35
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +35 -9
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +433 -11
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +80 -59
- package/src/resources/extensions/gsd/tests/auto-paused-session-validation.test.ts +3 -47
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +76 -18
- package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +160 -11
- package/src/resources/extensions/gsd/tests/auto-pr-bugs.test.ts +54 -95
- package/src/resources/extensions/gsd/tests/auto-project-root-env.test.ts +67 -26
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +14 -1
- package/src/resources/extensions/gsd/tests/auto-remediate-slice-status.test.ts +32 -30
- package/src/resources/extensions/gsd/tests/auto-start-bootstrap-await-3420.test.ts +32 -128
- package/src/resources/extensions/gsd/tests/auto-start-clean-runtime-db-gated.test.ts +20 -54
- package/src/resources/extensions/gsd/tests/auto-start-cold-db-bootstrap.test.ts +20 -30
- package/src/resources/extensions/gsd/tests/auto-start-index-lock.test.ts +17 -29
- package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +138 -0
- package/src/resources/extensions/gsd/tests/auto-start-time-persistence.test.ts +21 -39
- package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +15 -24
- package/src/resources/extensions/gsd/tests/auto-thinking-restore.test.ts +44 -29
- package/src/resources/extensions/gsd/tests/auto-warning-noise-regression.test.ts +39 -51
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +159 -213
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +15 -32
- package/src/resources/extensions/gsd/tests/browser-teardown.test.ts +0 -41
- package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +97 -2
- package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +34 -27
- package/src/resources/extensions/gsd/tests/cmux.test.ts +51 -53
- package/src/resources/extensions/gsd/tests/cold-resume-db-reopen.test.ts +39 -61
- package/src/resources/extensions/gsd/tests/commands-config.test.ts +26 -19
- package/src/resources/extensions/gsd/tests/compaction-snapshot.test.ts +14 -1
- package/src/resources/extensions/gsd/tests/complete-milestone-excerpt.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/complete-slice-composer.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/complete-task-normalize-lists.test.ts +29 -33
- package/src/resources/extensions/gsd/tests/completed-units-metrics-sync.test.ts +45 -108
- package/src/resources/extensions/gsd/tests/context-budget.test.ts +10 -1
- package/src/resources/extensions/gsd/tests/context-store.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/crash-handler-secondary.test.ts +90 -31
- package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +5 -1
- package/src/resources/extensions/gsd/tests/cwd-fallback-hardening.test.ts +138 -0
- package/src/resources/extensions/gsd/tests/dashboard-custom-engine.test.ts +4 -68
- package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +4 -9
- package/src/resources/extensions/gsd/tests/deferred-milestone-dir-4996.test.ts +14 -65
- package/src/resources/extensions/gsd/tests/detection.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/discuss-tool-scoping.test.ts +44 -37
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +58 -40
- package/src/resources/extensions/gsd/tests/dispatch-guard-closed-status.test.ts +25 -15
- package/src/resources/extensions/gsd/tests/dispatch-rule-coverage.test.ts +313 -0
- package/src/resources/extensions/gsd/tests/dispatcher-stuck-planning.test.ts +35 -17
- package/src/resources/extensions/gsd/tests/error-success-mask.test.ts +16 -21
- package/src/resources/extensions/gsd/tests/est-annotation-timeout.test.ts +15 -82
- package/src/resources/extensions/gsd/tests/exec-history.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/exec-sandbox.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/execute-task-rendering.test.ts +5 -2
- package/src/resources/extensions/gsd/tests/fast-forward-reused-milestone-branch.test.ts +219 -0
- package/src/resources/extensions/gsd/tests/finalize-survivor-branch.test.ts +132 -0
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +2 -20
- package/src/resources/extensions/gsd/tests/frontmatter-parse-noise.test.ts +18 -26
- package/src/resources/extensions/gsd/tests/init-skip-git.test.ts +9 -12
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/integration/commands-eval-review.integration.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/integration/git-locale.test.ts +31 -20
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/integration/milestone-transition-worktree.test.ts +0 -47
- package/src/resources/extensions/gsd/tests/interactive-routing-bypass.test.ts +60 -202
- package/src/resources/extensions/gsd/tests/isolation-none-branch-guard.test.ts +13 -56
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +239 -1
- package/src/resources/extensions/gsd/tests/journal-query-tool.test.ts +32 -0
- package/src/resources/extensions/gsd/tests/knowledge.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/lazy-pi-tui-import.test.ts +44 -6
- package/src/resources/extensions/gsd/tests/memory-decay-factor.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +21 -35
- package/src/resources/extensions/gsd/tests/merge-conflict-stops-loop.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +127 -0
- package/src/resources/extensions/gsd/tests/milestone-merge-stash-restore.test.ts +242 -0
- package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +79 -98
- package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +70 -278
- package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +34 -2
- package/src/resources/extensions/gsd/tests/needs-remediation-revalidation.test.ts +37 -30
- package/src/resources/extensions/gsd/tests/note-captures-executed.test.ts +32 -28
- package/src/resources/extensions/gsd/tests/originalbase-path-comparison.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/orphan-merge-bootstrap.test.ts +133 -0
- package/src/resources/extensions/gsd/tests/orphan-stash-audit.test.ts +201 -0
- package/src/resources/extensions/gsd/tests/parallel-orchestrator-fast-forward.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/phantom-ghost-detection.test.ts +24 -37
- package/src/resources/extensions/gsd/tests/phantom-milestone-default-queued.test.ts +9 -24
- package/src/resources/extensions/gsd/tests/phases-merge-error-stops-auto.test.ts +91 -75
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +50 -0
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +36 -22
- package/src/resources/extensions/gsd/tests/pre-exec-backtick-strip.test.ts +36 -30
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +45 -5
- package/src/resources/extensions/gsd/tests/pre-execution-pause-wiring.test.ts +74 -4
- package/src/resources/extensions/gsd/tests/preferences-worktree-sync.test.ts +20 -22
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +130 -32
- package/src/resources/extensions/gsd/tests/project-root-cwd-crash.test.ts +18 -36
- package/src/resources/extensions/gsd/tests/projection-no-plan-overwrite.test.ts +35 -73
- package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +76 -138
- package/src/resources/extensions/gsd/tests/prompt-duplication-cuts.test.ts +230 -0
- package/src/resources/extensions/gsd/tests/prompt-path-audit.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +70 -106
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +59 -161
- package/src/resources/extensions/gsd/tests/query-tools-db-open.test.ts +33 -29
- package/src/resources/extensions/gsd/tests/queue-auto-guard.test.ts +22 -196
- package/src/resources/extensions/gsd/tests/quick-auto-guard.test.ts +23 -93
- package/src/resources/extensions/gsd/tests/quick-external-gsd.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/quick-turn-end-cleanup.test.ts +50 -79
- package/src/resources/extensions/gsd/tests/reassess-default-optin.test.ts +27 -13
- package/src/resources/extensions/gsd/tests/remote-questions.test.ts +151 -251
- package/src/resources/extensions/gsd/tests/resource-loader-import-path.test.ts +41 -29
- package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +58 -69
- package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +32 -164
- package/src/resources/extensions/gsd/tests/right-sized-workflow-prompts.test.ts +192 -0
- package/src/resources/extensions/gsd/tests/run-uat-replay-cap.test.ts +57 -41
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +29 -0
- package/src/resources/extensions/gsd/tests/schema-v27-v28-sequence.test.ts +156 -0
- package/src/resources/extensions/gsd/tests/select-resumable-milestone.test.ts +96 -0
- package/src/resources/extensions/gsd/tests/session-model-override.test.ts +14 -9
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +77 -0
- package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +166 -0
- package/src/resources/extensions/gsd/tests/show-config-command.test.ts +44 -42
- package/src/resources/extensions/gsd/tests/signal-handlers.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/skip-slice-state-rebuild.test.ts +56 -24
- package/src/resources/extensions/gsd/tests/skipped-validation-db-atomicity.test.ts +51 -11
- package/src/resources/extensions/gsd/tests/slice-cadence.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/slice-context-injection.test.ts +66 -50
- package/src/resources/extensions/gsd/tests/slice-parallel-orchestrator.test.ts +68 -107
- package/src/resources/extensions/gsd/tests/slice-sequence-insert.test.ts +115 -42
- package/src/resources/extensions/gsd/tests/smart-entry-complete.test.ts +21 -59
- package/src/resources/extensions/gsd/tests/smart-entry-draft.test.ts +25 -116
- package/src/resources/extensions/gsd/tests/sqlite-unavailable-gate.test.ts +21 -57
- package/src/resources/extensions/gsd/tests/stale-dirlistcache-4648.test.ts +29 -76
- package/src/resources/extensions/gsd/tests/stale-lockfile-recovery.test.ts +33 -24
- package/src/resources/extensions/gsd/tests/stale-slice-rows.test.ts +39 -30
- package/src/resources/extensions/gsd/tests/stalled-tool-recovery.test.ts +49 -1
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/status-db-open.test.ts +35 -40
- package/src/resources/extensions/gsd/tests/stop-auto-merge-back.test.ts +48 -46
- package/src/resources/extensions/gsd/tests/stop-auto-race-null-unit.test.ts +14 -102
- package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +78 -232
- package/src/resources/extensions/gsd/tests/sync-worktree-skip-current.test.ts +32 -35
- package/src/resources/extensions/gsd/tests/system-context-memory.test.ts +112 -0
- package/src/resources/extensions/gsd/tests/system-context-message-routing.test.ts +7 -9
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +84 -309
- package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +291 -0
- package/src/resources/extensions/gsd/tests/triage-dispatch.test.ts +134 -341
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +136 -4
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +8 -25
- package/src/resources/extensions/gsd/tests/unit-dispatches.test.ts +80 -1
- package/src/resources/extensions/gsd/tests/unit-runtime.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/unstructured-continue-context-injection.test.ts +5 -99
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +43 -36
- package/src/resources/extensions/gsd/tests/visualizer-data.test.ts +84 -444
- package/src/resources/extensions/gsd/tests/workflow-dispatch-claim.test.ts +142 -0
- package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +44 -189
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +2 -57
- package/src/resources/extensions/gsd/tests/workflow-protocol-excerpt.test.ts +99 -0
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/workflow-worker-heartbeat.test.ts +32 -1
- package/src/resources/extensions/gsd/tests/worktree-db-same-file.test.ts +21 -44
- package/src/resources/extensions/gsd/tests/worktree-expected-warnings.test.ts +27 -26
- package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +38 -6
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/worktree-main-branch.test.ts +20 -18
- package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/worktree-nested-git-safety.test.ts +9 -2
- package/src/resources/extensions/gsd/tests/worktree-path-injection.test.ts +22 -19
- package/src/resources/extensions/gsd/tests/worktree-project-root-degrade.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +203 -4
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +40 -1
- package/src/resources/extensions/gsd/tests/zero-slice-roadmap-guided.test.ts +19 -13
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +14 -15
- package/src/resources/extensions/gsd/tools/complete-task.ts +1 -1
- package/src/resources/extensions/gsd/tools/context-mode-tool-result.ts +25 -0
- package/src/resources/extensions/gsd/tools/exec-search-tool.ts +7 -7
- package/src/resources/extensions/gsd/tools/exec-tool.ts +4 -23
- package/src/resources/extensions/gsd/tools/memory-tools.ts +1 -0
- package/src/resources/extensions/gsd/tools/plan-slice.ts +13 -0
- package/src/resources/extensions/gsd/tools/plan-task.ts +10 -0
- package/src/resources/extensions/gsd/tools/resume-tool.ts +7 -7
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +1 -1
- package/src/resources/extensions/gsd/unit-context-composer.ts +19 -4
- package/src/resources/extensions/gsd/unit-runtime.ts +25 -0
- package/src/resources/extensions/gsd/workflow-protocol.ts +160 -0
- package/src/resources/extensions/gsd/worktree-manager.ts +15 -4
- package/src/resources/extensions/gsd/worktree-resolver.ts +119 -20
- package/src/resources/skills/create-gsd-extension/templates/templates.test.ts +86 -40
- package/src/resources/skills/web-quality-audit/scripts/analyze.sh +0 -0
- package/dist/web/standalone/.next/static/chunks/8336.631939fb583761fa.js +0 -10
- /package/dist/web/standalone/.next/static/{vIAZSyxIuvqNkCvXt9oqb → Y9yOOsO4ZA5BPTOS8ixvP}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{vIAZSyxIuvqNkCvXt9oqb → Y9yOOsO4ZA5BPTOS8ixvP}/_ssgManifest.js +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { Type } from "@sinclair/typebox";
|
|
4
4
|
import { Text } from "@gsd/pi-tui";
|
|
5
5
|
import { loadEffectiveGSDPreferences } from "../preferences.js";
|
|
6
|
-
import { ensureDbOpen } from "./dynamic-tools.js";
|
|
6
|
+
import { ensureDbOpen, resolveCtxCwd } from "./dynamic-tools.js";
|
|
7
7
|
import { loadWriteGateSnapshot, shouldBlockRootArtifactSaveInSnapshot } from "./write-gate.js";
|
|
8
8
|
import { StringEnum } from "@gsd/pi-ai";
|
|
9
9
|
import { logError } from "../workflow-logger.js";
|
|
@@ -31,8 +31,8 @@ function registerAlias(pi, toolDef, aliasName, canonicalName) {
|
|
|
31
31
|
execute,
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
function requirementRootWriteGuard(operation) {
|
|
35
|
-
const guard = shouldBlockRootArtifactSaveInSnapshot(loadWriteGateSnapshot(
|
|
34
|
+
function requirementRootWriteGuard(operation, basePath) {
|
|
35
|
+
const guard = shouldBlockRootArtifactSaveInSnapshot(loadWriteGateSnapshot(basePath), "REQUIREMENTS");
|
|
36
36
|
if (!guard.block)
|
|
37
37
|
return null;
|
|
38
38
|
return {
|
|
@@ -56,7 +56,8 @@ function readDetails(result) {
|
|
|
56
56
|
export function registerDbTools(pi) {
|
|
57
57
|
// ─── gsd_decision_save (formerly gsd_save_decision) ─────────────────────
|
|
58
58
|
const decisionSaveExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
59
|
-
const
|
|
59
|
+
const basePath = resolveCtxCwd(_ctx);
|
|
60
|
+
const dbAvailable = await ensureDbOpen(basePath);
|
|
60
61
|
if (!dbAvailable) {
|
|
61
62
|
return {
|
|
62
63
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot save decision." }],
|
|
@@ -73,7 +74,7 @@ export function registerDbTools(pi) {
|
|
|
73
74
|
revisable: params.revisable,
|
|
74
75
|
when_context: params.when_context,
|
|
75
76
|
made_by: params.made_by,
|
|
76
|
-
},
|
|
77
|
+
}, basePath);
|
|
77
78
|
return {
|
|
78
79
|
content: [{ type: "text", text: `Saved decision ${id}` }],
|
|
79
80
|
details: { operation: "save_decision", id },
|
|
@@ -140,10 +141,11 @@ export function registerDbTools(pi) {
|
|
|
140
141
|
registerAlias(pi, decisionSaveTool, "gsd_save_decision", "gsd_decision_save");
|
|
141
142
|
// ─── gsd_requirement_update (formerly gsd_update_requirement) ───────────
|
|
142
143
|
const requirementUpdateExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
143
|
-
const
|
|
144
|
+
const basePath = resolveCtxCwd(_ctx);
|
|
145
|
+
const gateBlock = requirementRootWriteGuard("update_requirement", basePath);
|
|
144
146
|
if (gateBlock)
|
|
145
147
|
return gateBlock;
|
|
146
|
-
const dbAvailable = await ensureDbOpen();
|
|
148
|
+
const dbAvailable = await ensureDbOpen(basePath);
|
|
147
149
|
if (!dbAvailable) {
|
|
148
150
|
return {
|
|
149
151
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot update requirement." }],
|
|
@@ -165,7 +167,7 @@ export function registerDbTools(pi) {
|
|
|
165
167
|
updates.primary_owner = params.primary_owner;
|
|
166
168
|
if (params.supporting_slices !== undefined)
|
|
167
169
|
updates.supporting_slices = params.supporting_slices;
|
|
168
|
-
await updateRequirementInDb(params.id, updates,
|
|
170
|
+
await updateRequirementInDb(params.id, updates, basePath);
|
|
169
171
|
return {
|
|
170
172
|
content: [{ type: "text", text: `Updated requirement ${params.id}` }],
|
|
171
173
|
details: { operation: "update_requirement", id: params.id },
|
|
@@ -225,10 +227,11 @@ export function registerDbTools(pi) {
|
|
|
225
227
|
registerAlias(pi, requirementUpdateTool, "gsd_update_requirement", "gsd_requirement_update");
|
|
226
228
|
// ─── gsd_requirement_save ─────────────────────────────────────────────
|
|
227
229
|
const requirementSaveExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
228
|
-
const
|
|
230
|
+
const basePath = resolveCtxCwd(_ctx);
|
|
231
|
+
const gateBlock = requirementRootWriteGuard("save_requirement", basePath);
|
|
229
232
|
if (gateBlock)
|
|
230
233
|
return gateBlock;
|
|
231
|
-
const dbAvailable = await ensureDbOpen();
|
|
234
|
+
const dbAvailable = await ensureDbOpen(basePath);
|
|
232
235
|
if (!dbAvailable) {
|
|
233
236
|
return {
|
|
234
237
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot save requirement." }],
|
|
@@ -247,7 +250,7 @@ export function registerDbTools(pi) {
|
|
|
247
250
|
supporting_slices: params.supporting_slices,
|
|
248
251
|
validation: params.validation,
|
|
249
252
|
notes: params.notes,
|
|
250
|
-
},
|
|
253
|
+
}, basePath);
|
|
251
254
|
return {
|
|
252
255
|
content: [{ type: "text", text: `Saved requirement ${result.id}` }],
|
|
253
256
|
details: { operation: "save_requirement", id: result.id },
|
|
@@ -324,7 +327,7 @@ export function registerDbTools(pi) {
|
|
|
324
327
|
// ─── gsd_summary_save (formerly gsd_save_summary) ──────────────────────
|
|
325
328
|
const summarySaveExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
326
329
|
const { executeSummarySave } = await loadWorkflowExecutors();
|
|
327
|
-
return executeSummarySave(params,
|
|
330
|
+
return executeSummarySave(params, resolveCtxCwd(_ctx));
|
|
328
331
|
};
|
|
329
332
|
const summarySaveTool = {
|
|
330
333
|
name: "gsd_summary_save",
|
|
@@ -373,23 +376,23 @@ export function registerDbTools(pi) {
|
|
|
373
376
|
// ─── gsd_milestone_generate_id (formerly gsd_generate_milestone_id) ────
|
|
374
377
|
const milestoneGenerateIdExecute = async (_toolCallId, _params, _signal, _onUpdate, _ctx) => {
|
|
375
378
|
try {
|
|
379
|
+
const basePath = resolveCtxCwd(_ctx);
|
|
376
380
|
// Claim a reserved ID if the guided-flow already previewed one to the user.
|
|
377
381
|
// This guarantees the ID shown in the UI matches the one materialised on disk.
|
|
378
382
|
const { claimReservedId, findMilestoneIds, getReservedMilestoneIds, nextMilestoneId } = await import("../guided-flow.js");
|
|
379
383
|
const reserved = claimReservedId();
|
|
380
384
|
if (reserved) {
|
|
381
|
-
await ensureMilestoneDbRow(reserved);
|
|
385
|
+
await ensureMilestoneDbRow(reserved, basePath);
|
|
382
386
|
return {
|
|
383
387
|
content: [{ type: "text", text: reserved }],
|
|
384
388
|
details: { operation: "generate_milestone_id", id: reserved, source: "reserved" },
|
|
385
389
|
};
|
|
386
390
|
}
|
|
387
|
-
const basePath = process.cwd();
|
|
388
391
|
const existingIds = findMilestoneIds(basePath);
|
|
389
|
-
const uniqueEnabled = !!loadEffectiveGSDPreferences()?.preferences?.unique_milestone_ids;
|
|
392
|
+
const uniqueEnabled = !!loadEffectiveGSDPreferences(basePath)?.preferences?.unique_milestone_ids;
|
|
390
393
|
const allIds = [...new Set([...existingIds, ...getReservedMilestoneIds()])];
|
|
391
394
|
const newId = nextMilestoneId(allIds, uniqueEnabled);
|
|
392
|
-
await ensureMilestoneDbRow(newId);
|
|
395
|
+
await ensureMilestoneDbRow(newId, basePath);
|
|
393
396
|
return {
|
|
394
397
|
content: [{ type: "text", text: newId }],
|
|
395
398
|
details: { operation: "generate_milestone_id", id: newId, existingCount: existingIds.length, uniqueEnabled },
|
|
@@ -409,8 +412,8 @@ export function registerDbTools(pi) {
|
|
|
409
412
|
* later writes the full row. Silently skips if the DB isn't available yet
|
|
410
413
|
* (pre-migration).
|
|
411
414
|
*/
|
|
412
|
-
async function ensureMilestoneDbRow(milestoneId) {
|
|
413
|
-
const dbAvailable = await ensureDbOpen();
|
|
415
|
+
async function ensureMilestoneDbRow(milestoneId, basePath) {
|
|
416
|
+
const dbAvailable = await ensureDbOpen(basePath);
|
|
414
417
|
if (!dbAvailable)
|
|
415
418
|
return;
|
|
416
419
|
try {
|
|
@@ -455,7 +458,7 @@ export function registerDbTools(pi) {
|
|
|
455
458
|
// ─── gsd_plan_milestone (gsd_milestone_plan alias) ─────────────────────
|
|
456
459
|
const planMilestoneExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
457
460
|
const { executePlanMilestone } = await loadWorkflowExecutors();
|
|
458
|
-
return executePlanMilestone(params,
|
|
461
|
+
return executePlanMilestone(params, resolveCtxCwd(_ctx));
|
|
459
462
|
};
|
|
460
463
|
const planMilestoneTool = {
|
|
461
464
|
name: "gsd_plan_milestone",
|
|
@@ -520,7 +523,7 @@ export function registerDbTools(pi) {
|
|
|
520
523
|
// ─── gsd_plan_slice (gsd_slice_plan alias) ─────────────────────────────
|
|
521
524
|
const planSliceExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
522
525
|
const { executePlanSlice } = await loadWorkflowExecutors();
|
|
523
|
-
return executePlanSlice(params,
|
|
526
|
+
return executePlanSlice(params, resolveCtxCwd(_ctx));
|
|
524
527
|
};
|
|
525
528
|
const planSliceTool = {
|
|
526
529
|
name: "gsd_plan_slice",
|
|
@@ -564,7 +567,8 @@ export function registerDbTools(pi) {
|
|
|
564
567
|
registerAlias(pi, planSliceTool, "gsd_slice_plan", "gsd_plan_slice");
|
|
565
568
|
// ─── gsd_plan_task (gsd_task_plan alias) ───────────────────────────────
|
|
566
569
|
const planTaskExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
567
|
-
const
|
|
570
|
+
const basePath = resolveCtxCwd(_ctx);
|
|
571
|
+
const dbAvailable = await ensureDbOpen(basePath);
|
|
568
572
|
if (!dbAvailable) {
|
|
569
573
|
return {
|
|
570
574
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot plan task." }],
|
|
@@ -573,7 +577,7 @@ export function registerDbTools(pi) {
|
|
|
573
577
|
}
|
|
574
578
|
try {
|
|
575
579
|
const { handlePlanTask } = await import("../tools/plan-task.js");
|
|
576
|
-
const result = await handlePlanTask(params,
|
|
580
|
+
const result = await handlePlanTask(params, basePath);
|
|
577
581
|
if ("error" in result) {
|
|
578
582
|
return {
|
|
579
583
|
content: [{ type: "text", text: `Error planning task: ${result.error}` }],
|
|
@@ -634,7 +638,7 @@ export function registerDbTools(pi) {
|
|
|
634
638
|
// ─── gsd_task_complete (gsd_complete_task alias) ────────────────────────
|
|
635
639
|
const taskCompleteExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
636
640
|
const { executeTaskComplete } = await loadWorkflowExecutors();
|
|
637
|
-
return executeTaskComplete(params,
|
|
641
|
+
return executeTaskComplete(params, resolveCtxCwd(_ctx));
|
|
638
642
|
};
|
|
639
643
|
const taskCompleteTool = {
|
|
640
644
|
name: "gsd_task_complete",
|
|
@@ -697,7 +701,7 @@ export function registerDbTools(pi) {
|
|
|
697
701
|
// ─── gsd_slice_complete (gsd_complete_slice alias) ─────────────────────
|
|
698
702
|
const sliceCompleteExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
699
703
|
const { executeSliceComplete } = await loadWorkflowExecutors();
|
|
700
|
-
return executeSliceComplete(params,
|
|
704
|
+
return executeSliceComplete(params, resolveCtxCwd(_ctx));
|
|
701
705
|
};
|
|
702
706
|
const sliceCompleteTool = {
|
|
703
707
|
name: "gsd_slice_complete",
|
|
@@ -777,7 +781,8 @@ export function registerDbTools(pi) {
|
|
|
777
781
|
registerAlias(pi, sliceCompleteTool, "gsd_complete_slice", "gsd_slice_complete");
|
|
778
782
|
// ─── gsd_skip_slice (#3477 / #3487) ───────────────────────────────────
|
|
779
783
|
const skipSliceExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
780
|
-
const
|
|
784
|
+
const basePath = resolveCtxCwd(_ctx);
|
|
785
|
+
const dbAvailable = await ensureDbOpen(basePath);
|
|
781
786
|
if (!dbAvailable) {
|
|
782
787
|
return {
|
|
783
788
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot skip slice." }],
|
|
@@ -806,7 +811,6 @@ export function registerDbTools(pi) {
|
|
|
806
811
|
// Rebuild STATE.md so it reflects the skip immediately (#3477).
|
|
807
812
|
// Without this, /gsd auto reads stale STATE.md and resumes the skipped slice.
|
|
808
813
|
try {
|
|
809
|
-
const basePath = process.cwd();
|
|
810
814
|
const { rebuildState } = await import("../doctor.js");
|
|
811
815
|
await rebuildState(basePath);
|
|
812
816
|
}
|
|
@@ -862,7 +866,7 @@ export function registerDbTools(pi) {
|
|
|
862
866
|
// ─── gsd_complete_milestone ────────────────────────────────────────────
|
|
863
867
|
const milestoneCompleteExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
864
868
|
const { executeCompleteMilestone } = await loadWorkflowExecutors();
|
|
865
|
-
return executeCompleteMilestone(params,
|
|
869
|
+
return executeCompleteMilestone(params, resolveCtxCwd(_ctx));
|
|
866
870
|
};
|
|
867
871
|
const milestoneCompleteTool = {
|
|
868
872
|
name: "gsd_complete_milestone",
|
|
@@ -903,7 +907,7 @@ export function registerDbTools(pi) {
|
|
|
903
907
|
// ─── gsd_validate_milestone (gsd_milestone_validate alias) ─────────────
|
|
904
908
|
const milestoneValidateExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
905
909
|
const { executeValidateMilestone } = await loadWorkflowExecutors();
|
|
906
|
-
return executeValidateMilestone(params,
|
|
910
|
+
return executeValidateMilestone(params, resolveCtxCwd(_ctx));
|
|
907
911
|
};
|
|
908
912
|
const milestoneValidateTool = {
|
|
909
913
|
name: "gsd_validate_milestone",
|
|
@@ -936,7 +940,7 @@ export function registerDbTools(pi) {
|
|
|
936
940
|
// ─── gsd_replan_slice (gsd_slice_replan alias) ─────────────────────────
|
|
937
941
|
const replanSliceExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
938
942
|
const { executeReplanSlice } = await loadWorkflowExecutors();
|
|
939
|
-
return executeReplanSlice(params,
|
|
943
|
+
return executeReplanSlice(params, resolveCtxCwd(_ctx));
|
|
940
944
|
};
|
|
941
945
|
const replanSliceTool = {
|
|
942
946
|
name: "gsd_replan_slice",
|
|
@@ -979,7 +983,7 @@ export function registerDbTools(pi) {
|
|
|
979
983
|
// ─── gsd_reassess_roadmap (gsd_roadmap_reassess alias) ─────────────────
|
|
980
984
|
const reassessRoadmapExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
981
985
|
const { executeReassessRoadmap } = await loadWorkflowExecutors();
|
|
982
|
-
return executeReassessRoadmap(params,
|
|
986
|
+
return executeReassessRoadmap(params, resolveCtxCwd(_ctx));
|
|
983
987
|
};
|
|
984
988
|
const reassessRoadmapTool = {
|
|
985
989
|
name: "gsd_reassess_roadmap",
|
|
@@ -1027,7 +1031,8 @@ export function registerDbTools(pi) {
|
|
|
1027
1031
|
// ─── gsd_task_reopen (gsd_reopen_task alias) ───────────────────────────
|
|
1028
1032
|
// Single-writer v3, Stream 3: reversibility tools for closed units.
|
|
1029
1033
|
const reopenTaskExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
1030
|
-
const
|
|
1034
|
+
const basePath = resolveCtxCwd(_ctx);
|
|
1035
|
+
const dbAvailable = await ensureDbOpen(basePath);
|
|
1031
1036
|
if (!dbAvailable) {
|
|
1032
1037
|
return {
|
|
1033
1038
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot reopen task." }],
|
|
@@ -1036,7 +1041,7 @@ export function registerDbTools(pi) {
|
|
|
1036
1041
|
}
|
|
1037
1042
|
try {
|
|
1038
1043
|
const { handleReopenTask } = await import("../tools/reopen-task.js");
|
|
1039
|
-
const result = await handleReopenTask(params,
|
|
1044
|
+
const result = await handleReopenTask(params, basePath);
|
|
1040
1045
|
if ("error" in result) {
|
|
1041
1046
|
return {
|
|
1042
1047
|
content: [{ type: "text", text: `Error reopening task: ${result.error}` }],
|
|
@@ -1089,7 +1094,8 @@ export function registerDbTools(pi) {
|
|
|
1089
1094
|
registerAlias(pi, reopenTaskTool, "gsd_reopen_task", "gsd_task_reopen");
|
|
1090
1095
|
// ─── gsd_slice_reopen (gsd_reopen_slice alias) ─────────────────────────
|
|
1091
1096
|
const reopenSliceExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
1092
|
-
const
|
|
1097
|
+
const basePath = resolveCtxCwd(_ctx);
|
|
1098
|
+
const dbAvailable = await ensureDbOpen(basePath);
|
|
1093
1099
|
if (!dbAvailable) {
|
|
1094
1100
|
return {
|
|
1095
1101
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot reopen slice." }],
|
|
@@ -1098,7 +1104,7 @@ export function registerDbTools(pi) {
|
|
|
1098
1104
|
}
|
|
1099
1105
|
try {
|
|
1100
1106
|
const { handleReopenSlice } = await import("../tools/reopen-slice.js");
|
|
1101
|
-
const result = await handleReopenSlice(params,
|
|
1107
|
+
const result = await handleReopenSlice(params, basePath);
|
|
1102
1108
|
if ("error" in result) {
|
|
1103
1109
|
return {
|
|
1104
1110
|
content: [{ type: "text", text: `Error reopening slice: ${result.error}` }],
|
|
@@ -1151,7 +1157,8 @@ export function registerDbTools(pi) {
|
|
|
1151
1157
|
registerAlias(pi, reopenSliceTool, "gsd_reopen_slice", "gsd_slice_reopen");
|
|
1152
1158
|
// ─── gsd_milestone_reopen (gsd_reopen_milestone alias) ─────────────────
|
|
1153
1159
|
const reopenMilestoneExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
1154
|
-
const
|
|
1160
|
+
const basePath = resolveCtxCwd(_ctx);
|
|
1161
|
+
const dbAvailable = await ensureDbOpen(basePath);
|
|
1155
1162
|
if (!dbAvailable) {
|
|
1156
1163
|
return {
|
|
1157
1164
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot reopen milestone." }],
|
|
@@ -1160,7 +1167,7 @@ export function registerDbTools(pi) {
|
|
|
1160
1167
|
}
|
|
1161
1168
|
try {
|
|
1162
1169
|
const { handleReopenMilestone } = await import("../tools/reopen-milestone.js");
|
|
1163
|
-
const result = await handleReopenMilestone(params,
|
|
1170
|
+
const result = await handleReopenMilestone(params, basePath);
|
|
1164
1171
|
if ("error" in result) {
|
|
1165
1172
|
return {
|
|
1166
1173
|
content: [{ type: "text", text: `Error reopening milestone: ${result.error}` }],
|
|
@@ -1212,7 +1219,7 @@ export function registerDbTools(pi) {
|
|
|
1212
1219
|
// ─── gsd_save_gate_result ──────────────────────────────────────────────
|
|
1213
1220
|
const saveGateResultExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
1214
1221
|
const { executeSaveGateResult } = await loadWorkflowExecutors();
|
|
1215
|
-
return executeSaveGateResult(params,
|
|
1222
|
+
return executeSaveGateResult(params, resolveCtxCwd(_ctx));
|
|
1216
1223
|
};
|
|
1217
1224
|
const saveGateResultTool = {
|
|
1218
1225
|
name: "gsd_save_gate_result",
|
|
@@ -1,9 +1,31 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Registers workspace-aware dynamic filesystem and shell tools.
|
|
1
3
|
import { existsSync } from "node:fs";
|
|
4
|
+
import { homedir } from "node:os";
|
|
2
5
|
import { dirname } from "node:path";
|
|
3
6
|
import { createBashTool, createEditTool, createReadTool, createWriteTool } from "@gsd/pi-coding-agent";
|
|
4
7
|
import { DEFAULT_BASH_TIMEOUT_SECS } from "../constants.js";
|
|
5
8
|
import { setLogBasePath, logWarning } from "../workflow-logger.js";
|
|
6
9
|
import { resolveGsdPathContract } from "../paths.js";
|
|
10
|
+
export function safeWorkspaceCwd() {
|
|
11
|
+
try {
|
|
12
|
+
return process.cwd();
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
const projectRoot = process.env.GSD_PROJECT_ROOT;
|
|
16
|
+
if (projectRoot && existsSync(projectRoot))
|
|
17
|
+
return projectRoot;
|
|
18
|
+
return homedir();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function resolveCtxCwd(ctx) {
|
|
22
|
+
if (ctx && typeof ctx === "object" && typeof ctx.cwd === "string") {
|
|
23
|
+
const cwd = ctx.cwd;
|
|
24
|
+
if (existsSync(cwd))
|
|
25
|
+
return cwd;
|
|
26
|
+
}
|
|
27
|
+
return safeWorkspaceCwd();
|
|
28
|
+
}
|
|
7
29
|
/**
|
|
8
30
|
* Resolve the correct DB path for the current working directory.
|
|
9
31
|
* If `basePath` is inside a `.gsd/worktrees/<MID>/` directory, returns
|
|
@@ -13,7 +35,7 @@ import { resolveGsdPathContract } from "../paths.js";
|
|
|
13
35
|
export function resolveProjectRootDbPath(basePath) {
|
|
14
36
|
return resolveGsdPathContract(basePath).projectDb;
|
|
15
37
|
}
|
|
16
|
-
export async function ensureDbOpen(basePath =
|
|
38
|
+
export async function ensureDbOpen(basePath = safeWorkspaceCwd()) {
|
|
17
39
|
try {
|
|
18
40
|
const db = await import("../gsd-db.js");
|
|
19
41
|
const contract = resolveGsdPathContract(basePath);
|
|
@@ -44,41 +66,46 @@ export async function ensureDbOpen(basePath = process.cwd()) {
|
|
|
44
66
|
}
|
|
45
67
|
}
|
|
46
68
|
export function registerDynamicTools(pi) {
|
|
47
|
-
const
|
|
48
|
-
|
|
69
|
+
const fallbackRoot = safeWorkspaceCwd();
|
|
70
|
+
const baseBash = createBashTool(fallbackRoot, {
|
|
71
|
+
spawnHook: (ctx) => ctx,
|
|
49
72
|
});
|
|
50
73
|
const dynamicBash = {
|
|
51
74
|
...baseBash,
|
|
52
75
|
execute: async (toolCallId, params, signal, onUpdate, ctx) => {
|
|
76
|
+
const basePath = resolveCtxCwd(ctx);
|
|
77
|
+
const fresh = createBashTool(basePath, {
|
|
78
|
+
spawnHook: (spawnCtx) => ({ ...spawnCtx, cwd: basePath }),
|
|
79
|
+
});
|
|
53
80
|
const paramsWithTimeout = {
|
|
54
81
|
...params,
|
|
55
82
|
timeout: params.timeout ?? DEFAULT_BASH_TIMEOUT_SECS,
|
|
56
83
|
};
|
|
57
|
-
return
|
|
84
|
+
return fresh.execute(toolCallId, paramsWithTimeout, signal, onUpdate, ctx);
|
|
58
85
|
},
|
|
59
86
|
};
|
|
60
87
|
pi.registerTool(dynamicBash);
|
|
61
|
-
const baseWrite = createWriteTool(
|
|
88
|
+
const baseWrite = createWriteTool(fallbackRoot);
|
|
62
89
|
pi.registerTool({
|
|
63
90
|
...baseWrite,
|
|
64
91
|
execute: async (toolCallId, params, signal, onUpdate, ctx) => {
|
|
65
|
-
const fresh = createWriteTool(
|
|
92
|
+
const fresh = createWriteTool(resolveCtxCwd(ctx));
|
|
66
93
|
return fresh.execute(toolCallId, params, signal, onUpdate, ctx);
|
|
67
94
|
},
|
|
68
95
|
});
|
|
69
|
-
const baseRead = createReadTool(
|
|
96
|
+
const baseRead = createReadTool(fallbackRoot);
|
|
70
97
|
pi.registerTool({
|
|
71
98
|
...baseRead,
|
|
72
99
|
execute: async (toolCallId, params, signal, onUpdate, ctx) => {
|
|
73
|
-
const fresh = createReadTool(
|
|
100
|
+
const fresh = createReadTool(resolveCtxCwd(ctx));
|
|
74
101
|
return fresh.execute(toolCallId, params, signal, onUpdate, ctx);
|
|
75
102
|
},
|
|
76
103
|
});
|
|
77
|
-
const baseEdit = createEditTool(
|
|
104
|
+
const baseEdit = createEditTool(fallbackRoot);
|
|
78
105
|
pi.registerTool({
|
|
79
106
|
...baseEdit,
|
|
80
107
|
execute: async (toolCallId, params, signal, onUpdate, ctx) => {
|
|
81
|
-
const fresh = createEditTool(
|
|
108
|
+
const fresh = createEditTool(resolveCtxCwd(ctx));
|
|
82
109
|
return fresh.execute(toolCallId, params, signal, onUpdate, ctx);
|
|
83
110
|
},
|
|
84
111
|
});
|
|
@@ -1,23 +1,39 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Registers Context Mode execution tools.
|
|
1
3
|
// GSD2 — Exec (context-mode) tool registration.
|
|
2
4
|
//
|
|
3
5
|
// Exposes the Context Mode runtime tools in-process. Default-on; opt out with
|
|
4
6
|
// `context_mode.enabled: false` in preferences.
|
|
5
7
|
import { Type } from "@sinclair/typebox";
|
|
8
|
+
import { resolveCtxCwd } from "./dynamic-tools.js";
|
|
9
|
+
async function loadContextModePreferences(baseDir) {
|
|
10
|
+
const [{ loadEffectiveGSDPreferences }, { logWarning }] = await Promise.all([
|
|
11
|
+
import("../preferences.js"),
|
|
12
|
+
import("../workflow-logger.js"),
|
|
13
|
+
]);
|
|
14
|
+
try {
|
|
15
|
+
return loadEffectiveGSDPreferences(baseDir)?.preferences ?? null;
|
|
16
|
+
}
|
|
17
|
+
catch (err) {
|
|
18
|
+
logWarning("tool", `Context Mode tool could not load preferences: ${err instanceof Error ? err.message : String(err)}`);
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
6
22
|
export function registerExecTools(pi) {
|
|
7
23
|
pi.registerTool({
|
|
8
24
|
name: "gsd_exec",
|
|
9
25
|
label: "Exec (Sandboxed)",
|
|
10
|
-
description: "Run a short script (bash/node/python) in a subprocess.
|
|
26
|
+
description: "Run a short script (bash/node/python) in a subprocess. Capped stdout/stderr and metadata persist to " +
|
|
11
27
|
".gsd/exec/<id>.{stdout,stderr,meta.json}; only a short digest returns in context. Use " +
|
|
12
28
|
"this instead of reading many files or emitting large tool outputs — e.g. have the script " +
|
|
13
29
|
"count/grep/summarize and log the finding. Enabled by default; opt out via " +
|
|
14
30
|
"preferences.context_mode.enabled=false.",
|
|
15
|
-
promptSnippet: "Run a bash/node/python script in a sandbox;
|
|
31
|
+
promptSnippet: "Run a bash/node/python script in a sandbox; capped output is saved to disk and only a digest returns",
|
|
16
32
|
promptGuidelines: [
|
|
17
33
|
"Prefer gsd_exec for analyses that would otherwise read >3 files or produce large tool output.",
|
|
18
34
|
"Write scripts that log the finding (counts, matches, summaries) rather than raw dumps.",
|
|
19
35
|
"The digest is the last ~300 chars of stdout — size your log output accordingly.",
|
|
20
|
-
"Need
|
|
36
|
+
"Need persisted output? Read the stdout_path returned in details (file on local disk).",
|
|
21
37
|
],
|
|
22
38
|
parameters: Type.Object({
|
|
23
39
|
runtime: Type.Union([Type.Literal("bash"), Type.Literal("node"), Type.Literal("python")], { description: "Interpreter: bash (-c), node (-e), or python3 (-c)." }),
|
|
@@ -30,21 +46,11 @@ export function registerExecTools(pi) {
|
|
|
30
46
|
})),
|
|
31
47
|
}),
|
|
32
48
|
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
import("../preferences.js"),
|
|
36
|
-
import("../workflow-logger.js"),
|
|
37
|
-
]);
|
|
38
|
-
let prefs = null;
|
|
39
|
-
try {
|
|
40
|
-
prefs = loadEffectiveGSDPreferences();
|
|
41
|
-
}
|
|
42
|
-
catch (err) {
|
|
43
|
-
logWarning("tool", `gsd_exec could not load preferences: ${err instanceof Error ? err.message : String(err)}`);
|
|
44
|
-
}
|
|
49
|
+
const { executeGsdExec } = await import("../tools/exec-tool.js");
|
|
50
|
+
const baseDir = resolveCtxCwd(_ctx);
|
|
45
51
|
return executeGsdExec(params, {
|
|
46
|
-
baseDir
|
|
47
|
-
preferences:
|
|
52
|
+
baseDir,
|
|
53
|
+
preferences: await loadContextModePreferences(baseDir),
|
|
48
54
|
});
|
|
49
55
|
},
|
|
50
56
|
});
|
|
@@ -56,7 +62,7 @@ export function registerExecTools(pi) {
|
|
|
56
62
|
promptSnippet: "Search prior gsd_exec runs by substring, runtime, or failing-only filter",
|
|
57
63
|
promptGuidelines: [
|
|
58
64
|
"Use this before re-running an expensive analysis — the prior run's stdout file may still answer.",
|
|
59
|
-
"The preview shows the trailing ~300 chars of stdout; read stdout_path for
|
|
65
|
+
"The preview shows the trailing ~300 chars of stdout; read stdout_path for persisted output.",
|
|
60
66
|
],
|
|
61
67
|
parameters: Type.Object({
|
|
62
68
|
query: Type.Optional(Type.String({ description: "Substring matched against id and purpose (case-insensitive)." })),
|
|
@@ -68,8 +74,10 @@ export function registerExecTools(pi) {
|
|
|
68
74
|
}),
|
|
69
75
|
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
70
76
|
const { executeExecSearch } = await import("../tools/exec-search-tool.js");
|
|
77
|
+
const baseDir = resolveCtxCwd(_ctx);
|
|
71
78
|
return executeExecSearch(params, {
|
|
72
|
-
baseDir
|
|
79
|
+
baseDir,
|
|
80
|
+
preferences: await loadContextModePreferences(baseDir),
|
|
73
81
|
});
|
|
74
82
|
},
|
|
75
83
|
});
|
|
@@ -87,8 +95,10 @@ export function registerExecTools(pi) {
|
|
|
87
95
|
parameters: Type.Object({}),
|
|
88
96
|
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
89
97
|
const { executeResume } = await import("../tools/resume-tool.js");
|
|
98
|
+
const baseDir = resolveCtxCwd(_ctx);
|
|
90
99
|
return executeResume(params, {
|
|
91
|
-
baseDir
|
|
100
|
+
baseDir,
|
|
101
|
+
preferences: await loadContextModePreferences(baseDir),
|
|
92
102
|
});
|
|
93
103
|
},
|
|
94
104
|
});
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Registers journal query tools.
|
|
1
3
|
import { Type } from "@sinclair/typebox";
|
|
2
4
|
import { queryJournal } from "../journal.js";
|
|
3
5
|
import { logWarning } from "../workflow-logger.js";
|
|
6
|
+
import { resolveCtxCwd } from "./dynamic-tools.js";
|
|
4
7
|
export function registerJournalTools(pi) {
|
|
5
8
|
pi.registerTool({
|
|
6
9
|
name: "gsd_journal_query",
|
|
@@ -37,7 +40,7 @@ export function registerJournalTools(pi) {
|
|
|
37
40
|
filters.after = params.after;
|
|
38
41
|
if (params.before !== undefined)
|
|
39
42
|
filters.before = params.before;
|
|
40
|
-
const entries = queryJournal(
|
|
43
|
+
const entries = queryJournal(resolveCtxCwd(_ctx), filters);
|
|
41
44
|
const limited = entries.slice(0, params.limit ?? 100);
|
|
42
45
|
if (limited.length === 0) {
|
|
43
46
|
return {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Registers memory-layer tools.
|
|
1
3
|
// GSD2 — Memory tool registration
|
|
2
4
|
//
|
|
3
5
|
// Exposes the memory-layer tools (capture_thought, memory_query, gsd_graph)
|
|
4
6
|
// to the LLM over MCP. All three degrade gracefully when the GSD database
|
|
5
7
|
// is unavailable.
|
|
6
8
|
import { Type } from "@sinclair/typebox";
|
|
7
|
-
import { ensureDbOpen } from "./dynamic-tools.js";
|
|
9
|
+
import { ensureDbOpen, resolveCtxCwd } from "./dynamic-tools.js";
|
|
8
10
|
import { executeGsdGraph, executeMemoryCapture, executeMemoryQuery, } from "../tools/memory-tools.js";
|
|
9
11
|
export function registerMemoryTools(pi) {
|
|
10
12
|
// ─── capture_thought ────────────────────────────────────────────────────
|
|
@@ -39,7 +41,7 @@ export function registerMemoryTools(pi) {
|
|
|
39
41
|
})),
|
|
40
42
|
}),
|
|
41
43
|
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
42
|
-
const ok = await ensureDbOpen();
|
|
44
|
+
const ok = await ensureDbOpen(resolveCtxCwd(_ctx));
|
|
43
45
|
if (!ok) {
|
|
44
46
|
return {
|
|
45
47
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot capture memory." }],
|
|
@@ -79,7 +81,7 @@ export function registerMemoryTools(pi) {
|
|
|
79
81
|
reinforce_hits: Type.Optional(Type.Boolean({ description: "Increment hit_count on returned memories (default false)" })),
|
|
80
82
|
}),
|
|
81
83
|
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
82
|
-
const ok = await ensureDbOpen();
|
|
84
|
+
const ok = await ensureDbOpen(resolveCtxCwd(_ctx));
|
|
83
85
|
if (!ok) {
|
|
84
86
|
return {
|
|
85
87
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot query memory." }],
|
|
@@ -117,7 +119,7 @@ export function registerMemoryTools(pi) {
|
|
|
117
119
|
], { description: "Only include edges with this relation type" })),
|
|
118
120
|
}),
|
|
119
121
|
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
120
|
-
const ok = await ensureDbOpen();
|
|
122
|
+
const ok = await ensureDbOpen(resolveCtxCwd(_ctx));
|
|
121
123
|
if (!ok) {
|
|
122
124
|
return {
|
|
123
125
|
content: [{ type: "text", text: "Error: GSD database is not available." }],
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Registers read-only DB query tools.
|
|
1
3
|
// GSD2 — Read-only query tools exposing DB state to the LLM via the WAL connection
|
|
2
4
|
import { Type } from "@sinclair/typebox";
|
|
3
|
-
import { ensureDbOpen } from "./dynamic-tools.js";
|
|
5
|
+
import { ensureDbOpen, resolveCtxCwd } from "./dynamic-tools.js";
|
|
4
6
|
export function registerQueryTools(pi) {
|
|
5
7
|
pi.registerTool({
|
|
6
8
|
name: "gsd_milestone_status",
|
|
@@ -16,7 +18,7 @@ export function registerQueryTools(pi) {
|
|
|
16
18
|
milestoneId: Type.String({ description: "Milestone ID to query (e.g. M001)" }),
|
|
17
19
|
}),
|
|
18
20
|
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
19
|
-
const dbAvailable = await ensureDbOpen();
|
|
21
|
+
const dbAvailable = await ensureDbOpen(resolveCtxCwd(_ctx));
|
|
20
22
|
if (!dbAvailable) {
|
|
21
23
|
return {
|
|
22
24
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot read milestone status." }],
|
|
@@ -41,7 +43,7 @@ export function registerQueryTools(pi) {
|
|
|
41
43
|
],
|
|
42
44
|
parameters: Type.Object({}),
|
|
43
45
|
async execute(_toolCallId, _params, _signal, _onUpdate, _ctx) {
|
|
44
|
-
const dbAvailable = await ensureDbOpen();
|
|
46
|
+
const dbAvailable = await ensureDbOpen(resolveCtxCwd(_ctx));
|
|
45
47
|
if (!dbAvailable) {
|
|
46
48
|
return {
|
|
47
49
|
content: [{ type: "text", text: "Error: GSD database is not available. Cannot checkpoint." }],
|
|
@@ -36,7 +36,7 @@ export function handleRecoverableExtensionProcessError(err) {
|
|
|
36
36
|
}
|
|
37
37
|
return false;
|
|
38
38
|
}
|
|
39
|
-
function installEpipeGuard() {
|
|
39
|
+
export function installEpipeGuard() {
|
|
40
40
|
if (!process.listeners("uncaughtException").some((listener) => listener.name === "_gsdEpipeGuard")) {
|
|
41
41
|
const _gsdEpipeGuard = (err) => {
|
|
42
42
|
if (handleRecoverableExtensionProcessError(err))
|