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
package/dist/utils/git.js
CHANGED
|
@@ -62,6 +62,56 @@ export async function hasUncommittedChanges(cwd) {
|
|
|
62
62
|
});
|
|
63
63
|
return stdout.trim().length > 0;
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Add a new git worktree at the given path on a new branch.
|
|
67
|
+
*
|
|
68
|
+
* Shells out to: git worktree add <path> -b <branch> [<baseBranch>]
|
|
69
|
+
* Throws on non-zero exit (a failed worktree-add must surface as an error).
|
|
70
|
+
*/
|
|
71
|
+
export async function addWorktree(projectRoot, worktreePath, branch, baseBranch) {
|
|
72
|
+
const args = ["worktree", "add", worktreePath, "-b", branch];
|
|
73
|
+
if (baseBranch)
|
|
74
|
+
args.push(baseBranch);
|
|
75
|
+
await execa("git", args, { cwd: projectRoot });
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Remove a git worktree by path.
|
|
79
|
+
*
|
|
80
|
+
* Shells out to: git worktree remove [-f] <path>
|
|
81
|
+
* Uses reject: false so that removing a worktree that no longer exists
|
|
82
|
+
* does not crash cleanup paths.
|
|
83
|
+
*/
|
|
84
|
+
export async function removeWorktree(projectRoot, worktreePath, force) {
|
|
85
|
+
const args = ["worktree", "remove"];
|
|
86
|
+
if (force)
|
|
87
|
+
args.push("-f");
|
|
88
|
+
args.push(worktreePath);
|
|
89
|
+
await execa("git", args, { cwd: projectRoot, reject: false });
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Check whether the working tree is clean (no staged or unstaged changes).
|
|
93
|
+
*
|
|
94
|
+
* Returns { clean: true, dirtyFiles: [] } when the tree is clean.
|
|
95
|
+
* Returns { clean: false, dirtyFiles: [...] } listing each dirty path
|
|
96
|
+
* (parsed from `git status --porcelain` — columns 0-1 are the XY status
|
|
97
|
+
* codes, column 2 is a space, then the path starts at column 3).
|
|
98
|
+
*/
|
|
99
|
+
export async function isClean(cwd) {
|
|
100
|
+
const { stdout } = await execa("git", ["status", "--porcelain"], {
|
|
101
|
+
cwd,
|
|
102
|
+
reject: false,
|
|
103
|
+
});
|
|
104
|
+
const lines = stdout
|
|
105
|
+
.split("\n")
|
|
106
|
+
.map((l) => l.trim())
|
|
107
|
+
.filter(Boolean);
|
|
108
|
+
if (lines.length === 0) {
|
|
109
|
+
return { clean: true, dirtyFiles: [] };
|
|
110
|
+
}
|
|
111
|
+
// Porcelain format: "XY path" — strip the leading "XY " (3 chars)
|
|
112
|
+
const dirtyFiles = lines.map((l) => l.slice(3).trim());
|
|
113
|
+
return { clean: false, dirtyFiles };
|
|
114
|
+
}
|
|
65
115
|
/**
|
|
66
116
|
* Stash any current changes, run the provided function, then restore.
|
|
67
117
|
*
|
package/dist/utils/git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,sEAAsE;AAEtE;;GAEG;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AC,IAAI,EAAE,CAAC,CAAC;IACvD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,GAAW,EACX,EAAoB;IAEpB,MAAM,KAAK,GAAG,MAAM,qBAAqB,CAAC,GAAG,CAAC,CAAC;IAE/C,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,EAAE,CAAC;IACpB,CAAC;YAAS,CAAC;QACT,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/hooks/hooks.json
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"hooks": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"matcher": "startup|clear|compact",
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "command",
|
|
9
|
+
"command": "${CLAUDE_PLUGIN_ROOT:-.}/hooks/session-start",
|
|
10
|
+
"async": false
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
3
15
|
"PostToolUse": [
|
|
4
16
|
{
|
|
5
17
|
"matcher": "Edit|Write",
|
|
6
|
-
"command": "echo 'Files modified
|
|
18
|
+
"command": "echo 'Files modified — run /bober:eval to verify'"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"matcher": "Edit|Write",
|
|
22
|
+
"command": "node scripts/graph-hook.mjs"
|
|
7
23
|
}
|
|
8
24
|
]
|
|
9
25
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# session-start — SessionStart hook for agent-bober
|
|
3
|
+
# Injects the bober.using-bober bootstrap skill into the model's first-turn context.
|
|
4
|
+
#
|
|
5
|
+
# Structural pattern from obra/superpowers (MIT). https://github.com/obra/superpowers
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
# Determine project root directory
|
|
10
|
+
PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
11
|
+
|
|
12
|
+
# Read bober.using-bober skill content
|
|
13
|
+
using_bober_content=$(cat "${PROJECT_ROOT}/skills/bober.using-bober/SKILL.md" 2>&1 || echo "Error reading bober.using-bober skill")
|
|
14
|
+
|
|
15
|
+
# Escape string for JSON embedding using bash parameter substitution.
|
|
16
|
+
# Each ${s//old/new} is a single C-level pass - orders of magnitude
|
|
17
|
+
# faster than the character-by-character loop this replaces.
|
|
18
|
+
escape_for_json() {
|
|
19
|
+
local s="$1"
|
|
20
|
+
s="${s//\\/\\\\}"
|
|
21
|
+
s="${s//\"/\\\"}"
|
|
22
|
+
s="${s//$'\n'/\\n}"
|
|
23
|
+
s="${s//$'\r'/\\r}"
|
|
24
|
+
s="${s//$'\t'/\\t}"
|
|
25
|
+
printf '%s' "$s"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
using_bober_escaped=$(escape_for_json "$using_bober_content")
|
|
29
|
+
session_context="<EXTREMELY_IMPORTANT>\nYou are agent-bober.\n\n**Below is the full content of your 'bober-using-bober' skill - your introduction to using bober skills. For all other skills, use the 'Skill' tool:**\n\n${using_bober_escaped}\n\n</EXTREMELY_IMPORTANT>"
|
|
30
|
+
|
|
31
|
+
# Output context injection as JSON.
|
|
32
|
+
# Uses printf instead of heredoc to work around bash 5.3+ heredoc hang.
|
|
33
|
+
# See: https://github.com/obra/superpowers/issues/571
|
|
34
|
+
if [ -n "${CURSOR_PLUGIN_ROOT:-}" ]; then
|
|
35
|
+
printf '{\n "additional_context": "%s"\n}\n' "$session_context"
|
|
36
|
+
elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -z "${COPILOT_CLI:-}" ]; then
|
|
37
|
+
printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": "%s"\n }\n}\n' "$session_context"
|
|
38
|
+
else
|
|
39
|
+
printf '{\n "additionalContext": "%s"\n}\n' "$session_context"
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
exit 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-bober",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Multi-agent harness for building applications autonomously with any LLM. Researcher, Planner, Curator, Generator, Evaluator pipeline. Supports Claude, GPT, Gemini, Ollama. MCP server for Cursor/Windsurf.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"LICENSE"
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@anthropic-ai/sdk": "^0.
|
|
60
|
+
"@anthropic-ai/sdk": "^0.100.1",
|
|
61
61
|
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
62
62
|
"chalk": "^5.4.1",
|
|
63
63
|
"commander": "^13.1.0",
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"glob": "^11.0.1",
|
|
66
66
|
"ora": "^8.1.1",
|
|
67
67
|
"prompts": "^2.4.2",
|
|
68
|
+
"semver": "^7.8.1",
|
|
68
69
|
"zod": "^3.24.2"
|
|
69
70
|
},
|
|
70
71
|
"peerDependencies": {
|
|
@@ -83,9 +84,11 @@
|
|
|
83
84
|
"@eslint/js": "^10.0.1",
|
|
84
85
|
"@types/node": "^22.13.0",
|
|
85
86
|
"@types/prompts": "^2.4.9",
|
|
87
|
+
"@types/semver": "^7.7.1",
|
|
86
88
|
"@typescript-eslint/eslint-plugin": "^8.22.0",
|
|
87
89
|
"@typescript-eslint/parser": "^8.22.0",
|
|
88
90
|
"eslint": "^9.19.0",
|
|
91
|
+
"markdownlint-cli": "^0.48.0",
|
|
89
92
|
"typescript": "^5.7.3",
|
|
90
93
|
"vitest": "^3.0.5"
|
|
91
94
|
}
|
package/scripts/check-prereqs.sh
CHANGED
|
@@ -54,6 +54,18 @@ else
|
|
|
54
54
|
add_check "{\"name\":\"bober_dir\",\"status\":\"missing\",\"path\":\".bober/\",\"message\":\"No .bober/ directory. Run /bober-plan first.\"}"
|
|
55
55
|
fi
|
|
56
56
|
|
|
57
|
+
# ── Optional check: tokensave (only if installed) ─────────────────
|
|
58
|
+
if command -v agent-bober &>/dev/null; then
|
|
59
|
+
ts_json=$(agent-bober graph check-prereq 2>/dev/null || echo '{"ok":false,"reason":"MISSING","hint":"agent-bober graph check-prereq failed"}')
|
|
60
|
+
# Normalize to the {name,status} shape used by other checks
|
|
61
|
+
if echo "$ts_json" | grep -q '"ok":true'; then
|
|
62
|
+
add_check "{\"name\":\"tokensave\",\"status\":\"ok\",\"detail\":$ts_json}"
|
|
63
|
+
else
|
|
64
|
+
# Tokensave missing is NOT a hard blocker for any current command — emit info-only
|
|
65
|
+
CHECKS+=("{\"name\":\"tokensave\",\"status\":\"optional\",\"detail\":$ts_json}")
|
|
66
|
+
fi
|
|
67
|
+
fi
|
|
68
|
+
|
|
57
69
|
# ── Command-specific checks ───────────────────────────────────────
|
|
58
70
|
|
|
59
71
|
case "$COMMAND" in
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# e2e-graph-smoke.sh — end-to-end smoke test for the tokensave graph integration.
|
|
3
|
+
#
|
|
4
|
+
# Prerequisites:
|
|
5
|
+
# - tokensave >= 6.0.0-beta.1 installed and on PATH
|
|
6
|
+
# - npm + node >= 18
|
|
7
|
+
#
|
|
8
|
+
# This script is gated in CI by checking for the tokensave binary.
|
|
9
|
+
# If tokensave is not available, the script exits 0 (skip, not fail).
|
|
10
|
+
#
|
|
11
|
+
# Usage:
|
|
12
|
+
# bash scripts/e2e-graph-smoke.sh
|
|
13
|
+
#
|
|
14
|
+
# The script:
|
|
15
|
+
# 1. Verifies tokensave is available
|
|
16
|
+
# 2. Builds the project
|
|
17
|
+
# 3. Creates a temp directory with a minimal project
|
|
18
|
+
# 4. Runs agent-bober init (brownfield) to get bober.config.json with graph.enabled=true
|
|
19
|
+
# 5. Runs agent-bober graph init
|
|
20
|
+
# 6. Runs agent-bober graph status — asserts ready=true in JSON output
|
|
21
|
+
# 7. Runs agent-bober onboard — asserts 5 files written
|
|
22
|
+
# 8. Runs agent-bober impact sandboxPath — asserts .bober/graph/impact/sandboxpath.md exists
|
|
23
|
+
# 9. Cleans up
|
|
24
|
+
|
|
25
|
+
set -euo pipefail
|
|
26
|
+
|
|
27
|
+
# ── Colors ────────────────────────────────────────────────────────────────────
|
|
28
|
+
RED='\033[0;31m'
|
|
29
|
+
GREEN='\033[0;32m'
|
|
30
|
+
CYAN='\033[0;36m'
|
|
31
|
+
YELLOW='\033[1;33m'
|
|
32
|
+
NC='\033[0m' # No Color
|
|
33
|
+
|
|
34
|
+
info() { echo -e "${CYAN}[smoke]${NC} $*"; }
|
|
35
|
+
ok() { echo -e "${GREEN}[OK]${NC} $*"; }
|
|
36
|
+
warn() { echo -e "${YELLOW}[SKIP]${NC} $*"; }
|
|
37
|
+
fail() { echo -e "${RED}[FAIL]${NC} $*" >&2; exit 1; }
|
|
38
|
+
|
|
39
|
+
# ── Gate: tokensave must be available ─────────────────────────────────────────
|
|
40
|
+
if ! command -v tokensave &>/dev/null; then
|
|
41
|
+
warn "tokensave binary not found — skipping e2e smoke test (install with: brew install aovestdipaperino/tap/tokensave)"
|
|
42
|
+
exit 0
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
TOKENSAVE_VERSION=$(tokensave --version 2>&1 | head -1 || echo "unknown")
|
|
46
|
+
info "tokensave found: ${TOKENSAVE_VERSION}"
|
|
47
|
+
|
|
48
|
+
# ── Step 1: Build the project ─────────────────────────────────────────────────
|
|
49
|
+
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
50
|
+
info "Building agent-bober from ${REPO_ROOT}..."
|
|
51
|
+
cd "${REPO_ROOT}"
|
|
52
|
+
npm run build 2>&1 | tail -5
|
|
53
|
+
ok "Build complete"
|
|
54
|
+
|
|
55
|
+
# ── Step 2: Create a temp test project ────────────────────────────────────────
|
|
56
|
+
TMP_DIR="$(mktemp -d)"
|
|
57
|
+
trap 'rm -rf "${TMP_DIR}"' EXIT
|
|
58
|
+
info "Temp project: ${TMP_DIR}"
|
|
59
|
+
|
|
60
|
+
# Initialise a minimal git repo so agent-bober can detect project root
|
|
61
|
+
cd "${TMP_DIR}"
|
|
62
|
+
git init -q
|
|
63
|
+
git commit --allow-empty -m "init" -q
|
|
64
|
+
|
|
65
|
+
# Write a minimal bober.config.json with graph.enabled=true
|
|
66
|
+
cat > bober.config.json <<'EOF'
|
|
67
|
+
{
|
|
68
|
+
"project": { "name": "smoke-test", "mode": "brownfield" },
|
|
69
|
+
"planner": { "model": "sonnet" },
|
|
70
|
+
"generator": { "model": "sonnet" },
|
|
71
|
+
"evaluator": { "strategies": [] },
|
|
72
|
+
"graph": { "enabled": true, "languageTier": "core" }
|
|
73
|
+
}
|
|
74
|
+
EOF
|
|
75
|
+
|
|
76
|
+
# Add a minimal TypeScript source file
|
|
77
|
+
mkdir -p src
|
|
78
|
+
cat > src/index.ts <<'EOF'
|
|
79
|
+
export function sandboxPath(root: string, p: string): string {
|
|
80
|
+
return `${root}/${p}`;
|
|
81
|
+
}
|
|
82
|
+
EOF
|
|
83
|
+
|
|
84
|
+
# Write a package.json so tokensave knows it is a Node project
|
|
85
|
+
cat > package.json <<'EOF'
|
|
86
|
+
{ "name": "smoke-test", "version": "1.0.0" }
|
|
87
|
+
EOF
|
|
88
|
+
|
|
89
|
+
ok "Temp project created"
|
|
90
|
+
|
|
91
|
+
# ── Step 3: Link or use agent-bober ───────────────────────────────────────────
|
|
92
|
+
BOBER_BIN="${REPO_ROOT}/node_modules/.bin/agent-bober"
|
|
93
|
+
if [[ ! -f "${BOBER_BIN}" ]]; then
|
|
94
|
+
# If running from a global install
|
|
95
|
+
BOBER_BIN="agent-bober"
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
# Use the built binary directly for hermetic execution
|
|
99
|
+
NODE_BIN="node ${REPO_ROOT}/dist/cli/index.js"
|
|
100
|
+
|
|
101
|
+
run_bober() {
|
|
102
|
+
${NODE_BIN} "$@"
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
# ── Step 4: graph init ────────────────────────────────────────────────────────
|
|
106
|
+
info "Running: agent-bober graph init"
|
|
107
|
+
run_bober graph init
|
|
108
|
+
ok "graph init succeeded"
|
|
109
|
+
|
|
110
|
+
# ── Step 5: graph status ──────────────────────────────────────────────────────
|
|
111
|
+
info "Running: agent-bober graph status --json"
|
|
112
|
+
STATUS_JSON="$(run_bober graph status --json)"
|
|
113
|
+
info "Status output: ${STATUS_JSON}"
|
|
114
|
+
|
|
115
|
+
# The graph may not be 'ready' if tokensave hasn't fully indexed in CI,
|
|
116
|
+
# but the command should succeed (exit 0) and produce valid JSON.
|
|
117
|
+
echo "${STATUS_JSON}" | node -e "
|
|
118
|
+
const d = JSON.parse(require('fs').readFileSync('/dev/stdin','utf8'));
|
|
119
|
+
if (typeof d.indexedFileCount !== 'number') { console.error('Missing indexedFileCount'); process.exit(1); }
|
|
120
|
+
if (typeof d.stale !== 'boolean') { console.error('Missing stale'); process.exit(1); }
|
|
121
|
+
console.log('JSON shape OK');
|
|
122
|
+
" || fail "graph status --json produced invalid JSON"
|
|
123
|
+
|
|
124
|
+
ok "graph status succeeded"
|
|
125
|
+
|
|
126
|
+
# ── Step 6: onboard ───────────────────────────────────────────────────────────
|
|
127
|
+
info "Running: agent-bober onboard"
|
|
128
|
+
# onboard requires a live graph engine; run it and check artifacts
|
|
129
|
+
run_bober onboard || warn "onboard exited non-zero (graph may not be fully ready)"
|
|
130
|
+
|
|
131
|
+
ONBOARD_DIR="${TMP_DIR}/.bober/onboarding"
|
|
132
|
+
if [[ -d "${ONBOARD_DIR}" ]]; then
|
|
133
|
+
ARTIFACT_COUNT="$(ls "${ONBOARD_DIR}"/*.md 2>/dev/null | wc -l | tr -d ' ')"
|
|
134
|
+
if [[ "${ARTIFACT_COUNT}" -eq 5 ]]; then
|
|
135
|
+
ok "onboard wrote 5 artifacts"
|
|
136
|
+
else
|
|
137
|
+
warn "onboard wrote ${ARTIFACT_COUNT}/5 artifacts (graph may be warming up)"
|
|
138
|
+
fi
|
|
139
|
+
else
|
|
140
|
+
warn "onboard directory not created (graph engine may not be ready)"
|
|
141
|
+
fi
|
|
142
|
+
|
|
143
|
+
# ── Step 7: impact ────────────────────────────────────────────────────────────
|
|
144
|
+
info "Running: agent-bober impact sandboxPath"
|
|
145
|
+
run_bober impact sandboxPath || warn "impact exited non-zero (graph may not be fully ready)"
|
|
146
|
+
|
|
147
|
+
IMPACT_FILE="${TMP_DIR}/.bober/graph/impact/sandboxpath.md"
|
|
148
|
+
if [[ -f "${IMPACT_FILE}" ]]; then
|
|
149
|
+
ok "impact report written: .bober/graph/impact/sandboxpath.md"
|
|
150
|
+
# Verify required sections
|
|
151
|
+
if grep -q "^# Impact: sandboxPath" "${IMPACT_FILE}" && \
|
|
152
|
+
grep -q "^## Affected symbols" "${IMPACT_FILE}" && \
|
|
153
|
+
grep -q "^## Tests covering this symbol" "${IMPACT_FILE}"; then
|
|
154
|
+
ok "impact report has all required sections"
|
|
155
|
+
else
|
|
156
|
+
fail "impact report is missing required sections"
|
|
157
|
+
fi
|
|
158
|
+
else
|
|
159
|
+
warn "impact file not created (graph engine may not be ready)"
|
|
160
|
+
fi
|
|
161
|
+
|
|
162
|
+
# ── Done ──────────────────────────────────────────────────────────────────────
|
|
163
|
+
echo ""
|
|
164
|
+
ok "e2e-graph-smoke.sh completed"
|
|
165
|
+
echo ""
|
|
166
|
+
echo " Temp project: ${TMP_DIR} (cleaned up)"
|
|
167
|
+
echo " Tokensave: ${TOKENSAVE_VERSION}"
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* PostToolUse hook for Edit|Write tools.
|
|
4
|
+
*
|
|
5
|
+
* Claude Code invokes this script after every Edit/Write tool call,
|
|
6
|
+
* passing tool metadata via stdin (JSON) per the hook contract.
|
|
7
|
+
*
|
|
8
|
+
* Contract:
|
|
9
|
+
* - Read bober.config.json sync; exit 0 if graph.enabled=false or graph.autoSync=false.
|
|
10
|
+
* - Read JSON payload from stdin (Claude Code hook protocol).
|
|
11
|
+
* - Extract file paths (tool_input.file_path for Edit/Write).
|
|
12
|
+
* - Validate each path is inside the project root (sandboxPath logic mirrored
|
|
13
|
+
* from src/orchestrator/tools/handlers.ts:31-45).
|
|
14
|
+
* - Append one JSON line to .bober/graph/.hook-queue.jsonl: {ts, tool, paths}.
|
|
15
|
+
* - Exit 0 in <50ms. No tokensave invocation here.
|
|
16
|
+
*
|
|
17
|
+
* Cross-platform notes:
|
|
18
|
+
* - Shebang is present but Windows uses the hooks.json command directly:
|
|
19
|
+
* "command": "node scripts/graph-hook.mjs" (NOT a bare path).
|
|
20
|
+
* - All path operations use node:path, no shell quoting.
|
|
21
|
+
* - Uses fs SYNC calls only (readFileSync, appendFileSync) so the script
|
|
22
|
+
* can return as soon as the event loop drains. No promises.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { readFileSync, appendFileSync, mkdirSync, existsSync } from "node:fs";
|
|
26
|
+
import { resolve, relative, isAbsolute, dirname } from "node:path";
|
|
27
|
+
|
|
28
|
+
const PROJECT_ROOT = process.cwd();
|
|
29
|
+
|
|
30
|
+
// ── Helpers ────────────────────────────────────────────────────────
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Mirror of src/orchestrator/tools/handlers.ts:31-45 sandboxPath.
|
|
34
|
+
* Returns null instead of throwing when the path is outside the sandbox,
|
|
35
|
+
* so the hook script can silently drop + log an incident rather than crash.
|
|
36
|
+
*/
|
|
37
|
+
function sandboxPath(projectRoot, inputPath) {
|
|
38
|
+
if (typeof inputPath !== "string" || !inputPath) return null;
|
|
39
|
+
const abs = isAbsolute(inputPath) ? resolve(inputPath) : resolve(projectRoot, inputPath);
|
|
40
|
+
const rel = relative(projectRoot, abs);
|
|
41
|
+
if (rel.startsWith("..") || isAbsolute(rel)) return null;
|
|
42
|
+
return abs;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function readConfigSync() {
|
|
46
|
+
for (const candidate of ["bober.config.json", ".bober/config.json"]) {
|
|
47
|
+
const p = resolve(PROJECT_ROOT, candidate);
|
|
48
|
+
if (existsSync(p)) {
|
|
49
|
+
try {
|
|
50
|
+
return JSON.parse(readFileSync(p, "utf-8"));
|
|
51
|
+
} catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function readStdinSync() {
|
|
60
|
+
// Read up to 64KB from stdin synchronously via file descriptor 0.
|
|
61
|
+
try {
|
|
62
|
+
return readFileSync(0, "utf-8");
|
|
63
|
+
} catch {
|
|
64
|
+
return "";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function appendSandboxDropIncident(file) {
|
|
69
|
+
// Best-effort; mirrors IncidentLog.append for the "sandbox-drop" variant.
|
|
70
|
+
try {
|
|
71
|
+
const incidentsPath = resolve(PROJECT_ROOT, ".bober/graph/incidents.jsonl");
|
|
72
|
+
mkdirSync(dirname(incidentsPath), { recursive: true });
|
|
73
|
+
appendFileSync(
|
|
74
|
+
incidentsPath,
|
|
75
|
+
JSON.stringify({
|
|
76
|
+
ts: new Date().toISOString(),
|
|
77
|
+
event: "sandbox-drop",
|
|
78
|
+
file,
|
|
79
|
+
source: "graph-hook",
|
|
80
|
+
}) + "\n",
|
|
81
|
+
"utf-8",
|
|
82
|
+
);
|
|
83
|
+
} catch {
|
|
84
|
+
// ignore — never block the tool call
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// ── Main ───────────────────────────────────────────────────────────
|
|
89
|
+
|
|
90
|
+
function main() {
|
|
91
|
+
const config = readConfigSync();
|
|
92
|
+
const graph = config?.graph;
|
|
93
|
+
|
|
94
|
+
// Early exit when graph is disabled or autoSync is off.
|
|
95
|
+
// The hook entry stays registered in hooks.json (per s8-c9) but does nothing.
|
|
96
|
+
if (!graph || graph.enabled === false) return 0;
|
|
97
|
+
if (graph.autoSync === false) return 0;
|
|
98
|
+
|
|
99
|
+
const raw = readStdinSync();
|
|
100
|
+
let payload = {};
|
|
101
|
+
try {
|
|
102
|
+
payload = raw.trim() ? JSON.parse(raw) : {};
|
|
103
|
+
} catch {
|
|
104
|
+
// Malformed payload — exit cleanly with a warning; never crash.
|
|
105
|
+
process.stderr.write("[graph-hook] Warning: malformed stdin payload\n");
|
|
106
|
+
return 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Claude Code hook payload shape:
|
|
110
|
+
// { tool_name, tool_input: { file_path?, edits?[{file_path?}] }, ... }
|
|
111
|
+
const tool = payload.tool_name ?? "unknown";
|
|
112
|
+
const candidatePaths = [];
|
|
113
|
+
const ti = payload.tool_input ?? {};
|
|
114
|
+
if (typeof ti.file_path === "string") candidatePaths.push(ti.file_path);
|
|
115
|
+
if (Array.isArray(ti.edits)) {
|
|
116
|
+
for (const e of ti.edits) {
|
|
117
|
+
if (typeof e?.file_path === "string") candidatePaths.push(e.file_path);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Sandbox-validate every path. Drop any path outside the project root
|
|
122
|
+
// with a silent incident log.
|
|
123
|
+
const validated = [];
|
|
124
|
+
for (const p of candidatePaths) {
|
|
125
|
+
const sb = sandboxPath(PROJECT_ROOT, p);
|
|
126
|
+
if (sb === null) appendSandboxDropIncident(p);
|
|
127
|
+
else validated.push(sb);
|
|
128
|
+
}
|
|
129
|
+
if (validated.length === 0) return 0;
|
|
130
|
+
|
|
131
|
+
// Append to IPC queue file. mkdir is defensive.
|
|
132
|
+
const queueFile = resolve(PROJECT_ROOT, ".bober/graph/.hook-queue.jsonl");
|
|
133
|
+
try {
|
|
134
|
+
mkdirSync(dirname(queueFile), { recursive: true });
|
|
135
|
+
appendFileSync(
|
|
136
|
+
queueFile,
|
|
137
|
+
JSON.stringify({
|
|
138
|
+
ts: new Date().toISOString(),
|
|
139
|
+
tool,
|
|
140
|
+
paths: validated,
|
|
141
|
+
}) + "\n",
|
|
142
|
+
"utf-8",
|
|
143
|
+
);
|
|
144
|
+
} catch {
|
|
145
|
+
// Best-effort; never block the tool call
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
process.exit(main());
|