gsd-pi 2.29.0-dev.953d788 → 2.29.0-dev.f08b4fe
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 +24 -17
- package/dist/extension-registry.d.ts +63 -0
- package/dist/extension-registry.js +166 -0
- package/dist/headless.js +4 -0
- package/dist/loader.js +10 -1
- package/dist/resource-loader.js +11 -1
- package/dist/resources/extensions/async-jobs/extension-manifest.json +13 -0
- package/dist/resources/extensions/bg-shell/extension-manifest.json +14 -0
- package/dist/resources/extensions/bg-shell/process-manager.ts +13 -0
- package/dist/resources/extensions/browser-tools/extension-manifest.json +37 -0
- package/dist/resources/extensions/context7/extension-manifest.json +12 -0
- package/dist/resources/extensions/google-search/extension-manifest.json +12 -0
- package/dist/resources/extensions/gsd/auto-dashboard.ts +217 -65
- package/dist/resources/extensions/gsd/auto-dispatch.ts +32 -3
- package/dist/resources/extensions/gsd/auto-post-unit.ts +45 -13
- package/dist/resources/extensions/gsd/auto-prompts.ts +40 -17
- package/dist/resources/extensions/gsd/auto-recovery.ts +18 -23
- package/dist/resources/extensions/gsd/auto-start.ts +18 -32
- package/dist/resources/extensions/gsd/auto-worktree.ts +21 -182
- package/dist/resources/extensions/gsd/auto.ts +2 -24
- package/dist/resources/extensions/gsd/captures.ts +4 -10
- package/dist/resources/extensions/gsd/commands-extensions.ts +328 -0
- package/dist/resources/extensions/gsd/commands-handlers.ts +22 -2
- package/dist/resources/extensions/gsd/commands-logs.ts +13 -14
- package/dist/resources/extensions/gsd/commands-prefs-wizard.ts +44 -14
- package/dist/resources/extensions/gsd/commands-workflow-templates.ts +544 -0
- package/dist/resources/extensions/gsd/commands.ts +108 -24
- package/dist/resources/extensions/gsd/dashboard-overlay.ts +2 -1
- package/dist/resources/extensions/gsd/detection.ts +2 -1
- package/dist/resources/extensions/gsd/doctor-checks.ts +49 -1
- package/dist/resources/extensions/gsd/doctor-types.ts +3 -1
- package/dist/resources/extensions/gsd/extension-manifest.json +18 -0
- package/dist/resources/extensions/gsd/forensics.ts +2 -2
- package/dist/resources/extensions/gsd/git-service.ts +3 -2
- package/dist/resources/extensions/gsd/gitignore.ts +9 -63
- package/dist/resources/extensions/gsd/gsd-db.ts +1 -165
- package/dist/resources/extensions/gsd/guided-flow.ts +8 -5
- package/dist/resources/extensions/gsd/index.ts +3 -3
- package/dist/resources/extensions/gsd/json-persistence.ts +16 -1
- package/dist/resources/extensions/gsd/md-importer.ts +3 -2
- package/dist/resources/extensions/gsd/mechanical-completion.ts +430 -0
- package/dist/resources/extensions/gsd/migrate/command.ts +3 -2
- package/dist/resources/extensions/gsd/migrate/writer.ts +2 -1
- package/dist/resources/extensions/gsd/migrate-external.ts +123 -0
- package/dist/resources/extensions/gsd/paths.ts +24 -2
- package/dist/resources/extensions/gsd/post-unit-hooks.ts +6 -5
- package/dist/resources/extensions/gsd/preferences-models.ts +7 -1
- package/dist/resources/extensions/gsd/preferences-validation.ts +2 -1
- package/dist/resources/extensions/gsd/preferences.ts +10 -5
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +4 -2
- package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +26 -2
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +15 -1
- package/dist/resources/extensions/gsd/prompts/workflow-start.md +28 -0
- package/dist/resources/extensions/gsd/queue-order.ts +10 -11
- package/dist/resources/extensions/gsd/repo-identity.ts +148 -0
- package/dist/resources/extensions/gsd/resource-version.ts +99 -0
- package/dist/resources/extensions/gsd/session-forensics.ts +4 -3
- package/dist/resources/extensions/gsd/session-status-io.ts +23 -41
- package/dist/resources/extensions/gsd/tests/activity-log.test.ts +2 -2
- package/dist/resources/extensions/gsd/tests/auto-budget-alerts.test.ts +1 -1
- package/dist/resources/extensions/gsd/tests/auto-recovery.test.ts +3 -3
- package/dist/resources/extensions/gsd/tests/auto-skip-loop.test.ts +1 -1
- package/dist/resources/extensions/gsd/tests/auto-worktree.test.ts +0 -58
- package/dist/resources/extensions/gsd/tests/doctor-runtime.test.ts +3 -4
- package/dist/resources/extensions/gsd/tests/extension-selector-separator.test.ts +60 -38
- package/dist/resources/extensions/gsd/tests/feature-branch-lifecycle-integration.test.ts +5 -18
- package/dist/resources/extensions/gsd/tests/git-service.test.ts +10 -37
- package/dist/resources/extensions/gsd/tests/knowledge.test.ts +4 -4
- package/dist/resources/extensions/gsd/tests/mechanical-completion.test.ts +356 -0
- package/dist/resources/extensions/gsd/tests/parallel-workers-multi-milestone-e2e.test.ts +1 -1
- package/dist/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +1 -0
- package/dist/resources/extensions/gsd/tests/token-profile.test.ts +14 -16
- package/dist/resources/extensions/gsd/tests/workflow-templates.test.ts +173 -0
- package/dist/resources/extensions/gsd/triage-resolution.ts +2 -1
- package/dist/resources/extensions/gsd/types.ts +2 -0
- package/dist/resources/extensions/gsd/workflow-templates/bugfix.md +87 -0
- package/dist/resources/extensions/gsd/workflow-templates/dep-upgrade.md +74 -0
- package/dist/resources/extensions/gsd/workflow-templates/full-project.md +41 -0
- package/dist/resources/extensions/gsd/workflow-templates/hotfix.md +45 -0
- package/dist/resources/extensions/gsd/workflow-templates/refactor.md +83 -0
- package/dist/resources/extensions/gsd/workflow-templates/registry.json +85 -0
- package/dist/resources/extensions/gsd/workflow-templates/security-audit.md +73 -0
- package/dist/resources/extensions/gsd/workflow-templates/small-feature.md +81 -0
- package/dist/resources/extensions/gsd/workflow-templates/spike.md +69 -0
- package/dist/resources/extensions/gsd/workflow-templates.ts +241 -0
- package/dist/resources/extensions/gsd/worktree-command.ts +1 -11
- package/dist/resources/extensions/gsd/worktree-manager.ts +3 -2
- package/dist/resources/extensions/gsd/worktree.ts +42 -5
- package/dist/resources/extensions/mac-tools/extension-manifest.json +16 -0
- package/dist/resources/extensions/mcp-client/index.ts +459 -0
- package/dist/resources/extensions/mcporter/extension-manifest.json +12 -0
- package/dist/resources/extensions/remote-questions/discord-adapter.ts +8 -19
- package/dist/resources/extensions/remote-questions/extension-manifest.json +11 -0
- package/dist/resources/extensions/remote-questions/http-client.ts +76 -0
- package/dist/resources/extensions/remote-questions/slack-adapter.ts +11 -17
- package/dist/resources/extensions/remote-questions/telegram-adapter.ts +8 -19
- package/dist/resources/extensions/search-the-web/extension-manifest.json +13 -0
- package/dist/resources/extensions/slash-commands/extension-manifest.json +11 -0
- package/dist/resources/extensions/subagent/extension-manifest.json +13 -0
- package/dist/resources/extensions/ttsr/extension-manifest.json +11 -0
- package/dist/resources/extensions/universal-config/extension-manifest.json +13 -0
- package/dist/resources/extensions/voice/extension-manifest.json +12 -0
- package/dist/resources/skills/create-gsd-extension/SKILL.md +87 -0
- package/dist/resources/skills/create-gsd-extension/references/compaction-session-control.md +77 -0
- package/dist/resources/skills/create-gsd-extension/references/custom-commands.md +139 -0
- package/dist/resources/skills/create-gsd-extension/references/custom-rendering.md +108 -0
- package/dist/resources/skills/create-gsd-extension/references/custom-tools.md +183 -0
- package/dist/resources/skills/create-gsd-extension/references/custom-ui.md +490 -0
- package/dist/resources/skills/create-gsd-extension/references/events-reference.md +126 -0
- package/dist/resources/skills/create-gsd-extension/references/extension-lifecycle.md +64 -0
- package/dist/resources/skills/create-gsd-extension/references/extensionapi-reference.md +75 -0
- package/dist/resources/skills/create-gsd-extension/references/extensioncontext-reference.md +53 -0
- package/dist/resources/skills/create-gsd-extension/references/key-rules-gotchas.md +36 -0
- package/dist/resources/skills/create-gsd-extension/references/mode-behavior.md +32 -0
- package/dist/resources/skills/create-gsd-extension/references/model-provider-management.md +89 -0
- package/dist/resources/skills/create-gsd-extension/references/packaging-distribution.md +55 -0
- package/dist/resources/skills/create-gsd-extension/references/remote-execution-overrides.md +90 -0
- package/dist/resources/skills/create-gsd-extension/references/state-management.md +70 -0
- package/dist/resources/skills/create-gsd-extension/references/system-prompt-modification.md +52 -0
- package/dist/resources/skills/create-gsd-extension/templates/extension-skeleton.ts +51 -0
- package/dist/resources/skills/create-gsd-extension/templates/stateful-tool-skeleton.ts +143 -0
- package/dist/resources/skills/create-gsd-extension/workflows/add-capability.md +57 -0
- package/dist/resources/skills/create-gsd-extension/workflows/create-extension.md +156 -0
- package/dist/resources/skills/create-gsd-extension/workflows/debug-extension.md +74 -0
- package/dist/resources/skills/create-skill/SKILL.md +184 -0
- package/dist/resources/skills/create-skill/references/api-security.md +226 -0
- package/dist/resources/skills/create-skill/references/be-clear-and-direct.md +531 -0
- package/dist/resources/skills/create-skill/references/common-patterns.md +595 -0
- package/dist/resources/skills/create-skill/references/core-principles.md +437 -0
- package/dist/resources/skills/create-skill/references/executable-code.md +175 -0
- package/dist/resources/skills/create-skill/references/gsd-skill-ecosystem.md +68 -0
- package/dist/resources/skills/create-skill/references/iteration-and-testing.md +474 -0
- package/dist/resources/skills/create-skill/references/recommended-structure.md +168 -0
- package/dist/resources/skills/create-skill/references/skill-structure.md +372 -0
- package/dist/resources/skills/create-skill/references/use-xml-tags.md +466 -0
- package/dist/resources/skills/create-skill/references/using-scripts.md +113 -0
- package/dist/resources/skills/create-skill/references/using-templates.md +112 -0
- package/dist/resources/skills/create-skill/references/workflows-and-validation.md +510 -0
- package/dist/resources/skills/create-skill/templates/router-skill.md +73 -0
- package/dist/resources/skills/create-skill/templates/simple-skill.md +33 -0
- package/dist/resources/skills/create-skill/workflows/add-reference.md +96 -0
- package/dist/resources/skills/create-skill/workflows/add-script.md +93 -0
- package/dist/resources/skills/create-skill/workflows/add-template.md +74 -0
- package/dist/resources/skills/create-skill/workflows/add-workflow.md +120 -0
- package/dist/resources/skills/create-skill/workflows/audit-skill.md +148 -0
- package/dist/resources/skills/create-skill/workflows/create-new-skill.md +196 -0
- package/dist/resources/skills/create-skill/workflows/get-guidance.md +121 -0
- package/dist/resources/skills/create-skill/workflows/upgrade-to-router.md +161 -0
- package/dist/resources/skills/create-skill/workflows/verify-skill.md +204 -0
- package/dist/resources/skills/react-best-practices/SKILL.md +1 -1
- package/package.json +1 -1
- package/packages/native/dist/native.d.ts +2 -0
- package/packages/native/dist/native.js +19 -5
- package/packages/native/src/native.ts +23 -9
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +13 -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 +3 -0
- package/packages/pi-coding-agent/dist/core/lsp/client.js.map +1 -1
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +13 -0
- package/packages/pi-coding-agent/src/core/lsp/client.ts +3 -0
- package/src/resources/extensions/async-jobs/extension-manifest.json +13 -0
- package/src/resources/extensions/bg-shell/extension-manifest.json +14 -0
- package/src/resources/extensions/bg-shell/process-manager.ts +13 -0
- package/src/resources/extensions/browser-tools/extension-manifest.json +37 -0
- package/src/resources/extensions/context7/extension-manifest.json +12 -0
- package/src/resources/extensions/google-search/extension-manifest.json +12 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +217 -65
- package/src/resources/extensions/gsd/auto-dispatch.ts +32 -3
- package/src/resources/extensions/gsd/auto-post-unit.ts +45 -13
- package/src/resources/extensions/gsd/auto-prompts.ts +40 -17
- package/src/resources/extensions/gsd/auto-recovery.ts +18 -23
- package/src/resources/extensions/gsd/auto-start.ts +18 -32
- package/src/resources/extensions/gsd/auto-worktree.ts +21 -182
- package/src/resources/extensions/gsd/auto.ts +2 -24
- package/src/resources/extensions/gsd/captures.ts +4 -10
- package/src/resources/extensions/gsd/commands-extensions.ts +328 -0
- package/src/resources/extensions/gsd/commands-handlers.ts +22 -2
- package/src/resources/extensions/gsd/commands-logs.ts +13 -14
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +44 -14
- package/src/resources/extensions/gsd/commands-workflow-templates.ts +544 -0
- package/src/resources/extensions/gsd/commands.ts +108 -24
- package/src/resources/extensions/gsd/dashboard-overlay.ts +2 -1
- package/src/resources/extensions/gsd/detection.ts +2 -1
- package/src/resources/extensions/gsd/doctor-checks.ts +49 -1
- package/src/resources/extensions/gsd/doctor-types.ts +3 -1
- package/src/resources/extensions/gsd/extension-manifest.json +18 -0
- package/src/resources/extensions/gsd/forensics.ts +2 -2
- package/src/resources/extensions/gsd/git-service.ts +3 -2
- package/src/resources/extensions/gsd/gitignore.ts +9 -63
- package/src/resources/extensions/gsd/gsd-db.ts +1 -165
- package/src/resources/extensions/gsd/guided-flow.ts +8 -5
- package/src/resources/extensions/gsd/index.ts +3 -3
- package/src/resources/extensions/gsd/json-persistence.ts +16 -1
- package/src/resources/extensions/gsd/md-importer.ts +3 -2
- package/src/resources/extensions/gsd/mechanical-completion.ts +430 -0
- package/src/resources/extensions/gsd/migrate/command.ts +3 -2
- package/src/resources/extensions/gsd/migrate/writer.ts +2 -1
- package/src/resources/extensions/gsd/migrate-external.ts +123 -0
- package/src/resources/extensions/gsd/paths.ts +24 -2
- package/src/resources/extensions/gsd/post-unit-hooks.ts +6 -5
- package/src/resources/extensions/gsd/preferences-models.ts +7 -1
- package/src/resources/extensions/gsd/preferences-validation.ts +2 -1
- package/src/resources/extensions/gsd/preferences.ts +10 -5
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +4 -2
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +26 -2
- package/src/resources/extensions/gsd/prompts/plan-slice.md +15 -1
- package/src/resources/extensions/gsd/prompts/workflow-start.md +28 -0
- package/src/resources/extensions/gsd/queue-order.ts +10 -11
- package/src/resources/extensions/gsd/repo-identity.ts +148 -0
- package/src/resources/extensions/gsd/resource-version.ts +99 -0
- package/src/resources/extensions/gsd/session-forensics.ts +4 -3
- package/src/resources/extensions/gsd/session-status-io.ts +23 -41
- package/src/resources/extensions/gsd/tests/activity-log.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/auto-budget-alerts.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/auto-skip-loop.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-worktree.test.ts +0 -58
- package/src/resources/extensions/gsd/tests/doctor-runtime.test.ts +3 -4
- package/src/resources/extensions/gsd/tests/extension-selector-separator.test.ts +60 -38
- package/src/resources/extensions/gsd/tests/feature-branch-lifecycle-integration.test.ts +5 -18
- package/src/resources/extensions/gsd/tests/git-service.test.ts +10 -37
- package/src/resources/extensions/gsd/tests/knowledge.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/mechanical-completion.test.ts +356 -0
- package/src/resources/extensions/gsd/tests/parallel-workers-multi-milestone-e2e.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +14 -16
- package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +173 -0
- package/src/resources/extensions/gsd/triage-resolution.ts +2 -1
- package/src/resources/extensions/gsd/types.ts +2 -0
- package/src/resources/extensions/gsd/workflow-templates/bugfix.md +87 -0
- package/src/resources/extensions/gsd/workflow-templates/dep-upgrade.md +74 -0
- package/src/resources/extensions/gsd/workflow-templates/full-project.md +41 -0
- package/src/resources/extensions/gsd/workflow-templates/hotfix.md +45 -0
- package/src/resources/extensions/gsd/workflow-templates/refactor.md +83 -0
- package/src/resources/extensions/gsd/workflow-templates/registry.json +85 -0
- package/src/resources/extensions/gsd/workflow-templates/security-audit.md +73 -0
- package/src/resources/extensions/gsd/workflow-templates/small-feature.md +81 -0
- package/src/resources/extensions/gsd/workflow-templates/spike.md +69 -0
- package/src/resources/extensions/gsd/workflow-templates.ts +241 -0
- package/src/resources/extensions/gsd/worktree-command.ts +1 -11
- package/src/resources/extensions/gsd/worktree-manager.ts +3 -2
- package/src/resources/extensions/gsd/worktree.ts +42 -5
- package/src/resources/extensions/mac-tools/extension-manifest.json +16 -0
- package/src/resources/extensions/mcp-client/index.ts +459 -0
- package/src/resources/extensions/mcporter/extension-manifest.json +12 -0
- package/src/resources/extensions/remote-questions/discord-adapter.ts +8 -19
- package/src/resources/extensions/remote-questions/extension-manifest.json +11 -0
- package/src/resources/extensions/remote-questions/http-client.ts +76 -0
- package/src/resources/extensions/remote-questions/slack-adapter.ts +11 -17
- package/src/resources/extensions/remote-questions/telegram-adapter.ts +8 -19
- package/src/resources/extensions/search-the-web/extension-manifest.json +13 -0
- package/src/resources/extensions/slash-commands/extension-manifest.json +11 -0
- package/src/resources/extensions/subagent/extension-manifest.json +13 -0
- package/src/resources/extensions/ttsr/extension-manifest.json +11 -0
- package/src/resources/extensions/universal-config/extension-manifest.json +13 -0
- package/src/resources/extensions/voice/extension-manifest.json +12 -0
- package/src/resources/skills/create-gsd-extension/SKILL.md +87 -0
- package/src/resources/skills/create-gsd-extension/references/compaction-session-control.md +77 -0
- package/src/resources/skills/create-gsd-extension/references/custom-commands.md +139 -0
- package/src/resources/skills/create-gsd-extension/references/custom-rendering.md +108 -0
- package/src/resources/skills/create-gsd-extension/references/custom-tools.md +183 -0
- package/src/resources/skills/create-gsd-extension/references/custom-ui.md +490 -0
- package/src/resources/skills/create-gsd-extension/references/events-reference.md +126 -0
- package/src/resources/skills/create-gsd-extension/references/extension-lifecycle.md +64 -0
- package/src/resources/skills/create-gsd-extension/references/extensionapi-reference.md +75 -0
- package/src/resources/skills/create-gsd-extension/references/extensioncontext-reference.md +53 -0
- package/src/resources/skills/create-gsd-extension/references/key-rules-gotchas.md +36 -0
- package/src/resources/skills/create-gsd-extension/references/mode-behavior.md +32 -0
- package/src/resources/skills/create-gsd-extension/references/model-provider-management.md +89 -0
- package/src/resources/skills/create-gsd-extension/references/packaging-distribution.md +55 -0
- package/src/resources/skills/create-gsd-extension/references/remote-execution-overrides.md +90 -0
- package/src/resources/skills/create-gsd-extension/references/state-management.md +70 -0
- package/src/resources/skills/create-gsd-extension/references/system-prompt-modification.md +52 -0
- package/src/resources/skills/create-gsd-extension/templates/extension-skeleton.ts +51 -0
- package/src/resources/skills/create-gsd-extension/templates/stateful-tool-skeleton.ts +143 -0
- package/src/resources/skills/create-gsd-extension/workflows/add-capability.md +57 -0
- package/src/resources/skills/create-gsd-extension/workflows/create-extension.md +156 -0
- package/src/resources/skills/create-gsd-extension/workflows/debug-extension.md +74 -0
- package/src/resources/skills/create-skill/SKILL.md +184 -0
- package/src/resources/skills/create-skill/references/api-security.md +226 -0
- package/src/resources/skills/create-skill/references/be-clear-and-direct.md +531 -0
- package/src/resources/skills/create-skill/references/common-patterns.md +595 -0
- package/src/resources/skills/create-skill/references/core-principles.md +437 -0
- package/src/resources/skills/create-skill/references/executable-code.md +175 -0
- package/src/resources/skills/create-skill/references/gsd-skill-ecosystem.md +68 -0
- package/src/resources/skills/create-skill/references/iteration-and-testing.md +474 -0
- package/src/resources/skills/create-skill/references/recommended-structure.md +168 -0
- package/src/resources/skills/create-skill/references/skill-structure.md +372 -0
- package/src/resources/skills/create-skill/references/use-xml-tags.md +466 -0
- package/src/resources/skills/create-skill/references/using-scripts.md +113 -0
- package/src/resources/skills/create-skill/references/using-templates.md +112 -0
- package/src/resources/skills/create-skill/references/workflows-and-validation.md +510 -0
- package/src/resources/skills/create-skill/templates/router-skill.md +73 -0
- package/src/resources/skills/create-skill/templates/simple-skill.md +33 -0
- package/src/resources/skills/create-skill/workflows/add-reference.md +96 -0
- package/src/resources/skills/create-skill/workflows/add-script.md +93 -0
- package/src/resources/skills/create-skill/workflows/add-template.md +74 -0
- package/src/resources/skills/create-skill/workflows/add-workflow.md +120 -0
- package/src/resources/skills/create-skill/workflows/audit-skill.md +148 -0
- package/src/resources/skills/create-skill/workflows/create-new-skill.md +196 -0
- package/src/resources/skills/create-skill/workflows/get-guidance.md +121 -0
- package/src/resources/skills/create-skill/workflows/upgrade-to-router.md +161 -0
- package/src/resources/skills/create-skill/workflows/verify-skill.md +204 -0
- package/src/resources/skills/react-best-practices/SKILL.md +1 -1
- package/dist/resources/extensions/gsd/auto-worktree-sync.ts +0 -198
- package/dist/resources/extensions/gsd/tests/worktree-db-integration.test.ts +0 -205
- package/dist/resources/extensions/gsd/tests/worktree-db.test.ts +0 -442
- package/dist/resources/extensions/mcporter/index.ts +0 -525
- package/src/resources/extensions/gsd/auto-worktree-sync.ts +0 -198
- package/src/resources/extensions/gsd/tests/worktree-db-integration.test.ts +0 -205
- package/src/resources/extensions/gsd/tests/worktree-db.test.ts +0 -442
- package/src/resources/extensions/mcporter/index.ts +0 -525
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "google-search",
|
|
3
|
+
"name": "Google Search",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Web search via Google with AI-synthesized answers and source citations",
|
|
6
|
+
"tier": "bundled",
|
|
7
|
+
"requires": { "platform": ">=2.29.0" },
|
|
8
|
+
"provides": {
|
|
9
|
+
"tools": ["google_search"],
|
|
10
|
+
"hooks": ["session_start"]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -11,6 +11,7 @@ import type { GSDState } from "./types.js";
|
|
|
11
11
|
import { getCurrentBranch } from "./worktree.js";
|
|
12
12
|
import { getActiveHook } from "./post-unit-hooks.js";
|
|
13
13
|
import { getLedger, getProjectTotals, formatCost, formatTokenCount, formatTierSavings } from "./metrics.js";
|
|
14
|
+
import { getHealthTrend, getConsecutiveErrorUnits } from "./doctor-proactive.js";
|
|
14
15
|
import {
|
|
15
16
|
resolveMilestoneFile,
|
|
16
17
|
resolveSliceFile,
|
|
@@ -204,6 +205,13 @@ export function estimateTimeRemaining(): string | null {
|
|
|
204
205
|
|
|
205
206
|
// ─── Slice Progress Cache ─────────────────────────────────────────────────────
|
|
206
207
|
|
|
208
|
+
/** Cached task detail for the widget task checklist */
|
|
209
|
+
interface CachedTaskDetail {
|
|
210
|
+
id: string;
|
|
211
|
+
title: string;
|
|
212
|
+
done: boolean;
|
|
213
|
+
}
|
|
214
|
+
|
|
207
215
|
/** Cached slice progress for the widget — avoid async in render */
|
|
208
216
|
let cachedSliceProgress: {
|
|
209
217
|
done: number;
|
|
@@ -211,6 +219,8 @@ let cachedSliceProgress: {
|
|
|
211
219
|
milestoneId: string;
|
|
212
220
|
/** Real task progress for the active slice, if its plan file exists */
|
|
213
221
|
activeSliceTasks: { done: number; total: number } | null;
|
|
222
|
+
/** Full task list for the active slice checklist */
|
|
223
|
+
taskDetails: CachedTaskDetail[] | null;
|
|
214
224
|
} | null = null;
|
|
215
225
|
|
|
216
226
|
export function updateSliceProgressCache(base: string, mid: string, activeSid?: string): void {
|
|
@@ -221,6 +231,7 @@ export function updateSliceProgressCache(base: string, mid: string, activeSid?:
|
|
|
221
231
|
const roadmap = parseRoadmap(content);
|
|
222
232
|
|
|
223
233
|
let activeSliceTasks: { done: number; total: number } | null = null;
|
|
234
|
+
let taskDetails: CachedTaskDetail[] | null = null;
|
|
224
235
|
if (activeSid) {
|
|
225
236
|
try {
|
|
226
237
|
const planFile = resolveSliceFile(base, mid, activeSid, "PLAN");
|
|
@@ -231,6 +242,7 @@ export function updateSliceProgressCache(base: string, mid: string, activeSid?:
|
|
|
231
242
|
done: plan.tasks.filter(t => t.done).length,
|
|
232
243
|
total: plan.tasks.length,
|
|
233
244
|
};
|
|
245
|
+
taskDetails = plan.tasks.map(t => ({ id: t.id, title: t.title, done: t.done }));
|
|
234
246
|
}
|
|
235
247
|
} catch {
|
|
236
248
|
// Non-fatal — just omit task count
|
|
@@ -242,13 +254,19 @@ export function updateSliceProgressCache(base: string, mid: string, activeSid?:
|
|
|
242
254
|
total: roadmap.slices.length,
|
|
243
255
|
milestoneId: mid,
|
|
244
256
|
activeSliceTasks,
|
|
257
|
+
taskDetails,
|
|
245
258
|
};
|
|
246
259
|
} catch {
|
|
247
260
|
// Non-fatal — widget just won't show progress bar
|
|
248
261
|
}
|
|
249
262
|
}
|
|
250
263
|
|
|
251
|
-
export function getRoadmapSlicesSync(): {
|
|
264
|
+
export function getRoadmapSlicesSync(): {
|
|
265
|
+
done: number;
|
|
266
|
+
total: number;
|
|
267
|
+
activeSliceTasks: { done: number; total: number } | null;
|
|
268
|
+
taskDetails: CachedTaskDetail[] | null;
|
|
269
|
+
} | null {
|
|
252
270
|
return cachedSliceProgress;
|
|
253
271
|
}
|
|
254
272
|
|
|
@@ -349,87 +367,84 @@ export function updateProgressWidget(
|
|
|
349
367
|
const lines: string[] = [];
|
|
350
368
|
const pad = INDENT.base;
|
|
351
369
|
|
|
352
|
-
// ──
|
|
370
|
+
// ── Top bar ─────────────────────────────────────────────────────
|
|
353
371
|
lines.push(...ui.bar());
|
|
354
372
|
|
|
373
|
+
// ── Header: GSD AUTO ... elapsed ────────────────────────────────
|
|
355
374
|
const dot = pulseBright
|
|
356
375
|
? theme.fg("accent", GLYPH.statusActive)
|
|
357
376
|
: theme.fg("dim", GLYPH.statusPending);
|
|
358
377
|
const elapsed = formatAutoElapsed(accessors.getAutoStartTime());
|
|
359
378
|
const modeTag = accessors.isStepMode() ? "NEXT" : "AUTO";
|
|
360
|
-
const headerLeft = `${pad}${dot} ${theme.fg("accent", theme.bold("GSD"))}
|
|
379
|
+
const headerLeft = `${pad}${dot} ${theme.fg("accent", theme.bold("GSD"))} ${theme.fg("success", modeTag)}`;
|
|
361
380
|
const headerRight = elapsed ? theme.fg("dim", elapsed) : "";
|
|
362
381
|
lines.push(rightAlign(headerLeft, headerRight, width));
|
|
363
382
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
if (mid)
|
|
367
|
-
lines.push(truncateToWidth(`${pad}${theme.fg("dim", mid.title)}`, width));
|
|
368
|
-
}
|
|
369
|
-
|
|
383
|
+
// ── Context: project · slice · action (merged into one line) ────
|
|
384
|
+
const contextParts: string[] = [];
|
|
385
|
+
if (mid) contextParts.push(theme.fg("dim", mid.title));
|
|
370
386
|
if (slice && unitType !== "research-milestone" && unitType !== "plan-milestone") {
|
|
371
|
-
|
|
372
|
-
`${pad}${theme.fg("text", theme.bold(`${slice.id}: ${slice.title}`))}`,
|
|
373
|
-
width,
|
|
374
|
-
));
|
|
387
|
+
contextParts.push(theme.fg("text", theme.bold(`${slice.id}: ${slice.title}`)));
|
|
375
388
|
}
|
|
376
|
-
|
|
377
|
-
lines.push("");
|
|
378
|
-
|
|
379
389
|
const isHook = unitType.startsWith("hook/");
|
|
380
390
|
const target = isHook
|
|
381
391
|
? (unitId.split("/").pop() ?? unitId)
|
|
382
392
|
: (task ? `${task.id}: ${task.title}` : unitId);
|
|
383
|
-
|
|
393
|
+
contextParts.push(`${theme.fg("accent", "▸")} ${theme.fg("accent", verb)} ${theme.fg("text", target)}`);
|
|
394
|
+
|
|
384
395
|
const tierTag = tierBadge ? theme.fg("dim", `[${tierBadge}] `) : "";
|
|
385
396
|
const phaseBadge = `${tierTag}${theme.fg("dim", phaseLabel)}`;
|
|
386
|
-
|
|
387
|
-
lines.push(
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
397
|
+
const contextLine = contextParts.join(theme.fg("dim", " · "));
|
|
398
|
+
lines.push(rightAlign(`${pad}${contextLine}`, phaseBadge, width));
|
|
399
|
+
|
|
400
|
+
// ── Two-column body ─────────────────────────────────────────────
|
|
401
|
+
// Left: progress, ETA, next, stats (fixed) | Right: task checklist (fixed, adjacent)
|
|
402
|
+
// Both columns sit left-to-center; empty space is on the right.
|
|
403
|
+
const divider = theme.fg("dim", "│");
|
|
404
|
+
const minTwoColWidth = 100;
|
|
405
|
+
const rightColFixed = 44;
|
|
406
|
+
const colGap = 5; // breathing room between columns
|
|
407
|
+
// Left column takes remaining space — no truncation on wide terminals
|
|
408
|
+
const useTwoCol = width >= minTwoColWidth;
|
|
409
|
+
const rightColWidth = useTwoCol ? rightColFixed : 0;
|
|
410
|
+
const leftColWidth = useTwoCol ? width - rightColWidth - colGap : width;
|
|
411
|
+
|
|
412
|
+
const roadmapSlices = mid ? getRoadmapSlicesSync() : null;
|
|
413
|
+
|
|
414
|
+
// Build left column: progress bar, ETA, next step, token stats
|
|
415
|
+
const leftLines: string[] = [];
|
|
416
|
+
|
|
417
|
+
if (roadmapSlices) {
|
|
418
|
+
const { done, total, activeSliceTasks } = roadmapSlices;
|
|
419
|
+
const barWidth = Math.max(6, Math.min(18, Math.floor(leftColWidth * 0.4)));
|
|
420
|
+
const pct = total > 0 ? done / total : 0;
|
|
421
|
+
const filled = Math.round(pct * barWidth);
|
|
422
|
+
const bar = theme.fg("success", "█".repeat(filled))
|
|
423
|
+
+ theme.fg("dim", "░".repeat(barWidth - filled));
|
|
424
|
+
|
|
425
|
+
let meta = theme.fg("dim", `${done}/${total} slices`);
|
|
426
|
+
if (activeSliceTasks && activeSliceTasks.total > 0) {
|
|
427
|
+
const taskNum = isHook
|
|
428
|
+
? Math.max(activeSliceTasks.done, 1)
|
|
429
|
+
: Math.min(activeSliceTasks.done + 1, activeSliceTasks.total);
|
|
430
|
+
meta += theme.fg("dim", ` · task ${taskNum}/${activeSliceTasks.total}`);
|
|
431
|
+
}
|
|
432
|
+
leftLines.push(truncateToWidth(`${pad}${bar} ${meta}`, leftColWidth));
|
|
414
433
|
|
|
415
|
-
|
|
434
|
+
const eta = estimateTimeRemaining();
|
|
435
|
+
if (eta) {
|
|
436
|
+
leftLines.push(truncateToWidth(`${pad}${theme.fg("dim", eta)}`, leftColWidth));
|
|
416
437
|
}
|
|
417
438
|
}
|
|
418
439
|
|
|
419
|
-
lines.push("");
|
|
420
|
-
|
|
421
440
|
if (next) {
|
|
422
|
-
|
|
441
|
+
leftLines.push(truncateToWidth(
|
|
423
442
|
`${pad}${theme.fg("dim", "→")} ${theme.fg("dim", `then ${next}`)}`,
|
|
424
|
-
|
|
443
|
+
leftColWidth,
|
|
425
444
|
));
|
|
426
445
|
}
|
|
427
446
|
|
|
428
|
-
//
|
|
429
|
-
lines.push("");
|
|
430
|
-
lines.push(truncateToWidth(theme.fg("dim", `${pad}${widgetPwd}`), width, theme.fg("dim", "…")));
|
|
431
|
-
|
|
432
|
-
// Token stats from current unit session + cumulative cost from metrics
|
|
447
|
+
// Token stats
|
|
433
448
|
{
|
|
434
449
|
const cmdCtx = accessors.getCmdCtx();
|
|
435
450
|
let totalInput = 0, totalOutput = 0;
|
|
@@ -464,7 +479,6 @@ export function updateProgressWidget(
|
|
|
464
479
|
if (totalOutput) sp.push(`↓${formatWidgetTokens(totalOutput)}`);
|
|
465
480
|
if (totalCacheRead) sp.push(`R${formatWidgetTokens(totalCacheRead)}`);
|
|
466
481
|
if (totalCacheWrite) sp.push(`W${formatWidgetTokens(totalCacheWrite)}`);
|
|
467
|
-
// Cache hit rate for current unit
|
|
468
482
|
if (totalCacheRead + totalInput > 0) {
|
|
469
483
|
const hitRate = Math.round((totalCacheRead / (totalCacheRead + totalInput)) * 100);
|
|
470
484
|
sp.push(`\u26A1${hitRate}%`);
|
|
@@ -483,33 +497,134 @@ export function updateProgressWidget(
|
|
|
483
497
|
sp.push(cxDisplay);
|
|
484
498
|
}
|
|
485
499
|
|
|
486
|
-
const
|
|
500
|
+
const tokenLine = sp.map(p => p.includes("\x1b[") ? p : theme.fg("dim", p))
|
|
487
501
|
.join(theme.fg("dim", " "));
|
|
502
|
+
leftLines.push(truncateToWidth(`${pad}${tokenLine}`, leftColWidth));
|
|
488
503
|
|
|
489
504
|
const modelId = cmdCtx?.model?.id ?? "";
|
|
490
505
|
const modelProvider = cmdCtx?.model?.provider ?? "";
|
|
491
|
-
const modelPhase = phaseLabel ? theme.fg("dim", `[${phaseLabel}] `) : "";
|
|
492
506
|
const modelDisplay = modelProvider && modelId
|
|
493
507
|
? `${modelProvider}/${modelId}`
|
|
494
508
|
: modelId;
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
lines.push(rightAlign(`${pad}${sLeft}`, sRight, width));
|
|
509
|
+
if (modelDisplay) {
|
|
510
|
+
leftLines.push(truncateToWidth(`${pad}${theme.fg("dim", modelDisplay)}`, leftColWidth));
|
|
511
|
+
}
|
|
499
512
|
|
|
500
|
-
// Dynamic routing savings
|
|
513
|
+
// Dynamic routing savings
|
|
501
514
|
if (mLedger && mLedger.units.some(u => u.tier)) {
|
|
502
515
|
const savings = formatTierSavings(mLedger.units);
|
|
503
516
|
if (savings) {
|
|
504
|
-
|
|
517
|
+
leftLines.push(truncateToWidth(`${pad}${theme.fg("dim", savings)}`, leftColWidth));
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// Build right column: task checklist (pegged to right edge)
|
|
523
|
+
const rightLines: string[] = [];
|
|
524
|
+
const taskDetails = roadmapSlices?.taskDetails ?? null;
|
|
525
|
+
const maxVisibleTasks = 8;
|
|
526
|
+
const rpad = " ";
|
|
527
|
+
|
|
528
|
+
if (useTwoCol) {
|
|
529
|
+
if (taskDetails && taskDetails.length > 0) {
|
|
530
|
+
const visibleTasks = taskDetails.slice(0, maxVisibleTasks);
|
|
531
|
+
for (const t of visibleTasks) {
|
|
532
|
+
const isCurrent = task && t.id === task.id;
|
|
533
|
+
const glyph = t.done
|
|
534
|
+
? theme.fg("success", GLYPH.statusDone)
|
|
535
|
+
: isCurrent
|
|
536
|
+
? theme.fg("accent", "▸")
|
|
537
|
+
: theme.fg("dim", " ");
|
|
538
|
+
const label = isCurrent
|
|
539
|
+
? theme.fg("text", `${t.id}: ${t.title}`)
|
|
540
|
+
: t.done
|
|
541
|
+
? theme.fg("dim", `${t.id}: ${t.title}`)
|
|
542
|
+
: theme.fg("text", `${t.id}: ${t.title}`);
|
|
543
|
+
rightLines.push(truncateToWidth(`${rpad}${glyph} ${label}`, rightColWidth));
|
|
544
|
+
}
|
|
545
|
+
if (taskDetails.length > maxVisibleTasks) {
|
|
546
|
+
rightLines.push(truncateToWidth(
|
|
547
|
+
`${rpad}${theme.fg("dim", ` …+${taskDetails.length - maxVisibleTasks} more`)}`,
|
|
548
|
+
rightColWidth,
|
|
549
|
+
));
|
|
550
|
+
}
|
|
551
|
+
} else if (roadmapSlices?.activeSliceTasks) {
|
|
552
|
+
const { done: tDone, total: tTotal } = roadmapSlices.activeSliceTasks;
|
|
553
|
+
rightLines.push(`${rpad}${theme.fg("dim", `${tDone}/${tTotal} tasks`)}`);
|
|
554
|
+
}
|
|
555
|
+
} else {
|
|
556
|
+
// Narrow single-column: task list goes into left column
|
|
557
|
+
if (taskDetails && taskDetails.length > 0) {
|
|
558
|
+
for (const t of taskDetails.slice(0, maxVisibleTasks)) {
|
|
559
|
+
const isCurrent = task && t.id === task.id;
|
|
560
|
+
const glyph = t.done
|
|
561
|
+
? theme.fg("success", GLYPH.statusDone)
|
|
562
|
+
: isCurrent
|
|
563
|
+
? theme.fg("accent", "▸")
|
|
564
|
+
: theme.fg("dim", " ");
|
|
565
|
+
const label = isCurrent
|
|
566
|
+
? theme.fg("text", `${t.id}: ${t.title}`)
|
|
567
|
+
: t.done
|
|
568
|
+
? theme.fg("dim", `${t.id}: ${t.title}`)
|
|
569
|
+
: theme.fg("text", `${t.id}: ${t.title}`);
|
|
570
|
+
leftLines.push(truncateToWidth(`${pad}${glyph} ${label}`, leftColWidth));
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
// Add progress bar inline
|
|
574
|
+
if (roadmapSlices) {
|
|
575
|
+
const { done, total, activeSliceTasks } = roadmapSlices;
|
|
576
|
+
const barWidth = Math.max(6, Math.min(18, Math.floor(leftColWidth * 0.4)));
|
|
577
|
+
const pct = total > 0 ? done / total : 0;
|
|
578
|
+
const filled = Math.round(pct * barWidth);
|
|
579
|
+
const bar = theme.fg("success", "█".repeat(filled))
|
|
580
|
+
+ theme.fg("dim", "░".repeat(barWidth - filled));
|
|
581
|
+
let meta = theme.fg("dim", `${done}/${total} slices`);
|
|
582
|
+
if (activeSliceTasks && activeSliceTasks.total > 0) {
|
|
583
|
+
const taskNum = isHook
|
|
584
|
+
? Math.max(activeSliceTasks.done, 1)
|
|
585
|
+
: Math.min(activeSliceTasks.done + 1, activeSliceTasks.total);
|
|
586
|
+
meta += theme.fg("dim", ` · task ${taskNum}/${activeSliceTasks.total}`);
|
|
587
|
+
}
|
|
588
|
+
const eta = estimateTimeRemaining();
|
|
589
|
+
if (eta) meta += theme.fg("dim", ` · ${eta}`);
|
|
590
|
+
leftLines.push(truncateToWidth(`${pad}${bar} ${meta}`, leftColWidth));
|
|
591
|
+
}
|
|
592
|
+
if (next) {
|
|
593
|
+
leftLines.push(truncateToWidth(
|
|
594
|
+
`${pad}${theme.fg("dim", "→")} ${theme.fg("dim", `then ${next}`)}`,
|
|
595
|
+
leftColWidth,
|
|
596
|
+
));
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
// Compose columns
|
|
601
|
+
if (useTwoCol) {
|
|
602
|
+
const maxRows = Math.max(leftLines.length, rightLines.length);
|
|
603
|
+
if (maxRows > 0) {
|
|
604
|
+
lines.push(""); // spacer before columns
|
|
605
|
+
for (let i = 0; i < maxRows; i++) {
|
|
606
|
+
const left = padToWidth(leftLines[i] ?? "", leftColWidth);
|
|
607
|
+
const gap = " ".repeat(colGap - 2); // colGap minus divider and its trailing space
|
|
608
|
+
const right = rightLines[i] ?? "";
|
|
609
|
+
lines.push(truncateToWidth(`${left}${gap}${divider} ${right}`, width));
|
|
505
610
|
}
|
|
506
611
|
}
|
|
612
|
+
} else {
|
|
613
|
+
// Narrow single-column: just stack
|
|
614
|
+
if (leftLines.length > 0) {
|
|
615
|
+
lines.push("");
|
|
616
|
+
for (const l of leftLines) lines.push(l);
|
|
617
|
+
}
|
|
507
618
|
}
|
|
508
619
|
|
|
620
|
+
// ── Footer: pwd + hints ─────────────────────────────────────────
|
|
621
|
+
lines.push("");
|
|
509
622
|
const hintParts: string[] = [];
|
|
510
623
|
hintParts.push("esc pause");
|
|
511
624
|
hintParts.push(process.platform === "darwin" ? "⌃⌥G dashboard" : "Ctrl+Alt+G dashboard");
|
|
512
|
-
|
|
625
|
+
const hintStr = theme.fg("dim", hintParts.join(" | "));
|
|
626
|
+
const pwdStr = theme.fg("dim", widgetPwd);
|
|
627
|
+
lines.push(rightAlign(`${pad}${pwdStr}`, hintStr, width));
|
|
513
628
|
|
|
514
629
|
lines.push(...ui.bar());
|
|
515
630
|
|
|
@@ -535,6 +650,31 @@ export function updateProgressWidget(
|
|
|
535
650
|
* Build a compact string-array representation of the progress widget.
|
|
536
651
|
* Used as a fallback when the factory-based widget cannot render (RPC mode).
|
|
537
652
|
*/
|
|
653
|
+
// ─── Model Health Indicator ───────────────────────────────────────────────────
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Compute a traffic-light health indicator from observable signals.
|
|
657
|
+
* 🟢 progressing well — no errors, trend stable/improving
|
|
658
|
+
* 🟡 struggling — some errors or degrading trend
|
|
659
|
+
* 🔴 stuck — consecutive errors, likely needs attention
|
|
660
|
+
*/
|
|
661
|
+
export function getModelHealthIndicator(): { emoji: string; label: string } {
|
|
662
|
+
const trend = getHealthTrend();
|
|
663
|
+
const consecutiveErrors = getConsecutiveErrorUnits();
|
|
664
|
+
|
|
665
|
+
if (consecutiveErrors >= 3) {
|
|
666
|
+
return { emoji: "🔴", label: "stuck" };
|
|
667
|
+
}
|
|
668
|
+
if (consecutiveErrors >= 1 || trend === "degrading") {
|
|
669
|
+
return { emoji: "🟡", label: "struggling" };
|
|
670
|
+
}
|
|
671
|
+
if (trend === "improving") {
|
|
672
|
+
return { emoji: "🟢", label: "progressing well" };
|
|
673
|
+
}
|
|
674
|
+
// stable or unknown
|
|
675
|
+
return { emoji: "🟢", label: "progressing" };
|
|
676
|
+
}
|
|
677
|
+
|
|
538
678
|
function buildProgressTextLines(
|
|
539
679
|
verb: string,
|
|
540
680
|
phaseLabel: string,
|
|
@@ -583,6 +723,11 @@ function buildProgressTextLines(
|
|
|
583
723
|
}
|
|
584
724
|
|
|
585
725
|
if (next) lines.push(` Next: ${next}`);
|
|
726
|
+
|
|
727
|
+
// Model health indicator
|
|
728
|
+
const health = getModelHealthIndicator();
|
|
729
|
+
lines.push(` Health: ${health.emoji} ${health.label}`);
|
|
730
|
+
|
|
586
731
|
lines.push(` ${widgetPwd}`);
|
|
587
732
|
|
|
588
733
|
return lines;
|
|
@@ -597,3 +742,10 @@ function rightAlign(left: string, right: string, width: number): string {
|
|
|
597
742
|
const gap = Math.max(1, width - leftVis - rightVis);
|
|
598
743
|
return truncateToWidth(left + " ".repeat(gap) + right, width);
|
|
599
744
|
}
|
|
745
|
+
|
|
746
|
+
/** Pad a string with trailing spaces to fill exactly `colWidth` (ANSI-aware). */
|
|
747
|
+
function padToWidth(s: string, colWidth: number): string {
|
|
748
|
+
const vis = visibleWidth(s);
|
|
749
|
+
if (vis >= colWidth) return truncateToWidth(s, colWidth);
|
|
750
|
+
return s + " ".repeat(colWidth - vis);
|
|
751
|
+
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import type { GSDState } from "./types.js";
|
|
13
13
|
import type { GSDPreferences } from "./preferences.js";
|
|
14
14
|
import type { UatType } from "./files.js";
|
|
15
|
-
import { loadFile, extractUatType, loadActiveOverrides } from "./files.js";
|
|
15
|
+
import { loadFile, extractUatType, loadActiveOverrides, parseRoadmap } from "./files.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveMilestoneFile, resolveMilestonePath, resolveSliceFile, resolveTaskFile,
|
|
18
18
|
relSliceFile, buildMilestoneFileName,
|
|
@@ -123,11 +123,40 @@ const DISPATCH_RULES: DispatchRule[] = [
|
|
|
123
123
|
};
|
|
124
124
|
},
|
|
125
125
|
},
|
|
126
|
+
{
|
|
127
|
+
name: "uat-verdict-gate (non-PASS blocks progression)",
|
|
128
|
+
match: async ({ mid, basePath, prefs }) => {
|
|
129
|
+
// Only applies when UAT dispatch is enabled
|
|
130
|
+
if (!prefs?.uat_dispatch) return null;
|
|
131
|
+
|
|
132
|
+
const roadmapFile = resolveMilestoneFile(basePath, mid, "ROADMAP");
|
|
133
|
+
const roadmapContent = roadmapFile ? await loadFile(roadmapFile) : null;
|
|
134
|
+
if (!roadmapContent) return null;
|
|
135
|
+
|
|
136
|
+
const roadmap = parseRoadmap(roadmapContent);
|
|
137
|
+
for (const slice of roadmap.slices.filter(s => s.done)) {
|
|
138
|
+
const resultFile = resolveSliceFile(basePath, mid, slice.id, "UAT-RESULT");
|
|
139
|
+
if (!resultFile) continue;
|
|
140
|
+
const content = await loadFile(resultFile);
|
|
141
|
+
if (!content) continue;
|
|
142
|
+
const verdictMatch = content.match(/verdict:\s*([\w-]+)/i);
|
|
143
|
+
const verdict = verdictMatch?.[1]?.toLowerCase();
|
|
144
|
+
if (verdict && verdict !== "pass" && verdict !== "passed") {
|
|
145
|
+
return {
|
|
146
|
+
action: "stop" as const,
|
|
147
|
+
reason: `UAT verdict for ${slice.id} is "${verdict}" — blocking progression until resolved.\nReview the UAT result and update the verdict to PASS, or re-run /gsd auto after fixing.`,
|
|
148
|
+
level: "warning" as const,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return null;
|
|
153
|
+
},
|
|
154
|
+
},
|
|
126
155
|
{
|
|
127
156
|
name: "reassess-roadmap (post-completion)",
|
|
128
157
|
match: async ({ state, mid, midTitle, basePath, prefs }) => {
|
|
129
|
-
//
|
|
130
|
-
if (prefs?.phases?.
|
|
158
|
+
// Reassess is opt-in: only fire when explicitly enabled
|
|
159
|
+
if (!prefs?.phases?.reassess_after_slice) return null;
|
|
131
160
|
const needsReassess = await checkNeedsReassessment(basePath, mid, state);
|
|
132
161
|
if (!needsReassess) return null;
|
|
133
162
|
return {
|
|
@@ -37,7 +37,6 @@ import { resolveAutoSupervisorConfig, loadEffectiveGSDPreferences } from "./pref
|
|
|
37
37
|
import { runGSDDoctor, rebuildState, summarizeDoctorIssues } from "./doctor.js";
|
|
38
38
|
import { COMPLETION_TRANSITION_CODES } from "./doctor-types.js";
|
|
39
39
|
import { recordHealthSnapshot, checkHealEscalation } from "./doctor-proactive.js";
|
|
40
|
-
import { syncStateToProjectRoot } from "./auto-worktree-sync.js";
|
|
41
40
|
import { resetRewriteCircuitBreaker } from "./auto-dispatch.js";
|
|
42
41
|
import { isDbAvailable } from "./gsd-db.js";
|
|
43
42
|
import { consumeSignal } from "./session-status-io.js";
|
|
@@ -176,7 +175,7 @@ export async function postUnitPreVerification(pctx: PostUnitContext): Promise<"d
|
|
|
176
175
|
);
|
|
177
176
|
try {
|
|
178
177
|
const { formatDoctorIssuesForPrompt, formatDoctorReport } = await import("./doctor.js");
|
|
179
|
-
const { dispatchDoctorHeal } = await import("./commands.js");
|
|
178
|
+
const { dispatchDoctorHeal } = await import("./commands-handlers.js");
|
|
180
179
|
const actionable = report.issues.filter(i => i.severity === "error");
|
|
181
180
|
const reportText = formatDoctorReport(report, { scope: doctorScope, includeWarnings: true });
|
|
182
181
|
const structuredIssues = formatDoctorIssuesForPrompt(actionable);
|
|
@@ -202,23 +201,17 @@ export async function postUnitPreVerification(pctx: PostUnitContext): Promise<"d
|
|
|
202
201
|
}
|
|
203
202
|
}
|
|
204
203
|
|
|
205
|
-
// Prune dead bg-shell processes
|
|
204
|
+
// Prune dead bg-shell processes and kill non-persistent live ones.
|
|
205
|
+
// Without killing live processes between units, dev servers spawned during
|
|
206
|
+
// one task keep ports bound, causing conflicts in subsequent tasks (#1209).
|
|
206
207
|
try {
|
|
207
|
-
const { pruneDeadProcesses } = await import("../bg-shell/process-manager.js");
|
|
208
|
+
const { pruneDeadProcesses, killSessionProcesses } = await import("../bg-shell/process-manager.js");
|
|
208
209
|
pruneDeadProcesses();
|
|
210
|
+
killSessionProcesses();
|
|
209
211
|
} catch {
|
|
210
212
|
// Non-fatal
|
|
211
213
|
}
|
|
212
214
|
|
|
213
|
-
// Sync worktree state back to project root
|
|
214
|
-
if (s.originalBasePath && s.originalBasePath !== s.basePath) {
|
|
215
|
-
try {
|
|
216
|
-
syncStateToProjectRoot(s.basePath, s.originalBasePath, s.currentMilestoneId);
|
|
217
|
-
} catch {
|
|
218
|
-
// Non-fatal
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
215
|
// Rewrite-docs completion
|
|
223
216
|
if (s.currentUnit.type === "rewrite-docs") {
|
|
224
217
|
try {
|
|
@@ -328,6 +321,45 @@ export async function postUnitPostVerification(pctx: PostUnitContext): Promise<"
|
|
|
328
321
|
}
|
|
329
322
|
}
|
|
330
323
|
|
|
324
|
+
// ── Mechanical completion (ADR-003) ──
|
|
325
|
+
// After task execution, attempt mechanical slice and milestone completion
|
|
326
|
+
// instead of dispatching LLM sessions for complete-slice / validate-milestone.
|
|
327
|
+
if (s.currentUnit?.type === "execute-task" && !s.stepMode) {
|
|
328
|
+
try {
|
|
329
|
+
const [mid, sid] = s.currentUnit.id.split("/");
|
|
330
|
+
if (mid && sid) {
|
|
331
|
+
const state = await deriveState(s.basePath);
|
|
332
|
+
if (state.phase === "summarizing" && state.activeSlice?.id === sid) {
|
|
333
|
+
const { mechanicalSliceCompletion } = await import("./mechanical-completion.js");
|
|
334
|
+
const ok = await mechanicalSliceCompletion(s.basePath, mid, sid);
|
|
335
|
+
if (ok) {
|
|
336
|
+
invalidateAllCaches();
|
|
337
|
+
autoCommitCurrentBranch(s.basePath, "mechanical-completion", `${mid}/${sid}`);
|
|
338
|
+
ctx.ui.notify(`Mechanical completion: ${sid} summary + roadmap updated.`, "info");
|
|
339
|
+
|
|
340
|
+
// Re-derive state — check if milestone is now ready for validation
|
|
341
|
+
invalidateAllCaches();
|
|
342
|
+
const postSliceState = await deriveState(s.basePath);
|
|
343
|
+
if (postSliceState.phase === "validating-milestone" || postSliceState.phase === "completing-milestone") {
|
|
344
|
+
const { aggregateMilestoneVerification, generateMilestoneSummary } = await import("./mechanical-completion.js");
|
|
345
|
+
const validation = await aggregateMilestoneVerification(s.basePath, mid);
|
|
346
|
+
if (validation.verdict !== "failed") {
|
|
347
|
+
await generateMilestoneSummary(s.basePath, mid);
|
|
348
|
+
invalidateAllCaches();
|
|
349
|
+
autoCommitCurrentBranch(s.basePath, "mechanical-milestone-completion", mid);
|
|
350
|
+
ctx.ui.notify(`Mechanical completion: ${mid} validation + summary written.`, "info");
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
// If !ok, summarizing phase persists → dispatch rule fires as LLM fallback
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
} catch (err) {
|
|
358
|
+
process.stderr.write(`gsd-mechanical: completion failed: ${(err as Error).message}\n`);
|
|
359
|
+
// Non-fatal — fall through to normal dispatch
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
331
363
|
// ── Post-unit hooks ──
|
|
332
364
|
if (s.currentUnit && !s.stepMode) {
|
|
333
365
|
const hookUnit = checkPostUnitHooks(s.currentUnit.type, s.currentUnit.id, s.basePath);
|