opencastle 1.3.0 → 1.4.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/README.md +102 -131
- package/bin/cli.mjs +20 -10
- package/dist/cli/adapters/claude-code.d.ts +5 -3
- package/dist/cli/adapters/claude-code.d.ts.map +1 -1
- package/dist/cli/adapters/claude-code.js +7 -3
- package/dist/cli/adapters/claude-code.js.map +1 -1
- package/dist/cli/adapters/single-file-base.d.ts +18 -0
- package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
- package/dist/cli/adapters/single-file-base.js +29 -4
- package/dist/cli/adapters/single-file-base.js.map +1 -1
- package/dist/cli/agent-plugin.test.js +12 -0
- package/dist/cli/agent-plugin.test.js.map +1 -1
- package/dist/cli/agent-roster.test.js +0 -48
- package/dist/cli/agent-roster.test.js.map +1 -1
- package/dist/cli/bootstrap.d.ts.map +1 -1
- package/dist/cli/bootstrap.js +20 -0
- package/dist/cli/bootstrap.js.map +1 -1
- package/dist/cli/boundary.test.js +9 -7
- package/dist/cli/boundary.test.js.map +1 -1
- package/dist/cli/ci.d.ts.map +1 -1
- package/dist/cli/ci.js +6 -4
- package/dist/cli/ci.js.map +1 -1
- package/dist/cli/command-namespace.test.js +33 -0
- package/dist/cli/command-namespace.test.js.map +1 -1
- package/dist/cli/convoy/artifacts.d.ts +9 -2
- package/dist/cli/convoy/artifacts.d.ts.map +1 -1
- package/dist/cli/convoy/artifacts.js +13 -10
- package/dist/cli/convoy/artifacts.js.map +1 -1
- package/dist/cli/convoy/artifacts.test.js +4 -2
- package/dist/cli/convoy/artifacts.test.js.map +1 -1
- package/dist/cli/convoy/engine.d.ts +53 -23
- package/dist/cli/convoy/engine.d.ts.map +1 -1
- package/dist/cli/convoy/engine.git.test.d.ts +2 -0
- package/dist/cli/convoy/engine.git.test.d.ts.map +1 -0
- package/dist/cli/convoy/engine.git.test.js +435 -0
- package/dist/cli/convoy/engine.git.test.js.map +1 -0
- package/dist/cli/convoy/engine.js +1746 -2305
- package/dist/cli/convoy/engine.js.map +1 -1
- package/dist/cli/convoy/engine.test.js +698 -678
- package/dist/cli/convoy/engine.test.js.map +1 -1
- package/dist/cli/convoy/event-schemas.d.ts +2 -0
- package/dist/cli/convoy/event-schemas.d.ts.map +1 -1
- package/dist/cli/convoy/event-schemas.js +59 -57
- package/dist/cli/convoy/event-schemas.js.map +1 -1
- package/dist/cli/convoy/events.d.ts +4 -1
- package/dist/cli/convoy/events.d.ts.map +1 -1
- package/dist/cli/convoy/events.js +69 -84
- package/dist/cli/convoy/events.js.map +1 -1
- package/dist/cli/convoy/events.test.js +50 -9
- package/dist/cli/convoy/events.test.js.map +1 -1
- package/dist/cli/convoy/gates.d.ts +9 -4
- package/dist/cli/convoy/gates.d.ts.map +1 -1
- package/dist/cli/convoy/gates.js +29 -14
- package/dist/cli/convoy/gates.js.map +1 -1
- package/dist/cli/convoy/isolation.d.ts +32 -6
- package/dist/cli/convoy/isolation.d.ts.map +1 -1
- package/dist/cli/convoy/isolation.js +72 -34
- package/dist/cli/convoy/isolation.js.map +1 -1
- package/dist/cli/convoy/isolation.test.js +66 -42
- package/dist/cli/convoy/isolation.test.js.map +1 -1
- package/dist/cli/convoy/lock.d.ts.map +1 -1
- package/dist/cli/convoy/lock.js +25 -10
- package/dist/cli/convoy/lock.js.map +1 -1
- package/dist/cli/convoy/lock.test.js +12 -0
- package/dist/cli/convoy/lock.test.js.map +1 -1
- package/dist/cli/convoy/merge.d.ts +21 -4
- package/dist/cli/convoy/merge.d.ts.map +1 -1
- package/dist/cli/convoy/merge.js +69 -53
- package/dist/cli/convoy/merge.js.map +1 -1
- package/dist/cli/convoy/merge.test.js +23 -1
- package/dist/cli/convoy/merge.test.js.map +1 -1
- package/dist/cli/convoy/progress.d.ts +35 -0
- package/dist/cli/convoy/progress.d.ts.map +1 -0
- package/dist/cli/convoy/progress.js +103 -0
- package/dist/cli/convoy/progress.js.map +1 -0
- package/dist/cli/convoy/progress.test.d.ts +2 -0
- package/dist/cli/convoy/progress.test.d.ts.map +1 -0
- package/dist/cli/convoy/progress.test.js +53 -0
- package/dist/cli/convoy/progress.test.js.map +1 -0
- package/dist/cli/convoy/read-model.d.ts +468 -0
- package/dist/cli/convoy/read-model.d.ts.map +1 -0
- package/dist/cli/convoy/read-model.js +1132 -0
- package/dist/cli/convoy/read-model.js.map +1 -0
- package/dist/cli/convoy/read-model.test.d.ts +2 -0
- package/dist/cli/convoy/read-model.test.d.ts.map +1 -0
- package/dist/cli/convoy/read-model.test.js +609 -0
- package/dist/cli/convoy/read-model.test.js.map +1 -0
- package/dist/cli/convoy/redact.d.ts +34 -0
- package/dist/cli/convoy/redact.d.ts.map +1 -0
- package/dist/cli/convoy/redact.js +66 -0
- package/dist/cli/convoy/redact.js.map +1 -0
- package/dist/cli/convoy/redact.test.d.ts +2 -0
- package/dist/cli/convoy/redact.test.d.ts.map +1 -0
- package/dist/cli/convoy/redact.test.js +43 -0
- package/dist/cli/convoy/redact.test.js.map +1 -0
- package/dist/cli/convoy/reviewer.d.ts +65 -0
- package/dist/cli/convoy/reviewer.d.ts.map +1 -0
- package/dist/cli/convoy/reviewer.js +141 -0
- package/dist/cli/convoy/reviewer.js.map +1 -0
- package/dist/cli/convoy/reviewer.test.d.ts +2 -0
- package/dist/cli/convoy/reviewer.test.d.ts.map +1 -0
- package/dist/cli/convoy/reviewer.test.js +96 -0
- package/dist/cli/convoy/reviewer.test.js.map +1 -0
- package/dist/cli/convoy/schedule.d.ts +30 -0
- package/dist/cli/convoy/schedule.d.ts.map +1 -0
- package/dist/cli/convoy/schedule.js +111 -0
- package/dist/cli/convoy/schedule.js.map +1 -0
- package/dist/cli/convoy/schedule.test.d.ts +2 -0
- package/dist/cli/convoy/schedule.test.d.ts.map +1 -0
- package/dist/cli/convoy/schedule.test.js +45 -0
- package/dist/cli/convoy/schedule.test.js.map +1 -0
- package/dist/cli/convoy/spec-builder.d.ts +120 -30
- package/dist/cli/convoy/spec-builder.d.ts.map +1 -1
- package/dist/cli/convoy/spec-builder.js +438 -114
- package/dist/cli/convoy/spec-builder.js.map +1 -1
- package/dist/cli/convoy/spec-builder.test.js +419 -435
- package/dist/cli/convoy/spec-builder.test.js.map +1 -1
- package/dist/cli/convoy/spec-types.d.ts +46 -92
- package/dist/cli/convoy/spec-types.d.ts.map +1 -1
- package/dist/cli/convoy/store.d.ts +6 -1
- package/dist/cli/convoy/store.d.ts.map +1 -1
- package/dist/cli/convoy/store.js +111 -15
- package/dist/cli/convoy/store.js.map +1 -1
- package/dist/cli/convoy/store.test.js +59 -13
- package/dist/cli/convoy/store.test.js.map +1 -1
- package/dist/cli/convoy/types.d.ts +76 -113
- package/dist/cli/convoy/types.d.ts.map +1 -1
- package/dist/cli/convoy/types.js +6 -13
- package/dist/cli/convoy/types.js.map +1 -1
- package/dist/cli/convoy/worktree.d.ts +88 -3
- package/dist/cli/convoy/worktree.d.ts.map +1 -1
- package/dist/cli/convoy/worktree.js +282 -56
- package/dist/cli/convoy/worktree.js.map +1 -1
- package/dist/cli/convoy/worktree.test.js +132 -1
- package/dist/cli/convoy/worktree.test.js.map +1 -1
- package/dist/cli/convoy-args.test.js +9 -27
- package/dist/cli/convoy-args.test.js.map +1 -1
- package/dist/cli/convoy-cmd.d.ts +31 -6
- package/dist/cli/convoy-cmd.d.ts.map +1 -1
- package/dist/cli/convoy-cmd.js +150 -200
- package/dist/cli/convoy-cmd.js.map +1 -1
- package/dist/cli/convoy-cmd.test.d.ts +2 -0
- package/dist/cli/convoy-cmd.test.d.ts.map +1 -0
- package/dist/cli/convoy-cmd.test.js +144 -0
- package/dist/cli/convoy-cmd.test.js.map +1 -0
- package/dist/cli/dashboard.d.ts +24 -11
- package/dist/cli/dashboard.d.ts.map +1 -1
- package/dist/cli/dashboard.js +241 -303
- package/dist/cli/dashboard.js.map +1 -1
- package/dist/cli/dashboard.test.d.ts +2 -0
- package/dist/cli/dashboard.test.d.ts.map +1 -0
- package/dist/cli/dashboard.test.js +340 -0
- package/dist/cli/dashboard.test.js.map +1 -0
- package/dist/cli/dispatcher.test.js +41 -2
- package/dist/cli/dispatcher.test.js.map +1 -1
- package/dist/cli/docs-accuracy.test.js +36 -11
- package/dist/cli/docs-accuracy.test.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +9 -6
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/init-own-files.test.d.ts +2 -0
- package/dist/cli/init-own-files.test.d.ts.map +1 -0
- package/dist/cli/init-own-files.test.js +133 -0
- package/dist/cli/init-own-files.test.js.map +1 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +106 -7
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/init.test.js +5 -4
- package/dist/cli/init.test.js.map +1 -1
- package/dist/cli/layers.d.ts.map +1 -1
- package/dist/cli/layers.js +13 -4
- package/dist/cli/layers.js.map +1 -1
- package/dist/cli/lesson.d.ts.map +1 -1
- package/dist/cli/lesson.js +6 -5
- package/dist/cli/lesson.js.map +1 -1
- package/dist/cli/log.d.ts +39 -0
- package/dist/cli/log.d.ts.map +1 -1
- package/dist/cli/log.js +267 -93
- package/dist/cli/log.js.map +1 -1
- package/dist/cli/log.test.d.ts +2 -0
- package/dist/cli/log.test.d.ts.map +1 -0
- package/dist/cli/log.test.js +208 -0
- package/dist/cli/log.test.js.map +1 -0
- package/dist/cli/nearest.d.ts +18 -0
- package/dist/cli/nearest.d.ts.map +1 -0
- package/dist/cli/nearest.js +38 -0
- package/dist/cli/nearest.js.map +1 -0
- package/dist/cli/nearest.test.d.ts +2 -0
- package/dist/cli/nearest.test.d.ts.map +1 -0
- package/dist/cli/nearest.test.js +24 -0
- package/dist/cli/nearest.test.js.map +1 -0
- package/dist/cli/pipeline.d.ts +61 -0
- package/dist/cli/pipeline.d.ts.map +1 -1
- package/dist/cli/pipeline.flow.test.d.ts +2 -0
- package/dist/cli/pipeline.flow.test.d.ts.map +1 -0
- package/dist/cli/pipeline.flow.test.js +524 -0
- package/dist/cli/pipeline.flow.test.js.map +1 -0
- package/dist/cli/pipeline.js +471 -690
- package/dist/cli/pipeline.js.map +1 -1
- package/dist/cli/plan.d.ts +82 -31
- package/dist/cli/plan.d.ts.map +1 -1
- package/dist/cli/plan.js +167 -507
- package/dist/cli/plan.js.map +1 -1
- package/dist/cli/plan.test.d.ts +2 -0
- package/dist/cli/plan.test.d.ts.map +1 -0
- package/dist/cli/plan.test.js +158 -0
- package/dist/cli/plan.test.js.map +1 -0
- package/dist/cli/prompt.d.ts.map +1 -1
- package/dist/cli/prompt.js +9 -7
- package/dist/cli/prompt.js.map +1 -1
- package/dist/cli/prompt.test.js +20 -2
- package/dist/cli/prompt.test.js.map +1 -1
- package/dist/cli/remove.d.ts.map +1 -1
- package/dist/cli/remove.js +3 -1
- package/dist/cli/remove.js.map +1 -1
- package/dist/cli/review.d.ts.map +1 -1
- package/dist/cli/review.js +7 -1
- package/dist/cli/review.js.map +1 -1
- package/dist/cli/run/adapters/agent-process.d.ts +82 -0
- package/dist/cli/run/adapters/agent-process.d.ts.map +1 -0
- package/dist/cli/run/adapters/agent-process.js +224 -0
- package/dist/cli/run/adapters/agent-process.js.map +1 -0
- package/dist/cli/run/adapters/agent-process.test.d.ts +2 -0
- package/dist/cli/run/adapters/agent-process.test.d.ts.map +1 -0
- package/dist/cli/run/adapters/agent-process.test.js +159 -0
- package/dist/cli/run/adapters/agent-process.test.js.map +1 -0
- package/dist/cli/run/adapters/claude.d.ts +53 -2
- package/dist/cli/run/adapters/claude.d.ts.map +1 -1
- package/dist/cli/run/adapters/claude.js +147 -171
- package/dist/cli/run/adapters/claude.js.map +1 -1
- package/dist/cli/run/adapters/claude.test.js +197 -254
- package/dist/cli/run/adapters/claude.test.js.map +1 -1
- package/dist/cli/run/adapters/codex.d.ts +25 -2
- package/dist/cli/run/adapters/codex.d.ts.map +1 -1
- package/dist/cli/run/adapters/codex.js +113 -81
- package/dist/cli/run/adapters/codex.js.map +1 -1
- package/dist/cli/run/adapters/codex.test.js +116 -95
- package/dist/cli/run/adapters/codex.test.js.map +1 -1
- package/dist/cli/run/adapters/copilot.d.ts +35 -1
- package/dist/cli/run/adapters/copilot.d.ts.map +1 -1
- package/dist/cli/run/adapters/copilot.js +104 -287
- package/dist/cli/run/adapters/copilot.js.map +1 -1
- package/dist/cli/run/adapters/copilot.test.js +122 -282
- package/dist/cli/run/adapters/copilot.test.js.map +1 -1
- package/dist/cli/run/adapters/cursor.d.ts +25 -7
- package/dist/cli/run/adapters/cursor.d.ts.map +1 -1
- package/dist/cli/run/adapters/cursor.js +103 -156
- package/dist/cli/run/adapters/cursor.js.map +1 -1
- package/dist/cli/run/adapters/cursor.test.js +106 -218
- package/dist/cli/run/adapters/cursor.test.js.map +1 -1
- package/dist/cli/run/adapters/index.d.ts +34 -5
- package/dist/cli/run/adapters/index.d.ts.map +1 -1
- package/dist/cli/run/adapters/index.js +147 -21
- package/dist/cli/run/adapters/index.js.map +1 -1
- package/dist/cli/run/adapters/index.test.d.ts +2 -0
- package/dist/cli/run/adapters/index.test.d.ts.map +1 -0
- package/dist/cli/run/adapters/index.test.js +129 -0
- package/dist/cli/run/adapters/index.test.js.map +1 -0
- package/dist/cli/run/adapters/opencode.d.ts +25 -9
- package/dist/cli/run/adapters/opencode.d.ts.map +1 -1
- package/dist/cli/run/adapters/opencode.js +136 -152
- package/dist/cli/run/adapters/opencode.js.map +1 -1
- package/dist/cli/run/adapters/opencode.test.js +99 -218
- package/dist/cli/run/adapters/opencode.test.js.map +1 -1
- package/dist/cli/run/adapters/permission-modes.d.ts +47 -4
- package/dist/cli/run/adapters/permission-modes.d.ts.map +1 -1
- package/dist/cli/run/adapters/permission-modes.js +113 -37
- package/dist/cli/run/adapters/permission-modes.js.map +1 -1
- package/dist/cli/run/adapters/permission-modes.test.js +55 -40
- package/dist/cli/run/adapters/permission-modes.test.js.map +1 -1
- package/dist/cli/run/adapters/stub-cli.test-helper.d.ts +22 -0
- package/dist/cli/run/adapters/stub-cli.test-helper.d.ts.map +1 -0
- package/dist/cli/run/adapters/stub-cli.test-helper.js +73 -0
- package/dist/cli/run/adapters/stub-cli.test-helper.js.map +1 -0
- package/dist/cli/run/platform.d.ts +52 -0
- package/dist/cli/run/platform.d.ts.map +1 -0
- package/dist/cli/run/platform.js +207 -0
- package/dist/cli/run/platform.js.map +1 -0
- package/dist/cli/run/platform.test.d.ts +2 -0
- package/dist/cli/run/platform.test.d.ts.map +1 -0
- package/dist/cli/run/platform.test.js +119 -0
- package/dist/cli/run/platform.test.js.map +1 -0
- package/dist/cli/run/schema.d.ts +6 -8
- package/dist/cli/run/schema.d.ts.map +1 -1
- package/dist/cli/run/schema.js +44 -68
- package/dist/cli/run/schema.js.map +1 -1
- package/dist/cli/run/schema.test.js +59 -279
- package/dist/cli/run/schema.test.js.map +1 -1
- package/dist/cli/run.d.ts +34 -56
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +379 -1132
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/run.test.d.ts +2 -0
- package/dist/cli/run.test.d.ts.map +1 -0
- package/dist/cli/run.test.js +318 -0
- package/dist/cli/run.test.js.map +1 -0
- package/dist/cli/sync-check.d.ts.map +1 -1
- package/dist/cli/sync-check.js +12 -3
- package/dist/cli/sync-check.js.map +1 -1
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +3 -2
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/team-config.d.ts.map +1 -1
- package/dist/cli/team-config.js +2 -21
- package/dist/cli/team-config.js.map +1 -1
- package/dist/cli/tiers.test.js +4 -13
- package/dist/cli/tiers.test.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +4 -3
- package/dist/cli/update.js.map +1 -1
- package/dist/cli/website-plugins.test.js +51 -2
- package/dist/cli/website-plugins.test.js.map +1 -1
- package/dist/orchestrator/plugins/coolify/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/coolify/config.js +13 -0
- package/dist/orchestrator/plugins/coolify/config.js.map +1 -1
- package/dist/orchestrator/plugins/sentry/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/sentry/config.js +13 -0
- package/dist/orchestrator/plugins/sentry/config.js.map +1 -1
- package/package.json +3 -10
- package/src/cli/adapters/claude-code.ts +7 -3
- package/src/cli/adapters/single-file-base.ts +47 -4
- package/src/cli/agent-plugin.test.ts +14 -0
- package/src/cli/agent-roster.test.ts +0 -55
- package/src/cli/bootstrap.ts +23 -0
- package/src/cli/boundary.test.ts +9 -7
- package/src/cli/ci.ts +6 -4
- package/src/cli/command-namespace.test.ts +35 -0
- package/src/cli/convoy/TELEMETRY.md +138 -130
- package/src/cli/convoy/artifacts.test.ts +4 -2
- package/src/cli/convoy/artifacts.ts +13 -12
- package/src/cli/convoy/engine.git.test.ts +462 -0
- package/src/cli/convoy/engine.test.ts +817 -850
- package/src/cli/convoy/engine.ts +1864 -2596
- package/src/cli/convoy/event-schemas.ts +63 -59
- package/src/cli/convoy/events.test.ts +58 -9
- package/src/cli/convoy/events.ts +69 -91
- package/src/cli/convoy/gates.ts +31 -12
- package/src/cli/convoy/isolation.test.ts +76 -43
- package/src/cli/convoy/isolation.ts +100 -38
- package/src/cli/convoy/lock.test.ts +16 -0
- package/src/cli/convoy/lock.ts +25 -8
- package/src/cli/convoy/merge.test.ts +25 -1
- package/src/cli/convoy/merge.ts +74 -61
- package/src/cli/convoy/progress.test.ts +59 -0
- package/src/cli/convoy/progress.ts +121 -0
- package/src/cli/convoy/read-model.test.ts +685 -0
- package/src/cli/convoy/read-model.ts +1469 -0
- package/src/cli/convoy/redact.test.ts +49 -0
- package/src/cli/convoy/redact.ts +73 -0
- package/src/cli/convoy/reviewer.test.ts +112 -0
- package/src/cli/convoy/reviewer.ts +196 -0
- package/src/cli/convoy/schedule.test.ts +56 -0
- package/src/cli/convoy/schedule.ts +109 -0
- package/src/cli/convoy/spec-builder.test.ts +460 -464
- package/src/cli/convoy/spec-builder.ts +460 -129
- package/src/cli/convoy/spec-types.ts +46 -108
- package/src/cli/convoy/store.test.ts +64 -13
- package/src/cli/convoy/store.ts +143 -33
- package/src/cli/convoy/types.ts +59 -71
- package/src/cli/convoy/worktree.test.ts +140 -1
- package/src/cli/convoy/worktree.ts +311 -61
- package/src/cli/convoy-args.test.ts +10 -30
- package/src/cli/convoy-cmd.test.ts +163 -0
- package/src/cli/convoy-cmd.ts +173 -215
- package/src/cli/dashboard/dashboard.css +2086 -0
- package/src/cli/dashboard/dashboard.js +1687 -0
- package/src/cli/dashboard/index.html +307 -0
- package/src/cli/dashboard.test.ts +382 -0
- package/src/cli/dashboard.ts +243 -339
- package/src/cli/dispatcher.test.ts +43 -2
- package/src/cli/docs-accuracy.test.ts +37 -10
- package/src/cli/doctor.ts +9 -6
- package/src/cli/init-own-files.test.ts +156 -0
- package/src/cli/init.test.ts +5 -4
- package/src/cli/init.ts +104 -7
- package/src/cli/layers.ts +13 -4
- package/src/cli/lesson.ts +6 -5
- package/src/cli/log.test.ts +228 -0
- package/src/cli/log.ts +302 -83
- package/src/cli/nearest.test.ts +27 -0
- package/src/cli/nearest.ts +38 -0
- package/src/cli/pipeline.flow.test.ts +607 -0
- package/src/cli/pipeline.ts +544 -759
- package/src/cli/plan.test.ts +193 -0
- package/src/cli/plan.ts +209 -545
- package/src/cli/prompt.test.ts +21 -2
- package/src/cli/prompt.ts +11 -7
- package/src/cli/remove.ts +3 -0
- package/src/cli/review.ts +7 -1
- package/src/cli/run/adapters/agent-process.test.ts +175 -0
- package/src/cli/run/adapters/agent-process.ts +252 -0
- package/src/cli/run/adapters/claude.test.ts +205 -260
- package/src/cli/run/adapters/claude.ts +151 -162
- package/src/cli/run/adapters/codex.test.ts +120 -100
- package/src/cli/run/adapters/codex.ts +115 -91
- package/src/cli/run/adapters/copilot.test.ts +135 -306
- package/src/cli/run/adapters/copilot.ts +105 -274
- package/src/cli/run/adapters/cursor.test.ts +111 -220
- package/src/cli/run/adapters/cursor.ts +105 -156
- package/src/cli/run/adapters/index.test.ts +148 -0
- package/src/cli/run/adapters/index.ts +168 -20
- package/src/cli/run/adapters/opencode.test.ts +106 -227
- package/src/cli/run/adapters/opencode.ts +139 -151
- package/src/cli/run/adapters/permission-modes.test.ts +63 -41
- package/src/cli/run/adapters/permission-modes.ts +118 -37
- package/src/cli/run/adapters/stub-cli.test-helper.ts +88 -0
- package/src/cli/run/platform.test.ts +128 -0
- package/src/cli/run/platform.ts +213 -0
- package/src/cli/run/schema.test.ts +62 -344
- package/src/cli/run/schema.ts +48 -78
- package/src/cli/run.test.ts +351 -0
- package/src/cli/run.ts +366 -1151
- package/src/cli/sync-check.ts +12 -3
- package/src/cli/sync.ts +3 -2
- package/src/cli/team-config.ts +2 -21
- package/src/cli/tiers.test.ts +4 -17
- package/src/cli/update.ts +4 -3
- package/src/cli/website-plugins.test.ts +55 -5
- package/src/orchestrator/agents/team-lead.agent.md +2 -2
- package/src/orchestrator/customizations/README.md +58 -13
- package/src/orchestrator/customizations/logs/README.md +23 -18
- package/src/orchestrator/instructions/general.instructions.md +1 -1
- package/src/orchestrator/plugins/coolify/config.ts +13 -0
- package/src/orchestrator/plugins/sentry/config.ts +13 -0
- package/src/orchestrator/prompts/assess-complexity.prompt.md +43 -26
- package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +44 -49
- package/src/orchestrator/prompts/brainstorm.prompt.md +2 -2
- package/src/orchestrator/prompts/bug-fix.prompt.md +5 -4
- package/src/orchestrator/prompts/create-skill.prompt.md +29 -39
- package/src/orchestrator/prompts/fix-convoy.prompt.md +43 -29
- package/src/orchestrator/prompts/fix-prd.prompt.md +26 -22
- package/src/orchestrator/prompts/generate-convoy.prompt.md +139 -147
- package/src/orchestrator/prompts/generate-prd.prompt.md +75 -68
- package/src/orchestrator/prompts/implement-feature.prompt.md +7 -6
- package/src/orchestrator/prompts/validate-convoy.prompt.md +29 -28
- package/src/orchestrator/prompts/validate-prd.prompt.md +28 -21
- package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +3 -3
- package/src/orchestrator/skills/agent-hooks/SKILL.md +1 -1
- package/src/orchestrator/skills/fast-review/SKILL.md +3 -1
- package/src/orchestrator/skills/orchestration-protocols/SKILL.md +7 -8
- package/dist/cli/convoy/dag-analysis.d.ts +0 -39
- package/dist/cli/convoy/dag-analysis.d.ts.map +0 -1
- package/dist/cli/convoy/dag-analysis.js +0 -279
- package/dist/cli/convoy/dag-analysis.js.map +0 -1
- package/dist/cli/convoy/dag-analysis.test.d.ts +0 -2
- package/dist/cli/convoy/dag-analysis.test.d.ts.map +0 -1
- package/dist/cli/convoy/dag-analysis.test.js +0 -289
- package/dist/cli/convoy/dag-analysis.test.js.map +0 -1
- package/dist/cli/convoy/formula.d.ts +0 -19
- package/dist/cli/convoy/formula.d.ts.map +0 -1
- package/dist/cli/convoy/formula.js +0 -142
- package/dist/cli/convoy/formula.js.map +0 -1
- package/dist/cli/convoy/formula.test.d.ts +0 -2
- package/dist/cli/convoy/formula.test.d.ts.map +0 -1
- package/dist/cli/convoy/formula.test.js +0 -342
- package/dist/cli/convoy/formula.test.js.map +0 -1
- package/dist/cli/convoy/health.d.ts +0 -34
- package/dist/cli/convoy/health.d.ts.map +0 -1
- package/dist/cli/convoy/health.js +0 -123
- package/dist/cli/convoy/health.js.map +0 -1
- package/dist/cli/convoy/health.test.d.ts +0 -2
- package/dist/cli/convoy/health.test.d.ts.map +0 -1
- package/dist/cli/convoy/health.test.js +0 -448
- package/dist/cli/convoy/health.test.js.map +0 -1
- package/dist/cli/convoy/last-run.d.ts +0 -53
- package/dist/cli/convoy/last-run.d.ts.map +0 -1
- package/dist/cli/convoy/last-run.js +0 -54
- package/dist/cli/convoy/last-run.js.map +0 -1
- package/dist/cli/convoy/last-run.test.d.ts +0 -2
- package/dist/cli/convoy/last-run.test.d.ts.map +0 -1
- package/dist/cli/convoy/last-run.test.js +0 -110
- package/dist/cli/convoy/last-run.test.js.map +0 -1
- package/dist/cli/convoy/pipeline.d.ts +0 -41
- package/dist/cli/convoy/pipeline.d.ts.map +0 -1
- package/dist/cli/convoy/pipeline.js +0 -414
- package/dist/cli/convoy/pipeline.js.map +0 -1
- package/dist/cli/convoy/pipeline.test.d.ts +0 -2
- package/dist/cli/convoy/pipeline.test.d.ts.map +0 -1
- package/dist/cli/convoy/pipeline.test.js +0 -837
- package/dist/cli/convoy/pipeline.test.js.map +0 -1
- package/dist/cli/convoy/review-stages.d.ts +0 -9
- package/dist/cli/convoy/review-stages.d.ts.map +0 -1
- package/dist/cli/convoy/review-stages.js +0 -134
- package/dist/cli/convoy/review-stages.js.map +0 -1
- package/dist/cli/convoy/review-stages.test.d.ts +0 -2
- package/dist/cli/convoy/review-stages.test.d.ts.map +0 -1
- package/dist/cli/convoy/review-stages.test.js +0 -197
- package/dist/cli/convoy/review-stages.test.js.map +0 -1
- package/dist/cli/run/executor.d.ts +0 -15
- package/dist/cli/run/executor.d.ts.map +0 -1
- package/dist/cli/run/executor.js +0 -249
- package/dist/cli/run/executor.js.map +0 -1
- package/dist/cli/run/executor.test.d.ts +0 -2
- package/dist/cli/run/executor.test.d.ts.map +0 -1
- package/dist/cli/run/executor.test.js +0 -297
- package/dist/cli/run/executor.test.js.map +0 -1
- package/dist/cli/run/reporter.d.ts +0 -10
- package/dist/cli/run/reporter.d.ts.map +0 -1
- package/dist/cli/run/reporter.js +0 -142
- package/dist/cli/run/reporter.js.map +0 -1
- package/dist/cli/run-dry-run.test.d.ts +0 -2
- package/dist/cli/run-dry-run.test.d.ts.map +0 -1
- package/dist/cli/run-dry-run.test.js +0 -83
- package/dist/cli/run-dry-run.test.js.map +0 -1
- package/dist/cli/run-executor-flags.test.d.ts +0 -2
- package/dist/cli/run-executor-flags.test.d.ts.map +0 -1
- package/dist/cli/run-executor-flags.test.js +0 -31
- package/dist/cli/run-executor-flags.test.js.map +0 -1
- package/dist/cli/run-finish.test.d.ts +0 -2
- package/dist/cli/run-finish.test.d.ts.map +0 -1
- package/dist/cli/run-finish.test.js +0 -77
- package/dist/cli/run-finish.test.js.map +0 -1
- package/dist/cli/watch.d.ts +0 -15
- package/dist/cli/watch.d.ts.map +0 -1
- package/dist/cli/watch.js +0 -277
- package/dist/cli/watch.js.map +0 -1
- package/dist/dashboard/scripts/etl.d.ts +0 -10
- package/dist/dashboard/scripts/etl.d.ts.map +0 -1
- package/dist/dashboard/scripts/etl.js +0 -141
- package/dist/dashboard/scripts/etl.js.map +0 -1
- package/src/cli/convoy/dag-analysis.test.ts +0 -349
- package/src/cli/convoy/dag-analysis.ts +0 -367
- package/src/cli/convoy/formula.test.ts +0 -404
- package/src/cli/convoy/formula.ts +0 -174
- package/src/cli/convoy/health.test.ts +0 -519
- package/src/cli/convoy/health.ts +0 -189
- package/src/cli/convoy/last-run.test.ts +0 -130
- package/src/cli/convoy/last-run.ts +0 -87
- package/src/cli/convoy/pipeline.test.ts +0 -999
- package/src/cli/convoy/pipeline.ts +0 -492
- package/src/cli/convoy/review-stages.test.ts +0 -235
- package/src/cli/convoy/review-stages.ts +0 -166
- package/src/cli/run/executor.test.ts +0 -338
- package/src/cli/run/executor.ts +0 -292
- package/src/cli/run/reporter.ts +0 -160
- package/src/cli/run-dry-run.test.ts +0 -97
- package/src/cli/run-executor-flags.test.ts +0 -38
- package/src/cli/run-finish.test.ts +0 -91
- package/src/cli/watch.ts +0 -295
- package/src/dashboard/astro.config.mjs +0 -6
- package/src/dashboard/dist/_astro/index.CADNhRPS.css +0 -1
- package/src/dashboard/dist/data/.gitkeep +0 -0
- package/src/dashboard/dist/data/convoy-list.json +0 -1
- package/src/dashboard/dist/data/overall-stats.json +0 -29
- package/src/dashboard/dist/index.html +0 -1963
- package/src/dashboard/node_modules/.vite/deps/_metadata.json +0 -31
- package/src/dashboard/node_modules/.vite/deps/astro___aria-query.js +0 -6776
- package/src/dashboard/node_modules/.vite/deps/astro___aria-query.js.map +0 -7
- package/src/dashboard/node_modules/.vite/deps/astro___axobject-query.js +0 -3754
- package/src/dashboard/node_modules/.vite/deps/astro___axobject-query.js.map +0 -7
- package/src/dashboard/node_modules/.vite/deps/astro___cssesc.js +0 -99
- package/src/dashboard/node_modules/.vite/deps/astro___cssesc.js.map +0 -7
- package/src/dashboard/node_modules/.vite/deps/chunk-BUSYA2B4.js +0 -8
- package/src/dashboard/node_modules/.vite/deps/chunk-BUSYA2B4.js.map +0 -7
- package/src/dashboard/node_modules/.vite/deps/package.json +0 -3
- package/src/dashboard/package-lock.json +0 -6
- package/src/dashboard/public/data/.gitkeep +0 -0
- package/src/dashboard/public/data/convoy-list.json +0 -1
- package/src/dashboard/public/data/overall-stats.json +0 -29
- package/src/dashboard/public/icon-192.png +0 -0
- package/src/dashboard/scripts/etl.test.ts +0 -166
- package/src/dashboard/scripts/etl.ts +0 -170
- package/src/dashboard/scripts/generate-demo-db.test.ts +0 -30
- package/src/dashboard/scripts/generate-demo-db.ts +0 -529
- package/src/dashboard/scripts/integration-test.ts +0 -504
- package/src/dashboard/scripts/verify-demo-data.sh +0 -51
- package/src/dashboard/seed-data/delegations.ndjson +0 -35
- package/src/dashboard/seed-data/events.ndjson +0 -104
- package/src/dashboard/seed-data/panels.ndjson +0 -13
- package/src/dashboard/seed-data/reviews.ndjson +0 -6
- package/src/dashboard/seed-data/sessions.ndjson +0 -50
- package/src/dashboard/src/env.d.ts +0 -1
- package/src/dashboard/src/layouts/Layout.astro +0 -25
- package/src/dashboard/src/pages/index.astro +0 -2313
- package/src/dashboard/src/styles/dashboard.css +0 -2943
- package/src/dashboard/tsconfig.json +0 -6
- /package/src/{dashboard/dist → cli/dashboard}/icon-192.png +0 -0
|
@@ -1,60 +1,93 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
buildSharedContext,
|
|
4
|
+
buildTaskSection,
|
|
5
|
+
composePrompt,
|
|
6
|
+
summarizeTask,
|
|
4
7
|
formatDependencyResults,
|
|
5
8
|
detectPartitionViolations,
|
|
6
9
|
type DependencyResult,
|
|
10
|
+
type PlanEntry,
|
|
7
11
|
} from './isolation.js'
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
expect(
|
|
22
|
-
expect(result).toContain('Implement the auth service')
|
|
23
|
-
expect(result).toContain('src/auth/')
|
|
24
|
-
expect(result).toContain('src/services/auth.ts')
|
|
25
|
-
expect(result).toContain('No dependencies')
|
|
26
|
-
expect(result).toContain('first phase')
|
|
13
|
+
const plan: PlanEntry[] = [
|
|
14
|
+
{ id: 'api', agent: 'developer', summary: 'Build the API', files: ['src/api/'], depends_on: [] },
|
|
15
|
+
{ id: 'tests', agent: 'testing-expert', summary: 'Test the API', files: ['test/api.test.ts'], depends_on: ['api'] },
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
describe('buildSharedContext', () => {
|
|
19
|
+
const shared = buildSharedContext({ convoyName: 'Auth', plan, artifactsDir: '/repo/.opencastle/artifacts/c1/' })
|
|
20
|
+
|
|
21
|
+
it('tells workers to leave .opencastle/ alone, though the project instructions ask them to write there', () => {
|
|
22
|
+
// A real worker recorded an issue in KNOWN-ISSUES.md, as the compiled
|
|
23
|
+
// CLAUDE.md asks; review blocked it as a change outside the task, and the
|
|
24
|
+
// task ran twice.
|
|
25
|
+
expect(shared).toMatch(/do not edit anything under `\.opencastle\/`/)
|
|
27
26
|
})
|
|
28
27
|
|
|
29
|
-
it('
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
expect(
|
|
37
|
-
expect(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
it('lists the whole plan with dependencies and files', () => {
|
|
29
|
+
expect(shared).toContain('# Convoy: Auth')
|
|
30
|
+
expect(shared).toContain('- api [developer]: Build the API — files: src/api/')
|
|
31
|
+
expect(shared).toContain('- tests [testing-expert] (after api): Test the API — files: test/api.test.ts')
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
it('states the file rule once, and names no runtime-specific path', () => {
|
|
35
|
+
expect(shared.match(/Change only the files/g)).toHaveLength(1)
|
|
36
|
+
expect(shared).not.toContain('.github/instructions')
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('is the same text for every task, so a prompt cache can serve it', () => {
|
|
40
|
+
const a = composePrompt(shared, buildTaskSection({ id: 'api', agent: 'developer', files: ['src/api/'], prompt: 'Build it' }))
|
|
41
|
+
const b = composePrompt(shared, buildTaskSection({ id: 'tests', agent: 'testing-expert', files: [], prompt: 'Test it' }))
|
|
42
|
+
expect(a.startsWith(shared)).toBe(true)
|
|
43
|
+
expect(b.startsWith(shared)).toBe(true)
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
describe('buildTaskSection', () => {
|
|
48
|
+
it('puts the task prompt in once, with no copied "Objective"', () => {
|
|
49
|
+
const prompt = 'Please implement the auth service with JWT tokens'
|
|
50
|
+
const section = buildTaskSection({ id: 'task-1', agent: 'developer', files: ['src/auth/'], prompt })
|
|
51
|
+
expect(section).toContain('## Your task: task-1')
|
|
52
|
+
expect(section).toContain('You are the developer agent for this task.')
|
|
53
|
+
expect(section).toContain('Files you may change: src/auth/')
|
|
54
|
+
expect(section.split(prompt)).toHaveLength(2)
|
|
55
|
+
expect(section).not.toContain('Objective')
|
|
41
56
|
})
|
|
42
57
|
|
|
43
|
-
it('
|
|
44
|
-
const
|
|
45
|
-
{ taskId: 'task-
|
|
58
|
+
it('adds dependency results, earlier work, the retry note and the contract only when present', () => {
|
|
59
|
+
const deps: DependencyResult[] = [
|
|
60
|
+
{ taskId: 'task-0', agent: 'architect', status: 'done', summary: 'Designed the auth schema', filesChanged: ['schema.ts'] },
|
|
46
61
|
]
|
|
47
|
-
const
|
|
48
|
-
expect(
|
|
49
|
-
expect(
|
|
62
|
+
const bare = buildTaskSection({ id: 't', agent: 'developer', files: [], prompt: 'Do it' })
|
|
63
|
+
expect(bare).toContain('Files: not limited to a list')
|
|
64
|
+
expect(bare).not.toContain('previous attempt')
|
|
65
|
+
|
|
66
|
+
const full = buildTaskSection({
|
|
67
|
+
id: 't',
|
|
68
|
+
agent: 'developer',
|
|
69
|
+
files: [],
|
|
70
|
+
prompt: 'Do it',
|
|
71
|
+
dependencyResults: deps,
|
|
72
|
+
previousWork: ['Last time I did X'],
|
|
73
|
+
retryNote: 'The gate `npm test` failed',
|
|
74
|
+
contract: '## Output Contract (REQUIRED)',
|
|
75
|
+
})
|
|
76
|
+
expect(full).toContain('Designed the auth schema')
|
|
77
|
+
expect(full).toContain('Last time I did X')
|
|
78
|
+
expect(full).toContain('### Your previous attempt\nThe gate `npm test` failed')
|
|
79
|
+
// The task's own prompt survives a retry: the note is added, not swapped in.
|
|
80
|
+
expect(full).toContain('### Instructions\nDo it')
|
|
81
|
+
expect(full.indexOf('### Instructions')).toBeLessThan(full.indexOf('### Your previous attempt'))
|
|
82
|
+
expect(full.trim().endsWith('## Output Contract (REQUIRED)')).toBe(true)
|
|
50
83
|
})
|
|
84
|
+
})
|
|
51
85
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
expect(
|
|
57
|
-
expect(result).not.toContain('A'.repeat(201))
|
|
86
|
+
describe('summarizeTask', () => {
|
|
87
|
+
it('prefers a real description, else the first line of the prompt, trimmed', () => {
|
|
88
|
+
expect(summarizeTask({ id: 'a', description: 'Write docs', prompt: 'x' })).toBe('Write docs')
|
|
89
|
+
expect(summarizeTask({ id: 'a', description: 'a', prompt: '\nFirst line\nsecond' })).toBe('First line')
|
|
90
|
+
expect(summarizeTask({ id: 'a', prompt: 'A'.repeat(300) }).length).toBe(100)
|
|
58
91
|
})
|
|
59
92
|
})
|
|
60
93
|
|
|
@@ -20,18 +20,114 @@ export interface PartitionViolation {
|
|
|
20
20
|
violations: string[]
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/** One line of the run summary every task sees. */
|
|
24
|
+
export interface PlanEntry {
|
|
25
|
+
id: string
|
|
26
|
+
agent: string
|
|
27
|
+
summary: string
|
|
28
|
+
files: string[]
|
|
29
|
+
depends_on: string[]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ── Prompt layout ─────────────────────────────────────────────────────────────
|
|
33
|
+
//
|
|
34
|
+
// Every task's prompt is the shared context followed by the task's own part.
|
|
35
|
+
// The shared context is byte-identical for every task of a run, so a runtime
|
|
36
|
+
// with a prompt cache reads it once and serves it to the rest at a tenth of
|
|
37
|
+
// the price; anything that differs per task comes after it.
|
|
38
|
+
//
|
|
39
|
+
// The old preamble opened with the task's id, repeated the first 200
|
|
40
|
+
// characters of the prompt as an "Objective" (on a retry, the retry banner),
|
|
41
|
+
// stated the file rule a second time after the adapter had, and sent every
|
|
42
|
+
// runtime to `.github/instructions/`, a path only Copilot uses.
|
|
43
|
+
|
|
44
|
+
const SUMMARY_MAX = 100
|
|
45
|
+
|
|
46
|
+
/** A one-line summary of a task for the run summary. */
|
|
47
|
+
export function summarizeTask(task: { id: string; description?: string; prompt: string }): string {
|
|
48
|
+
const source = task.description && task.description !== task.id ? task.description : task.prompt
|
|
49
|
+
const line = source.split('\n').map((l) => l.trim()).find(Boolean) ?? ''
|
|
50
|
+
return line.length > SUMMARY_MAX ? line.slice(0, SUMMARY_MAX - 1) + '…' : line
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** The part of the prompt every task in a run shares, word for word. */
|
|
54
|
+
export function buildSharedContext(opts: {
|
|
55
|
+
convoyName: string
|
|
56
|
+
plan: PlanEntry[]
|
|
57
|
+
artifactsDir: string
|
|
58
|
+
}): string {
|
|
59
|
+
const plan = opts.plan.map((t) => {
|
|
60
|
+
const after = t.depends_on.length > 0 ? ` (after ${t.depends_on.join(', ')})` : ''
|
|
61
|
+
const files = t.files.length > 0 ? ` — files: ${t.files.join(', ')}` : ''
|
|
62
|
+
return `- ${t.id} [${t.agent}]${after}: ${t.summary}${files}`
|
|
63
|
+
})
|
|
64
|
+
return [
|
|
65
|
+
`# Convoy: ${opts.convoyName}`,
|
|
66
|
+
'',
|
|
67
|
+
'You are one of several agents working on this project at the same time. Each works on one task, in its own git worktree; the convoy merges each finished task into the convoy branch.',
|
|
68
|
+
'',
|
|
69
|
+
'## The plan',
|
|
70
|
+
...plan,
|
|
71
|
+
'',
|
|
72
|
+
'## Rules',
|
|
73
|
+
'- Do your task and nothing else. Change only the files your task lists; if it needs a change elsewhere, say so in your answer instead of making it.',
|
|
74
|
+
'- Leave committing to the convoy. It commits your work when you finish.',
|
|
75
|
+
"- Follow the project's own conventions and instruction files, with one exception: do not edit anything under `.opencastle/` (KNOWN-ISSUES.md, LESSONS-LEARNED.md, logs) even where those instructions ask you to. Several agents run at once, and each such edit is a change outside your task that review sends back. Put an issue or a lesson you found in your answer instead.",
|
|
76
|
+
`- For long output (a report, a data dump), write it to a file under ${opts.artifactsDir}<your task id>/ and mention it in your answer as \`[ARTIFACT: <file name>] <one-line summary>\`.`,
|
|
77
|
+
].join('\n')
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** The part of the prompt that is this task's alone. */
|
|
81
|
+
export function buildTaskSection(opts: {
|
|
82
|
+
id: string
|
|
83
|
+
agent: string
|
|
84
|
+
files: string[]
|
|
85
|
+
prompt: string
|
|
86
|
+
dependencyResults?: DependencyResult[]
|
|
87
|
+
previousWork?: string[]
|
|
88
|
+
retryNote?: string | null
|
|
89
|
+
contract?: string | null
|
|
90
|
+
}): string {
|
|
91
|
+
// The role and the file list are stated here and nowhere else: the adapters
|
|
92
|
+
// no longer add "You are a <agent>" or "Only modify files under".
|
|
93
|
+
const parts: string[] = [
|
|
94
|
+
`## Your task: ${opts.id}`,
|
|
95
|
+
`You are the ${opts.agent} agent for this task.`,
|
|
96
|
+
opts.files.length > 0 ? `Files you may change: ${opts.files.join(', ')}` : 'Files: not limited to a list',
|
|
97
|
+
]
|
|
98
|
+
if (opts.dependencyResults && opts.dependencyResults.length > 0) {
|
|
99
|
+
parts.push('', '### What the tasks before you produced', formatDependencyResults(opts.dependencyResults))
|
|
100
|
+
}
|
|
101
|
+
if (opts.previousWork && opts.previousWork.length > 0) {
|
|
102
|
+
parts.push('', `### Earlier work by ${opts.agent}`, opts.previousWork.join('\n\n'))
|
|
103
|
+
}
|
|
104
|
+
parts.push('', '### Instructions', opts.prompt.trim())
|
|
105
|
+
if (opts.retryNote) {
|
|
106
|
+
parts.push('', '### Your previous attempt', opts.retryNote.trim())
|
|
107
|
+
}
|
|
108
|
+
if (opts.contract) {
|
|
109
|
+
parts.push('', opts.contract)
|
|
110
|
+
}
|
|
111
|
+
return parts.join('\n')
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Shared context first, the task's part last. */
|
|
115
|
+
export function composePrompt(shared: string, taskSection: string): string {
|
|
116
|
+
return `${shared}\n\n---\n\n${taskSection}\n`
|
|
117
|
+
}
|
|
118
|
+
|
|
23
119
|
// ── Formatting ────────────────────────────────────────────────────────────────
|
|
24
120
|
|
|
25
121
|
export function formatDependencyResults(deps: DependencyResult[]): string {
|
|
26
122
|
return deps
|
|
27
123
|
.map(dep => {
|
|
28
|
-
let text = '#### ' + dep.taskId + ' (' + dep.agent + ')
|
|
124
|
+
let text = '#### ' + dep.taskId + ' (' + dep.agent + ') — ' + dep.status + '\n'
|
|
29
125
|
+ (dep.summary ?? 'No summary available.') + '\n'
|
|
30
126
|
+ 'Files changed: ' + (dep.filesChanged.length > 0 ? dep.filesChanged.join(', ') : 'none')
|
|
31
127
|
|
|
32
128
|
if (dep.artifactRefs && dep.artifactRefs.length > 0) {
|
|
33
129
|
text += '\nArtifacts available:\n'
|
|
34
|
-
+ dep.artifactRefs.map(r => '- ' + r.path + '
|
|
130
|
+
+ dep.artifactRefs.map(r => '- ' + r.path + ' — "' + r.summary + '"').join('\n')
|
|
35
131
|
+ '\n\nTo read an artifact, open the file at the path above.'
|
|
36
132
|
}
|
|
37
133
|
|
|
@@ -40,41 +136,6 @@ export function formatDependencyResults(deps: DependencyResult[]): string {
|
|
|
40
136
|
.join('\n\n')
|
|
41
137
|
}
|
|
42
138
|
|
|
43
|
-
export function buildIsolationPreamble(
|
|
44
|
-
task: { id: string; description: string; prompt: string; files: string[]; agent: string },
|
|
45
|
-
dependencyResults: DependencyResult[],
|
|
46
|
-
): string {
|
|
47
|
-
const objective = task.description || task.prompt.slice(0, 200)
|
|
48
|
-
const fileList = task.files.length > 0 ? task.files.map(f => '- ' + f).join('\n') : '- (none specified)'
|
|
49
|
-
const depSection = dependencyResults.length > 0
|
|
50
|
-
? formatDependencyResults(dependencyResults)
|
|
51
|
-
: 'No dependencies \u2014 you are in the first phase.'
|
|
52
|
-
|
|
53
|
-
return [
|
|
54
|
-
'## Context Isolation Notice',
|
|
55
|
-
'You are a fresh agent with NO prior context. You have no knowledge of other tasks',
|
|
56
|
-
'in this convoy. Your only context is what follows.',
|
|
57
|
-
'',
|
|
58
|
-
'### Your Task',
|
|
59
|
-
'- **ID:** ' + task.id,
|
|
60
|
-
'- **Agent:** ' + task.agent,
|
|
61
|
-
'- **Objective:** ' + objective,
|
|
62
|
-
'',
|
|
63
|
-
'### Your File Partition',
|
|
64
|
-
'You may ONLY read and modify files within this partition:',
|
|
65
|
-
fileList,
|
|
66
|
-
'',
|
|
67
|
-
'Do NOT modify files outside this partition. If you discover a need to change files',
|
|
68
|
-
'outside your partition, note it in your output but do not make the change.',
|
|
69
|
-
'',
|
|
70
|
-
'### Dependency Results',
|
|
71
|
-
depSection,
|
|
72
|
-
'',
|
|
73
|
-
'### Project Conventions',
|
|
74
|
-
'Read `.github/instructions/general.instructions.md` for coding standards.',
|
|
75
|
-
].join('\n')
|
|
76
|
-
}
|
|
77
|
-
|
|
78
139
|
// ── Partition violation detection ─────────────────────────────────────────────
|
|
79
140
|
|
|
80
141
|
export function detectPartitionViolations(
|
|
@@ -119,6 +180,7 @@ export function resolveDependencyResults(
|
|
|
119
180
|
store: ConvoyStore,
|
|
120
181
|
convoyId: string,
|
|
121
182
|
dependsOn: string[],
|
|
183
|
+
basePath?: string,
|
|
122
184
|
): DependencyResult[] {
|
|
123
185
|
return dependsOn
|
|
124
186
|
.map((depId) => {
|
|
@@ -148,7 +210,7 @@ export function resolveDependencyResults(
|
|
|
148
210
|
|
|
149
211
|
let artifactRefs: ArtifactRef[] | undefined
|
|
150
212
|
try {
|
|
151
|
-
const refs = listArtifacts(convoyId, depId)
|
|
213
|
+
const refs = listArtifacts(convoyId, depId, basePath)
|
|
152
214
|
if (refs.length > 0) artifactRefs = refs
|
|
153
215
|
} catch { /* non-critical */ }
|
|
154
216
|
|
|
@@ -61,6 +61,22 @@ describe('engine lock', () => {
|
|
|
61
61
|
lock.release()
|
|
62
62
|
})
|
|
63
63
|
|
|
64
|
+
it('takes over at once when the owner died on this host, however fresh its heartbeat', () => {
|
|
65
|
+
// A run killed with Ctrl+C leaves a heartbeat a second old. Waiting 30 s for
|
|
66
|
+
// it to expire is what made an immediate `convoy resume` refuse to start.
|
|
67
|
+
const now = new Date().toISOString()
|
|
68
|
+
const deadPid = 999999
|
|
69
|
+
expect(() => process.kill(deadPid, 0)).toThrow()
|
|
70
|
+
db.prepare(
|
|
71
|
+
'INSERT INTO engine_lock (id, pid, hostname, started_at, last_heartbeat) VALUES (1, ?, ?, ?, ?)',
|
|
72
|
+
).run(deadPid, hostname(), now, now)
|
|
73
|
+
|
|
74
|
+
const lock = acquireEngineLock(db, dbPath)
|
|
75
|
+
const row = db.prepare('SELECT pid FROM engine_lock WHERE id = 1').get() as { pid: number }
|
|
76
|
+
expect(row.pid).toBe(process.pid)
|
|
77
|
+
lock.release()
|
|
78
|
+
})
|
|
79
|
+
|
|
64
80
|
it('throws EngineAlreadyRunningError when lock is held by a live process', () => {
|
|
65
81
|
const now = new Date().toISOString()
|
|
66
82
|
db.prepare(
|
package/src/cli/convoy/lock.ts
CHANGED
|
@@ -12,16 +12,33 @@ export class EngineAlreadyRunningError extends Error {
|
|
|
12
12
|
|
|
13
13
|
type LockRow = { pid: number; hostname: string; last_heartbeat: string }
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (heartbeatAge <= 30_000) return false
|
|
18
|
-
if (row.hostname !== getHostname()) return true
|
|
15
|
+
/** False only when the process is certainly gone (ESRCH); EPERM means it exists. */
|
|
16
|
+
function pidAlive(pid: number): boolean {
|
|
19
17
|
try {
|
|
20
|
-
process.kill(
|
|
21
|
-
return
|
|
22
|
-
} catch {
|
|
23
|
-
return
|
|
18
|
+
process.kill(pid, 0)
|
|
19
|
+
return true
|
|
20
|
+
} catch (err) {
|
|
21
|
+
return (err as NodeJS.ErrnoException).code === 'EPERM'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Whether a lock row may be taken over.
|
|
27
|
+
*
|
|
28
|
+
* On this host the pid answers the question outright: a dead owner is stale
|
|
29
|
+
* at once. It used to count as live until its heartbeat was 30 s old, so a run
|
|
30
|
+
* killed with Ctrl+C could not be resumed straight away — `resume` said
|
|
31
|
+
* "another opencastle process is already running" about a process that no
|
|
32
|
+
* longer existed. Another host's pid means nothing here, so only the heartbeat
|
|
33
|
+
* can tell.
|
|
34
|
+
*/
|
|
35
|
+
function checkStaleness(row: LockRow): boolean {
|
|
36
|
+
if (row.hostname === getHostname()) {
|
|
37
|
+
if (row.pid === process.pid) return false
|
|
38
|
+
return !pidAlive(row.pid)
|
|
24
39
|
}
|
|
40
|
+
const heartbeatAge = Date.now() - new Date(row.last_heartbeat).getTime()
|
|
41
|
+
return heartbeatAge > 30_000
|
|
25
42
|
}
|
|
26
43
|
|
|
27
44
|
export function isLockStale(db: DatabaseSync): boolean {
|
|
@@ -43,7 +43,7 @@ beforeEach(async () => {
|
|
|
43
43
|
})
|
|
44
44
|
|
|
45
45
|
afterEach(() => {
|
|
46
|
-
rmSync(repoPath, { recursive: true, force: true })
|
|
46
|
+
rmSync(repoPath, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 })
|
|
47
47
|
})
|
|
48
48
|
|
|
49
49
|
// ── successful merge ──────────────────────────────────────────────────────────
|
|
@@ -181,3 +181,27 @@ describe('merge - error handling', () => {
|
|
|
181
181
|
).rejects.toThrow(/outside the managed worktrees directory/)
|
|
182
182
|
})
|
|
183
183
|
})
|
|
184
|
+
|
|
185
|
+
// ── one merge at a time ───────────────────────────────────────────────────────
|
|
186
|
+
|
|
187
|
+
describe('merge - concurrency', () => {
|
|
188
|
+
it('lands every one of eight merges started at once', async () => {
|
|
189
|
+
// Without the mutex, concurrent merges fought over index.lock and HEAD.
|
|
190
|
+
const paths: string[] = []
|
|
191
|
+
for (let i = 0; i < 8; i++) {
|
|
192
|
+
const p = await addWorktree(repoPath, `w${i}`, featureBranch)
|
|
193
|
+
writeFileSync(join(p, `f${i}.txt`), `${i}`)
|
|
194
|
+
paths.push(p)
|
|
195
|
+
}
|
|
196
|
+
const results = await Promise.all(paths.map((p, i) => queue.merge(p, `convoy-w${i}`, featureBranch)))
|
|
197
|
+
expect(results.every(r => r.success)).toBe(true)
|
|
198
|
+
const { stdout } = await execFile('git', ['-C', repoPath, 'ls-tree', '--name-only', featureBranch])
|
|
199
|
+
for (let i = 0; i < 8; i++) expect(stdout).toContain(`f${i}.txt`)
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
it('throws MergeError, not a success, when the merge fails for another reason', async () => {
|
|
203
|
+
const { MergeError } = await import('./merge.js')
|
|
204
|
+
const worktreePath = await addWorktree(repoPath, 'worker1', featureBranch)
|
|
205
|
+
await expect(queue.merge(worktreePath, 'no-such-branch', featureBranch)).rejects.toBeInstanceOf(MergeError)
|
|
206
|
+
})
|
|
207
|
+
})
|
package/src/cli/convoy/merge.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { promisify } from 'node:util'
|
|
4
|
-
|
|
5
|
-
const execFile = promisify(execFileCb)
|
|
1
|
+
import { join, resolve } from 'node:path'
|
|
2
|
+
import { commitAllIn, git, isInside, mergeIn } from './worktree.js'
|
|
6
3
|
|
|
7
4
|
export interface MergeResult {
|
|
8
5
|
success: boolean
|
|
@@ -20,88 +17,104 @@ export class MergeConflictError extends Error {
|
|
|
20
17
|
}
|
|
21
18
|
}
|
|
22
19
|
|
|
20
|
+
/** Any merge that did not land for a reason other than a conflict. */
|
|
21
|
+
export class MergeError extends Error {
|
|
22
|
+
constructor(message: string) {
|
|
23
|
+
super(message)
|
|
24
|
+
this.name = 'MergeError'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
export interface MergeQueue {
|
|
24
29
|
/**
|
|
25
|
-
* Merge a
|
|
26
|
-
*
|
|
27
|
-
*
|
|
30
|
+
* Merge a worker's branch into the target branch, one merge at a time.
|
|
31
|
+
* Commits anything the worker left uncommitted first. Throws
|
|
32
|
+
* `MergeConflictError` on a conflict and `MergeError` on anything else —
|
|
33
|
+
* a merge that did not land is never reported as one that did.
|
|
28
34
|
*/
|
|
29
35
|
merge(worktreePath: string, worktreeBranch: string, targetBranch: string): Promise<MergeResult>
|
|
30
36
|
}
|
|
31
37
|
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
/** A promise chain: each merge waits for the previous one to settle. */
|
|
39
|
+
function createMutex(): <T>(fn: () => Promise<T>) => Promise<T> {
|
|
40
|
+
let tail: Promise<unknown> = Promise.resolve()
|
|
41
|
+
return <T>(fn: () => Promise<T>) => {
|
|
42
|
+
const run = tail.then(fn, fn)
|
|
43
|
+
tail = run.catch(() => undefined)
|
|
44
|
+
return run
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function firstLine(text: string | undefined): string {
|
|
49
|
+
return (text ?? '').split('\n').map((l) => l.trim()).find(Boolean) ?? ''
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Merges happen in `targetWorktree` — the convoy's own checkout of its branch —
|
|
54
|
+
* never in the user's checkout.
|
|
55
|
+
*
|
|
56
|
+
* The old queue ran `git checkout <target>` and `git merge` in the main
|
|
57
|
+
* repository with no lock. Eight tasks merging at once fought over
|
|
58
|
+
* `index.lock` and `HEAD`; the losers were logged only with `--verbose`,
|
|
59
|
+
* reported as merged, and their branches deleted. A dirty file in the user's
|
|
60
|
+
* tree did the same to a single task.
|
|
61
|
+
*/
|
|
62
|
+
export function createMergeQueue(
|
|
63
|
+
targetWorktree: string,
|
|
64
|
+
opts: { worktreesDir?: string } = {},
|
|
65
|
+
): MergeQueue {
|
|
66
|
+
const target = resolve(targetWorktree)
|
|
67
|
+
const worktreesDir = resolve(opts.worktreesDir ?? join(target, '.opencastle', 'worktrees'))
|
|
68
|
+
const serialize = createMutex()
|
|
34
69
|
|
|
35
|
-
async function
|
|
70
|
+
async function mergeOnce(
|
|
36
71
|
worktreePath: string,
|
|
37
72
|
worktreeBranch: string,
|
|
38
73
|
targetBranch: string,
|
|
39
74
|
): Promise<MergeResult> {
|
|
40
|
-
|
|
41
|
-
if (!resolvedWorktree.startsWith(worktreesDir + sep)) {
|
|
75
|
+
if (!isInside(worktreesDir, worktreePath)) {
|
|
42
76
|
throw new Error(`Path "${worktreePath}" is outside the managed worktrees directory`)
|
|
43
77
|
}
|
|
44
78
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// Uses --name-only (exits 0 regardless of diff size) rather than --quiet
|
|
50
|
-
// (exits 1 when changes exist) so the check is output-based, not exit-code-based.
|
|
51
|
-
const { stdout: staged } = await execFile('git', [
|
|
52
|
-
'-C',
|
|
53
|
-
resolvedWorktree,
|
|
54
|
-
'diff',
|
|
55
|
-
'--cached',
|
|
56
|
-
'--name-only',
|
|
57
|
-
])
|
|
58
|
-
const hasUncommitted = staged.trim().length > 0
|
|
59
|
-
|
|
60
|
-
if (hasUncommitted) {
|
|
61
|
-
await execFile('git', [
|
|
62
|
-
'-C',
|
|
63
|
-
resolvedWorktree,
|
|
64
|
-
'commit',
|
|
65
|
-
'-m',
|
|
66
|
-
`convoy: ${worktreeBranch} completed`,
|
|
67
|
-
])
|
|
79
|
+
try {
|
|
80
|
+
await commitAllIn(resolve(worktreePath), `convoy: ${worktreeBranch} completed`)
|
|
81
|
+
} catch (err) {
|
|
82
|
+
throw new MergeError(`could not commit the task's work: ${firstLine((err as { stderr?: string }).stderr) || (err as Error).message}`)
|
|
68
83
|
}
|
|
69
84
|
|
|
70
|
-
|
|
71
|
-
|
|
85
|
+
try {
|
|
86
|
+
const head = (await git(['rev-parse', '--abbrev-ref', 'HEAD'], target)).trim()
|
|
87
|
+
if (head !== targetBranch) await git(['checkout', '-q', targetBranch], target)
|
|
88
|
+
} catch (err) {
|
|
89
|
+
throw new MergeError(`could not check out ${targetBranch}: ${firstLine((err as { stderr?: string }).stderr) || (err as Error).message}`)
|
|
90
|
+
}
|
|
72
91
|
|
|
73
92
|
try {
|
|
74
|
-
const
|
|
75
|
-
'-C',
|
|
76
|
-
repoPath,
|
|
77
|
-
'merge',
|
|
78
|
-
worktreeBranch,
|
|
79
|
-
'--no-edit',
|
|
80
|
-
])
|
|
93
|
+
const stdout = await mergeIn(target, ['--no-edit', worktreeBranch])
|
|
81
94
|
if (stdout.includes('Already up to date')) {
|
|
82
95
|
return { success: true, conflicted: false, message: 'No changes to merge' }
|
|
83
96
|
}
|
|
84
97
|
return { success: true, conflicted: false, message: 'Merged successfully' }
|
|
85
98
|
} catch (err) {
|
|
86
|
-
const error = err as { code?: number | string; stderr?: string; stdout?: string }
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (isConflict) {
|
|
91
|
-
// Collect conflicting files before aborting
|
|
92
|
-
let conflictingFiles: string[] = []
|
|
99
|
+
const error = err as { code?: number | string; stderr?: string; stdout?: string; message?: string }
|
|
100
|
+
const text = `${error.stdout ?? ''}\n${error.stderr ?? ''}`
|
|
101
|
+
let conflictingFiles: string[] = []
|
|
102
|
+
if (text.includes('CONFLICT')) {
|
|
93
103
|
try {
|
|
94
|
-
|
|
95
|
-
'
|
|
96
|
-
|
|
97
|
-
conflictingFiles = conflictOut.split('\n').filter(Boolean)
|
|
98
|
-
} catch { /* ignore — we still abort */ }
|
|
99
|
-
await execFile('git', ['-C', repoPath, 'merge', '--abort'])
|
|
100
|
-
throw new MergeConflictError(conflictingFiles)
|
|
104
|
+
conflictingFiles = (await git(['diff', '--name-only', '--diff-filter=U'], target))
|
|
105
|
+
.split('\n').filter(Boolean)
|
|
106
|
+
} catch { /* still abort below */ }
|
|
101
107
|
}
|
|
102
|
-
|
|
108
|
+
// Leave the integration checkout as it was before this merge, whatever
|
|
109
|
+
// went wrong, so the next task's merge starts clean.
|
|
110
|
+
try { await git(['merge', '--abort'], target) } catch { /* no merge in progress */ }
|
|
111
|
+
if (text.includes('CONFLICT')) throw new MergeConflictError(conflictingFiles)
|
|
112
|
+
throw new MergeError(firstLine(error.stderr) || firstLine(error.stdout) || error.message || 'git merge failed')
|
|
103
113
|
}
|
|
104
114
|
}
|
|
105
115
|
|
|
106
|
-
return {
|
|
116
|
+
return {
|
|
117
|
+
merge: (worktreePath, worktreeBranch, targetBranch) =>
|
|
118
|
+
serialize(() => mergeOnce(worktreePath, worktreeBranch, targetBranch)),
|
|
119
|
+
}
|
|
107
120
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { createProgress, firstLine, formatCost } from './progress.js'
|
|
3
|
+
|
|
4
|
+
function sink(isTTY: boolean, columns = 80) {
|
|
5
|
+
const chunks: string[] = []
|
|
6
|
+
return { chunks, stream: { isTTY, columns, write: (s: string) => { chunks.push(s); return true } } }
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
describe('createProgress', () => {
|
|
10
|
+
it('prints plain lines and no status line when not a terminal', () => {
|
|
11
|
+
const { chunks, stream } = sink(false)
|
|
12
|
+
const p = createProgress({ stream })
|
|
13
|
+
p.setStatus(() => '▸ a · 1/2 done')
|
|
14
|
+
p.line(' ✓ [a]')
|
|
15
|
+
p.stop()
|
|
16
|
+
expect(chunks.join('')).toBe(' ✓ [a]\n')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('redraws one status line in place under the permanent lines on a terminal', () => {
|
|
20
|
+
const { chunks, stream } = sink(true)
|
|
21
|
+
const p = createProgress({ stream })
|
|
22
|
+
p.setStatus(() => '▸ a · 0/1 done')
|
|
23
|
+
p.line(' ▶ [a] developer')
|
|
24
|
+
p.stop()
|
|
25
|
+
const out = chunks.join('')
|
|
26
|
+
// The status is cleared before the permanent line, then drawn again under it.
|
|
27
|
+
expect(out).toContain('\r\x1b[2K ▶ [a] developer\n\r\x1b[2K▸ a · 0/1 done')
|
|
28
|
+
expect(out.endsWith('\r\x1b[2K')).toBe(true)
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('treats a terminal that reports 0 columns as of unknown width, not 20', () => {
|
|
32
|
+
const { chunks, stream } = sink(true, 0)
|
|
33
|
+
const p = createProgress({ stream })
|
|
34
|
+
p.setStatus(() => '▸ build-api, write-tests · 2 queued · 5/11 done · 4m12s · $0.84 (est.)')
|
|
35
|
+
p.stop()
|
|
36
|
+
expect(chunks.some(ch => ch.includes('$0.84 (est.)'))).toBe(true)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('keeps the status line within the terminal width', () => {
|
|
40
|
+
const { chunks, stream } = sink(true, 30)
|
|
41
|
+
const p = createProgress({ stream })
|
|
42
|
+
p.setStatus(() => 'x'.repeat(200))
|
|
43
|
+
p.stop()
|
|
44
|
+
const drawn = chunks.find((c) => c.includes('x'))!
|
|
45
|
+
expect(drawn.replace('\r\x1b[2K', '').length).toBeLessThanOrEqual(29)
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
describe('helpers', () => {
|
|
50
|
+
it('takes the first non-empty line of a reason', () => {
|
|
51
|
+
expect(firstLine('\n boom: it broke\nstack…')).toBe('boom: it broke')
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
it('marks estimated cost', () => {
|
|
55
|
+
expect(formatCost(0.8412, true)).toBe('$0.84 (est.)')
|
|
56
|
+
expect(formatCost(0.8412, false)).toBe('$0.84')
|
|
57
|
+
expect(formatCost(null, true)).toBeNull()
|
|
58
|
+
})
|
|
59
|
+
})
|