agent-bober 0.12.0 → 0.15.0
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/CHANGELOG.md +213 -0
- package/README.md +112 -3
- package/agents/bober-architect.md +38 -0
- package/agents/bober-code-reviewer.md +236 -0
- package/agents/bober-curator.md +37 -0
- package/agents/bober-deployer.md +267 -0
- package/agents/bober-diagnoser.md +289 -0
- package/agents/bober-evaluator.md +89 -1
- package/agents/bober-generator.md +68 -3
- package/agents/bober-planner.md +39 -0
- package/agents/bober-postmortemer.md +185 -0
- package/agents/bober-researcher.md +38 -0
- package/dist/cli/commands/approve.d.ts +17 -0
- package/dist/cli/commands/approve.d.ts.map +1 -0
- package/dist/cli/commands/approve.js +64 -0
- package/dist/cli/commands/approve.js.map +1 -0
- package/dist/cli/commands/audit-show.d.ts +14 -0
- package/dist/cli/commands/audit-show.d.ts.map +1 -0
- package/dist/cli/commands/audit-show.js +85 -0
- package/dist/cli/commands/audit-show.js.map +1 -0
- package/dist/cli/commands/config.d.ts +10 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +73 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/graph.d.ts +8 -0
- package/dist/cli/commands/graph.d.ts.map +1 -0
- package/dist/cli/commands/graph.js +219 -0
- package/dist/cli/commands/graph.js.map +1 -0
- package/dist/cli/commands/impact.d.ts +19 -0
- package/dist/cli/commands/impact.d.ts.map +1 -0
- package/dist/cli/commands/impact.js +191 -0
- package/dist/cli/commands/impact.js.map +1 -0
- package/dist/cli/commands/incident.d.ts +19 -0
- package/dist/cli/commands/incident.d.ts.map +1 -0
- package/dist/cli/commands/incident.js +324 -0
- package/dist/cli/commands/incident.js.map +1 -0
- package/dist/cli/commands/init.js +36 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/list-approvals.d.ts +16 -0
- package/dist/cli/commands/list-approvals.d.ts.map +1 -0
- package/dist/cli/commands/list-approvals.js +57 -0
- package/dist/cli/commands/list-approvals.js.map +1 -0
- package/dist/cli/commands/onboard.d.ts +3 -0
- package/dist/cli/commands/onboard.d.ts.map +1 -0
- package/dist/cli/commands/onboard.js +190 -0
- package/dist/cli/commands/onboard.js.map +1 -0
- package/dist/cli/commands/playbook.d.ts +17 -0
- package/dist/cli/commands/playbook.d.ts.map +1 -0
- package/dist/cli/commands/playbook.js +123 -0
- package/dist/cli/commands/playbook.js.map +1 -0
- package/dist/cli/commands/postmortem.d.ts +12 -0
- package/dist/cli/commands/postmortem.d.ts.map +1 -0
- package/dist/cli/commands/postmortem.js +67 -0
- package/dist/cli/commands/postmortem.js.map +1 -0
- package/dist/cli/commands/reject.d.ts +17 -0
- package/dist/cli/commands/reject.d.ts.map +1 -0
- package/dist/cli/commands/reject.js +52 -0
- package/dist/cli/commands/reject.js.map +1 -0
- package/dist/cli/commands/rollback.d.ts +21 -0
- package/dist/cli/commands/rollback.d.ts.map +1 -0
- package/dist/cli/commands/rollback.js +90 -0
- package/dist/cli/commands/rollback.js.map +1 -0
- package/dist/cli/commands/run.d.ts +9 -0
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +29 -0
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/telemetry.d.ts +16 -0
- package/dist/cli/commands/telemetry.d.ts.map +1 -0
- package/dist/cli/commands/telemetry.js +152 -0
- package/dist/cli/commands/telemetry.js.map +1 -0
- package/dist/cli/commands/worktree.d.ts +12 -0
- package/dist/cli/commands/worktree.d.ts.map +1 -0
- package/dist/cli/commands/worktree.js +57 -0
- package/dist/cli/commands/worktree.js.map +1 -0
- package/dist/cli/index.js +50 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +27 -0
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +4 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +18 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/schema.d.ts +976 -56
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +147 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/graph/artifact-store.d.ts +14 -0
- package/dist/graph/artifact-store.d.ts.map +1 -0
- package/dist/graph/artifact-store.js +100 -0
- package/dist/graph/artifact-store.js.map +1 -0
- package/dist/graph/cli.d.ts +49 -0
- package/dist/graph/cli.d.ts.map +1 -0
- package/dist/graph/cli.js +140 -0
- package/dist/graph/cli.js.map +1 -0
- package/dist/graph/client.d.ts +64 -0
- package/dist/graph/client.d.ts.map +1 -0
- package/dist/graph/client.js +216 -0
- package/dist/graph/client.js.map +1 -0
- package/dist/graph/fallback.d.ts +13 -0
- package/dist/graph/fallback.d.ts.map +1 -0
- package/dist/graph/fallback.js +57 -0
- package/dist/graph/fallback.js.map +1 -0
- package/dist/graph/hook-handler.d.ts +50 -0
- package/dist/graph/hook-handler.d.ts.map +1 -0
- package/dist/graph/hook-handler.js +217 -0
- package/dist/graph/hook-handler.js.map +1 -0
- package/dist/graph/incidents.d.ts +59 -0
- package/dist/graph/incidents.d.ts.map +1 -0
- package/dist/graph/incidents.js +22 -0
- package/dist/graph/incidents.js.map +1 -0
- package/dist/graph/mcp-client.d.ts +51 -0
- package/dist/graph/mcp-client.d.ts.map +1 -0
- package/dist/graph/mcp-client.js +285 -0
- package/dist/graph/mcp-client.js.map +1 -0
- package/dist/graph/onboarding-composer.d.ts +30 -0
- package/dist/graph/onboarding-composer.d.ts.map +1 -0
- package/dist/graph/onboarding-composer.js +275 -0
- package/dist/graph/onboarding-composer.js.map +1 -0
- package/dist/graph/pipeline-lifecycle.d.ts +86 -0
- package/dist/graph/pipeline-lifecycle.d.ts.map +1 -0
- package/dist/graph/pipeline-lifecycle.js +329 -0
- package/dist/graph/pipeline-lifecycle.js.map +1 -0
- package/dist/graph/preflight-budgets.d.ts +52 -0
- package/dist/graph/preflight-budgets.d.ts.map +1 -0
- package/dist/graph/preflight-budgets.js +78 -0
- package/dist/graph/preflight-budgets.js.map +1 -0
- package/dist/graph/preflight-injector.d.ts +116 -0
- package/dist/graph/preflight-injector.d.ts.map +1 -0
- package/dist/graph/preflight-injector.js +538 -0
- package/dist/graph/preflight-injector.js.map +1 -0
- package/dist/graph/prereq.d.ts +12 -0
- package/dist/graph/prereq.d.ts.map +1 -0
- package/dist/graph/prereq.js +61 -0
- package/dist/graph/prereq.js.map +1 -0
- package/dist/graph/prompts.d.ts +42 -0
- package/dist/graph/prompts.d.ts.map +1 -0
- package/dist/graph/prompts.js +80 -0
- package/dist/graph/prompts.js.map +1 -0
- package/dist/graph/sandbox.d.ts +19 -0
- package/dist/graph/sandbox.d.ts.map +1 -0
- package/dist/graph/sandbox.js +25 -0
- package/dist/graph/sandbox.js.map +1 -0
- package/dist/graph/token-usage.d.ts +21 -0
- package/dist/graph/token-usage.d.ts.map +1 -0
- package/dist/graph/token-usage.js +22 -0
- package/dist/graph/token-usage.js.map +1 -0
- package/dist/graph/types.d.ts +129 -0
- package/dist/graph/types.d.ts.map +1 -0
- package/dist/graph/types.js +12 -0
- package/dist/graph/types.js.map +1 -0
- package/dist/incident/orchestrator.d.ts +168 -0
- package/dist/incident/orchestrator.d.ts.map +1 -0
- package/dist/incident/orchestrator.js +279 -0
- package/dist/incident/orchestrator.js.map +1 -0
- package/dist/incident/playbook-search.d.ts +67 -0
- package/dist/incident/playbook-search.d.ts.map +1 -0
- package/dist/incident/playbook-search.js +288 -0
- package/dist/incident/playbook-search.js.map +1 -0
- package/dist/incident/postmortem.d.ts +44 -0
- package/dist/incident/postmortem.d.ts.map +1 -0
- package/dist/incident/postmortem.js +486 -0
- package/dist/incident/postmortem.js.map +1 -0
- package/dist/incident/resolution-verify.d.ts +186 -0
- package/dist/incident/resolution-verify.d.ts.map +1 -0
- package/dist/incident/resolution-verify.js +210 -0
- package/dist/incident/resolution-verify.js.map +1 -0
- package/dist/incident/rollback.d.ts +137 -0
- package/dist/incident/rollback.d.ts.map +1 -0
- package/dist/incident/rollback.js +328 -0
- package/dist/incident/rollback.js.map +1 -0
- package/dist/incident/timeline.d.ts +147 -0
- package/dist/incident/timeline.d.ts.map +1 -0
- package/dist/incident/timeline.js +452 -0
- package/dist/incident/timeline.js.map +1 -0
- package/dist/incident/types.d.ts +335 -0
- package/dist/incident/types.d.ts.map +1 -0
- package/dist/incident/types.js +158 -0
- package/dist/incident/types.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/event-stream.d.ts +46 -0
- package/dist/mcp/event-stream.d.ts.map +1 -0
- package/dist/mcp/event-stream.js +421 -0
- package/dist/mcp/event-stream.js.map +1 -0
- package/dist/mcp/external-client.d.ts +38 -0
- package/dist/mcp/external-client.d.ts.map +1 -0
- package/dist/mcp/external-client.js +121 -0
- package/dist/mcp/external-client.js.map +1 -0
- package/dist/mcp/run-manager.d.ts +74 -9
- package/dist/mcp/run-manager.d.ts.map +1 -1
- package/dist/mcp/run-manager.js +127 -31
- package/dist/mcp/run-manager.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +56 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/abort-run.d.ts +2 -0
- package/dist/mcp/tools/abort-run.d.ts.map +1 -0
- package/dist/mcp/tools/abort-run.js +62 -0
- package/dist/mcp/tools/abort-run.js.map +1 -0
- package/dist/mcp/tools/anchor.js +1 -1
- package/dist/mcp/tools/anchor.js.map +1 -1
- package/dist/mcp/tools/approve-checkpoint.d.ts +2 -0
- package/dist/mcp/tools/approve-checkpoint.d.ts.map +1 -0
- package/dist/mcp/tools/approve-checkpoint.js +70 -0
- package/dist/mcp/tools/approve-checkpoint.js.map +1 -0
- package/dist/mcp/tools/brownfield.js +1 -1
- package/dist/mcp/tools/brownfield.js.map +1 -1
- package/dist/mcp/tools/get-project-state.d.ts +2 -0
- package/dist/mcp/tools/get-project-state.d.ts.map +1 -0
- package/dist/mcp/tools/get-project-state.js +107 -0
- package/dist/mcp/tools/get-project-state.js.map +1 -0
- package/dist/mcp/tools/get-run-status.d.ts +2 -0
- package/dist/mcp/tools/get-run-status.d.ts.map +1 -0
- package/dist/mcp/tools/get-run-status.js +40 -0
- package/dist/mcp/tools/get-run-status.js.map +1 -0
- package/dist/mcp/tools/graph-schemas.d.ts +100 -0
- package/dist/mcp/tools/graph-schemas.d.ts.map +1 -0
- package/dist/mcp/tools/graph-schemas.js +39 -0
- package/dist/mcp/tools/graph-schemas.js.map +1 -0
- package/dist/mcp/tools/graph.d.ts +19 -0
- package/dist/mcp/tools/graph.d.ts.map +1 -0
- package/dist/mcp/tools/graph.js +263 -0
- package/dist/mcp/tools/graph.js.map +1 -0
- package/dist/mcp/tools/incident.d.ts +2 -0
- package/dist/mcp/tools/incident.d.ts.map +1 -0
- package/dist/mcp/tools/incident.js +246 -0
- package/dist/mcp/tools/incident.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +38 -18
- package/dist/mcp/tools/index.d.ts.map +1 -1
- package/dist/mcp/tools/index.js +74 -18
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/list-active-runs.d.ts +2 -0
- package/dist/mcp/tools/list-active-runs.d.ts.map +1 -0
- package/dist/mcp/tools/list-active-runs.js +35 -0
- package/dist/mcp/tools/list-active-runs.js.map +1 -0
- package/dist/mcp/tools/list-pending-approvals.d.ts +2 -0
- package/dist/mcp/tools/list-pending-approvals.d.ts.map +1 -0
- package/dist/mcp/tools/list-pending-approvals.js +40 -0
- package/dist/mcp/tools/list-pending-approvals.js.map +1 -0
- package/dist/mcp/tools/list-projects.d.ts +2 -0
- package/dist/mcp/tools/list-projects.d.ts.map +1 -0
- package/dist/mcp/tools/list-projects.js +101 -0
- package/dist/mcp/tools/list-projects.js.map +1 -0
- package/dist/mcp/tools/list-specs.d.ts +2 -0
- package/dist/mcp/tools/list-specs.d.ts.map +1 -0
- package/dist/mcp/tools/list-specs.js +48 -0
- package/dist/mcp/tools/list-specs.js.map +1 -0
- package/dist/mcp/tools/playbook.d.ts +2 -0
- package/dist/mcp/tools/playbook.d.ts.map +1 -0
- package/dist/mcp/tools/playbook.js +104 -0
- package/dist/mcp/tools/playbook.js.map +1 -0
- package/dist/mcp/tools/postmortem.d.ts +2 -0
- package/dist/mcp/tools/postmortem.d.ts.map +1 -0
- package/dist/mcp/tools/postmortem.js +75 -0
- package/dist/mcp/tools/postmortem.js.map +1 -0
- package/dist/mcp/tools/react.js +1 -1
- package/dist/mcp/tools/react.js.map +1 -1
- package/dist/mcp/tools/reject-checkpoint.d.ts +2 -0
- package/dist/mcp/tools/reject-checkpoint.d.ts.map +1 -0
- package/dist/mcp/tools/reject-checkpoint.js +79 -0
- package/dist/mcp/tools/reject-checkpoint.js.map +1 -0
- package/dist/mcp/tools/rollback.d.ts +2 -0
- package/dist/mcp/tools/rollback.d.ts.map +1 -0
- package/dist/mcp/tools/rollback.js +78 -0
- package/dist/mcp/tools/rollback.js.map +1 -0
- package/dist/mcp/tools/run-in-worktree.d.ts +2 -0
- package/dist/mcp/tools/run-in-worktree.d.ts.map +1 -0
- package/dist/mcp/tools/run-in-worktree.js +90 -0
- package/dist/mcp/tools/run-in-worktree.js.map +1 -0
- package/dist/mcp/tools/run.js +1 -1
- package/dist/mcp/tools/run.js.map +1 -1
- package/dist/mcp/tools/solidity.js +1 -1
- package/dist/mcp/tools/solidity.js.map +1 -1
- package/dist/mcp/tools/status.d.ts.map +1 -1
- package/dist/mcp/tools/status.js +11 -0
- package/dist/mcp/tools/status.js.map +1 -1
- package/dist/mcp/tools/subscribe-events.d.ts +2 -0
- package/dist/mcp/tools/subscribe-events.d.ts.map +1 -0
- package/dist/mcp/tools/subscribe-events.js +48 -0
- package/dist/mcp/tools/subscribe-events.js.map +1 -0
- package/dist/mcp/tools/unsubscribe-events.d.ts +2 -0
- package/dist/mcp/tools/unsubscribe-events.d.ts.map +1 -0
- package/dist/mcp/tools/unsubscribe-events.js +45 -0
- package/dist/mcp/tools/unsubscribe-events.js.map +1 -0
- package/dist/orchestrator/agent-loader.d.ts +16 -0
- package/dist/orchestrator/agent-loader.d.ts.map +1 -1
- package/dist/orchestrator/agent-loader.js +16 -0
- package/dist/orchestrator/agent-loader.js.map +1 -1
- package/dist/orchestrator/architect-agent.d.ts.map +1 -1
- package/dist/orchestrator/architect-agent.js +37 -8
- package/dist/orchestrator/architect-agent.js.map +1 -1
- package/dist/orchestrator/checkpoints/audit.d.ts +128 -0
- package/dist/orchestrator/checkpoints/audit.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/audit.js +272 -0
- package/dist/orchestrator/checkpoints/audit.js.map +1 -0
- package/dist/orchestrator/checkpoints/feedback-router.d.ts +213 -0
- package/dist/orchestrator/checkpoints/feedback-router.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/feedback-router.js +438 -0
- package/dist/orchestrator/checkpoints/feedback-router.js.map +1 -0
- package/dist/orchestrator/checkpoints/index.d.ts +11 -0
- package/dist/orchestrator/checkpoints/index.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/index.js +12 -0
- package/dist/orchestrator/checkpoints/index.js.map +1 -0
- package/dist/orchestrator/checkpoints/mechanisms/cli.d.ts +35 -0
- package/dist/orchestrator/checkpoints/mechanisms/cli.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/mechanisms/cli.js +153 -0
- package/dist/orchestrator/checkpoints/mechanisms/cli.js.map +1 -0
- package/dist/orchestrator/checkpoints/mechanisms/disk.d.ts +34 -0
- package/dist/orchestrator/checkpoints/mechanisms/disk.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/mechanisms/disk.js +139 -0
- package/dist/orchestrator/checkpoints/mechanisms/disk.js.map +1 -0
- package/dist/orchestrator/checkpoints/mechanisms/pr.d.ts +141 -0
- package/dist/orchestrator/checkpoints/mechanisms/pr.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/mechanisms/pr.js +445 -0
- package/dist/orchestrator/checkpoints/mechanisms/pr.js.map +1 -0
- package/dist/orchestrator/checkpoints/noop.d.ts +12 -0
- package/dist/orchestrator/checkpoints/noop.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/noop.js +13 -0
- package/dist/orchestrator/checkpoints/noop.js.map +1 -0
- package/dist/orchestrator/checkpoints/registry.d.ts +48 -0
- package/dist/orchestrator/checkpoints/registry.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/registry.js +89 -0
- package/dist/orchestrator/checkpoints/registry.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/_util.d.ts +50 -0
- package/dist/orchestrator/checkpoints/renderers/_util.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/_util.js +137 -0
- package/dist/orchestrator/checkpoints/renderers/_util.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/code-review.d.ts +15 -0
- package/dist/orchestrator/checkpoints/renderers/code-review.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/code-review.js +66 -0
- package/dist/orchestrator/checkpoints/renderers/code-review.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/curator-briefing.d.ts +15 -0
- package/dist/orchestrator/checkpoints/renderers/curator-briefing.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/curator-briefing.js +40 -0
- package/dist/orchestrator/checkpoints/renderers/curator-briefing.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/eval-result.d.ts +15 -0
- package/dist/orchestrator/checkpoints/renderers/eval-result.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/eval-result.js +54 -0
- package/dist/orchestrator/checkpoints/renderers/eval-result.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/generator-diff.d.ts +49 -0
- package/dist/orchestrator/checkpoints/renderers/generator-diff.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/generator-diff.js +154 -0
- package/dist/orchestrator/checkpoints/renderers/generator-diff.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/pipeline-summary.d.ts +15 -0
- package/dist/orchestrator/checkpoints/renderers/pipeline-summary.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/pipeline-summary.js +59 -0
- package/dist/orchestrator/checkpoints/renderers/pipeline-summary.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/plan.d.ts +15 -0
- package/dist/orchestrator/checkpoints/renderers/plan.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/plan.js +34 -0
- package/dist/orchestrator/checkpoints/renderers/plan.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/registry.d.ts +43 -0
- package/dist/orchestrator/checkpoints/renderers/registry.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/registry.js +83 -0
- package/dist/orchestrator/checkpoints/renderers/registry.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/research.d.ts +15 -0
- package/dist/orchestrator/checkpoints/renderers/research.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/research.js +39 -0
- package/dist/orchestrator/checkpoints/renderers/research.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-contract.d.ts +20 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-contract.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-contract.js +57 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-contract.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-summary.d.ts +15 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-summary.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-summary.js +38 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-summary.js.map +1 -0
- package/dist/orchestrator/checkpoints/sites.d.ts +22 -0
- package/dist/orchestrator/checkpoints/sites.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/sites.js +57 -0
- package/dist/orchestrator/checkpoints/sites.js.map +1 -0
- package/dist/orchestrator/checkpoints/types.d.ts +51 -0
- package/dist/orchestrator/checkpoints/types.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/types.js +9 -0
- package/dist/orchestrator/checkpoints/types.js.map +1 -0
- package/dist/orchestrator/code-reviewer-agent.d.ts +50 -0
- package/dist/orchestrator/code-reviewer-agent.d.ts.map +1 -0
- package/dist/orchestrator/code-reviewer-agent.js +283 -0
- package/dist/orchestrator/code-reviewer-agent.js.map +1 -0
- package/dist/orchestrator/curator-agent.d.ts.map +1 -1
- package/dist/orchestrator/curator-agent.js +59 -8
- package/dist/orchestrator/curator-agent.js.map +1 -1
- package/dist/orchestrator/deploy/classify.d.ts +31 -0
- package/dist/orchestrator/deploy/classify.d.ts.map +1 -0
- package/dist/orchestrator/deploy/classify.js +109 -0
- package/dist/orchestrator/deploy/classify.js.map +1 -0
- package/dist/orchestrator/deploy/execute.d.ts +45 -0
- package/dist/orchestrator/deploy/execute.d.ts.map +1 -0
- package/dist/orchestrator/deploy/execute.js +146 -0
- package/dist/orchestrator/deploy/execute.js.map +1 -0
- package/dist/orchestrator/deploy/executor.d.ts +22 -0
- package/dist/orchestrator/deploy/executor.d.ts.map +1 -0
- package/dist/orchestrator/deploy/executor.js +31 -0
- package/dist/orchestrator/deploy/executor.js.map +1 -0
- package/dist/orchestrator/deploy/index.d.ts +21 -0
- package/dist/orchestrator/deploy/index.d.ts.map +1 -0
- package/dist/orchestrator/deploy/index.js +21 -0
- package/dist/orchestrator/deploy/index.js.map +1 -0
- package/dist/orchestrator/deploy/resolve.d.ts +51 -0
- package/dist/orchestrator/deploy/resolve.d.ts.map +1 -0
- package/dist/orchestrator/deploy/resolve.js +53 -0
- package/dist/orchestrator/deploy/resolve.js.map +1 -0
- package/dist/orchestrator/deploy/spawn.d.ts +60 -0
- package/dist/orchestrator/deploy/spawn.d.ts.map +1 -0
- package/dist/orchestrator/deploy/spawn.js +62 -0
- package/dist/orchestrator/deploy/spawn.js.map +1 -0
- package/dist/orchestrator/deploy/types.d.ts +98 -0
- package/dist/orchestrator/deploy/types.d.ts.map +1 -0
- package/dist/orchestrator/deploy/types.js +39 -0
- package/dist/orchestrator/deploy/types.js.map +1 -0
- package/dist/orchestrator/evaluator-agent.d.ts.map +1 -1
- package/dist/orchestrator/evaluator-agent.js +21 -8
- package/dist/orchestrator/evaluator-agent.js.map +1 -1
- package/dist/orchestrator/generator-agent.d.ts.map +1 -1
- package/dist/orchestrator/generator-agent.js +21 -8
- package/dist/orchestrator/generator-agent.js.map +1 -1
- package/dist/orchestrator/model-resolver.d.ts.map +1 -1
- package/dist/orchestrator/model-resolver.js +3 -1
- package/dist/orchestrator/model-resolver.js.map +1 -1
- package/dist/orchestrator/observability/index.d.ts +12 -0
- package/dist/orchestrator/observability/index.d.ts.map +1 -0
- package/dist/orchestrator/observability/index.js +12 -0
- package/dist/orchestrator/observability/index.js.map +1 -0
- package/dist/orchestrator/observability/merge.d.ts +73 -0
- package/dist/orchestrator/observability/merge.d.ts.map +1 -0
- package/dist/orchestrator/observability/merge.js +110 -0
- package/dist/orchestrator/observability/merge.js.map +1 -0
- package/dist/orchestrator/pipeline.d.ts +21 -0
- package/dist/orchestrator/pipeline.d.ts.map +1 -1
- package/dist/orchestrator/pipeline.js +156 -2
- package/dist/orchestrator/pipeline.js.map +1 -1
- package/dist/orchestrator/planner-agent.d.ts.map +1 -1
- package/dist/orchestrator/planner-agent.js +5 -4
- package/dist/orchestrator/planner-agent.js.map +1 -1
- package/dist/orchestrator/research-agent.d.ts.map +1 -1
- package/dist/orchestrator/research-agent.js +46 -9
- package/dist/orchestrator/research-agent.js.map +1 -1
- package/dist/orchestrator/tools/handlers.d.ts +2 -0
- package/dist/orchestrator/tools/handlers.d.ts.map +1 -1
- package/dist/orchestrator/tools/handlers.js +1 -1
- package/dist/orchestrator/tools/handlers.js.map +1 -1
- package/dist/orchestrator/tools/index.d.ts +84 -1
- package/dist/orchestrator/tools/index.d.ts.map +1 -1
- package/dist/orchestrator/tools/index.js +164 -1
- package/dist/orchestrator/tools/index.js.map +1 -1
- package/dist/orchestrator/worktree.d.ts +18 -0
- package/dist/orchestrator/worktree.d.ts.map +1 -0
- package/dist/orchestrator/worktree.js +129 -0
- package/dist/orchestrator/worktree.js.map +1 -0
- package/dist/providers/anthropic.d.ts +8 -1
- package/dist/providers/anthropic.d.ts.map +1 -1
- package/dist/providers/anthropic.js +86 -5
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/factory.d.ts.map +1 -1
- package/dist/providers/factory.js +35 -2
- package/dist/providers/factory.js.map +1 -1
- package/dist/providers/google.d.ts.map +1 -1
- package/dist/providers/google.js +5 -0
- package/dist/providers/google.js.map +1 -1
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/providers/openai.js +4 -0
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/types.d.ts +25 -2
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/state/approval-state.d.ts +74 -0
- package/dist/state/approval-state.d.ts.map +1 -0
- package/dist/state/approval-state.js +127 -0
- package/dist/state/approval-state.js.map +1 -0
- package/dist/state/index.d.ts +3 -0
- package/dist/state/index.d.ts.map +1 -1
- package/dist/state/index.js +4 -1
- package/dist/state/index.js.map +1 -1
- package/dist/state/review-state.d.ts +15 -0
- package/dist/state/review-state.d.ts.map +1 -0
- package/dist/state/review-state.js +51 -0
- package/dist/state/review-state.js.map +1 -0
- package/dist/state/run-state.d.ts +39 -0
- package/dist/state/run-state.d.ts.map +1 -0
- package/dist/state/run-state.js +101 -0
- package/dist/state/run-state.js.map +1 -0
- package/dist/telemetry/emit.d.ts +41 -0
- package/dist/telemetry/emit.d.ts.map +1 -0
- package/dist/telemetry/emit.js +65 -0
- package/dist/telemetry/emit.js.map +1 -0
- package/dist/utils/git.d.ts +27 -0
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +50 -0
- package/dist/utils/git.js.map +1 -1
- package/hooks/hooks.json +17 -1
- package/hooks/session-start +42 -0
- package/package.json +5 -2
- package/scripts/check-prereqs.sh +12 -0
- package/scripts/e2e-graph-smoke.sh +167 -0
- package/scripts/graph-hook.mjs +151 -0
- package/scripts/run-kpi-gate.mjs +245 -0
- package/scripts/sync-skills.mjs +4 -1
- package/skills/bober.code-review/SKILL.md +186 -0
- package/skills/bober.debug/SKILL.md +300 -0
- package/skills/bober.deploy/SKILL.md +262 -0
- package/skills/bober.diagnose/SKILL.md +254 -0
- package/skills/bober.graph/SKILL.md +85 -0
- package/skills/bober.impact/SKILL.md +101 -0
- package/skills/bober.incident/SKILL.md +245 -0
- package/skills/bober.onboard/SKILL.md +84 -0
- package/skills/bober.plan/SKILL.md +10 -0
- package/skills/bober.postmortem/SKILL.md +231 -0
- package/skills/bober.runbook/SKILL.md +335 -0
- package/skills/bober.using-bober/SKILL.md +133 -0
- package/skills/bober.verify/SKILL.md +143 -0
|
@@ -15,33 +15,98 @@ export interface RunResult {
|
|
|
15
15
|
export interface RunState {
|
|
16
16
|
runId: string;
|
|
17
17
|
task: string;
|
|
18
|
-
status: "running" | "completed" | "failed";
|
|
18
|
+
status: "running" | "completed" | "failed" | "aborted";
|
|
19
19
|
startedAt: string;
|
|
20
20
|
completedAt?: string;
|
|
21
|
+
abortedAt?: string;
|
|
22
|
+
abortReason?: string;
|
|
21
23
|
progress: RunProgress;
|
|
22
24
|
result?: RunResult;
|
|
23
25
|
error?: string;
|
|
26
|
+
projectRoot: string;
|
|
27
|
+
specId?: string;
|
|
28
|
+
/** Sprint 4: when this run was launched via runInWorktree(), the absolute
|
|
29
|
+
* path of the git worktree the pipeline executed in. Undefined for in-place
|
|
30
|
+
* runs (the existing bober_run path). */
|
|
31
|
+
worktreePath?: string;
|
|
32
|
+
/** Sprint 4: the git branch the worktree was created on. Undefined for
|
|
33
|
+
* in-place runs. */
|
|
34
|
+
branch?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Optional parameters for startRun().
|
|
38
|
+
* All fields are optional for back-compatibility with existing 3-arg callers.
|
|
39
|
+
*/
|
|
40
|
+
export interface StartRunOptions {
|
|
41
|
+
/** Pre-computed runId. When omitted, RunManager generates one with randomUUID(). */
|
|
42
|
+
runId?: string;
|
|
43
|
+
/** When the run is executed inside a git worktree, the absolute path of that worktree. */
|
|
44
|
+
worktreePath?: string;
|
|
45
|
+
/** Branch the worktree was created on. */
|
|
46
|
+
branch?: string;
|
|
24
47
|
}
|
|
25
48
|
export declare class RunManager {
|
|
26
|
-
private
|
|
49
|
+
private runs;
|
|
27
50
|
/**
|
|
28
|
-
* Check whether
|
|
51
|
+
* Check whether ANY pipeline run is currently in 'running' status.
|
|
52
|
+
*
|
|
53
|
+
* Back-compat: preserves the existing boolean contract used by
|
|
54
|
+
* bober_run and all other tool callers.
|
|
29
55
|
*/
|
|
30
56
|
isRunning(): boolean;
|
|
31
57
|
/**
|
|
32
|
-
* Return the
|
|
58
|
+
* Return the most-recently-started run, or null if no runs exist.
|
|
59
|
+
*
|
|
60
|
+
* Back-compat: when only one run exists this is identical to the
|
|
61
|
+
* old `return this.activeRun` behavior. When multiple runs exist
|
|
62
|
+
* the most-recently-started one is returned (sorted by startedAt desc).
|
|
33
63
|
*/
|
|
34
64
|
getStatus(): RunState | null;
|
|
65
|
+
/**
|
|
66
|
+
* Return the RunState for a specific runId, or null if not found.
|
|
67
|
+
*/
|
|
68
|
+
getRun(runId: string): RunState | null;
|
|
69
|
+
/**
|
|
70
|
+
* Return all runs currently in 'running' status.
|
|
71
|
+
*/
|
|
72
|
+
listActiveRuns(): RunState[];
|
|
73
|
+
/**
|
|
74
|
+
* Abort a run by setting its status to 'aborted' with the given reason.
|
|
75
|
+
* Persists the new state to disk (best-effort; logs on failure).
|
|
76
|
+
*/
|
|
77
|
+
abortRun(runId: string, reason: string): void;
|
|
78
|
+
/**
|
|
79
|
+
* Return ALL known runs regardless of status.
|
|
80
|
+
* Used by bober_list_active_runs for status-filtered listing.
|
|
81
|
+
*/
|
|
82
|
+
listAllRuns(): RunState[];
|
|
35
83
|
/**
|
|
36
84
|
* Start a new pipeline run as a fire-and-forget promise.
|
|
37
85
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
86
|
+
* Does NOT throw when another run is already in progress — concurrent
|
|
87
|
+
* runs are now supported. Callers that want to enforce one-at-a-time
|
|
88
|
+
* behavior should check isRunning() themselves (bober_run tool does
|
|
89
|
+
* this to preserve existing UX).
|
|
90
|
+
*
|
|
91
|
+
* Writes the initial state.json synchronously (await) before returning
|
|
92
|
+
* so disk state is visible immediately after startRun() returns.
|
|
93
|
+
*
|
|
94
|
+
* Returns the new runId.
|
|
95
|
+
*
|
|
96
|
+
* The optional `pipelineFn` parameter exists for testing only.
|
|
97
|
+
*/
|
|
98
|
+
startRun(task: string, projectRoot: string, config: BoberConfig, pipelineFn?: (task: string, projectRoot: string, config: BoberConfig) => Promise<PipelineResult>, opts?: StartRunOptions): Promise<string>;
|
|
99
|
+
/**
|
|
100
|
+
* Load all run state files from .bober/runs/ on startup.
|
|
101
|
+
*
|
|
102
|
+
* Populates the in-memory map from disk. Any run with status='running'
|
|
103
|
+
* is reconciled to status='failed' with error='orchestrator crashed
|
|
104
|
+
* before completion' — it cannot still be running if the process just
|
|
105
|
+
* started.
|
|
40
106
|
*
|
|
41
|
-
*
|
|
42
|
-
* it defaults to the real `runPipeline` function.
|
|
107
|
+
* Skips malformed state.json files with a warn log (does not throw).
|
|
43
108
|
*/
|
|
44
|
-
|
|
109
|
+
load(projectRoot: string): Promise<void>;
|
|
45
110
|
}
|
|
46
111
|
export declare const runManager: RunManager;
|
|
47
112
|
//# sourceMappingURL=run-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-manager.d.ts","sourceRoot":"","sources":["../../src/mcp/run-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-manager.d.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AAC;CACjB;AAID,qBAAa,UAAU;IACrB,OAAO,CAAC,IAAI,CAA+B;IAE3C;;;;;OAKG;IACH,SAAS,IAAI,OAAO;IAIpB;;;;;;OAMG;IACH,SAAS,IAAI,QAAQ,GAAG,IAAI;IAW5B;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI;IAItC;;OAEG;IACH,cAAc,IAAI,QAAQ,EAAE;IAI5B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAe7C;;;OAGG;IACH,WAAW,IAAI,QAAQ,EAAE;IAIzB;;;;;;;;;;;;;;OAcG;IACG,QAAQ,CACZ,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,WAAW,EACnB,UAAU,GAAE,CACV,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,WAAW,KAChB,OAAO,CAAC,cAAc,CAAe,EAC1C,IAAI,GAAE,eAAoB,GACzB,OAAO,CAAC,MAAM,CAAC;IAmElB;;;;;;;;;OASG;IACG,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAoB/C;AAID,eAAO,MAAM,UAAU,YAAmB,CAAC"}
|
package/dist/mcp/run-manager.js
CHANGED
|
@@ -1,78 +1,174 @@
|
|
|
1
1
|
// ── RunManager ───────────────────────────────────────────────────────
|
|
2
2
|
//
|
|
3
|
-
// Tracks
|
|
4
|
-
//
|
|
3
|
+
// Tracks active and historical pipeline runs in memory, backed by
|
|
4
|
+
// per-run state files at .bober/runs/<runId>/state.json.
|
|
5
|
+
//
|
|
6
|
+
// Back-compat: the singleton `runManager` export, isRunning(), and
|
|
7
|
+
// getStatus() preserve existing bober_run / bober_status behavior.
|
|
8
|
+
// New callers use keyed methods: getRun(), listActiveRuns(), abortRun(),
|
|
9
|
+
// load().
|
|
5
10
|
import { randomUUID } from "node:crypto";
|
|
6
11
|
import { runPipeline } from "../orchestrator/pipeline.js";
|
|
12
|
+
import { writeRunState, listRunStateFiles } from "../state/run-state.js";
|
|
13
|
+
import { logger } from "../utils/logger.js";
|
|
7
14
|
// ── RunManager ───────────────────────────────────────────────────────
|
|
8
15
|
export class RunManager {
|
|
9
|
-
|
|
16
|
+
runs = new Map();
|
|
10
17
|
/**
|
|
11
|
-
* Check whether
|
|
18
|
+
* Check whether ANY pipeline run is currently in 'running' status.
|
|
19
|
+
*
|
|
20
|
+
* Back-compat: preserves the existing boolean contract used by
|
|
21
|
+
* bober_run and all other tool callers.
|
|
12
22
|
*/
|
|
13
23
|
isRunning() {
|
|
14
|
-
return this.
|
|
24
|
+
return Array.from(this.runs.values()).some((s) => s.status === "running");
|
|
15
25
|
}
|
|
16
26
|
/**
|
|
17
|
-
* Return the
|
|
27
|
+
* Return the most-recently-started run, or null if no runs exist.
|
|
28
|
+
*
|
|
29
|
+
* Back-compat: when only one run exists this is identical to the
|
|
30
|
+
* old `return this.activeRun` behavior. When multiple runs exist
|
|
31
|
+
* the most-recently-started one is returned (sorted by startedAt desc).
|
|
18
32
|
*/
|
|
19
33
|
getStatus() {
|
|
20
|
-
|
|
34
|
+
if (this.runs.size === 0)
|
|
35
|
+
return null;
|
|
36
|
+
let newest = null;
|
|
37
|
+
for (const s of this.runs.values()) {
|
|
38
|
+
if (!newest || s.startedAt > newest.startedAt) {
|
|
39
|
+
newest = s;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return newest;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Return the RunState for a specific runId, or null if not found.
|
|
46
|
+
*/
|
|
47
|
+
getRun(runId) {
|
|
48
|
+
return this.runs.get(runId) ?? null;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Return all runs currently in 'running' status.
|
|
52
|
+
*/
|
|
53
|
+
listActiveRuns() {
|
|
54
|
+
return Array.from(this.runs.values()).filter((s) => s.status === "running");
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Abort a run by setting its status to 'aborted' with the given reason.
|
|
58
|
+
* Persists the new state to disk (best-effort; logs on failure).
|
|
59
|
+
*/
|
|
60
|
+
abortRun(runId, reason) {
|
|
61
|
+
const state = this.runs.get(runId);
|
|
62
|
+
if (!state)
|
|
63
|
+
return;
|
|
64
|
+
state.status = "aborted";
|
|
65
|
+
state.abortedAt = new Date().toISOString();
|
|
66
|
+
state.abortReason = reason;
|
|
67
|
+
writeRunState(state.projectRoot, state).catch((err) => {
|
|
68
|
+
logger.warn(`[RunManager.abortRun] Failed to persist aborted state for ${runId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Return ALL known runs regardless of status.
|
|
73
|
+
* Used by bober_list_active_runs for status-filtered listing.
|
|
74
|
+
*/
|
|
75
|
+
listAllRuns() {
|
|
76
|
+
return Array.from(this.runs.values());
|
|
21
77
|
}
|
|
22
78
|
/**
|
|
23
79
|
* Start a new pipeline run as a fire-and-forget promise.
|
|
24
80
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
81
|
+
* Does NOT throw when another run is already in progress — concurrent
|
|
82
|
+
* runs are now supported. Callers that want to enforce one-at-a-time
|
|
83
|
+
* behavior should check isRunning() themselves (bober_run tool does
|
|
84
|
+
* this to preserve existing UX).
|
|
27
85
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
86
|
+
* Writes the initial state.json synchronously (await) before returning
|
|
87
|
+
* so disk state is visible immediately after startRun() returns.
|
|
88
|
+
*
|
|
89
|
+
* Returns the new runId.
|
|
90
|
+
*
|
|
91
|
+
* The optional `pipelineFn` parameter exists for testing only.
|
|
30
92
|
*/
|
|
31
|
-
startRun(task, projectRoot, config, pipelineFn = runPipeline) {
|
|
32
|
-
|
|
33
|
-
throw new Error(`A pipeline is already running (runId: ${this.activeRun.runId}). Use bober_status to check progress.`);
|
|
34
|
-
}
|
|
35
|
-
const runId = randomUUID();
|
|
93
|
+
async startRun(task, projectRoot, config, pipelineFn = runPipeline, opts = {}) {
|
|
94
|
+
const runId = opts.runId ?? randomUUID();
|
|
36
95
|
const now = new Date().toISOString();
|
|
37
|
-
|
|
96
|
+
const state = {
|
|
38
97
|
runId,
|
|
39
98
|
task,
|
|
40
99
|
status: "running",
|
|
41
100
|
startedAt: now,
|
|
42
|
-
progress: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
101
|
+
progress: { completed: 0, total: 0 },
|
|
102
|
+
projectRoot,
|
|
103
|
+
...(opts.worktreePath ? { worktreePath: opts.worktreePath } : {}),
|
|
104
|
+
...(opts.branch ? { branch: opts.branch } : {}),
|
|
46
105
|
};
|
|
106
|
+
this.runs.set(runId, state);
|
|
107
|
+
// Persist initial state synchronously before returning (sc-1-2)
|
|
108
|
+
await writeRunState(projectRoot, state);
|
|
47
109
|
// Fire-and-forget: do NOT await this promise
|
|
48
110
|
const promise = pipelineFn(task, projectRoot, config);
|
|
49
111
|
promise
|
|
50
112
|
.then((result) => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
113
|
+
const s = this.runs.get(runId);
|
|
114
|
+
if (s) {
|
|
115
|
+
s.status = "completed";
|
|
116
|
+
s.completedAt = new Date().toISOString();
|
|
117
|
+
s.result = {
|
|
55
118
|
success: result.success,
|
|
56
119
|
completedSprints: result.completedSprints.length,
|
|
57
120
|
failedSprints: result.failedSprints.length,
|
|
58
121
|
duration: result.duration,
|
|
59
122
|
};
|
|
60
|
-
|
|
123
|
+
s.progress = {
|
|
61
124
|
completed: result.completedSprints.length,
|
|
62
125
|
total: result.completedSprints.length + result.failedSprints.length,
|
|
63
126
|
};
|
|
127
|
+
writeRunState(projectRoot, s).catch((err) => {
|
|
128
|
+
logger.warn(`[RunManager] Failed to persist completed state for ${runId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
129
|
+
});
|
|
64
130
|
}
|
|
65
131
|
})
|
|
66
132
|
.catch((err) => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
133
|
+
const s = this.runs.get(runId);
|
|
134
|
+
if (s) {
|
|
135
|
+
s.status = "failed";
|
|
136
|
+
s.completedAt = new Date().toISOString();
|
|
137
|
+
s.error = err instanceof Error ? err.message : String(err);
|
|
138
|
+
writeRunState(projectRoot, s).catch((writeErr) => {
|
|
139
|
+
logger.warn(`[RunManager] Failed to persist failed state for ${runId}: ${writeErr instanceof Error ? writeErr.message : String(writeErr)}`);
|
|
140
|
+
});
|
|
72
141
|
}
|
|
73
142
|
});
|
|
74
143
|
return runId;
|
|
75
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Load all run state files from .bober/runs/ on startup.
|
|
147
|
+
*
|
|
148
|
+
* Populates the in-memory map from disk. Any run with status='running'
|
|
149
|
+
* is reconciled to status='failed' with error='orchestrator crashed
|
|
150
|
+
* before completion' — it cannot still be running if the process just
|
|
151
|
+
* started.
|
|
152
|
+
*
|
|
153
|
+
* Skips malformed state.json files with a warn log (does not throw).
|
|
154
|
+
*/
|
|
155
|
+
async load(projectRoot) {
|
|
156
|
+
const states = await listRunStateFiles(projectRoot);
|
|
157
|
+
for (const s of states) {
|
|
158
|
+
if (s.status === "running") {
|
|
159
|
+
s.status = "failed";
|
|
160
|
+
s.completedAt = new Date().toISOString();
|
|
161
|
+
s.error = "orchestrator crashed before completion";
|
|
162
|
+
try {
|
|
163
|
+
await writeRunState(projectRoot, s);
|
|
164
|
+
}
|
|
165
|
+
catch (err) {
|
|
166
|
+
logger.warn(`[RunManager.load] Failed to persist reconciled state for ${s.runId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
this.runs.set(s.runId, s);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
76
172
|
}
|
|
77
173
|
// ── Module-scoped singleton ──────────────────────────────────────────
|
|
78
174
|
export const runManager = new RunManager();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-manager.js","sourceRoot":"","sources":["../../src/mcp/run-manager.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"run-manager.js","sourceRoot":"","sources":["../../src/mcp/run-manager.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,EAAE;AACF,kEAAkE;AAClE,yDAAyD;AACzD,EAAE;AACF,mEAAmE;AACnE,mEAAmE;AACnE,yEAAyE;AACzE,UAAU;AAEV,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAuD5C,wEAAwE;AAExE,MAAM,OAAO,UAAU;IACb,IAAI,GAAG,IAAI,GAAG,EAAoB,CAAC;IAE3C;;;;;OAKG;IACH,SAAS;QACP,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACP,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACtC,IAAI,MAAM,GAAoB,IAAI,CAAC;QACnC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;YACnC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;gBAC9C,MAAM,GAAG,CAAC,CAAC;YACb,CAAC;QACH,CAAC;QACD,OAA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C,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEL,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,IAAI,CAAC,WAAmB;QAC5B,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACpD,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;YACvB,IAAI,CAAC,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBAC3B,CAAC,CAAC,MAAM,GAAG,QAAQ,CAAC;gBACpB,CAAC,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;gBACzC,CAAC,CAAC,KAAK,GAAG,wCAAwC,CAAC;gBACnD,IAAI,CAAC;oBACH,MAAM,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;gBACtC,CAAC;gBAAC,OAAO,GAAY,EAAE,CAAC;oBACtB,MAAM,CAAC,IAAI,CACT,4DAA4D,CAAC,CAAC,KAAK,KACjE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CACjD,EAAE,CACH,CAAC;gBACJ,CAAC;YACH,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;CACF;AAED,wEAAwE;AAExE,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC"}
|
package/dist/mcp/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAgC1D;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CA4JjB"}
|
package/dist/mcp/server.js
CHANGED
|
@@ -12,6 +12,9 @@ import { Server } from "@modelcontextprotocol/sdk/server";
|
|
|
12
12
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
13
13
|
import { ListToolsRequestSchema, CallToolRequestSchema, McpError, ErrorCode, } from "@modelcontextprotocol/sdk/types.js";
|
|
14
14
|
import { registerAllTools, getAllTools, getTool } from "./tools/index.js";
|
|
15
|
+
import { configExists, loadConfig } from "../config/loader.js";
|
|
16
|
+
import { runManager } from "./run-manager.js";
|
|
17
|
+
import { initEventStream, getEventStream } from "./event-stream.js";
|
|
15
18
|
// ── Package version loader ──────────────────────────────────────────
|
|
16
19
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
20
|
async function loadVersion() {
|
|
@@ -43,6 +46,40 @@ export async function createBoberMCPServer(projectRoot) {
|
|
|
43
46
|
const version = await loadVersion();
|
|
44
47
|
// ── Register all tools before creating the server ────────────────
|
|
45
48
|
registerAllTools();
|
|
49
|
+
// ── Reconcile prior run state from disk (cockpit-integration sprint 1) ───
|
|
50
|
+
try {
|
|
51
|
+
await runManager.load(projectRoot);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
process.stderr.write(`[agent-bober mcp] runManager.load failed (continuing): ${err instanceof Error ? err.message : String(err)}\n`);
|
|
55
|
+
}
|
|
56
|
+
// ── Conditionally register graph_* tools ─────────────────────────
|
|
57
|
+
// Per sprint 4 spec: only when bober.config.json has
|
|
58
|
+
// graph.enabled === true AND graph.exposeOnExternalMcp === true.
|
|
59
|
+
// Failures here MUST NOT prevent server boot.
|
|
60
|
+
try {
|
|
61
|
+
if (await configExists(projectRoot)) {
|
|
62
|
+
const config = await loadConfig(projectRoot);
|
|
63
|
+
if (config.graph?.enabled && config.graph?.exposeOnExternalMcp !== false) {
|
|
64
|
+
const { GraphFallback } = await import("../graph/fallback.js");
|
|
65
|
+
const { GraphArtifactStore } = await import("../graph/artifact-store.js");
|
|
66
|
+
const { IncidentLog } = await import("../graph/incidents.js");
|
|
67
|
+
const { TokensaveMcpClient } = await import("../graph/mcp-client.js");
|
|
68
|
+
const { GraphClient } = await import("../graph/client.js");
|
|
69
|
+
const { registerGraphTools } = await import("./tools/graph.js");
|
|
70
|
+
const cfg = config.graph;
|
|
71
|
+
const store = new GraphArtifactStore(projectRoot);
|
|
72
|
+
const incidents = new IncidentLog(projectRoot);
|
|
73
|
+
const mcpClient = new TokensaveMcpClient(projectRoot, cfg, incidents, cfg.tokensavePath ?? "tokensave");
|
|
74
|
+
const graphFallback = new GraphFallback("dual");
|
|
75
|
+
const client = new GraphClient(projectRoot, mcpClient, store, graphFallback, incidents, cfg);
|
|
76
|
+
registerGraphTools({ client, fallback: graphFallback });
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
process.stderr.write(`[agent-bober mcp] graph tool registration skipped: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
82
|
+
}
|
|
46
83
|
// ── Create the server ────────────────────────────────────────────
|
|
47
84
|
const server = new Server({
|
|
48
85
|
name: "agent-bober",
|
|
@@ -91,10 +128,29 @@ export async function createBoberMCPServer(projectRoot) {
|
|
|
91
128
|
// ── Connect stdio transport ───────────────────────────────────────
|
|
92
129
|
const transport = new StdioServerTransport();
|
|
93
130
|
await server.connect(transport);
|
|
131
|
+
// ── Initialize event-stream subsystem (cockpit-integration sprint 3) ──
|
|
132
|
+
// Must run AFTER server.connect() so the transport is live for notifications.
|
|
133
|
+
{
|
|
134
|
+
let queueBound = 1000;
|
|
135
|
+
try {
|
|
136
|
+
if (await configExists(projectRoot)) {
|
|
137
|
+
const cfg = await loadConfig(projectRoot);
|
|
138
|
+
queueBound = cfg.pipeline.eventQueueBound ?? 1000;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
// Config read failure is non-fatal — use default
|
|
143
|
+
}
|
|
144
|
+
initEventStream(server, projectRoot, queueBound);
|
|
145
|
+
}
|
|
94
146
|
process.stderr.write(`[agent-bober mcp] Server v${version} started (project: ${projectRoot})\n`);
|
|
95
147
|
// ── Graceful shutdown ────────────────────────────────────────────
|
|
96
148
|
const shutdown = () => {
|
|
97
149
|
process.stderr.write("[agent-bober mcp] Shutting down...\n");
|
|
150
|
+
try {
|
|
151
|
+
getEventStream().shutdown();
|
|
152
|
+
}
|
|
153
|
+
catch { /* not initialized — ignore */ }
|
|
98
154
|
server.close().catch(() => {
|
|
99
155
|
// Ignore close errors during shutdown
|
|
100
156
|
});
|
package/dist/mcp/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,0DAA0D;AAC1D,kDAAkD;AAClD,EAAE;AACF,oEAAoE;AACpE,mDAAmD;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,QAAQ,EACR,SAAS,GACV,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[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abort_run tool ─────────────────────────────────────────────
|
|
2
|
+
//
|
|
3
|
+
// Aborts a running pipeline run by runId. Flips the run's status to
|
|
4
|
+
// 'aborted', persists { reason, abortedAt } to state.json, and returns
|
|
5
|
+
// { runId, status: 'aborted', abortedAt }.
|
|
6
|
+
//
|
|
7
|
+
// Soft errors (not found, not active) return JSON { error: '...' }.
|
|
8
|
+
// Hard errors (missing runId arg) throw McpError(InvalidRequest).
|
|
9
|
+
//
|
|
10
|
+
// Note: this sprint flips the in-memory and disk state only. Forceful
|
|
11
|
+
// in-flight subprocess termination (SIGTERM propagation) is deferred to
|
|
12
|
+
// a future hardening sprint.
|
|
13
|
+
import { McpError, ErrorCode } from "@modelcontextprotocol/sdk/types.js";
|
|
14
|
+
import { registerTool } from "./registry.js";
|
|
15
|
+
import { runManager } from "../run-manager.js";
|
|
16
|
+
// ── Registration ─────────────────────────────────────────────────────
|
|
17
|
+
export function registerAbortRunTool() {
|
|
18
|
+
registerTool({
|
|
19
|
+
name: "bober_abort_run",
|
|
20
|
+
description: "Abort a running pipeline run by runId. " +
|
|
21
|
+
"Flips the run's status to 'aborted' and persists the abort reason. " +
|
|
22
|
+
"Returns the runId, status, and abortedAt timestamp. " +
|
|
23
|
+
"Returns a soft-error JSON when the run is not found or not currently running.",
|
|
24
|
+
inputSchema: {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
runId: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "The unique identifier of the run to abort.",
|
|
30
|
+
},
|
|
31
|
+
reason: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "Optional reason for aborting the run. Defaults to 'Aborted by user'.",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
required: ["runId"],
|
|
37
|
+
additionalProperties: false,
|
|
38
|
+
},
|
|
39
|
+
handler: async (args) => {
|
|
40
|
+
const runId = typeof args.runId === "string" ? args.runId.trim() : "";
|
|
41
|
+
if (!runId) {
|
|
42
|
+
throw new McpError(ErrorCode.InvalidRequest, "runId is required and must be a non-empty string.");
|
|
43
|
+
}
|
|
44
|
+
const reason = typeof args.reason === "string" ? args.reason : "Aborted by user";
|
|
45
|
+
const state = runManager.getRun(runId);
|
|
46
|
+
if (state === null) {
|
|
47
|
+
return JSON.stringify({ error: `Run not found: ${runId}` }, null, 2);
|
|
48
|
+
}
|
|
49
|
+
if (state.status !== "running") {
|
|
50
|
+
return JSON.stringify({ error: "Run is not active" }, null, 2);
|
|
51
|
+
}
|
|
52
|
+
runManager.abortRun(runId, reason);
|
|
53
|
+
const updated = runManager.getRun(runId);
|
|
54
|
+
return JSON.stringify({
|
|
55
|
+
runId: updated.runId,
|
|
56
|
+
status: updated.status,
|
|
57
|
+
abortedAt: updated.abortedAt,
|
|
58
|
+
}, null, 2);
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=abort-run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abort-run.js","sourceRoot":"","sources":["../../../src/mcp/tools/abort-run.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,EAAE;AACF,oEAAoE;AACpE,uEAAuE;AACvE,2CAA2C;AAC3C,EAAE;AACF,oEAAoE;AACpE,kEAAkE;AAClE,EAAE;AACF,sEAAsE;AACtE,wEAAwE;AACxE,6BAA6B;AAE7B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,wEAAwE;AAExE,MAAM,UAAU,oBAAoB;IAClC,YAAY,CAAC;QACX,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,yCAAyC;YACzC,qEAAqE;YACrE,sDAAsD;YACtD,+EAA+E;QACjF,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,E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CACnB;gBACE,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,SAAS,EAAE,OAAO,CAAC,SAAS;aAC7B,EACD,IAAI,EACJ,CAAC,CACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/dist/mcp/tools/anchor.js
CHANGED
|
@@ -50,7 +50,7 @@ export function registerAnchorTool() {
|
|
|
50
50
|
}
|
|
51
51
|
config.project.mode = "greenfield";
|
|
52
52
|
config.project.preset = "anchor";
|
|
53
|
-
const runId = runManager.startRun(task, projectRoot, config);
|
|
53
|
+
const runId = await runManager.startRun(task, projectRoot, config);
|
|
54
54
|
return JSON.stringify({
|
|
55
55
|
runId,
|
|
56
56
|
status: "running",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor.js","sourceRoot":"","sources":["../../../src/mcp/tools/anchor.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,4EAA4E;AAE5E,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,wEAAwE;AAExE,MAAM,UAAU,kBAAkB;IAChC,YAAY,CAAC;QACX,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,8DAA8D;YAC9D,+DAA+D;YAC/D,mDAAmD;YACnD,mCAAmC;QACrC,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,6CAA6C;iBAC3D;aACF;YACD,QAAQ,EAAE,CAAC,MAAM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pD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// ── bober_approve_checkpoint tool ────────────────────────────────────
|
|
2
|
+
//
|
|
3
|
+
// Approves a pending checkpoint by writing
|
|
4
|
+
// .bober/approvals/<id>.approved.json with the same payload shape as
|
|
5
|
+
// the `bober approve` CLI command. Guards with pendingExists before
|
|
6
|
+
// writing to prevent dangling approved markers.
|
|
7
|
+
//
|
|
8
|
+
// Returns { approvedAt, checkpointId } on success.
|
|
9
|
+
// Soft errors for: missing pending, relative projectPath.
|
|
10
|
+
//
|
|
11
|
+
// Sprint 5 (cockpit-integration)
|
|
12
|
+
import { cwd } from "node:process";
|
|
13
|
+
import { isAbsolute } from "node:path";
|
|
14
|
+
import { registerTool } from "./registry.js";
|
|
15
|
+
import { pendingExists, saveApproved, } from "../../state/approval-state.js";
|
|
16
|
+
import { resolveApprover } from "../../cli/commands/approve.js";
|
|
17
|
+
// ── Registration ─────────────────────────────────────────────────────
|
|
18
|
+
export function registerApproveCheckpointTool() {
|
|
19
|
+
registerTool({
|
|
20
|
+
name: "bober_approve_checkpoint",
|
|
21
|
+
description: "Approve a pending checkpoint by writing .bober/approvals/<id>.approved.json. " +
|
|
22
|
+
"Shares the marker-file shape with the `bober approve` CLI command. " +
|
|
23
|
+
"Returns { approvedAt, checkpointId } on success.",
|
|
24
|
+
inputSchema: {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
checkpointId: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "Checkpoint to approve.",
|
|
30
|
+
},
|
|
31
|
+
projectPath: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "Absolute project root (defaults to cwd).",
|
|
34
|
+
},
|
|
35
|
+
editDelta: {
|
|
36
|
+
description: "Optional override payload (any JSON-serializable value).",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
required: ["checkpointId"],
|
|
40
|
+
additionalProperties: false,
|
|
41
|
+
},
|
|
42
|
+
handler: async (args) => {
|
|
43
|
+
const checkpointId = typeof args.checkpointId === "string" ? args.checkpointId.trim() : "";
|
|
44
|
+
if (!checkpointId) {
|
|
45
|
+
return JSON.stringify({
|
|
46
|
+
error: "checkpointId is required and must be a non-empty string.",
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
const projectPath = typeof args.projectPath === "string" ? args.projectPath : cwd();
|
|
50
|
+
if (typeof args.projectPath === "string" && !isAbsolute(args.projectPath)) {
|
|
51
|
+
return JSON.stringify({ error: "projectPath must be absolute" });
|
|
52
|
+
}
|
|
53
|
+
const exists = await pendingExists(projectPath, checkpointId);
|
|
54
|
+
if (!exists) {
|
|
55
|
+
return JSON.stringify({
|
|
56
|
+
error: `No pending checkpoint found: ${checkpointId}`,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const approvedAt = new Date().toISOString();
|
|
60
|
+
const marker = {
|
|
61
|
+
approvedAt,
|
|
62
|
+
approverId: resolveApprover(),
|
|
63
|
+
...(args.editDelta !== undefined ? { editDelta: args.editDelta } : {}),
|
|
64
|
+
};
|
|
65
|
+
await saveApproved(projectPath, checkpointId, marker);
|
|
66
|
+
return JSON.stringify({ approvedAt, checkpointId }, null, 2);
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=approve-checkpoint.js.map
|