@rsalmn/extremerouter 0.7.3 → 0.7.4
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/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +7 -7
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/alerts/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cache/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/swarm/active/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/swarm/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/meta/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/meta/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page.js +1 -1
- package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing/page.js +1 -1
- package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page.js +1 -1
- package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +5 -5
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page.js +1 -1
- package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +7 -7
- package/app/.next-cli-build/server/chunks/1216.js +1 -1
- package/app/.next-cli-build/server/chunks/1350.js +1 -1
- package/app/.next-cli-build/server/chunks/1719.js +1 -1
- package/app/.next-cli-build/server/chunks/2231.js +1 -1
- package/app/.next-cli-build/server/chunks/2701.js +1 -1
- package/app/.next-cli-build/server/chunks/318.js +8 -6
- package/app/.next-cli-build/server/chunks/3571.js +1 -0
- package/app/.next-cli-build/server/chunks/412.js +2 -2
- package/app/.next-cli-build/server/chunks/5612.js +1 -1
- package/app/.next-cli-build/server/chunks/5699.js +1 -1
- package/app/.next-cli-build/server/chunks/5961.js +1 -1
- package/app/.next-cli-build/server/chunks/6070.js +1 -1
- package/app/.next-cli-build/server/chunks/615.js +1 -1
- package/app/.next-cli-build/server/chunks/6306.js +1 -1
- package/app/.next-cli-build/server/chunks/6316.js +2 -2
- package/app/.next-cli-build/server/chunks/6763.js +1 -1
- package/app/.next-cli-build/server/chunks/6777.js +1 -1
- package/app/.next-cli-build/server/chunks/8238.js +1 -1
- package/app/.next-cli-build/server/chunks/8271.js +1 -1
- package/app/.next-cli-build/server/chunks/8833.js +1 -1
- package/app/.next-cli-build/server/chunks/8920.js +1 -1
- package/app/.next-cli-build/server/chunks/9630.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/static/chunks/1321-b29070c75a1bf41b.js +1 -0
- package/app/.next-cli-build/static/chunks/{1696-2558002db021b00d.js → 1696-bafe4b44a7a0439e.js} +1 -1
- package/app/.next-cli-build/static/chunks/1992-b492aa3235a8c259.js +1 -0
- package/app/.next-cli-build/static/chunks/5497-2bcb49ea235529a8.js +7 -0
- package/app/.next-cli-build/static/chunks/705-b7d7b61f41806f0d.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/playground/page-8a44865bda8d1138.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-1e4e44e8b9d5d986.js → page-0cb65a048e0ac91a.js} +3 -3
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-80f241f97889edc2.js +1 -0
- package/app/cli/.build-home/AppData/Roaming/extremerouter/db/backups/upgrade-0.7.3-to-0.7.4-0.7.4-20260722-105125/data.sqlite +0 -0
- package/app/cli/.build-home/AppData/Roaming/extremerouter/db/data.sqlite-shm +0 -0
- package/app/cli/.build-home/AppData/Roaming/extremerouter/db/data.sqlite-wal +0 -0
- package/app/package.json +3 -1
- package/app/public/providers/alibaba-cn.svg +11 -0
- package/app/public/providers/alibaba.svg +11 -0
- package/app/public/providers/forge.svg +9 -0
- package/app/public/providers/hcnsec.svg +10 -0
- package/app/public/providers/qwen-cloud-token-plan.svg +8 -0
- package/app/public/providers/qwen-cloud.svg +8 -0
- package/app/public/providers/tokenrouter.svg +15 -0
- package/package.json +1 -1
- package/app/.next-cli-build/server/chunks/8881.js +0 -1
- package/app/.next-cli-build/static/chunks/1321-118ecb4341892b2c.js +0 -1
- package/app/.next-cli-build/static/chunks/5497-d21171ba9c9fbb8d.js +0 -7
- package/app/.next-cli-build/static/chunks/705-197061b2f061280b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/playground/page-ba165a4326051b21.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-5fc4c9e1400d741e.js +0 -1
- /package/app/.next-cli-build/static/{3gc9MPTw0g8Wf0FjVPWJh → fsglpkHqAEeF3CQ_z_ynh}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{3gc9MPTw0g8Wf0FjVPWJh → fsglpkHqAEeF3CQ_z_ynh}/_ssgManifest.js +0 -0
- /package/app/cli/.build-home/AppData/Roaming/extremerouter/db/backups/{upgrade-0.6.8-to-0.6.9-0.6.9-20260713-141714 → upgrade-0.7.2-to-0.7.3-0.7.3-20260719-100408}/data.sqlite +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=6763,exports.ids=[6763],exports.modules={26763:(a,b,c)=>{c.d(b,{PROVIDER_PRICING:()=>e,calculateCostFromTokens:()=>i,getPricingForModel:()=>h});let d={"claude-opus-4-6":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-opus-4-5-20251101":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-haiku-4-5-20251001":{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25},"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:25,cached:7.5,reasoning:112.5,cache_creation:15},"claude-3-5-sonnet-20241022":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4.5":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"claude-opus-4.1":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.5":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.6":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-4":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-5-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.7":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.8":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-5-thinking":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-fable-5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"gpt-3.5-turbo":{input:.5,output:1.5,cached:.25,reasoning:2.25,cache_creation:.5},"gpt-4":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-5":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-mini":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5-codex":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5.1":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1-codex-mini-high":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.2":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.2-codex":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.3-codex":{input:6,output:24,cached:3,reasoning:36,cache_creation:6},"gpt-5.3-codex-xhigh":{input:10,output:40,cached:5,reasoning:60,cache_creation:10},"gpt-5.3-codex-high":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.3-codex-low":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.3-codex-none":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5.3-codex-spark":{input:3,output:12,cached:.3,reasoning:12,cache_creation:3},"gpt-5.4":{input:6,output:24,cached:3,reasoning:36,cache_creation:6},"gpt-5.4-mini":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.4-nano":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5.5":{input:7,output:28,cached:3.5,reasoning:42,cache_creation:7},"gpt-5.6-luna":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.6-sol":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.6-terra":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},o1:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15},"o1-mini":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-low":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-high":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-pro-agent":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash-agent":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-extra-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15},"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"kimi-k2":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2-thinking":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"kimi-k2.5":{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2},"kimi-k2.5-thinking":{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8},"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"deepseek-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-r1":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87,cache_creation:.435},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6v":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-5":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.8,cache_creation:.3},"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.5":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.7":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.5":{input:.6,output:2.4,cached:.3,reasoning:3.6,cache_creation:.6},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"oswe-vscode-prime":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"gpt-oss-120b-medium":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"vision-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"coder-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},e={gh:{"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}}},f=[{pattern:"*-codex-xhigh",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"*-codex-high",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-max",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-mini-*",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-mini",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-low",pricing:{input:4,output:16,cached:2,reasoning:24,cache_creation:4}},{pattern:"*-codex-none",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"*-codex-spark",pricing:{input:3,output:12,cached:.3,reasoning:12,cache_creation:3}},{pattern:"codex-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"*-codex",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"claude-opus-*",pricing:{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25}},{pattern:"claude-sonnet-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"claude-haiku-*",pricing:{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25}},{pattern:"claude-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"gemini-*-flash-lite",pricing:{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},{pattern:"gemini-*-flash",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*-pro",pricing:{input:2,output:12,cached:.25,reasoning:18,cache_creation:2}},{pattern:"gemini-3-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gemini-2.5-*",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gpt-5.3-*",pricing:{input:6,output:24,cached:3,reasoning:36,cache_creation:6}},{pattern:"gpt-5.2-*",pricing:{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5}},{pattern:"gpt-5.1-*",pricing:{input:4,output:16,cached:2,reasoning:24,cache_creation:4}},{pattern:"gpt-5-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"gpt-5*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"gpt-4o-*",pricing:{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15}},{pattern:"gpt-4o",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"gpt-4*",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"o1-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"o1",pricing:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15}},{pattern:"o3-*",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"o4-*",pricing:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},{pattern:"qwen3-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"kimi-*-thinking",pricing:{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8}},{pattern:"kimi-k2*",pricing:{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2}},{pattern:"kimi-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"deepseek-*reasoner*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-r*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-v*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"glm-5*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"glm-4*",pricing:{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},{pattern:"glm-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"MiniMax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"minimax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-code-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}}];function g(a,b){return RegExp("^"+a.split("*").map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")+"$","i").test(b)}function h(a,b){if(!b)return null;if(a&&e[a]?.[b])return e[a][b];let c=b.includes("/")?b.split("/").pop():b;if(d[c])return d[c];if(d[b])return d[b];for(let{pattern:a,pricing:d}of f)if(g(a,c)||g(a,b))return d;return null}function i(a,b){if(!a||!b)return 0;let c=0,d=a.prompt_tokens||a.input_tokens||0,e=a.cached_tokens||a.cache_read_input_tokens||0,f=a.cache_creation_input_tokens||0;c+=Math.max(0,d-e-f)*(b.input/1e6),e>0&&(c+=e*((b.cached||b.input)/1e6)),c+=(a.completion_tokens||a.output_tokens||0)*(b.output/1e6);let g=a.reasoning_tokens||0;return g>0&&(c+=g*((b.reasoning||b.output)/1e6)),f>0&&(c+=f*((b.cache_creation||b.input)/1e6)),c}}};
|
|
1
|
+
"use strict";exports.id=6763,exports.ids=[6763],exports.modules={26763:(a,b,c)=>{c.d(b,{PROVIDER_PRICING:()=>e,calculateCostFromTokens:()=>i,getPricingForModel:()=>h});let d={"claude-opus-4-6":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-opus-4-5-20251101":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-haiku-4-5-20251001":{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25},"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:25,cached:7.5,reasoning:112.5,cache_creation:15},"claude-3-5-sonnet-20241022":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4.5":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"claude-opus-4.1":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.5":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.6":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-4":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-5-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.7":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.8":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-5-thinking":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-fable-5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"gpt-3.5-turbo":{input:.5,output:1.5,cached:.25,reasoning:2.25,cache_creation:.5},"gpt-4":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-5":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-mini":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5-codex":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5.1":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1-codex-mini-high":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.2":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.2-codex":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.3-codex":{input:6,output:24,cached:3,reasoning:36,cache_creation:6},"gpt-5.3-codex-xhigh":{input:10,output:40,cached:5,reasoning:60,cache_creation:10},"gpt-5.3-codex-high":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.3-codex-low":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.3-codex-none":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5.3-codex-spark":{input:3,output:12,cached:.3,reasoning:12,cache_creation:3},"gpt-5.4":{input:6,output:24,cached:3,reasoning:36,cache_creation:6},"gpt-5.4-mini":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.4-nano":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5.5":{input:7,output:28,cached:3.5,reasoning:42,cache_creation:7},"gpt-5.6-luna":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.6-sol":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.6-terra":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},o1:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15},"o1-mini":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-low":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-high":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-pro-agent":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash-agent":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-extra-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15},"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"kimi-k2":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2-thinking":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"kimi-k2.5":{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2},"kimi-k2.5-thinking":{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8},"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"deepseek-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-r1":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87,cache_creation:.435},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6v":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-5":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.8,cache_creation:.3},"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.5":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.7":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.5":{input:.6,output:2.4,cached:.3,reasoning:3.6,cache_creation:.6},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"oswe-vscode-prime":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"gpt-oss-120b-medium":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"vision-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"coder-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},e={gh:{"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},forge:{"gpt-5.6-sol":{input:5,output:30},"gpt-5.6-terra":{input:2.5,output:15},"gpt-5.6-luna":{input:1,output:6},"gpt-5.5":{input:5,output:40},"gpt-5.3-codex":{input:1.75,output:14},"claude-opus-4-5-20251101":{input:5,output:25},"claude-sonnet-4-5-20250929":{input:3,output:15},"claude-haiku-4-5-20251001":{input:1,output:5},"claude-sonnet-4-6":{input:3,output:15},"claude-sonnet-4-6-thinking":{input:3,output:15},"claude-sonnet-5":{input:2,output:10},"claude-fable-5":{input:10,output:50},"grok-4.5":{input:2,output:6},"grok-4.3":{input:1.25,output:2.5},"grok-build-0.1":{input:1,output:2},"deepseek-r1":{input:.401,output:1.605},"deepseek-v4-flash":{input:.098,output:.196},"deepseek-v4-pro":{input:.304,output:.609},"deepseek-v3.2":{input:.2,output:.301},"deepseek-v3.1":{input:.401,output:1.204},"deepseek-v3":{input:.2,output:.802},"kimi-k3":{input:3,output:15},"kimi-k2.7-code":{input:.625,output:2.599},"kimi-k2.6":{input:.625,output:2.599},"kimi-k2.5":{input:.401,output:2.107},"gemini-3-pro-preview":{input:2,output:12},"gemini-3.5-flash":{input:1.5,output:9},"tencent/hy3":{input:.2,output:.8},"mimo-v2.5":{input:.1,output:.2},"mimo-v2.5-pro":{input:.3,output:.6},"MiniMax-M3":{input:.21,output:.84},"MiniMax-M2.5":{input:.21,output:.84},"glm-5.2":{input:.77,output:2.695}}},f=[{pattern:"*-codex-xhigh",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"*-codex-high",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-max",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-mini-*",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-mini",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-low",pricing:{input:4,output:16,cached:2,reasoning:24,cache_creation:4}},{pattern:"*-codex-none",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"*-codex-spark",pricing:{input:3,output:12,cached:.3,reasoning:12,cache_creation:3}},{pattern:"codex-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"*-codex",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"claude-opus-*",pricing:{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25}},{pattern:"claude-sonnet-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"claude-haiku-*",pricing:{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25}},{pattern:"claude-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"gemini-*-flash-lite",pricing:{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},{pattern:"gemini-*-flash",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*-pro",pricing:{input:2,output:12,cached:.25,reasoning:18,cache_creation:2}},{pattern:"gemini-3-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gemini-2.5-*",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gpt-5.3-*",pricing:{input:6,output:24,cached:3,reasoning:36,cache_creation:6}},{pattern:"gpt-5.2-*",pricing:{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5}},{pattern:"gpt-5.1-*",pricing:{input:4,output:16,cached:2,reasoning:24,cache_creation:4}},{pattern:"gpt-5-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"gpt-5*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"gpt-4o-*",pricing:{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15}},{pattern:"gpt-4o",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"gpt-4*",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"o1-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"o1",pricing:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15}},{pattern:"o3-*",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"o4-*",pricing:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},{pattern:"qwen3-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"kimi-*-thinking",pricing:{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8}},{pattern:"kimi-k2*",pricing:{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2}},{pattern:"kimi-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"deepseek-*reasoner*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-r*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-v*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"glm-5*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"glm-4*",pricing:{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},{pattern:"glm-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"MiniMax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"minimax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-code-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}}];function g(a,b){return RegExp("^"+a.split("*").map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")+"$","i").test(b)}function h(a,b){if(!b)return null;if(a&&e[a]?.[b])return e[a][b];let c=b.includes("/")?b.split("/").pop():b;if(d[c])return d[c];if(d[b])return d[b];for(let{pattern:a,pricing:d}of f)if(g(a,c)||g(a,b))return d;return null}function i(a,b){if(!a||!b)return 0;let c=0,d=a.prompt_tokens||a.input_tokens||0,e=a.cached_tokens||a.cache_read_input_tokens||0,f=a.cache_creation_input_tokens||0;c+=Math.max(0,d-e-f)*(b.input/1e6),e>0&&(c+=e*((b.cached||b.input)/1e6)),c+=(a.completion_tokens||a.output_tokens||0)*(b.output/1e6);let g=a.reasoning_tokens||0;return g>0&&(c+=g*((b.reasoning||b.output)/1e6)),f>0&&(c+=f*((b.cache_creation||b.input)/1e6)),c}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=6777,exports.ids=[6777],exports.modules={17660:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({children:a,title:b,subtitle:c,icon:g,action:h,padding:i="md",hover:j=!1,elev:k=!1,className:l,...m}){return(0,d.jsxs)("div",{className:(0,e.cn)("bg-panel border border-border-subtle text-text-main",k?"rounded-panel shadow-[var(--shadow-elev)]":"rounded-panel shadow-[var(--shadow-soft)]",j&&"hover:border-primary/35 hover:bg-panel-elev hover:shadow-[var(--shadow-warm)] transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-5",lg:"p-6"}[i],l),...m,children:[(b||h)&&(0,d.jsxs)("div",{className:"mb-4 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[g&&(0,d.jsx)("div",{className:"flex size-9 items-center justify-center rounded-brand bg-primary/10 text-primary ring-1 ring-primary/15",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:g})}),(0,d.jsxs)("div",{className:"min-w-0",children:[b&&(0,d.jsx)("h3",{className:"truncate text-sm font-semibold tracking-tight text-text-main",children:b}),c&&(0,d.jsx)("p",{className:"mt-0.5 truncate text-xs text-text-muted",children:c})]})]}),h]}),a]})}f.Section=function({children:a,className:b,...c}){return(0,d.jsx)("div",{className:(0,e.cn)("rounded-brand border border-border-subtle bg-surface-2 p-4",b),...c,children:a})},f.Row=function({children:a,className:b,...c}){return(0,d.jsx)("div",{className:(0,e.cn)("-mx-3 border-b border-border-subtle px-3 py-3 transition-colors last:border-b-0","hover:bg-surface-2/70",b),...c,children:a})},f.ListItem=function({children:a,actions:b,className:c,...f}){return(0,d.jsxs)("div",{className:(0,e.cn)("group -mx-3 flex items-center justify-between border-b border-border-subtle px-3 py-3 transition-colors last:border-b-0","hover:bg-surface-2/70",c),...f,children:[(0,d.jsx)("div",{className:"min-w-0 flex-1",children:a}),b&&(0,d.jsx)("div",{className:"flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:b})]})}},18982:(a,b,c)=>{c.d(b,{BD:()=>j,PS:()=>h,ad:()=>i,gH:()=>g,uy:()=>k});let d={"claude-opus-4-6":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-opus-4-5-20251101":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-haiku-4-5-20251001":{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25},"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:25,cached:7.5,reasoning:112.5,cache_creation:15},"claude-3-5-sonnet-20241022":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4.5":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"claude-opus-4.1":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.5":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.6":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-4":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-5-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.7":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.8":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-5-thinking":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-fable-5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"gpt-3.5-turbo":{input:.5,output:1.5,cached:.25,reasoning:2.25,cache_creation:.5},"gpt-4":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-5":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-mini":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5-codex":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5.1":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1-codex-mini-high":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.2":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.2-codex":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.3-codex":{input:6,output:24,cached:3,reasoning:36,cache_creation:6},"gpt-5.3-codex-xhigh":{input:10,output:40,cached:5,reasoning:60,cache_creation:10},"gpt-5.3-codex-high":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.3-codex-low":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.3-codex-none":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5.3-codex-spark":{input:3,output:12,cached:.3,reasoning:12,cache_creation:3},"gpt-5.4":{input:6,output:24,cached:3,reasoning:36,cache_creation:6},"gpt-5.4-mini":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.4-nano":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5.5":{input:7,output:28,cached:3.5,reasoning:42,cache_creation:7},"gpt-5.6-luna":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.6-sol":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.6-terra":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},o1:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15},"o1-mini":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-low":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-high":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-pro-agent":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash-agent":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-extra-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15},"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"kimi-k2":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2-thinking":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"kimi-k2.5":{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2},"kimi-k2.5-thinking":{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8},"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"deepseek-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-r1":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87,cache_creation:.435},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6v":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-5":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.8,cache_creation:.3},"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.5":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.7":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.5":{input:.6,output:2.4,cached:.3,reasoning:3.6,cache_creation:.6},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"oswe-vscode-prime":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"gpt-oss-120b-medium":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"vision-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"coder-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},e={gh:{"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}}},f=[{pattern:"*-codex-xhigh",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"*-codex-high",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-max",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-mini-*",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-mini",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-low",pricing:{input:4,output:16,cached:2,reasoning:24,cache_creation:4}},{pattern:"*-codex-none",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"*-codex-spark",pricing:{input:3,output:12,cached:.3,reasoning:12,cache_creation:3}},{pattern:"codex-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"*-codex",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"claude-opus-*",pricing:{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25}},{pattern:"claude-sonnet-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"claude-haiku-*",pricing:{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25}},{pattern:"claude-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"gemini-*-flash-lite",pricing:{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},{pattern:"gemini-*-flash",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*-pro",pricing:{input:2,output:12,cached:.25,reasoning:18,cache_creation:2}},{pattern:"gemini-3-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gemini-2.5-*",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gpt-5.3-*",pricing:{input:6,output:24,cached:3,reasoning:36,cache_creation:6}},{pattern:"gpt-5.2-*",pricing:{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5}},{pattern:"gpt-5.1-*",pricing:{input:4,output:16,cached:2,reasoning:24,cache_creation:4}},{pattern:"gpt-5-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"gpt-5*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"gpt-4o-*",pricing:{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15}},{pattern:"gpt-4o",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"gpt-4*",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"o1-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"o1",pricing:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15}},{pattern:"o3-*",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"o4-*",pricing:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},{pattern:"qwen3-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"kimi-*-thinking",pricing:{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8}},{pattern:"kimi-k2*",pricing:{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2}},{pattern:"kimi-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"deepseek-*reasoner*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-r*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-v*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"glm-5*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"glm-4*",pricing:{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},{pattern:"glm-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"MiniMax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"minimax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-code-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}}];function g(a,b){return RegExp("^"+a.split("*").map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")+"$","i").test(b)}function h(a,b){if(!b)return null;if(a&&e[a]?.[b])return e[a][b];let c=b.includes("/")?b.split("/").pop():b;if(d[c])return d[c];if(d[b])return d[b];for(let{pattern:a,pricing:d}of f)if(g(a,c)||g(a,b))return d;return null}function i(){return e}function j(a){return null==a||isNaN(a)?"$0.00":`$${a.toFixed(2)}`}function k(a,b){if(!a||!b)return 0;let c=0,d=a.prompt_tokens||a.input_tokens||0,e=a.cached_tokens||a.cache_read_input_tokens||0,f=a.cache_creation_input_tokens||0;c+=Math.max(0,d-e-f)*(b.input/1e6),e>0&&(c+=e*((b.cached||b.input)/1e6)),c+=(a.completion_tokens||a.output_tokens||0)*(b.output/1e6);let g=a.reasoning_tokens||0;return g>0&&(c+=g*((b.reasoning||b.output)/1e6)),f>0&&(c+=f*((b.cache_creation||b.input)/1e6)),c}},71404:(a,b,c)=>{c.d(b,{cn:()=>d});function d(...a){return a.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}}};
|
|
1
|
+
"use strict";exports.id=6777,exports.ids=[6777],exports.modules={17660:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({children:a,title:b,subtitle:c,icon:g,action:h,padding:i="md",hover:j=!1,elev:k=!1,className:l,...m}){return(0,d.jsxs)("div",{className:(0,e.cn)("bg-panel border border-border-subtle text-text-main",k?"rounded-panel shadow-[var(--shadow-elev)]":"rounded-panel shadow-[var(--shadow-soft)]",j&&"hover:border-primary/35 hover:bg-panel-elev hover:shadow-[var(--shadow-warm)] transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-5",lg:"p-6"}[i],l),...m,children:[(b||h)&&(0,d.jsxs)("div",{className:"mb-4 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[g&&(0,d.jsx)("div",{className:"flex size-9 items-center justify-center rounded-brand bg-primary/10 text-primary ring-1 ring-primary/15",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:g})}),(0,d.jsxs)("div",{className:"min-w-0",children:[b&&(0,d.jsx)("h3",{className:"truncate text-sm font-semibold tracking-tight text-text-main",children:b}),c&&(0,d.jsx)("p",{className:"mt-0.5 truncate text-xs text-text-muted",children:c})]})]}),h]}),a]})}f.Section=function({children:a,className:b,...c}){return(0,d.jsx)("div",{className:(0,e.cn)("rounded-brand border border-border-subtle bg-surface-2 p-4",b),...c,children:a})},f.Row=function({children:a,className:b,...c}){return(0,d.jsx)("div",{className:(0,e.cn)("-mx-3 border-b border-border-subtle px-3 py-3 transition-colors last:border-b-0","hover:bg-surface-2/70",b),...c,children:a})},f.ListItem=function({children:a,actions:b,className:c,...f}){return(0,d.jsxs)("div",{className:(0,e.cn)("group -mx-3 flex items-center justify-between border-b border-border-subtle px-3 py-3 transition-colors last:border-b-0","hover:bg-surface-2/70",c),...f,children:[(0,d.jsx)("div",{className:"min-w-0 flex-1",children:a}),b&&(0,d.jsx)("div",{className:"flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:b})]})}},18982:(a,b,c)=>{c.d(b,{BD:()=>j,PS:()=>h,ad:()=>i,gH:()=>g,uy:()=>k});let d={"claude-opus-4-6":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-opus-4-5-20251101":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-haiku-4-5-20251001":{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25},"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:25,cached:7.5,reasoning:112.5,cache_creation:15},"claude-3-5-sonnet-20241022":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4.5":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"claude-opus-4.1":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.5":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.6":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-4":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-5-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.7":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.8":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-5-thinking":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-fable-5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"gpt-3.5-turbo":{input:.5,output:1.5,cached:.25,reasoning:2.25,cache_creation:.5},"gpt-4":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-5":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-mini":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5-codex":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5.1":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1-codex-mini-high":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.2":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.2-codex":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.3-codex":{input:6,output:24,cached:3,reasoning:36,cache_creation:6},"gpt-5.3-codex-xhigh":{input:10,output:40,cached:5,reasoning:60,cache_creation:10},"gpt-5.3-codex-high":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.3-codex-low":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.3-codex-none":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5.3-codex-spark":{input:3,output:12,cached:.3,reasoning:12,cache_creation:3},"gpt-5.4":{input:6,output:24,cached:3,reasoning:36,cache_creation:6},"gpt-5.4-mini":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.4-nano":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5.5":{input:7,output:28,cached:3.5,reasoning:42,cache_creation:7},"gpt-5.6-luna":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.6-sol":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.6-terra":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},o1:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15},"o1-mini":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-low":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-high":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-pro-agent":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash-agent":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-extra-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15},"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"kimi-k2":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2-thinking":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"kimi-k2.5":{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2},"kimi-k2.5-thinking":{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8},"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"deepseek-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-r1":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87,cache_creation:.435},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6v":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-5":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.8,cache_creation:.3},"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.5":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.7":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.5":{input:.6,output:2.4,cached:.3,reasoning:3.6,cache_creation:.6},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"oswe-vscode-prime":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"gpt-oss-120b-medium":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"vision-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"coder-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},e={gh:{"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},forge:{"gpt-5.6-sol":{input:5,output:30},"gpt-5.6-terra":{input:2.5,output:15},"gpt-5.6-luna":{input:1,output:6},"gpt-5.5":{input:5,output:40},"gpt-5.3-codex":{input:1.75,output:14},"claude-opus-4-5-20251101":{input:5,output:25},"claude-sonnet-4-5-20250929":{input:3,output:15},"claude-haiku-4-5-20251001":{input:1,output:5},"claude-sonnet-4-6":{input:3,output:15},"claude-sonnet-4-6-thinking":{input:3,output:15},"claude-sonnet-5":{input:2,output:10},"claude-fable-5":{input:10,output:50},"grok-4.5":{input:2,output:6},"grok-4.3":{input:1.25,output:2.5},"grok-build-0.1":{input:1,output:2},"deepseek-r1":{input:.401,output:1.605},"deepseek-v4-flash":{input:.098,output:.196},"deepseek-v4-pro":{input:.304,output:.609},"deepseek-v3.2":{input:.2,output:.301},"deepseek-v3.1":{input:.401,output:1.204},"deepseek-v3":{input:.2,output:.802},"kimi-k3":{input:3,output:15},"kimi-k2.7-code":{input:.625,output:2.599},"kimi-k2.6":{input:.625,output:2.599},"kimi-k2.5":{input:.401,output:2.107},"gemini-3-pro-preview":{input:2,output:12},"gemini-3.5-flash":{input:1.5,output:9},"tencent/hy3":{input:.2,output:.8},"mimo-v2.5":{input:.1,output:.2},"mimo-v2.5-pro":{input:.3,output:.6},"MiniMax-M3":{input:.21,output:.84},"MiniMax-M2.5":{input:.21,output:.84},"glm-5.2":{input:.77,output:2.695}}},f=[{pattern:"*-codex-xhigh",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"*-codex-high",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-max",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-mini-*",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-mini",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-low",pricing:{input:4,output:16,cached:2,reasoning:24,cache_creation:4}},{pattern:"*-codex-none",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"*-codex-spark",pricing:{input:3,output:12,cached:.3,reasoning:12,cache_creation:3}},{pattern:"codex-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"*-codex",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"claude-opus-*",pricing:{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25}},{pattern:"claude-sonnet-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"claude-haiku-*",pricing:{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25}},{pattern:"claude-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"gemini-*-flash-lite",pricing:{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},{pattern:"gemini-*-flash",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*-pro",pricing:{input:2,output:12,cached:.25,reasoning:18,cache_creation:2}},{pattern:"gemini-3-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gemini-2.5-*",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gpt-5.3-*",pricing:{input:6,output:24,cached:3,reasoning:36,cache_creation:6}},{pattern:"gpt-5.2-*",pricing:{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5}},{pattern:"gpt-5.1-*",pricing:{input:4,output:16,cached:2,reasoning:24,cache_creation:4}},{pattern:"gpt-5-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"gpt-5*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"gpt-4o-*",pricing:{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15}},{pattern:"gpt-4o",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"gpt-4*",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"o1-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"o1",pricing:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15}},{pattern:"o3-*",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"o4-*",pricing:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},{pattern:"qwen3-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"kimi-*-thinking",pricing:{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8}},{pattern:"kimi-k2*",pricing:{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2}},{pattern:"kimi-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"deepseek-*reasoner*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-r*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-v*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"glm-5*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"glm-4*",pricing:{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},{pattern:"glm-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"MiniMax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"minimax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-code-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}}];function g(a,b){return RegExp("^"+a.split("*").map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")+"$","i").test(b)}function h(a,b){if(!b)return null;if(a&&e[a]?.[b])return e[a][b];let c=b.includes("/")?b.split("/").pop():b;if(d[c])return d[c];if(d[b])return d[b];for(let{pattern:a,pricing:d}of f)if(g(a,c)||g(a,b))return d;return null}function i(){return e}function j(a){return null==a||isNaN(a)?"$0.00":`$${a.toFixed(2)}`}function k(a,b){if(!a||!b)return 0;let c=0,d=a.prompt_tokens||a.input_tokens||0,e=a.cached_tokens||a.cache_read_input_tokens||0,f=a.cache_creation_input_tokens||0;c+=Math.max(0,d-e-f)*(b.input/1e6),e>0&&(c+=e*((b.cached||b.input)/1e6)),c+=(a.completion_tokens||a.output_tokens||0)*(b.output/1e6);let g=a.reasoning_tokens||0;return g>0&&(c+=g*((b.reasoning||b.output)/1e6)),f>0&&(c+=f*((b.cache_creation||b.input)/1e6)),c}},71404:(a,b,c)=>{c.d(b,{cn:()=>d});function d(...a){return a.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=8238,exports.ids=[615,5699,8238],exports.modules={30869:(a,b,c)=>{c.d(b,{UY:()=>h,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g,oc:()=>i});var d=c(39006),e=c(40615),f=c(81329);d.rE;let g={npmPackageName:"@rsalmn/extremerouter",installCmd:"npm i -g @rsalmn/extremerouter",installCmdLatest:"npm i -g @rsalmn/extremerouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:20128},h={maxLines:200,pollIntervalMs:1e3},i={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}}},35024:(a,b,c)=>{c.d(b,{Ak:()=>e,Yg:()=>h,sr:()=>d.sr,xq:()=>d.xq});var d=c(26070);function e(a){return(a?.providerSpecificData?.baseUrl?.trim()||"http://localhost:11434").replace(/\/$/,"")}let f=d.xq["xiaomi-tokenplan"]?.regions||{},g=d.xq["xiaomi-tokenplan"]?.defaultRegion;function h(a){return f[a?.providerSpecificData?.region]||f[g]}},38238:(a,b,c)=>{c.d(b,{P:()=>h});var d=c(89718),e=c(30869),f=c(54603);async function g(){let a=null;try{let b=await (0,d.PX)();a=b.find(a=>!1!==a.isActive)?.key||null}catch{}let b={"Content-Type":"application/json"};return a&&(b.Authorization=`Bearer ${a}`),b["x-9r-cli-token"]=await (0,f.Xj)("9r-cli-auth"),b}async function h(a,b,c=`http://127.0.0.1:${process.env.PORT||e.h0.appPort}`){let d=await g(),f=Date.now();if("embedding"===b){let b=await fetch(`${c}/api/v1/embeddings`,{method:"POST",headers:d,body:JSON.stringify({model:a,input:"test"}),signal:AbortSignal.timeout(15e3)}),e=Date.now()-f,g=await b.text().catch(()=>""),h=null;try{h=g?JSON.parse(g):null}catch{}if(!b.ok){let a=h?.error?.message||h?.error||g;return{ok:!1,latencyMs:e,error:`HTTP ${b.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:b.status}}return Array.isArray(h?.data)&&h.data.length>0&&Array.isArray(h.data[0]?.embedding)?{ok:!0,latencyMs:e,error:null,status:b.status}:{ok:!1,latencyMs:e,status:b.status,error:"Provider returned no embedding data"}}if("image"===b){let b=await fetch(`${c}/api/v1/images/generations`,{method:"POST",headers:d,body:JSON.stringify({model:a,prompt:"test"}),signal:AbortSignal.timeout(15e3)}),e=Date.now()-f,g=await b.text().catch(()=>""),h=null;try{h=g?JSON.parse(g):null}catch{}if(!b.ok){let a=h?.error?.message||h?.msg||h?.message||h?.error||g;return{ok:!1,latencyMs:e,error:`HTTP ${b.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:b.status}}return Array.isArray(h?.data)&&h.data.length>0?{ok:!0,latencyMs:e,error:null,status:b.status}:{ok:!1,latencyMs:e,status:b.status,error:"Provider returned no image data for this model"}}if("stt"===b){let b,e,g,h,i=new FormData,j=(g=new DataView(e=new ArrayBuffer(44+(b=2*Math.max(1,Math.floor(4e3))))),(h=(a,b)=>{for(let c=0;c<b.length;c+=1)g.setUint8(a+c,b.charCodeAt(c))})(0,"RIFF"),g.setUint32(4,36+b,!0),h(8,"WAVE"),h(12,"fmt "),g.setUint32(16,16,!0),g.setUint16(20,1,!0),g.setUint16(22,1,!0),g.setUint32(24,16e3,!0),g.setUint32(28,32e3,!0),g.setUint16(32,2,!0),g.setUint16(34,16,!0),h(36,"data"),g.setUint32(40,b,!0),new Blob([e],{type:"audio/wav"}));i.append("file",j,"test.wav"),i.append("model",a);let k=await fetch(`${c}/api/v1/audio/transcriptions`,{method:"POST",headers:Object.fromEntries(Object.entries(d).filter(([a])=>"content-type"!==a.toLowerCase())),body:i,signal:AbortSignal.timeout(15e3)}),l=Date.now()-f,m=await k.text().catch(()=>""),n=null;try{n=m?JSON.parse(m):null}catch{}if(!k.ok){let a=n?.error?.message||n?.msg||n?.message||n?.error||m;return{ok:!1,latencyMs:l,error:`HTTP ${k.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:k.status}}return("string"==typeof n?.text?n.text:"").trim()?{ok:!0,latencyMs:l,error:null,status:k.status}:{ok:!1,latencyMs:l,status:k.status,error:"Provider returned no transcription text for this model"}}let i=await fetch(`${c}/api/v1/chat/completions`,{method:"POST",headers:d,body:JSON.stringify({model:a,max_tokens:16,stream:!1,messages:[{role:"user",content:"hi"}]}),signal:AbortSignal.timeout(15e3)}),j=Date.now()-f,k=await i.text().catch(()=>""),l=null;try{l=k?JSON.parse(k):null}catch{}if(!i.ok){let a=l?.error?.message||l?.msg||l?.message||l?.error||k;return{ok:!1,latencyMs:j,error:`HTTP ${i.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:i.status}}let m=l?.status,n=l?.msg||l?.message;if(null!=m&&"200"!==String(m)&&"0"!==String(m)&&n)return{ok:!1,latencyMs:j,status:i.status,error:`Provider status ${m}: ${String(n).slice(0,240)}`};if(l?.error){let a=l?.error?.message||l?.error||"Provider returned an error";return{ok:!1,latencyMs:j,status:i.status,error:String(a).slice(0,240)}}let o=Array.isArray(l?.choices)&&l.choices.length>0?l:l?.data&&"object"==typeof l.data?l.data:l;return Array.isArray(o?.choices)&&o.choices.length>0?{ok:!0,latencyMs:j,error:null,status:i.status}:{ok:!1,latencyMs:j,status:i.status,error:"Provider returned no completion choices for this model"}}},39006:a=>{a.exports={rE:"0.7.3"}},40615:(a,b,c)=>{c.d(b,{AI_PROVIDERS:()=>s,js:()=>w,DI:()=>n,fg:()=>k,Pd:()=>o,IS:()=>h,nJ:()=>i,zN:()=>j,JH:()=>m,jO:()=>y,wb:()=>x,br:()=>l,wG:()=>v,zt:()=>t,gb:()=>q,gC:()=>r,mq:()=>p,rs:()=>u});var d=c(91237);let e="⚠️ Risk Notice: This provider uses a subscription/OAuth session not officially licensed for proxy/router use. Account may be restricted or banned. Use at your own risk.";Object.fromEntries(d.A.filter(a=>a.display).map(a=>{let b;return[a.id,"RISK_NOTICE"===(b=a.display).deprecationNotice?{...b,deprecationNotice:e}:b]}));let f=["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","modelsFetcher","mediaPriority","hiddenKinds"],g=a=>Object.fromEntries(d.A.filter(b=>b.category===a).map(a=>[a.id,function(a){let b={};for(let c of(a.media&&Object.assign(b,a.media),f))void 0!==a[c]&&(b[c]=a[c]);let c={...a.display||{}};return"RISK_NOTICE"===c.deprecationNotice&&(c.deprecationNotice=e),{...c,id:a.id,alias:a.uiAlias||a.alias,...a.hidden?{hidden:!0}:{},...b,...void 0!==a.priority?{priority:a.priority}:{},...a.hasFree?{hasFree:!0}:{},...a.thinkingConfig?{thinkingConfig:a.thinkingConfig}:{},...a.regions?{regions:a.regions,defaultRegion:a.defaultRegion}:{},...a.hasProviderSpecificData?{hasProviderSpecificData:!0}:{},...a.noAuth?{noAuth:!0}:{},...a.passthroughModels?{passthroughModels:!0}:{},...a.hasOAuth?{hasOAuth:!0}:{},...a.authModes?{authModes:a.authModes}:{},...a.authType?{authType:a.authType}:{},...a.authHint?{authHint:a.authHint}:{},...a.comingSoon?{comingSoon:!0}:{}}}(a)])),h=g("free"),i=g("freeTier"),j=g("oauth"),k=g("apikey"),l=g("webCookie"),m="openai-compatible-",n="anthropic-compatible-",o="custom-embedding-";function p(a){return"string"==typeof a&&a.startsWith(m)}function q(a){return"string"==typeof a&&a.startsWith(n)}function r(a){return"string"==typeof a&&a.startsWith(o)}let s={...h,...i,...j,...k,...l};function t(a){for(let b of Object.values(s))if(b.alias===a||b.id===a)return b;return null}function u(a){let b=t(a);return b?.id||a}function v(a){let b=s[a];return b?.alias||a}let w=Object.values(s).reduce((a,b)=>(a[b.alias]=b.id,a),{});Object.values(s).reduce((a,b)=>(a[b.id]=b.alias,a),{});let x=d.A.filter(a=>a.features?.usage).map(a=>a.id),y=d.A.filter(a=>a.features?.usageApikey).map(a=>a.id)},45699:(a,b,c)=>{c.d(b,{Xg:()=>o,PROVIDER_MODELS:()=>f.vq,fZ:()=>j,cY:()=>q,ux:()=>k,OA:()=>l,kt:()=>m,KC:()=>p,SM:()=>i});var d=c(35024),e=c(91237),f=c(26070),g=c(99511);let h="-review";function i(a){return f.vq[a]||[]}function j(a){let b=f.vq[a];return b?.[0]?.id||null}function k(a,b){let c=f.vq[a];return c?(0,g.gr)(c.find(a=>a.id===b)):null}function l(a,b){let c=f.vq[a];if(!c)return null;let d=c.find(a=>a.id===b);return d?.kind||d?.type||null}function m(a,b){let c=f.vq[a],d=c?.find(a=>a.id===b);return d?.upstreamModelId?d.upstreamModelId:"cx"===a&&"string"==typeof b&&b.endsWith(h)?b.slice(0,-h.length):b}let n=Object.fromEntries(e.A.filter(a=>a.alias&&a.alias!==a.id).map(a=>[a.id,a.alias])),o=Object.fromEntries(Object.keys(d.xq).map(a=>[a,n[a]||a]));function p(a){let b=o[a]||a;return f.vq[b]||[]}function q(a,b){return(0,g.g5)(f.vq[a]?.find(a=>a.id===b))}},54603:(a,b,c)=>{c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(58273);let l=h().join(k.n,"machine-id"),m=h().join(k.n,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.n,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},81329:(a,b,c)=>{c.d(b,{CP:()=>f,Xg:()=>d.Xg,eh:()=>e,vq:()=>d.PROVIDER_MODELS});var d=c(45699);Object.entries(c(40615).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.PROVIDER_MODELS).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name}))),f=(a,b=null)=>a?.kind||a?.type||b},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mY:()=>d.mY,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(39422)}};
|
|
1
|
+
"use strict";exports.id=8238,exports.ids=[615,5699,8238],exports.modules={30869:(a,b,c)=>{c.d(b,{UY:()=>h,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g,oc:()=>i});var d=c(39006),e=c(40615),f=c(81329);d.rE;let g={npmPackageName:"@rsalmn/extremerouter",installCmd:"npm i -g @rsalmn/extremerouter",installCmdLatest:"npm i -g @rsalmn/extremerouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:20128},h={maxLines:200,pollIntervalMs:1e3},i={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}}},35024:(a,b,c)=>{c.d(b,{Ak:()=>e,Yg:()=>h,sr:()=>d.sr,xq:()=>d.xq});var d=c(26070);function e(a){return(a?.providerSpecificData?.baseUrl?.trim()||"http://localhost:11434").replace(/\/$/,"")}let f=d.xq["xiaomi-tokenplan"]?.regions||{},g=d.xq["xiaomi-tokenplan"]?.defaultRegion;function h(a){return f[a?.providerSpecificData?.region]||f[g]}},38238:(a,b,c)=>{c.d(b,{P:()=>h});var d=c(89718),e=c(30869),f=c(54603);async function g(){let a=null;try{let b=await (0,d.PX)();a=b.find(a=>!1!==a.isActive)?.key||null}catch{}let b={"Content-Type":"application/json"};return a&&(b.Authorization=`Bearer ${a}`),b["x-9r-cli-token"]=await (0,f.Xj)("9r-cli-auth"),b}async function h(a,b,c=`http://127.0.0.1:${process.env.PORT||e.h0.appPort}`){let d=await g(),f=Date.now();if("embedding"===b){let b=await fetch(`${c}/api/v1/embeddings`,{method:"POST",headers:d,body:JSON.stringify({model:a,input:"test"}),signal:AbortSignal.timeout(15e3)}),e=Date.now()-f,g=await b.text().catch(()=>""),h=null;try{h=g?JSON.parse(g):null}catch{}if(!b.ok){let a=h?.error?.message||h?.error||g;return{ok:!1,latencyMs:e,error:`HTTP ${b.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:b.status}}return Array.isArray(h?.data)&&h.data.length>0&&Array.isArray(h.data[0]?.embedding)?{ok:!0,latencyMs:e,error:null,status:b.status}:{ok:!1,latencyMs:e,status:b.status,error:"Provider returned no embedding data"}}if("image"===b){let b=await fetch(`${c}/api/v1/images/generations`,{method:"POST",headers:d,body:JSON.stringify({model:a,prompt:"test"}),signal:AbortSignal.timeout(15e3)}),e=Date.now()-f,g=await b.text().catch(()=>""),h=null;try{h=g?JSON.parse(g):null}catch{}if(!b.ok){let a=h?.error?.message||h?.msg||h?.message||h?.error||g;return{ok:!1,latencyMs:e,error:`HTTP ${b.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:b.status}}return Array.isArray(h?.data)&&h.data.length>0?{ok:!0,latencyMs:e,error:null,status:b.status}:{ok:!1,latencyMs:e,status:b.status,error:"Provider returned no image data for this model"}}if("stt"===b){let b,e,g,h,i=new FormData,j=(g=new DataView(e=new ArrayBuffer(44+(b=2*Math.max(1,Math.floor(4e3))))),(h=(a,b)=>{for(let c=0;c<b.length;c+=1)g.setUint8(a+c,b.charCodeAt(c))})(0,"RIFF"),g.setUint32(4,36+b,!0),h(8,"WAVE"),h(12,"fmt "),g.setUint32(16,16,!0),g.setUint16(20,1,!0),g.setUint16(22,1,!0),g.setUint32(24,16e3,!0),g.setUint32(28,32e3,!0),g.setUint16(32,2,!0),g.setUint16(34,16,!0),h(36,"data"),g.setUint32(40,b,!0),new Blob([e],{type:"audio/wav"}));i.append("file",j,"test.wav"),i.append("model",a);let k=await fetch(`${c}/api/v1/audio/transcriptions`,{method:"POST",headers:Object.fromEntries(Object.entries(d).filter(([a])=>"content-type"!==a.toLowerCase())),body:i,signal:AbortSignal.timeout(15e3)}),l=Date.now()-f,m=await k.text().catch(()=>""),n=null;try{n=m?JSON.parse(m):null}catch{}if(!k.ok){let a=n?.error?.message||n?.msg||n?.message||n?.error||m;return{ok:!1,latencyMs:l,error:`HTTP ${k.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:k.status}}return("string"==typeof n?.text?n.text:"").trim()?{ok:!0,latencyMs:l,error:null,status:k.status}:{ok:!1,latencyMs:l,status:k.status,error:"Provider returned no transcription text for this model"}}let i=await fetch(`${c}/api/v1/chat/completions`,{method:"POST",headers:d,body:JSON.stringify({model:a,max_tokens:16,stream:!1,messages:[{role:"user",content:"hi"}]}),signal:AbortSignal.timeout(15e3)}),j=Date.now()-f,k=await i.text().catch(()=>""),l=null;try{l=k?JSON.parse(k):null}catch{}if(!i.ok){let a=l?.error?.message||l?.msg||l?.message||l?.error||k;return{ok:!1,latencyMs:j,error:`HTTP ${i.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:i.status}}let m=l?.status,n=l?.msg||l?.message;if(null!=m&&"200"!==String(m)&&"0"!==String(m)&&n)return{ok:!1,latencyMs:j,status:i.status,error:`Provider status ${m}: ${String(n).slice(0,240)}`};if(l?.error){let a=l?.error?.message||l?.error||"Provider returned an error";return{ok:!1,latencyMs:j,status:i.status,error:String(a).slice(0,240)}}let o=Array.isArray(l?.choices)&&l.choices.length>0?l:l?.data&&"object"==typeof l.data?l.data:l;return Array.isArray(o?.choices)&&o.choices.length>0?{ok:!0,latencyMs:j,error:null,status:i.status}:{ok:!1,latencyMs:j,status:i.status,error:"Provider returned no completion choices for this model"}}},39006:a=>{a.exports={rE:"0.7.4"}},40615:(a,b,c)=>{c.d(b,{AI_PROVIDERS:()=>s,js:()=>w,DI:()=>n,fg:()=>k,Pd:()=>o,IS:()=>h,nJ:()=>i,zN:()=>j,JH:()=>m,jO:()=>y,wb:()=>x,br:()=>l,wG:()=>v,zt:()=>t,gb:()=>q,gC:()=>r,mq:()=>p,rs:()=>u});var d=c(64367);let e="⚠️ Risk Notice: This provider uses a subscription/OAuth session not officially licensed for proxy/router use. Account may be restricted or banned. Use at your own risk.";Object.fromEntries(d.A.filter(a=>a.display).map(a=>{let b;return[a.id,"RISK_NOTICE"===(b=a.display).deprecationNotice?{...b,deprecationNotice:e}:b]}));let f=["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","modelsFetcher","mediaPriority","hiddenKinds"],g=a=>Object.fromEntries(d.A.filter(b=>b.category===a).map(a=>[a.id,function(a){let b={};for(let c of(a.media&&Object.assign(b,a.media),f))void 0!==a[c]&&(b[c]=a[c]);let c={...a.display||{}};return"RISK_NOTICE"===c.deprecationNotice&&(c.deprecationNotice=e),{...c,id:a.id,alias:a.uiAlias||a.alias,...a.hidden?{hidden:!0}:{},...b,...void 0!==a.priority?{priority:a.priority}:{},...a.hasFree?{hasFree:!0}:{},...a.thinkingConfig?{thinkingConfig:a.thinkingConfig}:{},...a.regions?{regions:a.regions,defaultRegion:a.defaultRegion}:{},...a.hasProviderSpecificData?{hasProviderSpecificData:!0}:{},...a.noAuth?{noAuth:!0}:{},...a.passthroughModels?{passthroughModels:!0}:{},...a.hasOAuth?{hasOAuth:!0}:{},...a.authModes?{authModes:a.authModes}:{},...a.authType?{authType:a.authType}:{},...a.authHint?{authHint:a.authHint}:{},...a.comingSoon?{comingSoon:!0}:{}}}(a)])),h=g("free"),i=g("freeTier"),j=g("oauth"),k=g("apikey"),l=g("webCookie"),m="openai-compatible-",n="anthropic-compatible-",o="custom-embedding-";function p(a){return"string"==typeof a&&a.startsWith(m)}function q(a){return"string"==typeof a&&a.startsWith(n)}function r(a){return"string"==typeof a&&a.startsWith(o)}let s={...h,...i,...j,...k,...l};function t(a){for(let b of Object.values(s))if(b.alias===a||b.id===a)return b;return null}function u(a){let b=t(a);return b?.id||a}function v(a){let b=s[a];return b?.alias||a}let w=Object.values(s).reduce((a,b)=>(a[b.alias]=b.id,a),{});Object.values(s).reduce((a,b)=>(a[b.id]=b.alias,a),{});let x=d.A.filter(a=>a.features?.usage).map(a=>a.id),y=d.A.filter(a=>a.features?.usageApikey).map(a=>a.id)},45699:(a,b,c)=>{c.d(b,{Xg:()=>o,PROVIDER_MODELS:()=>f.vq,fZ:()=>j,cY:()=>q,ux:()=>k,OA:()=>l,kt:()=>m,KC:()=>p,SM:()=>i});var d=c(35024),e=c(64367),f=c(26070),g=c(99511);let h="-review";function i(a){return f.vq[a]||[]}function j(a){let b=f.vq[a];return b?.[0]?.id||null}function k(a,b){let c=f.vq[a];return c?(0,g.gr)(c.find(a=>a.id===b)):null}function l(a,b){let c=f.vq[a];if(!c)return null;let d=c.find(a=>a.id===b);return d?.kind||d?.type||null}function m(a,b){let c=f.vq[a],d=c?.find(a=>a.id===b);return d?.upstreamModelId?d.upstreamModelId:"cx"===a&&"string"==typeof b&&b.endsWith(h)?b.slice(0,-h.length):b}let n=Object.fromEntries(e.A.filter(a=>a.alias&&a.alias!==a.id).map(a=>[a.id,a.alias])),o=Object.fromEntries(Object.keys(d.xq).map(a=>[a,n[a]||a]));function p(a){let b=o[a]||a;return f.vq[b]||[]}function q(a,b){return(0,g.g5)(f.vq[a]?.find(a=>a.id===b))}},54603:(a,b,c)=>{c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(58273);let l=h().join(k.n,"machine-id"),m=h().join(k.n,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.n,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},81329:(a,b,c)=>{c.d(b,{CP:()=>f,Xg:()=>d.Xg,eh:()=>e,vq:()=>d.PROVIDER_MODELS});var d=c(45699);Object.entries(c(40615).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.PROVIDER_MODELS).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name}))),f=(a,b=null)=>a?.kind||a?.type||b},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mY:()=>d.mY,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(39422)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=8271,exports.ids=[615,1477,1998,8271],exports.modules={1477:(a,b,c)=>{c.d(b,{getKiroUsage:()=>g});var d=c(39609),e=c(6382),f=c(24295);async function g(a,b,c=null){let h=b?.authMethod||"builder-id",i="api_key"===h,j=i?{tokentype:"API_KEY"}:{},k="external_idp"===h?{TokenType:"EXTERNAL_IDP"}:{},l=i?b?.profileArn||"":b?.profileArn||(0,e.We)(h),m=new URLSearchParams({isEmailRequired:"true",origin:"AI_EDITOR",resourceType:"AGENTIC_REQUEST"}),n=!1,o=[];for(let b of[{name:"codewhisperer-get",run:async()=>(0,d.proxyAwareFetch)(`${(0,f.U)("kiro").cwHost}${(0,f.U)("kiro").limitsPath}?${m.toString()}`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","x-amz-user-agent":"aws-sdk-js/1.0.0 KiroIDE","user-agent":"aws-sdk-js/1.0.0 KiroIDE",...j,...k}},c)},{name:"codewhisperer-post",run:async()=>(0,d.proxyAwareFetch)((0,f.U)("kiro").cwHost,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.GetUsageLimits",Accept:"application/json",...j,...k},body:JSON.stringify({origin:"AI_EDITOR",...l?{profileArn:l}:{},resourceType:"AGENTIC_REQUEST"})},c)},{name:"q-get",run:async()=>{let b=new URLSearchParams({origin:"AI_EDITOR",...l?{profileArn:l}:{},resourceType:"AGENTIC_REQUEST"});return(0,d.proxyAwareFetch)(`${(0,f.U)("kiro").qHost}${(0,f.U)("kiro").limitsPath}?${b}`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json",...j,...k}},c)}}])try{let a=await b.run();if(!a.ok){let c=await a.text().catch(()=>"");(401===a.status||403===a.status)&&(n=!0),o.push(`${b.name}:${a.status}${c?`:${c}`:""}`);continue}let c=await a.json();return function(a){let b=a.usageBreakdownList||[],c={},d=(0,f.eZ)(a.nextDateReset||a.resetDate);return b.forEach(a=>{let b=a.resourceType?.toLowerCase()||"unknown",e=a.currentUsageWithPrecision||0,g=a.usageLimitWithPrecision||0;if(c[b]={used:e,total:g,remaining:g-e,resetAt:d,unlimited:!1},a.freeTrialInfo){let e=a.freeTrialInfo.currentUsageWithPrecision||0,g=a.freeTrialInfo.usageLimitWithPrecision||0;c[`${b}_freetrial`]={used:e,total:g,remaining:g-e,resetAt:(0,f.eZ)(a.freeTrialInfo.freeTrialExpiry||d),unlimited:!1}}}),{plan:a.subscriptionInfo?.subscriptionTitle||"Kiro",quotas:c}}(c)}catch(a){o.push(`${b.name}:${a.message}`)}return n&&"idc"===h?{message:"Kiro quota API is unavailable for the current AWS IAM Identity Center session. Chat may still work. If this persists after renewing your session, reconnect Kiro.",quotas:{}}:n&&("google"===h||"github"===h)?{message:"Kiro quota API authentication expired. Chat may still work.",quotas:{}}:n?{message:"Kiro quota API rejected the current token. Chat may still work.",quotas:{}}:{message:o.length>0?`Unable to fetch Kiro usage right now. (${o[o.length-1]})`:"Unable to fetch Kiro usage right now.",quotas:{}}}},6551:(a,b,c)=>{c.d(b,{RO:()=>m,Tl:()=>k,Yt:()=>l});var d=c(39609),e=c(24295);let f={usageUrl:(0,e.U)("codex").url,resetCreditsUrl:(0,e.U)("codex").resetCreditsUrl,resetCreditsConsumeUrl:(0,e.U)("codex").resetCreditsConsumeUrl};function g(a){if(!a)return null;let b=a instanceof Date?a:new Date("number"==typeof a&&a<1e12?1e3*a:a);return Number.isFinite(b.getTime())?b.toISOString():null}function h(a){return!a||"object"!=typeof a||Array.isArray(a)?null:a.rate_limit&&"object"==typeof a.rate_limit?a.rate_limit:a}function i(a){let b=Math.max(0,Math.min(100,(0,e.IQ)(a?.used_percent??a?.percent_used,0)));return{used:b,total:100,remaining:Math.max(0,100-b),resetAt:(0,e.eZ)(a?.reset_at??a?.resets_at??a?.resetAt??null),unlimited:!1}}function j(a,b,c){let d=h(c);if(!d)return!1;let e=d.primary_window||d.primary||c.primary_window||c.primary,f=d.secondary_window||d.secondary||c.secondary_window||c.secondary,g=!1;return e&&(a[b?`${b}_session`:"session"]=i(e),g=!0),f&&(a[b?`${b}_weekly`:"weekly"]=i(f),g=!0),g}async function k(a,b=null){try{let c=await (0,d.proxyAwareFetch)(f.usageUrl,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(!c.ok)return{message:`Codex connected. Usage API temporarily unavailable (${c.status}).`};let g=await c.json(),i=g.rate_limit||g.rate_limits||g.rate_limits_by_limit_id?.codex||{},k=function(a){if(a.code_review_rate_limit||a.review_rate_limit)return a.code_review_rate_limit||a.review_rate_limit;let b=a.rate_limits_by_limit_id;return b&&"object"==typeof b&&!Array.isArray(b)?b.code_review||b.codex_review||b.review||null:(Array.isArray(a.additional_rate_limits)?a.additional_rate_limits:[]).find(a=>{let b=String(a?.limit_name||a?.metered_feature||a?.id||"").toLowerCase();return"code_review"===b||"codex_review"===b||"review"===b||b.includes("review")})||null}(g),l=Math.max(0,(0,e.IQ)(g.rate_limit_reset_credits?.available_count,0)),m={};return j(m,"",i),j(m,"review",k),{plan:g.plan_type||g.summary?.plan||"unknown",limitReached:h(i)?.limit_reached||!1,reviewLimitReached:h(k)?.limit_reached||!1,resetCredits:{availableCount:l},quotas:m}}catch(a){throw Error(`Failed to fetch Codex usage: ${a.message}`)}}async function l(a,b=null,c=null){if(!a)throw Error("No Codex access token available. Please re-authorize the connection.");let h=c?.workspaceId||c?.accountId||c?.chatgptAccountId||null,i={Authorization:`Bearer ${a}`,Accept:"application/json","OpenAI-Beta":"codex-1",originator:"codex_cli_rs"};h&&(i["ChatGPT-Account-ID"]=h);let j=await (0,d.proxyAwareFetch)(f.resetCreditsUrl,{method:"GET",headers:i},b),k=null;try{k=await j.json()}catch{k=null}if(!j.ok)throw Error(k?.message||k?.error||k?.detail||`Codex reset credits API unavailable (${j.status}).`);let m=Array.isArray(k?.credits)?k.credits:[];return{availableCount:Math.max(0,(0,e.IQ)(k?.available_count??k?.availableCount,0)),credits:m.map(a=>({status:String(a?.status||"unknown"),grantedAt:g(a?.granted_at??a?.grantedAt),expiresAt:g(a?.expires_at??a?.expiresAt)}))}}async function m(a,b,c=null){let g;if(!a)throw Error("No Codex access token available. Please re-authorize the connection.");if(!b||"string"!=typeof b)throw Error("A redeem request id is required to consume a Codex reset credit.");let h=null;try{g=await (0,d.proxyAwareFetch)(f.resetCreditsConsumeUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({redeem_request_id:b})},c);let e=await g.text();h=e?JSON.parse(e):null}catch(a){throw Error(`Failed to consume Codex reset credit: ${a.message}`)}let i=h?.code||null,j=(0,e.IQ)(h?.windows_reset,0);return{ok:g.ok&&("reset"===i||j>0),noCredit:g.ok&&"no_credit"===i,status:g.status,code:i,windowsReset:j,message:h?.message||null,raw:h}}},18271:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>m,refreshAndUpdateCredentials:()=>l});var e=c(48895),f=c(89718),g=c(33815),h=c(55330),i=c(39326),j=c(40615),k=a([e,h]);[e,h]=k.then?(await k)():k;let n=["expired","authentication","unauthorized","401","re-authorize"];async function l(a,b=!1,c=null){let d=(0,h.SB)(a.provider),e={accessToken:a.accessToken,refreshToken:a.refreshToken,idToken:a.idToken,expiresAt:a.expiresAt||a.tokenExpiresAt,lastRefreshAt:a.lastRefreshAt,connectionId:a.id,providerSpecificData:a.providerSpecificData,copilotToken:a.providerSpecificData?.copilotToken,copilotTokenExpiresAt:a.providerSpecificData?.copilotTokenExpiresAt};if(!(b||d.needsRefresh(e)))return{connection:a,refreshed:!1};let g=await d.refreshCredentials(e,console,c);if(!g){if(a.accessToken)return{connection:a,refreshed:!1};throw Error("Failed to refresh credentials. Please re-authorize the connection.")}let i={updatedAt:new Date().toISOString()};g.accessToken&&(i.accessToken=g.accessToken),g.refreshToken&&(i.refreshToken=g.refreshToken),g.idToken&&(i.idToken=g.idToken),g.lastRefreshAt&&(i.lastRefreshAt=g.lastRefreshAt),g.expiresIn?(i.expiresAt=new Date(Date.now()+1e3*g.expiresIn).toISOString(),i.expiresIn=g.expiresIn):g.expiresAt&&(i.expiresAt=g.expiresAt);let j={...g.providerSpecificData||{},...g.copilotToken?{copilotToken:g.copilotToken}:{},...g.copilotTokenExpiresAt?{copilotTokenExpiresAt:g.copilotTokenExpiresAt}:{}};return Object.keys(j).length>0&&(i.providerSpecificData={...a.providerSpecificData||{},...j}),await (0,f.updateProviderConnection)(a.id,i),{connection:{...a,...i,providerSpecificData:i.providerSpecificData||a.providerSpecificData},refreshed:!0}}async function m(a,{params:b}){let c;try{let{connectionId:a}=await b;if(!(c=await (0,f.Mc)(a)))return Response.json({error:"Connection not found"},{status:404});let d="oauth"===c.authType,e=("apikey"===c.authType||"api_key"===c.authType)&&j.jO.includes(c.provider);if(!d&&!e)return Response.json({message:"Usage not available for this connection"});let h=await (0,i.B)(c.providerSpecificData),k={connectionProxyEnabled:!0===h.connectionProxyEnabled,connectionProxyUrl:h.connectionProxyUrl||"",connectionNoProxy:h.connectionNoProxy||"",vercelRelayUrl:h.vercelRelayUrl||"",strictProxy:!1};if(d)try{c=(await l(c,!1,k)).connection}catch(a){return console.error("[Usage API] Credential refresh failed:",a),Response.json({error:`Credential refresh failed: ${a.message}`},{status:401})}let m=await (0,g.my)(c,k);if(d&&function(a){if(!a?.message)return!1;let b=a.message.toLowerCase();return n.some(a=>b.includes(a))}(m)&&c.refreshToken)try{c=(await l(c,!0,k)).connection,m=await (0,g.my)(c,k)}catch(a){console.warn(`[Usage] ${c.provider}: force refresh failed: ${a.message}`)}return Response.json(m)}catch(b){let a=c?.provider??"unknown";return console.warn(`[Usage] ${a}: ${b.message}`),Response.json({error:b.message},{status:500})}}d()}catch(a){d(a)}})},24295:(a,b,c)=>{c.d(b,{IQ:()=>h,U:()=>f,eZ:()=>g,gD:()=>i,u9:()=>j});var d=c(26070),e=c(39609);let f=a=>d.xq[a]?.usage||{};function g(a){if(!a)return null;try{if(a instanceof Date)return a.toISOString();if("number"==typeof a)return new Date(a<1e12?1e3*a:a).toISOString();if("string"==typeof a){if(/^\d+$/.test(a)){let b=Number(a);return new Date(b<1e12?1e3*b:b).toISOString()}return new Date(a).toISOString()}return null}catch(b){return console.warn(`Failed to parse reset time: ${a}`,b),null}}function h(a,b=0){if("number"==typeof a&&Number.isFinite(a))return a;if("string"==typeof a&&a.trim()){let b=Number(a);if(Number.isFinite(b))return b}return b}function i(a){return"string"==typeof a?a.trim()||null:a&&"object"==typeof a&&"string"==typeof a.id&&a.id.trim()||null}async function j(a,b,c=1e4,d=null){let f=new AbortController,g=setTimeout(()=>f.abort(),c);try{return await (0,e.proxyAwareFetch)(a,{...b,signal:f.signal},d)}finally{clearTimeout(g)}}},33815:(a,b,c)=>{c.d(b,{RO:()=>r.RO,Yt:()=>r.Yt,my:()=>O});var d=c(39609),e=c(26070),f=c(24295);let g={apiVersion:e.sr.github?.apiVersion,userAgent:e.sr.github?.userAgent};async function h(a,b,c=null){try{if(!a)throw Error("No GitHub access token available. Please re-authorize the connection.");let b=await (0,d.proxyAwareFetch)((0,f.U)("github").url,{headers:{Authorization:`token ${a}`,Accept:"application/json","X-GitHub-Api-Version":g.apiVersion,"User-Agent":g.userAgent,"Editor-Version":"vscode/1.100.0","Editor-Plugin-Version":"copilot-chat/0.26.7"}},c);if(!b.ok){let a=await b.text();throw Error(`GitHub API error: ${a}`)}let e=await b.json();if(e.quota_snapshots){let a=e.quota_snapshots,b=(0,f.eZ)(e.quota_reset_date);return{plan:e.copilot_plan,resetDate:e.quota_reset_date,quotas:{chat:{...i(a.chat),resetAt:b},completions:{...i(a.completions),resetAt:b},premium_interactions:{...i(a.premium_interactions),resetAt:b}}}}if(e.monthly_quotas||e.limited_user_quotas){let a=e.monthly_quotas||{},b=e.limited_user_quotas||{},c=(0,f.eZ)(e.limited_user_reset_date);return{plan:e.copilot_plan||e.access_type_sku,resetDate:e.limited_user_reset_date,quotas:{chat:{used:b.chat||0,total:a.chat||0,unlimited:!1,resetAt:c},completions:{used:b.completions||0,total:a.completions||0,unlimited:!1,resetAt:c}}}}return{message:"GitHub Copilot connected. Unable to parse quota data."}}catch(a){throw Error(`Failed to fetch GitHub usage: ${a.message}`)}}function i(a){return a?{used:a.entitlement-a.remaining,total:a.entitlement,remaining:a.remaining,unlimited:a.unlimited||!1}:{used:0,total:0,unlimited:!0}}var j=c(75924),k=c(74129);let l={...(0,f.U)("antigravity"),...k.XP,userAgent:(0,j.A9)()};async function m(a,b,c=null){if(!a)return{plan:"Free",message:"Gemini CLI access token not available."};try{let d=(0,f.gD)(b?.projectId),e="Free";if(!d){let b=await n(a,c);d=(0,f.gD)(b?.cloudaicompanionProject),e=b?.currentTier?.name||e}if(!d)return{plan:e,message:"Gemini CLI project ID not available. Reconnect Gemini CLI, or configure a Google Cloud project with Gemini Code Assist access before checking quota."};let g=await (0,f.u9)((0,f.U)("gemini-cli").quotaUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({project:d})},1e4,c);if(!g.ok)return{plan:e,message:`Gemini CLI quota error (${g.status}).`};let h=await g.json(),i={};if(Array.isArray(h.buckets))for(let a of h.buckets){if(!a.modelId||null==a.remainingFraction)continue;let b=Number(a.remainingFraction)||0,c=Math.round(1e3*b),d=Math.max(0,1e3-c);i[a.modelId]={used:d,total:1e3,resetAt:(0,f.eZ)(a.resetTime),remainingPercentage:100*b,unlimited:!1}}return{plan:e,quotas:i}}catch(a){return{message:`Gemini CLI error: ${a.message}`}}}async function n(a,b=null){try{let c=await (0,f.u9)((0,f.U)("gemini-cli").loadCodeAssistUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:j.Cn})},1e4,b);if(!c.ok)return null;return await c.json()}catch{return null}}async function o(a,b,c=null){try{let b=await p(a,c),d=b?.cloudaicompanionProject||null,e=await (0,f.u9)(l.quotaApiUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"User-Agent":l.userAgent,"Content-Type":"application/json","X-Client-Name":"antigravity","X-Client-Version":"1.107.0","x-request-source":"local"},body:JSON.stringify({...d?{project:d}:{}})},1e4,c);if(403===e.status)return{message:"Antigravity quota API access forbidden. Chat may still work.",quotas:{}};if(401===e.status)return{message:"Antigravity quota API authentication expired. Chat may still work.",quotas:{}};if(!e.ok)throw Error(`Antigravity API error: ${e.status}`);let g=await e.json(),h={};if(g.models){let a=["gemini-3-flash-agent","gemini-3.5-flash-low","gemini-3.5-flash-extra-low","gemini-pro-agent","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium","gemini-3-flash","gemini-3.1-flash-image","gemini-3-pro-image"];for(let[b,c]of Object.entries(g.models)){if(!c.quotaInfo||c.isInternal||!a.includes(b))continue;let d=c.quotaInfo.remainingFraction||0,e=100*d,g=Math.round(1e3*d),i=1e3-g;h[b]={used:i,total:1e3,resetAt:(0,f.eZ)(c.quotaInfo.resetTime),remainingPercentage:e,unlimited:!1,displayName:c.displayName||b}}}return{plan:b?.currentTier?.name||"Unknown",quotas:h,subscriptionInfo:b}}catch(a){return console.error("[Antigravity Usage] Error:",a.message,a.cause),{message:`Antigravity error: ${a.message}`}}}async function p(a,b=null){try{let c=await (0,f.u9)(l.loadProjectApiUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"User-Agent":l.userAgent,"Content-Type":"application/json","x-request-source":"local"},body:JSON.stringify({metadata:j.Cn,mode:1})},1e4,b);if(!c.ok)return null;return await c.json()}catch(a){return console.error("[Antigravity Subscription] Error:",a.message),null}}var q=c(69788),r=c(6551),s=c(1477);let t={minimax:(0,f.U)("minimax").urls,"minimax-cn":(0,f.U)("minimax-cn").urls};function u(a,b,c){return a&&"object"==typeof a?a[b]??a[c]??null:null}function v(a,b,c){if(!a||"object"!=typeof a)return null;let d=a[b]??a[c];if(null==d)return null;let e=Number(d);return Number.isFinite(e)?Math.max(0,Math.min(100,e)):null}function w(a){return Math.max(0,Number(u(a,"current_interval_total_count","currentIntervalTotalCount"))||0)}function x(a){return Math.max(0,Number(u(a,"current_weekly_total_count","currentWeeklyTotalCount"))||0)}function y(a){return!!(w(a)>0||x(a)>0)||null!==v(a,"current_interval_remaining_percent","currentIntervalRemainingPercent")||null!==v(a,"current_weekly_remaining_percent","currentWeeklyRemainingPercent")}function z(a,b,c,d,e,g,h,i,j,k){let l=d(c),m=v(c,h,i);if(l<=0&&null===m)return;let n=Math.max(0,Number(u(c,e,g))||0),o=l,p=n;l<=0&&(o=100,p=k?Math.round(m/100*o):Math.round(o*(1-m/100))),a[b]=function(a,b,c,d,e=null){var f,g,h;let i=Math.max(0,a),j=d?Math.max(i-b,0):Math.min(Math.max(0,b),i),k=Math.max(i-j,0),l=(f=e,g=k,h=i,null!=f&&Number.isFinite(f)?Math.max(0,Math.min(100,f)):h>0?Math.max(0,Math.min(100,g/h*100)):0);return{used:j,total:i,remaining:k,remainingPercentage:l,resetAt:c,unlimited:!1}}(o,p,function(a,b,c,d,e,g){let h=Number(u(a,c,d))||0;return h>0?new Date(b+h).toISOString():(0,f.eZ)(u(a,e,g))}(c,...j),k,m)}async function A(a,b,c=null){if(!a)return{message:"MiniMax API key not available."};let e=t[b]||[],f="";for(let b=0;b<e.length;b+=1){let g=e[b],h=b<e.length-1;try{let b=await (0,d.proxyAwareFetch)(g,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","Content-Type":"application/json"}},c),e=await b.text(),i={};if(e)try{i=JSON.parse(e)}catch{i={}}let j=(i?.base_resp??i?.baseResp)||{},k=Number(j.status_code??j.statusCode)||0,l=String(j.status_msg??j.statusMsg??"").trim(),m=`${l} ${e}`.trim(),n=/token plan|coding plan|invalid api key|invalid key|unauthorized|inactive/i;if(401===b.status||403===b.status||1004===k||n.test(m))return{message:"MiniMax API key invalid or inactive. Use an active Token/Coding Plan key."};if(!b.ok){if(f=`MiniMax usage endpoint error (${b.status})`,(404===b.status||405===b.status||b.status>=500)&&h)continue;return{message:`MiniMax connected. ${f}`}}if(0!==k)return{message:`MiniMax connected. ${l||"Upstream quota API error"}`};let o=i?.model_remains??i?.modelRemains,p=(Array.isArray(o)?o:[]).filter(y);if(0===p.length)return{message:"MiniMax connected. No quota data was returned."};let q=Date.now(),r=g.includes("/coding_plan/remains"),s={};for(let a of p){let b=function(a){let b=String(u(a,"model_name","modelName")||"").trim();return b?"MiniMax-M*"===b||"general"===b?"M-series":b.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,a=>a.toUpperCase()).replace(/\bTo\b/g,"to").replace(/\bTts\b/g,"TTS").replace(/\bHd\b/g,"HD"):"MiniMax"}(a);z(s,`${b} (5h)`,a,w,"current_interval_usage_count","currentIntervalUsageCount","current_interval_remaining_percent","currentIntervalRemainingPercent",[q,"remains_time","remainsTime","end_time","endTime"],r),z(s,`${b} (7d)`,a,x,"current_weekly_usage_count","currentWeeklyUsageCount","current_weekly_remaining_percent","currentWeeklyRemainingPercent",[q,"weekly_remains_time","weeklyRemainsTime","weekly_end_time","weeklyEndTime"],r)}if(0===Object.keys(s).length)return{message:"MiniMax connected. Unable to extract quota usage."};return{quotas:s}}catch(a){if(f=a.message,!h)break}}return{message:f?`MiniMax connected. Unable to fetch usage: ${f}`:"MiniMax connected. Unable to fetch usage."}}let B="codebuddy-cn";function C(a,b){let c=Number(a??b);return Number.isFinite(c)?c:0}async function D(a,b,c,g=null){let h=a||b;if(!h)return{message:"CodeBuddy CN credential not available."};try{let a=await (0,d.proxyAwareFetch)((0,f.U)(B).url,{method:"POST",headers:{...e.xq[B]?.headers||{},Authorization:`Bearer ${h}`,"Content-Type":"application/json",Accept:"application/json"},body:"{}"},g);if(401===a.status||403===a.status)return{message:"CodeBuddy CN credential invalid or expired."};if(!a.ok)return{message:`CodeBuddy CN quota API error (${a.status}).`};let b=await a.json();if(b?.code!==0)return{message:`CodeBuddy CN quota error: ${b?.msg||"unknown"}`};let c=b?.data?.Response?.Data||{},i=Array.isArray(c.Accounts)?c.Accounts:[];if(0===i.length)return{message:"CodeBuddy CN connected. No credit package found."};let j=a=>{let b=(0,f.eZ)(a.CycleEndTime);return b?new Date(b).getTime():1/0},k=a=>{let b=j(a),c=Number(a.DeductionEndTime);return Number.isFinite(b)&&Number.isFinite(c)&&c-b>1728e5},l=(a,b)=>j(a)-j(b),m=i.filter(k).sort(l),n=i.filter(a=>!k(a)).sort(l),o={},p={};m.forEach(a=>{let b=function(a){let b=(0,f.eZ)(a.CycleStartTime),c=(0,f.eZ)(a.CycleEndTime);if(b&&c){let a=(new Date(c).getTime()-new Date(b).getTime())/864e5;if(a<=1.5)return"Daily";if(a<=10)return"Weekly"}return"Monthly"}(a);p[b]=(p[b]||0)+1,o[p[b]>1?`${b} ${p[b]}`:b]={used:C(a.CycleCapacityUsedPrecise,a.CycleCapacityUsed),total:C(a.CycleCapacitySizePrecise,a.CycleCapacitySize),resetAt:(0,f.eZ)(a.CycleEndTime),unlimited:!1,recurring:!0}}),n.forEach((a,b)=>{o[`Bonus Pack ${b+1}`]={used:C(a.CapacityUsedPrecise,a.CapacityUsed),total:C(a.CapacitySizePrecise,a.CapacitySize),resetAt:(0,f.eZ)(a.CycleEndTime),unlimited:!1,recurring:!1}});let q=m[0]||i[0]||{};return{plan:q.PackageName||q.SubProductName||"CodeBuddy CN",quotas:o}}catch(a){return{message:`CodeBuddy CN error: ${a.message}`}}}let E={international:(0,f.U)("glm").url,china:(0,f.U)("glm-cn").url},F=(0,f.U)("vercel-ai-gateway").url;async function G(a,b){try{if(!b?.resourceUrl)return{message:"Qwen connected. No resource URL available."};return{message:"Qwen connected. Usage tracked per request."}}catch(a){return{message:"Unable to fetch Qwen usage."}}}async function H(a){try{return{message:"iFlow connected. Usage tracked per request."}}catch(a){return{message:"Unable to fetch iFlow usage."}}}async function I(a,b){try{return{plan:b?.plan||"Free",message:"Ollama Cloud uses a free tier with light usage limits (resets every 5h & 7d). For detailed usage tracking, visit ollama.com/settings/keys.",quotas:[]}}catch(a){return{message:"Unable to fetch Ollama Cloud usage."}}}async function J(a,b,c=null){if(!a)return{message:"GLM API key not available."};let e=E["glm-cn"===b?"china":"international"];try{let b=await (0,d.proxyAwareFetch)(e,{headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},c);if(!b.ok){if(401===b.status)return{message:"GLM API key invalid or expired."};return{message:`GLM quota API error (${b.status}).`}}let f=await b.json(),g=f?.data&&"object"==typeof f.data?f.data:{},h=Array.isArray(g.limits)?g.limits:[],i={};for(let a of h){if(!a||"TOKENS_LIMIT"!==a.type)continue;let b=Number(a.percentage)||0,c=Number(a.nextResetTime)||0,d=Math.max(0,100-b);i.session={used:b,total:100,remaining:d,remainingPercentage:d,resetAt:c>0?new Date(c).toISOString():null,unlimited:!1}}let j="string"==typeof g.level?g.level:"";return{plan:j?j.charAt(0).toUpperCase()+j.slice(1).toLowerCase():"Unknown",quotas:i}}catch(a){return{message:`GLM error: ${a.message}`}}}async function K(a,b=null){if(!a)return{message:"Vercel AI Gateway API key not available."};try{let c=await (0,d.proxyAwareFetch)(F,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(401===c.status||403===c.status)return{message:"Vercel AI Gateway API key invalid or expired."};if(!c.ok){let a=await c.text().catch(()=>""),b=a?`: ${a.slice(0,200)}`:"";return{message:`Vercel AI Gateway credits API error (${c.status})${b}`}}let e=await c.json(),f=Number(e?.balance)||0,g=Number(e?.total_used)||0;if(f<=0&&g<=0)return{plan:"Pay-as-you-go",message:"Vercel AI Gateway connected. No credit allocation found (BYOK or unfunded account).",quotas:{}};return{plan:"Pay-as-you-go",quotas:{"Used (USD)":{used:g,total:0,remaining:0,remainingPercentage:100,unlimited:!0},"Remaining (USD)":{used:f,total:5,remaining:f,remainingPercentage:f/5*100,unlimited:!1}}}}catch(a){return{message:`Vercel AI Gateway error: ${a.message}`}}}async function L(a,b=null){if(!a)return{message:"Qoder usage unavailable: no access token"};try{let c=await (0,d.proxyAwareFetch)((0,f.U)("qoder").url,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(!c.ok)return{message:`Qoder connected. Usage fetch returned ${c.status}.`};let e=await c.json().catch(()=>null);if(!e)return{message:"Qoder connected. Usage response was not JSON."};let g=e.userQuota||{},h=e.orgResourcePackage||{},i=Number.isFinite(Number(e.expiresAt))&&Number(e.expiresAt)>0?Number(e.expiresAt):null,j=i?new Date(i).toISOString():null;return{quotas:{user:{total:Number(g.total)||0,used:Number(g.used)||0,remaining:Number(g.remaining)||0,unit:g.unit||"credits",resetAt:j},organization:{total:Number(h.total)||0,used:Number(h.used)||0,remaining:Number(h.remaining)||0,unit:h.unit||"credits",resetAt:j}},totalUsagePercentage:Number(e.totalUsagePercentage)||0,isQuotaExceeded:!!e.isQuotaExceeded,expiresAt:i}}catch(a){return{message:`Qoder connected. Unable to fetch usage: ${a.message}`}}}async function M(a,b=null){let c=a?.accessToken;if(!c)return null;let e=(0,f.U)("xai"),g={Authorization:`Bearer ${c}`,Accept:"application/json","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"},[h,i]=await Promise.allSettled([e.billingUrl?(0,d.proxyAwareFetch)(e.billingUrl,{method:"GET",headers:g},b):Promise.reject(Error("no billingUrl")),e.subscriptionUrl?(0,d.proxyAwareFetch)(e.subscriptionUrl,{method:"GET",headers:g},b):Promise.reject(Error("no subscriptionUrl"))]),j=null,k=null;if("fulfilled"===h.status&&h.value?.ok){let a=await h.value.json().catch(()=>null);if(a){let b=(0,f.IQ)(a.credits??a.remaining_credits),c=(0,f.IQ)(a.used_credits??a.used),d=(0,f.IQ)(a.total_credits??a.total);(b>0||d>0||c>0)&&(j={remaining:b,used:c,total:d||b+c,remainingPercentage:d>0?Math.round(b/d*100):null,resetAt:(0,f.eZ)(a.reset_at??a.reset_date)||null})}}if("fulfilled"===i.status&&i.value?.ok){let a=await i.value.json().catch(()=>null);if(a){let b=a.subscription||a;k=b.plan||b.tier||b.name||null}}let l={};return j&&(l.Credits={used:j.used,total:j.total,remaining:j.remaining,remainingPercentage:j.remainingPercentage,resetAt:j.resetAt}),0===Object.keys(l).length&&k&&(l[k]={used:0,total:0,unlimited:!0,remainingPercentage:null}),{quotas:l,plan:k,credits:j}}let N={github:a=>h(a.accessToken,a.providerSpecificData,a.proxyOptions),"gemini-cli":a=>m(a.accessToken,a.providerDataWithProjectId,a.proxyOptions),antigravity:a=>o(a.accessToken,a.providerSpecificData,a.proxyOptions),claude:a=>(0,q.g)(a.accessToken,a.proxyOptions),codex:a=>(0,r.Tl)(a.accessToken,a.proxyOptions),kiro:a=>(0,s.getKiroUsage)(a.accessToken,a.providerSpecificData,a.proxyOptions),qoder:a=>L(a.accessToken,a.proxyOptions),qwen:a=>G(a.accessToken,a.providerSpecificData),iflow:a=>H(a.accessToken),ollama:a=>I(a.accessToken),glm:a=>J(a.apiKey,a.provider,a.proxyOptions),"glm-cn":a=>J(a.apiKey,a.provider,a.proxyOptions),minimax:a=>A(a.apiKey,a.provider,a.proxyOptions),"minimax-cn":a=>A(a.apiKey,a.provider,a.proxyOptions),"vercel-ai-gateway":a=>K(a.apiKey,a.proxyOptions),"codebuddy-cn":a=>D(a.accessToken,a.apiKey,a.providerSpecificData,a.proxyOptions),xai:a=>M(a,a.proxyOptions)};async function O(a,b=null){let{provider:c,accessToken:d,apiKey:e,providerSpecificData:f,projectId:g}=a,h={...f||{},...g?{projectId:g}:{}},i=N[c];return i?await i({provider:c,accessToken:d,apiKey:e,providerSpecificData:f,providerDataWithProjectId:h,proxyOptions:b}):{message:`Usage API not implemented for ${c}`}}},39326:(a,b,c)=>{c.d(b,{B:()=>f});var d=c(71998);function e(a){return null==a?"":String(a).trim()}async function f(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},40615:(a,b,c)=>{c.d(b,{AI_PROVIDERS:()=>s,js:()=>w,DI:()=>n,fg:()=>k,Pd:()=>o,IS:()=>h,nJ:()=>i,zN:()=>j,JH:()=>m,jO:()=>y,wb:()=>x,br:()=>l,wG:()=>v,zt:()=>t,gb:()=>q,gC:()=>r,mq:()=>p,rs:()=>u});var d=c(91237);let e="⚠️ Risk Notice: This provider uses a subscription/OAuth session not officially licensed for proxy/router use. Account may be restricted or banned. Use at your own risk.";Object.fromEntries(d.A.filter(a=>a.display).map(a=>{let b;return[a.id,"RISK_NOTICE"===(b=a.display).deprecationNotice?{...b,deprecationNotice:e}:b]}));let f=["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","modelsFetcher","mediaPriority","hiddenKinds"],g=a=>Object.fromEntries(d.A.filter(b=>b.category===a).map(a=>[a.id,function(a){let b={};for(let c of(a.media&&Object.assign(b,a.media),f))void 0!==a[c]&&(b[c]=a[c]);let c={...a.display||{}};return"RISK_NOTICE"===c.deprecationNotice&&(c.deprecationNotice=e),{...c,id:a.id,alias:a.uiAlias||a.alias,...a.hidden?{hidden:!0}:{},...b,...void 0!==a.priority?{priority:a.priority}:{},...a.hasFree?{hasFree:!0}:{},...a.thinkingConfig?{thinkingConfig:a.thinkingConfig}:{},...a.regions?{regions:a.regions,defaultRegion:a.defaultRegion}:{},...a.hasProviderSpecificData?{hasProviderSpecificData:!0}:{},...a.noAuth?{noAuth:!0}:{},...a.passthroughModels?{passthroughModels:!0}:{},...a.hasOAuth?{hasOAuth:!0}:{},...a.authModes?{authModes:a.authModes}:{},...a.authType?{authType:a.authType}:{},...a.authHint?{authHint:a.authHint}:{},...a.comingSoon?{comingSoon:!0}:{}}}(a)])),h=g("free"),i=g("freeTier"),j=g("oauth"),k=g("apikey"),l=g("webCookie"),m="openai-compatible-",n="anthropic-compatible-",o="custom-embedding-";function p(a){return"string"==typeof a&&a.startsWith(m)}function q(a){return"string"==typeof a&&a.startsWith(n)}function r(a){return"string"==typeof a&&a.startsWith(o)}let s={...h,...i,...j,...k,...l};function t(a){for(let b of Object.values(s))if(b.alias===a||b.id===a)return b;return null}function u(a){let b=t(a);return b?.id||a}function v(a){let b=s[a];return b?.alias||a}let w=Object.values(s).reduce((a,b)=>(a[b.alias]=b.id,a),{});Object.values(s).reduce((a,b)=>(a[b.id]=b.alias,a),{});let x=d.A.filter(a=>a.features?.usage).map(a=>a.id),y=d.A.filter(a=>a.features?.usageApikey).map(a=>a.id)},69788:(a,b,c)=>{c.d(b,{g:()=>i});var d=c(39609),e=c(74129),f=c(24295);let g={oauthUsageUrl:(0,f.U)("claude").oauthUrl,usageUrl:(0,f.U)("claude").orgUrl,settingsUrl:(0,f.U)("claude").settingsUrl,apiVersion:e.b8},h=new Map;async function i(a,b=null){try{let c=h.get(a);if(c&&Date.now()<c)return await j(a,b);let e=await (0,d.proxyAwareFetch)(g.oauthUsageUrl,{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-beta":"oauth-2025-04-20","anthropic-version":g.apiVersion}},b);if(e.ok){let a=await e.json(),b={},c=a=>a&&"object"==typeof a&&"number"==typeof a.utilization,d=a=>{let b=a.utilization,c=Math.max(0,100-b);return{used:b,total:100,remaining:c,remainingPercentage:c,resetAt:(0,f.eZ)(a.resets_at),unlimited:!1}};for(let[e,f]of(c(a.five_hour)&&(b["session (5h)"]=d(a.five_hour)),c(a.seven_day)&&(b["weekly (7d)"]=d(a.seven_day)),Object.entries(a)))if(e.startsWith("seven_day_")&&"seven_day"!==e&&c(f)){let a=e.replace("seven_day_","");b[`weekly ${a} (7d)`]=d(f)}return{plan:"Claude Code",extraUsage:a.extra_usage??null,quotas:b}}return 429===e.status&&h.set(a,Date.now()+18e4),console.warn(`[Claude Usage] OAuth endpoint returned ${e.status}, falling back to legacy`),await j(a,b)}catch(a){return{message:`Claude connected. Unable to fetch usage: ${a.message}`}}}async function j(a,b=null){try{let c=await (0,d.proxyAwareFetch)(g.settingsUrl,{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-version":g.apiVersion}},b);if(c.ok){let e=await c.json();if(e.organization_id){let c=await (0,d.proxyAwareFetch)(g.usageUrl.replace("{org_id}",e.organization_id),{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-version":g.apiVersion}},b);if(c.ok){let a=await c.json();return{plan:e.plan||"Unknown",organization:e.organization_name,quotas:a}}}return{plan:e.plan||"Unknown",organization:e.organization_name,message:"Claude connected. Usage details require admin access."}}return{message:"Claude connected. Usage API requires admin permissions."}}catch(a){return{message:`Claude connected. Unable to fetch usage: ${a.message}`}}}},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)}};
|
|
1
|
+
"use strict";exports.id=8271,exports.ids=[615,1477,1998,8271],exports.modules={1477:(a,b,c)=>{c.d(b,{getKiroUsage:()=>g});var d=c(39609),e=c(6382),f=c(24295);async function g(a,b,c=null){let h=b?.authMethod||"builder-id",i="api_key"===h,j=i?{tokentype:"API_KEY"}:{},k="external_idp"===h?{TokenType:"EXTERNAL_IDP"}:{},l=i?b?.profileArn||"":b?.profileArn||(0,e.We)(h),m=new URLSearchParams({isEmailRequired:"true",origin:"AI_EDITOR",resourceType:"AGENTIC_REQUEST"}),n=!1,o=[];for(let b of[{name:"codewhisperer-get",run:async()=>(0,d.proxyAwareFetch)(`${(0,f.U)("kiro").cwHost}${(0,f.U)("kiro").limitsPath}?${m.toString()}`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","x-amz-user-agent":"aws-sdk-js/1.0.0 KiroIDE","user-agent":"aws-sdk-js/1.0.0 KiroIDE",...j,...k}},c)},{name:"codewhisperer-post",run:async()=>(0,d.proxyAwareFetch)((0,f.U)("kiro").cwHost,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.GetUsageLimits",Accept:"application/json",...j,...k},body:JSON.stringify({origin:"AI_EDITOR",...l?{profileArn:l}:{},resourceType:"AGENTIC_REQUEST"})},c)},{name:"q-get",run:async()=>{let b=new URLSearchParams({origin:"AI_EDITOR",...l?{profileArn:l}:{},resourceType:"AGENTIC_REQUEST"});return(0,d.proxyAwareFetch)(`${(0,f.U)("kiro").qHost}${(0,f.U)("kiro").limitsPath}?${b}`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json",...j,...k}},c)}}])try{let a=await b.run();if(!a.ok){let c=await a.text().catch(()=>"");(401===a.status||403===a.status)&&(n=!0),o.push(`${b.name}:${a.status}${c?`:${c}`:""}`);continue}let c=await a.json();return function(a){let b=a.usageBreakdownList||[],c={},d=(0,f.eZ)(a.nextDateReset||a.resetDate);return b.forEach(a=>{let b=a.resourceType?.toLowerCase()||"unknown",e=a.currentUsageWithPrecision||0,g=a.usageLimitWithPrecision||0;if(c[b]={used:e,total:g,remaining:g-e,resetAt:d,unlimited:!1},a.freeTrialInfo){let e=a.freeTrialInfo.currentUsageWithPrecision||0,g=a.freeTrialInfo.usageLimitWithPrecision||0;c[`${b}_freetrial`]={used:e,total:g,remaining:g-e,resetAt:(0,f.eZ)(a.freeTrialInfo.freeTrialExpiry||d),unlimited:!1}}}),{plan:a.subscriptionInfo?.subscriptionTitle||"Kiro",quotas:c}}(c)}catch(a){o.push(`${b.name}:${a.message}`)}return n&&"idc"===h?{message:"Kiro quota API is unavailable for the current AWS IAM Identity Center session. Chat may still work. If this persists after renewing your session, reconnect Kiro.",quotas:{}}:n&&("google"===h||"github"===h)?{message:"Kiro quota API authentication expired. Chat may still work.",quotas:{}}:n?{message:"Kiro quota API rejected the current token. Chat may still work.",quotas:{}}:{message:o.length>0?`Unable to fetch Kiro usage right now. (${o[o.length-1]})`:"Unable to fetch Kiro usage right now.",quotas:{}}}},6551:(a,b,c)=>{c.d(b,{RO:()=>m,Tl:()=>k,Yt:()=>l});var d=c(39609),e=c(24295);let f={usageUrl:(0,e.U)("codex").url,resetCreditsUrl:(0,e.U)("codex").resetCreditsUrl,resetCreditsConsumeUrl:(0,e.U)("codex").resetCreditsConsumeUrl};function g(a){if(!a)return null;let b=a instanceof Date?a:new Date("number"==typeof a&&a<1e12?1e3*a:a);return Number.isFinite(b.getTime())?b.toISOString():null}function h(a){return!a||"object"!=typeof a||Array.isArray(a)?null:a.rate_limit&&"object"==typeof a.rate_limit?a.rate_limit:a}function i(a){let b=Math.max(0,Math.min(100,(0,e.IQ)(a?.used_percent??a?.percent_used,0)));return{used:b,total:100,remaining:Math.max(0,100-b),resetAt:(0,e.eZ)(a?.reset_at??a?.resets_at??a?.resetAt??null),unlimited:!1}}function j(a,b,c){let d=h(c);if(!d)return!1;let e=d.primary_window||d.primary||c.primary_window||c.primary,f=d.secondary_window||d.secondary||c.secondary_window||c.secondary,g=!1;return e&&(a[b?`${b}_session`:"session"]=i(e),g=!0),f&&(a[b?`${b}_weekly`:"weekly"]=i(f),g=!0),g}async function k(a,b=null){try{let c=await (0,d.proxyAwareFetch)(f.usageUrl,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(!c.ok)return{message:`Codex connected. Usage API temporarily unavailable (${c.status}).`};let g=await c.json(),i=g.rate_limit||g.rate_limits||g.rate_limits_by_limit_id?.codex||{},k=function(a){if(a.code_review_rate_limit||a.review_rate_limit)return a.code_review_rate_limit||a.review_rate_limit;let b=a.rate_limits_by_limit_id;return b&&"object"==typeof b&&!Array.isArray(b)?b.code_review||b.codex_review||b.review||null:(Array.isArray(a.additional_rate_limits)?a.additional_rate_limits:[]).find(a=>{let b=String(a?.limit_name||a?.metered_feature||a?.id||"").toLowerCase();return"code_review"===b||"codex_review"===b||"review"===b||b.includes("review")})||null}(g),l=Math.max(0,(0,e.IQ)(g.rate_limit_reset_credits?.available_count,0)),m={};return j(m,"",i),j(m,"review",k),{plan:g.plan_type||g.summary?.plan||"unknown",limitReached:h(i)?.limit_reached||!1,reviewLimitReached:h(k)?.limit_reached||!1,resetCredits:{availableCount:l},quotas:m}}catch(a){throw Error(`Failed to fetch Codex usage: ${a.message}`)}}async function l(a,b=null,c=null){if(!a)throw Error("No Codex access token available. Please re-authorize the connection.");let h=c?.workspaceId||c?.accountId||c?.chatgptAccountId||null,i={Authorization:`Bearer ${a}`,Accept:"application/json","OpenAI-Beta":"codex-1",originator:"codex_cli_rs"};h&&(i["ChatGPT-Account-ID"]=h);let j=await (0,d.proxyAwareFetch)(f.resetCreditsUrl,{method:"GET",headers:i},b),k=null;try{k=await j.json()}catch{k=null}if(!j.ok)throw Error(k?.message||k?.error||k?.detail||`Codex reset credits API unavailable (${j.status}).`);let m=Array.isArray(k?.credits)?k.credits:[];return{availableCount:Math.max(0,(0,e.IQ)(k?.available_count??k?.availableCount,0)),credits:m.map(a=>({status:String(a?.status||"unknown"),grantedAt:g(a?.granted_at??a?.grantedAt),expiresAt:g(a?.expires_at??a?.expiresAt)}))}}async function m(a,b,c=null){let g;if(!a)throw Error("No Codex access token available. Please re-authorize the connection.");if(!b||"string"!=typeof b)throw Error("A redeem request id is required to consume a Codex reset credit.");let h=null;try{g=await (0,d.proxyAwareFetch)(f.resetCreditsConsumeUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({redeem_request_id:b})},c);let e=await g.text();h=e?JSON.parse(e):null}catch(a){throw Error(`Failed to consume Codex reset credit: ${a.message}`)}let i=h?.code||null,j=(0,e.IQ)(h?.windows_reset,0);return{ok:g.ok&&("reset"===i||j>0),noCredit:g.ok&&"no_credit"===i,status:g.status,code:i,windowsReset:j,message:h?.message||null,raw:h}}},18271:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>m,refreshAndUpdateCredentials:()=>l});var e=c(48895),f=c(89718),g=c(94885),h=c(55330),i=c(39326),j=c(40615),k=a([e,h]);[e,h]=k.then?(await k)():k;let n=["expired","authentication","unauthorized","401","re-authorize"];async function l(a,b=!1,c=null){let d=(0,h.SB)(a.provider),e={accessToken:a.accessToken,refreshToken:a.refreshToken,idToken:a.idToken,expiresAt:a.expiresAt||a.tokenExpiresAt,lastRefreshAt:a.lastRefreshAt,connectionId:a.id,providerSpecificData:a.providerSpecificData,copilotToken:a.providerSpecificData?.copilotToken,copilotTokenExpiresAt:a.providerSpecificData?.copilotTokenExpiresAt};if(!(b||d.needsRefresh(e)))return{connection:a,refreshed:!1};let g=await d.refreshCredentials(e,console,c);if(!g){if(a.accessToken)return{connection:a,refreshed:!1};throw Error("Failed to refresh credentials. Please re-authorize the connection.")}let i={updatedAt:new Date().toISOString()};g.accessToken&&(i.accessToken=g.accessToken),g.refreshToken&&(i.refreshToken=g.refreshToken),g.idToken&&(i.idToken=g.idToken),g.lastRefreshAt&&(i.lastRefreshAt=g.lastRefreshAt),g.expiresIn?(i.expiresAt=new Date(Date.now()+1e3*g.expiresIn).toISOString(),i.expiresIn=g.expiresIn):g.expiresAt&&(i.expiresAt=g.expiresAt);let j={...g.providerSpecificData||{},...g.copilotToken?{copilotToken:g.copilotToken}:{},...g.copilotTokenExpiresAt?{copilotTokenExpiresAt:g.copilotTokenExpiresAt}:{}};return Object.keys(j).length>0&&(i.providerSpecificData={...a.providerSpecificData||{},...j}),await (0,f.updateProviderConnection)(a.id,i),{connection:{...a,...i,providerSpecificData:i.providerSpecificData||a.providerSpecificData},refreshed:!0}}async function m(a,{params:b}){let c;try{let{connectionId:a}=await b;if(!(c=await (0,f.Mc)(a)))return Response.json({error:"Connection not found"},{status:404});let d="oauth"===c.authType,e=("apikey"===c.authType||"api_key"===c.authType)&&j.jO.includes(c.provider);if(!d&&!e)return Response.json({message:"Usage not available for this connection"});let h=await (0,i.B)(c.providerSpecificData),k={connectionProxyEnabled:!0===h.connectionProxyEnabled,connectionProxyUrl:h.connectionProxyUrl||"",connectionNoProxy:h.connectionNoProxy||"",vercelRelayUrl:h.vercelRelayUrl||"",strictProxy:!1};if(d)try{c=(await l(c,!1,k)).connection}catch(a){return console.error("[Usage API] Credential refresh failed:",a),Response.json({error:`Credential refresh failed: ${a.message}`},{status:401})}let m=await (0,g.my)(c,k);if(d&&function(a){if(!a?.message)return!1;let b=a.message.toLowerCase();return n.some(a=>b.includes(a))}(m)&&c.refreshToken)try{c=(await l(c,!0,k)).connection,m=await (0,g.my)(c,k)}catch(a){console.warn(`[Usage] ${c.provider}: force refresh failed: ${a.message}`)}return Response.json(m)}catch(b){let a=c?.provider??"unknown";return console.warn(`[Usage] ${a}: ${b.message}`),Response.json({error:b.message},{status:500})}}d()}catch(a){d(a)}})},24295:(a,b,c)=>{c.d(b,{IQ:()=>h,U:()=>f,eZ:()=>g,gD:()=>i,u9:()=>j});var d=c(26070),e=c(39609);let f=a=>d.xq[a]?.usage||{};function g(a){if(!a)return null;try{if(a instanceof Date)return a.toISOString();if("number"==typeof a)return new Date(a<1e12?1e3*a:a).toISOString();if("string"==typeof a){if(/^\d+$/.test(a)){let b=Number(a);return new Date(b<1e12?1e3*b:b).toISOString()}return new Date(a).toISOString()}return null}catch(b){return console.warn(`Failed to parse reset time: ${a}`,b),null}}function h(a,b=0){if("number"==typeof a&&Number.isFinite(a))return a;if("string"==typeof a&&a.trim()){let b=Number(a);if(Number.isFinite(b))return b}return b}function i(a){return"string"==typeof a?a.trim()||null:a&&"object"==typeof a&&"string"==typeof a.id&&a.id.trim()||null}async function j(a,b,c=1e4,d=null){let f=new AbortController,g=setTimeout(()=>f.abort(),c);try{return await (0,e.proxyAwareFetch)(a,{...b,signal:f.signal},d)}finally{clearTimeout(g)}}},39326:(a,b,c)=>{c.d(b,{B:()=>f});var d=c(71998);function e(a){return null==a?"":String(a).trim()}async function f(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},40615:(a,b,c)=>{c.d(b,{AI_PROVIDERS:()=>s,js:()=>w,DI:()=>n,fg:()=>k,Pd:()=>o,IS:()=>h,nJ:()=>i,zN:()=>j,JH:()=>m,jO:()=>y,wb:()=>x,br:()=>l,wG:()=>v,zt:()=>t,gb:()=>q,gC:()=>r,mq:()=>p,rs:()=>u});var d=c(64367);let e="⚠️ Risk Notice: This provider uses a subscription/OAuth session not officially licensed for proxy/router use. Account may be restricted or banned. Use at your own risk.";Object.fromEntries(d.A.filter(a=>a.display).map(a=>{let b;return[a.id,"RISK_NOTICE"===(b=a.display).deprecationNotice?{...b,deprecationNotice:e}:b]}));let f=["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","modelsFetcher","mediaPriority","hiddenKinds"],g=a=>Object.fromEntries(d.A.filter(b=>b.category===a).map(a=>[a.id,function(a){let b={};for(let c of(a.media&&Object.assign(b,a.media),f))void 0!==a[c]&&(b[c]=a[c]);let c={...a.display||{}};return"RISK_NOTICE"===c.deprecationNotice&&(c.deprecationNotice=e),{...c,id:a.id,alias:a.uiAlias||a.alias,...a.hidden?{hidden:!0}:{},...b,...void 0!==a.priority?{priority:a.priority}:{},...a.hasFree?{hasFree:!0}:{},...a.thinkingConfig?{thinkingConfig:a.thinkingConfig}:{},...a.regions?{regions:a.regions,defaultRegion:a.defaultRegion}:{},...a.hasProviderSpecificData?{hasProviderSpecificData:!0}:{},...a.noAuth?{noAuth:!0}:{},...a.passthroughModels?{passthroughModels:!0}:{},...a.hasOAuth?{hasOAuth:!0}:{},...a.authModes?{authModes:a.authModes}:{},...a.authType?{authType:a.authType}:{},...a.authHint?{authHint:a.authHint}:{},...a.comingSoon?{comingSoon:!0}:{}}}(a)])),h=g("free"),i=g("freeTier"),j=g("oauth"),k=g("apikey"),l=g("webCookie"),m="openai-compatible-",n="anthropic-compatible-",o="custom-embedding-";function p(a){return"string"==typeof a&&a.startsWith(m)}function q(a){return"string"==typeof a&&a.startsWith(n)}function r(a){return"string"==typeof a&&a.startsWith(o)}let s={...h,...i,...j,...k,...l};function t(a){for(let b of Object.values(s))if(b.alias===a||b.id===a)return b;return null}function u(a){let b=t(a);return b?.id||a}function v(a){let b=s[a];return b?.alias||a}let w=Object.values(s).reduce((a,b)=>(a[b.alias]=b.id,a),{});Object.values(s).reduce((a,b)=>(a[b.id]=b.alias,a),{});let x=d.A.filter(a=>a.features?.usage).map(a=>a.id),y=d.A.filter(a=>a.features?.usageApikey).map(a=>a.id)},69788:(a,b,c)=>{c.d(b,{g:()=>i});var d=c(39609),e=c(74129),f=c(24295);let g={oauthUsageUrl:(0,f.U)("claude").oauthUrl,usageUrl:(0,f.U)("claude").orgUrl,settingsUrl:(0,f.U)("claude").settingsUrl,apiVersion:e.b8},h=new Map;async function i(a,b=null){try{let c=h.get(a);if(c&&Date.now()<c)return await j(a,b);let e=await (0,d.proxyAwareFetch)(g.oauthUsageUrl,{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-beta":"oauth-2025-04-20","anthropic-version":g.apiVersion}},b);if(e.ok){let a=await e.json(),b={},c=a=>a&&"object"==typeof a&&"number"==typeof a.utilization,d=a=>{let b=a.utilization,c=Math.max(0,100-b);return{used:b,total:100,remaining:c,remainingPercentage:c,resetAt:(0,f.eZ)(a.resets_at),unlimited:!1}};for(let[e,f]of(c(a.five_hour)&&(b["session (5h)"]=d(a.five_hour)),c(a.seven_day)&&(b["weekly (7d)"]=d(a.seven_day)),Object.entries(a)))if(e.startsWith("seven_day_")&&"seven_day"!==e&&c(f)){let a=e.replace("seven_day_","");b[`weekly ${a} (7d)`]=d(f)}return{plan:"Claude Code",extraUsage:a.extra_usage??null,quotas:b}}return 429===e.status&&h.set(a,Date.now()+18e4),console.warn(`[Claude Usage] OAuth endpoint returned ${e.status}, falling back to legacy`),await j(a,b)}catch(a){return{message:`Claude connected. Unable to fetch usage: ${a.message}`}}}async function j(a,b=null){try{let c=await (0,d.proxyAwareFetch)(g.settingsUrl,{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-version":g.apiVersion}},b);if(c.ok){let e=await c.json();if(e.organization_id){let c=await (0,d.proxyAwareFetch)(g.usageUrl.replace("{org_id}",e.organization_id),{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-version":g.apiVersion}},b);if(c.ok){let a=await c.json();return{plan:e.plan||"Unknown",organization:e.organization_name,quotas:a}}}return{plan:e.plan||"Unknown",organization:e.organization_name,message:"Claude connected. Usage details require admin access."}}return{message:"Claude connected. Usage API requires admin permissions."}}catch(a){return{message:`Claude connected. Unable to fetch usage: ${a.message}`}}}},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},94885:(a,b,c)=>{c.d(b,{RO:()=>r.RO,Yt:()=>r.Yt,my:()=>P});var d=c(39609),e=c(26070),f=c(24295);let g={apiVersion:e.sr.github?.apiVersion,userAgent:e.sr.github?.userAgent};async function h(a,b,c=null){try{if(!a)throw Error("No GitHub access token available. Please re-authorize the connection.");let b=await (0,d.proxyAwareFetch)((0,f.U)("github").url,{headers:{Authorization:`token ${a}`,Accept:"application/json","X-GitHub-Api-Version":g.apiVersion,"User-Agent":g.userAgent,"Editor-Version":"vscode/1.100.0","Editor-Plugin-Version":"copilot-chat/0.26.7"}},c);if(!b.ok){let a=await b.text();throw Error(`GitHub API error: ${a}`)}let e=await b.json();if(e.quota_snapshots){let a=e.quota_snapshots,b=(0,f.eZ)(e.quota_reset_date);return{plan:e.copilot_plan,resetDate:e.quota_reset_date,quotas:{chat:{...i(a.chat),resetAt:b},completions:{...i(a.completions),resetAt:b},premium_interactions:{...i(a.premium_interactions),resetAt:b}}}}if(e.monthly_quotas||e.limited_user_quotas){let a=e.monthly_quotas||{},b=e.limited_user_quotas||{},c=(0,f.eZ)(e.limited_user_reset_date);return{plan:e.copilot_plan||e.access_type_sku,resetDate:e.limited_user_reset_date,quotas:{chat:{used:b.chat||0,total:a.chat||0,unlimited:!1,resetAt:c},completions:{used:b.completions||0,total:a.completions||0,unlimited:!1,resetAt:c}}}}return{message:"GitHub Copilot connected. Unable to parse quota data."}}catch(a){throw Error(`Failed to fetch GitHub usage: ${a.message}`)}}function i(a){return a?{used:a.entitlement-a.remaining,total:a.entitlement,remaining:a.remaining,unlimited:a.unlimited||!1}:{used:0,total:0,unlimited:!0}}var j=c(75924),k=c(74129);let l={...(0,f.U)("antigravity"),...k.XP,userAgent:(0,j.A9)()};async function m(a,b,c=null){if(!a)return{plan:"Free",message:"Gemini CLI access token not available."};try{let d=(0,f.gD)(b?.projectId),e="Free";if(!d){let b=await n(a,c);d=(0,f.gD)(b?.cloudaicompanionProject),e=b?.currentTier?.name||e}if(!d)return{plan:e,message:"Gemini CLI project ID not available. Reconnect Gemini CLI, or configure a Google Cloud project with Gemini Code Assist access before checking quota."};let g=await (0,f.u9)((0,f.U)("gemini-cli").quotaUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({project:d})},1e4,c);if(!g.ok)return{plan:e,message:`Gemini CLI quota error (${g.status}).`};let h=await g.json(),i={};if(Array.isArray(h.buckets))for(let a of h.buckets){if(!a.modelId||null==a.remainingFraction)continue;let b=Number(a.remainingFraction)||0,c=Math.round(1e3*b),d=Math.max(0,1e3-c);i[a.modelId]={used:d,total:1e3,resetAt:(0,f.eZ)(a.resetTime),remainingPercentage:100*b,unlimited:!1}}return{plan:e,quotas:i}}catch(a){return{message:`Gemini CLI error: ${a.message}`}}}async function n(a,b=null){try{let c=await (0,f.u9)((0,f.U)("gemini-cli").loadCodeAssistUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:j.Cn})},1e4,b);if(!c.ok)return null;return await c.json()}catch{return null}}async function o(a,b,c=null){try{let b=await p(a,c),d=b?.cloudaicompanionProject||null,e=await (0,f.u9)(l.quotaApiUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"User-Agent":l.userAgent,"Content-Type":"application/json","X-Client-Name":"antigravity","X-Client-Version":"1.107.0","x-request-source":"local"},body:JSON.stringify({...d?{project:d}:{}})},1e4,c);if(403===e.status)return{message:"Antigravity quota API access forbidden. Chat may still work.",quotas:{}};if(401===e.status)return{message:"Antigravity quota API authentication expired. Chat may still work.",quotas:{}};if(!e.ok)throw Error(`Antigravity API error: ${e.status}`);let g=await e.json(),h={};if(g.models){let a=["gemini-3-flash-agent","gemini-3.5-flash-low","gemini-3.5-flash-extra-low","gemini-pro-agent","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium","gemini-3-flash","gemini-3.1-flash-image","gemini-3-pro-image"];for(let[b,c]of Object.entries(g.models)){if(!c.quotaInfo||c.isInternal||!a.includes(b))continue;let d=c.quotaInfo.remainingFraction||0,e=100*d,g=Math.round(1e3*d),i=1e3-g;h[b]={used:i,total:1e3,resetAt:(0,f.eZ)(c.quotaInfo.resetTime),remainingPercentage:e,unlimited:!1,displayName:c.displayName||b}}}return{plan:b?.currentTier?.name||"Unknown",quotas:h,subscriptionInfo:b}}catch(a){return console.error("[Antigravity Usage] Error:",a.message,a.cause),{message:`Antigravity error: ${a.message}`}}}async function p(a,b=null){try{let c=await (0,f.u9)(l.loadProjectApiUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"User-Agent":l.userAgent,"Content-Type":"application/json","x-request-source":"local"},body:JSON.stringify({metadata:j.Cn,mode:1})},1e4,b);if(!c.ok)return null;return await c.json()}catch(a){return console.error("[Antigravity Subscription] Error:",a.message),null}}var q=c(69788),r=c(6551),s=c(1477);let t={minimax:(0,f.U)("minimax").urls,"minimax-cn":(0,f.U)("minimax-cn").urls};function u(a,b,c){return a&&"object"==typeof a?a[b]??a[c]??null:null}function v(a,b,c){if(!a||"object"!=typeof a)return null;let d=a[b]??a[c];if(null==d)return null;let e=Number(d);return Number.isFinite(e)?Math.max(0,Math.min(100,e)):null}function w(a){return Math.max(0,Number(u(a,"current_interval_total_count","currentIntervalTotalCount"))||0)}function x(a){return Math.max(0,Number(u(a,"current_weekly_total_count","currentWeeklyTotalCount"))||0)}function y(a){return!!(w(a)>0||x(a)>0)||null!==v(a,"current_interval_remaining_percent","currentIntervalRemainingPercent")||null!==v(a,"current_weekly_remaining_percent","currentWeeklyRemainingPercent")}function z(a,b,c,d,e,g,h,i,j,k){let l=d(c),m=v(c,h,i);if(l<=0&&null===m)return;let n=Math.max(0,Number(u(c,e,g))||0),o=l,p=n;l<=0&&(o=100,p=k?Math.round(m/100*o):Math.round(o*(1-m/100))),a[b]=function(a,b,c,d,e=null){var f,g,h;let i=Math.max(0,a),j=d?Math.max(i-b,0):Math.min(Math.max(0,b),i),k=Math.max(i-j,0),l=(f=e,g=k,h=i,null!=f&&Number.isFinite(f)?Math.max(0,Math.min(100,f)):h>0?Math.max(0,Math.min(100,g/h*100)):0);return{used:j,total:i,remaining:k,remainingPercentage:l,resetAt:c,unlimited:!1}}(o,p,function(a,b,c,d,e,g){let h=Number(u(a,c,d))||0;return h>0?new Date(b+h).toISOString():(0,f.eZ)(u(a,e,g))}(c,...j),k,m)}async function A(a,b,c=null){if(!a)return{message:"MiniMax API key not available."};let e=t[b]||[],f="";for(let b=0;b<e.length;b+=1){let g=e[b],h=b<e.length-1;try{let b=await (0,d.proxyAwareFetch)(g,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","Content-Type":"application/json"}},c),e=await b.text(),i={};if(e)try{i=JSON.parse(e)}catch{i={}}let j=(i?.base_resp??i?.baseResp)||{},k=Number(j.status_code??j.statusCode)||0,l=String(j.status_msg??j.statusMsg??"").trim(),m=`${l} ${e}`.trim(),n=/token plan|coding plan|invalid api key|invalid key|unauthorized|inactive/i;if(401===b.status||403===b.status||1004===k||n.test(m))return{message:"MiniMax API key invalid or inactive. Use an active Token/Coding Plan key."};if(!b.ok){if(f=`MiniMax usage endpoint error (${b.status})`,(404===b.status||405===b.status||b.status>=500)&&h)continue;return{message:`MiniMax connected. ${f}`}}if(0!==k)return{message:`MiniMax connected. ${l||"Upstream quota API error"}`};let o=i?.model_remains??i?.modelRemains,p=(Array.isArray(o)?o:[]).filter(y);if(0===p.length)return{message:"MiniMax connected. No quota data was returned."};let q=Date.now(),r=g.includes("/coding_plan/remains"),s={};for(let a of p){let b=function(a){let b=String(u(a,"model_name","modelName")||"").trim();return b?"MiniMax-M*"===b||"general"===b?"M-series":b.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,a=>a.toUpperCase()).replace(/\bTo\b/g,"to").replace(/\bTts\b/g,"TTS").replace(/\bHd\b/g,"HD"):"MiniMax"}(a);z(s,`${b} (5h)`,a,w,"current_interval_usage_count","currentIntervalUsageCount","current_interval_remaining_percent","currentIntervalRemainingPercent",[q,"remains_time","remainsTime","end_time","endTime"],r),z(s,`${b} (7d)`,a,x,"current_weekly_usage_count","currentWeeklyUsageCount","current_weekly_remaining_percent","currentWeeklyRemainingPercent",[q,"weekly_remains_time","weeklyRemainsTime","weekly_end_time","weeklyEndTime"],r)}if(0===Object.keys(s).length)return{message:"MiniMax connected. Unable to extract quota usage."};return{quotas:s}}catch(a){if(f=a.message,!h)break}}return{message:f?`MiniMax connected. Unable to fetch usage: ${f}`:"MiniMax connected. Unable to fetch usage."}}let B="codebuddy-cn";function C(a,b){let c=Number(a??b);return Number.isFinite(c)?c:0}async function D(a,b,c,g=null){let h=a||b;if(!h)return{message:"CodeBuddy CN credential not available."};try{let a=await (0,d.proxyAwareFetch)((0,f.U)(B).url,{method:"POST",headers:{...e.xq[B]?.headers||{},Authorization:`Bearer ${h}`,"Content-Type":"application/json",Accept:"application/json"},body:"{}"},g);if(401===a.status||403===a.status)return{message:"CodeBuddy CN credential invalid or expired."};if(!a.ok)return{message:`CodeBuddy CN quota API error (${a.status}).`};let b=await a.json();if(b?.code!==0)return{message:`CodeBuddy CN quota error: ${b?.msg||"unknown"}`};let c=b?.data?.Response?.Data||{},i=Array.isArray(c.Accounts)?c.Accounts:[];if(0===i.length)return{message:"CodeBuddy CN connected. No credit package found."};let j=a=>{let b=(0,f.eZ)(a.CycleEndTime);return b?new Date(b).getTime():1/0},k=a=>{let b=j(a),c=Number(a.DeductionEndTime);return Number.isFinite(b)&&Number.isFinite(c)&&c-b>1728e5},l=(a,b)=>j(a)-j(b),m=i.filter(k).sort(l),n=i.filter(a=>!k(a)).sort(l),o={},p={};m.forEach(a=>{let b=function(a){let b=(0,f.eZ)(a.CycleStartTime),c=(0,f.eZ)(a.CycleEndTime);if(b&&c){let a=(new Date(c).getTime()-new Date(b).getTime())/864e5;if(a<=1.5)return"Daily";if(a<=10)return"Weekly"}return"Monthly"}(a);p[b]=(p[b]||0)+1,o[p[b]>1?`${b} ${p[b]}`:b]={used:C(a.CycleCapacityUsedPrecise,a.CycleCapacityUsed),total:C(a.CycleCapacitySizePrecise,a.CycleCapacitySize),resetAt:(0,f.eZ)(a.CycleEndTime),unlimited:!1,recurring:!0}}),n.forEach((a,b)=>{o[`Bonus Pack ${b+1}`]={used:C(a.CapacityUsedPrecise,a.CapacityUsed),total:C(a.CapacitySizePrecise,a.CapacitySize),resetAt:(0,f.eZ)(a.CycleEndTime),unlimited:!1,recurring:!1}});let q=m[0]||i[0]||{};return{plan:q.PackageName||q.SubProductName||"CodeBuddy CN",quotas:o}}catch(a){return{message:`CodeBuddy CN error: ${a.message}`}}}let E={international:(0,f.U)("glm").url,china:(0,f.U)("glm-cn").url},F=(0,f.U)("vercel-ai-gateway").url;async function G(a,b){try{if(!b?.resourceUrl)return{message:"Qwen connected. No resource URL available."};return{message:"Qwen connected. Usage tracked per request."}}catch(a){return{message:"Unable to fetch Qwen usage."}}}async function H(a){try{return{message:"iFlow connected. Usage tracked per request."}}catch(a){return{message:"Unable to fetch iFlow usage."}}}async function I(a,b){try{return{plan:b?.plan||"Free",message:"Ollama Cloud uses a free tier with light usage limits (resets every 5h & 7d). For detailed usage tracking, visit ollama.com/settings/keys.",quotas:[]}}catch(a){return{message:"Unable to fetch Ollama Cloud usage."}}}async function J(a,b,c=null){if(!a)return{message:"GLM API key not available."};let e=E["glm-cn"===b?"china":"international"];try{let b=await (0,d.proxyAwareFetch)(e,{headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},c);if(!b.ok){if(401===b.status)return{message:"GLM API key invalid or expired."};return{message:`GLM quota API error (${b.status}).`}}let f=await b.json(),g=f?.data&&"object"==typeof f.data?f.data:{},h=Array.isArray(g.limits)?g.limits:[],i={};for(let a of h){if(!a||"TOKENS_LIMIT"!==a.type)continue;let b=Number(a.percentage)||0,c=Number(a.nextResetTime)||0,d=Math.max(0,100-b);i.session={used:b,total:100,remaining:d,remainingPercentage:d,resetAt:c>0?new Date(c).toISOString():null,unlimited:!1}}let j="string"==typeof g.level?g.level:"";return{plan:j?j.charAt(0).toUpperCase()+j.slice(1).toLowerCase():"Unknown",quotas:i}}catch(a){return{message:`GLM error: ${a.message}`}}}async function K(a,b=null){if(!a)return{message:"Vercel AI Gateway API key not available."};try{let c=await (0,d.proxyAwareFetch)(F,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(401===c.status||403===c.status)return{message:"Vercel AI Gateway API key invalid or expired."};if(!c.ok){let a=await c.text().catch(()=>""),b=a?`: ${a.slice(0,200)}`:"";return{message:`Vercel AI Gateway credits API error (${c.status})${b}`}}let e=await c.json(),f=Number(e?.balance)||0,g=Number(e?.total_used)||0;if(f<=0&&g<=0)return{plan:"Pay-as-you-go",message:"Vercel AI Gateway connected. No credit allocation found (BYOK or unfunded account).",quotas:{}};return{plan:"Pay-as-you-go",quotas:{"Used (USD)":{used:g,total:0,remaining:0,remainingPercentage:100,unlimited:!0},"Remaining (USD)":{used:f,total:5,remaining:f,remainingPercentage:f/5*100,unlimited:!1}}}}catch(a){return{message:`Vercel AI Gateway error: ${a.message}`}}}async function L(a,b=null){if(!a)return{message:"Qoder usage unavailable: no access token"};try{let c=await (0,d.proxyAwareFetch)((0,f.U)("qoder").url,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(!c.ok)return{message:`Qoder connected. Usage fetch returned ${c.status}.`};let e=await c.json().catch(()=>null);if(!e)return{message:"Qoder connected. Usage response was not JSON."};let g=e.userQuota||{},h=e.orgResourcePackage||{},i=Number.isFinite(Number(e.expiresAt))&&Number(e.expiresAt)>0?Number(e.expiresAt):null,j=i?new Date(i).toISOString():null;return{quotas:{user:{total:Number(g.total)||0,used:Number(g.used)||0,remaining:Number(g.remaining)||0,unit:g.unit||"credits",resetAt:j},organization:{total:Number(h.total)||0,used:Number(h.used)||0,remaining:Number(h.remaining)||0,unit:h.unit||"credits",resetAt:j}},totalUsagePercentage:Number(e.totalUsagePercentage)||0,isQuotaExceeded:!!e.isQuotaExceeded,expiresAt:i}}catch(a){return{message:`Qoder connected. Unable to fetch usage: ${a.message}`}}}async function M(a,b=null){return(f.U,a?.providerSpecificData?.mgmtKey||a?.providerDataWithProjectId?.mgmtKey)?{quotas:{},plan:null,credits:null,message:"xAI Management API key detected, but the billing endpoint is not yet implemented. Usage tracking for xAI is pending upstream documentation."}:{quotas:{},plan:null,credits:null,message:"xAI removed the public billing API. Usage tracking is only available in the xAI Console at console.x.ai → Billing."}}async function N(a,b={},c=null){let e,g=b?.mgmtKey||a?.providerSpecificData?.mgmtKey;if(!g)return{quotas:{},plan:null,message:"No management key set. Edit the connection and add your TokenRouter management key (separate from the chat API key) to enable wallet tracking."};let h=(0,f.U)("tokenrouter").walletUrl;if(!h)return null;let i={Authorization:`Bearer ${g}`,Accept:"application/json","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"};try{e=await (0,d.proxyAwareFetch)(h,{method:"GET",headers:i},c)}catch{return{quotas:{},plan:null,message:"Could not reach TokenRouter wallet API (network error)."}}if(!e?.ok){let a=e?.status??0;return{quotas:{},plan:null,message:401===a||403===a?"Authentication failed — check that your management key is correct and hasn't expired.":`Wallet API returned HTTP ${a}.`}}let j=await e.json().catch(()=>null);if(!j?.success||!j.data)return{quotas:{},plan:null,message:"Wallet API returned an unexpected response shape."};let k=j.data,l=(0,f.IQ)(k.topUpBalance),m=(0,f.IQ)(k.voucherEfficientAmount),n=(0,f.IQ)(k.toppedUpSpent),o=(0,f.IQ)(k.voucherSpent),p=l+m,q=n+o,r=p+q,s={Wallet:{used:q,total:r,remaining:p,remainingPercentage:r>0?Math.round(p/r*100):null,resetAt:null}};if(l>0||n>0){let a=l+n;s["Top-up"]={used:n,total:a,remaining:l,remainingPercentage:a>0?Math.round(l/a*100):null,resetAt:null}}if(m>0||o>0){let a=m+o;s.Voucher={used:o,total:a,remaining:m,remainingPercentage:a>0?Math.round(m/a*100):null,resetAt:null}}return{quotas:s,plan:null,credits:{remaining:p,used:q,total:r}}}let O={github:a=>h(a.accessToken,a.providerSpecificData,a.proxyOptions),"gemini-cli":a=>m(a.accessToken,a.providerDataWithProjectId,a.proxyOptions),antigravity:a=>o(a.accessToken,a.providerSpecificData,a.proxyOptions),claude:a=>(0,q.g)(a.accessToken,a.proxyOptions),codex:a=>(0,r.Tl)(a.accessToken,a.proxyOptions),kiro:a=>(0,s.getKiroUsage)(a.accessToken,a.providerSpecificData,a.proxyOptions),qoder:a=>L(a.accessToken,a.proxyOptions),qwen:a=>G(a.accessToken,a.providerSpecificData),iflow:a=>H(a.accessToken),ollama:a=>I(a.accessToken),glm:a=>J(a.apiKey,a.provider,a.proxyOptions),"glm-cn":a=>J(a.apiKey,a.provider,a.proxyOptions),minimax:a=>A(a.apiKey,a.provider,a.proxyOptions),"minimax-cn":a=>A(a.apiKey,a.provider,a.proxyOptions),"vercel-ai-gateway":a=>K(a.apiKey,a.proxyOptions),"codebuddy-cn":a=>D(a.accessToken,a.apiKey,a.providerSpecificData,a.proxyOptions),xai:a=>M(a,a.proxyOptions),tokenrouter:a=>N(a,a.providerSpecificData,a.proxyOptions)};async function P(a,b=null){let{provider:c,accessToken:d,apiKey:e,providerSpecificData:f,projectId:g}=a,h={...f||{},...g?{projectId:g}:{}},i=O[c];return i?await i({provider:c,accessToken:d,apiKey:e,providerSpecificData:f,providerDataWithProjectId:h,proxyOptions:b}):{message:`Usage API not implemented for ${c}`}}}};
|
|
@@ -57,7 +57,7 @@ Respond ONLY with the JSON object, no other text.`)}else"json_object"===a.type&&
|
|
|
57
57
|
[CommandCode error: ${c}]`})),e.push(l(b,{},f.bC.STOP))}}return e.length?e:null}(0,d.kz)(e.h.COMMANDCODE,e.h.OPENAI,null,n)},52136:(a,b,c)=>{c.d(b,{NU:()=>j,nF:()=>h,sS:()=>i,z:()=>p});var d=c(66306),e=c(26070),f=c(58028);let g={openai:"openai","openai-responses":"openai","openai-response":"openai",codex:"openai",claude:"claude-budget",gemini:"gemini-budget","gemini-cli":"gemini-budget",vertex:"gemini-budget",antigravity:"gemini-budget",kiro:"kiro"};function h(a){if("string"!=typeof a)return{cleanModel:a,override:null};let b=a.match(/^(.*)\(([^()]+)\)\s*$/);if(!b)return{cleanModel:a,override:null};let c=b[1].trim(),d=b[2].trim().toLowerCase();return"none"===d||"off"===d?{cleanModel:c,override:{mode:"none"}}:"auto"===d?{cleanModel:c,override:{mode:"auto"}}:/^\d+$/.test(d)?{cleanModel:c,override:{mode:"budget",budget:Number(d)}}:void 0!==f.Dl[d]?{cleanModel:c,override:{mode:"level",level:d}}:{cleanModel:c,override:null}}function i(a){if(!a||"object"!=typeof a)return null;let b=a.output_config?.effort;if("string"==typeof b&&b){let a=b.toLowerCase();return"none"===a||"off"===a?{mode:"none"}:"auto"===a?{mode:"auto"}:{mode:"level",level:a}}let c=a.thinking;if(c&&"object"==typeof c){if("disabled"===c.type)return{mode:"none"};if("adaptive"===c.type||"enabled"===c.type){let a=Number(c.budget_tokens);return Number.isFinite(a)&&a>0?{mode:"budget",budget:a}:{mode:"auto"}}}let d=a.reasoning_effort??("object"==typeof a.reasoning?a.reasoning?.effort:null);if("string"==typeof d&&d){let a=d.toLowerCase();return"none"===a||"off"===a?{mode:"none"}:"auto"===a?{mode:"auto"}:{mode:"level",level:a}}let e=a.thinkingConfig||a.generationConfig?.thinkingConfig||a.request?.generationConfig?.thinkingConfig;if(e&&"object"==typeof e){if("string"==typeof e.thinkingLevel)return{mode:"level",level:e.thinkingLevel.toLowerCase()};let a=Number(e.thinkingBudget);if(Number.isFinite(a))return 0===a?{mode:"none"}:a<0?{mode:"auto"}:{mode:"budget",budget:a}}if(!1===a.enable_thinking)return{mode:"none"};if(!0===a.enable_thinking){let b=Number(a.thinking_budget);return Number.isFinite(b)&&b>0?{mode:"budget",budget:b}:{mode:"auto"}}return null}let j=i;function k(a,b){let c;if("budget"===a.mode)c=a.budget;else if("level"===a.mode)c=(0,f.nE)(a.level);else if("auto"===a.mode)return -1;if(Number.isFinite(c))return b&&(null!=b.min&&c<b.min&&(c=b.min),null!=b.max&&c>b.max&&(c=b.max)),c}let l=new Set(["minimal","low","medium","high","xhigh","max"]);function m(a){return"level"===a.mode?l.has(a.level)?a.level:null:"budget"===a.mode?(0,f.vz)(a.budget)||"medium":"auto"===a.mode?"auto":null}function n(a,b){(a.request?.generationConfig?a.request.generationConfig:a.generationConfig&&"object"==typeof a.generationConfig?a.generationConfig:a.generationConfig={}).thinkingConfig=b}function o(a){delete a.thinking,delete a.reasoning_effort,delete a.reasoning,delete a.thinkingConfig,delete a.enable_thinking,delete a.thinking_budget,delete a.output_config,a.generationConfig&&delete a.generationConfig.thinkingConfig,a.request?.generationConfig&&delete a.request.generationConfig.thinkingConfig}function p(a,b,c,j=null,l){if(!c||"object"!=typeof c)return c;let{cleanModel:q,override:r}=h(b),s=r||l||i(c),t=(0,d.nl)(j,q);if(!t.reasoning)return o(c),c;if(!s)return c;let u=function(a,b,c){let f=c?e.xq[c]?.thinkingFormat:null;if(f)return f;let h=(0,d.nl)(c,b);return h.thinkingFormat?h.thinkingFormat:g[a]||"openai"}(a,q,j);return o(c),!function(a,b,c,d){let e="none"===c.mode,g=!1!==d.thinkingCanDisable,h=e&&!g?{mode:"level",level:"minimal"}:c;switch(a){case"openai":{if(e&&g){b.reasoning_effort="none";break}let a=m(h);a&&(b.reasoning_effort=a);break}case"claude-adaptive":{if(e&&g){b.thinking={type:"disabled"};break}let a=m(h);b.output_config={effort:"xhigh"===a?"high":a};break}case"claude-budget":{if(e&&g){b.thinking={type:"disabled"};break}let a=k(h,d.thinkingRange);b.thinking=-1===a?{type:"enabled"}:{type:"enabled",budget_tokens:a||8192};break}case"gemini-level":{let a,c=e?"minimal":(a="auto"===h.mode?"high":m(h)||"high",(0,f.wd)(a));n(b,{thinkingLevel:c,includeThoughts:"minimal"!==c});break}case"gemini-budget":if(e&&g){n(b,{thinkingBudget:0,includeThoughts:!1});break}n(b,{thinkingBudget:k(h,d.thinkingRange)??-1,includeThoughts:!0});break;case"zai":if(e&&g){b.enable_thinking=!1,delete b.thinking;break}b.thinking={type:"enabled"};break;case"qwen":{if(e&&g){b.enable_thinking=!1;break}b.enable_thinking=!0;let a=k(h,d.thinkingRange);Number.isFinite(a)&&a>0&&(b.thinking_budget=a);break}case"deepseek":{if(e&&g){b.thinking={type:"disabled"};break}b.thinking={type:"enabled"};let a=m(h);b.reasoning_effort="xhigh"===a||"max"===a?"max":"high";break}case"kimi":{if(e&&g){b.thinking={type:"disabled"};break}let a=m(h);a&&"auto"!==a&&(b.reasoning_effort="minimal"===a?"low":"xhigh"===a||"max"===a?"high":a);break}case"minimax":b.thinking={type:e&&g?"disabled":"adaptive"};break;case"hunyuan":{if(e&&g){b.thinking={type:"disabled"};break}let a=k(h,d.thinkingRange);b.thinking=-1===a?{type:"enabled"}:{type:"enabled",budget_tokens:a||8192};break}case"step":{if(e&&g)break;let a=m(h);a&&"auto"!==a&&(b.reasoning_effort="minimal"===a?"low":"xhigh"===a||"max"===a?"high":a)}}}(u,c,s,t),c}},55399:(a,b,c)=>{c.d(b,{Az:()=>f,fO:()=>i,kR:()=>g});var d=c(55511),e=c(75924);function f(a){let b=a.tools;if(!b||0===b.length)return{body:a,toolNameMap:null};let c=a=>`${a}${e.uR}`,d=new Map,f=new Set,g=[];for(let a of b){if(a.type){g.push(a);continue}let b=c(a.name);d.set(b,a.name),f.add(a.name),g.push({...a,name:b})}let i=[...g,...h],j=a.messages?.map(a=>{if(!Array.isArray(a.content))return a;let b=a.content.map(a=>"tool_use"===a.type?{...a,name:c(a.name)}:a);return{...a,content:b}}),k={...a,tools:i,messages:j||a.messages};return a.tool_choice?.type==="tool"&&f.has(a.tool_choice.name)&&(k.tool_choice={...a.tool_choice,name:c(a.tool_choice.name)}),{body:k,toolNameMap:d.size>0?d:null}}function g(a,b){if(!b?.size||!Array.isArray(a?.content))return a;let c=a.content.map(a=>a?.type==="tool_use"&&b.has(a.name)?{...a,name:b.get(a.name)}:a);return{...a,content:c}}let h=[{name:"Task",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskOutput",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskStop",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskCreate",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskGet",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskUpdate",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskList",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Bash",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Glob",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Grep",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Read",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Edit",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Write",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"NotebookEdit",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"WebFetch",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"WebSearch",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"AskUserQuestion",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Skill",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"EnterPlanMode",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"ExitPlanMode",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}}];function i(a,b,c){var e;let f,g,h,i,j,k,l;if(!b||!b.includes("sk-ant-oat"))return a;let m={...a},n={type:"text",text:(f=JSON.stringify(a),g=(0,d.createHash)("sha256").update(f).digest("hex").slice(0,5),h=(0,d.randomBytes)(2).toString("hex").slice(0,3),`x-anthropic-billing-header: cc_version=2.1.92.${h}; cc_entrypoint=sdk-cli; cch=${g};`)};return Array.isArray(m.system)?m.system[0]?.text?.startsWith("x-anthropic-billing-header:")||(m.system=[n,...m.system]):"string"==typeof m.system?m.system=[n,{type:"text",text:m.system}]:m.system=[n],m.metadata?.user_id||(m.metadata={...m.metadata,user_id:(i=b?(0,d.createHash)("sha256").update(`device:${b}`).digest("hex"):(0,d.randomBytes)(32).toString("hex"),k=b?(e=`account:${b}`,j=(0,d.createHash)("sha256").update(e).digest("hex"),`${j.slice(0,8)}-${j.slice(8,12)}-4${j.slice(13,16)}-${(3&parseInt(j[16],16)|8).toString(16)}${j.slice(17,20)}-${j.slice(20,32)}`):(0,d.randomUUID)(),l=c||(0,d.randomUUID)(),`{"device_id":"${i}","account_uuid":"${k}","session_id":"${l}"}`)}),m}},55673:(a,b,c)=>{c.d(b,{R4:()=>g,BY:()=>l,a_:()=>j.a_,RV:()=>e,rP:()=>k,x4:()=>f,bC:()=>j.bC,Du:()=>h,z7:()=>d,m8:()=>i});let d={USER:"user",ASSISTANT:"assistant",TOOL:"tool",SYSTEM:"system",DEVELOPER:"developer"},e={USER:"user",MODEL:"model"},f={TEXT:"text",IMAGE_URL:"image_url",IMAGE:"image",INPUT_AUDIO:"input_audio",AUDIO_URL:"audio_url",FILE:"file",FUNCTION:"function"},g={TEXT:"text",IMAGE:"image",DOCUMENT:"document",TOOL_USE:"tool_use",TOOL_RESULT:"tool_result",THINKING:"thinking",REDACTED_THINKING:"redacted_thinking"},h={MESSAGE:"message",FUNCTION_CALL:"function_call",FUNCTION_CALL_OUTPUT:"function_call_output",REASONING:"reasoning",OUTPUT_TEXT:"output_text",INPUT_TEXT:"input_text",INPUT_IMAGE:"input_image",SUMMARY_TEXT:"summary_text"},i=[f.TEXT,f.IMAGE_URL,f.IMAGE,f.INPUT_AUDIO,f.AUDIO_URL,f.FILE];f.TEXT,f.IMAGE_URL,f.IMAGE,g.TOOL_RESULT;var j=c(69320);let k="unknown",l="image/png"},57647:(a,b,c)=>{c.d(b,{SZ:()=>n,Tz:()=>k,jJ:()=>l,oF:()=>m});var d=c(35024),e=c(74129);let f={baseUrl:e.Es},g={baseUrl:e.ky};function h(a){return"string"==typeof a&&a.startsWith("openai-compatible-")}function i(a){return"string"==typeof a&&a.startsWith("anthropic-compatible-")}function j(a){return h(a)&&a.includes("responses")?"responses":"chat"}function k(a){if(a.input&&(Array.isArray(a.input)||"string"==typeof a.input)&&!a.messages)return"openai-responses";if(a.request?.contents&&"antigravity"===a.userAgent)return"antigravity";if(a.contents&&Array.isArray(a.contents))return"gemini";if(a.stream_options||a.response_format||void 0!==a.logprobs||void 0!==a.top_logprobs||void 0!==a.n||void 0!==a.presence_penalty||void 0!==a.frequency_penalty||a.logit_bias||a.user)return"openai";if(a.messages&&Array.isArray(a.messages)){let b=a.messages[0];if(b?.content&&Array.isArray(b.content)){let c=b.content[0];if(c?.type==="text"&&!a.model?.includes("/")){if(a.system||a.anthropic_version)return"claude";let c=b.content.some(a=>"image"===a.type&&a.source?.type==="base64"),d=b.content.some(a=>"image_url"===a.type&&a.image_url?.url);if(c)return"claude";if(d)return"openai";if(b.content.some(a=>"tool_use"===a.type||"tool_result"===a.type))return"claude"}}if(void 0!==a.system||a.anthropic_version)return"claude"}return"openai"}function l(a){return h(a)?"responses"===j(a)?"openai-responses":"openai":i(a)?"claude":function(a){if(h(a)){let b=j(a);return{...d.xq.openai,format:"responses"===b?"openai-responses":"openai",baseUrl:f.baseUrl}}return i(a)?{...d.xq.anthropic,format:"claude",baseUrl:g.baseUrl}:d.xq[a]||d.xq.openai}(a).format||"openai"}function m(a,b){let c=d.xq[a],e=c?.transports;return Array.isArray(e)&&e.length&&e.find(a=>a.format===b)||null}function n(a){return!function(a){let b=a.messages||a.contents;if(!b?.length)return!0;let c=b[b.length-1];return c?.role==="user"}(a)&&delete a.thinking,a}},58028:(a,b,c)=>{c.d(b,{Dl:()=>d,Vp:()=>h,nE:()=>e,vz:()=>g,wd:()=>f});let d={none:0,minimal:512,low:1024,medium:8192,high:24576,xhigh:32768,max:128e3};function e(a){if(a)return d[String(a).toLowerCase()]}function f(a){let b=String(a).toLowerCase().trim();return"none"===b||"off"===b?"minimal":"xhigh"===b||"max"===b?"high":b}function g(a){let b=Number(a);return!b||b<=0?null:b<=768?"minimal":b<=4096?"low":b<=16384?"medium":b<=28672?"high":"xhigh"}function h(a){return!a||a<=0?null:a<=2048?"low":a<=16384?"medium":"high"}},60983:(a,b,c)=>{c.d(b,{t:()=>k});var d=c(78833),e=c(14170),f=c(74525),g=c(71301),h=c(55673),i=c(97721);function j(a){return"string"!=typeof a?"":a.replace(/^x-anthropic-billing-header:[^\n]*(?:\r?\n)?/i,"")}function k(a,b,c){let d={model:a,messages:[],stream:c};if(b.max_tokens&&(d.max_tokens=(0,f.M)(b)),void 0!==b.temperature&&(d.temperature=b.temperature),b.system){let a=Array.isArray(b.system)?b.system.map(a=>j(a.text||"")).filter(Boolean).join("\n"):j(b.system);a&&d.messages.push({role:h.z7.SYSTEM,content:a})}if(b.messages&&Array.isArray(b.messages))for(let a=0;a<b.messages.length;a++){let c=function(a){if(a.role===h.z7.SYSTEM){var b;let c,d=(c=(Array.isArray(b=a.content)?b.filter(a=>a?.type===h.R4.TEXT).map(a=>a.text||""):["string"==typeof b?b:""]).filter(Boolean).join("\n")).trim()?`<system-reminder>
|
|
58
58
|
${c}
|
|
59
59
|
</system-reminder>`:"";return d?{role:h.z7.USER,content:d}:null}let c=a.role===h.z7.USER||a.role===h.z7.TOOL?h.z7.USER:h.z7.ASSISTANT;if("string"==typeof a.content)return{role:c,content:a.content};if(Array.isArray(a.content)){let b=[],d=[],e=[];for(let c of a.content)switch(c.type){case h.R4.TEXT:b.push({type:h.x4.TEXT,text:c.text});break;case h.R4.IMAGE:c.source?.type==="base64"&&b.push({type:h.x4.IMAGE_URL,image_url:{url:(0,g.$q)(c.source.media_type,c.source.data)}});break;case h.R4.TOOL_USE:d.push({id:c.id,type:h.x4.FUNCTION,function:{name:c.name,arguments:JSON.stringify(c.input||{})}});break;case h.R4.TOOL_RESULT:let a="";"string"==typeof c.content?a=c.content:Array.isArray(c.content)?a=c.content.filter(a=>a.type===h.R4.TEXT).map(a=>a.text).join("\n")||JSON.stringify(c.content):c.content&&(a=JSON.stringify(c.content)),e.push({role:h.z7.TOOL,tool_call_id:c.tool_use_id,content:a})}if(e.length>0)return b.length>0?[...e,{role:h.z7.USER,content:(0,i.z)(b)}]:e;if(d.length>0){let a={role:h.z7.ASSISTANT};return b.length>0&&(a.content=(0,i.z)(b)),a.tool_calls=d,a}if(b.length>0)return{role:c,content:(0,i.z)(b)};if(0===a.content.length)return{role:c,content:""}}return null}(b.messages[a]);c&&(Array.isArray(c)?d.messages.push(...c):d.messages.push(c))}return function(a){for(let b=0;b<a.length;b++){let c=a[b];if(c.role===h.z7.ASSISTANT&&c.tool_calls&&c.tool_calls.length>0){let d=c.tool_calls.map(a=>a.id),e=new Set,f=b+1;for(let c=b+1;c<a.length;c++){let b=a[c];if(b.role===h.z7.TOOL&&b.tool_call_id)e.add(b.tool_call_id),f=c+1;else break}let g=d.filter(a=>!e.has(a));if(g.length>0){let c=g.map(a=>({role:h.z7.TOOL,tool_call_id:a,content:"[No response received]"}));a.splice(f,0,...c),b=f+c.length-1}}}}(d.messages),b.tools&&Array.isArray(b.tools)&&(d.tools=b.tools.map(a=>({type:h.x4.FUNCTION,function:{name:a.name,description:String(a.description||""),parameters:a.input_schema||{type:"object",properties:{}}}}))),b.tool_choice&&(d.tool_choice=function(a){if(!a)return"auto";if("string"==typeof a)return a;switch(a.type){case"auto":default:return"auto";case"any":return"required";case"tool":return{type:h.x4.FUNCTION,function:{name:a.name}}}}(b.tool_choice)),void 0!==b.reasoning_effort?d.reasoning_effort=b.reasoning_effort:b.reasoning?.effort!==void 0&&(d.reasoning_effort=b.reasoning.effort),void 0!==b.reasoning&&(d.reasoning=b.reasoning),d}(0,d.kz)(e.h.CLAUDE,e.h.OPENAI,k,null)},62842:(a,b,c)=>{c.d(b,{N:()=>d});function d(a,b){if("string"!=typeof a)return a;try{return JSON.parse(a)}catch{return b}}},65377:(a,b,c)=>{c.d(b,{Z:()=>i,h:()=>k});var d=c(78833),e=c(14170),f=c(37981),g=c(55673);let h=a=>"string"==typeof a&&a.length>64?a.substring(0,64):a;function i(a,b,c,d){if(!b.input)return b;let e={...b};e.messages=[],b.instructions&&e.messages.push({role:g.z7.SYSTEM,content:b.instructions});let h=null,i=[],k="",l=(0,f.m)(b.input);if(!l)return b;let m=a=>{if(Array.isArray(a.summary)){let b=a.summary.map(a=>a?.text||"").filter(Boolean).join("\n");if(b)return b}if(Array.isArray(a.content)){let b=a.content.map(a=>a?.text||"").filter(Boolean).join("\n");if(b)return b}return""};for(let a of l){let b=a.type||(a.role?g.Du.MESSAGE:null);if(b===g.Du.MESSAGE){if(h&&(e.messages.push(h),h=null),i.length>0){for(let a of i)e.messages.push(a);i=[]}let b=Array.isArray(a.content)?a.content.map(a=>{if(a.type===g.Du.INPUT_TEXT||a.type===g.Du.OUTPUT_TEXT)return{type:g.x4.TEXT,text:a.text};if(a.type===g.Du.INPUT_IMAGE){let b=a.image_url||a.file_id||"";return{type:g.x4.IMAGE_URL,image_url:{url:b,detail:a.detail||"auto"}}}return a}):a.content,c={role:a.role,content:b};a.role===g.z7.ASSISTANT&&k&&(c.reasoning_content=k),k="",e.messages.push(c)}else if(b===g.Du.FUNCTION_CALL){if(!h&&(h={role:g.z7.ASSISTANT,content:null,tool_calls:[]},k&&(h.reasoning_content=k,k="")),!a.name||"string"!=typeof a.name||""===a.name.trim())continue;h.tool_calls.push({id:a.call_id,type:g.x4.FUNCTION,function:{name:a.name,arguments:a.arguments}})}else if(b===g.Du.FUNCTION_CALL_OUTPUT){if(h&&(e.messages.push(h),h=null),i.length>0){for(let a of i)e.messages.push(a);i=[]}e.messages.push({role:g.z7.TOOL,tool_call_id:a.call_id,content:"string"==typeof a.output?a.output:JSON.stringify(a.output)})}else if(b===g.Du.REASONING){let b=m(a);b&&(k=k?`${k}
|
|
60
|
-
${b}`:b);continue}}if(h&&e.messages.push(h),i.length>0)for(let a of i)e.messages.push(a);return b.tools&&Array.isArray(b.tools)&&(e.tools=b.tools.map(a=>{if(a.function)return a;let b=a.name;return b&&"string"==typeof b&&""!==b.trim()?{type:g.x4.FUNCTION,function:{name:b,description:String(a.description||""),parameters:j(a.parameters),strict:a.strict}}:null}).filter(Boolean)),void 0!==e.max_output_tokens&&(void 0===e.max_tokens&&(e.max_tokens=e.max_output_tokens),delete e.max_output_tokens),delete e.input,delete e.instructions,delete e.include,delete e.prompt_cache_key,delete e.store,delete e.reasoning,e}function j(a){return a?"object"!==a.type||a.properties?a:{...a,properties:{}}:{type:"object",properties:{}}}function k(a,b,c,d){if(b.input)return{...b,model:a,stream:!0};let e={model:a,input:[],stream:!0,store:!1},f=!1;for(let a of b.messages||[]){if(a.role===g.z7.SYSTEM){f||(e.instructions="string"==typeof a.content?a.content:"",f=!0);continue}if(a.role===g.z7.USER||a.role===g.z7.ASSISTANT){let b=a.role===g.z7.USER?g.Du.INPUT_TEXT:g.Du.OUTPUT_TEXT,c="string"==typeof a.content?[{type:b,text:a.content}]:Array.isArray(a.content)?a.content.map(a=>{if(a.type===g.x4.TEXT)return{type:b,text:a.text};if(a.type===g.x4.IMAGE_URL){let b="string"==typeof a.image_url?a.image_url:a.image_url?.url;return{type:g.Du.INPUT_IMAGE,image_url:b,detail:a.image_url?.detail||"auto"}}if(a.type===g.Du.INPUT_IMAGE)return a;let c=a.text||a.content||JSON.stringify(a);return{type:b,text:"string"==typeof c?c:JSON.stringify(c)}}):[];c.length>0&&e.input.push({type:g.Du.MESSAGE,role:a.role,content:c})}if(a.role===g.z7.ASSISTANT&&a.tool_calls)for(let b of a.tool_calls)e.input.push({type:g.Du.FUNCTION_CALL,call_id:h(b.id),name:b.function?.name||"_unknown",arguments:b.function?.arguments||"{}"});if(a.role===g.z7.TOOL){let b="string"==typeof a.content?a.content:Array.isArray(a.content)?a.content.map(a=>a.text||JSON.stringify(a)).join(""):JSON.stringify(a.content);e.input.push({type:g.Du.FUNCTION_CALL_OUTPUT,call_id:h(a.tool_call_id),output:b})}}return f||(e.instructions=""),b.tools&&Array.isArray(b.tools)&&(e.tools=b.tools.map(a=>a.type===g.x4.FUNCTION?{type:g.x4.FUNCTION,name:a.function.name,description:String(a.function.description||""),parameters:j(a.function.parameters),strict:a.function.strict}:a)),void 0!==b.temperature&&(e.temperature=b.temperature),void 0!==b.max_tokens&&(e.max_tokens=b.max_tokens),void 0!==b.top_p&&(e.top_p=b.top_p),void 0!==b.reasoning&&(e.reasoning=b.reasoning),void 0!==b.reasoning_effort&&(e.reasoning={effort:b.reasoning_effort,summary:"auto"}),e}(0,d.kz)(e.h.OPENAI_RESPONSES,e.h.OPENAI,i,null),(0,d.kz)(e.h.OPENAI,e.h.OPENAI_RESPONSES,k,null)},69320:(a,b,c)=>{c.d(b,{Ut:()=>e,a_:()=>f,bC:()=>d});let d={STOP:"stop",LENGTH:"length",TOOL_CALLS:"tool_calls",CONTENT_FILTER:"content_filter"},e={END_TURN:"end_turn",MAX_TOKENS:"max_tokens",TOOL_USE:"tool_use",STOP_SEQUENCE:"stop_sequence"},f={STOP:"STOP",MAX_TOKENS:"MAX_TOKENS",SAFETY:"SAFETY",RECITATION:"RECITATION",BLOCKLIST:"BLOCKLIST",PROHIBITED_CONTENT:"PROHIBITED_CONTENT"}},71301:(a,b,c)=>{c.d(b,{$q:()=>i,ni:()=>m,W$:()=>k});var d=c(88556),e=c(71553),f=c(47774);let g=[{sig:[137,80,78,71],offset:0,mime:"image/png"},{sig:[255,216,255],offset:0,mime:"image/jpeg"},{sig:[71,73,70,56],offset:0,mime:"image/gif"},{sig:[82,73,70,70],offset:0,mime:"image/webp",verifyWebp:!0},{sig:[66,77],offset:0,mime:"image/bmp"}],h=new Set(["localhost","127.0.0.1","0.0.0.0","::1","169.254.169.254","metadata.google.internal"]);function i(a,b){return`data:${a};base64,${b}`}let j=/^data:([^;]+);base64,([\s\S]+)$/;function k(a){if("string"!=typeof a)return null;let b=a.match(j);return b?{mimeType:b[1],base64:b[2]}:null}async function l(a){if(!a||h.has(a.toLowerCase()))return null;try{let b=await (0,e.lookup)(a,{all:!0});if(!b.length||b.some(a=>(function(a){if(!a||"::1"===a||a.startsWith("fc")||a.startsWith("fd")||a.startsWith("fe80"))return!0;let b=(a.includes(".")?a.split(":").pop():a).split(".").map(a=>Number.parseInt(a,10));if(4!==b.length||b.some(a=>Number.isNaN(a)))return!a.includes(":");let[c,d]=b;return 10===c||127===c||0===c||172===c&&d>=16&&d<=31||192===c&&168===d||169===c&&254===d||100===c&&d>=64&&d<=127||!1})(a.address)))return null;return b}catch{return null}}async function m(a,b={}){let c,{signal:e,timeoutMs:h=1e4,maxBytes:i=0xa00000}=b;if(!a||!a.startsWith("http://")&&!a.startsWith("https://"))return null;try{c=new URL(a)}catch{return null}try{(0,d.P)(a)}catch{return null}let j=await l(c.hostname);if(!j)return null;let k=new AbortController,n=e?null:setTimeout(()=>k.abort(),h),o=e||k.signal,p=new f.g6({connect:{lookup:(a,b,c)=>c(null,[{address:j[0].address,family:j[0].family}])}});try{let b=await fetch(a,{signal:o,redirect:"manual",dispatcher:p});if(!b.ok||!b.body)return null;let c=b.body.getReader(),d=[],e=0;for(;;){let{done:a,value:b}=await c.read();if(a)break;if((e+=b.length)>i){try{await c.cancel()}catch{}return null}d.push(b)}let f=Buffer.concat(d.map(a=>Buffer.from(a))),h=function(a){for(let{sig:b,offset:c,mime:d,verifyWebp:e}of g){if(a.length<c+b.length)continue;let f=!0;for(let d=0;d<b.length;d++)if(a[c+d]!==b[d]){f=!1;break}if(f&&(!e||a.length>=12&&87===a[8]&&69===a[9]&&66===a[10]&&80===a[11]))return d}return null}(f);if(!h)return null;return{url:`data:${h};base64,${f.toString("base64")}`,mimeType:h}}catch{return null}finally{n&&clearTimeout(n),p.close().catch(()=>{})}}},74525:(a,b,c)=>{c.d(b,{M:()=>e});var d=c(41004);function e(a){let b=a.max_tokens||d.Uc;return a.tools&&Array.isArray(a.tools)&&a.tools.length>0&&b<d.eo&&(b=d.eo),a.thinking?.budget_tokens&&b<=a.thinking.budget_tokens&&(b=a.thinking.budget_tokens+1024),b>d.Uc&&(b=d.Uc),b}},74957:(a,b,c)=>{c.d(b,{H:()=>i});var d=c(41004),e=c(93943),f=c(39609),g=c(92306),h=c(74129);class i{constructor(a,b){this.provider=a,this.config=b,this.noAuth=b?.noAuth||!1}getProvider(){return this.provider}getBaseUrls(){return this.config.baseUrls||(this.config.baseUrl?[this.config.baseUrl]:[])}getFallbackCount(){return this.getBaseUrls().length||1}buildUrl(a,b,c=0,d=null){if(this.provider?.startsWith?.("openai-compatible-")){let a=(d?.providerSpecificData?.baseUrl||h.Es).replace(/\/$/,""),b=this.provider.includes("responses")?"/responses":"/chat/completions";return`${a}${b}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let a=(d?.providerSpecificData?.baseUrl||h.ky).replace(/\/$/,"");return`${a}/messages`}let e=this.getBaseUrls();return e[c]||e[0]||this.config.baseUrl}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",...this.config.headers};return this.provider?.startsWith?.("anthropic-compatible-")?(a.apiKey?c["x-api-key"]=a.apiKey:a.accessToken&&(c.Authorization=`Bearer ${a.accessToken}`),c["anthropic-version"]||(c["anthropic-version"]=h.b8)):a.accessToken?c.Authorization=`Bearer ${a.accessToken}`:a.apiKey&&(c.Authorization=`Bearer ${a.apiKey}`),b&&(c.Accept="text/event-stream"),c}transformRequest(a,b,c,d){return b}shouldRetry(a,b){return a===d.gx.RATE_LIMITED&&b+1<this.getFallbackCount()}async refreshCredentials(a,b,c=null){return null}needsRefresh(a){return(0,e.fp)(this.provider,a)}parseError(a,b){return{status:a.status,message:b||`HTTP ${a.status}`}}async execute({model:a,body:b,stream:c,credentials:e,signal:h,log:i,proxyOptions:j=null}){let k=this.getFallbackCount(),l=null,m=0,n=0,o={},p={...d.cI,...this.config.retry},q=async(a,b,c,e=null)=>{let{attempts:f,delayMs:g}=(0,d.DR)(p[b]);if(f<=0||o[a]>=f)return!1;let h=g;if(e&&this.computeRetryDelay){let b=await this.computeRetryDelay(e,o[a]+1,g);if(!1===b)return!1;null!=b&&(h=b)}let j=o[a]+1;return e&&this.computeRetryDelay||(h=Math.min(g*Math.pow(2,j-1)+.25*g*Math.random(),3e4)),o[a]++,n++,i?.debug?.("RETRY",`${c} retry ${o[a]}/${f} after ${(h/1e3).toFixed(1)}s (exp backoff attempt ${j})`),await new Promise(a=>setTimeout(a,h)),!0};for(let p=0;p<k;p++){let r=this.buildUrl(a,c,p,e),s=this.transformRequest(a,b,c,e),t=this.buildHeaders(e,c);o[p]||(o[p]=0);let u=new AbortController,v=this.config?.timeoutMs||d.pH,w=setTimeout(()=>u.abort(Error("fetch connect timeout")),v),x=h?AbortSignal.any([h,u.signal]):u.signal;try{let a=JSON.stringify(s),b=Date.now();(0,g.s)("FETCH",`${this.provider.toUpperCase()} → ${r} | body=${a.length}B | connectTimeout=${v}ms`);let c=await (0,f.proxyAwareFetch)(r,{method:"POST",headers:t,body:a,signal:x},j);clearTimeout(w);let d=c.headers?.get?.("content-type")||"",e=c.headers?.get?.("content-length")||"?";if((0,g.s)("FETCH",`${this.provider.toUpperCase()} ← ${c.status} | ttft=${Date.now()-b}ms | ct=${d} | cl=${e}`),await q(p,c.status,`status ${c.status}`,c)){p--;continue}if(this.shouldRetry(c.status,p)){i?.debug?.("RETRY",`${c.status} on ${r}, trying fallback ${p+1}`),m=c.status;continue}return{response:c,url:r,headers:t,transformedBody:s,retryCount:n}}catch(b){clearTimeout(w),l=b;let a=u.signal.aborted&&"AbortError"===b.name;if((0,g.s)("FETCH",`${this.provider.toUpperCase()} ✖ ${b.name}: ${b.message}${a?" (connect timeout)":""}`),"AbortError"===b.name&&!a)throw b;if(await q(p,d.gx.BAD_GATEWAY,`network "${b.message}"`)){p--;continue}if(p+1<k){i?.debug?.("RETRY",`Error on ${r}, trying fallback ${p+1}`);continue}throw b}}throw l||Error(`All ${k} URLs failed with status ${m}`)}}},78833:(a,b,c)=>{c.d(b,{Ws:()=>af,Ai:()=>ag,nZ:()=>ae,kz:()=>ab,GH:()=>ac,Y8:()=>ad});var d,e,f=c(14170),g=c(17242),h=c(95189),i=c(55399),j=c(55673),k=c(57647),l=c(52136),m=c(80662);c(39536);var n=c(26070);c(60983);var o=c(19979),p=c(74525),q=c(71301),r=c(97721);function s(a,b,c){let d={model:a,messages:[],stream:c};if(b.generationConfig){let a=b.generationConfig;if(a.maxOutputTokens){let c={max_tokens:a.maxOutputTokens,tools:b.tools};d.max_tokens=(0,p.M)(c)}void 0!==a.temperature&&(d.temperature=a.temperature),void 0!==a.topP&&(d.top_p=a.topP)}if(b.systemInstruction){var e;let a="string"==typeof(e=b.systemInstruction)?e:e.parts&&Array.isArray(e.parts)?e.parts.map(a=>a.text||"").join(""):"";a&&d.messages.push({role:j.z7.SYSTEM,content:a})}if(b.contents&&Array.isArray(b.contents))for(let a of b.contents){let b=function(a){let b=a.role===j.RV.USER?j.z7.USER:j.z7.ASSISTANT;if(!a.parts||!Array.isArray(a.parts))return null;let c=[],d=[];for(let b of a.parts)if(void 0!==b.text&&c.push({type:j.x4.TEXT,text:b.text}),b.inlineData&&c.push({type:j.x4.IMAGE_URL,image_url:{url:(0,q.$q)(b.inlineData.mimeType,b.inlineData.data)}}),b.functionCall&&d.push({id:b.functionCall.id||`call_${b.functionCall.name}`,type:j.x4.FUNCTION,function:{name:b.functionCall.name,arguments:JSON.stringify(b.functionCall.args||{})}}),b.functionResponse)return{role:j.z7.TOOL,tool_call_id:b.functionResponse.id||`call_${b.functionResponse.name}`,content:JSON.stringify(b.functionResponse.response?.result||b.functionResponse.response||{})};if(d.length>0){let a={role:j.z7.ASSISTANT};return c.length>0&&(a.content=1===c.length?c[0].text:c),a.tool_calls=d,a}return c.length>0?{role:b,content:(0,r.z)(c)}:null}(a);b&&d.messages.push(b)}if(b.tools&&Array.isArray(b.tools)){for(let a of(d.tools=[],b.tools))if(a.functionDeclarations)for(let b of a.functionDeclarations)d.tools.push({type:j.x4.FUNCTION,function:{name:b.name,description:b.description||"",parameters:b.parameters||{type:"object",properties:{}}}})}return d}ab(f.h.GEMINI,f.h.OPENAI,s,null),ab(f.h.GEMINI_CLI,f.h.OPENAI,s,null);var t=c(96281),u=c(75924),v=c(26922);function w(){return crypto.randomUUID()}function x(a){if(!a)return"_unknown";let b=a.replace(/[^a-zA-Z0-9_.:\-]/g,"_");return/^[a-zA-Z_]/.test(b)||(b="_"+b),b.substring(0,64)}function y(a){let b=[];for(let c of a||[]){if(!c?.role||!Array.isArray(c.parts)||0===c.parts.length)continue;let a=b.at(-1);a?.role===c.role?a.parts.push(...c.parts):b.push({...c,parts:[...c.parts]})}return b}function z(a,b,c,d=t.bf){let e={model:a,contents:[],generationConfig:{},safetySettings:v.fc};void 0!==b.temperature&&(e.generationConfig.temperature=b.temperature),void 0!==b.top_p&&(e.generationConfig.topP=b.top_p),void 0!==b.top_k&&(e.generationConfig.topK=b.top_k),void 0!==b.max_tokens&&(e.generationConfig.maxOutputTokens=b.max_tokens);let f={};if(b.messages&&Array.isArray(b.messages)){for(let a of b.messages)if(a.role===j.z7.ASSISTANT&&a.tool_calls)for(let b of a.tool_calls)b.type===j.x4.FUNCTION&&b.id&&b.function?.name&&(f[b.id]=b.function.name)}let g={};if(b.messages&&Array.isArray(b.messages))for(let a of b.messages)a.role===j.z7.TOOL&&a.tool_call_id&&(g[a.tool_call_id]=a.content);if(b.messages&&Array.isArray(b.messages))for(let a=0;a<b.messages.length;a++){let c=b.messages[a],h=c.role,i=c.content;if(h===j.z7.SYSTEM&&b.messages.length>1)e.systemInstruction={role:j.RV.USER,parts:[{text:"string"==typeof i?i:(0,v.kU)(i)}]};else if(h===j.z7.USER||h===j.z7.SYSTEM&&1===b.messages.length){let a=(0,v.S6)(i);a.length>0&&e.contents.push({role:j.RV.USER,parts:a})}else if(h===j.z7.ASSISTANT){let a=[];if(c.reasoning_content&&(a.push({thought:!0,text:c.reasoning_content}),a.push({thoughtSignature:d,text:""})),i){let b="string"==typeof i?i:(0,v.kU)(i);b&&a.push({text:b})}if(c.tool_calls&&Array.isArray(c.tool_calls)){let b=[];for(let e of c.tool_calls){if(e.type!==j.x4.FUNCTION)continue;let c=(0,v.pT)(e.function?.arguments||"{}");a.push({thoughtSignature:d,functionCall:{id:e.id,name:x(e.function.name),args:c}}),b.push(e.id)}if(a.length>0&&e.contents.push({role:j.RV.MODEL,parts:a}),b.some(a=>g[a])){let a=[];for(let c of b){if(!g[c])continue;let b=f[c];if(!b){let a=c.split("-");b=a.length>2?a.slice(0,-2).join("-"):c}let d=g[c],e=(0,v.pT)(d);null===e?e={result:d}:"object"!=typeof e&&(e={result:e}),a.push({functionResponse:{id:c,name:x(b),response:{result:e}}})}a.length>0&&e.contents.push({role:j.RV.USER,parts:a})}}else a.length>0&&e.contents.push({role:j.RV.MODEL,parts:a})}}if(b.tools&&Array.isArray(b.tools)&&b.tools.length>0){let a=[];for(let c of b.tools)if(c.name&&c.input_schema){let b=(0,v.Yr)(structuredClone(c.input_schema||{type:"object",properties:{}}));a.push({name:x(c.name),description:c.description||"",parameters:b})}else if(c.type===j.x4.FUNCTION&&c.function){let b=c.function,d=(0,v.Yr)(structuredClone(b.parameters||{type:"object",properties:{}}));a.push({name:x(b.name),description:b.description||"",parameters:d})}a.length>0&&(e.tools=[{functionDeclarations:a}])}return e.contents=y(e.contents),e}function A(a,b,c){return z(a,b,c)}function B(a,b,c){let d=z(a,b,c,t.$G);if(d.tools?.[0]?.functionDeclarations){for(let a of d.tools[0].functionDeclarations)if(a.parameters){let b=(0,v.Yr)(a.parameters);a.parameters=b}}return d}function C(a,b,c=null,d=!1){let e={project:c?.projectId||(0,v.w_)(),model:a,userAgent:d?"antigravity":"gemini-cli",requestId:d?`agent-${w()}`:(0,v.KZ)(),request:{sessionId:(0,m.E9)(c?._clientSessionId)||(d?(0,m.RF)(c?.email||c?.connectionId):(0,v.f6)()),contents:b.contents,systemInstruction:b.systemInstruction,generationConfig:b.generationConfig,tools:b.tools}};if(d){e.requestType="agent";let a=[{text:u.$V},{text:`Please ignore the following [ignore]${u.$V}[/ignore]`}];e.request.systemInstruction?.parts?e.request.systemInstruction.parts.unshift(...a):e.request.systemInstruction={role:j.RV.USER,parts:a},b.tools?.length>0&&(e.request.toolConfig={functionCallingConfig:{mode:"VALIDATED"}})}else e.request.safetySettings=b.safetySettings,b.tools?.length>0&&(e.request.toolConfig={functionCallingConfig:{mode:"VALIDATED"}});return e}ab(f.h.OPENAI,f.h.GEMINI,A,null),ab(f.h.OPENAI,f.h.GEMINI_CLI,(a,b,c,d)=>C(a,B(a,b,c),d),null),ab(f.h.OPENAI,f.h.ANTIGRAVITY,function(a,b,c,d=null){if(a.toLowerCase().includes("claude")){let e=(0,o.C)(a,b,c);return function(a,b,c=null,d=t.bf){let e={project:c?.projectId||(0,v.w_)(),model:a,userAgent:"antigravity",requestId:`agent-${w()}`,requestType:"agent",request:{sessionId:(0,m.E9)(c?._clientSessionId)||(0,m.RF)(c?.email||c?.connectionId),contents:[],generationConfig:{temperature:b.temperature||1,maxOutputTokens:b.max_tokens||4096}}},f={};if(b.messages&&Array.isArray(b.messages)){for(let a of b.messages)if(Array.isArray(a.content))for(let b of a.content)b.type===j.R4.TOOL_USE&&b.id&&b.name&&(f[b.id]=b.name)}if(b.messages&&Array.isArray(b.messages))for(let a of b.messages){let b=[];if(Array.isArray(a.content)){for(let c of a.content)if(c.type===j.R4.TEXT)b.push({text:c.text});else if(c.type===j.R4.TOOL_USE)b.push({thoughtSignature:d,functionCall:{id:c.id,name:x(c.name),args:c.input||{}}});else if(c.type===j.R4.TOOL_RESULT){let a=c.content;Array.isArray(a)&&(a=a.map(a=>a.type===j.R4.TEXT?a.text:JSON.stringify(a)).join("\n"));let d=f[c.tool_use_id]?x(f[c.tool_use_id]):"tool";b.push({functionResponse:{id:c.tool_use_id,name:d,response:{result:(0,v.pT)(a)||a}}})}}else"string"==typeof a.content&&b.push({text:a.content});b.length>0&&e.request.contents.push({role:a.role===j.z7.ASSISTANT?j.RV.MODEL:j.RV.USER,parts:b})}if(b.tools&&Array.isArray(b.tools)){let a=[];for(let c of b.tools)if(c.name&&c.input_schema){let b=(0,v.Yr)(c.input_schema);a.push({name:x(c.name),description:c.description||"",parameters:b})}a.length>0&&(e.request.tools=[{functionDeclarations:a}],e.request.toolConfig={functionCallingConfig:{mode:"VALIDATED"}})}let g=[{text:u.$V},{text:`Please ignore the following [ignore]${u.$V}[/ignore]`}];if(b.system)if(Array.isArray(b.system))for(let a of b.system)a.text&&g.push({text:a.text});else"string"==typeof b.system&&g.push({text:b.system});return e.request.systemInstruction?.parts?e.request.systemInstruction.parts.unshift(...g):e.request.systemInstruction={role:j.RV.USER,parts:g},e.request.contents=y(e.request.contents),e}(a,e,d)}let e=B(a,b,c);return C(a,e,d,!0)},null),ab(f.h.OPENAI,f.h.VERTEX,function(a,b,c,d){var e=A(a,b,c,d);if(!e?.contents)return e;for(let a of e.contents)if(Array.isArray(a.parts))for(let b of a.parts)void 0!==b.thoughtSignature&&(b.thoughtSignature=t.n6),b.functionCall&&"id"in b.functionCall&&delete b.functionCall.id,b.functionResponse&&"id"in b.functionResponse&&delete b.functionResponse.id;return e},null);var D=c(58028);ab(f.h.ANTIGRAVITY,f.h.OPENAI,function(a,b,c){let d=b.request||b,e={model:a,messages:[],stream:c};if(d.generationConfig){let a=d.generationConfig;if(a.maxOutputTokens){let b={max_tokens:a.maxOutputTokens,tools:d.tools};e.max_tokens=(0,p.M)(b)}if(void 0!==a.temperature&&(e.temperature=a.temperature),void 0!==a.topP&&(e.top_p=a.topP),void 0!==a.topK&&(e.top_k=a.topK),a.thinkingConfig){let b=(0,D.Vp)(a.thinkingConfig.thinkingBudget||0);b&&(e.reasoning_effort=b)}}if(d.systemInstruction){var f;let a="string"==typeof(f=d.systemInstruction)?f:f.parts&&Array.isArray(f.parts)?f.parts.map(a=>a.text||"").join(""):"";a&&e.messages.push({role:j.z7.SYSTEM,content:a})}if(d.contents&&Array.isArray(d.contents))for(let a of d.contents){let b=function(a){let b=a.role===j.RV.MODEL?j.z7.ASSISTANT:a.role===j.RV.USER?j.z7.USER:a.role;if(!a.parts||!Array.isArray(a.parts))return null;let c=[],d=[],e=[],f="";for(let b of a.parts){if(!0===b.thought&&b.text){f+=b.text;continue}if(b.thoughtSignature&&void 0!==b.text){b.text&&c.push({type:j.x4.TEXT,text:b.text});continue}void 0!==b.text&&""!==b.text&&c.push({type:j.x4.TEXT,text:b.text}),b.inlineData&&c.push({type:j.x4.IMAGE_URL,image_url:{url:(0,q.$q)(b.inlineData.mimeType,b.inlineData.data)}}),b.functionCall&&d.push({id:b.functionCall.id||`call_${b.functionCall.name}`,type:j.x4.FUNCTION,function:{name:b.functionCall.name,arguments:JSON.stringify(b.functionCall.args||{})}}),b.functionResponse&&e.push({role:j.z7.TOOL,tool_call_id:b.functionResponse.id||`call_${b.functionResponse.name}`,content:JSON.stringify(b.functionResponse.response?.result||b.functionResponse.response||{})})}if(e.length>0){if(d.length>0||c.length>0||f){let a={role:j.z7.ASSISTANT};return c.length>0&&(a.content=(0,r.z)(c)),f&&(a.reasoning_content=f),d.length>0&&(a.tool_calls=d),[...e,a]}return e}if(d.length>0){let a={role:j.z7.ASSISTANT};return c.length>0&&(a.content=(0,r.z)(c)),f&&(a.reasoning_content=f),a.tool_calls=d,a}if(c.length>0||f){let a={role:b};return c.length>0&&(a.content=(0,r.z)(c)),f&&(a.reasoning_content=f),a}return null}(a);b&&(Array.isArray(b)?e.messages.push(...b):e.messages.push(b))}if(d.tools&&Array.isArray(d.tools)){for(let a of(e.tools=[],d.tools))if(a.functionDeclarations)for(let b of a.functionDeclarations)e.tools.push({type:j.x4.FUNCTION,function:{name:b.name,description:b.description||"",parameters:function a(b){if(!b||"object"!=typeof b)return b;let c=Array.isArray(b)?[...b]:{...b};if("string"==typeof c.type&&(c.type=c.type.toLowerCase()),delete c.enumDescriptions,c.properties){let b={};for(let[d,e]of Object.entries(c.properties))b[d]=a(e);c.properties=b}return c.items&&(c.items=a(c.items)),c}(b.parameters)||{type:"object",properties:{}}}})}return e},null),c(65377);var E=c(94755),F=c(6382);function G(a,b){let c;try{c="string"==typeof b?b:JSON.stringify(b??{})}catch{c="{}"}return`[Tool call: ${a||"unknown"}(${c})]`}function H(a){let b=Array.isArray(a)?a.map(a=>"string"==typeof a?a:a.text||"").join("\n"):"string"==typeof a?a:"";return`[Tool result: ${b}]`}ab(f.h.OPENAI,f.h.KIRO,function(a,b,c,d){let e=b.messages||[],f=b.tools||[],g=b.temperature,h=b.top_p,{upstream:i,agentic:k}=(0,F.$D)(a),l=(0,F.P9)(b,d?.rawHeaders,a),{history:n,currentMessage:o}=function(a,b,c){let d=[],e=null,f=b&&b.length>0;f||(a=function(a){let b=[];for(let c of a){if(c.role===j.z7.TOOL){b.push({role:j.z7.USER,content:H(c.content)});continue}if(c.role===j.z7.ASSISTANT){let a=[];if(Array.isArray(c.content))for(let b of c.content)b.type===j.R4.TOOL_USE?a.push(G(b.name,b.input)):(b.type===j.x4.TEXT||b.text)&&a.push(b.text||"");else"string"==typeof c.content&&a.push(c.content);for(let b of c.tool_calls||[])a.push(G(b.function?.name,b.function?.arguments));b.push({role:j.z7.ASSISTANT,content:a.filter(Boolean).join("\n")});continue}if(c.role===j.z7.USER&&Array.isArray(c.content)){let a=c.content.map(a=>a.type===j.R4.TOOL_RESULT?{type:j.x4.TEXT,text:H(a.content)}:a);b.push({...c,content:a});continue}b.push(c)}return b}(a));let g=[],h=[],i=[],k=[],l=null,m=!1,n=()=>{if("user"===l){let a={userInputMessage:{content:g.join("\n\n").trim()||"continue",modelId:""}};k.length>0&&(a.userInputMessage.images=k),i.length>0&&(a.userInputMessage.userInputMessageContext={toolResults:i}),f&&!m&&(a.userInputMessage.userInputMessageContext||(a.userInputMessage.userInputMessageContext={}),a.userInputMessage.userInputMessageContext.tools=b.map(a=>{let b=a.function?.name||a.name,c=a.function?.description||a.description||"";c.trim()||(c=`Tool: ${b}`);let d=a.function?.parameters||a.parameters||a.input_schema||{};return{toolSpecification:{name:b,description:c,inputSchema:{json:0===Object.keys(d).length?{type:"object",properties:{},required:[]}:{...d,required:d.required??[]}}}}}),m=!0),d.push(a),e=a,g=[],i=[],k=[]}else if("assistant"===l){let a=h.join("\n\n").trim()||"...";d.push({assistantResponseMessage:{content:a}}),h=[]}};for(let b=0;b<a.length;b++){let c=a[b],e=c.role;if((e===j.z7.SYSTEM||e===j.z7.TOOL)&&(e=j.z7.USER),e!==l&&null!==l&&n(),l=e,e===j.z7.USER){let a="";if("string"==typeof c.content)a=c.content;else if(Array.isArray(c.content)){let b=[];for(let a of c.content)if(a.type===j.x4.TEXT||a.text)b.push(a.text||"");else if(a.type===j.x4.IMAGE_URL){let c=a.image_url?.url||"",d=(0,q.W$)(c);if(d){let a=d.mimeType.split("/")[1]||d.mimeType;k.push({format:a,source:{bytes:d.base64}})}else(c.startsWith("http://")||c.startsWith("https://"))&&b.push(`[Image: ${c}]`)}else if(a.type===j.R4.IMAGE&&a.source?.type==="base64"&&a.source?.data){let b=a.source.media_type||j.BY,c=b.split("/")[1]||b;k.push({format:c,source:{bytes:a.source.data}})}a=b.join("\n");let d=c.content.filter(a=>a.type===j.R4.TOOL_RESULT);d.length>0&&d.forEach(a=>{let b=Array.isArray(a.content)?a.content.map(a=>a.text||"").join("\n"):"string"==typeof a.content?a.content:"";i.push({toolUseId:a.tool_use_id,status:"success",content:[{text:b}]})})}if(c.role===j.z7.TOOL){let a="string"==typeof c.content?c.content:"";i.push({toolUseId:c.tool_call_id,status:"success",content:[{text:a}]})}else a&&g.push(a)}else if(e===j.z7.ASSISTANT){let a="",b=[];if(Array.isArray(c.content)?(a=c.content.filter(a=>a.type===j.x4.TEXT).map(a=>a.text).join("\n").trim(),b=c.content.filter(a=>a.type===j.R4.TOOL_USE)):"string"==typeof c.content&&(a=c.content.trim()),c.tool_calls&&c.tool_calls.length>0&&(b=c.tool_calls),a&&h.push(a),b.length>0){n();let a=d[d.length-1];a?.assistantResponseMessage&&(a.assistantResponseMessage.toolUses=b.map(a=>a.function?{toolUseId:a.id||(0,E.A)(),name:a.function.name,input:function(a,b){if("string"!=typeof a)return a??b;try{return JSON.parse(a)}catch{return b}}(a.function.arguments,{})}:{toolUseId:a.id||(0,E.A)(),name:a.name,input:a.input||{}})),l=null}}}null!==l&&n();for(let a=d.length-1;a>=0;a--)if(d[a].userInputMessage){e=d.splice(a,1)[0];break}let o=d[0]?.userInputMessage?.userInputMessageContext?.tools;d.forEach(a=>{a.userInputMessage?.userInputMessageContext?.tools&&delete a.userInputMessage.userInputMessageContext.tools,a.userInputMessage?.userInputMessageContext&&0===Object.keys(a.userInputMessage.userInputMessageContext).length&&delete a.userInputMessage.userInputMessageContext,a.userInputMessage&&!a.userInputMessage.modelId&&(a.userInputMessage.modelId=c)});let p=[];for(let a=0;a<d.length;a++){let b=d[a];if(b.userInputMessage&&p.length>0&&p[p.length-1].userInputMessage){let a=p[p.length-1];a.userInputMessage.content+="\n\n"+b.userInputMessage.content;let c=a.userInputMessage.userInputMessageContext,d=b.userInputMessage.userInputMessageContext;d&&(c?(d.toolResults?.length>0&&(c.toolResults=[...c.toolResults||[],...d.toolResults]),d.tools?.length>0&&(c.tools=[...c.tools||[],...d.tools])):a.userInputMessage.userInputMessageContext=d)}else p.push(b)}return e||(e={userInputMessage:{content:"",modelId:c}}),f&&function(a,b){let c=new Set;for(let b of a){let a=b.assistantResponseMessage;if(a)for(let b of a.toolUses||[])b.toolUseId&&c.add(b.toolUseId)}for(let d of b?[...a,b]:a){let a=d.userInputMessage,b=a?.userInputMessageContext;if(!b?.toolResults?.length)continue;let e=[],f=[];for(let a of b.toolResults)c.has(a.toolUseId)?e.push(a):f.push(H(a.content));if(0===f.length)continue;let g=f.join("\n");a.content=a.content?`${a.content}
|
|
60
|
+
${b}`:b);continue}}if(h&&e.messages.push(h),i.length>0)for(let a of i)e.messages.push(a);return b.tools&&Array.isArray(b.tools)&&(e.tools=b.tools.map(a=>{if(a.function)return a;let b=a.name;return b&&"string"==typeof b&&""!==b.trim()?{type:g.x4.FUNCTION,function:{name:b,description:String(a.description||""),parameters:j(a.parameters),strict:a.strict}}:null}).filter(Boolean)),void 0!==e.max_output_tokens&&(void 0===e.max_tokens&&(e.max_tokens=e.max_output_tokens),delete e.max_output_tokens),delete e.input,delete e.instructions,delete e.include,delete e.prompt_cache_key,delete e.store,delete e.reasoning,e}function j(a){return a?"object"!==a.type||a.properties?a:{...a,properties:{}}:{type:"object",properties:{}}}function k(a,b,c,d){if(b.input)return{...b,model:a,stream:!0};let e={model:a,input:[],stream:!0,store:!1},f=!1;for(let a of b.messages||[]){if(a.role===g.z7.SYSTEM){f||(e.instructions="string"==typeof a.content?a.content:"",f=!0);continue}if(a.role===g.z7.USER||a.role===g.z7.ASSISTANT){let b=a.role===g.z7.USER?g.Du.INPUT_TEXT:g.Du.OUTPUT_TEXT,c="string"==typeof a.content?[{type:b,text:a.content}]:Array.isArray(a.content)?a.content.map(a=>{if(a.type===g.x4.TEXT)return{type:b,text:a.text};if(a.type===g.x4.IMAGE_URL){let b="string"==typeof a.image_url?a.image_url:a.image_url?.url;return{type:g.Du.INPUT_IMAGE,image_url:b,detail:a.image_url?.detail||"auto"}}if(a.type===g.Du.INPUT_IMAGE)return a;let c=a.text||a.content||JSON.stringify(a);return{type:b,text:"string"==typeof c?c:JSON.stringify(c)}}):[];c.length>0&&e.input.push({type:g.Du.MESSAGE,role:a.role,content:c})}if(a.role===g.z7.ASSISTANT&&a.tool_calls)for(let b of a.tool_calls)e.input.push({type:g.Du.FUNCTION_CALL,call_id:h(b.id),name:b.function?.name||"_unknown",arguments:b.function?.arguments||"{}"});if(a.role===g.z7.TOOL){let b="string"==typeof a.content?a.content:Array.isArray(a.content)?a.content.map(a=>a.text||JSON.stringify(a)).join(""):JSON.stringify(a.content);e.input.push({type:g.Du.FUNCTION_CALL_OUTPUT,call_id:h(a.tool_call_id),output:b})}}return f||(e.instructions=""),b.tools&&Array.isArray(b.tools)&&(e.tools=b.tools.map(a=>a.type===g.x4.FUNCTION?{type:g.x4.FUNCTION,name:a.function.name,description:String(a.function.description||""),parameters:j(a.function.parameters),strict:a.function.strict}:a)),void 0!==b.temperature&&(e.temperature=b.temperature),void 0!==b.max_tokens&&(e.max_tokens=b.max_tokens),void 0!==b.top_p&&(e.top_p=b.top_p),void 0!==b.reasoning&&(e.reasoning=b.reasoning),void 0!==b.reasoning_effort&&(e.reasoning={effort:b.reasoning_effort,summary:"auto"}),e}(0,d.kz)(e.h.OPENAI_RESPONSES,e.h.OPENAI,i,null),(0,d.kz)(e.h.OPENAI,e.h.OPENAI_RESPONSES,k,null)},69320:(a,b,c)=>{c.d(b,{Ut:()=>e,a_:()=>f,bC:()=>d});let d={STOP:"stop",LENGTH:"length",TOOL_CALLS:"tool_calls",CONTENT_FILTER:"content_filter"},e={END_TURN:"end_turn",MAX_TOKENS:"max_tokens",TOOL_USE:"tool_use",STOP_SEQUENCE:"stop_sequence"},f={STOP:"STOP",MAX_TOKENS:"MAX_TOKENS",SAFETY:"SAFETY",RECITATION:"RECITATION",BLOCKLIST:"BLOCKLIST",PROHIBITED_CONTENT:"PROHIBITED_CONTENT"}},71301:(a,b,c)=>{c.d(b,{$q:()=>i,ni:()=>m,W$:()=>k});var d=c(88556),e=c(71553),f=c(47774);let g=[{sig:[137,80,78,71],offset:0,mime:"image/png"},{sig:[255,216,255],offset:0,mime:"image/jpeg"},{sig:[71,73,70,56],offset:0,mime:"image/gif"},{sig:[82,73,70,70],offset:0,mime:"image/webp",verifyWebp:!0},{sig:[66,77],offset:0,mime:"image/bmp"}],h=new Set(["localhost","127.0.0.1","0.0.0.0","::1","169.254.169.254","metadata.google.internal"]);function i(a,b){return`data:${a};base64,${b}`}let j=/^data:([^;]+);base64,([\s\S]+)$/;function k(a){if("string"!=typeof a)return null;let b=a.match(j);return b?{mimeType:b[1],base64:b[2]}:null}async function l(a){if(!a||h.has(a.toLowerCase()))return null;try{let b=await (0,e.lookup)(a,{all:!0});if(!b.length||b.some(a=>(function(a){if(!a||"::1"===a||a.startsWith("fc")||a.startsWith("fd")||a.startsWith("fe80"))return!0;let b=(a.includes(".")?a.split(":").pop():a).split(".").map(a=>Number.parseInt(a,10));if(4!==b.length||b.some(a=>Number.isNaN(a)))return!a.includes(":");let[c,d]=b;return 10===c||127===c||0===c||172===c&&d>=16&&d<=31||192===c&&168===d||169===c&&254===d||100===c&&d>=64&&d<=127||!1})(a.address)))return null;return b}catch{return null}}async function m(a,b={}){let c,{signal:e,timeoutMs:h=1e4,maxBytes:i=0xa00000}=b;if(!a||!a.startsWith("http://")&&!a.startsWith("https://"))return null;try{c=new URL(a)}catch{return null}try{(0,d.P)(a)}catch{return null}let j=await l(c.hostname);if(!j)return null;let k=new AbortController,n=e?null:setTimeout(()=>k.abort(),h),o=e||k.signal,p=new f.g6({connect:{lookup:(a,b,c)=>c(null,[{address:j[0].address,family:j[0].family}])}});try{let b=await fetch(a,{signal:o,redirect:"manual",dispatcher:p});if(!b.ok||!b.body)return null;let c=b.body.getReader(),d=[],e=0;for(;;){let{done:a,value:b}=await c.read();if(a)break;if((e+=b.length)>i){try{await c.cancel()}catch{}return null}d.push(b)}let f=Buffer.concat(d.map(a=>Buffer.from(a))),h=function(a){for(let{sig:b,offset:c,mime:d,verifyWebp:e}of g){if(a.length<c+b.length)continue;let f=!0;for(let d=0;d<b.length;d++)if(a[c+d]!==b[d]){f=!1;break}if(f&&(!e||a.length>=12&&87===a[8]&&69===a[9]&&66===a[10]&&80===a[11]))return d}return null}(f);if(!h)return null;return{url:`data:${h};base64,${f.toString("base64")}`,mimeType:h}}catch{return null}finally{n&&clearTimeout(n),p.close().catch(()=>{})}}},74525:(a,b,c)=>{c.d(b,{M:()=>e});var d=c(41004);function e(a){let b=a.max_tokens||d.Uc;return a.tools&&Array.isArray(a.tools)&&a.tools.length>0&&b<d.eo&&(b=d.eo),a.thinking?.budget_tokens&&b<=a.thinking.budget_tokens&&(b=a.thinking.budget_tokens+1024),b>d.Uc&&(b=d.Uc),b}},74957:(a,b,c)=>{c.d(b,{H:()=>i});var d=c(41004),e=c(93943),f=c(39609),g=c(92306),h=c(74129);class i{constructor(a,b){this.provider=a,this.config=b,this.noAuth=b?.noAuth||!1}getProvider(){return this.provider}getBaseUrls(){return this.config.baseUrls||(this.config.baseUrl?[this.config.baseUrl]:[])}getFallbackCount(){return this.getBaseUrls().length||1}buildUrl(a,b,c=0,d=null){if(this.provider?.startsWith?.("openai-compatible-")){let a=(d?.providerSpecificData?.baseUrl||h.Es).replace(/\/$/,""),b=this.provider.includes("responses")?"/responses":"/chat/completions";return`${a}${b}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let a=(d?.providerSpecificData?.baseUrl||h.ky).replace(/\/$/,"");return`${a}/messages`}let e=this.getBaseUrls();return e[c]||e[0]||this.config.baseUrl}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",...this.config.headers};return this.provider?.startsWith?.("anthropic-compatible-")?(a.apiKey?c["x-api-key"]=a.apiKey:a.accessToken&&(c.Authorization=`Bearer ${a.accessToken}`),c["anthropic-version"]||(c["anthropic-version"]=h.b8)):a.accessToken?c.Authorization=`Bearer ${a.accessToken}`:a.apiKey&&(c.Authorization=`Bearer ${a.apiKey}`),b&&(c.Accept="text/event-stream"),c}transformRequest(a,b,c,d){return b}shouldRetry(a,b){return a===d.gx.RATE_LIMITED&&b+1<this.getFallbackCount()}async refreshCredentials(a,b,c=null){return null}needsRefresh(a){return(0,e.fp)(this.provider,a)}parseError(a,b){return{status:a.status,message:b||`HTTP ${a.status}`}}async execute({model:a,body:b,stream:c,credentials:e,signal:h,log:i,proxyOptions:j=null}){let k=this.getFallbackCount(),l=null,m=0,n=0,o={},p={...d.cI,...this.config.retry},q=async(a,b,c,e=null)=>{let{attempts:f,delayMs:g}=(0,d.DR)(p[b]);if(f<=0||o[a]>=f)return!1;let h=g;if(e&&this.computeRetryDelay){let b=await this.computeRetryDelay(e,o[a]+1,g);if(!1===b)return!1;null!=b&&(h=b)}let j=o[a]+1;return e&&this.computeRetryDelay||(h=Math.min(g*Math.pow(2,j-1)+.25*g*Math.random(),3e4)),o[a]++,n++,i?.debug?.("RETRY",`${c} retry ${o[a]}/${f} after ${(h/1e3).toFixed(1)}s (exp backoff attempt ${j})`),await new Promise(a=>setTimeout(a,h)),!0};for(let p=0;p<k;p++){let r=this.buildUrl(a,c,p,e),s=this.transformRequest(a,b,c,e),t=this.buildHeaders(e,c,a);o[p]||(o[p]=0);let u=new AbortController,v=this.config?.timeoutMs||d.pH,w=setTimeout(()=>u.abort(Error("fetch connect timeout")),v),x=h?AbortSignal.any([h,u.signal]):u.signal;try{let a=JSON.stringify(s),b=Date.now();(0,g.s)("FETCH",`${this.provider.toUpperCase()} → ${r} | body=${a.length}B | connectTimeout=${v}ms`);let c=await (0,f.proxyAwareFetch)(r,{method:"POST",headers:t,body:a,signal:x},j);clearTimeout(w);let d=c.headers?.get?.("content-type")||"",e=c.headers?.get?.("content-length")||"?";if((0,g.s)("FETCH",`${this.provider.toUpperCase()} ← ${c.status} | ttft=${Date.now()-b}ms | ct=${d} | cl=${e}`),await q(p,c.status,`status ${c.status}`,c)){p--;continue}if(this.shouldRetry(c.status,p)){i?.debug?.("RETRY",`${c.status} on ${r}, trying fallback ${p+1}`),m=c.status;continue}return{response:c,url:r,headers:t,transformedBody:s,retryCount:n}}catch(b){clearTimeout(w),l=b;let a=u.signal.aborted&&"AbortError"===b.name;if((0,g.s)("FETCH",`${this.provider.toUpperCase()} ✖ ${b.name}: ${b.message}${a?" (connect timeout)":""}`),"AbortError"===b.name&&!a)throw b;if(await q(p,d.gx.BAD_GATEWAY,`network "${b.message}"`)){p--;continue}if(p+1<k){i?.debug?.("RETRY",`Error on ${r}, trying fallback ${p+1}`);continue}throw b}}throw l||Error(`All ${k} URLs failed with status ${m}`)}}},78833:(a,b,c)=>{c.d(b,{Ws:()=>af,Ai:()=>ag,nZ:()=>ae,kz:()=>ab,GH:()=>ac,Y8:()=>ad});var d,e,f=c(14170),g=c(17242),h=c(95189),i=c(55399),j=c(55673),k=c(57647),l=c(52136),m=c(80662);c(39536);var n=c(26070);c(60983);var o=c(19979),p=c(74525),q=c(71301),r=c(97721);function s(a,b,c){let d={model:a,messages:[],stream:c};if(b.generationConfig){let a=b.generationConfig;if(a.maxOutputTokens){let c={max_tokens:a.maxOutputTokens,tools:b.tools};d.max_tokens=(0,p.M)(c)}void 0!==a.temperature&&(d.temperature=a.temperature),void 0!==a.topP&&(d.top_p=a.topP)}if(b.systemInstruction){var e;let a="string"==typeof(e=b.systemInstruction)?e:e.parts&&Array.isArray(e.parts)?e.parts.map(a=>a.text||"").join(""):"";a&&d.messages.push({role:j.z7.SYSTEM,content:a})}if(b.contents&&Array.isArray(b.contents))for(let a of b.contents){let b=function(a){let b=a.role===j.RV.USER?j.z7.USER:j.z7.ASSISTANT;if(!a.parts||!Array.isArray(a.parts))return null;let c=[],d=[];for(let b of a.parts)if(void 0!==b.text&&c.push({type:j.x4.TEXT,text:b.text}),b.inlineData&&c.push({type:j.x4.IMAGE_URL,image_url:{url:(0,q.$q)(b.inlineData.mimeType,b.inlineData.data)}}),b.functionCall&&d.push({id:b.functionCall.id||`call_${b.functionCall.name}`,type:j.x4.FUNCTION,function:{name:b.functionCall.name,arguments:JSON.stringify(b.functionCall.args||{})}}),b.functionResponse)return{role:j.z7.TOOL,tool_call_id:b.functionResponse.id||`call_${b.functionResponse.name}`,content:JSON.stringify(b.functionResponse.response?.result||b.functionResponse.response||{})};if(d.length>0){let a={role:j.z7.ASSISTANT};return c.length>0&&(a.content=1===c.length?c[0].text:c),a.tool_calls=d,a}return c.length>0?{role:b,content:(0,r.z)(c)}:null}(a);b&&d.messages.push(b)}if(b.tools&&Array.isArray(b.tools)){for(let a of(d.tools=[],b.tools))if(a.functionDeclarations)for(let b of a.functionDeclarations)d.tools.push({type:j.x4.FUNCTION,function:{name:b.name,description:b.description||"",parameters:b.parameters||{type:"object",properties:{}}}})}return d}ab(f.h.GEMINI,f.h.OPENAI,s,null),ab(f.h.GEMINI_CLI,f.h.OPENAI,s,null);var t=c(96281),u=c(75924),v=c(26922);function w(){return crypto.randomUUID()}function x(a){if(!a)return"_unknown";let b=a.replace(/[^a-zA-Z0-9_.:\-]/g,"_");return/^[a-zA-Z_]/.test(b)||(b="_"+b),b.substring(0,64)}function y(a){let b=[];for(let c of a||[]){if(!c?.role||!Array.isArray(c.parts)||0===c.parts.length)continue;let a=b.at(-1);a?.role===c.role?a.parts.push(...c.parts):b.push({...c,parts:[...c.parts]})}return b}function z(a,b,c,d=t.bf){let e={model:a,contents:[],generationConfig:{},safetySettings:v.fc};void 0!==b.temperature&&(e.generationConfig.temperature=b.temperature),void 0!==b.top_p&&(e.generationConfig.topP=b.top_p),void 0!==b.top_k&&(e.generationConfig.topK=b.top_k),void 0!==b.max_tokens&&(e.generationConfig.maxOutputTokens=b.max_tokens);let f={};if(b.messages&&Array.isArray(b.messages)){for(let a of b.messages)if(a.role===j.z7.ASSISTANT&&a.tool_calls)for(let b of a.tool_calls)b.type===j.x4.FUNCTION&&b.id&&b.function?.name&&(f[b.id]=b.function.name)}let g={};if(b.messages&&Array.isArray(b.messages))for(let a of b.messages)a.role===j.z7.TOOL&&a.tool_call_id&&(g[a.tool_call_id]=a.content);if(b.messages&&Array.isArray(b.messages))for(let a=0;a<b.messages.length;a++){let c=b.messages[a],h=c.role,i=c.content;if(h===j.z7.SYSTEM&&b.messages.length>1)e.systemInstruction={role:j.RV.USER,parts:[{text:"string"==typeof i?i:(0,v.kU)(i)}]};else if(h===j.z7.USER||h===j.z7.SYSTEM&&1===b.messages.length){let a=(0,v.S6)(i);a.length>0&&e.contents.push({role:j.RV.USER,parts:a})}else if(h===j.z7.ASSISTANT){let a=[];if(c.reasoning_content&&(a.push({thought:!0,text:c.reasoning_content}),a.push({thoughtSignature:d,text:""})),i){let b="string"==typeof i?i:(0,v.kU)(i);b&&a.push({text:b})}if(c.tool_calls&&Array.isArray(c.tool_calls)){let b=[];for(let e of c.tool_calls){if(e.type!==j.x4.FUNCTION)continue;let c=(0,v.pT)(e.function?.arguments||"{}");a.push({thoughtSignature:d,functionCall:{id:e.id,name:x(e.function.name),args:c}}),b.push(e.id)}if(a.length>0&&e.contents.push({role:j.RV.MODEL,parts:a}),b.some(a=>g[a])){let a=[];for(let c of b){if(!g[c])continue;let b=f[c];if(!b){let a=c.split("-");b=a.length>2?a.slice(0,-2).join("-"):c}let d=g[c],e=(0,v.pT)(d);null===e?e={result:d}:"object"!=typeof e&&(e={result:e}),a.push({functionResponse:{id:c,name:x(b),response:{result:e}}})}a.length>0&&e.contents.push({role:j.RV.USER,parts:a})}}else a.length>0&&e.contents.push({role:j.RV.MODEL,parts:a})}}if(b.tools&&Array.isArray(b.tools)&&b.tools.length>0){let a=[];for(let c of b.tools)if(c.name&&c.input_schema){let b=(0,v.Yr)(structuredClone(c.input_schema||{type:"object",properties:{}}));a.push({name:x(c.name),description:c.description||"",parameters:b})}else if(c.type===j.x4.FUNCTION&&c.function){let b=c.function,d=(0,v.Yr)(structuredClone(b.parameters||{type:"object",properties:{}}));a.push({name:x(b.name),description:b.description||"",parameters:d})}a.length>0&&(e.tools=[{functionDeclarations:a}])}return e.contents=y(e.contents),e}function A(a,b,c){return z(a,b,c)}function B(a,b,c){let d=z(a,b,c,t.$G);if(d.tools?.[0]?.functionDeclarations){for(let a of d.tools[0].functionDeclarations)if(a.parameters){let b=(0,v.Yr)(a.parameters);a.parameters=b}}return d}function C(a,b,c=null,d=!1){let e={project:c?.projectId||(0,v.w_)(),model:a,userAgent:d?"antigravity":"gemini-cli",requestId:d?`agent-${w()}`:(0,v.KZ)(),request:{sessionId:(0,m.E9)(c?._clientSessionId)||(d?(0,m.RF)(c?.email||c?.connectionId):(0,v.f6)()),contents:b.contents,systemInstruction:b.systemInstruction,generationConfig:b.generationConfig,tools:b.tools}};if(d){e.requestType="agent";let a=[{text:u.$V},{text:`Please ignore the following [ignore]${u.$V}[/ignore]`}];e.request.systemInstruction?.parts?e.request.systemInstruction.parts.unshift(...a):e.request.systemInstruction={role:j.RV.USER,parts:a},b.tools?.length>0&&(e.request.toolConfig={functionCallingConfig:{mode:"VALIDATED"}})}else e.request.safetySettings=b.safetySettings,b.tools?.length>0&&(e.request.toolConfig={functionCallingConfig:{mode:"VALIDATED"}});return e}ab(f.h.OPENAI,f.h.GEMINI,A,null),ab(f.h.OPENAI,f.h.GEMINI_CLI,(a,b,c,d)=>C(a,B(a,b,c),d),null),ab(f.h.OPENAI,f.h.ANTIGRAVITY,function(a,b,c,d=null){if(a.toLowerCase().includes("claude")){let e=(0,o.C)(a,b,c);return function(a,b,c=null,d=t.bf){let e={project:c?.projectId||(0,v.w_)(),model:a,userAgent:"antigravity",requestId:`agent-${w()}`,requestType:"agent",request:{sessionId:(0,m.E9)(c?._clientSessionId)||(0,m.RF)(c?.email||c?.connectionId),contents:[],generationConfig:{temperature:b.temperature||1,maxOutputTokens:b.max_tokens||4096}}},f={};if(b.messages&&Array.isArray(b.messages)){for(let a of b.messages)if(Array.isArray(a.content))for(let b of a.content)b.type===j.R4.TOOL_USE&&b.id&&b.name&&(f[b.id]=b.name)}if(b.messages&&Array.isArray(b.messages))for(let a of b.messages){let b=[];if(Array.isArray(a.content)){for(let c of a.content)if(c.type===j.R4.TEXT)b.push({text:c.text});else if(c.type===j.R4.TOOL_USE)b.push({thoughtSignature:d,functionCall:{id:c.id,name:x(c.name),args:c.input||{}}});else if(c.type===j.R4.TOOL_RESULT){let a=c.content;Array.isArray(a)&&(a=a.map(a=>a.type===j.R4.TEXT?a.text:JSON.stringify(a)).join("\n"));let d=f[c.tool_use_id]?x(f[c.tool_use_id]):"tool";b.push({functionResponse:{id:c.tool_use_id,name:d,response:{result:(0,v.pT)(a)||a}}})}}else"string"==typeof a.content&&b.push({text:a.content});b.length>0&&e.request.contents.push({role:a.role===j.z7.ASSISTANT?j.RV.MODEL:j.RV.USER,parts:b})}if(b.tools&&Array.isArray(b.tools)){let a=[];for(let c of b.tools)if(c.name&&c.input_schema){let b=(0,v.Yr)(c.input_schema);a.push({name:x(c.name),description:c.description||"",parameters:b})}a.length>0&&(e.request.tools=[{functionDeclarations:a}],e.request.toolConfig={functionCallingConfig:{mode:"VALIDATED"}})}let g=[{text:u.$V},{text:`Please ignore the following [ignore]${u.$V}[/ignore]`}];if(b.system)if(Array.isArray(b.system))for(let a of b.system)a.text&&g.push({text:a.text});else"string"==typeof b.system&&g.push({text:b.system});return e.request.systemInstruction?.parts?e.request.systemInstruction.parts.unshift(...g):e.request.systemInstruction={role:j.RV.USER,parts:g},e.request.contents=y(e.request.contents),e}(a,e,d)}let e=B(a,b,c);return C(a,e,d,!0)},null),ab(f.h.OPENAI,f.h.VERTEX,function(a,b,c,d){var e=A(a,b,c,d);if(!e?.contents)return e;for(let a of e.contents)if(Array.isArray(a.parts))for(let b of a.parts)void 0!==b.thoughtSignature&&(b.thoughtSignature=t.n6),b.functionCall&&"id"in b.functionCall&&delete b.functionCall.id,b.functionResponse&&"id"in b.functionResponse&&delete b.functionResponse.id;return e},null);var D=c(58028);ab(f.h.ANTIGRAVITY,f.h.OPENAI,function(a,b,c){let d=b.request||b,e={model:a,messages:[],stream:c};if(d.generationConfig){let a=d.generationConfig;if(a.maxOutputTokens){let b={max_tokens:a.maxOutputTokens,tools:d.tools};e.max_tokens=(0,p.M)(b)}if(void 0!==a.temperature&&(e.temperature=a.temperature),void 0!==a.topP&&(e.top_p=a.topP),void 0!==a.topK&&(e.top_k=a.topK),a.thinkingConfig){let b=(0,D.Vp)(a.thinkingConfig.thinkingBudget||0);b&&(e.reasoning_effort=b)}}if(d.systemInstruction){var f;let a="string"==typeof(f=d.systemInstruction)?f:f.parts&&Array.isArray(f.parts)?f.parts.map(a=>a.text||"").join(""):"";a&&e.messages.push({role:j.z7.SYSTEM,content:a})}if(d.contents&&Array.isArray(d.contents))for(let a of d.contents){let b=function(a){let b=a.role===j.RV.MODEL?j.z7.ASSISTANT:a.role===j.RV.USER?j.z7.USER:a.role;if(!a.parts||!Array.isArray(a.parts))return null;let c=[],d=[],e=[],f="";for(let b of a.parts){if(!0===b.thought&&b.text){f+=b.text;continue}if(b.thoughtSignature&&void 0!==b.text){b.text&&c.push({type:j.x4.TEXT,text:b.text});continue}void 0!==b.text&&""!==b.text&&c.push({type:j.x4.TEXT,text:b.text}),b.inlineData&&c.push({type:j.x4.IMAGE_URL,image_url:{url:(0,q.$q)(b.inlineData.mimeType,b.inlineData.data)}}),b.functionCall&&d.push({id:b.functionCall.id||`call_${b.functionCall.name}`,type:j.x4.FUNCTION,function:{name:b.functionCall.name,arguments:JSON.stringify(b.functionCall.args||{})}}),b.functionResponse&&e.push({role:j.z7.TOOL,tool_call_id:b.functionResponse.id||`call_${b.functionResponse.name}`,content:JSON.stringify(b.functionResponse.response?.result||b.functionResponse.response||{})})}if(e.length>0){if(d.length>0||c.length>0||f){let a={role:j.z7.ASSISTANT};return c.length>0&&(a.content=(0,r.z)(c)),f&&(a.reasoning_content=f),d.length>0&&(a.tool_calls=d),[...e,a]}return e}if(d.length>0){let a={role:j.z7.ASSISTANT};return c.length>0&&(a.content=(0,r.z)(c)),f&&(a.reasoning_content=f),a.tool_calls=d,a}if(c.length>0||f){let a={role:b};return c.length>0&&(a.content=(0,r.z)(c)),f&&(a.reasoning_content=f),a}return null}(a);b&&(Array.isArray(b)?e.messages.push(...b):e.messages.push(b))}if(d.tools&&Array.isArray(d.tools)){for(let a of(e.tools=[],d.tools))if(a.functionDeclarations)for(let b of a.functionDeclarations)e.tools.push({type:j.x4.FUNCTION,function:{name:b.name,description:b.description||"",parameters:function a(b){if(!b||"object"!=typeof b)return b;let c=Array.isArray(b)?[...b]:{...b};if("string"==typeof c.type&&(c.type=c.type.toLowerCase()),delete c.enumDescriptions,c.properties){let b={};for(let[d,e]of Object.entries(c.properties))b[d]=a(e);c.properties=b}return c.items&&(c.items=a(c.items)),c}(b.parameters)||{type:"object",properties:{}}}})}return e},null),c(65377);var E=c(94755),F=c(6382);function G(a,b){let c;try{c="string"==typeof b?b:JSON.stringify(b??{})}catch{c="{}"}return`[Tool call: ${a||"unknown"}(${c})]`}function H(a){let b=Array.isArray(a)?a.map(a=>"string"==typeof a?a:a.text||"").join("\n"):"string"==typeof a?a:"";return`[Tool result: ${b}]`}ab(f.h.OPENAI,f.h.KIRO,function(a,b,c,d){let e=b.messages||[],f=b.tools||[],g=b.temperature,h=b.top_p,{upstream:i,agentic:k}=(0,F.$D)(a),l=(0,F.P9)(b,d?.rawHeaders,a),{history:n,currentMessage:o}=function(a,b,c){let d=[],e=null,f=b&&b.length>0;f||(a=function(a){let b=[];for(let c of a){if(c.role===j.z7.TOOL){b.push({role:j.z7.USER,content:H(c.content)});continue}if(c.role===j.z7.ASSISTANT){let a=[];if(Array.isArray(c.content))for(let b of c.content)b.type===j.R4.TOOL_USE?a.push(G(b.name,b.input)):(b.type===j.x4.TEXT||b.text)&&a.push(b.text||"");else"string"==typeof c.content&&a.push(c.content);for(let b of c.tool_calls||[])a.push(G(b.function?.name,b.function?.arguments));b.push({role:j.z7.ASSISTANT,content:a.filter(Boolean).join("\n")});continue}if(c.role===j.z7.USER&&Array.isArray(c.content)){let a=c.content.map(a=>a.type===j.R4.TOOL_RESULT?{type:j.x4.TEXT,text:H(a.content)}:a);b.push({...c,content:a});continue}b.push(c)}return b}(a));let g=[],h=[],i=[],k=[],l=null,m=!1,n=()=>{if("user"===l){let a={userInputMessage:{content:g.join("\n\n").trim()||"continue",modelId:""}};k.length>0&&(a.userInputMessage.images=k),i.length>0&&(a.userInputMessage.userInputMessageContext={toolResults:i}),f&&!m&&(a.userInputMessage.userInputMessageContext||(a.userInputMessage.userInputMessageContext={}),a.userInputMessage.userInputMessageContext.tools=b.map(a=>{let b=a.function?.name||a.name,c=a.function?.description||a.description||"";c.trim()||(c=`Tool: ${b}`);let d=a.function?.parameters||a.parameters||a.input_schema||{};return{toolSpecification:{name:b,description:c,inputSchema:{json:0===Object.keys(d).length?{type:"object",properties:{},required:[]}:{...d,required:d.required??[]}}}}}),m=!0),d.push(a),e=a,g=[],i=[],k=[]}else if("assistant"===l){let a=h.join("\n\n").trim()||"...";d.push({assistantResponseMessage:{content:a}}),h=[]}};for(let b=0;b<a.length;b++){let c=a[b],e=c.role;if((e===j.z7.SYSTEM||e===j.z7.TOOL)&&(e=j.z7.USER),e!==l&&null!==l&&n(),l=e,e===j.z7.USER){let a="";if("string"==typeof c.content)a=c.content;else if(Array.isArray(c.content)){let b=[];for(let a of c.content)if(a.type===j.x4.TEXT||a.text)b.push(a.text||"");else if(a.type===j.x4.IMAGE_URL){let c=a.image_url?.url||"",d=(0,q.W$)(c);if(d){let a=d.mimeType.split("/")[1]||d.mimeType;k.push({format:a,source:{bytes:d.base64}})}else(c.startsWith("http://")||c.startsWith("https://"))&&b.push(`[Image: ${c}]`)}else if(a.type===j.R4.IMAGE&&a.source?.type==="base64"&&a.source?.data){let b=a.source.media_type||j.BY,c=b.split("/")[1]||b;k.push({format:c,source:{bytes:a.source.data}})}a=b.join("\n");let d=c.content.filter(a=>a.type===j.R4.TOOL_RESULT);d.length>0&&d.forEach(a=>{let b=Array.isArray(a.content)?a.content.map(a=>a.text||"").join("\n"):"string"==typeof a.content?a.content:"";i.push({toolUseId:a.tool_use_id,status:"success",content:[{text:b}]})})}if(c.role===j.z7.TOOL){let a="string"==typeof c.content?c.content:"";i.push({toolUseId:c.tool_call_id,status:"success",content:[{text:a}]})}else a&&g.push(a)}else if(e===j.z7.ASSISTANT){let a="",b=[];if(Array.isArray(c.content)?(a=c.content.filter(a=>a.type===j.x4.TEXT).map(a=>a.text).join("\n").trim(),b=c.content.filter(a=>a.type===j.R4.TOOL_USE)):"string"==typeof c.content&&(a=c.content.trim()),c.tool_calls&&c.tool_calls.length>0&&(b=c.tool_calls),a&&h.push(a),b.length>0){n();let a=d[d.length-1];a?.assistantResponseMessage&&(a.assistantResponseMessage.toolUses=b.map(a=>a.function?{toolUseId:a.id||(0,E.A)(),name:a.function.name,input:function(a,b){if("string"!=typeof a)return a??b;try{return JSON.parse(a)}catch{return b}}(a.function.arguments,{})}:{toolUseId:a.id||(0,E.A)(),name:a.name,input:a.input||{}})),l=null}}}null!==l&&n();for(let a=d.length-1;a>=0;a--)if(d[a].userInputMessage){e=d.splice(a,1)[0];break}let o=d[0]?.userInputMessage?.userInputMessageContext?.tools;d.forEach(a=>{a.userInputMessage?.userInputMessageContext?.tools&&delete a.userInputMessage.userInputMessageContext.tools,a.userInputMessage?.userInputMessageContext&&0===Object.keys(a.userInputMessage.userInputMessageContext).length&&delete a.userInputMessage.userInputMessageContext,a.userInputMessage&&!a.userInputMessage.modelId&&(a.userInputMessage.modelId=c)});let p=[];for(let a=0;a<d.length;a++){let b=d[a];if(b.userInputMessage&&p.length>0&&p[p.length-1].userInputMessage){let a=p[p.length-1];a.userInputMessage.content+="\n\n"+b.userInputMessage.content;let c=a.userInputMessage.userInputMessageContext,d=b.userInputMessage.userInputMessageContext;d&&(c?(d.toolResults?.length>0&&(c.toolResults=[...c.toolResults||[],...d.toolResults]),d.tools?.length>0&&(c.tools=[...c.tools||[],...d.tools])):a.userInputMessage.userInputMessageContext=d)}else p.push(b)}return e||(e={userInputMessage:{content:"",modelId:c}}),f&&function(a,b){let c=new Set;for(let b of a){let a=b.assistantResponseMessage;if(a)for(let b of a.toolUses||[])b.toolUseId&&c.add(b.toolUseId)}for(let d of b?[...a,b]:a){let a=d.userInputMessage,b=a?.userInputMessageContext;if(!b?.toolResults?.length)continue;let e=[],f=[];for(let a of b.toolResults)c.has(a.toolUseId)?e.push(a):f.push(H(a.content));if(0===f.length)continue;let g=f.join("\n");a.content=a.content?`${a.content}
|
|
61
61
|
|
|
62
62
|
${g}`:g,b.toolResults=e,0!==e.length||b.tools?.length||delete a.userInputMessageContext}}(p,e),o?.length>0&&!e.userInputMessage.userInputMessageContext?.tools&&(e.userInputMessage.userInputMessageContext||(e.userInputMessage.userInputMessageContext={}),e.userInputMessage.userInputMessageContext.tools=o),{history:p,currentMessage:e}}(e,f,i),p=d?.providerSpecificData?.authMethod,r="api_key"===p||"idc"===p||"external_idp"===p?d?.providerSpecificData?.profileArn||"":d?.providerSpecificData?.profileArn||(0,F.We)(p),s=o?.userInputMessage?.content||"",t=new Date().toISOString(),u=[];null!==l&&u.push((0,F.aZ)(l)),u.push(`[Context: Current time is ${t}]`),k&&u.push(F.rG),s=`${u.join("\n\n")}
|
|
63
63
|
|