agent-bober 0.12.0 → 0.17.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/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +2 -2
- package/CHANGELOG.md +243 -0
- package/README.md +238 -5
- package/agents/bober-architect.md +72 -0
- package/agents/bober-code-reviewer.md +238 -0
- package/agents/bober-curator.md +49 -0
- package/agents/bober-deployer.md +267 -0
- package/agents/bober-diagnoser.md +289 -0
- package/agents/bober-documenter.md +129 -0
- package/agents/bober-evaluator.md +135 -1
- package/agents/bober-generator.md +80 -3
- package/agents/bober-planner.md +47 -1
- 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 +40 -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/memory.d.ts +14 -0
- package/dist/cli/commands/memory.d.ts.map +1 -0
- package/dist/cli/commands/memory.js +132 -0
- package/dist/cli/commands/memory.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 +56 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +41 -3
- 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 +25 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/role-providers.d.ts +29 -0
- package/dist/config/role-providers.d.ts.map +1 -0
- package/dist/config/role-providers.js +115 -0
- package/dist/config/role-providers.js.map +1 -0
- package/dist/config/schema.d.ts +1350 -61
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +189 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/contracts/eval-result.d.ts +112 -56
- package/dist/contracts/eval-result.d.ts.map +1 -1
- package/dist/contracts/eval-result.js +3 -0
- package/dist/contracts/eval-result.js.map +1 -1
- package/dist/contracts/sprint-contract.d.ts +30 -30
- package/dist/fleet/aggregator.d.ts +5 -0
- package/dist/fleet/aggregator.d.ts.map +1 -0
- package/dist/fleet/aggregator.js +39 -0
- package/dist/fleet/aggregator.js.map +1 -0
- package/dist/fleet/child-config.d.ts +12 -0
- package/dist/fleet/child-config.d.ts.map +1 -0
- package/dist/fleet/child-config.js +38 -0
- package/dist/fleet/child-config.js.map +1 -0
- package/dist/fleet/coordinator.d.ts +25 -0
- package/dist/fleet/coordinator.d.ts.map +1 -0
- package/dist/fleet/coordinator.js +40 -0
- package/dist/fleet/coordinator.js.map +1 -0
- package/dist/fleet/index.d.ts +40 -0
- package/dist/fleet/index.d.ts.map +1 -0
- package/dist/fleet/index.js +117 -0
- package/dist/fleet/index.js.map +1 -0
- package/dist/fleet/manifest.d.ts +51 -0
- package/dist/fleet/manifest.d.ts.map +1 -0
- package/dist/fleet/manifest.js +32 -0
- package/dist/fleet/manifest.js.map +1 -0
- package/dist/fleet/reporter.d.ts +32 -0
- package/dist/fleet/reporter.d.ts.map +1 -0
- package/dist/fleet/reporter.js +71 -0
- package/dist/fleet/reporter.js.map +1 -0
- package/dist/fleet/runner.d.ts +48 -0
- package/dist/fleet/runner.d.ts.map +1 -0
- package/dist/fleet/runner.js +104 -0
- package/dist/fleet/runner.js.map +1 -0
- package/dist/fleet/scaffolder.d.ts +12 -0
- package/dist/fleet/scaffolder.d.ts.map +1 -0
- package/dist/fleet/scaffolder.js +82 -0
- package/dist/fleet/scaffolder.js.map +1 -0
- package/dist/fleet/types.d.ts +21 -0
- package/dist/fleet/types.d.ts.map +1 -0
- package/dist/fleet/types.js +2 -0
- package/dist/fleet/types.js.map +1 -0
- 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 +53 -0
- package/dist/graph/cli.d.ts.map +1 -0
- package/dist/graph/cli.js +181 -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 +95 -0
- package/dist/graph/pipeline-lifecycle.d.ts.map +1 -0
- package/dist/graph/pipeline-lifecycle.js +341 -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 +130 -0
- package/dist/graph/preflight-injector.d.ts.map +1 -0
- package/dist/graph/preflight-injector.js +618 -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/init.d.ts.map +1 -1
- package/dist/mcp/tools/init.js +2 -0
- package/dist/mcp/tools/init.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 +30 -0
- package/dist/orchestrator/agent-loader.js.map +1 -1
- package/dist/orchestrator/agentic-loop.d.ts +51 -0
- package/dist/orchestrator/agentic-loop.d.ts.map +1 -1
- package/dist/orchestrator/agentic-loop.js +123 -4
- package/dist/orchestrator/agentic-loop.js.map +1 -1
- package/dist/orchestrator/arch-lenses.d.ts +7 -0
- package/dist/orchestrator/arch-lenses.d.ts.map +1 -0
- package/dist/orchestrator/arch-lenses.js +22 -0
- package/dist/orchestrator/arch-lenses.js.map +1 -0
- package/dist/orchestrator/architect-agent.d.ts +16 -0
- package/dist/orchestrator/architect-agent.d.ts.map +1 -1
- package/dist/orchestrator/architect-agent.js +546 -9
- 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 +60 -9
- 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/documenter-agent.d.ts +57 -0
- package/dist/orchestrator/documenter-agent.d.ts.map +1 -0
- package/dist/orchestrator/documenter-agent.js +195 -0
- package/dist/orchestrator/documenter-agent.js.map +1 -0
- package/dist/orchestrator/environment.d.ts +45 -0
- package/dist/orchestrator/environment.d.ts.map +1 -0
- package/dist/orchestrator/environment.js +151 -0
- package/dist/orchestrator/environment.js.map +1 -0
- package/dist/orchestrator/eval-lenses.d.ts +7 -0
- package/dist/orchestrator/eval-lenses.d.ts.map +1 -0
- package/dist/orchestrator/eval-lenses.js +19 -0
- package/dist/orchestrator/eval-lenses.js.map +1 -0
- package/dist/orchestrator/eval-persist.d.ts +25 -0
- package/dist/orchestrator/eval-persist.d.ts.map +1 -0
- package/dist/orchestrator/eval-persist.js +74 -0
- package/dist/orchestrator/eval-persist.js.map +1 -0
- package/dist/orchestrator/evaluator-agent.d.ts +23 -0
- package/dist/orchestrator/evaluator-agent.d.ts.map +1 -1
- package/dist/orchestrator/evaluator-agent.js +80 -10
- 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 +53 -8
- package/dist/orchestrator/generator-agent.js.map +1 -1
- package/dist/orchestrator/memory/distill.d.ts +60 -0
- package/dist/orchestrator/memory/distill.d.ts.map +1 -0
- package/dist/orchestrator/memory/distill.js +177 -0
- package/dist/orchestrator/memory/distill.js.map +1 -0
- package/dist/orchestrator/memory/eval-source.d.ts +20 -0
- package/dist/orchestrator/memory/eval-source.d.ts.map +1 -0
- package/dist/orchestrator/memory/eval-source.js +88 -0
- package/dist/orchestrator/memory/eval-source.js.map +1 -0
- package/dist/orchestrator/memory/retrieve.d.ts +45 -0
- package/dist/orchestrator/memory/retrieve.d.ts.map +1 -0
- package/dist/orchestrator/memory/retrieve.js +102 -0
- package/dist/orchestrator/memory/retrieve.js.map +1 -0
- package/dist/orchestrator/model-resolver.d.ts.map +1 -1
- package/dist/orchestrator/model-resolver.js +15 -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 +31 -0
- package/dist/orchestrator/pipeline.d.ts.map +1 -1
- package/dist/orchestrator/pipeline.js +267 -5
- package/dist/orchestrator/pipeline.js.map +1 -1
- package/dist/orchestrator/planner-agent.d.ts +22 -1
- package/dist/orchestrator/planner-agent.d.ts.map +1 -1
- package/dist/orchestrator/planner-agent.js +165 -8
- 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 +48 -11
- package/dist/orchestrator/research-agent.js.map +1 -1
- package/dist/orchestrator/tools/handlers.d.ts +16 -0
- package/dist/orchestrator/tools/handlers.d.ts.map +1 -1
- package/dist/orchestrator/tools/handlers.js +30 -5
- 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/tools/schemas.js +5 -5
- package/dist/orchestrator/tools/schemas.js.map +1 -1
- package/dist/orchestrator/workflow/args-builder.d.ts +35 -0
- package/dist/orchestrator/workflow/args-builder.d.ts.map +1 -0
- package/dist/orchestrator/workflow/args-builder.js +142 -0
- package/dist/orchestrator/workflow/args-builder.js.map +1 -0
- package/dist/orchestrator/workflow/budget.d.ts +57 -0
- package/dist/orchestrator/workflow/budget.d.ts.map +1 -0
- package/dist/orchestrator/workflow/budget.js +80 -0
- package/dist/orchestrator/workflow/budget.js.map +1 -0
- package/dist/orchestrator/workflow/conformance.d.ts +27 -0
- package/dist/orchestrator/workflow/conformance.d.ts.map +1 -0
- package/dist/orchestrator/workflow/conformance.js +111 -0
- package/dist/orchestrator/workflow/conformance.js.map +1 -0
- package/dist/orchestrator/workflow/eligibility.d.ts +8 -0
- package/dist/orchestrator/workflow/eligibility.d.ts.map +1 -0
- package/dist/orchestrator/workflow/eligibility.js +10 -0
- package/dist/orchestrator/workflow/eligibility.js.map +1 -0
- package/dist/orchestrator/workflow/engine.d.ts +10 -0
- package/dist/orchestrator/workflow/engine.d.ts.map +1 -0
- package/dist/orchestrator/workflow/engine.js +2 -0
- package/dist/orchestrator/workflow/engine.js.map +1 -0
- package/dist/orchestrator/workflow/errors.d.ts +13 -0
- package/dist/orchestrator/workflow/errors.d.ts.map +1 -0
- package/dist/orchestrator/workflow/errors.js +26 -0
- package/dist/orchestrator/workflow/errors.js.map +1 -0
- package/dist/orchestrator/workflow/flusher.d.ts +19 -0
- package/dist/orchestrator/workflow/flusher.d.ts.map +1 -0
- package/dist/orchestrator/workflow/flusher.js +81 -0
- package/dist/orchestrator/workflow/flusher.js.map +1 -0
- package/dist/orchestrator/workflow/interpreter.d.ts +48 -0
- package/dist/orchestrator/workflow/interpreter.d.ts.map +1 -0
- package/dist/orchestrator/workflow/interpreter.js +92 -0
- package/dist/orchestrator/workflow/interpreter.js.map +1 -0
- package/dist/orchestrator/workflow/pure-sprint.d.ts +65 -0
- package/dist/orchestrator/workflow/pure-sprint.d.ts.map +1 -0
- package/dist/orchestrator/workflow/pure-sprint.js +82 -0
- package/dist/orchestrator/workflow/pure-sprint.js.map +1 -0
- package/dist/orchestrator/workflow/reconciler.d.ts +15 -0
- package/dist/orchestrator/workflow/reconciler.d.ts.map +1 -0
- package/dist/orchestrator/workflow/reconciler.js +65 -0
- package/dist/orchestrator/workflow/reconciler.js.map +1 -0
- package/dist/orchestrator/workflow/resume-cursor.d.ts +10 -0
- package/dist/orchestrator/workflow/resume-cursor.d.ts.map +1 -0
- package/dist/orchestrator/workflow/resume-cursor.js +25 -0
- package/dist/orchestrator/workflow/resume-cursor.js.map +1 -0
- package/dist/orchestrator/workflow/retry.d.ts +50 -0
- package/dist/orchestrator/workflow/retry.d.ts.map +1 -0
- package/dist/orchestrator/workflow/retry.js +100 -0
- package/dist/orchestrator/workflow/retry.js.map +1 -0
- package/dist/orchestrator/workflow/scheduler.d.ts +87 -0
- package/dist/orchestrator/workflow/scheduler.d.ts.map +1 -0
- package/dist/orchestrator/workflow/scheduler.js +158 -0
- package/dist/orchestrator/workflow/scheduler.js.map +1 -0
- package/dist/orchestrator/workflow/selector.d.ts +26 -0
- package/dist/orchestrator/workflow/selector.d.ts.map +1 -0
- package/dist/orchestrator/workflow/selector.js +54 -0
- package/dist/orchestrator/workflow/selector.js.map +1 -0
- package/dist/orchestrator/workflow/synthesizer.d.ts +52 -0
- package/dist/orchestrator/workflow/synthesizer.d.ts.map +1 -0
- package/dist/orchestrator/workflow/synthesizer.js +75 -0
- package/dist/orchestrator/workflow/synthesizer.js.map +1 -0
- package/dist/orchestrator/workflow/ts-engine.d.ts +13 -0
- package/dist/orchestrator/workflow/ts-engine.d.ts.map +1 -0
- package/dist/orchestrator/workflow/ts-engine.js +14 -0
- package/dist/orchestrator/workflow/ts-engine.js.map +1 -0
- package/dist/orchestrator/workflow/types.d.ts +55 -0
- package/dist/orchestrator/workflow/types.d.ts.map +1 -0
- package/dist/orchestrator/workflow/types.js +3 -0
- package/dist/orchestrator/workflow/types.js.map +1 -0
- package/dist/orchestrator/workflow/workflow-engine.d.ts +31 -0
- package/dist/orchestrator/workflow/workflow-engine.d.ts.map +1 -0
- package/dist/orchestrator/workflow/workflow-engine.js +70 -0
- package/dist/orchestrator/workflow/workflow-engine.js.map +1 -0
- 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 +135 -11
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/claude-code.d.ts +44 -0
- package/dist/providers/claude-code.d.ts.map +1 -0
- package/dist/providers/claude-code.js +143 -0
- package/dist/providers/claude-code.js.map +1 -0
- package/dist/providers/factory.d.ts +16 -2
- package/dist/providers/factory.d.ts.map +1 -1
- package/dist/providers/factory.js +101 -14
- package/dist/providers/factory.js.map +1 -1
- package/dist/providers/google.d.ts.map +1 -1
- package/dist/providers/google.js +32 -3
- package/dist/providers/google.js.map +1 -1
- package/dist/providers/index.d.ts +4 -2
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +3 -1
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/providers/openai.js +28 -3
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/preflight.d.ts +22 -0
- package/dist/providers/preflight.d.ts.map +1 -0
- package/dist/providers/preflight.js +54 -0
- package/dist/providers/preflight.js.map +1 -0
- package/dist/providers/structured.d.ts +130 -0
- package/dist/providers/structured.d.ts.map +1 -0
- package/dist/providers/structured.js +205 -0
- package/dist/providers/structured.js.map +1 -0
- package/dist/providers/types.d.ts +53 -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/history-rotation.d.ts +17 -0
- package/dist/state/history-rotation.d.ts.map +1 -0
- package/dist/state/history-rotation.js +84 -0
- package/dist/state/history-rotation.js.map +1 -0
- package/dist/state/history.d.ts +16 -4
- package/dist/state/history.d.ts.map +1 -1
- package/dist/state/history.js +62 -20
- package/dist/state/history.js.map +1 -1
- package/dist/state/index.d.ts +4 -1
- package/dist/state/index.d.ts.map +1 -1
- package/dist/state/index.js +5 -2
- package/dist/state/index.js.map +1 -1
- package/dist/state/memory.d.ts +60 -0
- package/dist/state/memory.d.ts.map +1 -0
- package/dist/state/memory.js +242 -0
- package/dist/state/memory.js.map +1 -0
- 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 +27 -1
- package/hooks/session-start +42 -0
- package/package.json +13 -6
- 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/spike-claude-code-provider.mjs +66 -0
- package/scripts/spike-deepseek.mjs +63 -0
- package/scripts/sync-skills.mjs +4 -1
- package/scripts/sync-targets.json +12 -0
- package/scripts/update-all.mjs +255 -0
- package/skills/bober.architect/SKILL.md +13 -0
- package/skills/bober.architect/references/arch-lens-panel.md +126 -0
- 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.eval/SKILL.md +9 -0
- package/skills/bober.eval/references/lens-panel.md +115 -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 +16 -0
- package/skills/bober.postmortem/SKILL.md +231 -0
- package/skills/bober.run/SKILL.md +23 -4
- package/skills/bober.run/references/lens-panel.md +115 -0
- package/skills/bober.runbook/SKILL.md +335 -0
- package/skills/bober.sprint/SKILL.md +44 -2
- package/skills/bober.sprint/references/lens-panel.md +115 -0
- package/skills/bober.using-bober/SKILL.md +133 -0
- package/skills/bober.verify/SKILL.md +143 -0
- package/skills/shared/arch-lens-panel.md +126 -0
- package/skills/shared/lens-panel.md +115 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command classifier for the deploy module (Sprint 20).
|
|
3
|
+
*
|
|
4
|
+
* classifyCommand(commandText) returns 'safe' | 'risky' based solely on the
|
|
5
|
+
* COMMAND CONTENT — never on the agent's self-declared classification.
|
|
6
|
+
*
|
|
7
|
+
* This is the safety guarantee against multi-command Bash invocations such as
|
|
8
|
+
* `echo 'safe' && kubectl scale ...`. The classifier scans the entire command
|
|
9
|
+
* string for state-mutating verbs before any execution occurs.
|
|
10
|
+
*
|
|
11
|
+
* Pattern sources:
|
|
12
|
+
* - agents/bober-diagnoser.md:188-198 (forbidden command list)
|
|
13
|
+
* - skills/bober.runbook/SKILL.md (risky-step examples)
|
|
14
|
+
* - Sprint 20 contract evaluatorNotes: multi-command gate requirement.
|
|
15
|
+
*
|
|
16
|
+
* Default-deny: when in doubt, classify risky.
|
|
17
|
+
*/
|
|
18
|
+
/** Risky patterns — matched against the full command string.
|
|
19
|
+
* Most-specific patterns listed first to avoid false positives on substrings. */
|
|
20
|
+
const RISKY_PATTERNS = [
|
|
21
|
+
// kubectl mutators
|
|
22
|
+
/\bkubectl\s+(delete|apply|patch|edit|scale|rollout|exec\b.*--\s+(?!.*\bget\b))/,
|
|
23
|
+
// docker mutators
|
|
24
|
+
/\bdocker\s+(rm|stop|kill|restart|run|exec\b.*(?:bash|sh))/,
|
|
25
|
+
// git mutators
|
|
26
|
+
/\bgit\s+(reset\s+--hard|push|rebase|commit|revert|clean)/,
|
|
27
|
+
// terraform / helm
|
|
28
|
+
/\b(terraform\s+(apply|destroy)|helm\s+(install|upgrade|uninstall|rollback))\b/,
|
|
29
|
+
// file mutation: rm, rmdir, mv, cp with overwrite intent
|
|
30
|
+
/(?:^|\s)(rm|rmdir)\s+/,
|
|
31
|
+
/(?:^|\s)(mv|cp)\s+.*\s+\S+/, // mv/cp with destination argument (potential overwrite)
|
|
32
|
+
// shell redirect to file (> or >>)
|
|
33
|
+
/(?:^|[\s;|&])[^>]*>[>]?\s*\S+/,
|
|
34
|
+
// chmod / chown
|
|
35
|
+
/\bchmod\b|\bchown\b/,
|
|
36
|
+
// service / process control
|
|
37
|
+
/\bsystemctl\s+(start|stop|restart|enable|disable|mask|unmask)\b/,
|
|
38
|
+
/\bservice\s+\S+\s+(start|stop|restart)\b/,
|
|
39
|
+
/\b(kill|pkill|killall)\b/,
|
|
40
|
+
// package install
|
|
41
|
+
/\b(npm\s+install|pip\s+install|apt(\s+|-get\s+)install|brew\s+install|yarn\s+add|gem\s+install|cargo\s+install)\b/,
|
|
42
|
+
// privilege escalation
|
|
43
|
+
/(?:^|\s)sudo\s+/,
|
|
44
|
+
// state-mutating HTTP
|
|
45
|
+
/\bcurl\b[^|]*\s-X\s+(POST|PUT|PATCH|DELETE)\b/i,
|
|
46
|
+
// wget downloading executables (heuristic)
|
|
47
|
+
/\bwget\s+[^|]*\.(sh|bin|exe)\b/i,
|
|
48
|
+
// AWS mutation
|
|
49
|
+
/\baws\s+(ec2|elbv2|route53)\s+(create|delete|modify|put|update)/i,
|
|
50
|
+
// GCloud mutation
|
|
51
|
+
/\bgcloud\s+\S+\s+(create|delete|update|set)\b/i,
|
|
52
|
+
// Database migrations (heuristic — covers common runners)
|
|
53
|
+
/\b(flyway\s+migrate|liquibase\s+update|alembic\s+upgrade|rake\s+db:migrate|knex\s+migrate)\b/i,
|
|
54
|
+
// Secret rotation (heuristic)
|
|
55
|
+
/\b(vault\s+(rotate|write|delete)|aws\s+secretsmanager\s+(rotate|put|delete|update))\b/i,
|
|
56
|
+
];
|
|
57
|
+
/**
|
|
58
|
+
* Safe explicit allowlist — used as SHORT-CIRCUIT only when the ENTIRE command
|
|
59
|
+
* matches (no chain operators present). Any command with && / || / ; chains is
|
|
60
|
+
* evaluated via RISKY_PATTERNS first before reaching this list.
|
|
61
|
+
*/
|
|
62
|
+
const SAFE_SINGLE_COMMAND_PATTERNS = [
|
|
63
|
+
/^kubectl\s+(get|describe|logs|top|version|config\s+view)\b[^&;|]*$/,
|
|
64
|
+
/^docker\s+(ps|logs|inspect|images|version)\b[^&;|]*$/,
|
|
65
|
+
/^(grep|rg|ag|find|cat|head|tail|less|wc|awk|jq|yq)\b[^&;|]*$/,
|
|
66
|
+
/^git\s+(log|diff|show|blame|status|rev-parse|describe)\b[^&;|]*$/,
|
|
67
|
+
/^curl\b(?![^|]*\s-X\s+(POST|PUT|PATCH|DELETE))[^&;|]*$/i,
|
|
68
|
+
/^(ps|top|htop|lsof|netstat|ss|dig|nslookup|host|ping|traceroute|df|du|free|uname|uptime|date)\b[^&;|]*$/,
|
|
69
|
+
/^(sed\s+-n|awk)\b[^&;|]*$/, // read-only sed (-n only)
|
|
70
|
+
];
|
|
71
|
+
/**
|
|
72
|
+
* Classify a command string by blast radius.
|
|
73
|
+
*
|
|
74
|
+
* Rules:
|
|
75
|
+
* 1. Scan the full command string for any risky pattern (takes priority over allowlist).
|
|
76
|
+
* 2. If no risky pattern matched AND the command has no chain operators (&&/||/;/|),
|
|
77
|
+
* check if it matches the safe allowlist.
|
|
78
|
+
* 3. When in doubt → risky (default-deny).
|
|
79
|
+
*
|
|
80
|
+
* @param commandText - The raw shell command string.
|
|
81
|
+
* @returns 'safe' if the command is confirmed read-only/reversible; 'risky' otherwise.
|
|
82
|
+
*/
|
|
83
|
+
export function classifyCommand(commandText) {
|
|
84
|
+
const trimmed = commandText.trim();
|
|
85
|
+
if (trimmed.length === 0)
|
|
86
|
+
return "safe"; // empty / no-op
|
|
87
|
+
// Step 1: Scan for risky patterns first — this catches multi-command invocations.
|
|
88
|
+
for (const pattern of RISKY_PATTERNS) {
|
|
89
|
+
if (pattern.test(trimmed))
|
|
90
|
+
return "risky";
|
|
91
|
+
}
|
|
92
|
+
// Step 2: If no risky pattern matched, check if the whole command is a known-safe single command.
|
|
93
|
+
// A command with chain operators (&&, ||, ;, |) that passed risky-scan is still examined:
|
|
94
|
+
// pipe (|) alone can be safe (e.g., kubectl get pods | head) but && / || / ; chains to
|
|
95
|
+
// other commands need more scrutiny. Here we allow simple pipes to safe commands.
|
|
96
|
+
const hasRiskyChainOperator = /&&|\|\|/.test(trimmed);
|
|
97
|
+
const hasSemicolon = /;(?!\s*$)/.test(trimmed); // semicolons not at end
|
|
98
|
+
if (!hasRiskyChainOperator && !hasSemicolon) {
|
|
99
|
+
// Strip any trailing pipe chain and classify the base command.
|
|
100
|
+
const baseCommand = trimmed.split("|")[0].trim();
|
|
101
|
+
for (const safe of SAFE_SINGLE_COMMAND_PATTERNS) {
|
|
102
|
+
if (safe.test(baseCommand))
|
|
103
|
+
return "safe";
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// Step 3: When in doubt, classify risky (default-deny).
|
|
107
|
+
return "risky";
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=classify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify.js","sourceRoot":"","sources":["../../../src/orchestrator/deploy/classify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;kFACkF;AAClF,MAAM,cAAc,GAA0B;IAC5C,mBAAmB;IACnB,gFAAgF;IAChF,kBAAkB;IAClB,2DAA2D;IAC3D,eAAe;IACf,0DAA0D;IAC1D,mBAAmB;IACnB,+EAA+E;IAC/E,yDAAyD;IACzD,uBAAuB;IACvB,4BAA4B,EAAE,wDAAwD;IACtF,mCAAmC;IACnC,+BAA+B;IAC/B,gBAAgB;IAChB,qBAAqB;IACrB,4BAA4B;IAC5B,iEAAiE;IACjE,0CAA0C;IAC1C,0BAA0B;IAC1B,kBAAkB;IAClB,mHAAmH;IACnH,uBAAuB;IACvB,iBAAiB;IACjB,sBAAsB;IACtB,gDAAgD;IAChD,2CAA2C;IAC3C,iCAAiC;IACjC,eAAe;IACf,kEAAkE;IAClE,kBAAkB;IAClB,gDAAgD;IAChD,0DAA0D;IAC1D,+FAA+F;IAC/F,8BAA8B;IAC9B,wFAAwF;CACzF,CAAC;AAEF;;;;GAIG;AACH,MAAM,4BAA4B,GAA0B;IAC1D,oEAAoE;IACpE,sDAAsD;IACtD,8DAA8D;IAC9D,kEAAkE;IAClE,yDAAyD;IACzD,yGAAyG;IACzG,2BAA2B,EAAE,0BAA0B;CACxD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,WAAmB;IACjD,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;IACnC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC,CAAC,gBAAgB;IAEzD,kFAAkF;IAClF,KAAK,MAAM,OAAO,IAAI,cAAc,EAAE,CAAC;QACrC,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,OAAO,OAAO,CAAC;IAC5C,CAAC;IAED,kGAAkG;IAClG,0FAA0F;IAC1F,uFAAuF;IACvF,kFAAkF;IAClF,MAAM,qBAAqB,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,MAAM,YAAY,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB;IACxE,IAAI,CAAC,qBAAqB,IAAI,CAAC,YAAY,EAAE,CAAC;QAC5C,+DAA+D;QAC/D,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACjD,KAAK,MAAM,IAAI,IAAI,4BAA4B,EAAE,CAAC;YAChD,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;gBAAE,OAAO,MAAM,CAAC;QAC5C,CAAC;IACH,CAAC;IAED,wDAAwD;IACxD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* executeAction — main entrypoint for the deploy module (Sprint 20).
|
|
3
|
+
*
|
|
4
|
+
* Execution sequence:
|
|
5
|
+
* 0. Validate action shape (inverse required) — throws BEFORE any I/O.
|
|
6
|
+
* 1. Authoritative classification via classifyCommand() — overrides agent's self-declaration.
|
|
7
|
+
* 2. Log proposed action to actions.jsonl for audit.
|
|
8
|
+
* 3. If risky: gate via Tier 2 checkpoint (or auto-approve with warning if allowAutopilotRiskyActions).
|
|
9
|
+
* 4. Write ChangeEntry with status='pending' BEFORE execution.
|
|
10
|
+
* 5. Execute via injected seam.
|
|
11
|
+
* 6. Write ChangeEntry with terminal status ('executed' | 'failed') AFTER execution.
|
|
12
|
+
*
|
|
13
|
+
* Critical invariants:
|
|
14
|
+
* - ChangeEntry is ALWAYS written (even on crash) once execution starts.
|
|
15
|
+
* - inverse.description is REQUIRED and validated up-front (Zod + explicit guard).
|
|
16
|
+
* - The agent's self-declared classification is a HINT; classifyCommand() is authoritative.
|
|
17
|
+
* - allowAutopilotRiskyActions=true skips interactive approval but NOT the audit trail.
|
|
18
|
+
*/
|
|
19
|
+
import { type ProposedAction, type ExecutorSeam } from "./types.js";
|
|
20
|
+
import { type RiskyActionConfig } from "./resolve.js";
|
|
21
|
+
export interface ExecuteActionDeps {
|
|
22
|
+
/** Override for tests. Default = execa wrapper (defaultExecutor). */
|
|
23
|
+
executor?: ExecutorSeam;
|
|
24
|
+
/** Override for tests to capture stderr warnings. Default = process.stderr.write. */
|
|
25
|
+
writeWarn?: (msg: string) => void;
|
|
26
|
+
/** Override for tests — injectable clock. Default = () => new Date(). */
|
|
27
|
+
now?: () => Date;
|
|
28
|
+
}
|
|
29
|
+
export interface ExecuteActionResult {
|
|
30
|
+
status: "executed" | "failed" | "aborted";
|
|
31
|
+
reason?: "checkpoint_rejected" | "precondition_failed" | "missing_inverse" | "postcondition_failed";
|
|
32
|
+
durationMs: number;
|
|
33
|
+
error?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Execute a single proposed action under the deploy discipline.
|
|
37
|
+
*
|
|
38
|
+
* @param action - The proposed action (agent's self-classified).
|
|
39
|
+
* @param incidentId - Incident ID for audit trail writes.
|
|
40
|
+
* @param projectRoot - Root path for incident artifact writes.
|
|
41
|
+
* @param config - Pipeline config (controls allowAutopilotRiskyActions + mechanism resolution).
|
|
42
|
+
* @param deps - Optional injection overrides (executor, writeWarn, now).
|
|
43
|
+
*/
|
|
44
|
+
export declare function executeAction(action: ProposedAction, incidentId: string, projectRoot: string, config: RiskyActionConfig | undefined, deps?: ExecuteActionDeps): Promise<ExecuteActionResult>;
|
|
45
|
+
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/deploy/execute.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,EAAwB,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1F,OAAO,EAA4D,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAKhH,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,qFAAqF;IACrF,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,yEAAyE;IACzE,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAID,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC1C,MAAM,CAAC,EAAE,qBAAqB,GAAG,qBAAqB,GAAG,iBAAiB,GAAG,sBAAsB,CAAC;IACpG,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,IAAI,GAAE,iBAAsB,GAC3B,OAAO,CAAC,mBAAmB,CAAC,CAiI9B"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* executeAction — main entrypoint for the deploy module (Sprint 20).
|
|
3
|
+
*
|
|
4
|
+
* Execution sequence:
|
|
5
|
+
* 0. Validate action shape (inverse required) — throws BEFORE any I/O.
|
|
6
|
+
* 1. Authoritative classification via classifyCommand() — overrides agent's self-declaration.
|
|
7
|
+
* 2. Log proposed action to actions.jsonl for audit.
|
|
8
|
+
* 3. If risky: gate via Tier 2 checkpoint (or auto-approve with warning if allowAutopilotRiskyActions).
|
|
9
|
+
* 4. Write ChangeEntry with status='pending' BEFORE execution.
|
|
10
|
+
* 5. Execute via injected seam.
|
|
11
|
+
* 6. Write ChangeEntry with terminal status ('executed' | 'failed') AFTER execution.
|
|
12
|
+
*
|
|
13
|
+
* Critical invariants:
|
|
14
|
+
* - ChangeEntry is ALWAYS written (even on crash) once execution starts.
|
|
15
|
+
* - inverse.description is REQUIRED and validated up-front (Zod + explicit guard).
|
|
16
|
+
* - The agent's self-declared classification is a HINT; classifyCommand() is authoritative.
|
|
17
|
+
* - allowAutopilotRiskyActions=true skips interactive approval but NOT the audit trail.
|
|
18
|
+
*/
|
|
19
|
+
import { appendChange, appendTimeline, appendAction } from "../../incident/timeline.js";
|
|
20
|
+
import { ProposedActionSchema } from "./types.js";
|
|
21
|
+
import { classifyCommand } from "./classify.js";
|
|
22
|
+
import { getRiskyActionMechanism, resolveRiskyActionMechanismName } from "./resolve.js";
|
|
23
|
+
import { defaultExecutor } from "./executor.js";
|
|
24
|
+
// ── executeAction ──────────────────────────────────────────────────────────────
|
|
25
|
+
/**
|
|
26
|
+
* Execute a single proposed action under the deploy discipline.
|
|
27
|
+
*
|
|
28
|
+
* @param action - The proposed action (agent's self-classified).
|
|
29
|
+
* @param incidentId - Incident ID for audit trail writes.
|
|
30
|
+
* @param projectRoot - Root path for incident artifact writes.
|
|
31
|
+
* @param config - Pipeline config (controls allowAutopilotRiskyActions + mechanism resolution).
|
|
32
|
+
* @param deps - Optional injection overrides (executor, writeWarn, now).
|
|
33
|
+
*/
|
|
34
|
+
export async function executeAction(action, incidentId, projectRoot, config, deps = {}) {
|
|
35
|
+
const executor = deps.executor ?? defaultExecutor;
|
|
36
|
+
const writeWarn = deps.writeWarn ?? ((m) => process.stderr.write(m));
|
|
37
|
+
const now = deps.now ?? (() => new Date());
|
|
38
|
+
// ── Step 0: validate action shape BEFORE any I/O. ───────────────────────────
|
|
39
|
+
// Explicit guard first — throws a clear, test-matchable error for the most
|
|
40
|
+
// critical invariant (inverse required). Then Zod validates the rest.
|
|
41
|
+
const rawAction = action;
|
|
42
|
+
if (!rawAction.inverse?.description ||
|
|
43
|
+
rawAction.inverse.description.trim() === "") {
|
|
44
|
+
throw new Error(`executeAction: action.inverse is required and must be non-empty (action id: ${rawAction.id ?? "unknown"})`);
|
|
45
|
+
}
|
|
46
|
+
// Full schema validation (validates all remaining fields).
|
|
47
|
+
ProposedActionSchema.parse(action);
|
|
48
|
+
// ── Step 1: authoritative classification (overrides agent's self-declared). ──
|
|
49
|
+
// If the command content is risky, the action IS risky regardless of `action.classification`.
|
|
50
|
+
const commandClassification = action.command ? classifyCommand(action.command) : action.classification;
|
|
51
|
+
const isRisky = commandClassification === "risky" || action.classification === "risky";
|
|
52
|
+
// ── Step 2: log proposed action (always, for audit trail). ─────────────────
|
|
53
|
+
await appendAction(projectRoot, incidentId, {
|
|
54
|
+
timestamp: now().toISOString(),
|
|
55
|
+
action: action.description,
|
|
56
|
+
blastRadius: isRisky ? "risky" : "safe",
|
|
57
|
+
requiresApproval: isRisky,
|
|
58
|
+
rationale: action.reasoning,
|
|
59
|
+
});
|
|
60
|
+
// ── Step 3: if risky, gate via Tier 2 checkpoint. ──────────────────────────
|
|
61
|
+
if (isRisky) {
|
|
62
|
+
const allow = config?.pipeline?.allowAutopilotRiskyActions === true;
|
|
63
|
+
const mechanismName = resolveRiskyActionMechanismName(config, true, action.id);
|
|
64
|
+
if (allow) {
|
|
65
|
+
// Auto-approve with STERN warning to stderr. Audit trail STILL written below.
|
|
66
|
+
writeWarn(`[bober deploy] WARN allowAutopilotRiskyActions=true — auto-approved risky action ${action.id}: ` +
|
|
67
|
+
`${action.description}. Inverse recorded: "${action.inverse.description}". ` +
|
|
68
|
+
`Mechanism would have been: ${mechanismName}.\n`);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const mech = getRiskyActionMechanism(config, true, action.id);
|
|
72
|
+
const outcome = await mech.request(`risky-action-${action.id}`, {
|
|
73
|
+
kind: "risky-action",
|
|
74
|
+
actionId: action.id,
|
|
75
|
+
description: action.description,
|
|
76
|
+
classification: "risky",
|
|
77
|
+
classificationReasoning: action.reasoning,
|
|
78
|
+
command: action.command,
|
|
79
|
+
inverse: action.inverse,
|
|
80
|
+
});
|
|
81
|
+
// Handle all three CheckpointOutcome variants.
|
|
82
|
+
if ("approved" in outcome && outcome.approved === false) {
|
|
83
|
+
await appendTimeline(projectRoot, incidentId, {
|
|
84
|
+
timestamp: now().toISOString(),
|
|
85
|
+
eventKind: "action_aborted",
|
|
86
|
+
source: "deployer",
|
|
87
|
+
summary: `Action ${action.id} rejected at checkpoint: ${outcome.feedback}`,
|
|
88
|
+
});
|
|
89
|
+
return { status: "aborted", reason: "checkpoint_rejected", durationMs: 0 };
|
|
90
|
+
}
|
|
91
|
+
if ("edit" in outcome) {
|
|
92
|
+
// The operator modified the command via checkpoint edit. Log the modification.
|
|
93
|
+
// Re-classification of the modified command is deferred to Sprint 24 (full /bober-incident flow).
|
|
94
|
+
// For now, treat as approved and proceed with the original action.
|
|
95
|
+
writeWarn(`[bober deploy] INFO checkpoint edit received for action ${action.id}. ` +
|
|
96
|
+
`Edit delta recorded; proceeding with original command.\n`);
|
|
97
|
+
}
|
|
98
|
+
// If neither rejected nor edited, fall through — approved=true.
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// ── Step 4: write ChangeEntry with status='pending' BEFORE execution. ───────
|
|
102
|
+
const startedAt = now().toISOString();
|
|
103
|
+
const pendingEntry = {
|
|
104
|
+
id: action.id,
|
|
105
|
+
type: isRisky ? "risky-action" : "safe-action",
|
|
106
|
+
executedAt: startedAt,
|
|
107
|
+
description: action.description,
|
|
108
|
+
inverse: action.inverse,
|
|
109
|
+
status: "pending",
|
|
110
|
+
};
|
|
111
|
+
await appendChange(projectRoot, incidentId, pendingEntry);
|
|
112
|
+
// ── Step 5: execute via injected seam. ──────────────────────────────────────
|
|
113
|
+
const startTime = Date.now();
|
|
114
|
+
let exitCode = 0;
|
|
115
|
+
let stderr = "";
|
|
116
|
+
let crashed = false;
|
|
117
|
+
try {
|
|
118
|
+
if (action.command) {
|
|
119
|
+
const r = await executor.run(action.command);
|
|
120
|
+
exitCode = r.exitCode;
|
|
121
|
+
stderr = r.stderr;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
crashed = true;
|
|
126
|
+
stderr = err instanceof Error ? err.message : String(err);
|
|
127
|
+
}
|
|
128
|
+
const durationMs = Date.now() - startTime;
|
|
129
|
+
// ── Step 6: write ChangeEntry with terminal status AFTER execution. ──────────
|
|
130
|
+
// Written even if the executor crashed — the audit trail is preserved.
|
|
131
|
+
const finalStatus = crashed || exitCode !== 0 ? "failed" : "executed";
|
|
132
|
+
const finalEntry = {
|
|
133
|
+
id: action.id,
|
|
134
|
+
type: isRisky ? "risky-action" : "safe-action",
|
|
135
|
+
executedAt: now().toISOString(),
|
|
136
|
+
description: action.description,
|
|
137
|
+
inverse: action.inverse,
|
|
138
|
+
status: finalStatus,
|
|
139
|
+
};
|
|
140
|
+
await appendChange(projectRoot, incidentId, finalEntry);
|
|
141
|
+
if (finalStatus === "failed") {
|
|
142
|
+
return { status: "failed", durationMs, error: stderr };
|
|
143
|
+
}
|
|
144
|
+
return { status: "executed", durationMs };
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/orchestrator/deploy/execute.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default executor seam for the deploy module (Sprint 20).
|
|
3
|
+
*
|
|
4
|
+
* Production code uses defaultExecutor (execa wrapper).
|
|
5
|
+
* Tests inject a fake ExecutorSeam to avoid real shell execution.
|
|
6
|
+
*
|
|
7
|
+
* Every Bash command the deployer sends MUST route through this seam.
|
|
8
|
+
* The seam runs AFTER classifyCommand() approves the command — the
|
|
9
|
+
* classification gate is the caller's responsibility (see execute.ts).
|
|
10
|
+
*
|
|
11
|
+
* Pattern mirrors src/orchestrator/tools/handlers.ts:70 (execa usage).
|
|
12
|
+
*/
|
|
13
|
+
import type { ExecutorSeam } from "./types.js";
|
|
14
|
+
/**
|
|
15
|
+
* Default execa-backed executor.
|
|
16
|
+
*
|
|
17
|
+
* Runs the command via `sh -c <command>`. Captures stdout, stderr, exitCode.
|
|
18
|
+
* Does NOT reject on non-zero exit code (reject: false) — the caller in
|
|
19
|
+
* execute.ts decides whether a non-zero exit is a failure.
|
|
20
|
+
*/
|
|
21
|
+
export declare const defaultExecutor: ExecutorSeam;
|
|
22
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/deploy/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,YAS7B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default executor seam for the deploy module (Sprint 20).
|
|
3
|
+
*
|
|
4
|
+
* Production code uses defaultExecutor (execa wrapper).
|
|
5
|
+
* Tests inject a fake ExecutorSeam to avoid real shell execution.
|
|
6
|
+
*
|
|
7
|
+
* Every Bash command the deployer sends MUST route through this seam.
|
|
8
|
+
* The seam runs AFTER classifyCommand() approves the command — the
|
|
9
|
+
* classification gate is the caller's responsibility (see execute.ts).
|
|
10
|
+
*
|
|
11
|
+
* Pattern mirrors src/orchestrator/tools/handlers.ts:70 (execa usage).
|
|
12
|
+
*/
|
|
13
|
+
import { execa } from "execa";
|
|
14
|
+
/**
|
|
15
|
+
* Default execa-backed executor.
|
|
16
|
+
*
|
|
17
|
+
* Runs the command via `sh -c <command>`. Captures stdout, stderr, exitCode.
|
|
18
|
+
* Does NOT reject on non-zero exit code (reject: false) — the caller in
|
|
19
|
+
* execute.ts decides whether a non-zero exit is a failure.
|
|
20
|
+
*/
|
|
21
|
+
export const defaultExecutor = {
|
|
22
|
+
async run(command) {
|
|
23
|
+
const r = await execa("sh", ["-c", command], { reject: false });
|
|
24
|
+
return {
|
|
25
|
+
exitCode: r.exitCode ?? 1,
|
|
26
|
+
stdout: r.stdout,
|
|
27
|
+
stderr: r.stderr,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/orchestrator/deploy/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAG9B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAiB;IAC3C,KAAK,CAAC,GAAG,CAAC,OAAe;QACvB,MAAM,CAAC,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAChE,OAAO;YACL,QAAQ,EAAE,CAAC,CAAC,QAAQ,IAAI,CAAC;YACzB,MAAM,EAAE,CAAC,CAAC,MAAM;YAChB,MAAM,EAAE,CAAC,CAAC,MAAM;SACjB,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API for the deploy module (Sprint 20).
|
|
3
|
+
*
|
|
4
|
+
* Sprint 24 (/bober-incident CLI command) will import from this barrel
|
|
5
|
+
* to wire the deployer spawn with the risky-action checkpoint callback.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import { executeAction, classifyCommand, resolveRiskyActionMechanismName,
|
|
9
|
+
* type ProposedAction } from "../orchestrator/deploy/index.js";
|
|
10
|
+
*
|
|
11
|
+
* Observability MCP tools are merged at spawn time via mergeObsTools() from
|
|
12
|
+
* src/orchestrator/observability/merge.ts — the same pattern used for the
|
|
13
|
+
* diagnoser agent (Sprint 16). The deployer's tool list at spawn is:
|
|
14
|
+
* [Read, Bash, Grep, Glob, ...namespacedObsTools]
|
|
15
|
+
*/
|
|
16
|
+
export { executeAction, type ExecuteActionDeps, type ExecuteActionResult } from "./execute.js";
|
|
17
|
+
export { classifyCommand } from "./classify.js";
|
|
18
|
+
export { resolveRiskyActionMechanismName, getRiskyActionMechanism, type RiskyActionConfig } from "./resolve.js";
|
|
19
|
+
export { defaultExecutor } from "./executor.js";
|
|
20
|
+
export { ProposedActionSchema, type ProposedAction, type ExecutorSeam, type DeployResult } from "./types.js";
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/deploy/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,KAAK,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,+BAA+B,EAAE,uBAAuB,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API for the deploy module (Sprint 20).
|
|
3
|
+
*
|
|
4
|
+
* Sprint 24 (/bober-incident CLI command) will import from this barrel
|
|
5
|
+
* to wire the deployer spawn with the risky-action checkpoint callback.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import { executeAction, classifyCommand, resolveRiskyActionMechanismName,
|
|
9
|
+
* type ProposedAction } from "../orchestrator/deploy/index.js";
|
|
10
|
+
*
|
|
11
|
+
* Observability MCP tools are merged at spawn time via mergeObsTools() from
|
|
12
|
+
* src/orchestrator/observability/merge.ts — the same pattern used for the
|
|
13
|
+
* diagnoser agent (Sprint 16). The deployer's tool list at spawn is:
|
|
14
|
+
* [Read, Bash, Grep, Glob, ...namespacedObsTools]
|
|
15
|
+
*/
|
|
16
|
+
export { executeAction } from "./execute.js";
|
|
17
|
+
export { classifyCommand } from "./classify.js";
|
|
18
|
+
export { resolveRiskyActionMechanismName, getRiskyActionMechanism } from "./resolve.js";
|
|
19
|
+
export { defaultExecutor } from "./executor.js";
|
|
20
|
+
export { ProposedActionSchema } from "./types.js";
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/orchestrator/deploy/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAoD,MAAM,cAAc,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,+BAA+B,EAAE,uBAAuB,EAA0B,MAAM,cAAc,CAAC;AAChH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAA6D,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Risky-action mechanism resolver (Sprint 20).
|
|
3
|
+
*
|
|
4
|
+
* Wraps the 6-tier resolver from Sprint 14 (resolveCheckpointMechanismName)
|
|
5
|
+
* with a FORCED FLOOR for risky actions:
|
|
6
|
+
*
|
|
7
|
+
* Tier 0 (Sprint 20): if isRisky && !allowAutopilotRiskyActions && resolved==='noop'
|
|
8
|
+
* → override to 'disk'.
|
|
9
|
+
*
|
|
10
|
+
* This is the unconditional gate (s20-c6): even mode='autopilot' +
|
|
11
|
+
* checkpointMechanism='noop' cannot bypass the gate for risky actions.
|
|
12
|
+
*
|
|
13
|
+
* The escape hatch (allowAutopilotRiskyActions=true) lets fully-automated
|
|
14
|
+
* environments (CI, batch jobs) skip interactive approval WHILE preserving
|
|
15
|
+
* the audit trail (ChangeEntry is always written). Document this as a footgun.
|
|
16
|
+
*/
|
|
17
|
+
import { type CheckpointMechanism, type CheckpointOverrideConfig } from "../checkpoints/index.js";
|
|
18
|
+
/**
|
|
19
|
+
* Extended config shape: pipeline.allowAutopilotRiskyActions is a Sprint 20 field.
|
|
20
|
+
* Other pipeline fields are passed through to the underlying resolver unchanged.
|
|
21
|
+
*/
|
|
22
|
+
export interface RiskyActionConfig extends CheckpointOverrideConfig {
|
|
23
|
+
pipeline?: CheckpointOverrideConfig["pipeline"] & {
|
|
24
|
+
allowAutopilotRiskyActions?: boolean;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Pure name resolver for risky-action mechanism.
|
|
29
|
+
*
|
|
30
|
+
* Tier 0 (Sprint 20 FORCED FLOOR):
|
|
31
|
+
* if isRisky && !allowAutopilotRiskyActions && underlying resolves to 'noop'
|
|
32
|
+
* → return 'disk'.
|
|
33
|
+
*
|
|
34
|
+
* Tiers 1-6: defer to resolveCheckpointMechanismName (Sprint 14).
|
|
35
|
+
*
|
|
36
|
+
* The checkpointId is dynamic: 'risky-action-<actionId>'. Passing it through
|
|
37
|
+
* to the underlying resolver allows per-checkpoint overrides to target a specific
|
|
38
|
+
* action id (rare; not a documented feature; semantically correct).
|
|
39
|
+
*
|
|
40
|
+
* @param config - Pipeline config, may include allowAutopilotRiskyActions.
|
|
41
|
+
* @param isRisky - True when the action is classified as risky.
|
|
42
|
+
* @param actionId - Optional action id; used to form the checkpoint id.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveRiskyActionMechanismName(config: RiskyActionConfig | undefined, isRisky: boolean, actionId?: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Impure wrapper: resolves the mechanism NAME and returns the registered
|
|
47
|
+
* CheckpointMechanism implementation. Tests may call resolveRiskyActionMechanismName
|
|
48
|
+
* directly (pure, no side effects) and assert the returned name.
|
|
49
|
+
*/
|
|
50
|
+
export declare function getRiskyActionMechanism(config: RiskyActionConfig | undefined, isRisky: boolean, actionId?: string): CheckpointMechanism;
|
|
51
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/deploy/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC9B,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,wBAAwB;IACjE,QAAQ,CAAC,EAAE,wBAAwB,CAAC,UAAU,CAAC,GAAG;QAChD,0BAA0B,CAAC,EAAE,OAAO,CAAC;KACtC,CAAC;CACH;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAUR;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,mBAAmB,CAErB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Risky-action mechanism resolver (Sprint 20).
|
|
3
|
+
*
|
|
4
|
+
* Wraps the 6-tier resolver from Sprint 14 (resolveCheckpointMechanismName)
|
|
5
|
+
* with a FORCED FLOOR for risky actions:
|
|
6
|
+
*
|
|
7
|
+
* Tier 0 (Sprint 20): if isRisky && !allowAutopilotRiskyActions && resolved==='noop'
|
|
8
|
+
* → override to 'disk'.
|
|
9
|
+
*
|
|
10
|
+
* This is the unconditional gate (s20-c6): even mode='autopilot' +
|
|
11
|
+
* checkpointMechanism='noop' cannot bypass the gate for risky actions.
|
|
12
|
+
*
|
|
13
|
+
* The escape hatch (allowAutopilotRiskyActions=true) lets fully-automated
|
|
14
|
+
* environments (CI, batch jobs) skip interactive approval WHILE preserving
|
|
15
|
+
* the audit trail (ChangeEntry is always written). Document this as a footgun.
|
|
16
|
+
*/
|
|
17
|
+
import { resolveCheckpointMechanismName, getCheckpointMechanism, } from "../checkpoints/index.js";
|
|
18
|
+
/**
|
|
19
|
+
* Pure name resolver for risky-action mechanism.
|
|
20
|
+
*
|
|
21
|
+
* Tier 0 (Sprint 20 FORCED FLOOR):
|
|
22
|
+
* if isRisky && !allowAutopilotRiskyActions && underlying resolves to 'noop'
|
|
23
|
+
* → return 'disk'.
|
|
24
|
+
*
|
|
25
|
+
* Tiers 1-6: defer to resolveCheckpointMechanismName (Sprint 14).
|
|
26
|
+
*
|
|
27
|
+
* The checkpointId is dynamic: 'risky-action-<actionId>'. Passing it through
|
|
28
|
+
* to the underlying resolver allows per-checkpoint overrides to target a specific
|
|
29
|
+
* action id (rare; not a documented feature; semantically correct).
|
|
30
|
+
*
|
|
31
|
+
* @param config - Pipeline config, may include allowAutopilotRiskyActions.
|
|
32
|
+
* @param isRisky - True when the action is classified as risky.
|
|
33
|
+
* @param actionId - Optional action id; used to form the checkpoint id.
|
|
34
|
+
*/
|
|
35
|
+
export function resolveRiskyActionMechanismName(config, isRisky, actionId) {
|
|
36
|
+
const checkpointId = `risky-action-${actionId ?? "default"}`;
|
|
37
|
+
const resolved = resolveCheckpointMechanismName(checkpointId, config);
|
|
38
|
+
const allow = config?.pipeline?.allowAutopilotRiskyActions === true;
|
|
39
|
+
// Forced floor: risky + !allow + resolved==='noop' → 'disk'.
|
|
40
|
+
if (isRisky && !allow && resolved === "noop") {
|
|
41
|
+
return "disk";
|
|
42
|
+
}
|
|
43
|
+
return resolved;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Impure wrapper: resolves the mechanism NAME and returns the registered
|
|
47
|
+
* CheckpointMechanism implementation. Tests may call resolveRiskyActionMechanismName
|
|
48
|
+
* directly (pure, no side effects) and assert the returned name.
|
|
49
|
+
*/
|
|
50
|
+
export function getRiskyActionMechanism(config, isRisky, actionId) {
|
|
51
|
+
return getCheckpointMechanism(resolveRiskyActionMechanismName(config, isRisky, actionId));
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../src/orchestrator/deploy/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,GAGvB,MAAM,yBAAyB,CAAC;AAYjC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,+BAA+B,CAC7C,MAAqC,EACrC,OAAgB,EAChB,QAAiB;IAEjB,MAAM,YAAY,GAAG,gBAAgB,QAAQ,IAAI,SAAS,EAAE,CAAC;IAC7D,MAAM,QAAQ,GAAG,8BAA8B,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACtE,MAAM,KAAK,GAAG,MAAM,EAAE,QAAQ,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAEpE,6DAA6D;IAC7D,IAAI,OAAO,IAAI,CAAC,KAAK,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QAC7C,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAqC,EACrC,OAAgB,EAChB,QAAiB;IAEjB,OAAO,sBAAsB,CAAC,+BAA+B,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deployer spawn-site integration surface (Sprint 20).
|
|
3
|
+
*
|
|
4
|
+
* Sprint 24 (/bober-incident CLI command) will call spawnDeployer() to:
|
|
5
|
+
* 1. Merge observability MCP tools (same pattern as the diagnoser — Sprint 16).
|
|
6
|
+
* 2. Load the bober-deployer agent definition.
|
|
7
|
+
* 3. Register the risky-action checkpoint callback (the gate that calls executeAction).
|
|
8
|
+
*
|
|
9
|
+
* This module exports the spawn helper and the RiskyActionCheckpointCallback type
|
|
10
|
+
* so Sprint 24 can wire without importing from internal deploy/ modules directly.
|
|
11
|
+
*
|
|
12
|
+
* Pattern:
|
|
13
|
+
* - mergeObsTools: from src/orchestrator/observability/merge.ts (Sprint 16)
|
|
14
|
+
* - loadAgentDefinition: from src/orchestrator/agent-loader.ts (Sprint 15 pattern)
|
|
15
|
+
*
|
|
16
|
+
* The deployer's tool list at spawn time:
|
|
17
|
+
* [Read, Bash, Grep, Glob, ...namespacedObsTools]
|
|
18
|
+
*
|
|
19
|
+
* The risky-action callback:
|
|
20
|
+
* Called once per ProposedAction that classifyCommand() classifies as risky.
|
|
21
|
+
* Receives the action description, classification reasoning, and inverse.
|
|
22
|
+
* Returns the checkpoint outcome (approved, rejected, or operator-edited).
|
|
23
|
+
*
|
|
24
|
+
* Sprint 24 integration point:
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import { spawnDeployer } from "../orchestrator/deploy/spawn.js";
|
|
27
|
+
* const { agentDef, obsTools, stopObs } = await spawnDeployer(config, projectRoot);
|
|
28
|
+
* try {
|
|
29
|
+
* // pass agentDef + obsTools to the agentic loop
|
|
30
|
+
* } finally {
|
|
31
|
+
* await stopObs();
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
import type { AgentDefinition } from "../agent-loader.js";
|
|
36
|
+
import type { NamespacedTool } from "../observability/index.js";
|
|
37
|
+
import type { RiskyActionConfig } from "./resolve.js";
|
|
38
|
+
export interface DeployerSpawnContext {
|
|
39
|
+
/** Loaded bober-deployer agent definition (frontmatter + body). */
|
|
40
|
+
agentDef: AgentDefinition;
|
|
41
|
+
/** Observability tools merged from configured providers. Namespaced obs__<provider>__<tool>. */
|
|
42
|
+
obsTools: NamespacedTool[];
|
|
43
|
+
/** Call in finally to stop all started observability MCP servers. */
|
|
44
|
+
stopObs: () => Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Prepare the deployer subagent's spawn context.
|
|
48
|
+
*
|
|
49
|
+
* Mirrors the diagnoser spawn pattern (Sprint 15/16):
|
|
50
|
+
* 1. Load the agent definition from agents/bober-deployer.md.
|
|
51
|
+
* 2. Merge observability MCP tools via Promise.allSettled (partial failure safe).
|
|
52
|
+
* 3. Return the spawn context for Sprint 24 to pass into the agentic loop.
|
|
53
|
+
*
|
|
54
|
+
* The caller MUST call stopObs() in a finally block to release observability MCP processes.
|
|
55
|
+
*
|
|
56
|
+
* @param config - Pipeline config (controls allowAutopilotRiskyActions + mechanism resolution).
|
|
57
|
+
* @param projectRoot - Absolute path to the project root.
|
|
58
|
+
*/
|
|
59
|
+
export declare function spawnDeployer(config: RiskyActionConfig | undefined, projectRoot: string): Promise<DeployerSpawnContext>;
|
|
60
|
+
//# sourceMappingURL=spawn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/deploy/spawn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,2BAA2B,CAAC;AACnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAItD,MAAM,WAAW,oBAAoB;IACnC,mEAAmE;IACnE,QAAQ,EAAE,eAAe,CAAC;IAC1B,gGAAgG;IAChG,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,qEAAqE;IACrE,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAID;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,oBAAoB,CAAC,CAe/B"}
|