@tangle-network/agent-runtime 0.131.1 → 0.131.3

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 (33) hide show
  1. package/dist/{activation-BCzMOTaV.js → activation-CrVCSWLi.js} +2 -2
  2. package/dist/{activation-BCzMOTaV.js.map → activation-CrVCSWLi.js.map} +1 -1
  3. package/dist/agent.js +2 -2
  4. package/dist/{authoring-Dv3t6SXe.js → authoring-tkyJHE0o.js} +2 -2
  5. package/dist/{authoring-Dv3t6SXe.js.map → authoring-tkyJHE0o.js.map} +1 -1
  6. package/dist/{graph-xWdv53Le.js → graph-RVorX4TM.js} +2 -2
  7. package/dist/{graph-xWdv53Le.js.map → graph-RVorX4TM.js.map} +1 -1
  8. package/dist/{improvement-cycle-Csp38cWg.js → improvement-cycle-CSprJl2t.js} +3 -3
  9. package/dist/{improvement-cycle-Csp38cWg.js.map → improvement-cycle-CSprJl2t.js.map} +1 -1
  10. package/dist/index.js +7 -7
  11. package/dist/intelligence.js +3 -3
  12. package/dist/kernel.js +6 -6
  13. package/dist/{knowledge-DPEu4f-0.js → knowledge-DqcVhYYF.js} +3 -3
  14. package/dist/{knowledge-DPEu4f-0.js.map → knowledge-DqcVhYYF.js.map} +1 -1
  15. package/dist/knowledge.js +1 -1
  16. package/dist/{loop-runner-bin-dg6li2-b.js → loop-runner-bin-BXdUq87C.js} +3 -3
  17. package/dist/{loop-runner-bin-dg6li2-b.js.map → loop-runner-bin-BXdUq87C.js.map} +1 -1
  18. package/dist/loop-runner-bin.js +1 -1
  19. package/dist/mcp/bin.js +3 -3
  20. package/dist/mcp/index.js +4 -4
  21. package/dist/{openai-tools-zRphjXS4.js → openai-tools-CPhN7uKC.js} +2 -2
  22. package/dist/{openai-tools-zRphjXS4.js.map → openai-tools-CPhN7uKC.js.map} +1 -1
  23. package/dist/{runtime-cOzDOOHr.js → runtime-B4z0Z1sM.js} +6 -6
  24. package/dist/{runtime-cOzDOOHr.js.map → runtime-B4z0Z1sM.js.map} +1 -1
  25. package/dist/{structural-rollout-3uxVGcg2.js → structural-rollout-UO3ue9OI.js} +2 -2
  26. package/dist/{structural-rollout-3uxVGcg2.js.map → structural-rollout-UO3ue9OI.js.map} +1 -1
  27. package/dist/{supervise-DHYX8gO2.js → supervise-BVNSL3N0.js} +2 -2
  28. package/dist/{supervise-DHYX8gO2.js.map → supervise-BVNSL3N0.js.map} +1 -1
  29. package/dist/{supervisor-CV6Jh28D.js → supervisor-D4G47raS.js} +97 -9
  30. package/dist/supervisor-D4G47raS.js.map +1 -0
  31. package/dist/testing.js +11 -11
  32. package/package.json +1 -1
  33. package/dist/supervisor-CV6Jh28D.js.map +0 -1
@@ -6838,14 +6838,16 @@ const bridgeExecutor = (spec, ctx) => {
6838
6838
  const base = readSeam(ctx, bridgeSeamKey, "bridge");
6839
6839
  const effectiveProfile = agentProfileSchema.parse(spec.profile);
6840
6840
  const model = bridgeProfileModel(effectiveProfile, "bridgeExecutor");
6841
+ const profileExecution = profileModelExecutionSettings(effectiveProfile, "bridgeExecutor");
6841
6842
  const seam = {
6842
6843
  ...base,
6843
- model
6844
+ model,
6845
+ ...profileExecution.maxTokens !== void 0 ? { maxTokens: profileExecution.maxTokens } : {}
6844
6846
  };
6845
6847
  if (!seam.bridgeUrl || !seam.bridgeBearer) throw new ValidationError("bridgeExecutor: bridgeUrl + bridgeBearer are required");
6846
6848
  if (seam.timeoutMs !== void 0 && (!Number.isSafeInteger(seam.timeoutMs) || seam.timeoutMs < 1 || seam.timeoutMs > maxBridgeTimeoutMs)) throw new ValidationError(`bridgeExecutor: timeoutMs must be an integer from 1 to ${maxBridgeTimeoutMs}`);
6847
6849
  if (seam.maxReconnects !== void 0 && (!Number.isSafeInteger(seam.maxReconnects) || seam.maxReconnects < 0)) throw new ValidationError("bridgeExecutor: maxReconnects must be a nonnegative safe integer");
6848
- const maxTurns = profileModelExecutionSettings(effectiveProfile, "bridgeExecutor").maxTurns ?? 0;
6850
+ const maxTurns = profileExecution.maxTurns ?? 0;
6849
6851
  const maxReconnects = seam.maxReconnects ?? 3;
6850
6852
  const sessionId = seam.sessionId ?? `bridge-${spec.profile.name ?? "worker"}-${randomUUID()}`;
6851
6853
  const attemptId = ctx.node?.attemptId ?? newExecutionAttemptId(sessionId);
@@ -6887,6 +6889,7 @@ const bridgeExecutor = (spec, ctx) => {
6887
6889
  maxReconnects,
6888
6890
  timeoutMs: seam.timeoutMs ?? null,
6889
6891
  streaming: true,
6892
+ ...seam.maxTokens !== void 0 ? { maxTokens: seam.maxTokens } : {},
6890
6893
  terminalAcknowledgement: null
6891
6894
  }
6892
6895
  };
@@ -7151,6 +7154,7 @@ async function* streamBridgeSession(args) {
7151
7154
  run_id: activeRun.id,
7152
7155
  session_id: args.sessionId,
7153
7156
  ...seam.cwd ? { cwd: seam.cwd } : {},
7157
+ ...seam.maxTokens !== void 0 ? { max_tokens: seam.maxTokens } : {},
7154
7158
  execution: {
7155
7159
  kind: "host",
7156
7160
  ...seam.timeoutMs !== void 0 ? { timeoutMs: seam.timeoutMs } : {}
@@ -7587,12 +7591,7 @@ function assertBridgeProfileMaterialization(value, profile, wireModel) {
7587
7591
  const missing = requiredKeys.filter((key) => !presentKeys.includes(key));
7588
7592
  const unknown = presentKeys.filter((key) => !requiredKeys.includes(key) && !optionalKeys.includes(key));
7589
7593
  if (missing.length > 0 || unknown.length > 0) throw new ValidationError("bridgeExecutor: profile materialization receipt has missing or unknown fields" + (missing.length > 0 ? ` (missing: ${missing.sort().join(", ")})` : "") + (unknown.length > 0 ? ` (unknown: ${unknown.sort().join(", ")})` : ""));
7590
- if (raw.inference !== void 0) {
7591
- const inference = raw.inference;
7592
- if (typeof inference !== "object" || inference === null || Array.isArray(inference)) throw new ValidationError("bridgeExecutor: profile materialization receipt has an invalid inference block");
7593
- const endpoint = inference.effectiveEndpoint;
7594
- if (typeof endpoint !== "string" || endpoint.length === 0) throw new ValidationError("bridgeExecutor: profile materialization inference block has no effectiveEndpoint");
7595
- }
7594
+ const inference = raw.inference === void 0 ? void 0 : parseBridgeInferenceReceipt(raw.inference);
7596
7595
  if (raw.schema !== bridgeProfileMaterializationSchema) throw new ValidationError(`bridgeExecutor: profile materialization receipt is not ${bridgeProfileMaterializationSchema}`);
7597
7596
  const effectiveProfileDigest = raw.effectiveProfileDigest;
7598
7597
  if (typeof effectiveProfileDigest !== "string" || !/^sha256:[a-f0-9]{64}$/u.test(effectiveProfileDigest)) throw new ValidationError("bridgeExecutor: profile materialization receipt has an invalid effectiveProfileDigest");
@@ -7651,11 +7650,100 @@ function assertBridgeProfileMaterialization(value, profile, wireModel) {
7651
7650
  requested,
7652
7651
  applied
7653
7652
  },
7653
+ ...inference === void 0 ? {} : { inference },
7654
7654
  workspacePlanDigest: raw.workspacePlanDigest,
7655
7655
  files: Object.freeze(files),
7656
7656
  unsupported: Object.freeze(unsupported)
7657
7657
  });
7658
7658
  }
7659
+ function parseBridgeInferenceReceipt(value) {
7660
+ if (typeof value !== "object" || value === null || Array.isArray(value)) throw new ValidationError("bridgeExecutor: profile materialization receipt has an invalid inference block");
7661
+ const raw = value;
7662
+ assertBridgeReceiptKeys(raw, [
7663
+ "apiMode",
7664
+ "effectiveEndpoint",
7665
+ "transport"
7666
+ ], ["observation"], "profile materialization inference block");
7667
+ const effectiveEndpoint = raw.effectiveEndpoint;
7668
+ if (typeof effectiveEndpoint !== "string" || effectiveEndpoint.length === 0) throw new ValidationError("bridgeExecutor: profile materialization inference block has no effectiveEndpoint");
7669
+ const apiMode = raw.apiMode;
7670
+ if (typeof apiMode !== "string" || apiMode.length === 0) throw new ValidationError("bridgeExecutor: profile materialization inference block has no apiMode");
7671
+ if (raw.transport !== "scoped-loopback") throw new ValidationError("bridgeExecutor: profile materialization inference block has invalid transport");
7672
+ const observation = raw.observation === void 0 ? void 0 : parseBridgeInferenceObservation(raw.observation);
7673
+ return detachedSnapshot({
7674
+ effectiveEndpoint,
7675
+ apiMode,
7676
+ transport: "scoped-loopback",
7677
+ ...observation === void 0 ? {} : { observation }
7678
+ }, "bridgeExecutor: profile materialization inference block");
7679
+ }
7680
+ function parseBridgeInferenceObservation(value) {
7681
+ if (typeof value !== "object" || value === null || Array.isArray(value)) throw new ValidationError("bridgeExecutor: profile materialization inference observation must be an object");
7682
+ const raw = value;
7683
+ assertBridgeReceiptKeys(raw, [
7684
+ "accountingMatched",
7685
+ "auxiliaryRequests",
7686
+ "failedRequests",
7687
+ "generationRequests",
7688
+ "inFlightRequests",
7689
+ "rejectedRequests",
7690
+ "requests",
7691
+ "usage",
7692
+ "usageReceipts"
7693
+ ], [], "profile materialization inference observation");
7694
+ return detachedSnapshot({
7695
+ requests: bridgeInferenceCount(raw.requests, "requests"),
7696
+ generationRequests: bridgeInferenceCount(raw.generationRequests, "generationRequests"),
7697
+ auxiliaryRequests: bridgeInferenceCount(raw.auxiliaryRequests, "auxiliaryRequests"),
7698
+ usageReceipts: bridgeInferenceCount(raw.usageReceipts, "usageReceipts"),
7699
+ rejectedRequests: bridgeInferenceCount(raw.rejectedRequests, "rejectedRequests"),
7700
+ failedRequests: bridgeInferenceCount(raw.failedRequests, "failedRequests"),
7701
+ inFlightRequests: bridgeInferenceCount(raw.inFlightRequests, "inFlightRequests"),
7702
+ accountingMatched: bridgeInferenceBoolean(raw.accountingMatched, "accountingMatched"),
7703
+ usage: parseBridgeInferenceUsage(raw.usage)
7704
+ }, "bridgeExecutor: profile materialization inference observation");
7705
+ }
7706
+ function parseBridgeInferenceUsage(value) {
7707
+ if (typeof value !== "object" || value === null || Array.isArray(value)) throw new ValidationError("bridgeExecutor: profile materialization inference usage must be an object");
7708
+ const raw = value;
7709
+ assertBridgeReceiptKeys(raw, ["costKnown"], [
7710
+ "cacheReadInputTokens",
7711
+ "cacheWriteInputTokens",
7712
+ "estimatedCost",
7713
+ "freshInputTokens",
7714
+ "inputTokens",
7715
+ "outputTokens"
7716
+ ], "profile materialization inference usage");
7717
+ if (raw.costKnown !== false) throw new ValidationError("bridgeExecutor: profile materialization inference usage must report costKnown=false");
7718
+ return detachedSnapshot({
7719
+ ...raw.inputTokens === void 0 ? {} : { inputTokens: bridgeInferenceCount(raw.inputTokens, "usage.inputTokens") },
7720
+ ...raw.freshInputTokens === void 0 ? {} : { freshInputTokens: bridgeInferenceCount(raw.freshInputTokens, "usage.freshInputTokens") },
7721
+ ...raw.cacheReadInputTokens === void 0 ? {} : { cacheReadInputTokens: bridgeInferenceCount(raw.cacheReadInputTokens, "usage.cacheReadInputTokens") },
7722
+ ...raw.cacheWriteInputTokens === void 0 ? {} : { cacheWriteInputTokens: bridgeInferenceCount(raw.cacheWriteInputTokens, "usage.cacheWriteInputTokens") },
7723
+ ...raw.outputTokens === void 0 ? {} : { outputTokens: bridgeInferenceCount(raw.outputTokens, "usage.outputTokens") },
7724
+ costKnown: false,
7725
+ ...raw.estimatedCost === void 0 ? {} : { estimatedCost: bridgeInferenceMoney(raw.estimatedCost, "usage.estimatedCost") }
7726
+ }, "bridgeExecutor: profile materialization inference usage");
7727
+ }
7728
+ function assertBridgeReceiptKeys(value, required, optional, context) {
7729
+ const requiredSet = new Set(required);
7730
+ const optionalSet = new Set(optional);
7731
+ const missing = required.filter((key) => !Object.hasOwn(value, key));
7732
+ const unknown = Object.keys(value).filter((key) => !requiredSet.has(key) && !optionalSet.has(key));
7733
+ if (missing.length > 0 || unknown.length > 0) throw new ValidationError(`bridgeExecutor: ${context} has missing or unknown fields` + (missing.length > 0 ? ` (missing: ${missing.sort().join(", ")})` : "") + (unknown.length > 0 ? ` (unknown: ${unknown.sort().join(", ")})` : ""));
7734
+ }
7735
+ function bridgeInferenceCount(value, field) {
7736
+ if (!Number.isSafeInteger(value) || value < 0) throw new ValidationError(`bridgeExecutor: profile materialization inference ${field} must be a nonnegative safe integer`);
7737
+ return value;
7738
+ }
7739
+ function bridgeInferenceBoolean(value, field) {
7740
+ if (typeof value !== "boolean") throw new ValidationError(`bridgeExecutor: profile materialization inference ${field} must be boolean`);
7741
+ return value;
7742
+ }
7743
+ function bridgeInferenceMoney(value, field) {
7744
+ if (typeof value !== "number" || !Number.isFinite(value) || value < 0) throw new ValidationError(`bridgeExecutor: profile materialization inference ${field} must be finite and nonnegative`);
7745
+ return value;
7746
+ }
7659
7747
  /** Expected native control for the bridge backends that can emit the v2 acknowledgement. These
7660
7748
  * mappings mirror the actual cli-bridge argv functions, so the acknowledgement is checked against
7661
7749
  * what the process must have received rather than merely echoing the canonical request. */
@@ -11932,4 +12020,4 @@ function isNonEmptySpend(s) {
11932
12020
  //#endregion
11933
12021
  export { createSandboxLineage as $, bindReusableExecutorExecutionId as A, removeWorktree as At, workerTraceSeamKey as B, defineProfileMaterializationContract as Bt, queueOf as C, sanitizeAgentRuntimeEvent as Ct, assertValidBudget as D, runWorktreeHarness as Dt, teardownExecutor as E, runSettledCommand as Et, snapshotExecutorConfig as F, parseCodexTokenUsage as Ft, sandboxSessionTraceSource as G, promptOnlyProfileMaterialization as Gt, createSteerableSandboxSession as H, profileMaterializationAxes$1 as Ht, createWorktreeCliExecutor as I, CodexExecutionDiagnosticError as It, readWorkerProgress as J, sandboxActProfileMaterialization as Jt, DEFAULT_STALL_AFTER_MS as K, promptResourceProfileMaterialization as Kt, WORKER_TRACE_PROPAGATION as L, AGENT_PROFILE_MATERIALIZATION_AXES as Lt, cliWorktreeExecutor as M, LOCAL_HARNESSES as Mt, createExecutor as N, harnessSupportsReasoningEffort as Nt, createBudgetPool as O, captureWorktreeDiff as Ot, createExecutorRegistry as P, localHarnessExecutable as Pt, runAgentRounds as Q, readWorkerTraceContext as R, assertProfileMaterialization as Rt, freeSlots as S, createRuntimeStreamEventCollector as St, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as T, sanitizeRuntimeStreamEvent as Tt, createPushTraceSource as U, promptControlProfileMaterialization as Ut, DEFAULT_SANDBOX_STEERING_MAX_TURNS as V, fullProfileMaterialization as Vt, decodeToolPart as W, promptModelProfileMaterialization as Wt, createSandboxForSpec as X, worktreeCliProfileMaterialization as Xt, createInbox as Y, validateProfileMaterialization as Yt, defaultSelectWinner as Z, pollFor as _, loopEventToOtelSpan as _t, pickBestDelivered as a, mergeTraceEnv as at, waitUntil as b, toOtelAttributes as bt, driverChild as c, INTELLIGENCE_WIRE_VERSION as ct, deriveNodeExecutionIdentity as d, buildRuntimeEventOtelSpans as dt, probeSandboxCapabilities as et, recordScopeOwnerMaterialization as f, createOpenInferenceFileExporter as ft, isWaitOutcome as g, generateSpanId as gt, createWaitProbes as h, flatOtelSpan as ht, collectDelivered as i, createPropagatingTraceEmitter as it, captureReusableExecutorConfig as j, DEFAULT_LOCAL_HARNESS as jt, spendFromUsageEvents as k, createWorktree as kt, withDriverExecutor as l, buildLoopOtelSpans as lt, settledToIteration as m, exportEvalRuns as mt, createSupervisor as n, routerBrain as nt, runFinalizer as o, readTraceContextFromEnv as ot, scopeOwnerExecutorNodeContext as p, createOtelExporter as pt, createActivityLog as q, renderProfileMaterializationIssues as qt, bestDelivered as r, runBrainLoop as rt, runTree as s, traceContextToEnv as st, createRootHandle as t, acquireSandbox as tt, createScope as u, buildLoopSpanNodes as ut, timerAt as v, padSpanId as vt, rollingDispatch as w, sanitizeKnowledgeReadinessReport as wt, effectiveConcurrency as x, createRuntimeEventCollector as xt, validateWaitSpec as y, padTraceId as yt, workerTraceEnv as z, controlProfileMaterialization as zt };
11934
12022
 
11935
- //# sourceMappingURL=supervisor-CV6Jh28D.js.map
12023
+ //# sourceMappingURL=supervisor-D4G47raS.js.map