gsd-pi 2.58.0-dev.778d6ac → 2.58.0-dev.d63175c
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 +1 -1
- package/dist/cli.js +35 -49
- package/dist/headless-ui.d.ts +0 -17
- package/dist/headless-ui.js +3 -97
- package/dist/headless.js +6 -67
- package/dist/help-text.js +0 -1
- package/dist/onboarding.js +0 -44
- package/dist/resource-loader.js +1 -16
- package/dist/resources/agents/researcher.md +1 -1
- package/dist/resources/extensions/ask-user-questions.js +3 -16
- package/dist/resources/extensions/async-jobs/extension-manifest.json +1 -1
- package/dist/resources/extensions/bg-shell/extension-manifest.json +1 -1
- package/dist/resources/extensions/browser-tools/extension-manifest.json +1 -1
- package/dist/resources/extensions/claude-code-cli/partial-builder.js +6 -14
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +36 -59
- package/dist/resources/extensions/context7/extension-manifest.json +1 -1
- package/dist/resources/extensions/get-secrets-from-user.js +5 -8
- package/dist/resources/extensions/google-search/extension-manifest.json +1 -1
- package/dist/resources/extensions/google-search/index.js +1 -2
- package/dist/resources/extensions/gsd/auto/phases.js +21 -25
- package/dist/resources/extensions/gsd/auto-artifact-paths.js +2 -2
- package/dist/resources/extensions/gsd/auto-dashboard.js +20 -37
- package/dist/resources/extensions/gsd/auto-dispatch.js +2 -17
- package/dist/resources/extensions/gsd/auto-model-selection.js +3 -26
- package/dist/resources/extensions/gsd/auto-post-unit.js +4 -16
- package/dist/resources/extensions/gsd/auto-prompts.js +1 -1
- package/dist/resources/extensions/gsd/auto-recovery.js +5 -13
- package/dist/resources/extensions/gsd/auto-start.js +22 -35
- package/dist/resources/extensions/gsd/auto-worktree.js +12 -196
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +0 -32
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +8 -80
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +1 -32
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +18 -33
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +11 -44
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +0 -67
- package/dist/resources/extensions/gsd/captures.js +4 -56
- package/dist/resources/extensions/gsd/db-writer.js +8 -116
- package/dist/resources/extensions/gsd/doctor-git-checks.js +0 -28
- package/dist/resources/extensions/gsd/doctor-providers.js +1 -2
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +4 -5
- package/dist/resources/extensions/gsd/doctor.js +1 -3
- package/dist/resources/extensions/gsd/error-classifier.js +10 -13
- package/dist/resources/extensions/gsd/extension-manifest.json +1 -16
- package/dist/resources/extensions/gsd/forensics.js +20 -123
- package/dist/resources/extensions/gsd/git-service.js +1 -23
- package/dist/resources/extensions/gsd/gitignore.js +0 -33
- package/dist/resources/extensions/gsd/gsd-db.js +9 -36
- package/dist/resources/extensions/gsd/guided-flow.js +44 -106
- package/dist/resources/extensions/gsd/health-widget-core.js +0 -31
- package/dist/resources/extensions/gsd/health-widget.js +0 -17
- package/dist/resources/extensions/gsd/index.js +1 -1
- package/dist/resources/extensions/gsd/memory-extractor.js +0 -7
- package/dist/resources/extensions/gsd/migrate-external.js +1 -8
- package/dist/resources/extensions/gsd/model-cost-table.js +0 -18
- package/dist/resources/extensions/gsd/model-router.js +1 -35
- package/dist/resources/extensions/gsd/native-git-bridge.js +0 -17
- package/dist/resources/extensions/gsd/notifications.js +1 -16
- package/dist/resources/extensions/gsd/parallel-eligibility.js +2 -13
- package/dist/resources/extensions/gsd/parallel-merge.js +5 -78
- package/dist/resources/extensions/gsd/parsers-legacy.js +3 -20
- package/dist/resources/extensions/gsd/paths.js +0 -43
- package/dist/resources/extensions/gsd/preferences-models.js +1 -14
- package/dist/resources/extensions/gsd/preferences-types.js +1 -2
- package/dist/resources/extensions/gsd/preferences.js +16 -13
- package/dist/resources/extensions/gsd/prompt-loader.js +1 -4
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +2 -4
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +1 -1
- package/dist/resources/extensions/gsd/prompts/discuss.md +1 -1
- package/dist/resources/extensions/gsd/prompts/execute-task.md +1 -3
- package/dist/resources/extensions/gsd/prompts/forensics.md +2 -2
- package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +0 -2
- package/dist/resources/extensions/gsd/prompts/rethink.md +1 -1
- package/dist/resources/extensions/gsd/prompts/triage-captures.md +0 -1
- package/dist/resources/extensions/gsd/repo-identity.js +11 -205
- package/dist/resources/extensions/gsd/rethink.js +0 -5
- package/dist/resources/extensions/gsd/roadmap-slices.js +4 -5
- package/dist/resources/extensions/gsd/state.js +27 -85
- package/dist/resources/extensions/gsd/tests/dist-redirect.mjs +1 -20
- package/dist/resources/extensions/gsd/tools/complete-task.js +71 -34
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +2 -12
- package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +1 -29
- package/dist/resources/extensions/gsd/tools/validate-milestone.js +3 -14
- package/dist/resources/extensions/gsd/triage-resolution.js +7 -22
- package/dist/resources/extensions/gsd/undo.js +2 -2
- package/dist/resources/extensions/gsd/unit-ownership.js +33 -164
- package/dist/resources/extensions/gsd/verdict-parser.js +8 -20
- package/dist/resources/extensions/gsd/workflow-manifest.js +5 -24
- package/dist/resources/extensions/gsd/workflow-projections.js +63 -95
- package/dist/resources/extensions/gsd/workflow-reconcile.js +5 -35
- package/dist/resources/extensions/gsd/workspace-index.js +0 -24
- package/dist/resources/extensions/gsd/worktree-manager.js +1 -105
- package/dist/resources/extensions/gsd/worktree-resolver.js +3 -20
- package/dist/resources/extensions/mcp-client/index.js +7 -11
- package/dist/resources/extensions/search-the-web/extension-manifest.json +1 -1
- package/dist/resources/extensions/shared/interview-ui.js +1 -11
- package/dist/resources/skills/create-gsd-extension/SKILL.md +3 -5
- package/dist/resources/skills/create-gsd-extension/references/key-rules-gotchas.md +4 -5
- package/dist/resources/skills/create-gsd-extension/workflows/add-capability.md +2 -2
- package/dist/resources/skills/create-gsd-extension/workflows/create-extension.md +4 -4
- package/dist/resources/skills/create-gsd-extension/workflows/debug-extension.md +3 -5
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +17 -17
- 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/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 +2 -2
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +2 -2
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +2 -2
- 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 +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 +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +17 -17
- package/dist/web/standalone/.next/server/chunks/2229.js +2 -2
- 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/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +2 -2
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/6502.8b732f67a11b11b4.js +9 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-a1c1e452c6b32d04.js → webpack-61d3afac6d0f0ce7.js} +1 -1
- package/dist/web/standalone/.next/static/css/a58ef8a151aa0493.css +1 -0
- package/dist/web/standalone/server.js +1 -1
- package/dist/web-mode.js +1 -2
- package/package.json +2 -2
- package/packages/native/dist/ast/index.js +5 -9
- package/packages/native/dist/ast/types.js +1 -2
- package/packages/native/dist/clipboard/index.js +7 -12
- package/packages/native/dist/clipboard/types.js +1 -2
- package/packages/native/dist/diff/index.js +7 -12
- package/packages/native/dist/diff/types.js +1 -2
- package/packages/native/dist/fd/index.js +3 -6
- package/packages/native/dist/fd/types.js +1 -2
- package/packages/native/dist/glob/index.js +5 -9
- package/packages/native/dist/glob/types.js +1 -2
- package/packages/native/dist/grep/index.js +5 -9
- package/packages/native/dist/grep/types.js +1 -2
- package/packages/native/dist/gsd-parser/index.js +11 -18
- package/packages/native/dist/gsd-parser/types.js +1 -2
- package/packages/native/dist/highlight/index.js +7 -12
- package/packages/native/dist/highlight/types.js +1 -2
- package/packages/native/dist/html/index.js +3 -6
- package/packages/native/dist/html/types.js +1 -2
- package/packages/native/dist/image/index.js +5 -10
- package/packages/native/dist/image/types.js +4 -7
- package/packages/native/dist/index.js +17 -70
- package/packages/native/dist/json-parse/index.js +8 -13
- package/packages/native/dist/native.js +10 -47
- package/packages/native/dist/ps/index.js +9 -15
- package/packages/native/dist/ps/types.js +1 -2
- package/packages/native/dist/stream-process/index.js +7 -12
- package/packages/native/dist/text/index.js +14 -24
- package/packages/native/dist/text/types.js +2 -5
- package/packages/native/dist/truncate/index.js +7 -12
- package/packages/native/dist/ttsr/index.js +7 -12
- package/packages/native/dist/ttsr/types.js +1 -2
- package/packages/native/dist/xxhash/index.js +5 -9
- package/packages/native/package.json +19 -19
- package/packages/native/src/native.ts +8 -9
- package/packages/pi-agent-core/dist/agent-loop.js +2 -3
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/dist/proxy.d.ts +1 -1
- package/packages/pi-agent-core/dist/proxy.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/proxy.js.map +1 -1
- package/packages/pi-agent-core/src/agent-loop.ts +2 -3
- package/packages/pi-agent-core/src/proxy.ts +1 -1
- package/packages/pi-ai/dist/env-api-keys.js +0 -1
- package/packages/pi-ai/dist/env-api-keys.js.map +1 -1
- package/packages/pi-ai/dist/index.d.ts +0 -1
- package/packages/pi-ai/dist/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/index.js +0 -1
- package/packages/pi-ai/dist/index.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 +2 -19
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/types.d.ts +3 -3
- 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/json-parse.d.ts +0 -3
- package/packages/pi-ai/dist/utils/json-parse.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/json-parse.js +1 -24
- package/packages/pi-ai/dist/utils/json-parse.js.map +1 -1
- package/packages/pi-ai/src/env-api-keys.ts +0 -1
- package/packages/pi-ai/src/index.ts +0 -1
- package/packages/pi-ai/src/providers/anthropic-shared.ts +2 -17
- package/packages/pi-ai/src/types.ts +2 -3
- package/packages/pi-ai/src/utils/json-parse.ts +1 -28
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +0 -4
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +0 -31
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +1 -17
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js +2 -62
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/exec.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/exec.js +1 -3
- package/packages/pi-coding-agent/dist/core/exec.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +0 -4
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js +0 -2
- package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +0 -5
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +0 -5
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/index.js +1 -1
- package/packages/pi-coding-agent/dist/core/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/index.js +0 -3
- package/packages/pi-coding-agent/dist/core/lsp/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.js +0 -3
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/messages.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/messages.js +2 -31
- package/packages/pi-coding-agent/dist/core/messages.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js +0 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.d.ts +0 -10
- package/packages/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.js +1 -12
- package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +0 -6
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js +1 -48
- package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
- 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 -10
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/read.js +4 -13
- package/packages/pi-coding-agent/dist/core/tools/read.js.map +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts +2 -2
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +0 -4
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/remote-terminal.d.ts +0 -1
- package/packages/pi-coding-agent/dist/modes/rpc/remote-terminal.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/remote-terminal.js +0 -5
- package/packages/pi-coding-agent/dist/modes/rpc/remote-terminal.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +1 -38
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +1 -94
- package/packages/pi-coding-agent/src/core/exec.ts +1 -3
- package/packages/pi-coding-agent/src/core/extensions/index.ts +0 -4
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +0 -5
- package/packages/pi-coding-agent/src/core/index.ts +0 -6
- package/packages/pi-coding-agent/src/core/lsp/index.ts +0 -3
- package/packages/pi-coding-agent/src/core/lsp/lspmux.ts +0 -3
- package/packages/pi-coding-agent/src/core/messages.ts +2 -29
- package/packages/pi-coding-agent/src/core/model-resolver.ts +0 -1
- package/packages/pi-coding-agent/src/core/resource-loader.ts +1 -20
- package/packages/pi-coding-agent/src/core/retry-handler.ts +1 -52
- package/packages/pi-coding-agent/src/core/tools/hashline-read.ts +3 -11
- package/packages/pi-coding-agent/src/core/tools/read.ts +4 -14
- package/packages/pi-coding-agent/src/index.ts +0 -6
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +0 -7
- package/packages/pi-coding-agent/src/modes/rpc/remote-terminal.ts +0 -6
- package/packages/pi-tui/dist/terminal.d.ts +0 -2
- package/packages/pi-tui/dist/terminal.d.ts.map +1 -1
- package/packages/pi-tui/dist/terminal.js +0 -9
- package/packages/pi-tui/dist/terminal.js.map +1 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +0 -9
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/src/terminal.ts +0 -14
- package/packages/pi-tui/src/tui.ts +0 -8
- package/scripts/ensure-workspace-builds.cjs +14 -45
- package/src/resources/agents/researcher.md +1 -1
- package/src/resources/extensions/ask-user-questions.ts +3 -21
- package/src/resources/extensions/async-jobs/extension-manifest.json +1 -1
- package/src/resources/extensions/bg-shell/extension-manifest.json +1 -1
- package/src/resources/extensions/browser-tools/extension-manifest.json +1 -1
- package/src/resources/extensions/claude-code-cli/partial-builder.ts +6 -13
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +35 -63
- package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +0 -28
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +1 -108
- package/src/resources/extensions/context7/extension-manifest.json +1 -1
- package/src/resources/extensions/get-secrets-from-user.ts +5 -8
- package/src/resources/extensions/google-search/extension-manifest.json +1 -1
- package/src/resources/extensions/google-search/index.ts +1 -2
- package/src/resources/extensions/gsd/auto/loop-deps.ts +0 -1
- package/src/resources/extensions/gsd/auto/phases.ts +34 -43
- package/src/resources/extensions/gsd/auto-artifact-paths.ts +2 -2
- package/src/resources/extensions/gsd/auto-dashboard.ts +19 -37
- package/src/resources/extensions/gsd/auto-dispatch.ts +2 -18
- package/src/resources/extensions/gsd/auto-model-selection.ts +5 -26
- package/src/resources/extensions/gsd/auto-post-unit.ts +4 -18
- package/src/resources/extensions/gsd/auto-prompts.ts +1 -1
- package/src/resources/extensions/gsd/auto-recovery.ts +5 -12
- package/src/resources/extensions/gsd/auto-start.ts +26 -35
- package/src/resources/extensions/gsd/auto-worktree.ts +9 -190
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +0 -31
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +8 -85
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +1 -38
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +19 -31
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +11 -50
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +0 -75
- package/src/resources/extensions/gsd/captures.ts +3 -63
- package/src/resources/extensions/gsd/db-writer.ts +7 -140
- package/src/resources/extensions/gsd/doctor-git-checks.ts +0 -26
- package/src/resources/extensions/gsd/doctor-providers.ts +1 -2
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +4 -5
- package/src/resources/extensions/gsd/doctor.ts +1 -3
- package/src/resources/extensions/gsd/error-classifier.ts +11 -14
- package/src/resources/extensions/gsd/extension-manifest.json +1 -16
- package/src/resources/extensions/gsd/forensics.ts +20 -144
- package/src/resources/extensions/gsd/git-service.ts +3 -26
- package/src/resources/extensions/gsd/gitignore.ts +0 -33
- package/src/resources/extensions/gsd/gsd-db.ts +7 -43
- package/src/resources/extensions/gsd/guided-flow.ts +45 -114
- package/src/resources/extensions/gsd/health-widget-core.ts +0 -34
- package/src/resources/extensions/gsd/health-widget.ts +0 -17
- package/src/resources/extensions/gsd/index.ts +0 -1
- package/src/resources/extensions/gsd/memory-extractor.ts +0 -8
- package/src/resources/extensions/gsd/migrate-external.ts +1 -9
- package/src/resources/extensions/gsd/model-cost-table.ts +0 -19
- package/src/resources/extensions/gsd/model-router.ts +1 -35
- package/src/resources/extensions/gsd/native-git-bridge.ts +0 -17
- package/src/resources/extensions/gsd/notifications.ts +0 -16
- package/src/resources/extensions/gsd/parallel-eligibility.ts +2 -15
- package/src/resources/extensions/gsd/parallel-merge.ts +4 -87
- package/src/resources/extensions/gsd/parsers-legacy.ts +3 -22
- package/src/resources/extensions/gsd/paths.ts +0 -42
- package/src/resources/extensions/gsd/preferences-models.ts +1 -14
- package/src/resources/extensions/gsd/preferences-types.ts +1 -2
- package/src/resources/extensions/gsd/preferences.ts +15 -13
- package/src/resources/extensions/gsd/prompt-loader.ts +1 -4
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/complete-slice.md +2 -4
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +1 -1
- package/src/resources/extensions/gsd/prompts/discuss.md +1 -1
- package/src/resources/extensions/gsd/prompts/execute-task.md +1 -3
- package/src/resources/extensions/gsd/prompts/forensics.md +2 -2
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/plan-slice.md +0 -2
- package/src/resources/extensions/gsd/prompts/rethink.md +1 -1
- package/src/resources/extensions/gsd/prompts/triage-captures.md +0 -1
- package/src/resources/extensions/gsd/repo-identity.ts +11 -186
- package/src/resources/extensions/gsd/rethink.ts +0 -6
- package/src/resources/extensions/gsd/roadmap-slices.ts +4 -5
- package/src/resources/extensions/gsd/state.ts +32 -84
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +0 -29
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +1 -71
- package/src/resources/extensions/gsd/tests/captures.test.ts +0 -103
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +0 -27
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +0 -21
- package/src/resources/extensions/gsd/tests/db-writer.test.ts +12 -7
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +5 -78
- package/src/resources/extensions/gsd/tests/derive-state.test.ts +0 -29
- package/src/resources/extensions/gsd/tests/discuss-queued-milestones.test.ts +0 -40
- package/src/resources/extensions/gsd/tests/dist-redirect.mjs +1 -20
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +0 -117
- package/src/resources/extensions/gsd/tests/empty-db-reconciliation.test.ts +79 -0
- package/src/resources/extensions/gsd/tests/forensics-dedup.test.ts +0 -31
- package/src/resources/extensions/gsd/tests/gsd-tools.test.ts +12 -125
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +0 -67
- package/src/resources/extensions/gsd/tests/integration/auto-recovery.test.ts +1 -111
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +0 -101
- package/src/resources/extensions/gsd/tests/integration/auto-worktree.test.ts +0 -59
- package/src/resources/extensions/gsd/tests/integration/parallel-merge.test.ts +0 -110
- package/src/resources/extensions/gsd/tests/integration/run-uat.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/memory-extractor.test.ts +2 -85
- package/src/resources/extensions/gsd/tests/model-cost-table.test.ts +0 -34
- package/src/resources/extensions/gsd/tests/model-router.test.ts +3 -68
- package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +0 -28
- package/src/resources/extensions/gsd/tests/notifications.test.ts +0 -45
- package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +1 -33
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +0 -29
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +0 -38
- package/src/resources/extensions/gsd/tests/reassess-handler.test.ts +0 -117
- package/src/resources/extensions/gsd/tests/roadmap-slices.test.ts +0 -97
- package/src/resources/extensions/gsd/tests/secure-env-collect.test.ts +0 -134
- package/src/resources/extensions/gsd/tests/tool-naming.test.ts +1 -2
- package/src/resources/extensions/gsd/tests/triage-resolution.test.ts +0 -8
- package/src/resources/extensions/gsd/tests/unit-ownership.test.ts +17 -100
- package/src/resources/extensions/gsd/tests/validate-milestone-write-order.test.ts +1 -4
- package/src/resources/extensions/gsd/tests/workflow-logger.test.ts +0 -48
- package/src/resources/extensions/gsd/tests/workflow-manifest.test.ts +0 -92
- package/src/resources/extensions/gsd/tests/workflow-projections.test.ts +2 -4
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +1 -48
- package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +5 -29
- package/src/resources/extensions/gsd/tools/complete-task.ts +74 -36
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +1 -13
- package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +0 -36
- package/src/resources/extensions/gsd/tools/validate-milestone.ts +2 -20
- package/src/resources/extensions/gsd/triage-resolution.ts +6 -23
- package/src/resources/extensions/gsd/types.ts +2 -4
- package/src/resources/extensions/gsd/undo.ts +2 -2
- package/src/resources/extensions/gsd/unit-ownership.ts +35 -206
- package/src/resources/extensions/gsd/verdict-parser.ts +6 -21
- package/src/resources/extensions/gsd/workflow-logger.ts +1 -3
- package/src/resources/extensions/gsd/workflow-manifest.ts +5 -22
- package/src/resources/extensions/gsd/workflow-projections.ts +64 -97
- package/src/resources/extensions/gsd/workflow-reconcile.ts +10 -39
- package/src/resources/extensions/gsd/workspace-index.ts +0 -30
- package/src/resources/extensions/gsd/worktree-manager.ts +1 -120
- package/src/resources/extensions/gsd/worktree-resolver.ts +3 -22
- package/src/resources/extensions/mcp-client/index.ts +7 -13
- package/src/resources/extensions/search-the-web/extension-manifest.json +1 -1
- package/src/resources/extensions/shared/interview-ui.ts +1 -12
- package/src/resources/skills/create-gsd-extension/SKILL.md +3 -5
- package/src/resources/skills/create-gsd-extension/references/key-rules-gotchas.md +4 -5
- package/src/resources/skills/create-gsd-extension/workflows/add-capability.md +2 -2
- package/src/resources/skills/create-gsd-extension/workflows/create-extension.md +4 -4
- package/src/resources/skills/create-gsd-extension/workflows/debug-extension.md +3 -5
- package/dist/resources/extensions/gsd/milestone-validation-gates.js +0 -45
- package/dist/resources/extensions/ollama/index.js +0 -112
- package/dist/resources/extensions/ollama/model-capabilities.js +0 -115
- package/dist/resources/extensions/ollama/ollama-client.js +0 -168
- package/dist/resources/extensions/ollama/ollama-commands.js +0 -194
- package/dist/resources/extensions/ollama/ollama-discovery.js +0 -69
- package/dist/resources/extensions/ollama/ollama-tool.js +0 -184
- package/dist/resources/extensions/ollama/types.js +0 -2
- package/dist/startup-model-validation.d.ts +0 -39
- package/dist/startup-model-validation.js +0 -50
- package/dist/web/standalone/.next/static/chunks/6502.7593d7797a4b3999.js +0 -9
- package/dist/web/standalone/.next/static/css/f6e8833d46e738d8.css +0 -1
- package/packages/native/src/__tests__/module-compat.test.mjs +0 -91
- package/packages/pi-agent-core/src/agent-loop.test.ts +0 -45
- package/packages/pi-ai/dist/providers/anthropic-shared.test.d.ts +0 -2
- package/packages/pi-ai/dist/providers/anthropic-shared.test.d.ts.map +0 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js +0 -25
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +0 -1
- package/packages/pi-ai/dist/utils/repair-tool-json.d.ts +0 -37
- package/packages/pi-ai/dist/utils/repair-tool-json.d.ts.map +0 -1
- package/packages/pi-ai/dist/utils/repair-tool-json.js +0 -75
- package/packages/pi-ai/dist/utils/repair-tool-json.js.map +0 -1
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.d.ts +0 -2
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.d.ts.map +0 -1
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.js +0 -73
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.js.map +0 -1
- package/packages/pi-ai/src/providers/anthropic-shared.test.ts +0 -29
- package/packages/pi-ai/src/utils/repair-tool-json.ts +0 -88
- package/packages/pi-ai/src/utils/tests/repair-tool-json.test.ts +0 -102
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.d.ts +0 -6
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js +0 -176
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js.map +0 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.d.ts +0 -28
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.js +0 -37
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.js.map +0 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.test.d.ts +0 -2
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.test.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.test.js +0 -63
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.test.js.map +0 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.d.ts +0 -19
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.js +0 -115
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.js.map +0 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.test.d.ts +0 -2
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.test.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.test.js +0 -109
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.test.js.map +0 -1
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.d.ts +0 -44
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.js +0 -97
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.js.map +0 -1
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.test.d.ts +0 -2
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.test.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.test.js +0 -181
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.test.js.map +0 -1
- package/packages/pi-coding-agent/dist/core/messages.test.d.ts +0 -9
- package/packages/pi-coding-agent/dist/core/messages.test.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/core/messages.test.js +0 -86
- package/packages/pi-coding-agent/dist/core/messages.test.js.map +0 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.test.d.ts +0 -9
- package/packages/pi-coding-agent/dist/core/retry-handler.test.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js +0 -193
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js.map +0 -1
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.d.ts +0 -16
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js +0 -80
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js.map +0 -1
- package/packages/pi-coding-agent/src/core/compaction/compaction.test.ts +0 -236
- package/packages/pi-coding-agent/src/core/extensions/extension-manifest.test.ts +0 -77
- package/packages/pi-coding-agent/src/core/extensions/extension-manifest.ts +0 -62
- package/packages/pi-coding-agent/src/core/extensions/extension-sort.test.ts +0 -134
- package/packages/pi-coding-agent/src/core/extensions/extension-sort.ts +0 -137
- package/packages/pi-coding-agent/src/core/image-overflow-recovery.test.ts +0 -228
- package/packages/pi-coding-agent/src/core/image-overflow-recovery.ts +0 -118
- package/packages/pi-coding-agent/src/core/messages.test.ts +0 -114
- package/packages/pi-coding-agent/src/core/retry-handler.test.ts +0 -255
- package/packages/pi-coding-agent/src/core/tools/spawn-shell-windows.test.ts +0 -92
- package/src/resources/extensions/gsd/milestone-validation-gates.ts +0 -56
- package/src/resources/extensions/gsd/tests/auto-mode-interactive-guard.test.ts +0 -71
- package/src/resources/extensions/gsd/tests/cli-provider-rate-limit.test.ts +0 -47
- package/src/resources/extensions/gsd/tests/completion-hierarchy-guards.test.ts +0 -192
- package/src/resources/extensions/gsd/tests/db-path-worktree-symlink.test.ts +0 -131
- package/src/resources/extensions/gsd/tests/discord-invite-links.test.ts +0 -47
- package/src/resources/extensions/gsd/tests/discuss-empty-db-fallback.test.ts +0 -127
- package/src/resources/extensions/gsd/tests/dynamic-routing-default.test.ts +0 -20
- package/src/resources/extensions/gsd/tests/empty-content-abort-loop.test.ts +0 -74
- package/src/resources/extensions/gsd/tests/event-replay-idempotency.test.ts +0 -140
- package/src/resources/extensions/gsd/tests/forensics-context-persist.test.ts +0 -129
- package/src/resources/extensions/gsd/tests/forensics-db-completion.test.ts +0 -96
- package/src/resources/extensions/gsd/tests/gsdroot-worktree-detection.test.ts +0 -164
- package/src/resources/extensions/gsd/tests/guided-flow-dynamic-routing.test.ts +0 -135
- package/src/resources/extensions/gsd/tests/guided-flow-session-isolation.test.ts +0 -97
- package/src/resources/extensions/gsd/tests/hook-key-parsing.test.ts +0 -107
- package/src/resources/extensions/gsd/tests/integration/doctor-false-positives.test.ts +0 -243
- package/src/resources/extensions/gsd/tests/integration/gitignore-staging-2570.test.ts +0 -150
- package/src/resources/extensions/gsd/tests/integration/state-machine-live-validation.test.ts +0 -959
- package/src/resources/extensions/gsd/tests/migrate-external-worktree.test.ts +0 -105
- package/src/resources/extensions/gsd/tests/milestone-status-authoritative.test.ts +0 -116
- package/src/resources/extensions/gsd/tests/parallel-commit-scope.test.ts +0 -159
- package/src/resources/extensions/gsd/tests/parallel-eligibility-ghost.test.ts +0 -150
- package/src/resources/extensions/gsd/tests/plan-milestone-title.test.ts +0 -70
- package/src/resources/extensions/gsd/tests/project-relocation-recovery.test.ts +0 -297
- package/src/resources/extensions/gsd/tests/prompt-loader-replacement.test.ts +0 -178
- package/src/resources/extensions/gsd/tests/prompt-tool-names.test.ts +0 -69
- package/src/resources/extensions/gsd/tests/queue-execution-guard.test.ts +0 -157
- package/src/resources/extensions/gsd/tests/quick-turn-end-cleanup.test.ts +0 -90
- package/src/resources/extensions/gsd/tests/reconciliation-edge-cases.test.ts +0 -162
- package/src/resources/extensions/gsd/tests/slice-disk-reconcile.test.ts +0 -233
- package/src/resources/extensions/gsd/tests/stash-queued-context-files.test.ts +0 -305
- package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +0 -405
- package/src/resources/extensions/gsd/tests/state-derivation-parity.test.ts +0 -257
- package/src/resources/extensions/gsd/tests/state-machine-full-walkthrough.test.ts +0 -1628
- package/src/resources/extensions/gsd/tests/stop-auto-race-null-unit.test.ts +0 -106
- package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +0 -174
- package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +0 -221
- package/src/resources/extensions/gsd/tests/uat-stuck-loop-orphaned-worktree.test.ts +0 -289
- package/src/resources/extensions/gsd/tests/vacuum-recovery.test.ts +0 -154
- package/src/resources/extensions/gsd/tests/verdict-parser.test.ts +0 -156
- package/src/resources/extensions/gsd/tests/verification-operational-gate.test.ts +0 -82
- package/src/resources/extensions/gsd/tests/worktree-db-respawn-truncation.test.ts +0 -140
- package/src/resources/extensions/gsd/tests/worktree-nested-git-safety.test.ts +0 -101
- package/src/resources/extensions/gsd/tests/zombie-gsd-state.test.ts +0 -95
- package/src/resources/extensions/mcp-client/tests/server-name-spaces.test.ts +0 -55
- package/src/resources/extensions/ollama/index.ts +0 -130
- package/src/resources/extensions/ollama/model-capabilities.ts +0 -145
- package/src/resources/extensions/ollama/ollama-client.ts +0 -196
- package/src/resources/extensions/ollama/ollama-commands.ts +0 -248
- package/src/resources/extensions/ollama/ollama-discovery.ts +0 -106
- package/src/resources/extensions/ollama/ollama-tool.ts +0 -218
- package/src/resources/extensions/ollama/tests/model-capabilities.test.ts +0 -162
- package/src/resources/extensions/ollama/tests/ollama-client.test.ts +0 -38
- package/src/resources/extensions/ollama/tests/ollama-discovery.test.ts +0 -28
- package/src/resources/extensions/ollama/types.ts +0 -130
- package/src/resources/extensions/shared/tests/ask-user-freetext.test.ts +0 -156
- /package/dist/web/standalone/.next/static/{R0D4xaIPl5kg93edN7Oo0 → 5DLsjFHdSB6_a1EDQVjr7}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{R0D4xaIPl5kg93edN7Oo0 → 5DLsjFHdSB6_a1EDQVjr7}/_ssgManifest.js +0 -0
|
@@ -6,9 +6,8 @@ import { isToolCallEventType } from "@gsd/pi-coding-agent";
|
|
|
6
6
|
import { buildMilestoneFileName, resolveMilestonePath, resolveSliceFile, resolveSlicePath } from "../paths.js";
|
|
7
7
|
import { buildBeforeAgentStartResult } from "./system-context.js";
|
|
8
8
|
import { handleAgentEnd } from "./agent-end-recovery.js";
|
|
9
|
-
import { clearDiscussionFlowState, isDepthVerified, isQueuePhaseActive, markDepthVerified, resetWriteGateState, shouldBlockContextWrite
|
|
9
|
+
import { clearDiscussionFlowState, isDepthVerified, isQueuePhaseActive, markDepthVerified, resetWriteGateState, shouldBlockContextWrite } from "./write-gate.js";
|
|
10
10
|
import { isBlockedStateFile, isBashWriteToStateFile, BLOCKED_WRITE_ERROR } from "../write-intercept.js";
|
|
11
|
-
import { cleanupQuickBranch } from "../quick.js";
|
|
12
11
|
import { getDiscussionMilestoneId } from "../guided-flow.js";
|
|
13
12
|
import { loadToolApiKeys } from "../commands-config.js";
|
|
14
13
|
import { loadFile, saveFile, formatContinue } from "../files.js";
|
|
@@ -17,6 +16,8 @@ import { getAutoDashboardData, isAutoActive, isAutoPaused, markToolEnd, markTool
|
|
|
17
16
|
import { isParallelActive, shutdownParallel } from "../parallel-orchestrator.js";
|
|
18
17
|
import { checkToolCallLoop, resetToolCallLoopGuard } from "./tool-call-loop-guard.js";
|
|
19
18
|
import { saveActivityLog } from "../activity-log.js";
|
|
19
|
+
import { startRtkStatusUpdates, stopRtkStatusUpdates } from "../rtk-status.js";
|
|
20
|
+
import { rewriteCommandWithRtk } from "../../shared/rtk.js";
|
|
20
21
|
|
|
21
22
|
// Skip the welcome screen on the very first session_start — cli.ts already
|
|
22
23
|
// printed it before the TUI launched. Only re-print on /clear (subsequent sessions).
|
|
@@ -28,10 +29,19 @@ async function syncServiceTierStatus(ctx: ExtensionContext): Promise<void> {
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
export function registerHooks(pi: ExtensionAPI): void {
|
|
32
|
+
// Route all agent bash tool commands through RTK rewrite when opted in.
|
|
33
|
+
// This is a no-op when RTK is disabled or not installed.
|
|
34
|
+
pi.on("bash_transform", async (event) => {
|
|
35
|
+
const rewritten = rewriteCommandWithRtk(event.command);
|
|
36
|
+
if (rewritten === event.command) return undefined;
|
|
37
|
+
return { command: rewritten };
|
|
38
|
+
});
|
|
39
|
+
|
|
31
40
|
pi.on("session_start", async (_event, ctx) => {
|
|
32
41
|
resetWriteGateState();
|
|
33
42
|
resetToolCallLoopGuard();
|
|
34
43
|
await syncServiceTierStatus(ctx);
|
|
44
|
+
startRtkStatusUpdates(ctx);
|
|
35
45
|
|
|
36
46
|
// Apply show_token_cost preference (#1515)
|
|
37
47
|
try {
|
|
@@ -76,6 +86,11 @@ export function registerHooks(pi: ExtensionAPI): void {
|
|
|
76
86
|
clearDiscussionFlowState();
|
|
77
87
|
await syncServiceTierStatus(ctx);
|
|
78
88
|
loadToolApiKeys();
|
|
89
|
+
startRtkStatusUpdates(ctx);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
pi.on("session_fork", async (_event, ctx) => {
|
|
93
|
+
startRtkStatusUpdates(ctx);
|
|
79
94
|
});
|
|
80
95
|
|
|
81
96
|
pi.on("before_agent_start", async (event, ctx: ExtensionContext) => {
|
|
@@ -87,17 +102,6 @@ export function registerHooks(pi: ExtensionAPI): void {
|
|
|
87
102
|
await handleAgentEnd(pi, event, ctx);
|
|
88
103
|
});
|
|
89
104
|
|
|
90
|
-
// Squash-merge quick-task branch back to the original branch after the
|
|
91
|
-
// agent turn completes (#2668). cleanupQuickBranch is a no-op when no
|
|
92
|
-
// quick-return state is pending, so this is safe to call on every turn.
|
|
93
|
-
pi.on("turn_end", async () => {
|
|
94
|
-
try {
|
|
95
|
-
cleanupQuickBranch();
|
|
96
|
-
} catch {
|
|
97
|
-
// Best-effort: don't break the turn lifecycle if cleanup fails.
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
|
|
101
105
|
pi.on("session_before_compact", async () => {
|
|
102
106
|
if (isAutoActive() || isAutoPaused()) {
|
|
103
107
|
return { cancel: true };
|
|
@@ -135,6 +139,7 @@ export function registerHooks(pi: ExtensionAPI): void {
|
|
|
135
139
|
});
|
|
136
140
|
|
|
137
141
|
pi.on("session_shutdown", async (_event, ctx: ExtensionContext) => {
|
|
142
|
+
stopRtkStatusUpdates(ctx);
|
|
138
143
|
if (isParallelActive()) {
|
|
139
144
|
try {
|
|
140
145
|
await shutdownParallel(process.cwd());
|
|
@@ -156,23 +161,6 @@ export function registerHooks(pi: ExtensionAPI): void {
|
|
|
156
161
|
return { block: true, reason: loopCheck.reason };
|
|
157
162
|
}
|
|
158
163
|
|
|
159
|
-
// ── Queue-mode execution guard (#2545): block source-code mutations ──
|
|
160
|
-
// When /gsd queue is active, the agent should only create milestones,
|
|
161
|
-
// not execute work. Block write/edit to non-.gsd/ paths and bash commands
|
|
162
|
-
// that would modify files.
|
|
163
|
-
if (isQueuePhaseActive()) {
|
|
164
|
-
let queueInput = "";
|
|
165
|
-
if (isToolCallEventType("write", event)) {
|
|
166
|
-
queueInput = event.input.path;
|
|
167
|
-
} else if (isToolCallEventType("edit", event)) {
|
|
168
|
-
queueInput = event.input.path;
|
|
169
|
-
} else if (isToolCallEventType("bash", event)) {
|
|
170
|
-
queueInput = event.input.command;
|
|
171
|
-
}
|
|
172
|
-
const queueGuard = shouldBlockQueueExecution(event.toolName, queueInput, true);
|
|
173
|
-
if (queueGuard.block) return queueGuard;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
164
|
// ── Single-writer engine: block direct writes to STATE.md ──────────
|
|
177
165
|
// Covers write, edit, and bash tools to prevent bypass vectors.
|
|
178
166
|
if (isToolCallEventType("write", event)) {
|
|
@@ -257,7 +245,7 @@ export function registerHooks(pi: ExtensionAPI): void {
|
|
|
257
245
|
|
|
258
246
|
pi.on("tool_execution_start", async (event) => {
|
|
259
247
|
if (!isAutoActive()) return;
|
|
260
|
-
markToolStart(event.toolCallId);
|
|
248
|
+
markToolStart(event.toolCallId, event.toolName);
|
|
261
249
|
});
|
|
262
250
|
|
|
263
251
|
pi.on("tool_execution_end", async (event) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync, readFileSync
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
|
|
@@ -6,7 +6,6 @@ import type { ExtensionContext } from "@gsd/pi-coding-agent";
|
|
|
6
6
|
|
|
7
7
|
import { debugTime } from "../debug-logger.js";
|
|
8
8
|
import { loadPrompt } from "../prompt-loader.js";
|
|
9
|
-
import { readForensicsMarker } from "../forensics.js";
|
|
10
9
|
import { resolveAllSkillReferences, renderPreferencesForSystemPrompt, loadEffectiveGSDPreferences } from "../preferences.js";
|
|
11
10
|
import { resolveGsdRootFile, resolveSliceFile, resolveSlicePath, resolveTaskFile, resolveTaskFiles, resolveTasksDir, relSliceFile, relSlicePath, relTaskFile } from "../paths.js";
|
|
12
11
|
import { hasSkillSnapshot, detectNewSkills, formatSkillsXml } from "../skill-discovery.js";
|
|
@@ -98,30 +97,27 @@ export async function buildBeforeAgentStartResult(
|
|
|
98
97
|
warnDeprecatedAgentInstructions();
|
|
99
98
|
|
|
100
99
|
const injection = await buildGuidedExecuteContextInjection(event.prompt, process.cwd());
|
|
101
|
-
|
|
102
|
-
// Re-inject forensics context on follow-up turns (#2941)
|
|
103
|
-
const forensicsInjection = !injection ? buildForensicsContextInjection(process.cwd()) : null;
|
|
104
|
-
|
|
105
100
|
const worktreeBlock = buildWorktreeContextBlock();
|
|
106
101
|
const fullSystem = `${event.systemPrompt}\n\n[SYSTEM CONTEXT — GSD]\n\n${systemContent}${preferenceBlock}${knowledgeBlock}${memoryBlock}${newSkillsBlock}${worktreeBlock}`;
|
|
107
102
|
|
|
108
103
|
stopContextTimer({
|
|
109
104
|
systemPromptSize: fullSystem.length,
|
|
110
|
-
injectionSize: injection?.length ??
|
|
105
|
+
injectionSize: injection?.length ?? 0,
|
|
111
106
|
hasPreferences: preferenceBlock.length > 0,
|
|
112
107
|
hasNewSkills: newSkillsBlock.length > 0,
|
|
113
108
|
});
|
|
114
109
|
|
|
115
|
-
// Determine which context message to inject (guided execute takes priority)
|
|
116
|
-
const contextMessage = injection
|
|
117
|
-
? { customType: "gsd-guided-context", content: injection, display: false as const }
|
|
118
|
-
: forensicsInjection
|
|
119
|
-
? { customType: "gsd-forensics", content: forensicsInjection, display: false as const }
|
|
120
|
-
: null;
|
|
121
|
-
|
|
122
110
|
return {
|
|
123
111
|
systemPrompt: fullSystem,
|
|
124
|
-
...(
|
|
112
|
+
...(injection
|
|
113
|
+
? {
|
|
114
|
+
message: {
|
|
115
|
+
customType: "gsd-guided-context",
|
|
116
|
+
content: injection,
|
|
117
|
+
display: false as const,
|
|
118
|
+
},
|
|
119
|
+
}
|
|
120
|
+
: {}),
|
|
125
121
|
};
|
|
126
122
|
}
|
|
127
123
|
|
|
@@ -379,38 +375,3 @@ function oneLine(text: string): string {
|
|
|
379
375
|
return text.replace(/\s+/g, " ").trim();
|
|
380
376
|
}
|
|
381
377
|
|
|
382
|
-
// ─── Forensics Context Re-injection (#2941) ──────────────────────────────────
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Check for an active forensics session and return the prompt content
|
|
386
|
-
* so it can be re-injected on follow-up turns.
|
|
387
|
-
*/
|
|
388
|
-
function buildForensicsContextInjection(basePath: string): string | null {
|
|
389
|
-
const marker = readForensicsMarker(basePath);
|
|
390
|
-
if (!marker) return null;
|
|
391
|
-
|
|
392
|
-
// Expire markers older than 2 hours to avoid stale context
|
|
393
|
-
const age = Date.now() - new Date(marker.createdAt).getTime();
|
|
394
|
-
if (age > 2 * 60 * 60 * 1000) {
|
|
395
|
-
clearForensicsMarker(basePath);
|
|
396
|
-
return null;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
return marker.promptContent;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* Remove the active forensics marker file, e.g. when the investigation
|
|
404
|
-
* is complete or the session expires.
|
|
405
|
-
*/
|
|
406
|
-
export function clearForensicsMarker(basePath: string): void {
|
|
407
|
-
const markerPath = join(basePath, ".gsd", "runtime", "active-forensics.json");
|
|
408
|
-
if (existsSync(markerPath)) {
|
|
409
|
-
try {
|
|
410
|
-
unlinkSync(markerPath);
|
|
411
|
-
} catch {
|
|
412
|
-
// non-fatal
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
|
|
@@ -1,31 +1,5 @@
|
|
|
1
1
|
const MILESTONE_CONTEXT_RE = /M\d+(?:-[a-z0-9]{6})?-CONTEXT\.md$/;
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Path segment that identifies .gsd/ planning artifacts.
|
|
5
|
-
* Writes to these paths are allowed during queue mode.
|
|
6
|
-
*/
|
|
7
|
-
const GSD_DIR_RE = /(^|[/\\])\.gsd([/\\]|$)/;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Read-only tool names that are always safe during queue mode.
|
|
11
|
-
*/
|
|
12
|
-
const QUEUE_SAFE_TOOLS = new Set([
|
|
13
|
-
"read", "grep", "find", "ls", "glob",
|
|
14
|
-
// Discussion & planning tools
|
|
15
|
-
"ask_user_questions",
|
|
16
|
-
"gsd_milestone_generate_id",
|
|
17
|
-
"gsd_summary_save",
|
|
18
|
-
// Web research tools used during queue discussion
|
|
19
|
-
"search-the-web", "resolve_library", "get_library_docs", "fetch_page",
|
|
20
|
-
"search_and_read",
|
|
21
|
-
]);
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Bash commands that are read-only / investigative — safe during queue mode.
|
|
25
|
-
* Matches the leading command in a bash invocation.
|
|
26
|
-
*/
|
|
27
|
-
const BASH_READ_ONLY_RE = /^\s*(cat|head|tail|less|more|wc|file|stat|du|df|which|type|echo|printf|ls|find|grep|rg|awk|sed\b(?!.*-i)|sort|uniq|diff|comm|tr|cut|tee\s+-a\s+\/dev\/null|git\s+(log|show|diff|status|branch|tag|remote|rev-parse|ls-files|blame|shortlog|describe|stash\s+list|config\s+--get|cat-file)|gh\s+(issue|pr|api|repo|release)\s+(view|list|diff|status|checks)|mkdir\s+-p\s+\.gsd|rtk\s)/;
|
|
28
|
-
|
|
29
3
|
let depthVerificationDone = false;
|
|
30
4
|
let activeQueuePhase = false;
|
|
31
5
|
|
|
@@ -75,52 +49,3 @@ export function shouldBlockContextWrite(
|
|
|
75
49
|
};
|
|
76
50
|
}
|
|
77
51
|
|
|
78
|
-
/**
|
|
79
|
-
* Queue-mode execution guard (#2545).
|
|
80
|
-
*
|
|
81
|
-
* When the queue phase is active, the agent should only create planning
|
|
82
|
-
* artifacts (milestones, CONTEXT.md, QUEUE.md, etc.) — never execute work.
|
|
83
|
-
* This function blocks write/edit/bash tool calls that would modify source
|
|
84
|
-
* code outside of .gsd/.
|
|
85
|
-
*
|
|
86
|
-
* @param toolName The tool being called (write, edit, bash, etc.)
|
|
87
|
-
* @param input For write/edit: the file path. For bash: the command string.
|
|
88
|
-
* @param queuePhaseActive Whether the queue phase is currently active.
|
|
89
|
-
* @returns { block, reason } — block=true if the call should be rejected.
|
|
90
|
-
*/
|
|
91
|
-
export function shouldBlockQueueExecution(
|
|
92
|
-
toolName: string,
|
|
93
|
-
input: string,
|
|
94
|
-
queuePhaseActive: boolean,
|
|
95
|
-
): { block: boolean; reason?: string } {
|
|
96
|
-
if (!queuePhaseActive) return { block: false };
|
|
97
|
-
|
|
98
|
-
// Always-safe tools (read-only, discussion, planning)
|
|
99
|
-
if (QUEUE_SAFE_TOOLS.has(toolName)) return { block: false };
|
|
100
|
-
|
|
101
|
-
// write/edit — allow if targeting .gsd/ planning artifacts
|
|
102
|
-
if (toolName === "write" || toolName === "edit") {
|
|
103
|
-
if (GSD_DIR_RE.test(input)) return { block: false };
|
|
104
|
-
return {
|
|
105
|
-
block: true,
|
|
106
|
-
reason: `Blocked: /gsd queue is a planning tool — it creates milestones, not executes work. ` +
|
|
107
|
-
`Cannot ${toolName} to "${input}" during queue mode. ` +
|
|
108
|
-
`Write CONTEXT.md files and update PROJECT.md/QUEUE.md instead.`,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// bash — allow read-only/investigative commands, block everything else
|
|
113
|
-
if (toolName === "bash") {
|
|
114
|
-
if (BASH_READ_ONLY_RE.test(input)) return { block: false };
|
|
115
|
-
return {
|
|
116
|
-
block: true,
|
|
117
|
-
reason: `Blocked: /gsd queue is a planning tool — it creates milestones, not executes work. ` +
|
|
118
|
-
`Cannot run "${input.slice(0, 80)}${input.length > 80 ? "…" : ""}" during queue mode. ` +
|
|
119
|
-
`Use read-only commands (cat, grep, git log, etc.) to investigate, then write planning artifacts.`,
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Unknown tools — allow by default (custom extension tools, etc.)
|
|
124
|
-
return { block: false };
|
|
125
|
-
}
|
|
126
|
-
|
|
@@ -26,7 +26,6 @@ export interface CaptureEntry {
|
|
|
26
26
|
resolution?: string;
|
|
27
27
|
rationale?: string;
|
|
28
28
|
resolvedAt?: string;
|
|
29
|
-
resolvedInMilestone?: string;
|
|
30
29
|
executed?: boolean;
|
|
31
30
|
}
|
|
32
31
|
|
|
@@ -177,7 +176,6 @@ export function markCaptureResolved(
|
|
|
177
176
|
classification: Classification,
|
|
178
177
|
resolution: string,
|
|
179
178
|
rationale: string,
|
|
180
|
-
milestoneId?: string,
|
|
181
179
|
): void {
|
|
182
180
|
const filePath = resolveCapturesPath(basePath);
|
|
183
181
|
if (!existsSync(filePath)) return;
|
|
@@ -208,17 +206,13 @@ export function markCaptureResolved(
|
|
|
208
206
|
`**Rationale:** ${rationale}`,
|
|
209
207
|
`**Resolved:** ${resolvedAt}`,
|
|
210
208
|
];
|
|
211
|
-
if (milestoneId) {
|
|
212
|
-
newFields.push(`**Milestone:** ${milestoneId}`);
|
|
213
|
-
}
|
|
214
209
|
|
|
215
|
-
// Remove any existing classification/resolution/rationale/resolved
|
|
210
|
+
// Remove any existing classification/resolution/rationale/resolved fields
|
|
216
211
|
// (in case of re-triage)
|
|
217
212
|
section = section.replace(/\*\*Classification:\*\*\s*.+\n?/g, "");
|
|
218
213
|
section = section.replace(/\*\*Resolution:\*\*\s*.+\n?/g, "");
|
|
219
214
|
section = section.replace(/\*\*Rationale:\*\*\s*.+\n?/g, "");
|
|
220
215
|
section = section.replace(/\*\*Resolved:\*\*\s*.+\n?/g, "");
|
|
221
|
-
section = section.replace(/\*\*Milestone:\*\*\s*.+\n?/g, "");
|
|
222
216
|
|
|
223
217
|
// Add new fields after Status line
|
|
224
218
|
section = section.trimEnd() + "\n" + newFields.join("\n") + "\n";
|
|
@@ -261,68 +255,16 @@ export function markCaptureExecuted(basePath: string, captureId: string): void {
|
|
|
261
255
|
* Load resolved captures that have actionable classifications (inject, replan,
|
|
262
256
|
* quick-task) but have NOT yet been executed.
|
|
263
257
|
* These are captures whose resolutions need to be carried out.
|
|
264
|
-
*
|
|
265
|
-
* When `currentMilestoneId` is provided, captures resolved in a *different*
|
|
266
|
-
* milestone are treated as stale and excluded. This prevents quick-task
|
|
267
|
-
* captures from a prior milestone re-executing after the underlying issues
|
|
268
|
-
* were already fixed by planned milestone work (#2872).
|
|
269
|
-
*
|
|
270
|
-
* Captures that have no `resolvedInMilestone` (legacy captures resolved before
|
|
271
|
-
* this field was introduced) are always included for backward compatibility.
|
|
272
258
|
*/
|
|
273
|
-
export function loadActionableCaptures(basePath: string
|
|
259
|
+
export function loadActionableCaptures(basePath: string): CaptureEntry[] {
|
|
274
260
|
return loadAllCaptures(basePath).filter(
|
|
275
261
|
c =>
|
|
276
262
|
c.status === "resolved" &&
|
|
277
263
|
!c.executed &&
|
|
278
264
|
(c.classification === "inject" ||
|
|
279
265
|
c.classification === "replan" ||
|
|
280
|
-
c.classification === "quick-task")
|
|
281
|
-
// Staleness gate: exclude captures resolved in a different milestone (#2872)
|
|
282
|
-
(!currentMilestoneId ||
|
|
283
|
-
!c.resolvedInMilestone ||
|
|
284
|
-
c.resolvedInMilestone === currentMilestoneId),
|
|
285
|
-
);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Retroactively stamp a capture with a milestone ID.
|
|
290
|
-
*
|
|
291
|
-
* Used by executeTriageResolutions() as a safety net when the triage LLM
|
|
292
|
-
* resolves a capture without writing the **Milestone:** field. This ensures
|
|
293
|
-
* the staleness gate in loadActionableCaptures() works correctly even for
|
|
294
|
-
* captures resolved before the prompt was updated (#2872).
|
|
295
|
-
*/
|
|
296
|
-
export function stampCaptureMilestone(basePath: string, captureId: string, milestoneId: string): void {
|
|
297
|
-
const filePath = resolveCapturesPath(basePath);
|
|
298
|
-
if (!existsSync(filePath)) return;
|
|
299
|
-
|
|
300
|
-
const content = readFileSync(filePath, "utf-8");
|
|
301
|
-
|
|
302
|
-
const sectionRegex = new RegExp(
|
|
303
|
-
`(### ${escapeRegex(captureId)}\\n(?:(?!### ).)*?)(?=### |$)`,
|
|
304
|
-
"s",
|
|
266
|
+
c.classification === "quick-task"),
|
|
305
267
|
);
|
|
306
|
-
const match = sectionRegex.exec(content);
|
|
307
|
-
if (!match) return;
|
|
308
|
-
|
|
309
|
-
let section = match[1];
|
|
310
|
-
|
|
311
|
-
// Only stamp if not already present
|
|
312
|
-
if (/\*\*Milestone:\*\*/.test(section)) return;
|
|
313
|
-
|
|
314
|
-
// Insert after the Resolved field (or at end of section)
|
|
315
|
-
const resolvedFieldEnd = section.search(/\*\*Resolved:\*\*\s*.+\n?/);
|
|
316
|
-
if (resolvedFieldEnd !== -1) {
|
|
317
|
-
const resolvedMatch = section.match(/\*\*Resolved:\*\*\s*.+\n?/);
|
|
318
|
-
const insertPos = resolvedFieldEnd + (resolvedMatch?.[0]?.length ?? 0);
|
|
319
|
-
section = section.slice(0, insertPos) + `**Milestone:** ${milestoneId}\n` + section.slice(insertPos);
|
|
320
|
-
} else {
|
|
321
|
-
section = section.trimEnd() + "\n" + `**Milestone:** ${milestoneId}` + "\n";
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
const updated = content.replace(sectionRegex, section);
|
|
325
|
-
writeFileSync(filePath, updated, "utf-8");
|
|
326
268
|
}
|
|
327
269
|
|
|
328
270
|
// ─── Parser ───────────────────────────────────────────────────────────────────
|
|
@@ -349,7 +291,6 @@ function parseCapturesContent(content: string): CaptureEntry[] {
|
|
|
349
291
|
const resolution = extractBoldField(body, "Resolution");
|
|
350
292
|
const rationale = extractBoldField(body, "Rationale");
|
|
351
293
|
const resolvedAt = extractBoldField(body, "Resolved");
|
|
352
|
-
const milestoneId = extractBoldField(body, "Milestone");
|
|
353
294
|
const executedAt = extractBoldField(body, "Executed");
|
|
354
295
|
|
|
355
296
|
if (!text || !timestamp) continue;
|
|
@@ -367,7 +308,6 @@ function parseCapturesContent(content: string): CaptureEntry[] {
|
|
|
367
308
|
...(resolution ? { resolution } : {}),
|
|
368
309
|
...(rationale ? { rationale } : {}),
|
|
369
310
|
...(resolvedAt ? { resolvedAt } : {}),
|
|
370
|
-
...(milestoneId ? { resolvedInMilestone: milestoneId } : {}),
|
|
371
311
|
...(executedAt ? { executed: true } : {}),
|
|
372
312
|
});
|
|
373
313
|
}
|
|
@@ -227,122 +227,6 @@ export async function nextDecisionId(): Promise<string> {
|
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
// ─── Next Requirement ID ─────────────────────────────────────────────────
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Compute the next requirement ID from the current DB state.
|
|
234
|
-
* Queries MAX(CAST(SUBSTR(id, 2) AS INTEGER)) from requirements table.
|
|
235
|
-
* Returns R001 if no requirements exist. Zero-pads to 3 digits.
|
|
236
|
-
*/
|
|
237
|
-
export async function nextRequirementId(): Promise<string> {
|
|
238
|
-
try {
|
|
239
|
-
const db = await import('./gsd-db.js');
|
|
240
|
-
const adapter = db._getAdapter();
|
|
241
|
-
if (!adapter) return 'R001';
|
|
242
|
-
|
|
243
|
-
const row = adapter
|
|
244
|
-
.prepare('SELECT MAX(CAST(SUBSTR(id, 2) AS INTEGER)) as max_num FROM requirements')
|
|
245
|
-
.get();
|
|
246
|
-
|
|
247
|
-
const maxNum = row ? (row['max_num'] as number | null) : null;
|
|
248
|
-
if (maxNum == null || isNaN(maxNum)) return 'R001';
|
|
249
|
-
|
|
250
|
-
const next = maxNum + 1;
|
|
251
|
-
return `R${String(next).padStart(3, '0')}`;
|
|
252
|
-
} catch (err) {
|
|
253
|
-
logError('manifest', 'nextRequirementId failed', { fn: 'nextRequirementId', error: String((err as Error).message) });
|
|
254
|
-
return 'R001';
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// ─── Save Requirement to DB + Regenerate Markdown ────────────────────────
|
|
259
|
-
|
|
260
|
-
export interface SaveRequirementFields {
|
|
261
|
-
class: string;
|
|
262
|
-
status?: string;
|
|
263
|
-
description: string;
|
|
264
|
-
why: string;
|
|
265
|
-
source: string;
|
|
266
|
-
primary_owner?: string;
|
|
267
|
-
supporting_slices?: string;
|
|
268
|
-
validation?: string;
|
|
269
|
-
notes?: string;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Save a new requirement to DB and regenerate REQUIREMENTS.md.
|
|
274
|
-
* Auto-assigns the next ID via nextRequirementId().
|
|
275
|
-
* Returns the assigned ID.
|
|
276
|
-
*/
|
|
277
|
-
export async function saveRequirementToDb(
|
|
278
|
-
fields: SaveRequirementFields,
|
|
279
|
-
basePath: string,
|
|
280
|
-
): Promise<{ id: string }> {
|
|
281
|
-
try {
|
|
282
|
-
const db = await import('./gsd-db.js');
|
|
283
|
-
|
|
284
|
-
const id = await nextRequirementId();
|
|
285
|
-
|
|
286
|
-
const requirement: Requirement = {
|
|
287
|
-
id,
|
|
288
|
-
class: fields.class,
|
|
289
|
-
status: fields.status ?? 'active',
|
|
290
|
-
description: fields.description,
|
|
291
|
-
why: fields.why,
|
|
292
|
-
source: fields.source,
|
|
293
|
-
primary_owner: fields.primary_owner ?? '',
|
|
294
|
-
supporting_slices: fields.supporting_slices ?? '',
|
|
295
|
-
validation: fields.validation ?? '',
|
|
296
|
-
notes: fields.notes ?? '',
|
|
297
|
-
full_content: '',
|
|
298
|
-
superseded_by: null,
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
db.upsertRequirement(requirement);
|
|
302
|
-
|
|
303
|
-
// Fetch all requirements for full file regeneration
|
|
304
|
-
const adapter = db._getAdapter();
|
|
305
|
-
let allRequirements: Requirement[] = [];
|
|
306
|
-
if (adapter) {
|
|
307
|
-
const rows = adapter.prepare('SELECT * FROM requirements ORDER BY id').all();
|
|
308
|
-
allRequirements = rows.map(row => ({
|
|
309
|
-
id: row['id'] as string,
|
|
310
|
-
class: row['class'] as string,
|
|
311
|
-
status: row['status'] as string,
|
|
312
|
-
description: row['description'] as string,
|
|
313
|
-
why: row['why'] as string,
|
|
314
|
-
source: row['source'] as string,
|
|
315
|
-
primary_owner: row['primary_owner'] as string,
|
|
316
|
-
supporting_slices: row['supporting_slices'] as string,
|
|
317
|
-
validation: row['validation'] as string,
|
|
318
|
-
notes: row['notes'] as string,
|
|
319
|
-
full_content: row['full_content'] as string,
|
|
320
|
-
superseded_by: (row['superseded_by'] as string) ?? null,
|
|
321
|
-
}));
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
const nonSuperseded = allRequirements.filter(r => r.superseded_by == null);
|
|
325
|
-
const md = generateRequirementsMd(nonSuperseded);
|
|
326
|
-
const filePath = resolveGsdRootFile(basePath, 'REQUIREMENTS');
|
|
327
|
-
try {
|
|
328
|
-
await saveFile(filePath, md);
|
|
329
|
-
} catch (diskErr) {
|
|
330
|
-
logError('manifest', 'disk write failed, rolling back DB row', { fn: 'saveRequirementToDb', error: String((diskErr as Error).message) });
|
|
331
|
-
const rollbackAdapter = db._getAdapter();
|
|
332
|
-
rollbackAdapter?.prepare('DELETE FROM requirements WHERE id = :id').run({ ':id': id });
|
|
333
|
-
throw diskErr;
|
|
334
|
-
}
|
|
335
|
-
invalidateStateCache();
|
|
336
|
-
clearPathCache();
|
|
337
|
-
clearParseCache();
|
|
338
|
-
|
|
339
|
-
return { id };
|
|
340
|
-
} catch (err) {
|
|
341
|
-
logError('manifest', 'saveRequirementToDb failed', { fn: 'saveRequirementToDb', error: String((err as Error).message) });
|
|
342
|
-
throw err;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
230
|
// ─── Save Decision to DB + Regenerate Markdown ────────────────────────────
|
|
347
231
|
|
|
348
232
|
export interface SaveDecisionFields {
|
|
@@ -460,30 +344,15 @@ export async function updateRequirementInDb(
|
|
|
460
344
|
const db = await import('./gsd-db.js');
|
|
461
345
|
|
|
462
346
|
const existing = db.getRequirementById(id);
|
|
347
|
+
if (!existing) {
|
|
348
|
+
throw new GSDError(GSD_STALE_STATE, `Requirement ${id} not found`);
|
|
349
|
+
}
|
|
463
350
|
|
|
464
|
-
//
|
|
465
|
-
// This handles the case where requirements were written to REQUIREMENTS.md
|
|
466
|
-
// but never imported into the database (see #2919).
|
|
467
|
-
const base: Requirement = existing ?? {
|
|
468
|
-
id,
|
|
469
|
-
class: '',
|
|
470
|
-
status: 'active',
|
|
471
|
-
description: '',
|
|
472
|
-
why: '',
|
|
473
|
-
source: '',
|
|
474
|
-
primary_owner: '',
|
|
475
|
-
supporting_slices: '',
|
|
476
|
-
validation: '',
|
|
477
|
-
notes: '',
|
|
478
|
-
full_content: '',
|
|
479
|
-
superseded_by: null,
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
// Merge updates into existing (or skeleton)
|
|
351
|
+
// Merge updates into existing
|
|
483
352
|
const merged: Requirement = {
|
|
484
|
-
...
|
|
353
|
+
...existing,
|
|
485
354
|
...updates,
|
|
486
|
-
id:
|
|
355
|
+
id: existing.id, // ID cannot be changed
|
|
487
356
|
};
|
|
488
357
|
|
|
489
358
|
db.upsertRequirement(merged);
|
|
@@ -519,9 +388,7 @@ export async function updateRequirementInDb(
|
|
|
519
388
|
await saveFile(filePath, md);
|
|
520
389
|
} catch (diskErr) {
|
|
521
390
|
logError('manifest', 'disk write failed, reverting DB row', { fn: 'updateRequirementInDb', error: String((diskErr as Error).message) });
|
|
522
|
-
|
|
523
|
-
db.upsertRequirement(existing);
|
|
524
|
-
}
|
|
391
|
+
db.upsertRequirement(existing);
|
|
525
392
|
throw diskErr;
|
|
526
393
|
}
|
|
527
394
|
// Invalidate file-read caches so deriveState() sees the updated markdown.
|
|
@@ -14,28 +14,6 @@ import { nativeIsRepo, nativeWorktreeList, nativeWorktreeRemove, nativeBranchLis
|
|
|
14
14
|
import { getAllWorktreeHealth } from "./worktree-health.js";
|
|
15
15
|
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
* Returns true if the directory contains only doctor artifacts
|
|
19
|
-
* (e.g. `.gsd/doctor-history.jsonl`). These dirs are created by
|
|
20
|
-
* appendDoctorHistory() writing to worktree-scoped paths during the audit
|
|
21
|
-
* and should not be flagged as orphaned worktrees (#3105).
|
|
22
|
-
*/
|
|
23
|
-
function isDoctorArtifactOnly(dirPath: string): boolean {
|
|
24
|
-
try {
|
|
25
|
-
const entries = readdirSync(dirPath);
|
|
26
|
-
// Empty dir — not a doctor artifact, still orphaned
|
|
27
|
-
if (entries.length === 0) return false;
|
|
28
|
-
// Only a .gsd subdirectory
|
|
29
|
-
if (entries.length === 1 && entries[0] === ".gsd") {
|
|
30
|
-
const gsdEntries = readdirSync(join(dirPath, ".gsd"));
|
|
31
|
-
return gsdEntries.length <= 1 && gsdEntries.every(e => e === "doctor-history.jsonl");
|
|
32
|
-
}
|
|
33
|
-
return false;
|
|
34
|
-
} catch {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
17
|
export async function checkGitHealth(
|
|
40
18
|
basePath: string,
|
|
41
19
|
issues: DoctorIssue[],
|
|
@@ -336,10 +314,6 @@ export async function checkGitHealth(
|
|
|
336
314
|
} catch { continue; }
|
|
337
315
|
const normalizedFullPath = normalizePath(fullPath);
|
|
338
316
|
if (!registeredPaths.has(normalizedFullPath)) {
|
|
339
|
-
// Skip directories that only contain doctor artifacts (.gsd/doctor-history.jsonl).
|
|
340
|
-
// appendDoctorHistory() can recreate these dirs during the audit itself,
|
|
341
|
-
// causing a circular false positive (#3105 Bug 1).
|
|
342
|
-
if (isDoctorArtifactOnly(fullPath)) continue;
|
|
343
317
|
issues.push({
|
|
344
318
|
severity: "warning",
|
|
345
319
|
code: "worktree_directory_orphaned",
|
|
@@ -181,8 +181,7 @@ function resolveKey(providerId: string): KeyLookup {
|
|
|
181
181
|
*/
|
|
182
182
|
const PROVIDER_ROUTES: Record<string, string[]> = {
|
|
183
183
|
anthropic: ["github-copilot"],
|
|
184
|
-
openai: ["github-copilot"
|
|
185
|
-
google: ["google-gemini-cli"],
|
|
184
|
+
openai: ["github-copilot"],
|
|
186
185
|
};
|
|
187
186
|
|
|
188
187
|
function checkLlmProviders(): ProviderCheckResult[] {
|
|
@@ -119,11 +119,10 @@ export async function checkRuntimeHealth(
|
|
|
119
119
|
|
|
120
120
|
for (const key of keys) {
|
|
121
121
|
// Key format: "unitType/unitId" e.g. "execute-task/M001/S01/T01"
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
const { unitType, unitId } = parsed;
|
|
122
|
+
const slashIdx = key.indexOf("/");
|
|
123
|
+
if (slashIdx === -1) continue;
|
|
124
|
+
const unitType = key.slice(0, slashIdx);
|
|
125
|
+
const unitId = key.slice(slashIdx + 1);
|
|
127
126
|
|
|
128
127
|
// Only validate artifact-producing unit types
|
|
129
128
|
const { verifyExpectedArtifact } = await import("./auto-recovery.js");
|
|
@@ -729,10 +729,8 @@ export async function runGSDDoctor(basePath: string, options?: { fix?: boolean;
|
|
|
729
729
|
}
|
|
730
730
|
|
|
731
731
|
// Blocker-without-replan detection
|
|
732
|
-
// Skip when all tasks are done — the blocker was implicitly resolved
|
|
733
|
-
// within the task and the slice is not stuck (#3105 Bug 2).
|
|
734
732
|
const replanPath = resolveSliceFile(basePath, milestoneId, slice.id, "REPLAN");
|
|
735
|
-
if (!replanPath
|
|
733
|
+
if (!replanPath) {
|
|
736
734
|
for (const task of plan.tasks) {
|
|
737
735
|
if (!task.done) continue;
|
|
738
736
|
const summaryPath = resolveTaskFile(basePath, milestoneId, slice.id, task.id, "SUMMARY");
|