taskchef 7.22.4 → 7.22.5

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.
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runDashboardSessionProcess } from "../src/dashboard-session-process.js";
4
+
5
+ let cancelled = false;
6
+ let runtime = null;
7
+ let readySent = false;
8
+ const startupController = new AbortController();
9
+ process.on("message", (message) => {
10
+ if (message?.type !== "cancel") return;
11
+ cancelled = true;
12
+ startupController.abort();
13
+ if (runtime) void runtime.close().finally(() => { process.exitCode = 1; });
14
+ });
15
+ process.on("disconnect", () => {
16
+ if (readySent) return;
17
+ cancelled = true;
18
+ startupController.abort();
19
+ if (runtime) void runtime.close().finally(() => { process.exitCode = 1; });
20
+ });
21
+
22
+ try {
23
+ runtime = await runDashboardSessionProcess({ signal: startupController.signal });
24
+ if (cancelled) {
25
+ await runtime.close();
26
+ throw Object.assign(new Error("dashboard session startup was cancelled"), {
27
+ code: "TASKCHEF_DASHBOARD_START_TIMEOUT",
28
+ });
29
+ }
30
+ if (process.send && process.connected) {
31
+ readySent = true;
32
+ await new Promise((resolve, reject) => {
33
+ process.send({ type: "ready", port: runtime.server.port }, (error) =>
34
+ error ? reject(error) : resolve());
35
+ });
36
+ if (process.connected) process.disconnect();
37
+ }
38
+ } catch (error) {
39
+ readySent = false;
40
+ if (runtime) await runtime.close().catch(() => {});
41
+ if (process.send && process.connected) {
42
+ await new Promise((resolve) => {
43
+ process.send({
44
+ type: "error",
45
+ code: typeof error?.code === "string" ? error.code : "TASKCHEF_DASHBOARD_START_FAILED",
46
+ }, () => resolve());
47
+ }).catch(() => {});
48
+ if (process.connected) process.disconnect();
49
+ }
50
+ process.exitCode = 1;
51
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskchef",
3
- "version": "7.22.4",
3
+ "version": "7.22.5",
4
4
  "description": "A non-blocking interactive dispatcher for visible Codex tasks.",
5
5
  "license": "MIT",
6
6
  "author": "Favo Yang",
@@ -25,6 +25,7 @@
25
25
  "bin",
26
26
  "docs/spec.md",
27
27
  "docs/workflows.md",
28
+ "docs/dashboard-lifecycle.md",
28
29
  "docs/firstmate-taskchef-comparison.md",
29
30
  "docs/images/dashboard-identity.jpg",
30
31
  "docs/images/ccusage-token-consumption.png",