opencastle 1.3.1 → 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 +16 -10
- package/bin/cli.mjs +8 -9
- package/dist/cli/agent-roster.test.js +0 -48
- package/dist/cli/agent-roster.test.js.map +1 -1
- package/dist/cli/boundary.test.js +9 -7
- package/dist/cli/boundary.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 -201
- 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 +35 -2
- package/dist/cli/dispatcher.test.js.map +1 -1
- package/dist/cli/docs-accuracy.test.js +3 -3
- package/dist/cli/docs-accuracy.test.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/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/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/package.json +3 -10
- package/src/cli/agent-roster.test.ts +0 -55
- package/src/cli/boundary.test.ts +9 -7
- package/src/cli/convoy/TELEMETRY.md +131 -125
- 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 -216
- 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 +36 -2
- package/src/cli/docs-accuracy.test.ts +3 -3
- 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/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/team-config.ts +2 -21
- package/src/cli/tiers.test.ts +4 -17
- package/src/orchestrator/agents/team-lead.agent.md +1 -1
- package/src/orchestrator/prompts/assess-complexity.prompt.md +43 -26
- package/src/orchestrator/prompts/brainstorm.prompt.md +1 -1
- package/src/orchestrator/prompts/bug-fix.prompt.md +2 -2
- 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 +2 -2
- 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
package/src/cli/convoy-cmd.ts
CHANGED
|
@@ -1,46 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { createConvoyStore } from './convoy/store.js'
|
|
4
|
-
import { selectLastRun } from './convoy/last-run.js'
|
|
1
|
+
import { findProjectRoot, readRun, readRuns, type RunSummary } from './convoy/read-model.js'
|
|
2
|
+
import { nearest } from './nearest.js'
|
|
5
3
|
import { c } from './prompt.js'
|
|
6
4
|
import type { CliContext } from './types.js'
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* The experimental `convoy` namespace.
|
|
10
8
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
9
|
+
* Name a task to plan and run it, run a spec you wrote, continue what is not
|
|
10
|
+
* done, or watch it live. Run it bare to see where the last run stands and the
|
|
11
|
+
* one thing to do next. Everything else that used to live here — a status
|
|
12
|
+
* flag, retry and dead-letter verbs, watch mode, formulas — is state the tool
|
|
13
|
+
* can read for itself, so it is gone.
|
|
16
14
|
*/
|
|
17
15
|
|
|
18
16
|
const CONVOY_HELP = `
|
|
19
17
|
opencastle convoy [task] [options]
|
|
20
18
|
|
|
21
|
-
Experimental:
|
|
19
|
+
Experimental: plan multi-step work and run it with agents in parallel.
|
|
22
20
|
|
|
23
21
|
Usage:
|
|
24
|
-
opencastle convoy
|
|
25
|
-
opencastle convoy "<task>"
|
|
26
|
-
opencastle convoy
|
|
27
|
-
opencastle convoy resume
|
|
28
|
-
opencastle convoy
|
|
29
|
-
opencastle convoy
|
|
30
|
-
opencastle convoy run -f <spec> Execute a spec you wrote by hand
|
|
22
|
+
opencastle convoy The last run and the one next step
|
|
23
|
+
opencastle convoy "<task>" Plan it, show the plan, ask, then run it
|
|
24
|
+
opencastle convoy run <spec.yml> Run a spec you wrote
|
|
25
|
+
opencastle convoy resume Continue whatever is not done
|
|
26
|
+
opencastle convoy dashboard The Observability dashboard, live
|
|
27
|
+
opencastle convoy plan --prd <file> Plan again from a PRD you edited
|
|
31
28
|
|
|
32
29
|
Options:
|
|
33
|
-
--
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
--adapter, -a <name>
|
|
37
|
-
--
|
|
38
|
-
--
|
|
39
|
-
--
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
--yes, -y With a task: run the plan without asking
|
|
31
|
+
--dry-run With a task: plan and write the spec, but do not run it.
|
|
32
|
+
With run or resume: show what would run
|
|
33
|
+
--adapter, -a <name> Agent runtime (default: the one opencastle init set up)
|
|
34
|
+
--concurrency, -c <n> Tasks at once
|
|
35
|
+
--verbose Stream agent output
|
|
36
|
+
--json With no task: the last run, as JSON
|
|
37
|
+
--help, -h Show this help
|
|
38
|
+
|
|
39
|
+
Every subcommand has its own --help. This namespace is experimental and may
|
|
40
|
+
change.
|
|
44
41
|
`
|
|
45
42
|
|
|
46
43
|
/**
|
|
@@ -53,62 +50,21 @@ const CONVOY_HELP = `
|
|
|
53
50
|
* `bin/cli.mjs` has already split any `--flag=value` form before this runs, so
|
|
54
51
|
* only the space form reaches here.
|
|
55
52
|
*/
|
|
56
|
-
const FLAGS_WITH_VALUES = new Set([
|
|
57
|
-
'--adapter',
|
|
58
|
-
'-a',
|
|
59
|
-
'--file',
|
|
60
|
-
'-f',
|
|
61
|
-
'--prd',
|
|
62
|
-
'--complexity',
|
|
63
|
-
'--output-prd',
|
|
64
|
-
'--output-spec',
|
|
65
|
-
'--concurrency',
|
|
66
|
-
'-c',
|
|
67
|
-
'--permission-mode',
|
|
68
|
-
'--report-dir',
|
|
69
|
-
'--formula',
|
|
70
|
-
'--set',
|
|
71
|
-
'--watch-config',
|
|
72
|
-
'--convoy',
|
|
73
|
-
'--resolution',
|
|
74
|
-
])
|
|
53
|
+
const FLAGS_WITH_VALUES = new Set(['--adapter', '-a', '--concurrency', '-c', '--file', '-f', '--prd'])
|
|
75
54
|
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
* flags and silently discarded everything else. A flag that is accepted and
|
|
82
|
-
* ignored is the defect `bin/cli.mjs` refuses unknown options to prevent, and
|
|
83
|
-
* its comment exempts `convoy` on the grounds that this file validates its own
|
|
84
|
-
* input — which, on this path, it did not.
|
|
85
|
-
*
|
|
86
|
-
* `--text` is not here because the task itself supplies it, and `--prd` is not
|
|
87
|
-
* because `SUBCOMMAND_FLAGS` sends it to `convoy plan` with a pointer.
|
|
88
|
-
*/
|
|
89
|
-
const TASK_FLAGS = new Set([
|
|
90
|
-
'--adapter',
|
|
91
|
-
'-a',
|
|
92
|
-
'--verbose',
|
|
93
|
-
'--dry-run',
|
|
94
|
-
'--dryRun',
|
|
95
|
-
'--skip-validation',
|
|
96
|
-
'--complexity',
|
|
97
|
-
'--output-prd',
|
|
98
|
-
'--output-spec',
|
|
99
|
-
])
|
|
55
|
+
/** Flags the planner reads, forwarded from the task path. */
|
|
56
|
+
const TASK_FLAGS = new Set(['--yes', '-y', '--dry-run', '--adapter', '-a', '--concurrency', '-c', '--verbose'])
|
|
57
|
+
|
|
58
|
+
/** What a mistyped word is checked against. `retry` still works, but is not suggested. */
|
|
59
|
+
const SUBCOMMANDS = ['run', 'resume', 'dashboard', 'plan']
|
|
100
60
|
|
|
101
61
|
/**
|
|
102
62
|
* The words of the task, with the flags and their values taken out.
|
|
103
63
|
*
|
|
104
64
|
* A shell splits an unquoted task into one argument per word, and this command
|
|
105
65
|
* used to read only the first of them: `opencastle convoy add rate limiting to
|
|
106
|
-
* the API` planned a feature called "add".
|
|
107
|
-
*
|
|
108
|
-
* only one our own "Start one:" hint shows.
|
|
109
|
-
*
|
|
110
|
-
* Flag values come out with their flag, so `--adapter codex` cannot contribute
|
|
111
|
-
* the word "codex" to a task description.
|
|
66
|
+
* the API` planned a feature called "add". Flag values come out with their
|
|
67
|
+
* flag, so `--adapter codex` cannot add the word "codex" to a task.
|
|
112
68
|
*/
|
|
113
69
|
export function positionalWords(args: string[]): string[] {
|
|
114
70
|
const out: string[] = []
|
|
@@ -149,212 +105,213 @@ export function splitTaskFlags(args: string[]): { forward: string[]; unknown: st
|
|
|
149
105
|
return { forward, unknown }
|
|
150
106
|
}
|
|
151
107
|
|
|
152
|
-
|
|
153
|
-
async function delegate(mod: string, ctx: CliContext, args: string[]): Promise<void> {
|
|
154
|
-
const loaded = (await import(`./${mod}.js`)) as {
|
|
155
|
-
default: (_ctx: CliContext) => Promise<void>
|
|
156
|
-
}
|
|
157
|
-
await loaded.default({ ...ctx, args })
|
|
158
|
-
}
|
|
108
|
+
// ── Status ────────────────────────────────────────────────────────────────────
|
|
159
109
|
|
|
160
|
-
|
|
110
|
+
const FAILED_STATUSES = new Set(['failed', 'gate-failed', 'timed-out', 'review-blocked', 'disputed', 'hook-failed'])
|
|
111
|
+
|
|
112
|
+
export interface LastRun {
|
|
161
113
|
id: string
|
|
162
114
|
name: string
|
|
163
115
|
status: string
|
|
164
|
-
|
|
165
|
-
|
|
116
|
+
branch: string | null
|
|
117
|
+
created_at: string
|
|
118
|
+
/** A process is working on it now. */
|
|
119
|
+
alive: boolean
|
|
166
120
|
total: number
|
|
167
121
|
done: number
|
|
122
|
+
/** Every failed status: failed, gate-failed, timed-out, review-blocked, disputed, hook-failed. */
|
|
168
123
|
failed: number
|
|
124
|
+
running: number
|
|
125
|
+
skipped: number
|
|
169
126
|
pending: number
|
|
127
|
+
/** The one command to run next. */
|
|
128
|
+
next: string
|
|
129
|
+
/** An older run with work left, when this one has none: what `resume` would continue. */
|
|
130
|
+
older_unfinished: { id: string; name: string } | null
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function unfinished(run: RunSummary): boolean {
|
|
134
|
+
return run.status !== 'done' || run.tasks_done < run.tasks_total
|
|
170
135
|
}
|
|
171
136
|
|
|
172
137
|
/**
|
|
173
|
-
* The
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* used to call. The two answers differed whenever a project had run a pipeline:
|
|
177
|
-
* this screen named the newest convoy and advised `resume`, and `resume` then
|
|
178
|
-
* reopened the pipeline instead. Advice that names a different run than the
|
|
179
|
-
* command acts on is worse than no advice.
|
|
138
|
+
* The last run, from the read model: the database is opened read-only, never
|
|
139
|
+
* migrated, and closed again. The status screen used to open the read-write
|
|
140
|
+
* store, which migrated an older project's database just to look at it.
|
|
180
141
|
*/
|
|
181
|
-
function readLastRun(projectRoot: string): LastRun | null {
|
|
182
|
-
const
|
|
183
|
-
if (
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
total: tasks.length,
|
|
208
|
-
done: tasks.filter((t) => t.status === 'done').length,
|
|
209
|
-
failed: tasks.filter((t) => t.status === 'failed' || t.status === 'gate-failed').length,
|
|
210
|
-
pending: tasks.filter((t) => t.status === 'pending' || t.status === 'assigned').length,
|
|
211
|
-
}
|
|
212
|
-
} catch {
|
|
213
|
-
return null
|
|
214
|
-
} finally {
|
|
215
|
-
try { store.close() } catch { /* already closed */ }
|
|
142
|
+
export function readLastRun(projectRoot: string): LastRun | null {
|
|
143
|
+
const runs = readRuns(projectRoot, 200)
|
|
144
|
+
if (runs.length === 0) return null
|
|
145
|
+
const last = runs[0]
|
|
146
|
+
const tasks = readRun(projectRoot, last.id)?.tasks ?? []
|
|
147
|
+
const count = (pick: (s: string) => boolean): number => tasks.filter((t) => pick(t.status)).length
|
|
148
|
+
const done = count((s) => s === 'done')
|
|
149
|
+
// Not done is not done: skipped and running tasks count against "finished"
|
|
150
|
+
// as much as failed ones do, and the run's own status is not trusted to say so.
|
|
151
|
+
const notDone = last.status !== 'done' || done < tasks.length
|
|
152
|
+
const older = notDone ? undefined : runs.slice(1).find(unfinished)
|
|
153
|
+
return {
|
|
154
|
+
id: last.id,
|
|
155
|
+
name: last.name,
|
|
156
|
+
status: last.status,
|
|
157
|
+
branch: last.branch,
|
|
158
|
+
created_at: last.created_at,
|
|
159
|
+
alive: last.alive,
|
|
160
|
+
total: tasks.length,
|
|
161
|
+
done,
|
|
162
|
+
failed: count((s) => FAILED_STATUSES.has(s)),
|
|
163
|
+
running: count((s) => s === 'running' || s === 'assigned'),
|
|
164
|
+
skipped: count((s) => s === 'skipped'),
|
|
165
|
+
pending: count((s) => s === 'pending'),
|
|
166
|
+
next: last.alive ? 'opencastle convoy dashboard' : notDone ? 'opencastle convoy resume' : 'opencastle convoy "<task>"',
|
|
167
|
+
older_unfinished: older ? { id: older.id, name: older.name } : null,
|
|
216
168
|
}
|
|
217
169
|
}
|
|
218
170
|
|
|
219
|
-
/** Bare `convoy`: report the last run and
|
|
171
|
+
/** Bare `convoy`: report the last run and the one verb that fits its state. */
|
|
220
172
|
function renderStatus(last: LastRun | null, json: boolean): void {
|
|
221
173
|
if (json) {
|
|
222
174
|
console.log(JSON.stringify(last, null, 2))
|
|
223
175
|
return
|
|
224
176
|
}
|
|
225
177
|
|
|
178
|
+
console.log(`\n 🚚 ${c.bold('Convoy')} ${c.dim('(experimental)')}\n`)
|
|
226
179
|
if (!last) {
|
|
227
|
-
console.log(`\n 🚚 ${c.bold('Convoy')} ${c.dim('(experimental)')}\n`)
|
|
228
180
|
console.log(' No runs yet.\n')
|
|
229
181
|
console.log(` ${c.bold('Start one:')} ${c.cyan('opencastle convoy "add rate limiting to the API"')}\n`)
|
|
230
182
|
return
|
|
231
183
|
}
|
|
232
184
|
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
console.log(
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
)
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
(last.pending ? c.dim(`, ${last.pending} pending`) : ''),
|
|
245
|
-
)
|
|
185
|
+
const resumable = last.next === 'opencastle convoy resume'
|
|
186
|
+
const mark = last.alive ? c.cyan('▶') : resumable ? c.yellow('!') : c.green('✓')
|
|
187
|
+
const state = last.alive ? 'running now' : last.status
|
|
188
|
+
console.log(` ${mark} ${c.bold(last.name)} ${c.dim(`— ${state}`)}`)
|
|
189
|
+
const parts = [`${last.done}/${last.total} done`]
|
|
190
|
+
if (last.failed) parts.push(c.yellow(`${last.failed} failed`))
|
|
191
|
+
if (last.skipped) parts.push(c.yellow(`${last.skipped} skipped`))
|
|
192
|
+
if (last.running) parts.push(`${last.running} running`)
|
|
193
|
+
if (last.pending) parts.push(c.dim(`${last.pending} pending`))
|
|
194
|
+
console.log(` ${parts.join(', ')}`)
|
|
195
|
+
if (last.branch) console.log(` ${c.dim('Branch')} ${last.branch}`)
|
|
246
196
|
console.log('')
|
|
247
197
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
console.log(` ${c.dim(
|
|
257
|
-
} else {
|
|
258
|
-
console.log(` ${c.dim('Nothing outstanding. Start another with')} ${c.cyan('opencastle convoy "<task>"')}`)
|
|
198
|
+
const why = last.alive
|
|
199
|
+
? 'watch it live'
|
|
200
|
+
: resumable
|
|
201
|
+
? 'runs what is not done — failed, interrupted and skipped tasks — and keeps the rest'
|
|
202
|
+
: 'every task is done; start another'
|
|
203
|
+
console.log(` ${c.bold('Next:')} ${c.cyan(last.next)}`)
|
|
204
|
+
console.log(` ${c.dim(why)}`)
|
|
205
|
+
if (last.older_unfinished) {
|
|
206
|
+
console.log(` ${c.dim(`An earlier run, ${last.older_unfinished.name}, has work left; opencastle convoy resume continues it.`)}`)
|
|
259
207
|
}
|
|
260
208
|
console.log('')
|
|
261
209
|
}
|
|
262
210
|
|
|
263
|
-
|
|
264
|
-
const { args } = ctx
|
|
211
|
+
// ── Dispatch ──────────────────────────────────────────────────────────────────
|
|
265
212
|
|
|
266
|
-
|
|
213
|
+
/** Hand the arguments to another command module. */
|
|
214
|
+
async function delegate(mod: string, ctx: CliContext, args: string[]): Promise<void> {
|
|
215
|
+
const loaded = (await import(`./${mod}.js`)) as { default: (_ctx: CliContext) => Promise<void> }
|
|
216
|
+
await loaded.default({ ...ctx, args })
|
|
217
|
+
}
|
|
267
218
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
return
|
|
274
|
-
}
|
|
219
|
+
function refuse(message: string, hint?: string): never {
|
|
220
|
+
console.error(` ${c.red('✗')} ${message}`)
|
|
221
|
+
if (hint) console.error(` ${c.dim(hint)}`)
|
|
222
|
+
process.exit(1)
|
|
223
|
+
}
|
|
275
224
|
|
|
276
|
-
|
|
225
|
+
/** An unknown flag, named with what replaced it when it is one we removed, or the nearest one we have. */
|
|
226
|
+
async function unknownFlag(flag: string, candidates: string[]): Promise<string> {
|
|
227
|
+
const { REMOVED_FLAGS } = await import('./run.js')
|
|
228
|
+
if (flag in REMOVED_FLAGS) return `${flag} was removed. ${REMOVED_FLAGS[flag]}.`
|
|
229
|
+
const near = nearest(flag, candidates)
|
|
230
|
+
return `Unknown option ${flag}.${near ? ` Did you mean ${near}?` : ''}`
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export default async function convoy(ctx: CliContext): Promise<void> {
|
|
234
|
+
const { args } = ctx
|
|
235
|
+
const [sub, ...rest] = args
|
|
277
236
|
|
|
278
237
|
switch (sub) {
|
|
279
|
-
case
|
|
280
|
-
|
|
238
|
+
case 'run':
|
|
239
|
+
await delegate('run', ctx, rest)
|
|
281
240
|
return
|
|
282
|
-
|
|
283
241
|
case 'resume':
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
await delegate('run', ctx, ['--retry-failed', ...rest])
|
|
242
|
+
// `retry` is what this was called before resume did everything it did.
|
|
243
|
+
case 'retry': {
|
|
244
|
+
const { resume } = await import('./run.js')
|
|
245
|
+
await resume({ ...ctx, args: rest })
|
|
289
246
|
return
|
|
290
|
-
|
|
247
|
+
}
|
|
291
248
|
case 'dashboard':
|
|
292
249
|
await delegate('dashboard', ctx, rest)
|
|
293
250
|
return
|
|
294
|
-
|
|
295
|
-
case 'run':
|
|
296
|
-
// Explicit spec execution, for a .convoy.yml written by hand or by the planner.
|
|
297
|
-
await delegate('run', ctx, rest)
|
|
298
|
-
return
|
|
299
|
-
|
|
300
251
|
case 'plan':
|
|
301
|
-
// The
|
|
302
|
-
// this there was no command that would take that PRD back — the advice dead-ended.
|
|
252
|
+
// The only way to plan again from a PRD someone edited.
|
|
303
253
|
await delegate('pipeline', ctx, rest)
|
|
304
254
|
return
|
|
305
|
-
|
|
306
255
|
default:
|
|
307
256
|
break
|
|
308
257
|
}
|
|
309
258
|
|
|
310
|
-
//
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
259
|
+
// `convoy --help` is ours; `convoy run --help` belongs to the subcommand.
|
|
260
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
261
|
+
console.log(CONVOY_HELP)
|
|
262
|
+
return
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// A flag that belongs to a subcommand used at this level would otherwise
|
|
266
|
+
// be read as part of a task, or dropped.
|
|
316
267
|
const SUBCOMMAND_FLAGS = new Map([
|
|
317
268
|
['--file', 'run'],
|
|
318
269
|
['-f', 'run'],
|
|
319
270
|
['--prd', 'plan'],
|
|
320
|
-
['--resume', 'resume'],
|
|
321
|
-
['--retry-failed', 'retry'],
|
|
322
271
|
])
|
|
323
272
|
const misplaced = args.find((a) => SUBCOMMAND_FLAGS.has(a))
|
|
324
273
|
if (misplaced) {
|
|
325
274
|
const owner = SUBCOMMAND_FLAGS.get(misplaced)!
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
275
|
+
refuse(
|
|
276
|
+
`${misplaced} belongs to \`opencastle convoy ${owner}\`.`,
|
|
277
|
+
`Try: opencastle convoy ${owner} ${args.slice(args.indexOf(misplaced)).join(' ')}`,
|
|
278
|
+
)
|
|
329
279
|
}
|
|
330
280
|
|
|
331
|
-
|
|
332
|
-
|
|
281
|
+
const words = positionalWords(args)
|
|
282
|
+
if (words.length === 0) {
|
|
283
|
+
// Flags alone: the status screen, which reads only --json.
|
|
284
|
+
const stray = args.find((a) => a.startsWith('-') && a !== '--json')
|
|
285
|
+
if (stray) {
|
|
286
|
+
refuse(
|
|
287
|
+
TASK_FLAGS.has(stray) ? `${stray} goes with a task: opencastle convoy "<task>" ${stray}` : await unknownFlag(stray, ['--json', ...TASK_FLAGS]),
|
|
288
|
+
'Run "opencastle convoy --help" for usage.',
|
|
289
|
+
)
|
|
290
|
+
}
|
|
291
|
+
renderStatus(readLastRun(findProjectRoot(process.cwd()) ?? process.cwd()), args.includes('--json'))
|
|
333
292
|
return
|
|
334
293
|
}
|
|
335
294
|
|
|
336
|
-
//
|
|
337
|
-
// a
|
|
338
|
-
// for a feature called "
|
|
339
|
-
// the
|
|
340
|
-
if (
|
|
341
|
-
|
|
342
|
-
|
|
295
|
+
// A single word is not something a planner can act on, and is far more
|
|
296
|
+
// often a mistyped subcommand: `convoy resum` used to start a planning
|
|
297
|
+
// session for a feature called "resum". Planning costs real sessions, so
|
|
298
|
+
// the word is checked before any start.
|
|
299
|
+
if (words.length === 1 && !words[0].includes(' ')) {
|
|
300
|
+
const near = nearest(words[0], SUBCOMMANDS)
|
|
301
|
+
refuse(
|
|
302
|
+
near ? `Unknown subcommand "${words[0]}". Did you mean opencastle convoy ${near}?` : `"${words[0]}" is one word; describe the task in a few.`,
|
|
303
|
+
near
|
|
304
|
+
? 'To plan a task, describe it in a few words: opencastle convoy "add rate limiting to the API"'
|
|
305
|
+
: 'For example: opencastle convoy "add rate limiting to the API". For the last run: opencastle convoy',
|
|
306
|
+
)
|
|
343
307
|
}
|
|
344
308
|
|
|
345
|
-
//
|
|
346
|
-
//
|
|
347
|
-
// this tool prints under "Start one:" fail with "Unknown option".
|
|
348
|
-
//
|
|
349
|
-
// Every word, not just the first. An unquoted task arrives as one argument per
|
|
350
|
-
// word, and taking `sub` alone silently planned the first of them.
|
|
309
|
+
// Everything else is a task: plan it, show the plan, ask, run. Every word,
|
|
310
|
+
// not just the first: an unquoted task arrives as one argument per word.
|
|
351
311
|
const { forward, unknown } = splitTaskFlags(args)
|
|
352
312
|
if (unknown.length > 0) {
|
|
353
|
-
|
|
354
|
-
console.error(` ${c.red('✗')} Unknown option for a convoy task: ${unknown[0]}`)
|
|
355
|
-
console.error(` ${c.dim('Accepts:')} ${accepted} --help`)
|
|
356
|
-
console.error(` ${c.dim('For run or plan options:')} opencastle convoy run --help`)
|
|
357
|
-
process.exit(1)
|
|
313
|
+
refuse(await unknownFlag(unknown[0], [...TASK_FLAGS]), `A task accepts: ${[...TASK_FLAGS].join(' ')} --help`)
|
|
358
314
|
}
|
|
359
|
-
await
|
|
315
|
+
const { planTask } = await import('./pipeline.js')
|
|
316
|
+
await planTask({ ...ctx, args: forward }, words.join(' '))
|
|
360
317
|
}
|