gsd-pi 2.41.0 → 2.42.0-dev.1df898f
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 +92 -29
- package/dist/cli-web-branch.d.ts +6 -0
- package/dist/cli-web-branch.js +17 -0
- package/dist/cli.js +18 -3
- package/dist/loader.js +3 -1
- package/dist/onboarding.js +2 -1
- package/dist/resource-loader.js +39 -6
- package/dist/resources/extensions/async-jobs/async-bash-tool.js +52 -4
- package/dist/resources/extensions/async-jobs/await-tool.js +5 -0
- package/dist/resources/extensions/async-jobs/index.js +2 -0
- package/dist/resources/extensions/gsd/auto/loop.js +89 -1
- package/dist/resources/extensions/gsd/auto/phases.js +29 -13
- package/dist/resources/extensions/gsd/auto/session.js +6 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +8 -2
- package/dist/resources/extensions/gsd/auto-dispatch.js +19 -2
- package/dist/resources/extensions/gsd/auto-post-unit.js +7 -0
- package/dist/resources/extensions/gsd/auto-prompts.js +3 -16
- package/dist/resources/extensions/gsd/auto-recovery.js +12 -4
- package/dist/resources/extensions/gsd/auto-start.js +16 -14
- package/dist/resources/extensions/gsd/auto-worktree.js +147 -13
- package/dist/resources/extensions/gsd/auto.js +64 -2
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +199 -164
- package/dist/resources/extensions/gsd/bootstrap/journal-tools.js +62 -0
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +2 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +25 -3
- package/dist/resources/extensions/gsd/bootstrap/tool-call-loop-guard.js +7 -2
- package/dist/resources/extensions/gsd/commands/catalog.js +40 -1
- package/dist/resources/extensions/gsd/commands/handlers/core.js +1 -0
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +5 -0
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +146 -0
- package/dist/resources/extensions/gsd/context-injector.js +74 -0
- package/dist/resources/extensions/gsd/context-store.js +4 -3
- package/dist/resources/extensions/gsd/custom-execution-policy.js +47 -0
- package/dist/resources/extensions/gsd/custom-verification.js +145 -0
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +164 -0
- package/dist/resources/extensions/gsd/dashboard-overlay.js +1 -0
- package/dist/resources/extensions/gsd/db-writer.js +5 -2
- package/dist/resources/extensions/gsd/definition-loader.js +352 -0
- package/dist/resources/extensions/gsd/detection.js +20 -1
- package/dist/resources/extensions/gsd/dev-execution-policy.js +24 -0
- package/dist/resources/extensions/gsd/dev-workflow-engine.js +82 -0
- package/dist/resources/extensions/gsd/doctor-checks.js +31 -1
- package/dist/resources/extensions/gsd/doctor-providers.js +10 -0
- package/dist/resources/extensions/gsd/doctor.js +11 -1
- package/dist/resources/extensions/gsd/engine-resolver.js +40 -0
- package/dist/resources/extensions/gsd/engine-types.js +8 -0
- package/dist/resources/extensions/gsd/execution-policy.js +8 -0
- package/dist/resources/extensions/gsd/exit-command.js +12 -2
- package/dist/resources/extensions/gsd/export.js +9 -13
- package/dist/resources/extensions/gsd/extension-manifest.json +2 -2
- package/dist/resources/extensions/gsd/files.js +28 -11
- package/dist/resources/extensions/gsd/forensics.js +94 -3
- package/dist/resources/extensions/gsd/git-constants.js +1 -0
- package/dist/resources/extensions/gsd/git-service.js +6 -2
- package/dist/resources/extensions/gsd/graph.js +225 -0
- package/dist/resources/extensions/gsd/gsd-db.js +25 -8
- package/dist/resources/extensions/gsd/guided-flow-queue.js +1 -1
- package/dist/resources/extensions/gsd/guided-flow.js +7 -3
- package/dist/resources/extensions/gsd/journal.js +85 -0
- package/dist/resources/extensions/gsd/md-importer.js +5 -0
- package/dist/resources/extensions/gsd/milestone-ids.js +1 -1
- package/dist/resources/extensions/gsd/native-git-bridge.js +3 -2
- package/dist/resources/extensions/gsd/post-unit-hooks.js +24 -412
- package/dist/resources/extensions/gsd/preferences-types.js +2 -0
- package/dist/resources/extensions/gsd/preferences.js +60 -8
- package/dist/resources/extensions/gsd/prompt-loader.js +34 -4
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +11 -10
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +2 -2
- package/dist/resources/extensions/gsd/prompts/discuss.md +1 -1
- package/dist/resources/extensions/gsd/prompts/forensics.md +12 -5
- package/dist/resources/extensions/gsd/prompts/queue.md +1 -1
- package/dist/resources/extensions/gsd/repo-identity.js +92 -7
- package/dist/resources/extensions/gsd/rule-registry.js +489 -0
- package/dist/resources/extensions/gsd/rule-types.js +6 -0
- package/dist/resources/extensions/gsd/run-manager.js +134 -0
- package/dist/resources/extensions/gsd/service-tier.js +147 -0
- package/dist/resources/extensions/gsd/session-lock.js +2 -2
- package/dist/resources/extensions/gsd/structured-data-formatter.js +2 -1
- package/dist/resources/extensions/gsd/templates/decisions.md +2 -2
- package/dist/resources/extensions/gsd/workflow-engine.js +7 -0
- package/dist/resources/extensions/gsd/workflow-templates.js +13 -1
- package/dist/resources/extensions/gsd/worktree-manager.js +20 -6
- package/dist/resources/extensions/gsd/worktree-resolver.js +21 -4
- package/dist/resources/extensions/gsd/worktree.js +2 -2
- package/dist/resources/extensions/mcp-client/index.js +2 -1
- package/dist/resources/extensions/search-the-web/tool-search.js +3 -3
- package/dist/resources/extensions/subagent/index.js +7 -3
- package/dist/resources/extensions/voice/index.js +4 -4
- package/dist/resources/skills/create-workflow/SKILL.md +103 -0
- package/dist/resources/skills/create-workflow/references/feature-patterns.md +128 -0
- package/dist/resources/skills/create-workflow/references/verification-policies.md +76 -0
- package/dist/resources/skills/create-workflow/references/yaml-schema-v1.md +46 -0
- package/dist/resources/skills/create-workflow/templates/blog-post-pipeline.yaml +60 -0
- package/dist/resources/skills/create-workflow/templates/code-audit.yaml +60 -0
- package/dist/resources/skills/create-workflow/templates/release-checklist.yaml +66 -0
- package/dist/resources/skills/create-workflow/templates/workflow-definition.yaml +32 -0
- package/dist/resources/skills/create-workflow/workflows/create-from-scratch.md +104 -0
- package/dist/resources/skills/create-workflow/workflows/create-from-template.md +72 -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 +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route_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/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 +5 -5
- 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/terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.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 +4 -4
- 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 +4 -4
- 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 +3 -3
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- 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/229.js +3 -3
- package/dist/web/standalone/.next/server/chunks/471.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/4024.c195dc1fdd2adbea.js +9 -0
- package/dist/web/standalone/.next/static/chunks/app/_not-found/page-f2a7482d42a5614b.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/layout-a16c7a7ecdf0c2cf.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/page-b9367c5ae13b99c6.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{main-app-2f2ee7b85712c2bd.js → main-app-fdab67f7802d7832.js} +1 -1
- 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-9afaaebf6042a1d7.js → webpack-fa307370fcf9fb2c.js} +1 -1
- 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.d.ts +4 -0
- package/dist/web-mode.js +69 -11
- package/package.json +1 -1
- package/packages/native/src/__tests__/text.test.mjs +33 -0
- package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent.js +2 -0
- package/packages/pi-agent-core/dist/agent.js.map +1 -1
- package/packages/pi-agent-core/dist/types.d.ts +6 -0
- package/packages/pi-agent-core/dist/types.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/types.js.map +1 -1
- package/packages/pi-agent-core/src/agent.test.ts +53 -0
- package/packages/pi-agent-core/src/agent.ts +3 -0
- package/packages/pi-agent-core/src/types.ts +6 -0
- package/packages/pi-agent-core/tsconfig.json +1 -1
- package/packages/pi-ai/dist/models.d.ts +5 -3
- package/packages/pi-ai/dist/models.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.d.ts +801 -1468
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +1135 -1588
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/dist/models.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js +60 -2
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
- package/packages/pi-ai/scripts/generate-models.ts +1543 -0
- package/packages/pi-ai/src/models.generated.ts +1140 -1593
- package/packages/pi-ai/src/models.ts +7 -4
- package/packages/pi-ai/src/utils/oauth/github-copilot.ts +74 -2
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +8 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +7 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js +29 -2
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js +60 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/discovery-cache.test.js +3 -1
- package/packages/pi-coding-agent/dist/core/discovery-cache.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +18 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/client.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/client.js +23 -0
- package/packages/pi-coding-agent/dist/core/lsp/client.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +2 -0
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/package-manager.d.ts +6 -0
- package/packages/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/package-manager.js +63 -11
- package/packages/pi-coding-agent/dist/core/package-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.d.ts +9 -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 +20 -6
- package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +6 -5
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.js +3 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.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 +9 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +10 -7
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +34 -10
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +7 -1
- package/packages/pi-coding-agent/src/core/auth-storage.test.ts +68 -0
- package/packages/pi-coding-agent/src/core/auth-storage.ts +30 -2
- package/packages/pi-coding-agent/src/core/discovery-cache.test.ts +4 -2
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +18 -0
- package/packages/pi-coding-agent/src/core/lsp/client.ts +29 -0
- package/packages/pi-coding-agent/src/core/model-registry.ts +3 -0
- package/packages/pi-coding-agent/src/core/package-manager.ts +99 -58
- package/packages/pi-coding-agent/src/core/resource-loader.ts +24 -6
- package/packages/pi-coding-agent/src/core/system-prompt.ts +6 -5
- package/packages/pi-coding-agent/src/modes/interactive/components/extension-editor.ts +3 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +10 -6
- package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +11 -7
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +36 -11
- package/pkg/package.json +1 -1
- package/src/resources/extensions/async-jobs/async-bash-timeout.test.ts +122 -0
- package/src/resources/extensions/async-jobs/async-bash-tool.ts +40 -4
- package/src/resources/extensions/async-jobs/await-tool.test.ts +47 -0
- package/src/resources/extensions/async-jobs/await-tool.ts +5 -0
- package/src/resources/extensions/async-jobs/index.ts +1 -0
- package/src/resources/extensions/async-jobs/job-manager.ts +2 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +5 -2
- package/src/resources/extensions/gsd/auto/loop.ts +101 -1
- package/src/resources/extensions/gsd/auto/phases.ts +31 -13
- package/src/resources/extensions/gsd/auto/session.ts +6 -0
- package/src/resources/extensions/gsd/auto/types.ts +4 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +9 -2
- package/src/resources/extensions/gsd/auto-dispatch.ts +25 -5
- package/src/resources/extensions/gsd/auto-post-unit.ts +8 -0
- package/src/resources/extensions/gsd/auto-prompts.ts +2 -18
- package/src/resources/extensions/gsd/auto-recovery.ts +12 -4
- package/src/resources/extensions/gsd/auto-start.ts +15 -13
- package/src/resources/extensions/gsd/auto-worktree.ts +162 -18
- package/src/resources/extensions/gsd/auto.ts +71 -2
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +209 -162
- package/src/resources/extensions/gsd/bootstrap/journal-tools.ts +62 -0
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +2 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +25 -4
- package/src/resources/extensions/gsd/bootstrap/tool-call-loop-guard.ts +9 -2
- package/src/resources/extensions/gsd/commands/catalog.ts +40 -1
- package/src/resources/extensions/gsd/commands/handlers/core.ts +1 -0
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +5 -0
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +164 -0
- package/src/resources/extensions/gsd/context-injector.ts +100 -0
- package/src/resources/extensions/gsd/context-store.ts +4 -3
- package/src/resources/extensions/gsd/custom-execution-policy.ts +73 -0
- package/src/resources/extensions/gsd/custom-verification.ts +180 -0
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +216 -0
- package/src/resources/extensions/gsd/dashboard-overlay.ts +1 -0
- package/src/resources/extensions/gsd/db-writer.ts +6 -2
- package/src/resources/extensions/gsd/definition-loader.ts +462 -0
- package/src/resources/extensions/gsd/detection.ts +20 -1
- package/src/resources/extensions/gsd/dev-execution-policy.ts +51 -0
- package/src/resources/extensions/gsd/dev-workflow-engine.ts +110 -0
- package/src/resources/extensions/gsd/doctor-checks.ts +32 -1
- package/src/resources/extensions/gsd/doctor-providers.ts +13 -0
- package/src/resources/extensions/gsd/doctor-types.ts +1 -0
- package/src/resources/extensions/gsd/doctor.ts +12 -1
- package/src/resources/extensions/gsd/engine-resolver.ts +57 -0
- package/src/resources/extensions/gsd/engine-types.ts +71 -0
- package/src/resources/extensions/gsd/execution-policy.ts +43 -0
- package/src/resources/extensions/gsd/exit-command.ts +14 -2
- package/src/resources/extensions/gsd/export.ts +8 -15
- package/src/resources/extensions/gsd/extension-manifest.json +2 -2
- package/src/resources/extensions/gsd/files.ts +29 -12
- package/src/resources/extensions/gsd/forensics.ts +101 -3
- package/src/resources/extensions/gsd/git-constants.ts +1 -0
- package/src/resources/extensions/gsd/git-service.ts +5 -5
- package/src/resources/extensions/gsd/gitignore.ts +1 -1
- package/src/resources/extensions/gsd/graph.ts +312 -0
- package/src/resources/extensions/gsd/gsd-db.ts +37 -8
- package/src/resources/extensions/gsd/guided-flow-queue.ts +1 -1
- package/src/resources/extensions/gsd/guided-flow.ts +7 -3
- package/src/resources/extensions/gsd/journal.ts +134 -0
- package/src/resources/extensions/gsd/md-importer.ts +6 -0
- package/src/resources/extensions/gsd/milestone-ids.ts +1 -1
- package/src/resources/extensions/gsd/native-git-bridge.ts +3 -2
- package/src/resources/extensions/gsd/post-unit-hooks.ts +24 -462
- package/src/resources/extensions/gsd/preferences-types.ts +6 -0
- package/src/resources/extensions/gsd/preferences.ts +63 -6
- package/src/resources/extensions/gsd/prompt-loader.ts +35 -4
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +11 -10
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +2 -2
- package/src/resources/extensions/gsd/prompts/discuss.md +1 -1
- package/src/resources/extensions/gsd/prompts/forensics.md +12 -5
- package/src/resources/extensions/gsd/prompts/queue.md +1 -1
- package/src/resources/extensions/gsd/repo-identity.ts +95 -7
- package/src/resources/extensions/gsd/rule-registry.ts +599 -0
- package/src/resources/extensions/gsd/rule-types.ts +68 -0
- package/src/resources/extensions/gsd/run-manager.ts +180 -0
- package/src/resources/extensions/gsd/service-tier.ts +184 -0
- package/src/resources/extensions/gsd/session-lock.ts +2 -2
- package/src/resources/extensions/gsd/structured-data-formatter.ts +3 -1
- package/src/resources/extensions/gsd/templates/decisions.md +2 -2
- package/src/resources/extensions/gsd/tests/activity-log.test.ts +31 -69
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +103 -120
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +85 -0
- package/src/resources/extensions/gsd/tests/auto-secrets-gate.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/auto-worktree-milestone-merge.test.ts +202 -0
- package/src/resources/extensions/gsd/tests/bundled-workflow-defs.test.ts +180 -0
- package/src/resources/extensions/gsd/tests/captures.test.ts +12 -1
- package/src/resources/extensions/gsd/tests/commands-workflow-custom.test.ts +283 -0
- package/src/resources/extensions/gsd/tests/context-injector.test.ts +313 -0
- package/src/resources/extensions/gsd/tests/context-store.test.ts +10 -5
- package/src/resources/extensions/gsd/tests/continue-here.test.ts +20 -20
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +540 -0
- package/src/resources/extensions/gsd/tests/custom-verification.test.ts +382 -0
- package/src/resources/extensions/gsd/tests/custom-workflow-engine.test.ts +339 -0
- package/src/resources/extensions/gsd/tests/dashboard-custom-engine.test.ts +87 -0
- package/src/resources/extensions/gsd/tests/db-writer.test.ts +10 -0
- package/src/resources/extensions/gsd/tests/definition-loader.test.ts +778 -0
- package/src/resources/extensions/gsd/tests/dev-engine-wrapper.test.ts +318 -0
- package/src/resources/extensions/gsd/tests/doctor-completion-deferral.test.ts +15 -10
- package/src/resources/extensions/gsd/tests/doctor-fixlevel.test.ts +5 -4
- package/src/resources/extensions/gsd/tests/doctor-roadmap-summary-atomicity.test.ts +167 -0
- package/src/resources/extensions/gsd/tests/doctor-task-done-missing-summary-slice-loop.test.ts +174 -0
- package/src/resources/extensions/gsd/tests/e2e-workflow-pipeline-integration.test.ts +476 -0
- package/src/resources/extensions/gsd/tests/engine-interfaces-contract.test.ts +271 -0
- package/src/resources/extensions/gsd/tests/exit-command.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/forensics-dedup.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/forensics-issue-routing.test.ts +43 -0
- package/src/resources/extensions/gsd/tests/git-locale.test.ts +133 -0
- package/src/resources/extensions/gsd/tests/git-service.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/graph-operations.test.ts +599 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +8 -1
- package/src/resources/extensions/gsd/tests/gsd-tools.test.ts +7 -7
- package/src/resources/extensions/gsd/tests/iterate-engine-integration.test.ts +429 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +513 -0
- package/src/resources/extensions/gsd/tests/journal-query-tool.test.ts +147 -0
- package/src/resources/extensions/gsd/tests/journal.test.ts +341 -0
- package/src/resources/extensions/gsd/tests/manifest-status.test.ts +73 -82
- package/src/resources/extensions/gsd/tests/md-importer.test.ts +31 -1
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/milestone-id-reservation.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/parsers.test.ts +110 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +47 -25
- package/src/resources/extensions/gsd/tests/prompt-db.test.ts +3 -1
- package/src/resources/extensions/gsd/tests/repo-identity-worktree.test.ts +61 -1
- package/src/resources/extensions/gsd/tests/routing-history.test.ts +11 -22
- package/src/resources/extensions/gsd/tests/rule-registry.test.ts +413 -0
- package/src/resources/extensions/gsd/tests/run-manager.test.ts +229 -0
- package/src/resources/extensions/gsd/tests/service-tier.test.ts +127 -0
- package/src/resources/extensions/gsd/tests/skill-activation.test.ts +56 -3
- package/src/resources/extensions/gsd/tests/skill-lifecycle.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/stalled-tool-recovery.test.ts +102 -0
- package/src/resources/extensions/gsd/tests/structured-data-formatter.test.ts +4 -3
- package/src/resources/extensions/gsd/tests/symlink-numbered-variants.test.ts +151 -0
- package/src/resources/extensions/gsd/tests/tool-call-loop-guard.test.ts +45 -0
- package/src/resources/extensions/gsd/tests/tool-naming.test.ts +117 -0
- package/src/resources/extensions/gsd/tests/triage-dispatch.test.ts +6 -1
- package/src/resources/extensions/gsd/tests/verification-gate.test.ts +156 -263
- package/src/resources/extensions/gsd/tests/windows-path-normalization.test.ts +99 -0
- package/src/resources/extensions/gsd/tests/worktree-db-integration.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/worktree-db.test.ts +4 -0
- package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +135 -0
- package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +203 -106
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +79 -5
- package/src/resources/extensions/gsd/tests/worktree-symlink-removal.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +74 -0
- package/src/resources/extensions/gsd/types.ts +3 -0
- package/src/resources/extensions/gsd/workflow-engine.ts +38 -0
- package/src/resources/extensions/gsd/workflow-templates.ts +12 -1
- package/src/resources/extensions/gsd/worktree-manager.ts +21 -6
- package/src/resources/extensions/gsd/worktree-resolver.ts +32 -12
- package/src/resources/extensions/gsd/worktree.ts +2 -2
- package/src/resources/extensions/mcp-client/index.ts +5 -1
- package/src/resources/extensions/search-the-web/tool-search.ts +3 -3
- package/src/resources/extensions/subagent/index.ts +7 -3
- package/src/resources/extensions/voice/index.ts +4 -4
- package/src/resources/skills/create-workflow/SKILL.md +103 -0
- package/src/resources/skills/create-workflow/references/feature-patterns.md +128 -0
- package/src/resources/skills/create-workflow/references/verification-policies.md +76 -0
- package/src/resources/skills/create-workflow/references/yaml-schema-v1.md +46 -0
- package/src/resources/skills/create-workflow/templates/blog-post-pipeline.yaml +60 -0
- package/src/resources/skills/create-workflow/templates/code-audit.yaml +60 -0
- package/src/resources/skills/create-workflow/templates/release-checklist.yaml +66 -0
- package/src/resources/skills/create-workflow/templates/workflow-definition.yaml +32 -0
- package/src/resources/skills/create-workflow/workflows/create-from-scratch.md +104 -0
- package/src/resources/skills/create-workflow/workflows/create-from-template.md +72 -0
- package/dist/web/standalone/.next/static/chunks/4024.279c423e4661ece1.js +0 -9
- package/dist/web/standalone/.next/static/chunks/app/_not-found/page-e07acdb7dd069836.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/layout-745c6ed5fea5fb06.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/page-801b53eff6e83579.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-e6255954dccfcf0a.js +0 -1
- /package/dist/web/standalone/.next/static/{Ute3pMouVczQyT15qrBBO → qw8qDHXOTLUXBq1vEknSz}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{Ute3pMouVczQyT15qrBBO → qw8qDHXOTLUXBq1vEknSz}/_ssgManifest.js +0 -0
|
@@ -2,7 +2,7 @@ import { existsSync, lstatSync, readdirSync, readFileSync, realpathSync, rmSync,
|
|
|
2
2
|
import { basename, dirname, join, sep } from "node:path";
|
|
3
3
|
|
|
4
4
|
import type { DoctorIssue, DoctorIssueCode } from "./doctor-types.js";
|
|
5
|
-
import { readRepoMeta, externalProjectsRoot } from "./repo-identity.js";
|
|
5
|
+
import { readRepoMeta, externalProjectsRoot, cleanNumberedGsdVariants } from "./repo-identity.js";
|
|
6
6
|
import { loadFile, parseRoadmap } from "./files.js";
|
|
7
7
|
import { resolveMilestoneFile, milestonesDir, gsdRoot, resolveGsdRootFile, relGsdRootFile } from "./paths.js";
|
|
8
8
|
import { deriveState, isMilestoneComplete } from "./state.js";
|
|
@@ -776,6 +776,37 @@ export async function checkRuntimeHealth(
|
|
|
776
776
|
// Non-fatal — external state check failed
|
|
777
777
|
}
|
|
778
778
|
|
|
779
|
+
// ── Numbered .gsd collision variants (#2205) ───────────────────────────
|
|
780
|
+
// macOS APFS can create ".gsd 2", ".gsd 3" etc. when a directory blocks
|
|
781
|
+
// symlink creation. These must be removed so the canonical .gsd is used.
|
|
782
|
+
try {
|
|
783
|
+
const variantPattern = /^\.gsd \d+$/;
|
|
784
|
+
const entries = readdirSync(basePath);
|
|
785
|
+
const variants = entries.filter(e => variantPattern.test(e));
|
|
786
|
+
if (variants.length > 0) {
|
|
787
|
+
for (const v of variants) {
|
|
788
|
+
issues.push({
|
|
789
|
+
severity: "warning",
|
|
790
|
+
code: "numbered_gsd_variant",
|
|
791
|
+
scope: "project",
|
|
792
|
+
unitId: "project",
|
|
793
|
+
message: `Found macOS collision variant "${v}" — this can cause GSD state to appear deleted.`,
|
|
794
|
+
file: v,
|
|
795
|
+
fixable: true,
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
if (shouldFix("numbered_gsd_variant")) {
|
|
800
|
+
const removed = cleanNumberedGsdVariants(basePath);
|
|
801
|
+
for (const name of removed) {
|
|
802
|
+
fixesApplied.push(`removed numbered .gsd variant: ${name}`);
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
} catch {
|
|
807
|
+
// Non-fatal — variant check failed
|
|
808
|
+
}
|
|
809
|
+
|
|
779
810
|
// ── Metrics ledger integrity ───────────────────────────────────────────
|
|
780
811
|
try {
|
|
781
812
|
const metricsPath = join(root, "metrics.json");
|
|
@@ -305,11 +305,24 @@ function checkOptionalProviders(): ProviderCheckResult[] {
|
|
|
305
305
|
const optional = ["brave", "tavily", "jina", "context7"] as const;
|
|
306
306
|
const results: ProviderCheckResult[] = [];
|
|
307
307
|
|
|
308
|
+
// Determine which search providers are configured so we can suppress
|
|
309
|
+
// "not configured" noise for alternative search providers when at least
|
|
310
|
+
// one is already active (e.g. don't warn about missing BRAVE_API_KEY
|
|
311
|
+
// when Tavily is configured).
|
|
312
|
+
const searchProviderIds = ["brave", "tavily"] as const;
|
|
313
|
+
const hasAnySearchProvider = searchProviderIds.some(id => resolveKey(id).found);
|
|
314
|
+
|
|
308
315
|
for (const providerId of optional) {
|
|
309
316
|
const info = PROVIDER_REGISTRY.find(p => p.id === providerId);
|
|
310
317
|
if (!info) continue;
|
|
311
318
|
|
|
312
319
|
const lookup = resolveKey(providerId);
|
|
320
|
+
|
|
321
|
+
// Skip unconfigured search providers when another search provider is active
|
|
322
|
+
if (!lookup.found && hasAnySearchProvider && info.category === "search") {
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
|
|
313
326
|
results.push({
|
|
314
327
|
name: providerId,
|
|
315
328
|
label: info.label,
|
|
@@ -792,6 +792,7 @@ export async function runGSDDoctor(basePath: string, options?: { fix?: boolean;
|
|
|
792
792
|
} catch { /* non-fatal */ }
|
|
793
793
|
|
|
794
794
|
let allTasksDone = plan.tasks.length > 0;
|
|
795
|
+
let taskUncheckedByDoctor = false;
|
|
795
796
|
for (const task of plan.tasks) {
|
|
796
797
|
const taskUnitId = `${unitId}/${task.id}`;
|
|
797
798
|
const summaryPath = resolveTaskFile(basePath, milestoneId, slice.id, task.id, "SUMMARY");
|
|
@@ -810,6 +811,7 @@ export async function runGSDDoctor(basePath: string, options?: { fix?: boolean;
|
|
|
810
811
|
dryRunCanFix("task_done_missing_summary", `uncheck ${task.id} in plan for ${taskUnitId}`);
|
|
811
812
|
if (shouldFix("task_done_missing_summary")) {
|
|
812
813
|
await markTaskUndoneInPlan(basePath, milestoneId, slice.id, task.id, fixesApplied);
|
|
814
|
+
taskUncheckedByDoctor = true;
|
|
813
815
|
}
|
|
814
816
|
}
|
|
815
817
|
|
|
@@ -873,6 +875,15 @@ export async function runGSDDoctor(basePath: string, options?: { fix?: boolean;
|
|
|
873
875
|
allTasksDone = allTasksDone && task.done;
|
|
874
876
|
}
|
|
875
877
|
|
|
878
|
+
// ── #1850: cascade slice uncheck when task_done_missing_summary fires ──
|
|
879
|
+
// When doctor unchecks tasks inside a done slice, the slice must also be
|
|
880
|
+
// unchecked so the state machine re-enters the executing phase. Without
|
|
881
|
+
// this, state.ts skips done slices and the unchecked tasks never run,
|
|
882
|
+
// causing doctor to fire again on every start (infinite loop).
|
|
883
|
+
if (taskUncheckedByDoctor && slice.done) {
|
|
884
|
+
await markSliceUndoneInRoadmap(basePath, milestoneId, slice.id, fixesApplied);
|
|
885
|
+
}
|
|
886
|
+
|
|
876
887
|
// Blocker-without-replan detection
|
|
877
888
|
const replanPath = resolveSliceFile(basePath, milestoneId, slice.id, "REPLAN");
|
|
878
889
|
if (!replanPath) {
|
|
@@ -949,7 +960,7 @@ export async function runGSDDoctor(basePath: string, options?: { fix?: boolean;
|
|
|
949
960
|
fixable: true,
|
|
950
961
|
});
|
|
951
962
|
dryRunCanFix("all_tasks_done_roadmap_not_checked", `mark ${slice.id} done in roadmap`);
|
|
952
|
-
if (shouldFix("all_tasks_done_roadmap_not_checked") && (hasSliceSummary ||
|
|
963
|
+
if (shouldFix("all_tasks_done_roadmap_not_checked") && (hasSliceSummary || existsSync(join(slicePath, `${slice.id}-SUMMARY.md`)))) {
|
|
953
964
|
await markSliceDoneInRoadmap(basePath, milestoneId, slice.id, fixesApplied);
|
|
954
965
|
}
|
|
955
966
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* engine-resolver.ts — Route sessions to engine/policy pairs.
|
|
3
|
+
*
|
|
4
|
+
* Routes `null` and `"dev"` engine IDs to the DevWorkflowEngine/DevExecutionPolicy
|
|
5
|
+
* pair. Any other non-null engine ID is treated as a custom workflow engine that
|
|
6
|
+
* reads its state from an `activeRunDir`. Respects `GSD_ENGINE_BYPASS=1` kill
|
|
7
|
+
* switch to skip the engine layer entirely.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { WorkflowEngine } from "./workflow-engine.js";
|
|
11
|
+
import type { ExecutionPolicy } from "./execution-policy.js";
|
|
12
|
+
import { DevWorkflowEngine } from "./dev-workflow-engine.js";
|
|
13
|
+
import { DevExecutionPolicy } from "./dev-execution-policy.js";
|
|
14
|
+
import { CustomWorkflowEngine } from "./custom-workflow-engine.js";
|
|
15
|
+
import { CustomExecutionPolicy } from "./custom-execution-policy.js";
|
|
16
|
+
|
|
17
|
+
/** A resolved engine + policy pair ready for the auto-loop. */
|
|
18
|
+
export interface ResolvedEngine {
|
|
19
|
+
engine: WorkflowEngine;
|
|
20
|
+
policy: ExecutionPolicy;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Resolve an engine/policy pair for the given session.
|
|
25
|
+
*
|
|
26
|
+
* - `null` or `"dev"` → DevWorkflowEngine + DevExecutionPolicy
|
|
27
|
+
* - any other non-null ID → CustomWorkflowEngine(activeRunDir) + CustomExecutionPolicy()
|
|
28
|
+
* (requires activeRunDir to be a non-empty string)
|
|
29
|
+
*
|
|
30
|
+
* Note: `GSD_ENGINE_BYPASS=1` is checked in autoLoop before calling this function.
|
|
31
|
+
*/
|
|
32
|
+
export function resolveEngine(
|
|
33
|
+
session: { activeEngineId: string | null; activeRunDir?: string | null },
|
|
34
|
+
): ResolvedEngine {
|
|
35
|
+
const { activeEngineId, activeRunDir } = session;
|
|
36
|
+
|
|
37
|
+
if (activeEngineId === null || activeEngineId === "dev") {
|
|
38
|
+
return {
|
|
39
|
+
engine: new DevWorkflowEngine(),
|
|
40
|
+
policy: new DevExecutionPolicy(),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Any non-null, non-"dev" engine ID is a custom workflow engine.
|
|
45
|
+
// activeRunDir is required — the engine reads GRAPH.yaml from it.
|
|
46
|
+
if (!activeRunDir || typeof activeRunDir !== "string") {
|
|
47
|
+
throw new Error(
|
|
48
|
+
`Custom engine "${activeEngineId}" requires activeRunDir to be a non-empty string, ` +
|
|
49
|
+
`got: ${JSON.stringify(activeRunDir)}`,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
engine: new CustomWorkflowEngine(activeRunDir),
|
|
55
|
+
policy: new CustomExecutionPolicy(activeRunDir),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* engine-types.ts — Engine-polymorphic type contracts.
|
|
3
|
+
*
|
|
4
|
+
* LEAF NODE: This file must have ZERO imports from any GSD module.
|
|
5
|
+
* Only `node:` imports are permitted. All engine/policy interfaces
|
|
6
|
+
* depend on these types; nothing here depends on GSD internals.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Snapshot of engine state at a point in time. */
|
|
10
|
+
export interface EngineState {
|
|
11
|
+
phase: string;
|
|
12
|
+
currentMilestoneId: string | null;
|
|
13
|
+
activeSliceId: string | null;
|
|
14
|
+
activeTaskId: string | null;
|
|
15
|
+
isComplete: boolean;
|
|
16
|
+
/** Opaque engine-specific state — never narrowed to a GSD-specific type. */
|
|
17
|
+
raw: unknown;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** A unit of work the engine wants the agent to execute. */
|
|
21
|
+
export interface StepContract {
|
|
22
|
+
unitType: string;
|
|
23
|
+
unitId: string;
|
|
24
|
+
prompt: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** UI-facing metadata for progress display. */
|
|
28
|
+
export interface DisplayMetadata {
|
|
29
|
+
engineLabel: string;
|
|
30
|
+
currentPhase: string;
|
|
31
|
+
progressSummary: string;
|
|
32
|
+
stepCount: { completed: number; total: number } | null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Discriminated union: what the engine tells the loop to do next.
|
|
37
|
+
*
|
|
38
|
+
* - `dispatch` — execute a step
|
|
39
|
+
* - `stop` — halt the loop with a reason and severity
|
|
40
|
+
* - `skip` — nothing to do right now, advance without executing
|
|
41
|
+
*/
|
|
42
|
+
export type EngineDispatchAction =
|
|
43
|
+
| { action: "dispatch"; step: StepContract }
|
|
44
|
+
| { action: "stop"; reason: string; level: "info" | "warning" | "error" }
|
|
45
|
+
| { action: "skip" };
|
|
46
|
+
|
|
47
|
+
/** Outcome of reconciling state after a step completes. */
|
|
48
|
+
export interface ReconcileResult {
|
|
49
|
+
outcome: "continue" | "milestone-complete" | "pause" | "stop";
|
|
50
|
+
reason?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Recovery strategy when a step fails. */
|
|
54
|
+
export interface RecoveryAction {
|
|
55
|
+
outcome: "retry" | "skip" | "stop" | "pause";
|
|
56
|
+
reason?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Result of closing out a completed unit. */
|
|
60
|
+
export interface CloseoutResult {
|
|
61
|
+
committed: boolean;
|
|
62
|
+
artifacts: string[];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Record of a completed execution step. */
|
|
66
|
+
export interface CompletedStep {
|
|
67
|
+
unitType: string;
|
|
68
|
+
unitId: string;
|
|
69
|
+
startedAt: number;
|
|
70
|
+
finishedAt: number;
|
|
71
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* execution-policy.ts — ExecutionPolicy interface.
|
|
3
|
+
*
|
|
4
|
+
* Defines the policy layer that governs model selection, verification,
|
|
5
|
+
* recovery, and closeout for each execution step. Imports only from
|
|
6
|
+
* the leaf-node engine-types.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { RecoveryAction, CloseoutResult } from "./engine-types.js";
|
|
10
|
+
|
|
11
|
+
/** Policy governing how each step is executed, verified, and closed out. */
|
|
12
|
+
export interface ExecutionPolicy {
|
|
13
|
+
/** Prepare the workspace before a milestone begins (e.g. worktree setup). */
|
|
14
|
+
prepareWorkspace(basePath: string, milestoneId: string): Promise<void>;
|
|
15
|
+
|
|
16
|
+
/** Select the model tier for a given unit. Returns null to use defaults. */
|
|
17
|
+
selectModel(
|
|
18
|
+
unitType: string,
|
|
19
|
+
unitId: string,
|
|
20
|
+
context: { basePath: string },
|
|
21
|
+
): Promise<{ tier: string; modelDowngraded: boolean } | null>;
|
|
22
|
+
|
|
23
|
+
/** Verify unit output. Returns disposition for the loop. */
|
|
24
|
+
verify(
|
|
25
|
+
unitType: string,
|
|
26
|
+
unitId: string,
|
|
27
|
+
context: { basePath: string },
|
|
28
|
+
): Promise<"continue" | "retry" | "pause">;
|
|
29
|
+
|
|
30
|
+
/** Determine recovery action when a unit fails. */
|
|
31
|
+
recover(
|
|
32
|
+
unitType: string,
|
|
33
|
+
unitId: string,
|
|
34
|
+
context: { basePath: string },
|
|
35
|
+
): Promise<RecoveryAction>;
|
|
36
|
+
|
|
37
|
+
/** Close out a completed unit (commit, snapshot, artifact capture). */
|
|
38
|
+
closeout(
|
|
39
|
+
unitType: string,
|
|
40
|
+
unitId: string,
|
|
41
|
+
context: { basePath: string; startedAt: number },
|
|
42
|
+
): Promise<CloseoutResult>;
|
|
43
|
+
}
|
|
@@ -10,8 +10,20 @@ export function registerExitCommand(
|
|
|
10
10
|
description: "Exit GSD gracefully",
|
|
11
11
|
handler: async (_args: string, ctx: ExtensionCommandContext) => {
|
|
12
12
|
// Stop auto-mode first so locks and activity state are cleaned up before shutdown.
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
// Wrapped in try/catch: if gsd-pi was updated on disk mid-session, the dynamic
|
|
14
|
+
// import may resolve a new auto-worktree.js whose static imports reference
|
|
15
|
+
// exports absent from the process-cached native-git-bridge.js (ESM cache is
|
|
16
|
+
// immutable). The user's work is already saved — this is cleanup only.
|
|
17
|
+
try {
|
|
18
|
+
const stopAuto = deps.stopAuto ?? (await importExtensionModule<typeof import("./auto.js")>(import.meta.url, "./auto.js")).stopAuto;
|
|
19
|
+
await stopAuto(ctx, pi, "Graceful exit");
|
|
20
|
+
} catch (e) {
|
|
21
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
22
|
+
ctx.ui?.notify?.(
|
|
23
|
+
`Auto-mode cleanup skipped (module version mismatch): ${msg}`,
|
|
24
|
+
"warning",
|
|
25
|
+
);
|
|
26
|
+
}
|
|
15
27
|
ctx.shutdown();
|
|
16
28
|
},
|
|
17
29
|
});
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import type { ExtensionCommandContext } from "@gsd/pi-coding-agent";
|
|
5
5
|
import { writeFileSync, mkdirSync } from "node:fs";
|
|
6
6
|
import { join, basename } from "node:path";
|
|
7
|
-
import { exec } from "node:child_process";
|
|
7
|
+
import { exec, execFile } from "node:child_process";
|
|
8
8
|
import {
|
|
9
9
|
getLedger, getProjectTotals, aggregateByPhase, aggregateBySlice,
|
|
10
10
|
aggregateByModel, formatCost, formatTokenCount, loadLedgerFromDisk,
|
|
@@ -20,20 +20,13 @@ import { getErrorMessage } from "./error-utils.js";
|
|
|
20
20
|
* Non-blocking, non-fatal — failures are silently ignored.
|
|
21
21
|
*/
|
|
22
22
|
export function openInBrowser(filePath: string): void {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
? `"" "${filePath}"`
|
|
31
|
-
: `"${filePath}"`;
|
|
32
|
-
|
|
33
|
-
exec(`${cmd} ${args}`, (err) => {
|
|
34
|
-
// Non-fatal — if the browser can't be opened, the file path is still shown
|
|
35
|
-
if (err) void err;
|
|
36
|
-
});
|
|
23
|
+
if (process.platform === "win32") {
|
|
24
|
+
// PowerShell's Start-Process handles paths with '&' and spaces safely.
|
|
25
|
+
execFile("powershell", ["-c", `Start-Process '${filePath.replace(/'/g, "''")}'`], () => {});
|
|
26
|
+
} else {
|
|
27
|
+
const cmd = process.platform === "darwin" ? "open" : "xdg-open";
|
|
28
|
+
execFile(cmd, [filePath], () => {});
|
|
29
|
+
}
|
|
37
30
|
}
|
|
38
31
|
|
|
39
32
|
/**
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"provides": {
|
|
9
9
|
"tools": [
|
|
10
10
|
"bash", "write", "read", "edit",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"gsd_decision_save", "gsd_summary_save",
|
|
12
|
+
"gsd_requirement_update", "gsd_milestone_generate_id"
|
|
13
13
|
],
|
|
14
14
|
"commands": ["gsd", "kill", "worktree", "exit"],
|
|
15
15
|
"hooks": ["session_start"],
|
|
@@ -374,20 +374,37 @@ function _parsePlanImpl(content: string): SlicePlan {
|
|
|
374
374
|
|
|
375
375
|
for (const line of taskLines) {
|
|
376
376
|
const cbMatch = line.match(/^-\s+\[([ xX])\]\s+\*\*([\w.]+):\s+(.+?)\*\*\s*(.*)/);
|
|
377
|
-
|
|
377
|
+
// Heading-style: ### T01 -- Title, ### T01: Title, ### T01 — Title
|
|
378
|
+
const hdMatch = !cbMatch ? line.match(/^#{2,4}\s+([\w.]+)\s*(?:--|—|:)\s*(.+)/) : null;
|
|
379
|
+
if (cbMatch || hdMatch) {
|
|
378
380
|
if (currentTask) tasks.push(currentTask);
|
|
379
381
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
382
|
+
if (cbMatch) {
|
|
383
|
+
const rest = cbMatch[4] || '';
|
|
384
|
+
const estMatch = rest.match(/`est:([^`]+)`/);
|
|
385
|
+
const estimate = estMatch ? estMatch[1] : '';
|
|
386
|
+
|
|
387
|
+
currentTask = {
|
|
388
|
+
id: cbMatch[2],
|
|
389
|
+
title: cbMatch[3],
|
|
390
|
+
description: '',
|
|
391
|
+
done: cbMatch[1].toLowerCase() === 'x',
|
|
392
|
+
estimate,
|
|
393
|
+
};
|
|
394
|
+
} else {
|
|
395
|
+
const rest = hdMatch![2] || '';
|
|
396
|
+
const titleEstMatch = rest.match(/^(.+?)\s*`est:([^`]+)`\s*$/);
|
|
397
|
+
const title = titleEstMatch ? titleEstMatch[1].trim() : rest.trim();
|
|
398
|
+
const estimate = titleEstMatch ? titleEstMatch[2] : '';
|
|
399
|
+
|
|
400
|
+
currentTask = {
|
|
401
|
+
id: hdMatch![1],
|
|
402
|
+
title,
|
|
403
|
+
description: '',
|
|
404
|
+
done: false,
|
|
405
|
+
estimate,
|
|
406
|
+
};
|
|
407
|
+
}
|
|
391
408
|
} else if (currentTask && line.match(/^\s*-\s+Files:\s*(.*)/)) {
|
|
392
409
|
const filesMatch = line.match(/^\s*-\s+Files:\s*(.*)/);
|
|
393
410
|
if (filesMatch) {
|
|
@@ -12,6 +12,7 @@ import type { ExtensionAPI, ExtensionCommandContext } from "@gsd/pi-coding-agent
|
|
|
12
12
|
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
13
13
|
import { join, dirname, relative } from "node:path";
|
|
14
14
|
import { fileURLToPath } from "node:url";
|
|
15
|
+
import { homedir } from "node:os";
|
|
15
16
|
|
|
16
17
|
import { extractTrace, type ExecutionTrace } from "./session-forensics.js";
|
|
17
18
|
import { nativeParseJsonlTail } from "./native-parser-bridge.js";
|
|
@@ -29,6 +30,9 @@ import { loadPrompt } from "./prompt-loader.js";
|
|
|
29
30
|
import { gsdRoot } from "./paths.js";
|
|
30
31
|
import { formatDuration } from "../shared/format-utils.js";
|
|
31
32
|
import { getAutoWorktreePath } from "./auto-worktree.js";
|
|
33
|
+
import { loadEffectiveGSDPreferences, loadGlobalGSDPreferences, getGlobalGSDPreferencesPath } from "./preferences.js";
|
|
34
|
+
import { showNextAction } from "../shared/tui.js";
|
|
35
|
+
import { ensurePreferencesFile, serializePreferencesToFrontmatter } from "./commands-prefs-wizard.js";
|
|
32
36
|
|
|
33
37
|
// ─── Types ────────────────────────────────────────────────────────────────────
|
|
34
38
|
|
|
@@ -66,6 +70,71 @@ interface ForensicReport {
|
|
|
66
70
|
recentUnits: { type: string; id: string; cost: number; duration: number; model: string; finishedAt: number }[];
|
|
67
71
|
}
|
|
68
72
|
|
|
73
|
+
// ─── Duplicate Detection ──────────────────────────────────────────────────────
|
|
74
|
+
|
|
75
|
+
const DEDUP_PROMPT_SECTION = `
|
|
76
|
+
## Duplicate Detection (REQUIRED before issue creation)
|
|
77
|
+
|
|
78
|
+
Before offering to create a GitHub issue, you MUST search for existing issues and PRs that may already address this bug. This step uses the user's AI tokens for analysis.
|
|
79
|
+
|
|
80
|
+
### Search Steps
|
|
81
|
+
|
|
82
|
+
1. **Search closed issues** for similar keywords from your diagnosis:
|
|
83
|
+
\`\`\`
|
|
84
|
+
gh issue list --repo gsd-build/gsd-2 --state closed --search "<keywords from root cause>" --limit 20
|
|
85
|
+
\`\`\`
|
|
86
|
+
|
|
87
|
+
2. **Search open PRs** that might contain the fix:
|
|
88
|
+
\`\`\`
|
|
89
|
+
gh pr list --repo gsd-build/gsd-2 --state open --search "<keywords>" --limit 10
|
|
90
|
+
\`\`\`
|
|
91
|
+
|
|
92
|
+
3. **Search merged PRs** that may have already fixed this:
|
|
93
|
+
\`\`\`
|
|
94
|
+
gh pr list --repo gsd-build/gsd-2 --state merged --search "<keywords>" --limit 10
|
|
95
|
+
\`\`\`
|
|
96
|
+
|
|
97
|
+
### Analysis
|
|
98
|
+
|
|
99
|
+
For each result, compare it against your root-cause diagnosis:
|
|
100
|
+
- Does the issue describe the same code path or file?
|
|
101
|
+
- Does the PR modify the same file:line you identified?
|
|
102
|
+
- Is the symptom description semantically similar even if keywords differ?
|
|
103
|
+
|
|
104
|
+
### Present Findings
|
|
105
|
+
|
|
106
|
+
If you find potential matches, present them to the user:
|
|
107
|
+
|
|
108
|
+
1. **"Already fixed by PR #X — skip issue creation"** — when a merged PR or closed issue clearly addresses the same root cause. Explain why you believe it matches.
|
|
109
|
+
2. **"Add my findings to existing issue #Y"** — when an open issue exists for the same bug. Use \`gh issue comment #Y --repo gsd-build/gsd-2\` to add forensic evidence.
|
|
110
|
+
3. **"Create new issue anyway"** — when existing results do not cover this specific failure.
|
|
111
|
+
|
|
112
|
+
Only proceed to issue creation if no matches were found OR the user explicitly chooses "Create new issue anyway".
|
|
113
|
+
`;
|
|
114
|
+
|
|
115
|
+
async function writeForensicsDedupPref(ctx: ExtensionCommandContext, enabled: boolean): Promise<void> {
|
|
116
|
+
const prefsPath = getGlobalGSDPreferencesPath();
|
|
117
|
+
await ensurePreferencesFile(prefsPath, ctx, "global");
|
|
118
|
+
const existing = loadGlobalGSDPreferences();
|
|
119
|
+
const prefs: Record<string, unknown> = existing?.preferences ? { ...existing.preferences } : {};
|
|
120
|
+
prefs.version = prefs.version || 1;
|
|
121
|
+
prefs.forensics_dedup = enabled;
|
|
122
|
+
|
|
123
|
+
const frontmatter = serializePreferencesToFrontmatter(prefs);
|
|
124
|
+
const raw = existsSync(prefsPath) ? readFileSync(prefsPath, "utf-8") : "";
|
|
125
|
+
let body = "\n# GSD Skill Preferences\n\nSee `~/.gsd/agent/extensions/gsd/docs/preferences-reference.md` for full field documentation and examples.\n";
|
|
126
|
+
const start = raw.startsWith("---\n") ? 4 : raw.startsWith("---\r\n") ? 5 : -1;
|
|
127
|
+
if (start !== -1) {
|
|
128
|
+
const closingIdx = raw.indexOf("\n---", start);
|
|
129
|
+
if (closingIdx !== -1) {
|
|
130
|
+
const after = raw.slice(closingIdx + 4);
|
|
131
|
+
if (after.trim()) body = after;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
writeFileSync(prefsPath, `---\n${frontmatter}---${body}`, "utf-8");
|
|
136
|
+
}
|
|
137
|
+
|
|
69
138
|
// ─── Entry Point ──────────────────────────────────────────────────────────────
|
|
70
139
|
|
|
71
140
|
export async function handleForensics(
|
|
@@ -97,20 +166,49 @@ export async function handleForensics(
|
|
|
97
166
|
return;
|
|
98
167
|
}
|
|
99
168
|
|
|
169
|
+
// ─── Duplicate detection opt-in ─────────────────────────────────────────────
|
|
170
|
+
const effectivePrefs = loadEffectiveGSDPreferences()?.preferences;
|
|
171
|
+
let dedupEnabled = effectivePrefs?.forensics_dedup === true;
|
|
172
|
+
|
|
173
|
+
if (effectivePrefs?.forensics_dedup === undefined) {
|
|
174
|
+
const choice = await showNextAction(ctx, {
|
|
175
|
+
title: "Duplicate detection available",
|
|
176
|
+
summary: ["Before filing a GitHub issue, forensics can search existing issues and PRs to avoid duplicates.", "This uses additional AI tokens for analysis."],
|
|
177
|
+
actions: [
|
|
178
|
+
{ id: "enable", label: "Enable duplicate detection", description: "Search issues/PRs before filing (recommended)", recommended: true },
|
|
179
|
+
{ id: "skip", label: "Skip for now", description: "File without checking for duplicates" },
|
|
180
|
+
],
|
|
181
|
+
notYetMessage: "You can enable this later via preferences (forensics_dedup: true).",
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
if (choice === "enable") {
|
|
185
|
+
await writeForensicsDedupPref(ctx, true);
|
|
186
|
+
dedupEnabled = true;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const dedupSection = dedupEnabled ? DEDUP_PROMPT_SECTION : "";
|
|
191
|
+
|
|
100
192
|
ctx.ui.notify("Building forensic report...", "info");
|
|
101
193
|
|
|
102
194
|
const report = await buildForensicReport(basePath);
|
|
103
195
|
const savedPath = saveForensicReport(basePath, report, problemDescription);
|
|
104
196
|
|
|
105
|
-
// Derive GSD source dir for prompt
|
|
106
|
-
|
|
107
|
-
|
|
197
|
+
// Derive GSD source dir for prompt — fall back to ~/.gsd/agent/extensions/gsd/
|
|
198
|
+
// when import.meta.url resolves to the npm-global install path (Windows).
|
|
199
|
+
let gsdSourceDir = dirname(fileURLToPath(import.meta.url));
|
|
200
|
+
if (!existsSync(join(gsdSourceDir, "prompts"))) {
|
|
201
|
+
const gsdHome = process.env.GSD_HOME || join(homedir(), ".gsd");
|
|
202
|
+
const fallback = join(gsdHome, "agent", "extensions", "gsd");
|
|
203
|
+
if (existsSync(join(fallback, "prompts"))) gsdSourceDir = fallback;
|
|
204
|
+
}
|
|
108
205
|
|
|
109
206
|
const forensicData = formatReportForPrompt(report);
|
|
110
207
|
const content = loadPrompt("forensics", {
|
|
111
208
|
problemDescription,
|
|
112
209
|
forensicData,
|
|
113
210
|
gsdSourceDir,
|
|
211
|
+
dedupSection,
|
|
114
212
|
});
|
|
115
213
|
|
|
116
214
|
ctx.ui.notify(`Forensic report saved: ${relative(basePath, savedPath)}`, "info");
|
|
@@ -245,7 +245,6 @@ export function writeIntegrationBranch(
|
|
|
245
245
|
basePath: string,
|
|
246
246
|
milestoneId: string,
|
|
247
247
|
branch: string,
|
|
248
|
-
_options?: { commitDocs?: boolean },
|
|
249
248
|
): void {
|
|
250
249
|
// Don't record slice branches as the integration target
|
|
251
250
|
if (SLICE_BRANCH_RE.test(branch)) return;
|
|
@@ -683,10 +682,11 @@ export function createDraftPR(
|
|
|
683
682
|
body: string,
|
|
684
683
|
): string | null {
|
|
685
684
|
try {
|
|
686
|
-
const result =
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
685
|
+
const result = execFileSync("gh", [
|
|
686
|
+
"pr", "create", "--draft",
|
|
687
|
+
"--title", title,
|
|
688
|
+
"--body", body,
|
|
689
|
+
], { cwd: basePath, encoding: "utf8", timeout: 30000, env: GIT_NO_PROMPT_ENV });
|
|
690
690
|
return result.trim();
|
|
691
691
|
} catch {
|
|
692
692
|
return null;
|
|
@@ -137,7 +137,7 @@ export function hasGitTrackedGsdFiles(basePath: string): boolean {
|
|
|
137
137
|
*/
|
|
138
138
|
export function ensureGitignore(
|
|
139
139
|
basePath: string,
|
|
140
|
-
options?: { manageGitignore?: boolean
|
|
140
|
+
options?: { manageGitignore?: boolean },
|
|
141
141
|
): boolean {
|
|
142
142
|
// If manage_gitignore is explicitly false, do not touch .gitignore at all
|
|
143
143
|
if (options?.manageGitignore === false) return false;
|