Run script/setup in new worktrees and give each task a port block

This commit is contained in:
Ian Gulliver
2026-10-15 11:52:13 -07:00
parent f5e5dd30e3
commit cfa9699f4b
15 changed files with 453 additions and 174 deletions
+10
View File
@@ -848,6 +848,16 @@ function renderEvent(ev, ctx) {
}
case "task.merge_title":
return h("div", { class: "note" }, `${ev.actor} set the merge commit title to "${String(p["merge_title"])}" `, when);
case "setup.started": {
const base = Number(p["port_base"]);
return h("div", { class: "note" }, `running ${String(p["script"])} with ports ${base}–${base + 9} `, when);
}
case "setup.ended": {
const secs = Math.round(Number(p["duration_ms"]) / 1000);
const failed = typeof p["error"] === "string";
const summary = failed ? `${String(p["script"])} failed after ${secs}s: ${String(p["error"])}` : `${String(p["script"])} finished in ${secs}s`;
return h("details", { class: failed ? "note error" : "note" }, h("summary", {}, summary, " ", when), h("pre", {}, String(p["output"] ?? "")));
}
case "task.merged":
return h("div", { class: "note" }, `${ev.actor} merged the task${p["commit"] ? ` as ${String(p["commit"]).slice(0, 7)}` : ""}${p["pushed"] ? ` and pushed it to ${String(p["pushed"])}` : ""} `, when);
case "task.discarded":
+1 -1
View File
File diff suppressed because one or more lines are too long
+2
View File
@@ -774,6 +774,8 @@ export interface components {
branch: string;
worktree_path: string;
base_ref: string;
/** @description The first of the task's block of ports (port_base to port_base+9), passed to its setup script and agent as PORT. */
port_base: number;
/** @enum {string} */
status: "active" | "merged" | "discarded";
created_by: string;
+12
View File
@@ -1008,6 +1008,18 @@ function renderEvent(ev: ByreEvent, ctx: Ctx): HTMLElement | null {
case "task.merge_title":
return h("div", { class: "note" }, `${ev.actor} set the merge commit title to "${String(p["merge_title"])}" `, when);
case "setup.started": {
const base = Number(p["port_base"]);
return h("div", { class: "note" }, `running ${String(p["script"])} with ports ${base}–${base + 9} `, when);
}
case "setup.ended": {
const secs = Math.round(Number(p["duration_ms"]) / 1000);
const failed = typeof p["error"] === "string";
const summary = failed ? `${String(p["script"])} failed after ${secs}s: ${String(p["error"])}` : `${String(p["script"])} finished in ${secs}s`;
return h("details", { class: failed ? "note error" : "note" }, h("summary", {}, summary, " ", when), h("pre", {}, String(p["output"] ?? "")));
}
case "task.merged":
return h(
"div",