@tangle-network/agent-runtime 3.0.17 → 3.0.19
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-BDfK0qUP.js → activation-CiCGGm2I.js} +2 -2
- package/dist/{activation-BDfK0qUP.js.map → activation-CiCGGm2I.js.map} +1 -1
- package/dist/agent.js +2 -2
- package/dist/{coordination-manager-BRJ-3FYo.js → coordination-manager-CnhmWuIX.js} +2 -2
- package/dist/{coordination-manager-BRJ-3FYo.js.map → coordination-manager-CnhmWuIX.js.map} +1 -1
- package/dist/{delegate-B9hjoWtv.js → delegate-BRJPGltl.js} +2 -2
- package/dist/{delegate-B9hjoWtv.js.map → delegate-BRJPGltl.js.map} +1 -1
- package/dist/durable.js +3 -3
- package/dist/{graph-DITmb_sh.js → graph-BfMlwjJf.js} +4 -4
- package/dist/{graph-DITmb_sh.js.map → graph-BfMlwjJf.js.map} +1 -1
- package/dist/{improve-B4LkHUCx.js → improve-ikgoMB8n.js} +5 -5
- package/dist/{improve-B4LkHUCx.js.map → improve-ikgoMB8n.js.map} +1 -1
- package/dist/index.js +7 -7
- package/dist/intelligence.js +3 -3
- package/dist/kernel.js +9 -9
- package/dist/{loop-runner-DYrzAEL1.js → loop-runner-Ddrz869H.js} +2 -2
- package/dist/{loop-runner-DYrzAEL1.js.map → loop-runner-Ddrz869H.js.map} +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +2 -2
- package/dist/mcp/index.js +4 -4
- package/dist/{provision-supervisor-CI7KnQU5.js → provision-supervisor-D4Yz6sdC.js} +3 -3
- package/dist/{provision-supervisor-CI7KnQU5.js.map → provision-supervisor-D4Yz6sdC.js.map} +1 -1
- package/dist/{runtime-Bv8Fg8_o.js → runtime-DmtlNrgj.js} +9 -9
- package/dist/{runtime-Bv8Fg8_o.js.map → runtime-DmtlNrgj.js.map} +1 -1
- package/dist/{search-executor-CQIV9K8q.js → search-executor-Btbon3_a.js} +2 -2
- package/dist/{search-executor-CQIV9K8q.js.map → search-executor-Btbon3_a.js.map} +1 -1
- package/dist/{server-CJKgAwAC.js → server-D4yuf0ZQ.js} +2 -2
- package/dist/{server-CJKgAwAC.js.map → server-D4yuf0ZQ.js.map} +1 -1
- package/dist/{structural-rollout-BGbw3v4h.js → structural-rollout-CykeYhjp.js} +2 -2
- package/dist/{structural-rollout-BGbw3v4h.js.map → structural-rollout-CykeYhjp.js.map} +1 -1
- package/dist/{supervise-Cm10bCQE.js → supervise-DoH3TCQa.js} +41 -19
- package/dist/supervise-DoH3TCQa.js.map +1 -0
- package/dist/{supervisor-BFoJnigz.js → supervisor-DriSPPyb.js} +8 -23
- package/dist/supervisor-DriSPPyb.js.map +1 -0
- package/dist/testing.js +11 -11
- package/dist/tui/index.js +1 -1
- package/package.json +1 -1
- package/dist/supervise-Cm10bCQE.js.map +0 -1
- package/dist/supervisor-BFoJnigz.js.map +0 -1
|
@@ -2,11 +2,11 @@ import { $n as persistHarnessTranscript, Ai as spendFromUsageTotals, At as begin
|
|
|
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
4
|
import { d as detachedSnapshot, h as errorHttpStatus, m as errMessage } from "./jsonl-file-BBP9Dz9w.js";
|
|
5
|
-
import { B as createRouterTranscript, C as createExecutor, Ct as
|
|
5
|
+
import { $t as renderUnsupported, B as createRouterTranscript, C as createExecutor, Ct as bestComposite, F as codeModeArguments, Gt as assertProfileMaterialization, I as codeModeModelOutput, Jt as defineProfileMaterializationContract, L as createCodeModeTools, Lt as bridgeRuntimeAttachmentsKey, Ot as bridgeAdmissionRefusal, Qt as promptModelProfileMaterialization, Rt as bridgeStopSignalKey, S as captureReusableExecutorConfig, St as admitContinuationPolicy, Tt as createContinuationKeeper, U as resolveAgentEnvironmentProvider, V as routerBrain, X as createInbox, Xt as profileMaterializationAxes$1, Y as INBOX_RECEIPT_KEY, Yt as fullProfileMaterialization, Zt as promptControlProfileMaterialization, _t as gateFactoryOnDeliverable, a as assertRunParking, c as sleepScopeWait, ct as HarnessTurnFailedError, d as runFinalizer, dt as classifyDriverFailure, et as PEER_MAIL_WIRE_KEY, f as runTree, ft as isContentFilterRefusal, g as isDriverSpec, gt as CheckUnavailableError, h as driverExecutorFactory, ht as upstreamUnavailableSignal, i as RunParkedError, kt as bridgeModelRouteRefusal, l as withRunParking, lt as abandonablePending, m as driverChild, mt as undispatchedCredentialExit, n as createSupervisor, nn as unsupportedProfileDimensions, o as bindScopeParkingDrain, p as createRootHandle, pt as summarizeDriverAttempts, qt as controlProfileMaterialization, rn as worktreeCliProfileMaterialization, rt as isPeerMailEnvelope, st as DriverAttemptsExhaustedError, tn as sandboxProfileMaterialization, u as bestDelivered, ut as causedByPartialFailure, w as snapshotExecutorConfig, wt as checkVerdictOf, x as bindReusableExecutorExecutionId, xt as CONTINUATIONS_DIR, z as toolResultText } from "./supervisor-DriSPPyb.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-C-RGAUW4.js";
|
|
7
7
|
import { t as composeRuntimeHooks } from "./runtime-hooks-CsW2pfFk.js";
|
|
8
8
|
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-pmPWcMy0.js";
|
|
9
|
-
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-
|
|
9
|
+
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-CnhmWuIX.js";
|
|
10
10
|
import { o as safeJsonText } from "./coordination-map-routing-BllzcZov.js";
|
|
11
11
|
import { n as createStdioToolServer, t as PROTOCOL_VERSION } from "./tool-server-CZWd_Opp.js";
|
|
12
12
|
import { a as graphRegistry, c as loadGraph } from "./graph-registry-D6y6zffC.js";
|
|
@@ -3536,7 +3536,7 @@ function createCoordinationCredentials(input) {
|
|
|
3536
3536
|
} : void 0;
|
|
3537
3537
|
const randomToken = () => Buffer.from(randomBytes(32).toString("base64url"));
|
|
3538
3538
|
let readerToken = randomToken(), controllerToken = randomToken(), audience = "";
|
|
3539
|
-
let current, staged;
|
|
3539
|
+
let current, staged, prior;
|
|
3540
3540
|
let allowLegacy = true;
|
|
3541
3541
|
const revoked = /* @__PURE__ */ new Map();
|
|
3542
3542
|
const grants = createHash("sha256").update(JSON.stringify([...input.toolNames].sort())).digest("hex");
|
|
@@ -3566,11 +3566,12 @@ function createCoordinationCredentials(input) {
|
|
|
3566
3566
|
headers: Object.freeze({ Authorization: `Bearer ${text}` })
|
|
3567
3567
|
};
|
|
3568
3568
|
}
|
|
3569
|
-
const commit = (next) => {
|
|
3570
|
-
if (current) {
|
|
3571
|
-
revoked.set(
|
|
3569
|
+
const commit = (next, renewal = false) => {
|
|
3570
|
+
if (current && !renewal) {
|
|
3571
|
+
for (const value of [current, prior]) if (value) revoked.set(value.token.toString(), value.expiresAt);
|
|
3572
3572
|
allowLegacy = false;
|
|
3573
3573
|
}
|
|
3574
|
+
prior = renewal ? current : void 0;
|
|
3574
3575
|
current = next;
|
|
3575
3576
|
staged = void 0;
|
|
3576
3577
|
};
|
|
@@ -3586,7 +3587,7 @@ function createCoordinationCredentials(input) {
|
|
|
3586
3587
|
staged = next;
|
|
3587
3588
|
try {
|
|
3588
3589
|
await install(next.headers);
|
|
3589
|
-
commit(next);
|
|
3590
|
+
commit(next, true);
|
|
3590
3591
|
} catch (error) {
|
|
3591
3592
|
staged = void 0;
|
|
3592
3593
|
revoked.set(next.token.toString(), next.expiresAt);
|
|
@@ -3596,8 +3597,12 @@ function createCoordinationCredentials(input) {
|
|
|
3596
3597
|
const matches = (supplied, expected) => supplied.length === expected.length && timingSafeEqual(supplied, expected);
|
|
3597
3598
|
const valid = (supplied) => {
|
|
3598
3599
|
if (revoked.has(supplied.toString())) return false;
|
|
3599
|
-
|
|
3600
|
-
|
|
3600
|
+
for (const value of [
|
|
3601
|
+
current,
|
|
3602
|
+
staged,
|
|
3603
|
+
prior
|
|
3604
|
+
]) if (value && Date.now() < value.expiresAt && matches(supplied, value.token)) return true;
|
|
3605
|
+
if (!signingKeys || !allowLegacy || supplied.length > 8192) return false;
|
|
3601
3606
|
try {
|
|
3602
3607
|
const parts = supplied.toString().split(".");
|
|
3603
3608
|
if (parts.length !== 2) return false;
|
|
@@ -3606,7 +3611,9 @@ function createCoordinationCredentials(input) {
|
|
|
3606
3611
|
const expected = createHmac("sha256", signingKeys.keys[claims.key]).update(payload).digest();
|
|
3607
3612
|
const signature = Buffer.from(parts[1], "base64url");
|
|
3608
3613
|
const expiry = claims.expires ?? (allowLegacy && auth?.ttlMs === void 0 ? current?.expiresAt : void 0);
|
|
3609
|
-
|
|
3614
|
+
const ours = signature.toString("base64url") === parts[1] && matches(signature, expected) && claims.run === run && claims.actor === actor && claims.audience === audience && claims.grants === grants && Number.isSafeInteger(expiry);
|
|
3615
|
+
if (ours && expiry <= Date.now()) input.onExpiredBearer?.();
|
|
3616
|
+
return ours && expiry > Date.now() && (input.lifetimeExpiresAt === void 0 || expiry <= input.lifetimeExpiresAt);
|
|
3610
3617
|
} catch {
|
|
3611
3618
|
return false;
|
|
3612
3619
|
}
|
|
@@ -4415,6 +4422,12 @@ async function serveCoordinationMcpForManager(opts, lifetime) {
|
|
|
4415
4422
|
} });
|
|
4416
4423
|
if ((opts.authentication || opts.onAudit) && (!identity.runId.trim() || !identity.actorId.trim())) throw new ConfigError("authenticated coordination requires a trusted run and actor identity");
|
|
4417
4424
|
const state = openCoordinationListenerState();
|
|
4425
|
+
const stopUnreachable = (reason) => {
|
|
4426
|
+
state.closed = true;
|
|
4427
|
+
try {
|
|
4428
|
+
opts.onStop?.(reason);
|
|
4429
|
+
} catch {}
|
|
4430
|
+
};
|
|
4418
4431
|
const credentials = createCoordinationCredentials({
|
|
4419
4432
|
authentication: opts.authentication,
|
|
4420
4433
|
identity,
|
|
@@ -4422,7 +4435,8 @@ async function serveCoordinationMcpForManager(opts, lifetime) {
|
|
|
4422
4435
|
scopeSignal: opts.scope.signal,
|
|
4423
4436
|
lifetimeSignal: lifetime,
|
|
4424
4437
|
lifetimeExpiresAt: opts.scope.rootDeadlineAtMs,
|
|
4425
|
-
isClosed: () => state.closed
|
|
4438
|
+
isClosed: () => state.closed,
|
|
4439
|
+
onExpiredBearer: () => stopUnreachable("coordination credential expired in its holder: no renewal reached it")
|
|
4426
4440
|
});
|
|
4427
4441
|
const ctx = {
|
|
4428
4442
|
opts,
|
|
@@ -4499,12 +4513,7 @@ async function serveCoordinationMcpForManager(opts, lifetime) {
|
|
|
4499
4513
|
const renew = () => {
|
|
4500
4514
|
if (!active || state.closed || opts.scope.signal.aborted || lifetime?.aborted) return;
|
|
4501
4515
|
pending = credentials.replace(install);
|
|
4502
|
-
pending.then(schedule, () =>
|
|
4503
|
-
state.closed = true;
|
|
4504
|
-
try {
|
|
4505
|
-
opts.onStop?.("coordination credential renewal failed");
|
|
4506
|
-
} catch {}
|
|
4507
|
-
});
|
|
4516
|
+
pending.then(schedule, () => stopUnreachable("coordination credential renewal failed"));
|
|
4508
4517
|
};
|
|
4509
4518
|
refreshBoundCredential = () => {
|
|
4510
4519
|
cancelTimer?.();
|
|
@@ -4951,6 +4960,13 @@ function barrenPauseMs(streak, maxBarren) {
|
|
|
4951
4960
|
const INSTANT_FAILURE_MS = 3e4;
|
|
4952
4961
|
const REPEATED_FAILURE_LIMIT = 10;
|
|
4953
4962
|
const REPEATED_FAILURE_WINDOW_MS = 3e5;
|
|
4963
|
+
/**
|
|
4964
|
+
* Content-filter refusals in a row (any other outcome resets) that stop an agent with
|
|
4965
|
+
* `repeated-failure`; an opted-in root pauses and re-enters. One prompt is not refused every time:
|
|
4966
|
+
* on Discovery run magnetar-rust-sandbox-20261031f agents passed after up to 6 in a row (`:s0:s1`
|
|
4967
|
+
* on its 7th identical send), and the loops that never passed ran 9 and 10.
|
|
4968
|
+
*/
|
|
4969
|
+
const CONTENT_FILTER_REFUSAL_LIMIT = 8;
|
|
4954
4970
|
/** Consecutive identical reconciliation failures of one pending invocation that resolve it. */
|
|
4955
4971
|
const SAME_PENDING_LIMIT = 2;
|
|
4956
4972
|
/**
|
|
@@ -5031,6 +5047,7 @@ var DriverRetryLoop = class {
|
|
|
5031
5047
|
samePending;
|
|
5032
5048
|
sameFailure;
|
|
5033
5049
|
sameIdle;
|
|
5050
|
+
refusals = 0;
|
|
5034
5051
|
abandonments = 0;
|
|
5035
5052
|
stopPauses = 0;
|
|
5036
5053
|
pauses = 0;
|
|
@@ -5141,6 +5158,7 @@ var DriverRetryLoop = class {
|
|
|
5141
5158
|
this.consecutiveBarren = 0;
|
|
5142
5159
|
this.sameFailure = void 0;
|
|
5143
5160
|
this.sameIdle = void 0;
|
|
5161
|
+
this.refusals = 0;
|
|
5144
5162
|
this.samePending = void 0;
|
|
5145
5163
|
this.abandonments = 0;
|
|
5146
5164
|
this.outageSince = void 0;
|
|
@@ -5170,6 +5188,7 @@ var DriverRetryLoop = class {
|
|
|
5170
5188
|
async afterFailure(error, attempt, before, startedAt) {
|
|
5171
5189
|
const durationMs = this.limits.now() - startedAt;
|
|
5172
5190
|
const classification = classifyDriverFailure(error, this.run.signal, this.run.stopSignal);
|
|
5191
|
+
this.refusals = isContentFilterRefusal(error) ? this.refusals + 1 : 0;
|
|
5173
5192
|
const after = this.run.progress();
|
|
5174
5193
|
const progressed = madeProgress(before, after);
|
|
5175
5194
|
if (progressed) {
|
|
@@ -5306,6 +5325,7 @@ var DriverRetryLoop = class {
|
|
|
5306
5325
|
if (!limits.retryEnabled) return "retry-disabled";
|
|
5307
5326
|
const byBudget = budgetStop(run.budget(), failedAt);
|
|
5308
5327
|
if (byBudget) return byBudget;
|
|
5328
|
+
if (this.refusals >= CONTENT_FILTER_REFUSAL_LIMIT) return "repeated-failure";
|
|
5309
5329
|
if (sameIdle !== void 0 && (causedByPartialFailure(error) ? sameIdle.count >= SAME_PARTIAL_FAILURE_LIMIT : run.nested === true && sameIdle.count >= REPEATED_FAILURE_LIMIT && failedAt - sameIdle.since >= REPEATED_FAILURE_WINDOW_MS)) return "repeated-failure";
|
|
5310
5330
|
if (inOutage) return void 0;
|
|
5311
5331
|
if (this.chargedFailures >= limits.maxAttempts) return "max-attempts";
|
|
@@ -5397,6 +5417,7 @@ var DriverRetryLoop = class {
|
|
|
5397
5417
|
this.samePending = void 0;
|
|
5398
5418
|
this.sameFailure = void 0;
|
|
5399
5419
|
this.sameIdle = void 0;
|
|
5420
|
+
this.refusals = 0;
|
|
5400
5421
|
this.abandonments = 0;
|
|
5401
5422
|
const durationMs = this.limits.now() - startedAt;
|
|
5402
5423
|
const after = run.progress();
|
|
@@ -6119,7 +6140,8 @@ async function readCheckAtTurnEnd(loop, attempt) {
|
|
|
6119
6140
|
function reportManagerLoop(loop) {
|
|
6120
6141
|
loop.reported = true;
|
|
6121
6142
|
const { mcp, controls, state } = loop.session;
|
|
6122
|
-
const
|
|
6143
|
+
const stopped = state.stopController.signal.reason;
|
|
6144
|
+
const stopReason = controls.stopReason() ?? state.progressStopReason ?? (typeof stopped === "string" ? stopped : void 0);
|
|
6123
6145
|
const closedBy = mcp.submittedResult() ? "result-accepted" : mcp.isStopped() ? "stop" : state.progressStopReason !== void 0 ? "stop-rule" : void 0;
|
|
6124
6146
|
const blocked = controls.blocked();
|
|
6125
6147
|
loop.config.deps.onDriverLoopSettled?.({
|
|
@@ -9479,4 +9501,4 @@ function superviseWithContext(profile, task, opts, brain) {
|
|
|
9479
9501
|
}
|
|
9480
9502
|
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 };
|
|
9481
9503
|
|
|
9482
|
-
//# sourceMappingURL=supervise-
|
|
9504
|
+
//# sourceMappingURL=supervise-DoH3TCQa.js.map
|