gsd-pi 2.57.0 → 2.58.0-dev.394cb18
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 +58 -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/infra-errors.js +4 -0
- 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 +20 -5
- 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 +206 -14
- package/dist/resources/extensions/gsd/auto.js +4 -0
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +32 -0
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +82 -9
- 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/dispatch-guard.js +11 -1
- 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 +44 -10
- 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/parallel-orchestrator.js +23 -6
- 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 +42 -31
- 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/prompts/validate-milestone.md +2 -2
- 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 +18 -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/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/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 +9 -9
- package/dist/web/standalone/.next/build-manifest.json +4 -4
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
- package/dist/web/standalone/.next/required-server-files.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +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.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +4 -4
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- 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.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +5 -5
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +5 -5
- 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 +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +9 -9
- package/dist/web/standalone/.next/server/chunks/2229.js +2 -2
- package/dist/web/standalone/.next/server/chunks/7471.js +3 -3
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware.js +2 -2
- package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +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/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-0c485498795110d6.js +1 -0
- package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-4332cbd5dd1be584.js → webpack-a1c1e452c6b32d04.js} +1 -1
- package/dist/web/standalone/.next/static/css/f6e8833d46e738d8.css +1 -0
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
- package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
- package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
- package/dist/web/standalone/server.js +1 -1
- package/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/daemon/src/cli.ts +49 -0
- package/packages/daemon/src/daemon.test.ts +104 -1
- package/packages/daemon/src/daemon.ts +24 -1
- package/packages/daemon/src/discord-bot.ts +73 -3
- package/packages/daemon/src/event-bridge.ts +15 -9
- package/packages/daemon/src/event-formatter.ts +30 -2
- package/packages/daemon/src/index.ts +9 -0
- package/packages/daemon/src/launchd.test.ts +356 -0
- package/packages/daemon/src/launchd.ts +242 -0
- package/packages/daemon/src/message-batcher.test.ts +2 -2
- package/packages/daemon/src/message-batcher.ts +9 -3
- package/packages/daemon/src/orchestrator.test.ts +1 -0
- package/packages/daemon/src/orchestrator.ts +106 -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/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/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 +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/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/package.json +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/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/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 +6 -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/pkg/package.json +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/infra-errors.ts +3 -0
- 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 +21 -5
- 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 +200 -11
- package/src/resources/extensions/gsd/auto.ts +5 -0
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +31 -0
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +87 -9
- 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/dispatch-guard.ts +12 -1
- 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 +49 -8
- 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/parallel-orchestrator.ts +23 -6
- 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 +45 -29
- 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/prompts/validate-milestone.md +2 -2
- 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 +47 -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/dispatch-guard.test.ts +47 -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/parallel-worker-monitoring.test.ts +9 -8
- 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/preferences.test.ts +34 -0
- package/src/resources/extensions/gsd/tests/project-relocation-recovery.test.ts +297 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +36 -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 +27 -2
- package/src/resources/extensions/gsd/tests/validation-gate-patterns.test.ts +44 -2
- 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-db-same-file.test.ts +175 -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 +25 -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/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.2305d0afd2385711.js +0 -9
- package/dist/web/standalone/.next/static/chunks/app/page-62be3b5fa91e4c8f.js +0 -1
- package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
- package/dist/web/standalone/.next/static/css/a58ef8a151aa0493.css +0 -1
- package/src/resources/extensions/gsd/tests/empty-db-reconciliation.test.ts +0 -79
- /package/dist/web/standalone/.next/static/{yowc5qPtuKxjOr22KmOAy → uDm3eO1oo9lDfY2TyoO9t}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{yowc5qPtuKxjOr22KmOAy → uDm3eO1oo9lDfY2TyoO9t}/_ssgManifest.js +0 -0
|
@@ -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);
|
|
@@ -406,8 +406,19 @@ function createMilestoneWorktree(basePath, milestoneId) {
|
|
|
406
406
|
// ─── Worker Spawning ───────────────────────────────────────────────────
|
|
407
407
|
/**
|
|
408
408
|
* Spawn a worker process for a milestone.
|
|
409
|
-
* The worker runs `gsd --
|
|
409
|
+
* The worker runs `gsd headless --json auto` in the milestone's worktree
|
|
410
410
|
* with GSD_MILESTONE_LOCK set to isolate state derivation.
|
|
411
|
+
*
|
|
412
|
+
* IMPORTANT: We use `headless --json auto` instead of `--print "/gsd auto"`.
|
|
413
|
+
* --print mode calls session.prompt() which returns immediately after the
|
|
414
|
+
* extension command handler fires, because auto-mode's ctx.newSession()
|
|
415
|
+
* resets the session and unblocks the outer prompt() await. This causes
|
|
416
|
+
* process.exit(0) to fire before any LLM work happens. See #2792.
|
|
417
|
+
*
|
|
418
|
+
* The headless subcommand uses an RPC client that keeps the process alive
|
|
419
|
+
* until auto-mode emits a terminal notification or the idle timer fires.
|
|
420
|
+
* It outputs NDJSON events to stdout (with --json), which our
|
|
421
|
+
* processWorkerLine() parser already understands.
|
|
411
422
|
*/
|
|
412
423
|
export function spawnWorker(basePath, milestoneId) {
|
|
413
424
|
if (!state)
|
|
@@ -423,7 +434,7 @@ export function spawnWorker(basePath, milestoneId) {
|
|
|
423
434
|
return false;
|
|
424
435
|
let child;
|
|
425
436
|
try {
|
|
426
|
-
child = spawn(process.execPath, [binPath, "
|
|
437
|
+
child = spawn(process.execPath, [binPath, "headless", "--json", "auto"], {
|
|
427
438
|
cwd: worker.worktreePath,
|
|
428
439
|
env: {
|
|
429
440
|
...process.env,
|
|
@@ -461,9 +472,10 @@ export function spawnWorker(basePath, milestoneId) {
|
|
|
461
472
|
return false;
|
|
462
473
|
}
|
|
463
474
|
// ── NDJSON stdout monitoring ────────────────────────────────────────
|
|
464
|
-
// Workers run
|
|
465
|
-
// We parse message_end events to extract
|
|
466
|
-
// the coordinator's cost tracking in sync
|
|
475
|
+
// Workers run via `headless --json`, which forwards all RPC events
|
|
476
|
+
// as NDJSON to stdout. We parse message_end events to extract
|
|
477
|
+
// cost/token usage, keeping the coordinator's cost tracking in sync
|
|
478
|
+
// with actual API spend.
|
|
467
479
|
if (child.stdout) {
|
|
468
480
|
let stdoutBuffer = "";
|
|
469
481
|
child.stdout.on("data", (data) => {
|
|
@@ -674,7 +686,12 @@ export async function stopParallel(basePath, milestoneId) {
|
|
|
674
686
|
}
|
|
675
687
|
catch { /* process may already be dead */ }
|
|
676
688
|
}
|
|
677
|
-
|
|
689
|
+
// Wait for the headless process to cascade SIGTERM to its RPC child.
|
|
690
|
+
// The headless signal handler calls client.stop() which sends SIGTERM
|
|
691
|
+
// to the RPC child and waits up to 1000ms. The previous 750ms window
|
|
692
|
+
// was insufficient — the parent got SIGKILL before the child died,
|
|
693
|
+
// leaving orphaned RPC processes holding auto.lock. See #2798.
|
|
694
|
+
const exitedAfterTerm = await waitForWorkerExit(worker, 3000);
|
|
678
695
|
if (!exitedAfterTerm && worker.pid > 0) {
|
|
679
696
|
try {
|
|
680
697
|
if (worker.process) {
|
|
@@ -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"]);
|
|
@@ -16,7 +16,7 @@ import { gsdRoot } from "./paths.js";
|
|
|
16
16
|
import { parse as parseYaml } from "yaml";
|
|
17
17
|
import { normalizeStringArray } from "../shared/format-utils.js";
|
|
18
18
|
import { resolveProfileDefaults as _resolveProfileDefaults } from "./preferences-models.js";
|
|
19
|
-
import { MODE_DEFAULTS, } from "./preferences-types.js";
|
|
19
|
+
import { KNOWN_PREFERENCE_KEYS, MODE_DEFAULTS, } from "./preferences-types.js";
|
|
20
20
|
import { validatePreferences } from "./preferences-validation.js";
|
|
21
21
|
import { formatSkillRef } from "./preferences-skills.js";
|
|
22
22
|
// ─── Re-exports: validation ─────────────────────────────────────────────────
|
|
@@ -24,27 +24,27 @@ export { validatePreferences } from "./preferences-validation.js";
|
|
|
24
24
|
// ─── Re-exports: skills ─────────────────────────────────────────────────────
|
|
25
25
|
export { resolveAllSkillReferences, resolveSkillDiscoveryMode, resolveSkillStalenessDays, } from "./preferences-skills.js";
|
|
26
26
|
// ─── Re-exports: models ─────────────────────────────────────────────────────
|
|
27
|
-
export { resolveModelForUnit, resolveModelWithFallbacksForUnit, getNextFallbackModel, validateModelId, updatePreferencesModels, resolveDynamicRoutingConfig, resolveAutoSupervisorConfig, resolveProfileDefaults, resolveEffectiveProfile, resolveInlineLevel, resolveContextSelection, resolveSearchProviderFromPreferences, } from "./preferences-models.js";
|
|
27
|
+
export { resolveModelForUnit, resolveModelWithFallbacksForUnit, getNextFallbackModel, isTransientNetworkError, validateModelId, updatePreferencesModels, resolveDynamicRoutingConfig, resolveAutoSupervisorConfig, resolveProfileDefaults, resolveEffectiveProfile, resolveInlineLevel, resolveContextSelection, resolveSearchProviderFromPreferences, } from "./preferences-models.js";
|
|
28
28
|
// ─── Path Constants & Getters ───────────────────────────────────────────────
|
|
29
29
|
function gsdHome() {
|
|
30
30
|
return process.env.GSD_HOME || join(homedir(), ".gsd");
|
|
31
31
|
}
|
|
32
32
|
function globalPreferencesPath() {
|
|
33
|
-
return join(gsdHome(), "
|
|
33
|
+
return join(gsdHome(), "preferences.md");
|
|
34
34
|
}
|
|
35
35
|
function legacyGlobalPreferencesPath() {
|
|
36
36
|
return join(homedir(), ".pi", "agent", "gsd-preferences.md");
|
|
37
37
|
}
|
|
38
38
|
function projectPreferencesPath() {
|
|
39
|
-
return join(gsdRoot(process.cwd()), "
|
|
39
|
+
return join(gsdRoot(process.cwd()), "preferences.md");
|
|
40
40
|
}
|
|
41
|
-
//
|
|
42
|
-
// Check
|
|
43
|
-
function
|
|
44
|
-
return join(gsdHome(), "
|
|
41
|
+
// Bootstrap in gitignore.ts historically created PREFERENCES.md (uppercase) by mistake.
|
|
42
|
+
// Check uppercase as a fallback so those files aren't silently ignored.
|
|
43
|
+
function globalPreferencesPathUppercase() {
|
|
44
|
+
return join(gsdHome(), "PREFERENCES.md");
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return join(gsdRoot(process.cwd()), "
|
|
46
|
+
function projectPreferencesPathUppercase() {
|
|
47
|
+
return join(gsdRoot(process.cwd()), "PREFERENCES.md");
|
|
48
48
|
}
|
|
49
49
|
export function getGlobalGSDPreferencesPath() {
|
|
50
50
|
return globalPreferencesPath();
|
|
@@ -58,12 +58,12 @@ export function getProjectGSDPreferencesPath() {
|
|
|
58
58
|
// ─── Loading ────────────────────────────────────────────────────────────────
|
|
59
59
|
export function loadGlobalGSDPreferences() {
|
|
60
60
|
return loadPreferencesFile(globalPreferencesPath(), "global")
|
|
61
|
-
?? loadPreferencesFile(
|
|
61
|
+
?? loadPreferencesFile(globalPreferencesPathUppercase(), "global")
|
|
62
62
|
?? loadPreferencesFile(legacyGlobalPreferencesPath(), "global");
|
|
63
63
|
}
|
|
64
64
|
export function loadProjectGSDPreferences() {
|
|
65
65
|
return loadPreferencesFile(projectPreferencesPath(), "project")
|
|
66
|
-
?? loadPreferencesFile(
|
|
66
|
+
?? loadPreferencesFile(projectPreferencesPathUppercase(), "project");
|
|
67
67
|
}
|
|
68
68
|
export function loadEffectiveGSDPreferences() {
|
|
69
69
|
const globalPreferences = loadGlobalGSDPreferences();
|
|
@@ -149,7 +149,7 @@ export function parsePreferencesMarkdown(content) {
|
|
|
149
149
|
}
|
|
150
150
|
if (!_warnedUnrecognizedFormat) {
|
|
151
151
|
_warnedUnrecognizedFormat = true;
|
|
152
|
-
console.warn("[parsePreferencesMarkdown]
|
|
152
|
+
console.warn("[parsePreferencesMarkdown] preferences.md exists but uses an unrecognized format — skipping.");
|
|
153
153
|
}
|
|
154
154
|
return null;
|
|
155
155
|
}
|
|
@@ -183,28 +183,42 @@ function parseHeadingListFormat(content) {
|
|
|
183
183
|
const headingMatch = line.match(/^##\s+(.+)$/);
|
|
184
184
|
if (headingMatch) {
|
|
185
185
|
currentSection = headingMatch[1].trim().toLowerCase().replace(/\s+/g, '_');
|
|
186
|
+
if (!result[currentSection])
|
|
187
|
+
result[currentSection] = [];
|
|
186
188
|
continue;
|
|
187
189
|
}
|
|
188
|
-
if (currentSection) {
|
|
189
|
-
|
|
190
|
-
if (itemMatch) {
|
|
191
|
-
if (!result[currentSection])
|
|
192
|
-
result[currentSection] = {};
|
|
193
|
-
const value = itemMatch[2].trim();
|
|
194
|
-
// Coerce "true"/"false" strings and numbers
|
|
195
|
-
result[currentSection][itemMatch[1].trim()] = value;
|
|
196
|
-
}
|
|
190
|
+
if (currentSection && line.trim() && !line.trimStart().startsWith('#')) {
|
|
191
|
+
result[currentSection].push(line);
|
|
197
192
|
}
|
|
198
193
|
}
|
|
199
|
-
// Convert string values to appropriate types via YAML parser for each section
|
|
200
194
|
const typed = {};
|
|
201
|
-
for (const [section,
|
|
202
|
-
|
|
195
|
+
for (const [section, lines] of Object.entries(result)) {
|
|
196
|
+
if (lines.length === 0)
|
|
197
|
+
continue;
|
|
198
|
+
const usesLegacyListItems = lines.every((line) => /^\s*-\s+[^:]+:\s*.*$/.test(line));
|
|
199
|
+
const yamlBlock = usesLegacyListItems
|
|
200
|
+
? lines.map((line) => line.replace(/^\s*-\s+/, '')).join('\n')
|
|
201
|
+
: lines.join('\n');
|
|
203
202
|
try {
|
|
204
|
-
|
|
203
|
+
const parsed = parseYaml(yamlBlock);
|
|
204
|
+
if (typeof parsed !== 'object' || parsed === null)
|
|
205
|
+
continue;
|
|
206
|
+
let targetSection = section;
|
|
207
|
+
let value = parsed;
|
|
208
|
+
if (!Array.isArray(parsed)) {
|
|
209
|
+
const keys = Object.keys(parsed);
|
|
210
|
+
if (keys.length === 1) {
|
|
211
|
+
const [onlyKey] = keys;
|
|
212
|
+
if (onlyKey === section || (!KNOWN_PREFERENCE_KEYS.has(section) && KNOWN_PREFERENCE_KEYS.has(onlyKey))) {
|
|
213
|
+
targetSection = onlyKey;
|
|
214
|
+
value = parsed[onlyKey];
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
typed[targetSection] = value;
|
|
205
219
|
}
|
|
206
220
|
catch {
|
|
207
|
-
|
|
221
|
+
/* malformed section — skip */
|
|
208
222
|
}
|
|
209
223
|
}
|
|
210
224
|
return typed;
|
|
@@ -275,9 +289,6 @@ function mergePreferences(base, override) {
|
|
|
275
289
|
service_tier: override.service_tier ?? base.service_tier,
|
|
276
290
|
forensics_dedup: override.forensics_dedup ?? base.forensics_dedup,
|
|
277
291
|
show_token_cost: override.show_token_cost ?? base.show_token_cost,
|
|
278
|
-
experimental: (base.experimental || override.experimental)
|
|
279
|
-
? { ...(base.experimental ?? {}), ...(override.experimental ?? {}) }
|
|
280
|
-
: undefined,
|
|
281
292
|
};
|
|
282
293
|
}
|
|
283
294
|
function mergeStringLists(base, override) {
|
|
@@ -398,7 +409,7 @@ export function resolvePreDispatchHooks() {
|
|
|
398
409
|
* Resolve the effective git isolation mode from preferences.
|
|
399
410
|
* Returns "none" (default), "worktree", or "branch".
|
|
400
411
|
*
|
|
401
|
-
* Default is "none" so GSD works out of the box without
|
|
412
|
+
* Default is "none" so GSD works out of the box without preferences.md.
|
|
402
413
|
* Worktree isolation requires explicit opt-in because it depends on git
|
|
403
414
|
* branch infrastructure that must be set up before use.
|
|
404
415
|
*/
|
|
@@ -124,7 +124,10 @@ export function loadPrompt(name, vars = {}) {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
for (const [key, value] of Object.entries(effectiveVars)) {
|
|
127
|
-
|
|
127
|
+
// Use split/join instead of replaceAll to avoid JavaScript's special
|
|
128
|
+
// replacement patterns ($', $`, $&) being interpreted in the value.
|
|
129
|
+
// See: https://github.com/gsd-build/gsd-2/issues/2968
|
|
130
|
+
content = content.split(`{{${key}}}`).join(value);
|
|
128
131
|
}
|
|
129
132
|
return content.trim();
|
|
130
133
|
}
|
|
@@ -56,7 +56,7 @@ Then:
|
|
|
56
56
|
- `followUps` (string) — Follow-up items for future milestones
|
|
57
57
|
- `deviations` (string) — Deviations from the original plan
|
|
58
58
|
10. For each requirement whose status changed in step 8, call `gsd_requirement_update` with the requirement ID and updated `status` and `validation` fields — the tool regenerates `.gsd/REQUIREMENTS.md` automatically.
|
|
59
|
-
11. Update `.gsd/PROJECT.md`
|
|
59
|
+
11. Update `.gsd/PROJECT.md`: use the `write` tool with `path: ".gsd/PROJECT.md"` and `content` containing the full updated document reflecting milestone completion and current project state. Do NOT use the `edit` tool for this — PROJECT.md is a full-document refresh.
|
|
60
60
|
12. Review all slice summaries for cross-cutting lessons, patterns, or gotchas that emerged during this milestone. Append any non-obvious, reusable insights to `.gsd/KNOWLEDGE.md`.
|
|
61
61
|
13. Do not commit manually — the system auto-commits your changes after this unit completes.
|
|
62
62
|
- Say: "Milestone {{milestoneId}} complete."
|
|
@@ -29,9 +29,11 @@ Then:
|
|
|
29
29
|
8. Write `{{sliceUatPath}}` — a concrete UAT script with real test cases derived from the slice plan and task summaries. Include preconditions, numbered steps with expected outcomes, and edge cases. This must NOT be a placeholder or generic template — tailor every test case to what this slice actually built.
|
|
30
30
|
9. Review task summaries for `key_decisions`. Append any significant decisions to `.gsd/DECISIONS.md` if missing.
|
|
31
31
|
10. Review task summaries for patterns, gotchas, or non-obvious lessons learned. If any would save future agents from repeating investigation or hitting the same issues, append them to `.gsd/KNOWLEDGE.md`. Only add entries that are genuinely useful — don't pad with obvious observations.
|
|
32
|
-
11. Call `gsd_complete_slice` with
|
|
32
|
+
11. Call `gsd_complete_slice` with milestoneId, sliceId, the slice summary, and the UAT result. Do NOT manually mark the roadmap checkbox — the tool writes to the DB and renders the ROADMAP.md projection automatically.
|
|
33
33
|
12. Do not run git commands — the system commits your changes and handles any merge after this unit succeeds.
|
|
34
|
-
13. Update `.gsd/PROJECT.md` if it exists — refresh current state if needed.
|
|
34
|
+
13. Update `.gsd/PROJECT.md` if it exists — refresh current state if needed: use the `write` tool with `path: ".gsd/PROJECT.md"` and `content` containing the full updated document reflecting current project state. Do NOT use the `edit` tool for this — PROJECT.md is a full-document refresh.
|
|
35
|
+
|
|
36
|
+
**Autonomous execution:** Do not call `ask_user_questions` or `secure_env_collect`. You are running in auto-mode — there is no human available to answer questions. Make reasonable assumptions and document them in the slice summary. If a decision genuinely requires human input, note it in the summary and proceed with the best available option.
|
|
35
37
|
|
|
36
38
|
**You MUST call `gsd_complete_slice` with the slice summary and UAT content before finishing. The tool persists to both DB and disk and renders `{{sliceSummaryPath}}` and `{{sliceUatPath}}` automatically.**
|
|
37
39
|
|
|
@@ -38,7 +38,7 @@ Do a mandatory investigation pass before making any decisions. This is not optio
|
|
|
38
38
|
3. **Web search** — `search-the-web` if the domain is unfamiliar, if you need current best practices, or if the spec references external services/APIs you need facts about. Use `fetch_page` for full content when snippets aren't enough.
|
|
39
39
|
|
|
40
40
|
**Web search budget:** Budget carefully across investigation + focused research:
|
|
41
|
-
- Prefer `resolve_library` / `get_library_docs` over `
|
|
41
|
+
- Prefer `resolve_library` / `get_library_docs` over `search-the-web` for library documentation.
|
|
42
42
|
- Prefer `search_and_read` for one-shot topic research.
|
|
43
43
|
- Target 2-3 web searches in this investigation pass. Save remaining budget for focused research.
|
|
44
44
|
- Do NOT repeat the same or similar queries.
|
|
@@ -37,7 +37,7 @@ Before asking your first question, do a mandatory investigation pass. This is no
|
|
|
37
37
|
3. **Web search** — `search-the-web` if the domain is unfamiliar, if you need current best practices, or if the user referenced external services/APIs you need facts about. Use `fetch_page` for full content when snippets aren't enough.
|
|
38
38
|
|
|
39
39
|
**Web search budget:** You have a limited number of web searches per turn (typically 3-5). The discuss phase spans many turns (investigation, question rounds, focused research, requirements), so budget carefully:
|
|
40
|
-
- Prefer `resolve_library` / `get_library_docs` over `
|
|
40
|
+
- Prefer `resolve_library` / `get_library_docs` over `search-the-web` for library documentation — they don't consume the web search budget.
|
|
41
41
|
- Prefer `search_and_read` for one-shot topic research — it combines search + page fetch in a single call.
|
|
42
42
|
- Target 2-3 web searches in the investigation pass. Save remaining budget for the focused research pass before roadmap creation.
|
|
43
43
|
- Do NOT repeat the same or similar queries. If a search didn't find what you need, rephrase once or move on.
|
|
@@ -68,11 +68,13 @@ Then:
|
|
|
68
68
|
17. If you discover a non-obvious rule, recurring gotcha, or useful pattern during execution, append it to `.gsd/KNOWLEDGE.md`. Only add entries that would save future agents from repeating your investigation. Don't add obvious things.
|
|
69
69
|
18. Read the template at `~/.gsd/agent/extensions/gsd/templates/task-summary.md`
|
|
70
70
|
19. Write `{{taskSummaryPath}}`
|
|
71
|
-
20. Call `gsd_complete_task` with
|
|
71
|
+
20. Call `gsd_complete_task` with milestoneId, sliceId, taskId, and a summary of what was accomplished. This is your final required step — do NOT manually edit PLAN.md checkboxes. The tool marks the task complete, updates the DB, and renders PLAN.md automatically.
|
|
72
72
|
21. Do not run git commands — the system reads your task summary after completion and creates a meaningful commit from it (type inferred from title, message from your one-liner, key files from frontmatter). Write a clear, specific one-liner in the summary — it becomes the commit message.
|
|
73
73
|
|
|
74
74
|
All work stays in your working directory: `{{workingDirectory}}`.
|
|
75
75
|
|
|
76
|
+
**Autonomous execution:** Do not call `ask_user_questions` or `secure_env_collect`. You are running in auto-mode — there is no human available to answer questions. Make reasonable assumptions and document them in the task summary. If a decision genuinely requires human input, note it in the summary and proceed with the best available option.
|
|
77
|
+
|
|
76
78
|
**You MUST call `gsd_complete_task` AND write `{{taskSummaryPath}}` before finishing.**
|
|
77
79
|
|
|
78
80
|
When done, say: "Task {{taskId}} complete."
|