gsd-pi 2.33.0-dev.bafba33 → 2.33.1-dev.235d83a
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 +13 -18
- package/dist/cli.js +16 -0
- package/dist/resource-loader.d.ts +2 -0
- package/dist/resource-loader.js +36 -3
- package/dist/resources/extensions/ask-user-questions.js +217 -0
- package/dist/resources/extensions/async-jobs/async-bash-tool.js +180 -0
- package/dist/resources/extensions/async-jobs/await-tool.js +90 -0
- package/dist/resources/extensions/async-jobs/cancel-job-tool.js +28 -0
- package/dist/resources/extensions/async-jobs/index.js +119 -0
- package/dist/resources/extensions/async-jobs/job-manager.js +159 -0
- package/dist/resources/extensions/aws-auth/index.js +138 -0
- package/dist/resources/extensions/bg-shell/bg-shell-command.js +182 -0
- package/dist/resources/extensions/bg-shell/bg-shell-lifecycle.js +343 -0
- package/dist/resources/extensions/bg-shell/bg-shell-tool.js +831 -0
- package/dist/resources/extensions/bg-shell/index.js +41 -0
- package/dist/resources/extensions/bg-shell/interaction.js +160 -0
- package/dist/resources/extensions/bg-shell/output-formatter.js +245 -0
- package/dist/resources/extensions/bg-shell/overlay.js +378 -0
- package/dist/resources/extensions/bg-shell/process-manager.js +413 -0
- package/dist/resources/extensions/bg-shell/readiness-detector.js +109 -0
- package/dist/resources/extensions/bg-shell/types.js +96 -0
- package/dist/resources/extensions/bg-shell/utilities.js +50 -0
- package/dist/resources/extensions/browser-tools/capture.js +179 -0
- package/dist/resources/extensions/browser-tools/core.js +899 -0
- package/dist/resources/extensions/browser-tools/{evaluate-helpers.ts → evaluate-helpers.js} +0 -1
- package/dist/resources/extensions/browser-tools/index.js +123 -0
- package/dist/resources/extensions/browser-tools/lifecycle.js +222 -0
- package/dist/resources/extensions/browser-tools/refs.js +254 -0
- package/dist/resources/extensions/browser-tools/settle.js +173 -0
- package/dist/resources/extensions/browser-tools/state.js +126 -0
- package/dist/resources/extensions/browser-tools/tools/action-cache.js +179 -0
- package/dist/resources/extensions/browser-tools/tools/assertions.js +320 -0
- package/dist/resources/extensions/browser-tools/tools/codegen.js +242 -0
- package/dist/resources/extensions/browser-tools/tools/device.js +162 -0
- package/dist/resources/extensions/browser-tools/tools/extract.js +191 -0
- package/dist/resources/extensions/browser-tools/tools/forms.js +710 -0
- package/dist/resources/extensions/browser-tools/tools/injection-detect.js +178 -0
- package/dist/resources/extensions/browser-tools/tools/inspection.js +426 -0
- package/dist/resources/extensions/browser-tools/tools/intent.js +556 -0
- package/dist/resources/extensions/browser-tools/tools/interaction.js +776 -0
- package/dist/resources/extensions/browser-tools/tools/navigation.js +208 -0
- package/dist/resources/extensions/browser-tools/tools/network-mock.js +194 -0
- package/dist/resources/extensions/browser-tools/tools/pages.js +280 -0
- package/dist/resources/extensions/browser-tools/tools/pdf.js +74 -0
- package/dist/resources/extensions/browser-tools/tools/refs.js +485 -0
- package/dist/resources/extensions/browser-tools/tools/screenshot.js +87 -0
- package/dist/resources/extensions/browser-tools/tools/session.js +375 -0
- package/dist/resources/extensions/browser-tools/tools/state-persistence.js +180 -0
- package/dist/resources/extensions/browser-tools/tools/visual-diff.js +174 -0
- package/dist/resources/extensions/browser-tools/tools/wait.js +201 -0
- package/dist/resources/extensions/browser-tools/tools/zoom.js +90 -0
- package/dist/resources/extensions/browser-tools/utils.js +490 -0
- package/dist/resources/extensions/context7/index.js +337 -0
- package/dist/resources/extensions/get-secrets-from-user.js +492 -0
- package/dist/resources/extensions/google-search/index.js +373 -0
- package/dist/resources/extensions/gsd/activity-log.js +146 -0
- package/dist/resources/extensions/gsd/atomic-write.js +38 -0
- package/dist/resources/extensions/gsd/auto/session.js +187 -0
- package/dist/resources/extensions/gsd/auto-budget.js +30 -0
- package/dist/resources/extensions/gsd/{auto-constants.ts → auto-constants.js} +0 -1
- package/dist/resources/extensions/gsd/auto-dashboard.js +509 -0
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +180 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +382 -0
- package/dist/resources/extensions/gsd/auto-idempotency.js +106 -0
- package/dist/resources/extensions/gsd/auto-model-selection.js +133 -0
- package/dist/resources/extensions/gsd/auto-observability.js +54 -0
- package/dist/resources/extensions/gsd/auto-post-unit.js +495 -0
- package/dist/resources/extensions/gsd/auto-prompts.js +1121 -0
- package/dist/resources/extensions/gsd/auto-recovery.js +550 -0
- package/dist/resources/extensions/gsd/auto-start.js +393 -0
- package/dist/resources/extensions/gsd/auto-stuck-detection.js +165 -0
- package/dist/resources/extensions/gsd/{auto-supervisor.ts → auto-supervisor.js} +29 -32
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +183 -0
- package/dist/resources/extensions/gsd/auto-timers.js +181 -0
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +50 -0
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +30 -0
- package/dist/resources/extensions/gsd/auto-verification.js +209 -0
- package/dist/resources/extensions/gsd/auto-worktree.js +594 -0
- package/dist/resources/extensions/gsd/auto.js +1485 -0
- package/dist/resources/extensions/gsd/{cache.ts → cache.js} +5 -7
- package/dist/resources/extensions/gsd/captures.js +348 -0
- package/dist/resources/extensions/gsd/claude-import.js +540 -0
- package/dist/resources/extensions/gsd/collision-diagnostics.js +226 -0
- package/dist/resources/extensions/gsd/commands-bootstrap.js +223 -0
- package/dist/resources/extensions/gsd/commands-config.js +89 -0
- package/dist/resources/extensions/gsd/commands-extensions.js +259 -0
- package/dist/resources/extensions/gsd/commands-handlers.js +310 -0
- package/dist/resources/extensions/gsd/commands-inspect.js +70 -0
- package/dist/resources/extensions/gsd/commands-logs.js +468 -0
- package/dist/resources/extensions/gsd/commands-maintenance.js +185 -0
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +660 -0
- package/dist/resources/extensions/gsd/commands-workflow-templates.js +408 -0
- package/dist/resources/extensions/gsd/commands.js +1024 -0
- package/dist/resources/extensions/gsd/complexity-classifier.js +257 -0
- package/dist/resources/extensions/gsd/{constants.ts → constants.js} +0 -6
- package/dist/resources/extensions/gsd/context-budget.js +187 -0
- package/dist/resources/extensions/gsd/context-store.js +165 -0
- package/dist/resources/extensions/gsd/crash-recovery.js +110 -0
- package/dist/resources/extensions/gsd/dashboard-overlay.js +562 -0
- package/dist/resources/extensions/gsd/db-writer.js +298 -0
- package/dist/resources/extensions/gsd/debug-logger.js +161 -0
- package/dist/resources/extensions/gsd/detection.js +373 -0
- package/dist/resources/extensions/gsd/diff-context.js +168 -0
- package/dist/resources/extensions/gsd/dispatch-guard.js +76 -0
- package/dist/resources/extensions/gsd/doctor-checks.js +563 -0
- package/dist/resources/extensions/gsd/doctor-environment.js +429 -0
- package/dist/resources/extensions/gsd/doctor-format.js +71 -0
- package/dist/resources/extensions/gsd/doctor-proactive.js +239 -0
- package/dist/resources/extensions/gsd/doctor-providers.js +292 -0
- package/dist/resources/extensions/gsd/doctor-types.js +12 -0
- package/dist/resources/extensions/gsd/doctor.js +672 -0
- package/dist/resources/extensions/gsd/error-utils.js +6 -0
- package/dist/resources/extensions/gsd/{errors.ts → errors.js} +6 -11
- package/dist/resources/extensions/gsd/exit-command.js +11 -0
- package/dist/resources/extensions/gsd/{export-html.ts → export-html.js} +482 -614
- package/dist/resources/extensions/gsd/export.js +268 -0
- package/dist/resources/extensions/gsd/file-watcher.js +76 -0
- package/dist/resources/extensions/gsd/files.js +937 -0
- package/dist/resources/extensions/gsd/forensics.js +511 -0
- package/dist/resources/extensions/gsd/{git-constants.ts → git-constants.js} +4 -5
- package/dist/resources/extensions/gsd/git-self-heal.js +113 -0
- package/dist/resources/extensions/gsd/git-service.js +460 -0
- package/dist/resources/extensions/gsd/{gitignore.ts → gitignore.js} +98 -125
- package/dist/resources/extensions/gsd/gsd-db.js +590 -0
- package/dist/resources/extensions/gsd/guided-flow-queue.js +366 -0
- package/dist/resources/extensions/gsd/guided-flow.js +1149 -0
- package/dist/resources/extensions/gsd/health-widget.js +141 -0
- package/dist/resources/extensions/gsd/history.js +118 -0
- package/dist/resources/extensions/gsd/index.js +1250 -0
- package/dist/resources/extensions/gsd/init-wizard.js +479 -0
- package/dist/resources/extensions/gsd/json-persistence.js +62 -0
- package/dist/resources/extensions/gsd/{jsonl-utils.ts → jsonl-utils.js} +10 -7
- package/dist/resources/extensions/gsd/key-manager.js +829 -0
- package/dist/resources/extensions/gsd/marketplace-discovery.js +356 -0
- package/dist/resources/extensions/gsd/md-importer.js +440 -0
- package/dist/resources/extensions/gsd/mechanical-completion.js +351 -0
- package/dist/resources/extensions/gsd/memory-extractor.js +295 -0
- package/dist/resources/extensions/gsd/memory-store.js +351 -0
- package/dist/resources/extensions/gsd/metrics.js +377 -0
- package/dist/resources/extensions/gsd/migrate/command.js +157 -0
- package/dist/resources/extensions/gsd/migrate/index.js +7 -0
- package/dist/resources/extensions/gsd/migrate/parser.js +268 -0
- package/dist/resources/extensions/gsd/migrate/parsers.js +477 -0
- package/dist/resources/extensions/gsd/migrate/preview.js +47 -0
- package/dist/resources/extensions/gsd/migrate/transformer.js +278 -0
- package/dist/resources/extensions/gsd/migrate/types.js +4 -0
- package/dist/resources/extensions/gsd/migrate/validator.js +41 -0
- package/dist/resources/extensions/gsd/migrate/writer.js +477 -0
- package/dist/resources/extensions/gsd/migrate-external.js +130 -0
- package/dist/resources/extensions/gsd/milestone-actions.js +111 -0
- package/dist/resources/extensions/gsd/{milestone-ids.ts → milestone-ids.js} +50 -63
- package/dist/resources/extensions/gsd/model-cost-table.js +48 -0
- package/dist/resources/extensions/gsd/model-router.js +187 -0
- package/dist/resources/extensions/gsd/namespaced-registry.js +322 -0
- package/dist/resources/extensions/gsd/namespaced-resolver.js +176 -0
- package/dist/resources/extensions/gsd/native-git-bridge.js +842 -0
- package/dist/resources/extensions/gsd/native-parser-bridge.js +156 -0
- package/dist/resources/extensions/gsd/notifications.js +58 -0
- package/dist/resources/extensions/gsd/observability-validator.js +398 -0
- package/dist/resources/extensions/gsd/parallel-eligibility.js +182 -0
- package/dist/resources/extensions/gsd/parallel-merge.js +121 -0
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +687 -0
- package/dist/resources/extensions/gsd/paths.js +414 -0
- package/dist/resources/extensions/gsd/plugin-importer.js +254 -0
- package/dist/resources/extensions/gsd/post-unit-hooks.js +433 -0
- package/dist/resources/extensions/gsd/preferences-models.js +294 -0
- package/dist/resources/extensions/gsd/preferences-skills.js +154 -0
- package/dist/resources/extensions/gsd/preferences-types.js +73 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +607 -0
- package/dist/resources/extensions/gsd/preferences.js +325 -0
- package/dist/resources/extensions/gsd/progress-score.js +197 -0
- package/dist/resources/extensions/gsd/prompt-cache-optimizer.js +150 -0
- package/dist/resources/extensions/gsd/prompt-compressor.js +393 -0
- package/dist/resources/extensions/gsd/prompt-loader.js +119 -0
- package/dist/resources/extensions/gsd/prompt-ordering.js +170 -0
- package/dist/resources/extensions/gsd/provider-error-pause.js +60 -0
- package/dist/resources/extensions/gsd/queue-order.js +178 -0
- package/dist/resources/extensions/gsd/queue-reorder-ui.js +234 -0
- package/dist/resources/extensions/gsd/quick.js +230 -0
- package/dist/resources/extensions/gsd/repo-identity.js +187 -0
- package/dist/resources/extensions/gsd/{reports.ts → reports.js} +146 -241
- package/dist/resources/extensions/gsd/{resource-version.ts → resource-version.js} +50 -53
- package/dist/resources/extensions/gsd/roadmap-slices.js +130 -0
- package/dist/resources/extensions/gsd/routing-history.js +210 -0
- package/dist/resources/extensions/gsd/safe-fs.js +52 -0
- package/dist/resources/extensions/gsd/semantic-chunker.js +254 -0
- package/dist/resources/extensions/gsd/session-forensics.js +427 -0
- package/dist/resources/extensions/gsd/session-lock.js +376 -0
- package/dist/resources/extensions/gsd/session-status-io.js +134 -0
- package/dist/resources/extensions/gsd/skill-discovery.js +121 -0
- package/dist/resources/extensions/gsd/skill-health.js +324 -0
- package/dist/resources/extensions/gsd/{skill-telemetry.ts → skill-telemetry.js} +58 -74
- package/dist/resources/extensions/gsd/state.js +653 -0
- package/dist/resources/extensions/gsd/structured-data-formatter.js +97 -0
- package/dist/resources/extensions/gsd/summary-distiller.js +212 -0
- package/dist/resources/extensions/gsd/token-counter.js +54 -0
- package/dist/resources/extensions/gsd/triage-resolution.js +217 -0
- package/dist/resources/extensions/gsd/triage-ui.js +125 -0
- package/dist/resources/extensions/gsd/types.js +4 -0
- package/dist/resources/extensions/gsd/undo.js +210 -0
- package/dist/resources/extensions/gsd/unit-id.js +7 -0
- package/dist/resources/extensions/gsd/unit-runtime.js +130 -0
- package/dist/resources/extensions/gsd/validate-directory.js +143 -0
- package/dist/resources/extensions/gsd/verification-evidence.js +123 -0
- package/dist/resources/extensions/gsd/verification-gate.js +543 -0
- package/dist/resources/extensions/gsd/visualizer-data.js +612 -0
- package/dist/resources/extensions/gsd/visualizer-overlay.js +501 -0
- package/dist/resources/extensions/gsd/visualizer-views.js +893 -0
- package/dist/resources/extensions/gsd/workflow-templates.js +188 -0
- package/dist/resources/extensions/gsd/workspace-index.js +139 -0
- package/dist/resources/extensions/gsd/worktree-command-bootstrap.js +40 -0
- package/dist/resources/extensions/gsd/worktree-command.js +676 -0
- package/dist/resources/extensions/gsd/worktree-manager.js +359 -0
- package/dist/resources/extensions/gsd/worktree.js +236 -0
- package/dist/resources/extensions/mac-tools/index.js +768 -0
- package/dist/resources/extensions/mcp-client/index.js +363 -0
- package/dist/resources/extensions/package.json +3 -0
- package/dist/resources/extensions/remote-questions/config.js +70 -0
- package/dist/resources/extensions/remote-questions/discord-adapter.js +134 -0
- package/dist/resources/extensions/remote-questions/format.js +234 -0
- package/dist/resources/extensions/remote-questions/http-client.js +43 -0
- package/dist/resources/extensions/remote-questions/manager.js +156 -0
- package/dist/resources/extensions/remote-questions/{mod.ts → mod.js} +1 -10
- package/dist/resources/extensions/remote-questions/notify.js +89 -0
- package/dist/resources/extensions/remote-questions/remote-command.js +453 -0
- package/dist/resources/extensions/remote-questions/slack-adapter.js +123 -0
- package/dist/resources/extensions/remote-questions/status.js +25 -0
- package/dist/resources/extensions/remote-questions/store.js +70 -0
- package/dist/resources/extensions/remote-questions/telegram-adapter.js +123 -0
- package/dist/resources/extensions/remote-questions/types.js +5 -0
- package/dist/resources/extensions/search-the-web/cache.js +74 -0
- package/dist/resources/extensions/search-the-web/command-search-provider.js +79 -0
- package/dist/resources/extensions/search-the-web/format.js +161 -0
- package/dist/resources/extensions/search-the-web/http.js +178 -0
- package/dist/resources/extensions/search-the-web/index.js +41 -0
- package/dist/resources/extensions/search-the-web/native-search.js +166 -0
- package/dist/resources/extensions/search-the-web/provider.js +143 -0
- package/dist/resources/extensions/search-the-web/tavily.js +82 -0
- package/dist/resources/extensions/search-the-web/tool-fetch-page.js +452 -0
- package/dist/resources/extensions/search-the-web/tool-llm-context.js +455 -0
- package/dist/resources/extensions/search-the-web/tool-search.js +482 -0
- package/dist/resources/extensions/search-the-web/url-utils.js +121 -0
- package/dist/resources/extensions/shared/confirm-ui.js +96 -0
- package/dist/resources/extensions/shared/{format-utils.ts → format-utils.js} +85 -91
- package/dist/resources/extensions/shared/frontmatter.js +109 -0
- package/dist/resources/extensions/shared/interview-ui.js +569 -0
- package/dist/resources/extensions/shared/{mod.ts → mod.js} +2 -24
- package/dist/resources/extensions/shared/next-action-ui.js +168 -0
- package/dist/resources/extensions/shared/{path-display.ts → path-display.js} +2 -3
- package/dist/resources/extensions/shared/sanitize.js +17 -0
- package/dist/resources/extensions/shared/terminal.js +21 -0
- package/dist/resources/extensions/shared/ui.js +245 -0
- package/dist/resources/extensions/shared/wizard-ui.js +478 -0
- package/dist/resources/extensions/slash-commands/audit.js +72 -0
- package/dist/resources/extensions/slash-commands/clear.js +8 -0
- package/dist/resources/extensions/slash-commands/create-extension.js +264 -0
- package/dist/resources/extensions/slash-commands/create-slash-command.js +208 -0
- package/dist/resources/extensions/slash-commands/index.js +10 -0
- package/dist/resources/extensions/subagent/agents.js +103 -0
- package/dist/resources/extensions/subagent/index.js +905 -0
- package/dist/resources/extensions/subagent/isolation.js +384 -0
- package/dist/resources/extensions/subagent/worker-registry.js +73 -0
- package/dist/resources/extensions/ttsr/index.js +144 -0
- package/dist/resources/extensions/ttsr/rule-loader.js +70 -0
- package/dist/resources/extensions/ttsr/ttsr-manager.js +380 -0
- package/dist/resources/extensions/universal-config/discovery.js +94 -0
- package/dist/resources/extensions/universal-config/format.js +178 -0
- package/dist/resources/extensions/universal-config/index.js +99 -0
- package/dist/resources/extensions/universal-config/scanners.js +574 -0
- package/dist/resources/extensions/universal-config/tools.js +57 -0
- package/dist/resources/extensions/universal-config/types.js +8 -0
- package/dist/resources/extensions/voice/index.js +247 -0
- package/dist/startup-timings.d.ts +2 -0
- package/dist/startup-timings.js +22 -0
- package/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +31 -4
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/extensions/index.ts +1 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +35 -4
- package/packages/pi-coding-agent/src/index.ts +1 -0
- package/pkg/package.json +1 -1
- package/src/resources/extensions/bg-shell/index.ts +41 -46
- package/src/resources/extensions/browser-tools/index.ts +156 -67
- package/src/resources/extensions/gsd/auto-supervisor.ts +10 -5
- package/src/resources/extensions/gsd/auto-verification.ts +20 -2
- package/src/resources/extensions/gsd/auto-worktree.ts +136 -1
- package/src/resources/extensions/gsd/commands-bootstrap.ts +252 -0
- package/src/resources/extensions/gsd/commands.ts +53 -33
- package/src/resources/extensions/gsd/git-service.ts +24 -11
- package/src/resources/extensions/gsd/index.ts +106 -34
- package/src/resources/extensions/gsd/quick.ts +52 -3
- package/src/resources/extensions/gsd/repo-identity.ts +56 -22
- package/src/resources/extensions/gsd/session-lock.ts +80 -16
- package/src/resources/extensions/gsd/tests/auto-dispatch-loop.test.ts +691 -0
- package/src/resources/extensions/gsd/tests/cache-staleness-regression.test.ts +317 -0
- package/src/resources/extensions/gsd/tests/git-service.test.ts +16 -7
- package/src/resources/extensions/gsd/tests/loop-regression.test.ts +40 -5
- package/src/resources/extensions/gsd/tests/quick-branch-lifecycle.test.ts +281 -0
- package/src/resources/extensions/gsd/tests/repo-identity-worktree.test.ts +71 -0
- package/src/resources/extensions/gsd/tests/roadmap-parse-regression.test.ts +358 -0
- package/src/resources/extensions/gsd/tests/session-lock-regression.test.ts +216 -0
- package/src/resources/extensions/gsd/tests/session-lock.test.ts +119 -0
- package/src/resources/extensions/gsd/tests/verification-gate.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +206 -0
- package/src/resources/extensions/gsd/types.ts +4 -0
- package/src/resources/extensions/gsd/verification-evidence.ts +1 -1
- package/src/resources/extensions/gsd/verification-gate.ts +23 -2
- package/src/resources/extensions/gsd/worktree-command-bootstrap.ts +46 -0
- package/src/resources/extensions/gsd/worktree-command.ts +17 -11
- package/src/resources/extensions/package.json +3 -0
- package/src/resources/extensions/search-the-web/command-search-provider.ts +1 -1
- package/src/resources/extensions/search-the-web/index.ts +35 -52
- package/src/resources/extensions/search-the-web/tavily.ts +1 -1
- package/dist/resources/extensions/ask-user-questions.ts +0 -290
- package/dist/resources/extensions/async-jobs/async-bash-tool.ts +0 -212
- package/dist/resources/extensions/async-jobs/await-tool.ts +0 -103
- package/dist/resources/extensions/async-jobs/cancel-job-tool.ts +0 -35
- package/dist/resources/extensions/async-jobs/index.ts +0 -141
- package/dist/resources/extensions/async-jobs/job-manager.ts +0 -211
- package/dist/resources/extensions/aws-auth/index.ts +0 -144
- package/dist/resources/extensions/bg-shell/bg-shell-command.ts +0 -219
- package/dist/resources/extensions/bg-shell/bg-shell-lifecycle.ts +0 -400
- package/dist/resources/extensions/bg-shell/bg-shell-tool.ts +0 -985
- package/dist/resources/extensions/bg-shell/index.ts +0 -59
- package/dist/resources/extensions/bg-shell/interaction.ts +0 -198
- package/dist/resources/extensions/bg-shell/output-formatter.ts +0 -279
- package/dist/resources/extensions/bg-shell/overlay.ts +0 -437
- package/dist/resources/extensions/bg-shell/process-manager.ts +0 -464
- package/dist/resources/extensions/bg-shell/readiness-detector.ts +0 -126
- package/dist/resources/extensions/bg-shell/types.ts +0 -303
- package/dist/resources/extensions/bg-shell/utilities.ts +0 -57
- package/dist/resources/extensions/browser-tools/capture.ts +0 -199
- package/dist/resources/extensions/browser-tools/core.ts +0 -1196
- package/dist/resources/extensions/browser-tools/index.ts +0 -71
- package/dist/resources/extensions/browser-tools/lifecycle.ts +0 -270
- package/dist/resources/extensions/browser-tools/refs.ts +0 -264
- package/dist/resources/extensions/browser-tools/settle.ts +0 -197
- package/dist/resources/extensions/browser-tools/state.ts +0 -408
- package/dist/resources/extensions/browser-tools/tools/action-cache.ts +0 -216
- package/dist/resources/extensions/browser-tools/tools/assertions.ts +0 -342
- package/dist/resources/extensions/browser-tools/tools/codegen.ts +0 -274
- package/dist/resources/extensions/browser-tools/tools/device.ts +0 -183
- package/dist/resources/extensions/browser-tools/tools/extract.ts +0 -229
- package/dist/resources/extensions/browser-tools/tools/forms.ts +0 -801
- package/dist/resources/extensions/browser-tools/tools/injection-detect.ts +0 -221
- package/dist/resources/extensions/browser-tools/tools/inspection.ts +0 -492
- package/dist/resources/extensions/browser-tools/tools/intent.ts +0 -614
- package/dist/resources/extensions/browser-tools/tools/interaction.ts +0 -865
- package/dist/resources/extensions/browser-tools/tools/navigation.ts +0 -232
- package/dist/resources/extensions/browser-tools/tools/network-mock.ts +0 -244
- package/dist/resources/extensions/browser-tools/tools/pages.ts +0 -303
- package/dist/resources/extensions/browser-tools/tools/pdf.ts +0 -92
- package/dist/resources/extensions/browser-tools/tools/refs.ts +0 -541
- package/dist/resources/extensions/browser-tools/tools/screenshot.ts +0 -101
- package/dist/resources/extensions/browser-tools/tools/session.ts +0 -400
- package/dist/resources/extensions/browser-tools/tools/state-persistence.ts +0 -202
- package/dist/resources/extensions/browser-tools/tools/visual-diff.ts +0 -209
- package/dist/resources/extensions/browser-tools/tools/wait.ts +0 -247
- package/dist/resources/extensions/browser-tools/tools/zoom.ts +0 -104
- package/dist/resources/extensions/browser-tools/utils.ts +0 -660
- package/dist/resources/extensions/context7/index.ts +0 -428
- package/dist/resources/extensions/get-secrets-from-user.ts +0 -607
- package/dist/resources/extensions/google-search/index.ts +0 -466
- package/dist/resources/extensions/gsd/activity-log.ts +0 -162
- package/dist/resources/extensions/gsd/atomic-write.ts +0 -35
- package/dist/resources/extensions/gsd/auto/session.ts +0 -236
- package/dist/resources/extensions/gsd/auto-budget.ts +0 -32
- package/dist/resources/extensions/gsd/auto-dashboard.ts +0 -626
- package/dist/resources/extensions/gsd/auto-direct-dispatch.ts +0 -224
- package/dist/resources/extensions/gsd/auto-dispatch.ts +0 -409
- package/dist/resources/extensions/gsd/auto-idempotency.ts +0 -151
- package/dist/resources/extensions/gsd/auto-model-selection.ts +0 -179
- package/dist/resources/extensions/gsd/auto-observability.ts +0 -72
- package/dist/resources/extensions/gsd/auto-post-unit.ts +0 -618
- package/dist/resources/extensions/gsd/auto-prompts.ts +0 -1273
- package/dist/resources/extensions/gsd/auto-recovery.ts +0 -578
- package/dist/resources/extensions/gsd/auto-start.ts +0 -483
- package/dist/resources/extensions/gsd/auto-stuck-detection.ts +0 -221
- package/dist/resources/extensions/gsd/auto-timeout-recovery.ts +0 -263
- package/dist/resources/extensions/gsd/auto-timers.ts +0 -224
- package/dist/resources/extensions/gsd/auto-tool-tracking.ts +0 -54
- package/dist/resources/extensions/gsd/auto-unit-closeout.ts +0 -48
- package/dist/resources/extensions/gsd/auto-verification.ts +0 -229
- package/dist/resources/extensions/gsd/auto-worktree.ts +0 -524
- package/dist/resources/extensions/gsd/auto.ts +0 -1834
- package/dist/resources/extensions/gsd/captures.ts +0 -427
- package/dist/resources/extensions/gsd/claude-import.ts +0 -656
- package/dist/resources/extensions/gsd/collision-diagnostics.ts +0 -332
- package/dist/resources/extensions/gsd/commands-config.ts +0 -102
- package/dist/resources/extensions/gsd/commands-extensions.ts +0 -328
- package/dist/resources/extensions/gsd/commands-handlers.ts +0 -395
- package/dist/resources/extensions/gsd/commands-inspect.ts +0 -91
- package/dist/resources/extensions/gsd/commands-logs.ts +0 -536
- package/dist/resources/extensions/gsd/commands-maintenance.ts +0 -206
- package/dist/resources/extensions/gsd/commands-prefs-wizard.ts +0 -780
- package/dist/resources/extensions/gsd/commands-workflow-templates.ts +0 -543
- package/dist/resources/extensions/gsd/commands.ts +0 -1137
- package/dist/resources/extensions/gsd/complexity-classifier.ts +0 -320
- package/dist/resources/extensions/gsd/context-budget.ts +0 -266
- package/dist/resources/extensions/gsd/context-store.ts +0 -195
- package/dist/resources/extensions/gsd/crash-recovery.ts +0 -121
- package/dist/resources/extensions/gsd/dashboard-overlay.ts +0 -681
- package/dist/resources/extensions/gsd/db-writer.ts +0 -360
- package/dist/resources/extensions/gsd/debug-logger.ts +0 -178
- package/dist/resources/extensions/gsd/detection.ts +0 -470
- package/dist/resources/extensions/gsd/diff-context.ts +0 -214
- package/dist/resources/extensions/gsd/dispatch-guard.ts +0 -81
- package/dist/resources/extensions/gsd/doctor-checks.ts +0 -612
- package/dist/resources/extensions/gsd/doctor-environment.ts +0 -497
- package/dist/resources/extensions/gsd/doctor-format.ts +0 -78
- package/dist/resources/extensions/gsd/doctor-proactive.ts +0 -292
- package/dist/resources/extensions/gsd/doctor-providers.ts +0 -343
- package/dist/resources/extensions/gsd/doctor-types.ts +0 -87
- package/dist/resources/extensions/gsd/doctor.ts +0 -722
- package/dist/resources/extensions/gsd/error-utils.ts +0 -6
- package/dist/resources/extensions/gsd/exit-command.ts +0 -18
- package/dist/resources/extensions/gsd/export.ts +0 -317
- package/dist/resources/extensions/gsd/file-watcher.ts +0 -97
- package/dist/resources/extensions/gsd/files.ts +0 -1058
- package/dist/resources/extensions/gsd/forensics.ts +0 -629
- package/dist/resources/extensions/gsd/git-self-heal.ts +0 -127
- package/dist/resources/extensions/gsd/git-service.ts +0 -580
- package/dist/resources/extensions/gsd/gsd-db.ts +0 -685
- package/dist/resources/extensions/gsd/guided-flow-queue.ts +0 -440
- package/dist/resources/extensions/gsd/guided-flow.ts +0 -1303
- package/dist/resources/extensions/gsd/health-widget.ts +0 -167
- package/dist/resources/extensions/gsd/history.ts +0 -143
- package/dist/resources/extensions/gsd/index.ts +0 -1390
- package/dist/resources/extensions/gsd/init-wizard.ts +0 -587
- package/dist/resources/extensions/gsd/json-persistence.ts +0 -67
- package/dist/resources/extensions/gsd/key-manager.ts +0 -996
- package/dist/resources/extensions/gsd/marketplace-discovery.ts +0 -508
- package/dist/resources/extensions/gsd/md-importer.ts +0 -527
- package/dist/resources/extensions/gsd/mechanical-completion.ts +0 -430
- package/dist/resources/extensions/gsd/memory-extractor.ts +0 -352
- package/dist/resources/extensions/gsd/memory-store.ts +0 -441
- package/dist/resources/extensions/gsd/metrics.ts +0 -532
- package/dist/resources/extensions/gsd/migrate/command.ts +0 -219
- package/dist/resources/extensions/gsd/migrate/index.ts +0 -42
- package/dist/resources/extensions/gsd/migrate/parser.ts +0 -323
- package/dist/resources/extensions/gsd/migrate/parsers.ts +0 -539
- package/dist/resources/extensions/gsd/migrate/preview.ts +0 -48
- package/dist/resources/extensions/gsd/migrate/transformer.ts +0 -346
- package/dist/resources/extensions/gsd/migrate/types.ts +0 -370
- package/dist/resources/extensions/gsd/migrate/validator.ts +0 -55
- package/dist/resources/extensions/gsd/migrate/writer.ts +0 -579
- package/dist/resources/extensions/gsd/migrate-external.ts +0 -140
- package/dist/resources/extensions/gsd/milestone-actions.ts +0 -126
- package/dist/resources/extensions/gsd/model-cost-table.ts +0 -65
- package/dist/resources/extensions/gsd/model-router.ts +0 -256
- package/dist/resources/extensions/gsd/namespaced-registry.ts +0 -467
- package/dist/resources/extensions/gsd/namespaced-resolver.ts +0 -307
- package/dist/resources/extensions/gsd/native-git-bridge.ts +0 -1041
- package/dist/resources/extensions/gsd/native-parser-bridge.ts +0 -267
- package/dist/resources/extensions/gsd/notifications.ts +0 -87
- package/dist/resources/extensions/gsd/observability-validator.ts +0 -429
- package/dist/resources/extensions/gsd/parallel-eligibility.ts +0 -233
- package/dist/resources/extensions/gsd/parallel-merge.ts +0 -157
- package/dist/resources/extensions/gsd/parallel-orchestrator.ts +0 -826
- package/dist/resources/extensions/gsd/paths.ts +0 -449
- package/dist/resources/extensions/gsd/plugin-importer.ts +0 -411
- package/dist/resources/extensions/gsd/post-unit-hooks.ts +0 -520
- package/dist/resources/extensions/gsd/preferences-models.ts +0 -329
- package/dist/resources/extensions/gsd/preferences-skills.ts +0 -169
- package/dist/resources/extensions/gsd/preferences-types.ts +0 -229
- package/dist/resources/extensions/gsd/preferences-validation.ts +0 -590
- package/dist/resources/extensions/gsd/preferences.ts +0 -416
- package/dist/resources/extensions/gsd/progress-score.ts +0 -273
- package/dist/resources/extensions/gsd/prompt-cache-optimizer.ts +0 -213
- package/dist/resources/extensions/gsd/prompt-compressor.ts +0 -508
- package/dist/resources/extensions/gsd/prompt-loader.ts +0 -130
- package/dist/resources/extensions/gsd/prompt-ordering.ts +0 -200
- package/dist/resources/extensions/gsd/provider-error-pause.ts +0 -88
- package/dist/resources/extensions/gsd/queue-order.ts +0 -230
- package/dist/resources/extensions/gsd/queue-reorder-ui.ts +0 -276
- package/dist/resources/extensions/gsd/quick.ts +0 -212
- package/dist/resources/extensions/gsd/repo-identity.ts +0 -169
- package/dist/resources/extensions/gsd/roadmap-slices.ts +0 -149
- package/dist/resources/extensions/gsd/routing-history.ts +0 -286
- package/dist/resources/extensions/gsd/safe-fs.ts +0 -47
- package/dist/resources/extensions/gsd/semantic-chunker.ts +0 -336
- package/dist/resources/extensions/gsd/session-forensics.ts +0 -537
- package/dist/resources/extensions/gsd/session-lock.ts +0 -362
- package/dist/resources/extensions/gsd/session-status-io.ts +0 -179
- package/dist/resources/extensions/gsd/skill-discovery.ts +0 -139
- package/dist/resources/extensions/gsd/skill-health.ts +0 -417
- package/dist/resources/extensions/gsd/state.ts +0 -727
- package/dist/resources/extensions/gsd/structured-data-formatter.ts +0 -144
- package/dist/resources/extensions/gsd/summary-distiller.ts +0 -258
- package/dist/resources/extensions/gsd/tests/activity-log.test.ts +0 -213
- package/dist/resources/extensions/gsd/tests/agent-end-retry.test.ts +0 -107
- package/dist/resources/extensions/gsd/tests/all-milestones-complete-merge.test.ts +0 -200
- package/dist/resources/extensions/gsd/tests/auto-budget-alerts.test.ts +0 -50
- package/dist/resources/extensions/gsd/tests/auto-dashboard.test.ts +0 -166
- package/dist/resources/extensions/gsd/tests/auto-lock-creation.test.ts +0 -186
- package/dist/resources/extensions/gsd/tests/auto-preflight.test.ts +0 -40
- package/dist/resources/extensions/gsd/tests/auto-recovery.test.ts +0 -640
- package/dist/resources/extensions/gsd/tests/auto-reentrancy-guard.test.ts +0 -127
- package/dist/resources/extensions/gsd/tests/auto-secrets-gate.test.ts +0 -302
- package/dist/resources/extensions/gsd/tests/auto-session-encapsulation.test.ts +0 -257
- package/dist/resources/extensions/gsd/tests/auto-skip-loop.test.ts +0 -123
- package/dist/resources/extensions/gsd/tests/auto-worktree-milestone-merge.test.ts +0 -340
- package/dist/resources/extensions/gsd/tests/auto-worktree.test.ts +0 -167
- package/dist/resources/extensions/gsd/tests/budget-prediction.test.ts +0 -220
- package/dist/resources/extensions/gsd/tests/captures.test.ts +0 -438
- package/dist/resources/extensions/gsd/tests/claude-import-tui.test.ts +0 -351
- package/dist/resources/extensions/gsd/tests/collect-from-manifest.test.ts +0 -469
- package/dist/resources/extensions/gsd/tests/collision-diagnostics.test.ts +0 -705
- package/dist/resources/extensions/gsd/tests/commands-logs.test.ts +0 -241
- package/dist/resources/extensions/gsd/tests/complete-milestone.test.ts +0 -209
- package/dist/resources/extensions/gsd/tests/complexity-classifier.test.ts +0 -181
- package/dist/resources/extensions/gsd/tests/context-budget.test.ts +0 -352
- package/dist/resources/extensions/gsd/tests/context-compression.test.ts +0 -193
- package/dist/resources/extensions/gsd/tests/context-store.test.ts +0 -462
- package/dist/resources/extensions/gsd/tests/continue-here.test.ts +0 -285
- package/dist/resources/extensions/gsd/tests/cost-projection.test.ts +0 -134
- package/dist/resources/extensions/gsd/tests/crash-recovery.test.ts +0 -134
- package/dist/resources/extensions/gsd/tests/dashboard-budget.test.ts +0 -346
- package/dist/resources/extensions/gsd/tests/db-writer.test.ts +0 -602
- package/dist/resources/extensions/gsd/tests/debug-logger.test.ts +0 -185
- package/dist/resources/extensions/gsd/tests/derive-state-db.test.ts +0 -405
- package/dist/resources/extensions/gsd/tests/derive-state-deps.test.ts +0 -421
- package/dist/resources/extensions/gsd/tests/derive-state-draft.test.ts +0 -308
- package/dist/resources/extensions/gsd/tests/derive-state.test.ts +0 -788
- package/dist/resources/extensions/gsd/tests/detection.test.ts +0 -398
- package/dist/resources/extensions/gsd/tests/diff-context.test.ts +0 -136
- package/dist/resources/extensions/gsd/tests/discuss-prompt.test.ts +0 -15
- package/dist/resources/extensions/gsd/tests/dispatch-guard.test.ts +0 -128
- package/dist/resources/extensions/gsd/tests/dispatch-missing-task-plans.test.ts +0 -132
- package/dist/resources/extensions/gsd/tests/dispatch-stall-guard.test.ts +0 -126
- package/dist/resources/extensions/gsd/tests/doctor-environment.test.ts +0 -314
- package/dist/resources/extensions/gsd/tests/doctor-fixlevel.test.ts +0 -245
- package/dist/resources/extensions/gsd/tests/doctor-git.test.ts +0 -344
- package/dist/resources/extensions/gsd/tests/doctor-proactive.test.ts +0 -278
- package/dist/resources/extensions/gsd/tests/doctor-providers.test.ts +0 -298
- package/dist/resources/extensions/gsd/tests/doctor-runtime.test.ts +0 -302
- package/dist/resources/extensions/gsd/tests/doctor.test.ts +0 -652
- package/dist/resources/extensions/gsd/tests/draft-promotion.test.ts +0 -169
- package/dist/resources/extensions/gsd/tests/exit-command.test.ts +0 -50
- package/dist/resources/extensions/gsd/tests/export-html-all.test.ts +0 -105
- package/dist/resources/extensions/gsd/tests/export-html-enhancements.test.ts +0 -378
- package/dist/resources/extensions/gsd/tests/extension-selector-separator.test.ts +0 -144
- package/dist/resources/extensions/gsd/tests/feature-branch-lifecycle-integration.test.ts +0 -424
- package/dist/resources/extensions/gsd/tests/git-self-heal.test.ts +0 -131
- package/dist/resources/extensions/gsd/tests/git-service.test.ts +0 -1172
- package/dist/resources/extensions/gsd/tests/gsd-db.test.ts +0 -353
- package/dist/resources/extensions/gsd/tests/gsd-inspect.test.ts +0 -125
- package/dist/resources/extensions/gsd/tests/gsd-tools.test.ts +0 -326
- package/dist/resources/extensions/gsd/tests/headless-answers.test.ts +0 -340
- package/dist/resources/extensions/gsd/tests/headless-query.test.ts +0 -162
- package/dist/resources/extensions/gsd/tests/idle-recovery.test.ts +0 -485
- package/dist/resources/extensions/gsd/tests/in-flight-tool-tracking.test.ts +0 -32
- package/dist/resources/extensions/gsd/tests/init-wizard.test.ts +0 -197
- package/dist/resources/extensions/gsd/tests/integration/headless-command.ts +0 -534
- package/dist/resources/extensions/gsd/tests/integration-edge.test.ts +0 -228
- package/dist/resources/extensions/gsd/tests/integration-lifecycle.test.ts +0 -277
- package/dist/resources/extensions/gsd/tests/integration-mixed-milestones.test.ts +0 -523
- package/dist/resources/extensions/gsd/tests/key-manager.test.ts +0 -414
- package/dist/resources/extensions/gsd/tests/knowledge.test.ts +0 -161
- package/dist/resources/extensions/gsd/tests/loop-regression.test.ts +0 -839
- package/dist/resources/extensions/gsd/tests/manifest-status.test.ts +0 -283
- package/dist/resources/extensions/gsd/tests/marketplace-test-fixtures.ts +0 -91
- package/dist/resources/extensions/gsd/tests/md-importer.test.ts +0 -410
- package/dist/resources/extensions/gsd/tests/mechanical-completion.test.ts +0 -356
- package/dist/resources/extensions/gsd/tests/memory-extractor.test.ts +0 -180
- package/dist/resources/extensions/gsd/tests/memory-leak-guards.test.ts +0 -91
- package/dist/resources/extensions/gsd/tests/memory-store.test.ts +0 -345
- package/dist/resources/extensions/gsd/tests/metrics.test.ts +0 -253
- package/dist/resources/extensions/gsd/tests/migrate-command.test.ts +0 -369
- package/dist/resources/extensions/gsd/tests/migrate-parser.test.ts +0 -757
- package/dist/resources/extensions/gsd/tests/migrate-transformer.test.ts +0 -635
- package/dist/resources/extensions/gsd/tests/migrate-validator-parsers.test.ts +0 -414
- package/dist/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +0 -303
- package/dist/resources/extensions/gsd/tests/migrate-writer.test.ts +0 -398
- package/dist/resources/extensions/gsd/tests/milestone-transition-worktree.test.ts +0 -147
- package/dist/resources/extensions/gsd/tests/model-cost-table.test.ts +0 -69
- package/dist/resources/extensions/gsd/tests/model-isolation.test.ts +0 -157
- package/dist/resources/extensions/gsd/tests/model-router.test.ts +0 -167
- package/dist/resources/extensions/gsd/tests/must-have-parser.test.ts +0 -291
- package/dist/resources/extensions/gsd/tests/namespaced-registry.test.ts +0 -1027
- package/dist/resources/extensions/gsd/tests/namespaced-resolver.test.ts +0 -671
- package/dist/resources/extensions/gsd/tests/native-has-changes-cache.test.ts +0 -61
- package/dist/resources/extensions/gsd/tests/next-milestone-id.test.ts +0 -23
- package/dist/resources/extensions/gsd/tests/none-mode-gates.test.ts +0 -114
- package/dist/resources/extensions/gsd/tests/notifications.test.ts +0 -67
- package/dist/resources/extensions/gsd/tests/overrides.test.ts +0 -131
- package/dist/resources/extensions/gsd/tests/parallel-budget-atomicity.test.ts +0 -331
- package/dist/resources/extensions/gsd/tests/parallel-crash-recovery.test.ts +0 -298
- package/dist/resources/extensions/gsd/tests/parallel-merge.test.ts +0 -468
- package/dist/resources/extensions/gsd/tests/parallel-orchestration.test.ts +0 -685
- package/dist/resources/extensions/gsd/tests/parallel-worker-monitoring.test.ts +0 -171
- package/dist/resources/extensions/gsd/tests/parallel-workers-multi-milestone-e2e.test.ts +0 -354
- package/dist/resources/extensions/gsd/tests/park-edge-cases.test.ts +0 -276
- package/dist/resources/extensions/gsd/tests/park-milestone.test.ts +0 -401
- package/dist/resources/extensions/gsd/tests/parsers.test.ts +0 -1704
- package/dist/resources/extensions/gsd/tests/plan-milestone.test.ts +0 -133
- package/dist/resources/extensions/gsd/tests/plan-quality-validator.test.ts +0 -363
- package/dist/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +0 -42
- package/dist/resources/extensions/gsd/tests/plugin-importer-live.test.ts +0 -481
- package/dist/resources/extensions/gsd/tests/plugin-importer.test.ts +0 -1383
- package/dist/resources/extensions/gsd/tests/post-unit-hooks.test.ts +0 -337
- package/dist/resources/extensions/gsd/tests/preferences.test.ts +0 -276
- package/dist/resources/extensions/gsd/tests/progress-score.test.ts +0 -206
- package/dist/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +0 -464
- package/dist/resources/extensions/gsd/tests/prompt-cache-optimizer.test.ts +0 -314
- package/dist/resources/extensions/gsd/tests/prompt-compressor.test.ts +0 -529
- package/dist/resources/extensions/gsd/tests/prompt-db.test.ts +0 -385
- package/dist/resources/extensions/gsd/tests/prompt-ordering.test.ts +0 -296
- package/dist/resources/extensions/gsd/tests/provider-errors.test.ts +0 -338
- package/dist/resources/extensions/gsd/tests/queue-draft-detection.test.ts +0 -126
- package/dist/resources/extensions/gsd/tests/queue-order.test.ts +0 -204
- package/dist/resources/extensions/gsd/tests/queue-reorder-e2e.test.ts +0 -282
- package/dist/resources/extensions/gsd/tests/reassess-detection.test.ts +0 -154
- package/dist/resources/extensions/gsd/tests/reassess-prompt.test.ts +0 -145
- package/dist/resources/extensions/gsd/tests/regex-hardening.test.ts +0 -281
- package/dist/resources/extensions/gsd/tests/remote-questions.test.ts +0 -642
- package/dist/resources/extensions/gsd/tests/remote-status.test.ts +0 -99
- package/dist/resources/extensions/gsd/tests/replan-slice.test.ts +0 -538
- package/dist/resources/extensions/gsd/tests/requirements.test.ts +0 -106
- package/dist/resources/extensions/gsd/tests/roadmap-slices.test.ts +0 -66
- package/dist/resources/extensions/gsd/tests/routing-history.test.ts +0 -240
- package/dist/resources/extensions/gsd/tests/run-uat.test.ts +0 -416
- package/dist/resources/extensions/gsd/tests/secure-env-collect.test.ts +0 -185
- package/dist/resources/extensions/gsd/tests/semantic-chunker.test.ts +0 -426
- package/dist/resources/extensions/gsd/tests/session-lock.test.ts +0 -315
- package/dist/resources/extensions/gsd/tests/skill-lifecycle.test.ts +0 -126
- package/dist/resources/extensions/gsd/tests/smart-entry-draft.test.ts +0 -123
- package/dist/resources/extensions/gsd/tests/stale-worktree-cwd.test.ts +0 -142
- package/dist/resources/extensions/gsd/tests/stop-auto-remote.test.ts +0 -156
- package/dist/resources/extensions/gsd/tests/structured-data-formatter.test.ts +0 -365
- package/dist/resources/extensions/gsd/tests/summary-distiller.test.ts +0 -323
- package/dist/resources/extensions/gsd/tests/test-helpers.ts +0 -61
- package/dist/resources/extensions/gsd/tests/token-counter.test.ts +0 -129
- package/dist/resources/extensions/gsd/tests/token-optimization-benchmark.test.ts +0 -1272
- package/dist/resources/extensions/gsd/tests/token-optimization-prefs.test.ts +0 -164
- package/dist/resources/extensions/gsd/tests/token-profile.test.ts +0 -268
- package/dist/resources/extensions/gsd/tests/token-savings.test.ts +0 -366
- package/dist/resources/extensions/gsd/tests/triage-dispatch.test.ts +0 -340
- package/dist/resources/extensions/gsd/tests/triage-resolution.test.ts +0 -416
- package/dist/resources/extensions/gsd/tests/undo.test.ts +0 -136
- package/dist/resources/extensions/gsd/tests/unique-milestone-ids.test.ts +0 -219
- package/dist/resources/extensions/gsd/tests/unit-runtime.test.ts +0 -258
- package/dist/resources/extensions/gsd/tests/update-command.test.ts +0 -67
- package/dist/resources/extensions/gsd/tests/validate-directory.test.ts +0 -222
- package/dist/resources/extensions/gsd/tests/validate-milestone.test.ts +0 -375
- package/dist/resources/extensions/gsd/tests/verification-evidence.test.ts +0 -745
- package/dist/resources/extensions/gsd/tests/verification-gate.test.ts +0 -1208
- package/dist/resources/extensions/gsd/tests/visualizer-critical-path.test.ts +0 -145
- package/dist/resources/extensions/gsd/tests/visualizer-data.test.ts +0 -446
- package/dist/resources/extensions/gsd/tests/visualizer-overlay.test.ts +0 -237
- package/dist/resources/extensions/gsd/tests/visualizer-views.test.ts +0 -718
- package/dist/resources/extensions/gsd/tests/worker-registry.test.ts +0 -148
- package/dist/resources/extensions/gsd/tests/workflow-templates.test.ts +0 -173
- package/dist/resources/extensions/gsd/tests/workspace-index.test.ts +0 -38
- package/dist/resources/extensions/gsd/tests/worktree-bugfix.test.ts +0 -120
- package/dist/resources/extensions/gsd/tests/worktree-e2e.test.ts +0 -244
- package/dist/resources/extensions/gsd/tests/worktree-integration.test.ts +0 -207
- package/dist/resources/extensions/gsd/tests/worktree-manager.test.ts +0 -141
- package/dist/resources/extensions/gsd/tests/worktree-post-create-hook.test.ts +0 -165
- package/dist/resources/extensions/gsd/tests/worktree.test.ts +0 -171
- package/dist/resources/extensions/gsd/tests/write-gate.test.ts +0 -211
- package/dist/resources/extensions/gsd/token-counter.ts +0 -65
- package/dist/resources/extensions/gsd/triage-resolution.ts +0 -284
- package/dist/resources/extensions/gsd/triage-ui.ts +0 -175
- package/dist/resources/extensions/gsd/types.ts +0 -425
- package/dist/resources/extensions/gsd/undo.ts +0 -223
- package/dist/resources/extensions/gsd/unit-id.ts +0 -14
- package/dist/resources/extensions/gsd/unit-runtime.ts +0 -192
- package/dist/resources/extensions/gsd/validate-directory.ts +0 -164
- package/dist/resources/extensions/gsd/verification-evidence.ts +0 -188
- package/dist/resources/extensions/gsd/verification-gate.ts +0 -643
- package/dist/resources/extensions/gsd/visualizer-data.ts +0 -866
- package/dist/resources/extensions/gsd/visualizer-overlay.ts +0 -566
- package/dist/resources/extensions/gsd/visualizer-views.ts +0 -1171
- package/dist/resources/extensions/gsd/workflow-templates.ts +0 -241
- package/dist/resources/extensions/gsd/workspace-index.ts +0 -217
- package/dist/resources/extensions/gsd/worktree-command.ts +0 -807
- package/dist/resources/extensions/gsd/worktree-manager.ts +0 -449
- package/dist/resources/extensions/gsd/worktree.ts +0 -257
- package/dist/resources/extensions/mac-tools/index.ts +0 -852
- package/dist/resources/extensions/mcp-client/index.ts +0 -459
- package/dist/resources/extensions/mcporter/extension-manifest.json +0 -12
- package/dist/resources/extensions/remote-questions/config.ts +0 -83
- package/dist/resources/extensions/remote-questions/discord-adapter.ts +0 -148
- package/dist/resources/extensions/remote-questions/format.ts +0 -315
- package/dist/resources/extensions/remote-questions/http-client.ts +0 -76
- package/dist/resources/extensions/remote-questions/manager.ts +0 -184
- package/dist/resources/extensions/remote-questions/notify.ts +0 -90
- package/dist/resources/extensions/remote-questions/remote-command.ts +0 -457
- package/dist/resources/extensions/remote-questions/slack-adapter.ts +0 -141
- package/dist/resources/extensions/remote-questions/status.ts +0 -31
- package/dist/resources/extensions/remote-questions/store.ts +0 -81
- package/dist/resources/extensions/remote-questions/telegram-adapter.ts +0 -149
- package/dist/resources/extensions/remote-questions/types.ts +0 -102
- package/dist/resources/extensions/search-the-web/cache.ts +0 -78
- package/dist/resources/extensions/search-the-web/command-search-provider.ts +0 -101
- package/dist/resources/extensions/search-the-web/format.ts +0 -258
- package/dist/resources/extensions/search-the-web/http.ts +0 -238
- package/dist/resources/extensions/search-the-web/index.ts +0 -65
- package/dist/resources/extensions/search-the-web/native-search.ts +0 -193
- package/dist/resources/extensions/search-the-web/provider.ts +0 -148
- package/dist/resources/extensions/search-the-web/tavily.ts +0 -116
- package/dist/resources/extensions/search-the-web/tool-fetch-page.ts +0 -589
- package/dist/resources/extensions/search-the-web/tool-llm-context.ts +0 -608
- package/dist/resources/extensions/search-the-web/tool-search.ts +0 -649
- package/dist/resources/extensions/search-the-web/url-utils.ts +0 -125
- package/dist/resources/extensions/shared/confirm-ui.ts +0 -126
- package/dist/resources/extensions/shared/frontmatter.ts +0 -117
- package/dist/resources/extensions/shared/interview-ui.ts +0 -613
- package/dist/resources/extensions/shared/next-action-ui.ts +0 -212
- package/dist/resources/extensions/shared/sanitize.ts +0 -19
- package/dist/resources/extensions/shared/terminal.ts +0 -23
- package/dist/resources/extensions/shared/tests/format-utils.test.ts +0 -153
- package/dist/resources/extensions/shared/ui.ts +0 -400
- package/dist/resources/extensions/shared/wizard-ui.ts +0 -551
- package/dist/resources/extensions/slash-commands/audit.ts +0 -88
- package/dist/resources/extensions/slash-commands/clear.ts +0 -10
- package/dist/resources/extensions/slash-commands/create-extension.ts +0 -297
- package/dist/resources/extensions/slash-commands/create-slash-command.ts +0 -234
- package/dist/resources/extensions/slash-commands/index.ts +0 -12
- package/dist/resources/extensions/subagent/agents.ts +0 -126
- package/dist/resources/extensions/subagent/index.ts +0 -1121
- package/dist/resources/extensions/subagent/isolation.ts +0 -501
- package/dist/resources/extensions/subagent/worker-registry.ts +0 -99
- package/dist/resources/extensions/ttsr/index.ts +0 -168
- package/dist/resources/extensions/ttsr/rule-loader.ts +0 -74
- package/dist/resources/extensions/ttsr/ttsr-manager.ts +0 -456
- package/dist/resources/extensions/universal-config/discovery.ts +0 -104
- package/dist/resources/extensions/universal-config/format.ts +0 -191
- package/dist/resources/extensions/universal-config/index.ts +0 -120
- package/dist/resources/extensions/universal-config/scanners.ts +0 -642
- package/dist/resources/extensions/universal-config/tests/discovery.test.ts +0 -119
- package/dist/resources/extensions/universal-config/tests/format.test.ts +0 -127
- package/dist/resources/extensions/universal-config/tests/scanners.test.ts +0 -456
- package/dist/resources/extensions/universal-config/tools.ts +0 -60
- package/dist/resources/extensions/universal-config/types.ts +0 -135
- package/dist/resources/extensions/voice/index.ts +0 -272
- package/dist/resources/skills/create-gsd-extension/templates/extension-skeleton.ts +0 -51
- package/dist/resources/skills/create-gsd-extension/templates/stateful-tool-skeleton.ts +0 -143
- package/src/resources/extensions/mcporter/extension-manifest.json +0 -12
|
@@ -0,0 +1,937 @@
|
|
|
1
|
+
// GSD Extension - File Parsing and I/O
|
|
2
|
+
// Parsers for roadmap, plan, summary, and continue files.
|
|
3
|
+
// Used by state derivation and the status widget.
|
|
4
|
+
// Pure functions, zero Pi dependencies - uses only Node built-ins.
|
|
5
|
+
import { promises as fs } from 'node:fs';
|
|
6
|
+
import { resolve } from 'node:path';
|
|
7
|
+
import { atomicWriteAsync } from './atomic-write.js';
|
|
8
|
+
import { resolveMilestoneFile, relMilestoneFile, resolveGsdRootFile } from './paths.js';
|
|
9
|
+
import { findMilestoneIds } from './guided-flow.js';
|
|
10
|
+
import { checkExistingEnvKeys } from '../get-secrets-from-user.js';
|
|
11
|
+
import { parseRoadmapSlices } from './roadmap-slices.js';
|
|
12
|
+
import { nativeParseRoadmap, nativeExtractSection, nativeParsePlanFile, nativeParseSummaryFile, NATIVE_UNAVAILABLE } from './native-parser-bridge.js';
|
|
13
|
+
import { debugTime, debugCount } from './debug-logger.js';
|
|
14
|
+
import { CACHE_MAX } from './constants.js';
|
|
15
|
+
import { splitFrontmatter, parseFrontmatterMap } from '../shared/frontmatter.js';
|
|
16
|
+
// Re-export for downstream consumers
|
|
17
|
+
export { splitFrontmatter, parseFrontmatterMap };
|
|
18
|
+
// ─── Parse Cache ──────────────────────────────────────────────────────────
|
|
19
|
+
/** Fast composite key: length + first/mid/last 100 chars. The middle sample
|
|
20
|
+
* prevents collisions when only a few characters change in the interior of
|
|
21
|
+
* a file (e.g., a checkbox [ ] → [x] that doesn't alter length or endpoints). */
|
|
22
|
+
function cacheKey(content) {
|
|
23
|
+
const len = content.length;
|
|
24
|
+
const head = content.slice(0, 100);
|
|
25
|
+
const midStart = Math.max(0, Math.floor(len / 2) - 50);
|
|
26
|
+
const mid = len > 200 ? content.slice(midStart, midStart + 100) : '';
|
|
27
|
+
const tail = len > 100 ? content.slice(-100) : '';
|
|
28
|
+
return `${len}:${head}:${mid}:${tail}`;
|
|
29
|
+
}
|
|
30
|
+
const _parseCache = new Map();
|
|
31
|
+
function cachedParse(content, tag, parseFn) {
|
|
32
|
+
const key = tag + '|' + cacheKey(content);
|
|
33
|
+
if (_parseCache.has(key))
|
|
34
|
+
return _parseCache.get(key);
|
|
35
|
+
if (_parseCache.size >= CACHE_MAX)
|
|
36
|
+
_parseCache.clear();
|
|
37
|
+
const result = parseFn(content);
|
|
38
|
+
_parseCache.set(key, result);
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
/** Clear the module-scoped parse cache. Call when files change on disk. */
|
|
42
|
+
export function clearParseCache() {
|
|
43
|
+
_parseCache.clear();
|
|
44
|
+
}
|
|
45
|
+
// ─── Helpers ───────────────────────────────────────────────────────────────
|
|
46
|
+
/** Extract the text after a heading at a given level, up to the next heading of same or higher level. */
|
|
47
|
+
export function extractSection(body, heading, level = 2) {
|
|
48
|
+
// Try native parser first for better performance on large files
|
|
49
|
+
const nativeResult = nativeExtractSection(body, heading, level);
|
|
50
|
+
if (nativeResult !== NATIVE_UNAVAILABLE)
|
|
51
|
+
return nativeResult;
|
|
52
|
+
const prefix = '#'.repeat(level) + ' ';
|
|
53
|
+
const regex = new RegExp(`^${prefix}${escapeRegex(heading)}\\s*$`, 'm');
|
|
54
|
+
const match = regex.exec(body);
|
|
55
|
+
if (!match)
|
|
56
|
+
return null;
|
|
57
|
+
const start = match.index + match[0].length;
|
|
58
|
+
const rest = body.slice(start);
|
|
59
|
+
const nextHeading = rest.match(new RegExp(`^#{1,${level}} `, 'm'));
|
|
60
|
+
const end = nextHeading ? nextHeading.index : rest.length;
|
|
61
|
+
return rest.slice(0, end).trim();
|
|
62
|
+
}
|
|
63
|
+
/** Extract all sections at a given level, returning heading → content map. */
|
|
64
|
+
export function extractAllSections(body, level = 2) {
|
|
65
|
+
const prefix = '#'.repeat(level) + ' ';
|
|
66
|
+
const regex = new RegExp(`^${prefix}(.+)$`, 'gm');
|
|
67
|
+
const sections = new Map();
|
|
68
|
+
const matches = [...body.matchAll(regex)];
|
|
69
|
+
for (let i = 0; i < matches.length; i++) {
|
|
70
|
+
const heading = matches[i][1].trim();
|
|
71
|
+
const start = matches[i].index + matches[i][0].length;
|
|
72
|
+
const end = i + 1 < matches.length ? matches[i + 1].index : body.length;
|
|
73
|
+
sections.set(heading, body.slice(start, end).trim());
|
|
74
|
+
}
|
|
75
|
+
return sections;
|
|
76
|
+
}
|
|
77
|
+
function escapeRegex(s) {
|
|
78
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
79
|
+
}
|
|
80
|
+
/** Parse bullet list items from a text block. */
|
|
81
|
+
export function parseBullets(text) {
|
|
82
|
+
return text.split('\n')
|
|
83
|
+
.map(l => l.replace(/^\s*[-*]\s+/, '').trim())
|
|
84
|
+
.filter(l => l.length > 0 && !l.startsWith('#'));
|
|
85
|
+
}
|
|
86
|
+
/** Extract key: value from bold-prefixed lines like "**Key:** Value" */
|
|
87
|
+
export function extractBoldField(text, key) {
|
|
88
|
+
const regex = new RegExp(`^\\*\\*${escapeRegex(key)}:\\*\\*\\s*(.+)$`, 'm');
|
|
89
|
+
const match = regex.exec(text);
|
|
90
|
+
return match ? match[1].trim() : null;
|
|
91
|
+
}
|
|
92
|
+
// ─── Roadmap Parser ────────────────────────────────────────────────────────
|
|
93
|
+
export function parseRoadmap(content) {
|
|
94
|
+
return cachedParse(content, 'roadmap', _parseRoadmapImpl);
|
|
95
|
+
}
|
|
96
|
+
function _parseRoadmapImpl(content) {
|
|
97
|
+
const stopTimer = debugTime("parse-roadmap");
|
|
98
|
+
// Try native parser first for better performance
|
|
99
|
+
const nativeResult = nativeParseRoadmap(content);
|
|
100
|
+
if (nativeResult) {
|
|
101
|
+
stopTimer({ native: true, slices: nativeResult.slices.length, boundaryEntries: nativeResult.boundaryMap.length });
|
|
102
|
+
debugCount("parseRoadmapCalls");
|
|
103
|
+
return nativeResult;
|
|
104
|
+
}
|
|
105
|
+
const lines = content.split('\n');
|
|
106
|
+
const h1 = lines.find(l => l.startsWith('# '));
|
|
107
|
+
const title = h1 ? h1.slice(2).trim() : '';
|
|
108
|
+
const vision = extractBoldField(content, 'Vision') || '';
|
|
109
|
+
const scSection = extractSection(content, 'Success Criteria', 2) ||
|
|
110
|
+
(() => {
|
|
111
|
+
const idx = content.indexOf('**Success Criteria:**');
|
|
112
|
+
if (idx === -1)
|
|
113
|
+
return '';
|
|
114
|
+
const rest = content.slice(idx);
|
|
115
|
+
const nextSection = rest.indexOf('\n---');
|
|
116
|
+
const block = rest.slice(0, nextSection === -1 ? undefined : nextSection);
|
|
117
|
+
const firstNewline = block.indexOf('\n');
|
|
118
|
+
return firstNewline === -1 ? '' : block.slice(firstNewline + 1);
|
|
119
|
+
})();
|
|
120
|
+
const successCriteria = scSection ? parseBullets(scSection) : [];
|
|
121
|
+
// Slices
|
|
122
|
+
const slices = parseRoadmapSlices(content);
|
|
123
|
+
// Boundary map
|
|
124
|
+
const boundaryMap = [];
|
|
125
|
+
const bmSection = extractSection(content, 'Boundary Map');
|
|
126
|
+
if (bmSection) {
|
|
127
|
+
const h3Sections = extractAllSections(bmSection, 3);
|
|
128
|
+
for (const [heading, sectionContent] of h3Sections) {
|
|
129
|
+
const arrowMatch = heading.match(/^(\S+)\s*→\s*(\S+)/);
|
|
130
|
+
if (!arrowMatch)
|
|
131
|
+
continue;
|
|
132
|
+
const fromSlice = arrowMatch[1];
|
|
133
|
+
const toSlice = arrowMatch[2];
|
|
134
|
+
let produces = '';
|
|
135
|
+
let consumes = '';
|
|
136
|
+
// Use indexOf-based parsing instead of [\s\S]*? regex to avoid
|
|
137
|
+
// catastrophic backtracking on content with code fences (#468).
|
|
138
|
+
const prodIdx = sectionContent.search(/^Produces:\s*$/m);
|
|
139
|
+
if (prodIdx !== -1) {
|
|
140
|
+
const afterProd = sectionContent.indexOf('\n', prodIdx);
|
|
141
|
+
if (afterProd !== -1) {
|
|
142
|
+
const consIdx = sectionContent.search(/^Consumes/m);
|
|
143
|
+
const endIdx = consIdx !== -1 && consIdx > afterProd ? consIdx : sectionContent.length;
|
|
144
|
+
produces = sectionContent.slice(afterProd + 1, endIdx).trim();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const consLineMatch = sectionContent.match(/^Consumes[^:]*:\s*(.+)$/m);
|
|
148
|
+
if (consLineMatch) {
|
|
149
|
+
consumes = consLineMatch[1].trim();
|
|
150
|
+
}
|
|
151
|
+
if (!consumes) {
|
|
152
|
+
const consIdx = sectionContent.search(/^Consumes[^:]*:\s*$/m);
|
|
153
|
+
if (consIdx !== -1) {
|
|
154
|
+
const afterCons = sectionContent.indexOf('\n', consIdx);
|
|
155
|
+
if (afterCons !== -1) {
|
|
156
|
+
consumes = sectionContent.slice(afterCons + 1).trim();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
boundaryMap.push({ fromSlice, toSlice, produces, consumes });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
const result = { title, vision, successCriteria, slices, boundaryMap };
|
|
164
|
+
stopTimer({ native: false, slices: slices.length, boundaryEntries: boundaryMap.length });
|
|
165
|
+
debugCount("parseRoadmapCalls");
|
|
166
|
+
return result;
|
|
167
|
+
}
|
|
168
|
+
// ─── Secrets Manifest Parser ───────────────────────────────────────────────
|
|
169
|
+
const VALID_STATUSES = new Set(['pending', 'collected', 'skipped']);
|
|
170
|
+
export function parseSecretsManifest(content) {
|
|
171
|
+
const milestone = extractBoldField(content, 'Milestone') || '';
|
|
172
|
+
const generatedAt = extractBoldField(content, 'Generated') || '';
|
|
173
|
+
const h3Sections = extractAllSections(content, 3);
|
|
174
|
+
const entries = [];
|
|
175
|
+
for (const [heading, sectionContent] of h3Sections) {
|
|
176
|
+
const key = heading.trim();
|
|
177
|
+
if (!key)
|
|
178
|
+
continue;
|
|
179
|
+
const service = extractBoldField(sectionContent, 'Service') || '';
|
|
180
|
+
const dashboardUrl = extractBoldField(sectionContent, 'Dashboard') || '';
|
|
181
|
+
const formatHint = extractBoldField(sectionContent, 'Format hint') || '';
|
|
182
|
+
const rawStatus = (extractBoldField(sectionContent, 'Status') || 'pending').toLowerCase().trim();
|
|
183
|
+
const status = VALID_STATUSES.has(rawStatus) ? rawStatus : 'pending';
|
|
184
|
+
const destination = extractBoldField(sectionContent, 'Destination') || 'dotenv';
|
|
185
|
+
// Extract numbered guidance list (lines matching "1. ...", "2. ...", etc.)
|
|
186
|
+
const guidance = [];
|
|
187
|
+
for (const line of sectionContent.split('\n')) {
|
|
188
|
+
const numMatch = line.match(/^\s*\d+\.\s+(.+)/);
|
|
189
|
+
if (numMatch) {
|
|
190
|
+
guidance.push(numMatch[1].trim());
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
entries.push({ key, service, dashboardUrl, guidance, formatHint, status, destination });
|
|
194
|
+
}
|
|
195
|
+
return { milestone, generatedAt, entries };
|
|
196
|
+
}
|
|
197
|
+
// ─── Secrets Manifest Formatter ───────────────────────────────────────────
|
|
198
|
+
export function formatSecretsManifest(manifest) {
|
|
199
|
+
const lines = [];
|
|
200
|
+
lines.push('# Secrets Manifest');
|
|
201
|
+
lines.push('');
|
|
202
|
+
lines.push(`**Milestone:** ${manifest.milestone}`);
|
|
203
|
+
lines.push(`**Generated:** ${manifest.generatedAt}`);
|
|
204
|
+
for (const entry of manifest.entries) {
|
|
205
|
+
lines.push('');
|
|
206
|
+
lines.push(`### ${entry.key}`);
|
|
207
|
+
lines.push('');
|
|
208
|
+
lines.push(`**Service:** ${entry.service}`);
|
|
209
|
+
if (entry.dashboardUrl) {
|
|
210
|
+
lines.push(`**Dashboard:** ${entry.dashboardUrl}`);
|
|
211
|
+
}
|
|
212
|
+
if (entry.formatHint) {
|
|
213
|
+
lines.push(`**Format hint:** ${entry.formatHint}`);
|
|
214
|
+
}
|
|
215
|
+
lines.push(`**Status:** ${entry.status}`);
|
|
216
|
+
lines.push(`**Destination:** ${entry.destination}`);
|
|
217
|
+
lines.push('');
|
|
218
|
+
for (let i = 0; i < entry.guidance.length; i++) {
|
|
219
|
+
lines.push(`${i + 1}. ${entry.guidance[i]}`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return lines.join('\n') + '\n';
|
|
223
|
+
}
|
|
224
|
+
// ─── Slice Plan Parser ─────────────────────────────────────────────────────
|
|
225
|
+
export function parsePlan(content) {
|
|
226
|
+
return cachedParse(content, 'plan', _parsePlanImpl);
|
|
227
|
+
}
|
|
228
|
+
function _parsePlanImpl(content) {
|
|
229
|
+
const stopTimer = debugTime("parse-plan");
|
|
230
|
+
// Try native parser first for better performance
|
|
231
|
+
const nativeResult = nativeParsePlanFile(content);
|
|
232
|
+
if (nativeResult) {
|
|
233
|
+
stopTimer({ native: true });
|
|
234
|
+
return {
|
|
235
|
+
id: nativeResult.id,
|
|
236
|
+
title: nativeResult.title,
|
|
237
|
+
goal: nativeResult.goal,
|
|
238
|
+
demo: nativeResult.demo,
|
|
239
|
+
mustHaves: nativeResult.mustHaves,
|
|
240
|
+
tasks: nativeResult.tasks.map(t => ({
|
|
241
|
+
id: t.id,
|
|
242
|
+
title: t.title,
|
|
243
|
+
description: t.description,
|
|
244
|
+
done: t.done,
|
|
245
|
+
estimate: t.estimate,
|
|
246
|
+
...(t.files.length > 0 ? { files: t.files } : {}),
|
|
247
|
+
...(t.verify ? { verify: t.verify } : {}),
|
|
248
|
+
})),
|
|
249
|
+
filesLikelyTouched: nativeResult.filesLikelyTouched,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
const lines = content.split('\n');
|
|
253
|
+
const h1 = lines.find(l => l.startsWith('# '));
|
|
254
|
+
let id = '';
|
|
255
|
+
let title = '';
|
|
256
|
+
if (h1) {
|
|
257
|
+
const match = h1.match(/^#\s+(\w+):\s+(.+)/);
|
|
258
|
+
if (match) {
|
|
259
|
+
id = match[1];
|
|
260
|
+
title = match[2].trim();
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
title = h1.slice(2).trim();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
const goal = extractBoldField(content, 'Goal') || '';
|
|
267
|
+
const demo = extractBoldField(content, 'Demo') || '';
|
|
268
|
+
const mhSection = extractSection(content, 'Must-Haves');
|
|
269
|
+
const mustHaves = mhSection ? parseBullets(mhSection) : [];
|
|
270
|
+
const tasksSection = extractSection(content, 'Tasks');
|
|
271
|
+
const tasks = [];
|
|
272
|
+
if (tasksSection) {
|
|
273
|
+
const taskLines = tasksSection.split('\n');
|
|
274
|
+
let currentTask = null;
|
|
275
|
+
for (const line of taskLines) {
|
|
276
|
+
const cbMatch = line.match(/^-\s+\[([ xX])\]\s+\*\*([\w.]+):\s+(.+?)\*\*\s*(.*)/);
|
|
277
|
+
if (cbMatch) {
|
|
278
|
+
if (currentTask)
|
|
279
|
+
tasks.push(currentTask);
|
|
280
|
+
const rest = cbMatch[4] || '';
|
|
281
|
+
const estMatch = rest.match(/`est:([^`]+)`/);
|
|
282
|
+
const estimate = estMatch ? estMatch[1] : '';
|
|
283
|
+
currentTask = {
|
|
284
|
+
id: cbMatch[2],
|
|
285
|
+
title: cbMatch[3],
|
|
286
|
+
description: '',
|
|
287
|
+
done: cbMatch[1].toLowerCase() === 'x',
|
|
288
|
+
estimate,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
else if (currentTask && line.match(/^\s*-\s+Files:\s*(.*)/)) {
|
|
292
|
+
const filesMatch = line.match(/^\s*-\s+Files:\s*(.*)/);
|
|
293
|
+
if (filesMatch) {
|
|
294
|
+
currentTask.files = filesMatch[1]
|
|
295
|
+
.split(',')
|
|
296
|
+
.map(f => f.replace(/`/g, '').trim())
|
|
297
|
+
.filter(f => f.length > 0);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
else if (currentTask && line.match(/^\s*-\s+Verify:\s*(.*)/)) {
|
|
301
|
+
const verifyMatch = line.match(/^\s*-\s+Verify:\s*(.*)/);
|
|
302
|
+
if (verifyMatch) {
|
|
303
|
+
currentTask.verify = verifyMatch[1].trim();
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
else if (currentTask && line.trim() && !line.startsWith('#')) {
|
|
307
|
+
const desc = line.trim();
|
|
308
|
+
if (desc) {
|
|
309
|
+
currentTask.description = currentTask.description
|
|
310
|
+
? currentTask.description + ' ' + desc
|
|
311
|
+
: desc;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (currentTask)
|
|
316
|
+
tasks.push(currentTask);
|
|
317
|
+
}
|
|
318
|
+
const filesSection = extractSection(content, 'Files Likely Touched');
|
|
319
|
+
const filesLikelyTouched = filesSection ? parseBullets(filesSection) : [];
|
|
320
|
+
const result = { id, title, goal, demo, mustHaves, tasks, filesLikelyTouched };
|
|
321
|
+
stopTimer({ tasks: tasks.length });
|
|
322
|
+
debugCount("parsePlanCalls");
|
|
323
|
+
return result;
|
|
324
|
+
}
|
|
325
|
+
// ─── Summary Parser ────────────────────────────────────────────────────────
|
|
326
|
+
export function parseSummary(content) {
|
|
327
|
+
return cachedParse(content, 'summary', _parseSummaryImpl);
|
|
328
|
+
}
|
|
329
|
+
function _parseSummaryImpl(content) {
|
|
330
|
+
// Try native parser first for better performance
|
|
331
|
+
const nativeResult = nativeParseSummaryFile(content);
|
|
332
|
+
if (nativeResult) {
|
|
333
|
+
const nfm = nativeResult.frontmatter;
|
|
334
|
+
return {
|
|
335
|
+
frontmatter: {
|
|
336
|
+
id: nfm.id,
|
|
337
|
+
parent: nfm.parent,
|
|
338
|
+
milestone: nfm.milestone,
|
|
339
|
+
provides: nfm.provides,
|
|
340
|
+
requires: nfm.requires,
|
|
341
|
+
affects: nfm.affects,
|
|
342
|
+
key_files: nfm.keyFiles,
|
|
343
|
+
key_decisions: nfm.keyDecisions,
|
|
344
|
+
patterns_established: nfm.patternsEstablished,
|
|
345
|
+
drill_down_paths: nfm.drillDownPaths,
|
|
346
|
+
observability_surfaces: nfm.observabilitySurfaces,
|
|
347
|
+
duration: nfm.duration,
|
|
348
|
+
verification_result: nfm.verificationResult,
|
|
349
|
+
completed_at: nfm.completedAt,
|
|
350
|
+
blocker_discovered: nfm.blockerDiscovered,
|
|
351
|
+
},
|
|
352
|
+
title: nativeResult.title,
|
|
353
|
+
oneLiner: nativeResult.oneLiner,
|
|
354
|
+
whatHappened: nativeResult.whatHappened,
|
|
355
|
+
deviations: nativeResult.deviations,
|
|
356
|
+
filesModified: nativeResult.filesModified,
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
const [fmLines, body] = splitFrontmatter(content);
|
|
360
|
+
const fm = fmLines ? parseFrontmatterMap(fmLines) : {};
|
|
361
|
+
const asStringArray = (v) => Array.isArray(v) ? v : (typeof v === 'string' && v ? [v] : []);
|
|
362
|
+
const frontmatter = {
|
|
363
|
+
id: fm.id || '',
|
|
364
|
+
parent: fm.parent || '',
|
|
365
|
+
milestone: fm.milestone || '',
|
|
366
|
+
provides: asStringArray(fm.provides),
|
|
367
|
+
requires: (fm.requires || []).map(r => ({
|
|
368
|
+
slice: r.slice || '',
|
|
369
|
+
provides: r.provides || '',
|
|
370
|
+
})),
|
|
371
|
+
affects: asStringArray(fm.affects),
|
|
372
|
+
key_files: asStringArray(fm.key_files),
|
|
373
|
+
key_decisions: asStringArray(fm.key_decisions),
|
|
374
|
+
patterns_established: asStringArray(fm.patterns_established),
|
|
375
|
+
drill_down_paths: asStringArray(fm.drill_down_paths),
|
|
376
|
+
observability_surfaces: asStringArray(fm.observability_surfaces),
|
|
377
|
+
duration: fm.duration || '',
|
|
378
|
+
verification_result: fm.verification_result || 'untested',
|
|
379
|
+
completed_at: fm.completed_at || '',
|
|
380
|
+
blocker_discovered: fm.blocker_discovered === 'true' || fm.blocker_discovered === true,
|
|
381
|
+
};
|
|
382
|
+
const bodyLines = body.split('\n');
|
|
383
|
+
const h1 = bodyLines.find(l => l.startsWith('# '));
|
|
384
|
+
const title = h1 ? h1.slice(2).trim() : '';
|
|
385
|
+
const h1Idx = bodyLines.indexOf(h1 || '');
|
|
386
|
+
let oneLiner = '';
|
|
387
|
+
for (let i = h1Idx + 1; i < bodyLines.length; i++) {
|
|
388
|
+
const line = bodyLines[i].trim();
|
|
389
|
+
if (!line)
|
|
390
|
+
continue;
|
|
391
|
+
if (line.startsWith('**') && line.endsWith('**')) {
|
|
392
|
+
oneLiner = line.slice(2, -2);
|
|
393
|
+
}
|
|
394
|
+
break;
|
|
395
|
+
}
|
|
396
|
+
const whatHappened = extractSection(body, 'What Happened') || '';
|
|
397
|
+
const deviations = extractSection(body, 'Deviations') || '';
|
|
398
|
+
const filesSection = extractSection(body, 'Files Created/Modified') || extractSection(body, 'Files Modified');
|
|
399
|
+
const filesModified = [];
|
|
400
|
+
if (filesSection) {
|
|
401
|
+
for (const line of filesSection.split('\n')) {
|
|
402
|
+
const trimmed = line.replace(/^\s*[-*]\s+/, '').trim();
|
|
403
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
404
|
+
continue;
|
|
405
|
+
const fileMatch = trimmed.match(/^`([^`]+)`\s*[—–-]\s*(.+)/);
|
|
406
|
+
if (fileMatch) {
|
|
407
|
+
filesModified.push({ path: fileMatch[1], description: fileMatch[2].trim() });
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
return { frontmatter, title, oneLiner, whatHappened, deviations, filesModified };
|
|
412
|
+
}
|
|
413
|
+
// ─── Continue Parser ───────────────────────────────────────────────────────
|
|
414
|
+
export function parseContinue(content) {
|
|
415
|
+
return cachedParse(content, 'continue', _parseContinueImpl);
|
|
416
|
+
}
|
|
417
|
+
function _parseContinueImpl(content) {
|
|
418
|
+
const [fmLines, body] = splitFrontmatter(content);
|
|
419
|
+
const fm = fmLines ? parseFrontmatterMap(fmLines) : {};
|
|
420
|
+
const frontmatter = {
|
|
421
|
+
milestone: fm.milestone || '',
|
|
422
|
+
slice: fm.slice || '',
|
|
423
|
+
task: fm.task || '',
|
|
424
|
+
step: typeof fm.step === 'string' ? parseInt(fm.step) : fm.step || 0,
|
|
425
|
+
totalSteps: typeof fm.total_steps === 'string' ? parseInt(fm.total_steps) : fm.total_steps ||
|
|
426
|
+
(typeof fm.totalSteps === 'string' ? parseInt(fm.totalSteps) : fm.totalSteps || 0),
|
|
427
|
+
status: (fm.status || 'in_progress'),
|
|
428
|
+
savedAt: fm.saved_at || fm.savedAt || '',
|
|
429
|
+
};
|
|
430
|
+
const completedWork = extractSection(body, 'Completed Work') || '';
|
|
431
|
+
const remainingWork = extractSection(body, 'Remaining Work') || '';
|
|
432
|
+
const decisions = extractSection(body, 'Decisions Made') || '';
|
|
433
|
+
const context = extractSection(body, 'Context') || '';
|
|
434
|
+
const nextAction = extractSection(body, 'Next Action') || '';
|
|
435
|
+
return { frontmatter, completedWork, remainingWork, decisions, context, nextAction };
|
|
436
|
+
}
|
|
437
|
+
// ─── Continue Formatter ────────────────────────────────────────────────────
|
|
438
|
+
function formatFrontmatter(data) {
|
|
439
|
+
const lines = ['---'];
|
|
440
|
+
for (const [key, value] of Object.entries(data)) {
|
|
441
|
+
if (value === undefined || value === null)
|
|
442
|
+
continue;
|
|
443
|
+
if (Array.isArray(value)) {
|
|
444
|
+
if (value.length === 0) {
|
|
445
|
+
lines.push(`${key}: []`);
|
|
446
|
+
}
|
|
447
|
+
else if (typeof value[0] === 'object' && value[0] !== null) {
|
|
448
|
+
lines.push(`${key}:`);
|
|
449
|
+
for (const obj of value) {
|
|
450
|
+
const entries = Object.entries(obj);
|
|
451
|
+
if (entries.length > 0) {
|
|
452
|
+
lines.push(` - ${entries[0][0]}: ${entries[0][1]}`);
|
|
453
|
+
for (let i = 1; i < entries.length; i++) {
|
|
454
|
+
lines.push(` ${entries[i][0]}: ${entries[i][1]}`);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
lines.push(`${key}:`);
|
|
461
|
+
for (const item of value) {
|
|
462
|
+
lines.push(` - ${item}`);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
lines.push(`${key}: ${value}`);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
lines.push('---');
|
|
471
|
+
return lines.join('\n');
|
|
472
|
+
}
|
|
473
|
+
export function formatContinue(cont) {
|
|
474
|
+
const fm = cont.frontmatter;
|
|
475
|
+
const fmData = {
|
|
476
|
+
milestone: fm.milestone,
|
|
477
|
+
slice: fm.slice,
|
|
478
|
+
task: fm.task,
|
|
479
|
+
step: fm.step,
|
|
480
|
+
total_steps: fm.totalSteps,
|
|
481
|
+
status: fm.status,
|
|
482
|
+
saved_at: fm.savedAt,
|
|
483
|
+
};
|
|
484
|
+
const lines = [];
|
|
485
|
+
lines.push(formatFrontmatter(fmData));
|
|
486
|
+
lines.push('');
|
|
487
|
+
lines.push('## Completed Work');
|
|
488
|
+
lines.push(cont.completedWork);
|
|
489
|
+
lines.push('');
|
|
490
|
+
lines.push('## Remaining Work');
|
|
491
|
+
lines.push(cont.remainingWork);
|
|
492
|
+
lines.push('');
|
|
493
|
+
lines.push('## Decisions Made');
|
|
494
|
+
lines.push(cont.decisions);
|
|
495
|
+
lines.push('');
|
|
496
|
+
lines.push('## Context');
|
|
497
|
+
lines.push(cont.context);
|
|
498
|
+
lines.push('');
|
|
499
|
+
lines.push('## Next Action');
|
|
500
|
+
lines.push(cont.nextAction);
|
|
501
|
+
return lines.join('\n');
|
|
502
|
+
}
|
|
503
|
+
// ─── File I/O ──────────────────────────────────────────────────────────────
|
|
504
|
+
/**
|
|
505
|
+
* Load a file from disk. Returns content string or null if file doesn't exist.
|
|
506
|
+
*/
|
|
507
|
+
export async function loadFile(path) {
|
|
508
|
+
try {
|
|
509
|
+
return await fs.readFile(path, 'utf-8');
|
|
510
|
+
}
|
|
511
|
+
catch (err) {
|
|
512
|
+
if (err.code === 'ENOENT')
|
|
513
|
+
return null;
|
|
514
|
+
throw err;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Save content to a file atomically (write to temp, then rename).
|
|
519
|
+
* Creates parent directories if needed.
|
|
520
|
+
*/
|
|
521
|
+
export async function saveFile(path, content) {
|
|
522
|
+
await atomicWriteAsync(path, content);
|
|
523
|
+
}
|
|
524
|
+
export function parseRequirementCounts(content) {
|
|
525
|
+
const counts = {
|
|
526
|
+
active: 0,
|
|
527
|
+
validated: 0,
|
|
528
|
+
deferred: 0,
|
|
529
|
+
outOfScope: 0,
|
|
530
|
+
blocked: 0,
|
|
531
|
+
total: 0,
|
|
532
|
+
};
|
|
533
|
+
if (!content)
|
|
534
|
+
return counts;
|
|
535
|
+
const sections = [
|
|
536
|
+
{ key: 'active', heading: 'Active' },
|
|
537
|
+
{ key: 'validated', heading: 'Validated' },
|
|
538
|
+
{ key: 'deferred', heading: 'Deferred' },
|
|
539
|
+
{ key: 'outOfScope', heading: 'Out of Scope' },
|
|
540
|
+
];
|
|
541
|
+
for (const section of sections) {
|
|
542
|
+
const text = extractSection(content, section.heading, 2);
|
|
543
|
+
if (!text)
|
|
544
|
+
continue;
|
|
545
|
+
const matches = text.match(/^###\s+[A-Z][\w-]*\d+\s+—/gm);
|
|
546
|
+
counts[section.key] = matches ? matches.length : 0;
|
|
547
|
+
}
|
|
548
|
+
const blockedMatches = content.match(/^-\s+Status:\s+blocked\s*$/gim);
|
|
549
|
+
counts.blocked = blockedMatches ? blockedMatches.length : 0;
|
|
550
|
+
counts.total = counts.active + counts.validated + counts.deferred + counts.outOfScope;
|
|
551
|
+
return counts;
|
|
552
|
+
}
|
|
553
|
+
// ─── Task Plan Must-Haves Parser ───────────────────────────────────────────
|
|
554
|
+
/**
|
|
555
|
+
* Parse must-have items from a task plan's `## Must-Haves` section.
|
|
556
|
+
* Returns structured items with checkbox state. Handles YAML frontmatter,
|
|
557
|
+
* all common checkbox variants (`[ ]`, `[x]`, `[X]`), plain bullets (no checkbox),
|
|
558
|
+
* and indented variants. Returns empty array when the section is missing or empty.
|
|
559
|
+
*/
|
|
560
|
+
export function parseTaskPlanMustHaves(content) {
|
|
561
|
+
const [, body] = splitFrontmatter(content);
|
|
562
|
+
const sectionText = extractSection(body, 'Must-Haves');
|
|
563
|
+
if (!sectionText)
|
|
564
|
+
return [];
|
|
565
|
+
const bullets = parseBullets(sectionText);
|
|
566
|
+
if (bullets.length === 0)
|
|
567
|
+
return [];
|
|
568
|
+
return bullets.map(line => {
|
|
569
|
+
const cbMatch = line.match(/^\[([xX ])\]\s+(.+)/);
|
|
570
|
+
if (cbMatch) {
|
|
571
|
+
return {
|
|
572
|
+
text: cbMatch[2].trim(),
|
|
573
|
+
checked: cbMatch[1].toLowerCase() === 'x',
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
// No checkbox - treat as unchecked with full line as text
|
|
577
|
+
return { text: line.trim(), checked: false };
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
// ─── Must-Have Summary Matching ────────────────────────────────────────────
|
|
581
|
+
/** Common short words to exclude from substring matching. */
|
|
582
|
+
const COMMON_WORDS = new Set([
|
|
583
|
+
'the', 'and', 'for', 'are', 'but', 'not', 'you', 'all', 'can', 'had', 'her',
|
|
584
|
+
'was', 'one', 'our', 'out', 'has', 'its', 'let', 'say', 'she', 'too', 'use',
|
|
585
|
+
'with', 'have', 'from', 'this', 'that', 'they', 'been', 'each', 'when', 'will',
|
|
586
|
+
'does', 'into', 'also', 'than', 'them', 'then', 'some', 'what', 'only', 'just',
|
|
587
|
+
'more', 'make', 'like', 'made', 'over', 'such', 'take', 'most', 'very', 'must',
|
|
588
|
+
'file', 'test', 'tests', 'task', 'new', 'add', 'added', 'existing',
|
|
589
|
+
]);
|
|
590
|
+
/**
|
|
591
|
+
* Count how many must-have items are mentioned in a summary.
|
|
592
|
+
*
|
|
593
|
+
* Matching heuristic per must-have:
|
|
594
|
+
* 1. Extract all backtick-enclosed code tokens (e.g. `inspectFoo`).
|
|
595
|
+
* If any code token appears case-insensitively in the summary, count as mentioned.
|
|
596
|
+
* 2. If no code tokens exist, check if any significant word (≥4 chars, not a common word)
|
|
597
|
+
* from the must-have text appears in the summary (case-insensitive).
|
|
598
|
+
*
|
|
599
|
+
* Returns the count of must-haves that had at least one match.
|
|
600
|
+
*/
|
|
601
|
+
export function countMustHavesMentionedInSummary(mustHaves, summaryContent) {
|
|
602
|
+
if (!summaryContent || mustHaves.length === 0)
|
|
603
|
+
return 0;
|
|
604
|
+
const summaryLower = summaryContent.toLowerCase();
|
|
605
|
+
let count = 0;
|
|
606
|
+
for (const mh of mustHaves) {
|
|
607
|
+
// Extract backtick-enclosed code tokens
|
|
608
|
+
const codeTokens = [];
|
|
609
|
+
const codeRegex = /`([^`]+)`/g;
|
|
610
|
+
let match;
|
|
611
|
+
while ((match = codeRegex.exec(mh.text)) !== null) {
|
|
612
|
+
codeTokens.push(match[1]);
|
|
613
|
+
}
|
|
614
|
+
if (codeTokens.length > 0) {
|
|
615
|
+
// Strategy 1: any code token found in summary (case-insensitive)
|
|
616
|
+
const found = codeTokens.some(token => summaryLower.includes(token.toLowerCase()));
|
|
617
|
+
if (found)
|
|
618
|
+
count++;
|
|
619
|
+
}
|
|
620
|
+
else {
|
|
621
|
+
// Strategy 2: significant substring matching
|
|
622
|
+
// Split into words, keep words ≥4 chars that aren't common
|
|
623
|
+
const words = mh.text.replace(/[^\w\s]/g, ' ').split(/\s+/).filter(w => w.length >= 4 && !COMMON_WORDS.has(w.toLowerCase()));
|
|
624
|
+
const found = words.some(word => summaryLower.includes(word.toLowerCase()));
|
|
625
|
+
if (found)
|
|
626
|
+
count++;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
return count;
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Extract the UAT type from a UAT file's raw content.
|
|
633
|
+
*
|
|
634
|
+
* UAT files have no YAML frontmatter - pass raw file content directly.
|
|
635
|
+
* Classification is leading-keyword-only: e.g. `mixed (artifact-driven + live-runtime)` → `'mixed'`.
|
|
636
|
+
*
|
|
637
|
+
* Returns `undefined` when:
|
|
638
|
+
* - the `## UAT Type` section is absent
|
|
639
|
+
* - no `UAT mode:` bullet is found in the section
|
|
640
|
+
* - the value does not start with a recognised keyword
|
|
641
|
+
*/
|
|
642
|
+
export function extractUatType(content) {
|
|
643
|
+
const sectionText = extractSection(content, 'UAT Type');
|
|
644
|
+
if (!sectionText)
|
|
645
|
+
return undefined;
|
|
646
|
+
const bullets = parseBullets(sectionText);
|
|
647
|
+
const modeBullet = bullets.find(b => b.startsWith('UAT mode:'));
|
|
648
|
+
if (!modeBullet)
|
|
649
|
+
return undefined;
|
|
650
|
+
const rawValue = modeBullet.slice('UAT mode:'.length).trim().toLowerCase();
|
|
651
|
+
if (rawValue.startsWith('artifact-driven'))
|
|
652
|
+
return 'artifact-driven';
|
|
653
|
+
if (rawValue.startsWith('live-runtime'))
|
|
654
|
+
return 'live-runtime';
|
|
655
|
+
if (rawValue.startsWith('human-experience'))
|
|
656
|
+
return 'human-experience';
|
|
657
|
+
if (rawValue.startsWith('mixed'))
|
|
658
|
+
return 'mixed';
|
|
659
|
+
return undefined;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Extract the `depends_on` list from M00x-CONTEXT.md YAML frontmatter.
|
|
663
|
+
* Returns [] when: content is null, no frontmatter block, field absent, or field is empty.
|
|
664
|
+
* Normalizes each dep ID to uppercase (e.g. 'm001' → 'M001').
|
|
665
|
+
*/
|
|
666
|
+
export function parseContextDependsOn(content) {
|
|
667
|
+
if (!content)
|
|
668
|
+
return [];
|
|
669
|
+
const [fmLines] = splitFrontmatter(content);
|
|
670
|
+
if (!fmLines)
|
|
671
|
+
return [];
|
|
672
|
+
const fm = parseFrontmatterMap(fmLines);
|
|
673
|
+
const raw = fm['depends_on'];
|
|
674
|
+
if (!Array.isArray(raw) || raw.length === 0)
|
|
675
|
+
return [];
|
|
676
|
+
return raw.map(s => String(s).trim()).filter(Boolean);
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Inline the prior milestone's SUMMARY.md as context for the current milestone's planning prompt.
|
|
680
|
+
* Returns null when: (1) `mid` is the first milestone, (2) prior milestone has no SUMMARY file.
|
|
681
|
+
*
|
|
682
|
+
* Uses the shared findMilestoneIds to scan the milestones directory.
|
|
683
|
+
*/
|
|
684
|
+
export async function inlinePriorMilestoneSummary(mid, base) {
|
|
685
|
+
const sorted = findMilestoneIds(base);
|
|
686
|
+
if (sorted.length === 0)
|
|
687
|
+
return null;
|
|
688
|
+
const idx = sorted.indexOf(mid);
|
|
689
|
+
if (idx <= 0)
|
|
690
|
+
return null;
|
|
691
|
+
const prevMid = sorted[idx - 1];
|
|
692
|
+
const absPath = resolveMilestoneFile(base, prevMid, "SUMMARY");
|
|
693
|
+
const relPath = relMilestoneFile(base, prevMid, "SUMMARY");
|
|
694
|
+
const content = absPath ? await loadFile(absPath) : null;
|
|
695
|
+
if (!content)
|
|
696
|
+
return null;
|
|
697
|
+
return `### Prior Milestone Summary\nSource: \`${relPath}\`\n\n${content.trim()}`;
|
|
698
|
+
}
|
|
699
|
+
// ─── Manifest Status ──────────────────────────────────────────────────────
|
|
700
|
+
/**
|
|
701
|
+
* Read a secrets manifest from disk and cross-reference each entry's status
|
|
702
|
+
* with the current environment (.env + process.env).
|
|
703
|
+
*
|
|
704
|
+
* Returns `null` when no manifest file exists (path resolution failure or
|
|
705
|
+
* file not on disk) - callers can distinguish "no manifest" from "empty manifest".
|
|
706
|
+
*/
|
|
707
|
+
export async function getManifestStatus(base, milestoneId) {
|
|
708
|
+
const resolvedPath = resolveMilestoneFile(base, milestoneId, 'SECRETS');
|
|
709
|
+
if (!resolvedPath)
|
|
710
|
+
return null;
|
|
711
|
+
const content = await loadFile(resolvedPath);
|
|
712
|
+
if (!content)
|
|
713
|
+
return null;
|
|
714
|
+
const manifest = parseSecretsManifest(content);
|
|
715
|
+
const keys = manifest.entries.map(e => e.key);
|
|
716
|
+
const existingKeys = await checkExistingEnvKeys(keys, resolve(base, '.env'));
|
|
717
|
+
const existingSet = new Set(existingKeys);
|
|
718
|
+
const result = {
|
|
719
|
+
pending: [],
|
|
720
|
+
collected: [],
|
|
721
|
+
skipped: [],
|
|
722
|
+
existing: [],
|
|
723
|
+
};
|
|
724
|
+
for (const entry of manifest.entries) {
|
|
725
|
+
if (existingSet.has(entry.key)) {
|
|
726
|
+
result.existing.push(entry.key);
|
|
727
|
+
}
|
|
728
|
+
else {
|
|
729
|
+
result[entry.status].push(entry.key);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
return result;
|
|
733
|
+
}
|
|
734
|
+
export async function appendOverride(basePath, change, appliedAt) {
|
|
735
|
+
const overridesPath = resolveGsdRootFile(basePath, "OVERRIDES");
|
|
736
|
+
const timestamp = new Date().toISOString();
|
|
737
|
+
const entry = [
|
|
738
|
+
`## Override: ${timestamp}`,
|
|
739
|
+
"",
|
|
740
|
+
`**Change:** ${change}`,
|
|
741
|
+
`**Scope:** active`,
|
|
742
|
+
`**Applied-at:** ${appliedAt}`,
|
|
743
|
+
"",
|
|
744
|
+
"---",
|
|
745
|
+
"",
|
|
746
|
+
].join("\n");
|
|
747
|
+
const existing = await loadFile(overridesPath);
|
|
748
|
+
if (existing) {
|
|
749
|
+
await saveFile(overridesPath, existing.trimEnd() + "\n\n" + entry);
|
|
750
|
+
}
|
|
751
|
+
else {
|
|
752
|
+
const header = [
|
|
753
|
+
"# GSD Overrides",
|
|
754
|
+
"",
|
|
755
|
+
"User-issued overrides that supersede plan document content.",
|
|
756
|
+
"",
|
|
757
|
+
"---",
|
|
758
|
+
"",
|
|
759
|
+
].join("\n");
|
|
760
|
+
await saveFile(overridesPath, header + entry);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
export async function appendKnowledge(basePath, type, entry, scope) {
|
|
764
|
+
const knowledgePath = resolveGsdRootFile(basePath, "KNOWLEDGE");
|
|
765
|
+
const existing = await loadFile(knowledgePath);
|
|
766
|
+
if (existing) {
|
|
767
|
+
// Find the next ID for this type
|
|
768
|
+
const prefix = type === "rule" ? "K" : type === "pattern" ? "P" : "L";
|
|
769
|
+
const idPattern = new RegExp(`^\\| ${prefix}(\\d+)`, "gm");
|
|
770
|
+
let maxId = 0;
|
|
771
|
+
let match;
|
|
772
|
+
while ((match = idPattern.exec(existing)) !== null) {
|
|
773
|
+
const num = parseInt(match[1], 10);
|
|
774
|
+
if (num > maxId)
|
|
775
|
+
maxId = num;
|
|
776
|
+
}
|
|
777
|
+
const nextId = `${prefix}${String(maxId + 1).padStart(3, "0")}`;
|
|
778
|
+
// Build the table row
|
|
779
|
+
let row;
|
|
780
|
+
if (type === "rule") {
|
|
781
|
+
row = `| ${nextId} | ${scope} | ${entry} | — | manual |`;
|
|
782
|
+
}
|
|
783
|
+
else if (type === "pattern") {
|
|
784
|
+
row = `| ${nextId} | ${entry} | — | ${scope} |`;
|
|
785
|
+
}
|
|
786
|
+
else {
|
|
787
|
+
row = `| ${nextId} | ${entry} | — | — | ${scope} |`;
|
|
788
|
+
}
|
|
789
|
+
// Find the right section and append after the table header
|
|
790
|
+
const sectionHeading = type === "rule" ? "## Rules" : type === "pattern" ? "## Patterns" : "## Lessons Learned";
|
|
791
|
+
const sectionIdx = existing.indexOf(sectionHeading);
|
|
792
|
+
if (sectionIdx !== -1) {
|
|
793
|
+
// Find the end of the table header row (the |---|...| line)
|
|
794
|
+
const afterHeading = existing.indexOf("\n", sectionIdx);
|
|
795
|
+
// Find the next section or end
|
|
796
|
+
const nextSection = existing.indexOf("\n## ", afterHeading + 1);
|
|
797
|
+
const insertPoint = nextSection !== -1 ? nextSection : existing.length;
|
|
798
|
+
// Insert row before the next section (or at end)
|
|
799
|
+
const before = existing.slice(0, insertPoint).trimEnd();
|
|
800
|
+
const after = existing.slice(insertPoint);
|
|
801
|
+
await saveFile(knowledgePath, before + "\n" + row + "\n" + after);
|
|
802
|
+
}
|
|
803
|
+
else {
|
|
804
|
+
// Section not found — append at end
|
|
805
|
+
await saveFile(knowledgePath, existing.trimEnd() + "\n\n" + row + "\n");
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
else {
|
|
809
|
+
// Create file from scratch with template header
|
|
810
|
+
const header = [
|
|
811
|
+
"# Project Knowledge",
|
|
812
|
+
"",
|
|
813
|
+
"Append-only register of project-specific rules, patterns, and lessons learned.",
|
|
814
|
+
"Agents read this before every unit. Add entries when you discover something worth remembering.",
|
|
815
|
+
"",
|
|
816
|
+
].join("\n");
|
|
817
|
+
let content;
|
|
818
|
+
if (type === "rule") {
|
|
819
|
+
content = header + [
|
|
820
|
+
"## Rules",
|
|
821
|
+
"",
|
|
822
|
+
"| # | Scope | Rule | Why | Added |",
|
|
823
|
+
"|---|-------|------|-----|-------|",
|
|
824
|
+
`| K001 | ${scope} | ${entry} | — | manual |`,
|
|
825
|
+
"",
|
|
826
|
+
"## Patterns",
|
|
827
|
+
"",
|
|
828
|
+
"| # | Pattern | Where | Notes |",
|
|
829
|
+
"|---|---------|-------|-------|",
|
|
830
|
+
"",
|
|
831
|
+
"## Lessons Learned",
|
|
832
|
+
"",
|
|
833
|
+
"| # | What Happened | Root Cause | Fix | Scope |",
|
|
834
|
+
"|---|--------------|------------|-----|-------|",
|
|
835
|
+
"",
|
|
836
|
+
].join("\n");
|
|
837
|
+
}
|
|
838
|
+
else if (type === "pattern") {
|
|
839
|
+
content = header + [
|
|
840
|
+
"## Rules",
|
|
841
|
+
"",
|
|
842
|
+
"| # | Scope | Rule | Why | Added |",
|
|
843
|
+
"|---|-------|------|-----|-------|",
|
|
844
|
+
"",
|
|
845
|
+
"## Patterns",
|
|
846
|
+
"",
|
|
847
|
+
"| # | Pattern | Where | Notes |",
|
|
848
|
+
"|---|---------|-------|-------|",
|
|
849
|
+
`| P001 | ${entry} | — | ${scope} |`,
|
|
850
|
+
"",
|
|
851
|
+
"## Lessons Learned",
|
|
852
|
+
"",
|
|
853
|
+
"| # | What Happened | Root Cause | Fix | Scope |",
|
|
854
|
+
"|---|--------------|------------|-----|-------|",
|
|
855
|
+
"",
|
|
856
|
+
].join("\n");
|
|
857
|
+
}
|
|
858
|
+
else {
|
|
859
|
+
content = header + [
|
|
860
|
+
"## Rules",
|
|
861
|
+
"",
|
|
862
|
+
"| # | Scope | Rule | Why | Added |",
|
|
863
|
+
"|---|-------|------|-----|-------|",
|
|
864
|
+
"",
|
|
865
|
+
"## Patterns",
|
|
866
|
+
"",
|
|
867
|
+
"| # | Pattern | Where | Notes |",
|
|
868
|
+
"|---|---------|-------|-------|",
|
|
869
|
+
"",
|
|
870
|
+
"## Lessons Learned",
|
|
871
|
+
"",
|
|
872
|
+
"| # | What Happened | Root Cause | Fix | Scope |",
|
|
873
|
+
"|---|--------------|------------|-----|-------|",
|
|
874
|
+
`| L001 | ${entry} | — | — | ${scope} |`,
|
|
875
|
+
"",
|
|
876
|
+
].join("\n");
|
|
877
|
+
}
|
|
878
|
+
await saveFile(knowledgePath, content);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
export async function loadActiveOverrides(basePath) {
|
|
882
|
+
const overridesPath = resolveGsdRootFile(basePath, "OVERRIDES");
|
|
883
|
+
const content = await loadFile(overridesPath);
|
|
884
|
+
if (!content)
|
|
885
|
+
return [];
|
|
886
|
+
return parseOverrides(content).filter(o => o.scope === "active");
|
|
887
|
+
}
|
|
888
|
+
export function parseOverrides(content) {
|
|
889
|
+
const overrides = [];
|
|
890
|
+
const blocks = content.split(/^## Override: /m).slice(1);
|
|
891
|
+
for (const block of blocks) {
|
|
892
|
+
const lines = block.split("\n");
|
|
893
|
+
const timestamp = lines[0]?.trim() ?? "";
|
|
894
|
+
let change = "";
|
|
895
|
+
let scope = "active";
|
|
896
|
+
let appliedAt = "";
|
|
897
|
+
for (const line of lines) {
|
|
898
|
+
const changeMatch = line.match(/^\*\*Change:\*\*\s*(.+)$/);
|
|
899
|
+
if (changeMatch)
|
|
900
|
+
change = changeMatch[1].trim();
|
|
901
|
+
const scopeMatch = line.match(/^\*\*Scope:\*\*\s*(.+)$/);
|
|
902
|
+
if (scopeMatch)
|
|
903
|
+
scope = scopeMatch[1].trim();
|
|
904
|
+
const appliedMatch = line.match(/^\*\*Applied-at:\*\*\s*(.+)$/);
|
|
905
|
+
if (appliedMatch)
|
|
906
|
+
appliedAt = appliedMatch[1].trim();
|
|
907
|
+
}
|
|
908
|
+
if (change) {
|
|
909
|
+
overrides.push({ timestamp, change, scope, appliedAt });
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
return overrides;
|
|
913
|
+
}
|
|
914
|
+
export function formatOverridesSection(overrides) {
|
|
915
|
+
if (overrides.length === 0)
|
|
916
|
+
return "";
|
|
917
|
+
const entries = overrides.map((o, i) => [
|
|
918
|
+
`${i + 1}. **${o.change}**`,
|
|
919
|
+
` _Issued: ${o.timestamp} during ${o.appliedAt}_`,
|
|
920
|
+
].join("\n")).join("\n");
|
|
921
|
+
return [
|
|
922
|
+
"## Active Overrides (supersede plan content)",
|
|
923
|
+
"",
|
|
924
|
+
"The following overrides were issued by the user and supersede any conflicting content in plan documents below. Follow these overrides even if they contradict the inlined task plan.",
|
|
925
|
+
"",
|
|
926
|
+
entries,
|
|
927
|
+
"",
|
|
928
|
+
].join("\n");
|
|
929
|
+
}
|
|
930
|
+
export async function resolveAllOverrides(basePath) {
|
|
931
|
+
const overridesPath = resolveGsdRootFile(basePath, "OVERRIDES");
|
|
932
|
+
const content = await loadFile(overridesPath);
|
|
933
|
+
if (!content)
|
|
934
|
+
return;
|
|
935
|
+
const updated = content.replace(/\*\*Scope:\*\* active/g, "**Scope:** resolved");
|
|
936
|
+
await saveFile(overridesPath, updated);
|
|
937
|
+
}
|