@tangle-network/agent-runtime 0.133.0 → 0.133.1
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-B4nhh8w3.js → activation-BKeGUWTV.js} +3 -3
- package/dist/{activation-B4nhh8w3.js.map → activation-BKeGUWTV.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/{authoring-Dt5lGaM7.js → authoring-CoJWo0Ju.js} +2 -2
- package/dist/{authoring-Dt5lGaM7.js.map → authoring-CoJWo0Ju.js.map} +1 -1
- package/dist/candidate-execution/index.js +4 -4
- package/dist/{candidate-execution-BUhnNcyt.js → candidate-execution-gDXl7pGk.js} +4 -4
- package/dist/{candidate-execution-BUhnNcyt.js.map → candidate-execution-gDXl7pGk.js.map} +1 -1
- package/dist/{conversation-CiO00rgm.js → conversation-kPowfA_A.js} +3 -3
- package/dist/{conversation-CiO00rgm.js.map → conversation-kPowfA_A.js.map} +1 -1
- package/dist/conversation.d.ts +1 -1
- package/dist/conversation.js +1 -1
- package/dist/{environment-provider-BnioYoPQ.d.ts → environment-provider-B-w9VYcF.d.ts} +2 -2
- package/dist/environment-provider.d.ts +1 -1
- package/dist/{graph-CEFPJQRh.js → graph-B2xqnhnF.js} +3 -3
- package/dist/{graph-CEFPJQRh.js.map → graph-B2xqnhnF.js.map} +1 -1
- package/dist/{improvement-cycle-Bf9V8cj8.js → improvement-cycle-Cq5xHru1.js} +5 -5
- package/dist/{improvement-cycle-Bf9V8cj8.js.map → improvement-cycle-Cq5xHru1.js.map} +1 -1
- package/dist/{index-BzP_EK1N.d.ts → index-B7qKWyMV.d.ts} +17 -11
- package/dist/{index-Cw0RMLao.d.ts → index-BNz-BzLt.d.ts} +4 -4
- package/dist/{index-Cdf9NET5.d.ts → index-DqJa9jGF.d.ts} +2 -2
- package/dist/index.d.ts +8 -8
- package/dist/index.js +13 -13
- package/dist/intelligence.d.ts +4 -4
- package/dist/intelligence.js +5 -5
- package/dist/kernel.d.ts +6 -6
- package/dist/kernel.js +8 -8
- package/dist/{knowledge-Dj7e4Pg8.js → knowledge-D-ofzi3v.js} +5 -5
- package/dist/{knowledge-Dj7e4Pg8.js.map → knowledge-D-ofzi3v.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-DJDMsJus.js → loop-runner-bin-BwF5A_xf.js} +3 -3
- package/dist/{loop-runner-bin-DJDMsJus.js.map → loop-runner-bin-BwF5A_xf.js.map} +1 -1
- package/dist/{loop-runner-bin-rmUSJ0jy.d.ts → loop-runner-bin-CBW9ri20.d.ts} +3 -3
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/{materialization-BkL7gRP6.js → materialization-D2bdTfkK.js} +75 -14
- package/dist/materialization-D2bdTfkK.js.map +1 -0
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-MB5xyj1D.js → openai-tools-rpPRFsVG.js} +2 -2
- package/dist/{openai-tools-MB5xyj1D.js.map → openai-tools-rpPRFsVG.js.map} +1 -1
- package/dist/{prepare-DggAvkbq.js → prepare-DWH0J5z2.js} +2 -2
- package/dist/{prepare-DggAvkbq.js.map → prepare-DWH0J5z2.js.map} +1 -1
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/{protected-model-port-BpQeW-0j.js → protected-model-port-djV8FMXc.js} +2 -2
- package/dist/{protected-model-port-BpQeW-0j.js.map → protected-model-port-djV8FMXc.js.map} +1 -1
- package/dist/{redact-BTKr5YLO.d.ts → redact-BSD-nvTf.d.ts} +3 -3
- package/dist/{runtime-DtRTgm3B.js → runtime-CmTSbexZ.js} +85 -76
- package/dist/runtime-CmTSbexZ.js.map +1 -0
- package/dist/{runtime-BRErB7lm.d.ts → runtime-D-26vxJt.d.ts} +3 -3
- package/dist/{spawn-journal-CNg5-D9p.js → spawn-journal-BX3-4WDm.js} +183 -5
- package/dist/spawn-journal-BX3-4WDm.js.map +1 -0
- package/dist/{stream-agent-turn-B4Mvk5G-.js → stream-agent-turn-D8YHY0oO.js} +2 -2
- package/dist/{stream-agent-turn-B4Mvk5G-.js.map → stream-agent-turn-D8YHY0oO.js.map} +1 -1
- package/dist/{stream-agent-turn-By46GZlo.d.ts → stream-agent-turn-NFWCv1X1.d.ts} +2 -2
- package/dist/{structural-rollout-OPAUocq7.js → structural-rollout-Cy0l0bbT.js} +5 -5
- package/dist/{structural-rollout-OPAUocq7.js.map → structural-rollout-Cy0l0bbT.js.map} +1 -1
- package/dist/{supervise-Da_e1GgK.js → supervise-DZxpJGK_.js} +98 -29
- package/dist/supervise-DZxpJGK_.js.map +1 -0
- package/dist/{supervisor-BwU40H4n.js → supervisor-BpIcKHy7.js} +78 -17
- package/dist/supervisor-BpIcKHy7.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +12 -12
- package/dist/{types-BjUQODeG.d.ts → types-DJ7k6vHE.d.ts} +30 -6
- package/dist/{workspace-archive-Cm3rtP4F.js → workspace-archive-DdrlLnIj.js} +2 -2
- package/dist/{workspace-archive-Cm3rtP4F.js.map → workspace-archive-DdrlLnIj.js.map} +1 -1
- package/package.json +1 -1
- package/dist/materialization-BkL7gRP6.js.map +0 -1
- package/dist/runtime-DtRTgm3B.js.map +0 -1
- package/dist/spawn-journal-CNg5-D9p.js.map +0 -1
- package/dist/supervise-Da_e1GgK.js.map +0 -1
- package/dist/supervisor-BwU40H4n.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { f as ValidationError, r as BackendTransportError, u as RuntimeRunStateError } from "./errors-DRoXIc7E.js";
|
|
2
2
|
import { t as detachedSnapshot } from "./snapshot-DY6VGliG.js";
|
|
3
|
-
import {
|
|
3
|
+
import { S as contentAddress, a as aggregateProviderModelEvidence, c as pendingWaits, g as runtimeOwnedNestedDriverTreeRoot, h as nestedDriverTreeRoot, l as replaySpawnTree, m as driverRuntime, o as loadSpawnForest, p as attestNestedDriverTreeOwner, s as materializeTreeView, v as captureWorkerTraceEvidence } from "./spawn-journal-BX3-4WDm.js";
|
|
4
4
|
import { c as randomUuid, d as throwAbort, f as throwIfAborted, l as sleep, m as zeroTokenUsage, n as cloneTokenUsage, o as mapWithConcurrency, p as withTimeout, r as deleteBoxSafe, s as randomSuffix, t as addTokenUsage, u as stringifySafe } from "./util-Dr--8wAL.js";
|
|
5
5
|
import { a as notifySandboxEventObserver, n as extractLlmCallEvent } from "./sandbox-events-vIwmuPdl.js";
|
|
6
6
|
import { a as concreteProfileModel, l as resolveRouterRetryPolicy, o as profileBridgeWireModel, s as profileModelExecutionSettings, t as assertExecutableAgentProfile, u as agentHarness } from "./model-policy-Bv1DU2fw.js";
|
|
7
|
-
import { _ as
|
|
7
|
+
import { C as unknownMaterializationReceipt, S as unknownExecutionBindingReceipt, T as executableAgentSpecSnapshot, _ as runtimeOwnedExecutorExecutionBinding, a as authoredProfileDigest, b as runtimeOwnedPendingExecutorMaterialization, c as knownExecutionBindingReceipt, f as recordRuntimeOwnedProviderAttemptStart, h as runtimeOwnedDeferredExecutorRuntime, l as knownMaterializationReceipt, m as recordRuntimeOwnedProviderModel, n as attestRuntimeOwnedExecutor, o as finalizeRuntimeOwnedPendingExecutor, p as recordRuntimeOwnedProviderIdentityConflict, r as attestRuntimeOwnedPendingExecutor, t as attestRuntimeOwnedDeferredExecutor, u as newExecutionAttemptId, v as runtimeOwnedExecutorMaterialization, w as executableAgentProfileSnapshot, x as runtimeOwnedScopeOwnerRuntime, y as runtimeOwnedExecutorProviderEvidence } from "./materialization-D2bdTfkK.js";
|
|
8
8
|
import { i as resolveAgentEnvironmentProvider, n as providerAsExecutor, r as providerAsSandboxClient } from "./environment-provider-mDsjfGjY.js";
|
|
9
9
|
import { i as notifyRuntimeHookEvent } from "./runtime-hooks-C7iJOWm3.js";
|
|
10
10
|
import { estimateCost, isModelPriced } from "@tangle-network/agent-eval";
|
|
@@ -3120,6 +3120,13 @@ function observedModelMatchesDeclared(observed, declared) {
|
|
|
3120
3120
|
if (declaredIdentity.snapshot !== void 0 && observedIdentity.snapshot !== declaredIdentity.snapshot) return false;
|
|
3121
3121
|
return equivalentModelBase(observedIdentity.base, declaredIdentity.base);
|
|
3122
3122
|
}
|
|
3123
|
+
/** Canonicalize a served model for cross-route identity comparisons. */
|
|
3124
|
+
function canonicalObservedModel(model) {
|
|
3125
|
+
const identity = modelIdentityParts(model);
|
|
3126
|
+
if (!identity) return void 0;
|
|
3127
|
+
const base = identity.base.slice(identity.base.lastIndexOf("/") + 1);
|
|
3128
|
+
return identity.snapshot === void 0 ? base : `${base}@${identity.snapshot}`;
|
|
3129
|
+
}
|
|
3123
3130
|
function modelIdentityParts(model) {
|
|
3124
3131
|
if (model.length === 0) return null;
|
|
3125
3132
|
const at = model.lastIndexOf("@");
|
|
@@ -6109,7 +6116,8 @@ const routerInlineExecutor = (spec, ctx) => {
|
|
|
6109
6116
|
let artifact;
|
|
6110
6117
|
const executionId = ctx.node?.nodeId ?? `router-request-${randomUUID()}`;
|
|
6111
6118
|
const attemptId = ctx.node?.attemptId ?? newExecutionAttemptId(executionId);
|
|
6112
|
-
|
|
6119
|
+
let executor;
|
|
6120
|
+
executor = attestRuntimeOwnedExecutor({
|
|
6113
6121
|
runtime: "router",
|
|
6114
6122
|
async execute(task, signal) {
|
|
6115
6123
|
const messages = taskToMessages(task, spec, profileExecution.systemPrompt);
|
|
@@ -6119,6 +6127,7 @@ const routerInlineExecutor = (spec, ctx) => {
|
|
|
6119
6127
|
...profileExecution.extraBody ?? {},
|
|
6120
6128
|
...profileExecution.reasoningEffort ? { reasoning_effort: profileExecution.reasoningEffort } : {}
|
|
6121
6129
|
};
|
|
6130
|
+
recordRuntimeOwnedProviderAttemptStart(executor);
|
|
6122
6131
|
const r = await runRouterTransport("routerInlineExecutor", () => seam.tools ? (profileExecution.stream === true ? streamRouterChatWithTools : routerChatWithTools)({
|
|
6123
6132
|
routerBaseUrl: seam.routerBaseUrl,
|
|
6124
6133
|
routerKey: seam.routerKey,
|
|
@@ -6148,6 +6157,7 @@ const routerInlineExecutor = (spec, ctx) => {
|
|
|
6148
6157
|
...profileExecution.extraBody ? { extraBody: profileExecution.extraBody } : {},
|
|
6149
6158
|
...requestIdentity
|
|
6150
6159
|
}));
|
|
6160
|
+
if (r.model !== void 0) recordRuntimeOwnedProviderModel(executor, r.model);
|
|
6151
6161
|
const spent = {
|
|
6152
6162
|
iterations: 1,
|
|
6153
6163
|
tokens: r.usage ? cloneTokenUsage({
|
|
@@ -6232,6 +6242,7 @@ const routerInlineExecutor = (spec, ctx) => {
|
|
|
6232
6242
|
backend: "router"
|
|
6233
6243
|
}
|
|
6234
6244
|
});
|
|
6245
|
+
return executor;
|
|
6235
6246
|
};
|
|
6236
6247
|
const routerToolsSeamKey = "router-tools";
|
|
6237
6248
|
function mergePromptCache(target, cache) {
|
|
@@ -6300,7 +6311,8 @@ const routerToolsInlineExecutor = (spec, ctx) => {
|
|
|
6300
6311
|
let artifact;
|
|
6301
6312
|
const executionId = ctx.node?.nodeId ?? `router-tools-run-${randomUUID()}`;
|
|
6302
6313
|
const attemptId = ctx.node?.attemptId ?? newExecutionAttemptId(executionId);
|
|
6303
|
-
|
|
6314
|
+
let executor;
|
|
6315
|
+
executor = attestRuntimeOwnedExecutor({
|
|
6304
6316
|
runtime: "router",
|
|
6305
6317
|
deliver: (m) => inbox.deliver(m),
|
|
6306
6318
|
async execute(task, signal) {
|
|
@@ -6341,6 +6353,7 @@ const routerToolsInlineExecutor = (spec, ctx) => {
|
|
|
6341
6353
|
const cleanup = () => external.removeEventListener("abort", abortTurn);
|
|
6342
6354
|
let res;
|
|
6343
6355
|
try {
|
|
6356
|
+
recordRuntimeOwnedProviderAttemptStart(executor);
|
|
6344
6357
|
res = await (profileExecution.stream === true ? streamRouterChatWithTools : routerChatWithTools)({
|
|
6345
6358
|
routerBaseUrl: seam.routerBaseUrl,
|
|
6346
6359
|
routerKey: seam.routerKey,
|
|
@@ -6372,6 +6385,7 @@ const routerToolsInlineExecutor = (spec, ctx) => {
|
|
|
6372
6385
|
cleanup();
|
|
6373
6386
|
turns += 1;
|
|
6374
6387
|
transportAttempts += res.transportAttempts;
|
|
6388
|
+
if (res.model !== void 0) recordRuntimeOwnedProviderModel(executor, res.model);
|
|
6375
6389
|
assertObservedRouterModel(res.model, model, "routerToolsInlineExecutor");
|
|
6376
6390
|
if (res.model !== void 0) observedModel = res.model;
|
|
6377
6391
|
mergePromptCache(promptCache, res.cache);
|
|
@@ -6552,6 +6566,7 @@ const routerToolsInlineExecutor = (spec, ctx) => {
|
|
|
6552
6566
|
backend: "router-tools"
|
|
6553
6567
|
}
|
|
6554
6568
|
});
|
|
6569
|
+
return executor;
|
|
6555
6570
|
};
|
|
6556
6571
|
function assertObservedRouterModel(observed, expected, context) {
|
|
6557
6572
|
if (observed !== void 0 && !observedModelMatchesDeclared(observed, expected)) throw new ValidationError(`${context}: provider reported model ${JSON.stringify(observed)} but AgentProfile requires ${JSON.stringify(expected)}`);
|
|
@@ -6981,11 +6996,14 @@ const bridgeExecutor = (spec, ctx) => {
|
|
|
6981
6996
|
const modelCredential = validateBridgeModelCredential(base.modelCredential, base.bridgeUrl, "bridgeExecutor");
|
|
6982
6997
|
const effectiveProfile = agentProfileSchema.parse(spec.profile);
|
|
6983
6998
|
const model = bridgeProfileModel(effectiveProfile, "bridgeExecutor");
|
|
6999
|
+
const harness = agentHarness(effectiveProfile.harness);
|
|
7000
|
+
const providerModel = harness !== void 0 && model.startsWith(`${harness}/`) ? model.slice(harness.length + 1) : model;
|
|
6984
7001
|
const profileExecution = profileModelExecutionSettings(effectiveProfile, "bridgeExecutor");
|
|
6985
7002
|
const seam = {
|
|
6986
7003
|
...base,
|
|
6987
7004
|
...modelCredential === void 0 ? {} : { modelCredential },
|
|
6988
7005
|
model,
|
|
7006
|
+
providerModel,
|
|
6989
7007
|
...profileExecution.maxTokens !== void 0 ? { maxTokens: profileExecution.maxTokens } : {}
|
|
6990
7008
|
};
|
|
6991
7009
|
if (!seam.bridgeUrl || !seam.bridgeBearer) throw new ValidationError("bridgeExecutor: bridgeUrl + bridgeBearer are required");
|
|
@@ -7097,6 +7115,9 @@ const bridgeExecutor = (spec, ctx) => {
|
|
|
7097
7115
|
record: (step) => {
|
|
7098
7116
|
trace.record(step);
|
|
7099
7117
|
},
|
|
7118
|
+
onProviderAttemptStart: () => recordRuntimeOwnedProviderAttemptStart(executor),
|
|
7119
|
+
onProviderModel: (model) => recordRuntimeOwnedProviderModel(executor, model),
|
|
7120
|
+
onProviderIdentityConflict: () => recordRuntimeOwnedProviderIdentityConflict(executor),
|
|
7100
7121
|
onArtifact: (a) => {
|
|
7101
7122
|
artifact = a;
|
|
7102
7123
|
},
|
|
@@ -7319,6 +7340,7 @@ async function* streamBridgeSession(args) {
|
|
|
7319
7340
|
let turnEstimatedCostSubtotal = 0;
|
|
7320
7341
|
let interrupted = false;
|
|
7321
7342
|
try {
|
|
7343
|
+
args.onProviderAttemptStart();
|
|
7322
7344
|
for await (const chunk of streamDurableBridgeRun({
|
|
7323
7345
|
seam,
|
|
7324
7346
|
profile: args.profile,
|
|
@@ -7329,9 +7351,24 @@ async function* streamBridgeSession(args) {
|
|
|
7329
7351
|
maxReconnects: args.maxReconnects,
|
|
7330
7352
|
traceHeaders: args.traceHeaders
|
|
7331
7353
|
})) {
|
|
7332
|
-
if (chunk.model !== void 0)
|
|
7354
|
+
if (chunk.model !== void 0) {
|
|
7355
|
+
args.onProviderModel(chunk.model);
|
|
7356
|
+
try {
|
|
7357
|
+
if (!observedModelMatchesDeclared(chunk.model, seam.providerModel)) {
|
|
7358
|
+
args.onProviderIdentityConflict();
|
|
7359
|
+
throw new ValidationError(`bridgeExecutor: bridge reported model ${JSON.stringify(chunk.model)} but the profile requires ${JSON.stringify(seam.providerModel)}`);
|
|
7360
|
+
}
|
|
7361
|
+
observedModel = mergeBridgeObservedModel(observedModel, chunk.model);
|
|
7362
|
+
} catch (error) {
|
|
7363
|
+
args.onProviderIdentityConflict();
|
|
7364
|
+
throw error;
|
|
7365
|
+
}
|
|
7366
|
+
}
|
|
7333
7367
|
if (chunk.systemFingerprint !== void 0) {
|
|
7334
|
-
if (observedSystemFingerprint !== void 0 && observedSystemFingerprint !== chunk.systemFingerprint)
|
|
7368
|
+
if (observedSystemFingerprint !== void 0 && observedSystemFingerprint !== chunk.systemFingerprint) {
|
|
7369
|
+
args.onProviderIdentityConflict();
|
|
7370
|
+
throw new ValidationError(`bridgeExecutor: bridge changed system fingerprint from ${JSON.stringify(observedSystemFingerprint)} to ${JSON.stringify(chunk.systemFingerprint)}`);
|
|
7371
|
+
}
|
|
7335
7372
|
observedSystemFingerprint = chunk.systemFingerprint;
|
|
7336
7373
|
}
|
|
7337
7374
|
if (chunk.content) turnText += chunk.content;
|
|
@@ -9570,6 +9607,8 @@ function defaultSleep(ms, signal) {
|
|
|
9570
9607
|
*
|
|
9571
9608
|
* @stable
|
|
9572
9609
|
*/
|
|
9610
|
+
/** Runtime-owned provider evidence is written through this private scope capability. */
|
|
9611
|
+
const runtimeOwnedProviderMeters = /* @__PURE__ */ new WeakMap();
|
|
9573
9612
|
/**
|
|
9574
9613
|
* The recursion seam key. A `Scope` seeds a value of this on each child's
|
|
9575
9614
|
* `ExecutorContext.seams` so a child whose executor is a DRIVER can mount a NESTED `Scope`
|
|
@@ -10245,7 +10284,7 @@ function createScope(args) {
|
|
|
10245
10284
|
return;
|
|
10246
10285
|
}
|
|
10247
10286
|
}
|
|
10248
|
-
async function
|
|
10287
|
+
async function meterInternal(spend, detail, providerModel) {
|
|
10249
10288
|
if (args.signal.aborted) throw new ValidationError("scope.meter: cannot record new driver work after scope abort");
|
|
10250
10289
|
const seq = meterSeq++;
|
|
10251
10290
|
let observeError;
|
|
@@ -10258,6 +10297,7 @@ function createScope(args) {
|
|
|
10258
10297
|
kind: "metered",
|
|
10259
10298
|
id: args.parentId,
|
|
10260
10299
|
spend,
|
|
10300
|
+
...providerModel === void 0 ? {} : { providerModel: detachedSnapshot(providerModel, "runtime provider model evidence") },
|
|
10261
10301
|
seq,
|
|
10262
10302
|
at: new Date(now()).toISOString()
|
|
10263
10303
|
});
|
|
@@ -10291,7 +10331,7 @@ function createScope(args) {
|
|
|
10291
10331
|
progress,
|
|
10292
10332
|
traceSource,
|
|
10293
10333
|
signal: args.signal,
|
|
10294
|
-
meter,
|
|
10334
|
+
meter: (spend, detail) => meterInternal(spend, detail),
|
|
10295
10335
|
...resume ? { resume } : {},
|
|
10296
10336
|
get view() {
|
|
10297
10337
|
return makeTreeView(args.parentId, children);
|
|
@@ -10306,6 +10346,7 @@ function createScope(args) {
|
|
|
10306
10346
|
};
|
|
10307
10347
|
}
|
|
10308
10348
|
};
|
|
10349
|
+
runtimeOwnedProviderMeters.set(scope, async (spend, providerModel, detail) => meterInternal(spend, detail, providerModel));
|
|
10309
10350
|
if (args.ownerMaterialization !== void 0) {
|
|
10310
10351
|
const authoredProfile = args.ownerMaterialization.authoredProfile === void 0 ? void 0 : detachedSnapshot(args.ownerMaterialization.authoredProfile, "scope owner authored profile");
|
|
10311
10352
|
ownerMaterializationStates.set(scope, {
|
|
@@ -10327,6 +10368,12 @@ function createScope(args) {
|
|
|
10327
10368
|
}
|
|
10328
10369
|
return scope;
|
|
10329
10370
|
}
|
|
10371
|
+
/** @internal Meter one Runtime-owned provider attempt into the durable scope journal. */
|
|
10372
|
+
function meterRuntimeOwnedProviderAttempt(scope, spend, providerModel, detail) {
|
|
10373
|
+
const meter = runtimeOwnedProviderMeters.get(scope);
|
|
10374
|
+
if (meter === void 0) throw new ValidationError("scope: Runtime-owned provider meter is not bound to this scope");
|
|
10375
|
+
return meter(spend, providerModel, detail);
|
|
10376
|
+
}
|
|
10330
10377
|
const ownerMaterializationStates = /* @__PURE__ */ new WeakMap();
|
|
10331
10378
|
/**
|
|
10332
10379
|
* @internal Publish exact root-manager materialization from a runtime-owned adapter after dynamic
|
|
@@ -10496,6 +10543,7 @@ async function finalizeSettlement(child, settlement, seq, args, now) {
|
|
|
10496
10543
|
if (settlement.kind === "down") {
|
|
10497
10544
|
child.status = "failed";
|
|
10498
10545
|
child.trace = settlement.trace;
|
|
10546
|
+
child.providerModel = settlement.providerModel;
|
|
10499
10547
|
await args.journal.appendEvent(args.root, {
|
|
10500
10548
|
kind: "settled",
|
|
10501
10549
|
id: child.id,
|
|
@@ -10503,6 +10551,7 @@ async function finalizeSettlement(child, settlement, seq, args, now) {
|
|
|
10503
10551
|
spent: child.spent,
|
|
10504
10552
|
infra: settlement.infra,
|
|
10505
10553
|
reason: settlement.reason,
|
|
10554
|
+
...settlement.providerModel ? { providerModel: settlement.providerModel } : {},
|
|
10506
10555
|
trace: settlement.trace,
|
|
10507
10556
|
seq,
|
|
10508
10557
|
at
|
|
@@ -10536,6 +10585,7 @@ async function finalizeSettlement(child, settlement, seq, args, now) {
|
|
|
10536
10585
|
reason: settlement.reason,
|
|
10537
10586
|
infra: settlement.infra,
|
|
10538
10587
|
restartCount: settlement.restartCount,
|
|
10588
|
+
...settlement.providerModel ? { providerModel: settlement.providerModel } : {},
|
|
10539
10589
|
trace: settlement.trace,
|
|
10540
10590
|
settledAt,
|
|
10541
10591
|
seq
|
|
@@ -10545,6 +10595,7 @@ async function finalizeSettlement(child, settlement, seq, args, now) {
|
|
|
10545
10595
|
child.outRef = settlement.outRef;
|
|
10546
10596
|
child.spent = settlement.spent;
|
|
10547
10597
|
child.trace = settlement.trace;
|
|
10598
|
+
child.providerModel = settlement.providerModel;
|
|
10548
10599
|
await args.journal.appendEvent(args.root, {
|
|
10549
10600
|
kind: "settled",
|
|
10550
10601
|
id: child.id,
|
|
@@ -10552,6 +10603,7 @@ async function finalizeSettlement(child, settlement, seq, args, now) {
|
|
|
10552
10603
|
outRef: settlement.outRef,
|
|
10553
10604
|
...settlement.verdict ? { verdict: settlement.verdict } : {},
|
|
10554
10605
|
spent: settlement.spent,
|
|
10606
|
+
...settlement.providerModel ? { providerModel: settlement.providerModel } : {},
|
|
10555
10607
|
trace: settlement.trace,
|
|
10556
10608
|
seq,
|
|
10557
10609
|
at
|
|
@@ -10587,6 +10639,7 @@ async function finalizeSettlement(child, settlement, seq, args, now) {
|
|
|
10587
10639
|
outRef: settlement.outRef,
|
|
10588
10640
|
...settlement.verdict ? { verdict: settlement.verdict } : {},
|
|
10589
10641
|
spent: settlement.spent,
|
|
10642
|
+
...settlement.providerModel ? { providerModel: settlement.providerModel } : {},
|
|
10590
10643
|
trace: settlement.trace,
|
|
10591
10644
|
settledAt,
|
|
10592
10645
|
seq
|
|
@@ -10730,7 +10783,7 @@ async function runChild(live, executor, childAbort, task, opts, pool, ticket, bl
|
|
|
10730
10783
|
const trace = await captureTraceOnce();
|
|
10731
10784
|
if (childAbort.signal.aborted) {
|
|
10732
10785
|
await teardownOnce(opts.shutdown ?? "brutalKill");
|
|
10733
|
-
return downRecord("aborted before settle", true, trace, ownMetered);
|
|
10786
|
+
return downRecord("aborted before settle", true, trace, ownMetered, runtimeOwnedExecutorProviderEvidence(executor));
|
|
10734
10787
|
}
|
|
10735
10788
|
const outRef = contentAddress(artifact.out);
|
|
10736
10789
|
await blobs.put(outRef, artifact.out);
|
|
@@ -10742,6 +10795,7 @@ async function runChild(live, executor, childAbort, task, opts, pool, ticket, bl
|
|
|
10742
10795
|
...artifact.verdict ? { verdict: artifact.verdict } : {},
|
|
10743
10796
|
spent: live.spent,
|
|
10744
10797
|
trace,
|
|
10798
|
+
providerModel: runtimeOwnedExecutorProviderEvidence(executor),
|
|
10745
10799
|
...ownMetered ? { metered: ownMetered } : {}
|
|
10746
10800
|
};
|
|
10747
10801
|
} catch (err) {
|
|
@@ -10761,6 +10815,7 @@ async function runChild(live, executor, childAbort, task, opts, pool, ticket, bl
|
|
|
10761
10815
|
}
|
|
10762
10816
|
const accounting = executor.accounting?.();
|
|
10763
10817
|
if (accounting) live.spent = accounting.reported;
|
|
10818
|
+
const providerModel = runtimeOwnedExecutorProviderEvidence(executor);
|
|
10764
10819
|
const aborted = childAbort.signal.aborted || isAbortError(err);
|
|
10765
10820
|
if (started && !terminalTelemetryCaptured && accounting === void 0) live.spent = {
|
|
10766
10821
|
...live.spent,
|
|
@@ -10768,7 +10823,7 @@ async function runChild(live, executor, childAbort, task, opts, pool, ticket, bl
|
|
|
10768
10823
|
usdKnown: false
|
|
10769
10824
|
};
|
|
10770
10825
|
const reconcileError = reconcileOnce(accounting?.reservation ?? live.spent);
|
|
10771
|
-
return downRecord(errMessage(err), evidenceError !== void 0 || teardownError !== void 0 || reconcileError !== void 0 || aborted || isInfraError(err), trace, executor.metered?.());
|
|
10826
|
+
return downRecord(errMessage(err), evidenceError !== void 0 || teardownError !== void 0 || reconcileError !== void 0 || aborted || isInfraError(err), trace, executor.metered?.(), providerModel);
|
|
10772
10827
|
}
|
|
10773
10828
|
}
|
|
10774
10829
|
/**
|
|
@@ -10832,7 +10887,8 @@ function makeTreeView(root, children) {
|
|
|
10832
10887
|
spent: c.spent,
|
|
10833
10888
|
...c.settledAt === void 0 ? {} : { settledAt: c.settledAt },
|
|
10834
10889
|
...c.outRef ? { outRef: c.outRef } : {},
|
|
10835
|
-
...c.trace ? { trace: c.trace } : {}
|
|
10890
|
+
...c.trace ? { trace: c.trace } : {},
|
|
10891
|
+
...c.providerModel ? { providerModel: c.providerModel } : {}
|
|
10836
10892
|
}));
|
|
10837
10893
|
return {
|
|
10838
10894
|
root,
|
|
@@ -10994,13 +11050,14 @@ function abortError(signal) {
|
|
|
10994
11050
|
error.name = "AbortError";
|
|
10995
11051
|
return error;
|
|
10996
11052
|
}
|
|
10997
|
-
function downRecord(reason, infra, trace, metered) {
|
|
11053
|
+
function downRecord(reason, infra, trace, metered, providerModel) {
|
|
10998
11054
|
return {
|
|
10999
11055
|
kind: "down",
|
|
11000
11056
|
reason,
|
|
11001
11057
|
infra,
|
|
11002
11058
|
restartCount: 0,
|
|
11003
11059
|
trace,
|
|
11060
|
+
...providerModel ? { providerModel } : {},
|
|
11004
11061
|
...metered ? { metered } : {}
|
|
11005
11062
|
};
|
|
11006
11063
|
}
|
|
@@ -11867,13 +11924,14 @@ function createSupervisor() {
|
|
|
11867
11924
|
if (out !== void 0) {
|
|
11868
11925
|
const outRef = contentAddress(out);
|
|
11869
11926
|
await opts.blobs.put(outRef, out);
|
|
11870
|
-
const { spentTotal, childWork, driverInference, gaps } = await terminalAccounting(journal, opts.runId, now() - runEpochMs);
|
|
11927
|
+
const { spentTotal, childWork, driverInference, gaps, providerModel } = await terminalAccounting(journal, opts.runId, now() - runEpochMs);
|
|
11871
11928
|
return {
|
|
11872
11929
|
kind: "winner",
|
|
11873
11930
|
out,
|
|
11874
11931
|
outRef,
|
|
11875
11932
|
tree,
|
|
11876
11933
|
spentTotal,
|
|
11934
|
+
providerModel,
|
|
11877
11935
|
...gaps.length > 0 ? { spendGaps: gaps } : {},
|
|
11878
11936
|
...isNonEmptySpend(driverInference) ? { spentBreakdown: {
|
|
11879
11937
|
driverInference,
|
|
@@ -11885,12 +11943,13 @@ function createSupervisor() {
|
|
|
11885
11943
|
}
|
|
11886
11944
|
return noWinner({ error: actOutcome.error });
|
|
11887
11945
|
async function noWinner(rejection) {
|
|
11888
|
-
const { spentTotal, gaps } = await terminalAccounting(journal, opts.runId, now() - runEpochMs);
|
|
11946
|
+
const { spentTotal, gaps, providerModel } = await terminalAccounting(journal, opts.runId, now() - runEpochMs);
|
|
11889
11947
|
const common = {
|
|
11890
11948
|
kind: "no-winner",
|
|
11891
11949
|
tree,
|
|
11892
11950
|
downCount: breaker.downCount(),
|
|
11893
11951
|
spentTotal,
|
|
11952
|
+
providerModel,
|
|
11894
11953
|
...gaps.length > 0 ? { spendGaps: gaps } : {}
|
|
11895
11954
|
};
|
|
11896
11955
|
const lifecycle = classifyNoWinner(executionAborted, pool, opts, breaker, deadlineExceeded, allChildrenDownAtSettle, downCountAtSettle);
|
|
@@ -12153,6 +12212,7 @@ async function terminalAccounting(journal, root, elapsedMs) {
|
|
|
12153
12212
|
if (events === void 0) throw new RuntimeRunStateError(`supervisor: spawn tree '${root}' is missing from the journal after run (corrupted log)`);
|
|
12154
12213
|
const { childWork, driverInference } = sumSpendFromEvents(events);
|
|
12155
12214
|
const gaps = spendGapsFromEvents(events);
|
|
12215
|
+
const providerModel = aggregateProviderModelEvidence(await loadSpawnForest(journal, root));
|
|
12156
12216
|
const summed = addSpend(childWork, driverInference);
|
|
12157
12217
|
return {
|
|
12158
12218
|
spentTotal: {
|
|
@@ -12163,7 +12223,8 @@ async function terminalAccounting(journal, root, elapsedMs) {
|
|
|
12163
12223
|
},
|
|
12164
12224
|
childWork,
|
|
12165
12225
|
driverInference,
|
|
12166
|
-
gaps
|
|
12226
|
+
gaps,
|
|
12227
|
+
providerModel
|
|
12167
12228
|
};
|
|
12168
12229
|
}
|
|
12169
12230
|
/** The journaled nodes whose usage accounting is incomplete — one `SpendGap` per node+kind,
|
|
@@ -12278,6 +12339,6 @@ function isNonEmptySpend(s) {
|
|
|
12278
12339
|
return s.iterations > 0 || s.tokens.input > 0 || s.tokens.output > 0 || s.usd > 0 || s.ms > 0 || s.tokensKnown === false || s.usdKnown === false;
|
|
12279
12340
|
}
|
|
12280
12341
|
//#endregion
|
|
12281
|
-
export {
|
|
12342
|
+
export { defaultSelectWinner as $, validateProfileMaterialization as $t, spendFromUsageEvents as A, runSettledCommand as At, workerTraceEnv as B, CodexExecutionDiagnosticError as Bt, freeSlots as C, padTraceId as Ct, teardownExecutor as D, sanitizeAgentRuntimeEvent as Dt, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as E, createRuntimeStreamEventCollector as Et, createExecutorRegistry as F, DEFAULT_LOCAL_HARNESS as Ft, createPushTraceSource as G, fullProfileMaterialization as Gt, workerTraceSeamKey as H, assertProfileMaterialization as Ht, snapshotExecutorConfig as I, LOCAL_HARNESSES as It, DEFAULT_STALL_AFTER_MS as J, promptModelProfileMaterialization as Jt, decodeToolPart as K, profileMaterializationAxes$1 as Kt, createWorktreeCliExecutor as L, harnessSupportsReasoningEffort as Lt, captureReusableExecutorConfig as M, captureWorktreeDiff as Mt, cliWorktreeExecutor as N, createWorktree as Nt, assertValidBudget as O, sanitizeKnowledgeReadinessReport as Ot, createExecutor as P, removeWorktree as Pt, createSandboxForSpec as Q, sandboxActProfileMaterialization as Qt, WORKER_TRACE_PROPAGATION as R, localHarnessExecutable as Rt, effectiveConcurrency as S, padSpanId as St, rollingDispatch as T, createRuntimeEventCollector as Tt, DEFAULT_SANDBOX_STEERING_MAX_TURNS as U, controlProfileMaterialization as Ut, workerTraceHeaders as V, AGENT_PROFILE_MATERIALIZATION_AXES as Vt, createSteerableSandboxSession as W, defineProfileMaterializationContract as Wt, readWorkerProgress as X, promptResourceProfileMaterialization as Xt, createActivityLog as Y, promptOnlyProfileMaterialization as Yt, createInbox as Z, renderProfileMaterializationIssues as Zt, isWaitOutcome as _, createOtelExporter as _t, pickBestDelivered as a, runBrainLoop as at, validateWaitSpec as b, generateSpanId as bt, driverChild as c, createPropagatingTraceEmitter as ct, deriveNodeExecutionIdentity as d, traceContextToEnv as dt, worktreeCliProfileMaterialization as en, runAgentRounds as et, meterRuntimeOwnedProviderAttempt as f, INTELLIGENCE_WIRE_VERSION as ft, createWaitProbes as g, createOpenInferenceFileExporter as gt, settledToIteration as h, buildRuntimeEventOtelSpans as ht, collectDelivered as i, routerBrain as it, bindReusableExecutorExecutionId as j, runWorktreeHarness as jt, createBudgetPool as k, sanitizeRuntimeStreamEvent as kt, withDriverExecutor as l, mergeTraceEnv as lt, scopeOwnerExecutorNodeContext as m, buildLoopSpanNodes as mt, createSupervisor as n, probeSandboxCapabilities as nt, runFinalizer as o, canonicalObservedModel as ot, recordScopeOwnerMaterialization as p, buildLoopOtelSpans as pt, sandboxSessionTraceSource as q, promptControlProfileMaterialization as qt, bestDelivered as r, acquireSandbox as rt, runTree as s, observedModelMatchesDeclared as st, createRootHandle as t, createSandboxLineage as tt, createScope as u, readTraceContextFromEnv as ut, pollFor as v, exportEvalRuns as vt, queueOf as w, toOtelAttributes as wt, waitUntil as x, loopEventToOtelSpan as xt, timerAt as y, flatOtelSpan as yt, readWorkerTraceContext as z, parseCodexTokenUsage as zt };
|
|
12282
12343
|
|
|
12283
|
-
//# sourceMappingURL=supervisor-
|
|
12344
|
+
//# sourceMappingURL=supervisor-BpIcKHy7.js.map
|