@tangle-network/agent-runtime 0.110.0 → 0.112.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.
Files changed (43) hide show
  1. package/dist/{activation-CsuHCZVN.js → activation-Cdc_tRNR.js} +2 -2
  2. package/dist/{activation-CsuHCZVN.js.map → activation-Cdc_tRNR.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +2 -2
  5. package/dist/{environment-provider-CTEMEP9u.d.ts → environment-provider-Cl97VeCv.d.ts} +43 -2
  6. package/dist/environment-provider.d.ts +1 -1
  7. package/dist/{improvement-cycle-ryAyCLKN.js → improvement-cycle-BCjD-g_C.js} +3 -3
  8. package/dist/{improvement-cycle-ryAyCLKN.js.map → improvement-cycle-BCjD-g_C.js.map} +1 -1
  9. package/dist/{index-D_OdNLe0.d.ts → index-B0sAaAO_.d.ts} +164 -24
  10. package/dist/{index-C-Zn0VrN.d.ts → index-B6glsqBp.d.ts} +3 -3
  11. package/dist/{index-WODlt7iz.d.ts → index-C9vg2af7.d.ts} +4 -4
  12. package/dist/index.d.ts +5 -5
  13. package/dist/index.js +7 -7
  14. package/dist/intelligence.d.ts +1 -1
  15. package/dist/intelligence.js +2 -2
  16. package/dist/kernel.d.ts +3 -3
  17. package/dist/kernel.js +5 -5
  18. package/dist/{knowledge-DBNAteaC.js → knowledge-In_1LsHg.js} +3 -3
  19. package/dist/{knowledge-DBNAteaC.js.map → knowledge-In_1LsHg.js.map} +1 -1
  20. package/dist/knowledge.d.ts +1 -1
  21. package/dist/knowledge.js +1 -1
  22. package/dist/{loop-runner-bin-BUm83y1g.d.ts → loop-runner-bin-CHnWCyiB.d.ts} +3 -3
  23. package/dist/{loop-runner-bin-zE7DyGop.js → loop-runner-bin-DF98VMqr.js} +3 -3
  24. package/dist/{loop-runner-bin-zE7DyGop.js.map → loop-runner-bin-DF98VMqr.js.map} +1 -1
  25. package/dist/loop-runner-bin.d.ts +1 -1
  26. package/dist/loop-runner-bin.js +1 -1
  27. package/dist/mcp/bin.js +1 -1
  28. package/dist/mcp/index.d.ts +1 -1
  29. package/dist/mcp/index.js +4 -4
  30. package/dist/{openai-tools-st-hERvA.js → openai-tools-g5FS2twc.js} +2 -2
  31. package/dist/{openai-tools-st-hERvA.js.map → openai-tools-g5FS2twc.js.map} +1 -1
  32. package/dist/primeintellect/index.d.ts +1 -1
  33. package/dist/{runtime-DSkMJb_X.js → runtime-6sL2vhTQ.js} +31 -13
  34. package/dist/{runtime-DSkMJb_X.js.map → runtime-6sL2vhTQ.js.map} +1 -1
  35. package/dist/{structural-rollout-CgnNy7_4.js → structural-rollout-D5GbH3cy.js} +2 -2
  36. package/dist/{structural-rollout-CgnNy7_4.js.map → structural-rollout-D5GbH3cy.js.map} +1 -1
  37. package/dist/{supervise-CeZtA1wu.js → supervise-6jSTe0kO.js} +322 -30
  38. package/dist/supervise-6jSTe0kO.js.map +1 -0
  39. package/dist/{supervisor-ByCPHcp9.js → supervisor-B4hOPKJV.js} +48 -6
  40. package/dist/{supervisor-ByCPHcp9.js.map → supervisor-B4hOPKJV.js.map} +1 -1
  41. package/dist/testing.js +8 -8
  42. package/package.json +1 -1
  43. package/dist/supervise-CeZtA1wu.js.map +0 -1
@@ -3710,6 +3710,29 @@ function maxSeqOf(events, pred) {
3710
3710
  /** The default runtime recursion-depth ceiling, paired with the conserved pool so a
3711
3711
  * runaway recursion hits budget-exhaustion first and depth-exceeded second (R3). */
3712
3712
  const defaultMaxDepth = 4;
3713
+ /**
3714
+ * Normalize an arbitrary rejection into the serializable triple the result carries. A driver may
3715
+ * reject with anything (a string, a plain object, a null-prototype value), and the whole point of
3716
+ * this field is that the failure survives, so every branch produces a message instead of throwing:
3717
+ * a stringification that itself throws (circular, hostile `toString`) falls back to the tag.
3718
+ */
3719
+ function describeRejection(error) {
3720
+ if (error instanceof Error) return {
3721
+ name: error.name,
3722
+ message: error.message,
3723
+ ...error.stack !== void 0 ? { stack: error.stack } : {}
3724
+ };
3725
+ let message;
3726
+ try {
3727
+ message = typeof error === "string" ? error : JSON.stringify(error) ?? String(error);
3728
+ } catch {
3729
+ message = Object.prototype.toString.call(error);
3730
+ }
3731
+ return {
3732
+ name: "NonError",
3733
+ message
3734
+ };
3735
+ }
3713
3736
  /** Create a supervisor that owns one recursive agent execution tree. */
3714
3737
  function createSupervisor() {
3715
3738
  let attached;
@@ -3813,16 +3836,29 @@ function createSupervisor() {
3813
3836
  }
3814
3837
  return noWinner();
3815
3838
  }
3816
- return noWinner();
3817
- async function noWinner() {
3839
+ return noWinner({ error: actOutcome.error });
3840
+ async function noWinner(rejection) {
3818
3841
  const { childWork, driverInference } = await spentFromJournal(journal, opts.runId);
3819
- return {
3842
+ const common = {
3820
3843
  kind: "no-winner",
3821
- reason: classifyNoWinner(controller, pool, opts, breaker),
3822
3844
  tree,
3823
3845
  downCount: breaker.downCount(),
3824
3846
  spentTotal: addSpend(childWork, driverInference)
3825
3847
  };
3848
+ const lifecycle = classifyNoWinner(controller, pool, opts, breaker);
3849
+ if (lifecycle !== void 0) return {
3850
+ ...common,
3851
+ reason: lifecycle
3852
+ };
3853
+ if (rejection !== void 0) return {
3854
+ ...common,
3855
+ reason: "driver-failed",
3856
+ error: describeRejection(rejection.error)
3857
+ };
3858
+ return {
3859
+ ...common,
3860
+ reason: "all-children-down"
3861
+ };
3826
3862
  }
3827
3863
  }
3828
3864
  function attach(h) {
@@ -3905,11 +3941,17 @@ async function drainLiveChildren(scope, controller) {
3905
3941
  async function drainCursor(scope) {
3906
3942
  for (;;) if (await scope.next() === null) return;
3907
3943
  }
3944
+ /**
3945
+ * The lifecycle cause of a no-winner, or `undefined` when the supervisor's own state proves
3946
+ * nothing. Returning `undefined` rather than falling through to `all-children-down` is what lets
3947
+ * the caller decide between the `driver-failed` arm (a rejection was captured) and the residual
3948
+ * bucket — and it is why `driver-failed` cannot be produced without an `error` to attach.
3949
+ */
3908
3950
  function classifyNoWinner(controller, pool, opts, breaker) {
3909
3951
  if (breaker.tripped()) return "all-children-down";
3910
3952
  if (controller.signal.aborted) return "aborted";
3911
3953
  if (poolExhausted(pool, opts)) return "budget-exhausted";
3912
- return "all-children-down";
3954
+ if (breaker.downCount() > 0) return "all-children-down";
3913
3955
  }
3914
3956
  function poolExhausted(pool, opts) {
3915
3957
  const r = pool.readout();
@@ -3991,4 +4033,4 @@ function isNonEmptySpend(s) {
3991
4033
  //#endregion
3992
4034
  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 };
3993
4035
 
3994
- //# sourceMappingURL=supervisor-ByCPHcp9.js.map
4036
+ //# sourceMappingURL=supervisor-B4hOPKJV.js.map