@tangle-network/agent-runtime 0.134.5 → 0.134.7

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 (58) hide show
  1. package/dist/{activation-CuSUhjsU.js → activation-CG9bkirD.js} +2 -2
  2. package/dist/{activation-CuSUhjsU.js.map → activation-CG9bkirD.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +2 -2
  5. package/dist/{authoring-DDHudCL3.js → authoring-CK6iXftK.js} +2 -2
  6. package/dist/{authoring-DDHudCL3.js.map → authoring-CK6iXftK.js.map} +1 -1
  7. package/dist/{conversation-DYVSghi8.js → conversation-DIUtiLkC.js} +2 -2
  8. package/dist/{conversation-DYVSghi8.js.map → conversation-DIUtiLkC.js.map} +1 -1
  9. package/dist/conversation.d.ts +1 -1
  10. package/dist/conversation.js +1 -1
  11. package/dist/{environment-provider-DIRm41xB.d.ts → environment-provider-BIZMHOQw.d.ts} +2 -2
  12. package/dist/environment-provider.d.ts +1 -1
  13. package/dist/{graph-BBPlG9Gp.js → graph-9KF7mJM3.js} +2 -2
  14. package/dist/{graph-BBPlG9Gp.js.map → graph-9KF7mJM3.js.map} +1 -1
  15. package/dist/{improvement-cycle-6Vb0Ctl7.js → improvement-cycle-5XDmxqzr.js} +4 -4
  16. package/dist/{improvement-cycle-6Vb0Ctl7.js.map → improvement-cycle-5XDmxqzr.js.map} +1 -1
  17. package/dist/{index-DHA5Oq5I.d.ts → index-0qU8jNOJ.d.ts} +5 -5
  18. package/dist/{index-iyZFnLdC.d.ts → index-DJ9qeOi3.d.ts} +4 -4
  19. package/dist/{index-BbdLlSh6.d.ts → index-RYbM0cUo.d.ts} +2 -2
  20. package/dist/index.d.ts +7 -7
  21. package/dist/index.js +9 -9
  22. package/dist/intelligence.d.ts +4 -4
  23. package/dist/intelligence.js +3 -3
  24. package/dist/kernel.d.ts +5 -5
  25. package/dist/kernel.js +7 -7
  26. package/dist/{knowledge-oUglku41.js → knowledge-DWTOug6a.js} +3 -3
  27. package/dist/{knowledge-oUglku41.js.map → knowledge-DWTOug6a.js.map} +1 -1
  28. package/dist/knowledge.d.ts +1 -1
  29. package/dist/knowledge.js +1 -1
  30. package/dist/{loop-runner-bin-vVCZrAF2.js → loop-runner-bin-BCvwX9rk.js} +3 -3
  31. package/dist/{loop-runner-bin-vVCZrAF2.js.map → loop-runner-bin-BCvwX9rk.js.map} +1 -1
  32. package/dist/{loop-runner-bin-BLnkJfSV.d.ts → loop-runner-bin-W7MjoHUk.d.ts} +3 -3
  33. package/dist/loop-runner-bin.d.ts +1 -1
  34. package/dist/loop-runner-bin.js +1 -1
  35. package/dist/mcp/bin.js +3 -3
  36. package/dist/mcp/index.d.ts +3 -3
  37. package/dist/mcp/index.js +4 -4
  38. package/dist/{openai-tools-DfoZEyvI.js → openai-tools-ClNr92Bx.js} +2 -2
  39. package/dist/{openai-tools-DfoZEyvI.js.map → openai-tools-ClNr92Bx.js.map} +1 -1
  40. package/dist/primeintellect/index.d.ts +1 -1
  41. package/dist/{redact-DTVIFTeR.d.ts → redact-Bojh05mQ.d.ts} +3 -3
  42. package/dist/{runtime-DZql0Fnh.js → runtime-CnQ_-DF_.js} +7 -7
  43. package/dist/{runtime-DZql0Fnh.js.map → runtime-CnQ_-DF_.js.map} +1 -1
  44. package/dist/{runtime-C60zv0Q4.d.ts → runtime-DHrzFy2v.d.ts} +3 -3
  45. package/dist/{stream-agent-turn-BLuTjcvw.d.ts → stream-agent-turn-BEv31Log.d.ts} +2 -2
  46. package/dist/{stream-agent-turn-DYBpzMmq.js → stream-agent-turn-Q5ellSUu.js} +10 -1
  47. package/dist/stream-agent-turn-Q5ellSUu.js.map +1 -0
  48. package/dist/{structural-rollout-DkYIjD2D.js → structural-rollout-CbQjaMwW.js} +3 -3
  49. package/dist/{structural-rollout-DkYIjD2D.js.map → structural-rollout-CbQjaMwW.js.map} +1 -1
  50. package/dist/{supervise-B8qbdlFz.js → supervise-B8Ykk8GO.js} +2 -2
  51. package/dist/{supervise-B8qbdlFz.js.map → supervise-B8Ykk8GO.js.map} +1 -1
  52. package/dist/{supervisor-lbWTSscK.js → supervisor-BU01azdt.js} +58 -5
  53. package/dist/{supervisor-lbWTSscK.js.map → supervisor-BU01azdt.js.map} +1 -1
  54. package/dist/testing.d.ts +2 -2
  55. package/dist/testing.js +11 -11
  56. package/dist/{types-CfQbuWgo.d.ts → types-C7UNjVce.d.ts} +10 -3
  57. package/package.json +1 -1
  58. package/dist/stream-agent-turn-DYBpzMmq.js.map +0 -1
@@ -7951,9 +7951,34 @@ function providerDispatchFromErrorBody(body) {
7951
7951
  if (typeof error !== "object" || error === null) return void 0;
7952
7952
  return error.provider_dispatch === "not_started" ? "not_started" : void 0;
7953
7953
  }
7954
+ /**
7955
+ * Recover the upstream HTTP status the bridge reports inside its message text.
7956
+ *
7957
+ * `classifyDriverFailure` already splits a transport failure correctly by status — 408/429/5xx
7958
+ * retryable, other 4xx terminal — but it reads `error.status`, and a bridge stream error carries
7959
+ * the status only as text: `pi assistant turn failed: 400: {"message":"The max_tokens parameter
7960
+ * is illegal ..."}`. With `status` undefined the classifier takes its "unknown, so assume the
7961
+ * upstream had a bad moment" branch, and a malformed request is retried to the attempt ceiling.
7962
+ * Measured: a 400 `invalid_request_error` retried 12 times, and it fails identically every time.
7963
+ *
7964
+ * Anchored to `: <status>: ` so it matches the bridge's own framing and not a status-shaped number
7965
+ * inside a provider's prose. A body that names no status leaves `status` undefined, which keeps
7966
+ * the existing retry-on-unknown behaviour.
7967
+ */
7968
+ function upstreamStatusFromMessage(message) {
7969
+ const match = message?.match(/: (\d{3}): /);
7970
+ if (!match) return void 0;
7971
+ const status = Number(match[1]);
7972
+ return status >= 100 && status <= 599 ? status : void 0;
7973
+ }
7954
7974
  function bridgeUpstreamError(error, prefix) {
7955
7975
  const providerDispatch = error.provider_dispatch === "not_started" ? "not_started" : void 0;
7956
- return new BackendTransportError("bridge", `${prefix}: ${error.message ?? error.type ?? "unknown"}`, providerDispatch === void 0 ? void 0 : { providerDispatch });
7976
+ const status = typeof error.status === "number" ? error.status : upstreamStatusFromMessage(error.message);
7977
+ const options = {
7978
+ ...providerDispatch === void 0 ? {} : { providerDispatch },
7979
+ ...status === void 0 ? {} : { status }
7980
+ };
7981
+ return new BackendTransportError("bridge", `${prefix}: ${error.message ?? error.type ?? "unknown"}`, Object.keys(options).length === 0 ? void 0 : options);
7957
7982
  }
7958
7983
  function mergeBridgeObservedModel(current, next) {
7959
7984
  if (current === void 0 || current === next) return next;
@@ -10205,9 +10230,9 @@ function createScope(args) {
10205
10230
  const unknown = unknownMaterializationReceipt({
10206
10231
  authoredProfileDigest: profileDigest,
10207
10232
  runtime: executor.runtime,
10208
- reason: "executor-receipt-pending"
10233
+ reason: "executor-failed-before-receipt"
10209
10234
  });
10210
- const unknownBinding = unknownExecutionBindingReceipt(unknown, attemptId, "executor-receipt-pending");
10235
+ const unknownBinding = unknownExecutionBindingReceipt(unknown, attemptId, "executor-failed-before-receipt");
10211
10236
  await appendNodeMaterialization(args, id, ordinal, unknown, unknownBinding, now);
10212
10237
  live.materialization = unknown;
10213
10238
  live.executionBindings.push(unknownBinding);
@@ -11851,7 +11876,7 @@ function assertResumeContract(events, opts) {
11851
11876
  if (roots.length !== 1) throw new RuntimeRunStateError(`supervisor: resumed run '${opts.runId}' must contain exactly one root identity event; found ${roots.length}`);
11852
11877
  const recorded = roots[0];
11853
11878
  if (contentAddress(recorded.budget) !== contentAddress(opts.budget)) throw new RuntimeRunStateError(`supervisor: resume budget mismatch for run '${opts.runId}'; use a new runId to change limits`);
11854
- if (!sameOptionalIdentity(recorded.identity, opts.rootIdentity)) throw new RuntimeRunStateError(`supervisor: resume identity mismatch for run '${opts.runId}'; task, profile, candidate, and correlation must match`);
11879
+ if (!sameOptionalIdentity(recorded.identity, opts.rootIdentity)) throw new RuntimeRunStateError(`supervisor: resume identity mismatch for run '${opts.runId}'; ${describeIdentityMismatch(recorded.identity, opts.rootIdentity)}`);
11855
11880
  const receipts = events.filter((event) => event.kind === "materialized" && event.id === opts.runId);
11856
11881
  const expectedReceipt = rootMaterializationReceipt(opts);
11857
11882
  if (expectedReceipt === void 0) {
@@ -11897,6 +11922,34 @@ function sameOptionalIdentity(recorded, requested) {
11897
11922
  if (recorded === void 0 || requested === void 0) return recorded === requested;
11898
11923
  return contentAddress(recorded) === contentAddress(requested);
11899
11924
  }
11925
+ /**
11926
+ * Name the identity fields that actually differ, with both values.
11927
+ *
11928
+ * The identity is compared as one content address, so a mismatch is a single boolean and the
11929
+ * message could only list every field that MIGHT have caused it. A caller then has to diff four
11930
+ * digests by hand to learn which one moved, and the common cause — a task file regenerated with
11931
+ * one character different — is indistinguishable from a genuinely different profile.
11932
+ *
11933
+ * Digests are truncated because the prefix identifies them and the full 64 characters push the
11934
+ * real content off the end of a terminal line.
11935
+ */
11936
+ function describeIdentityMismatch(recorded, requested) {
11937
+ if (recorded === void 0) return "the recorded root carried no identity but this resume supplies one";
11938
+ if (requested === void 0) return "the recorded root carried an identity but this resume supplies none";
11939
+ const short = (value) => {
11940
+ if (value === void 0) return "(absent)";
11941
+ const text = typeof value === "string" ? value : JSON.stringify(value);
11942
+ return text.length > 20 ? `${text.slice(0, 20)}…` : text;
11943
+ };
11944
+ const differing = [
11945
+ "profileDigest",
11946
+ "taskDigest",
11947
+ "candidateDigest",
11948
+ "correlation"
11949
+ ].filter((field) => contentAddress(recorded[field]) !== contentAddress(requested[field])).map((field) => `${field} recorded ${short(recorded[field])} but resumed with ${short(requested[field])}`);
11950
+ if (differing.length === 0) return "the identity objects differ in shape while every known field matches";
11951
+ return `${differing.join("; ")} — use a new runId to change any of these`;
11952
+ }
11900
11953
  /** Validate caller-supplied root identity before any journal access. Fresh runs may omit identity,
11901
11954
  * but once supplied it is trusted durable evidence and therefore must be complete and canonical;
11902
11955
  * resumed runs always require it so the prior root can be matched exactly. */
@@ -12585,4 +12638,4 @@ function isNonEmptySpend(s) {
12585
12638
  //#endregion
12586
12639
  export { createInbox as $, renderProfileMaterializationIssues as $t, createBudgetPool as A, sanitizeKnowledgeReadinessReport as At, WORKER_TRACE_PROPAGATION as B, localHarnessExecutable as Bt, effectiveConcurrency as C, loopEventToOtelSpan as Ct, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as D, createRuntimeEventCollector as Dt, rollingDispatch as E, toOtelAttributes as Et, cliWorktreeExecutor as F, createWorktree as Ft, DEFAULT_SANDBOX_STEERING_MAX_TURNS as G, controlProfileMaterialization as Gt, workerTraceEnv as H, CodexExecutionDiagnosticError as Ht, createExecutor as I, removeWorktree as It, decodeToolPart as J, profileMaterializationAxes$1 as Jt, createSteerableSandboxSession as K, defineProfileMaterializationContract as Kt, createExecutorRegistry as L, DEFAULT_LOCAL_HARNESS as Lt, bindReusableExecutorExecutionId as M, runSettledCommand as Mt, bridgeStopSignalKey as N, runWorktreeHarness as Nt, teardownExecutor as O, createRuntimeStreamEventCollector as Ot, captureReusableExecutorConfig as P, captureWorktreeDiff as Pt, readWorkerProgress as Q, promptResourceProfileMaterialization as Qt, snapshotExecutorConfig as R, LOCAL_HARNESSES as Rt, waitUntil as S, generateSpanId as St, queueOf as T, padTraceId as Tt, workerTraceHeaders as U, AGENT_PROFILE_MATERIALIZATION_AXES as Ut, readWorkerTraceContext as V, parseCodexTokenUsage as Vt, workerTraceSeamKey as W, assertProfileMaterialization as Wt, DEFAULT_STALL_AFTER_MS as X, promptModelProfileMaterialization as Xt, sandboxSessionTraceSource as Y, promptControlProfileMaterialization as Yt, createActivityLog as Z, promptOnlyProfileMaterialization as Zt, createWaitProbes as _, buildRuntimeEventOtelSpans as _t, pickBestDelivered as a, acquireSandbox as at, timerAt as b, exportEvalRuns as bt, driverChild as c, canonicalObservedModel as ct, deriveNodeExecutionIdentity as d, mergeTraceEnv as dt, sandboxActProfileMaterialization as en, createSandboxForSpec as et, meterRuntimeOwnedAccounting as f, readTraceContextFromEnv as ft, settledToIteration as g, buildLoopSpanNodes as gt, scopeOwnerExecutorNodeContext as h, buildLoopOtelSpans as ht, collectDelivered as i, probeSandboxCapabilities as it, spendFromUsageEvents as j, sanitizeRuntimeStreamEvent as jt, assertValidBudget as k, sanitizeAgentRuntimeEvent as kt, withDriverExecutor as l, observedModelMatchesDeclared as lt, recordScopeOwnerMaterialization as m, INTELLIGENCE_WIRE_VERSION as mt, createSupervisor as n, worktreeCliProfileMaterialization as nn, runAgentRounds as nt, runFinalizer as o, routerBrain as ot, meterRuntimeOwnedProviderAttempt as p, traceContextToEnv as pt, createPushTraceSource as q, fullProfileMaterialization as qt, bestDelivered as r, createSandboxLineage as rt, runTree as s, runBrainLoop as st, createRootHandle as t, validateProfileMaterialization as tn, defaultSelectWinner as tt, createScope as u, createPropagatingTraceEmitter as ut, isWaitOutcome as v, createOpenInferenceFileExporter as vt, freeSlots as w, padSpanId as wt, validateWaitSpec as x, flatOtelSpan as xt, pollFor as y, createOtelExporter as yt, createWorktreeCliExecutor as z, harnessSupportsReasoningEffort as zt };
12587
12640
 
12588
- //# sourceMappingURL=supervisor-lbWTSscK.js.map
12641
+ //# sourceMappingURL=supervisor-BU01azdt.js.map