@tangle-network/agent-runtime 0.343.4 → 0.348.1

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 (68) hide show
  1. package/dist/{activation-C5rFWXGj.js → activation-BEGalhOL.js} +2 -2
  2. package/dist/{activation-C5rFWXGj.js.map → activation-BEGalhOL.js.map} +1 -1
  3. package/dist/{activation-NJiV0MHb.d.ts → activation-NQZP_mdI.d.ts} +2 -2
  4. package/dist/agent.d.ts +1 -1
  5. package/dist/agent.js +3 -3
  6. package/dist/{coordination-manager-T98ZbsEt.js → coordination-manager-Bm6leXc6.js} +22 -19
  7. package/dist/coordination-manager-Bm6leXc6.js.map +1 -0
  8. package/dist/{delegate-CjdtLf1v.js → delegate-Cp5-PsaX.js} +2 -2
  9. package/dist/{delegate-CjdtLf1v.js.map → delegate-Cp5-PsaX.js.map} +1 -1
  10. package/dist/durable.d.ts +7 -2
  11. package/dist/durable.js +127 -115
  12. package/dist/durable.js.map +1 -1
  13. package/dist/{graph-kgzTaNMA.js → graph-CE_pzU31.js} +5 -4
  14. package/dist/graph-CE_pzU31.js.map +1 -0
  15. package/dist/{improve-DevAd83a.js → improve-wT11zteg.js} +6 -6
  16. package/dist/{improve-DevAd83a.js.map → improve-wT11zteg.js.map} +1 -1
  17. package/dist/index.d.ts +3 -3
  18. package/dist/index.js +7 -7
  19. package/dist/intelligence.d.ts +2 -2
  20. package/dist/intelligence.js +3 -3
  21. package/dist/kernel.d.ts +2 -2
  22. package/dist/kernel.js +11 -11
  23. package/dist/{loop-runner-D56Rpd2z.d.ts → loop-runner-CY5HHhtR.d.ts} +2 -2
  24. package/dist/{loop-runner-CyUoVMkv.js → loop-runner-CZzeeJTG.js} +2 -2
  25. package/dist/{loop-runner-CyUoVMkv.js.map → loop-runner-CZzeeJTG.js.map} +1 -1
  26. package/dist/loop-runner-bin.d.ts +1 -1
  27. package/dist/loop-runner-bin.js +1 -1
  28. package/dist/mcp/bin.js +3 -3
  29. package/dist/mcp/index.d.ts +1 -1
  30. package/dist/mcp/index.js +5 -5
  31. package/dist/mcp/index.js.map +1 -1
  32. package/dist/profiles.d.ts +1 -1
  33. package/dist/{provision-supervisor-CysVhSqV.js → provision-supervisor-CC0HdOHo.js} +5 -5
  34. package/dist/{provision-supervisor-CysVhSqV.js.map → provision-supervisor-CC0HdOHo.js.map} +1 -1
  35. package/dist/{durable-file-DLcrzrjL.js → record-events-D93DkpAx.js} +100 -3
  36. package/dist/record-events-D93DkpAx.js.map +1 -0
  37. package/dist/{run-cancellation-CEDiqfhC.js → run-cancellation-CzFhQGMa.js} +11 -9
  38. package/dist/run-cancellation-CzFhQGMa.js.map +1 -0
  39. package/dist/{runtime-CefFtXC2.js → runtime-B_40dXlF.js} +270 -57
  40. package/dist/runtime-B_40dXlF.js.map +1 -0
  41. package/dist/{search-executor-t05_9Wwk.js → search-executor-COd2F2wp.js} +2 -2
  42. package/dist/{search-executor-t05_9Wwk.js.map → search-executor-COd2F2wp.js.map} +1 -1
  43. package/dist/{server-DjrVWzH2.js → server-BGB4R4wQ.js} +3 -3
  44. package/dist/{server-DjrVWzH2.js.map → server-BGB4R4wQ.js.map} +1 -1
  45. package/dist/{structural-rollout-CpJknIaL.js → structural-rollout-Wl_rCuzM.js} +2 -2
  46. package/dist/{structural-rollout-CpJknIaL.js.map → structural-rollout-Wl_rCuzM.js.map} +1 -1
  47. package/dist/{supervise-BuVVC7Bl.js → supervise-BUOeThuB.js} +122 -63
  48. package/dist/supervise-BUOeThuB.js.map +1 -0
  49. package/dist/{supervisor-D3M9ab1v.js → supervisor-DDy0aEtR.js} +438 -170
  50. package/dist/supervisor-DDy0aEtR.js.map +1 -0
  51. package/dist/testing.d.ts +1 -1
  52. package/dist/testing.js +11 -11
  53. package/dist/{top-snapshot-BGYI6G6K.js → top-snapshot-CflmaDgk.js} +6 -4
  54. package/dist/top-snapshot-CflmaDgk.js.map +1 -0
  55. package/dist/tui/bin.js +2 -2
  56. package/dist/tui/index.d.ts +1 -1
  57. package/dist/tui/index.js +2 -2
  58. package/dist/{types-D0ZRqIJh.d.ts → types-hc4cmSc7.d.ts} +102 -13
  59. package/package.json +11 -11
  60. package/skills/agent-graphs/SKILL.md +38 -2
  61. package/dist/coordination-manager-T98ZbsEt.js.map +0 -1
  62. package/dist/durable-file-DLcrzrjL.js.map +0 -1
  63. package/dist/graph-kgzTaNMA.js.map +0 -1
  64. package/dist/run-cancellation-CEDiqfhC.js.map +0 -1
  65. package/dist/runtime-CefFtXC2.js.map +0 -1
  66. package/dist/supervise-BuVVC7Bl.js.map +0 -1
  67. package/dist/supervisor-D3M9ab1v.js.map +0 -1
  68. package/dist/top-snapshot-BGYI6G6K.js.map +0 -1
@@ -1,5 +1,6 @@
1
- import { Ai as detachedFrozen, Bi as assertValidBudget, C as FileSpawnJournal, Gn as isTerminalNodeStatus, In as createPeerMailbox, M as runtimeGraphMetadataKey, Mi as contentAddress, Pi as errMessage, Ui as resolveRedactor, Wn as isLiveNodeStatus, _t as readCommittedJsonLines, ar as CheckUnavailableError, d as withDriverExecutor, dt as InMemorySpawnJournal, fr as checkVerdictOf, ft as FileResultBlobStore, g as workerTraceAnalysisStore, h as parseWorkerToolTraceArtifact, kn as INBOX_RECEIPT_KEY, mr as failedItems, pt as appendCommittedJsonLine, q as resolveSpawnResourcePaths, ut as InMemoryResultBlobStore, xt as createExecutorRegistry, yi as settlementFailureCause, z as meterRuntimeOwnedAccounting } from "./supervisor-D3M9ab1v.js";
2
- import { C as writeWorkerCancellation, T as writeWorkerSteerAcknowledgement, c as writeRunCancellation, g as readWorkerSteerRequests, h as readWorkerSteerAcknowledgement, i as readRunCancellation, m as readWorkerCancellation, p as readWorkerCancelRequests, r as readRunCancelRequest, t as applyRunCancellation, u as claimWorkerSteerDelivery } from "./run-cancellation-CEDiqfhC.js";
1
+ import { c as captureRunWriteContext, t as spawnJournalRecordEvents } from "./record-events-D93DkpAx.js";
2
+ import { $ as resolveSpawnResourcePaths, Ct as readCommittedJsonLines, Dt as createExecutorRegistry, Ei as settlementFailureCause, Fn as INBOX_RECEIPT_KEY, G as meterRuntimeOwnedAccounting, Hn as createPeerMailbox, Li as detachedFrozen, R as runtimeGraphMetadataKey, S as workerTraceAnalysisStore, Vi as errMessage, Xi as resolveRedactor, Xn as isLiveNodeStatus, Zn as isTerminalNodeStatus, _ as withDriverExecutor, _t as InMemorySpawnJournal, dr as CheckUnavailableError, gt as InMemoryResultBlobStore, k as FileSpawnJournal, qi as assertValidBudget, vt as FileResultBlobStore, x as parseWorkerToolTraceArtifact, xr as failedItems, yr as checkVerdictOf, yt as appendCommittedJsonLine, zi as contentAddress } from "./supervisor-DDy0aEtR.js";
3
+ import { C as writeWorkerCancellation, T as writeWorkerSteerAcknowledgement, c as writeRunCancellation, g as readWorkerSteerRequests, h as readWorkerSteerAcknowledgement, i as readRunCancellation, m as readWorkerCancellation, p as readWorkerCancelRequests, r as readRunCancelRequest, t as applyRunCancellation, u as claimWorkerSteerDelivery } from "./run-cancellation-CzFhQGMa.js";
3
4
  import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest } from "@tangle-network/agent-interface";
4
5
  import { argHash, errorStreakDetector, observeAll, repeatedActionDetector } from "@tangle-network/agent-eval";
5
6
  import { registry } from "zod";
@@ -32,13 +33,14 @@ function persisted(event) {
32
33
  /** FS-backed `CoordinationLog`: append-only JSONL, fsynced per record. */
33
34
  var FileCoordinationLog = class {
34
35
  path;
36
+ writeContext = captureRunWriteContext();
35
37
  appendTail = Promise.resolve();
36
38
  constructor(path) {
37
39
  this.path = path;
38
40
  }
39
41
  async append(runId, record, ownerId) {
40
42
  if (!persisted(record.event)) return;
41
- const append = this.appendTail.then(() => this.appendRecord(runId, record, ownerId));
43
+ const append = this.appendTail.then(() => this.writeContext(() => this.appendRecord(runId, record, ownerId)));
42
44
  this.appendTail = append.catch(() => void 0);
43
45
  return append;
44
46
  }
@@ -173,7 +175,7 @@ function createInMemoryRunContext(opts = {}) {
173
175
  * resumes when it is re-run with the SAME `runId` and the SAME `dir`: the committed children come
174
176
  * back on `Scope.resume` (rehydrated by `replaySpawnTree`) instead of being re-executed.
175
177
  *
176
- * Layout: `${dir}/spawn-journal.jsonl` (one JSONL record per event), `${dir}/blobs/` (one
178
+ * Layout: `${dir}/spawn-journal.jsonl` (single-event or atomic-group JSONL records), `${dir}/blobs/` (one
177
179
  * content-addressed JSON file per settled result), and `${dir}/coordination-log.jsonl`
178
180
  * (questions, findings, answer decisions, and authorized continuation receipts retained as
179
181
  * evidence). The directory is created on first write.
@@ -640,8 +642,9 @@ function createSteerAcknowledger(deps) {
640
642
  });
641
643
  return { async pass(phase) {
642
644
  for (const request of readWorkerSteerRequests(deps.dir)) {
643
- if (phase === "turn" && deps.signal?.aborted) return;
645
+ if (phase !== "final" && deps.signal?.aborted) return;
644
646
  const rootRequest = request.worker === deps.ownerId && deps.deliverRoot !== void 0;
647
+ if (phase === "boundary" && !rootRequest) continue;
645
648
  if (!rootRequest && !isDirectChildNodeId(deps, request.worker)) continue;
646
649
  const queued = awaiting.get(request.operationId);
647
650
  if (phase === "final" && queued !== void 0) {
@@ -954,18 +957,15 @@ function terminatedDescendants(dir, nodeId, sinceIso) {
954
957
  for (const line of raw.split("\n")) {
955
958
  const trimmed = line.trim();
956
959
  if (!trimmed) continue;
957
- let parsed;
958
960
  try {
959
- parsed = JSON.parse(trimmed);
960
- } catch {
961
- continue;
962
- }
963
- if (parsed.kind !== "event" || parsed.event === void 0) continue;
964
- const event = parsed.event;
965
- if (!(event.kind === "settled" && event.status === "down" || event.kind === "cancelled")) continue;
966
- if (typeof event.id !== "string" || !event.id.startsWith(prefix)) continue;
967
- if (typeof event.at !== "string" || event.at < sinceIso) continue;
968
- ids.add(event.id);
961
+ for (const event of spawnJournalRecordEvents(JSON.parse(trimmed))) {
962
+ if (event === void 0) continue;
963
+ if (!(event.kind === "settled" && event.status === "down" || event.kind === "cancelled")) continue;
964
+ if (typeof event.id !== "string" || !event.id.startsWith(prefix)) continue;
965
+ if (typeof event.at !== "string" || event.at < sinceIso) continue;
966
+ ids.add(event.id);
967
+ }
968
+ } catch {}
969
969
  }
970
970
  return [...ids].sort();
971
971
  }
@@ -2435,9 +2435,12 @@ async function settledWithoutDrain({ state, settlements }) {
2435
2435
  });
2436
2436
  await state.inFlightDrain;
2437
2437
  }
2438
- function hasOpenWork(env) {
2438
+ function hasOpenWork(env, options) {
2439
2439
  const { running, unqueued, queued } = env.workers.openWork();
2440
- return running.length > 0 || unqueued.length > 0 || queued.length > 0 || env.bus.pending(wakeEventKinds) > 0 || env.openReceiptCount() > 0 || env.leadPublishing() > 0 || env.settlements.isBusy();
2440
+ const includeSettled = options?.includeSettled !== false;
2441
+ const queuedWork = includeSettled ? queued.length > 0 : queued.some((record) => record.event.type !== "settled");
2442
+ const pending = includeSettled ? env.bus.pending(wakeEventKinds) > 0 : env.bus.queued([...wakeEventKinds, "question"]).some((record) => record.event.type !== "settled");
2443
+ return running.length > 0 || unqueued.length > 0 || queuedWork || pending || env.openReceiptCount() > 0 || env.leadPublishing() > 0 || env.settlements.isBusy();
2441
2444
  }
2442
2445
  function liveWorkersProgressing({ workers }) {
2443
2446
  const running = workers.openWork().running;
@@ -5610,4 +5613,4 @@ function createResumeReplay({ opts, bus, ledger, analysis, projectSettled }) {
5610
5613
  //#endregion
5611
5614
  export { createEventBus as a, budgetOverspendText as c, safeJsonText as d, createFileRunContext as f, foldCoordinationRecords as g, FileCoordinationLog as h, watchTrace as i, normalizeAnalyzeOnSettle as l, withRunContext as m, createCoordinationToolsForManager as n, createCancelAcknowledger as o, createInMemoryRunContext as p, defaultToolDetectors as r, createSteerAcknowledger as s, createCoordinationTools as t, coordinationVerbNames as u };
5612
5615
 
5613
- //# sourceMappingURL=coordination-manager-T98ZbsEt.js.map
5616
+ //# sourceMappingURL=coordination-manager-Bm6leXc6.js.map