@cotal-ai/seat 0.57.0 → 0.59.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.
Files changed (45) hide show
  1. package/README.md +26 -1
  2. package/dist/artifacts.d.ts +14 -0
  3. package/dist/artifacts.d.ts.map +1 -0
  4. package/dist/artifacts.js +40 -0
  5. package/dist/artifacts.js.map +1 -0
  6. package/dist/client.d.ts +6 -9
  7. package/dist/client.d.ts.map +1 -1
  8. package/dist/client.js +14 -3
  9. package/dist/client.js.map +1 -1
  10. package/dist/custodian.d.ts +5 -0
  11. package/dist/custodian.d.ts.map +1 -1
  12. package/dist/custodian.js +134 -28
  13. package/dist/custodian.js.map +1 -1
  14. package/dist/diagnostic.d.ts +13 -0
  15. package/dist/diagnostic.d.ts.map +1 -0
  16. package/dist/diagnostic.js +43 -0
  17. package/dist/diagnostic.js.map +1 -0
  18. package/dist/handle.d.ts +2 -4
  19. package/dist/handle.d.ts.map +1 -1
  20. package/dist/handle.js +1 -1
  21. package/dist/handle.js.map +1 -1
  22. package/dist/index.d.ts +4 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +4 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/launcher.d.ts +2 -0
  27. package/dist/launcher.d.ts.map +1 -1
  28. package/dist/launcher.js +55 -33
  29. package/dist/launcher.js.map +1 -1
  30. package/dist/oom.d.ts +18 -0
  31. package/dist/oom.d.ts.map +1 -0
  32. package/dist/oom.js +28 -0
  33. package/dist/oom.js.map +1 -0
  34. package/dist/protocol.d.ts +12 -8
  35. package/dist/protocol.d.ts.map +1 -1
  36. package/dist/protocol.js.map +1 -1
  37. package/dist/reap.d.ts +35 -2
  38. package/dist/reap.d.ts.map +1 -1
  39. package/dist/reap.js +142 -14
  40. package/dist/reap.js.map +1 -1
  41. package/dist/record.d.ts +12 -0
  42. package/dist/record.d.ts.map +1 -1
  43. package/dist/record.js +15 -1
  44. package/dist/record.js.map +1 -1
  45. package/package.json +2 -2
package/dist/reap.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { type SeatRecord } from "./record.js";
2
+ import { type SeatExit } from "./protocol.js";
2
3
  /** What a reap proved. `absent`: no custody record exists for that seat id, so there is no process
3
4
  * this package can address. `reaped`: every process the record names was either signalled and
4
5
  * verified gone, or found already gone (its pid absent or held by a process with a different start
@@ -10,6 +11,7 @@ export type SeatReapEvidence = {
10
11
  custodian: "signalled" | "gone";
11
12
  child: "signalled" | "gone";
12
13
  group: number;
14
+ exit?: SeatExit;
13
15
  detail: string;
14
16
  };
15
17
  /** A pid's standing against a recorded start identity. `live` only when the process exists AND
@@ -44,11 +46,42 @@ export declare function censusCustodians(run?: string): CustodianSighting[];
44
46
  * start identities to execute the same kernel identity and group checks. An unknown reference with neither
45
47
  * on-disk file nor pinned record returns `absent` (failing closed as RuntimeReapUnproven).
46
48
  *
47
- * Signals only a pid whose current start identity matches the record, verifies the custodian, the child
48
- * and the child's whole process group gone, then removes the custody record directory.
49
+ * Signals the custodian and the child only while their current start identity matches the record. The
50
+ * child's descendants are not in the record, so its process group is signalled by pgid and then swept by
51
+ * membership alone, and the record's contents are trusted as written; docs/security.md lists both as
52
+ * accepted residuals. Verifies the custodian, the child and the child's whole process group gone, then
53
+ * removes the custody record directory.
49
54
  */
50
55
  export declare function reapSeat(root: string, id: string, opts?: {
51
56
  graceMs?: number;
52
57
  pinnedRecord?: SeatRecord;
53
58
  }): Promise<SeatReapEvidence>;
59
+ /** One custody record as {@link drainSeats} found it. `live-child`: the child still holds its
60
+ * recorded start identity, so the seat is a running agent and is never signalled. `childless`: the
61
+ * child is gone, so a drain would retire the seat. `drained`: a drain proved the seat gone and
62
+ * removed its record. `refused`: the record could not be read, its identity does not tie its pids
63
+ * to this boot's processes, or the reap did not prove exit; the record stays on disk. */
64
+ export interface SeatInventoryEntry {
65
+ id: string;
66
+ state: "live-child" | "childless" | "drained" | "refused";
67
+ name?: string;
68
+ custodianPid?: number;
69
+ childPid?: number;
70
+ detail: string;
71
+ }
72
+ /**
73
+ * List the custody records under `root`, and with `drain` retire every seat whose child is gone
74
+ * (#1391).
75
+ *
76
+ * A seat whose child still holds its recorded start identity is reported and left alone: it is a
77
+ * running agent, and a manager may still adopt it. Only a seat whose child is proved gone reaches
78
+ * {@link reapSeat}. A record is written once, and a start identity that is gone never comes back, so
79
+ * the reap that follows finds the child gone too and signals at most a custodian whose identity
80
+ * matches the record. A record that cannot be read or whose identity proves nothing on this boot, or
81
+ * a reap that does not prove exit, is refused and left on disk for the operator.
82
+ */
83
+ export declare function drainSeats(root: string, opts?: {
84
+ drain?: boolean;
85
+ graceMs?: number;
86
+ }): Promise<SeatInventoryEntry[]>;
54
87
  //# sourceMappingURL=reap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reap.d.ts","sourceRoot":"","sources":["../src/reap.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwD,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAIpG;;;yDAGyD;AACzD,MAAM,MAAM,gBAAgB,GACxB;IAAE,OAAO,EAAE,QAAQ,CAAA;CAAE,GACrB;IAAE,OAAO,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,WAAW,GAAG,MAAM,CAAC;IAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvH;;yCAEyC;AACzC,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAG3E;AAgDD,mFAAmF;AACnF,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAwBlE;AAED;;;;;;;;;;;G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O,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA+F9I;AAED;;;;0FAI0F;AAC1F,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,YAAY,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA6C9H"}
package/dist/reap.js CHANGED
@@ -1,8 +1,30 @@
1
1
  import { existsSync, readdirSync, readFileSync, rmSync } from "node:fs";
2
2
  import { dirname } from "node:path";
3
- import { bootToken, processStartToken, readRecord, recordPath } from "./record.js";
3
+ import { discardSeatArtifacts } from "./artifacts.js";
4
+ import { bootToken, exitPath, isSeatId, processStartToken, readRecord, recordPath } from "./record.js";
4
5
  import { RUN_MARKER_FLAG } from "./launcher.js";
5
6
  import { unsupportedTransport } from "./protocol.js";
7
+ /** How the child ended, as its custodian recorded it; why a record that exists cannot be read; or
8
+ * neither when no record exists (the child was still running, or its custodian never wrote one). */
9
+ function recordedExit(file) {
10
+ let raw;
11
+ try {
12
+ raw = JSON.parse(readFileSync(file, "utf8"));
13
+ }
14
+ catch (e) {
15
+ return e.code === "ENOENT" ? {} : { unreadable: e.message };
16
+ }
17
+ if (typeof raw !== "object" || raw === null)
18
+ return { unreadable: "not a JSON object" };
19
+ const { code, signal, diagnostic } = raw;
20
+ return {
21
+ exit: {
22
+ ...(Number.isInteger(code) ? { code: code } : {}),
23
+ ...(Number.isInteger(signal) ? { signal: signal } : {}),
24
+ ...(typeof diagnostic === "string" ? { diagnostic } : {}),
25
+ },
26
+ };
27
+ }
6
28
  /** A pid's standing against a recorded start identity. `live` only when the process exists AND
7
29
  * carries the recorded start token; a different token means the pid was reused by an unrelated
8
30
  * process, which is never signalled. */
@@ -103,6 +125,21 @@ export function censusCustodians(run) {
103
125
  }
104
126
  return out;
105
127
  }
128
+ /** Why `rec`'s pids cannot be tied to the processes it recorded, or undefined when they can. A
129
+ * start token counts ticks since ITS OWN boot, so it only tells two processes apart within one boot,
130
+ * and a record may have outlived a reboot on disk. A record with no start identity, no boot identity,
131
+ * or another boot's identity proves nothing about whatever this boot put at those pid numbers, so it
132
+ * is neither signalled nor reported as running or gone. */
133
+ function unprovedIdentity(id, rec) {
134
+ if (rec.custodianStart === undefined)
135
+ return `seat ${id} record carries no process start identity; refusing to signal pid ${rec.custodianPid}/${rec.childPid} (a bare pid may belong to an unrelated process)`;
136
+ if (rec.bootId === undefined)
137
+ return `seat ${id} record carries no boot identity; refusing to signal pid ${rec.custodianPid}/${rec.childPid} (its start tokens cannot be compared across a reboot)`;
138
+ const boot = bootToken();
139
+ if (boot !== undefined && rec.bootId !== boot)
140
+ return `seat ${id} record belongs to boot ${rec.bootId}, but this is boot ${boot}; refusing to signal pid ${rec.custodianPid}/${rec.childPid} (those pids now belong to this boot's processes)`;
141
+ return undefined;
142
+ }
106
143
  /**
107
144
  * Reap one custodied seat: a crashed manager's orphan, a lingering custodian, or a cleanly exited seat
108
145
  * whose custodian unlinked its on-disk record.
@@ -112,8 +149,11 @@ export function censusCustodians(run) {
112
149
  * start identities to execute the same kernel identity and group checks. An unknown reference with neither
113
150
  * on-disk file nor pinned record returns `absent` (failing closed as RuntimeReapUnproven).
114
151
  *
115
- * Signals only a pid whose current start identity matches the record, verifies the custodian, the child
116
- * and the child's whole process group gone, then removes the custody record directory.
152
+ * Signals the custodian and the child only while their current start identity matches the record. The
153
+ * child's descendants are not in the record, so its process group is signalled by pgid and then swept by
154
+ * membership alone, and the record's contents are trusted as written; docs/security.md lists both as
155
+ * accepted residuals. Verifies the custodian, the child and the child's whole process group gone, then
156
+ * removes the custody record directory.
117
157
  */
118
158
  export async function reapSeat(root, id, opts = {}) {
119
159
  if (process.platform !== "linux")
@@ -137,17 +177,13 @@ export async function reapSeat(root, id, opts = {}) {
137
177
  throw new Error(`seat ${id} record at ${path} is unreadable: ${e.message}`);
138
178
  }
139
179
  }
140
- if (rec.custodianStart === undefined)
141
- throw new Error(`seat ${id} record carries no process start identity; refusing to signal pid ${rec.custodianPid}/${rec.childPid} (a bare pid may belong to an unrelated process)`);
142
- // A start token counts ticks since ITS OWN boot, so it only tells two processes apart within one
143
- // boot, and this record may have outlived a reboot on disk. An unbound or foreign-boot record is
144
- // refused rather than signalled: the pids in it now name whatever this boot put at those numbers.
145
- const boot = bootToken();
146
- if (rec.bootId === undefined)
147
- throw new Error(`seat ${id} record carries no boot identity; refusing to signal pid ${rec.custodianPid}/${rec.childPid} (its start tokens cannot be compared across a reboot)`);
148
- if (boot !== undefined && rec.bootId !== boot)
149
- throw new Error(`seat ${id} record belongs to boot ${rec.bootId}, but this is boot ${boot}; refusing to signal pid ${rec.custodianPid}/${rec.childPid} (those pids now belong to this boot's processes)`);
180
+ const unproved = unprovedIdentity(id, rec);
181
+ if (unproved !== undefined)
182
+ throw new Error(unproved);
150
183
  const custodianStart = rec.custodianStart;
184
+ // Read before anything is signalled, so a SIGKILL sent below is never reported as how the child ended.
185
+ const recorded = recordedExit(exitPath(path));
186
+ const exit = recorded.exit;
151
187
  // A pinned record without a child identity means the child was gone before custody began.
152
188
  const childLive = () => rec.childStart !== undefined && identityVerdict(rec.childPid, rec.childStart) === "live";
153
189
  // The child first: node-pty made it a session and process-group leader, so signalling the group
@@ -168,7 +204,11 @@ export async function reapSeat(root, id, opts = {}) {
168
204
  throw new Error(`seat ${id}: custodian ${rec.custodianPid} or child ${rec.childPid} still holds its recorded start identity ${graceMs}ms after SIGKILL; exit not proved`);
169
205
  // The group after the leader: a member that re-parented to init keeps the pgid, and the pgid
170
206
  // cannot be reused while any member lives, so an empty group is proof for the descendants.
207
+ // A retained record may outlive its original group and numeric PGID. Without a live leader
208
+ // identity, remaining members might belong to a later generation, so retain unproved custody.
171
209
  let group = 0;
210
+ if (!groupKilled && processStartToken(rec.childPid) === undefined && groupMembers(rec.childPid).length > 0)
211
+ throw new Error(`seat ${id}: group ownership is unproved for absent leader ${rec.childPid}; custody retained`);
172
212
  if (groupKilled) {
173
213
  const empty = await until(() => {
174
214
  const members = groupMembers(rec.childPid);
@@ -181,16 +221,104 @@ export async function reapSeat(root, id, opts = {}) {
181
221
  if (!empty)
182
222
  throw new Error(`seat ${id}: ${group} process(es) still in group ${rec.childPid} ${graceMs}ms after SIGKILL; exit not proved`);
183
223
  }
224
+ // The launch artifacts the record still lists, read again now that the custodian is proved gone and
225
+ // can no longer change it: ones it had not removed when it died, or could not remove. Never the
226
+ // pinned copy, which still lists what the custodian has since removed, so its names may have been
227
+ // reused. A failed removal keeps the record, so a later reap of this reference tries again.
228
+ let latest;
229
+ try {
230
+ latest = readRecord(path);
231
+ }
232
+ catch (e) {
233
+ if (e.code !== "ENOENT")
234
+ throw new Error(`seat ${id}: exit proved, but its record at ${path} is unreadable: ${e.message}; custody record kept`);
235
+ }
236
+ try {
237
+ discardSeatArtifacts(latest?.artifacts, latest?.artifactRoot);
238
+ }
239
+ catch (e) {
240
+ throw new Error(`seat ${id}: exit proved, but ${e.message}; custody record kept so a later reap retries`);
241
+ }
184
242
  const hadPath = existsSync(path);
185
243
  const dir = dirname(path);
186
244
  if (existsSync(dir))
187
245
  rmSync(dir, { recursive: true, force: true });
246
+ // A child already gone when the reap began ended on its own, and its custodian's record is the
247
+ // only account of how, so a missing or unreadable one is said rather than left out.
248
+ const ended = exit
249
+ ? `; its custodian recorded exit code ${exit.code ?? "unknown"}${exit.signal === undefined ? "" : `, signal ${exit.signal}`}${exit.diagnostic ? `, last connector diagnostic: ${exit.diagnostic}` : ""}`
250
+ : recorded.unreadable !== undefined
251
+ ? `; its custodian's exit record is unreadable: ${recorded.unreadable}`
252
+ : child === "gone"
253
+ ? "; no exit record from its custodian was found"
254
+ : "";
188
255
  return {
189
256
  outcome: "reaped",
190
257
  custodian,
191
258
  child,
192
259
  group,
193
- detail: `custodian ${rec.custodianPid} ${custodian}, child ${rec.childPid} ${child}${groupKilled ? `, group ${rec.childPid} empty` : ""}; custody record ${hadPath ? "removed" : "verified gone"}`,
260
+ ...(exit ? { exit } : {}),
261
+ detail: `custodian ${rec.custodianPid} ${custodian}, child ${rec.childPid} ${child}${groupKilled || group > 0 ? `, group ${rec.childPid} empty` : ""}; custody record ${hadPath ? "removed" : "verified gone"}${ended}`,
194
262
  };
195
263
  }
264
+ /**
265
+ * List the custody records under `root`, and with `drain` retire every seat whose child is gone
266
+ * (#1391).
267
+ *
268
+ * A seat whose child still holds its recorded start identity is reported and left alone: it is a
269
+ * running agent, and a manager may still adopt it. Only a seat whose child is proved gone reaches
270
+ * {@link reapSeat}. A record is written once, and a start identity that is gone never comes back, so
271
+ * the reap that follows finds the child gone too and signals at most a custodian whose identity
272
+ * matches the record. A record that cannot be read or whose identity proves nothing on this boot, or
273
+ * a reap that does not prove exit, is refused and left on disk for the operator.
274
+ */
275
+ export async function drainSeats(root, opts = {}) {
276
+ if (process.platform !== "linux")
277
+ throw unsupportedTransport();
278
+ let ids;
279
+ try {
280
+ ids = readdirSync(root).filter(isSeatId).sort();
281
+ }
282
+ catch (e) {
283
+ if (e.code === "ENOENT")
284
+ return [];
285
+ throw e;
286
+ }
287
+ const out = [];
288
+ for (const id of ids) {
289
+ let rec;
290
+ try {
291
+ rec = readRecord(recordPath(root, id));
292
+ }
293
+ catch (e) {
294
+ out.push({ id, state: "refused", detail: `record unreadable: ${e.message}` });
295
+ continue;
296
+ }
297
+ const seen = { id, name: rec.name, custodianPid: rec.custodianPid, childPid: rec.childPid };
298
+ const unproved = unprovedIdentity(id, rec);
299
+ if (unproved !== undefined) {
300
+ out.push({ ...seen, state: "refused", detail: unproved });
301
+ continue;
302
+ }
303
+ if (rec.childStart !== undefined && identityVerdict(rec.childPid, rec.childStart) === "live") {
304
+ out.push({ ...seen, state: "live-child", detail: `child ${rec.childPid} is running; kept` });
305
+ continue;
306
+ }
307
+ if (!opts.drain) {
308
+ const custodian = rec.custodianStart !== undefined && identityVerdict(rec.custodianPid, rec.custodianStart) === "live" ? "running" : "gone";
309
+ out.push({ ...seen, state: "childless", detail: `child ${rec.childPid} is gone; custodian ${rec.custodianPid} ${custodian}` });
310
+ continue;
311
+ }
312
+ try {
313
+ const evidence = await reapSeat(root, id, opts.graceMs === undefined ? {} : { graceMs: opts.graceMs });
314
+ out.push(evidence.outcome === "reaped"
315
+ ? { ...seen, state: "drained", detail: evidence.detail }
316
+ : { ...seen, state: "refused", detail: "record vanished before the reap; nothing was signalled" });
317
+ }
318
+ catch (e) {
319
+ out.push({ ...seen, state: "refused", detail: e.message });
320
+ }
321
+ }
322
+ return out;
323
+ }
196
324
  //# sourceMappingURL=reap.js.map
package/dist/reap.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"reap.js","sourceRoot":"","sources":["../src/reap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,EAAmB,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAUrD;;yCAEyC;AACzC,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,KAAa;IACxD,MAAM,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACnC,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,KAAK,C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EAAE,CAAC,CAAC;YACvG,GAAG,CAAC,IAAI,CACN,QAAQ,CAAC,OAAO,KAAK,QAAQ;gBAC3B,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE;gBACxD,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,wDAAwD,EAAE,CACpG,CAAC;QACJ,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAG,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
package/dist/record.d.ts CHANGED
@@ -20,6 +20,14 @@ export interface SeatRecord {
20
20
  * the same pid at the same tick after a reboot, and be signalled for it. Absent on a record
21
21
  * written before boot binding; such a record is never signalled. */
22
22
  bootId?: string;
23
+ /** Private temporary directories the launch wrote for this seat's child to read (a persona
24
+ * carrier, an MCP config file). The custodian removes them when its child exits and drops from the
25
+ * record the ones it removed; any still listed belong to a custodian killed first or could not be
26
+ * removed, and the reap that proves the seat gone removes them, keeping the record until it has. */
27
+ artifacts?: string[];
28
+ /** The temp dir of the launcher that wrote `artifacts`, which every entry must sit directly under.
29
+ * Recorded because a reap may run in a successor whose own temp dir differs. */
30
+ artifactRoot?: string;
23
31
  }
24
32
  export declare function seatId(): string;
25
33
  /** Every seat id names a directory under the custody root, so it is checked against the shape
@@ -28,8 +36,12 @@ export declare function seatId(): string;
28
36
  * record outside the root. Refuse rather than resolve: an unaddressable reference must not be
29
37
  * reported as a seat that is already forgotten. */
30
38
  export declare function assertSeatId(id: string): string;
39
+ /** Whether `id` has the shape {@link seatId} mints, so a directory entry can be told from a seat. */
40
+ export declare function isSeatId(id: string): boolean;
31
41
  export declare function capabilityToken(): string;
32
42
  export declare function recordPath(root: string, id: string): string;
43
+ /** Where a custodian records how its child ended, beside the custody record it names. */
44
+ export declare function exitPath(recordFile: string): string;
33
45
  export declare function socketPath(root: string, id: string): string;
34
46
  /** This boot's identity. Read at the moment a record is written and again when it is read back: a
35
47
  * start token is ticks since THIS boot, so two records from different boots share a namespace they
@@ -1 +1 @@
1
- {"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB;;qFAEiF;IACjF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;0GACsG;IACtG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;yEAIqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,MAAM,IAAI,MAAM,CAE/B;AAID;;;;oDAIoD;AACpD,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;kFAGkF;AAClF,wBAAgB,SAAS,IAAI,MAAM,GAAG,SAAS,CAO9C;AAED;;;yCAGyC;AACzC,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUjE;AAED,wBAAgB,WAAW,CAAC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;AAClF,wBAAgB,SAAS,IAAI,MAAM,GAAG,SAAS,CAO9C;AAED;;;yCAGyC;AACzC,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUjE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAKlE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAmCnD"}
package/dist/record.js CHANGED
@@ -12,16 +12,24 @@ const SEAT_ID = /^[0-9a-f]{32}$/;
12
12
  * record outside the root. Refuse rather than resolve: an unaddressable reference must not be
13
13
  * reported as a seat that is already forgotten. */
14
14
  export function assertSeatId(id) {
15
- if (!SEAT_ID.test(id))
15
+ if (!isSeatId(id))
16
16
  throw new Error(`seat id ${JSON.stringify(id)} is not 32 lowercase hex characters; it names a directory under the custody root`);
17
17
  return id;
18
18
  }
19
+ /** Whether `id` has the shape {@link seatId} mints, so a directory entry can be told from a seat. */
20
+ export function isSeatId(id) {
21
+ return SEAT_ID.test(id);
22
+ }
19
23
  export function capabilityToken() {
20
24
  return randomBytes(32).toString("hex");
21
25
  }
22
26
  export function recordPath(root, id) {
23
27
  return join(root, assertSeatId(id), "record.json");
24
28
  }
29
+ /** Where a custodian records how its child ended, beside the custody record it names. */
30
+ export function exitPath(recordFile) {
31
+ return join(dirname(recordFile), "exit.json");
32
+ }
25
33
  export function socketPath(root, id) {
26
34
  return join(root, assertSeatId(id), "seat.sock");
27
35
  }
@@ -83,6 +91,10 @@ export function readRecord(path) {
83
91
  throw new Error("seat record childStart is not a start token");
84
92
  if (raw.bootId !== undefined && (typeof raw.bootId !== "string" || raw.bootId.length === 0))
85
93
  throw new Error("seat record bootId is not a boot identity");
94
+ if (raw.artifacts !== undefined && (!Array.isArray(raw.artifacts) || raw.artifacts.some((a) => typeof a !== "string" || a.length === 0)))
95
+ throw new Error("seat record artifacts is not a list of paths");
96
+ if (raw.artifactRoot !== undefined && (typeof raw.artifactRoot !== "string" || raw.artifactRoot.length === 0))
97
+ throw new Error("seat record artifactRoot is not a path");
86
98
  return {
87
99
  version: RECORD_VERSION,
88
100
  id: raw.id,
@@ -96,6 +108,8 @@ export function readRecord(path) {
96
108
  // Carried, not re-read from this process: a record read on another boot must still say which
97
109
  // boot its pids came from, which is the whole point of the stamp.
98
110
  ...(raw.bootId !== undefined ? { bootId: raw.bootId } : {}),
111
+ ...(raw.artifacts !== undefined ? { artifacts: raw.artifacts } : {}),
112
+ ...(raw.artifactRoot !== undefined ? { artifactRoot: raw.artifactRoot } : {}),
99
113
  };
100
114
  }
101
115
  //# sourceMappingURL=record.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"record.js","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAyBhC,MAAM,UAAU,MAAM;IACpB,OAAO,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAEjC;;;;oDAIoD;AACpD,MAAM,UAAU,YAAY,CAAC,EAAU;IACrC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,WAAW,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,kFAAkF,CAAC,CAAC;IACxJ,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzC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AY,EAAE,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9E,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cotal-ai/seat",
3
3
  "description": "Local PTY seat custody: one detached custodian process per seat, a one-shot launcher, and the authenticated local protocol a manager worker uses to adopt the handle. Depends on nothing else in the repo.",
4
- "version": "0.57.0",
4
+ "version": "0.59.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -37,6 +37,6 @@
37
37
  "build": "node scripts/build-native.mjs && tsc -p tsconfig.json",
38
38
  "build:ts": "tsc -p tsconfig.json",
39
39
  "build:native": "node scripts/build-native.mjs",
40
- "test": "pnpm run build && tsx smoke/platform.smoke.ts && tsx smoke/protocol.smoke.ts && tsx smoke/lifecycle.smoke.ts && tsx smoke/isolation.smoke.ts"
40
+ "test": "pnpm run build && tsx smoke/platform.smoke.ts && tsx smoke/protocol.smoke.ts && tsx smoke/lifecycle.smoke.ts && tsx smoke/isolation.smoke.ts && tsx smoke/reap-group-identity.smoke.ts && tsx smoke/peer-credentials-public.smoke.ts"
41
41
  }
42
42
  }