@tangle-network/agent-runtime 0.109.2 → 0.111.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-CM-L6TtL.js → activation-CsuHCZVN.js} +3 -3
- package/dist/{activation-CM-L6TtL.js.map → activation-CsuHCZVN.js.map} +1 -1
- package/dist/agent.d.ts +4 -4
- package/dist/agent.js +2 -2
- package/dist/agent.js.map +1 -1
- package/dist/{analyst-loop-C8cGThTW.js → analyst-loop-BoNIG2hA.js} +30 -9
- package/dist/analyst-loop-BoNIG2hA.js.map +1 -0
- package/dist/analyst-loop.d.ts +1 -1
- package/dist/analyst-loop.js +1 -1
- package/dist/candidate-execution/index.js +4 -4
- package/dist/{candidate-execution-nYMa-bc-.js → candidate-execution-Co3sRC_7.js} +4 -4
- package/dist/{candidate-execution-nYMa-bc-.js.map → candidate-execution-Co3sRC_7.js.map} +1 -1
- package/dist/{environment-provider-CfLUmKmf.js → environment-provider-BsHpW4Dp.js} +52 -5
- package/dist/environment-provider-BsHpW4Dp.js.map +1 -0
- package/dist/{environment-provider-CMqSAp-O.d.ts → environment-provider-CTEMEP9u.d.ts} +9 -1
- package/dist/environment-provider.d.ts +1 -1
- package/dist/environment-provider.js +1 -1
- package/dist/{improvement-adapter-BaAdfJKT.d.ts → improvement-adapter-D5gwwoXQ.d.ts} +2 -2
- package/dist/{improvement-cycle-9O4iVFOA.js → improvement-cycle-ryAyCLKN.js} +5 -5
- package/dist/{improvement-cycle-9O4iVFOA.js.map → improvement-cycle-ryAyCLKN.js.map} +1 -1
- package/dist/{index-BwY61sh3.d.ts → index-BmI2uxy5.d.ts} +3 -3
- package/dist/{index-CFJ_1m1U.d.ts → index-DlLPNELY.d.ts} +298 -92
- package/dist/{index-HsQm1Rrr.d.ts → index-sLuBoGud.d.ts} +6 -6
- package/dist/index.d.ts +5 -5
- package/dist/index.js +11 -11
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +39 -9
- package/dist/intelligence.js.map +1 -1
- package/dist/kernel.d.ts +3 -3
- package/dist/kernel.js +7 -7
- package/dist/{knowledge-1a38bcUT.js → knowledge-DBNAteaC.js} +5 -5
- package/dist/{knowledge-1a38bcUT.js.map → knowledge-DBNAteaC.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-C35m19w0.js → loop-runner-bin-BLOckrqT.js} +4 -4
- package/dist/{loop-runner-bin-C35m19w0.js.map → loop-runner-bin-BLOckrqT.js.map} +1 -1
- package/dist/{loop-runner-bin-DUQF0bYz.d.ts → loop-runner-bin-vRo5TZt_.d.ts} +4 -4
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +5 -5
- package/dist/{openai-tools-DT9FH2_t.js → openai-tools-st-hERvA.js} +2 -2
- package/dist/{openai-tools-DT9FH2_t.js.map → openai-tools-st-hERvA.js.map} +1 -1
- package/dist/{prepare-Pr19X93k.js → prepare-BKVdOn0w.js} +15 -14
- package/dist/prepare-BKVdOn0w.js.map +1 -0
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/{protected-model-port-uthtDNqu.js → protected-model-port-BtldAE9j.js} +2 -2
- package/dist/{protected-model-port-uthtDNqu.js.map → protected-model-port-BtldAE9j.js.map} +1 -1
- package/dist/{runtime-dpJZmZtt.js → runtime-fwz-erxT.js} +422 -15
- package/dist/runtime-fwz-erxT.js.map +1 -0
- package/dist/{spawn-journal-CwPvKUTa.js → spawn-journal-DLhnom3e.js} +2 -2
- package/dist/{spawn-journal-CwPvKUTa.js.map → spawn-journal-DLhnom3e.js.map} +1 -1
- package/dist/{structural-rollout-ASQLr4-v.js → structural-rollout-CgnNy7_4.js} +3 -3
- package/dist/{structural-rollout-ASQLr4-v.js.map → structural-rollout-CgnNy7_4.js.map} +1 -1
- package/dist/{supervise-DyPmmhJ6.js → supervise-CeZtA1wu.js} +223 -107
- package/dist/supervise-CeZtA1wu.js.map +1 -0
- package/dist/{supervisor-sTJC9psT.js → supervisor-ByCPHcp9.js} +82 -24
- package/dist/supervisor-ByCPHcp9.js.map +1 -0
- package/dist/testing.js +9 -9
- package/dist/{types-CfGKhIuj.d.ts → types-zWfqDjeL.d.ts} +10 -1
- package/dist/{util-MVgdwuIS.js → util-Cc9g9Y-o.js} +2 -2
- package/dist/{util-MVgdwuIS.js.map → util-Cc9g9Y-o.js.map} +1 -1
- package/dist/{workspace-archive-C9w_rxt6.js → workspace-archive-CYYxZyA7.js} +2 -2
- package/dist/{workspace-archive-C9w_rxt6.js.map → workspace-archive-CYYxZyA7.js.map} +1 -1
- package/package.json +7 -7
- package/dist/analyst-loop-C8cGThTW.js.map +0 -1
- package/dist/environment-provider-CfLUmKmf.js.map +0 -1
- package/dist/prepare-Pr19X93k.js.map +0 -1
- package/dist/runtime-dpJZmZtt.js.map +0 -1
- package/dist/supervise-DyPmmhJ6.js.map +0 -1
- package/dist/supervisor-sTJC9psT.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { c as RuntimeRunStateError, u as ValidationError } from "./errors-DEAvWQPy.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as contentAddress, c as replaySpawnTree, o as materializeTreeView, s as pendingWaits } from "./spawn-journal-
|
|
2
|
+
import { n as addTokenUsage, p as zeroTokenUsage } from "./util-Cc9g9Y-o.js";
|
|
3
|
+
import { a as contentAddress, c as replaySpawnTree, o as materializeTreeView, s as pendingWaits } from "./spawn-journal-DLhnom3e.js";
|
|
4
4
|
import { i as notifyRuntimeHookEvent } from "./runtime-hooks-C7iJOWm3.js";
|
|
5
5
|
import { estimateCost, isModelPriced } from "@tangle-network/agent-eval";
|
|
6
6
|
import { createHash, randomUUID } from "node:crypto";
|
|
7
|
-
import { applyWorkspacePlan, materializeProfile } from "@tangle-network/agent-profile-materialize";
|
|
7
|
+
import { applyWorkspacePlan, materializeProfile, resolveAgentProfileResources } from "@tangle-network/agent-profile-materialize";
|
|
8
8
|
import { access, chmod, copyFile, mkdir, mkdtemp, open, readFile, realpath, rm, symlink, writeFile } from "node:fs/promises";
|
|
9
9
|
import { constants, createReadStream } from "node:fs";
|
|
10
10
|
import { basename, delimiter, dirname, isAbsolute, join, resolve, sep, win32 } from "node:path";
|
|
@@ -1330,6 +1330,21 @@ const defaultCheckOutputCap = 16e3;
|
|
|
1330
1330
|
function materializerHarness(harness) {
|
|
1331
1331
|
return harness === "claude" ? "claude-code" : harness;
|
|
1332
1332
|
}
|
|
1333
|
+
/** This harness runs public plans only — it has no secret provider, so any
|
|
1334
|
+
* templated argument or secret-ref env value is refused rather than leaked
|
|
1335
|
+
* or silently stringified. */
|
|
1336
|
+
function publicPlanString(value) {
|
|
1337
|
+
if (typeof value === "string") return value;
|
|
1338
|
+
throw new Error("runWorktreeHarness: plan value requires a secret provider; this harness applies public plans only");
|
|
1339
|
+
}
|
|
1340
|
+
function resolvePublicPlanEnv(env) {
|
|
1341
|
+
const resolved = {};
|
|
1342
|
+
for (const [name, value] of Object.entries(env)) {
|
|
1343
|
+
if (value === void 0) continue;
|
|
1344
|
+
resolved[name] = publicPlanString(value);
|
|
1345
|
+
}
|
|
1346
|
+
return resolved;
|
|
1347
|
+
}
|
|
1333
1348
|
/**
|
|
1334
1349
|
* Run the one worktree-harness operation. A failed run attempts cleanup before propagating; if
|
|
1335
1350
|
* cleanup also fails, both errors are preserved. The caller cleans up a successful run.
|
|
@@ -1354,13 +1369,15 @@ async function runWorktreeHarness(opts) {
|
|
|
1354
1369
|
try {
|
|
1355
1370
|
assertSupportedWorktreeProfile(opts.profile, opts.harness);
|
|
1356
1371
|
assertSafeProfileResourcePaths(opts.profile);
|
|
1357
|
-
const
|
|
1358
|
-
|
|
1372
|
+
const profile = await resolveAgentProfileResources(opts.profile, resourceResolutionOptions(opts.resourceResolution, opts.signal));
|
|
1373
|
+
opts.signal?.throwIfAborted();
|
|
1374
|
+
const resourceInstructions = resolveResourceInstructions(profile);
|
|
1375
|
+
const plan = materializeProfile(materializationOnlyProfile(profile), materializerHarness(opts.harness));
|
|
1359
1376
|
if (plan.unsupported.length > 0) throw new Error(`runWorktreeHarness: profile cannot be materialized for ${opts.harness}: ${plan.unsupported.map(({ dimension, reason }) => `${dimension}: ${reason}`).join("; ")}`);
|
|
1360
1377
|
assertSafeMaterializedPaths(plan);
|
|
1361
1378
|
const applied = applyWorkspacePlan(plan, worktree.path, { existingFiles: "reject" });
|
|
1362
1379
|
if (applied.unsupported.length > 0) throw new Error("runWorktreeHarness: applied profile unexpectedly retained unsupported rows");
|
|
1363
|
-
const invocationProfile = profileWithResourceInstructions(
|
|
1380
|
+
const invocationProfile = profileWithResourceInstructions(profile, resourceInstructions);
|
|
1364
1381
|
const { command, args } = harnessInvocation(opts.harness, invocationProfile, opts.taskPrompt, {
|
|
1365
1382
|
dangerouslySkipPermissions: opts.harness === "claude",
|
|
1366
1383
|
...opts.codexReproducible ? { codexReproducible: true } : {}
|
|
@@ -1371,11 +1388,11 @@ async function runWorktreeHarness(opts) {
|
|
|
1371
1388
|
taskPrompt: opts.taskPrompt,
|
|
1372
1389
|
invocation: {
|
|
1373
1390
|
command,
|
|
1374
|
-
args: [...args, ...applied.flags]
|
|
1391
|
+
args: [...args, ...applied.flags.map(publicPlanString)]
|
|
1375
1392
|
},
|
|
1376
1393
|
env: {
|
|
1377
1394
|
...process.env,
|
|
1378
|
-
...applied.env
|
|
1395
|
+
...resolvePublicPlanEnv(applied.env)
|
|
1379
1396
|
},
|
|
1380
1397
|
...opts.codexReproducible ? { codexReproducible: true } : {},
|
|
1381
1398
|
...opts.codexReadDeniedPaths ? { codexReadDeniedPaths: opts.codexReadDeniedPaths } : {},
|
|
@@ -1442,6 +1459,21 @@ async function runWorktreeHarness(opts) {
|
|
|
1442
1459
|
throw err;
|
|
1443
1460
|
}
|
|
1444
1461
|
}
|
|
1462
|
+
function resourceResolutionOptions(options, signal) {
|
|
1463
|
+
if (!signal) return options;
|
|
1464
|
+
const fetchResource = options?.fetch ?? globalThis.fetch;
|
|
1465
|
+
return {
|
|
1466
|
+
...options,
|
|
1467
|
+
fetch: (input, init) => {
|
|
1468
|
+
signal.throwIfAborted();
|
|
1469
|
+
const requestSignal = init?.signal;
|
|
1470
|
+
return fetchResource(input, {
|
|
1471
|
+
...init,
|
|
1472
|
+
signal: requestSignal ? AbortSignal.any([signal, requestSignal]) : signal
|
|
1473
|
+
});
|
|
1474
|
+
}
|
|
1475
|
+
};
|
|
1476
|
+
}
|
|
1445
1477
|
function resolveResourceInstructions(profile) {
|
|
1446
1478
|
const instructions = profile.resources?.instructions;
|
|
1447
1479
|
if (instructions === void 0) return void 0;
|
|
@@ -1525,7 +1557,7 @@ function profileMaterializationReceipt(applied, resourceInstructions) {
|
|
|
1525
1557
|
writtenPaths: [...applied.written],
|
|
1526
1558
|
unsupported: [...applied.unsupported],
|
|
1527
1559
|
environmentNames: Object.keys(applied.env).sort(),
|
|
1528
|
-
flags:
|
|
1560
|
+
flags: applied.flags.map(publicPlanString),
|
|
1529
1561
|
resourceInstructions: instructionBytes ? {
|
|
1530
1562
|
delivery: "invocation-prompt",
|
|
1531
1563
|
sha256: `sha256:${createHash("sha256").update(instructionBytes).digest("hex")}`,
|
|
@@ -2009,6 +2041,7 @@ function readWorkerProgress(scope, executor, now, stallAfterMs = DEFAULT_STALL_A
|
|
|
2009
2041
|
turns: executor?.turns ?? scope.turns,
|
|
2010
2042
|
tokens: scope.tokens,
|
|
2011
2043
|
usd: scope.usd,
|
|
2044
|
+
...scope.usdKnown === false ? { usdKnown: false } : {},
|
|
2012
2045
|
pendingMessages: executor?.pendingMessages ?? 0,
|
|
2013
2046
|
recentActivity: executor?.recentActivity ?? [],
|
|
2014
2047
|
...note ? { note } : {}
|
|
@@ -2611,7 +2644,8 @@ function createScope(args) {
|
|
|
2611
2644
|
lastActivityAt: child.lastActivityAt,
|
|
2612
2645
|
turns: child.spent.iterations,
|
|
2613
2646
|
tokens: child.spent.tokens,
|
|
2614
|
-
usd: child.spent.usd
|
|
2647
|
+
usd: child.spent.usd,
|
|
2648
|
+
...child.spent.usdKnown === false ? { usdKnown: false } : {}
|
|
2615
2649
|
}, fromExecutor, opts.now ?? now(), opts.stallAfterMs ?? 18e4);
|
|
2616
2650
|
}
|
|
2617
2651
|
function traceSource(nodeId) {
|
|
@@ -2962,17 +2996,21 @@ async function foldStream(stream, onProgress) {
|
|
|
2962
2996
|
output: 0
|
|
2963
2997
|
};
|
|
2964
2998
|
let usd = 0;
|
|
2999
|
+
let usdKnown = true;
|
|
2965
3000
|
let iterations = 0;
|
|
2966
3001
|
for await (const ev of stream) {
|
|
2967
3002
|
if (ev.kind === "tokens") {
|
|
2968
3003
|
tokens.input += ev.input;
|
|
2969
3004
|
tokens.output += ev.output;
|
|
2970
|
-
} else if (ev.kind === "cost")
|
|
2971
|
-
|
|
3005
|
+
} else if (ev.kind === "cost") {
|
|
3006
|
+
usd += ev.usd;
|
|
3007
|
+
if (ev.usdKnown === false) usdKnown = false;
|
|
3008
|
+
} else iterations += 1;
|
|
2972
3009
|
onProgress?.({
|
|
2973
3010
|
iterations,
|
|
2974
3011
|
tokens: { ...tokens },
|
|
2975
3012
|
usd,
|
|
3013
|
+
...usdKnown ? {} : { usdKnown: false },
|
|
2976
3014
|
ms: 0
|
|
2977
3015
|
});
|
|
2978
3016
|
}
|
|
@@ -2980,6 +3018,7 @@ async function foldStream(stream, onProgress) {
|
|
|
2980
3018
|
iterations,
|
|
2981
3019
|
tokens,
|
|
2982
3020
|
usd,
|
|
3021
|
+
...usdKnown ? {} : { usdKnown: false },
|
|
2983
3022
|
ms: 0
|
|
2984
3023
|
};
|
|
2985
3024
|
}
|
|
@@ -3312,7 +3351,7 @@ function isAgent(value) {
|
|
|
3312
3351
|
* quantities (tokens, usd, iterations) plus an absolute deadline. Children reserve
|
|
3313
3352
|
* atomically at spawn and reconcile at settle:
|
|
3314
3353
|
*
|
|
3315
|
-
* total ≡ free + reserved + committed (
|
|
3354
|
+
* total ≡ free + reserved + committed (for every known quantity)
|
|
3316
3355
|
*
|
|
3317
3356
|
* `reserve` moves a child's whole ceiling from `free` → `reserved` and fails closed
|
|
3318
3357
|
* when `free` can't cover it (never read-then-spawn overcommit, so `Σk(treatment) ≡
|
|
@@ -3322,7 +3361,9 @@ function isAgent(value) {
|
|
|
3322
3361
|
*
|
|
3323
3362
|
* Pure and deterministic: `now()` is injected, there is no I/O, and no wall-clock or
|
|
3324
3363
|
* RNG read. A `reserve`/`reconcile` ticket is single-use (fail-loud on double or
|
|
3325
|
-
* unknown reconcile) so a child can never refund twice.
|
|
3364
|
+
* unknown reconcile) so a child can never refund twice. If dollar cost is unknowable under a
|
|
3365
|
+
* dollar limit, reconciliation closes the known token/iteration work, marks the dollar channel
|
|
3366
|
+
* unusable, and refuses later reservations; inventing a numeric dollar total would be worse.
|
|
3326
3367
|
*
|
|
3327
3368
|
* @experimental
|
|
3328
3369
|
*/
|
|
@@ -3332,17 +3373,21 @@ function isAgent(value) {
|
|
|
3332
3373
|
function spendFromUsageEvents(events) {
|
|
3333
3374
|
const tokens = zeroTokenUsage();
|
|
3334
3375
|
let usd = 0;
|
|
3376
|
+
let usdKnown = true;
|
|
3335
3377
|
let iterations = 0;
|
|
3336
3378
|
for (const ev of events) if (ev.kind === "tokens") addTokenUsage(tokens, {
|
|
3337
3379
|
input: ev.input,
|
|
3338
3380
|
output: ev.output
|
|
3339
3381
|
});
|
|
3340
|
-
else if (ev.kind === "cost")
|
|
3341
|
-
|
|
3382
|
+
else if (ev.kind === "cost") {
|
|
3383
|
+
usd += ev.usd;
|
|
3384
|
+
if (ev.usdKnown === false) usdKnown = false;
|
|
3385
|
+
} else iterations += 1;
|
|
3342
3386
|
return {
|
|
3343
3387
|
iterations,
|
|
3344
3388
|
tokens,
|
|
3345
3389
|
usd,
|
|
3390
|
+
...usdKnown ? {} : { usdKnown: false },
|
|
3346
3391
|
ms: 0
|
|
3347
3392
|
};
|
|
3348
3393
|
}
|
|
@@ -3350,17 +3395,21 @@ async function foldUsage(events) {
|
|
|
3350
3395
|
if (Array.isArray(events)) return spendFromUsageEvents(events);
|
|
3351
3396
|
const tokens = zeroTokenUsage();
|
|
3352
3397
|
let usd = 0;
|
|
3398
|
+
let usdKnown = true;
|
|
3353
3399
|
let iterations = 0;
|
|
3354
3400
|
for await (const ev of events) if (ev.kind === "tokens") addTokenUsage(tokens, {
|
|
3355
3401
|
input: ev.input,
|
|
3356
3402
|
output: ev.output
|
|
3357
3403
|
});
|
|
3358
|
-
else if (ev.kind === "cost")
|
|
3359
|
-
|
|
3404
|
+
else if (ev.kind === "cost") {
|
|
3405
|
+
usd += ev.usd;
|
|
3406
|
+
if (ev.usdKnown === false) usdKnown = false;
|
|
3407
|
+
} else iterations += 1;
|
|
3360
3408
|
return {
|
|
3361
3409
|
iterations,
|
|
3362
3410
|
tokens,
|
|
3363
3411
|
usd,
|
|
3412
|
+
...usdKnown ? {} : { usdKnown: false },
|
|
3364
3413
|
ms: 0
|
|
3365
3414
|
};
|
|
3366
3415
|
}
|
|
@@ -3381,6 +3430,7 @@ function createBudgetPool(root, now = Date.now) {
|
|
|
3381
3430
|
let freeUsd = root.maxUsd ?? 0;
|
|
3382
3431
|
let reservedUsd = 0;
|
|
3383
3432
|
let committedUsd = 0;
|
|
3433
|
+
let usdTainted = false;
|
|
3384
3434
|
let freeIterations = root.maxIterations;
|
|
3385
3435
|
let reservedIterations = 0;
|
|
3386
3436
|
let committedIterations = 0;
|
|
@@ -3391,6 +3441,10 @@ function createBudgetPool(root, now = Date.now) {
|
|
|
3391
3441
|
const wantTokens = b.maxTokens;
|
|
3392
3442
|
const wantUsd = b.maxUsd ?? 0;
|
|
3393
3443
|
const wantIterations = b.maxIterations;
|
|
3444
|
+
if (usdCapped && usdTainted) return {
|
|
3445
|
+
ok: false,
|
|
3446
|
+
reason: "budget-exhausted"
|
|
3447
|
+
};
|
|
3394
3448
|
if (wantTokens > freeTokens) return {
|
|
3395
3449
|
ok: false,
|
|
3396
3450
|
reason: "budget-exhausted"
|
|
@@ -3427,24 +3481,28 @@ function createBudgetPool(root, now = Date.now) {
|
|
|
3427
3481
|
}
|
|
3428
3482
|
function reconcile(ticket, spent) {
|
|
3429
3483
|
if (!open.has(ticket.id)) throw new Error(`budget pool: reconcile of unknown or already-settled ticket ${ticket.id}`);
|
|
3430
|
-
open.delete(ticket.id);
|
|
3431
3484
|
const { tokens: rTokens, usd: rUsd, iterations: rIterations } = ticket.reserved;
|
|
3432
|
-
|
|
3485
|
+
const unknownUnderCap = usdCapped && spent.usdKnown === false;
|
|
3433
3486
|
const spentTokens = totalTokens(spent.tokens);
|
|
3434
3487
|
if (spentTokens > rTokens) throw new Error(`budget pool: ticket ${ticket.id} spent ${spentTokens} tokens > reserved ${rTokens}`);
|
|
3435
3488
|
if (spent.iterations > rIterations) throw new Error(`budget pool: ticket ${ticket.id} spent ${spent.iterations} iterations > reserved ${rIterations}`);
|
|
3436
3489
|
if (usdCapped && spent.usd > rUsd) throw new Error(`budget pool: ticket ${ticket.id} spent $${spent.usd} > reserved $${rUsd}`);
|
|
3490
|
+
open.delete(ticket.id);
|
|
3437
3491
|
reservedTokens -= rTokens;
|
|
3438
3492
|
committedTokens += spentTokens;
|
|
3439
3493
|
freeTokens += rTokens - spentTokens;
|
|
3440
3494
|
reservedIterations -= rIterations;
|
|
3441
3495
|
committedIterations += spent.iterations;
|
|
3442
3496
|
freeIterations += rIterations - spent.iterations;
|
|
3443
|
-
if (usdCapped
|
|
3497
|
+
if (usdCapped) {
|
|
3444
3498
|
reservedUsd -= rUsd;
|
|
3445
3499
|
committedUsd += spent.usd;
|
|
3446
|
-
|
|
3500
|
+
if (unknownUnderCap) {
|
|
3501
|
+
usdTainted = true;
|
|
3502
|
+
freeUsd = 0;
|
|
3503
|
+
} else freeUsd += rUsd - spent.usd;
|
|
3447
3504
|
} else committedUsd += spent.usd;
|
|
3505
|
+
if (unknownUnderCap) throw new Error(`budget pool: ticket ${ticket.id} reported unknown dollar cost under a dollar-capped budget`);
|
|
3448
3506
|
}
|
|
3449
3507
|
function observe(spend) {
|
|
3450
3508
|
if (usdCapped && spend.usdKnown === false) throw new Error("budget pool: cannot observe unknown dollar cost under a dollar-capped budget");
|
|
@@ -3459,7 +3517,7 @@ function createBudgetPool(root, now = Date.now) {
|
|
|
3459
3517
|
function readout() {
|
|
3460
3518
|
return {
|
|
3461
3519
|
tokensLeft: freeTokens,
|
|
3462
|
-
usdLeft: usdCapped ? freeUsd : 0,
|
|
3520
|
+
usdLeft: usdCapped ? usdTainted ? 0 : freeUsd : 0,
|
|
3463
3521
|
usdCapped,
|
|
3464
3522
|
deadlineMs: absoluteDeadlineMs,
|
|
3465
3523
|
reservedTokens
|
|
@@ -3933,4 +3991,4 @@ function isNonEmptySpend(s) {
|
|
|
3933
3991
|
//#endregion
|
|
3934
3992
|
export { createWorktree as A, routerChatWithUsage as C, runWorktreeChecks as D, runSettledCommand as E, CodexExecutionDiagnosticError as F, harnessInvocation as M, parseCodexTokenUsage as N, runWorktreeHarness as O, runLocalHarness as P, routerChatWithTools as S, runBrainLoop as T, waitUntil as _, runFinalizer as a, readWorkerProgress as b, spendFromUsageEvents as c, settledToIteration as d, createWaitProbes as f, validateWaitSpec as g, timerAt as h, pickBestDelivered as i, removeWorktree as j, captureWorktreeDiff as k, withDriverExecutor as l, pollFor as m, bestDelivered as n, runTree as o, isWaitOutcome as p, collectDelivered as r, createBudgetPool as s, createSupervisor as t, createScope as u, DEFAULT_STALL_AFTER_MS as v, routerToolLoop as w, routerBrain as x, createActivityLog as y };
|
|
3935
3993
|
|
|
3936
|
-
//# sourceMappingURL=supervisor-
|
|
3994
|
+
//# sourceMappingURL=supervisor-ByCPHcp9.js.map
|