@tangle-network/agent-runtime 0.134.6 → 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-BFGP4ZnG.js → activation-CAexDnXt.js} +2 -2
  2. package/dist/{activation-BFGP4ZnG.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-CM9sA8yD.js → authoring-DHVHhbJO.js} +2 -2
  6. package/dist/{authoring-CM9sA8yD.js.map → authoring-DHVHhbJO.js.map} +1 -1
  7. package/dist/{graph-ICXhoz8O.js → graph-BWsEZmDL.js} +2 -2
  8. package/dist/{graph-ICXhoz8O.js.map → graph-BWsEZmDL.js.map} +1 -1
  9. package/dist/{improvement-cycle-b9IYBOJw.js → improvement-cycle-DN0QhoCi.js} +3 -3
  10. package/dist/{improvement-cycle-b9IYBOJw.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-Dxa5L4sb.js → knowledge-DDhcxfdu.js} +3 -3
  19. package/dist/{knowledge-Dxa5L4sb.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-B7yytyZx.js → loop-runner-bin-gw418CFH.js} +3 -3
  24. package/dist/{loop-runner-bin-B7yytyZx.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-DYTkum5Z.js → openai-tools-ne97uXo0.js} +2 -2
  31. package/dist/{openai-tools-DYTkum5Z.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-DPhY69h0.js → runtime-BZsDYscs.js} +6 -6
  35. package/dist/{runtime-DPhY69h0.js.map → runtime-BZsDYscs.js.map} +1 -1
  36. package/dist/{structural-rollout-B4ITMlW-.js → structural-rollout-BMnPPcJP.js} +2 -2
  37. package/dist/{structural-rollout-B4ITMlW-.js.map → structural-rollout-BMnPPcJP.js.map} +1 -1
  38. package/dist/{supervise-CR8zPmfT.js → supervise-B-nTWUCK.js} +168 -5
  39. package/dist/supervise-B-nTWUCK.js.map +1 -0
  40. package/dist/{supervisor-DEEGgN_S.js → supervisor-Dl9Fk7g5.js} +40 -12
  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-CR8zPmfT.js.map +0 -1
  53. package/dist/supervisor-DEEGgN_S.js.map +0 -1
  54. package/dist/top-app-G4M18b6i.js.map +0 -1
@@ -3136,6 +3136,10 @@ function canonicalObservedModel(model) {
3136
3136
  const base = identity.base.slice(identity.base.lastIndexOf("/") + 1);
3137
3137
  return identity.snapshot === void 0 ? base : `${base}@${identity.snapshot}`;
3138
3138
  }
3139
+ /** Return whether an observed identity includes a provider snapshot. */
3140
+ function observedModelHasSnapshot(model) {
3141
+ return modelIdentityParts(model)?.snapshot !== void 0;
3142
+ }
3139
3143
  function modelIdentityParts(model) {
3140
3144
  if (model.length === 0) return null;
3141
3145
  const at = model.lastIndexOf("@");
@@ -7481,18 +7485,17 @@ async function* streamBridgeSession(args) {
7481
7485
  maxReconnects: args.maxReconnects,
7482
7486
  traceHeaders: args.traceHeaders
7483
7487
  })) {
7484
- if (chunk.model !== void 0) {
7485
- args.onProviderModel(chunk.model);
7486
- try {
7487
- if (!observedModelMatchesDeclared(chunk.model, seam.providerModel)) {
7488
- args.onProviderIdentityConflict();
7489
- throw new ValidationError(`bridgeExecutor: bridge reported model ${JSON.stringify(chunk.model)} but the profile requires ${JSON.stringify(seam.providerModel)}`);
7490
- }
7491
- observedModel = mergeBridgeObservedModel(observedModel, chunk.model);
7492
- } catch (error) {
7488
+ if (chunk.model !== void 0) try {
7489
+ if (!observedModelMatchesDeclared(chunk.model, seam.providerModel)) {
7493
7490
  args.onProviderIdentityConflict();
7494
- throw error;
7491
+ throw new ValidationError(`bridgeExecutor: bridge reported model ${JSON.stringify(chunk.model)} but the profile requires ${JSON.stringify(seam.providerModel)}`);
7495
7492
  }
7493
+ const isWireModel = chunk.model === seam.model;
7494
+ if (!isWireModel && observedModelHasSnapshot(chunk.model)) args.onProviderModel(chunk.model);
7495
+ if (!isWireModel) observedModel = mergeBridgeObservedModel(observedModel, chunk.model);
7496
+ } catch (error) {
7497
+ args.onProviderIdentityConflict();
7498
+ throw error;
7496
7499
  }
7497
7500
  if (chunk.systemFingerprint !== void 0) {
7498
7501
  if (observedSystemFingerprint !== void 0 && observedSystemFingerprint !== chunk.systemFingerprint) {
@@ -7951,9 +7954,34 @@ function providerDispatchFromErrorBody(body) {
7951
7954
  if (typeof error !== "object" || error === null) return void 0;
7952
7955
  return error.provider_dispatch === "not_started" ? "not_started" : void 0;
7953
7956
  }
7957
+ /**
7958
+ * Recover the upstream HTTP status the bridge reports inside its message text.
7959
+ *
7960
+ * `classifyDriverFailure` already splits a transport failure correctly by status — 408/429/5xx
7961
+ * retryable, other 4xx terminal — but it reads `error.status`, and a bridge stream error carries
7962
+ * the status only as text: `pi assistant turn failed: 400: {"message":"The max_tokens parameter
7963
+ * is illegal ..."}`. With `status` undefined the classifier takes its "unknown, so assume the
7964
+ * upstream had a bad moment" branch, and a malformed request is retried to the attempt ceiling.
7965
+ * Measured: a 400 `invalid_request_error` retried 12 times, and it fails identically every time.
7966
+ *
7967
+ * Anchored to `: <status>: ` so it matches the bridge's own framing and not a status-shaped number
7968
+ * inside a provider's prose. A body that names no status leaves `status` undefined, which keeps
7969
+ * the existing retry-on-unknown behaviour.
7970
+ */
7971
+ function upstreamStatusFromMessage(message) {
7972
+ const match = message?.match(/: (\d{3}): /);
7973
+ if (!match) return void 0;
7974
+ const status = Number(match[1]);
7975
+ return status >= 100 && status <= 599 ? status : void 0;
7976
+ }
7954
7977
  function bridgeUpstreamError(error, prefix) {
7955
7978
  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 });
7979
+ const status = typeof error.status === "number" ? error.status : upstreamStatusFromMessage(error.message);
7980
+ const options = {
7981
+ ...providerDispatch === void 0 ? {} : { providerDispatch },
7982
+ ...status === void 0 ? {} : { status }
7983
+ };
7984
+ return new BackendTransportError("bridge", `${prefix}: ${error.message ?? error.type ?? "unknown"}`, Object.keys(options).length === 0 ? void 0 : options);
7957
7985
  }
7958
7986
  function mergeBridgeObservedModel(current, next) {
7959
7987
  if (current === void 0 || current === next) return next;
@@ -12613,4 +12641,4 @@ function isNonEmptySpend(s) {
12613
12641
  //#endregion
12614
12642
  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 };
12615
12643
 
12616
- //# sourceMappingURL=supervisor-DEEGgN_S.js.map
12644
+ //# sourceMappingURL=supervisor-Dl9Fk7g5.js.map