gsd-pi 2.58.0-dev.d63175c → 2.58.0-dev.e002a57
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 +60 -35
- package/dist/headless-ui.d.ts +17 -0
- package/dist/headless-ui.js +97 -3
- package/dist/headless.js +67 -6
- package/dist/help-text.js +1 -0
- package/dist/onboarding.js +44 -0
- package/dist/resource-loader.js +16 -1
- package/dist/resources/agents/researcher.md +1 -1
- package/dist/resources/extensions/ask-user-questions.js +16 -3
- 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 +14 -6
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +59 -36
- package/dist/resources/extensions/context7/extension-manifest.json +1 -1
- package/dist/resources/extensions/get-secrets-from-user.js +8 -5
- package/dist/resources/extensions/google-search/extension-manifest.json +1 -1
- package/dist/resources/extensions/google-search/index.js +2 -1
- package/dist/resources/extensions/gsd/auto/phases.js +25 -21
- package/dist/resources/extensions/gsd/auto-artifact-paths.js +2 -2
- package/dist/resources/extensions/gsd/auto-dashboard.js +37 -20
- package/dist/resources/extensions/gsd/auto-dispatch.js +17 -2
- package/dist/resources/extensions/gsd/auto-model-selection.js +26 -3
- package/dist/resources/extensions/gsd/auto-post-unit.js +16 -4
- package/dist/resources/extensions/gsd/auto-prompts.js +1 -1
- package/dist/resources/extensions/gsd/auto-recovery.js +13 -5
- package/dist/resources/extensions/gsd/auto-start.js +35 -22
- package/dist/resources/extensions/gsd/auto-worktree.js +199 -12
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +32 -0
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +80 -8
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +32 -1
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +42 -34
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +66 -12
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +67 -0
- package/dist/resources/extensions/gsd/captures.js +56 -4
- package/dist/resources/extensions/gsd/codebase-generator.js +279 -0
- package/dist/resources/extensions/gsd/commands/catalog.js +10 -1
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +5 -0
- package/dist/resources/extensions/gsd/commands-codebase.js +115 -0
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +41 -4
- package/dist/resources/extensions/gsd/complexity-classifier.js +8 -6
- package/dist/resources/extensions/gsd/db-writer.js +116 -8
- package/dist/resources/extensions/gsd/doctor-git-checks.js +76 -1
- package/dist/resources/extensions/gsd/doctor-proactive.js +34 -1
- package/dist/resources/extensions/gsd/doctor-providers.js +2 -1
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +5 -4
- package/dist/resources/extensions/gsd/doctor.js +3 -1
- package/dist/resources/extensions/gsd/error-classifier.js +12 -10
- package/dist/resources/extensions/gsd/extension-manifest.json +16 -1
- package/dist/resources/extensions/gsd/forensics.js +123 -20
- package/dist/resources/extensions/gsd/git-service.js +105 -2
- package/dist/resources/extensions/gsd/gitignore.js +33 -0
- package/dist/resources/extensions/gsd/gsd-db.js +36 -9
- package/dist/resources/extensions/gsd/guided-flow.js +106 -44
- package/dist/resources/extensions/gsd/health-widget-core.js +31 -0
- package/dist/resources/extensions/gsd/health-widget.js +17 -0
- package/dist/resources/extensions/gsd/index.js +1 -1
- package/dist/resources/extensions/gsd/memory-extractor.js +7 -0
- package/dist/resources/extensions/gsd/migrate-external.js +8 -1
- package/dist/resources/extensions/gsd/milestone-validation-gates.js +45 -0
- package/dist/resources/extensions/gsd/model-cost-table.js +18 -0
- package/dist/resources/extensions/gsd/model-router.js +35 -1
- package/dist/resources/extensions/gsd/native-git-bridge.js +39 -0
- package/dist/resources/extensions/gsd/notifications.js +16 -1
- package/dist/resources/extensions/gsd/parallel-eligibility.js +13 -2
- package/dist/resources/extensions/gsd/parallel-merge.js +78 -5
- package/dist/resources/extensions/gsd/parsers-legacy.js +20 -3
- package/dist/resources/extensions/gsd/paths.js +45 -0
- package/dist/resources/extensions/gsd/preferences-models.js +14 -1
- package/dist/resources/extensions/gsd/preferences-types.js +3 -1
- package/dist/resources/extensions/gsd/preferences.js +13 -16
- package/dist/resources/extensions/gsd/prompt-loader.js +4 -1
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +4 -2
- 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 +3 -1
- 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 +2 -0
- package/dist/resources/extensions/gsd/prompts/rethink.md +1 -1
- package/dist/resources/extensions/gsd/prompts/triage-captures.md +1 -0
- package/dist/resources/extensions/gsd/repo-identity.js +205 -11
- package/dist/resources/extensions/gsd/rethink.js +5 -0
- package/dist/resources/extensions/gsd/roadmap-slices.js +5 -4
- package/dist/resources/extensions/gsd/state.js +85 -27
- package/dist/resources/extensions/gsd/tests/dist-redirect.mjs +20 -1
- package/dist/resources/extensions/gsd/tools/complete-task.js +34 -71
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +12 -2
- package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +29 -1
- package/dist/resources/extensions/gsd/tools/validate-milestone.js +14 -3
- package/dist/resources/extensions/gsd/triage-resolution.js +22 -7
- package/dist/resources/extensions/gsd/undo.js +2 -2
- package/dist/resources/extensions/gsd/unit-ownership.js +164 -33
- package/dist/resources/extensions/gsd/verdict-parser.js +20 -8
- package/dist/resources/extensions/gsd/watch/header-renderer.js +241 -0
- package/dist/resources/extensions/gsd/workflow-manifest.js +24 -5
- package/dist/resources/extensions/gsd/workflow-projections.js +95 -63
- package/dist/resources/extensions/gsd/workflow-reconcile.js +35 -5
- package/dist/resources/extensions/gsd/workspace-index.js +24 -0
- package/dist/resources/extensions/gsd/worktree-manager.js +105 -1
- package/dist/resources/extensions/gsd/worktree-resolver.js +20 -3
- package/dist/resources/extensions/mcp-client/index.js +11 -7
- package/dist/resources/extensions/ollama/index.js +112 -0
- package/dist/resources/extensions/ollama/model-capabilities.js +115 -0
- package/dist/resources/extensions/ollama/ollama-client.js +168 -0
- package/dist/resources/extensions/ollama/ollama-commands.js +194 -0
- package/dist/resources/extensions/ollama/ollama-discovery.js +69 -0
- package/dist/resources/extensions/ollama/ollama-tool.js +184 -0
- package/dist/resources/extensions/ollama/types.js +2 -0
- package/dist/resources/extensions/search-the-web/extension-manifest.json +1 -1
- package/dist/resources/extensions/search-the-web/url-utils.js +17 -0
- package/dist/resources/extensions/shared/interview-ui.js +11 -1
- package/dist/resources/skills/create-gsd-extension/SKILL.md +5 -3
- package/dist/resources/skills/create-gsd-extension/references/key-rules-gotchas.md +5 -4
- 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 +5 -3
- package/dist/security-overrides.d.ts +11 -0
- package/dist/security-overrides.js +41 -0
- package/dist/startup-model-validation.d.ts +39 -0
- package/dist/startup-model-validation.js +50 -0
- 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.7593d7797a4b3999.js +9 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-61d3afac6d0f0ce7.js → webpack-a1c1e452c6b32d04.js} +1 -1
- package/dist/web/standalone/.next/static/css/f6e8833d46e738d8.css +1 -0
- package/dist/web/standalone/server.js +1 -1
- package/dist/web-mode.js +2 -1
- package/dist/welcome-screen.d.ts +1 -0
- package/dist/welcome-screen.js +32 -6
- package/package.json +2 -2
- package/packages/native/dist/ast/index.js +9 -5
- package/packages/native/dist/ast/types.js +2 -1
- package/packages/native/dist/clipboard/index.js +12 -7
- package/packages/native/dist/clipboard/types.js +2 -1
- package/packages/native/dist/diff/index.js +12 -7
- package/packages/native/dist/diff/types.js +2 -1
- package/packages/native/dist/fd/index.js +6 -3
- package/packages/native/dist/fd/types.js +2 -1
- package/packages/native/dist/glob/index.js +9 -5
- package/packages/native/dist/glob/types.js +2 -1
- package/packages/native/dist/grep/index.js +9 -5
- package/packages/native/dist/grep/types.js +2 -1
- package/packages/native/dist/gsd-parser/index.js +18 -11
- package/packages/native/dist/gsd-parser/types.js +2 -1
- package/packages/native/dist/highlight/index.js +12 -7
- package/packages/native/dist/highlight/types.js +2 -1
- package/packages/native/dist/html/index.js +6 -3
- package/packages/native/dist/html/types.js +2 -1
- package/packages/native/dist/image/index.js +10 -5
- package/packages/native/dist/image/types.js +7 -4
- package/packages/native/dist/index.js +70 -17
- package/packages/native/dist/json-parse/index.js +13 -8
- package/packages/native/dist/native.js +47 -10
- package/packages/native/dist/ps/index.js +15 -9
- package/packages/native/dist/ps/types.js +2 -1
- package/packages/native/dist/stream-process/index.js +12 -7
- package/packages/native/dist/text/index.js +24 -14
- package/packages/native/dist/text/types.js +5 -2
- package/packages/native/dist/truncate/index.js +12 -7
- package/packages/native/dist/ttsr/index.js +12 -7
- package/packages/native/dist/ttsr/types.js +2 -1
- package/packages/native/dist/xxhash/index.js +9 -5
- package/packages/native/package.json +19 -19
- package/packages/native/src/__tests__/module-compat.test.mjs +91 -0
- package/packages/native/src/native.ts +9 -8
- package/packages/pi-agent-core/dist/agent-loop.js +3 -2
- 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.test.ts +45 -0
- package/packages/pi-agent-core/src/agent-loop.ts +3 -2
- package/packages/pi-agent-core/src/proxy.ts +1 -1
- package/packages/pi-ai/dist/env-api-keys.js +1 -0
- package/packages/pi-ai/dist/env-api-keys.js.map +1 -1
- package/packages/pi-ai/dist/index.d.ts +1 -0
- package/packages/pi-ai/dist/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/index.js +1 -0
- 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 +19 -2
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js +25 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -0
- 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 +3 -0
- package/packages/pi-ai/dist/utils/json-parse.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/json-parse.js +24 -1
- package/packages/pi-ai/dist/utils/json-parse.js.map +1 -1
- package/packages/pi-ai/dist/utils/repair-tool-json.d.ts +37 -0
- package/packages/pi-ai/dist/utils/repair-tool-json.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/repair-tool-json.js +75 -0
- package/packages/pi-ai/dist/utils/repair-tool-json.js.map +1 -0
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.js +73 -0
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.js.map +1 -0
- package/packages/pi-ai/src/env-api-keys.ts +1 -0
- package/packages/pi-ai/src/index.ts +1 -0
- package/packages/pi-ai/src/providers/anthropic-shared.test.ts +29 -0
- package/packages/pi-ai/src/providers/anthropic-shared.ts +17 -2
- package/packages/pi-ai/src/types.ts +3 -2
- package/packages/pi-ai/src/utils/json-parse.ts +28 -1
- package/packages/pi-ai/src/utils/repair-tool-json.ts +88 -0
- package/packages/pi-ai/src/utils/tests/repair-tool-json.test.ts +102 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +4 -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 +31 -0
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +17 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js +62 -2
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.d.ts +6 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js +176 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/exec.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/exec.js +3 -1
- package/packages/pi-coding-agent/dist/core/exec.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.d.ts +28 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.js +37 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.test.js +63 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-manifest.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.d.ts +19 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.js +115 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.test.js +109 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-sort.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +4 -0
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js +2 -0
- package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +5 -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 +5 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.d.ts +44 -0
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.js +97 -0
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.test.js +181 -0
- package/packages/pi-coding-agent/dist/core/image-overflow-recovery.test.js.map +1 -0
- 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 +3 -0
- 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 +3 -0
- 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 +31 -2
- package/packages/pi-coding-agent/dist/core/messages.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/messages.test.d.ts +9 -0
- package/packages/pi-coding-agent/dist/core/messages.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/messages.test.js +86 -0
- package/packages/pi-coding-agent/dist/core/messages.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resolve-config-value.d.ts +8 -0
- package/packages/pi-coding-agent/dist/core/resolve-config-value.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/resolve-config-value.js +23 -2
- package/packages/pi-coding-agent/dist/core/resolve-config-value.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resolve-config-value.test.js +89 -2
- package/packages/pi-coding-agent/dist/core/resolve-config-value.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.d.ts +10 -0
- package/packages/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.js +12 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +6 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js +48 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.test.d.ts +9 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js +193 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/settings-manager-security.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/settings-manager-security.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/settings-manager-security.test.js +83 -0
- package/packages/pi-coding-agent/dist/core/settings-manager-security.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +14 -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 +36 -3
- package/packages/pi-coding-agent/dist/core/settings-manager.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 +10 -3
- 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 +13 -4
- 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.d.ts +16 -0
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js +80 -0
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/index.d.ts +3 -2
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js +2 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/armin.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/armin.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/armin.js +9 -8
- package/packages/pi-coding-agent/dist/modes/interactive/components/armin.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +0 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +2 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/bordered-loader.js +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.js +5 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.js +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/custom-message.js +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.js +4 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js +2 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js +8 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.js +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.js +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +26 -12
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/oauth-selector.js +4 -4
- package/packages/pi-coding-agent/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.d.ts +3 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.js +46 -14
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.js +2 -8
- package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js +4 -4
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +2 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- 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 +8 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.js +3 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.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 +19 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js +16 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +1 -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 +27 -4
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +6 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/remote-terminal.d.ts +1 -0
- 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 +5 -0
- package/packages/pi-coding-agent/dist/modes/rpc/remote-terminal.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +38 -1
- package/packages/pi-coding-agent/src/core/compaction/compaction.test.ts +236 -0
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +94 -1
- package/packages/pi-coding-agent/src/core/exec.ts +3 -1
- package/packages/pi-coding-agent/src/core/extensions/extension-manifest.test.ts +77 -0
- package/packages/pi-coding-agent/src/core/extensions/extension-manifest.ts +62 -0
- package/packages/pi-coding-agent/src/core/extensions/extension-sort.test.ts +134 -0
- package/packages/pi-coding-agent/src/core/extensions/extension-sort.ts +137 -0
- package/packages/pi-coding-agent/src/core/extensions/index.ts +4 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +5 -0
- package/packages/pi-coding-agent/src/core/image-overflow-recovery.test.ts +228 -0
- package/packages/pi-coding-agent/src/core/image-overflow-recovery.ts +118 -0
- package/packages/pi-coding-agent/src/core/index.ts +6 -0
- package/packages/pi-coding-agent/src/core/lsp/index.ts +3 -0
- package/packages/pi-coding-agent/src/core/lsp/lspmux.ts +3 -0
- package/packages/pi-coding-agent/src/core/messages.test.ts +114 -0
- package/packages/pi-coding-agent/src/core/messages.ts +29 -2
- package/packages/pi-coding-agent/src/core/model-resolver.ts +1 -0
- package/packages/pi-coding-agent/src/core/resolve-config-value.test.ts +111 -1
- package/packages/pi-coding-agent/src/core/resolve-config-value.ts +26 -2
- package/packages/pi-coding-agent/src/core/resource-loader.ts +20 -1
- package/packages/pi-coding-agent/src/core/retry-handler.test.ts +255 -0
- package/packages/pi-coding-agent/src/core/retry-handler.ts +52 -1
- package/packages/pi-coding-agent/src/core/settings-manager-security.test.ts +102 -0
- package/packages/pi-coding-agent/src/core/settings-manager.ts +44 -3
- package/packages/pi-coding-agent/src/core/tools/hashline-read.ts +11 -3
- package/packages/pi-coding-agent/src/core/tools/read.ts +14 -4
- package/packages/pi-coding-agent/src/core/tools/spawn-shell-windows.test.ts +92 -0
- package/packages/pi-coding-agent/src/index.ts +11 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/armin.ts +9 -9
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +0 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/bash-execution.ts +3 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/bordered-loader.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/branch-summary-message.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/compaction-summary-message.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/config-selector.ts +7 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/countdown-timer.ts +3 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/custom-message.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/daxnuts.ts +4 -3
- package/packages/pi-coding-agent/src/modes/interactive/components/diff.ts +2 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.ts +3 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/extension-input.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/extension-selector.ts +4 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +27 -13
- package/packages/pi-coding-agent/src/modes/interactive/components/oauth-selector.ts +4 -4
- package/packages/pi-coding-agent/src/modes/interactive/components/provider-manager.ts +45 -14
- package/packages/pi-coding-agent/src/modes/interactive/components/scoped-models-selector.ts +2 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/session-selector.ts +4 -4
- package/packages/pi-coding-agent/src/modes/interactive/components/skill-invocation-message.ts +2 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +8 -3
- package/packages/pi-coding-agent/src/modes/interactive/components/user-message-selector.ts +3 -2
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +24 -1
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.ts +14 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +35 -3
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +7 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +1 -1
- package/packages/pi-coding-agent/src/modes/rpc/remote-terminal.ts +6 -0
- package/packages/pi-tui/dist/terminal.d.ts +2 -0
- package/packages/pi-tui/dist/terminal.d.ts.map +1 -1
- package/packages/pi-tui/dist/terminal.js +9 -0
- 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 +9 -0
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/src/terminal.ts +14 -0
- package/packages/pi-tui/src/tui.ts +8 -0
- package/pkg/dist/modes/interactive/theme/themes.js +1 -1
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
- package/scripts/ensure-workspace-builds.cjs +45 -14
- package/src/resources/agents/researcher.md +1 -1
- package/src/resources/extensions/ask-user-questions.ts +21 -3
- 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 +13 -6
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +63 -35
- package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +28 -0
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +108 -1
- package/src/resources/extensions/context7/extension-manifest.json +1 -1
- package/src/resources/extensions/get-secrets-from-user.ts +8 -5
- package/src/resources/extensions/google-search/extension-manifest.json +1 -1
- package/src/resources/extensions/google-search/index.ts +2 -1
- package/src/resources/extensions/gsd/auto/loop-deps.ts +1 -0
- package/src/resources/extensions/gsd/auto/phases.ts +43 -34
- package/src/resources/extensions/gsd/auto-artifact-paths.ts +2 -2
- package/src/resources/extensions/gsd/auto-dashboard.ts +37 -19
- package/src/resources/extensions/gsd/auto-dispatch.ts +18 -2
- package/src/resources/extensions/gsd/auto-model-selection.ts +26 -5
- package/src/resources/extensions/gsd/auto-post-unit.ts +18 -4
- package/src/resources/extensions/gsd/auto-prompts.ts +1 -1
- package/src/resources/extensions/gsd/auto-recovery.ts +12 -5
- package/src/resources/extensions/gsd/auto-start.ts +35 -26
- package/src/resources/extensions/gsd/auto-worktree.ts +193 -9
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +31 -0
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +85 -8
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +38 -1
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +41 -35
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +72 -12
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +75 -0
- package/src/resources/extensions/gsd/captures.ts +63 -3
- package/src/resources/extensions/gsd/codebase-generator.ts +351 -0
- package/src/resources/extensions/gsd/commands/catalog.ts +10 -1
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +5 -0
- package/src/resources/extensions/gsd/commands-codebase.ts +164 -0
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +46 -4
- package/src/resources/extensions/gsd/complexity-classifier.ts +8 -6
- package/src/resources/extensions/gsd/db-writer.ts +140 -7
- package/src/resources/extensions/gsd/doctor-git-checks.ts +75 -1
- package/src/resources/extensions/gsd/doctor-proactive.ts +35 -1
- package/src/resources/extensions/gsd/doctor-providers.ts +2 -1
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +5 -4
- package/src/resources/extensions/gsd/doctor-types.ts +2 -0
- package/src/resources/extensions/gsd/doctor.ts +3 -1
- package/src/resources/extensions/gsd/error-classifier.ts +13 -11
- package/src/resources/extensions/gsd/extension-manifest.json +16 -1
- package/src/resources/extensions/gsd/forensics.ts +144 -20
- package/src/resources/extensions/gsd/git-service.ts +119 -3
- package/src/resources/extensions/gsd/gitignore.ts +33 -0
- package/src/resources/extensions/gsd/gsd-db.ts +43 -7
- package/src/resources/extensions/gsd/guided-flow.ts +114 -45
- package/src/resources/extensions/gsd/health-widget-core.ts +34 -0
- package/src/resources/extensions/gsd/health-widget.ts +17 -0
- package/src/resources/extensions/gsd/index.ts +1 -0
- package/src/resources/extensions/gsd/memory-extractor.ts +8 -0
- package/src/resources/extensions/gsd/migrate-external.ts +9 -1
- package/src/resources/extensions/gsd/milestone-validation-gates.ts +56 -0
- package/src/resources/extensions/gsd/model-cost-table.ts +19 -0
- package/src/resources/extensions/gsd/model-router.ts +35 -1
- package/src/resources/extensions/gsd/native-git-bridge.ts +41 -0
- package/src/resources/extensions/gsd/notifications.ts +16 -0
- package/src/resources/extensions/gsd/parallel-eligibility.ts +15 -2
- package/src/resources/extensions/gsd/parallel-merge.ts +87 -4
- package/src/resources/extensions/gsd/parsers-legacy.ts +22 -3
- package/src/resources/extensions/gsd/paths.ts +44 -0
- package/src/resources/extensions/gsd/preferences-models.ts +14 -1
- package/src/resources/extensions/gsd/preferences-types.ts +10 -1
- package/src/resources/extensions/gsd/preferences.ts +13 -15
- package/src/resources/extensions/gsd/prompt-loader.ts +4 -1
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/complete-slice.md +4 -2
- 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 +3 -1
- 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 +2 -0
- package/src/resources/extensions/gsd/prompts/rethink.md +1 -1
- package/src/resources/extensions/gsd/prompts/triage-captures.md +1 -0
- package/src/resources/extensions/gsd/repo-identity.ts +186 -11
- package/src/resources/extensions/gsd/rethink.ts +6 -0
- package/src/resources/extensions/gsd/roadmap-slices.ts +5 -4
- package/src/resources/extensions/gsd/state.ts +84 -32
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +29 -0
- package/src/resources/extensions/gsd/tests/auto-mode-interactive-guard.test.ts +71 -0
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +71 -1
- package/src/resources/extensions/gsd/tests/captures.test.ts +103 -0
- package/src/resources/extensions/gsd/tests/cli-provider-rate-limit.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/codebase-generator.test.ts +488 -0
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/completion-hierarchy-guards.test.ts +192 -0
- package/src/resources/extensions/gsd/tests/complexity-classifier.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/db-path-worktree-symlink.test.ts +131 -0
- package/src/resources/extensions/gsd/tests/db-writer.test.ts +7 -12
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +78 -5
- package/src/resources/extensions/gsd/tests/derive-state.test.ts +29 -0
- package/src/resources/extensions/gsd/tests/discord-invite-links.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/discuss-empty-db-fallback.test.ts +127 -0
- package/src/resources/extensions/gsd/tests/discuss-queued-milestones.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/dist-redirect.mjs +20 -1
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +117 -0
- package/src/resources/extensions/gsd/tests/dynamic-routing-default.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/empty-content-abort-loop.test.ts +74 -0
- package/src/resources/extensions/gsd/tests/event-replay-idempotency.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/forensics-context-persist.test.ts +129 -0
- package/src/resources/extensions/gsd/tests/forensics-db-completion.test.ts +96 -0
- package/src/resources/extensions/gsd/tests/forensics-dedup.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/gsd-tools.test.ts +125 -12
- package/src/resources/extensions/gsd/tests/gsdroot-worktree-detection.test.ts +164 -0
- package/src/resources/extensions/gsd/tests/guided-flow-dynamic-routing.test.ts +135 -0
- package/src/resources/extensions/gsd/tests/guided-flow-session-isolation.test.ts +97 -0
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/hook-key-parsing.test.ts +107 -0
- package/src/resources/extensions/gsd/tests/integration/auto-recovery.test.ts +111 -1
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +134 -0
- package/src/resources/extensions/gsd/tests/integration/auto-worktree.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-false-positives.test.ts +243 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-git.test.ts +72 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +68 -0
- package/src/resources/extensions/gsd/tests/integration/gitignore-staging-2570.test.ts +150 -0
- package/src/resources/extensions/gsd/tests/integration/parallel-merge.test.ts +110 -0
- package/src/resources/extensions/gsd/tests/integration/run-uat.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/integration/state-machine-live-validation.test.ts +959 -0
- package/src/resources/extensions/gsd/tests/memory-extractor.test.ts +85 -2
- package/src/resources/extensions/gsd/tests/migrate-external-worktree.test.ts +105 -0
- package/src/resources/extensions/gsd/tests/milestone-status-authoritative.test.ts +116 -0
- package/src/resources/extensions/gsd/tests/model-cost-table.test.ts +34 -0
- package/src/resources/extensions/gsd/tests/model-router.test.ts +68 -3
- package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +28 -0
- package/src/resources/extensions/gsd/tests/notifications.test.ts +45 -0
- package/src/resources/extensions/gsd/tests/parallel-commit-scope.test.ts +159 -0
- package/src/resources/extensions/gsd/tests/parallel-eligibility-ghost.test.ts +150 -0
- package/src/resources/extensions/gsd/tests/plan-milestone-title.test.ts +70 -0
- package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +33 -1
- package/src/resources/extensions/gsd/tests/project-relocation-recovery.test.ts +297 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +29 -0
- package/src/resources/extensions/gsd/tests/prompt-loader-replacement.test.ts +178 -0
- package/src/resources/extensions/gsd/tests/prompt-tool-names.test.ts +69 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/queue-execution-guard.test.ts +157 -0
- package/src/resources/extensions/gsd/tests/quick-turn-end-cleanup.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/reassess-handler.test.ts +117 -0
- package/src/resources/extensions/gsd/tests/reconciliation-edge-cases.test.ts +162 -0
- package/src/resources/extensions/gsd/tests/roadmap-slices.test.ts +97 -0
- package/src/resources/extensions/gsd/tests/secure-env-collect.test.ts +134 -0
- package/src/resources/extensions/gsd/tests/slice-disk-reconcile.test.ts +233 -0
- package/src/resources/extensions/gsd/tests/stash-queued-context-files.test.ts +305 -0
- package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +405 -0
- package/src/resources/extensions/gsd/tests/state-derivation-parity.test.ts +257 -0
- package/src/resources/extensions/gsd/tests/state-machine-full-walkthrough.test.ts +1628 -0
- package/src/resources/extensions/gsd/tests/stop-auto-race-null-unit.test.ts +106 -0
- package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +174 -0
- package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +221 -0
- package/src/resources/extensions/gsd/tests/terminated-transient.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/tool-naming.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/triage-resolution.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/uat-stuck-loop-orphaned-worktree.test.ts +289 -0
- package/src/resources/extensions/gsd/tests/unit-ownership.test.ts +100 -17
- package/src/resources/extensions/gsd/tests/vacuum-recovery.test.ts +154 -0
- package/src/resources/extensions/gsd/tests/validate-milestone-write-order.test.ts +4 -1
- package/src/resources/extensions/gsd/tests/verdict-parser.test.ts +156 -0
- package/src/resources/extensions/gsd/tests/verification-operational-gate.test.ts +82 -0
- package/src/resources/extensions/gsd/tests/workflow-logger.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/workflow-manifest.test.ts +92 -0
- package/src/resources/extensions/gsd/tests/workflow-projections.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/worktree-db-respawn-truncation.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/worktree-nested-git-safety.test.ts +101 -0
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +48 -1
- package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +29 -5
- package/src/resources/extensions/gsd/tests/zombie-gsd-state.test.ts +95 -0
- package/src/resources/extensions/gsd/tools/complete-task.ts +36 -74
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +13 -1
- package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +36 -0
- package/src/resources/extensions/gsd/tools/validate-milestone.ts +20 -2
- package/src/resources/extensions/gsd/triage-resolution.ts +23 -6
- package/src/resources/extensions/gsd/types.ts +4 -2
- package/src/resources/extensions/gsd/undo.ts +2 -2
- package/src/resources/extensions/gsd/unit-ownership.ts +206 -35
- package/src/resources/extensions/gsd/verdict-parser.ts +21 -6
- package/src/resources/extensions/gsd/watch/header-renderer.ts +275 -0
- package/src/resources/extensions/gsd/workflow-logger.ts +3 -1
- package/src/resources/extensions/gsd/workflow-manifest.ts +22 -5
- package/src/resources/extensions/gsd/workflow-projections.ts +97 -64
- package/src/resources/extensions/gsd/workflow-reconcile.ts +39 -10
- package/src/resources/extensions/gsd/workspace-index.ts +30 -0
- package/src/resources/extensions/gsd/worktree-manager.ts +120 -1
- package/src/resources/extensions/gsd/worktree-resolver.ts +22 -3
- package/src/resources/extensions/mcp-client/index.ts +13 -7
- package/src/resources/extensions/mcp-client/tests/server-name-spaces.test.ts +55 -0
- package/src/resources/extensions/ollama/index.ts +130 -0
- package/src/resources/extensions/ollama/model-capabilities.ts +145 -0
- package/src/resources/extensions/ollama/ollama-client.ts +196 -0
- package/src/resources/extensions/ollama/ollama-commands.ts +248 -0
- package/src/resources/extensions/ollama/ollama-discovery.ts +106 -0
- package/src/resources/extensions/ollama/ollama-tool.ts +218 -0
- package/src/resources/extensions/ollama/tests/model-capabilities.test.ts +162 -0
- package/src/resources/extensions/ollama/tests/ollama-client.test.ts +38 -0
- package/src/resources/extensions/ollama/tests/ollama-discovery.test.ts +28 -0
- package/src/resources/extensions/ollama/types.ts +130 -0
- package/src/resources/extensions/search-the-web/extension-manifest.json +1 -1
- package/src/resources/extensions/search-the-web/url-utils.ts +19 -0
- package/src/resources/extensions/shared/interview-ui.ts +12 -1
- package/src/resources/extensions/shared/tests/ask-user-freetext.test.ts +156 -0
- package/src/resources/skills/create-gsd-extension/SKILL.md +5 -3
- package/src/resources/skills/create-gsd-extension/references/key-rules-gotchas.md +5 -4
- 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 +5 -3
- package/dist/web/standalone/.next/static/chunks/6502.8b732f67a11b11b4.js +0 -9
- package/dist/web/standalone/.next/static/css/a58ef8a151aa0493.css +0 -1
- package/src/resources/extensions/gsd/tests/empty-db-reconciliation.test.ts +0 -79
- /package/dist/web/standalone/.next/static/{5DLsjFHdSB6_a1EDQVjr7 → nUA6d2OJrDSVq9RNb-c8b}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{5DLsjFHdSB6_a1EDQVjr7 → nUA6d2OJrDSVq9RNb-c8b}/_ssgManifest.js +0 -0
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { runProviderChecks, summariseProviderIssues } from "./doctor-providers.js";
|
|
11
11
|
import { runEnvironmentChecks } from "./doctor-environment.js";
|
|
12
12
|
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
13
|
+
import { nativeIsRepo, nativeLastCommitEpoch, nativeGetCurrentBranch, nativeCommitSubject } from "./native-git-bridge.js";
|
|
13
14
|
import { loadLedgerFromDisk, getProjectTotals } from "./metrics.js";
|
|
14
15
|
import { projectRoot } from "./commands/context.js";
|
|
15
16
|
import { buildHealthLines, detectHealthWidgetProjectState, } from "./health-widget-core.js";
|
|
@@ -20,6 +21,8 @@ function loadHealthWidgetData(basePath) {
|
|
|
20
21
|
let providerIssue = null;
|
|
21
22
|
let environmentErrorCount = 0;
|
|
22
23
|
let environmentWarningCount = 0;
|
|
24
|
+
let lastCommitEpoch = null;
|
|
25
|
+
let lastCommitMessage = null;
|
|
23
26
|
const projectState = detectHealthWidgetProjectState(basePath);
|
|
24
27
|
try {
|
|
25
28
|
const prefs = loadEffectiveGSDPreferences();
|
|
@@ -46,6 +49,18 @@ function loadHealthWidgetData(basePath) {
|
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
catch { /* non-fatal */ }
|
|
52
|
+
// ── Last commit info ──
|
|
53
|
+
try {
|
|
54
|
+
if (nativeIsRepo(basePath)) {
|
|
55
|
+
const branch = nativeGetCurrentBranch(basePath);
|
|
56
|
+
const epoch = nativeLastCommitEpoch(basePath, branch || "HEAD");
|
|
57
|
+
if (epoch > 0) {
|
|
58
|
+
lastCommitEpoch = epoch;
|
|
59
|
+
lastCommitMessage = nativeCommitSubject(basePath, branch || "HEAD") || null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch { /* non-fatal */ }
|
|
49
64
|
return {
|
|
50
65
|
projectState,
|
|
51
66
|
budgetCeiling,
|
|
@@ -53,6 +68,8 @@ function loadHealthWidgetData(basePath) {
|
|
|
53
68
|
providerIssue,
|
|
54
69
|
environmentErrorCount,
|
|
55
70
|
environmentWarningCount,
|
|
71
|
+
lastCommitEpoch,
|
|
72
|
+
lastCommitMessage,
|
|
56
73
|
lastRefreshed: Date.now(),
|
|
57
74
|
};
|
|
58
75
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { isDepthVerified, isQueuePhaseActive, setQueuePhaseActive, shouldBlockContextWrite, } from "./bootstrap/write-gate.js";
|
|
1
|
+
export { isDepthVerified, isQueuePhaseActive, setQueuePhaseActive, shouldBlockContextWrite, shouldBlockQueueExecution, } from "./bootstrap/write-gate.js";
|
|
2
2
|
export default async function registerExtension(pi) {
|
|
3
3
|
const { registerGsdExtension } = await import("./bootstrap/register-extension.js");
|
|
4
4
|
registerGsdExtension(pi);
|
|
@@ -57,14 +57,21 @@ export function buildMemoryLLMCall(ctx) {
|
|
|
57
57
|
if (!model)
|
|
58
58
|
return null;
|
|
59
59
|
const selectedModel = model;
|
|
60
|
+
// Resolve API key via modelRegistry so OAuth tokens (auth.json) are used.
|
|
61
|
+
// Without this, streamSimpleAnthropic only checks env vars via getEnvApiKey,
|
|
62
|
+
// which returns undefined for OAuth users (Claude Max / Claude Pro).
|
|
63
|
+
// See: https://github.com/gsd-build/gsd-2/issues/2959
|
|
64
|
+
const resolvedKeyPromise = ctx.modelRegistry.getApiKey(selectedModel).catch(() => undefined);
|
|
60
65
|
return async (system, user) => {
|
|
61
66
|
const { completeSimple } = await import('@gsd/pi-ai');
|
|
67
|
+
const resolvedApiKey = await resolvedKeyPromise;
|
|
62
68
|
const result = await completeSimple(selectedModel, {
|
|
63
69
|
systemPrompt: system,
|
|
64
70
|
messages: [{ role: 'user', content: [{ type: 'text', text: user }], timestamp: Date.now() }],
|
|
65
71
|
}, {
|
|
66
72
|
maxTokens: 2048,
|
|
67
73
|
temperature: 0,
|
|
74
|
+
...(resolvedApiKey ? { apiKey: resolvedApiKey } : {}),
|
|
68
75
|
});
|
|
69
76
|
// Extract text from response
|
|
70
77
|
const textParts = result.content
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { execFileSync } from "node:child_process";
|
|
9
9
|
import { existsSync, lstatSync, mkdirSync, readdirSync, realpathSync, renameSync, cpSync, rmSync, symlinkSync } from "node:fs";
|
|
10
10
|
import { join } from "node:path";
|
|
11
|
-
import { externalGsdRoot } from "./repo-identity.js";
|
|
11
|
+
import { externalGsdRoot, isInsideWorktree } from "./repo-identity.js";
|
|
12
12
|
import { getErrorMessage } from "./error-utils.js";
|
|
13
13
|
import { hasGitTrackedGsdFiles } from "./gitignore.js";
|
|
14
14
|
import { GIT_NO_PROMPT_ENV } from "./git-constants.js";
|
|
@@ -27,6 +27,13 @@ import { GIT_NO_PROMPT_ENV } from "./git-constants.js";
|
|
|
27
27
|
* 3. On failure: rename `.gsd.migrating` back to `.gsd` (rollback)
|
|
28
28
|
*/
|
|
29
29
|
export function migrateToExternalState(basePath) {
|
|
30
|
+
// Worktrees get their .gsd via syncGsdStateToWorktree(), not migration.
|
|
31
|
+
// Migration inside a worktree would compute the same external hash as the
|
|
32
|
+
// main repo (externalGsdRoot hashes remoteUrl + gitRoot), creating a broken
|
|
33
|
+
// junction and orphaning .gsd.migrating (#2970).
|
|
34
|
+
if (isInsideWorktree(basePath)) {
|
|
35
|
+
return { migrated: false };
|
|
36
|
+
}
|
|
30
37
|
const localGsd = join(basePath, ".gsd");
|
|
31
38
|
// Skip if doesn't exist
|
|
32
39
|
if (!existsSync(localGsd)) {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Milestone validation quality gate persistence.
|
|
3
|
+
*
|
|
4
|
+
* #2945 Bug 4: validate-milestone was writing VALIDATION.md to disk and
|
|
5
|
+
* inserting an assessment row, but never persisted structured quality_gates
|
|
6
|
+
* records in the DB. This module inserts milestone-level validation gates
|
|
7
|
+
* that correspond to the validation checks performed.
|
|
8
|
+
*
|
|
9
|
+
* Gate IDs for milestone validation:
|
|
10
|
+
* MV01 — Success criteria checklist
|
|
11
|
+
* MV02 — Slice delivery audit
|
|
12
|
+
* MV03 — Cross-slice integration
|
|
13
|
+
* MV04 — Requirement coverage
|
|
14
|
+
*
|
|
15
|
+
* These use the existing quality_gates table with scope "milestone".
|
|
16
|
+
*/
|
|
17
|
+
import { _getAdapter } from "./gsd-db.js";
|
|
18
|
+
/** Milestone validation gate IDs. */
|
|
19
|
+
const MILESTONE_GATE_IDS = ["MV01", "MV02", "MV03", "MV04"];
|
|
20
|
+
/**
|
|
21
|
+
* Insert milestone-level quality_gates records for a validation run.
|
|
22
|
+
*
|
|
23
|
+
* Each gate is inserted with status "complete" and a verdict derived
|
|
24
|
+
* from the overall milestone validation verdict. Individual gate-level
|
|
25
|
+
* verdicts are not available (the handler receives a single verdict),
|
|
26
|
+
* so all gates share the overall verdict.
|
|
27
|
+
*/
|
|
28
|
+
export function insertMilestoneValidationGates(milestoneId, sliceId, verdict, evaluatedAt) {
|
|
29
|
+
const db = _getAdapter();
|
|
30
|
+
if (!db)
|
|
31
|
+
return;
|
|
32
|
+
const gateVerdict = verdict === "pass" ? "pass" : "flag";
|
|
33
|
+
for (const gateId of MILESTONE_GATE_IDS) {
|
|
34
|
+
db.prepare(`INSERT OR REPLACE INTO quality_gates
|
|
35
|
+
(milestone_id, slice_id, gate_id, scope, task_id, status, verdict, rationale, findings, evaluated_at)
|
|
36
|
+
VALUES (:mid, :sid, :gid, 'milestone', '', 'complete', :verdict, :rationale, '', :evaluated_at)`).run({
|
|
37
|
+
":mid": milestoneId,
|
|
38
|
+
":sid": sliceId,
|
|
39
|
+
":gid": gateId,
|
|
40
|
+
":verdict": gateVerdict,
|
|
41
|
+
":rationale": `Milestone validation verdict: ${verdict}`,
|
|
42
|
+
":evaluated_at": evaluatedAt,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -20,9 +20,27 @@ export const BUNDLED_COST_TABLE = [
|
|
|
20
20
|
// OpenAI
|
|
21
21
|
{ id: "gpt-4o", inputPer1k: 0.0025, outputPer1k: 0.01, updatedAt: "2025-03-15" },
|
|
22
22
|
{ id: "gpt-4o-mini", inputPer1k: 0.00015, outputPer1k: 0.0006, updatedAt: "2025-03-15" },
|
|
23
|
+
{ id: "gpt-4.1", inputPer1k: 0.002, outputPer1k: 0.008, updatedAt: "2026-03-29" },
|
|
24
|
+
{ id: "gpt-4.1-mini", inputPer1k: 0.0004, outputPer1k: 0.0016, updatedAt: "2026-03-29" },
|
|
25
|
+
{ id: "gpt-4.1-nano", inputPer1k: 0.0001, outputPer1k: 0.0004, updatedAt: "2026-03-29" },
|
|
26
|
+
{ id: "gpt-5", inputPer1k: 0.01, outputPer1k: 0.04, updatedAt: "2026-03-29" },
|
|
27
|
+
{ id: "gpt-5-mini", inputPer1k: 0.0003, outputPer1k: 0.0012, updatedAt: "2026-03-29" },
|
|
28
|
+
{ id: "gpt-5-nano", inputPer1k: 0.0001, outputPer1k: 0.0004, updatedAt: "2026-03-29" },
|
|
29
|
+
{ id: "gpt-5-pro", inputPer1k: 0.015, outputPer1k: 0.06, updatedAt: "2026-03-29" },
|
|
23
30
|
{ id: "o1", inputPer1k: 0.015, outputPer1k: 0.06, updatedAt: "2025-03-15" },
|
|
24
31
|
{ id: "o3", inputPer1k: 0.015, outputPer1k: 0.06, updatedAt: "2025-03-15" },
|
|
32
|
+
{ id: "o4-mini", inputPer1k: 0.005, outputPer1k: 0.02, updatedAt: "2026-03-29" },
|
|
33
|
+
{ id: "o4-mini-deep-research", inputPer1k: 0.005, outputPer1k: 0.02, updatedAt: "2026-03-29" },
|
|
25
34
|
{ id: "gpt-4-turbo", inputPer1k: 0.01, outputPer1k: 0.03, updatedAt: "2025-03-15" },
|
|
35
|
+
// OpenAI Codex
|
|
36
|
+
{ id: "gpt-5.1", inputPer1k: 0.005, outputPer1k: 0.02, updatedAt: "2026-03-29" },
|
|
37
|
+
{ id: "gpt-5.1-codex-max", inputPer1k: 0.003, outputPer1k: 0.012, updatedAt: "2026-03-29" },
|
|
38
|
+
{ id: "gpt-5.1-codex-mini", inputPer1k: 0.0003, outputPer1k: 0.0012, updatedAt: "2026-03-29" },
|
|
39
|
+
{ id: "gpt-5.2", inputPer1k: 0.005, outputPer1k: 0.02, updatedAt: "2026-03-29" },
|
|
40
|
+
{ id: "gpt-5.2-codex", inputPer1k: 0.005, outputPer1k: 0.02, updatedAt: "2026-03-29" },
|
|
41
|
+
{ id: "gpt-5.3-codex", inputPer1k: 0.005, outputPer1k: 0.02, updatedAt: "2026-03-29" },
|
|
42
|
+
{ id: "gpt-5.3-codex-spark", inputPer1k: 0.0003, outputPer1k: 0.0012, updatedAt: "2026-03-29" },
|
|
43
|
+
{ id: "gpt-5.4", inputPer1k: 0.005, outputPer1k: 0.02, updatedAt: "2026-03-29" },
|
|
26
44
|
// Google
|
|
27
45
|
{ id: "gemini-2.0-flash", inputPer1k: 0.0001, outputPer1k: 0.0004, updatedAt: "2025-03-15" },
|
|
28
46
|
{ id: "gemini-flash-2.0", inputPer1k: 0.0001, outputPer1k: 0.0004, updatedAt: "2025-03-15" },
|
|
@@ -11,6 +11,12 @@ const MODEL_CAPABILITY_TIER = {
|
|
|
11
11
|
"claude-3-5-haiku-latest": "light",
|
|
12
12
|
"claude-3-haiku-20240307": "light",
|
|
13
13
|
"gpt-4o-mini": "light",
|
|
14
|
+
"gpt-4.1-mini": "light",
|
|
15
|
+
"gpt-4.1-nano": "light",
|
|
16
|
+
"gpt-5-mini": "light",
|
|
17
|
+
"gpt-5-nano": "light",
|
|
18
|
+
"gpt-5.1-codex-mini": "light",
|
|
19
|
+
"gpt-5.3-codex-spark": "light",
|
|
14
20
|
"gemini-2.0-flash": "light",
|
|
15
21
|
"gemini-flash-2.0": "light",
|
|
16
22
|
// Standard-tier models
|
|
@@ -18,14 +24,25 @@ const MODEL_CAPABILITY_TIER = {
|
|
|
18
24
|
"claude-sonnet-4-5-20250514": "standard",
|
|
19
25
|
"claude-3-5-sonnet-latest": "standard",
|
|
20
26
|
"gpt-4o": "standard",
|
|
27
|
+
"gpt-4.1": "standard",
|
|
28
|
+
"gpt-5.1-codex-max": "standard",
|
|
21
29
|
"gemini-2.5-pro": "standard",
|
|
22
30
|
"deepseek-chat": "standard",
|
|
23
31
|
// Heavy-tier models (most capable)
|
|
24
32
|
"claude-opus-4-6": "heavy",
|
|
25
33
|
"claude-3-opus-latest": "heavy",
|
|
26
34
|
"gpt-4-turbo": "heavy",
|
|
35
|
+
"gpt-5": "heavy",
|
|
36
|
+
"gpt-5-pro": "heavy",
|
|
37
|
+
"gpt-5.1": "heavy",
|
|
38
|
+
"gpt-5.2": "heavy",
|
|
39
|
+
"gpt-5.2-codex": "heavy",
|
|
40
|
+
"gpt-5.3-codex": "heavy",
|
|
41
|
+
"gpt-5.4": "heavy",
|
|
27
42
|
"o1": "heavy",
|
|
28
43
|
"o3": "heavy",
|
|
44
|
+
"o4-mini": "heavy",
|
|
45
|
+
"o4-mini-deep-research": "heavy",
|
|
29
46
|
};
|
|
30
47
|
// ─── Cost Table (per 1K input tokens, approximate USD) ───────────────────────
|
|
31
48
|
// Used for cross-provider cost comparison when multiple providers offer
|
|
@@ -38,6 +55,23 @@ const MODEL_COST_PER_1K_INPUT = {
|
|
|
38
55
|
"claude-opus-4-6": 0.015,
|
|
39
56
|
"gpt-4o-mini": 0.00015,
|
|
40
57
|
"gpt-4o": 0.0025,
|
|
58
|
+
"gpt-4.1": 0.002,
|
|
59
|
+
"gpt-4.1-mini": 0.0004,
|
|
60
|
+
"gpt-4.1-nano": 0.0001,
|
|
61
|
+
"gpt-5": 0.01,
|
|
62
|
+
"gpt-5-mini": 0.0003,
|
|
63
|
+
"gpt-5-nano": 0.0001,
|
|
64
|
+
"gpt-5-pro": 0.015,
|
|
65
|
+
"gpt-5.1": 0.005,
|
|
66
|
+
"gpt-5.1-codex-max": 0.003,
|
|
67
|
+
"gpt-5.1-codex-mini": 0.0003,
|
|
68
|
+
"gpt-5.2": 0.005,
|
|
69
|
+
"gpt-5.2-codex": 0.005,
|
|
70
|
+
"gpt-5.3-codex": 0.005,
|
|
71
|
+
"gpt-5.3-codex-spark": 0.0003,
|
|
72
|
+
"gpt-5.4": 0.005,
|
|
73
|
+
"o4-mini": 0.005,
|
|
74
|
+
"o4-mini-deep-research": 0.005,
|
|
41
75
|
"gemini-2.0-flash": 0.0001,
|
|
42
76
|
"gemini-2.5-pro": 0.00125,
|
|
43
77
|
"deepseek-chat": 0.00014,
|
|
@@ -133,7 +167,7 @@ export function escalateTier(currentTier) {
|
|
|
133
167
|
*/
|
|
134
168
|
export function defaultRoutingConfig() {
|
|
135
169
|
return {
|
|
136
|
-
enabled:
|
|
170
|
+
enabled: true,
|
|
137
171
|
escalate_on_failure: true,
|
|
138
172
|
budget_pressure: true,
|
|
139
173
|
cross_provider: true,
|
|
@@ -525,6 +525,15 @@ export function nativeAddAll(basePath) {
|
|
|
525
525
|
}
|
|
526
526
|
gitFileExec(basePath, ["add", "-A"]);
|
|
527
527
|
}
|
|
528
|
+
/**
|
|
529
|
+
* Stage only already-tracked files (git add -u).
|
|
530
|
+
* Does NOT add new untracked files — only updates modifications and deletions
|
|
531
|
+
* for files git already knows about. Safe for automated snapshots where
|
|
532
|
+
* pulling in unknown untracked files (secrets, binaries) would be dangerous.
|
|
533
|
+
*/
|
|
534
|
+
export function nativeAddTracked(basePath) {
|
|
535
|
+
gitFileExec(basePath, ["add", "-u"]);
|
|
536
|
+
}
|
|
528
537
|
/**
|
|
529
538
|
* Stage all files with pathspec exclusions (git add -A -- ':!pattern' ...).
|
|
530
539
|
* Excluded paths are never hashed by git, preventing hangs on large
|
|
@@ -758,6 +767,36 @@ export function nativeResetHard(basePath) {
|
|
|
758
767
|
}
|
|
759
768
|
execSync("git reset --hard HEAD", { cwd: basePath, stdio: "pipe" });
|
|
760
769
|
}
|
|
770
|
+
/**
|
|
771
|
+
* Soft reset to a target ref (git reset --soft <ref>).
|
|
772
|
+
* Moves HEAD to `target` while keeping all changes staged in the index.
|
|
773
|
+
* Used to squash snapshot commits back into a single real commit.
|
|
774
|
+
*/
|
|
775
|
+
export function nativeResetSoft(basePath, target) {
|
|
776
|
+
execFileSync("git", ["reset", "--soft", target], {
|
|
777
|
+
cwd: basePath,
|
|
778
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
779
|
+
encoding: "utf-8",
|
|
780
|
+
env: GIT_NO_PROMPT_ENV,
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* Get the subject line of a commit (git log -1 --format=%s <ref>).
|
|
785
|
+
* Returns empty string if the ref doesn't exist.
|
|
786
|
+
*/
|
|
787
|
+
export function nativeCommitSubject(basePath, ref) {
|
|
788
|
+
try {
|
|
789
|
+
return execFileSync("git", ["log", "-1", "--format=%s", ref], {
|
|
790
|
+
cwd: basePath,
|
|
791
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
792
|
+
encoding: "utf-8",
|
|
793
|
+
env: GIT_NO_PROMPT_ENV,
|
|
794
|
+
}).trim();
|
|
795
|
+
}
|
|
796
|
+
catch {
|
|
797
|
+
return "";
|
|
798
|
+
}
|
|
799
|
+
}
|
|
761
800
|
/**
|
|
762
801
|
* Delete a branch.
|
|
763
802
|
* Native: libgit2 branch delete.
|
|
@@ -7,7 +7,12 @@ import { CmuxClient, emitOsc777Notification, resolveCmuxConfig } from "../cmux/i
|
|
|
7
7
|
* Send a native desktop notification. Non-blocking, non-fatal.
|
|
8
8
|
* macOS: osascript, Linux: notify-send, Windows: skipped.
|
|
9
9
|
*/
|
|
10
|
-
export function sendDesktopNotification(title, message, level = "info", kind = "complete") {
|
|
10
|
+
export function sendDesktopNotification(title, message, level = "info", kind = "complete", projectName) {
|
|
11
|
+
// When a projectName is provided and the title is the default "GSD",
|
|
12
|
+
// replace it with a project-qualified title for multi-project clarity.
|
|
13
|
+
if (projectName && title === "GSD") {
|
|
14
|
+
title = formatNotificationTitle(projectName);
|
|
15
|
+
}
|
|
11
16
|
const loaded = loadEffectiveGSDPreferences()?.preferences;
|
|
12
17
|
if (!shouldSendDesktopNotification(kind, loaded?.notifications))
|
|
13
18
|
return;
|
|
@@ -45,6 +50,16 @@ export function shouldSendDesktopNotification(kind, preferences = loadEffectiveG
|
|
|
45
50
|
return preferences?.on_complete ?? true;
|
|
46
51
|
}
|
|
47
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Format a notification title that includes the project name for context.
|
|
55
|
+
* Returns "GSD — projectName" when a project name is available, otherwise "GSD".
|
|
56
|
+
*/
|
|
57
|
+
export function formatNotificationTitle(projectName) {
|
|
58
|
+
const trimmed = projectName?.trim();
|
|
59
|
+
if (trimmed)
|
|
60
|
+
return `GSD — ${trimmed}`;
|
|
61
|
+
return "GSD";
|
|
62
|
+
}
|
|
48
63
|
export function buildDesktopNotificationCommand(platform, title, message, level = "info") {
|
|
49
64
|
const normalizedTitle = normalizeNotificationText(title);
|
|
50
65
|
const normalizedMessage = normalizeNotificationText(message);
|
|
@@ -74,7 +74,18 @@ export async function analyzeParallelEligibility(basePath) {
|
|
|
74
74
|
for (const mid of milestoneIds) {
|
|
75
75
|
const entry = registryMap.get(mid);
|
|
76
76
|
const title = entry?.title ?? mid;
|
|
77
|
-
|
|
77
|
+
// Rule 0: milestones with no registry entry (ghost directories, unknown
|
|
78
|
+
// state) are ineligible — we cannot determine their status or deps (#2501)
|
|
79
|
+
if (!entry) {
|
|
80
|
+
ineligible.push({
|
|
81
|
+
milestoneId: mid,
|
|
82
|
+
title,
|
|
83
|
+
eligible: false,
|
|
84
|
+
reason: "Milestone has no planning data — cannot determine eligibility.",
|
|
85
|
+
});
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const status = entry.status;
|
|
78
89
|
// Rule 1: skip complete and parked milestones
|
|
79
90
|
if (status === "complete" || status === "parked") {
|
|
80
91
|
ineligible.push({
|
|
@@ -86,7 +97,7 @@ export async function analyzeParallelEligibility(basePath) {
|
|
|
86
97
|
continue;
|
|
87
98
|
}
|
|
88
99
|
// Rule 2: check dependency satisfaction
|
|
89
|
-
const deps = entry
|
|
100
|
+
const deps = entry.dependsOn ?? [];
|
|
90
101
|
const unsatisfied = deps.filter(dep => {
|
|
91
102
|
const depEntry = registryMap.get(dep);
|
|
92
103
|
return !depEntry || depEntry.status !== "complete";
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
* Handles merging completed milestone worktrees back to main branch
|
|
5
5
|
* with safety checks for parallel execution context.
|
|
6
6
|
*/
|
|
7
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
import { spawnSync } from "node:child_process";
|
|
7
10
|
import { loadFile } from "./files.js";
|
|
8
11
|
import { resolveMilestoneFile } from "./paths.js";
|
|
9
12
|
import { mergeMilestoneToMain } from "./auto-worktree.js";
|
|
@@ -11,19 +14,89 @@ import { MergeConflictError } from "./git-service.js";
|
|
|
11
14
|
import { removeSessionStatus } from "./session-status-io.js";
|
|
12
15
|
import { getErrorMessage } from "./error-utils.js";
|
|
13
16
|
// ─── Merge Queue ───────────────────────────────────────────────────────────
|
|
17
|
+
/**
|
|
18
|
+
* Check whether a milestone is complete by querying its worktree SQLite DB.
|
|
19
|
+
* Uses a subprocess to avoid disrupting the global DB singleton.
|
|
20
|
+
* Returns true when milestones.status = 'complete' in the worktree's gsd.db.
|
|
21
|
+
*/
|
|
22
|
+
export function isMilestoneCompleteInWorktreeDb(basePath, mid) {
|
|
23
|
+
const dbPath = join(basePath, ".gsd", "worktrees", mid, ".gsd", "gsd.db");
|
|
24
|
+
if (!existsSync(dbPath))
|
|
25
|
+
return false;
|
|
26
|
+
try {
|
|
27
|
+
const result = spawnSync("sqlite3", [dbPath, `SELECT status FROM milestones WHERE id='${mid}' LIMIT 1`], { timeout: 3000, encoding: "utf-8" });
|
|
28
|
+
return (result.stdout || "").trim() === "complete";
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Discover milestone IDs with status='complete' in their worktree DB,
|
|
36
|
+
* scanning .gsd/worktrees/<MID>/.gsd/gsd.db for each worktree directory.
|
|
37
|
+
*/
|
|
38
|
+
function discoverDbCompletedMilestones(basePath) {
|
|
39
|
+
const completed = new Set();
|
|
40
|
+
const worktreeDir = join(basePath, ".gsd", "worktrees");
|
|
41
|
+
try {
|
|
42
|
+
for (const entry of readdirSync(worktreeDir)) {
|
|
43
|
+
if (entry.startsWith("M") && isMilestoneCompleteInWorktreeDb(basePath, entry)) {
|
|
44
|
+
completed.add(entry);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// worktrees dir may not exist
|
|
50
|
+
}
|
|
51
|
+
return completed;
|
|
52
|
+
}
|
|
14
53
|
/**
|
|
15
54
|
* Determine safe merge order for completed milestones.
|
|
16
55
|
* Sequential: merge in milestone ID order (M001 before M002).
|
|
17
56
|
* By-completion: merge in the order milestones finished.
|
|
57
|
+
*
|
|
58
|
+
* When basePath is provided, also checks worktree SQLite DBs as the
|
|
59
|
+
* source of truth — workers with stale orchestrator state (e.g. "error")
|
|
60
|
+
* are included if their worktree DB shows status='complete'.
|
|
61
|
+
* See: https://github.com/gsd-build/gsd-2/issues/2812
|
|
18
62
|
*/
|
|
19
|
-
export function determineMergeOrder(workers, order = "sequential") {
|
|
20
|
-
|
|
63
|
+
export function determineMergeOrder(workers, order = "sequential", basePath) {
|
|
64
|
+
// Start with workers the orchestrator already knows are stopped
|
|
65
|
+
const stoppedIds = new Set(workers.filter(w => w.state === "stopped").map(w => w.milestoneId));
|
|
66
|
+
// When basePath is available, also check worktree DBs for milestones
|
|
67
|
+
// whose orchestrator state is stale but are actually complete (#2812)
|
|
68
|
+
const dbCompleted = basePath ? discoverDbCompletedMilestones(basePath) : new Set();
|
|
69
|
+
// Union: milestone is mergeable if stopped OR DB-complete
|
|
70
|
+
const mergeableIds = new Set([...stoppedIds, ...dbCompleted]);
|
|
71
|
+
// Build the list from tracked workers + any DB-discovered milestones
|
|
72
|
+
// not tracked by the orchestrator at all
|
|
73
|
+
const workerMap = new Map(workers.map(w => [w.milestoneId, w]));
|
|
74
|
+
const allMergeable = [];
|
|
75
|
+
for (const mid of mergeableIds) {
|
|
76
|
+
const w = workerMap.get(mid);
|
|
77
|
+
if (w) {
|
|
78
|
+
allMergeable.push(w);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
// Milestone discovered from worktree DB but not in workers list
|
|
82
|
+
allMergeable.push({
|
|
83
|
+
milestoneId: mid,
|
|
84
|
+
title: mid,
|
|
85
|
+
pid: 0,
|
|
86
|
+
process: null,
|
|
87
|
+
worktreePath: basePath ? join(basePath, ".gsd", "worktrees", mid) : "",
|
|
88
|
+
startedAt: 0,
|
|
89
|
+
state: "stopped",
|
|
90
|
+
cost: 0,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
21
94
|
if (order === "by-completion") {
|
|
22
|
-
return
|
|
95
|
+
return allMergeable
|
|
23
96
|
.sort((a, b) => a.startedAt - b.startedAt) // earliest first
|
|
24
97
|
.map(w => w.milestoneId);
|
|
25
98
|
}
|
|
26
|
-
return
|
|
99
|
+
return allMergeable
|
|
27
100
|
.sort((a, b) => a.milestoneId.localeCompare(b.milestoneId))
|
|
28
101
|
.map(w => w.milestoneId);
|
|
29
102
|
}
|
|
@@ -82,7 +155,7 @@ export async function mergeCompletedMilestone(basePath, milestoneId) {
|
|
|
82
155
|
* Stops on first conflict and returns results so far.
|
|
83
156
|
*/
|
|
84
157
|
export async function mergeAllCompleted(basePath, workers, order = "sequential") {
|
|
85
|
-
const mergeOrder = determineMergeOrder(workers, order);
|
|
158
|
+
const mergeOrder = determineMergeOrder(workers, order, basePath);
|
|
86
159
|
const results = [];
|
|
87
160
|
for (const mid of mergeOrder) {
|
|
88
161
|
const result = await mergeCompletedMilestone(basePath, mid);
|
|
@@ -165,16 +165,26 @@ function _parsePlanImpl(content) {
|
|
|
165
165
|
const demo = extractBoldField(body, 'Demo') || '';
|
|
166
166
|
const mhSection = extractSection(body, 'Must-Haves');
|
|
167
167
|
const mustHaves = mhSection ? parseBullets(mhSection) : [];
|
|
168
|
+
// Parse tasks from ## Tasks section first, then scan the full body for any
|
|
169
|
+
// task checkboxes that were missed. Multi-task plans can interleave T01 detail
|
|
170
|
+
// headings (## Steps, ## Must-Haves) before T02's checkbox, which causes
|
|
171
|
+
// extractSection("Tasks") to stop at the first ## heading and miss T02+ (#3105).
|
|
168
172
|
const tasksSection = extractSection(body, 'Tasks');
|
|
169
173
|
const tasks = [];
|
|
170
|
-
|
|
171
|
-
|
|
174
|
+
// Parse task entries from a set of lines, appending to `tasks`.
|
|
175
|
+
const parseTaskLines = (lines, knownIds) => {
|
|
172
176
|
let currentTask = null;
|
|
173
|
-
for (const line of
|
|
177
|
+
for (const line of lines) {
|
|
174
178
|
const cbMatch = line.match(/^-\s+\[([ xX])\]\s+\*\*([\w.]+):\s+(.+?)\*\*\s*(.*)/);
|
|
175
179
|
// Heading-style: ### T01 -- Title, ### T01: Title, ### T01 — Title
|
|
176
180
|
const hdMatch = !cbMatch ? line.match(/^#{2,4}\s+([\w.]+)\s*(?:--|—|:)\s*(.+)/) : null;
|
|
177
181
|
if (cbMatch || hdMatch) {
|
|
182
|
+
const taskId = cbMatch ? cbMatch[2] : hdMatch[1];
|
|
183
|
+
// Skip tasks already found in the Tasks section
|
|
184
|
+
if (knownIds.has(taskId)) {
|
|
185
|
+
currentTask = null;
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
178
188
|
if (currentTask)
|
|
179
189
|
tasks.push(currentTask);
|
|
180
190
|
if (cbMatch) {
|
|
@@ -229,7 +239,14 @@ function _parsePlanImpl(content) {
|
|
|
229
239
|
}
|
|
230
240
|
if (currentTask)
|
|
231
241
|
tasks.push(currentTask);
|
|
242
|
+
};
|
|
243
|
+
if (tasksSection) {
|
|
244
|
+
parseTaskLines(tasksSection.split('\n'), new Set());
|
|
232
245
|
}
|
|
246
|
+
// Second pass: scan the full body for task checkboxes outside ## Tasks.
|
|
247
|
+
// This handles interleaved plans where T02+ appear after T01's detail headings.
|
|
248
|
+
const foundIds = new Set(tasks.map(t => t.id));
|
|
249
|
+
parseTaskLines(body.split('\n'), foundIds);
|
|
233
250
|
const filesSection = extractSection(body, 'Files Likely Touched');
|
|
234
251
|
const filesLikelyTouched = filesSection ? parseBullets(filesSection) : [];
|
|
235
252
|
const result = { id, title, goal, demo, mustHaves, tasks, filesLikelyTouched };
|
|
@@ -254,6 +254,7 @@ export const GSD_ROOT_FILES = {
|
|
|
254
254
|
REQUIREMENTS: "REQUIREMENTS.md",
|
|
255
255
|
OVERRIDES: "OVERRIDES.md",
|
|
256
256
|
KNOWLEDGE: "KNOWLEDGE.md",
|
|
257
|
+
CODEBASE: "CODEBASE.md",
|
|
257
258
|
};
|
|
258
259
|
const LEGACY_GSD_ROOT_FILES = {
|
|
259
260
|
PROJECT: "project.md",
|
|
@@ -263,6 +264,7 @@ const LEGACY_GSD_ROOT_FILES = {
|
|
|
263
264
|
REQUIREMENTS: "requirements.md",
|
|
264
265
|
OVERRIDES: "overrides.md",
|
|
265
266
|
KNOWLEDGE: "knowledge.md",
|
|
267
|
+
CODEBASE: "codebase.md",
|
|
266
268
|
};
|
|
267
269
|
// ─── GSD Root Discovery ───────────────────────────────────────────────────────
|
|
268
270
|
const gsdRootCache = new Map();
|
|
@@ -289,11 +291,51 @@ export function gsdRoot(basePath) {
|
|
|
289
291
|
gsdRootCache.set(basePath, result);
|
|
290
292
|
return result;
|
|
291
293
|
}
|
|
294
|
+
/**
|
|
295
|
+
* Detect if a path is inside a .gsd/worktrees/<name>/ structure.
|
|
296
|
+
*
|
|
297
|
+
* GSD auto-worktrees live at <project>/.gsd/worktrees/<milestoneId>/.
|
|
298
|
+
* When gsdRoot() is called with such a path, we must NOT walk up to the
|
|
299
|
+
* project root's .gsd — each worktree manages its own .gsd state (#2594).
|
|
300
|
+
*
|
|
301
|
+
* Matches both forward-slash and platform-native separators to handle
|
|
302
|
+
* Windows paths (path.sep = '\\') and normalized Unix paths.
|
|
303
|
+
*/
|
|
304
|
+
function isInsideGsdWorktree(p) {
|
|
305
|
+
// Match /.gsd/worktrees/<name> where <name> is the final segment or
|
|
306
|
+
// followed by a separator. The <name> segment must be non-empty.
|
|
307
|
+
const sepFwd = "/";
|
|
308
|
+
const sepNative = "\\";
|
|
309
|
+
const markers = [
|
|
310
|
+
`${sepFwd}.gsd${sepFwd}worktrees${sepFwd}`,
|
|
311
|
+
`${sepNative}.gsd${sepNative}worktrees${sepNative}`,
|
|
312
|
+
];
|
|
313
|
+
for (const marker of markers) {
|
|
314
|
+
const idx = p.indexOf(marker);
|
|
315
|
+
if (idx === -1)
|
|
316
|
+
continue;
|
|
317
|
+
// Verify there's a non-empty worktree name after the marker
|
|
318
|
+
const afterMarker = p.slice(idx + marker.length);
|
|
319
|
+
// The name is everything up to the next separator (or end of string)
|
|
320
|
+
const nameEnd = afterMarker.search(/[/\\]/);
|
|
321
|
+
const name = nameEnd === -1 ? afterMarker : afterMarker.slice(0, nameEnd);
|
|
322
|
+
if (name.length > 0)
|
|
323
|
+
return true;
|
|
324
|
+
}
|
|
325
|
+
return false;
|
|
326
|
+
}
|
|
292
327
|
function probeGsdRoot(rawBasePath) {
|
|
293
328
|
// 1. Fast path — check the input path directly
|
|
294
329
|
const local = join(rawBasePath, ".gsd");
|
|
295
330
|
if (existsSync(local))
|
|
296
331
|
return local;
|
|
332
|
+
// 1b. Worktree guard (#2594) — if basePath is inside a .gsd/worktrees/<name>/
|
|
333
|
+
// structure, return the worktree-local .gsd path immediately. Without this,
|
|
334
|
+
// the git-root probe (step 2) or walk-up (step 3) escapes to the project
|
|
335
|
+
// root's .gsd, causing ensurePreconditions() and deriveState() to read/write
|
|
336
|
+
// state in the wrong location.
|
|
337
|
+
if (isInsideGsdWorktree(rawBasePath))
|
|
338
|
+
return local;
|
|
297
339
|
// Resolve symlinks so path comparisons work correctly across platforms
|
|
298
340
|
// (e.g. macOS /var → /private/var). Use rawBasePath as fallback if not resolvable.
|
|
299
341
|
let basePath;
|
|
@@ -303,6 +345,9 @@ function probeGsdRoot(rawBasePath) {
|
|
|
303
345
|
catch {
|
|
304
346
|
basePath = rawBasePath;
|
|
305
347
|
}
|
|
348
|
+
// Also check the resolved path for the worktree pattern (macOS /tmp → /private/tmp)
|
|
349
|
+
if (basePath !== rawBasePath && isInsideGsdWorktree(basePath))
|
|
350
|
+
return local;
|
|
306
351
|
// 2. Git root anchor — used as both probe target and walk-up boundary
|
|
307
352
|
// Only walk if we're inside a git project — prevents escaping into
|
|
308
353
|
// unrelated filesystem territory when running outside any repo.
|
|
@@ -53,6 +53,7 @@ export function resolveModelWithFallbacksForUnit(unitType) {
|
|
|
53
53
|
break;
|
|
54
54
|
case "complete-slice":
|
|
55
55
|
case "complete-milestone":
|
|
56
|
+
case "worktree-merge":
|
|
56
57
|
case "run-uat":
|
|
57
58
|
phaseConfig = m.completion;
|
|
58
59
|
break;
|
|
@@ -110,6 +111,18 @@ export function getNextFallbackModel(currentModelId, modelConfig) {
|
|
|
110
111
|
return modelsToTry[0];
|
|
111
112
|
}
|
|
112
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Detect whether an error message indicates a transient network error
|
|
116
|
+
* (worth retrying the same model) vs a permanent provider error
|
|
117
|
+
* (auth failure, quota exceeded, etc. -- should fall back immediately).
|
|
118
|
+
*/
|
|
119
|
+
export function isTransientNetworkError(errorMsg) {
|
|
120
|
+
if (!errorMsg)
|
|
121
|
+
return false;
|
|
122
|
+
const hasNetworkSignal = /network|ECONNRESET|ETIMEDOUT|ECONNREFUSED|socket hang up|fetch failed|connection.*reset|dns/i.test(errorMsg);
|
|
123
|
+
const hasPermanentSignal = /auth|unauthorized|forbidden|invalid.*key|quota|billing/i.test(errorMsg);
|
|
124
|
+
return hasNetworkSignal && !hasPermanentSignal;
|
|
125
|
+
}
|
|
113
126
|
/**
|
|
114
127
|
* Validate a model ID string.
|
|
115
128
|
* Returns true if the ID looks like a valid model identifier.
|
|
@@ -273,7 +286,7 @@ export function resolveContextSelection() {
|
|
|
273
286
|
return profile === "budget" ? "smart" : "full";
|
|
274
287
|
}
|
|
275
288
|
/**
|
|
276
|
-
* Resolve the search provider preference from
|
|
289
|
+
* Resolve the search provider preference from preferences.md.
|
|
277
290
|
* Returns undefined if not configured (caller falls back to existing behavior).
|
|
278
291
|
*/
|
|
279
292
|
export function resolveSearchProviderFromPreferences() {
|
|
@@ -70,12 +70,14 @@ export const KNOWN_PREFERENCE_KEYS = new Set([
|
|
|
70
70
|
"service_tier",
|
|
71
71
|
"forensics_dedup",
|
|
72
72
|
"show_token_cost",
|
|
73
|
+
"stale_commit_threshold_minutes",
|
|
73
74
|
"experimental",
|
|
74
75
|
]);
|
|
75
76
|
/** Canonical list of all dispatch unit types. */
|
|
76
77
|
export const KNOWN_UNIT_TYPES = [
|
|
77
78
|
"research-milestone", "plan-milestone", "research-slice", "plan-slice",
|
|
78
79
|
"execute-task", "reactive-execute", "gate-evaluate", "complete-slice", "replan-slice", "reassess-roadmap",
|
|
79
|
-
"run-uat", "complete-milestone",
|
|
80
|
+
"run-uat", "complete-milestone", "validate-milestone", "rewrite-docs",
|
|
81
|
+
"discuss-milestone", "discuss-slice", "worktree-merge",
|
|
80
82
|
];
|
|
81
83
|
export const SKILL_ACTIONS = new Set(["use", "prefer", "avoid"]);
|