@tangle-network/agent-runtime 0.134.3 → 0.134.5

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-BJS5eud7.js → activation-CuSUhjsU.js} +3 -3
  2. package/dist/{activation-BJS5eud7.js.map → activation-CuSUhjsU.js.map} +1 -1
  3. package/dist/agent.d.ts +2 -2
  4. package/dist/agent.js +2 -2
  5. package/dist/analyst-loop.d.ts +1 -1
  6. package/dist/{authoring-zj6jq4HE.js → authoring-DDHudCL3.js} +2 -2
  7. package/dist/{authoring-zj6jq4HE.js.map → authoring-DDHudCL3.js.map} +1 -1
  8. package/dist/candidate-execution/index.js +4 -4
  9. package/dist/{candidate-execution-DDOdYrRO.js → candidate-execution-CyCLYLfK.js} +4 -4
  10. package/dist/{candidate-execution-DDOdYrRO.js.map → candidate-execution-CyCLYLfK.js.map} +1 -1
  11. package/dist/conversation.d.ts +1 -1
  12. package/dist/{environment-provider-CCASQ5FA.d.ts → environment-provider-DIRm41xB.d.ts} +3 -3
  13. package/dist/environment-provider.d.ts +1 -1
  14. package/dist/{graph-D0bln4rR.js → graph-BBPlG9Gp.js} +3 -2
  15. package/dist/graph-BBPlG9Gp.js.map +1 -0
  16. package/dist/{improvement-cycle-fezPL8Th.js → improvement-cycle-6Vb0Ctl7.js} +4 -4
  17. package/dist/{improvement-cycle-fezPL8Th.js.map → improvement-cycle-6Vb0Ctl7.js.map} +1 -1
  18. package/dist/{index-Dg4MfLHq.d.ts → index-BbdLlSh6.d.ts} +3 -3
  19. package/dist/{index-gevMEHnE.d.ts → index-DHA5Oq5I.d.ts} +37 -23
  20. package/dist/{index-BDPN51IH.d.ts → index-iyZFnLdC.d.ts} +4 -4
  21. package/dist/index.d.ts +9 -9
  22. package/dist/index.js +11 -11
  23. package/dist/intelligence.d.ts +5 -5
  24. package/dist/intelligence.js +5 -5
  25. package/dist/kernel.d.ts +7 -7
  26. package/dist/kernel.js +6 -6
  27. package/dist/{knowledge-BXtZD-pC.js → knowledge-oUglku41.js} +5 -5
  28. package/dist/{knowledge-BXtZD-pC.js.map → knowledge-oUglku41.js.map} +1 -1
  29. package/dist/knowledge.d.ts +1 -1
  30. package/dist/knowledge.js +1 -1
  31. package/dist/{loop-runner-bin-DvaXefJJ.d.ts → loop-runner-bin-BLnkJfSV.d.ts} +3 -3
  32. package/dist/{loop-runner-bin-CjDcX5ua.js → loop-runner-bin-vVCZrAF2.js} +3 -3
  33. package/dist/{loop-runner-bin-CjDcX5ua.js.map → loop-runner-bin-vVCZrAF2.js.map} +1 -1
  34. package/dist/loop-runner-bin.d.ts +1 -1
  35. package/dist/loop-runner-bin.js +1 -1
  36. package/dist/mcp/bin.js +3 -3
  37. package/dist/mcp/index.d.ts +5 -5
  38. package/dist/mcp/index.js +4 -4
  39. package/dist/{openai-tools-CF2RMD7_.d.ts → openai-tools-BulrPqjW.d.ts} +2 -2
  40. package/dist/{openai-tools-CycyI0v2.js → openai-tools-DfoZEyvI.js} +2 -2
  41. package/dist/{openai-tools-CycyI0v2.js.map → openai-tools-DfoZEyvI.js.map} +1 -1
  42. package/dist/{prepare-Cv7NzRZl.js → prepare-Czki1LBy.js} +3 -1
  43. package/dist/{prepare-Cv7NzRZl.js.map → prepare-Czki1LBy.js.map} +1 -1
  44. package/dist/primeintellect/index.d.ts +1 -1
  45. package/dist/profiles.d.ts +1 -1
  46. package/dist/{protected-model-port-RnAK2ZrP.js → protected-model-port-OhS0l_6m.js} +2 -2
  47. package/dist/{protected-model-port-RnAK2ZrP.js.map → protected-model-port-OhS0l_6m.js.map} +1 -1
  48. package/dist/{redact-8ssmxJ0J.d.ts → redact-DTVIFTeR.d.ts} +3 -3
  49. package/dist/{runtime-CFD7S185.d.ts → runtime-C60zv0Q4.d.ts} +4 -4
  50. package/dist/{runtime-Btwztu5V.js → runtime-DZql0Fnh.js} +6 -6
  51. package/dist/{runtime-Btwztu5V.js.map → runtime-DZql0Fnh.js.map} +1 -1
  52. package/dist/{stream-agent-turn-8rmaOWtn.d.ts → stream-agent-turn-BLuTjcvw.d.ts} +3 -3
  53. package/dist/{structural-rollout-BHluS9JC.js → structural-rollout-DkYIjD2D.js} +2 -2
  54. package/dist/{structural-rollout-BHluS9JC.js.map → structural-rollout-DkYIjD2D.js.map} +1 -1
  55. package/dist/{supervise-BvjQqKsp.js → supervise-B8qbdlFz.js} +23 -2
  56. package/dist/{supervise-BvjQqKsp.js.map → supervise-B8qbdlFz.js.map} +1 -1
  57. package/dist/{supervisor-BsniJxSa.js → supervisor-lbWTSscK.js} +75 -14
  58. package/dist/supervisor-lbWTSscK.js.map +1 -0
  59. package/dist/testing.d.ts +2 -2
  60. package/dist/testing.js +108 -96
  61. package/dist/testing.js.map +1 -1
  62. package/dist/{types-XtB9WZzr.d.ts → types-CfQbuWgo.d.ts} +2 -2
  63. package/dist/{types-Cz4m4Iv6.d.ts → types-DzZCZcwI.d.ts} +12 -12
  64. package/dist/{workspace-archive-DFwzVhbk.js → workspace-archive-B_JDld25.js} +2 -2
  65. package/dist/{workspace-archive-DFwzVhbk.js.map → workspace-archive-B_JDld25.js.map} +1 -1
  66. package/package.json +10 -10
  67. package/dist/graph-D0bln4rR.js.map +0 -1
  68. package/dist/supervisor-BsniJxSa.js.map +0 -1
@@ -4164,6 +4164,28 @@ function createSandboxLineage(client, capabilities, options = {}) {
4164
4164
  async fork(parent, prompts, specs, signal) {
4165
4165
  if (prompts.length === 0) throw new ValidationError("SandboxLineage.fork: prompts must be non-empty");
4166
4166
  if (signal.aborted) throwAbort();
4167
+ const branched = await branchParent(parent.box, prompts.length, forkConcurrency, signal);
4168
+ if (branched !== void 0) {
4169
+ owned.push(...branched);
4170
+ if (branched.length !== prompts.length) throw new ValidationError(`SandboxLineage.fork: Sandbox returned ${branched.length} of ${prompts.length} requested children`);
4171
+ return mapWithConcurrency(branched, forkConcurrency, async (box, i) => {
4172
+ throwIfAborted(signal);
4173
+ const spec = specs[i % specs.length];
4174
+ if (!spec) throw new ValidationError("SandboxLineage.fork: no AgentRunSpec for branch");
4175
+ await spec.prepareBox?.(box, {
4176
+ signal,
4177
+ recordMount
4178
+ });
4179
+ const sessionId = mintSessionId();
4180
+ return {
4181
+ handle: {
4182
+ box,
4183
+ sessionId
4184
+ },
4185
+ events: promptEvents(streaming, box, prompts[i], sessionId, signal)
4186
+ };
4187
+ });
4188
+ }
4167
4189
  const checkpointId = capabilities.canFork ? await checkpointForFork(parent.box, signal) : void 0;
4168
4190
  return mapWithConcurrency(prompts, forkConcurrency, async (prompt, i) => {
4169
4191
  throwIfAborted(signal);
@@ -4218,10 +4240,28 @@ function mintSessionId() {
4218
4240
  return `loop-sess-${randomUuid()}`;
4219
4241
  }
4220
4242
  /**
4243
+ * Branch a running parent through the current Sandbox SDK, in bounded waves.
4244
+ * `undefined` means the box exposes only the legacy checkpoint API (or no
4245
+ * branching API), so the caller may try the legacy capability-gated path.
4246
+ */
4247
+ async function branchParent(box, count, concurrency, signal) {
4248
+ const branch = box.branch;
4249
+ if (typeof branch !== "function") return void 0;
4250
+ const children = [];
4251
+ for (let offset = 0; offset < count; offset += concurrency) {
4252
+ throwIfAborted(signal);
4253
+ const requested = Math.min(concurrency, count - offset);
4254
+ const batch = await branch.call(box, requested);
4255
+ children.push(...batch);
4256
+ if (batch.length !== requested) return children;
4257
+ }
4258
+ return children;
4259
+ }
4260
+ /**
4221
4261
  * Checkpoint the parent leaving it running, returning the checkpoint id to fork
4222
- * from, or `undefined` when the box exposes no `checkpoint` (the loop's fakes)
4223
- * or the call produced no id. `undefined` makes the caller degrade to fresh
4224
- * boxes — a fork that can't checkpoint must not pretend to share context.
4262
+ * from, or `undefined` when the box exposes no legacy `checkpoint` method or
4263
+ * the call produced no id. `undefined` makes the caller use fresh boxes — a
4264
+ * fork that cannot preserve context must not pretend to share it.
4225
4265
  */
4226
4266
  async function checkpointForFork(box, signal) {
4227
4267
  const checkpoint = box.checkpoint;
@@ -4235,10 +4275,9 @@ async function checkpointForFork(box, signal) {
4235
4275
  * platform advertised `canFork`; a missing `fork` here is a contract violation
4236
4276
  * (probe said yes, box says no) and fails loud rather than silently degrading.
4237
4277
  *
4238
- * `signal` gates entry only: the SDK's `fork(checkpointId, options)` takes no
4239
- * abort signal (`ForkOptions` is name/env/resources/metadata), so an in-flight
4240
- * fork cannot be interrupted. The caller (`fork`) checks abort per branch, so
4241
- * cancellation is responsive at branch boundaries, not mid-fork.
4278
+ * `signal` gates entry only: the legacy SDK's `fork(checkpointId, options)`
4279
+ * takes no abort signal, so an in-flight fork cannot be interrupted. The
4280
+ * caller checks abort per branch, so cancellation is responsive at boundaries.
4242
4281
  */
4243
4282
  async function forkFromCheckpoint(box, checkpointId, signal) {
4244
4283
  const fork = box.fork;
@@ -4460,8 +4499,8 @@ async function runAgentRounds(options) {
4460
4499
  }
4461
4500
  }
4462
4501
  /**
4463
- * Build the lineage when either lineage flag is set. Probes the platform's fork
4464
- * capability once per run (the lineage degrades gracefully when it's absent).
4502
+ * Build the lineage when either lineage flag is set. Probes the legacy fork
4503
+ * capability once per run (live branching is detected on each box).
4465
4504
  * Rejects the lineage + `onWorkerBox` combination: both claim the same
4466
4505
  * box-ownership channel, and silently honoring one would leak or double-free.
4467
4506
  */
@@ -4485,9 +4524,9 @@ async function setUpLineage(options, maxConcurrency, recordMount) {
4485
4524
  * Decide, for one round, how each iteration acquires its sandbox stream:
4486
4525
  * - refine (1 task) + `sessionContinuity` + a live parent handle ⇒ continue
4487
4526
  * the parent session on its box.
4488
- * - fanout (N tasks) + `forkFanout` + a live parent handle ⇒ fork the parent
4489
- * checkpoint once and stream each branch from a child box (degrades to fresh
4490
- * boxes inside the lineage when the platform can't fork).
4527
+ * - fanout (N tasks) + `forkFanout` + a live parent handle ⇒ branch the parent
4528
+ * box once and stream each branch from a child box (legacy CRIU or fresh-box
4529
+ * fallback is handled inside the lineage).
4491
4530
  * - otherwise (round 0, no parent, the off flag) ⇒ start a fresh box per
4492
4531
  * iteration THROUGH the lineage so it's owned + a handle is recorded for a
4493
4532
  * later round to descend from.
@@ -5988,6 +6027,15 @@ function linkSignals$1(a, b) {
5988
6027
  *
5989
6028
  * @experimental
5990
6029
  */
6030
+ /**
6031
+ * Materialization contract for one direct Router turn.
6032
+ *
6033
+ * `resourceFailOnError` is carried: this executor has no workspace, so it inlines resource content
6034
+ * into the system prompt and applies the profile's own resource-failure policy while it does so
6035
+ * (`renderRouterProfilePrompt`). No value of the field is dropped — a strict profile fails closed
6036
+ * on a resource that cannot be inlined, and a best-effort profile is refused because this path has
6037
+ * no way to report a skipped resource.
6038
+ */
5991
6039
  const routerTurnProfileMaterialization = defineProfileMaterializationContract({
5992
6040
  name: "router-profile-turn",
5993
6041
  axes: [
@@ -6009,6 +6057,7 @@ const routerTurnProfileMaterialization = defineProfileMaterializationContract({
6009
6057
  "resourceAgents",
6010
6058
  "commands",
6011
6059
  "resourceInstructions",
6060
+ "resourceFailOnError",
6012
6061
  "metadata"
6013
6062
  ]
6014
6063
  });
@@ -7660,7 +7709,10 @@ async function* streamDurableBridgeRun(args) {
7660
7709
  continue;
7661
7710
  }
7662
7711
  if (sawDone) {
7663
- if (args.run.profileMaterialization === void 0) throw new BackendTransportError("bridge", `bridgeExecutor: run ${args.run.id} completed without ${bridgeProfileMaterializationSchema}`);
7712
+ if (args.run.profileMaterialization === void 0) {
7713
+ if (pendingUpstreamError) throw pendingUpstreamError;
7714
+ throw new BackendTransportError("bridge", `bridgeExecutor: run ${args.run.id} completed without ${bridgeProfileMaterializationSchema}`);
7715
+ }
7664
7716
  args.run.terminal = true;
7665
7717
  if (pendingUpstreamError) throw pendingUpstreamError;
7666
7718
  return;
@@ -8915,10 +8967,19 @@ function exactRouterModel(profile, context) {
8915
8967
  if (agentHarness(profile.harness) !== void 0) throw new ValidationError(`${context}: AgentProfile.harness ${JSON.stringify(profile.harness)} conflicts with direct Router execution; use "cli-base"`);
8916
8968
  return concreteProfileModel(profile);
8917
8969
  }
8970
+ /**
8971
+ * Render the profile prompt plus every resource this executor can inline.
8972
+ *
8973
+ * The profile's `resources.failOnError` policy decides what happens to a resource that cannot be
8974
+ * inlined. Strict (`true` or absent) is the canonical default and fails closed. Best-effort
8975
+ * (`false`) asks for the supported subset plus a warning about the rest; this executor has no
8976
+ * channel to carry that warning, so it refuses the value instead of silently running strict.
8977
+ */
8918
8978
  function renderRouterProfilePrompt(profile) {
8919
8979
  const sections = [profile.prompt?.systemPrompt, ...profile.prompt?.instructions ?? []].filter((value) => typeof value === "string" && value.trim().length > 0);
8920
8980
  const resources = profile.resources;
8921
8981
  if (!resources) return sections.join("\n");
8982
+ if (resources.failOnError === false) throw new ValidationError("routerInlineExecutor: resources.failOnError: false requests a best-effort resource subset; the direct Router executor always fails closed on a resource it cannot inline and reports no skipped resource, so the best-effort policy is refused rather than applied as strict");
8922
8983
  if (typeof resources.instructions === "string") {
8923
8984
  if (resources.instructions.trim()) sections.push(resources.instructions);
8924
8985
  } else if (resources.instructions) sections.push(renderRouterResource("instructions", resources.instructions));
@@ -12524,4 +12585,4 @@ function isNonEmptySpend(s) {
12524
12585
  //#endregion
12525
12586
  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 };
12526
12587
 
12527
- //# sourceMappingURL=supervisor-BsniJxSa.js.map
12588
+ //# sourceMappingURL=supervisor-lbWTSscK.js.map