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
package/README.md
CHANGED
|
@@ -24,35 +24,98 @@ One command. Walk away. Come back to a built project with clean git history.
|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
-
## What's New in v2.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- **
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
34
|
-
-
|
|
35
|
-
- **
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- **
|
|
41
|
-
- **
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
- **
|
|
27
|
+
## What's New in v2.42.0
|
|
28
|
+
|
|
29
|
+
### New Features
|
|
30
|
+
|
|
31
|
+
- **Declarative workflow engine** — define YAML workflows that execute through auto-loop, enabling repeatable multi-step automations without code. (#2024)
|
|
32
|
+
- **Unified rule registry & event journal** — centralized rule registry, event journal with query tool, and standardized tool naming convention. (#1928)
|
|
33
|
+
- **PR risk checker** — CI classifies changed files by system area and surfaces risk level on pull requests. (#1930)
|
|
34
|
+
- **`/gsd fast`** — toggle service tier for supported models, enabling prioritized API routing for faster responses. (#1862)
|
|
35
|
+
- **Web mode CLI flags** — `--host`, `--port`, and `--allowed-origins` flags give full control over the web server bind address and CORS policy. (#1873)
|
|
36
|
+
- **ADR attribution** — architecture decision records now distinguish human, agent, and collaborative authorship. (#1830)
|
|
37
|
+
|
|
38
|
+
### Key Fixes
|
|
39
|
+
|
|
40
|
+
- **Node v24 web boot** — resolved `ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING` that prevented `gsd --web` from starting on Node v24. (#1864)
|
|
41
|
+
- **Worktree health check for all ecosystems** — broadened from JS-only to 17+ ecosystems (Rust, Go, Python, Java, etc.). (#1860)
|
|
42
|
+
- **Doctor roadmap atomicity** — roadmap checkbox gating now checks summary on disk, not issue detection, preventing false unchecks. (#1915)
|
|
43
|
+
- **Windows path handling** — 8.3 short path resolution, backslash normalization in bash commands, PowerShell browser launch, and parenthesis escaping. (#1960, #1863, #1870, #1872)
|
|
44
|
+
- **Auth token persistence** — web UI auth token survives page refreshes via sessionStorage. (#1877)
|
|
45
|
+
- **German/non-English locale git errors** — git commands now force `LC_ALL=C` to prevent locale-dependent parse failures.
|
|
46
|
+
- **Orphan web server process** — stale web server processes on port 3000 are now cleaned up automatically.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## What's New in v2.41.0
|
|
51
|
+
|
|
52
|
+
### New Features
|
|
53
|
+
|
|
54
|
+
- **Browser-based web interface** — run GSD from the browser with `gsd --web`. Full project management, real-time progress, and multi-project support via server-sent events. (#1717)
|
|
55
|
+
- **Doctor: worktree lifecycle checks** — `/gsd doctor` now validates worktree health, detects orphaned worktrees, consolidates cleanup, and enhances `/worktree list` with lifecycle status. (#1814)
|
|
56
|
+
- **CI: docs-only PR detection** — PRs that only change documentation skip build and test steps, with a new prompt injection scan for security. (#1699)
|
|
57
|
+
- **Custom Models guide** — new documentation for adding custom providers (Ollama, vLLM, LM Studio, proxies) via `models.json`. (#1670)
|
|
58
|
+
|
|
59
|
+
### Data Loss Prevention (Critical Fixes)
|
|
60
|
+
|
|
61
|
+
This release includes 7 fixes preventing silent data loss in auto-mode:
|
|
62
|
+
|
|
63
|
+
- **Hallucination guard** — execute-task agents that complete with zero tool calls are now rejected as hallucinated. Previously, agents could produce detailed but fabricated summaries without writing any code, wasting ~$25/milestone. (#1838)
|
|
64
|
+
- **Merge anchor verification** — before deleting a milestone worktree/branch, GSD now verifies the code is actually on the integration branch. Prevents orphaning commits when squash-merge produces an empty diff. (#1829)
|
|
65
|
+
- **Dirty working tree detection** — `nativeMergeSquash` now distinguishes dirty-tree rejections from content conflicts, preventing silent commit loss when synced `.gsd/` files block the merge. (#1752)
|
|
66
|
+
- **Doctor cleanup safety** — the `orphaned_completed_units` check no longer auto-fixes during post-task health checks. Previously, timing races could cause the doctor to remove valid completion keys, reverting users to earlier tasks. (#1825)
|
|
67
|
+
- **Root file reverse-sync** — worktree teardown now syncs root-level `.gsd/` files (PROJECT.md, REQUIREMENTS.md, completed-units.json) back to the project root. Previously these were lost on milestone closeout. (#1831)
|
|
68
|
+
- **Empty merge guard** — milestone branches with unanchored code changes are preserved instead of deleted when squash-merge produces nothing to commit. (#1755)
|
|
69
|
+
- **Crash-safe task closeout** — orphaned checkboxes in PLAN.md are unchecked on retry, preventing phantom task completion. (#1759)
|
|
70
|
+
|
|
71
|
+
### Auto-Mode Stability
|
|
72
|
+
|
|
73
|
+
- **Terminal hang fix** — `stopAuto()` now resolves pending promises, preventing the terminal from freezing permanently after stopping auto-mode. (#1818)
|
|
74
|
+
- **Signal handler coverage** — SIGHUP and SIGINT now clean up lock files, not just SIGTERM. Prevents stranded locks on VS-Code crash. (#1821)
|
|
75
|
+
- **Needs-discussion routing** — milestones in `needs-discussion` phase now route to the smart entry UI instead of hard-stopping, breaking the infinite loop. (#1820)
|
|
76
|
+
- **Infrastructure error handling** — auto-mode stops immediately on ENOSPC, ENOMEM, and similar unrecoverable errors instead of retrying. (#1780)
|
|
77
|
+
- **Dependency-aware dispatch** — slice dispatch now uses declared `depends_on` instead of positional ordering. (#1770)
|
|
78
|
+
- **Queue mode depth verification** — the write gate now processes depth verification in queue mode, fixing a deadlock where CONTEXT.md writes were permanently blocked. (#1823)
|
|
79
|
+
|
|
80
|
+
### Roadmap Parser Improvements
|
|
81
|
+
|
|
82
|
+
- **Table format support** — roadmaps using markdown tables (`| S01 | Title | Risk | Status |`) are now parsed correctly. (#1741)
|
|
83
|
+
- **Prose header fallback** — when `## Slices` contains H3 headers instead of checkboxes, the prose parser is invoked as a fallback. (#1744)
|
|
84
|
+
- **Completion marker detection** — prose headers with `✓` or `(Complete)` markers are correctly identified as done. (#1816)
|
|
85
|
+
- **Zero-slice stub handling** — stub roadmaps from `/gsd queue` return `pre-planning` instead of `blocked`. (#1826)
|
|
86
|
+
- **Immediate roadmap fix** — roadmap checkbox and UAT stub are fixed immediately after last task instead of deferring to `complete-slice`. (#1819)
|
|
87
|
+
|
|
88
|
+
### State & Git Improvements
|
|
89
|
+
|
|
90
|
+
- **CONTEXT-DRAFT.md fallback** — `depends_on` is read from CONTEXT-DRAFT.md when CONTEXT.md doesn't exist, preventing draft milestones from being promoted past dependency constraints. (#1743)
|
|
91
|
+
- **Unborn branch support** — `nativeBranchExists` handles repos with zero commits, preventing dispatch deadlock on new repos. (#1815)
|
|
92
|
+
- **Ghost milestone detection** — empty `.gsd/milestones/` directories are skipped instead of crashing `deriveState()`. (#1817)
|
|
93
|
+
- **Default branch detection** — milestone merge detects `master` vs `main` instead of hardcoding. (#1669)
|
|
94
|
+
- **Milestone title extraction** — titles are pulled from CONTEXT.md headings when no ROADMAP exists. (#1729)
|
|
95
|
+
|
|
96
|
+
### Windows & Platform
|
|
97
|
+
|
|
98
|
+
- **Windows path handling** — 8.3 short paths, `pathToFileURL` for ESM imports, and `realpathSync.native` fixes across the test suite and verification gate. (#1804)
|
|
99
|
+
- **DEP0190 fix** — `spawnSync` deprecation warning eliminated by passing commands to shell explicitly. (#1827)
|
|
100
|
+
- **Web build skip on Windows** — Next.js webpack EPERM errors on system directories are handled gracefully.
|
|
101
|
+
|
|
102
|
+
### Developer Experience
|
|
103
|
+
|
|
104
|
+
- **@ file finder fix** — typing `@` no longer freezes the TUI. The fix adds debounce, dedup, and empty-query short-circuit. (#1832)
|
|
105
|
+
- **Tool-call loop guard** — detects and breaks infinite tool-call loops within a single unit, preventing stack overflow. (#1801)
|
|
106
|
+
- **Completion deferral fix** — roadmap checkbox and UAT stub are fixed at task level, closing the fragile handoff window between last task and `complete-slice`. (#1819)
|
|
107
|
+
|
|
108
|
+
See the full [Changelog](./CHANGELOG.md) for all 70+ fixes in this release.
|
|
109
|
+
|
|
110
|
+
### Previous highlights (v2.39–v2.40)
|
|
111
|
+
|
|
112
|
+
- **GitHub sync extension** — auto-sync milestones to GitHub Issues, PRs, and Milestones
|
|
113
|
+
- **Skill tool resolution** — skills auto-activate in dispatched prompts
|
|
114
|
+
- **Health check phase 2** — real-time doctor issues in dashboard and visualizer
|
|
115
|
+
- **Forensics upgrade** — full-access GSD debugger with anomaly detection
|
|
116
|
+
- **Pipeline decomposition** — auto-loop rewritten as linear phase pipeline
|
|
117
|
+
- **Sliding-window stuck detection** — pattern-aware, fewer false positives
|
|
118
|
+
- **Data-loss recovery** — automatic detection and recovery from v2.30–v2.38 migration issues
|
|
56
119
|
|
|
57
120
|
---
|
|
58
121
|
|
package/dist/cli-web-branch.d.ts
CHANGED
|
@@ -13,6 +13,12 @@ export interface CliFlags {
|
|
|
13
13
|
web?: boolean;
|
|
14
14
|
/** Optional project path for web mode: `gsd --web <path>` or `gsd web start <path>` */
|
|
15
15
|
webPath?: string;
|
|
16
|
+
/** Custom host to bind web server to: `--host 0.0.0.0` */
|
|
17
|
+
webHost?: string;
|
|
18
|
+
/** Custom port for web server: `--port 8080` */
|
|
19
|
+
webPort?: number;
|
|
20
|
+
/** Additional allowed origins for CORS: `--allowed-origins http://192.168.1.10:8080` */
|
|
21
|
+
webAllowedOrigins?: string[];
|
|
16
22
|
help?: boolean;
|
|
17
23
|
version?: boolean;
|
|
18
24
|
}
|
package/dist/cli-web-branch.js
CHANGED
|
@@ -29,6 +29,20 @@ export function parseCliArgs(argv) {
|
|
|
29
29
|
flags.webPath = args[++i];
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
+
else if (arg === '--host' && i + 1 < args.length) {
|
|
33
|
+
flags.webHost = args[++i];
|
|
34
|
+
}
|
|
35
|
+
else if (arg === '--port' && i + 1 < args.length) {
|
|
36
|
+
const portStr = args[++i];
|
|
37
|
+
const port = parseInt(portStr, 10);
|
|
38
|
+
if (Number.isFinite(port) && port > 0 && port < 65536) {
|
|
39
|
+
flags.webPort = port;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else if (arg === '--allowed-origins' && i + 1 < args.length) {
|
|
43
|
+
const origins = args[++i].split(',').map(o => o.trim()).filter(Boolean);
|
|
44
|
+
flags.webAllowedOrigins = (flags.webAllowedOrigins ?? []).concat(origins);
|
|
45
|
+
}
|
|
32
46
|
else if (arg === '--model' && i + 1 < args.length) {
|
|
33
47
|
flags.model = args[++i];
|
|
34
48
|
}
|
|
@@ -216,6 +230,9 @@ export async function runWebCliBranch(flags, deps = {}) {
|
|
|
216
230
|
cwd: currentCwd,
|
|
217
231
|
projectSessionsDir,
|
|
218
232
|
agentDir,
|
|
233
|
+
host: flags.webHost,
|
|
234
|
+
port: flags.webPort,
|
|
235
|
+
allowedOrigins: flags.webAllowedOrigins,
|
|
219
236
|
});
|
|
220
237
|
if (!status.ok) {
|
|
221
238
|
emitWebModeFailure(stderr, status);
|
package/dist/cli.js
CHANGED
|
@@ -14,6 +14,14 @@ import { parseCliArgs as parseWebCliArgs, runWebCliBranch, migrateLegacyFlatSess
|
|
|
14
14
|
import { stopWebMode } from './web-mode.js';
|
|
15
15
|
import { getProjectSessionsDir } from './project-sessions.js';
|
|
16
16
|
import { markStartup, printStartupTimings } from './startup-timings.js';
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
// V8 compile cache — Node 22+ can cache compiled bytecode across runs,
|
|
19
|
+
// eliminating repeated parse/compile overhead for unchanged modules.
|
|
20
|
+
// Must be set early so dynamic imports (extensions, lazy subcommands) benefit.
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
if (parseInt(process.versions.node) >= 22) {
|
|
23
|
+
process.env.NODE_COMPILE_CACHE ??= join(agentDir, '.compile-cache');
|
|
24
|
+
}
|
|
17
25
|
function exitIfManagedResourcesAreNewer(currentAgentDir) {
|
|
18
26
|
const currentVersion = process.env.GSD_VERSION || '0.0.0';
|
|
19
27
|
const managedVersion = getNewerManagedResourceVersion(currentAgentDir, currentVersion);
|
|
@@ -461,8 +469,14 @@ const sessionManager = cliFlags._selectedSessionPath
|
|
|
461
469
|
exitIfManagedResourcesAreNewer(agentDir);
|
|
462
470
|
initResources(agentDir);
|
|
463
471
|
markStartup('initResources');
|
|
472
|
+
// Overlap resource loading with session manager setup — both are independent.
|
|
473
|
+
// resourceLoader.reload() is the most expensive step (jiti compilation), so
|
|
474
|
+
// starting it early shaves ~50-200ms off interactive startup.
|
|
464
475
|
const resourceLoader = buildResourceLoader(agentDir);
|
|
465
|
-
|
|
476
|
+
const resourceLoadPromise = resourceLoader.reload();
|
|
477
|
+
// While resources load, let session manager finish any async I/O it needs.
|
|
478
|
+
// Then await the resource promise before creating the agent session.
|
|
479
|
+
await resourceLoadPromise;
|
|
466
480
|
markStartup('resourceLoader.reload');
|
|
467
481
|
const { session, extensionsResult } = await createAgentSession({
|
|
468
482
|
authStorage,
|
|
@@ -530,8 +544,9 @@ if (!process.stdin.isTTY) {
|
|
|
530
544
|
process.stderr.write('[gsd] gsd --mode text "message" Text output mode\n');
|
|
531
545
|
process.exit(1);
|
|
532
546
|
}
|
|
533
|
-
// Welcome screen — shown on every fresh interactive session before TUI takes over
|
|
534
|
-
|
|
547
|
+
// Welcome screen — shown on every fresh interactive session before TUI takes over.
|
|
548
|
+
// Skip when the first-run banner was already printed in loader.ts (prevents double banner).
|
|
549
|
+
if (!process.env.GSD_FIRST_RUN_BANNER) {
|
|
535
550
|
const { printWelcomeScreen } = await import('./welcome-screen.js');
|
|
536
551
|
printWelcomeScreen({
|
|
537
552
|
version: process.env.GSD_VERSION || '0.0.0',
|
package/dist/loader.js
CHANGED
|
@@ -42,7 +42,8 @@ const pkgDir = resolve(dirname(fileURLToPath(import.meta.url)), '..', 'pkg');
|
|
|
42
42
|
process.env.PI_PACKAGE_DIR = pkgDir;
|
|
43
43
|
process.env.PI_SKIP_VERSION_CHECK = '1'; // GSD runs its own update check in cli.ts — suppress pi's
|
|
44
44
|
process.title = 'gsd';
|
|
45
|
-
// Print branded banner on first launch (before ~/.gsd/ exists)
|
|
45
|
+
// Print branded banner on first launch (before ~/.gsd/ exists).
|
|
46
|
+
// Set GSD_FIRST_RUN_BANNER so cli.ts skips the duplicate welcome screen.
|
|
46
47
|
if (!existsSync(appRoot)) {
|
|
47
48
|
const cyan = '\x1b[36m';
|
|
48
49
|
const green = '\x1b[32m';
|
|
@@ -53,6 +54,7 @@ if (!existsSync(appRoot)) {
|
|
|
53
54
|
'\n' +
|
|
54
55
|
` Get Shit Done ${dim}v${gsdVersion}${reset}\n` +
|
|
55
56
|
` ${green}Welcome.${reset} Setting up your environment...\n\n`);
|
|
57
|
+
process.env.GSD_FIRST_RUN_BANNER = '1';
|
|
56
58
|
}
|
|
57
59
|
// GSD_CODING_AGENT_DIR — tells pi's getAgentDir() to return ~/.gsd/agent/ instead of ~/.gsd/agent/
|
|
58
60
|
process.env.GSD_CODING_AGENT_DIR = agentDir;
|
package/dist/onboarding.js
CHANGED
|
@@ -94,7 +94,8 @@ async function loadPico() {
|
|
|
94
94
|
/** Open a URL in the system browser (best-effort, non-blocking) */
|
|
95
95
|
function openBrowser(url) {
|
|
96
96
|
if (process.platform === 'win32') {
|
|
97
|
-
|
|
97
|
+
// PowerShell's Start-Process handles URLs with '&' safely; cmd /c start does not.
|
|
98
|
+
execFile('powershell', ['-c', `Start-Process '${url.replace(/'/g, "''")}'`], () => { });
|
|
98
99
|
}
|
|
99
100
|
else {
|
|
100
101
|
const cmd = process.platform === 'darwin' ? 'open' : 'xdg-open';
|
package/dist/resource-loader.js
CHANGED
|
@@ -48,14 +48,25 @@ function getBundledGsdVersion() {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
function writeManagedResourceManifest(agentDir) {
|
|
51
|
-
// Record root-level files
|
|
52
|
-
// future upgrades can detect and prune any
|
|
51
|
+
// Record root-level files and subdirectory extension names currently in the
|
|
52
|
+
// bundled extensions source so that future upgrades can detect and prune any
|
|
53
|
+
// that get removed or moved.
|
|
53
54
|
let installedExtensionRootFiles = [];
|
|
55
|
+
let installedExtensionDirs = [];
|
|
54
56
|
try {
|
|
55
57
|
if (existsSync(bundledExtensionsDir)) {
|
|
56
|
-
|
|
58
|
+
const entries = readdirSync(bundledExtensionsDir, { withFileTypes: true });
|
|
59
|
+
installedExtensionRootFiles = entries
|
|
57
60
|
.filter(e => e.isFile())
|
|
58
61
|
.map(e => e.name);
|
|
62
|
+
installedExtensionDirs = entries
|
|
63
|
+
.filter(e => e.isDirectory())
|
|
64
|
+
.filter(e => {
|
|
65
|
+
// Only track directories that are actual extensions (contain index.js or index.ts)
|
|
66
|
+
const dirPath = join(bundledExtensionsDir, e.name);
|
|
67
|
+
return existsSync(join(dirPath, 'index.js')) || existsSync(join(dirPath, 'index.ts'));
|
|
68
|
+
})
|
|
69
|
+
.map(e => e.name);
|
|
59
70
|
}
|
|
60
71
|
}
|
|
61
72
|
catch { /* non-fatal */ }
|
|
@@ -64,6 +75,7 @@ function writeManagedResourceManifest(agentDir) {
|
|
|
64
75
|
syncedAt: Date.now(),
|
|
65
76
|
contentHash: computeResourceFingerprint(),
|
|
66
77
|
installedExtensionRootFiles,
|
|
78
|
+
installedExtensionDirs,
|
|
67
79
|
};
|
|
68
80
|
writeFileSync(getManagedResourceManifestPath(agentDir), JSON.stringify(manifest));
|
|
69
81
|
}
|
|
@@ -284,16 +296,20 @@ function pruneRemovedBundledExtensions(manifest, agentDir) {
|
|
|
284
296
|
return;
|
|
285
297
|
// Current bundled root-level files (what the new version provides)
|
|
286
298
|
const currentSourceFiles = new Set();
|
|
299
|
+
// Current bundled subdirectory extensions
|
|
300
|
+
const currentSourceDirs = new Set();
|
|
287
301
|
try {
|
|
288
302
|
if (existsSync(bundledExtensionsDir)) {
|
|
289
303
|
for (const e of readdirSync(bundledExtensionsDir, { withFileTypes: true })) {
|
|
290
304
|
if (e.isFile())
|
|
291
305
|
currentSourceFiles.add(e.name);
|
|
306
|
+
if (e.isDirectory())
|
|
307
|
+
currentSourceDirs.add(e.name);
|
|
292
308
|
}
|
|
293
309
|
}
|
|
294
310
|
}
|
|
295
311
|
catch { /* non-fatal */ }
|
|
296
|
-
const
|
|
312
|
+
const removeFileIfStale = (fileName) => {
|
|
297
313
|
if (currentSourceFiles.has(fileName))
|
|
298
314
|
return; // still in bundle, not stale
|
|
299
315
|
const stale = join(extensionsDir, fileName);
|
|
@@ -303,17 +319,33 @@ function pruneRemovedBundledExtensions(manifest, agentDir) {
|
|
|
303
319
|
}
|
|
304
320
|
catch { /* non-fatal */ }
|
|
305
321
|
};
|
|
322
|
+
const removeDirIfStale = (dirName) => {
|
|
323
|
+
if (currentSourceDirs.has(dirName))
|
|
324
|
+
return; // still in bundle, not stale
|
|
325
|
+
const stale = join(extensionsDir, dirName);
|
|
326
|
+
try {
|
|
327
|
+
if (existsSync(stale))
|
|
328
|
+
rmSync(stale, { recursive: true, force: true });
|
|
329
|
+
}
|
|
330
|
+
catch { /* non-fatal */ }
|
|
331
|
+
};
|
|
306
332
|
if (manifest?.installedExtensionRootFiles) {
|
|
307
333
|
// Manifest-based: remove previously-installed root files that are no longer bundled
|
|
308
334
|
for (const prevFile of manifest.installedExtensionRootFiles) {
|
|
309
|
-
|
|
335
|
+
removeFileIfStale(prevFile);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
if (manifest?.installedExtensionDirs) {
|
|
339
|
+
// Manifest-based: remove previously-installed subdirectory extensions that are no longer bundled
|
|
340
|
+
for (const prevDir of manifest.installedExtensionDirs) {
|
|
341
|
+
removeDirIfStale(prevDir);
|
|
310
342
|
}
|
|
311
343
|
}
|
|
312
344
|
// Always remove known stale files regardless of manifest state.
|
|
313
345
|
// These were installed by pre-manifest versions so they may not appear in
|
|
314
346
|
// installedExtensionRootFiles even when a manifest exists.
|
|
315
347
|
// env-utils.js was moved from extensions/ root → gsd/ in v2.39.x (#1634)
|
|
316
|
-
|
|
348
|
+
removeFileIfStale('env-utils.js');
|
|
317
349
|
}
|
|
318
350
|
/**
|
|
319
351
|
* Syncs all bundled resources to agentDir (~/.gsd/agent/) on every launch.
|
|
@@ -416,5 +448,6 @@ export function buildResourceLoader(agentDir) {
|
|
|
416
448
|
return new DefaultResourceLoader({
|
|
417
449
|
agentDir,
|
|
418
450
|
additionalExtensionPaths: piExtensionPaths,
|
|
451
|
+
bundledExtensionNames: bundledKeys,
|
|
419
452
|
});
|
|
420
453
|
}
|
|
@@ -83,6 +83,15 @@ export function createAsyncBashTool(getManager, getCwd) {
|
|
|
83
83
|
*/
|
|
84
84
|
function executeBashInBackground(command, cwd, signal, timeout) {
|
|
85
85
|
return new Promise((resolve, reject) => {
|
|
86
|
+
let settled = false;
|
|
87
|
+
const safeResolve = (value) => { if (!settled) {
|
|
88
|
+
settled = true;
|
|
89
|
+
resolve(value);
|
|
90
|
+
} };
|
|
91
|
+
const safeReject = (err) => { if (!settled) {
|
|
92
|
+
settled = true;
|
|
93
|
+
reject(err);
|
|
94
|
+
} };
|
|
86
95
|
const { shell, args } = getShellConfig();
|
|
87
96
|
const resolvedCommand = sanitizeCommand(command);
|
|
88
97
|
const child = spawn(shell, [...args, resolvedCommand], {
|
|
@@ -93,11 +102,42 @@ function executeBashInBackground(command, cwd, signal, timeout) {
|
|
|
93
102
|
});
|
|
94
103
|
let timedOut = false;
|
|
95
104
|
let timeoutHandle;
|
|
105
|
+
let sigkillHandle;
|
|
106
|
+
let hardDeadlineHandle;
|
|
107
|
+
/** Grace period (ms) between SIGTERM and SIGKILL. */
|
|
108
|
+
const SIGKILL_GRACE_MS = 5_000;
|
|
109
|
+
/** Hard deadline (ms) after SIGKILL to force-resolve the promise. */
|
|
110
|
+
const HARD_DEADLINE_MS = 3_000;
|
|
96
111
|
if (timeout !== undefined && timeout > 0) {
|
|
97
112
|
timeoutHandle = setTimeout(() => {
|
|
98
113
|
timedOut = true;
|
|
99
114
|
if (child.pid)
|
|
100
115
|
killTree(child.pid);
|
|
116
|
+
// If the process ignores SIGTERM, escalate to SIGKILL
|
|
117
|
+
sigkillHandle = setTimeout(() => {
|
|
118
|
+
if (child.pid) {
|
|
119
|
+
try {
|
|
120
|
+
process.kill(-child.pid, "SIGKILL");
|
|
121
|
+
}
|
|
122
|
+
catch { /* ignore */ }
|
|
123
|
+
try {
|
|
124
|
+
process.kill(child.pid, "SIGKILL");
|
|
125
|
+
}
|
|
126
|
+
catch { /* ignore */ }
|
|
127
|
+
}
|
|
128
|
+
// Hard deadline: if even SIGKILL doesn't trigger 'close',
|
|
129
|
+
// force-resolve so the job doesn't hang forever (#2186).
|
|
130
|
+
hardDeadlineHandle = setTimeout(() => {
|
|
131
|
+
const output = Buffer.concat(chunks).toString("utf-8");
|
|
132
|
+
safeResolve(output
|
|
133
|
+
? `${output}\n\nCommand timed out after ${timeout} seconds (force-killed)`
|
|
134
|
+
: `Command timed out after ${timeout} seconds (force-killed)`);
|
|
135
|
+
}, HARD_DEADLINE_MS);
|
|
136
|
+
if (typeof hardDeadlineHandle === "object" && "unref" in hardDeadlineHandle)
|
|
137
|
+
hardDeadlineHandle.unref();
|
|
138
|
+
}, SIGKILL_GRACE_MS);
|
|
139
|
+
if (typeof sigkillHandle === "object" && "unref" in sigkillHandle)
|
|
140
|
+
sigkillHandle.unref();
|
|
101
141
|
}, timeout * 1000);
|
|
102
142
|
}
|
|
103
143
|
const chunks = [];
|
|
@@ -139,23 +179,31 @@ function executeBashInBackground(command, cwd, signal, timeout) {
|
|
|
139
179
|
child.on("error", (err) => {
|
|
140
180
|
if (timeoutHandle)
|
|
141
181
|
clearTimeout(timeoutHandle);
|
|
182
|
+
if (sigkillHandle)
|
|
183
|
+
clearTimeout(sigkillHandle);
|
|
184
|
+
if (hardDeadlineHandle)
|
|
185
|
+
clearTimeout(hardDeadlineHandle);
|
|
142
186
|
signal.removeEventListener("abort", onAbort);
|
|
143
|
-
|
|
187
|
+
safeReject(err);
|
|
144
188
|
});
|
|
145
189
|
child.on("close", (code) => {
|
|
146
190
|
if (timeoutHandle)
|
|
147
191
|
clearTimeout(timeoutHandle);
|
|
192
|
+
if (sigkillHandle)
|
|
193
|
+
clearTimeout(sigkillHandle);
|
|
194
|
+
if (hardDeadlineHandle)
|
|
195
|
+
clearTimeout(hardDeadlineHandle);
|
|
148
196
|
signal.removeEventListener("abort", onAbort);
|
|
149
197
|
if (spillStream)
|
|
150
198
|
spillStream.end();
|
|
151
199
|
if (signal.aborted) {
|
|
152
200
|
const output = Buffer.concat(chunks).toString("utf-8");
|
|
153
|
-
|
|
201
|
+
safeResolve(output ? `${output}\n\nCommand aborted` : "Command aborted");
|
|
154
202
|
return;
|
|
155
203
|
}
|
|
156
204
|
if (timedOut) {
|
|
157
205
|
const output = Buffer.concat(chunks).toString("utf-8");
|
|
158
|
-
|
|
206
|
+
safeResolve(output ? `${output}\n\nCommand timed out after ${timeout} seconds` : `Command timed out after ${timeout} seconds`);
|
|
159
207
|
return;
|
|
160
208
|
}
|
|
161
209
|
const fullOutput = Buffer.concat(chunks).toString("utf-8");
|
|
@@ -176,7 +224,7 @@ function executeBashInBackground(command, cwd, signal, timeout) {
|
|
|
176
224
|
if (code !== 0 && code !== null) {
|
|
177
225
|
text += `\n\nCommand exited with code ${code}`;
|
|
178
226
|
}
|
|
179
|
-
|
|
227
|
+
safeResolve(text);
|
|
180
228
|
});
|
|
181
229
|
});
|
|
182
230
|
}
|
|
@@ -54,6 +54,11 @@ export function createAwaitTool(getManager) {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
+
// Mark all watched jobs as awaited upfront so the onJobComplete
|
|
58
|
+
// callback (which fires synchronously in the promise .then()) knows
|
|
59
|
+
// to suppress the follow-up message.
|
|
60
|
+
for (const j of watched)
|
|
61
|
+
j.awaited = true;
|
|
57
62
|
// If all watched jobs are already done, return immediately
|
|
58
63
|
const running = watched.filter((j) => j.status === "running");
|
|
59
64
|
if (running.length === 0) {
|
|
@@ -34,6 +34,8 @@ export default function AsyncJobs(pi) {
|
|
|
34
34
|
latestCwd = ctx.cwd;
|
|
35
35
|
manager = new AsyncJobManager({
|
|
36
36
|
onJobComplete: (job) => {
|
|
37
|
+
if (job.awaited)
|
|
38
|
+
return;
|
|
37
39
|
const statusEmoji = job.status === "completed" ? "done" : "error";
|
|
38
40
|
const elapsed = ((Date.now() - job.startTime) / 1000).toFixed(1);
|
|
39
41
|
const output = job.status === "completed"
|
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Imports from: auto/types, auto/resolve, auto/phases
|
|
8
8
|
*/
|
|
9
|
+
import { randomUUID } from "node:crypto";
|
|
9
10
|
import { MAX_LOOP_ITERATIONS, } from "./types.js";
|
|
10
11
|
import { _clearCurrentResolve } from "./resolve.js";
|
|
11
12
|
import { runPreDispatch, runDispatch, runGuards, runUnitPhase, runFinalize, } from "./phases.js";
|
|
12
13
|
import { debugLog } from "../debug-logger.js";
|
|
13
14
|
import { isInfrastructureError } from "./infra-errors.js";
|
|
15
|
+
import { resolveEngine } from "../engine-resolver.js";
|
|
14
16
|
/**
|
|
15
17
|
* Main auto-mode execution loop. Iterates: derive → dispatch → guards →
|
|
16
18
|
* runUnit → finalize → repeat. Exits when s.active becomes false or a
|
|
@@ -27,6 +29,10 @@ export async function autoLoop(ctx, pi, s, deps) {
|
|
|
27
29
|
while (s.active) {
|
|
28
30
|
iteration++;
|
|
29
31
|
debugLog("autoLoop", { phase: "loop-top", iteration });
|
|
32
|
+
// ── Journal: per-iteration flow grouping ──
|
|
33
|
+
const flowId = randomUUID();
|
|
34
|
+
let seqCounter = 0;
|
|
35
|
+
const nextSeq = () => ++seqCounter;
|
|
30
36
|
if (iteration > MAX_LOOP_ITERATIONS) {
|
|
31
37
|
debugLog("autoLoop", {
|
|
32
38
|
phase: "exit",
|
|
@@ -53,6 +59,7 @@ export async function autoLoop(ctx, pi, s, deps) {
|
|
|
53
59
|
unitType: sidecarItem.unitType,
|
|
54
60
|
unitId: sidecarItem.unitId,
|
|
55
61
|
});
|
|
62
|
+
deps.emitJournalEvent({ ts: new Date().toISOString(), flowId, seq: nextSeq(), eventType: "sidecar-dequeue", data: { kind: sidecarItem.kind, unitType: sidecarItem.unitType, unitId: sidecarItem.unitId } });
|
|
56
63
|
}
|
|
57
64
|
const sessionLockBase = deps.lockBase();
|
|
58
65
|
if (sessionLockBase) {
|
|
@@ -73,8 +80,88 @@ export async function autoLoop(ctx, pi, s, deps) {
|
|
|
73
80
|
break;
|
|
74
81
|
}
|
|
75
82
|
}
|
|
76
|
-
const ic = { ctx, pi, s, deps, prefs, iteration };
|
|
83
|
+
const ic = { ctx, pi, s, deps, prefs, iteration, flowId, nextSeq };
|
|
84
|
+
deps.emitJournalEvent({ ts: new Date().toISOString(), flowId, seq: nextSeq(), eventType: "iteration-start", data: { iteration } });
|
|
77
85
|
let iterData;
|
|
86
|
+
// ── Custom engine path ──────────────────────────────────────────────
|
|
87
|
+
// When activeEngineId is a non-dev value, bypass runPreDispatch and
|
|
88
|
+
// runDispatch entirely — the custom engine drives its own state via
|
|
89
|
+
// GRAPH.yaml. Shares runGuards and runUnitPhase with the dev path.
|
|
90
|
+
// After unit execution, verifies then reconciles via the engine layer.
|
|
91
|
+
//
|
|
92
|
+
// GSD_ENGINE_BYPASS=1 skips the engine layer entirely — falls through
|
|
93
|
+
// to the dev path below.
|
|
94
|
+
if (s.activeEngineId != null && s.activeEngineId !== "dev" && !sidecarItem && process.env.GSD_ENGINE_BYPASS !== "1") {
|
|
95
|
+
debugLog("autoLoop", { phase: "custom-engine-derive", iteration, engineId: s.activeEngineId });
|
|
96
|
+
const { engine, policy } = resolveEngine({
|
|
97
|
+
activeEngineId: s.activeEngineId,
|
|
98
|
+
activeRunDir: s.activeRunDir,
|
|
99
|
+
});
|
|
100
|
+
const engineState = await engine.deriveState(s.basePath);
|
|
101
|
+
if (engineState.isComplete) {
|
|
102
|
+
await deps.stopAuto(ctx, pi, "Workflow complete");
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
debugLog("autoLoop", { phase: "custom-engine-dispatch", iteration });
|
|
106
|
+
const dispatch = await engine.resolveDispatch(engineState, { basePath: s.basePath });
|
|
107
|
+
if (dispatch.action === "stop") {
|
|
108
|
+
await deps.stopAuto(ctx, pi, dispatch.reason ?? "Engine stopped");
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
if (dispatch.action === "skip") {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
// dispatch.action === "dispatch"
|
|
115
|
+
const step = dispatch.step;
|
|
116
|
+
const gsdState = await deps.deriveState(s.basePath);
|
|
117
|
+
iterData = {
|
|
118
|
+
unitType: step.unitType,
|
|
119
|
+
unitId: step.unitId,
|
|
120
|
+
prompt: step.prompt,
|
|
121
|
+
finalPrompt: step.prompt,
|
|
122
|
+
pauseAfterUatDispatch: false,
|
|
123
|
+
observabilityIssues: [],
|
|
124
|
+
state: gsdState,
|
|
125
|
+
mid: s.currentMilestoneId ?? "workflow",
|
|
126
|
+
midTitle: "Workflow",
|
|
127
|
+
isRetry: false,
|
|
128
|
+
previousTier: undefined,
|
|
129
|
+
};
|
|
130
|
+
// ── Progress widget (mirrors dev path in runDispatch) ──
|
|
131
|
+
deps.updateProgressWidget(ctx, iterData.unitType, iterData.unitId, iterData.state);
|
|
132
|
+
// ── Guards (shared with dev path) ──
|
|
133
|
+
const guardsResult = await runGuards(ic, s.currentMilestoneId ?? "workflow");
|
|
134
|
+
if (guardsResult.action === "break")
|
|
135
|
+
break;
|
|
136
|
+
// ── Unit execution (shared with dev path) ──
|
|
137
|
+
const unitPhaseResult = await runUnitPhase(ic, iterData, loopState);
|
|
138
|
+
if (unitPhaseResult.action === "break")
|
|
139
|
+
break;
|
|
140
|
+
// ── Verify first, then reconcile (only mark complete on pass) ──
|
|
141
|
+
debugLog("autoLoop", { phase: "custom-engine-verify", iteration, unitId: iterData.unitId });
|
|
142
|
+
const verifyResult = await policy.verify(iterData.unitType, iterData.unitId, { basePath: s.basePath });
|
|
143
|
+
if (verifyResult === "pause") {
|
|
144
|
+
await deps.pauseAuto(ctx, pi);
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
if (verifyResult === "retry") {
|
|
148
|
+
debugLog("autoLoop", { phase: "custom-engine-verify-retry", iteration, unitId: iterData.unitId });
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
// Verification passed — mark step complete
|
|
152
|
+
debugLog("autoLoop", { phase: "custom-engine-reconcile", iteration, unitId: iterData.unitId });
|
|
153
|
+
await engine.reconcile(engineState, {
|
|
154
|
+
unitType: iterData.unitType,
|
|
155
|
+
unitId: iterData.unitId,
|
|
156
|
+
startedAt: s.currentUnit?.startedAt ?? Date.now(),
|
|
157
|
+
finishedAt: Date.now(),
|
|
158
|
+
});
|
|
159
|
+
deps.clearUnitTimeout();
|
|
160
|
+
consecutiveErrors = 0;
|
|
161
|
+
deps.emitJournalEvent({ ts: new Date().toISOString(), flowId, seq: nextSeq(), eventType: "iteration-end", data: { iteration } });
|
|
162
|
+
debugLog("autoLoop", { phase: "iteration-complete", iteration });
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
78
165
|
if (!sidecarItem) {
|
|
79
166
|
// ── Phase 1: Pre-dispatch ─────────────────────────────────────────
|
|
80
167
|
const preDispatchResult = await runPreDispatch(ic, loopState);
|
|
@@ -121,6 +208,7 @@ export async function autoLoop(ctx, pi, s, deps) {
|
|
|
121
208
|
if (finalizeResult.action === "continue")
|
|
122
209
|
continue;
|
|
123
210
|
consecutiveErrors = 0; // Iteration completed successfully
|
|
211
|
+
deps.emitJournalEvent({ ts: new Date().toISOString(), flowId, seq: nextSeq(), eventType: "iteration-end", data: { iteration } });
|
|
124
212
|
debugLog("autoLoop", { phase: "iteration-complete", iteration });
|
|
125
213
|
}
|
|
126
214
|
catch (loopErr) {
|