@jokerized/getresearchdone 0.4.1
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/.claude-plugin/plugin.json +103 -0
- package/README.md +211 -0
- package/agents/grd-baseline-assessor.md +684 -0
- package/agents/grd-code-reviewer.md +300 -0
- package/agents/grd-codebase-mapper.md +355 -0
- package/agents/grd-critique-agent.md +119 -0
- package/agents/grd-debugger.md +519 -0
- package/agents/grd-deep-diver.md +737 -0
- package/agents/grd-eval-planner.md +913 -0
- package/agents/grd-eval-reporter.md +717 -0
- package/agents/grd-executor.md +683 -0
- package/agents/grd-feasibility-analyst.md +624 -0
- package/agents/grd-integration-checker.md +367 -0
- package/agents/grd-knowledge-miner.md +81 -0
- package/agents/grd-migrator.md +88 -0
- package/agents/grd-phase-researcher.md +697 -0
- package/agents/grd-plan-checker.md +443 -0
- package/agents/grd-planner.md +1532 -0
- package/agents/grd-product-owner.md +562 -0
- package/agents/grd-project-researcher.md +513 -0
- package/agents/grd-research-synthesizer.md +273 -0
- package/agents/grd-roadmapper.md +798 -0
- package/agents/grd-surveyor.md +566 -0
- package/agents/grd-verifier.md +893 -0
- package/bin/gd.js +4 -0
- package/bin/gd.ts +227 -0
- package/bin/grd-manifest.js +4 -0
- package/bin/grd-manifest.ts +286 -0
- package/bin/grd-mcp-server.js +4 -0
- package/bin/grd-mcp-server.ts +124 -0
- package/bin/grd-tools.js +4 -0
- package/bin/grd-tools.ts +2471 -0
- package/bin/postinstall.js +4 -0
- package/bin/postinstall.ts +80 -0
- package/commands/add-phase.md +123 -0
- package/commands/add-todo.md +87 -0
- package/commands/assess-baseline.md +289 -0
- package/commands/autopilot.md +100 -0
- package/commands/autoplan.md +55 -0
- package/commands/check-todos.md +87 -0
- package/commands/compare-methods.md +262 -0
- package/commands/complete-milestone.md +225 -0
- package/commands/debug.md +372 -0
- package/commands/deep-dive.md +288 -0
- package/commands/discover.md +281 -0
- package/commands/discuss-phase.md +188 -0
- package/commands/discuss.md +55 -0
- package/commands/eval-report.md +310 -0
- package/commands/evolve.md +79 -0
- package/commands/execute-phase.md +1017 -0
- package/commands/feasibility.md +292 -0
- package/commands/help.md +407 -0
- package/commands/init.md +1508 -0
- package/commands/insert-phase.md +113 -0
- package/commands/iterate.md +327 -0
- package/commands/list-phase-assumptions.md +217 -0
- package/commands/long-term-roadmap.md +202 -0
- package/commands/map-codebase.md +111 -0
- package/commands/migrate.md +159 -0
- package/commands/new-milestone.md +169 -0
- package/commands/pause-work.md +83 -0
- package/commands/plan-milestone-gaps.md +373 -0
- package/commands/plan-phase.md +655 -0
- package/commands/principles.md +328 -0
- package/commands/product-plan.md +319 -0
- package/commands/progress.md +481 -0
- package/commands/quick.md +167 -0
- package/commands/reapply-patches.md +154 -0
- package/commands/remove-phase.md +97 -0
- package/commands/requirement.md +96 -0
- package/commands/resume-project.md +113 -0
- package/commands/settings.md +1144 -0
- package/commands/survey.md +242 -0
- package/commands/sync.md +246 -0
- package/commands/tracker-setup.md +322 -0
- package/commands/update.md +202 -0
- package/commands/verify-phase.md +335 -0
- package/commands/verify-work.md +701 -0
- package/commands/wireup.md +29 -0
- package/dist/bin/gd.d.ts +3 -0
- package/dist/bin/gd.d.ts.map +1 -0
- package/dist/bin/gd.js +178 -0
- package/dist/bin/gd.js.map +1 -0
- package/dist/bin/grd-manifest.d.ts +3 -0
- package/dist/bin/grd-manifest.d.ts.map +1 -0
- package/dist/bin/grd-manifest.js +202 -0
- package/dist/bin/grd-manifest.js.map +1 -0
- package/dist/bin/grd-mcp-server.d.ts +3 -0
- package/dist/bin/grd-mcp-server.d.ts.map +1 -0
- package/dist/bin/grd-mcp-server.js +71 -0
- package/dist/bin/grd-mcp-server.js.map +1 -0
- package/dist/bin/grd-tools.d.ts +3 -0
- package/dist/bin/grd-tools.d.ts.map +1 -0
- package/dist/bin/grd-tools.js +1680 -0
- package/dist/bin/grd-tools.js.map +1 -0
- package/dist/bin/postinstall.d.ts +3 -0
- package/dist/bin/postinstall.d.ts.map +1 -0
- package/dist/bin/postinstall.js +61 -0
- package/dist/bin/postinstall.js.map +1 -0
- package/dist/lib/autopilot-milestone.d.ts +2 -0
- package/dist/lib/autopilot-milestone.d.ts.map +1 -0
- package/dist/lib/autopilot-milestone.js +94 -0
- package/dist/lib/autopilot-milestone.js.map +1 -0
- package/dist/lib/autopilot-pipeline.d.ts +2 -0
- package/dist/lib/autopilot-pipeline.d.ts.map +1 -0
- package/dist/lib/autopilot-pipeline.js +830 -0
- package/dist/lib/autopilot-pipeline.js.map +1 -0
- package/dist/lib/autopilot-waves.d.ts +2 -0
- package/dist/lib/autopilot-waves.d.ts.map +1 -0
- package/dist/lib/autopilot-waves.js +266 -0
- package/dist/lib/autopilot-waves.js.map +1 -0
- package/dist/lib/autopilot.d.ts +2 -0
- package/dist/lib/autopilot.d.ts.map +1 -0
- package/dist/lib/autopilot.js +1314 -0
- package/dist/lib/autopilot.js.map +1 -0
- package/dist/lib/autoplan.d.ts +2 -0
- package/dist/lib/autoplan.d.ts.map +1 -0
- package/dist/lib/autoplan.js +198 -0
- package/dist/lib/autoplan.js.map +1 -0
- package/dist/lib/autoresearch.d.ts +2 -0
- package/dist/lib/autoresearch.d.ts.map +1 -0
- package/dist/lib/autoresearch.js +626 -0
- package/dist/lib/autoresearch.js.map +1 -0
- package/dist/lib/backend.d.ts +2 -0
- package/dist/lib/backend.d.ts.map +1 -0
- package/dist/lib/backend.js +1036 -0
- package/dist/lib/backend.js.map +1 -0
- package/dist/lib/benchmark.d.ts +99 -0
- package/dist/lib/benchmark.d.ts.map +1 -0
- package/dist/lib/benchmark.js +278 -0
- package/dist/lib/benchmark.js.map +1 -0
- package/dist/lib/citations.d.ts +2 -0
- package/dist/lib/citations.d.ts.map +1 -0
- package/dist/lib/citations.js +642 -0
- package/dist/lib/citations.js.map +1 -0
- package/dist/lib/cleanup.d.ts +2 -0
- package/dist/lib/cleanup.d.ts.map +1 -0
- package/dist/lib/cleanup.js +1222 -0
- package/dist/lib/cleanup.js.map +1 -0
- package/dist/lib/cli/adapters.d.ts +10 -0
- package/dist/lib/cli/adapters.d.ts.map +1 -0
- package/dist/lib/cli/adapters.js +27 -0
- package/dist/lib/cli/adapters.js.map +1 -0
- package/dist/lib/cli/agent.d.ts +17 -0
- package/dist/lib/cli/agent.d.ts.map +1 -0
- package/dist/lib/cli/agent.js +53 -0
- package/dist/lib/cli/agent.js.map +1 -0
- package/dist/lib/cli/index.d.ts +21 -0
- package/dist/lib/cli/index.d.ts.map +1 -0
- package/dist/lib/cli/index.js +264 -0
- package/dist/lib/cli/index.js.map +1 -0
- package/dist/lib/cli/output.d.ts +20 -0
- package/dist/lib/cli/output.d.ts.map +1 -0
- package/dist/lib/cli/output.js +22 -0
- package/dist/lib/cli/output.js.map +1 -0
- package/dist/lib/cli/scan-dispatch.d.ts +9 -0
- package/dist/lib/cli/scan-dispatch.d.ts.map +1 -0
- package/dist/lib/cli/scan-dispatch.js +107 -0
- package/dist/lib/cli/scan-dispatch.js.map +1 -0
- package/dist/lib/cli/tools.d.ts +16 -0
- package/dist/lib/cli/tools.d.ts.map +1 -0
- package/dist/lib/cli/tools.js +168 -0
- package/dist/lib/cli/tools.js.map +1 -0
- package/dist/lib/commands/_dashboard-parsers.d.ts +2 -0
- package/dist/lib/commands/_dashboard-parsers.d.ts.map +1 -0
- package/dist/lib/commands/_dashboard-parsers.js +192 -0
- package/dist/lib/commands/_dashboard-parsers.js.map +1 -0
- package/dist/lib/commands/analysis.d.ts +2 -0
- package/dist/lib/commands/analysis.d.ts.map +1 -0
- package/dist/lib/commands/analysis.js +1418 -0
- package/dist/lib/commands/analysis.js.map +1 -0
- package/dist/lib/commands/assumptions.d.ts +2 -0
- package/dist/lib/commands/assumptions.d.ts.map +1 -0
- package/dist/lib/commands/assumptions.js +166 -0
- package/dist/lib/commands/assumptions.js.map +1 -0
- package/dist/lib/commands/blame.d.ts +2 -0
- package/dist/lib/commands/blame.d.ts.map +1 -0
- package/dist/lib/commands/blame.js +133 -0
- package/dist/lib/commands/blame.js.map +1 -0
- package/dist/lib/commands/budget.d.ts +2 -0
- package/dist/lib/commands/budget.d.ts.map +1 -0
- package/dist/lib/commands/budget.js +100 -0
- package/dist/lib/commands/budget.js.map +1 -0
- package/dist/lib/commands/check-plans.d.ts +2 -0
- package/dist/lib/commands/check-plans.d.ts.map +1 -0
- package/dist/lib/commands/check-plans.js +190 -0
- package/dist/lib/commands/check-plans.js.map +1 -0
- package/dist/lib/commands/config.d.ts +2 -0
- package/dist/lib/commands/config.d.ts.map +1 -0
- package/dist/lib/commands/config.js +188 -0
- package/dist/lib/commands/config.js.map +1 -0
- package/dist/lib/commands/dashboard.d.ts +2 -0
- package/dist/lib/commands/dashboard.d.ts.map +1 -0
- package/dist/lib/commands/dashboard.js +466 -0
- package/dist/lib/commands/dashboard.js.map +1 -0
- package/dist/lib/commands/estimate.d.ts +2 -0
- package/dist/lib/commands/estimate.d.ts.map +1 -0
- package/dist/lib/commands/estimate.js +148 -0
- package/dist/lib/commands/estimate.js.map +1 -0
- package/dist/lib/commands/eval-diff.d.ts +2 -0
- package/dist/lib/commands/eval-diff.d.ts.map +1 -0
- package/dist/lib/commands/eval-diff.js +213 -0
- package/dist/lib/commands/eval-diff.js.map +1 -0
- package/dist/lib/commands/freshness.d.ts +2 -0
- package/dist/lib/commands/freshness.d.ts.map +1 -0
- package/dist/lib/commands/freshness.js +163 -0
- package/dist/lib/commands/freshness.js.map +1 -0
- package/dist/lib/commands/health.d.ts +2 -0
- package/dist/lib/commands/health.d.ts.map +1 -0
- package/dist/lib/commands/health.js +435 -0
- package/dist/lib/commands/health.js.map +1 -0
- package/dist/lib/commands/index.d.ts +2 -0
- package/dist/lib/commands/index.d.ts.map +1 -0
- package/dist/lib/commands/index.js +128 -0
- package/dist/lib/commands/index.js.map +1 -0
- package/dist/lib/commands/install.d.ts +56 -0
- package/dist/lib/commands/install.d.ts.map +1 -0
- package/dist/lib/commands/install.js +214 -0
- package/dist/lib/commands/install.js.map +1 -0
- package/dist/lib/commands/knowhow-aggregator.d.ts +2 -0
- package/dist/lib/commands/knowhow-aggregator.d.ts.map +1 -0
- package/dist/lib/commands/knowhow-aggregator.js +279 -0
- package/dist/lib/commands/knowhow-aggregator.js.map +1 -0
- package/dist/lib/commands/knowledge-search.d.ts +2 -0
- package/dist/lib/commands/knowledge-search.d.ts.map +1 -0
- package/dist/lib/commands/knowledge-search.js +113 -0
- package/dist/lib/commands/knowledge-search.js.map +1 -0
- package/dist/lib/commands/long-term-roadmap.d.ts +2 -0
- package/dist/lib/commands/long-term-roadmap.d.ts.map +1 -0
- package/dist/lib/commands/long-term-roadmap.js +272 -0
- package/dist/lib/commands/long-term-roadmap.js.map +1 -0
- package/dist/lib/commands/patterns.d.ts +91 -0
- package/dist/lib/commands/patterns.d.ts.map +1 -0
- package/dist/lib/commands/patterns.js +391 -0
- package/dist/lib/commands/patterns.js.map +1 -0
- package/dist/lib/commands/phase-info.d.ts +2 -0
- package/dist/lib/commands/phase-info.d.ts.map +1 -0
- package/dist/lib/commands/phase-info.js +509 -0
- package/dist/lib/commands/phase-info.js.map +1 -0
- package/dist/lib/commands/plan-lint.d.ts +56 -0
- package/dist/lib/commands/plan-lint.d.ts.map +1 -0
- package/dist/lib/commands/plan-lint.js +481 -0
- package/dist/lib/commands/plan-lint.js.map +1 -0
- package/dist/lib/commands/plan-phase.d.ts +53 -0
- package/dist/lib/commands/plan-phase.d.ts.map +1 -0
- package/dist/lib/commands/plan-phase.js +288 -0
- package/dist/lib/commands/plan-phase.js.map +1 -0
- package/dist/lib/commands/progress.d.ts +2 -0
- package/dist/lib/commands/progress.d.ts.map +1 -0
- package/dist/lib/commands/progress.js +266 -0
- package/dist/lib/commands/progress.js.map +1 -0
- package/dist/lib/commands/quality.d.ts +2 -0
- package/dist/lib/commands/quality.d.ts.map +1 -0
- package/dist/lib/commands/quality.js +80 -0
- package/dist/lib/commands/quality.js.map +1 -0
- package/dist/lib/commands/rollback.d.ts +2 -0
- package/dist/lib/commands/rollback.d.ts.map +1 -0
- package/dist/lib/commands/rollback.js +145 -0
- package/dist/lib/commands/rollback.js.map +1 -0
- package/dist/lib/commands/scan.d.ts +25 -0
- package/dist/lib/commands/scan.d.ts.map +1 -0
- package/dist/lib/commands/scan.js +28 -0
- package/dist/lib/commands/scan.js.map +1 -0
- package/dist/lib/commands/search.d.ts +2 -0
- package/dist/lib/commands/search.d.ts.map +1 -0
- package/dist/lib/commands/search.js +212 -0
- package/dist/lib/commands/search.js.map +1 -0
- package/dist/lib/commands/select-candidate.d.ts +128 -0
- package/dist/lib/commands/select-candidate.d.ts.map +1 -0
- package/dist/lib/commands/select-candidate.js +518 -0
- package/dist/lib/commands/select-candidate.js.map +1 -0
- package/dist/lib/commands/singularity.d.ts +2 -0
- package/dist/lib/commands/singularity.d.ts.map +1 -0
- package/dist/lib/commands/singularity.js +185 -0
- package/dist/lib/commands/singularity.js.map +1 -0
- package/dist/lib/commands/slug-timestamp.d.ts +2 -0
- package/dist/lib/commands/slug-timestamp.d.ts.map +1 -0
- package/dist/lib/commands/slug-timestamp.js +54 -0
- package/dist/lib/commands/slug-timestamp.js.map +1 -0
- package/dist/lib/commands/tail.d.ts +2 -0
- package/dist/lib/commands/tail.d.ts.map +1 -0
- package/dist/lib/commands/tail.js +100 -0
- package/dist/lib/commands/tail.js.map +1 -0
- package/dist/lib/commands/todo.d.ts +2 -0
- package/dist/lib/commands/todo.d.ts.map +1 -0
- package/dist/lib/commands/todo.js +200 -0
- package/dist/lib/commands/todo.js.map +1 -0
- package/dist/lib/commands/watch.d.ts +2 -0
- package/dist/lib/commands/watch.d.ts.map +1 -0
- package/dist/lib/commands/watch.js +72 -0
- package/dist/lib/commands/watch.js.map +1 -0
- package/dist/lib/complexity.d.ts +55 -0
- package/dist/lib/complexity.d.ts.map +1 -0
- package/dist/lib/complexity.js +80 -0
- package/dist/lib/complexity.js.map +1 -0
- package/dist/lib/context/agents.d.ts +2 -0
- package/dist/lib/context/agents.d.ts.map +1 -0
- package/dist/lib/context/agents.js +344 -0
- package/dist/lib/context/agents.js.map +1 -0
- package/dist/lib/context/base.d.ts +2 -0
- package/dist/lib/context/base.d.ts.map +1 -0
- package/dist/lib/context/base.js +81 -0
- package/dist/lib/context/base.js.map +1 -0
- package/dist/lib/context/execute.d.ts +2 -0
- package/dist/lib/context/execute.d.ts.map +1 -0
- package/dist/lib/context/execute.js +753 -0
- package/dist/lib/context/execute.js.map +1 -0
- package/dist/lib/context/index.d.ts +2 -0
- package/dist/lib/context/index.d.ts.map +1 -0
- package/dist/lib/context/index.js +88 -0
- package/dist/lib/context/index.js.map +1 -0
- package/dist/lib/context/progress.d.ts +2 -0
- package/dist/lib/context/progress.d.ts.map +1 -0
- package/dist/lib/context/progress.js +178 -0
- package/dist/lib/context/progress.js.map +1 -0
- package/dist/lib/context/project.d.ts +2 -0
- package/dist/lib/context/project.d.ts.map +1 -0
- package/dist/lib/context/project.js +413 -0
- package/dist/lib/context/project.js.map +1 -0
- package/dist/lib/context/research.d.ts +2 -0
- package/dist/lib/context/research.d.ts.map +1 -0
- package/dist/lib/context/research.js +466 -0
- package/dist/lib/context/research.js.map +1 -0
- package/dist/lib/dead-ends.d.ts +28 -0
- package/dist/lib/dead-ends.d.ts.map +1 -0
- package/dist/lib/dead-ends.js +451 -0
- package/dist/lib/dead-ends.js.map +1 -0
- package/dist/lib/deps.d.ts +2 -0
- package/dist/lib/deps.d.ts.map +1 -0
- package/dist/lib/deps.js +630 -0
- package/dist/lib/deps.js.map +1 -0
- package/dist/lib/discussion.d.ts +2 -0
- package/dist/lib/discussion.d.ts.map +1 -0
- package/dist/lib/discussion.js +1041 -0
- package/dist/lib/discussion.js.map +1 -0
- package/dist/lib/drift.d.ts +36 -0
- package/dist/lib/drift.d.ts.map +1 -0
- package/dist/lib/drift.js +481 -0
- package/dist/lib/drift.js.map +1 -0
- package/dist/lib/evolve/_dimensions-features.d.ts +2 -0
- package/dist/lib/evolve/_dimensions-features.d.ts.map +1 -0
- package/dist/lib/evolve/_dimensions-features.js +369 -0
- package/dist/lib/evolve/_dimensions-features.js.map +1 -0
- package/dist/lib/evolve/_dimensions.d.ts +2 -0
- package/dist/lib/evolve/_dimensions.d.ts.map +1 -0
- package/dist/lib/evolve/_dimensions.js +358 -0
- package/dist/lib/evolve/_dimensions.js.map +1 -0
- package/dist/lib/evolve/_product-ideation.d.ts +2 -0
- package/dist/lib/evolve/_product-ideation.d.ts.map +1 -0
- package/dist/lib/evolve/_product-ideation.js +281 -0
- package/dist/lib/evolve/_product-ideation.js.map +1 -0
- package/dist/lib/evolve/_prompts.d.ts +2 -0
- package/dist/lib/evolve/_prompts.d.ts.map +1 -0
- package/dist/lib/evolve/_prompts.js +153 -0
- package/dist/lib/evolve/_prompts.js.map +1 -0
- package/dist/lib/evolve/cli.d.ts +2 -0
- package/dist/lib/evolve/cli.d.ts.map +1 -0
- package/dist/lib/evolve/cli.js +224 -0
- package/dist/lib/evolve/cli.js.map +1 -0
- package/dist/lib/evolve/discovery.d.ts +2 -0
- package/dist/lib/evolve/discovery.d.ts.map +1 -0
- package/dist/lib/evolve/discovery.js +391 -0
- package/dist/lib/evolve/discovery.js.map +1 -0
- package/dist/lib/evolve/index.d.ts +2 -0
- package/dist/lib/evolve/index.d.ts.map +1 -0
- package/dist/lib/evolve/index.js +88 -0
- package/dist/lib/evolve/index.js.map +1 -0
- package/dist/lib/evolve/orchestrator.d.ts +2 -0
- package/dist/lib/evolve/orchestrator.d.ts.map +1 -0
- package/dist/lib/evolve/orchestrator.js +851 -0
- package/dist/lib/evolve/orchestrator.js.map +1 -0
- package/dist/lib/evolve/scoring.d.ts +2 -0
- package/dist/lib/evolve/scoring.d.ts.map +1 -0
- package/dist/lib/evolve/scoring.js +118 -0
- package/dist/lib/evolve/scoring.js.map +1 -0
- package/dist/lib/evolve/state.d.ts +2 -0
- package/dist/lib/evolve/state.d.ts.map +1 -0
- package/dist/lib/evolve/state.js +264 -0
- package/dist/lib/evolve/state.js.map +1 -0
- package/dist/lib/evolve/types.d.ts +249 -0
- package/dist/lib/evolve/types.d.ts.map +1 -0
- package/dist/lib/evolve/types.js +3 -0
- package/dist/lib/evolve/types.js.map +1 -0
- package/dist/lib/frontmatter.d.ts +2 -0
- package/dist/lib/frontmatter.d.ts.map +1 -0
- package/dist/lib/frontmatter.js +513 -0
- package/dist/lib/frontmatter.js.map +1 -0
- package/dist/lib/gates.d.ts +2 -0
- package/dist/lib/gates.d.ts.map +1 -0
- package/dist/lib/gates.js +578 -0
- package/dist/lib/gates.js.map +1 -0
- package/dist/lib/genome.d.ts +10 -0
- package/dist/lib/genome.d.ts.map +1 -0
- package/dist/lib/genome.js +368 -0
- package/dist/lib/genome.js.map +1 -0
- package/dist/lib/got.d.ts +2 -0
- package/dist/lib/got.d.ts.map +1 -0
- package/dist/lib/got.js +280 -0
- package/dist/lib/got.js.map +1 -0
- package/dist/lib/invariants.d.ts +2 -0
- package/dist/lib/invariants.d.ts.map +1 -0
- package/dist/lib/invariants.js +298 -0
- package/dist/lib/invariants.js.map +1 -0
- package/dist/lib/knowledge.d.ts +2 -0
- package/dist/lib/knowledge.d.ts.map +1 -0
- package/dist/lib/knowledge.js +658 -0
- package/dist/lib/knowledge.js.map +1 -0
- package/dist/lib/long-term-roadmap.d.ts +2 -0
- package/dist/lib/long-term-roadmap.d.ts.map +1 -0
- package/dist/lib/long-term-roadmap.js +602 -0
- package/dist/lib/long-term-roadmap.js.map +1 -0
- package/dist/lib/markdown-split.d.ts +2 -0
- package/dist/lib/markdown-split.d.ts.map +1 -0
- package/dist/lib/markdown-split.js +199 -0
- package/dist/lib/markdown-split.js.map +1 -0
- package/dist/lib/mcp-server.d.ts +2 -0
- package/dist/lib/mcp-server.d.ts.map +1 -0
- package/dist/lib/mcp-server.js +2424 -0
- package/dist/lib/mcp-server.js.map +1 -0
- package/dist/lib/metrics.d.ts +16 -0
- package/dist/lib/metrics.d.ts.map +1 -0
- package/dist/lib/metrics.js +48 -0
- package/dist/lib/metrics.js.map +1 -0
- package/dist/lib/overstory.d.ts +2 -0
- package/dist/lib/overstory.d.ts.map +1 -0
- package/dist/lib/overstory.js +211 -0
- package/dist/lib/overstory.js.map +1 -0
- package/dist/lib/parallel.d.ts +2 -0
- package/dist/lib/parallel.d.ts.map +1 -0
- package/dist/lib/parallel.js +349 -0
- package/dist/lib/parallel.js.map +1 -0
- package/dist/lib/paths.d.ts +2 -0
- package/dist/lib/paths.d.ts.map +1 -0
- package/dist/lib/paths.js +254 -0
- package/dist/lib/paths.js.map +1 -0
- package/dist/lib/phase-complete-llm.d.ts +22 -0
- package/dist/lib/phase-complete-llm.d.ts.map +1 -0
- package/dist/lib/phase-complete-llm.js +331 -0
- package/dist/lib/phase-complete-llm.js.map +1 -0
- package/dist/lib/phase-complete.d.ts +46 -0
- package/dist/lib/phase-complete.d.ts.map +1 -0
- package/dist/lib/phase-complete.js +278 -0
- package/dist/lib/phase-complete.js.map +1 -0
- package/dist/lib/phase-io.d.ts +2 -0
- package/dist/lib/phase-io.d.ts.map +1 -0
- package/dist/lib/phase-io.js +126 -0
- package/dist/lib/phase-io.js.map +1 -0
- package/dist/lib/phase.d.ts +2 -0
- package/dist/lib/phase.d.ts.map +1 -0
- package/dist/lib/phase.js +1344 -0
- package/dist/lib/phase.js.map +1 -0
- package/dist/lib/plan-tournament.d.ts +63 -0
- package/dist/lib/plan-tournament.d.ts.map +1 -0
- package/dist/lib/plan-tournament.js +353 -0
- package/dist/lib/plan-tournament.js.map +1 -0
- package/dist/lib/refinement.d.ts +74 -0
- package/dist/lib/refinement.d.ts.map +1 -0
- package/dist/lib/refinement.js +283 -0
- package/dist/lib/refinement.js.map +1 -0
- package/dist/lib/requirements.d.ts +2 -0
- package/dist/lib/requirements.d.ts.map +1 -0
- package/dist/lib/requirements.js +355 -0
- package/dist/lib/requirements.js.map +1 -0
- package/dist/lib/research-bundle.d.ts +2 -0
- package/dist/lib/research-bundle.d.ts.map +1 -0
- package/dist/lib/research-bundle.js +246 -0
- package/dist/lib/research-bundle.js.map +1 -0
- package/dist/lib/roadmap.d.ts +2 -0
- package/dist/lib/roadmap.d.ts.map +1 -0
- package/dist/lib/roadmap.js +541 -0
- package/dist/lib/roadmap.js.map +1 -0
- package/dist/lib/sample.d.ts +16 -0
- package/dist/lib/sample.d.ts.map +1 -0
- package/dist/lib/sample.js +20 -0
- package/dist/lib/sample.js.map +1 -0
- package/dist/lib/scaffold.d.ts +2 -0
- package/dist/lib/scaffold.d.ts.map +1 -0
- package/dist/lib/scaffold.js +355 -0
- package/dist/lib/scaffold.js.map +1 -0
- package/dist/lib/scan/_utils.d.ts +11 -0
- package/dist/lib/scan/_utils.d.ts.map +1 -0
- package/dist/lib/scan/_utils.js +36 -0
- package/dist/lib/scan/_utils.js.map +1 -0
- package/dist/lib/scan/base64.d.ts +15 -0
- package/dist/lib/scan/base64.d.ts.map +1 -0
- package/dist/lib/scan/base64.js +66 -0
- package/dist/lib/scan/base64.js.map +1 -0
- package/dist/lib/scan/ignorefile.d.ts +30 -0
- package/dist/lib/scan/ignorefile.d.ts.map +1 -0
- package/dist/lib/scan/ignorefile.js +101 -0
- package/dist/lib/scan/ignorefile.js.map +1 -0
- package/dist/lib/scan/injection.d.ts +14 -0
- package/dist/lib/scan/injection.d.ts.map +1 -0
- package/dist/lib/scan/injection.js +39 -0
- package/dist/lib/scan/injection.js.map +1 -0
- package/dist/lib/scan/patterns.d.ts +17 -0
- package/dist/lib/scan/patterns.d.ts.map +1 -0
- package/dist/lib/scan/patterns.js +123 -0
- package/dist/lib/scan/patterns.js.map +1 -0
- package/dist/lib/scan/strip-markdown.d.ts +7 -0
- package/dist/lib/scan/strip-markdown.d.ts.map +1 -0
- package/dist/lib/scan/strip-markdown.js +38 -0
- package/dist/lib/scan/strip-markdown.js.map +1 -0
- package/dist/lib/scan/types.d.ts +23 -0
- package/dist/lib/scan/types.d.ts.map +1 -0
- package/dist/lib/scan/types.js +3 -0
- package/dist/lib/scan/types.js.map +1 -0
- package/dist/lib/scheduler-wait.d.ts +2 -0
- package/dist/lib/scheduler-wait.d.ts.map +1 -0
- package/dist/lib/scheduler-wait.js +59 -0
- package/dist/lib/scheduler-wait.js.map +1 -0
- package/dist/lib/scheduler.d.ts +254 -0
- package/dist/lib/scheduler.d.ts.map +1 -0
- package/dist/lib/scheduler.js +1147 -0
- package/dist/lib/scheduler.js.map +1 -0
- package/dist/lib/state.d.ts +2 -0
- package/dist/lib/state.d.ts.map +1 -0
- package/dist/lib/state.js +744 -0
- package/dist/lib/state.js.map +1 -0
- package/dist/lib/think.d.ts +18 -0
- package/dist/lib/think.d.ts.map +1 -0
- package/dist/lib/think.js +317 -0
- package/dist/lib/think.js.map +1 -0
- package/dist/lib/tracker.d.ts +2 -0
- package/dist/lib/tracker.d.ts.map +1 -0
- package/dist/lib/tracker.js +1121 -0
- package/dist/lib/tracker.js.map +1 -0
- package/dist/lib/types.d.ts +1514 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +4 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +1363 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/verify.d.ts +2 -0
- package/dist/lib/verify.d.ts.map +1 -0
- package/dist/lib/verify.js +1153 -0
- package/dist/lib/verify.js.map +1 -0
- package/dist/lib/wireup/autofix.d.ts +2 -0
- package/dist/lib/wireup/autofix.d.ts.map +1 -0
- package/dist/lib/wireup/autofix.js +188 -0
- package/dist/lib/wireup/autofix.js.map +1 -0
- package/dist/lib/wireup/cli.d.ts +2 -0
- package/dist/lib/wireup/cli.d.ts.map +1 -0
- package/dist/lib/wireup/cli.js +194 -0
- package/dist/lib/wireup/cli.js.map +1 -0
- package/dist/lib/wireup/detection.d.ts +47 -0
- package/dist/lib/wireup/detection.d.ts.map +1 -0
- package/dist/lib/wireup/detection.js +410 -0
- package/dist/lib/wireup/detection.js.map +1 -0
- package/dist/lib/wireup/discovery.d.ts +2 -0
- package/dist/lib/wireup/discovery.d.ts.map +1 -0
- package/dist/lib/wireup/discovery.js +934 -0
- package/dist/lib/wireup/discovery.js.map +1 -0
- package/dist/lib/wireup/execution.d.ts +2 -0
- package/dist/lib/wireup/execution.d.ts.map +1 -0
- package/dist/lib/wireup/execution.js +573 -0
- package/dist/lib/wireup/execution.js.map +1 -0
- package/dist/lib/wireup/index.d.ts +2 -0
- package/dist/lib/wireup/index.d.ts.map +1 -0
- package/dist/lib/wireup/index.js +85 -0
- package/dist/lib/wireup/index.js.map +1 -0
- package/dist/lib/wireup/orchestrator.d.ts +2 -0
- package/dist/lib/wireup/orchestrator.d.ts.map +1 -0
- package/dist/lib/wireup/orchestrator.js +366 -0
- package/dist/lib/wireup/orchestrator.js.map +1 -0
- package/dist/lib/wireup/report.d.ts +47 -0
- package/dist/lib/wireup/report.d.ts.map +1 -0
- package/dist/lib/wireup/report.js +201 -0
- package/dist/lib/wireup/report.js.map +1 -0
- package/dist/lib/wireup/scenarios.d.ts +2 -0
- package/dist/lib/wireup/scenarios.d.ts.map +1 -0
- package/dist/lib/wireup/scenarios.js +516 -0
- package/dist/lib/wireup/scenarios.js.map +1 -0
- package/dist/lib/wireup/state.d.ts +2 -0
- package/dist/lib/wireup/state.d.ts.map +1 -0
- package/dist/lib/wireup/state.js +102 -0
- package/dist/lib/wireup/state.js.map +1 -0
- package/dist/lib/wireup/types.d.ts +376 -0
- package/dist/lib/wireup/types.d.ts.map +1 -0
- package/dist/lib/wireup/types.js +3 -0
- package/dist/lib/wireup/types.js.map +1 -0
- package/dist/lib/worktree.d.ts +2 -0
- package/dist/lib/worktree.d.ts.map +1 -0
- package/dist/lib/worktree.js +999 -0
- package/dist/lib/worktree.js.map +1 -0
- package/lib/autopilot-milestone.ts +136 -0
- package/lib/autopilot-pipeline.ts +1179 -0
- package/lib/autopilot-waves.ts +361 -0
- package/lib/autopilot.ts +1874 -0
- package/lib/autoplan.ts +280 -0
- package/lib/autoresearch.js +4 -0
- package/lib/autoresearch.ts +886 -0
- package/lib/backend.ts +1252 -0
- package/lib/benchmark.ts +341 -0
- package/lib/citations.ts +760 -0
- package/lib/cleanup.ts +1588 -0
- package/lib/cli/adapters.ts +41 -0
- package/lib/cli/agent.ts +83 -0
- package/lib/cli/index.ts +273 -0
- package/lib/cli/output.ts +33 -0
- package/lib/cli/scan-dispatch.ts +130 -0
- package/lib/cli/tools.ts +198 -0
- package/lib/commands/_dashboard-parsers.ts +275 -0
- package/lib/commands/analysis.ts +1851 -0
- package/lib/commands/assumptions.ts +232 -0
- package/lib/commands/blame.ts +174 -0
- package/lib/commands/budget.ts +148 -0
- package/lib/commands/check-plans.ts +233 -0
- package/lib/commands/config.ts +287 -0
- package/lib/commands/dashboard.ts +680 -0
- package/lib/commands/estimate.ts +204 -0
- package/lib/commands/eval-diff.ts +252 -0
- package/lib/commands/freshness.ts +213 -0
- package/lib/commands/health.ts +607 -0
- package/lib/commands/index.ts +266 -0
- package/lib/commands/install.ts +307 -0
- package/lib/commands/knowhow-aggregator.ts +345 -0
- package/lib/commands/knowledge-search.ts +153 -0
- package/lib/commands/long-term-roadmap.ts +390 -0
- package/lib/commands/patterns.ts +465 -0
- package/lib/commands/phase-info.ts +698 -0
- package/lib/commands/plan-lint.ts +546 -0
- package/lib/commands/plan-phase.ts +375 -0
- package/lib/commands/progress.ts +319 -0
- package/lib/commands/quality.ts +138 -0
- package/lib/commands/rollback.ts +195 -0
- package/lib/commands/scan.ts +72 -0
- package/lib/commands/search.ts +300 -0
- package/lib/commands/select-candidate.ts +687 -0
- package/lib/commands/singularity.ts +222 -0
- package/lib/commands/slug-timestamp.ts +74 -0
- package/lib/commands/tail.ts +129 -0
- package/lib/commands/todo.ts +273 -0
- package/lib/commands/watch.ts +80 -0
- package/lib/complexity.ts +117 -0
- package/lib/context/agents.ts +505 -0
- package/lib/context/base.ts +123 -0
- package/lib/context/execute.ts +977 -0
- package/lib/context/index.ts +110 -0
- package/lib/context/progress.ts +278 -0
- package/lib/context/project.ts +531 -0
- package/lib/context/research.ts +646 -0
- package/lib/dead-ends.ts +506 -0
- package/lib/deps.ts +773 -0
- package/lib/discussion.ts +1275 -0
- package/lib/drift.ts +519 -0
- package/lib/evolve/_dimensions-features.ts +525 -0
- package/lib/evolve/_dimensions.ts +511 -0
- package/lib/evolve/_product-ideation.ts +405 -0
- package/lib/evolve/_prompts.ts +178 -0
- package/lib/evolve/cli.ts +330 -0
- package/lib/evolve/discovery.ts +571 -0
- package/lib/evolve/index.ts +105 -0
- package/lib/evolve/orchestrator.ts +1139 -0
- package/lib/evolve/scoring.ts +167 -0
- package/lib/evolve/state.ts +330 -0
- package/lib/evolve/types.ts +290 -0
- package/lib/frontmatter.ts +615 -0
- package/lib/gates.ts +695 -0
- package/lib/genome.ts +402 -0
- package/lib/got.js +4 -0
- package/lib/got.ts +361 -0
- package/lib/invariants.ts +378 -0
- package/lib/knowledge.ts +768 -0
- package/lib/long-term-roadmap.ts +806 -0
- package/lib/markdown-split.ts +273 -0
- package/lib/mcp-server.ts +3292 -0
- package/lib/metrics.ts +49 -0
- package/lib/overstory.ts +270 -0
- package/lib/parallel.ts +570 -0
- package/lib/paths.ts +293 -0
- package/lib/phase-complete-llm.ts +376 -0
- package/lib/phase-complete.ts +366 -0
- package/lib/phase-io.ts +101 -0
- package/lib/phase.ts +1981 -0
- package/lib/plan-tournament.ts +426 -0
- package/lib/refinement.ts +349 -0
- package/lib/requirements.ts +469 -0
- package/lib/research-bundle.ts +300 -0
- package/lib/roadmap.ts +775 -0
- package/lib/scaffold.ts +480 -0
- package/lib/scan/_utils.ts +37 -0
- package/lib/scan/base64.ts +90 -0
- package/lib/scan/ignorefile.ts +109 -0
- package/lib/scan/injection.ts +67 -0
- package/lib/scan/patterns.ts +139 -0
- package/lib/scan/strip-markdown.ts +39 -0
- package/lib/scan/types.ts +28 -0
- package/lib/scheduler-wait.ts +58 -0
- package/lib/scheduler.ts +1370 -0
- package/lib/state.ts +1000 -0
- package/lib/think.ts +365 -0
- package/lib/tracker.ts +1591 -0
- package/lib/types.ts +1663 -0
- package/lib/utils.ts +1479 -0
- package/lib/verify.ts +1434 -0
- package/lib/wireup/autofix.ts +241 -0
- package/lib/wireup/cli.ts +278 -0
- package/lib/wireup/detection.ts +542 -0
- package/lib/wireup/discovery.ts +1063 -0
- package/lib/wireup/execution.ts +686 -0
- package/lib/wireup/index.ts +117 -0
- package/lib/wireup/orchestrator.ts +519 -0
- package/lib/wireup/report.ts +286 -0
- package/lib/wireup/scenarios.ts +616 -0
- package/lib/wireup/state.ts +139 -0
- package/lib/wireup/types.ts +436 -0
- package/lib/worktree.ts +1309 -0
- package/package.json +67 -0
|
@@ -0,0 +1,2424 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// ─── Imports from lib/ modules ──────────────────────────────────────────────
|
|
4
|
+
const { cmdStateLoad, cmdStateGet, cmdStatePatch, cmdStateUpdate, cmdStateAdvancePlan, cmdStateRecordMetric, cmdStateUpdateProgress, cmdStateAddDecision, cmdStateAddBlocker, cmdStateResolveBlocker, cmdStateRecordSession, cmdStateSnapshot, } = require('./state');
|
|
5
|
+
const { cmdFrontmatterGet, cmdFrontmatterSet, cmdFrontmatterMerge, cmdFrontmatterValidate, } = require('./frontmatter');
|
|
6
|
+
const { cmdRoadmapGetPhase, cmdPhaseNextDecimal, cmdRoadmapAnalyze, } = require('./roadmap');
|
|
7
|
+
const { cmdPhaseAnalyzeDeps, } = require('./deps');
|
|
8
|
+
const { cmdAutopilot, cmdInitAutopilot, cmdMultiMilestoneAutopilot, cmdInitMultiMilestoneAutopilot, } = require('./autopilot');
|
|
9
|
+
const { cmdAutoplan, cmdInitAutoplan, } = require('./autoplan');
|
|
10
|
+
const { cmdEvolve, cmdEvolveDiscover, cmdEvolveState, cmdEvolveAdvance, cmdEvolveReset, cmdInitEvolve, } = require('./evolve');
|
|
11
|
+
const { cmdWireupDiscover, cmdWireupRun, cmdWireupState, cmdWireupScenarios, cmdWireupReport, } = require('./wireup');
|
|
12
|
+
const { runDiscussion, listDiscussions, readDiscussion, } = require('./discussion');
|
|
13
|
+
const { detectAvailableBackends, readConfig, } = require('./backend');
|
|
14
|
+
const { splitMarkdown, isIndexFile, estimateTokens, } = require('./markdown-split');
|
|
15
|
+
const { cmdInitExecuteParallel, } = require('./parallel');
|
|
16
|
+
const { cmdTemplateSelect, cmdTemplateFill, cmdScaffold, } = require('./scaffold');
|
|
17
|
+
const { cmdVerifySummary, cmdVerifyPlanStructure, cmdVerifyPhaseCompleteness, cmdVerifyReferences, cmdVerifyCommits, cmdVerifyArtifacts, cmdVerifyKeyLinks, } = require('./verify');
|
|
18
|
+
const { cmdPhasesList, cmdPhaseAdd, cmdPhaseInsert, cmdPhaseRemove, cmdPhaseComplete, cmdMilestoneComplete, cmdValidateConsistency, } = require('./phase');
|
|
19
|
+
const { cmdTracker, } = require('./tracker');
|
|
20
|
+
const { cmdWorktreeCreate, cmdWorktreeRemove, cmdWorktreeList, cmdWorktreeRemoveStale, cmdWorktreePushAndPR, } = require('./worktree');
|
|
21
|
+
const { cmdInitExecutePhase, cmdInitPlanPhase, cmdInitNewProject, cmdInitNewMilestone, cmdInitQuick, cmdInitResume, cmdInitVerifyWork, cmdInitPhaseOp, cmdInitTodos, cmdInitMilestoneOp, cmdInitMapCodebase, cmdInitProgress, cmdInitResearchWorkflow, cmdInitPlanMilestoneGaps,
|
|
22
|
+
// Agent & operation workflows (from context/agents.ts)
|
|
23
|
+
cmdInitDebug, cmdInitIntegrationCheck, cmdInitMigrate, cmdInitPlanCheck, cmdInitExecutor, cmdInitBaselineAssessor, cmdInitCodeReviewer, cmdInitCodebaseMapper, cmdInitDebugger, cmdInitDeepDiver, cmdInitEvalPlanner, cmdInitEvalReporter, cmdInitFeasibilityAnalyst, cmdInitIntegrationChecker, cmdInitMigrator, cmdInitPhaseResearcher, cmdInitPlanChecker,
|
|
24
|
+
// Execute & plan workflows (from context/execute.ts)
|
|
25
|
+
cmdInitCodeReview, cmdInitPhaseResearch,
|
|
26
|
+
// Research workflows (from context/research.ts)
|
|
27
|
+
cmdInitAssessBaseline, cmdInitDeepDive, cmdInitEvalPlan, cmdInitEvalReport, cmdInitFeasibility, cmdInitProductOwner, cmdInitProjectResearcher, cmdInitResearchSynthesizer, cmdInitRoadmapper, cmdInitSurveyor, cmdInitVerifier, } = require('./context');
|
|
28
|
+
const { cmdGenerateSlug, cmdCurrentTimestamp, cmdListTodos, cmdTodoComplete, cmdVerifyPathExists, cmdConfigEnsureSection, cmdConfigSet, cmdHistoryDigest, cmdResolveModel, cmdFindPhase, cmdCommit, cmdPhasePlanIndex, cmdSummaryExtract, cmdProgressRender, cmdDashboard, cmdPhaseDetail, cmdHealth, cmdDetectBackend, cmdLongTermRoadmap, cmdQualityAnalysis, cmdRequirementGet, cmdRequirementList, cmdRequirementTraceability, cmdRequirementUpdateStatus, cmdSearch, cmdCoverageReport, cmdHealthCheck, } = require('./commands');
|
|
29
|
+
// ─── Tool Descriptor Factory Functions ──────────────────────────────────────
|
|
30
|
+
//
|
|
31
|
+
// These factory functions reduce repetition in COMMAND_DESCRIPTORS for common
|
|
32
|
+
// command shapes. Each returns a full descriptor object.
|
|
33
|
+
//
|
|
34
|
+
// NOTE: COMMAND_DESCRIPTORS is defined in this file rather than a separate
|
|
35
|
+
// lib/mcp-descriptors.ts because every execute handler directly references
|
|
36
|
+
// imported cmd* functions at the top of this file. Extracting to a separate
|
|
37
|
+
// file would require moving all those imports too, which is tracked as future work.
|
|
38
|
+
/**
|
|
39
|
+
* Create a descriptor for a simple single-required-string-argument command.
|
|
40
|
+
*/
|
|
41
|
+
function makeSimpleCommand(name, description, argName, argDescription, handler) {
|
|
42
|
+
return {
|
|
43
|
+
name,
|
|
44
|
+
description,
|
|
45
|
+
params: [{ name: argName, type: 'string', required: true, description: argDescription }],
|
|
46
|
+
execute: (cwd, args) => handler(cwd, args[argName]),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Create a descriptor for a command that takes a single required 'phase' string argument.
|
|
51
|
+
*/
|
|
52
|
+
function makePhaseCommand(name, description, handler) {
|
|
53
|
+
return makeSimpleCommand(name, description, 'phase', 'Phase number', handler);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Create a descriptor for a zero-argument state-reading/mutation command.
|
|
57
|
+
*/
|
|
58
|
+
function makeStateCommand(name, description, handler) {
|
|
59
|
+
return {
|
|
60
|
+
name,
|
|
61
|
+
description,
|
|
62
|
+
params: [],
|
|
63
|
+
execute: (cwd, _args) => handler(cwd),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
// ─── Tool Descriptors ────────────────────────────────────────────────────────
|
|
67
|
+
//
|
|
68
|
+
// Each descriptor declares: name, description, params (with type, required, description).
|
|
69
|
+
// The buildToolDefinitions() function transforms these into MCP-format tool definitions.
|
|
70
|
+
const COMMAND_DESCRIPTORS = [
|
|
71
|
+
// ── State commands ──
|
|
72
|
+
makeStateCommand('grd_state_load', 'Load full project config, state, and roadmap status', (cwd) => cmdStateLoad(cwd, false)),
|
|
73
|
+
{
|
|
74
|
+
name: 'grd_state_get',
|
|
75
|
+
description: 'Read a specific field or section from STATE.md',
|
|
76
|
+
params: [
|
|
77
|
+
{
|
|
78
|
+
name: 'section',
|
|
79
|
+
type: 'string',
|
|
80
|
+
required: false,
|
|
81
|
+
description: 'Field or section name to read',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
execute: (cwd, args) => cmdStateGet(cwd, args.section || undefined, false),
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'grd_state_patch',
|
|
88
|
+
description: 'Batch update STATE.md fields',
|
|
89
|
+
params: [
|
|
90
|
+
{
|
|
91
|
+
name: 'patches',
|
|
92
|
+
type: 'object',
|
|
93
|
+
required: true,
|
|
94
|
+
description: 'Object of field:value pairs to update',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
execute: (cwd, args) => cmdStatePatch(cwd, args.patches || {}, false),
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'grd_state_update',
|
|
101
|
+
description: 'Update a single STATE.md field',
|
|
102
|
+
params: [
|
|
103
|
+
{ name: 'field', type: 'string', required: true, description: 'Field name to update' },
|
|
104
|
+
{ name: 'value', type: 'string', required: true, description: 'New value for the field' },
|
|
105
|
+
],
|
|
106
|
+
execute: (cwd, args) => cmdStateUpdate(cwd, args.field, args.value),
|
|
107
|
+
},
|
|
108
|
+
makeStateCommand('grd_state_advance_plan', 'Increment the current plan counter in STATE.md', (cwd) => cmdStateAdvancePlan(cwd, false)),
|
|
109
|
+
{
|
|
110
|
+
name: 'grd_state_record_metric',
|
|
111
|
+
description: 'Record execution metrics (phase, plan, duration, tasks, files) to STATE.md',
|
|
112
|
+
params: [
|
|
113
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number' },
|
|
114
|
+
{ name: 'plan', type: 'string', required: true, description: 'Plan number' },
|
|
115
|
+
{ name: 'duration', type: 'string', required: true, description: 'Duration (e.g. "3min")' },
|
|
116
|
+
{ name: 'tasks', type: 'string', required: false, description: 'Number of tasks' },
|
|
117
|
+
{ name: 'files', type: 'string', required: false, description: 'Number of files modified' },
|
|
118
|
+
],
|
|
119
|
+
execute: (cwd, args) => cmdStateRecordMetric(cwd, {
|
|
120
|
+
phase: args.phase,
|
|
121
|
+
plan: args.plan,
|
|
122
|
+
duration: args.duration,
|
|
123
|
+
tasks: args.tasks || null,
|
|
124
|
+
files: args.files || null,
|
|
125
|
+
}, false),
|
|
126
|
+
},
|
|
127
|
+
makeStateCommand('grd_state_update_progress', 'Recalculate progress bar from disk state', (cwd) => cmdStateUpdateProgress(cwd, false)),
|
|
128
|
+
{
|
|
129
|
+
name: 'grd_state_add_decision',
|
|
130
|
+
description: 'Add a decision to the Key Decisions table in STATE.md',
|
|
131
|
+
params: [
|
|
132
|
+
{ name: 'summary', type: 'string', required: true, description: 'Decision summary text' },
|
|
133
|
+
{
|
|
134
|
+
name: 'phase',
|
|
135
|
+
type: 'string',
|
|
136
|
+
required: false,
|
|
137
|
+
description: 'Phase number for the decision',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'rationale',
|
|
141
|
+
type: 'string',
|
|
142
|
+
required: false,
|
|
143
|
+
description: 'Rationale for the decision',
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
execute: (cwd, args) => cmdStateAddDecision(cwd, {
|
|
147
|
+
summary: args.summary,
|
|
148
|
+
phase: args.phase || null,
|
|
149
|
+
rationale: args.rationale || '',
|
|
150
|
+
}, false),
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: 'grd_state_add_blocker',
|
|
154
|
+
description: 'Add a blocker to STATE.md',
|
|
155
|
+
params: [{ name: 'text', type: 'string', required: true, description: 'Blocker description' }],
|
|
156
|
+
execute: (cwd, args) => cmdStateAddBlocker(cwd, args.text, false),
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: 'grd_state_resolve_blocker',
|
|
160
|
+
description: 'Resolve a blocker in STATE.md',
|
|
161
|
+
params: [
|
|
162
|
+
{ name: 'text', type: 'string', required: true, description: 'Blocker text to resolve' },
|
|
163
|
+
],
|
|
164
|
+
execute: (cwd, args) => cmdStateResolveBlocker(cwd, args.text, false),
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: 'grd_state_record_session',
|
|
168
|
+
description: 'Update session continuity info in STATE.md',
|
|
169
|
+
params: [
|
|
170
|
+
{
|
|
171
|
+
name: 'stopped_at',
|
|
172
|
+
type: 'string',
|
|
173
|
+
required: true,
|
|
174
|
+
description: 'Where execution stopped',
|
|
175
|
+
},
|
|
176
|
+
{ name: 'resume_file', type: 'string', required: false, description: 'File to resume from' },
|
|
177
|
+
],
|
|
178
|
+
execute: (cwd, args) => cmdStateRecordSession(cwd, {
|
|
179
|
+
stopped_at: args.stopped_at,
|
|
180
|
+
resume_file: args.resume_file || 'None',
|
|
181
|
+
}, false),
|
|
182
|
+
},
|
|
183
|
+
// ── Top-level commands ──
|
|
184
|
+
{
|
|
185
|
+
name: 'grd_resolve_model',
|
|
186
|
+
description: 'Resolve the model name for a given agent type from project configuration',
|
|
187
|
+
params: [
|
|
188
|
+
{
|
|
189
|
+
name: 'agent_type',
|
|
190
|
+
type: 'string',
|
|
191
|
+
required: true,
|
|
192
|
+
description: 'Agent type key (e.g. grd-executor)',
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
execute: (cwd, args) => cmdResolveModel(cwd, args.agent_type, false),
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: 'grd_find_phase',
|
|
199
|
+
description: 'Find a phase directory by number and list its plans and summaries',
|
|
200
|
+
params: [
|
|
201
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase identifier to find' },
|
|
202
|
+
],
|
|
203
|
+
execute: (cwd, args) => cmdFindPhase(cwd, args.phase, false),
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: 'grd_commit',
|
|
207
|
+
description: 'Create a git commit with specified files',
|
|
208
|
+
params: [
|
|
209
|
+
{ name: 'message', type: 'string', required: true, description: 'Commit message' },
|
|
210
|
+
{
|
|
211
|
+
name: 'files',
|
|
212
|
+
type: 'array',
|
|
213
|
+
required: false,
|
|
214
|
+
description: 'File paths to stage (defaults to .planning/)',
|
|
215
|
+
},
|
|
216
|
+
{ name: 'amend', type: 'boolean', required: false, description: 'Amend previous commit' },
|
|
217
|
+
],
|
|
218
|
+
execute: (cwd, args) => cmdCommit(cwd, args.message, args.files || [], false, args.amend || false),
|
|
219
|
+
},
|
|
220
|
+
// ── Verify commands ──
|
|
221
|
+
{
|
|
222
|
+
name: 'grd_verify_summary',
|
|
223
|
+
description: 'Verify a SUMMARY.md file structure and content',
|
|
224
|
+
params: [
|
|
225
|
+
{ name: 'file', type: 'string', required: true, description: 'Path to the SUMMARY.md file' },
|
|
226
|
+
{ name: 'check_count', type: 'number', required: false, description: 'Expected task count' },
|
|
227
|
+
],
|
|
228
|
+
execute: (cwd, args) => cmdVerifySummary(cwd, args.file, args.check_count || 2, false),
|
|
229
|
+
},
|
|
230
|
+
makeSimpleCommand('grd_verify_plan_structure', 'Validate a PLAN.md file structure and frontmatter', 'file', 'Path to the PLAN.md file', (cwd, file) => cmdVerifyPlanStructure(cwd, file, false)),
|
|
231
|
+
{
|
|
232
|
+
name: 'grd_verify_phase_completeness',
|
|
233
|
+
description: 'Check that all plans in a phase have corresponding summaries',
|
|
234
|
+
params: [
|
|
235
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number or directory' },
|
|
236
|
+
],
|
|
237
|
+
execute: (cwd, args) => cmdVerifyPhaseCompleteness(cwd, args.phase, false),
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: 'grd_verify_references',
|
|
241
|
+
description: 'Validate @-references and file paths in a file',
|
|
242
|
+
params: [
|
|
243
|
+
{ name: 'file', type: 'string', required: true, description: 'File to check references in' },
|
|
244
|
+
],
|
|
245
|
+
execute: (cwd, args) => cmdVerifyReferences(cwd, args.file, false),
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: 'grd_verify_commits',
|
|
249
|
+
description: 'Batch verify that git commits exist',
|
|
250
|
+
params: [
|
|
251
|
+
{
|
|
252
|
+
name: 'hashes',
|
|
253
|
+
type: 'array',
|
|
254
|
+
required: true,
|
|
255
|
+
description: 'Array of git commit hashes to verify',
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
execute: (cwd, args) => cmdVerifyCommits(cwd, args.hashes || [], false),
|
|
259
|
+
},
|
|
260
|
+
makeSimpleCommand('grd_verify_artifacts', 'Check that must_haves.artifacts from a plan file exist on disk', 'file', 'Path to the PLAN.md file', (cwd, file) => cmdVerifyArtifacts(cwd, file, false)),
|
|
261
|
+
makeSimpleCommand('grd_verify_key_links', 'Validate must_haves.key_links patterns between source files', 'file', 'Path to the PLAN.md file', (cwd, file) => cmdVerifyKeyLinks(cwd, file, false)),
|
|
262
|
+
// ── Template & Scaffold ──
|
|
263
|
+
{
|
|
264
|
+
name: 'grd_template_select',
|
|
265
|
+
description: 'Select the appropriate template for a given type',
|
|
266
|
+
params: [
|
|
267
|
+
{
|
|
268
|
+
name: 'type',
|
|
269
|
+
type: 'string',
|
|
270
|
+
required: true,
|
|
271
|
+
description: 'Template type (e.g. summary, plan)',
|
|
272
|
+
},
|
|
273
|
+
],
|
|
274
|
+
execute: (cwd, args) => cmdTemplateSelect(cwd, args.type, false),
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
name: 'grd_template_fill',
|
|
278
|
+
description: 'Fill a template with provided values',
|
|
279
|
+
params: [
|
|
280
|
+
{ name: 'template', type: 'string', required: true, description: 'Template path or type' },
|
|
281
|
+
{ name: 'phase', type: 'string', required: false, description: 'Phase number' },
|
|
282
|
+
{ name: 'plan', type: 'string', required: false, description: 'Plan number' },
|
|
283
|
+
{ name: 'name', type: 'string', required: false, description: 'Plan or phase name' },
|
|
284
|
+
{
|
|
285
|
+
name: 'type',
|
|
286
|
+
type: 'string',
|
|
287
|
+
required: false,
|
|
288
|
+
description: 'Plan type (default: execute)',
|
|
289
|
+
},
|
|
290
|
+
{ name: 'wave', type: 'string', required: false, description: 'Wave number (default: 1)' },
|
|
291
|
+
{
|
|
292
|
+
name: 'fields',
|
|
293
|
+
type: 'object',
|
|
294
|
+
required: false,
|
|
295
|
+
description: 'Additional template fields',
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
execute: (cwd, args) => cmdTemplateFill(cwd, args.template, {
|
|
299
|
+
phase: args.phase || null,
|
|
300
|
+
plan: args.plan || null,
|
|
301
|
+
name: args.name || null,
|
|
302
|
+
type: args.type || 'execute',
|
|
303
|
+
wave: args.wave || '1',
|
|
304
|
+
fields: args.fields || {},
|
|
305
|
+
}, false),
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: 'grd_scaffold',
|
|
309
|
+
description: 'Scaffold project structures (context, uat, verification, phase-dir, research-dir, eval, baseline)',
|
|
310
|
+
params: [
|
|
311
|
+
{ name: 'type', type: 'string', required: true, description: 'Scaffold type' },
|
|
312
|
+
{ name: 'phase', type: 'string', required: false, description: 'Phase number' },
|
|
313
|
+
{ name: 'name', type: 'string', required: false, description: 'Name for the scaffold' },
|
|
314
|
+
],
|
|
315
|
+
execute: (cwd, args) => cmdScaffold(cwd, args.type, {
|
|
316
|
+
phase: args.phase || null,
|
|
317
|
+
name: args.name || null,
|
|
318
|
+
}, false),
|
|
319
|
+
},
|
|
320
|
+
// ── Frontmatter ──
|
|
321
|
+
{
|
|
322
|
+
name: 'grd_frontmatter_get',
|
|
323
|
+
description: 'Get frontmatter from a markdown file',
|
|
324
|
+
params: [
|
|
325
|
+
{ name: 'file', type: 'string', required: true, description: 'Markdown file path' },
|
|
326
|
+
{ name: 'field', type: 'string', required: false, description: 'Specific field to extract' },
|
|
327
|
+
],
|
|
328
|
+
execute: (cwd, args) => cmdFrontmatterGet(cwd, args.file, args.field || null, false),
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
name: 'grd_frontmatter_set',
|
|
332
|
+
description: 'Set a frontmatter field in a markdown file',
|
|
333
|
+
params: [
|
|
334
|
+
{ name: 'file', type: 'string', required: true, description: 'Markdown file path' },
|
|
335
|
+
{ name: 'field', type: 'string', required: true, description: 'Field name to set' },
|
|
336
|
+
{ name: 'value', type: 'string', required: true, description: 'Value to set' },
|
|
337
|
+
],
|
|
338
|
+
execute: (cwd, args) => cmdFrontmatterSet(cwd, args.file, args.field, args.value, false),
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: 'grd_frontmatter_merge',
|
|
342
|
+
description: 'Merge data into frontmatter of a markdown file',
|
|
343
|
+
params: [
|
|
344
|
+
{ name: 'file', type: 'string', required: true, description: 'Markdown file path' },
|
|
345
|
+
{ name: 'data', type: 'string', required: true, description: 'JSON string of data to merge' },
|
|
346
|
+
],
|
|
347
|
+
execute: (cwd, args) => cmdFrontmatterMerge(cwd, args.file, args.data, false),
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
name: 'grd_frontmatter_validate',
|
|
351
|
+
description: 'Validate frontmatter of a markdown file against a schema',
|
|
352
|
+
params: [
|
|
353
|
+
{ name: 'file', type: 'string', required: true, description: 'Markdown file path' },
|
|
354
|
+
{
|
|
355
|
+
name: 'schema',
|
|
356
|
+
type: 'string',
|
|
357
|
+
required: false,
|
|
358
|
+
description: 'Schema name to validate against',
|
|
359
|
+
},
|
|
360
|
+
],
|
|
361
|
+
execute: (cwd, args) => cmdFrontmatterValidate(cwd, args.file, args.schema || null, false),
|
|
362
|
+
},
|
|
363
|
+
// ── Utility commands ──
|
|
364
|
+
{
|
|
365
|
+
name: 'grd_generate_slug',
|
|
366
|
+
description: 'Generate a kebab-case slug from input text',
|
|
367
|
+
params: [
|
|
368
|
+
{ name: 'text', type: 'string', required: true, description: 'Text to convert to slug' },
|
|
369
|
+
],
|
|
370
|
+
execute: (_cwd, args) => cmdGenerateSlug(args.text, false),
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
name: 'grd_current_timestamp',
|
|
374
|
+
description: 'Output the current timestamp in the specified format',
|
|
375
|
+
params: [
|
|
376
|
+
{
|
|
377
|
+
name: 'format',
|
|
378
|
+
type: 'string',
|
|
379
|
+
required: false,
|
|
380
|
+
description: 'Format: date, filename, or full (default: full)',
|
|
381
|
+
},
|
|
382
|
+
],
|
|
383
|
+
execute: (_cwd, args) => cmdCurrentTimestamp(args.format || 'full', false),
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
name: 'grd_list_todos',
|
|
387
|
+
description: 'List pending todo files with optional area filter',
|
|
388
|
+
params: [
|
|
389
|
+
{ name: 'area', type: 'string', required: false, description: 'Area filter (e.g. general)' },
|
|
390
|
+
],
|
|
391
|
+
execute: (cwd, args) => cmdListTodos(cwd, args.area || undefined, false),
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
name: 'grd_todo_complete',
|
|
395
|
+
description: 'Mark a todo file as completed',
|
|
396
|
+
params: [
|
|
397
|
+
{
|
|
398
|
+
name: 'filename',
|
|
399
|
+
type: 'string',
|
|
400
|
+
required: true,
|
|
401
|
+
description: 'Todo filename to complete',
|
|
402
|
+
},
|
|
403
|
+
],
|
|
404
|
+
execute: (cwd, args) => cmdTodoComplete(cwd, args.filename, false),
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: 'grd_verify_path_exists',
|
|
408
|
+
description: 'Check if a path exists in the project and report its type',
|
|
409
|
+
params: [
|
|
410
|
+
{ name: 'path', type: 'string', required: true, description: 'Path to check for existence' },
|
|
411
|
+
],
|
|
412
|
+
execute: (cwd, args) => cmdVerifyPathExists(cwd, args.path, false),
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
name: 'grd_config_ensure_section',
|
|
416
|
+
description: 'Ensure config.json exists with required sections',
|
|
417
|
+
params: [],
|
|
418
|
+
execute: (cwd, _args) => cmdConfigEnsureSection(cwd, false),
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
name: 'grd_config_set',
|
|
422
|
+
description: 'Set a configuration value by dot-path key in config.json',
|
|
423
|
+
params: [
|
|
424
|
+
{
|
|
425
|
+
name: 'key',
|
|
426
|
+
type: 'string',
|
|
427
|
+
required: true,
|
|
428
|
+
description: 'Dot-notation key path (e.g. workflow.research)',
|
|
429
|
+
},
|
|
430
|
+
{ name: 'value', type: 'string', required: true, description: 'Value to set' },
|
|
431
|
+
],
|
|
432
|
+
execute: (cwd, args) => cmdConfigSet(cwd, args.key, args.value, false),
|
|
433
|
+
},
|
|
434
|
+
makeStateCommand('grd_history_digest', 'Aggregate metrics, decisions, and tech stack from all SUMMARY.md files', (cwd) => cmdHistoryDigest(cwd, false)),
|
|
435
|
+
// ── Phases ──
|
|
436
|
+
{
|
|
437
|
+
name: 'grd_phases_list',
|
|
438
|
+
description: 'List all phases with optional type or phase filter',
|
|
439
|
+
params: [
|
|
440
|
+
{ name: 'type', type: 'string', required: false, description: 'Filter by phase type' },
|
|
441
|
+
{ name: 'phase', type: 'string', required: false, description: 'Filter by phase number' },
|
|
442
|
+
],
|
|
443
|
+
execute: (cwd, args) => cmdPhasesList(cwd, { type: args.type || null, phase: args.phase || null }, false),
|
|
444
|
+
},
|
|
445
|
+
// ── Roadmap ──
|
|
446
|
+
makePhaseCommand('grd_roadmap_get_phase', 'Get roadmap section for a specific phase', (cwd, phase) => cmdRoadmapGetPhase(cwd, phase, false)),
|
|
447
|
+
{
|
|
448
|
+
name: 'grd_roadmap_analyze',
|
|
449
|
+
description: 'Analyze roadmap structure and status',
|
|
450
|
+
params: [],
|
|
451
|
+
execute: (cwd, _args) => cmdRoadmapAnalyze(cwd, false),
|
|
452
|
+
},
|
|
453
|
+
// ── Phase operations ──
|
|
454
|
+
makePhaseCommand('grd_phase_next_decimal', 'Get the next decimal phase number after a given phase', (cwd, phase) => cmdPhaseNextDecimal(cwd, phase, false)),
|
|
455
|
+
{
|
|
456
|
+
name: 'grd_phase_add',
|
|
457
|
+
description: 'Add a new phase to the roadmap',
|
|
458
|
+
params: [
|
|
459
|
+
{ name: 'description', type: 'string', required: true, description: 'Phase description' },
|
|
460
|
+
{
|
|
461
|
+
name: 'context',
|
|
462
|
+
type: 'string',
|
|
463
|
+
required: false,
|
|
464
|
+
description: 'Optional context text to capture in CONTEXT.md',
|
|
465
|
+
},
|
|
466
|
+
],
|
|
467
|
+
execute: (cwd, args) => cmdPhaseAdd(cwd, args.description, false, args.context),
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
name: 'grd_phase_insert',
|
|
471
|
+
description: 'Insert a phase at a specific position in the roadmap',
|
|
472
|
+
params: [
|
|
473
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number to insert at' },
|
|
474
|
+
{ name: 'description', type: 'string', required: true, description: 'Phase description' },
|
|
475
|
+
],
|
|
476
|
+
execute: (cwd, args) => cmdPhaseInsert(cwd, args.phase, args.description, false),
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
name: 'grd_phase_remove',
|
|
480
|
+
description: 'Remove a phase from the roadmap',
|
|
481
|
+
params: [
|
|
482
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number to remove' },
|
|
483
|
+
{
|
|
484
|
+
name: 'force',
|
|
485
|
+
type: 'boolean',
|
|
486
|
+
required: false,
|
|
487
|
+
description: 'Force removal even if phase has content',
|
|
488
|
+
},
|
|
489
|
+
],
|
|
490
|
+
execute: (cwd, args) => cmdPhaseRemove(cwd, args.phase, { force: args.force || false }, false),
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
name: 'grd_phase_complete',
|
|
494
|
+
description: 'Mark a phase as complete',
|
|
495
|
+
params: [{ name: 'phase', type: 'string', required: true, description: 'Phase number' }],
|
|
496
|
+
execute: async (cwd, args) => await cmdPhaseComplete(cwd, args.phase, false),
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
name: 'grd_phase_analyze_deps',
|
|
500
|
+
description: 'Analyze roadmap phase dependencies and identify parallel execution groups',
|
|
501
|
+
params: [],
|
|
502
|
+
execute: (cwd, _args) => cmdPhaseAnalyzeDeps(cwd, false),
|
|
503
|
+
},
|
|
504
|
+
// ── Milestone ──
|
|
505
|
+
{
|
|
506
|
+
name: 'grd_milestone_complete',
|
|
507
|
+
description: 'Mark a milestone as complete and archive it',
|
|
508
|
+
params: [
|
|
509
|
+
{
|
|
510
|
+
name: 'version',
|
|
511
|
+
type: 'string',
|
|
512
|
+
required: true,
|
|
513
|
+
description: 'Milestone version (e.g. v1.0)',
|
|
514
|
+
},
|
|
515
|
+
{ name: 'name', type: 'string', required: false, description: 'Milestone name' },
|
|
516
|
+
],
|
|
517
|
+
execute: (cwd, args) => cmdMilestoneComplete(cwd, args.version, { name: args.name || null }, false),
|
|
518
|
+
},
|
|
519
|
+
// ── Validate ──
|
|
520
|
+
{
|
|
521
|
+
name: 'grd_validate_consistency',
|
|
522
|
+
description: 'Validate phase numbering and disk/roadmap sync',
|
|
523
|
+
params: [],
|
|
524
|
+
execute: (cwd, _args) => cmdValidateConsistency(cwd, false),
|
|
525
|
+
},
|
|
526
|
+
// ── Progress ──
|
|
527
|
+
{
|
|
528
|
+
name: 'grd_progress',
|
|
529
|
+
description: 'Render project progress in the specified format',
|
|
530
|
+
params: [
|
|
531
|
+
{
|
|
532
|
+
name: 'format',
|
|
533
|
+
type: 'string',
|
|
534
|
+
required: false,
|
|
535
|
+
description: 'Output format: json, table, or bar (default: json)',
|
|
536
|
+
},
|
|
537
|
+
],
|
|
538
|
+
execute: (cwd, args) => cmdProgressRender(cwd, args.format || 'json', false),
|
|
539
|
+
},
|
|
540
|
+
// ── Todo ──
|
|
541
|
+
// (grd_todo_complete is already defined above under utility commands)
|
|
542
|
+
// ── Phase Plan Index ──
|
|
543
|
+
makePhaseCommand('grd_phase_plan_index', 'Index plans in a phase with wave grouping and completion status', (cwd, phase) => cmdPhasePlanIndex(cwd, phase, false)),
|
|
544
|
+
// ── State Snapshot ──
|
|
545
|
+
makeStateCommand('grd_state_snapshot', 'Structured parse of STATE.md', (cwd) => cmdStateSnapshot(cwd, false)),
|
|
546
|
+
// ── Summary Extract ──
|
|
547
|
+
{
|
|
548
|
+
name: 'grd_summary_extract',
|
|
549
|
+
description: 'Extract structured data from a SUMMARY.md file',
|
|
550
|
+
params: [
|
|
551
|
+
{ name: 'file', type: 'string', required: true, description: 'Path to the SUMMARY.md file' },
|
|
552
|
+
{
|
|
553
|
+
name: 'fields',
|
|
554
|
+
type: 'string',
|
|
555
|
+
required: false,
|
|
556
|
+
description: 'Comma-separated list of fields to extract',
|
|
557
|
+
},
|
|
558
|
+
],
|
|
559
|
+
execute: (cwd, args) => cmdSummaryExtract(cwd, args.file, args.fields ? args.fields.split(',') : null, false),
|
|
560
|
+
},
|
|
561
|
+
// ── Tracker (12 subcommands) ──
|
|
562
|
+
{
|
|
563
|
+
name: 'grd_tracker_get_config',
|
|
564
|
+
description: 'Get tracker configuration',
|
|
565
|
+
params: [],
|
|
566
|
+
execute: (cwd, _args) => cmdTracker(cwd, 'get-config', [], false),
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
name: 'grd_tracker_sync_roadmap',
|
|
570
|
+
description: 'Sync roadmap to issue tracker',
|
|
571
|
+
params: [],
|
|
572
|
+
execute: (cwd, _args) => cmdTracker(cwd, 'sync-roadmap', [], false),
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
name: 'grd_tracker_sync_phase',
|
|
576
|
+
description: 'Sync a phase to issue tracker',
|
|
577
|
+
params: [
|
|
578
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number to sync' },
|
|
579
|
+
],
|
|
580
|
+
execute: (cwd, args) => cmdTracker(cwd, 'sync-phase', [args.phase], false),
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
name: 'grd_tracker_update_status',
|
|
584
|
+
description: 'Update phase status in tracker',
|
|
585
|
+
params: [
|
|
586
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number' },
|
|
587
|
+
{ name: 'status', type: 'string', required: true, description: 'New status' },
|
|
588
|
+
],
|
|
589
|
+
execute: (cwd, args) => cmdTracker(cwd, 'update-status', [args.phase, args.status], false),
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
name: 'grd_tracker_add_comment',
|
|
593
|
+
description: 'Add a comment to a phase issue in tracker',
|
|
594
|
+
params: [
|
|
595
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number' },
|
|
596
|
+
{
|
|
597
|
+
name: 'file',
|
|
598
|
+
type: 'string',
|
|
599
|
+
required: true,
|
|
600
|
+
description: 'Path to file to post as comment',
|
|
601
|
+
},
|
|
602
|
+
],
|
|
603
|
+
execute: (cwd, args) => cmdTracker(cwd, 'add-comment', [args.phase, args.file], false),
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
name: 'grd_tracker_sync_status',
|
|
607
|
+
description: 'Sync all phase statuses to tracker',
|
|
608
|
+
params: [],
|
|
609
|
+
execute: (cwd, _args) => cmdTracker(cwd, 'sync-status', [], false),
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
name: 'grd_tracker_schedule',
|
|
613
|
+
description: 'Compute and display schedule for tracker sync',
|
|
614
|
+
params: [],
|
|
615
|
+
execute: (cwd, _args) => cmdTracker(cwd, 'schedule', [], false),
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
name: 'grd_tracker_prepare_reschedule',
|
|
619
|
+
description: 'Prepare reschedule data for tracker',
|
|
620
|
+
params: [],
|
|
621
|
+
execute: (cwd, _args) => cmdTracker(cwd, 'prepare-reschedule', [], false),
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
name: 'grd_tracker_prepare_roadmap_sync',
|
|
625
|
+
description: 'Prepare roadmap sync payload for tracker',
|
|
626
|
+
params: [],
|
|
627
|
+
execute: (cwd, _args) => cmdTracker(cwd, 'prepare-roadmap-sync', [], false),
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
name: 'grd_tracker_prepare_phase_sync',
|
|
631
|
+
description: 'Prepare phase sync payload for tracker',
|
|
632
|
+
params: [{ name: 'phase', type: 'string', required: true, description: 'Phase number' }],
|
|
633
|
+
execute: (cwd, args) => cmdTracker(cwd, 'prepare-phase-sync', [args.phase], false),
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
name: 'grd_tracker_record_mapping',
|
|
637
|
+
description: 'Record tracker mapping entry',
|
|
638
|
+
params: [{ name: 'args', type: 'array', required: true, description: 'Mapping arguments' }],
|
|
639
|
+
execute: (cwd, args) => cmdTracker(cwd, 'record-mapping', args.args || [], false),
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
name: 'grd_tracker_record_status',
|
|
643
|
+
description: 'Record tracker status update',
|
|
644
|
+
params: [{ name: 'args', type: 'array', required: true, description: 'Status arguments' }],
|
|
645
|
+
execute: (cwd, args) => cmdTracker(cwd, 'record-status', args.args || [], false),
|
|
646
|
+
},
|
|
647
|
+
// ── Dashboard, Phase Detail, Health ──
|
|
648
|
+
{
|
|
649
|
+
name: 'grd_dashboard',
|
|
650
|
+
description: 'Render full project dashboard with milestones, phases, plans, and timeline',
|
|
651
|
+
params: [],
|
|
652
|
+
execute: (cwd, _args) => cmdDashboard(cwd, true),
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
name: 'grd_phase_detail',
|
|
656
|
+
description: 'Render detailed drill-down for a single phase',
|
|
657
|
+
params: [{ name: 'phase', type: 'string', required: true, description: 'Phase number' }],
|
|
658
|
+
execute: (cwd, args) => cmdPhaseDetail(cwd, args.phase, true),
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
name: 'grd_health',
|
|
662
|
+
description: 'Display project health indicators including blockers, deferred validations, velocity, and risks',
|
|
663
|
+
params: [],
|
|
664
|
+
execute: (cwd, _args) => cmdHealth(cwd, true),
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
name: 'grd_detect_backend',
|
|
668
|
+
description: 'Detect the current AI coding CLI backend and capabilities',
|
|
669
|
+
params: [],
|
|
670
|
+
execute: (cwd, _args) => cmdDetectBackend(cwd, false),
|
|
671
|
+
},
|
|
672
|
+
// ── Init workflows (21 total) ──
|
|
673
|
+
{
|
|
674
|
+
name: 'grd_init_execute_phase',
|
|
675
|
+
description: 'Initialize context for execute-phase workflow',
|
|
676
|
+
params: [
|
|
677
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number' },
|
|
678
|
+
{
|
|
679
|
+
name: 'include',
|
|
680
|
+
type: 'string',
|
|
681
|
+
required: false,
|
|
682
|
+
description: 'Comma-separated include items',
|
|
683
|
+
},
|
|
684
|
+
],
|
|
685
|
+
execute: (cwd, args) => cmdInitExecutePhase(cwd, args.phase, new Set(args.include ? args.include.split(',') : []), false),
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
name: 'grd_init_execute_parallel',
|
|
689
|
+
description: 'Initialize context for parallel multi-phase execution with independence validation',
|
|
690
|
+
params: [
|
|
691
|
+
{
|
|
692
|
+
name: 'phases',
|
|
693
|
+
type: 'string',
|
|
694
|
+
required: true,
|
|
695
|
+
description: 'Comma-separated phase numbers to execute in parallel (e.g., "27,29")',
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
name: 'include',
|
|
699
|
+
type: 'string',
|
|
700
|
+
required: false,
|
|
701
|
+
description: 'Comma-separated content sections to include (e.g., "state,config")',
|
|
702
|
+
},
|
|
703
|
+
],
|
|
704
|
+
execute: (cwd, args) => {
|
|
705
|
+
const phases = (args.phases || '')
|
|
706
|
+
.split(',')
|
|
707
|
+
.map((p) => p.trim())
|
|
708
|
+
.filter(Boolean);
|
|
709
|
+
const includes = new Set((args.include || '')
|
|
710
|
+
.split(',')
|
|
711
|
+
.map((s) => s.trim())
|
|
712
|
+
.filter(Boolean));
|
|
713
|
+
cmdInitExecuteParallel(cwd, phases, includes, false);
|
|
714
|
+
},
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
name: 'grd_init_plan_phase',
|
|
718
|
+
description: 'Initialize context for plan-phase workflow',
|
|
719
|
+
params: [
|
|
720
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number' },
|
|
721
|
+
{
|
|
722
|
+
name: 'include',
|
|
723
|
+
type: 'string',
|
|
724
|
+
required: false,
|
|
725
|
+
description: 'Comma-separated include items',
|
|
726
|
+
},
|
|
727
|
+
],
|
|
728
|
+
execute: (cwd, args) => cmdInitPlanPhase(cwd, args.phase, new Set(args.include ? args.include.split(',') : []), false),
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
name: 'grd_init_new_project',
|
|
732
|
+
description: 'Initialize context for init workflow',
|
|
733
|
+
params: [],
|
|
734
|
+
execute: (cwd, _args) => cmdInitNewProject(cwd, false),
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
name: 'grd_init_new_milestone',
|
|
738
|
+
description: 'Initialize context for new-milestone workflow',
|
|
739
|
+
params: [],
|
|
740
|
+
execute: (cwd, _args) => cmdInitNewMilestone(cwd, false),
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
name: 'grd_init_quick',
|
|
744
|
+
description: 'Initialize context for quick workflow',
|
|
745
|
+
params: [
|
|
746
|
+
{
|
|
747
|
+
name: 'description',
|
|
748
|
+
type: 'string',
|
|
749
|
+
required: false,
|
|
750
|
+
description: 'Quick task description',
|
|
751
|
+
},
|
|
752
|
+
],
|
|
753
|
+
execute: (cwd, args) => cmdInitQuick(cwd, args.description || '', false),
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
name: 'grd_init_resume',
|
|
757
|
+
description: 'Initialize context for resume workflow',
|
|
758
|
+
params: [],
|
|
759
|
+
execute: (cwd, _args) => cmdInitResume(cwd, false),
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
name: 'grd_init_verify_work',
|
|
763
|
+
description: 'Initialize context for verify-work workflow',
|
|
764
|
+
params: [{ name: 'phase', type: 'string', required: true, description: 'Phase number' }],
|
|
765
|
+
execute: (cwd, args) => cmdInitVerifyWork(cwd, args.phase, false),
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
name: 'grd_init_phase_op',
|
|
769
|
+
description: 'Initialize context for phase-op workflow',
|
|
770
|
+
params: [{ name: 'phase', type: 'string', required: true, description: 'Phase number' }],
|
|
771
|
+
execute: (cwd, args) => cmdInitPhaseOp(cwd, args.phase, false),
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
name: 'grd_init_todos',
|
|
775
|
+
description: 'Initialize context for todos workflow',
|
|
776
|
+
params: [{ name: 'area', type: 'string', required: false, description: 'Area filter' }],
|
|
777
|
+
execute: (cwd, args) => cmdInitTodos(cwd, args.area || undefined, false),
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
name: 'grd_init_milestone_op',
|
|
781
|
+
description: 'Initialize context for milestone-op workflow',
|
|
782
|
+
params: [],
|
|
783
|
+
execute: (cwd, _args) => cmdInitMilestoneOp(cwd, false),
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
name: 'grd_init_plan_milestone_gaps',
|
|
787
|
+
description: 'Initialize context for plan-milestone-gaps workflow',
|
|
788
|
+
params: [],
|
|
789
|
+
execute: (cwd, _args) => cmdInitPlanMilestoneGaps(cwd, false),
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
name: 'grd_init_map_codebase',
|
|
793
|
+
description: 'Initialize context for map-codebase workflow',
|
|
794
|
+
params: [],
|
|
795
|
+
execute: (cwd, _args) => cmdInitMapCodebase(cwd, false),
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
name: 'grd_init_progress',
|
|
799
|
+
description: 'Initialize context for progress workflow',
|
|
800
|
+
params: [
|
|
801
|
+
{
|
|
802
|
+
name: 'include',
|
|
803
|
+
type: 'string',
|
|
804
|
+
required: false,
|
|
805
|
+
description: 'Comma-separated include items',
|
|
806
|
+
},
|
|
807
|
+
],
|
|
808
|
+
execute: (cwd, args) => cmdInitProgress(cwd, new Set(args.include ? args.include.split(',') : []), false),
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
name: 'grd_init_survey',
|
|
812
|
+
description: 'Initialize context for survey research workflow',
|
|
813
|
+
params: [
|
|
814
|
+
{ name: 'topic', type: 'string', required: false, description: 'Survey topic' },
|
|
815
|
+
{
|
|
816
|
+
name: 'include',
|
|
817
|
+
type: 'string',
|
|
818
|
+
required: false,
|
|
819
|
+
description: 'Comma-separated include items',
|
|
820
|
+
},
|
|
821
|
+
],
|
|
822
|
+
execute: (cwd, args) => cmdInitResearchWorkflow(cwd, 'survey', args.topic || '', new Set(args.include ? args.include.split(',') : []), false),
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
name: 'grd_init_deep_dive',
|
|
826
|
+
description: 'Initialize context for deep-dive research workflow',
|
|
827
|
+
params: [
|
|
828
|
+
{ name: 'paper', type: 'string', required: false, description: 'Paper identifier' },
|
|
829
|
+
{
|
|
830
|
+
name: 'include',
|
|
831
|
+
type: 'string',
|
|
832
|
+
required: false,
|
|
833
|
+
description: 'Comma-separated include items',
|
|
834
|
+
},
|
|
835
|
+
],
|
|
836
|
+
execute: (cwd, args) => cmdInitResearchWorkflow(cwd, 'deep-dive', args.paper || '', new Set(args.include ? args.include.split(',') : []), false),
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
name: 'grd_init_feasibility',
|
|
840
|
+
description: 'Initialize context for feasibility research workflow',
|
|
841
|
+
params: [
|
|
842
|
+
{ name: 'approach', type: 'string', required: false, description: 'Approach description' },
|
|
843
|
+
{
|
|
844
|
+
name: 'include',
|
|
845
|
+
type: 'string',
|
|
846
|
+
required: false,
|
|
847
|
+
description: 'Comma-separated include items',
|
|
848
|
+
},
|
|
849
|
+
],
|
|
850
|
+
execute: (cwd, args) => cmdInitResearchWorkflow(cwd, 'feasibility', args.approach || '', new Set(args.include ? args.include.split(',') : []), false),
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
name: 'grd_init_eval_plan',
|
|
854
|
+
description: 'Initialize context for eval-plan research workflow',
|
|
855
|
+
params: [
|
|
856
|
+
{
|
|
857
|
+
name: 'description',
|
|
858
|
+
type: 'string',
|
|
859
|
+
required: false,
|
|
860
|
+
description: 'Evaluation plan description',
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
name: 'include',
|
|
864
|
+
type: 'string',
|
|
865
|
+
required: false,
|
|
866
|
+
description: 'Comma-separated include items',
|
|
867
|
+
},
|
|
868
|
+
],
|
|
869
|
+
execute: (cwd, args) => cmdInitResearchWorkflow(cwd, 'eval-plan', args.description || '', new Set(args.include ? args.include.split(',') : []), false),
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
name: 'grd_init_eval_report',
|
|
873
|
+
description: 'Initialize context for eval-report research workflow',
|
|
874
|
+
params: [
|
|
875
|
+
{
|
|
876
|
+
name: 'description',
|
|
877
|
+
type: 'string',
|
|
878
|
+
required: false,
|
|
879
|
+
description: 'Evaluation report description',
|
|
880
|
+
},
|
|
881
|
+
{
|
|
882
|
+
name: 'include',
|
|
883
|
+
type: 'string',
|
|
884
|
+
required: false,
|
|
885
|
+
description: 'Comma-separated include items',
|
|
886
|
+
},
|
|
887
|
+
],
|
|
888
|
+
execute: (cwd, args) => cmdInitResearchWorkflow(cwd, 'eval-report', args.description || '', new Set(args.include ? args.include.split(',') : []), false),
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
name: 'grd_init_assess_baseline',
|
|
892
|
+
description: 'Initialize context for assess-baseline research workflow',
|
|
893
|
+
params: [
|
|
894
|
+
{
|
|
895
|
+
name: 'description',
|
|
896
|
+
type: 'string',
|
|
897
|
+
required: false,
|
|
898
|
+
description: 'Baseline assessment description',
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
name: 'include',
|
|
902
|
+
type: 'string',
|
|
903
|
+
required: false,
|
|
904
|
+
description: 'Comma-separated include items',
|
|
905
|
+
},
|
|
906
|
+
],
|
|
907
|
+
execute: (cwd, args) => cmdInitResearchWorkflow(cwd, 'assess-baseline', args.description || '', new Set(args.include ? args.include.split(',') : []), false),
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
name: 'grd_init_product_plan',
|
|
911
|
+
description: 'Initialize context for product-plan workflow',
|
|
912
|
+
params: [
|
|
913
|
+
{
|
|
914
|
+
name: 'description',
|
|
915
|
+
type: 'string',
|
|
916
|
+
required: false,
|
|
917
|
+
description: 'Product plan description',
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
name: 'include',
|
|
921
|
+
type: 'string',
|
|
922
|
+
required: false,
|
|
923
|
+
description: 'Comma-separated include items',
|
|
924
|
+
},
|
|
925
|
+
],
|
|
926
|
+
execute: (cwd, args) => cmdInitResearchWorkflow(cwd, 'product-plan', args.description || '', new Set(args.include ? args.include.split(',') : []), false),
|
|
927
|
+
},
|
|
928
|
+
{
|
|
929
|
+
name: 'grd_init_iterate',
|
|
930
|
+
description: 'Initialize context for iterate workflow',
|
|
931
|
+
params: [
|
|
932
|
+
{
|
|
933
|
+
name: 'description',
|
|
934
|
+
type: 'string',
|
|
935
|
+
required: false,
|
|
936
|
+
description: 'Iteration description',
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
name: 'include',
|
|
940
|
+
type: 'string',
|
|
941
|
+
required: false,
|
|
942
|
+
description: 'Comma-separated include items',
|
|
943
|
+
},
|
|
944
|
+
],
|
|
945
|
+
execute: (cwd, args) => cmdInitResearchWorkflow(cwd, 'iterate', args.description || '', new Set(args.include ? args.include.split(',') : []), false),
|
|
946
|
+
},
|
|
947
|
+
// ── Agent & Operation Workflow Inits ──
|
|
948
|
+
{
|
|
949
|
+
name: 'grd_init_debug',
|
|
950
|
+
description: 'Initialize debug context with phase info, debug files, and project state',
|
|
951
|
+
params: [
|
|
952
|
+
{ name: 'phase', type: 'string', required: false, description: 'Optional phase number' },
|
|
953
|
+
],
|
|
954
|
+
execute: (cwd, args) => cmdInitDebug(cwd, args.phase || null, false),
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
name: 'grd_init_debugger',
|
|
958
|
+
description: 'Initialize grd-debugger agent context (alias for grd_init_debug)',
|
|
959
|
+
params: [
|
|
960
|
+
{ name: 'phase', type: 'string', required: false, description: 'Optional phase number' },
|
|
961
|
+
],
|
|
962
|
+
execute: (cwd, args) => cmdInitDebugger(cwd, args.phase || null, false),
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
name: 'grd_init_integration_check',
|
|
966
|
+
description: 'Initialize integration-check context with phase inventory and deferred validations',
|
|
967
|
+
params: [
|
|
968
|
+
{ name: 'phase', type: 'string', required: false, description: 'Optional phase number' },
|
|
969
|
+
],
|
|
970
|
+
execute: (cwd, args) => cmdInitIntegrationCheck(cwd, args.phase || null, false),
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
name: 'grd_init_integration_checker',
|
|
974
|
+
description: 'Initialize grd-integration-checker agent context (alias for grd_init_integration_check)',
|
|
975
|
+
params: [
|
|
976
|
+
{ name: 'phase', type: 'string', required: false, description: 'Optional phase number' },
|
|
977
|
+
],
|
|
978
|
+
execute: (cwd, args) => cmdInitIntegrationChecker(cwd, args.phase || null, false),
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
name: 'grd_init_migrate',
|
|
982
|
+
description: 'Initialize migrate context with planning directory layout inventory',
|
|
983
|
+
params: [],
|
|
984
|
+
execute: (cwd, _args) => cmdInitMigrate(cwd, false),
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
name: 'grd_init_migrator',
|
|
988
|
+
description: 'Initialize grd-migrator agent context (alias for grd_init_migrate)',
|
|
989
|
+
params: [],
|
|
990
|
+
execute: (cwd, _args) => cmdInitMigrator(cwd, false),
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
name: 'grd_init_plan_check',
|
|
994
|
+
description: 'Initialize plan-check context with phase plan files and roadmap goal',
|
|
995
|
+
params: [
|
|
996
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number to check' },
|
|
997
|
+
],
|
|
998
|
+
execute: (cwd, args) => cmdInitPlanCheck(cwd, args.phase, false),
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
name: 'grd_init_plan_checker',
|
|
1002
|
+
description: 'Initialize grd-plan-checker agent context (alias for grd_init_plan_check)',
|
|
1003
|
+
params: [
|
|
1004
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number to check' },
|
|
1005
|
+
],
|
|
1006
|
+
execute: (cwd, args) => cmdInitPlanChecker(cwd, args.phase, false),
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
name: 'grd_init_executor',
|
|
1010
|
+
description: 'Initialize grd-executor agent context with phase plans, STATE, and ROADMAP',
|
|
1011
|
+
params: [
|
|
1012
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number' },
|
|
1013
|
+
{
|
|
1014
|
+
name: 'include',
|
|
1015
|
+
type: 'string',
|
|
1016
|
+
required: false,
|
|
1017
|
+
description: 'Comma-separated include items (state,roadmap)',
|
|
1018
|
+
},
|
|
1019
|
+
],
|
|
1020
|
+
execute: (cwd, args) => cmdInitExecutor(cwd, args.phase, new Set(args.include ? args.include.split(',') : []), false),
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
name: 'grd_init_code_review',
|
|
1024
|
+
description: 'Initialize code-review context for a phase',
|
|
1025
|
+
params: [{ name: 'phase', type: 'string', required: true, description: 'Phase number' }],
|
|
1026
|
+
execute: (cwd, args) => cmdInitCodeReview(cwd, args.phase, false),
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
name: 'grd_init_code_reviewer',
|
|
1030
|
+
description: 'Initialize grd-code-reviewer agent context (alias for grd_init_code_review)',
|
|
1031
|
+
params: [{ name: 'phase', type: 'string', required: true, description: 'Phase number' }],
|
|
1032
|
+
execute: (cwd, args) => cmdInitCodeReviewer(cwd, args.phase, false),
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
name: 'grd_init_phase_research',
|
|
1036
|
+
description: 'Initialize phase-research context with research files for a phase',
|
|
1037
|
+
params: [
|
|
1038
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number' },
|
|
1039
|
+
{
|
|
1040
|
+
name: 'include',
|
|
1041
|
+
type: 'string',
|
|
1042
|
+
required: false,
|
|
1043
|
+
description: 'Comma-separated include items',
|
|
1044
|
+
},
|
|
1045
|
+
],
|
|
1046
|
+
execute: (cwd, args) => cmdInitPhaseResearch(cwd, args.phase, new Set(args.include ? args.include.split(',') : []), false),
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
name: 'grd_init_phase_researcher',
|
|
1050
|
+
description: 'Initialize grd-phase-researcher agent context (alias for grd_init_phase_research)',
|
|
1051
|
+
params: [
|
|
1052
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number' },
|
|
1053
|
+
{
|
|
1054
|
+
name: 'include',
|
|
1055
|
+
type: 'string',
|
|
1056
|
+
required: false,
|
|
1057
|
+
description: 'Comma-separated include items',
|
|
1058
|
+
},
|
|
1059
|
+
],
|
|
1060
|
+
execute: (cwd, args) => cmdInitPhaseResearcher(cwd, args.phase, new Set(args.include ? args.include.split(',') : []), false),
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
name: 'grd_init_codebase_mapper',
|
|
1064
|
+
description: 'Initialize grd-codebase-mapper agent context (alias for grd_init_map_codebase)',
|
|
1065
|
+
params: [],
|
|
1066
|
+
execute: (cwd, _args) => cmdInitCodebaseMapper(cwd, false),
|
|
1067
|
+
},
|
|
1068
|
+
// ── Research Agent Inits (direct functions) ──
|
|
1069
|
+
{
|
|
1070
|
+
name: 'grd_init_baseline_assessor',
|
|
1071
|
+
description: 'Initialize grd-baseline-assessor agent context with assessor model and eval config',
|
|
1072
|
+
params: [],
|
|
1073
|
+
execute: (cwd, _args) => cmdInitBaselineAssessor(cwd, false),
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
name: 'grd_init_deep_diver',
|
|
1077
|
+
description: 'Initialize grd-deep-diver agent context with topic, landscape, and papers info',
|
|
1078
|
+
params: [
|
|
1079
|
+
{ name: 'topic', type: 'string', required: false, description: 'Paper or topic identifier' },
|
|
1080
|
+
],
|
|
1081
|
+
execute: (cwd, args) => cmdInitDeepDiver(cwd, args.topic || '', false),
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
name: 'grd_init_eval_planner',
|
|
1085
|
+
description: 'Initialize grd-eval-planner agent context with phase info and eval config',
|
|
1086
|
+
params: [
|
|
1087
|
+
{ name: 'phase', type: 'string', required: false, description: 'Optional phase number' },
|
|
1088
|
+
],
|
|
1089
|
+
execute: (cwd, args) => cmdInitEvalPlanner(cwd, args.phase || null, false),
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
name: 'grd_init_eval_reporter',
|
|
1093
|
+
description: 'Initialize grd-eval-reporter agent context with phase plans, summaries, and eval config',
|
|
1094
|
+
params: [
|
|
1095
|
+
{ name: 'phase', type: 'string', required: false, description: 'Optional phase number' },
|
|
1096
|
+
],
|
|
1097
|
+
execute: (cwd, args) => cmdInitEvalReporter(cwd, args.phase || null, false),
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
name: 'grd_init_feasibility_analyst',
|
|
1101
|
+
description: 'Initialize grd-feasibility-analyst agent context with topic, deep dives, and research files',
|
|
1102
|
+
params: [
|
|
1103
|
+
{
|
|
1104
|
+
name: 'topic',
|
|
1105
|
+
type: 'string',
|
|
1106
|
+
required: false,
|
|
1107
|
+
description: 'Approach or topic to analyze',
|
|
1108
|
+
},
|
|
1109
|
+
],
|
|
1110
|
+
execute: (cwd, args) => cmdInitFeasibilityAnalyst(cwd, args.topic || '', false),
|
|
1111
|
+
},
|
|
1112
|
+
{
|
|
1113
|
+
name: 'grd_init_product_owner',
|
|
1114
|
+
description: 'Initialize grd-product-owner agent context with project docs and milestone info',
|
|
1115
|
+
params: [],
|
|
1116
|
+
execute: (cwd, _args) => cmdInitProductOwner(cwd, false),
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
name: 'grd_init_project_researcher',
|
|
1120
|
+
description: 'Initialize grd-project-researcher agent context with project docs and research landscape',
|
|
1121
|
+
params: [{ name: 'topic', type: 'string', required: false, description: 'Research topic' }],
|
|
1122
|
+
execute: (cwd, args) => cmdInitProjectResearcher(cwd, args.topic || '', false),
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
name: 'grd_init_research_synthesizer',
|
|
1126
|
+
description: 'Initialize grd-research-synthesizer agent context with deep dives and research files',
|
|
1127
|
+
params: [],
|
|
1128
|
+
execute: (cwd, _args) => cmdInitResearchSynthesizer(cwd, false),
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
name: 'grd_init_roadmapper',
|
|
1132
|
+
description: 'Initialize grd-roadmapper agent context with project docs and milestone info',
|
|
1133
|
+
params: [],
|
|
1134
|
+
execute: (cwd, _args) => cmdInitRoadmapper(cwd, false),
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
name: 'grd_init_surveyor',
|
|
1138
|
+
description: 'Initialize grd-surveyor agent context with landscape, papers, and research config',
|
|
1139
|
+
params: [{ name: 'topic', type: 'string', required: false, description: 'Survey topic' }],
|
|
1140
|
+
execute: (cwd, args) => cmdInitSurveyor(cwd, args.topic || '', false),
|
|
1141
|
+
},
|
|
1142
|
+
{
|
|
1143
|
+
name: 'grd_init_verifier',
|
|
1144
|
+
description: 'Initialize grd-verifier agent context with phase plans, summaries, and eval config',
|
|
1145
|
+
params: [
|
|
1146
|
+
{ name: 'phase', type: 'string', required: false, description: 'Optional phase number' },
|
|
1147
|
+
],
|
|
1148
|
+
execute: (cwd, args) => cmdInitVerifier(cwd, args.phase || null, false),
|
|
1149
|
+
},
|
|
1150
|
+
// Direct research function bindings (without the generic cmdInitResearchWorkflow wrapper)
|
|
1151
|
+
{
|
|
1152
|
+
name: 'grd_init_assess_baseline_direct',
|
|
1153
|
+
description: 'Initialize assess-baseline context directly (assessor model, eval config, artifact existence)',
|
|
1154
|
+
params: [],
|
|
1155
|
+
execute: (cwd, _args) => cmdInitAssessBaseline(cwd, false),
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
name: 'grd_init_deep_dive_direct',
|
|
1159
|
+
description: 'Initialize deep-dive context directly (deep-diver model, existing deep dives list)',
|
|
1160
|
+
params: [
|
|
1161
|
+
{ name: 'topic', type: 'string', required: false, description: 'Paper or topic identifier' },
|
|
1162
|
+
],
|
|
1163
|
+
execute: (cwd, args) => cmdInitDeepDive(cwd, args.topic || '', false),
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
name: 'grd_init_eval_plan_direct',
|
|
1167
|
+
description: 'Initialize eval-plan context directly (eval-planner model, phase info, eval config)',
|
|
1168
|
+
params: [
|
|
1169
|
+
{ name: 'phase', type: 'string', required: false, description: 'Optional phase number' },
|
|
1170
|
+
],
|
|
1171
|
+
execute: (cwd, args) => cmdInitEvalPlan(cwd, args.phase || null, false),
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
name: 'grd_init_eval_report_direct',
|
|
1175
|
+
description: 'Initialize eval-report context directly (eval-reporter model, phase plans, summaries)',
|
|
1176
|
+
params: [
|
|
1177
|
+
{ name: 'phase', type: 'string', required: false, description: 'Optional phase number' },
|
|
1178
|
+
],
|
|
1179
|
+
execute: (cwd, args) => cmdInitEvalReport(cwd, args.phase || null, false),
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
name: 'grd_init_feasibility_direct',
|
|
1183
|
+
description: 'Initialize feasibility context directly (feasibility model, topic, deep dives)',
|
|
1184
|
+
params: [
|
|
1185
|
+
{
|
|
1186
|
+
name: 'topic',
|
|
1187
|
+
type: 'string',
|
|
1188
|
+
required: false,
|
|
1189
|
+
description: 'Approach or topic to analyze',
|
|
1190
|
+
},
|
|
1191
|
+
],
|
|
1192
|
+
execute: (cwd, args) => cmdInitFeasibility(cwd, args.topic || '', false),
|
|
1193
|
+
},
|
|
1194
|
+
// ── Long-Term Roadmap (12 subcommands) ──
|
|
1195
|
+
{
|
|
1196
|
+
name: 'grd_long_term_roadmap_list',
|
|
1197
|
+
description: 'List all LT milestones',
|
|
1198
|
+
params: [],
|
|
1199
|
+
execute: (cwd, _args) => cmdLongTermRoadmap(cwd, 'list', [], false),
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
name: 'grd_long_term_roadmap_add',
|
|
1203
|
+
description: 'Add a new LT milestone',
|
|
1204
|
+
params: [
|
|
1205
|
+
{ name: 'name', type: 'string', required: true, description: 'LT milestone name' },
|
|
1206
|
+
{ name: 'goal', type: 'string', required: true, description: 'LT milestone goal' },
|
|
1207
|
+
],
|
|
1208
|
+
execute: (cwd, args) => cmdLongTermRoadmap(cwd, 'add', ['--name', args.name, '--goal', args.goal], false),
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
name: 'grd_long_term_roadmap_remove',
|
|
1212
|
+
description: 'Remove an LT milestone (protected if shipped)',
|
|
1213
|
+
params: [
|
|
1214
|
+
{ name: 'id', type: 'string', required: true, description: 'LT milestone ID (e.g. LT-2)' },
|
|
1215
|
+
],
|
|
1216
|
+
execute: (cwd, args) => cmdLongTermRoadmap(cwd, 'remove', ['--id', args.id], false),
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
name: 'grd_long_term_roadmap_update',
|
|
1220
|
+
description: 'Update LT milestone fields (name, goal, status)',
|
|
1221
|
+
params: [
|
|
1222
|
+
{ name: 'id', type: 'string', required: true, description: 'LT milestone ID' },
|
|
1223
|
+
{ name: 'name', type: 'string', required: false, description: 'New name' },
|
|
1224
|
+
{ name: 'goal', type: 'string', required: false, description: 'New goal' },
|
|
1225
|
+
{
|
|
1226
|
+
name: 'status',
|
|
1227
|
+
type: 'string',
|
|
1228
|
+
required: false,
|
|
1229
|
+
description: 'New status (completed/active/planned)',
|
|
1230
|
+
},
|
|
1231
|
+
],
|
|
1232
|
+
execute: (cwd, args) => {
|
|
1233
|
+
const subArgs = ['--id', args.id];
|
|
1234
|
+
if (args.name)
|
|
1235
|
+
subArgs.push('--name', args.name);
|
|
1236
|
+
if (args.goal)
|
|
1237
|
+
subArgs.push('--goal', args.goal);
|
|
1238
|
+
if (args.status)
|
|
1239
|
+
subArgs.push('--status', args.status);
|
|
1240
|
+
return cmdLongTermRoadmap(cwd, 'update', subArgs, false);
|
|
1241
|
+
},
|
|
1242
|
+
},
|
|
1243
|
+
{
|
|
1244
|
+
name: 'grd_long_term_roadmap_link',
|
|
1245
|
+
description: 'Link a normal milestone to an LT milestone',
|
|
1246
|
+
params: [
|
|
1247
|
+
{ name: 'id', type: 'string', required: true, description: 'LT milestone ID' },
|
|
1248
|
+
{ name: 'version', type: 'string', required: true, description: 'Normal milestone version' },
|
|
1249
|
+
{
|
|
1250
|
+
name: 'note',
|
|
1251
|
+
type: 'string',
|
|
1252
|
+
required: false,
|
|
1253
|
+
description: 'Optional note (e.g. "planned")',
|
|
1254
|
+
},
|
|
1255
|
+
],
|
|
1256
|
+
execute: (cwd, args) => {
|
|
1257
|
+
const subArgs = ['--id', args.id, '--version', args.version];
|
|
1258
|
+
if (args.note)
|
|
1259
|
+
subArgs.push('--note', args.note);
|
|
1260
|
+
return cmdLongTermRoadmap(cwd, 'link', subArgs, false);
|
|
1261
|
+
},
|
|
1262
|
+
},
|
|
1263
|
+
{
|
|
1264
|
+
name: 'grd_long_term_roadmap_unlink',
|
|
1265
|
+
description: 'Unlink a normal milestone from an LT milestone (protected if shipped)',
|
|
1266
|
+
params: [
|
|
1267
|
+
{ name: 'id', type: 'string', required: true, description: 'LT milestone ID' },
|
|
1268
|
+
{ name: 'version', type: 'string', required: true, description: 'Normal milestone version' },
|
|
1269
|
+
],
|
|
1270
|
+
execute: (cwd, args) => cmdLongTermRoadmap(cwd, 'unlink', ['--id', args.id, '--version', args.version], false),
|
|
1271
|
+
},
|
|
1272
|
+
{
|
|
1273
|
+
name: 'grd_long_term_roadmap_init',
|
|
1274
|
+
description: 'Auto-group existing ROADMAP.md milestones into LT-1',
|
|
1275
|
+
params: [{ name: 'project', type: 'string', required: false, description: 'Project name' }],
|
|
1276
|
+
execute: (cwd, args) => {
|
|
1277
|
+
const subArgs = args.project
|
|
1278
|
+
? ['--project', args.project]
|
|
1279
|
+
: [];
|
|
1280
|
+
return cmdLongTermRoadmap(cwd, 'init', subArgs, false);
|
|
1281
|
+
},
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
name: 'grd_long_term_roadmap_display',
|
|
1285
|
+
description: 'Display the long-term roadmap in formatted text',
|
|
1286
|
+
params: [],
|
|
1287
|
+
execute: (cwd, _args) => cmdLongTermRoadmap(cwd, 'display', [], false),
|
|
1288
|
+
},
|
|
1289
|
+
{
|
|
1290
|
+
name: 'grd_long_term_roadmap_parse',
|
|
1291
|
+
description: 'Parse the long-term roadmap file into structured data',
|
|
1292
|
+
params: [
|
|
1293
|
+
{
|
|
1294
|
+
name: 'file',
|
|
1295
|
+
type: 'string',
|
|
1296
|
+
required: false,
|
|
1297
|
+
description: 'Path to LONG-TERM-ROADMAP.md',
|
|
1298
|
+
},
|
|
1299
|
+
],
|
|
1300
|
+
execute: (cwd, args) => cmdLongTermRoadmap(cwd, 'parse', args.file ? [args.file] : [], false),
|
|
1301
|
+
},
|
|
1302
|
+
{
|
|
1303
|
+
name: 'grd_long_term_roadmap_validate',
|
|
1304
|
+
description: 'Validate the long-term roadmap structure',
|
|
1305
|
+
params: [
|
|
1306
|
+
{
|
|
1307
|
+
name: 'file',
|
|
1308
|
+
type: 'string',
|
|
1309
|
+
required: false,
|
|
1310
|
+
description: 'Path to LONG-TERM-ROADMAP.md',
|
|
1311
|
+
},
|
|
1312
|
+
],
|
|
1313
|
+
execute: (cwd, args) => cmdLongTermRoadmap(cwd, 'validate', args.file ? [args.file] : [], false),
|
|
1314
|
+
},
|
|
1315
|
+
{
|
|
1316
|
+
name: 'grd_long_term_roadmap_refine',
|
|
1317
|
+
description: 'Output context for AI discussion of an LT milestone',
|
|
1318
|
+
params: [{ name: 'id', type: 'string', required: true, description: 'LT milestone ID' }],
|
|
1319
|
+
execute: (cwd, args) => cmdLongTermRoadmap(cwd, 'refine', ['--id', args.id], false),
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
name: 'grd_long_term_roadmap_history',
|
|
1323
|
+
description: 'Update refinement history in the long-term roadmap',
|
|
1324
|
+
params: [
|
|
1325
|
+
{ name: 'action', type: 'string', required: true, description: 'History action' },
|
|
1326
|
+
{ name: 'details', type: 'string', required: true, description: 'Action details' },
|
|
1327
|
+
],
|
|
1328
|
+
execute: (cwd, args) => cmdLongTermRoadmap(cwd, 'history', ['--action', args.action, '--details', args.details], false),
|
|
1329
|
+
},
|
|
1330
|
+
// ── Quality Analysis ──
|
|
1331
|
+
{
|
|
1332
|
+
name: 'grd_quality_analysis',
|
|
1333
|
+
description: 'Run quality analysis for a phase',
|
|
1334
|
+
params: [
|
|
1335
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number to analyze' },
|
|
1336
|
+
],
|
|
1337
|
+
execute: (cwd, args) => cmdQualityAnalysis(cwd, ['--phase', args.phase], false),
|
|
1338
|
+
},
|
|
1339
|
+
// ── Requirement & Search commands ──
|
|
1340
|
+
{
|
|
1341
|
+
name: 'grd_requirement_get',
|
|
1342
|
+
description: 'Get a requirement by ID with status and phase from traceability matrix',
|
|
1343
|
+
params: [
|
|
1344
|
+
{
|
|
1345
|
+
name: 'req_id',
|
|
1346
|
+
type: 'string',
|
|
1347
|
+
required: true,
|
|
1348
|
+
description: 'Requirement ID (e.g. REQ-37)',
|
|
1349
|
+
},
|
|
1350
|
+
],
|
|
1351
|
+
execute: (cwd, args) => cmdRequirementGet(cwd, args.req_id, false),
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
name: 'grd_requirement_list',
|
|
1355
|
+
description: 'List requirements with optional filters (phase, priority, status, category)',
|
|
1356
|
+
params: [
|
|
1357
|
+
{ name: 'phase', type: 'string', required: false, description: 'Filter by phase number' },
|
|
1358
|
+
{
|
|
1359
|
+
name: 'priority',
|
|
1360
|
+
type: 'string',
|
|
1361
|
+
required: false,
|
|
1362
|
+
description: 'Filter by priority (e.g. P1, P2)',
|
|
1363
|
+
},
|
|
1364
|
+
{
|
|
1365
|
+
name: 'status',
|
|
1366
|
+
type: 'string',
|
|
1367
|
+
required: false,
|
|
1368
|
+
description: 'Filter by status (Pending, In Progress, Done, Deferred)',
|
|
1369
|
+
},
|
|
1370
|
+
{ name: 'category', type: 'string', required: false, description: 'Filter by category' },
|
|
1371
|
+
{
|
|
1372
|
+
name: 'all',
|
|
1373
|
+
type: 'boolean',
|
|
1374
|
+
required: false,
|
|
1375
|
+
description: 'Include archived milestone requirements',
|
|
1376
|
+
},
|
|
1377
|
+
],
|
|
1378
|
+
execute: (cwd, args) => cmdRequirementList(cwd, {
|
|
1379
|
+
phase: args.phase || null,
|
|
1380
|
+
priority: args.priority || null,
|
|
1381
|
+
status: args.status || null,
|
|
1382
|
+
category: args.category || null,
|
|
1383
|
+
all: args.all || false,
|
|
1384
|
+
}, false),
|
|
1385
|
+
},
|
|
1386
|
+
{
|
|
1387
|
+
name: 'grd_requirement_traceability',
|
|
1388
|
+
description: 'Get the traceability matrix with optional phase filter',
|
|
1389
|
+
params: [
|
|
1390
|
+
{ name: 'phase', type: 'string', required: false, description: 'Filter by phase number' },
|
|
1391
|
+
],
|
|
1392
|
+
execute: (cwd, args) => cmdRequirementTraceability(cwd, { phase: args.phase || null }, false),
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
name: 'grd_requirement_update_status',
|
|
1396
|
+
description: 'Update the status of a requirement in the traceability matrix',
|
|
1397
|
+
params: [
|
|
1398
|
+
{
|
|
1399
|
+
name: 'req_id',
|
|
1400
|
+
type: 'string',
|
|
1401
|
+
required: true,
|
|
1402
|
+
description: 'Requirement ID (e.g. REQ-37)',
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
name: 'status',
|
|
1406
|
+
type: 'string',
|
|
1407
|
+
required: true,
|
|
1408
|
+
description: 'New status (Pending, In Progress, Done, Deferred)',
|
|
1409
|
+
},
|
|
1410
|
+
],
|
|
1411
|
+
execute: (cwd, args) => cmdRequirementUpdateStatus(cwd, args.req_id, args.status, false),
|
|
1412
|
+
},
|
|
1413
|
+
{
|
|
1414
|
+
name: 'grd_search',
|
|
1415
|
+
description: 'Search across all .planning/ markdown files for a text query',
|
|
1416
|
+
params: [
|
|
1417
|
+
{ name: 'query', type: 'string', required: true, description: 'Text query to search for' },
|
|
1418
|
+
],
|
|
1419
|
+
execute: (cwd, args) => cmdSearch(cwd, args.query, false),
|
|
1420
|
+
},
|
|
1421
|
+
// ── Worktree commands ──
|
|
1422
|
+
{
|
|
1423
|
+
name: 'grd_worktree_create',
|
|
1424
|
+
description: 'Create a git worktree for isolated phase execution',
|
|
1425
|
+
params: [
|
|
1426
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number' },
|
|
1427
|
+
{
|
|
1428
|
+
name: 'milestone',
|
|
1429
|
+
type: 'string',
|
|
1430
|
+
required: false,
|
|
1431
|
+
description: 'Milestone version (defaults to current)',
|
|
1432
|
+
},
|
|
1433
|
+
{ name: 'slug', type: 'string', required: false, description: 'Phase slug for branch name' },
|
|
1434
|
+
{
|
|
1435
|
+
name: 'start_point',
|
|
1436
|
+
type: 'string',
|
|
1437
|
+
required: false,
|
|
1438
|
+
description: 'Branch or commit to fork from (for stacked PRs). If omitted, forks from current HEAD.',
|
|
1439
|
+
},
|
|
1440
|
+
],
|
|
1441
|
+
execute: (cwd, args) => cmdWorktreeCreate(cwd, {
|
|
1442
|
+
phase: args.phase,
|
|
1443
|
+
milestone: args.milestone || null,
|
|
1444
|
+
slug: args.slug || null,
|
|
1445
|
+
startPoint: args.start_point || null,
|
|
1446
|
+
}, false),
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
name: 'grd_worktree_remove',
|
|
1450
|
+
description: 'Remove a git worktree and clean up temp directory',
|
|
1451
|
+
params: [
|
|
1452
|
+
{
|
|
1453
|
+
name: 'phase',
|
|
1454
|
+
type: 'string',
|
|
1455
|
+
required: false,
|
|
1456
|
+
description: 'Phase number to remove worktree for',
|
|
1457
|
+
},
|
|
1458
|
+
{ name: 'path', type: 'string', required: false, description: 'Direct path to worktree' },
|
|
1459
|
+
{
|
|
1460
|
+
name: 'stale',
|
|
1461
|
+
type: 'boolean',
|
|
1462
|
+
required: false,
|
|
1463
|
+
description: 'Remove all stale worktrees',
|
|
1464
|
+
},
|
|
1465
|
+
],
|
|
1466
|
+
execute: (cwd, args) => args.stale
|
|
1467
|
+
? cmdWorktreeRemoveStale(cwd, false)
|
|
1468
|
+
: cmdWorktreeRemove(cwd, { phase: args.phase || null, path: args.path || null }, false),
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
name: 'grd_worktree_list',
|
|
1472
|
+
description: 'List all active GRD worktrees',
|
|
1473
|
+
params: [],
|
|
1474
|
+
execute: (cwd, _args) => cmdWorktreeList(cwd, false),
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
name: 'grd_worktree_push_pr',
|
|
1478
|
+
description: 'Push worktree branch and create a PR targeting the base branch',
|
|
1479
|
+
params: [
|
|
1480
|
+
{ name: 'phase', type: 'string', required: true, description: 'Phase number' },
|
|
1481
|
+
{ name: 'milestone', type: 'string', required: false, description: 'Milestone version' },
|
|
1482
|
+
{ name: 'title', type: 'string', required: false, description: 'PR title' },
|
|
1483
|
+
{ name: 'body', type: 'string', required: false, description: 'PR body markdown' },
|
|
1484
|
+
{ name: 'base', type: 'string', required: false, description: 'Base branch for PR' },
|
|
1485
|
+
],
|
|
1486
|
+
execute: (cwd, args) => cmdWorktreePushAndPR(cwd, {
|
|
1487
|
+
phase: args.phase,
|
|
1488
|
+
milestone: args.milestone || null,
|
|
1489
|
+
title: args.title || null,
|
|
1490
|
+
body: args.body || null,
|
|
1491
|
+
base: args.base || null,
|
|
1492
|
+
}, false),
|
|
1493
|
+
},
|
|
1494
|
+
// ── Autopilot ──
|
|
1495
|
+
{
|
|
1496
|
+
name: 'grd_autopilot_run',
|
|
1497
|
+
description: 'Run autopilot to plan and execute multiple phases sequentially with fresh context per step',
|
|
1498
|
+
params: [
|
|
1499
|
+
{
|
|
1500
|
+
name: 'phase_from',
|
|
1501
|
+
type: 'string',
|
|
1502
|
+
required: false,
|
|
1503
|
+
description: 'Starting phase number (inclusive)',
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
name: 'phase_to',
|
|
1507
|
+
type: 'string',
|
|
1508
|
+
required: false,
|
|
1509
|
+
description: 'Ending phase number (inclusive)',
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
name: 'milestone',
|
|
1513
|
+
type: 'boolean',
|
|
1514
|
+
required: false,
|
|
1515
|
+
description: 'Run in milestone mode (default when no phase range given)',
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
name: 'dry_run',
|
|
1519
|
+
type: 'boolean',
|
|
1520
|
+
required: false,
|
|
1521
|
+
description: 'Show plan without executing',
|
|
1522
|
+
},
|
|
1523
|
+
{
|
|
1524
|
+
name: 'skip_plan',
|
|
1525
|
+
type: 'boolean',
|
|
1526
|
+
required: false,
|
|
1527
|
+
description: 'Skip planning step',
|
|
1528
|
+
},
|
|
1529
|
+
{
|
|
1530
|
+
name: 'skip_execute',
|
|
1531
|
+
type: 'boolean',
|
|
1532
|
+
required: false,
|
|
1533
|
+
description: 'Skip execution step',
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
name: 'timeout',
|
|
1537
|
+
type: 'number',
|
|
1538
|
+
required: false,
|
|
1539
|
+
description: 'Timeout per invocation in minutes (default: 30)',
|
|
1540
|
+
},
|
|
1541
|
+
{
|
|
1542
|
+
name: 'max_turns',
|
|
1543
|
+
type: 'number',
|
|
1544
|
+
required: false,
|
|
1545
|
+
description: 'Max turns per claude -p invocation',
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
name: 'model',
|
|
1549
|
+
type: 'string',
|
|
1550
|
+
required: false,
|
|
1551
|
+
description: 'Model override for claude -p',
|
|
1552
|
+
},
|
|
1553
|
+
],
|
|
1554
|
+
execute: (cwd, args) => {
|
|
1555
|
+
const cliArgs = [];
|
|
1556
|
+
if (args.phase_from)
|
|
1557
|
+
cliArgs.push('--phase-from', args.phase_from);
|
|
1558
|
+
if (args.phase_to)
|
|
1559
|
+
cliArgs.push('--phase-to', args.phase_to);
|
|
1560
|
+
if (args.milestone)
|
|
1561
|
+
cliArgs.push('--milestone');
|
|
1562
|
+
if (args.dry_run)
|
|
1563
|
+
cliArgs.push('--dry-run');
|
|
1564
|
+
if (args.skip_plan)
|
|
1565
|
+
cliArgs.push('--skip-plan');
|
|
1566
|
+
if (args.skip_execute)
|
|
1567
|
+
cliArgs.push('--skip-execute');
|
|
1568
|
+
if (args.timeout)
|
|
1569
|
+
cliArgs.push('--timeout', String(args.timeout));
|
|
1570
|
+
if (args.max_turns)
|
|
1571
|
+
cliArgs.push('--max-turns', String(args.max_turns));
|
|
1572
|
+
if (args.model)
|
|
1573
|
+
cliArgs.push('--model', args.model);
|
|
1574
|
+
return cmdAutopilot(cwd, cliArgs, false);
|
|
1575
|
+
},
|
|
1576
|
+
},
|
|
1577
|
+
{
|
|
1578
|
+
name: 'grd_autopilot_init',
|
|
1579
|
+
description: 'Get autopilot pre-flight context: phase range, config, claude availability',
|
|
1580
|
+
params: [],
|
|
1581
|
+
execute: (cwd, _args) => cmdInitAutopilot(cwd, false),
|
|
1582
|
+
},
|
|
1583
|
+
// ── Multi-Milestone Autopilot ──
|
|
1584
|
+
{
|
|
1585
|
+
name: 'grd_multi_milestone_autopilot_run',
|
|
1586
|
+
description: 'Plan and execute phases across multiple milestones autonomously, completing one milestone and starting the next',
|
|
1587
|
+
params: [
|
|
1588
|
+
{
|
|
1589
|
+
name: 'max_milestones',
|
|
1590
|
+
type: 'number',
|
|
1591
|
+
required: false,
|
|
1592
|
+
description: 'Maximum milestones to process (default: 10)',
|
|
1593
|
+
},
|
|
1594
|
+
{
|
|
1595
|
+
name: 'dry_run',
|
|
1596
|
+
type: 'boolean',
|
|
1597
|
+
required: false,
|
|
1598
|
+
description: 'Preview without executing',
|
|
1599
|
+
},
|
|
1600
|
+
{
|
|
1601
|
+
name: 'timeout',
|
|
1602
|
+
type: 'number',
|
|
1603
|
+
required: false,
|
|
1604
|
+
description: 'Per-subprocess timeout in minutes',
|
|
1605
|
+
},
|
|
1606
|
+
{
|
|
1607
|
+
name: 'max_turns',
|
|
1608
|
+
type: 'number',
|
|
1609
|
+
required: false,
|
|
1610
|
+
description: 'Max turns per subprocess',
|
|
1611
|
+
},
|
|
1612
|
+
{
|
|
1613
|
+
name: 'model',
|
|
1614
|
+
type: 'string',
|
|
1615
|
+
required: false,
|
|
1616
|
+
description: 'Model override',
|
|
1617
|
+
},
|
|
1618
|
+
{
|
|
1619
|
+
name: 'skip_plan',
|
|
1620
|
+
type: 'boolean',
|
|
1621
|
+
required: false,
|
|
1622
|
+
description: 'Skip planning step',
|
|
1623
|
+
},
|
|
1624
|
+
{
|
|
1625
|
+
name: 'skip_execute',
|
|
1626
|
+
type: 'boolean',
|
|
1627
|
+
required: false,
|
|
1628
|
+
description: 'Skip execution step',
|
|
1629
|
+
},
|
|
1630
|
+
],
|
|
1631
|
+
execute: (cwd, args) => {
|
|
1632
|
+
const cliArgs = [];
|
|
1633
|
+
if (args.max_milestones)
|
|
1634
|
+
cliArgs.push('--max-milestones', String(args.max_milestones));
|
|
1635
|
+
if (args.dry_run)
|
|
1636
|
+
cliArgs.push('--dry-run');
|
|
1637
|
+
if (args.timeout)
|
|
1638
|
+
cliArgs.push('--timeout', String(args.timeout));
|
|
1639
|
+
if (args.max_turns)
|
|
1640
|
+
cliArgs.push('--max-turns', String(args.max_turns));
|
|
1641
|
+
if (args.model)
|
|
1642
|
+
cliArgs.push('--model', args.model);
|
|
1643
|
+
if (args.skip_plan)
|
|
1644
|
+
cliArgs.push('--skip-plan');
|
|
1645
|
+
if (args.skip_execute)
|
|
1646
|
+
cliArgs.push('--skip-execute');
|
|
1647
|
+
return cmdMultiMilestoneAutopilot(cwd, cliArgs, false);
|
|
1648
|
+
},
|
|
1649
|
+
},
|
|
1650
|
+
{
|
|
1651
|
+
name: 'grd_multi_milestone_autopilot_init',
|
|
1652
|
+
description: 'Pre-flight context for multi-milestone autopilot: LT roadmap state, milestone completion, next milestone',
|
|
1653
|
+
params: [],
|
|
1654
|
+
execute: (cwd, _args) => cmdInitMultiMilestoneAutopilot(cwd, false),
|
|
1655
|
+
},
|
|
1656
|
+
// ── Autoplan ──
|
|
1657
|
+
{
|
|
1658
|
+
name: 'grd_autoplan_run',
|
|
1659
|
+
description: 'Automatically generate a milestone from evolve discovery results or fresh discovery',
|
|
1660
|
+
params: [
|
|
1661
|
+
{
|
|
1662
|
+
name: 'dry_run',
|
|
1663
|
+
type: 'boolean',
|
|
1664
|
+
required: false,
|
|
1665
|
+
description: 'Preview the autoplan prompt without executing',
|
|
1666
|
+
},
|
|
1667
|
+
{
|
|
1668
|
+
name: 'timeout',
|
|
1669
|
+
type: 'number',
|
|
1670
|
+
required: false,
|
|
1671
|
+
description: 'Subprocess timeout in minutes',
|
|
1672
|
+
},
|
|
1673
|
+
{
|
|
1674
|
+
name: 'max_turns',
|
|
1675
|
+
type: 'number',
|
|
1676
|
+
required: false,
|
|
1677
|
+
description: 'Max turns for subprocess',
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
name: 'model',
|
|
1681
|
+
type: 'string',
|
|
1682
|
+
required: false,
|
|
1683
|
+
description: 'Model override',
|
|
1684
|
+
},
|
|
1685
|
+
{
|
|
1686
|
+
name: 'pick_pct',
|
|
1687
|
+
type: 'number',
|
|
1688
|
+
required: false,
|
|
1689
|
+
description: 'Discovery pick percentage (default: 50)',
|
|
1690
|
+
},
|
|
1691
|
+
{
|
|
1692
|
+
name: 'name',
|
|
1693
|
+
type: 'string',
|
|
1694
|
+
required: false,
|
|
1695
|
+
description: 'Override milestone name',
|
|
1696
|
+
},
|
|
1697
|
+
],
|
|
1698
|
+
execute: (cwd, args) => {
|
|
1699
|
+
const cliArgs = [];
|
|
1700
|
+
if (args.dry_run)
|
|
1701
|
+
cliArgs.push('--dry-run');
|
|
1702
|
+
if (args.timeout)
|
|
1703
|
+
cliArgs.push('--timeout', String(args.timeout));
|
|
1704
|
+
if (args.max_turns)
|
|
1705
|
+
cliArgs.push('--max-turns', String(args.max_turns));
|
|
1706
|
+
if (args.model)
|
|
1707
|
+
cliArgs.push('--model', args.model);
|
|
1708
|
+
if (args.pick_pct)
|
|
1709
|
+
cliArgs.push('--pick-pct', String(args.pick_pct));
|
|
1710
|
+
if (args.name)
|
|
1711
|
+
cliArgs.push('--name', args.name);
|
|
1712
|
+
return cmdAutoplan(cwd, cliArgs, false);
|
|
1713
|
+
},
|
|
1714
|
+
},
|
|
1715
|
+
{
|
|
1716
|
+
name: 'grd_autoplan_init',
|
|
1717
|
+
description: 'Pre-flight context for autoplan: evolve state, current milestone, config',
|
|
1718
|
+
params: [],
|
|
1719
|
+
execute: (cwd, _args) => cmdInitAutoplan(cwd, false),
|
|
1720
|
+
},
|
|
1721
|
+
// ── Evolve Orchestrator ──
|
|
1722
|
+
{
|
|
1723
|
+
name: 'grd_evolve_run',
|
|
1724
|
+
description: 'Run autonomous self-improvement loop with sonnet-tier models',
|
|
1725
|
+
params: [
|
|
1726
|
+
{
|
|
1727
|
+
name: 'iterations',
|
|
1728
|
+
type: 'number',
|
|
1729
|
+
description: 'Number of iterations to run (default: 1)',
|
|
1730
|
+
required: false,
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
name: 'items',
|
|
1734
|
+
type: 'number',
|
|
1735
|
+
description: 'Work items per iteration (default: 5)',
|
|
1736
|
+
required: false,
|
|
1737
|
+
},
|
|
1738
|
+
{
|
|
1739
|
+
name: 'timeout',
|
|
1740
|
+
type: 'number',
|
|
1741
|
+
description: 'Timeout per subprocess in minutes',
|
|
1742
|
+
required: false,
|
|
1743
|
+
},
|
|
1744
|
+
{
|
|
1745
|
+
name: 'max_turns',
|
|
1746
|
+
type: 'number',
|
|
1747
|
+
description: 'Max turns per claude -p invocation',
|
|
1748
|
+
required: false,
|
|
1749
|
+
},
|
|
1750
|
+
{
|
|
1751
|
+
name: 'dry_run',
|
|
1752
|
+
type: 'boolean',
|
|
1753
|
+
description: 'Show plan without executing',
|
|
1754
|
+
required: false,
|
|
1755
|
+
},
|
|
1756
|
+
],
|
|
1757
|
+
execute: async (cwd, args) => {
|
|
1758
|
+
const cliArgs = [];
|
|
1759
|
+
if (args.iterations)
|
|
1760
|
+
cliArgs.push('--iterations', String(args.iterations));
|
|
1761
|
+
if (args.items)
|
|
1762
|
+
cliArgs.push('--items', String(args.items));
|
|
1763
|
+
if (args.timeout)
|
|
1764
|
+
cliArgs.push('--timeout', String(args.timeout));
|
|
1765
|
+
if (args.max_turns)
|
|
1766
|
+
cliArgs.push('--max-turns', String(args.max_turns));
|
|
1767
|
+
if (args.dry_run)
|
|
1768
|
+
cliArgs.push('--dry-run');
|
|
1769
|
+
return cmdEvolve(cwd, cliArgs, false);
|
|
1770
|
+
},
|
|
1771
|
+
},
|
|
1772
|
+
// ── Evolve Engine ──
|
|
1773
|
+
{
|
|
1774
|
+
name: 'grd_evolve_discover',
|
|
1775
|
+
description: 'Discover work items for self-improvement across 8 dimensions (product-ideation, improve-features, new-features, productivity, quality, usability, consistency, stability) and select top priority items. Product ideation discovers creative feature ideas by analyzing PROJECT.md and the product roadmap.',
|
|
1776
|
+
params: [
|
|
1777
|
+
{
|
|
1778
|
+
name: 'count',
|
|
1779
|
+
type: 'number',
|
|
1780
|
+
required: false,
|
|
1781
|
+
description: 'Number of items to select (default: 5)',
|
|
1782
|
+
},
|
|
1783
|
+
],
|
|
1784
|
+
execute: async (cwd, args) => {
|
|
1785
|
+
const cliArgs = [];
|
|
1786
|
+
if (args.count)
|
|
1787
|
+
cliArgs.push('--count', String(args.count));
|
|
1788
|
+
return await cmdEvolveDiscover(cwd, cliArgs, false);
|
|
1789
|
+
},
|
|
1790
|
+
},
|
|
1791
|
+
{
|
|
1792
|
+
name: 'grd_evolve_state',
|
|
1793
|
+
description: 'Read the current evolve iteration state file (selected items, remaining items, iteration history)',
|
|
1794
|
+
params: [],
|
|
1795
|
+
execute: (cwd, _args) => cmdEvolveState(cwd, [], false),
|
|
1796
|
+
},
|
|
1797
|
+
{
|
|
1798
|
+
name: 'grd_evolve_advance',
|
|
1799
|
+
description: 'Advance to the next evolve iteration: carry over remaining items, merge bugfixes, increment counter',
|
|
1800
|
+
params: [],
|
|
1801
|
+
execute: (cwd, _args) => cmdEvolveAdvance(cwd, [], false),
|
|
1802
|
+
},
|
|
1803
|
+
{
|
|
1804
|
+
name: 'grd_evolve_reset',
|
|
1805
|
+
description: 'Delete the evolve state file to start a fresh iteration',
|
|
1806
|
+
params: [],
|
|
1807
|
+
execute: (cwd, _args) => cmdEvolveReset(cwd, [], false),
|
|
1808
|
+
},
|
|
1809
|
+
{
|
|
1810
|
+
name: 'grd_evolve_init',
|
|
1811
|
+
description: 'Get evolve pre-flight context: backend, models, existing evolve state, milestone info',
|
|
1812
|
+
params: [],
|
|
1813
|
+
execute: (cwd, _args) => cmdInitEvolve(cwd, false),
|
|
1814
|
+
},
|
|
1815
|
+
// -- Wireup Tools --
|
|
1816
|
+
{
|
|
1817
|
+
name: 'grd_wireup_discover',
|
|
1818
|
+
description: 'Discover unwired features in the project via filesystem analysis',
|
|
1819
|
+
params: [],
|
|
1820
|
+
execute: (cwd, _args) => cmdWireupDiscover(cwd, [], false),
|
|
1821
|
+
},
|
|
1822
|
+
{
|
|
1823
|
+
name: 'grd_wireup_run',
|
|
1824
|
+
description: 'Run a full wireup iteration: discover, generate scenarios, execute, detect issues, report',
|
|
1825
|
+
params: [
|
|
1826
|
+
{
|
|
1827
|
+
name: 'target',
|
|
1828
|
+
type: 'string',
|
|
1829
|
+
required: false,
|
|
1830
|
+
description: 'Focus on a specific feature (function name or file path substring)',
|
|
1831
|
+
},
|
|
1832
|
+
{
|
|
1833
|
+
name: 'dry_run',
|
|
1834
|
+
type: 'boolean',
|
|
1835
|
+
required: false,
|
|
1836
|
+
description: 'Discover and generate scenarios without executing them',
|
|
1837
|
+
},
|
|
1838
|
+
],
|
|
1839
|
+
execute: async (cwd, args) => {
|
|
1840
|
+
const cliArgs = [];
|
|
1841
|
+
if (args.target)
|
|
1842
|
+
cliArgs.push('--target', String(args.target));
|
|
1843
|
+
if (args.dry_run)
|
|
1844
|
+
cliArgs.push('--dry-run');
|
|
1845
|
+
return cmdWireupRun(cwd, cliArgs, false);
|
|
1846
|
+
},
|
|
1847
|
+
},
|
|
1848
|
+
{
|
|
1849
|
+
name: 'grd_wireup_state',
|
|
1850
|
+
description: 'Read the current wireup iteration state (features discovered, scenarios, fixes applied)',
|
|
1851
|
+
params: [],
|
|
1852
|
+
execute: (cwd, _args) => cmdWireupState(cwd, [], false),
|
|
1853
|
+
},
|
|
1854
|
+
{
|
|
1855
|
+
name: 'grd_wireup_scenarios',
|
|
1856
|
+
description: 'List generated wireup scenarios for discovered features',
|
|
1857
|
+
params: [],
|
|
1858
|
+
execute: (cwd, _args) => cmdWireupScenarios(cwd, [], false),
|
|
1859
|
+
},
|
|
1860
|
+
{
|
|
1861
|
+
name: 'grd_wireup_report',
|
|
1862
|
+
description: 'Get the latest wireup report with pass/fail results and issue summary',
|
|
1863
|
+
params: [],
|
|
1864
|
+
execute: (cwd, _args) => cmdWireupReport(cwd, [], false),
|
|
1865
|
+
},
|
|
1866
|
+
// -- Discussion Tools --
|
|
1867
|
+
{
|
|
1868
|
+
name: 'grd_discussion_run',
|
|
1869
|
+
description: 'Run an ad-hoc multi-backend discussion on a topic. Dispatches to configured participants and synthesizes a final answer.',
|
|
1870
|
+
params: [
|
|
1871
|
+
{
|
|
1872
|
+
name: 'topic',
|
|
1873
|
+
type: 'string',
|
|
1874
|
+
required: true,
|
|
1875
|
+
description: 'The topic or question to discuss',
|
|
1876
|
+
},
|
|
1877
|
+
{
|
|
1878
|
+
name: 'participants',
|
|
1879
|
+
type: 'string',
|
|
1880
|
+
required: false,
|
|
1881
|
+
description: 'Comma-separated backend IDs to participate (e.g. "claude,gemini")',
|
|
1882
|
+
},
|
|
1883
|
+
{
|
|
1884
|
+
name: 'rounds',
|
|
1885
|
+
type: 'number',
|
|
1886
|
+
required: false,
|
|
1887
|
+
description: 'Number of discussion rounds (default: 2)',
|
|
1888
|
+
},
|
|
1889
|
+
{
|
|
1890
|
+
name: 'synthesizer',
|
|
1891
|
+
type: 'string',
|
|
1892
|
+
required: false,
|
|
1893
|
+
description: 'Backend to synthesize final answer (default: claude)',
|
|
1894
|
+
},
|
|
1895
|
+
],
|
|
1896
|
+
execute: async (cwd, args) => {
|
|
1897
|
+
const topic = args.topic;
|
|
1898
|
+
const participantStr = args.participants;
|
|
1899
|
+
const participants = participantStr
|
|
1900
|
+
? participantStr.split(',').map((s) => s.trim()).filter(Boolean)
|
|
1901
|
+
: [];
|
|
1902
|
+
const result = await runDiscussion(topic, participants, {
|
|
1903
|
+
rounds: args.rounds,
|
|
1904
|
+
synthesizer: args.synthesizer,
|
|
1905
|
+
cwd,
|
|
1906
|
+
});
|
|
1907
|
+
return JSON.stringify(result);
|
|
1908
|
+
},
|
|
1909
|
+
},
|
|
1910
|
+
{
|
|
1911
|
+
name: 'grd_discussion_config',
|
|
1912
|
+
description: 'Read discussion configuration from config.json — returns discussion settings and backend_roles',
|
|
1913
|
+
params: [],
|
|
1914
|
+
execute: (cwd, _args) => {
|
|
1915
|
+
const config = readConfig(cwd) ?? {};
|
|
1916
|
+
return JSON.stringify({
|
|
1917
|
+
discussion: config.discussion ?? {},
|
|
1918
|
+
backend_roles: config.backend_roles ?? {},
|
|
1919
|
+
});
|
|
1920
|
+
},
|
|
1921
|
+
},
|
|
1922
|
+
{
|
|
1923
|
+
name: 'grd_backends_available',
|
|
1924
|
+
description: 'List all available backends and their configured roles. Returns a map of backend availability and role assignments.',
|
|
1925
|
+
params: [],
|
|
1926
|
+
execute: (cwd, _args) => {
|
|
1927
|
+
const backends = detectAvailableBackends(cwd);
|
|
1928
|
+
const config = readConfig(cwd) ?? {};
|
|
1929
|
+
return JSON.stringify({
|
|
1930
|
+
backends,
|
|
1931
|
+
roles: config.backend_roles ?? {},
|
|
1932
|
+
});
|
|
1933
|
+
},
|
|
1934
|
+
},
|
|
1935
|
+
{
|
|
1936
|
+
name: 'grd_discussion_history',
|
|
1937
|
+
description: 'List or read discussion history. Without filename lists all discussions; with filename reads a specific discussion file.',
|
|
1938
|
+
params: [
|
|
1939
|
+
{
|
|
1940
|
+
name: 'filename',
|
|
1941
|
+
type: 'string',
|
|
1942
|
+
required: false,
|
|
1943
|
+
description: 'Specific discussion file to read (omit to list all)',
|
|
1944
|
+
},
|
|
1945
|
+
],
|
|
1946
|
+
execute: (cwd, args) => {
|
|
1947
|
+
const filename = args.filename;
|
|
1948
|
+
if (filename) {
|
|
1949
|
+
const content = readDiscussion(filename, cwd);
|
|
1950
|
+
return JSON.stringify({ filename, content });
|
|
1951
|
+
}
|
|
1952
|
+
const files = listDiscussions(cwd);
|
|
1953
|
+
return JSON.stringify(files);
|
|
1954
|
+
},
|
|
1955
|
+
},
|
|
1956
|
+
// ── Markdown Splitting ──
|
|
1957
|
+
{
|
|
1958
|
+
name: 'grd_markdown_split',
|
|
1959
|
+
description: 'Split a large markdown file into numbered partials with an index file. Returns split result with partial paths.',
|
|
1960
|
+
params: [
|
|
1961
|
+
{
|
|
1962
|
+
name: 'file',
|
|
1963
|
+
type: 'string',
|
|
1964
|
+
required: true,
|
|
1965
|
+
description: 'Path to markdown file to split (relative to project root)',
|
|
1966
|
+
},
|
|
1967
|
+
{
|
|
1968
|
+
name: 'threshold',
|
|
1969
|
+
type: 'number',
|
|
1970
|
+
required: false,
|
|
1971
|
+
description: 'Token threshold for splitting (default: 25000)',
|
|
1972
|
+
},
|
|
1973
|
+
],
|
|
1974
|
+
execute: (cwd, args) => {
|
|
1975
|
+
const fs = require('fs');
|
|
1976
|
+
const path = require('path');
|
|
1977
|
+
const filePath = path.resolve(cwd, args.file);
|
|
1978
|
+
if (!fs.existsSync(filePath))
|
|
1979
|
+
throw new Error(`File not found: ${filePath}`);
|
|
1980
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
1981
|
+
const basename = path.basename(filePath, '.md');
|
|
1982
|
+
const dir = path.dirname(filePath);
|
|
1983
|
+
const result = splitMarkdown(content, {
|
|
1984
|
+
threshold: args.threshold,
|
|
1985
|
+
basename,
|
|
1986
|
+
});
|
|
1987
|
+
if (!result.split_performed) {
|
|
1988
|
+
process.stdout.write(JSON.stringify({ split_performed: false, reason: result.reason }));
|
|
1989
|
+
return;
|
|
1990
|
+
}
|
|
1991
|
+
fs.writeFileSync(filePath, result.index_content, 'utf-8');
|
|
1992
|
+
const partials = [];
|
|
1993
|
+
for (const part of result.parts) {
|
|
1994
|
+
const partPath = path.join(dir, part.filename);
|
|
1995
|
+
fs.writeFileSync(partPath, part.content, 'utf-8');
|
|
1996
|
+
partials.push(partPath);
|
|
1997
|
+
}
|
|
1998
|
+
process.stdout.write(JSON.stringify({
|
|
1999
|
+
split_performed: true,
|
|
2000
|
+
index_file: filePath,
|
|
2001
|
+
partials,
|
|
2002
|
+
part_count: result.parts.length,
|
|
2003
|
+
}));
|
|
2004
|
+
},
|
|
2005
|
+
},
|
|
2006
|
+
{
|
|
2007
|
+
name: 'grd_markdown_check',
|
|
2008
|
+
description: 'Check if a markdown file is a GRD split index and estimate its token count.',
|
|
2009
|
+
params: [
|
|
2010
|
+
{
|
|
2011
|
+
name: 'file',
|
|
2012
|
+
type: 'string',
|
|
2013
|
+
required: true,
|
|
2014
|
+
description: 'Path to markdown file to check (relative to project root)',
|
|
2015
|
+
},
|
|
2016
|
+
],
|
|
2017
|
+
execute: (cwd, args) => {
|
|
2018
|
+
const fs = require('fs');
|
|
2019
|
+
const path = require('path');
|
|
2020
|
+
const filePath = path.resolve(cwd, args.file);
|
|
2021
|
+
if (!fs.existsSync(filePath))
|
|
2022
|
+
throw new Error(`File not found: ${filePath}`);
|
|
2023
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
2024
|
+
const tokens = estimateTokens(content);
|
|
2025
|
+
process.stdout.write(JSON.stringify({
|
|
2026
|
+
file: filePath,
|
|
2027
|
+
is_index: isIndexFile(content),
|
|
2028
|
+
estimated_tokens: tokens,
|
|
2029
|
+
exceeds_threshold: tokens > 25000,
|
|
2030
|
+
}));
|
|
2031
|
+
},
|
|
2032
|
+
},
|
|
2033
|
+
// ── Coverage & Health ──
|
|
2034
|
+
{
|
|
2035
|
+
name: 'grd_coverage_report',
|
|
2036
|
+
description: 'Generate structured coverage report identifying lib/ modules below a threshold',
|
|
2037
|
+
params: [
|
|
2038
|
+
{
|
|
2039
|
+
name: 'threshold',
|
|
2040
|
+
type: 'number',
|
|
2041
|
+
required: false,
|
|
2042
|
+
description: 'Minimum line coverage percentage (default: 85)',
|
|
2043
|
+
},
|
|
2044
|
+
],
|
|
2045
|
+
execute: (cwd, args) => cmdCoverageReport(cwd, { threshold: args.threshold || 85 }, false),
|
|
2046
|
+
},
|
|
2047
|
+
{
|
|
2048
|
+
name: 'grd_health_check',
|
|
2049
|
+
description: 'Run comprehensive project health checks: tests, lint, format, consistency validation',
|
|
2050
|
+
params: [
|
|
2051
|
+
{
|
|
2052
|
+
name: 'fix',
|
|
2053
|
+
type: 'boolean',
|
|
2054
|
+
required: false,
|
|
2055
|
+
description: 'Whether to auto-fix lint and format issues (default: false)',
|
|
2056
|
+
},
|
|
2057
|
+
],
|
|
2058
|
+
execute: (cwd, args) => cmdHealthCheck(cwd, { fix: args.fix || false }, false),
|
|
2059
|
+
},
|
|
2060
|
+
];
|
|
2061
|
+
// ─── Tool Definition Builder ────────────────────────────────────────────────
|
|
2062
|
+
/**
|
|
2063
|
+
* Transform COMMAND_DESCRIPTORS into MCP-format tool definitions with JSON Schema inputSchema.
|
|
2064
|
+
*/
|
|
2065
|
+
function buildToolDefinitions() {
|
|
2066
|
+
return COMMAND_DESCRIPTORS.map((desc) => {
|
|
2067
|
+
const properties = {};
|
|
2068
|
+
const required = [];
|
|
2069
|
+
for (const param of desc.params) {
|
|
2070
|
+
const prop = {
|
|
2071
|
+
description: param.description,
|
|
2072
|
+
type: 'string',
|
|
2073
|
+
};
|
|
2074
|
+
switch (param.type) {
|
|
2075
|
+
case 'string':
|
|
2076
|
+
prop.type = 'string';
|
|
2077
|
+
break;
|
|
2078
|
+
case 'number':
|
|
2079
|
+
prop.type = 'number';
|
|
2080
|
+
break;
|
|
2081
|
+
case 'boolean':
|
|
2082
|
+
prop.type = 'boolean';
|
|
2083
|
+
break;
|
|
2084
|
+
case 'array':
|
|
2085
|
+
prop.type = 'array';
|
|
2086
|
+
prop.items = { type: 'string' };
|
|
2087
|
+
break;
|
|
2088
|
+
case 'object':
|
|
2089
|
+
prop.type = 'object';
|
|
2090
|
+
break;
|
|
2091
|
+
default:
|
|
2092
|
+
prop.type = 'string';
|
|
2093
|
+
}
|
|
2094
|
+
properties[param.name] = prop;
|
|
2095
|
+
if (param.required) {
|
|
2096
|
+
required.push(param.name);
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
const inputSchema = {
|
|
2100
|
+
type: 'object',
|
|
2101
|
+
properties,
|
|
2102
|
+
};
|
|
2103
|
+
if (required.length > 0) {
|
|
2104
|
+
inputSchema.required = required;
|
|
2105
|
+
}
|
|
2106
|
+
return {
|
|
2107
|
+
name: desc.name,
|
|
2108
|
+
description: desc.description,
|
|
2109
|
+
inputSchema,
|
|
2110
|
+
};
|
|
2111
|
+
});
|
|
2112
|
+
}
|
|
2113
|
+
// ─── Output Capture ─────────────────────────────────────────────────────────
|
|
2114
|
+
const EXIT_SENTINEL = '__MCP_EXEC_EXIT__';
|
|
2115
|
+
/**
|
|
2116
|
+
* Execute a cmd* function while capturing stdout, stderr, and process.exit calls.
|
|
2117
|
+
*
|
|
2118
|
+
* The existing cmd* functions call output() which writes to stdout and calls process.exit(0),
|
|
2119
|
+
* or error() which writes to stderr and calls process.exit(1). We intercept these to capture
|
|
2120
|
+
* the output without actually exiting the process.
|
|
2121
|
+
* @param fn - The synchronous function to execute with captured output
|
|
2122
|
+
* @returns Captured stdout, stderr, and exit code from the executed function
|
|
2123
|
+
*/
|
|
2124
|
+
function captureExecution(fn) {
|
|
2125
|
+
let stdout = '';
|
|
2126
|
+
let stderr = '';
|
|
2127
|
+
let exitCode = 0;
|
|
2128
|
+
const origStdoutWrite = process.stdout.write;
|
|
2129
|
+
const origStderrWrite = process.stderr.write;
|
|
2130
|
+
const origExit = process.exit;
|
|
2131
|
+
process.stdout.write = function (data) {
|
|
2132
|
+
stdout += String(data);
|
|
2133
|
+
return true;
|
|
2134
|
+
};
|
|
2135
|
+
process.stderr.write = function (data) {
|
|
2136
|
+
stderr += String(data);
|
|
2137
|
+
return true;
|
|
2138
|
+
};
|
|
2139
|
+
process.exit = function (code) {
|
|
2140
|
+
exitCode = code;
|
|
2141
|
+
const err = new Error(EXIT_SENTINEL);
|
|
2142
|
+
err.__MCP_EXIT__ = true;
|
|
2143
|
+
err.exitCode = code;
|
|
2144
|
+
throw err;
|
|
2145
|
+
};
|
|
2146
|
+
try {
|
|
2147
|
+
fn();
|
|
2148
|
+
}
|
|
2149
|
+
catch (e) {
|
|
2150
|
+
if (e && e.__MCP_EXIT__) {
|
|
2151
|
+
// Expected -- process.exit was intercepted
|
|
2152
|
+
}
|
|
2153
|
+
else {
|
|
2154
|
+
// Real error from the command
|
|
2155
|
+
process.stdout.write = origStdoutWrite;
|
|
2156
|
+
process.stderr.write = origStderrWrite;
|
|
2157
|
+
process.exit = origExit;
|
|
2158
|
+
throw e;
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
finally {
|
|
2162
|
+
process.stdout.write = origStdoutWrite;
|
|
2163
|
+
process.stderr.write = origStderrWrite;
|
|
2164
|
+
process.exit = origExit;
|
|
2165
|
+
}
|
|
2166
|
+
return { stdout, stderr, exitCode };
|
|
2167
|
+
}
|
|
2168
|
+
/**
|
|
2169
|
+
* Async variant of captureExecution for async tool handlers.
|
|
2170
|
+
* Intercepts stdout/stderr/process.exit while awaiting the async function.
|
|
2171
|
+
*/
|
|
2172
|
+
async function captureExecutionAsync(fn) {
|
|
2173
|
+
let stdout = '';
|
|
2174
|
+
let stderr = '';
|
|
2175
|
+
let exitCode = 0;
|
|
2176
|
+
const origStdoutWrite = process.stdout.write;
|
|
2177
|
+
const origStderrWrite = process.stderr.write;
|
|
2178
|
+
const origExit = process.exit;
|
|
2179
|
+
process.stdout.write = function (data) {
|
|
2180
|
+
stdout += String(data);
|
|
2181
|
+
return true;
|
|
2182
|
+
};
|
|
2183
|
+
process.stderr.write = function (data) {
|
|
2184
|
+
stderr += String(data);
|
|
2185
|
+
return true;
|
|
2186
|
+
};
|
|
2187
|
+
process.exit = function (code) {
|
|
2188
|
+
exitCode = code;
|
|
2189
|
+
const err = new Error(EXIT_SENTINEL);
|
|
2190
|
+
err.__MCP_EXIT__ = true;
|
|
2191
|
+
err.exitCode = code;
|
|
2192
|
+
throw err;
|
|
2193
|
+
};
|
|
2194
|
+
try {
|
|
2195
|
+
await fn();
|
|
2196
|
+
}
|
|
2197
|
+
catch (e) {
|
|
2198
|
+
if (e && e.__MCP_EXIT__) {
|
|
2199
|
+
// Expected -- process.exit was intercepted
|
|
2200
|
+
}
|
|
2201
|
+
else {
|
|
2202
|
+
process.stdout.write = origStdoutWrite;
|
|
2203
|
+
process.stderr.write = origStderrWrite;
|
|
2204
|
+
process.exit = origExit;
|
|
2205
|
+
throw e;
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
finally {
|
|
2209
|
+
process.stdout.write = origStdoutWrite;
|
|
2210
|
+
process.stderr.write = origStderrWrite;
|
|
2211
|
+
process.exit = origExit;
|
|
2212
|
+
}
|
|
2213
|
+
return { stdout, stderr, exitCode };
|
|
2214
|
+
}
|
|
2215
|
+
// ─── MCP Server Class ──────────────────────────────────────────────────────
|
|
2216
|
+
/**
|
|
2217
|
+
* MCP Server implementing JSON-RPC 2.0 protocol.
|
|
2218
|
+
*
|
|
2219
|
+
* Handles: initialize, notifications/initialized, tools/list, tools/call.
|
|
2220
|
+
* Dispatches tool calls to GRD lib/ functions via the COMMAND_DESCRIPTORS registry.
|
|
2221
|
+
*/
|
|
2222
|
+
class McpServer {
|
|
2223
|
+
cwd;
|
|
2224
|
+
toolDefinitions;
|
|
2225
|
+
_initialized;
|
|
2226
|
+
_descriptorMap;
|
|
2227
|
+
constructor(options = {}) {
|
|
2228
|
+
this.cwd = options.cwd || process.cwd();
|
|
2229
|
+
this.toolDefinitions = buildToolDefinitions();
|
|
2230
|
+
this._initialized = false;
|
|
2231
|
+
// Build lookup map: toolName -> descriptor
|
|
2232
|
+
this._descriptorMap = new Map();
|
|
2233
|
+
for (const desc of COMMAND_DESCRIPTORS) {
|
|
2234
|
+
this._descriptorMap.set(desc.name, desc);
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
/**
|
|
2238
|
+
* Handle an incoming JSON-RPC 2.0 message and return a response (or null for notifications).
|
|
2239
|
+
*/
|
|
2240
|
+
handleMessage(message) {
|
|
2241
|
+
// Validate basic JSON-RPC structure
|
|
2242
|
+
if (!message || typeof message !== 'object') {
|
|
2243
|
+
return this._errorResponse(null, -32600, 'Invalid Request');
|
|
2244
|
+
}
|
|
2245
|
+
const { method, id, params } = message;
|
|
2246
|
+
if (!method || typeof method !== 'string') {
|
|
2247
|
+
return this._errorResponse(id || null, -32600, 'Invalid Request');
|
|
2248
|
+
}
|
|
2249
|
+
// Notifications (no id) -- no response expected
|
|
2250
|
+
if (id === undefined || id === null) {
|
|
2251
|
+
// Handle known notifications silently
|
|
2252
|
+
if (method === 'notifications/initialized') {
|
|
2253
|
+
this._initialized = true;
|
|
2254
|
+
}
|
|
2255
|
+
return null;
|
|
2256
|
+
}
|
|
2257
|
+
// Request methods
|
|
2258
|
+
switch (method) {
|
|
2259
|
+
case 'initialize':
|
|
2260
|
+
return this._handleInitialize(id, params);
|
|
2261
|
+
case 'tools/list':
|
|
2262
|
+
return this._handleToolsList(id);
|
|
2263
|
+
case 'tools/call':
|
|
2264
|
+
return this._handleToolsCall(id, params);
|
|
2265
|
+
default:
|
|
2266
|
+
return this._errorResponse(id, -32601, 'Method not found');
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
/**
|
|
2270
|
+
* Handle initialize request -- return server capabilities and info.
|
|
2271
|
+
*/
|
|
2272
|
+
_handleInitialize(id, _params) {
|
|
2273
|
+
return {
|
|
2274
|
+
jsonrpc: '2.0',
|
|
2275
|
+
id,
|
|
2276
|
+
result: {
|
|
2277
|
+
protocolVersion: '2024-11-05',
|
|
2278
|
+
capabilities: {
|
|
2279
|
+
tools: {},
|
|
2280
|
+
},
|
|
2281
|
+
serverInfo: {
|
|
2282
|
+
name: 'grd-mcp-server',
|
|
2283
|
+
version: '0.1.0',
|
|
2284
|
+
},
|
|
2285
|
+
},
|
|
2286
|
+
};
|
|
2287
|
+
}
|
|
2288
|
+
/**
|
|
2289
|
+
* Handle tools/list request -- return all tool definitions.
|
|
2290
|
+
*/
|
|
2291
|
+
_handleToolsList(id) {
|
|
2292
|
+
return {
|
|
2293
|
+
jsonrpc: '2.0',
|
|
2294
|
+
id,
|
|
2295
|
+
result: {
|
|
2296
|
+
tools: this.toolDefinitions,
|
|
2297
|
+
},
|
|
2298
|
+
};
|
|
2299
|
+
}
|
|
2300
|
+
/**
|
|
2301
|
+
* Handle tools/call request -- validate params, execute tool, return result.
|
|
2302
|
+
*/
|
|
2303
|
+
_handleToolsCall(id, params) {
|
|
2304
|
+
if (!params || !params.name) {
|
|
2305
|
+
return this._errorResponse(id, -32602, 'Invalid params', { missing: ['name'] });
|
|
2306
|
+
}
|
|
2307
|
+
const toolName = params.name;
|
|
2308
|
+
const toolArgs = params.arguments || {};
|
|
2309
|
+
const descriptor = this._descriptorMap.get(toolName);
|
|
2310
|
+
if (!descriptor) {
|
|
2311
|
+
return this._errorResponse(id, -32601, 'Method not found', { tool: toolName });
|
|
2312
|
+
}
|
|
2313
|
+
// Validate required params
|
|
2314
|
+
const missingParams = [];
|
|
2315
|
+
for (const param of descriptor.params) {
|
|
2316
|
+
if (param.required && (toolArgs[param.name] === undefined || toolArgs[param.name] === null)) {
|
|
2317
|
+
missingParams.push(param.name);
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
if (missingParams.length > 0) {
|
|
2321
|
+
return this._errorResponse(id, -32602, 'Invalid params', { missing: missingParams });
|
|
2322
|
+
}
|
|
2323
|
+
// Execute the tool
|
|
2324
|
+
return this._executeTool(id, descriptor, toolArgs);
|
|
2325
|
+
}
|
|
2326
|
+
/**
|
|
2327
|
+
* Execute a tool by calling its cmd* function with output capture.
|
|
2328
|
+
*/
|
|
2329
|
+
_executeTool(id, descriptor, args) {
|
|
2330
|
+
// Async handlers (declared with async keyword) use async capture
|
|
2331
|
+
if (descriptor.execute.constructor.name === 'AsyncFunction') {
|
|
2332
|
+
return this._executeToolAsync(id, descriptor, args);
|
|
2333
|
+
}
|
|
2334
|
+
try {
|
|
2335
|
+
const result = captureExecution(() => {
|
|
2336
|
+
descriptor.execute(this.cwd, args);
|
|
2337
|
+
});
|
|
2338
|
+
return this._formatToolResult(id, result);
|
|
2339
|
+
}
|
|
2340
|
+
catch (e) {
|
|
2341
|
+
return this._errorResponse(id, -32603, 'Internal error', {
|
|
2342
|
+
error: e.message || String(e),
|
|
2343
|
+
});
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
/**
|
|
2347
|
+
* Async variant of _executeTool for async tool handlers.
|
|
2348
|
+
*/
|
|
2349
|
+
async _executeToolAsync(id, descriptor, args) {
|
|
2350
|
+
try {
|
|
2351
|
+
const result = await captureExecutionAsync(() => {
|
|
2352
|
+
return descriptor.execute(this.cwd, args);
|
|
2353
|
+
});
|
|
2354
|
+
return this._formatToolResult(id, result);
|
|
2355
|
+
}
|
|
2356
|
+
catch (e) {
|
|
2357
|
+
return this._errorResponse(id, -32603, 'Internal error', {
|
|
2358
|
+
error: e.message || String(e),
|
|
2359
|
+
});
|
|
2360
|
+
}
|
|
2361
|
+
}
|
|
2362
|
+
/**
|
|
2363
|
+
* Format captured execution result into a JSON-RPC response.
|
|
2364
|
+
*/
|
|
2365
|
+
_formatToolResult(id, result) {
|
|
2366
|
+
if (result.exitCode !== 0) {
|
|
2367
|
+
return {
|
|
2368
|
+
jsonrpc: '2.0',
|
|
2369
|
+
id,
|
|
2370
|
+
result: {
|
|
2371
|
+
content: [
|
|
2372
|
+
{
|
|
2373
|
+
type: 'text',
|
|
2374
|
+
text: result.stderr || result.stdout || 'Command failed',
|
|
2375
|
+
},
|
|
2376
|
+
],
|
|
2377
|
+
isError: true,
|
|
2378
|
+
},
|
|
2379
|
+
};
|
|
2380
|
+
}
|
|
2381
|
+
let text = result.stdout;
|
|
2382
|
+
try {
|
|
2383
|
+
const parsed = JSON.parse(text);
|
|
2384
|
+
text = JSON.stringify(parsed, null, 2);
|
|
2385
|
+
}
|
|
2386
|
+
catch {
|
|
2387
|
+
// Not JSON -- use raw text
|
|
2388
|
+
}
|
|
2389
|
+
return {
|
|
2390
|
+
jsonrpc: '2.0',
|
|
2391
|
+
id,
|
|
2392
|
+
result: {
|
|
2393
|
+
content: [
|
|
2394
|
+
{
|
|
2395
|
+
type: 'text',
|
|
2396
|
+
text,
|
|
2397
|
+
},
|
|
2398
|
+
],
|
|
2399
|
+
},
|
|
2400
|
+
};
|
|
2401
|
+
}
|
|
2402
|
+
/**
|
|
2403
|
+
* Build a JSON-RPC error response.
|
|
2404
|
+
*/
|
|
2405
|
+
_errorResponse(id, code, message, data) {
|
|
2406
|
+
const error = { code, message };
|
|
2407
|
+
if (data) {
|
|
2408
|
+
error.data = data;
|
|
2409
|
+
}
|
|
2410
|
+
return {
|
|
2411
|
+
jsonrpc: '2.0',
|
|
2412
|
+
id,
|
|
2413
|
+
error,
|
|
2414
|
+
};
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
// ─── Exports ────────────────────────────────────────────────────────────────
|
|
2418
|
+
module.exports = {
|
|
2419
|
+
McpServer,
|
|
2420
|
+
buildToolDefinitions,
|
|
2421
|
+
COMMAND_DESCRIPTORS,
|
|
2422
|
+
captureExecution,
|
|
2423
|
+
};
|
|
2424
|
+
//# sourceMappingURL=mcp-server.js.map
|