@tangle-network/agent-runtime 10.0.7 → 10.0.9
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.
- package/CHANGELOG.md +19 -0
- package/dist/{activation-B3qLMoog.js → activation-D4hAza0W.js} +2 -2
- package/dist/{activation-B3qLMoog.js.map → activation-D4hAza0W.js.map} +1 -1
- package/dist/{activation-CT-rr2-5.d.ts → activation-Gi19oho7.d.ts} +2 -2
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/{delegate-BFP1uCNY.js → delegate-C53pe9th.js} +2 -2
- package/dist/{delegate-BFP1uCNY.js.map → delegate-C53pe9th.js.map} +1 -1
- package/dist/{driver-control-acknowledgers-jdlf49OQ.js → driver-control-acknowledgers-eETy7SAi.js} +16 -17
- package/dist/driver-control-acknowledgers-eETy7SAi.js.map +1 -0
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +4 -4
- package/dist/{graph-CiApRth2.js → graph-CRaquJhB.js} +4 -4
- package/dist/{graph-CiApRth2.js.map → graph-CRaquJhB.js.map} +1 -1
- package/dist/{improve-LJaiGxdI.js → improve-CEOS1Ijj.js} +5 -5
- package/dist/{improve-LJaiGxdI.js.map → improve-CEOS1Ijj.js.map} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -8
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +3 -3
- package/dist/kernel.d.ts +1 -1
- package/dist/kernel.js +10 -10
- package/dist/{loop-runner-Dgow637w.js → loop-runner-2vKhhbQA.js} +2 -2
- package/dist/{loop-runner-Dgow637w.js.map → loop-runner-2vKhhbQA.js.map} +1 -1
- package/dist/{loop-runner-D6egvap-.d.ts → loop-runner-CPxQyiWQ.d.ts} +2 -2
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +2 -2
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +4 -4
- package/dist/profile-Cxl_Ajl2.js.map +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/{provision-supervisor-DLOeyFHV.js → provision-supervisor-CzKfUJIg.js} +3 -3
- package/dist/{provision-supervisor-DLOeyFHV.js.map → provision-supervisor-CzKfUJIg.js.map} +1 -1
- package/dist/{run-state-Bcci4zIN.js → run-state-Dbi2PVOt.js} +2 -2
- package/dist/{run-state-Bcci4zIN.js.map → run-state-Dbi2PVOt.js.map} +1 -1
- package/dist/{runtime-DCo0OP4n.js → runtime-CZ-VnOr5.js} +44 -29
- package/dist/{runtime-DCo0OP4n.js.map → runtime-CZ-VnOr5.js.map} +1 -1
- package/dist/{search-executor-Dn5YmHsg.js → search-executor-C0aVtzXX.js} +2 -2
- package/dist/{search-executor-Dn5YmHsg.js.map → search-executor-C0aVtzXX.js.map} +1 -1
- package/dist/{server-DxpG9y6W.js → server-BwpXzcpm.js} +2 -2
- package/dist/{server-DxpG9y6W.js.map → server-BwpXzcpm.js.map} +1 -1
- package/dist/{structural-rollout-DOmjcEMD.js → structural-rollout-CKNwDl0T.js} +2 -2
- package/dist/{structural-rollout-DOmjcEMD.js.map → structural-rollout-CKNwDl0T.js.map} +1 -1
- package/dist/{supervise-D7jtypE-.js → supervise-CkIKRWDV.js} +9 -5
- package/dist/{supervise-D7jtypE-.js.map → supervise-CkIKRWDV.js.map} +1 -1
- package/dist/{supervisor-BFs4u2Vo.js → supervisor-CAQI8ILe.js} +19 -14
- package/dist/supervisor-CAQI8ILe.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +11 -11
- package/dist/tool-loop.d.ts +9 -0
- package/dist/tool-loop.js +131 -90
- package/dist/tool-loop.js.map +1 -1
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/dist/{types-CKsn_wgO.d.ts → types-BYiwLO2L.d.ts} +10 -1
- package/package.json +5 -4
- package/dist/driver-control-acknowledgers-jdlf49OQ.js.map +0 -1
- 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
|
|
7657
|
-
*
|
|
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 +
|
|
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
|
|
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) {
|
|
@@ -8811,17 +8813,21 @@ function providerAsSandboxClient(provider, options = {}) {
|
|
|
8811
8813
|
const defaults = options.defaults ?? {};
|
|
8812
8814
|
const sandboxInput = createInputFromSandboxOptions(createOptions, options.mapCreateOptions !== void 0);
|
|
8813
8815
|
const selected = structuredClone(sandboxInput.secrets ?? defaults.secrets);
|
|
8814
|
-
const authored =
|
|
8816
|
+
const authored = createOptions?.backend?.profile ?? defaults.profile;
|
|
8815
8817
|
const bindings = [
|
|
8816
8818
|
defaults.proxySecrets,
|
|
8817
8819
|
sandboxInput.proxySecrets,
|
|
8818
8820
|
typeof authored === "object" ? authored.proxySecrets : void 0
|
|
8819
8821
|
].flatMap((value) => value === void 0 ? [] : [mergeProxySecretBindings(value)]);
|
|
8820
|
-
const customInput =
|
|
8822
|
+
const { profile, ...customInput } = {
|
|
8823
|
+
profile: authored,
|
|
8824
|
+
...options.mapCreateOptions?.(createOptions)
|
|
8825
|
+
};
|
|
8821
8826
|
const mapped = {
|
|
8822
8827
|
...defaults,
|
|
8823
8828
|
...sandboxInput,
|
|
8824
8829
|
...customInput,
|
|
8830
|
+
profile: typeof profile === "object" ? agentProfileSchema.parse(profile) : profile,
|
|
8825
8831
|
...defaults.env || sandboxInput.env || customInput.env ? { env: {
|
|
8826
8832
|
...defaults.env,
|
|
8827
8833
|
...sandboxInput.env,
|
|
@@ -8841,7 +8847,6 @@ function providerAsSandboxClient(provider, options = {}) {
|
|
|
8841
8847
|
const entries = new Set((Array.isArray(mapped.secrets) ? mapped.secrets : []).map(bindingId));
|
|
8842
8848
|
for (const binding of Array.isArray(selected) ? selected : []) if (typeof binding !== "string" && !entries.has(bindingId(binding))) throw new ValidationError("mapped create changed a stored host binding");
|
|
8843
8849
|
if (bindings.length) mapped.proxySecrets = mergeProxySecretBindings(...bindings, mapped.proxySecrets, typeof mapped.profile === "object" ? mapped.profile.proxySecrets : void 0);
|
|
8844
|
-
if (typeof mapped.profile === "object") mapped.profile = structuredClone(mapped.profile);
|
|
8845
8850
|
if (mapped.backend === void 0) delete mapped.backend;
|
|
8846
8851
|
if (mapped.profile === void 0) throw new ValidationError(`providerAsSandboxClient(${provider.name}): profile required in defaults or CreateSandboxOptions.backend.profile`);
|
|
8847
8852
|
const needsMcp = hasRuntimeMcpAttachments(mapped);
|
|
@@ -8897,7 +8902,6 @@ function createInputFromSandboxOptions(options, customMapping) {
|
|
|
8897
8902
|
}
|
|
8898
8903
|
if (unsupported.length > 0) throw new ValidationError(`providerAsSandboxClient: Sandbox create controls require mapCreateOptions: ${unsupported.join(", ")}`);
|
|
8899
8904
|
}
|
|
8900
|
-
const profile = options?.backend?.profile;
|
|
8901
8905
|
const backend = options?.backend?.type;
|
|
8902
8906
|
const cwd = options?.cwd === void 0 ? void 0 : canonicalWorkspaceCwd({
|
|
8903
8907
|
base: "repository",
|
|
@@ -8910,7 +8914,6 @@ function createInputFromSandboxOptions(options, customMapping) {
|
|
|
8910
8914
|
...cwd === void 0 ? {} : { cwd }
|
|
8911
8915
|
};
|
|
8912
8916
|
return {
|
|
8913
|
-
...profile !== void 0 ? { profile } : {},
|
|
8914
8917
|
...backend ? { backend } : {},
|
|
8915
8918
|
...Object.keys(workspace).length > 0 ? { workspace } : {},
|
|
8916
8919
|
...options?.resources ? { resources: options.resources } : {},
|
|
@@ -10007,6 +10010,8 @@ function admittedControlRef(retention) {
|
|
|
10007
10010
|
const NATIVE_STOP_TIMEOUT_MS = 3e4;
|
|
10008
10011
|
// src/runtime/environment-provider/provider-executor-lifecycle.ts
|
|
10009
10012
|
function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
10013
|
+
const windowMs = options.capacityRetryWindowMs;
|
|
10014
|
+
if (windowMs !== void 0 && !(typeof windowMs === "number" && windowMs >= 0)) throw new ValidationError("providerAsExecutor: capacityRetryWindowMs must be a non-negative number");
|
|
10010
10015
|
options = {
|
|
10011
10016
|
...options,
|
|
10012
10017
|
...providerOutputOptions(profile, options)
|
|
@@ -16581,4 +16586,4 @@ async function noWinner(settled, rejection) {
|
|
|
16581
16586
|
}
|
|
16582
16587
|
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
16588
|
|
|
16584
|
-
//# sourceMappingURL=supervisor-
|
|
16589
|
+
//# sourceMappingURL=supervisor-CAQI8ILe.js.map
|