@tangle-network/agent-runtime 0.236.0 → 0.238.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-i0X3nbzs.js → activation-Br1FRlyB.js} +2 -2
- package/dist/{activation-i0X3nbzs.js.map → activation-Br1FRlyB.js.map} +1 -1
- package/dist/{activation-BRI-PlIJ.d.ts → activation-CRDZUoUE.d.ts} +2 -2
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +2 -2
- package/dist/{coordination-driver-CVJVrk2v.js → coordination-driver-DbiCH5be.js} +52 -25
- package/dist/coordination-driver-DbiCH5be.js.map +1 -0
- package/dist/{delegate-DZzAL4Wm.js → delegate-C4rLxuv8.js} +2 -2
- package/dist/{delegate-DZzAL4Wm.js.map → delegate-C4rLxuv8.js.map} +1 -1
- package/dist/durable.d.ts +2 -2
- package/dist/durable.js +26 -37
- package/dist/durable.js.map +1 -1
- package/dist/{graph-BaE-P5QS.js → graph-BHU73FnA.js} +3 -3
- package/dist/{graph-BaE-P5QS.js.map → graph-BHU73FnA.js.map} +1 -1
- package/dist/{improvement-cycle-2RWFyW4D.js → improvement-cycle-DkzbEzS5.js} +3 -3
- package/dist/{improvement-cycle-2RWFyW4D.js.map → improvement-cycle-DkzbEzS5.js.map} +1 -1
- package/dist/{index-CEWz0yNr.d.ts → index-B8Fmz26p.d.ts} +4 -4
- package/dist/index.d.ts +6 -6
- package/dist/index.js +8 -16
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +3 -3
- package/dist/intelligence.js +3 -3
- package/dist/kernel.d.ts +4 -4
- package/dist/kernel.js +8 -8
- package/dist/{loop-runner-bin-hloQ3MT_.js → loop-runner-bin-BaQIyvh-.js} +3 -3
- package/dist/{loop-runner-bin-hloQ3MT_.js.map → loop-runner-bin-BaQIyvh-.js.map} +1 -1
- package/dist/{loop-runner-bin-tPYqizeb.d.ts → loop-runner-bin-vGFnPXLM.d.ts} +3 -3
- 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 +5 -5
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-DcJtr_0L.d.ts → openai-tools-BPPAXxP2.d.ts} +2 -2
- package/dist/profiles.d.ts +2 -2
- package/dist/{provision-supervisor-CfT7yEeg.js → provision-supervisor-Briw5tX4.js} +3 -3
- package/dist/{provision-supervisor-CfT7yEeg.js.map → provision-supervisor-Briw5tX4.js.map} +1 -1
- package/dist/{runtime-DqxluIn_.js → runtime-BzGKUqqY.js} +11 -20
- package/dist/runtime-BzGKUqqY.js.map +1 -0
- package/dist/{server-BNsUopoF.js → server-CDn-i_GJ.js} +3 -3
- package/dist/{server-BNsUopoF.js.map → server-CDn-i_GJ.js.map} +1 -1
- package/dist/{stream-agent-turn-BYupQNrs.d.ts → stream-agent-turn-xgmm-M55.d.ts} +2 -2
- package/dist/{structural-rollout-C6FsCpeq.js → structural-rollout-B-EAO8C5.js} +2 -2
- package/dist/{structural-rollout-C6FsCpeq.js.map → structural-rollout-B-EAO8C5.js.map} +1 -1
- package/dist/{substrate-C7ivCM2O.d.ts → substrate-B_9stFWH.d.ts} +2 -2
- package/dist/{supervise-mvykoSSc.js → supervise-Dc2DjlZS.js} +30 -15
- package/dist/supervise-Dc2DjlZS.js.map +1 -0
- package/dist/{supervisor-DGsHiL1-.js → supervisor-BN3oMv_v.js} +158 -64
- package/dist/supervisor-BN3oMv_v.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +12 -12
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/dist/{types-DANs9CAb.d.ts → types-CE7ES_TD.d.ts} +28 -5
- package/package.json +1 -1
- package/dist/coordination-driver-CVJVrk2v.js.map +0 -1
- package/dist/runtime-DqxluIn_.js.map +0 -1
- package/dist/supervise-mvykoSSc.js.map +0 -1
- package/dist/supervisor-DGsHiL1-.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ur as Driver, Vr as AgentRunSpec, hi as Validator, ui as OutputAdapter } from "./types-CE7ES_TD.js";
|
|
2
2
|
import { AgentProfile } from "@tangle-network/agent-interface";
|
|
3
3
|
//#region src/profiles/coder.d.ts
|
|
4
4
|
/**
|
|
@@ -281,4 +281,4 @@ interface UiFinding {
|
|
|
281
281
|
}
|
|
282
282
|
//#endregion
|
|
283
283
|
export { CoderTask as _, UiFindingSeverity as a, KnowledgeUpdate as c, ResearchSource as d, ResearchTask as f, researcherProfile as g, multiHarnessResearcherFanout as h, UiFindingScreenshot as i, MultiHarnessResearcherFanoutOptions as l, createResearcherValidator as m, UI_LENSES as n, UiLens as o, ResearcherProfileOptions as p, UiFinding as r, KnowledgeItem as s, UI_FINDING_SEVERITIES as t, ResearchOutput as u, coderTaskToPrompt as v };
|
|
284
|
-
//# sourceMappingURL=substrate-
|
|
284
|
+
//# sourceMappingURL=substrate-B_9stFWH.d.ts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $t as bridgeAdmissionRefusal, An as registerRetainedExecutorPreparation, Ar as defineProfileMaterializationContract, Br as unsupportedProfileDimensions, C as restoreScopeOwnerAcceptedExecution, Et as assertValidBudget, F as scopeRetainedOwnerContext, Fn as runAbortable, Gi as resourceTelemetry, Gr as readCommittedJsonLines, Hi as withTimeout, Hr as worktreeCliProfileMaterialization, I as scopeRetainedOwnerPriorSpend, Jr as attestRuntimeOwnedScopeOwner, Ki as withBudgetResources, L as scopeRetainedOwnerResult, Li as sleep, M as bindScopeRetainedOwnerProvider, Mn as RunCancellationReason, Mr as profileMaterializationAxes$1, Mt as WORKER_TRACE_PROPAGATION, N as consumeScopeRetainedOwnerResult, Nr as promptControlProfileMaterialization, Or as assertProfileMaterialization, Ot as meterUsageEvent, P as prepareScopeRetainedOwnerTask, Pn as linkAbort, Pr as promptModelProfileMaterialization, Qi as teardownExecutor, Qt as executorFailure, Rr as renderUnsupported, S as recordScopeOwnerMaterialization, Tn as resolveAgentEnvironmentProvider, Ui as zeroSpend, Ur as isNoEntError, Vi as unmeteredSpend, Vt as createInbox, Wi as addResourceSpend, Wr as prepareJsonlAppend, Xi as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, Y as errMessage, Zr as inheritRuntimeOwnedExecutorAttestation, _ as beginScopeOwnerAttempt, _n as routerBrain, ai as runtimeOwnedExecutorMaterialization, an as bridgeRuntimeAttachmentsKey, b as meterRuntimeOwnedAccounting, ci as runtimeOwnedScopeOwnerRuntime, d as defaultUnmetContractSteer, en as bridgeModelRouteRefusal, et as bindReusableExecutorExecutionId, f as runDriverWithRetry, h as isDriverSpec, ii as runtimeOwnedExecutorExecutionBinding, it as createExecutor, jn as retainedExecutorSeamKey, jr as fullProfileMaterialization, jt as spendFromUsageTotals, ki as addSpend, kr as controlProfileMaterialization, kt as newUsageTotals, l as HarnessTurnFailedError, m as driverExecutorFactory, mi as detachedSnapshot, n as createSupervisor, ni as recordRuntimeOwnedDriveHarnessProviderEvidence, o as runFinalizer, oi as runtimeOwnedExecutorProviderEvidence, on as bridgeStopSignalKey, or as generateSpanId, ot as snapshotExecutorConfig, p as driverChild, qn as contentAddress, r as bestDelivered, ri as runtimeOwnedDriveHarnessProviderEvidence, rr as createOtelExporter, s as runTree, si as runtimeOwnedPendingExecutorMaterialization, t as createRootHandle, ti as providerAttemptEvidence, tt as captureReusableExecutorConfig, ur as toOtelAttributes, w as scopeOwnerExecutorNodeContext, x as meterRuntimeOwnedProviderAttempt, y as deriveNodeExecutionIdentity } from "./supervisor-BN3oMv_v.js";
|
|
2
2
|
import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError } 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-BbSCSak0.js";
|
|
4
4
|
import { t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
|
|
5
5
|
import { n as assertNoSymlinkDescendant } from "./durable-file-D24y9zg7.js";
|
|
6
6
|
import { n as createStdioToolServer, t as PROTOCOL_VERSION } from "./tool-server-x9NEhvHZ.js";
|
|
7
|
-
import { D as coordinationVerbNames, O as createCoordinationTools, S as watchRunCancellation, c as createProgressTracker, d as progressStop, r as driverAgent, v as createFileRunContext, w as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, x as applyRunCancellation, y as createInMemoryRunContext } from "./coordination-driver-
|
|
7
|
+
import { D as coordinationVerbNames, O as createCoordinationTools, S as watchRunCancellation, c as createProgressTracker, d as progressStop, r as driverAgent, v as createFileRunContext, w as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, x as applyRunCancellation, y as createInMemoryRunContext } from "./coordination-driver-DbiCH5be.js";
|
|
8
8
|
import { k as writeRunCancellation, o as readRunCancelRequest, s as readRunCancellation } from "./run-layout-hZREkcfu.js";
|
|
9
9
|
import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalCandidateJson, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
10
10
|
import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
11
11
|
import { closeSync, constants, fsyncSync, openSync, writeSync } from "node:fs";
|
|
12
12
|
import { resolve } from "node:path";
|
|
13
|
-
import { mkdir
|
|
13
|
+
import { mkdir } from "node:fs/promises";
|
|
14
14
|
import { isMaterializerHarness } from "@tangle-network/agent-profile-materialize";
|
|
15
15
|
import { createServer } from "node:http";
|
|
16
16
|
//#region src/runtime/supervise/completion-gate.ts
|
|
@@ -1243,7 +1243,8 @@ function createRootStreamSink(runDir, now) {
|
|
|
1243
1243
|
await mkdir(dir, { recursive: true });
|
|
1244
1244
|
assertNoSymlinkDescendant(dir, path, "root stream");
|
|
1245
1245
|
const needsSeparator = await prepareJsonlAppend(path);
|
|
1246
|
-
seq =
|
|
1246
|
+
seq = 0;
|
|
1247
|
+
for await (const _record of readCommittedJsonLines(path, { allowMissing: true })) seq += 1;
|
|
1247
1248
|
fd = openSync(path, constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY | (typeof constants.O_NOFOLLOW === "number" ? constants.O_NOFOLLOW : 0), 384);
|
|
1248
1249
|
if (needsSeparator) writeLine(fd, "");
|
|
1249
1250
|
};
|
|
@@ -1322,30 +1323,33 @@ function writeLine(fd, line) {
|
|
|
1322
1323
|
*/
|
|
1323
1324
|
async function readRootStreamReceipt(runDir) {
|
|
1324
1325
|
const path = resolve(runDir, ROOT_STREAM_FILE);
|
|
1325
|
-
|
|
1326
|
+
const hash = createHash("sha256");
|
|
1327
|
+
let events = 0;
|
|
1326
1328
|
try {
|
|
1327
|
-
|
|
1329
|
+
for await (const _record of readCommittedJsonLines(path, { onBytes: (bytes) => {
|
|
1330
|
+
hash.update(bytes);
|
|
1331
|
+
} })) events += 1;
|
|
1328
1332
|
} catch (error) {
|
|
1329
1333
|
if (isNoEntError(error)) return void 0;
|
|
1330
1334
|
throw error;
|
|
1331
1335
|
}
|
|
1332
1336
|
return Object.freeze({
|
|
1333
|
-
ref: `sha256:${
|
|
1334
|
-
events
|
|
1337
|
+
ref: `sha256:${hash.digest("hex")}`,
|
|
1338
|
+
events
|
|
1335
1339
|
});
|
|
1336
1340
|
}
|
|
1337
1341
|
/** Every committed line of the root stream, in order, or `undefined` when there is no file. A
|
|
1338
1342
|
* torn final line from a process that died mid-write is not a record and is left out. */
|
|
1339
1343
|
async function readRootStream(runDir) {
|
|
1340
1344
|
const path = resolve(runDir, ROOT_STREAM_FILE);
|
|
1341
|
-
|
|
1345
|
+
const records = [];
|
|
1342
1346
|
try {
|
|
1343
|
-
|
|
1347
|
+
for await (const record of readCommittedJsonLines(path)) records.push(record);
|
|
1344
1348
|
} catch (error) {
|
|
1345
1349
|
if (isNoEntError(error)) return void 0;
|
|
1346
1350
|
throw error;
|
|
1347
1351
|
}
|
|
1348
|
-
return
|
|
1352
|
+
return records;
|
|
1349
1353
|
}
|
|
1350
1354
|
function errorMessage(error) {
|
|
1351
1355
|
return error instanceof Error ? error.message : String(error);
|
|
@@ -2477,14 +2481,18 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
|
|
|
2477
2481
|
const turnCap = maxTurns ?? 0;
|
|
2478
2482
|
const boundBackend = bindReusableExecutorExecutionId(captureReusableExecutorConfig(backend, "driveHarnessFromBackend"), executionId);
|
|
2479
2483
|
const baseFactory = createExecutor(boundBackend);
|
|
2484
|
+
const ownerRuntime = boundBackend.backend === "provider" ? boundBackend.runtime ?? resolveAgentEnvironmentProvider(boundBackend.provider, boundBackend.registry).name : "cli";
|
|
2480
2485
|
let activeExecutor;
|
|
2481
2486
|
const drive = async ({ profile, authoredProfile, task, scope, coordinationMcpUrl, coordinationMcpHeaders, stopSignal, coordinationTools }) => {
|
|
2482
2487
|
const retainedOwner = boundBackend.backend === "provider" ? scopeRetainedOwnerContext(scope) : void 0;
|
|
2483
2488
|
if (retainedOwner && boundBackend.backend === "provider") bindScopeRetainedOwnerProvider(scope, resolveAgentEnvironmentProvider(boundBackend.provider, boundBackend.registry));
|
|
2484
2489
|
const originalTask = retainedOwner ? await prepareScopeRetainedOwnerTask(scope, task) : task;
|
|
2485
|
-
|
|
2490
|
+
const acceptedOwner = retainedOwner ? await scopeRetainedOwnerResult(scope) : void 0;
|
|
2491
|
+
if (acceptedOwner) {
|
|
2486
2492
|
await restoreScopeOwnerAcceptedExecution(scope);
|
|
2487
2493
|
consumeScopeRetainedOwnerResult(scope);
|
|
2494
|
+
const replayedFailure = executorFailure(acceptedOwner);
|
|
2495
|
+
if (replayedFailure !== void 0) throw new HarnessTurnFailedError(ownerRuntime, replayedFailure);
|
|
2488
2496
|
return;
|
|
2489
2497
|
}
|
|
2490
2498
|
const initialBudget = scope.budget;
|
|
@@ -2640,6 +2648,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
|
|
|
2640
2648
|
const pending = runtimeOwnedPendingExecutorMaterialization(executor);
|
|
2641
2649
|
let failed = false;
|
|
2642
2650
|
let failure;
|
|
2651
|
+
let turnFailure;
|
|
2643
2652
|
let ownerMaterializationPublished = false;
|
|
2644
2653
|
const ownerDeclaration = (exactDeclaration) => ({
|
|
2645
2654
|
...exactDeclaration,
|
|
@@ -2741,15 +2750,20 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
|
|
|
2741
2750
|
telemetry: "unknown"
|
|
2742
2751
|
});
|
|
2743
2752
|
terminalAccountingCaptured = true;
|
|
2753
|
+
const reported = executorFailure(artifact);
|
|
2754
|
+
if (reported !== void 0) turnFailure = new HarnessTurnFailedError(executor.runtime, reported);
|
|
2744
2755
|
} else {
|
|
2756
|
+
const artifact = await run;
|
|
2745
2757
|
await meterRuntimeOwnedProviderAttempt(scope, withBudgetResources({
|
|
2746
|
-
...
|
|
2758
|
+
...artifact.spent,
|
|
2747
2759
|
iterations: 0
|
|
2748
2760
|
}, scope.budget), providerEvidenceForNextMeter(), {
|
|
2749
2761
|
role: "driver",
|
|
2750
2762
|
runtime: executor.runtime
|
|
2751
2763
|
});
|
|
2752
2764
|
terminalAccountingCaptured = true;
|
|
2765
|
+
const reported = executorFailure(artifact);
|
|
2766
|
+
if (reported !== void 0) turnFailure = new HarnessTurnFailedError(executor.runtime, reported);
|
|
2753
2767
|
}
|
|
2754
2768
|
if (pending !== void 0 && !ownerMaterializationPublished) {
|
|
2755
2769
|
const acknowledged = runtimeOwnedExecutorMaterialization(executor);
|
|
@@ -2822,6 +2836,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
|
|
|
2822
2836
|
if (activeExecutor === executor) activeExecutor = void 0;
|
|
2823
2837
|
}
|
|
2824
2838
|
if (failed) throw failure;
|
|
2839
|
+
if (turnFailure !== void 0) throw turnFailure;
|
|
2825
2840
|
};
|
|
2826
2841
|
drive.deliver = (message) => {
|
|
2827
2842
|
const deliver = activeExecutor?.deliver;
|
|
@@ -2830,7 +2845,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
|
|
|
2830
2845
|
};
|
|
2831
2846
|
drive.traceSource = () => activeExecutor?.traceSource?.();
|
|
2832
2847
|
drive.progress = () => activeExecutor?.progress?.();
|
|
2833
|
-
return attestRuntimeOwnedScopeOwner(drive,
|
|
2848
|
+
return attestRuntimeOwnedScopeOwner(drive, ownerRuntime);
|
|
2834
2849
|
}
|
|
2835
2850
|
function isAsyncIterable(value) {
|
|
2836
2851
|
return value !== null && typeof value === "object" && Symbol.asyncIterator in value && typeof value[Symbol.asyncIterator] === "function";
|
|
@@ -3674,4 +3689,4 @@ function rootProviderModelEvidenceFromExecution(evidence) {
|
|
|
3674
3689
|
//#endregion
|
|
3675
3690
|
export { createSupervisorSpanRecorder as _, isPreSpawnExecutorFailure as a, mapExecutorResult as b, withWorkerSpawnRetry as c, resolveSupervisorProfile as d, supervisorAgent as f, readRootStreamReceipt as g, readRootStream as h, workerFromBackend as i, assertCoordinationBinding as l, ROOT_STREAM_FILE 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, serveCoordinationMcp as v, gateOnDeliverable as y };
|
|
3676
3691
|
|
|
3677
|
-
//# sourceMappingURL=supervise-
|
|
3692
|
+
//# sourceMappingURL=supervise-Dc2DjlZS.js.map
|