@ambystech/ambykit 1.3.1 → 1.6.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 +131 -1
- package/README.md +9 -0
- package/dist/cli/activity.d.ts +5 -1
- package/dist/cli/activity.js +22 -8
- package/dist/cli/activity.js.map +1 -1
- package/dist/cli/add.js +12 -5
- package/dist/cli/add.js.map +1 -1
- package/dist/cli/analyze.js +68 -4
- package/dist/cli/analyze.js.map +1 -1
- package/dist/cli/base-command.js +6 -0
- package/dist/cli/base-command.js.map +1 -1
- package/dist/cli/check.js +18 -3
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/dashboard.d.ts +4 -1
- package/dist/cli/dashboard.js +47 -15
- package/dist/cli/dashboard.js.map +1 -1
- package/dist/cli/directive.d.ts +7 -0
- package/dist/cli/directive.js +43 -0
- package/dist/cli/directive.js.map +1 -0
- package/dist/cli/fleet.d.ts +16 -0
- package/dist/cli/fleet.js +472 -0
- package/dist/cli/fleet.js.map +1 -0
- package/dist/cli/graph.d.ts +13 -0
- package/dist/cli/graph.js +40 -0
- package/dist/cli/graph.js.map +1 -0
- package/dist/cli/index.js +12 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/io/fsops.d.ts +4 -0
- package/dist/cli/io/fsops.js +62 -0
- package/dist/cli/io/fsops.js.map +1 -1
- package/dist/cli/lane.d.ts +0 -2
- package/dist/cli/lane.js +9 -104
- package/dist/cli/lane.js.map +1 -1
- package/dist/cli/mcp.d.ts +21 -0
- package/dist/cli/mcp.js +27 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli/run-budget.d.ts +18 -0
- package/dist/cli/run-budget.js +75 -0
- package/dist/cli/run-budget.js.map +1 -0
- package/dist/cli/run-control.d.ts +28 -0
- package/dist/cli/run-control.js +139 -0
- package/dist/cli/run-control.js.map +1 -0
- package/dist/cli/run-files.d.ts +96 -0
- package/dist/cli/run-files.js +120 -0
- package/dist/cli/run-files.js.map +1 -0
- package/dist/cli/run-gates.d.ts +25 -0
- package/dist/cli/run-gates.js +45 -0
- package/dist/cli/run-gates.js.map +1 -0
- package/dist/cli/run-launch.d.ts +17 -0
- package/dist/cli/run-launch.js +89 -0
- package/dist/cli/run-launch.js.map +1 -0
- package/dist/cli/run-loop.d.ts +37 -0
- package/dist/cli/run-loop.js +150 -0
- package/dist/cli/run-loop.js.map +1 -0
- package/dist/cli/run-merger.d.ts +12 -0
- package/dist/cli/run-merger.js +88 -0
- package/dist/cli/run-merger.js.map +1 -0
- package/dist/cli/run-plan.d.ts +28 -0
- package/dist/cli/run-plan.js +49 -0
- package/dist/cli/run-plan.js.map +1 -0
- package/dist/cli/run-process.d.ts +39 -0
- package/dist/cli/run-process.js +99 -0
- package/dist/cli/run-process.js.map +1 -0
- package/dist/cli/run-protocol-prompts.d.ts +7 -0
- package/dist/cli/run-protocol-prompts.js +36 -0
- package/dist/cli/run-protocol-prompts.js.map +1 -0
- package/dist/cli/run-protocol.d.ts +10 -0
- package/dist/cli/run-protocol.js +99 -0
- package/dist/cli/run-protocol.js.map +1 -0
- package/dist/cli/run-script.d.ts +11 -0
- package/dist/cli/run-script.js +66 -0
- package/dist/cli/run-script.js.map +1 -0
- package/dist/cli/run-session.d.ts +60 -0
- package/dist/cli/run-session.js +21 -0
- package/dist/cli/run-session.js.map +1 -0
- package/dist/cli/run-supervisor.d.ts +20 -0
- package/dist/cli/run-supervisor.js +144 -0
- package/dist/cli/run-supervisor.js.map +1 -0
- package/dist/cli/run.d.ts +73 -0
- package/dist/cli/run.js +363 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/sync.d.ts +2 -0
- package/dist/cli/sync.js +31 -5
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/trace.d.ts +14 -0
- package/dist/cli/trace.js +89 -0
- package/dist/cli/trace.js.map +1 -0
- package/dist/cli/ui/dashboard/feature-chart.js +15 -2
- package/dist/cli/ui/dashboard/feature-chart.js.map +1 -1
- package/dist/cli/ui/dashboard/feature-view.js +11 -1
- package/dist/cli/ui/dashboard/feature-view.js.map +1 -1
- package/dist/cli/ui/dashboard/fleet-tokens.d.ts +404 -0
- package/dist/cli/ui/dashboard/fleet-tokens.js +405 -0
- package/dist/cli/ui/dashboard/fleet-tokens.js.map +1 -0
- package/dist/cli/ui/dashboard/fleet-view.d.ts +50 -0
- package/dist/cli/ui/dashboard/fleet-view.js +211 -0
- package/dist/cli/ui/dashboard/fleet-view.js.map +1 -0
- package/dist/cli/ui/dashboard/graph-view.d.ts +44 -0
- package/dist/cli/ui/dashboard/graph-view.js +78 -0
- package/dist/cli/ui/dashboard/graph-view.js.map +1 -0
- package/dist/cli/ui/dashboard/help-overlay.d.ts +1 -1
- package/dist/cli/ui/dashboard/help-overlay.js +20 -0
- package/dist/cli/ui/dashboard/help-overlay.js.map +1 -1
- package/dist/cli/ui/dashboard/quality-view.d.ts +8 -0
- package/dist/cli/ui/dashboard/quality-view.js +31 -0
- package/dist/cli/ui/dashboard/quality-view.js.map +1 -0
- package/dist/cli/ui/dashboard/story-detail.d.ts +1 -1
- package/dist/cli/ui/dashboard/story-detail.js +10 -3
- package/dist/cli/ui/dashboard/story-detail.js.map +1 -1
- package/dist/cli/ui/dashboard/tokens.d.ts +26 -0
- package/dist/cli/ui/dashboard/tokens.js +26 -0
- package/dist/cli/ui/dashboard/tokens.js.map +1 -1
- package/dist/cli/ui/icons.d.ts +22 -0
- package/dist/cli/ui/icons.js +17 -0
- package/dist/cli/ui/icons.js.map +1 -0
- package/dist/cli/ui/interactive/fleet-actions.d.ts +24 -0
- package/dist/cli/ui/interactive/fleet-actions.js +30 -0
- package/dist/cli/ui/interactive/fleet-actions.js.map +1 -0
- package/dist/cli/ui/interactive/fleet.d.ts +54 -0
- package/dist/cli/ui/interactive/fleet.js +98 -0
- package/dist/cli/ui/interactive/fleet.js.map +1 -0
- package/dist/cli/ui/interactive/fullscreen.js +26 -8
- package/dist/cli/ui/interactive/fullscreen.js.map +1 -1
- package/dist/cli/ui/interactive/live.d.ts +8 -0
- package/dist/cli/ui/interactive/live.js +13 -0
- package/dist/cli/ui/interactive/live.js.map +1 -1
- package/dist/cli/ui/interactive/overview.d.ts +27 -1
- package/dist/cli/ui/interactive/overview.js +111 -0
- package/dist/cli/ui/interactive/overview.js.map +1 -1
- package/dist/cli/ui/tool-options.d.ts +3 -2
- package/dist/cli/ui/tool-options.js +3 -3
- package/dist/cli/ui/tool-options.js.map +1 -1
- package/dist/cli/update.d.ts +1 -1
- package/dist/cli/update.js +8 -3
- package/dist/cli/update.js.map +1 -1
- package/dist/core/activity.d.ts +15 -2
- package/dist/core/activity.js +19 -4
- package/dist/core/activity.js.map +1 -1
- package/dist/core/analyze.d.ts +80 -2
- package/dist/core/analyze.js +200 -61
- package/dist/core/analyze.js.map +1 -1
- package/dist/core/checkouts.js +2 -0
- package/dist/core/checkouts.js.map +1 -1
- package/dist/core/config.d.ts +31 -1
- package/dist/core/config.js +50 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/dashboard.d.ts +4 -0
- package/dist/core/dashboard.js +5 -3
- package/dist/core/dashboard.js.map +1 -1
- package/dist/core/decisions.d.ts +60 -0
- package/dist/core/decisions.js +231 -0
- package/dist/core/decisions.js.map +1 -0
- package/dist/core/emit.d.ts +16 -1
- package/dist/core/emit.js +49 -5
- package/dist/core/emit.js.map +1 -1
- package/dist/core/features.js +6 -1
- package/dist/core/features.js.map +1 -1
- package/dist/core/fleet/claims.d.ts +45 -0
- package/dist/core/fleet/claims.js +85 -0
- package/dist/core/fleet/claims.js.map +1 -0
- package/dist/core/fleet/directives.d.ts +56 -0
- package/dist/core/fleet/directives.js +99 -0
- package/dist/core/fleet/directives.js.map +1 -0
- package/dist/core/fleet/flow-input.d.ts +6 -0
- package/dist/core/fleet/flow-input.js +35 -0
- package/dist/core/fleet/flow-input.js.map +1 -0
- package/dist/core/fleet/index.d.ts +9 -0
- package/dist/core/fleet/index.js +10 -0
- package/dist/core/fleet/index.js.map +1 -0
- package/dist/core/fleet/lane-status.d.ts +39 -0
- package/dist/core/fleet/lane-status.js +63 -0
- package/dist/core/fleet/lane-status.js.map +1 -0
- package/dist/core/fleet/lock.d.ts +23 -0
- package/dist/core/fleet/lock.js +103 -0
- package/dist/core/fleet/lock.js.map +1 -0
- package/dist/core/fleet/notes.d.ts +31 -0
- package/dist/core/fleet/notes.js +56 -0
- package/dist/core/fleet/notes.js.map +1 -0
- package/dist/core/fleet/run-flow.d.ts +157 -0
- package/dist/core/fleet/run-flow.js +205 -0
- package/dist/core/fleet/run-flow.js.map +1 -0
- package/dist/core/fleet/runs.d.ts +46 -0
- package/dist/core/fleet/runs.js +182 -0
- package/dist/core/fleet/runs.js.map +1 -0
- package/dist/core/fleet/types.d.ts +63 -0
- package/dist/core/fleet/types.js +11 -0
- package/dist/core/fleet/types.js.map +1 -0
- package/dist/core/fleet-view/derive.d.ts +14 -0
- package/dist/core/fleet-view/derive.js +54 -0
- package/dist/core/fleet-view/derive.js.map +1 -0
- package/dist/core/fleet-view/json.d.ts +37 -0
- package/dist/core/fleet-view/json.js +25 -0
- package/dist/core/fleet-view/json.js.map +1 -0
- package/dist/core/fleet-view/read.d.ts +8 -0
- package/dist/core/fleet-view/read.js +44 -0
- package/dist/core/fleet-view/read.js.map +1 -0
- package/dist/core/fleet-view/types.d.ts +52 -0
- package/dist/core/fleet-view/types.js +2 -0
- package/dist/core/fleet-view/types.js.map +1 -0
- package/dist/core/graph-format.d.ts +51 -0
- package/dist/core/graph-format.js +99 -0
- package/dist/core/graph-format.js.map +1 -0
- package/dist/core/graph-paths.d.ts +27 -0
- package/dist/core/graph-paths.js +94 -0
- package/dist/core/graph-paths.js.map +1 -0
- package/dist/core/graph-scope.d.ts +7 -0
- package/dist/core/graph-scope.js +31 -0
- package/dist/core/graph-scope.js.map +1 -0
- package/dist/core/graph-types.d.ts +55 -0
- package/dist/core/graph-types.js +6 -0
- package/dist/core/graph-types.js.map +1 -0
- package/dist/core/graph.d.ts +14 -0
- package/dist/core/graph.js +144 -0
- package/dist/core/graph.js.map +1 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/lane-merge.d.ts +29 -0
- package/dist/core/lane-merge.js +105 -0
- package/dist/core/lane-merge.js.map +1 -0
- package/dist/core/markers.d.ts +44 -0
- package/dist/core/markers.js +139 -0
- package/dist/core/markers.js.map +1 -0
- package/dist/core/merge-json.d.ts +15 -0
- package/dist/core/merge-json.js +46 -0
- package/dist/core/merge-json.js.map +1 -0
- package/dist/core/moved-targets.d.ts +23 -0
- package/dist/core/moved-targets.js +23 -0
- package/dist/core/moved-targets.js.map +1 -0
- package/dist/core/overview-types.d.ts +27 -1
- package/dist/core/overview-types.js.map +1 -1
- package/dist/core/overview.d.ts +1 -1
- package/dist/core/overview.js +91 -74
- package/dist/core/overview.js.map +1 -1
- package/dist/core/path-guard.d.ts +5 -0
- package/dist/core/path-guard.js +9 -0
- package/dist/core/path-guard.js.map +1 -0
- package/dist/core/paths.d.ts +2 -0
- package/dist/core/paths.js +4 -0
- package/dist/core/paths.js.map +1 -1
- package/dist/core/query.d.ts +91 -0
- package/dist/core/query.js +197 -0
- package/dist/core/query.js.map +1 -0
- package/dist/core/report.d.ts +36 -0
- package/dist/core/report.js +62 -0
- package/dist/core/report.js.map +1 -0
- package/dist/core/rules.js +3 -0
- package/dist/core/rules.js.map +1 -1
- package/dist/core/run-gate-actions.d.ts +51 -0
- package/dist/core/run-gate-actions.js +105 -0
- package/dist/core/run-gate-actions.js.map +1 -0
- package/dist/core/run-launch-plan.d.ts +51 -0
- package/dist/core/run-launch-plan.js +27 -0
- package/dist/core/run-launch-plan.js.map +1 -0
- package/dist/core/run-prompt.d.ts +47 -0
- package/dist/core/run-prompt.js +37 -0
- package/dist/core/run-prompt.js.map +1 -0
- package/dist/core/run-review.d.ts +50 -0
- package/dist/core/run-review.js +20 -0
- package/dist/core/run-review.js.map +1 -0
- package/dist/core/run-schedule.d.ts +23 -0
- package/dist/core/run-schedule.js +40 -0
- package/dist/core/run-schedule.js.map +1 -0
- package/dist/core/run-supervise.d.ts +71 -0
- package/dist/core/run-supervise.js +61 -0
- package/dist/core/run-supervise.js.map +1 -0
- package/dist/core/runners.d.ts +59 -0
- package/dist/core/runners.js +60 -0
- package/dist/core/runners.js.map +1 -0
- package/dist/core/scaffold.d.ts +2 -2
- package/dist/core/scaffold.js +3 -1
- package/dist/core/scaffold.js.map +1 -1
- package/dist/core/subagents.d.ts +29 -0
- package/dist/core/subagents.js +52 -0
- package/dist/core/subagents.js.map +1 -0
- package/dist/core/tasks-edit.d.ts +34 -0
- package/dist/core/tasks-edit.js +115 -0
- package/dist/core/tasks-edit.js.map +1 -0
- package/dist/core/test-design.d.ts +94 -0
- package/dist/core/test-design.js +325 -0
- package/dist/core/test-design.js.map +1 -0
- package/dist/core/trace-cite.d.ts +16 -0
- package/dist/core/trace-cite.js +24 -0
- package/dist/core/trace-cite.js.map +1 -0
- package/dist/core/trace-coverage.d.ts +8 -0
- package/dist/core/trace-coverage.js +40 -0
- package/dist/core/trace-coverage.js.map +1 -0
- package/dist/core/trace-design.d.ts +6 -0
- package/dist/core/trace-design.js +16 -0
- package/dist/core/trace-design.js.map +1 -0
- package/dist/core/trace-io.d.ts +14 -0
- package/dist/core/trace-io.js +97 -0
- package/dist/core/trace-io.js.map +1 -0
- package/dist/core/trace-requirements.d.ts +9 -0
- package/dist/core/trace-requirements.js +27 -0
- package/dist/core/trace-requirements.js.map +1 -0
- package/dist/core/trace-tests.d.ts +7 -0
- package/dist/core/trace-tests.js +27 -0
- package/dist/core/trace-tests.js.map +1 -0
- package/dist/core/trace-types.d.ts +81 -0
- package/dist/core/trace-types.js +3 -0
- package/dist/core/trace-types.js.map +1 -0
- package/dist/core/trace.d.ts +18 -0
- package/dist/core/trace.js +109 -0
- package/dist/core/trace.js.map +1 -0
- package/dist/core/types.d.ts +50 -1
- package/dist/emitters/antigravity-cli.d.ts +4 -0
- package/dist/emitters/antigravity-cli.js +8 -0
- package/dist/emitters/antigravity-cli.js.map +1 -1
- package/dist/emitters/antigravity.d.ts +6 -0
- package/dist/emitters/antigravity.js +8 -0
- package/dist/emitters/antigravity.js.map +1 -1
- package/dist/emitters/base-emitter.d.ts +28 -0
- package/dist/emitters/base-emitter.js +41 -1
- package/dist/emitters/base-emitter.js.map +1 -1
- package/dist/emitters/claude.d.ts +12 -2
- package/dist/emitters/claude.js +34 -5
- package/dist/emitters/claude.js.map +1 -1
- package/dist/emitters/copilot-cli.d.ts +7 -1
- package/dist/emitters/copilot-cli.js +9 -0
- package/dist/emitters/copilot-cli.js.map +1 -1
- package/dist/emitters/copilot.d.ts +5 -0
- package/dist/emitters/copilot.js +23 -1
- package/dist/emitters/copilot.js.map +1 -1
- package/dist/emitters/cursor.d.ts +3 -0
- package/dist/emitters/cursor.js +8 -1
- package/dist/emitters/cursor.js.map +1 -1
- package/dist/emitters/index.d.ts +10 -3
- package/dist/emitters/index.js +6 -6
- package/dist/emitters/index.js.map +1 -1
- package/dist/emitters/opencode.d.ts +8 -0
- package/dist/emitters/opencode.js +23 -0
- package/dist/emitters/opencode.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/protocol.d.ts +44 -0
- package/dist/mcp/protocol.js +114 -0
- package/dist/mcp/protocol.js.map +1 -0
- package/dist/mcp/registry.d.ts +40 -0
- package/dist/mcp/registry.js +44 -0
- package/dist/mcp/registry.js.map +1 -0
- package/dist/mcp/server.d.ts +7 -0
- package/dist/mcp/server.js +14 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/common.d.ts +12 -0
- package/dist/mcp/tools/common.js +12 -0
- package/dist/mcp/tools/common.js.map +1 -0
- package/dist/mcp/tools/fleet.d.ts +10 -0
- package/dist/mcp/tools/fleet.js +102 -0
- package/dist/mcp/tools/fleet.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +3 -0
- package/dist/mcp/tools/index.js +13 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/read.d.ts +6 -0
- package/dist/mcp/tools/read.js +62 -0
- package/dist/mcp/tools/read.js.map +1 -0
- package/dist/mcp/tools/write.d.ts +6 -0
- package/dist/mcp/tools/write.js +34 -0
- package/dist/mcp/tools/write.js.map +1 -0
- package/dist/plugins/api.d.ts +39 -0
- package/dist/plugins/api.js +28 -0
- package/dist/plugins/api.js.map +1 -0
- package/dist/plugins/index.d.ts +11 -0
- package/dist/plugins/index.js +9 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/loader.d.ts +35 -0
- package/dist/plugins/loader.js +117 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/manifest.d.ts +21 -0
- package/dist/plugins/manifest.js +53 -0
- package/dist/plugins/manifest.js.map +1 -0
- package/dist/plugins/registry.d.ts +36 -0
- package/dist/plugins/registry.js +30 -0
- package/dist/plugins/registry.js.map +1 -0
- package/dist/plugins/report.d.ts +9 -0
- package/dist/plugins/report.js +19 -0
- package/dist/plugins/report.js.map +1 -0
- package/dist/plugins/semver.d.ts +23 -0
- package/dist/plugins/semver.js +106 -0
- package/dist/plugins/semver.js.map +1 -0
- package/dist/plugins/session.d.ts +18 -0
- package/dist/plugins/session.js +22 -0
- package/dist/plugins/session.js.map +1 -0
- package/dist/testkit/contract.d.ts +33 -0
- package/dist/testkit/contract.js +118 -0
- package/dist/testkit/contract.js.map +1 -0
- package/dist/testkit/index.d.ts +15 -0
- package/dist/testkit/index.js +15 -0
- package/dist/testkit/index.js.map +1 -0
- package/docs/architecture.md +33 -5
- package/docs/artifacts/decision-record.md +54 -0
- package/docs/artifacts/tasks.md +37 -0
- package/docs/artifacts/tests.md +43 -0
- package/docs/cli-reference.md +255 -6
- package/docs/concepts/mcp-server.md +93 -0
- package/docs/contributing.md +9 -0
- package/docs/index.md +1 -1
- package/docs/plugin-api.md +124 -0
- package/docs/plugin-split.md +55 -0
- package/docs/plugin-trust.md +51 -0
- package/docs/tool-compatibility.md +71 -6
- package/docs/workflow.md +37 -5
- package/package.json +5 -2
- package/src/agents/worker.md +37 -0
- package/src/prompts/converge.md +8 -3
- package/src/prompts/decide.md +31 -0
- package/src/prompts/implement.md +15 -7
- package/src/prompts/revise.md +4 -2
- package/src/prompts/run.md +100 -0
- package/src/prompts/tasks.md +13 -3
- package/src/roles/security.md +17 -0
- package/src/templates/adr.md +29 -0
- package/src/templates/tasks.md +6 -0
- package/src/templates/tests.md +29 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-gate-actions.js","sourceRoot":"","sources":["../../src/core/run-gate-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAgC,MAAM,kBAAkB,CAAC;AAGpF;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,SAAS,KAAK,EAAE,CAAC;AAEvE;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAiB,EAAE,KAAa;IAC/D,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAe,CAAC,CAAC,CAAC;IACzG,MAAM,IAAI,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAChH,OAAO,IAAI,CAAC,GAAG,CA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EAAE,SAAS,EAAE,CAAC,GAAG,GAAG,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IACtI,OAAO,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;AACjF,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,GAAW,EAAE,MAA+B;IACjF,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,GAAG;QAAE,OAAO;IACjB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,CAAC,GAAG,GAAG,CAAC,WAAW,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1J,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type RunnerSpec } from "./runners.js";
|
|
2
|
+
/**
|
|
3
|
+
* The launch plan (feature 028, FR-001..FR-004, FR-006): lanes + their assistant + their prompt file → the
|
|
4
|
+
* exact command per lane. Pure: it decides and formats, it starts nothing. A lane whose assistant has no
|
|
5
|
+
* verified runner is `refused` with the reason, and the same plan feeds the preview, `--emit-script` and the
|
|
6
|
+
* launch, so what is printed is exactly what runs.
|
|
7
|
+
*/
|
|
8
|
+
export interface LaunchLane {
|
|
9
|
+
/** Short lane name `lane-p-k`. */
|
|
10
|
+
lane: string;
|
|
11
|
+
/** Full lane name `NNN-slug.lane-p-k`. */
|
|
12
|
+
full: string;
|
|
13
|
+
/** The lane's worktree. */
|
|
14
|
+
cwd: string;
|
|
15
|
+
assistant: string;
|
|
16
|
+
/** The prompt text; the plan only names where it is stored. */
|
|
17
|
+
prompt: string;
|
|
18
|
+
}
|
|
19
|
+
export interface LaunchEntry {
|
|
20
|
+
lane: string;
|
|
21
|
+
full: string;
|
|
22
|
+
assistant: string;
|
|
23
|
+
cwd: string;
|
|
24
|
+
promptFile: string;
|
|
25
|
+
prompt: string;
|
|
26
|
+
/** Absent when refused. */
|
|
27
|
+
command?: {
|
|
28
|
+
exe: string;
|
|
29
|
+
args: string[];
|
|
30
|
+
stdin?: string;
|
|
31
|
+
};
|
|
32
|
+
/** The command as a person would type it, redirecting the prompt file where the runner reads stdin. */
|
|
33
|
+
display: string;
|
|
34
|
+
/** Why this lane will not run; set exactly when `command` is absent. */
|
|
35
|
+
refused?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface LaunchPlanOptions {
|
|
38
|
+
/** Where a lane's prompt file lives (relative or absolute path as printed). */
|
|
39
|
+
promptFileFor(lane: string): string;
|
|
40
|
+
registry?: RunnerSpec[];
|
|
41
|
+
model?: string;
|
|
42
|
+
}
|
|
43
|
+
export declare function launchPlan(lanes: LaunchLane[], opts: LaunchPlanOptions): LaunchEntry[];
|
|
44
|
+
/** Lanes the plan refuses, with the reason each. */
|
|
45
|
+
export declare function refusals(plan: LaunchEntry[]): {
|
|
46
|
+
lane: string;
|
|
47
|
+
assistant: string;
|
|
48
|
+
reason: string;
|
|
49
|
+
}[];
|
|
50
|
+
/** Spread lanes over assistants round-robin, so two lanes and two assistants run on two different assistants. */
|
|
51
|
+
export declare function assignAssistants(lanes: string[], assistants: string[]): Map<string, string>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RUNNERS, runnable } from "./runners.js";
|
|
2
|
+
const quote = (a) => (/^[A-Za-z0-9_@%+=:,./\\-]+$/.test(a) ? a : `"${a.replace(/"/g, '\\"')}"`);
|
|
3
|
+
export function launchPlan(lanes, opts) {
|
|
4
|
+
const registry = opts.registry ?? RUNNERS;
|
|
5
|
+
return lanes.map((l) => {
|
|
6
|
+
const promptFile = opts.promptFileFor(l.lane);
|
|
7
|
+
const base = { lane: l.lane, full: l.full, assistant: l.assistant, cwd: l.cwd, promptFile, prompt: l.prompt };
|
|
8
|
+
const can = runnable(l.assistant, registry);
|
|
9
|
+
if (!can.ok)
|
|
10
|
+
return { ...base, display: `# ${l.lane} (${l.assistant}): REFUSED — ${can.reason}`, refused: can.reason };
|
|
11
|
+
const command = can.runner.invoke({ prompt: l.prompt, promptFile, ...(opts.model ? { model: opts.model } : {}) });
|
|
12
|
+
const text = [command.exe, ...command.args].map(quote).join(" ");
|
|
13
|
+
const display = `cd ${quote(l.cwd)} && ${text}${command.stdin !== undefined ? ` < ${quote(promptFile)}` : ""}`;
|
|
14
|
+
return { ...base, command, display };
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** Lanes the plan refuses, with the reason each. */
|
|
18
|
+
export function refusals(plan) {
|
|
19
|
+
return plan.flatMap((e) => (e.refused ? [{ lane: e.lane, assistant: e.assistant, reason: e.refused }] : []));
|
|
20
|
+
}
|
|
21
|
+
/** Spread lanes over assistants round-robin, so two lanes and two assistants run on two different assistants. */
|
|
22
|
+
export function assignAssistants(lanes, assistants) {
|
|
23
|
+
const out = new Map();
|
|
24
|
+
lanes.forEach((lane, i) => out.set(lane, assistants[i % assistants.length]));
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=run-launch-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-launch-plan.js","sourceRoot":"","sources":["../../src/core/run-launch-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAmB,MAAM,cAAc,CAAC;AA2ClE,MAAM,KAAK,GAAG,CAA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ant cannot get cheaper elsewhere: its task IDs, the artifacts by `@path` reference, and the files it
|
|
4
|
+
* owns. Task text, the spec and the plan are never copied in: the assistant reads them by reference.
|
|
5
|
+
*/
|
|
6
|
+
export interface PromptLane {
|
|
7
|
+
feature: string;
|
|
8
|
+
/** Full lane name `NNN-slug.lane-p-k`. */
|
|
9
|
+
lane: string;
|
|
10
|
+
phase: number;
|
|
11
|
+
tasks: {
|
|
12
|
+
id: string;
|
|
13
|
+
paths: string[];
|
|
14
|
+
}[];
|
|
15
|
+
}
|
|
16
|
+
export interface LanePromptOptions {
|
|
17
|
+
/** Run id, so reports and directives name it. */
|
|
18
|
+
run: string;
|
|
19
|
+
/** `@` reference targets that exist, relative to the lane checkout (spec, plan, tasks, tests). */
|
|
20
|
+
artifacts: string[];
|
|
21
|
+
/** Task IDs still unchecked; checked ones are not listed (a restart repeats no completed task). */
|
|
22
|
+
open?: string[];
|
|
23
|
+
/** Review finding IDs returned to the worker; when present the prompt is a fix round, not a build. */
|
|
24
|
+
findings?: string[];
|
|
25
|
+
/** The protocol wording shared with spec 019's worker persona (reporting cadence and directive text). */
|
|
26
|
+
protocol?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const shortName: (lane: string) => string;
|
|
29
|
+
export declare function buildLanePrompt(lane: PromptLane, opts: LanePromptOptions): string;
|
|
30
|
+
export type ReviewRole = "qa" | "architect";
|
|
31
|
+
export interface RolePromptInput {
|
|
32
|
+
role: ReviewRole;
|
|
33
|
+
feature: string;
|
|
34
|
+
lane: string;
|
|
35
|
+
phase: number;
|
|
36
|
+
round: number;
|
|
37
|
+
run: string;
|
|
38
|
+
/** The role file by reference, e.g. `.amby/roles/qa.md`. */
|
|
39
|
+
roleFile: string;
|
|
40
|
+
/** The phase's `**Verify:**` line, verbatim; absent when the phase has none. */
|
|
41
|
+
verify?: string;
|
|
42
|
+
artifacts: string[];
|
|
43
|
+
/** The verdict file the role writes, relative to the run directory. */
|
|
44
|
+
verdictFile: string;
|
|
45
|
+
}
|
|
46
|
+
/** QA and architect jobs: the role by `@` reference, the phase's Verify line, and where to write the verdict. */
|
|
47
|
+
export declare function buildRolePrompt(input: RolePromptInput): string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompts for headless jobs (feature 028, FR-004, Principle 3). A lane's prompt carries only what the
|
|
3
|
+
* assistant cannot get cheaper elsewhere: its task IDs, the artifacts by `@path` reference, and the files it
|
|
4
|
+
* owns. Task text, the spec and the plan are never copied in: the assistant reads them by reference.
|
|
5
|
+
*/
|
|
6
|
+
export const shortName = (lane) => lane.slice(lane.lastIndexOf(".lane-") + 1);
|
|
7
|
+
export function buildLanePrompt(lane, opts) {
|
|
8
|
+
const open = opts.open ?? lane.tasks.map((t) => t.id);
|
|
9
|
+
const refs = opts.artifacts.map((a) => `@${a}`).join(" ");
|
|
10
|
+
const own = [...new Set(lane.tasks.filter((t) => open.includes(t.id)).flatMap((t) => t.paths))];
|
|
11
|
+
const name = shortName(lane.lane);
|
|
12
|
+
const lines = [];
|
|
13
|
+
if (opts.findings && opts.findings.length > 0) {
|
|
14
|
+
lines.push(`You are the worker of lane ${name} of ${lane.feature} (run ${opts.run}). Fix exactly these review findings and nothing else: ${opts.findings.join(", ")}.`);
|
|
15
|
+
lines.push(`Read: ${refs}. The findings are in the verdict files under .amby/fleet/${opts.run}/verdicts/. Report one line per ID: <id>: fixed (<files>).`);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
lines.push(`You are the worker of lane ${name} of ${lane.feature} (run ${opts.run}), phase ${lane.phase}. Build only these tasks, in order, and check each off in tasks.md: ${open.join(", ") || "(none left)"}.`);
|
|
19
|
+
lines.push(`Read: ${refs}.`);
|
|
20
|
+
}
|
|
21
|
+
if (own.length > 0)
|
|
22
|
+
lines.push(`Edit only the files you own: ${own.join(", ")}.`);
|
|
23
|
+
lines.push(`Report: ambykit activity ${lane.feature} --phase=implement --task=T### --lane=${name} --state=<working|waiting|blocked|done> --run=${opts.run}; then read your directive with: ambykit fleet directive ${lane.feature} ${name} --run=${opts.run}.`);
|
|
24
|
+
if (opts.protocol)
|
|
25
|
+
lines.push(opts.protocol);
|
|
26
|
+
return lines.join("\n");
|
|
27
|
+
}
|
|
28
|
+
/** QA and architect jobs: the role by `@` reference, the phase's Verify line, and where to write the verdict. */
|
|
29
|
+
export function buildRolePrompt(input) {
|
|
30
|
+
const refs = input.artifacts.map((a) => `@${a}`).join(" ");
|
|
31
|
+
return [
|
|
32
|
+
`Act as the ${input.role} reviewer: follow @${input.roleFile}. Review lane ${shortName(input.lane)} of ${input.feature}, phase ${input.phase}, round ${input.round}. Read: ${refs}.`,
|
|
33
|
+
input.verify ? `Run this check and judge its result: ${input.verify}` : "The phase has no Verify line: review the lane's diff against the plan.",
|
|
34
|
+
`Write your verdict to .amby/fleet/${input.run}/${input.verdictFile} as JSON: {"verdict":"pass"|"fail","findings":[{"id","severity","finding","fix"}]}. A fail needs at least one finding with an id. Edit no other file.`,
|
|
35
|
+
].join("\n");
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=run-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-prompt.js","sourceRoot":"","sources":["../../src/core/run-prompt.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAuBH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAE9F,MAAM,UAAU,eAAe,CAAC,IAAgB,EAAE,IAAuB;IACvE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACtD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAA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I,CACR,4BAA4B,IAAI,CAAC,OAAO,yCAAyC,IAAI,iDAAiD,IAAI,CAAC,GAAG,4DAA4D,IAAI,CAAC,OAAO,IAAI,IAAI,UAAU,IAAI,CAAC,GAAG,GAAG,CACpP,CAAC;IACF,IAAI,IAAI,CAAC,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAoBD,iHAAiH;AACjH,MAAM,UAAU,eAAe,CAAC,KAAsB;IACpD,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3D,OAAO;QACL,cAAc,KAAK,CAAC,IAAI,sBAAsB,KAAK,CAAC,QAAQ,iBAAiB,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,OAAO,WAAW,KAAK,CAAC,KAAK,WAAW,KAAK,CAAC,KAAK,WAAW,IAAI,GAAG;QACpL,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,wCAAwC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,wEAAwE;QAChJ,qCAAqC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,WAAW,uJAAuJ;KAC3N,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type VerdictResult } from "./fleet/run-flow.js";
|
|
2
|
+
/**
|
|
3
|
+
* The review loop's state machine (feature 028, FR-018, SC-009). Pure: it takes where a lane is in the loop and
|
|
4
|
+
* what the last reviewer wrote, and says what happens next. The verdict contract is spec 019's
|
|
5
|
+
* (`verdicts/<lane>.<role>.<round>.json`, parsed by `parseVerdict`); the round limit is `fleet.roundLimit`.
|
|
6
|
+
* Order is QA first, then the architect; a failure from either goes back to the same lane's worker as finding
|
|
7
|
+
* IDs only, and after `limit` failed rounds the loop stops and asks a person.
|
|
8
|
+
*/
|
|
9
|
+
export type Reviewer = "qa" | "architect";
|
|
10
|
+
export type ReviewStep =
|
|
11
|
+
/** The reviewer has not run this round: launch it. */
|
|
12
|
+
{
|
|
13
|
+
kind: "launch";
|
|
14
|
+
role: Reviewer;
|
|
15
|
+
round: number;
|
|
16
|
+
}
|
|
17
|
+
/** QA passed: the architect reviews next. */
|
|
18
|
+
| {
|
|
19
|
+
kind: "advance";
|
|
20
|
+
to: "architect";
|
|
21
|
+
}
|
|
22
|
+
/** Both passed: the lane may merge. */
|
|
23
|
+
| {
|
|
24
|
+
kind: "pass";
|
|
25
|
+
}
|
|
26
|
+
/** A failure under the limit: the worker fixes exactly these findings, then the next round starts at QA. */
|
|
27
|
+
| {
|
|
28
|
+
kind: "fix";
|
|
29
|
+
findings: string[];
|
|
30
|
+
failedRounds: number;
|
|
31
|
+
}
|
|
32
|
+
/** The loop ends here and a person decides. */
|
|
33
|
+
| {
|
|
34
|
+
kind: "escalate";
|
|
35
|
+
reason: string;
|
|
36
|
+
findings: string[];
|
|
37
|
+
failedRounds: number;
|
|
38
|
+
};
|
|
39
|
+
export interface ReviewInput {
|
|
40
|
+
stage: Reviewer;
|
|
41
|
+
round: number;
|
|
42
|
+
/** Rounds of this lane that already ended in a failure. */
|
|
43
|
+
failedRounds: number;
|
|
44
|
+
limit: number;
|
|
45
|
+
/** The reviewer's process for this round has finished. */
|
|
46
|
+
reviewerDone: boolean;
|
|
47
|
+
/** The parsed verdict file; `null` = no file. Ignored until `reviewerDone`. */
|
|
48
|
+
verdict: VerdictResult | null;
|
|
49
|
+
}
|
|
50
|
+
export declare function reviewStep(input: ReviewInput): ReviewStep;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { nextRoundAction } from "./fleet/run-flow.js";
|
|
2
|
+
export function reviewStep(input) {
|
|
3
|
+
if (!input.reviewerDone)
|
|
4
|
+
return { kind: "launch", role: input.stage, round: input.round };
|
|
5
|
+
if (input.verdict === null) {
|
|
6
|
+
return { kind: "escalate", reason: `the ${input.stage} reviewer wrote no verdict for round ${input.round}`, findings: [], failedRounds: input.failedRounds };
|
|
7
|
+
}
|
|
8
|
+
if (!input.verdict.ok) {
|
|
9
|
+
return { kind: "escalate", reason: `the ${input.stage} verdict for round ${input.round} is invalid: ${input.verdict.error}`, findings: [], failedRounds: input.failedRounds };
|
|
10
|
+
}
|
|
11
|
+
if (input.verdict.verdict.verdict === "pass")
|
|
12
|
+
return input.stage === "qa" ? { kind: "advance", to: "architect" } : { kind: "pass" };
|
|
13
|
+
const failed = input.failedRounds + 1;
|
|
14
|
+
const ids = input.verdict.failingIds;
|
|
15
|
+
if (nextRoundAction(failed, input.limit) === "escalate") {
|
|
16
|
+
return { kind: "escalate", reason: `still failing after ${failed} review round${failed === 1 ? "" : "s"} (limit ${input.limit})`, findings: ids, failedRounds: failed };
|
|
17
|
+
}
|
|
18
|
+
return { kind: "fix", findings: ids, failedRounds: failed };
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=run-review.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-review.js","sourceRoot":"","sources":["../../src/core/run-review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAsB,MAAM,qBAAqB,CAAC;AAoC1E,MAAM,UAAU,UAAU,CAAC,KAAkB;IAC3C,IAAI,CAAC,KAAK,CAAC,YAAY;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;IAC1F,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QAC3B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,KAAK,CAAC,KAAK,wCAAwC,KAAK,CAAC,KA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encyGraph } from "./graph-types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Which queued lanes start now (feature 028, FR-005). Pure: the total cap and the per-type cap come from
|
|
4
|
+
* `fleet.concurrency`; order is the queue's order, which is stable (phase, then lane index). A lane in `held`
|
|
5
|
+
* waits (an unfinished cross-story dependency, or a gate), and a lane whose assistant is at its per-type cap
|
|
6
|
+
* is skipped without blocking later lanes of another type.
|
|
7
|
+
*/
|
|
8
|
+
export interface QueuedLane {
|
|
9
|
+
lane: string;
|
|
10
|
+
assistant: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function nextToStart(queue: QueuedLane[], running: QueuedLane[], caps: {
|
|
13
|
+
total: number;
|
|
14
|
+
perType: number;
|
|
15
|
+
}, held?: ReadonlySet<string>): QueuedLane[];
|
|
16
|
+
/**
|
|
17
|
+
* Lanes held because a story they build has an unmet blocker in another feature (spec 023's graph). Within a
|
|
18
|
+
* feature the phase order already sequences work, so only cross-feature blockers hold a lane here.
|
|
19
|
+
*/
|
|
20
|
+
export declare function heldByDependencies(graph: DependencyGraph, feature: string, lanes: {
|
|
21
|
+
lane: string;
|
|
22
|
+
stories: string[];
|
|
23
|
+
}[]): Set<string>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { blockersOf } from "./graph-paths.js";
|
|
2
|
+
export function nextToStart(queue, running, caps, held = new Set()) {
|
|
3
|
+
const perType = new Map();
|
|
4
|
+
for (const r of running)
|
|
5
|
+
perType.set(r.assistant, (perType.get(r.assistant) ?? 0) + 1);
|
|
6
|
+
let total = running.length;
|
|
7
|
+
const start = [];
|
|
8
|
+
for (const q of queue) {
|
|
9
|
+
if (total >= caps.total)
|
|
10
|
+
break;
|
|
11
|
+
if (held.has(q.lane))
|
|
12
|
+
continue;
|
|
13
|
+
const n = perType.get(q.assistant) ?? 0;
|
|
14
|
+
if (n >= caps.perType)
|
|
15
|
+
continue;
|
|
16
|
+
start.push(q);
|
|
17
|
+
perType.set(q.assistant, n + 1);
|
|
18
|
+
total += 1;
|
|
19
|
+
}
|
|
20
|
+
return start;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Lanes held because a story they build has an unmet blocker in another feature (spec 023's graph). Within a
|
|
24
|
+
* feature the phase order already sequences work, so only cross-feature blockers hold a lane here.
|
|
25
|
+
*/
|
|
26
|
+
export function heldByDependencies(graph, feature, lanes) {
|
|
27
|
+
const held = new Set();
|
|
28
|
+
for (const l of lanes) {
|
|
29
|
+
for (const story of l.stories) {
|
|
30
|
+
const key = `${feature}:${story}`;
|
|
31
|
+
const crossFeature = blockersOf(graph, key).some((b) => !b.key.startsWith(`${feature}:`));
|
|
32
|
+
if (crossFeature) {
|
|
33
|
+
held.add(l.lane);
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return held;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=run-schedule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-schedule.js","sourceRoot":"","sources":["../../src/core/run-schedule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAa9C,MAAM,UAAU,WAAW,CACzB,KAAmB,EACnB,OAAqB,EACrB,IAAwC,EACxC,IAAI,GAAwB,IAAI,GAAG,EAAE;IAErC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC1C,KAAK,MAAM,CAAC,IAAI,OAAO;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACvF,IAAI,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC;IAC3B,MAAM,KAAK,GAAiB,EAAE,CAAC;IAC/B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,IAAI,KAAK,IAAI,IAAI,CAA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none touches a process, a file or the clock. *Whether a lane is stalled* is spec 025's
|
|
4
|
+
* `laneStatus` (waiting, blocked, paused and done lanes are exempt there); 028 only decides what to do about it.
|
|
5
|
+
*/
|
|
6
|
+
export type RestartDecision = "none" | "restart" | "pause";
|
|
7
|
+
/** A stalled lane restarts until `limit` restarts are used; the next stall pauses it for a person (FR-009). */
|
|
8
|
+
export declare function restartDecision(input: {
|
|
9
|
+
stalled: boolean;
|
|
10
|
+
restarts: number;
|
|
11
|
+
limit: number;
|
|
12
|
+
}): RestartDecision;
|
|
13
|
+
/** A person's approval to move a lane to another assistant, recorded in `run.json` `approvals[]`. */
|
|
14
|
+
export interface ReassignApproval {
|
|
15
|
+
kind: "reassign";
|
|
16
|
+
lane: string;
|
|
17
|
+
to: string;
|
|
18
|
+
at: string;
|
|
19
|
+
}
|
|
20
|
+
export type ReassignDecision = {
|
|
21
|
+
allowed: true;
|
|
22
|
+
} | {
|
|
23
|
+
allowed: false;
|
|
24
|
+
reason: string;
|
|
25
|
+
};
|
|
26
|
+
/** FR-009: a lane moves to a different assistant only with that person's approval; never on its own. */
|
|
27
|
+
export declare function reassignGate(approvals: unknown[], lane: string, to: string): ReassignDecision;
|
|
28
|
+
export interface Budgets {
|
|
29
|
+
/** Minutes the run may take. Always enforced. */
|
|
30
|
+
wallClockMinutes: number;
|
|
31
|
+
/** Task events (check-offs plus restarts and fix rounds) the run may use. Always enforced. */
|
|
32
|
+
maxTasks: number;
|
|
33
|
+
/** Tokens, enforced only where every runner in the run reports usage. */
|
|
34
|
+
maxTokens?: number;
|
|
35
|
+
}
|
|
36
|
+
export declare const DEFAULT_WALL_CLOCK_MINUTES = 120;
|
|
37
|
+
/** Defaults: 120 minutes, and twice the open tasks of the prepared lanes (room for rework). Config, then flags. */
|
|
38
|
+
export declare function resolveBudgets(input: {
|
|
39
|
+
openTasks: number;
|
|
40
|
+
config?: Record<string, number>;
|
|
41
|
+
flags?: Partial<Budgets>;
|
|
42
|
+
}): Budgets;
|
|
43
|
+
export interface BudgetSnapshot {
|
|
44
|
+
elapsedMs: number;
|
|
45
|
+
tasksUsed: number;
|
|
46
|
+
tokensUsed?: number;
|
|
47
|
+
/** True when every runner of the run reports usage. */
|
|
48
|
+
reportsUsage: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface BudgetDecision {
|
|
51
|
+
exceeded: boolean;
|
|
52
|
+
/** Why the run must stop; recorded in the run state. */
|
|
53
|
+
reason?: string;
|
|
54
|
+
/** Budgets that are set but cannot be enforced, stated at start and when exceeded (FR-013). */
|
|
55
|
+
unenforced: string[];
|
|
56
|
+
}
|
|
57
|
+
export declare function budgetDecision(budgets: Budgets, snap: BudgetSnapshot): BudgetDecision;
|
|
58
|
+
/** After a stop or budget directive: terminate a lane that has not reported for the stop grace (FR-014). */
|
|
59
|
+
export declare function mustTerminate(input: {
|
|
60
|
+
stopRequestedAt: number;
|
|
61
|
+
lastReportAt: number | null;
|
|
62
|
+
now: number;
|
|
63
|
+
graceMinutes: number;
|
|
64
|
+
}): boolean;
|
|
65
|
+
/** A verified runner that exits non-zero within this many seconds of starting is a command/version mismatch. */
|
|
66
|
+
export declare const FAST_FAILURE_SECONDS = 15;
|
|
67
|
+
/** True when a lane's process died at once with an error: the runner's recorded command no longer works. */
|
|
68
|
+
export declare function isImmediateFailure(input: {
|
|
69
|
+
code: number | null;
|
|
70
|
+
ranMs: number;
|
|
71
|
+
}): boolean;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure supervision rules (feature 028, FR-008..FR-010, FR-013, FR-014). Each takes a snapshot and returns a
|
|
3
|
+
* decision; none touches a process, a file or the clock. *Whether a lane is stalled* is spec 025's
|
|
4
|
+
* `laneStatus` (waiting, blocked, paused and done lanes are exempt there); 028 only decides what to do about it.
|
|
5
|
+
*/
|
|
6
|
+
/** A stalled lane restarts until `limit` restarts are used; the next stall pauses it for a person (FR-009). */
|
|
7
|
+
export function restartDecision(input) {
|
|
8
|
+
if (!input.stalled)
|
|
9
|
+
return "none";
|
|
10
|
+
return input.restarts < input.limit ? "restart" : "pause";
|
|
11
|
+
}
|
|
12
|
+
/** FR-009: a lane moves to a different assistant only with that person's approval; never on its own. */
|
|
13
|
+
export function reassignGate(approvals, lane, to) {
|
|
14
|
+
const ok = approvals.some((a) => {
|
|
15
|
+
const r = a;
|
|
16
|
+
return !!r && r.kind === "reassign" && r.lane === lane && r.to === to;
|
|
17
|
+
});
|
|
18
|
+
return ok ? { allowed: true } : { allowed: false, reason: `moving ${lane} to ${to} needs a person's approval; none is recorded` };
|
|
19
|
+
}
|
|
20
|
+
export const DEFAULT_WALL_CLOCK_MINUTES = 120;
|
|
21
|
+
/** Defaults: 120 minutes, and twice the open tasks of the prepared lanes (room for rework). Config, then flags. */
|
|
22
|
+
export function resolveBudgets(input) {
|
|
23
|
+
const c = input.config ?? {};
|
|
24
|
+
const f = input.flags ?? {};
|
|
25
|
+
const out = {
|
|
26
|
+
wallClockMinutes: f.wallClockMinutes ?? c["wallClockMinutes"] ?? DEFAULT_WALL_CLOCK_MINUTES,
|
|
27
|
+
maxTasks: f.maxTasks ?? c["maxTasks"] ?? Math.max(1, input.openTasks * 2),
|
|
28
|
+
};
|
|
29
|
+
const tokens = f.maxTokens ?? c["maxTokens"];
|
|
30
|
+
if (tokens !== undefined)
|
|
31
|
+
out.maxTokens = tokens;
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
export function budgetDecision(budgets, snap) {
|
|
35
|
+
const unenforced = [];
|
|
36
|
+
if (budgets.maxTokens !== undefined && !snap.reportsUsage)
|
|
37
|
+
unenforced.push("token ceiling not enforceable for this runner (it does not report usage)");
|
|
38
|
+
if (snap.elapsedMs > budgets.wallClockMinutes * 60_000) {
|
|
39
|
+
return { exceeded: true, reason: `wall-clock budget of ${budgets.wallClockMinutes} minutes exceeded`, unenforced };
|
|
40
|
+
}
|
|
41
|
+
if (snap.tasksUsed > budgets.maxTasks) {
|
|
42
|
+
return { exceeded: true, reason: `task budget of ${budgets.maxTasks} exceeded (${snap.tasksUsed} used)`, unenforced };
|
|
43
|
+
}
|
|
44
|
+
if (budgets.maxTokens !== undefined && snap.reportsUsage && (snap.tokensUsed ?? 0) > budgets.maxTokens) {
|
|
45
|
+
return { exceeded: true, reason: `token ceiling of ${budgets.maxTokens} exceeded (${snap.tokensUsed} used)`, unenforced };
|
|
46
|
+
}
|
|
47
|
+
return { exceeded: false, unenforced };
|
|
48
|
+
}
|
|
49
|
+
/** After a stop or budget directive: terminate a lane that has not reported for the stop grace (FR-014). */
|
|
50
|
+
export function mustTerminate(input) {
|
|
51
|
+
const last = Math.max(input.stopRequestedAt, input.lastReportAt ?? 0);
|
|
52
|
+
return input.now - last > input.graceMinutes * 60_000;
|
|
53
|
+
}
|
|
54
|
+
// --- immediate failure (US-3 AC3) ---------------------------------------------------------
|
|
55
|
+
/** A verified runner that exits non-zero within this many seconds of starting is a command/version mismatch. */
|
|
56
|
+
export const FAST_FAILURE_SECONDS = 15;
|
|
57
|
+
/** True when a lane's process died at once with an error: the runner's recorded command no longer works. */
|
|
58
|
+
export function isImmediateFailure(input) {
|
|
59
|
+
return input.code !== 0 && input.ranMs < FAST_FAILURE_SECONDS * 1000;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=run-supervise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-supervise.js","sourceRoot":"","sources":["../../src/core/run-supervise.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,+GAA+G;AAC/G,MAAM,UAAU,eAAe,CAAC,KAA4D;IAC1F,IAAI,CAAC,KAAK,CAAC,OAAO;QAAE,OAAO,MAAM,CAAC;IAClC,OAAO,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;AAC5D,CAAC;AAYD,wGAAwG;AACxG,MAAM,UAAU,YAAY,CAAC,SAAoB,EAAE,IAAY,EAAE,EAA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AC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC,4GAA4G;AAC5G,MAAM,UAAU,kBAAkB,CAAC,KAA6C;IAC9E,OAAO,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,GAAG,oBAAoB,GAAG,IAAI,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Headless runner registry (feature 028, FR-006, FR-007). A runner is *data*: the command that runs one
|
|
3
|
+
* assistant non-interactively, how its exit reads and whether it reports token usage. Every entry starts
|
|
4
|
+
* `verified: false`; a runner becomes runnable only after its command has run a real lane task on a live
|
|
5
|
+
* install (T044, T045), and the matrix in `docs/tool-compatibility.md` carries the same rows (a doc-sync test
|
|
6
|
+
* keeps them equal). `runnable()` is the single chokepoint before any process is spawned (SC-006, Principle 4).
|
|
7
|
+
*/
|
|
8
|
+
export interface RunnerJob {
|
|
9
|
+
/** The full prompt text (IDs, `@` references, ownership). */
|
|
10
|
+
prompt: string;
|
|
11
|
+
/** The same prompt as a file under the run directory, for runners that take a file reference. */
|
|
12
|
+
promptFile: string;
|
|
13
|
+
model?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface RunnerCommand {
|
|
16
|
+
exe: string;
|
|
17
|
+
args: string[];
|
|
18
|
+
/** Text written to the process's stdin; absent when the prompt is passed another way. */
|
|
19
|
+
stdin?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface RunnerSpec {
|
|
22
|
+
/** Matches the assistant's id in `config.tools`. */
|
|
23
|
+
id: string;
|
|
24
|
+
label: string;
|
|
25
|
+
executable: string;
|
|
26
|
+
invoke(job: RunnerJob): RunnerCommand;
|
|
27
|
+
/** How the process's exit is read, in words (recorded in the matrix). */
|
|
28
|
+
exit: string;
|
|
29
|
+
/** Whether the process reports token usage, so a token ceiling can be enforced. */
|
|
30
|
+
reportsUsage: boolean;
|
|
31
|
+
verified: boolean;
|
|
32
|
+
/** The CLI version the command was verified against; present only when `verified`. */
|
|
33
|
+
verifiedVersion?: string;
|
|
34
|
+
/** What is still to confirm on a live install. */
|
|
35
|
+
toVerify: string;
|
|
36
|
+
}
|
|
37
|
+
export declare const RUNNERS: RunnerSpec[];
|
|
38
|
+
export declare function runnerFor(id: string): RunnerSpec | undefined;
|
|
39
|
+
export type Runnable = {
|
|
40
|
+
ok: true;
|
|
41
|
+
runner: RunnerSpec;
|
|
42
|
+
} | {
|
|
43
|
+
ok: false;
|
|
44
|
+
reason: string;
|
|
45
|
+
};
|
|
46
|
+
/** FR-006: only a verified runner is runnable; the reason says exactly why a refused one is not. */
|
|
47
|
+
export declare function runnable(id: string, registry?: RunnerSpec[]): Runnable;
|
|
48
|
+
export interface RunnerListing {
|
|
49
|
+
id: string;
|
|
50
|
+
label: string;
|
|
51
|
+
verified: boolean;
|
|
52
|
+
verifiedVersion?: string;
|
|
53
|
+
reportsUsage: boolean;
|
|
54
|
+
runnable: boolean;
|
|
55
|
+
/** Present when not runnable. */
|
|
56
|
+
reason?: string;
|
|
57
|
+
}
|
|
58
|
+
/** FR-007: the runners with their capabilities, for `ambykit run --runners`. */
|
|
59
|
+
export declare function listRunners(registry?: RunnerSpec[]): RunnerListing[];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Headless runner registry (feature 028, FR-006, FR-007). A runner is *data*: the command that runs one
|
|
3
|
+
* assistant non-interactively, how its exit reads and whether it reports token usage. Every entry starts
|
|
4
|
+
* `verified: false`; a runner becomes runnable only after its command has run a real lane task on a live
|
|
5
|
+
* install (T044, T045), and the matrix in `docs/tool-compatibility.md` carries the same rows (a doc-sync test
|
|
6
|
+
* keeps them equal). `runnable()` is the single chokepoint before any process is spawned (SC-006, Principle 4).
|
|
7
|
+
*/
|
|
8
|
+
export const RUNNERS = [
|
|
9
|
+
{
|
|
10
|
+
id: "claude",
|
|
11
|
+
label: "Claude Code",
|
|
12
|
+
executable: "claude",
|
|
13
|
+
invoke: (job) => ({ exe: "claude", args: ["-p", ...(job.model ? ["--model", job.model] : [])], stdin: job.prompt }),
|
|
14
|
+
exit: "0 = finished its turn; non-zero = failed",
|
|
15
|
+
reportsUsage: false,
|
|
16
|
+
verified: false,
|
|
17
|
+
toVerify: "non-interactive flag, prompt on stdin, permission handling for edits, exit codes, usage output",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: "codex",
|
|
21
|
+
label: "Codex",
|
|
22
|
+
executable: "codex",
|
|
23
|
+
invoke: (job) => ({ exe: "codex", args: ["exec", ...(job.model ? ["--model", job.model] : []), "-"], stdin: job.prompt }),
|
|
24
|
+
exit: "0 = finished; non-zero = failed",
|
|
25
|
+
reportsUsage: false,
|
|
26
|
+
verified: false,
|
|
27
|
+
toVerify: "exec subcommand, prompt on stdin, sandbox and approval flags for edits, exit codes, usage output",
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
export function runnerFor(id) {
|
|
31
|
+
return RUNNERS.find((r) => r.id === id);
|
|
32
|
+
}
|
|
33
|
+
/** FR-006: only a verified runner is runnable; the reason says exactly why a refused one is not. */
|
|
34
|
+
export function runnable(id, registry = RUNNERS) {
|
|
35
|
+
const runner = registry.find((r) => r.id === id);
|
|
36
|
+
if (!runner) {
|
|
37
|
+
const ok = registry.filter((r) => r.verified).map((r) => r.id);
|
|
38
|
+
return { ok: false, reason: `no headless runner is recorded for '${id}'; runnable assistants: ${ok.join(", ") || "none yet"}` };
|
|
39
|
+
}
|
|
40
|
+
if (!runner.verified) {
|
|
41
|
+
return { ok: false, reason: `the ${runner.label} runner is not verified yet (to confirm on a live install: ${runner.toVerify}); see docs/tool-compatibility.md` };
|
|
42
|
+
}
|
|
43
|
+
return { ok: true, runner };
|
|
44
|
+
}
|
|
45
|
+
/** FR-007: the runners with their capabilities, for `ambykit run --runners`. */
|
|
46
|
+
export function listRunners(registry = RUNNERS) {
|
|
47
|
+
return registry.map((r) => {
|
|
48
|
+
const can = runnable(r.id, registry);
|
|
49
|
+
return {
|
|
50
|
+
id: r.id,
|
|
51
|
+
label: r.label,
|
|
52
|
+
verified: r.verified,
|
|
53
|
+
...(r.verifiedVersion ? { verifiedVersion: r.verifiedVersion } : {}),
|
|
54
|
+
reportsUsage: r.reportsUsage,
|
|
55
|
+
runnable: can.ok,
|
|
56
|
+
...(can.ok ? {} : { reason: can.reason }),
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=runners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runners.js","sourceRoot":"","sources":["../../src/core/runners.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAkCH,MAAM,CAAC,MAAM,OAAO,GAAiB;IACnC;QACE,EAAE,EAAE,QAAQ;QACZ,KAAK,EAAE,aAAa;QACpB,UAAU,EAAE,QAAQ;QACpB,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;QACnH,IAAI,EAAE,0CAA0C;QAChD,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,gGAAgG;KAC3G;IACD;QACE,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,OAAO;QACd,UAAU,EAAE,OAAO;QACnB,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EA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,OAAO;IAC1D,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACxB,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QACrC,OAAO;YACL,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACpE,YAAY,EAAE,CAAC,CAAC,YAAY;YAC5B,QAAQ,EAAE,GAAG,CAAC,EAAE;YAChB,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;SAC1C,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/core/scaffold.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** Artifact templates installed into a consumer's `.amby/templates/` (referenced by the prompts). */
|
|
2
|
-
export declare const ARTIFACT_TEMPLATES: readonly ["constitution.md", "spec.md", "ui.md", "design-tokens.json", "plan.md", "tasks.md"];
|
|
2
|
+
export declare const ARTIFACT_TEMPLATES: readonly ["constitution.md", "spec.md", "ui.md", "design-tokens.json", "plan.md", "tasks.md", "tests.md", "adr.md"];
|
|
3
3
|
/** On-demand reference docs installed into a consumer's `.amby/reference/`. */
|
|
4
4
|
export declare const REFERENCE_DOCS: readonly ["design-conventions.md"];
|
|
5
5
|
/** Default role definitions installed into a consumer's `.amby/roles/` (feature 013, FR-001). */
|
|
6
|
-
export declare const SHIPPED_ROLES: readonly ["pm.md", "ux.md", "architect.md", "tech-lead.md", "developer.md", "qa.md"];
|
|
6
|
+
export declare const SHIPPED_ROLES: readonly ["pm.md", "ux.md", "architect.md", "tech-lead.md", "developer.md", "qa.md", "security.md"];
|
|
7
7
|
export interface InstallResult {
|
|
8
8
|
created: string[];
|
|
9
9
|
present: string[];
|