@tangle-network/agent-app 4.0.13 → 4.0.15

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 (32) hide show
  1. package/dist/billing/identity-bound.d.ts +14 -9
  2. package/dist/billing/index.js +1 -1
  3. package/dist/chat-routes/detached-turn.d.ts +1 -1
  4. package/dist/chat-routes/failure-wording.d.ts +3 -4
  5. package/dist/chat-routes/index.js +5 -5
  6. package/dist/chat-routes/index.js.map +1 -1
  7. package/dist/{chunk-XCUT2I52.js → chunk-5QQBQS7W.js} +8 -2
  8. package/dist/{chunk-XCUT2I52.js.map → chunk-5QQBQS7W.js.map} +1 -1
  9. package/dist/{chunk-GWATTXFR.js → chunk-FYF564KJ.js} +2 -2
  10. package/dist/{chunk-QPD42X6A.js → chunk-G4NHCLYA.js} +17 -9
  11. package/dist/chunk-G4NHCLYA.js.map +1 -0
  12. package/dist/{chunk-TMWUWKLU.js → chunk-GE242CLI.js} +2 -2
  13. package/dist/{chunk-RNDWCT4O.js → chunk-MZZMOGFN.js} +101 -89
  14. package/dist/{chunk-RNDWCT4O.js.map → chunk-MZZMOGFN.js.map} +1 -1
  15. package/dist/{chunk-CD4SJXYC.js → chunk-RFXROORA.js} +12 -12
  16. package/dist/chunk-RFXROORA.js.map +1 -0
  17. package/dist/platform/delegated-keys.d.ts +5 -1
  18. package/dist/platform/index.js +8 -2
  19. package/dist/platform/index.js.map +1 -1
  20. package/dist/preset-cloudflare/index.js +3 -3
  21. package/dist/public-consultation/index.js +3 -3
  22. package/dist/runtime/index.js +2 -2
  23. package/dist/runtime/router-turn.js +1 -1
  24. package/dist/spend/delegate-budget.d.ts +4 -0
  25. package/dist/spend/index.js.map +1 -1
  26. package/dist/turn-health/index.js +3 -1
  27. package/dist/turn-health/index.js.map +1 -1
  28. package/package.json +1 -1
  29. package/dist/chunk-CD4SJXYC.js.map +0 -1
  30. package/dist/chunk-QPD42X6A.js.map +0 -1
  31. /package/dist/{chunk-GWATTXFR.js.map → chunk-FYF564KJ.js.map} +0 -0
  32. /package/dist/{chunk-TMWUWKLU.js.map → chunk-GE242CLI.js.map} +0 -0
@@ -907,7 +907,13 @@ async function runRouterTurn(options) {
907
907
  });
908
908
  }
909
909
  const detail = error instanceof Error ? error.message.match(/\(HTTP \d+\): ([\s\S]*)$/)?.[1]?.slice(0, 1e3) : void 0;
910
- return outcome(typeof status === "number" ? { code: `model_http_${status}`, status, message: "The model service did not answer.", ...detail ? { detail } : {} } : { code: "model_unavailable", message: "The model service did not answer." });
910
+ const spent = status === 402 && /budget_(exhausted|exceeded)/i.test(detail ?? "");
911
+ return outcome(typeof status === "number" ? {
912
+ code: `model_http_${status}`,
913
+ status,
914
+ ...detail ? { detail } : {},
915
+ message: spent ? "The paying key has spent its budget. Top it up or raise its cap, then retry." : "The model service did not answer."
916
+ } : { code: "model_unavailable", message: "The model service did not answer." });
911
917
  }
912
918
  if (placementFailure) return outcome(placementFailure);
913
919
  if (stop === "deadline" && checkpoint) {
@@ -998,4 +1004,4 @@ export {
998
1004
  composeRouterTurnPrompt,
999
1005
  runRouterTurn
1000
1006
  };
1001
- //# sourceMappingURL=chunk-XCUT2I52.js.map
1007
+ //# sourceMappingURL=chunk-5QQBQS7W.js.map