@tangle-network/agent-runtime 10.0.7 → 10.0.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 (57) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{activation-CT-rr2-5.d.ts → activation-Gi19oho7.d.ts} +2 -2
  3. package/dist/{activation-B3qLMoog.js → activation-pRO-xNlo.js} +2 -2
  4. package/dist/{activation-B3qLMoog.js.map → activation-pRO-xNlo.js.map} +1 -1
  5. package/dist/agent.d.ts +1 -1
  6. package/dist/agent.js +2 -2
  7. package/dist/{delegate-BFP1uCNY.js → delegate-ChsxEeFK.js} +2 -2
  8. package/dist/{delegate-BFP1uCNY.js.map → delegate-ChsxEeFK.js.map} +1 -1
  9. package/dist/{driver-control-acknowledgers-jdlf49OQ.js → driver-control-acknowledgers-DL-lN2Pb.js} +2 -2
  10. package/dist/{driver-control-acknowledgers-jdlf49OQ.js.map → driver-control-acknowledgers-DL-lN2Pb.js.map} +1 -1
  11. package/dist/durable.d.ts +1 -1
  12. package/dist/durable.js +4 -4
  13. package/dist/{graph-CiApRth2.js → graph-CKdDENlv.js} +4 -4
  14. package/dist/{graph-CiApRth2.js.map → graph-CKdDENlv.js.map} +1 -1
  15. package/dist/{improve-LJaiGxdI.js → improve-DNOZVLb-.js} +5 -5
  16. package/dist/{improve-LJaiGxdI.js.map → improve-DNOZVLb-.js.map} +1 -1
  17. package/dist/index.d.ts +3 -3
  18. package/dist/index.js +8 -8
  19. package/dist/intelligence.d.ts +2 -2
  20. package/dist/intelligence.js +3 -3
  21. package/dist/kernel.d.ts +1 -1
  22. package/dist/kernel.js +10 -10
  23. package/dist/{loop-runner-D6egvap-.d.ts → loop-runner-CPxQyiWQ.d.ts} +2 -2
  24. package/dist/{loop-runner-Dgow637w.js → loop-runner-DmDW9BKB.js} +2 -2
  25. package/dist/{loop-runner-Dgow637w.js.map → loop-runner-DmDW9BKB.js.map} +1 -1
  26. package/dist/loop-runner-bin.d.ts +1 -1
  27. package/dist/loop-runner-bin.js +1 -1
  28. package/dist/mcp/bin.js +2 -2
  29. package/dist/mcp/index.d.ts +1 -1
  30. package/dist/mcp/index.js +4 -4
  31. package/dist/profiles.d.ts +1 -1
  32. package/dist/{provision-supervisor-DLOeyFHV.js → provision-supervisor-DdsrpA3I.js} +3 -3
  33. package/dist/{provision-supervisor-DLOeyFHV.js.map → provision-supervisor-DdsrpA3I.js.map} +1 -1
  34. package/dist/{run-state-Bcci4zIN.js → run-state-CX8OTr-9.js} +2 -2
  35. package/dist/{run-state-Bcci4zIN.js.map → run-state-CX8OTr-9.js.map} +1 -1
  36. package/dist/{runtime-DCo0OP4n.js → runtime-ERkXbzFe.js} +10 -10
  37. package/dist/{runtime-DCo0OP4n.js.map → runtime-ERkXbzFe.js.map} +1 -1
  38. package/dist/{search-executor-Dn5YmHsg.js → search-executor-DDb4sT3E.js} +2 -2
  39. package/dist/{search-executor-Dn5YmHsg.js.map → search-executor-DDb4sT3E.js.map} +1 -1
  40. package/dist/{server-DxpG9y6W.js → server-B9tOx3CY.js} +2 -2
  41. package/dist/{server-DxpG9y6W.js.map → server-B9tOx3CY.js.map} +1 -1
  42. package/dist/{structural-rollout-DOmjcEMD.js → structural-rollout-B6RlFKxq.js} +2 -2
  43. package/dist/{structural-rollout-DOmjcEMD.js.map → structural-rollout-B6RlFKxq.js.map} +1 -1
  44. package/dist/{supervise-D7jtypE-.js → supervise-CikShHxF.js} +3 -3
  45. package/dist/{supervise-D7jtypE-.js.map → supervise-CikShHxF.js.map} +1 -1
  46. package/dist/{supervisor-BFs4u2Vo.js → supervisor-BvEe3y0c.js} +13 -9
  47. package/dist/supervisor-BvEe3y0c.js.map +1 -0
  48. package/dist/testing.d.ts +1 -1
  49. package/dist/testing.js +11 -11
  50. package/dist/tool-loop.d.ts +9 -0
  51. package/dist/tool-loop.js +131 -90
  52. package/dist/tool-loop.js.map +1 -1
  53. package/dist/tui/index.d.ts +1 -1
  54. package/dist/tui/index.js +1 -1
  55. package/dist/{types-CKsn_wgO.d.ts → types-BYiwLO2L.d.ts} +10 -1
  56. package/package.json +2 -1
  57. package/dist/supervisor-BFs4u2Vo.js.map +0 -1
@@ -7645,6 +7645,7 @@ async function captureBeforeDestroy(scope, target, signal) {
7645
7645
  // src/runtime/supervise/host-restart.ts
7646
7646
  /** A release roll restarts a host agent for about 18 s; past this window the failure stands. */
7647
7647
  const HOST_RESTART_WINDOW_MS = 18e4;
7648
+ /** The default `ProviderExecutorOptions.capacityRetryWindowMs`. */
7648
7649
  const CAPACITY_RETRY_WINDOW_MS = 6e5;
7649
7650
  /**
7650
7651
  * Sandbox answers a request that outlived a planned host-agent restart's hold with 503
@@ -7653,12 +7654,12 @@ const CAPACITY_RETRY_WINDOW_MS = 6e5;
7653
7654
  * resent under one execution id once and replays its events
7654
7655
  * (apps/sidecar/tests/integration/run-stream-resend.test.ts). `retry` waits, Retry-After at least, then doubling to `retryUntil`,
7655
7656
  * 30 s per wait, and answers true; any other error, an abort or a spent window answers false.
7656
- * A placement refusal waits for room until `deadlineMs` when the run has one, else for the
7657
- * capacity window, before the same retained invocation counts as a failed attempt; `refused` is
7657
+ * A placement refusal waits for room until `deadlineMs` when the run has one, else for
7658
+ * `capacityWindowMs`, before the same retained invocation counts as a failed attempt; `refused` is
7658
7659
  * the refusal the last wait was for, which a wait the signal cut ends on instead of the abort.
7659
7660
  * `settled` opens a new window after progress; the caller's signal still bounds every wait.
7660
7661
  */
7661
- function hostRestartReconnect(signal, deadlineMs = 0) {
7662
+ function hostRestartReconnect(signal, deadlineMs = 0, capacityWindowMs = CAPACITY_RETRY_WINDOW_MS) {
7662
7663
  let since;
7663
7664
  let waits = 0;
7664
7665
  let refused;
@@ -7670,7 +7671,7 @@ function hostRestartReconnect(signal, deadlineMs = 0) {
7670
7671
  const refusal = capacity ?? causeChain(error).find(code);
7671
7672
  if (refusal === void 0 || signal.aborted) return false;
7672
7673
  since ??= Date.now();
7673
- const left = (capacity === void 0 ? since + HOST_RESTART_WINDOW_MS : deadlineMs > 0 ? deadlineMs : since + CAPACITY_RETRY_WINDOW_MS) - Date.now();
7674
+ const left = (capacity === void 0 ? since + HOST_RESTART_WINDOW_MS : deadlineMs > 0 ? deadlineMs : since + capacityWindowMs) - Date.now();
7674
7675
  if (left <= 0) return false;
7675
7676
  refused = capacity;
7676
7677
  const wanted = Math.max(ms(Reflect.get(refusal, "retryAfterMs")), ms(Reflect.get(refusal, "retryUntil")) - Date.now(), cappedDoublingMs(++waits, 1e3, 3e4));
@@ -8096,12 +8097,12 @@ var RetainedObservation = class {
8096
8097
  seenEvents = /* @__PURE__ */ new Map();
8097
8098
  pendingRead;
8098
8099
  restart;
8099
- constructor(handle, signal, position, quietMs = RETAINED_AWAITING_RESULT_AFTER_MS) {
8100
+ constructor(handle, signal, position, quietMs = RETAINED_AWAITING_RESULT_AFTER_MS, capacityWindowMs) {
8100
8101
  this.handle = handle;
8101
8102
  this.signal = signal;
8102
8103
  this.position = position;
8103
8104
  this.quietMs = quietMs;
8104
- this.restart = hostRestartReconnect(signal);
8105
+ this.restart = hostRestartReconnect(signal, 0, capacityWindowMs);
8105
8106
  const observed = position?.observed;
8106
8107
  if (observed?.executionId === handle.controlRef.executionId) this.lastReplayPosition = this.resumedFrom = observed.replayPosition;
8107
8108
  }
@@ -8579,7 +8580,8 @@ async function retainedExecution(args, retention, turn, selectedTurn, signal) {
8579
8580
  executionAdmitted: args.recovering && retention.admissions.some((admission) => admission.phase === "dispatched")
8580
8581
  };
8581
8582
  const admissions = [...retention.admissions];
8582
- const restart = hostRestartReconnect(signal, retention.deadlineMs);
8583
+ const { capacityRetryWindowMs } = args.options;
8584
+ const restart = hostRestartReconnect(signal, retention.deadlineMs, capacityRetryWindowMs);
8583
8585
  let reattach = false;
8584
8586
  const onAdmission = async (admission) => {
8585
8587
  if (admission.phase === "dispatched") proof.executionAdmitted = true;
@@ -8618,7 +8620,7 @@ async function retainedExecution(args, retention, turn, selectedTurn, signal) {
8618
8620
  const session = exactSession(environment, handle.controlRef).session;
8619
8621
  return {
8620
8622
  environment,
8621
- events: new RetainedObservation(handle, signal, retention).observe(session),
8623
+ events: new RetainedObservation(handle, signal, retention, void 0, capacityRetryWindowMs).observe(session),
8622
8624
  retained: true
8623
8625
  };
8624
8626
  } catch (thrown) {
@@ -10007,6 +10009,8 @@ function admittedControlRef(retention) {
10007
10009
  const NATIVE_STOP_TIMEOUT_MS = 3e4;
10008
10010
  // src/runtime/environment-provider/provider-executor-lifecycle.ts
10009
10011
  function createProviderExecutor(provider, profile, ctx, options, placement) {
10012
+ const windowMs = options.capacityRetryWindowMs;
10013
+ if (windowMs !== void 0 && !(typeof windowMs === "number" && windowMs >= 0)) throw new ValidationError("providerAsExecutor: capacityRetryWindowMs must be a non-negative number");
10010
10014
  options = {
10011
10015
  ...options,
10012
10016
  ...providerOutputOptions(profile, options)
@@ -16581,4 +16585,4 @@ async function noWinner(settled, rejection) {
16581
16585
  }
16582
16586
  export { failPendingAfter as $, worktreeCliProfileMaterialization as $t, readPromptOptions as A, readCodexRolloutSession as At, toolResultText as B, terminateProcessTreeAndConfirm as Bt, captureReusableExecutorConfig as C, bridgeAdmissionRefusal as Ct, createSteerableSandboxSession as D, addHarnessUsage as Dt, DEFAULT_SANDBOX_STEERING_MAX_TURNS as E, ROUTER_PRICE_SOURCE as Et, defaultSelectWinner as F, defaultRunCommand as Ft, providerAsExecutor as G, fullProfileMaterialization as Gt, routerBrain as H, assertProfileMaterializes as Ht, codeModeArguments as I, runSettledCommand as It, providerAsSandboxClient as J, promptModelProfileMaterialization as Jt, providerOutputOptions as K, profileMaterializationAxes$1 as Kt, codeModeModelOutput as L, runWorktreeHarness as Lt, createSandboxLineage as M, bridgeRuntimeAttachmentsKey as Mt, acquireSandbox as N, bridgeRuntimeEnvKey as Nt, runAgentRounds as O, createCodexRolloutStoreReader as Ot, TERMINAL_DECISIONS as P, bridgeStopSignalKey as Pt, createInbox as Q, unsupportedProfileDimensions as Qt, createCodeModeTools as R, LOCAL_HARNESSES as Rt, bindReusableExecutorExecutionId as S, verdictFromJudgeScore as St, snapshotExecutorConfig as T, priceTokens as Tt, createAgentEnvironmentProviderRegistry as U, controlProfileMaterialization as Ut, createRouterTranscript as V, assertProfileMaterialization as Vt, resolveAgentEnvironmentProvider as W, defineProfileMaterializationContract as Wt, createInPlaceCliExecutor as X, sandboxActProfileMaterialization as Xt, createWorktreeCliExecutor as Y, renderUnsupported as Yt, INBOX_RECEIPT_KEY as Z, sandboxProfileMaterialization as Zt, isDriverSpec as _, preflightPublicCoordination as _t, awaitRootWake as a, isPeerMailEnvelope as at, InMemorySpawnJournal as b, gateOnDeliverable as bt, readRunParking as c, taskToPrompt$1 as ct, bestDelivered as d, abandonablePending as dt, projectSandboxOutcome as en, AUTHORITY_MARKERS as et, runFinalizer as f, classifyDriverFailure as ft, driverExecutorFactory as g, upstreamUnavailableSignal as gt, driverChild as h, undispatchedCredentialExit as ht, assertRunParking as i, createPeerMailbox as it, createSandboxForSpec as j, createPushTraceSource as jt, assertBoxlessPromptOptions as k, harnessUsageIsEmpty as kt, sleepScopeWait as l, DriverAttemptsExhaustedError as lt, createRootHandle as m, transientFailureKind as mt, createSupervisor as n, PEER_MAIL_WIRE_KEY as nt, bindScopeParkingDrain as o, peerMailTools as ot, runTree as p, summarizeDriverAttempts as pt, LEAF_CONTINUATION_TASK as q, promptControlProfileMaterialization as qt, RunParkedError as r, claimsAuthority as rt, isRunParked as s, peerMailVerbNames as st, DEFAULT_MAX_DEPTH as t, readSandboxOutcome as tn, DEFAULT_PEER_MAIL_LIMITS as tt, withRunParking as u, HarnessTurnFailedError as ut, withDriverExecutor as v, CheckUnavailableError as vt, createExecutor as w, bridgeModelRouteRefusal as wt, createExecutorRegistry as x, mapExecutorResult as xt, InMemoryResultBlobStore as y, gateFactoryOnDeliverable as yt, runCodeMode as z, harnessInvocation as zt };
16583
16587
 
16584
- //# sourceMappingURL=supervisor-BFs4u2Vo.js.map
16588
+ //# sourceMappingURL=supervisor-BvEe3y0c.js.map