feat(scripts): pnpm work dispatch — wire CLI to dispatch.mjs

This commit is contained in:
2026-05-13 08:19:19 +02:00
parent da811eb461
commit d1b00f1cf5
2 changed files with 18 additions and 2 deletions

View File

@@ -114,7 +114,12 @@ function mark(status) {
}
function usage() {
console.log("Usage: pnpm work <rebuild-state|status|next|ready|blocked>");
console.log(
"Usage: pnpm work <rebuild-state|status|next|ready|blocked|dispatch>",
);
console.log(
" dispatch Print the next dispatch plan (use --execute to invoke sandcastle)",
);
process.exit(2);
}
@@ -124,4 +129,10 @@ else if (cmd === "status") printStatus();
else if (cmd === "next") printNext();
else if (cmd === "ready") printReady();
else if (cmd === "blocked") printBlocked();
else usage();
else if (cmd === "dispatch") {
// Re-dispatch to the dispatch script so it can handle its own --execute flag
import("./dispatch.mjs").catch((e) => {
console.error(e);
process.exit(1);
});
} else usage();

View File

@@ -51,4 +51,9 @@ describe("pnpm work cli", () => {
const out = run("blocked");
expect(out.length).toBeGreaterThan(0);
});
it("dispatch prints a plan", () => {
const out = run("dispatch");
expect(out).toContain("Dispatch plan");
});
});