@tangle-network/agent-runtime 0.203.1 → 0.204.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-jkFJVJRN.js → activation-C4FzfZdf.js} +2 -2
- package/dist/{activation-jkFJVJRN.js.map → activation-C4FzfZdf.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/{coordination-driver-MJuF_LIR.js → coordination-driver-CeORgR_y.js} +54 -54
- package/dist/coordination-driver-CeORgR_y.js.map +1 -0
- package/dist/{delegate-BdLTkmND.js → delegate-Y8HERQ-0.js} +2 -2
- package/dist/{delegate-BdLTkmND.js.map → delegate-Y8HERQ-0.js.map} +1 -1
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +26 -3
- package/dist/durable.js.map +1 -1
- package/dist/{graph-DQN-oV1z.js → graph-BeKgH5yz.js} +3 -3
- package/dist/{graph-DQN-oV1z.js.map → graph-BeKgH5yz.js.map} +1 -1
- package/dist/{improvement-cycle-BxqzXYi8.js → improvement-cycle-Bgm5fYr0.js} +3 -3
- package/dist/{improvement-cycle-BxqzXYi8.js.map → improvement-cycle-Bgm5fYr0.js.map} +1 -1
- package/dist/{index-prZR0SAw.d.ts → index-JwBrfEmf.d.ts} +7 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -7
- package/dist/intelligence.js +3 -3
- package/dist/kernel.d.ts +1 -1
- package/dist/kernel.js +8 -8
- package/dist/{loop-runner-bin-CrRJTCHK.js → loop-runner-bin-DAzvKFYG.js} +3 -3
- package/dist/{loop-runner-bin-CrRJTCHK.js.map → loop-runner-bin-DAzvKFYG.js.map} +1 -1
- package/dist/{loop-runner-bin-CdLhMvhw.d.ts → loop-runner-bin-DD3mqY76.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 +3 -3
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +4 -4
- package/dist/{provision-supervisor-BS4y6pVS.js → provision-supervisor-CZ_YEGAm.js} +3 -3
- package/dist/{provision-supervisor-BS4y6pVS.js.map → provision-supervisor-CZ_YEGAm.js.map} +1 -1
- package/dist/{redact-B1SbJVu9.js → redact-73IRu8-T.js} +5 -3
- package/dist/{redact-B1SbJVu9.js.map → redact-73IRu8-T.js.map} +1 -1
- package/dist/{runtime-tA99kYBU.js → runtime-pw6TGY_D.js} +8 -8
- package/dist/{runtime-tA99kYBU.js.map → runtime-pw6TGY_D.js.map} +1 -1
- package/dist/{server-Bd7EYaQT.js → server-CrU79Grl.js} +3 -3
- package/dist/{server-Bd7EYaQT.js.map → server-CrU79Grl.js.map} +1 -1
- package/dist/{structural-rollout-FBtZzm0q.js → structural-rollout-Bzkfmwuo.js} +27 -5
- package/dist/structural-rollout-Bzkfmwuo.js.map +1 -0
- package/dist/{supervise-dCZg-EB8.js → supervise-Cr3ZtFyh.js} +25 -14
- package/dist/supervise-Cr3ZtFyh.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +12 -12
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/package.json +4 -4
- package/dist/coordination-driver-MJuF_LIR.js.map +0 -1
- package/dist/structural-rollout-FBtZzm0q.js.map +0 -1
- package/dist/supervise-dCZg-EB8.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { $ as bridgeAdmissionRefusal, $r as providerAttemptEvidence, $t as spendFromUsageEvents, A as consumeScopeRetainedOwnerResult, Ar as profileMaterializationAxes$1, Br as worktreeCliProfileMaterialization, Ct as createInbox, Dr as controlProfileMaterialization, Er as assertProfileMaterialization, Ir as renderUnsupported, Kr as attestRuntimeOwnedScopeOwner, M as scopeRetainedOwnerContext, Mn as zeroSpend, Mr as promptModelProfileMaterialization, N as scopeRetainedOwnerPriorSpend, Nn as registerRetainedExecutorPreparation, Or as defineProfileMaterializationContract, P as scopeRetainedOwnerResult, Pn as retainedExecutorSeamKey, Q as bindReusableExecutorExecutionId, Rr as unsupportedProfileDimensions, S as scopeOwnerExecutorNodeContext, X as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, Xt as contentAddress, Yr as inheritRuntimeOwnedExecutorAttestation, Z as teardownExecutor, Zt as assertValidBudget, _ as deriveNodeExecutionIdentity, _n as resolveAgentEnvironmentProvider, a as createSupervisor, ai as runtimeOwnedPendingExecutorMaterialization, b as recordScopeOwnerMaterialization, cr as toOtelAttributes, ct as snapshotExecutorConfig, d as driverChild, ei as recordRuntimeOwnedDriveHarnessProviderEvidence, et as bridgeModelRouteRefusal, f as driverExecutorFactory, fi as detachedSnapshot, h as beginScopeOwnerAttempt, i as createRootHandle, ii as runtimeOwnedExecutorProviderEvidence, ir as generateSpanId, j as prepareScopeRetainedOwnerTask, jn as unmeteredSpend, jr as promptControlProfileMaterialization, kr as fullProfileMaterialization, l as runFinalizer, ni as runtimeOwnedExecutorExecutionBinding, nt as bridgeStopSignalKey, o as bestDelivered, oi as runtimeOwnedScopeOwnerRuntime, ot as createExecutor, p as isDriverSpec, ri as runtimeOwnedExecutorMaterialization, rt as captureReusableExecutorConfig, ti as runtimeOwnedDriveHarnessProviderEvidence, tr as createOtelExporter, tt as bridgeRuntimeAttachmentsKey, u as runTree, un as routerBrain, ut as WORKER_TRACE_PROPAGATION, v as meterRuntimeOwnedAccounting, x as restoreScopeOwnerAcceptedExecution, y as meterRuntimeOwnedProviderAttempt, yn as addSpend } from "./redact-
|
|
1
|
+
import { $ as bridgeAdmissionRefusal, $r as providerAttemptEvidence, $t as spendFromUsageEvents, A as consumeScopeRetainedOwnerResult, Ar as profileMaterializationAxes$1, Br as worktreeCliProfileMaterialization, Ct as createInbox, Dr as controlProfileMaterialization, Er as assertProfileMaterialization, Ir as renderUnsupported, Kr as attestRuntimeOwnedScopeOwner, M as scopeRetainedOwnerContext, Mn as zeroSpend, Mr as promptModelProfileMaterialization, N as scopeRetainedOwnerPriorSpend, Nn as registerRetainedExecutorPreparation, Or as defineProfileMaterializationContract, P as scopeRetainedOwnerResult, Pn as retainedExecutorSeamKey, Q as bindReusableExecutorExecutionId, Rr as unsupportedProfileDimensions, S as scopeOwnerExecutorNodeContext, X as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, Xt as contentAddress, Yr as inheritRuntimeOwnedExecutorAttestation, Z as teardownExecutor, Zt as assertValidBudget, _ as deriveNodeExecutionIdentity, _n as resolveAgentEnvironmentProvider, a as createSupervisor, ai as runtimeOwnedPendingExecutorMaterialization, b as recordScopeOwnerMaterialization, cr as toOtelAttributes, ct as snapshotExecutorConfig, d as driverChild, ei as recordRuntimeOwnedDriveHarnessProviderEvidence, et as bridgeModelRouteRefusal, f as driverExecutorFactory, fi as detachedSnapshot, h as beginScopeOwnerAttempt, i as createRootHandle, ii as runtimeOwnedExecutorProviderEvidence, ir as generateSpanId, j as prepareScopeRetainedOwnerTask, jn as unmeteredSpend, jr as promptControlProfileMaterialization, kr as fullProfileMaterialization, l as runFinalizer, ni as runtimeOwnedExecutorExecutionBinding, nt as bridgeStopSignalKey, o as bestDelivered, oi as runtimeOwnedScopeOwnerRuntime, ot as createExecutor, p as isDriverSpec, ri as runtimeOwnedExecutorMaterialization, rt as captureReusableExecutorConfig, ti as runtimeOwnedDriveHarnessProviderEvidence, tr as createOtelExporter, tt as bridgeRuntimeAttachmentsKey, u as runTree, un as routerBrain, ut as WORKER_TRACE_PROPAGATION, v as meterRuntimeOwnedAccounting, x as restoreScopeOwnerAcceptedExecution, y as meterRuntimeOwnedProviderAttempt, yn as addSpend } from "./redact-73IRu8-T.js";
|
|
2
2
|
import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError, r as BackendTransportError, t as AgentEvalError } from "./errors-DodWX-cb.js";
|
|
3
3
|
import { a as concreteProfileModel, c as profileModelExecutionSettings, d as agentHarness, f as harnessRunsAgent, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile } from "./model-policy-DKDyr-fc.js";
|
|
4
4
|
import { t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
|
|
5
|
-
import { C as coordinationVerbNames, M as createFileRunContext, N as createInMemoryRunContext, c as createProgressTracker, d as progressStop, r as driverAgent, v as watchRunCancellation, w as createCoordinationTools } from "./coordination-driver-MJuF_LIR.js";
|
|
6
5
|
import { k as writeRunCancellation, o as readRunCancelRequest, s as readRunCancellation } from "./run-layout-B8I_LXN-.js";
|
|
6
|
+
import { C as createCoordinationTools, F as watchRunCancellation, M as createInMemoryRunContext, P as applyRunCancellation, S as coordinationVerbNames, c as createProgressTracker, d as progressStop, j as createFileRunContext, r as driverAgent } from "./coordination-driver-CeORgR_y.js";
|
|
7
7
|
import { t as createStdioToolServer } from "./tool-server-BJbCPhoW.js";
|
|
8
8
|
import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
9
9
|
import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
@@ -1599,14 +1599,12 @@ function buildSupervisorAgent(profile, deps, testBrain) {
|
|
|
1599
1599
|
ledger = mcp;
|
|
1600
1600
|
const coordinationTools = slot.descriptors();
|
|
1601
1601
|
const providerProfile = detachedSnapshot(providerVisibleProfile(stableProfile), "supervisorAgent provider-visible profile");
|
|
1602
|
-
let cancellation;
|
|
1603
1602
|
try {
|
|
1604
1603
|
const recoveredSubmission = mcp.submittedResult();
|
|
1605
1604
|
if (recoveredSubmission) {
|
|
1606
1605
|
deps.onAcceptedSubmission?.(recoveredSubmission.result);
|
|
1607
1606
|
return recoveredSubmission.result;
|
|
1608
1607
|
}
|
|
1609
|
-
if (deps.controlDir !== void 0 && deps.abortRun !== void 0 && deps.controlScope !== "subtree") cancellation = watchRunCancellation(deps.controlDir, deps.abortRun);
|
|
1610
1608
|
const baseTokensLeft = scope.budget.tokensLeft;
|
|
1611
1609
|
const contractDeclared = deps.deliverable !== void 0;
|
|
1612
1610
|
const maxReprompts = deps.repromptOnUnmet ?? 0;
|
|
@@ -1624,7 +1622,7 @@ function buildSupervisorAgent(profile, deps, testBrain) {
|
|
|
1624
1622
|
};
|
|
1625
1623
|
await runDriverWithRetry({
|
|
1626
1624
|
drive: async (attempt, reentry) => {
|
|
1627
|
-
|
|
1625
|
+
if (deps.controlDir !== void 0 && deps.abortRun !== void 0) applyRunCancellation(deps.controlDir, deps.abortRun, () => (/* @__PURE__ */ new Date()).toISOString());
|
|
1628
1626
|
scope.signal.throwIfAborted();
|
|
1629
1627
|
beginScopeOwnerAttempt(scope, attempt);
|
|
1630
1628
|
try {
|
|
@@ -1657,7 +1655,6 @@ function buildSupervisorAgent(profile, deps, testBrain) {
|
|
|
1657
1655
|
} } : {},
|
|
1658
1656
|
...deps.onDriverAttempt ? { onAttempt: deps.onDriverAttempt } : {}
|
|
1659
1657
|
});
|
|
1660
|
-
cancellation?.close();
|
|
1661
1658
|
await mcp.drainResolved();
|
|
1662
1659
|
const submitted = mcp.submittedResult();
|
|
1663
1660
|
if (submitted) {
|
|
@@ -1671,7 +1668,6 @@ function buildSupervisorAgent(profile, deps, testBrain) {
|
|
|
1671
1668
|
budget: scope.budget
|
|
1672
1669
|
});
|
|
1673
1670
|
} finally {
|
|
1674
|
-
cancellation?.close();
|
|
1675
1671
|
await mcp.close();
|
|
1676
1672
|
}
|
|
1677
1673
|
}
|
|
@@ -2933,9 +2929,9 @@ function captureSuperviseOptions(opts) {
|
|
|
2933
2929
|
* Record what a run-scoped cancel actually did, at the ONE place that observes the run's terminal
|
|
2934
2930
|
* state: the `supervise()` settle path.
|
|
2935
2931
|
*
|
|
2936
|
-
* The
|
|
2937
|
-
* outcome known.
|
|
2938
|
-
* reached any other terminal state despite the request terminated nothing and reads `not_live`,
|
|
2932
|
+
* The observer writes `cancel_requested` when it issues the abort; only here is the run's own
|
|
2933
|
+
* outcome known. An aborted run reads `cancelled` only with confirmed teardown, otherwise `unknown`.
|
|
2934
|
+
* A run that reached any other terminal state despite the request terminated nothing and reads `not_live`,
|
|
2939
2935
|
* never a success. A request the run ended before applying is expired here too, so a reader can
|
|
2940
2936
|
* tell run-over from in-progress and a stale request cannot outlive its run.
|
|
2941
2937
|
*/
|
|
@@ -2962,6 +2958,14 @@ function recordRunCancellationOutcome(runDir, result, now) {
|
|
|
2962
2958
|
});
|
|
2963
2959
|
return;
|
|
2964
2960
|
}
|
|
2961
|
+
if (aborted && result.teardownUnconfirmed?.length) {
|
|
2962
|
+
writeRunCancellation(dir, {
|
|
2963
|
+
...base,
|
|
2964
|
+
effect: "unknown",
|
|
2965
|
+
detail: `run aborted but teardown remains unconfirmed for: ${result.teardownUnconfirmed.map((node) => node.id).join(", ")}`
|
|
2966
|
+
});
|
|
2967
|
+
return;
|
|
2968
|
+
}
|
|
2965
2969
|
writeRunCancellation(dir, aborted ? {
|
|
2966
2970
|
...base,
|
|
2967
2971
|
effect: "cancelled",
|
|
@@ -3304,7 +3308,8 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
3304
3308
|
...finalizer ? { finalizer } : {},
|
|
3305
3309
|
...options.runDir === void 0 ? {} : {
|
|
3306
3310
|
controlDir: resolve(options.runDir),
|
|
3307
|
-
controlScope: "subtree"
|
|
3311
|
+
controlScope: "subtree",
|
|
3312
|
+
abortRun: (reason) => runControl?.abort(reason)
|
|
3308
3313
|
}
|
|
3309
3314
|
}), journal, childExecution.ref, () => acceptedSubmission, recoveryFactories.get(childFactory));
|
|
3310
3315
|
};
|
|
@@ -3336,11 +3341,11 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
3336
3341
|
};
|
|
3337
3342
|
makeWorkerAgent = makeRecursiveWorkerFor(canonicalProfile, rootExecution.identity, 1, rootOwnerId);
|
|
3338
3343
|
}
|
|
3344
|
+
const runControl = options.rootHandle ?? (options.runDir === void 0 ? void 0 : createRootHandle());
|
|
3339
3345
|
const workerFactory = makeWorkerAgent;
|
|
3340
3346
|
const start = async () => {
|
|
3341
3347
|
const priorCoordination = log ? await log.load(runId, rootOwnerId) : void 0;
|
|
3342
3348
|
const authorizeRootMessage = authorizeDownFor(canonicalProfile, 1);
|
|
3343
|
-
const runControl = options.rootHandle ?? (options.runDir === void 0 ? void 0 : createRootHandle());
|
|
3344
3349
|
const agentDeps = {
|
|
3345
3350
|
blobs,
|
|
3346
3351
|
makeWorkerAgent: workerFactory,
|
|
@@ -3405,6 +3410,7 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
3405
3410
|
const hooks = recorder ? composeRuntimeHooks(options.hooks, recorder.hooks) : options.hooks;
|
|
3406
3411
|
const supervisor = createSupervisor();
|
|
3407
3412
|
if (runControl !== void 0) supervisor.attach(runControl);
|
|
3413
|
+
const cancellation = options.runDir !== void 0 && runControl !== void 0 ? watchRunCancellation(resolve(options.runDir), (reason) => runControl.abort(reason)) : void 0;
|
|
3408
3414
|
const run = supervisor.run(agent, canonicalTask, {
|
|
3409
3415
|
budget: options.budget,
|
|
3410
3416
|
runId,
|
|
@@ -3431,7 +3437,12 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
3431
3437
|
...options.runDir === void 0 ? {} : { interactiveBindingDir: resolve(options.runDir) }
|
|
3432
3438
|
});
|
|
3433
3439
|
const settle = async () => {
|
|
3434
|
-
|
|
3440
|
+
let result;
|
|
3441
|
+
try {
|
|
3442
|
+
result = await run;
|
|
3443
|
+
} finally {
|
|
3444
|
+
cancellation?.close();
|
|
3445
|
+
}
|
|
3435
3446
|
recordRunCancellationOutcome(options.runDir, result, now);
|
|
3436
3447
|
const rootProviderModel = ctx.resume === true ? rootProviderModelEvidence([]) : rootProviderModels.length > 0 ? rootProviderModelEvidence(rootProviderModels) : rootDriveHarness === void 0 ? rootProviderModelEvidence([]) : rootProviderModelEvidenceFromExecution(runtimeOwnedDriveHarnessProviderEvidence(rootDriveHarness));
|
|
3437
3448
|
return {
|
|
@@ -3472,4 +3483,4 @@ function rootProviderModelEvidenceFromExecution(evidence) {
|
|
|
3472
3483
|
//#endregion
|
|
3473
3484
|
export { serveCoordinationMcp as _, isPreSpawnExecutorFailure as a, mapExecutorResult as b, withWorkerSpawnRetry as c, resolveSupervisorProfile as d, supervisorAgent as f, defaultUnmetContractSteer as g, classifyDriverFailure as h, workerFromBackend as i, assertCoordinationBinding as l, DriverAttemptsExhaustedError as m, supervise as n, resolveWorkerSpawnRetry as o, supervisorAgentWithTestBrain as p, superviseWithTestBrain as r, retryPreSpawnRefusals as s, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, coordinationProfileToolPrefix as u, createSupervisorSpanRecorder as v, gateOnDeliverable as y };
|
|
3474
3485
|
|
|
3475
|
-
//# sourceMappingURL=supervise-
|
|
3486
|
+
//# sourceMappingURL=supervise-Cr3ZtFyh.js.map
|