@tangle-network/agent-runtime 3.0.43 → 4.0.0
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/dist/{activation-CiUbW1QE.d.ts → activation-B49A14V5.d.ts} +2 -2
- package/dist/{activation-1YUy4GWu.js → activation-BiQYCayd.js} +2 -2
- package/dist/{activation-1YUy4GWu.js.map → activation-BiQYCayd.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +4 -4
- package/dist/{coordination-manager-DXOwLu9T.js → coordination-manager-C-ZoeZ73.js} +6 -6
- package/dist/{coordination-manager-DXOwLu9T.js.map → coordination-manager-C-ZoeZ73.js.map} +1 -1
- package/dist/{coordination-map-routing-2_hUlTnz.js → coordination-map-routing-SnsZp287.js} +2 -2
- package/dist/{coordination-map-routing-2_hUlTnz.js.map → coordination-map-routing-SnsZp287.js.map} +1 -1
- package/dist/{delegate-CAvTMCk0.js → delegate-d9HcOFC5.js} +2 -2
- package/dist/{delegate-CAvTMCk0.js.map → delegate-d9HcOFC5.js.map} +1 -1
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +7 -7
- package/dist/{graph-C7Xthj-4.js → graph-C_Z0Ua10.js} +6 -6
- package/dist/{graph-C7Xthj-4.js.map → graph-C_Z0Ua10.js.map} +1 -1
- package/dist/{graph-registry-EGeo_moB.js → graph-registry-BU7pcrUW.js} +1 -1
- package/dist/{graph-registry-BoaUV5g8.js → graph-registry-CI1o16DH.js} +3 -3
- package/dist/{graph-registry-BoaUV5g8.js.map → graph-registry-CI1o16DH.js.map} +1 -1
- package/dist/{improve-BZpoezFh.js → improve-B4v4S8jY.js} +7 -7
- package/dist/{improve-BZpoezFh.js.map → improve-B4v4S8jY.js.map} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +9 -9
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +5 -5
- package/dist/{jsonl-file-CbxMVnUj.js → jsonl-file-CvPuwM0a.js} +5 -2
- package/dist/jsonl-file-CvPuwM0a.js.map +1 -0
- package/dist/kernel.d.ts +1 -1
- package/dist/kernel.js +12 -12
- package/dist/{loop-runner-Dmjf2IY6.d.ts → loop-runner-DKvA0JJr.d.ts} +2 -2
- package/dist/{loop-runner-BchibTTn.js → loop-runner-DMZkwlND.js} +2 -2
- package/dist/{loop-runner-BchibTTn.js.map → loop-runner-DMZkwlND.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +5 -5
- package/dist/profiles.d.ts +1 -1
- package/dist/{provision-supervisor-BtDnk11d.js → provision-supervisor-Cjs4SQ9Q.js} +5 -5
- package/dist/{provision-supervisor-BtDnk11d.js.map → provision-supervisor-Cjs4SQ9Q.js.map} +1 -1
- package/dist/{run-cancellation-DEW04dun.js → run-cancellation-CGgk54Md.js} +3 -3
- package/dist/{run-cancellation-DEW04dun.js.map → run-cancellation-CGgk54Md.js.map} +1 -1
- package/dist/{runtime-CKoChP6L.js → runtime-BmxmsaNz.js} +15 -15
- package/dist/{runtime-CKoChP6L.js.map → runtime-BmxmsaNz.js.map} +1 -1
- package/dist/{scope-Bg1uCsPR.js → scope-CJ7xtrs8.js} +127 -69
- package/dist/scope-CJ7xtrs8.js.map +1 -0
- package/dist/{search-executor-CJ5y2-b8.js → search-executor-DSB6XAl1.js} +3 -3
- package/dist/{search-executor-CJ5y2-b8.js.map → search-executor-DSB6XAl1.js.map} +1 -1
- package/dist/{server-zdmmyP7r.js → server-FWT2Nt_w.js} +3 -3
- package/dist/{server-zdmmyP7r.js.map → server-FWT2Nt_w.js.map} +1 -1
- package/dist/{structural-rollout-CH9b7K9B.js → structural-rollout-Bl23HSOd.js} +3 -3
- package/dist/{structural-rollout-CH9b7K9B.js.map → structural-rollout-Bl23HSOd.js.map} +1 -1
- package/dist/{supervise-472pyfgQ.js → supervise-MAzd0hOk.js} +93 -41
- package/dist/supervise-MAzd0hOk.js.map +1 -0
- package/dist/{supervision-discovery-CD350Iar.js → supervision-discovery-6EtvKCsU.js} +3 -3
- package/dist/{supervision-discovery-CD350Iar.js.map → supervision-discovery-6EtvKCsU.js.map} +1 -1
- package/dist/{supervisor-BDOWzyCC.js → supervisor-CwANBb9-.js} +10 -3
- package/dist/supervisor-CwANBb9-.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +11 -11
- package/dist/{top-web-CNTJBqFy.js → top-web-CZP3RRhD.js} +5 -5
- package/dist/{top-web-CNTJBqFy.js.map → top-web-CZP3RRhD.js.map} +1 -1
- package/dist/tui/bin.js +3 -3
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +2 -2
- package/dist/{types-tG_tps7N.d.ts → types-ooyUaxq_.d.ts} +18 -3
- package/package.json +2 -2
- package/dist/jsonl-file-CbxMVnUj.js.map +0 -1
- package/dist/scope-Bg1uCsPR.js.map +0 -1
- package/dist/supervise-472pyfgQ.js.map +0 -1
- package/dist/supervisor-BDOWzyCC.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { $n as persistHarnessTranscript,
|
|
1
|
+
import { $n as persistHarnessTranscript, Ai as spendFromUsageTotals, At as beginScopeRetainedOwnerDrive, B as beginScopeOwnerAttempt, Di as meterUsageEvent, Dt as prepareScopeRetainedOwnerTask, Et as consumeScopeRetainedOwnerResult, Fr as runtimeOwnedExecutorExecutionBinding, Ft as scopeRetainedOwnerRestorePoint, G as scopeOwnerExecutorNodeContext, Gr as runtimeFlowAgent, H as noteScopeOwnerPlannedExecution, Ht as scopeRetainedOwnerJournalRoot, Ir as runtimeOwnedExecutorMaterialization, It as noteScopeRetainedOwnerCoordination, J as providerVisibleProfile, K as coordinationMcpAlias, Kr as runtimeFlowBrain, Lr as runtimeOwnedExecutorProviderEvidence, Mt as scopeRetainedOwnerTurnEnded, Nt as assertRetainedOwnerCoordinationRekey, O as parseWorkerToolTraceArtifact, Oi as newUsageTotals, Or as providerAttemptEvidence, Ot as scopeRetainedOwnerPriorSpend, Pr as runtimeOwnedDriveHarnessProviderEvidence, Pt as reconcileScopeRetainedOwnerEnvironment, Q as assertRecursiveReservationPolicy, Rr as runtimeOwnedPendingExecutorMaterialization, Rt as bindScopeRetainedOwnerEnvironmentId, St as scopeRetainedOwnerResourceReader, Tt as abandonScopeRetainedOwnerInvocation, U as recordScopeOwnerMaterialization, Vn as generateSpanId, Vt as scopeRetainedOwnerContext, W as restoreScopeOwnerAcceptedExecution, Wr as isRuntimeFlowBrain, Y as runtimeGraphMetadataKey, a as readRootStream, ai as registerRetainedExecutorPreparation, br as attestRuntimeOwnedScopeOwner, bt as prepareScopeRetainedOwnerSeatSwitch, ca as RunCancellationReason, ct as recordScopeOwnerBarrenPause, da as runAbortable, di as jitteredMs, dr as SEAT_RECHECK_MS, ea as recordValue, er as readHarnessTranscript, fr as SeatChain, hi as unavailableResumeAt, hr as seatExecutionProfile, ji as assertValidBudget, kn as WORKER_TRACE_PROPAGATION, kr as recordRuntimeOwnedDriveHarnessProviderEvidence, kt as scopeRetainedOwnerResult, lr as isLiveNodeStatus, lt as recordScopeOwnerDriverAttempt, mi as unavailablePauseMs, mr as authoredSeatStages, n as ROOT_STREAM_FILE, or as createActivityLog, ot as meterRuntimeOwnedAccounting, pi as reportedResetAt, pr as SeatPauseError, q as coordinationProfileToolPrefix, r as createRootStreamSink, si as retainedExecutorSeamKey, st as meterRuntimeOwnedProviderAttempt, ti as RetainedExecutionPendingError, ua as linkAbort, ui as cappedDoublingMs, ur as isTerminalNodeStatus, ut as recordScopeOwnerPause, wr as inheritRuntimeOwnedExecutorAttestation, xi as executorFailure, xr as authoredAgentIdentity, xt as releaseScopeRetainedOwnerForSeatPause, yi as contentAddress, zn as createOtelExporter, zr as runtimeOwnedScopeOwnerRuntime, zt as bindScopeRetainedOwnerProvider } from "./scope-CJ7xtrs8.js";
|
|
2
2
|
import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError } from "./errors-AzSuGI23.js";
|
|
3
3
|
import { $ as isAsyncIterable, Dt as teardownExecutor, G as chargedTokens, Ot as teardownSurfaces, St as armDeadlineTimer, Tt as isDeadlineAbortReason, U as addSpend, Y as errorMessage, at as sleep, bt as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, dt as zeroSpend, gt as withBudgetResources, ht as resourceTelemetry, lt as unmeteredSpend, pt as addResourceSpend, tt as promptCacheTokenClasses, ut as withTimeout } from "./workspace-streams-8ALHaZzx.js";
|
|
4
|
-
import { d as detachedSnapshot, h as errorHttpStatus, m as errMessage, p as causeChain } from "./jsonl-file-
|
|
5
|
-
import { $t as promptModelProfileMaterialization, At as bridgeModelRouteRefusal, B as createRouterTranscript, C as createExecutor, Ct as admitContinuationPolicy, Et as createContinuationKeeper, F as codeModeArguments, I as codeModeModelOutput, Jt as controlProfileMaterialization, Kt as assertProfileMaterialization, L as createCodeModeTools, Qt as promptControlProfileMaterialization, Rt as bridgeRuntimeAttachmentsKey, S as captureReusableExecutorConfig, St as CONTINUATIONS_DIR, Tt as checkVerdictOf, U as resolveAgentEnvironmentProvider, V as routerBrain, X as createInbox, Xt as fullProfileMaterialization, Y as INBOX_RECEIPT_KEY, Yt as defineProfileMaterializationContract, Zt as profileMaterializationAxes$1, _t as CheckUnavailableError, a as assertRunParking, c as sleepScopeWait, ct as HarnessTurnFailedError, d as runFinalizer, dt as isContentFilterRefusal, en as renderUnsupported, et as PEER_MAIL_WIRE_KEY, f as runTree, ft as summarizeDriverAttempts, g as isDriverSpec, gt as preflightPublicCoordination, h as driverExecutorFactory, ht as upstreamUnavailableSignal, i as RunParkedError, in as worktreeCliProfileMaterialization, kt as bridgeAdmissionRefusal, l as withRunParking, lt as abandonablePending, m as driverChild, mt as undispatchedCredentialExit, n as createSupervisor, nn as sandboxProfileMaterialization, o as bindScopeParkingDrain, p as createRootHandle, pt as transientFailureKind, rn as unsupportedProfileDimensions, rt as isPeerMailEnvelope, st as DriverAttemptsExhaustedError, u as bestDelivered, ut as classifyDriverFailure, vt as gateFactoryOnDeliverable, w as snapshotExecutorConfig, wt as bestComposite, x as bindReusableExecutorExecutionId, z as toolResultText, zt as bridgeStopSignalKey } from "./supervisor-
|
|
4
|
+
import { _ as errorText, d as detachedSnapshot, h as errorHttpStatus, m as errMessage, p as causeChain } from "./jsonl-file-CvPuwM0a.js";
|
|
5
|
+
import { $t as promptModelProfileMaterialization, At as bridgeModelRouteRefusal, B as createRouterTranscript, C as createExecutor, Ct as admitContinuationPolicy, Et as createContinuationKeeper, F as codeModeArguments, I as codeModeModelOutput, Jt as controlProfileMaterialization, Kt as assertProfileMaterialization, L as createCodeModeTools, Qt as promptControlProfileMaterialization, Rt as bridgeRuntimeAttachmentsKey, S as captureReusableExecutorConfig, St as CONTINUATIONS_DIR, Tt as checkVerdictOf, U as resolveAgentEnvironmentProvider, V as routerBrain, X as createInbox, Xt as fullProfileMaterialization, Y as INBOX_RECEIPT_KEY, Yt as defineProfileMaterializationContract, Zt as profileMaterializationAxes$1, _t as CheckUnavailableError, a as assertRunParking, c as sleepScopeWait, ct as HarnessTurnFailedError, d as runFinalizer, dt as isContentFilterRefusal, en as renderUnsupported, et as PEER_MAIL_WIRE_KEY, f as runTree, ft as summarizeDriverAttempts, g as isDriverSpec, gt as preflightPublicCoordination, h as driverExecutorFactory, ht as upstreamUnavailableSignal, i as RunParkedError, in as worktreeCliProfileMaterialization, kt as bridgeAdmissionRefusal, l as withRunParking, lt as abandonablePending, m as driverChild, mt as undispatchedCredentialExit, n as createSupervisor, nn as sandboxProfileMaterialization, o as bindScopeParkingDrain, p as createRootHandle, pt as transientFailureKind, rn as unsupportedProfileDimensions, rt as isPeerMailEnvelope, st as DriverAttemptsExhaustedError, u as bestDelivered, ut as classifyDriverFailure, vt as gateFactoryOnDeliverable, w as snapshotExecutorConfig, wt as bestComposite, x as bindReusableExecutorExecutionId, z as toolResultText, zt as bridgeStopSignalKey } from "./supervisor-CwANBb9-.js";
|
|
6
6
|
import { _ as agentHarness, a as concreteProfileModel, c as profileModelExecutionSettings, l as profileProviderModel, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile, v as harnessRunsAgent } from "./model-policy-JOcg3NRs.js";
|
|
7
7
|
import { n as createStdioToolServer } from "./tool-server-CZWd_Opp.js";
|
|
8
8
|
import { t as composeRuntimeHooks } from "./runtime-hooks-CsW2pfFk.js";
|
|
9
|
-
import { _ as workerAssignmentNamespace, c as writeRunCancellation, d as coordinationEventId, f as externalExecutionId, g as supervisionRunNamespace, h as rootCoordinationOwner, i as readRunCancellation, l as canonicalExecution, m as freezeDetachedProfile, p as freezeDetached, r as readRunCancelRequest, s as watchRunCancellation, t as applyRunCancellation, u as childCoordinationOwner } from "./run-cancellation-
|
|
10
|
-
import { c as createSteerAcknowledger, d as coordinationVerbNames, f as createFileRunContext, l as budgetOverspendText, m as withRunContext, n as createCoordinationToolsForManager, p as createInMemoryRunContext, s as createCancelAcknowledger, t as createCoordinationTools, u as normalizeAnalyzeOnSettle } from "./coordination-manager-
|
|
11
|
-
import { o as safeJsonText } from "./coordination-map-routing-
|
|
12
|
-
import { a as graphRegistry, c as loadGraph } from "./graph-registry-
|
|
9
|
+
import { _ as workerAssignmentNamespace, c as writeRunCancellation, d as coordinationEventId, f as externalExecutionId, g as supervisionRunNamespace, h as rootCoordinationOwner, i as readRunCancellation, l as canonicalExecution, m as freezeDetachedProfile, p as freezeDetached, r as readRunCancelRequest, s as watchRunCancellation, t as applyRunCancellation, u as childCoordinationOwner } from "./run-cancellation-CGgk54Md.js";
|
|
10
|
+
import { c as createSteerAcknowledger, d as coordinationVerbNames, f as createFileRunContext, l as budgetOverspendText, m as withRunContext, n as createCoordinationToolsForManager, p as createInMemoryRunContext, s as createCancelAcknowledger, t as createCoordinationTools, u as normalizeAnalyzeOnSettle } from "./coordination-manager-C-ZoeZ73.js";
|
|
11
|
+
import { o as safeJsonText } from "./coordination-map-routing-SnsZp287.js";
|
|
12
|
+
import { a as graphRegistry, c as loadGraph } from "./graph-registry-CI1o16DH.js";
|
|
13
13
|
import { ATTR, agentIdentityAttributes } from "@tangle-network/agent-trace-contract";
|
|
14
14
|
import { ProxySecretScopeSchema, ProxySecretsSchema, agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalCandidateJson, mergeProxySecretBindings, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
15
15
|
import { toolSpansToTraceAnalysisStore } from "@tangle-network/agent-eval";
|
|
@@ -2451,11 +2451,13 @@ function assertPerWorkerAdmittable(perWorker, pool, ownerShare) {
|
|
|
2451
2451
|
].filter((x) => x !== null);
|
|
2452
2452
|
if (unadmittable.length > 0) throw new ValidationError(`${unadmittable.join("; ")} — lower perWorker on that channel so a child fits beside the owner's own turns; otherwise children are refused or starve at spawn hours into the run.`);
|
|
2453
2453
|
}
|
|
2454
|
-
/** The slice a child gets when its manager names none:
|
|
2455
|
-
*
|
|
2456
|
-
*
|
|
2457
|
-
|
|
2458
|
-
|
|
2454
|
+
/** The slice a child gets when its manager names none: the part of the manager's budget its
|
|
2455
|
+
* children may reserve, divided by the run's worker slots (four with none), so the slots, not the
|
|
2456
|
+
* budget, set how many run at once. A quarter share capped managers with 8-15 slots at 2-4
|
|
2457
|
+
* children (zro-w4a16-hopper-20261104b held 4 of 8; canary-soak-20261104a queued s5-s7 163-176 s). */
|
|
2458
|
+
function defaultPerWorker(budget, ownerShare, workerSlots) {
|
|
2459
|
+
const slots = typeof workerSlots === "number" ? workerSlots : workerSlots?.max;
|
|
2460
|
+
const share = (1 - ownerShare) / (slots !== void 0 && slots > 0 ? slots : 4);
|
|
2459
2461
|
return {
|
|
2460
2462
|
...budget.resources === void 0 ? {} : { resources: Object.fromEntries(Object.entries(budget.resources).map(([name, value]) => [name, {
|
|
2461
2463
|
unit: value.unit,
|
|
@@ -3590,23 +3592,24 @@ function createCoordinationCredentials(input) {
|
|
|
3590
3592
|
current = next;
|
|
3591
3593
|
staged = void 0;
|
|
3592
3594
|
};
|
|
3595
|
+
let installing = false;
|
|
3593
3596
|
const rotate = () => {
|
|
3594
|
-
if (
|
|
3597
|
+
if (installing) throw new ConfigError("coordination credential replacement is pending");
|
|
3598
|
+
if (staged) revoked.set(staged.token.toString(), staged.expiresAt);
|
|
3595
3599
|
commit(issue());
|
|
3596
3600
|
readerToken = randomToken();
|
|
3597
3601
|
controllerToken = randomToken();
|
|
3598
3602
|
};
|
|
3599
3603
|
const replace = async (install) => {
|
|
3600
|
-
if (
|
|
3601
|
-
|
|
3602
|
-
|
|
3604
|
+
if (installing) throw new ConfigError("coordination credential replacement is pending");
|
|
3605
|
+
if (!staged || staged.expiresAt <= Date.now()) staged = issue();
|
|
3606
|
+
const next = staged;
|
|
3607
|
+
installing = true;
|
|
3603
3608
|
try {
|
|
3604
3609
|
await install(next.headers);
|
|
3605
3610
|
commit(next, true);
|
|
3606
|
-
}
|
|
3607
|
-
|
|
3608
|
-
revoked.set(next.token.toString(), next.expiresAt);
|
|
3609
|
-
throw error;
|
|
3611
|
+
} finally {
|
|
3612
|
+
installing = false;
|
|
3610
3613
|
}
|
|
3611
3614
|
};
|
|
3612
3615
|
const matches = (supplied, expected) => supplied.length === expected.length && timingSafeEqual(supplied, expected);
|
|
@@ -4291,6 +4294,7 @@ function assertCoordinationTransport(options) {
|
|
|
4291
4294
|
}
|
|
4292
4295
|
/** Response hold cap, under the 60 s MCP tool-call timeout Claude Code and Codex apply. */
|
|
4293
4296
|
const RESPONSE_FENCE_CAP_MS = 45e3;
|
|
4297
|
+
const RENEWAL_RETRY_MAX_MS = 6e4;
|
|
4294
4298
|
/** The longest a fenced call (`submit_result`, node tools) holds its response before answering with
|
|
4295
4299
|
* a receipt: half of `requestTimeoutMs` (beating the transport's 504), at most {@link RESPONSE_FENCE_CAP_MS}. */
|
|
4296
4300
|
function coordinationResponseFenceMs(requestTimeoutMs) {
|
|
@@ -4350,6 +4354,7 @@ async function serveCoordinationMcpForManager(opts, lifetime) {
|
|
|
4350
4354
|
} });
|
|
4351
4355
|
if ((opts.authentication || opts.onAudit) && (!identity.runId.trim() || !identity.actorId.trim())) throw new ConfigError("authenticated coordination requires a trusted run and actor identity");
|
|
4352
4356
|
const state = openCoordinationListenerState();
|
|
4357
|
+
let renewing = false;
|
|
4353
4358
|
const stopUnreachable = (reason) => {
|
|
4354
4359
|
state.closed = true;
|
|
4355
4360
|
try {
|
|
@@ -4364,7 +4369,9 @@ async function serveCoordinationMcpForManager(opts, lifetime) {
|
|
|
4364
4369
|
lifetimeSignal: lifetime,
|
|
4365
4370
|
lifetimeExpiresAt: opts.scope.rootDeadlineAtMs,
|
|
4366
4371
|
isClosed: () => state.closed,
|
|
4367
|
-
onExpiredBearer: () =>
|
|
4372
|
+
onExpiredBearer: () => {
|
|
4373
|
+
if (!renewing) stopUnreachable("coordination credential expired in its holder: no renewal reached it");
|
|
4374
|
+
}
|
|
4368
4375
|
});
|
|
4369
4376
|
const ctx = {
|
|
4370
4377
|
opts,
|
|
@@ -4440,15 +4447,25 @@ async function serveCoordinationMcpForManager(opts, lifetime) {
|
|
|
4440
4447
|
await pending;
|
|
4441
4448
|
};
|
|
4442
4449
|
stopCredentialBinding = stop;
|
|
4450
|
+
let failures = 0;
|
|
4443
4451
|
const schedule = () => {
|
|
4452
|
+
failures = 0;
|
|
4453
|
+
renewing = false;
|
|
4444
4454
|
const expiry = credentials.expiresAt;
|
|
4445
4455
|
if (!active || state.closed || opts.scope.signal.aborted || lifetime?.aborted || opts.scope.rootDeadlineAtMs !== void 0 && expiry >= opts.scope.rootDeadlineAtMs) return;
|
|
4446
4456
|
cancelTimer = armDeadlineTimer(Math.max(1, Math.floor((expiry - Date.now()) / 2)), renew);
|
|
4447
4457
|
};
|
|
4458
|
+
const stopped = () => !active || state.closed || opts.scope.signal.aborted || lifetime?.aborted;
|
|
4459
|
+
const retry = (error) => {
|
|
4460
|
+
if (stopped()) return;
|
|
4461
|
+
const paced = error.retryAfterMs ?? 1e3 * 2 ** failures++;
|
|
4462
|
+
console.warn(`[coordination] credential renewal retries: ${errMessage(error)}`);
|
|
4463
|
+
cancelTimer = armDeadlineTimer(Math.min(paced, RENEWAL_RETRY_MAX_MS), renew);
|
|
4464
|
+
};
|
|
4448
4465
|
const renew = () => {
|
|
4449
|
-
if (
|
|
4450
|
-
|
|
4451
|
-
pending.then(schedule,
|
|
4466
|
+
if (stopped()) return;
|
|
4467
|
+
renewing = true;
|
|
4468
|
+
pending = credentials.replace(install).then(schedule, retry);
|
|
4452
4469
|
};
|
|
4453
4470
|
refreshBoundCredential = () => {
|
|
4454
4471
|
cancelTimer?.();
|
|
@@ -5175,7 +5192,10 @@ var DriverRetryLoop = class {
|
|
|
5175
5192
|
const stop = (() => {
|
|
5176
5193
|
if (run.signal.aborted) return abortStop(run.signal);
|
|
5177
5194
|
if (!limits.retryEnabled) return "retry-disabled";
|
|
5178
|
-
|
|
5195
|
+
const byBudget = budgetStop(run.budget(), limits.now());
|
|
5196
|
+
if (byBudget) return byBudget;
|
|
5197
|
+
const deadline = run.budget().deadlineMs;
|
|
5198
|
+
return deadline > 0 && (reportedResetAt(error) ?? 0) >= deadline ? "deadline" : void 0;
|
|
5179
5199
|
})();
|
|
5180
5200
|
const unavailableSignal = upstreamUnavailableSignal(error) ?? "unavailable";
|
|
5181
5201
|
if (stop !== void 0) {
|
|
@@ -5188,7 +5208,7 @@ var DriverRetryLoop = class {
|
|
|
5188
5208
|
this.pauses += 1;
|
|
5189
5209
|
this.consecutivePauses = progressed ? 1 : this.consecutivePauses + 1;
|
|
5190
5210
|
const pausedAt = limits.now();
|
|
5191
|
-
const resetAt = unavailableResumeAt(
|
|
5211
|
+
const resetAt = unavailableResumeAt(reportedResetAt(error), pausedAt);
|
|
5192
5212
|
const deadlineMs = run.budget().deadlineMs;
|
|
5193
5213
|
const pause = resetAt === void 0 ? jitteredMs(unavailablePauseMs(this.consecutivePauses, limits.policy), limits.random) : Math.max(1e3, Math.min(resetAt, deadlineMs > 0 ? deadlineMs : resetAt) - pausedAt);
|
|
5194
5214
|
const exitCode = undispatchedCredentialExit(error);
|
|
@@ -6766,7 +6786,7 @@ function automaticDriverBackendSupported(backend, coordination) {
|
|
|
6766
6786
|
function buildNestedManagerDeps(child) {
|
|
6767
6787
|
const { env, seat, admitted, spawnContext } = child;
|
|
6768
6788
|
const { options, ownerShare, authorizeDownFor, peerAuditFor } = env.setup;
|
|
6769
|
-
const nestedPerWorker = defaultPerWorker(spawnContext.budget, ownerShare);
|
|
6789
|
+
const nestedPerWorker = defaultPerWorker(spawnContext.budget, ownerShare, options.workerSlots);
|
|
6770
6790
|
const runMessageAuthority = authorizeDownFor(admitted.authorized, seat.depth + 1);
|
|
6771
6791
|
const authorizeNestedMessage = child.subtreeGraph && runMessageAuthority ? child.subtreeGraph.observeMessages(runMessageAuthority) : runMessageAuthority;
|
|
6772
6792
|
const policy = nestedSettlementPolicy(child);
|
|
@@ -6923,7 +6943,7 @@ async function storeCoordinationSecret(provider, secrets, name, bind, policy) {
|
|
|
6923
6943
|
if (!(date instanceof Date) || !Number.isFinite(date.getTime())) throw new ValidationError("provider secret receipt has no valid updatedAt");
|
|
6924
6944
|
return date.toISOString();
|
|
6925
6945
|
};
|
|
6926
|
-
let revision;
|
|
6946
|
+
let revision, adopted = false;
|
|
6927
6947
|
const prior = secrets.get(name);
|
|
6928
6948
|
if (prior?.binding === bind && prior.ready) return prior.policy;
|
|
6929
6949
|
if (prior?.binding === bind) throw new ValidationError("coordination binding is not ready");
|
|
@@ -6962,16 +6982,26 @@ async function storeCoordinationSecret(provider, secrets, name, bind, policy) {
|
|
|
6962
6982
|
const authority = (bindings) => canonicalCandidateDigest(bindings?.map(({ ttlSeconds: _, ...binding }) => binding));
|
|
6963
6983
|
if (stored.exposeInBox || authority(recovered) !== authority(policy.proxySecrets)) throw new ValidationError("stored coordination policy has different authority");
|
|
6964
6984
|
entry.policy = { proxySecrets: recovered };
|
|
6985
|
+
adopted = true;
|
|
6965
6986
|
}
|
|
6966
6987
|
}
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6988
|
+
try {
|
|
6989
|
+
revision = stamp(await store.update(name, value, {
|
|
6990
|
+
...entry.policy,
|
|
6991
|
+
expectedUpdatedAt
|
|
6992
|
+
}));
|
|
6993
|
+
} catch (error) {
|
|
6994
|
+
if (entry.ready) revision = await store.list().then((rows) => stamp(rows.find((row) => row.name === name)), () => revision);
|
|
6995
|
+
throw error;
|
|
6996
|
+
}
|
|
6971
6997
|
});
|
|
6972
6998
|
entry.ready = true;
|
|
6973
6999
|
return entry.policy;
|
|
6974
7000
|
} catch (cause) {
|
|
7001
|
+
if (adopted) {
|
|
7002
|
+
secrets.delete(name);
|
|
7003
|
+
throw cause;
|
|
7004
|
+
}
|
|
6975
7005
|
await entry.release().catch((cleanup) => {
|
|
6976
7006
|
throw new AggregateError([cause, cleanup], "coordination binding and cleanup failed");
|
|
6977
7007
|
});
|
|
@@ -8348,10 +8378,14 @@ var ManagerDriveSession = class {
|
|
|
8348
8378
|
}
|
|
8349
8379
|
const seatJournalRoot = scopeRetainedOwnerJournalRoot(scope) ?? seatSelection.rootId;
|
|
8350
8380
|
this.seatChain ??= new SeatChain(authoredProfile, scope.view.root, seatJournalRoot, seatSelection.journal, seatSelection.select, now, (segment, phase) => seatSelection.onSegment(scope.view.root, segment, phase), async (selection, previous) => {
|
|
8351
|
-
if (previous
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8381
|
+
if (!previous || previous.seat === selection.seat) return;
|
|
8382
|
+
const sameEnvironment = previous.provider === selection.stage.provider && previous.harness === selection.stage.harness;
|
|
8383
|
+
try {
|
|
8384
|
+
const checkpointAt = await prepareScopeRetainedOwnerSeatSwitch(scope, sameEnvironment ? "same-environment" : "replace-environment");
|
|
8385
|
+
if (!sameEnvironment) this.switchedProviderCheckpointAt = checkpointAt;
|
|
8386
|
+
} catch (error) {
|
|
8387
|
+
scope.signal.throwIfAborted();
|
|
8388
|
+
throw new SeatPauseError(new Date(now() + SEAT_RECHECK_MS).toISOString(), `seat switch waits: ${errorText(error instanceof Error ? error.message : error)}`);
|
|
8355
8389
|
}
|
|
8356
8390
|
});
|
|
8357
8391
|
const usageLimit = reentry?.reason.reason === "upstream-unavailable" && reentry.reason.signal === "subscription-usage-limit";
|
|
@@ -8374,13 +8408,14 @@ var ManagerDriveSession = class {
|
|
|
8374
8408
|
if (afterRecheck) await seatSelection.onPause(scope.view.root, "", "resumed");
|
|
8375
8409
|
return seat;
|
|
8376
8410
|
} catch (error) {
|
|
8377
|
-
if (!(error instanceof
|
|
8411
|
+
if (!(error instanceof SeatPauseError)) throw error;
|
|
8378
8412
|
if (error.resumeAt !== pausedUntil) {
|
|
8379
8413
|
pausedUntil = error.resumeAt;
|
|
8380
8414
|
await seatSelection.journal.appendEvent(seatJournalRoot, {
|
|
8381
8415
|
kind: "seat-paused",
|
|
8382
8416
|
id: scope.view.root,
|
|
8383
8417
|
resumeAt: error.resumeAt,
|
|
8418
|
+
...error.detail === void 0 ? {} : { detail: error.detail },
|
|
8384
8419
|
seq: Date.parse(error.resumeAt),
|
|
8385
8420
|
at: new Date(now()).toISOString()
|
|
8386
8421
|
});
|
|
@@ -8851,7 +8886,7 @@ function providerSpawnPreflight(provider) {
|
|
|
8851
8886
|
const validate = provider.validateProfile?.bind(provider);
|
|
8852
8887
|
if (validate === void 0) return void 0;
|
|
8853
8888
|
return async (profile) => {
|
|
8854
|
-
const result = await validate(profile);
|
|
8889
|
+
const result = await validate(providerVisibleProfile(profile));
|
|
8855
8890
|
const errors = result.issues.filter((issue) => issue.level === "error");
|
|
8856
8891
|
if (result.ok && errors.length === 0) return void 0;
|
|
8857
8892
|
const named = errors.map((issue) => `${issue.code}${issue.path === void 0 ? "" : ` at ${issue.path}`}: ${issue.message}`);
|
|
@@ -8861,6 +8896,23 @@ function providerSpawnPreflight(provider) {
|
|
|
8861
8896
|
};
|
|
8862
8897
|
};
|
|
8863
8898
|
}
|
|
8899
|
+
/** Refuse a Runtime-managed child whose model controls its executor would refuse at its first
|
|
8900
|
+
* attempt (an unknown `model.metadata` key, an ambiguous `maxTokens`): the same check, at the call. */
|
|
8901
|
+
function modelSettingsSpawnPreflight(runtimeOwnsManager, path) {
|
|
8902
|
+
if (!runtimeOwnsManager) return void 0;
|
|
8903
|
+
return async (profile) => {
|
|
8904
|
+
try {
|
|
8905
|
+
profileModelExecutionSettings(profile, "spawn_worker", path);
|
|
8906
|
+
return;
|
|
8907
|
+
} catch (error) {
|
|
8908
|
+
if (!(error instanceof ConfigError)) throw error;
|
|
8909
|
+
return {
|
|
8910
|
+
cause: "unprovisionable-profile",
|
|
8911
|
+
detail: error.message
|
|
8912
|
+
};
|
|
8913
|
+
}
|
|
8914
|
+
};
|
|
8915
|
+
}
|
|
8864
8916
|
/** Refuse a Runtime-managed child whose declared tools cannot exist on its execution path. */
|
|
8865
8917
|
function profileToolSpawnPreflight(runtimeOwnsManager, canResolveProductTools) {
|
|
8866
8918
|
return async (profile) => {
|
|
@@ -9123,7 +9175,7 @@ function resolveRunRegistry(options) {
|
|
|
9123
9175
|
function admitPerWorker(options) {
|
|
9124
9176
|
assertRecursiveReservationPolicy(options.reservationPolicy);
|
|
9125
9177
|
const ownerShare = options.reservationPolicy?.ownerShare ?? 0;
|
|
9126
|
-
const perWorker = options.perWorker ?? defaultPerWorker(options.budget, ownerShare);
|
|
9178
|
+
const perWorker = options.perWorker ?? defaultPerWorker(options.budget, ownerShare, options.workerSlots);
|
|
9127
9179
|
assertValidBudget(perWorker, "supervise perWorker");
|
|
9128
9180
|
assertPerWorkerWithinPool(perWorker, options.budget);
|
|
9129
9181
|
if (options.perWorker !== void 0) assertPerWorkerAdmittable(perWorker, options.budget, ownerShare);
|
|
@@ -9154,7 +9206,7 @@ function managerDriverPlan(options, canonicalProfile, externalRoot) {
|
|
|
9154
9206
|
if (authoredSeatStages(canonicalProfile) && !hasCustomDriveHarness && !options.selectSeat) throw new ValidationError("supervise: AgentProfile.seats requires selectSeat before execution");
|
|
9155
9207
|
const automaticDriver = managerBackend !== void 0 && automaticDriverBackendSupported(managerBackend, options.coordination);
|
|
9156
9208
|
const spawnResourceRoot = hasCustomDriveHarness ? void 0 : rootSpawnResourceRoot(managerBackend);
|
|
9157
|
-
const spawnPreflight = composeSpawnPreflights(profileToolSpawnPreflight(options.makeWorkerAgent === void 0, options.resolveSupervisorTools !== void 0), coordinationChannelSpawnPreflight(options.makeWorkerAgent === void 0, hasCustomDriveHarness, managerBackend, options.coordination), options.backend?.backend === "bridge" ? bridgeSpawnPreflight(options.backend) : void 0, options.backend?.backend === "provider" && typeof options.backend.provider === "object" ? providerSpawnPreflight(options.backend.provider) : void 0);
|
|
9209
|
+
const spawnPreflight = composeSpawnPreflights(modelSettingsSpawnPreflight(options.makeWorkerAgent === void 0, options.backend?.backend === "provider" ? "provider" : "router"), profileToolSpawnPreflight(options.makeWorkerAgent === void 0, options.resolveSupervisorTools !== void 0), coordinationChannelSpawnPreflight(options.makeWorkerAgent === void 0, hasCustomDriveHarness, managerBackend, options.coordination), options.backend?.backend === "bridge" ? bridgeSpawnPreflight(options.backend) : void 0, options.backend?.backend === "provider" && typeof options.backend.provider === "object" ? providerSpawnPreflight(options.backend.provider) : void 0);
|
|
9158
9210
|
const driverMaterialization = hasCustomDriveHarness ? options.driveHarnessMaterialization ?? fullProfileMaterialization : managerBackend && automaticDriver ? backendProfileMaterialization(managerBackend) : void 0;
|
|
9159
9211
|
if (externalRoot && !hasCustomDriveHarness && !automaticDriver) throw new ValidationError(`supervise: external supervisor profile.harness=${JSON.stringify(canonicalProfile.harness)} requires a local bridge, a provider with authenticated coordination.publicUrl and runtime MCP attachments, or an explicit driveHarness with reachable coordination transport`);
|
|
9160
9212
|
return {
|
|
@@ -9442,4 +9494,4 @@ function superviseWithContext(profile, task, opts, brain) {
|
|
|
9442
9494
|
}
|
|
9443
9495
|
export { analyzesFindingsReportPrompt as A, anyOf as B, flowRootProfile as C, defaultEdgeTraversalCap as D, validateFlowGraph as E, formatPromptHandle as F, bestSoFar as G, plateau as H, kernelPromptRegistry as I, createSupervisorSpanRecorder as J, plateauLength as K, naiveContinuationPrompt as L, delegatesWorkerBriefPrompt as M, dumbContinuationFailPrompt as N, graphRootProfile as O, dumbContinuationPassPrompt as P, promptHandle as R, createFlowRun as S, routeFlowOf as T, anytimeReport as U, noProgressFor as V, areaUnderCurve as W, coordinationControlToolNames as _, superviseRootProfile as a, createGraphOverlay as b, retryPreSpawnRefusals as c, supervisorAgent as d, supervisorAgentWithTestBrain as f, serveCoordinationMcp as g, composeReentryTask as h, profileGuidanceComposer as i, createPromptRegistry as j, validateGraphTopology as k, withWorkerSpawnRetry as l, UNPROVEN_CONTINUITY as m, superviseFleetCapabilities as n, isPreSpawnExecutorFailure as o, runToolSpans as p, renderAnytimeTable as q, superviseWithTestBrain as r, resolveWorkerSpawnRetry as s, supervise as t, workerFromBackend as u, driverAgent as v, journaledGateDecider as w, GraphRouteError as x, runBrainLoop as y, allWorkersStalled as z };
|
|
9444
9496
|
|
|
9445
|
-
//# sourceMappingURL=supervise-
|
|
9497
|
+
//# sourceMappingURL=supervise-MAzd0hOk.js.map
|