@tangle-network/agent-runtime 0.164.0 → 0.166.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 (70) hide show
  1. package/dist/{activation-CneAm4jL.js → activation-BkO0p4I1.js} +3 -3
  2. package/dist/{activation-CneAm4jL.js.map → activation-BkO0p4I1.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +2 -2
  5. package/dist/{authoring-CZM22nUG.js → authoring-Bt17KOML.js} +2 -2
  6. package/dist/{authoring-CZM22nUG.js.map → authoring-Bt17KOML.js.map} +1 -1
  7. package/dist/candidate-execution/index.js +4 -4
  8. package/dist/{candidate-execution-DNLk6h0A.js → candidate-execution-DC0T8l2p.js} +4 -4
  9. package/dist/{candidate-execution-DNLk6h0A.js.map → candidate-execution-DC0T8l2p.js.map} +1 -1
  10. package/dist/conversation.d.ts +1 -1
  11. package/dist/durable.d.ts +2 -2
  12. package/dist/durable.js +1 -1
  13. package/dist/{environment-provider-BXFFK_rZ.d.ts → environment-provider-DWjbGH8W.d.ts} +2 -2
  14. package/dist/environment-provider.d.ts +1 -1
  15. package/dist/graph-E0U0c2YP.js +2668 -0
  16. package/dist/graph-E0U0c2YP.js.map +1 -0
  17. package/dist/graph.d.ts +319 -53
  18. package/dist/graph.js +2 -1203
  19. package/dist/{improvement-cycle-a_L8FFql.js → improvement-cycle-BAWOyeTA.js} +4 -4
  20. package/dist/{improvement-cycle-a_L8FFql.js.map → improvement-cycle-BAWOyeTA.js.map} +1 -1
  21. package/dist/{index-BP11HXYi.d.ts → index-BGQtpQuJ.d.ts} +5 -5
  22. package/dist/{index-C2X-OVPZ.d.ts → index-BgptUCKl.d.ts} +4 -4
  23. package/dist/{index-OFOvnNc2.d.ts → index-CFMB9ux3.d.ts} +2 -2
  24. package/dist/index.d.ts +7 -7
  25. package/dist/index.js +11 -11
  26. package/dist/intelligence.d.ts +4 -4
  27. package/dist/intelligence.js +5 -5
  28. package/dist/kernel.d.ts +5 -5
  29. package/dist/kernel.js +7 -7
  30. package/dist/{knowledge-Ccdghy81.js → knowledge-Bhhz6lvH.js} +5 -5
  31. package/dist/{knowledge-Ccdghy81.js.map → knowledge-Bhhz6lvH.js.map} +1 -1
  32. package/dist/knowledge.d.ts +1 -1
  33. package/dist/knowledge.js +1 -1
  34. package/dist/{loop-runner-bin-DM-AnPC-.js → loop-runner-bin-BQnpSn0h.js} +3 -3
  35. package/dist/{loop-runner-bin-DM-AnPC-.js.map → loop-runner-bin-BQnpSn0h.js.map} +1 -1
  36. package/dist/{loop-runner-bin-2NITRIFc.d.ts → loop-runner-bin-C2NXQK7J.d.ts} +3 -3
  37. package/dist/loop-runner-bin.d.ts +1 -1
  38. package/dist/loop-runner-bin.js +1 -1
  39. package/dist/mcp/bin.js +3 -3
  40. package/dist/mcp/index.d.ts +3 -3
  41. package/dist/mcp/index.js +4 -4
  42. package/dist/{openai-tools-CIo9tB75.js → openai-tools-t6spVYKL.js} +2 -2
  43. package/dist/{openai-tools-CIo9tB75.js.map → openai-tools-t6spVYKL.js.map} +1 -1
  44. package/dist/{prepare-D7Fb75XR.js → prepare-BCScSDCv.js} +2 -2
  45. package/dist/{prepare-D7Fb75XR.js.map → prepare-BCScSDCv.js.map} +1 -1
  46. package/dist/primeintellect/index.d.ts +1 -1
  47. package/dist/{protected-model-port-RZkxRZhp.js → protected-model-port-D-5E3HBe.js} +2 -2
  48. package/dist/{protected-model-port-RZkxRZhp.js.map → protected-model-port-D-5E3HBe.js.map} +1 -1
  49. package/dist/{redact-D4vlt6p4.d.ts → redact-DkObldQP.d.ts} +3 -3
  50. package/dist/{runtime-D44YrQ4t.d.ts → runtime-B0HZbuEv.d.ts} +3 -3
  51. package/dist/{runtime-BDHsMgCK.js → runtime-BJoNta1Y.js} +7 -7
  52. package/dist/{runtime-BDHsMgCK.js.map → runtime-BJoNta1Y.js.map} +1 -1
  53. package/dist/{spawn-journal-oewq1g2h.js → spawn-journal-Tgvp5VS5.js} +8 -2
  54. package/dist/{spawn-journal-oewq1g2h.js.map → spawn-journal-Tgvp5VS5.js.map} +1 -1
  55. package/dist/{stream-agent-turn-Dx2YrEWW.d.ts → stream-agent-turn-DxQ3GOuR.d.ts} +2 -2
  56. package/dist/{structural-rollout-CBK2LHni.js → structural-rollout-B5E0mWCH.js} +3 -3
  57. package/dist/{structural-rollout-CBK2LHni.js.map → structural-rollout-B5E0mWCH.js.map} +1 -1
  58. package/dist/{supervise-CzllE0vn.js → supervise-CnxqHx1P.js} +3 -3
  59. package/dist/{supervise-CzllE0vn.js.map → supervise-CnxqHx1P.js.map} +1 -1
  60. package/dist/{supervisor-D5K8ihKQ.js → supervisor-C8kgh8mf.js} +29 -6
  61. package/dist/{supervisor-D5K8ihKQ.js.map → supervisor-C8kgh8mf.js.map} +1 -1
  62. package/dist/testing.d.ts +2 -2
  63. package/dist/testing.js +12 -12
  64. package/dist/{types-C2l1jaos.d.ts → types-DjVO-p7R.d.ts} +58 -3
  65. package/dist/{workspace-archive-DK0mDjSB.js → workspace-archive-CHY5HvrF.js} +2 -2
  66. package/dist/{workspace-archive-DK0mDjSB.js.map → workspace-archive-CHY5HvrF.js.map} +1 -1
  67. package/package.json +1 -1
  68. package/dist/graph-DzE4SwfP.js +0 -532
  69. package/dist/graph-DzE4SwfP.js.map +0 -1
  70. package/dist/graph.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { C as runtimeOwnedScopeOwnerRuntime, S as runtimeOwnedPendingExecutorMaterialization, T as unknownMaterializationReceipt, _ as runtimeOwnedDeferredExecutorRuntime, a as authoredProfileDigest, b as runtimeOwnedExecutorMaterialization, c as knownExecutionBindingReceipt, g as recordRuntimeOwnedProviderModel, h as recordRuntimeOwnedProviderIdentityConflict, l as knownMaterializationReceipt, m as recordRuntimeOwnedProviderDispatchNotStarted, n as attestRuntimeOwnedExecutor, o as finalizeRuntimeOwnedPendingExecutor, p as recordRuntimeOwnedProviderAttemptStart, r as attestRuntimeOwnedPendingExecutor, s as inheritRuntimeOwnedExecutorAttestation, t as attestRuntimeOwnedDeferredExecutor, u as newExecutionAttemptId, w as unknownExecutionBindingReceipt, x as runtimeOwnedExecutorProviderEvidence, y as runtimeOwnedExecutorExecutionBinding } from "./materialization-Ct3I4wu3.js";
2
2
  import { f as RuntimeRunStateError, m as ValidationError, r as BackendTransportError } from "./errors-CDZ8XsVj.js";
3
3
  import { n as detachedSnapshot } from "./snapshot-CTAf4uuA.js";
4
- import { _ as captureWorkerTraceEvidence, a as aggregateProviderModelEvidence, c as loadSpawnForest, d as replaySpawnTree, f as attestNestedDriverTreeOwner, h as runtimeOwnedNestedDriverTreeRoot, l as materializeTreeView, m as nestedDriverTreeRoot, o as closesCursorSlot, p as driverRuntime, u as pendingWaits, x as contentAddress } from "./spawn-journal-oewq1g2h.js";
4
+ import { _ as captureWorkerTraceEvidence, a as aggregateProviderModelEvidence, c as loadSpawnForest, d as replaySpawnTree, f as attestNestedDriverTreeOwner, h as runtimeOwnedNestedDriverTreeRoot, l as materializeTreeView, m as nestedDriverTreeRoot, o as closesCursorSlot, p as driverRuntime, u as pendingWaits, x as contentAddress } from "./spawn-journal-Tgvp5VS5.js";
5
5
  import { _ as unmeteredSpend, a as cloneTokenUsage, b as zeroTokenUsage, d as randomSuffix, f as randomUuid, g as throwIfAborted, h as throwAbort, l as mapWithConcurrency, m as stringifySafe, n as addTokenUsage, o as deleteBoxSafe, p as sleep, r as chargedTokens, s as hasCompleteCacheBreakdown, t as addSpend, u as promptCacheTokenClasses, v as withTimeout, y as zeroSpend } from "./util-D6ZEuBMi.js";
6
6
  import { c as notifySandboxEventObserver, i as extractLlmCallEvent, l as sandboxEventServedBackend, r as createSandboxToolPartState, s as mapSandboxToolEvent, t as assertSandboxServedModel, u as sandboxProgressEvents } from "./sandbox-events-BVjstFgb.js";
7
7
  import { n as executableAgentSpecSnapshot, r as projectSandboxOutcome, t as executableAgentProfileSnapshot } from "./executable-spec-CkGvdPds.js";
@@ -7973,7 +7973,7 @@ const bridgeExecutor = (spec, ctx) => {
7973
7973
  },
7974
7974
  onProfileMaterialization: (receipt) => {
7975
7975
  if (acknowledged !== void 0) {
7976
- if (JSON.stringify(acknowledged) !== JSON.stringify(receipt)) throw new ValidationError("bridgeExecutor: profile materialization changed across session turns");
7976
+ if (JSON.stringify(stripMaterializationObservation(acknowledged)) !== JSON.stringify(stripMaterializationObservation(receipt))) throw new ValidationError("bridgeExecutor: profile materialization changed across session turns");
7977
7977
  return;
7978
7978
  }
7979
7979
  acknowledged = receipt;
@@ -8948,6 +8948,25 @@ function assertBridgeProfileMaterialization(value, profile, wireModel) {
8948
8948
  unsupported: Object.freeze(unsupported)
8949
8949
  });
8950
8950
  }
8951
+ /**
8952
+ * Remove `inference.observation` — and ONLY that — before the cross-turn identity comparison.
8953
+ * cli-bridge's pi backend writes per-turn traffic and token counters into the receipt's
8954
+ * `inference.observation` block (`requests`, `generationRequests`, `usageReceipts`, the `usage`
8955
+ * token totals): a fresh measurement on every turn BY DESIGN, not profile identity, so two honest
8956
+ * receipts from the same session are never byte-equal and the raw compare refused every
8957
+ * multi-turn pi session at the end of turn 2. Every identity field stays compared: schema,
8958
+ * effectiveProfileDigest, harness, provider, model, reasoningEffort, workspacePlanDigest, files,
8959
+ * unsupported, and the stable inference identity (`effectiveEndpoint`, `apiMode`, `transport`,
8960
+ * `appliedMaxTokens`).
8961
+ */
8962
+ function stripMaterializationObservation(receipt) {
8963
+ if (receipt.inference === void 0) return receipt;
8964
+ const { observation: _observation, ...inferenceIdentity } = receipt.inference;
8965
+ return {
8966
+ ...receipt,
8967
+ inference: inferenceIdentity
8968
+ };
8969
+ }
8951
8970
  function parseBridgeInferenceReceipt(value) {
8952
8971
  if (typeof value !== "object" || value === null || Array.isArray(value)) throw new ValidationError("bridgeExecutor: profile materialization receipt has an invalid inference block");
8953
8972
  const raw = value;
@@ -10578,13 +10597,16 @@ function createWaitProbes(entries) {
10578
10597
  function isWaitOutcome(value) {
10579
10598
  return typeof value === "object" && value !== null && value.waitOutcome === true;
10580
10599
  }
10581
- /** The absolute instant a spec is bounded by, or `undefined` for an unbounded poll. */
10600
+ /** The absolute instant a spec is bounded by, or `undefined` for an unbounded wait. */
10582
10601
  function waitUntil(spec) {
10583
- return spec.kind === "timer" ? spec.untilMs : spec.timeoutAtMs;
10602
+ if (spec.kind === "timer") return spec.untilMs;
10603
+ if (spec.kind === "token") return spec.expiresAtMs;
10604
+ return spec.timeoutAtMs;
10584
10605
  }
10585
10606
  /** Structural validation, independent of the run. Returns null when the spec is usable. */
10586
10607
  function validateWaitSpec(spec) {
10587
10608
  if (spec.kind === "timer") return Number.isFinite(spec.untilMs) ? null : "timer.untilMs must be a finite epoch-ms instant";
10609
+ if (spec.kind === "token") return "token waits are graph-engine-owned; deliver them through engine resume/expire";
10588
10610
  if (typeof spec.probe !== "string" || spec.probe.length === 0) return "poll.probe must be a non-empty probe name";
10589
10611
  if (!Number.isFinite(spec.intervalMs) || spec.intervalMs <= 0) return "poll.intervalMs must be > 0";
10590
10612
  if (spec.timeoutAtMs !== void 0 && !Number.isFinite(spec.timeoutAtMs)) return "poll.timeoutAtMs must be a finite epoch-ms instant";
@@ -10627,6 +10649,7 @@ async function runWait(args) {
10627
10649
  outcome: outcome("timer", "fired", label, spec.untilMs, armedAt, now(), 0, 0, resumed)
10628
10650
  };
10629
10651
  }
10652
+ if (spec.kind === "token") throw new ValidationError(`wait '${label}': token waits are graph-engine-owned; deliver them through engine resume/expire`);
10630
10653
  const probe = args.probes?.resolve(spec.probe);
10631
10654
  if (!probe) throw new ValidationError(`wait '${label}': poll probe '${spec.probe}' is not registered in this run's WaitProbeRegistry`);
10632
10655
  let polls = 0;
@@ -13387,6 +13410,6 @@ function isNonEmptySpend(s) {
13387
13410
  return s.iterations > 0 || s.tokens.input > 0 || s.tokens.output > 0 || s.usd > 0 || s.ms > 0 || s.tokensKnown === false || s.usdKnown === false;
13388
13411
  }
13389
13412
  //#endregion
13390
- export { DEFAULT_STALL_AFTER_MS as $, LOCAL_HARNESSES as $t, createBudgetPool as A, buildLoopOtelSpans as At, createExecutorRegistry as B, padTraceId as Bt, effectiveConcurrency as C, canonicalObservedModel as Ct, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as D, readTraceContextFromEnv as Dt, rollingDispatch as E, mergeTraceEnv as Et, bridgeRuntimeAttachmentsKey as F, exportEvalRuns as Ft, workerTraceEnv as G, sanitizeKnowledgeReadinessReport as Gt, createWorktreeCliExecutor as H, createRuntimeEventCollector as Ht, bridgeStopSignalKey as I, flatOtelSpan as It, DEFAULT_SANDBOX_STEERING_MAX_TURNS as J, runWorktreeHarness as Jt, workerTraceHeaders as K, sanitizeRuntimeStreamEvent as Kt, captureReusableExecutorConfig as L, generateSpanId as Lt, bindReusableExecutorExecutionId as M, buildRuntimeEventOtelSpans as Mt, bridgeAdmissionRead as N, createOpenInferenceFileExporter as Nt, teardownExecutor as O, traceContextToEnv as Ot, bridgeModelRouteRefusal as P, createOtelExporter as Pt, sandboxSessionTraceSource as Q, DEFAULT_LOCAL_HARNESS as Qt, cliWorktreeExecutor as R, loopEventToOtelSpan as Rt, waitUntil as S, runBrainLoop as St, queueOf as T, createPropagatingTraceEmitter as Tt, WORKER_TRACE_PROPAGATION as U, createRuntimeStreamEventCollector as Ut, snapshotExecutorConfig as V, toOtelAttributes as Vt, readWorkerTraceContext as W, sanitizeAgentRuntimeEvent as Wt, createPushTraceSource as X, createWorktree as Xt, createSteerableSandboxSession as Y, captureWorktreeDiff as Yt, decodeToolPart as Z, removeWorktree as Zt, createWaitProbes as _, unsupportedProfileDimensions as _n, runAgentRounds as _t, pickBestDelivered as a, assertProfileMaterialization as an, PEER_MAIL_WIRE_KEY as at, timerAt as b, acquireSandbox as bt, driverChild as c, fullProfileMaterialization as cn, isPeerMailEnvelope as ct, deriveNodeExecutionIdentity as d, promptModelProfileMaterialization as dn, isLiveNodeStatus as dt, harnessSupportsReasoningEffort as en, createActivityLog as et, meterRuntimeOwnedAccounting as f, promptOnlyProfileMaterialization as fn, isTerminalNodeStatus as ft, settledToIteration as g, sandboxActProfileMaterialization as gn, isTerminalDecision as gt, scopeOwnerExecutorNodeContext as h, renderUnsupported as hn, defaultSelectWinner as ht, collectDelivered as i, AGENT_PROFILE_MATERIALIZATION_AXES as in, DEFAULT_PEER_MAIL_LIMITS as it, spendFromUsageEvents as j, buildLoopSpanNodes as jt, assertValidBudget as k, INTELLIGENCE_WIRE_VERSION as kt, withDriverExecutor as l, profileMaterializationAxes$1 as ln, peerMailTools as lt, recordScopeOwnerMaterialization as m, renderProfileMaterializationIssues as mn, createSandboxForSpec as mt, createSupervisor as n, parseCodexTokenUsage as nn, createInbox as nt, runFinalizer as o, controlProfileMaterialization as on, claimsAuthority as ot, meterRuntimeOwnedProviderAttempt as p, promptResourceProfileMaterialization as pn, TERMINAL_DECISIONS as pt, workerTraceSeamKey as q, runSettledCommand as qt, bestDelivered as r, CodexExecutionDiagnosticError as rn, AUTHORITY_MARKERS as rt, runTree as s, defineProfileMaterializationContract as sn, createPeerMailbox as st, createRootHandle as t, localHarnessExecutable as tn, readWorkerProgress as tt, createScope as u, promptControlProfileMaterialization as un, peerMailVerbNames as ut, isWaitOutcome as v, validateProfileMaterialization as vn, createSandboxLineage as vt, freeSlots as w, observedModelMatchesDeclared as wt, validateWaitSpec as x, routerBrain as xt, pollFor as y, worktreeCliProfileMaterialization as yn, probeSandboxCapabilities as yt, createExecutor as z, padSpanId as zt };
13413
+ export { createPushTraceSource as $, createWorktree as $t, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as A, readTraceContextFromEnv as At, captureReusableExecutorConfig as B, generateSpanId as Bt, timerAt as C, acquireSandbox as Ct, freeSlots as D, observedModelMatchesDeclared as Dt, effectiveConcurrency as E, canonicalObservedModel as Et, bindReusableExecutorExecutionId as F, buildRuntimeEventOtelSpans as Ft, createWorktreeCliExecutor as G, createRuntimeEventCollector as Gt, createExecutor as H, padSpanId as Ht, bridgeAdmissionRead as I, createOpenInferenceFileExporter as It, workerTraceEnv as J, sanitizeKnowledgeReadinessReport as Jt, WORKER_TRACE_PROPAGATION as K, createRuntimeStreamEventCollector as Kt, bridgeModelRouteRefusal as L, createOtelExporter as Lt, assertValidBudget as M, INTELLIGENCE_WIRE_VERSION as Mt, createBudgetPool as N, buildLoopOtelSpans as Nt, queueOf as O, createPropagatingTraceEmitter as Ot, spendFromUsageEvents as P, buildLoopSpanNodes as Pt, createSteerableSandboxSession as Q, captureWorktreeDiff as Qt, bridgeRuntimeAttachmentsKey as R, exportEvalRuns as Rt, pollFor as S, worktreeCliProfileMaterialization as Sn, probeSandboxCapabilities as St, waitUntil as T, runBrainLoop as Tt, createExecutorRegistry as U, padTraceId as Ut, cliWorktreeExecutor as V, loopEventToOtelSpan as Vt, snapshotExecutorConfig as W, toOtelAttributes as Wt, workerTraceSeamKey as X, runSettledCommand as Xt, workerTraceHeaders as Y, sanitizeRuntimeStreamEvent as Yt, DEFAULT_SANDBOX_STEERING_MAX_TURNS as Z, runWorktreeHarness as Zt, recordScopeOwnerMaterialization as _, renderProfileMaterializationIssues as _n, createSandboxForSpec as _t, uncertainSpawnBudgets as a, parseCodexTokenUsage as an, createInbox as at, createWaitProbes as b, unsupportedProfileDimensions as bn, runAgentRounds as bt, pickBestDelivered as c, assertProfileMaterialization as cn, PEER_MAIL_WIRE_KEY as ct, driverChild as d, fullProfileMaterialization as dn, isPeerMailEnvelope as dt, removeWorktree as en, decodeToolPart as et, withDriverExecutor as f, profileMaterializationAxes$1 as fn, peerMailTools as ft, meterRuntimeOwnedProviderAttempt as g, promptResourceProfileMaterialization as gn, TERMINAL_DECISIONS as gt, meterRuntimeOwnedAccounting as h, promptOnlyProfileMaterialization as hn, isTerminalNodeStatus as ht, sumMeasuredSpendFromEvents as i, localHarnessExecutable as in, readWorkerProgress as it, teardownExecutor as j, traceContextToEnv as jt, rollingDispatch as k, mergeTraceEnv as kt, runFinalizer as l, controlProfileMaterialization as ln, claimsAuthority as lt, deriveNodeExecutionIdentity as m, promptModelProfileMaterialization as mn, isLiveNodeStatus as mt, createSupervisor as n, LOCAL_HARNESSES as nn, DEFAULT_STALL_AFTER_MS as nt, bestDelivered as o, CodexExecutionDiagnosticError as on, AUTHORITY_MARKERS as ot, createScope as p, promptControlProfileMaterialization as pn, peerMailVerbNames as pt, readWorkerTraceContext as q, sanitizeAgentRuntimeEvent as qt, maxSeqOf as r, harnessSupportsReasoningEffort as rn, createActivityLog as rt, collectDelivered as s, AGENT_PROFILE_MATERIALIZATION_AXES as sn, DEFAULT_PEER_MAIL_LIMITS as st, createRootHandle as t, DEFAULT_LOCAL_HARNESS as tn, sandboxSessionTraceSource as tt, runTree as u, defineProfileMaterializationContract as un, createPeerMailbox as ut, scopeOwnerExecutorNodeContext as v, renderUnsupported as vn, defaultSelectWinner as vt, validateWaitSpec as w, routerBrain as wt, isWaitOutcome as x, validateProfileMaterialization as xn, createSandboxLineage as xt, settledToIteration as y, sandboxActProfileMaterialization as yn, isTerminalDecision as yt, bridgeStopSignalKey as z, flatOtelSpan as zt };
13391
13414
 
13392
- //# sourceMappingURL=supervisor-D5K8ihKQ.js.map
13415
+ //# sourceMappingURL=supervisor-C8kgh8mf.js.map