@tangle-network/agent-runtime 0.134.7 → 0.134.8

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 (54) hide show
  1. package/dist/{activation-CG9bkirD.js → activation-CAexDnXt.js} +2 -2
  2. package/dist/{activation-CG9bkirD.js.map → activation-CAexDnXt.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +2 -2
  5. package/dist/{authoring-CK6iXftK.js → authoring-DHVHhbJO.js} +2 -2
  6. package/dist/{authoring-CK6iXftK.js.map → authoring-DHVHhbJO.js.map} +1 -1
  7. package/dist/{graph-9KF7mJM3.js → graph-BWsEZmDL.js} +2 -2
  8. package/dist/{graph-9KF7mJM3.js.map → graph-BWsEZmDL.js.map} +1 -1
  9. package/dist/{improvement-cycle-5XDmxqzr.js → improvement-cycle-DN0QhoCi.js} +3 -3
  10. package/dist/{improvement-cycle-5XDmxqzr.js.map → improvement-cycle-DN0QhoCi.js.map} +1 -1
  11. package/dist/{index-0qU8jNOJ.d.ts → index-CRauzLFH.d.ts} +116 -35
  12. package/dist/{index-DJ9qeOi3.d.ts → index-DC7CNU9n.d.ts} +2 -2
  13. package/dist/index.d.ts +3 -3
  14. package/dist/index.js +7 -7
  15. package/dist/intelligence.js +3 -3
  16. package/dist/kernel.d.ts +2 -2
  17. package/dist/kernel.js +8 -8
  18. package/dist/{knowledge-DWTOug6a.js → knowledge-DDhcxfdu.js} +3 -3
  19. package/dist/{knowledge-DWTOug6a.js.map → knowledge-DDhcxfdu.js.map} +1 -1
  20. package/dist/knowledge.d.ts +1 -1
  21. package/dist/knowledge.js +1 -1
  22. package/dist/{loop-runner-bin-W7MjoHUk.d.ts → loop-runner-bin-Yp4T-tUJ.d.ts} +2 -2
  23. package/dist/{loop-runner-bin-BCvwX9rk.js → loop-runner-bin-gw418CFH.js} +3 -3
  24. package/dist/{loop-runner-bin-BCvwX9rk.js.map → loop-runner-bin-gw418CFH.js.map} +1 -1
  25. package/dist/loop-runner-bin.d.ts +1 -1
  26. package/dist/loop-runner-bin.js +1 -1
  27. package/dist/mcp/bin.js +3 -3
  28. package/dist/mcp/index.d.ts +1 -1
  29. package/dist/mcp/index.js +4 -4
  30. package/dist/{openai-tools-ClNr92Bx.js → openai-tools-ne97uXo0.js} +2 -2
  31. package/dist/{openai-tools-ClNr92Bx.js.map → openai-tools-ne97uXo0.js.map} +1 -1
  32. package/dist/run-layout-Be_Z0dF8.js +288 -0
  33. package/dist/run-layout-Be_Z0dF8.js.map +1 -0
  34. package/dist/{runtime-CnQ_-DF_.js → runtime-BZsDYscs.js} +6 -6
  35. package/dist/{runtime-CnQ_-DF_.js.map → runtime-BZsDYscs.js.map} +1 -1
  36. package/dist/{structural-rollout-CbQjaMwW.js → structural-rollout-BMnPPcJP.js} +2 -2
  37. package/dist/{structural-rollout-CbQjaMwW.js.map → structural-rollout-BMnPPcJP.js.map} +1 -1
  38. package/dist/{supervise-B8Ykk8GO.js → supervise-B-nTWUCK.js} +168 -5
  39. package/dist/supervise-B-nTWUCK.js.map +1 -0
  40. package/dist/{supervisor-BU01azdt.js → supervisor-Dl9Fk7g5.js} +14 -11
  41. package/dist/supervisor-Dl9Fk7g5.js.map +1 -0
  42. package/dist/testing.d.ts +1 -1
  43. package/dist/testing.js +11 -11
  44. package/dist/{top-app-G4M18b6i.js → top-app-CH4cUgpo.js} +28 -8
  45. package/dist/top-app-CH4cUgpo.js.map +1 -0
  46. package/dist/tui/bin.js +1 -1
  47. package/dist/tui/index.d.ts +7 -5
  48. package/dist/tui/index.js +1 -1
  49. package/package.json +1 -1
  50. package/dist/run-layout-CeJsEAom.js +0 -158
  51. package/dist/run-layout-CeJsEAom.js.map +0 -1
  52. package/dist/supervise-B8Ykk8GO.js.map +0 -1
  53. package/dist/supervisor-BU01azdt.js.map +0 -1
  54. package/dist/top-app-G4M18b6i.js.map +0 -1
@@ -0,0 +1,288 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { join, resolve } from "node:path";
3
+ import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
4
+ //#region src/runtime/supervise/run-layout.ts
5
+ /**
6
+ * The on-disk supervisor-run layout: `<root>/.agent/supervisor/<id>`.
7
+ *
8
+ * This is the durable, cross-process face of a supervisor run — the counterpart to the in-process
9
+ * `Inbox` seam in `./inbox`. A run persists its state under one directory so that any OTHER process
10
+ * can find it after the fact: `@tangle-network/traces` reads exactly this layout via
11
+ * `traces analyze --supervisor-run-dir`, a restarted host can rehydrate a run it no longer holds
12
+ * handles to, and a human can steer a live worker by appending one NDJSON line. Until now the
13
+ * layout was defined only in the unpublished `loops` repo (`src/supervisor-control.ts`) — a
14
+ * published reader depending on an unpublished writer's convention — so the contract is promoted
15
+ * here, names preserved.
16
+ *
17
+ * `.agent` is the one dot-dir for ALL agent-owned state (skills already write
18
+ * `.agent/hypotheses/`, `.agent/skill-runs.jsonl`); supervisor runs live beside them rather than
19
+ * under a product-branded dir. Runs written by older writers used `.loops/supervisor/<id>` —
20
+ * readers that must see those keep a legacy fallback; this writer never creates `.loops` again.
21
+ *
22
+ * Layout, relative to `supervisorRunDir(root, id)`:
23
+ *
24
+ * workers/<label>.inbox.ndjson down-leg steer/answer requests for one worker (durable inbox);
25
+ * each line is a {@link WorkerSteerRequest}
26
+ * workers/<label>.ndjson best-effort per-worker control-event log (delivery bookkeeping)
27
+ * cancellations/requests.ndjson worker-scoped cancel requests (durable inbox); each line is a
28
+ * {@link WorkerCancelRequest}
29
+ * cancellations/<opId>.json the acknowledgement for one cancel operation — a
30
+ * {@link WorkerCancellation} written ONLY by the runtime
31
+ * acknowledger (the coordination driver's turn loop)
32
+ *
33
+ * Reads are tolerant by contract: a partial trailing line (a writer mid-append) or a corrupt line
34
+ * never poisons the rest of the file — later valid lines still matter.
35
+ *
36
+ * Promoted from `loops/src/supervisor-control.ts`. The one deliberate difference: the loops version
37
+ * resolved a worker id to its label through the run journal before writing a steer; that resolution
38
+ * stays with the caller (it is journal-format-specific), so `writeWorkerSteer` here takes the worker
39
+ * LABEL directly.
40
+ *
41
+ * @experimental
42
+ */
43
+ /** The root every supervisor run of one workspace lives under. */
44
+ function supervisorRunsRoot(rootDir) {
45
+ return join(resolve(rootDir), ".agent", "supervisor");
46
+ }
47
+ /** The run directory every artifact of one supervisor run lives under. */
48
+ function supervisorRunDir(rootDir, id) {
49
+ return join(supervisorRunsRoot(rootDir), id);
50
+ }
51
+ /**
52
+ * Where a pre-rename writer put the same run (`<root>/.loops/supervisor/<id>`). Readers that must
53
+ * see historical runs check {@link supervisorRunDir} first and fall back to this; nothing writes
54
+ * here anymore.
55
+ */
56
+ function legacySupervisorRunDir(rootDir, id) {
57
+ return join(legacySupervisorRunsRoot(rootDir), id);
58
+ }
59
+ /**
60
+ * The pre-rename runs root (`<root>/.loops/supervisor`). Only readers that ENUMERATE historical
61
+ * runs need this — the per-id form is {@link legacySupervisorRunDir}. Nothing writes here.
62
+ */
63
+ function legacySupervisorRunsRoot(rootDir) {
64
+ return join(resolve(rootDir), ".loops", "supervisor");
65
+ }
66
+ /** A worker label reduced to a safe filename stem. Empty labels get a stable fallback. */
67
+ function safeWorkerFile(label) {
68
+ const safe = label.replace(/[^A-Za-z0-9._-]/g, "_");
69
+ return safe.length > 0 ? safe : "worker";
70
+ }
71
+ /** The directory holding every per-worker file of one run (inboxes and control-event logs). */
72
+ function supervisorWorkersDir(eventDir) {
73
+ return join(eventDir, "workers");
74
+ }
75
+ /** The durable inbox file for one worker of one run. */
76
+ function workerInboxFile(rootDir, supervisorId, worker) {
77
+ return workerInboxFileFromEventDir(supervisorRunDir(rootDir, supervisorId), worker);
78
+ }
79
+ /** Same, addressed from an already-known run directory (the reader's usual entry point). */
80
+ function workerInboxFileFromEventDir(eventDir, worker) {
81
+ return join(supervisorWorkersDir(eventDir), `${safeWorkerFile(worker)}.inbox.ndjson`);
82
+ }
83
+ /**
84
+ * The best-effort control-event log for one worker (`workers/<label>.ndjson`) — delivery
85
+ * bookkeeping for steers, plus whatever lifecycle events a writer chooses to append. Distinct from
86
+ * the inbox: the inbox is the durable down-leg queue, this is the record of what happened to it.
87
+ */
88
+ function workerControlLogFile(eventDir, worker) {
89
+ return join(supervisorWorkersDir(eventDir), `${safeWorkerFile(worker)}.ndjson`);
90
+ }
91
+ /**
92
+ * Durably append one steer request to a worker's inbox and log the delivery attempt.
93
+ *
94
+ * The inbox append is the durable act; the control-event log is best-effort bookkeeping and may
95
+ * silently fail without voiding the steer.
96
+ */
97
+ function writeWorkerSteer(rootDir, supervisorId, worker, message, source = "human") {
98
+ const trimmed = message.trim();
99
+ if (!trimmed) throw new Error("steer message is empty");
100
+ const dir = supervisorRunDir(rootDir, supervisorId);
101
+ mkdirSync(supervisorWorkersDir(dir), { recursive: true });
102
+ const request = {
103
+ id: randomUUID(),
104
+ at: (/* @__PURE__ */ new Date()).toISOString(),
105
+ source,
106
+ worker,
107
+ message: trimmed
108
+ };
109
+ const file = workerInboxFile(rootDir, supervisorId, worker);
110
+ appendFileSync(file, `${JSON.stringify(request)}\n`, "utf8");
111
+ appendWorkerControlEvent(dir, worker, {
112
+ kind: "message",
113
+ direction: "down",
114
+ source,
115
+ requestId: request.id,
116
+ message: trimmed,
117
+ queued: true,
118
+ delivered: false
119
+ });
120
+ return {
121
+ worker,
122
+ file,
123
+ request
124
+ };
125
+ }
126
+ /** Read every valid steer request in a worker's inbox. Corrupt or partial lines are skipped. */
127
+ function readWorkerSteerRequests(eventDir, worker) {
128
+ const file = workerInboxFileFromEventDir(eventDir, worker);
129
+ if (!existsSync(file)) return [];
130
+ const out = [];
131
+ let raw = "";
132
+ try {
133
+ raw = readFileSync(file, "utf8");
134
+ } catch {
135
+ return out;
136
+ }
137
+ for (const line of raw.split("\n")) {
138
+ const trimmed = line.trim();
139
+ if (!trimmed) continue;
140
+ try {
141
+ const parsed = JSON.parse(trimmed);
142
+ if (isWorkerSteerRequest(parsed)) out.push(parsed);
143
+ } catch {}
144
+ }
145
+ return out;
146
+ }
147
+ /** The directory holding every cancellation artifact of one run (request inbox + acknowledgements). */
148
+ function workerCancellationsDir(eventDir) {
149
+ return join(eventDir, "cancellations");
150
+ }
151
+ /** The durable cancel-request inbox of one run — one NDJSON line per {@link WorkerCancelRequest}. */
152
+ function workerCancelRequestsFile(eventDir) {
153
+ return join(workerCancellationsDir(eventDir), "requests.ndjson");
154
+ }
155
+ /**
156
+ * The acknowledgement file for one cancel operation. The filename is a sanitized stem of the
157
+ * `operationId`; the record inside carries the exact id, and readers verify it so two distinct
158
+ * ids that sanitize to one stem fail loud instead of answering for each other.
159
+ */
160
+ function workerCancellationFile(eventDir, operationId) {
161
+ return join(workerCancellationsDir(eventDir), `${safeOperationFile(operationId)}.json`);
162
+ }
163
+ function safeOperationFile(operationId) {
164
+ const safe = operationId.replace(/[^A-Za-z0-9._-]/g, "_");
165
+ if (safe.length === 0) throw new Error("cancel operationId is empty");
166
+ return safe;
167
+ }
168
+ /** Read every valid cancel request in the run's cancellation inbox. Corrupt lines are skipped. */
169
+ function readWorkerCancelRequests(eventDir) {
170
+ const file = workerCancelRequestsFile(eventDir);
171
+ if (!existsSync(file)) return [];
172
+ const out = [];
173
+ let raw = "";
174
+ try {
175
+ raw = readFileSync(file, "utf8");
176
+ } catch {
177
+ return out;
178
+ }
179
+ for (const line of raw.split("\n")) {
180
+ const trimmed = line.trim();
181
+ if (!trimmed) continue;
182
+ try {
183
+ const parsed = JSON.parse(trimmed);
184
+ if (isWorkerCancelRequest(parsed)) out.push(parsed);
185
+ } catch {}
186
+ }
187
+ return out;
188
+ }
189
+ /**
190
+ * Read the acknowledgement for one cancel operation. `undefined` when the runtime has not
191
+ * answered. A record whose stored `operationId` differs from the requested one is a filename
192
+ * collision between two sanitized ids — fail loud rather than return another operation's answer.
193
+ */
194
+ function readWorkerCancellation(eventDir, operationId) {
195
+ const file = workerCancellationFile(eventDir, operationId);
196
+ if (!existsSync(file)) return void 0;
197
+ const parsed = JSON.parse(readFileSync(file, "utf8"));
198
+ if (parsed.operationId !== operationId) throw new Error(`cancel acknowledgement collision: '${file}' holds operation '${parsed.operationId}', not '${operationId}' — use operation ids that stay distinct after filename sanitization`);
199
+ return parsed;
200
+ }
201
+ /**
202
+ * Durably write one acknowledgement record. Write-then-rename, so a concurrent reader sees the
203
+ * prior complete record or the new complete record, never a partial file.
204
+ *
205
+ * @internal The runtime acknowledger is the only intended writer; clients read via
206
+ * {@link readWorkerCancellation} or {@link cancelWorker}.
207
+ */
208
+ function writeWorkerCancellation(eventDir, record) {
209
+ mkdirSync(workerCancellationsDir(eventDir), { recursive: true });
210
+ const file = workerCancellationFile(eventDir, record.operationId);
211
+ const tmp = `${file}.${randomUUID()}.tmp`;
212
+ writeFileSync(tmp, `${JSON.stringify(record, null, 2)}\n`, "utf8");
213
+ renameSync(tmp, file);
214
+ }
215
+ /**
216
+ * Request the cancellation of ONE worker, idempotently, and return the operation's current
217
+ * durable state.
218
+ *
219
+ * The write half of the acknowledged-cancellation contract (`writeWorkerSteer` is the steer
220
+ * analog): append the request to the run's cancellation inbox, where the runtime's acknowledger
221
+ * (the coordination driver's turn loop) applies it — aborting exactly that worker's subtree and
222
+ * recording what it proved. This function never applies the cancellation itself; writing a
223
+ * request file is not an acknowledgement.
224
+ *
225
+ * Idempotency is a lookup: when an acknowledgement for `operationId` already exists, it is
226
+ * returned AS-IS and nothing is appended — repeating one operation can never apply twice. A
227
+ * request the runtime has not answered yet returns `effect: 'unknown'` (never a success); call
228
+ * again with the same `operationId` — or `readWorkerCancellation` — to read the acknowledged
229
+ * result after a reconnect.
230
+ */
231
+ function cancelWorker(eventDir, worker, operationId, options = {}) {
232
+ const ref = worker.trim();
233
+ if (!ref) throw new Error("cancelWorker: worker reference is empty");
234
+ const opId = operationId.trim();
235
+ if (!opId) throw new Error("cancelWorker: operationId is empty");
236
+ const acknowledged = readWorkerCancellation(eventDir, opId);
237
+ if (acknowledged) return acknowledged;
238
+ const source = options.source ?? "human";
239
+ const pending = readWorkerCancelRequests(eventDir).find((r) => r.operationId === opId);
240
+ const request = pending ?? {
241
+ operationId: opId,
242
+ at: (/* @__PURE__ */ new Date()).toISOString(),
243
+ source,
244
+ worker: ref,
245
+ ...options.reason === void 0 ? {} : { reason: options.reason }
246
+ };
247
+ if (!pending) {
248
+ mkdirSync(workerCancellationsDir(eventDir), { recursive: true });
249
+ appendFileSync(workerCancelRequestsFile(eventDir), `${JSON.stringify(request)}\n`, "utf8");
250
+ appendWorkerControlEvent(eventDir, ref, {
251
+ kind: "cancel-request",
252
+ operationId: opId,
253
+ source,
254
+ queued: true,
255
+ ...options.reason === void 0 ? {} : { reason: options.reason }
256
+ });
257
+ }
258
+ return {
259
+ operationId: opId,
260
+ worker: request.worker,
261
+ effect: "unknown",
262
+ requestedAt: request.at,
263
+ observedAt: request.at,
264
+ ...request.reason === void 0 ? {} : { reason: request.reason },
265
+ detail: "request queued; no runtime acknowledger has answered yet",
266
+ terminated: []
267
+ };
268
+ }
269
+ function isWorkerCancelRequest(value) {
270
+ return typeof value.operationId === "string" && value.operationId.length > 0 && typeof value.at === "string" && typeof value.source === "string" && typeof value.worker === "string" && value.worker.length > 0 && (value.reason === void 0 || typeof value.reason === "string");
271
+ }
272
+ function appendWorkerControlEvent(eventDir, label, event) {
273
+ try {
274
+ mkdirSync(supervisorWorkersDir(eventDir), { recursive: true });
275
+ appendFileSync(workerControlLogFile(eventDir, label), `${JSON.stringify({
276
+ at: (/* @__PURE__ */ new Date()).toISOString(),
277
+ label,
278
+ ...event
279
+ })}\n`, "utf8");
280
+ } catch {}
281
+ }
282
+ function isWorkerSteerRequest(value) {
283
+ return typeof value.id === "string" && typeof value.at === "string" && typeof value.source === "string" && typeof value.worker === "string" && typeof value.message === "string" && value.message.trim().length > 0;
284
+ }
285
+ //#endregion
286
+ export { writeWorkerCancellation as _, readWorkerCancellation as a, supervisorRunDir as c, workerCancelRequestsFile as d, workerCancellationFile as f, workerInboxFileFromEventDir as g, workerInboxFile as h, readWorkerCancelRequests as i, supervisorRunsRoot as l, workerControlLogFile as m, legacySupervisorRunDir as n, readWorkerSteerRequests as o, workerCancellationsDir as p, legacySupervisorRunsRoot as r, safeWorkerFile as s, cancelWorker as t, supervisorWorkersDir as u, writeWorkerSteer as v };
287
+
288
+ //# sourceMappingURL=run-layout-Be_Z0dF8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-layout-Be_Z0dF8.js","names":[],"sources":["../src/runtime/supervise/run-layout.ts"],"sourcesContent":["/**\n * The on-disk supervisor-run layout: `<root>/.agent/supervisor/<id>`.\n *\n * This is the durable, cross-process face of a supervisor run — the counterpart to the in-process\n * `Inbox` seam in `./inbox`. A run persists its state under one directory so that any OTHER process\n * can find it after the fact: `@tangle-network/traces` reads exactly this layout via\n * `traces analyze --supervisor-run-dir`, a restarted host can rehydrate a run it no longer holds\n * handles to, and a human can steer a live worker by appending one NDJSON line. Until now the\n * layout was defined only in the unpublished `loops` repo (`src/supervisor-control.ts`) — a\n * published reader depending on an unpublished writer's convention — so the contract is promoted\n * here, names preserved.\n *\n * `.agent` is the one dot-dir for ALL agent-owned state (skills already write\n * `.agent/hypotheses/`, `.agent/skill-runs.jsonl`); supervisor runs live beside them rather than\n * under a product-branded dir. Runs written by older writers used `.loops/supervisor/<id>` —\n * readers that must see those keep a legacy fallback; this writer never creates `.loops` again.\n *\n * Layout, relative to `supervisorRunDir(root, id)`:\n *\n * workers/<label>.inbox.ndjson down-leg steer/answer requests for one worker (durable inbox);\n * each line is a {@link WorkerSteerRequest}\n * workers/<label>.ndjson best-effort per-worker control-event log (delivery bookkeeping)\n * cancellations/requests.ndjson worker-scoped cancel requests (durable inbox); each line is a\n * {@link WorkerCancelRequest}\n * cancellations/<opId>.json the acknowledgement for one cancel operation — a\n * {@link WorkerCancellation} written ONLY by the runtime\n * acknowledger (the coordination driver's turn loop)\n *\n * Reads are tolerant by contract: a partial trailing line (a writer mid-append) or a corrupt line\n * never poisons the rest of the file — later valid lines still matter.\n *\n * Promoted from `loops/src/supervisor-control.ts`. The one deliberate difference: the loops version\n * resolved a worker id to its label through the run journal before writing a steer; that resolution\n * stays with the caller (it is journal-format-specific), so `writeWorkerSteer` here takes the worker\n * LABEL directly.\n *\n * @experimental\n */\n\nimport { randomUUID } from 'node:crypto'\nimport {\n appendFileSync,\n existsSync,\n mkdirSync,\n readFileSync,\n renameSync,\n writeFileSync,\n} from 'node:fs'\nimport { join, resolve } from 'node:path'\nimport type { RetainedRunEffect } from '../retained-run-types'\n\n/** One durable down-leg request appended to a worker's inbox file. */\nexport interface WorkerSteerRequest {\n readonly id: string\n /** ISO timestamp of the append. */\n readonly at: string\n /** Who asked — 'human', a brain label, a tool name. Provenance, not authorization. */\n readonly source: string\n /** The worker LABEL the request targets (already resolved by the caller). */\n readonly worker: string\n readonly message: string\n}\n\n/** One durable worker-scoped cancel request appended to the run's cancellation inbox. */\nexport interface WorkerCancelRequest {\n /** Caller-minted stable operation identifier — the idempotency key of the whole operation. */\n readonly operationId: string\n /** ISO timestamp of the append. */\n readonly at: string\n /** Who asked — 'human', a brain label, a tool name. Provenance, not authorization. */\n readonly source: string\n /** The worker the request targets: a workerId (node id), a profile name, or a spawn label. */\n readonly worker: string\n readonly reason?: string\n}\n\n/**\n * The durable acknowledgement state for one worker-scoped cancel operation, keyed by\n * `operationId`. The runtime acknowledger is the ONLY writer; `cancelWorker` only reads it.\n *\n * `effect` reuses the retained-run vocabulary ({@link RetainedRunEffect}) so the runtime has one\n * spelling of the four cancellation states:\n * - `'unknown'` — not yet resolved by the runtime (also what `cancelWorker` returns for\n * a request no acknowledger has answered). Never a success.\n * - `'cancel_requested'` — the runtime issued the worker's abort; termination not yet proven.\n * - `'cancelled'` — the worker reached a terminal `down` state on the settle path.\n * - `'not_live'` — the worker was not live to cancel (already settled, or it settled\n * `done` despite the abort). Never a success of THIS operation.\n */\nexport interface WorkerCancellation {\n readonly operationId: string\n /** The worker reference exactly as requested. */\n readonly worker: string\n readonly effect: RetainedRunEffect\n /** ISO timestamp of the original request. */\n readonly requestedAt: string\n /** ISO timestamp of the runtime's most recent observation of this operation. */\n readonly observedAt: string\n /** The node id the acknowledger resolved `worker` to, once resolved. */\n readonly workerId?: string\n /** The caller's reason, carried verbatim from the request. */\n readonly reason?: string\n /** The runtime's explanation of how it arrived at `effect`. */\n readonly detail?: string\n /**\n * Every node id this operation PROVED terminated: the requested worker plus each descendant of\n * its subtree observed to reach a terminal `down`/`cancelled` journal record at or after\n * `requestedAt` (a cancelled lead cascades to its subtree by design — the scope signal chain —\n * so the acknowledgement names the set, not one id). Empty until termination is proven.\n */\n readonly terminated: ReadonlyArray<string>\n}\n\n/** The root every supervisor run of one workspace lives under. */\nexport function supervisorRunsRoot(rootDir: string): string {\n return join(resolve(rootDir), '.agent', 'supervisor')\n}\n\n/** The run directory every artifact of one supervisor run lives under. */\nexport function supervisorRunDir(rootDir: string, id: string): string {\n return join(supervisorRunsRoot(rootDir), id)\n}\n\n/**\n * Where a pre-rename writer put the same run (`<root>/.loops/supervisor/<id>`). Readers that must\n * see historical runs check {@link supervisorRunDir} first and fall back to this; nothing writes\n * here anymore.\n */\nexport function legacySupervisorRunDir(rootDir: string, id: string): string {\n return join(legacySupervisorRunsRoot(rootDir), id)\n}\n\n/**\n * The pre-rename runs root (`<root>/.loops/supervisor`). Only readers that ENUMERATE historical\n * runs need this — the per-id form is {@link legacySupervisorRunDir}. Nothing writes here.\n */\nexport function legacySupervisorRunsRoot(rootDir: string): string {\n return join(resolve(rootDir), '.loops', 'supervisor')\n}\n\n/** A worker label reduced to a safe filename stem. Empty labels get a stable fallback. */\nexport function safeWorkerFile(label: string): string {\n const safe = label.replace(/[^A-Za-z0-9._-]/g, '_')\n return safe.length > 0 ? safe : 'worker'\n}\n\n/** The directory holding every per-worker file of one run (inboxes and control-event logs). */\nexport function supervisorWorkersDir(eventDir: string): string {\n return join(eventDir, 'workers')\n}\n\n/** The durable inbox file for one worker of one run. */\nexport function workerInboxFile(rootDir: string, supervisorId: string, worker: string): string {\n return workerInboxFileFromEventDir(supervisorRunDir(rootDir, supervisorId), worker)\n}\n\n/** Same, addressed from an already-known run directory (the reader's usual entry point). */\nexport function workerInboxFileFromEventDir(eventDir: string, worker: string): string {\n return join(supervisorWorkersDir(eventDir), `${safeWorkerFile(worker)}.inbox.ndjson`)\n}\n\n/**\n * The best-effort control-event log for one worker (`workers/<label>.ndjson`) — delivery\n * bookkeeping for steers, plus whatever lifecycle events a writer chooses to append. Distinct from\n * the inbox: the inbox is the durable down-leg queue, this is the record of what happened to it.\n */\nexport function workerControlLogFile(eventDir: string, worker: string): string {\n return join(supervisorWorkersDir(eventDir), `${safeWorkerFile(worker)}.ndjson`)\n}\n\n/**\n * Durably append one steer request to a worker's inbox and log the delivery attempt.\n *\n * The inbox append is the durable act; the control-event log is best-effort bookkeeping and may\n * silently fail without voiding the steer.\n */\nexport function writeWorkerSteer(\n rootDir: string,\n supervisorId: string,\n worker: string,\n message: string,\n source = 'human',\n): { worker: string; file: string; request: WorkerSteerRequest } {\n const trimmed = message.trim()\n if (!trimmed) throw new Error('steer message is empty')\n const dir = supervisorRunDir(rootDir, supervisorId)\n mkdirSync(supervisorWorkersDir(dir), { recursive: true })\n const request: WorkerSteerRequest = {\n id: randomUUID(),\n at: new Date().toISOString(),\n source,\n worker,\n message: trimmed,\n }\n const file = workerInboxFile(rootDir, supervisorId, worker)\n appendFileSync(file, `${JSON.stringify(request)}\\n`, 'utf8')\n appendWorkerControlEvent(dir, worker, {\n kind: 'message',\n direction: 'down',\n source,\n requestId: request.id,\n message: trimmed,\n queued: true,\n delivered: false,\n })\n return { worker, file, request }\n}\n\n/** Read every valid steer request in a worker's inbox. Corrupt or partial lines are skipped. */\nexport function readWorkerSteerRequests(eventDir: string, worker: string): WorkerSteerRequest[] {\n const file = workerInboxFileFromEventDir(eventDir, worker)\n if (!existsSync(file)) return []\n const out: WorkerSteerRequest[] = []\n let raw = ''\n try {\n raw = readFileSync(file, 'utf8')\n } catch {\n return out\n }\n for (const line of raw.split('\\n')) {\n const trimmed = line.trim()\n if (!trimmed) continue\n try {\n const parsed = JSON.parse(trimmed) as Partial<WorkerSteerRequest>\n if (isWorkerSteerRequest(parsed)) out.push(parsed)\n } catch {\n // Ignore partial or corrupt input lines; later valid lines still matter.\n }\n }\n return out\n}\n\n/** The directory holding every cancellation artifact of one run (request inbox + acknowledgements). */\nexport function workerCancellationsDir(eventDir: string): string {\n return join(eventDir, 'cancellations')\n}\n\n/** The durable cancel-request inbox of one run — one NDJSON line per {@link WorkerCancelRequest}. */\nexport function workerCancelRequestsFile(eventDir: string): string {\n return join(workerCancellationsDir(eventDir), 'requests.ndjson')\n}\n\n/**\n * The acknowledgement file for one cancel operation. The filename is a sanitized stem of the\n * `operationId`; the record inside carries the exact id, and readers verify it so two distinct\n * ids that sanitize to one stem fail loud instead of answering for each other.\n */\nexport function workerCancellationFile(eventDir: string, operationId: string): string {\n return join(workerCancellationsDir(eventDir), `${safeOperationFile(operationId)}.json`)\n}\n\nfunction safeOperationFile(operationId: string): string {\n const safe = operationId.replace(/[^A-Za-z0-9._-]/g, '_')\n if (safe.length === 0) throw new Error('cancel operationId is empty')\n return safe\n}\n\n/** Read every valid cancel request in the run's cancellation inbox. Corrupt lines are skipped. */\nexport function readWorkerCancelRequests(eventDir: string): WorkerCancelRequest[] {\n const file = workerCancelRequestsFile(eventDir)\n if (!existsSync(file)) return []\n const out: WorkerCancelRequest[] = []\n let raw = ''\n try {\n raw = readFileSync(file, 'utf8')\n } catch {\n return out\n }\n for (const line of raw.split('\\n')) {\n const trimmed = line.trim()\n if (!trimmed) continue\n try {\n const parsed = JSON.parse(trimmed) as Partial<WorkerCancelRequest>\n if (isWorkerCancelRequest(parsed)) out.push(parsed)\n } catch {\n // Ignore partial or corrupt input lines; later valid lines still matter.\n }\n }\n return out\n}\n\n/**\n * Read the acknowledgement for one cancel operation. `undefined` when the runtime has not\n * answered. A record whose stored `operationId` differs from the requested one is a filename\n * collision between two sanitized ids — fail loud rather than return another operation's answer.\n */\nexport function readWorkerCancellation(\n eventDir: string,\n operationId: string,\n): WorkerCancellation | undefined {\n const file = workerCancellationFile(eventDir, operationId)\n if (!existsSync(file)) return undefined\n const parsed = JSON.parse(readFileSync(file, 'utf8')) as WorkerCancellation\n if (parsed.operationId !== operationId) {\n throw new Error(\n `cancel acknowledgement collision: '${file}' holds operation '${parsed.operationId}', ` +\n `not '${operationId}' — use operation ids that stay distinct after filename sanitization`,\n )\n }\n return parsed\n}\n\n/**\n * Durably write one acknowledgement record. Write-then-rename, so a concurrent reader sees the\n * prior complete record or the new complete record, never a partial file.\n *\n * @internal The runtime acknowledger is the only intended writer; clients read via\n * {@link readWorkerCancellation} or {@link cancelWorker}.\n */\nexport function writeWorkerCancellation(eventDir: string, record: WorkerCancellation): void {\n const dir = workerCancellationsDir(eventDir)\n mkdirSync(dir, { recursive: true })\n const file = workerCancellationFile(eventDir, record.operationId)\n const tmp = `${file}.${randomUUID()}.tmp`\n writeFileSync(tmp, `${JSON.stringify(record, null, 2)}\\n`, 'utf8')\n renameSync(tmp, file)\n}\n\n/**\n * Request the cancellation of ONE worker, idempotently, and return the operation's current\n * durable state.\n *\n * The write half of the acknowledged-cancellation contract (`writeWorkerSteer` is the steer\n * analog): append the request to the run's cancellation inbox, where the runtime's acknowledger\n * (the coordination driver's turn loop) applies it — aborting exactly that worker's subtree and\n * recording what it proved. This function never applies the cancellation itself; writing a\n * request file is not an acknowledgement.\n *\n * Idempotency is a lookup: when an acknowledgement for `operationId` already exists, it is\n * returned AS-IS and nothing is appended — repeating one operation can never apply twice. A\n * request the runtime has not answered yet returns `effect: 'unknown'` (never a success); call\n * again with the same `operationId` — or `readWorkerCancellation` — to read the acknowledged\n * result after a reconnect.\n */\nexport function cancelWorker(\n eventDir: string,\n worker: string,\n operationId: string,\n options: { readonly reason?: string; readonly source?: string } = {},\n): WorkerCancellation {\n const ref = worker.trim()\n if (!ref) throw new Error('cancelWorker: worker reference is empty')\n const opId = operationId.trim()\n if (!opId) throw new Error('cancelWorker: operationId is empty')\n const acknowledged = readWorkerCancellation(eventDir, opId)\n if (acknowledged) return acknowledged\n const source = options.source ?? 'human'\n const pending = readWorkerCancelRequests(eventDir).find((r) => r.operationId === opId)\n const request: WorkerCancelRequest = pending ?? {\n operationId: opId,\n at: new Date().toISOString(),\n source,\n worker: ref,\n ...(options.reason === undefined ? {} : { reason: options.reason }),\n }\n if (!pending) {\n mkdirSync(workerCancellationsDir(eventDir), { recursive: true })\n appendFileSync(workerCancelRequestsFile(eventDir), `${JSON.stringify(request)}\\n`, 'utf8')\n appendWorkerControlEvent(eventDir, ref, {\n kind: 'cancel-request',\n operationId: opId,\n source,\n queued: true,\n ...(options.reason === undefined ? {} : { reason: options.reason }),\n })\n }\n return {\n operationId: opId,\n worker: request.worker,\n effect: 'unknown',\n requestedAt: request.at,\n observedAt: request.at,\n ...(request.reason === undefined ? {} : { reason: request.reason }),\n detail: 'request queued; no runtime acknowledger has answered yet',\n terminated: [],\n }\n}\n\nfunction isWorkerCancelRequest(value: Partial<WorkerCancelRequest>): value is WorkerCancelRequest {\n return (\n typeof value.operationId === 'string' &&\n value.operationId.length > 0 &&\n typeof value.at === 'string' &&\n typeof value.source === 'string' &&\n typeof value.worker === 'string' &&\n value.worker.length > 0 &&\n (value.reason === undefined || typeof value.reason === 'string')\n )\n}\n\nfunction appendWorkerControlEvent(\n eventDir: string,\n label: string,\n event: Record<string, unknown>,\n): void {\n try {\n mkdirSync(supervisorWorkersDir(eventDir), { recursive: true })\n appendFileSync(\n workerControlLogFile(eventDir, label),\n `${JSON.stringify({ at: new Date().toISOString(), label, ...event })}\\n`,\n 'utf8',\n )\n } catch {\n // Control logging is best-effort; the inbox write above is the durable part.\n }\n}\n\nfunction isWorkerSteerRequest(value: Partial<WorkerSteerRequest>): value is WorkerSteerRequest {\n return (\n typeof value.id === 'string' &&\n typeof value.at === 'string' &&\n typeof value.source === 'string' &&\n typeof value.worker === 'string' &&\n typeof value.message === 'string' &&\n value.message.trim().length > 0\n )\n}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GAAG,EAAE,WAAW,KAAK,CAAC;EAC7D,eACE,qBAAqB,UAAU,KAAK,GACpC,GAAG,KAAK,UAAU;GAAE,qBAAI,IAAI,KAAK,EAAA,CAAE,YAAY;GAAG;GAAO,GAAG;EAAM,CAAC,EAAE,KACrE,MACF;CACF,QAAQ,CAER;AACF;AAEA,SAAS,qBAAqB,OAAiE;CAC7F,OACE,OAAO,MAAM,OAAO,YACpB,OAAO,MAAM,OAAO,YACpB,OAAO,MAAM,WAAW,YACxB,OAAO,MAAM,WAAW,YACxB,OAAO,MAAM,YAAY,YACzB,MAAM,QAAQ,KAAK,CAAC,CAAC,SAAS;AAElC"}
@@ -6,13 +6,13 @@ import { i as redactProtectedValue, r as redactProtectedReason } from "./protect
6
6
  import { a as notifySandboxEventObserver, c as parseCanonicalTransportEvent, s as extractTransportEventIdentity } from "./sandbox-events-CA2amHoA.js";
7
7
  import { c as profileProviderModel, i as concreteModelId, s as profileModelExecutionSettings, t as assertExecutableAgentProfile } from "./model-policy-UTTc9Z-A.js";
8
8
  import { E as executableAgentSpecSnapshot, T as executableAgentProfileSnapshot } from "./materialization-BP5zspr2.js";
9
- import { E as rollingDispatch, I as createExecutor, L as createExecutorRegistry, ct as canonicalObservedModel, g as settledToIteration, it as probeSandboxCapabilities, l as withDriverExecutor, n as createSupervisor, nt as runAgentRounds, ot as routerBrain, q as createPushTraceSource, rt as createSandboxLineage, st as runBrainLoop, tt as defaultSelectWinner, z as createWorktreeCliExecutor } from "./supervisor-BU01azdt.js";
9
+ import { E as rollingDispatch, I as createExecutor, L as createExecutorRegistry, ct as canonicalObservedModel, g as settledToIteration, it as probeSandboxCapabilities, l as withDriverExecutor, n as createSupervisor, nt as runAgentRounds, ot as routerBrain, q as createPushTraceSource, rt as createSandboxLineage, st as runBrainLoop, tt as defaultSelectWinner, z as createWorktreeCliExecutor } from "./supervisor-Dl9Fk7g5.js";
10
10
  import "./environment-provider-CLNVqp6H.js";
11
11
  import { i as notifyRuntimeHookEvent } from "./runtime-hooks-C7iJOWm3.js";
12
- import { C as observe, O as strategyAuthorMethod, T as profileChatClient, b as sample, v as refine, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-CbQjaMwW.js";
13
- import { It as gateOnDeliverable, Lt as mapExecutorResult, n as supervise } from "./supervise-B8Ykk8GO.js";
14
- import "./authoring-CK6iXftK.js";
15
- import "./graph-9KF7mJM3.js";
12
+ import { C as observe, O as strategyAuthorMethod, T as profileChatClient, b as sample, v as refine, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-BMnPPcJP.js";
13
+ import { It as gateOnDeliverable, Lt as mapExecutorResult, n as supervise } from "./supervise-B-nTWUCK.js";
14
+ import "./authoring-DHVHhbJO.js";
15
+ import "./graph-BWsEZmDL.js";
16
16
  import { CODING_HARNESSES, InMemoryTraceStore, OUTPUT_VALUE, benjaminiHochberg, buildTrajectory, computeFindingId as computeFindingId$1, confidenceInterval, expandProfileAxes, makeFinding as makeFinding$1, pairedBootstrap, paretoFrontier, wilcoxonSignedRank, wilson } from "@tangle-network/agent-eval";
17
17
  import { heldoutSignificance, runProfileMatrix } from "@tangle-network/agent-eval/campaign";
18
18
  import { AgentEnvironmentCapabilitiesSchema, AgentExactRunControlRefSchema, AgentNativeContextContinuationResultSchema, AgentRunCancellationAcknowledgementSchema, AgentRunCancellationRequestSchema, AgentTurnResultSchema, InteractionAcknowledgementSchema, InteractionResponseCommandSchema, NativeContextBoundaryProofSchema, NativeContextContinuationRequestSchema, RuntimeEventEnvelopeSchema, agentNativeContextContinuationResultMatchesRequest, agentProfileSchema, agentRunCancellationAcknowledgementMatchesRequest, agentRunCancellationRequestDigest, canonicalAgentProfileDigest, canonicalCandidateDigest, nativeContextContinuationTurnDigest, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
@@ -6672,4 +6672,4 @@ function tail(s) {
6672
6672
  //#endregion
6673
6673
  export { FileCorpus as $, pickChampion as A, renderLeaderboardMarkdown as At, runBenchmark as B, envKeyProvider as Bt, analyzeTrace as C, completionAuthorizes as Ct, chatWorkerSeam as D, leaderboard as Dt, chatTransportExecutor as E, stopSentinel as Et, strategyAuthorContract as F, McpSpawnFault as Ft, promotionGate as G, recoverRetainedRun as H, resolveMcpServerLaunch as Ht, strategyAuthorSystemPrompt as I, connectStdioMcp as It, definePersona as J, equalKOnCost as K, SandboxRunAbortError as L, materializeLocalMcp as Lt, selectChampion as M, renderPairwiseMarkdown as Mt, assertStrategyContract as N, auditIntent as Nt, createChatSessionStore as O, pairwiseSignificance as Ot, authorStrategy as P, defaultAuditorInstruction as Pt, registerShape as Q, openSandboxRun as R, createMcpEnvironment as Rt, withUntrackedArtifacts as S, superviseDispatch as St, runCoderChecks as T, sentinelCompletion as Tt, startRetainedRun as U, resolveSecretEnv as Ut, reconnectRetainedRun as V, mcpSecretEnvMetadataKey as Vt, startRetainedRunInEnvironment as W, secretEnvOfMcpServer as Wt, builtinShapes as X, runPersonified as Y, createShapeRegistry as Z, VERIFY_TAIL_CHARS as _, resolveSandboxClient as _t, localShell as a, panel as at, settledWorkerOut as b, loopCampaignDispatch as bt, createVerifierEnvironment as c, verify as ct, harvestSurfaceDiffs as d, buildSteerContext as dt, InMemoryCorpus as et, failuresAnalyst as f, createScopeAnalyst as ft, NOTE_MAX_CHARS as g, defineLeaderboard as gt, EVIDENCE_MAX_CHARS as h, harvestCorpus as ht, jjWorkspace as i, loopUntil as it, runStrategyEvolution as j, renderLeaderboardSvg as jt, discriminatingMeans as k, renderLeaderboardHtml as kt, boxSurfaceReader as l, widen as lt, worktreeFanout as m, inProcessSandboxClient as mt, makeFinding$1 as n, fanout as nt, runInWorkspace as o, pipeline as ot, superviseSurface as p, registryScopeAnalyst as pt, trajectoryReport as q, gitWorkspace as r, flatWidenGate as rt, createWaterfallCollector as s, selectValidWinner as st, computeFindingId$1 as t, renderCorpusToInstructions as tt, fsSurfaceReader as u, assertTraceDerivedFindings as ut, closingWorkerNote as v, localSandboxClient as vt, patchDelivered as w, deterministicCompletion as wt, copyUntrackedIntoClone as x, loopDispatch as xt, composeWorkerEvidence as y, inlineSandboxClient as yt, printBenchmarkReport as z, sanitizeMcpToolSchema as zt };
6674
6674
 
6675
- //# sourceMappingURL=runtime-CnQ_-DF_.js.map
6675
+ //# sourceMappingURL=runtime-BZsDYscs.js.map