@tangle-network/agent-runtime 0.115.0 → 0.115.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.
Files changed (39) hide show
  1. package/dist/{activation-BNQQO-bc.js → activation-Bt_XVkjK.js} +2 -2
  2. package/dist/{activation-BNQQO-bc.js.map → activation-Bt_XVkjK.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +2 -2
  5. package/dist/{improvement-cycle-CBLOgfsQ.js → improvement-cycle-tEswzEPr.js} +3 -3
  6. package/dist/{improvement-cycle-CBLOgfsQ.js.map → improvement-cycle-tEswzEPr.js.map} +1 -1
  7. package/dist/{index-BuzkRsOn.d.ts → index-BUWd8QJq.d.ts} +10 -1
  8. package/dist/{index-I97xACXk.d.ts → index-DZukewLl.d.ts} +2 -2
  9. package/dist/{index-B_vcAAle.d.ts → index-K7nucOmw.d.ts} +4 -4
  10. package/dist/index.d.ts +4 -4
  11. package/dist/index.js +7 -7
  12. package/dist/intelligence.js +2 -2
  13. package/dist/kernel.d.ts +1 -1
  14. package/dist/kernel.js +4 -4
  15. package/dist/{knowledge-DcIKJaPd.js → knowledge-CUXQE8Sq.js} +3 -3
  16. package/dist/{knowledge-DcIKJaPd.js.map → knowledge-CUXQE8Sq.js.map} +1 -1
  17. package/dist/knowledge.d.ts +1 -1
  18. package/dist/knowledge.js +1 -1
  19. package/dist/{loop-runner-bin-DgAXgQCI.d.ts → loop-runner-bin-BZl5vp7t.d.ts} +2 -2
  20. package/dist/{loop-runner-bin-C2GIqSUn.js → loop-runner-bin-DzJz48Fb.js} +3 -3
  21. package/dist/{loop-runner-bin-C2GIqSUn.js.map → loop-runner-bin-DzJz48Fb.js.map} +1 -1
  22. package/dist/loop-runner-bin.d.ts +1 -1
  23. package/dist/loop-runner-bin.js +1 -1
  24. package/dist/mcp/bin.js +1 -1
  25. package/dist/mcp/index.d.ts +1 -1
  26. package/dist/mcp/index.js +4 -4
  27. package/dist/{openai-tools-BWAEIHkZ.js → openai-tools-CynwZMZd.js} +2 -2
  28. package/dist/{openai-tools-BWAEIHkZ.js.map → openai-tools-CynwZMZd.js.map} +1 -1
  29. package/dist/primeintellect/index.d.ts +1 -1
  30. package/dist/{runtime-C_g_SsXg.js → runtime-BatQajPB.js} +4 -4
  31. package/dist/{runtime-C_g_SsXg.js.map → runtime-BatQajPB.js.map} +1 -1
  32. package/dist/{structural-rollout-Cqm1dKa7.js → structural-rollout-DEf37yQy.js} +2 -2
  33. package/dist/{structural-rollout-Cqm1dKa7.js.map → structural-rollout-DEf37yQy.js.map} +1 -1
  34. package/dist/{supervise-BcCHhLrz.js → supervise-B7TIJR3D.js} +2 -2
  35. package/dist/{supervise-BcCHhLrz.js.map → supervise-B7TIJR3D.js.map} +1 -1
  36. package/dist/{supervisor-CspDspod.js → supervisor-DzQu5Ydu.js} +16 -7
  37. package/dist/{supervisor-CspDspod.js.map → supervisor-DzQu5Ydu.js.map} +1 -1
  38. package/dist/testing.js +8 -8
  39. package/package.json +1 -1
@@ -3578,7 +3578,12 @@ function isAgent(value) {
3578
3578
  *
3579
3579
  * Pure and deterministic: `now()` is injected, there is no I/O, and no wall-clock or
3580
3580
  * RNG read. A `reserve`/`reconcile` ticket is single-use (fail-loud on double or
3581
- * unknown reconcile) so a child can never refund twice. If dollar cost is unknowable under a
3581
+ * unknown reconcile) so a child can never refund twice. Reconciling an OPEN ticket always
3582
+ * closes it: a fail-loud condition settles the reservation first and throws afterwards, so no
3583
+ * error path can strand a reservation past the join barrier's `assertNoOpenTickets`.
3584
+ * A child that declared no `maxUsd` reserved no dollar allocation, so its real dollars are
3585
+ * committed as observed spend and debited from the root's balance rather than treated as an
3586
+ * overspend of a $0 ceiling it never asked for. If dollar cost is unknowable under a
3582
3587
  * dollar limit, reconciliation closes the known token/iteration work, marks the dollar channel
3583
3588
  * unusable, and refuses later reservations; inventing a numeric dollar total would be worse.
3584
3589
  * If a TOKEN count is unknowable (a provider that reported no usage for work that ran), the pool
@@ -3700,7 +3705,8 @@ function createBudgetPool(root, now = Date.now) {
3700
3705
  reserved: {
3701
3706
  tokens: wantTokens,
3702
3707
  usd: wantUsd,
3703
- iterations: wantIterations
3708
+ iterations: wantIterations,
3709
+ usdBudgeted: b.maxUsd !== void 0
3704
3710
  }
3705
3711
  }
3706
3712
  };
@@ -3710,9 +3716,12 @@ function createBudgetPool(root, now = Date.now) {
3710
3716
  const { tokens: rTokens, usd: rUsd, iterations: rIterations } = ticket.reserved;
3711
3717
  const unknownUnderCap = usdCapped && spent.usdKnown === false;
3712
3718
  const spentTokens = totalTokens(spent.tokens);
3713
- if (spentTokens > rTokens) throw new Error(`budget pool: ticket ${ticket.id} spent ${spentTokens} tokens > reserved ${rTokens}`);
3714
- if (spent.iterations > rIterations) throw new Error(`budget pool: ticket ${ticket.id} spent ${spent.iterations} iterations > reserved ${rIterations}`);
3715
- if (usdCapped && spent.usd > rUsd) throw new Error(`budget pool: ticket ${ticket.id} spent $${spent.usd} > reserved $${rUsd}`);
3719
+ const usdBudgeted = ticket.reserved.usdBudgeted !== false;
3720
+ let violation;
3721
+ if (spentTokens > rTokens) violation = `ticket ${ticket.id} spent ${spentTokens} tokens > reserved ${rTokens}`;
3722
+ else if (spent.iterations > rIterations) violation = `ticket ${ticket.id} spent ${spent.iterations} iterations > reserved ${rIterations}`;
3723
+ else if (usdCapped && usdBudgeted && spent.usd > rUsd) violation = `ticket ${ticket.id} spent $${spent.usd} > reserved $${rUsd}`;
3724
+ else if (unknownUnderCap) violation = `ticket ${ticket.id} reported unknown dollar cost under a dollar-capped budget`;
3716
3725
  open.delete(ticket.id);
3717
3726
  if (spent.tokensKnown === false) tokensTainted = true;
3718
3727
  reservedTokens -= rTokens;
@@ -3729,7 +3738,7 @@ function createBudgetPool(root, now = Date.now) {
3729
3738
  freeUsd = 0;
3730
3739
  } else freeUsd += rUsd - spent.usd;
3731
3740
  } else committedUsd += spent.usd;
3732
- if (unknownUnderCap) throw new Error(`budget pool: ticket ${ticket.id} reported unknown dollar cost under a dollar-capped budget`);
3741
+ if (violation !== void 0) throw new Error(`budget pool: ${violation}`);
3733
3742
  }
3734
3743
  function observe(spend) {
3735
3744
  if (usdCapped && spend.usdKnown === false) throw new Error("budget pool: cannot observe unknown dollar cost under a dollar-capped budget");
@@ -4266,4 +4275,4 @@ function isNonEmptySpend(s) {
4266
4275
  //#endregion
4267
4276
  export { captureWorktreeDiff as A, routerChatWithUsage as C, runSettledCommand as D, runBrainLoop as E, runLocalHarness as F, CodexExecutionDiagnosticError as I, removeWorktree as M, harnessInvocation as N, runWorktreeChecks as O, parseCodexTokenUsage as P, routerChatWithTools as S, streamRouterChatWithTools 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, createWorktree as j, runWorktreeHarness 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 };
4268
4277
 
4269
- //# sourceMappingURL=supervisor-CspDspod.js.map
4278
+ //# sourceMappingURL=supervisor-DzQu5Ydu.js.map