beeos-claw 0.5.73 → 0.5.74

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.
@@ -1 +1 @@
1
- const ERROR_PATTERNS={billing:[/["']?(?:status|code)["']?\s*[:=]\s*402\b|\bhttp\s*402\b|\berror(?:\s+code)?\s*[:=]?\s*402\b|\b(?:got|returned|received)\s+(?:a\s+)?402\b|^\s*402\s+payment/i,"payment required","insufficient credits",/insufficient[_ ]quota/i,"credit balance","plans & billing","insufficient balance","insufficient usd or diem balance","billing error","add more credits"],rateLimit:[/rate[_ ]limit|too many requests|429/,"model_cooldown","exceeded your current quota","resource has been exhausted","quota exceeded","resource_exhausted","usage limit",/\btpm\b/i,"tokens per minute","tokens per day"],overloaded:[/overloaded_error|"type"\s*:\s*"overloaded_error"/i,"overloaded",/service[_ ]unavailable.*(?:overload|capacity|high[_ ]demand)|(?:overload|capacity|high[_ ]demand).*service[_ ]unavailable/i,"high demand"],timeout:["timeout","timed out","service unavailable","deadline exceeded","connection error","network error","network request failed","fetch failed","socket hang up",/\beconn(?:refused|reset|aborted)\b/i,/\benotfound\b/i],auth:[/invalid[_ ]?api[_ ]?key/,"incorrect api key","invalid token","unauthorized","forbidden","access denied","insufficient permissions",/\b401\b/,/\b403\b/,"no credentials found","no api key found",/api[_ ]?key[_ ]?(?:revoked|invalid|deactivated|deleted)/i,"invalid_api_key","key has been disabled","permission_error"],contextOverflow:["request_too_large","context length exceeded","maximum context length","prompt is too long","exceeds model context window","context overflow:","context_window_exceeded"]};function matchesPatterns(e,t){if(!e)return!1;const r=e.toLowerCase();return t.some(e=>e instanceof RegExp?e.test(r):r.includes(e))}function classifyErrorReason(e){return e?matchesPatterns(e,ERROR_PATTERNS.billing)?"billing":matchesPatterns(e,ERROR_PATTERNS.contextOverflow)?"context_overflow":matchesPatterns(e,ERROR_PATTERNS.rateLimit)?"rate_limit":matchesPatterns(e,ERROR_PATTERNS.overloaded)?"overloaded":matchesPatterns(e,ERROR_PATTERNS.timeout)?"timeout":matchesPatterns(e,ERROR_PATTERNS.auth)?"auth":null:null}const FRIENDLY_MESSAGES={billing:"API provider returned a billing error — your API key may have run out of credits or has an insufficient balance. Check your provider's billing dashboard and top up, or switch to a different API key.",rate_limit:"API rate limit reached. Please wait a moment and try again.",auth:"API authentication failed — your API key may be invalid, revoked, or lacking permissions. Check your provider settings.",timeout:"LLM request timed out or the service is temporarily unavailable. Please try again.",overloaded:"The AI service is temporarily overloaded. Please try again in a moment.",context_overflow:"Context overflow: prompt too large for the model. Try starting a fresh session or use a model with a larger context window."};export function formatFriendlyError(e){if(!e)return e;if(e.startsWith("⚠️"))return e;const t=classifyErrorReason(e);return t?FRIENDLY_MESSAGES[t]:e}
1
+ const ERROR_PATTERNS={modelCapability:["no endpoints found that support image","support image input","unknown variant image_url","model is not registered","model_not_found","no alias rule matches",/does not support (?:image|vision|multimodal)/i],billing:[/["']?(?:status|code)["']?\s*[:=]\s*402\b|\bhttp\s*402\b|\berror(?:\s+code)?\s*[:=]?\s*402\b|\b(?:got|returned|received)\s+(?:a\s+)?402\b|^\s*402\s+payment/i,"payment required","insufficient credits",/insufficient[_ ]quota/i,"credit balance","plans & billing","insufficient balance","insufficient usd or diem balance","billing error","add more credits"],rateLimit:[/rate[_ ]limit|too many requests|429/,"model_cooldown","exceeded your current quota","resource has been exhausted","quota exceeded","resource_exhausted","usage limit",/\btpm\b/i,"tokens per minute","tokens per day"],overloaded:[/overloaded_error|"type"\s*:\s*"overloaded_error"/i,"overloaded",/service[_ ]unavailable.*(?:overload|capacity|high[_ ]demand)|(?:overload|capacity|high[_ ]demand).*service[_ ]unavailable/i,"high demand"],timeout:["timeout","timed out","service unavailable","deadline exceeded","connection error","network error","network request failed","fetch failed","socket hang up",/\beconn(?:refused|reset|aborted)\b/i,/\benotfound\b/i],auth:[/invalid[_ ]?api[_ ]?key/,"incorrect api key","invalid token","unauthorized","forbidden","access denied","insufficient permissions",/\b401\b/,/\b403\b/,"no credentials found","no api key found",/api[_ ]?key[_ ]?(?:revoked|invalid|deactivated|deleted)/i,"invalid_api_key","key has been disabled","permission_error"],contextOverflow:["request_too_large","context length exceeded","maximum context length","prompt is too long","exceeds model context window","context overflow:","context_window_exceeded"]};function matchesPatterns(e,t){if(!e)return!1;const i=e.toLowerCase();return t.some(e=>e instanceof RegExp?e.test(i):i.includes(e))}function classifyErrorReason(e){return e?matchesPatterns(e,ERROR_PATTERNS.modelCapability)?"model_capability":matchesPatterns(e,ERROR_PATTERNS.billing)?"billing":matchesPatterns(e,ERROR_PATTERNS.contextOverflow)?"context_overflow":matchesPatterns(e,ERROR_PATTERNS.rateLimit)?"rate_limit":matchesPatterns(e,ERROR_PATTERNS.overloaded)?"overloaded":matchesPatterns(e,ERROR_PATTERNS.timeout)?"timeout":matchesPatterns(e,ERROR_PATTERNS.auth)?"auth":null:null}const FRIENDLY_MESSAGES={model_capability:"The selected model cannot handle this request (for example image input is not supported, or the model id is not registered). Switch to a vision-capable model such as Gemini or GPT-4o and try again.",billing:"API provider returned a billing error — your API key may have run out of credits or has an insufficient balance. Check your provider's billing dashboard and top up, or switch to a different API key.",rate_limit:"API rate limit reached. Please wait a moment and try again.",auth:"API authentication failed — your API key may be invalid, revoked, or lacking permissions. Check your provider settings.",timeout:"LLM request timed out or the service is temporarily unavailable. Please try again.",overloaded:"The AI service is temporarily overloaded. Please try again in a moment.",context_overflow:"Context overflow: prompt too large for the model. Try starting a fresh session or use a model with a larger context window."};export function formatFriendlyError(e){if(!e)return e;if(e.startsWith("⚠️"))return matchesPatterns(e,ERROR_PATTERNS.modelCapability)?FRIENDLY_MESSAGES.model_capability:e;const t=classifyErrorReason(e);return t?FRIENDLY_MESSAGES[t]:e}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beeos-claw",
3
- "version": "0.5.73",
3
+ "version": "0.5.74",
4
4
  "description": "OpenClaw plugin that bridges the BeeOS platform with the local OpenClaw Gateway, providing file transfer, ACP bridge, and observability.",
5
5
  "license": "MIT",
6
6
  "author": "BeeOS <dev@beeos.ai>",