@wrongstack/core 0.292.0 → 0.292.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/coordination/index.d.ts +1 -1
- package/dist/coordination/index.d.ts.map +1 -1
- package/dist/coordination/index.js +163 -39
- package/dist/coordination/index.js.map +3 -3
- package/dist/coordination/mailbox-http-router.d.ts +38 -0
- package/dist/coordination/mailbox-http-router.d.ts.map +1 -1
- package/dist/coordination/provider-status-tracker.d.ts.map +1 -1
- package/dist/core/fallback-model.d.ts.map +1 -1
- package/dist/defaults/index.js +5 -1
- package/dist/defaults/index.js.map +2 -2
- package/dist/execution/index.js +8 -1
- package/dist/execution/index.js.map +2 -2
- package/dist/execution/one-shot-llm.d.ts.map +1 -1
- package/dist/index.js +305 -139
- package/dist/index.js.map +4 -4
- package/dist/tools/index.js +8 -1
- package/dist/tools/index.js.map +2 -2
- package/dist/types/index.js +5 -1
- package/dist/types/index.js.map +2 -2
- package/dist/types/provider.d.ts.map +1 -1
- package/dist/utils/connectivity.d.ts +36 -0
- package/dist/utils/connectivity.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +44 -11
- package/dist/utils/index.js.map +4 -4
- package/package.json +2 -2
package/dist/types/index.js
CHANGED
|
@@ -441,7 +441,8 @@ function effectiveInputTokens(usage) {
|
|
|
441
441
|
}
|
|
442
442
|
var CONTEXT_OVERFLOW_RE = /context.length|context.window|maximum context|max.*tokens?.*exceeded|prompt is too long|too long|exceeds the context|\btokens\b.*exceed|too many tokens|reduce the length|resulted in \d+ tokens|input.{0,12}too (?:large|long)|context_length_exceeded/i;
|
|
443
443
|
var CONTENT_FILTER_RE = /content.(filter|policy|moderation)|safety (system|filter)/i;
|
|
444
|
-
var QUOTA_EXHAUSTED_RE = /(?:insufficient|exhausted|depleted|exceeded|no|not enough)[-_\s]*(?:quota|credit|balance)|(?:quota|credit|balance)[-_\s]*(?:exhausted|depleted|exceeded|insufficient)|billing[_\s-]*(?:hard[_\s-]*)?limit|payment required|spending limit|plan limit/i;
|
|
444
|
+
var QUOTA_EXHAUSTED_RE = /(?:insufficient|exhausted|depleted|exceeded|no|not enough)[-_\s]*(?:quota|credit|balance)|(?:quota|credit|balance)[-_\s]*(?:exhausted|depleted|exceeded|insufficient)|billing[_\s-]*(?:hard[_\s-]*)?limit|payment required|spending limit|plan limit|usage[-_\s]*limit[-_\s]*(?:reached|exceeded)/i;
|
|
445
|
+
var RATE_LIMIT_EXCEEDED_RE = /rate[-_\s]*limit[-_\s]*exceeded/i;
|
|
445
446
|
function classifyProviderError(status, body, message) {
|
|
446
447
|
const type = body?.type;
|
|
447
448
|
const text = [message, body?.message, type, body?.raw].filter(Boolean).join("\n");
|
|
@@ -449,6 +450,9 @@ function classifyProviderError(status, body, message) {
|
|
|
449
450
|
if (status === 408) return "timeout";
|
|
450
451
|
if (status === 599) return "stream_hang";
|
|
451
452
|
if (status === 402 || QUOTA_EXHAUSTED_RE.test(text)) return "quota_exhausted";
|
|
453
|
+
if (status === 429 && body?.message && RATE_LIMIT_EXCEEDED_RE.test(body.message)) {
|
|
454
|
+
return "quota_exhausted";
|
|
455
|
+
}
|
|
452
456
|
if (type === "rate_limit_error" || status === 429) return "rate_limit";
|
|
453
457
|
if (type === "overloaded_error" || status === 529) return "overloaded";
|
|
454
458
|
if (status >= 500) return "server";
|