@sifxprime/krouter 0.5.164 → 0.5.166
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 +12 -12
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- 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_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
- 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_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_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_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_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/environment/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/environment/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
- 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_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_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_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_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_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/presidio/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/presidio/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_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
- 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_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_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_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/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_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_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_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_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_client-reference-manifest.js +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/_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_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 +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +7 -7
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -2
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +5 -5
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +3 -2
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js +51 -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/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +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/codex/bulk-import/route.js +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/providers/[id]/models/route.js +2 -2
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js +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-models/route.js +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/route.js +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/validate/route.js +1 -51
- package/app/.next-cli-build/server/app/api/settings/route.js +51 -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/stream/route.js +2 -2
- package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +3 -3
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +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/audio/speech/route.js +51 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +51 -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/embeddings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
- package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +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/route.js +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/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js +51 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +51 -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/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +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/update/route.js +1 -1
- package/app/.next-cli-build/server/app/callback/page.js +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 +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/environment.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/environment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk/dashboard/environment/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/environment.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/environment.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/presidio.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/presidio.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/presidio.segments/!KGRhc2hib2FyZCk/dashboard/presidio/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/presidio.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/presidio.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.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_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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- 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_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 +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- package/app/.next-cli-build/server/app/login/page.js +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 +4 -4
- package/app/.next-cli-build/server/app/login.segments/_full.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 +4 -4
- package/app/.next-cli-build/server/app/page.js +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 +12 -12
- package/app/.next-cli-build/server/chunks/1318.js +51 -0
- package/app/.next-cli-build/server/chunks/1350.js +1 -0
- package/app/.next-cli-build/server/chunks/1450.js +1 -1
- package/app/.next-cli-build/server/chunks/1738.js +2 -2
- package/app/.next-cli-build/server/chunks/2557.js +1 -0
- package/app/.next-cli-build/server/chunks/2722.js +7 -7
- package/app/.next-cli-build/server/chunks/2750.js +2 -2
- package/app/.next-cli-build/server/chunks/3120.js +60 -12
- package/app/.next-cli-build/server/chunks/{9528.js → 369.js} +2 -3
- package/app/.next-cli-build/server/chunks/412.js +5 -5
- package/app/.next-cli-build/server/chunks/4161.js +1 -1
- package/app/.next-cli-build/server/chunks/4315.js +1 -1
- package/app/.next-cli-build/server/chunks/4404.js +1 -1
- package/app/.next-cli-build/server/chunks/4632.js +1 -1
- package/app/.next-cli-build/server/chunks/4884.js +3 -3
- package/app/.next-cli-build/server/chunks/5024.js +1 -1
- package/app/.next-cli-build/server/chunks/5330.js +28 -20
- package/app/.next-cli-build/server/chunks/5470.js +1 -1
- package/app/.next-cli-build/server/chunks/5681.js +1 -1
- package/app/.next-cli-build/server/chunks/5718.js +1 -1
- package/app/.next-cli-build/server/chunks/6108.js +1 -1
- package/app/.next-cli-build/server/chunks/6182.js +1 -1
- package/app/.next-cli-build/server/chunks/6200.js +1 -1
- package/app/.next-cli-build/server/chunks/6457.js +1 -1
- package/app/.next-cli-build/server/chunks/7153.js +1 -0
- package/app/.next-cli-build/server/chunks/7341.js +1 -1
- package/app/.next-cli-build/server/chunks/7828.js +1 -1
- package/app/.next-cli-build/server/chunks/8238.js +1 -1
- package/app/.next-cli-build/server/chunks/8590.js +1 -1
- package/app/.next-cli-build/server/chunks/8895.js +6 -6
- package/app/.next-cli-build/server/chunks/8962.js +1 -1
- package/app/.next-cli-build/server/chunks/{2365.js → 9055.js} +2 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +5 -5
- 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/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/chunks/1321-c5b3011761e0228b.js +1 -0
- package/app/.next-cli-build/static/chunks/5497-1af4fbf829c885c4.js +7 -0
- package/app/.next-cli-build/static/chunks/{6069-cd255683a4a76ed3.js → 6069-7e7f824c6e2d4291.js} +6 -6
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-e7fe548bb32bb43c.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-4bcade1442e6c0b5.js → page-66d4b33890b140ae.js} +7 -7
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-c88a929e34f9b002.js → page-2f53d5dd5b247cf1.js} +4 -4
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-a6d8744e27e7dd87.js +1 -0
- package/app/cli/package.json +1 -1
- package/app/node_modules/source-map-js/lib/quick-sort.js +10 -1
- package/app/node_modules/source-map-js/lib/source-map-consumer.js +51 -3
- package/app/node_modules/source-map-js/lib/source-map-generator.js +6 -4
- package/app/node_modules/source-map-js/lib/source-node.js +7 -0
- package/app/node_modules/source-map-js/package.json +1 -1
- package/app/package.json +1 -1
- package/app/src/mitm/server.js +1 -1
- package/package.json +1 -1
- package/src/cli/menus/combos.js +11 -2
- package/src/cli/utils/comboModelId.js +14 -0
- package/app/.next-cli-build/server/chunks/4746.js +0 -51
- package/app/.next-cli-build/server/chunks/6306.js +0 -1
- package/app/.next-cli-build/server/chunks/8319.js +0 -1
- package/app/.next-cli-build/server/chunks/9376.js +0 -51
- package/app/.next-cli-build/static/chunks/1321-0b5ea2e0d2a8833d.js +0 -1
- package/app/.next-cli-build/static/chunks/5497-71ac1eaeaacd3abb.js +0 -7
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-18d8f169d8c3de33.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-a1e95f4a56398b5f.js +0 -1
- /package/app/.next-cli-build/static/{M98dvtgJ0h4WJXRRd3DBx → i0cMBMqFdYWpbajovDyfY}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{M98dvtgJ0h4WJXRRd3DBx → i0cMBMqFdYWpbajovDyfY}/_ssgManifest.js +0 -0
package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-a6d8744e27e7dd87.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{7450:(e,t,r)=>{Promise.resolve().then(r.bind(r,75095)),Promise.resolve().then(r.bind(r,25086))},75095:(e,t,r)=>{"use strict";r.d(t,{default:()=>$});var a=r(95155),s=r(12115),i=r(57250),n=r(72107);function l(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}function o(e){return e&&"object"==typeof e?String(e.modelKey||e.name||"").trim():""}function c(e,t){let r=t?.[e]?.hidden;return new Set(Array.isArray(r)?r.map(String):[])}function d({quotas:e=[],compact:t=!1,sortMode:r="default",showSortLabel:i=!1,onHideQuota:n=null}){let[o,c]=(0,s.useState)(1),u=(0,s.useMemo)(()=>e.map((e,t)=>({...e,index:t,remaining:e?.remaining!==void 0?Math.max(0,Math.round(e.remaining)):e?.remainingPercentage!==void 0?Math.round(e.remainingPercentage):l(e?.used,e?.total)})),[e]),m=(0,s.useMemo)(()=>"remaining-asc"===r?[...u].sort((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?[...u].sort((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):u,[u,r]),x=Math.max(1,Math.ceil(m.length/10));if((0,s.useEffect)(()=>{c(1)},[r,e]),(0,s.useEffect)(()=>{c(e=>Math.min(e,x))},[x]),!e||0===e.length)return null;let h=m.slice((o-1)*10,10*o),p=0===m.length?0:(o-1)*10+1,b=Math.min(10*o,m.length),g=t?"py-1 px-1.5":"py-2 px-3",f=t?"text-[11px]":"text-sm",y=t?"text-[11px]":"text-sm",v=t?"text-[10px] leading-tight":"text-xs";return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"text-[10px] text-text-muted",children:[m.length," quota",m.length>1?"s":""]}),i&&(0,a.jsx)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1 text-[10px] text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"Sorted by account remaining"})]}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsx)("table",{className:"w-full table-fixed text-left",children:(0,a.jsx)("tbody",{children:h.map(e=>{var r;let s=(r=e.remaining)>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:r>=30?{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"}:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"},i=function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,r=new Date,a=t-r;if(a<=0)return"-";let s=Math.ceil(a/6e4);if(s<60)return`${s}m`;let i=Math.floor(s/60),n=s%60;if(i<24)return`${i}h ${n}m`;let l=Math.floor(i/24);return`${l}d ${i%24}h ${n}m`}catch(e){return"-"}}(e.resetAt),l=function(e){if(!e)return null;try{let t=new Date(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(a);s.setDate(s.getDate()+1);let i="";i=t>=a&&t<s?"Today":t>=s&&t<new Date(s.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let n=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${i}, ${n}`}catch{return null}}(e.resetAt);return(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:`${g} w-[30%]`,children:(0,a.jsxs)("div",{className:"group/qrow flex items-center gap-1.5 min-w-0",children:[(0,a.jsx)("span",{className:"text-[10px] shrink-0",children:s.emoji}),(0,a.jsx)("span",{className:`${f} font-medium text-text-primary truncate`,children:e.name}),n&&(0,a.jsx)("button",{type:"button",onClick:()=>n(e),className:"shrink-0 opacity-0 group-hover/qrow:opacity-100 text-text-muted hover:text-red-500 transition-opacity",title:`Hide "${e.name}"`,"aria-label":`Hide ${e.name}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px] align-middle",children:"visibility_off"})})]})}),(0,a.jsx)("td",{className:`${g} w-[45%]`,children:(0,a.jsxs)("div",{className:t?"space-y-1":"space-y-1.5",children:[(0,a.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${s.bgLight} ${0===e.remaining?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,a.jsx)("div",{className:`h-full transition-all duration-300 ${s.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,a.jsxs)("div",{className:`flex items-center justify-between ${t?"text-[10px]":"text-xs"}`,children:[(0,a.jsx)("span",{className:"text-text-muted",children:100===e.total?`${e.used}% used`:`${e.used.toLocaleString()} / ${e.total>0?e.total.toLocaleString():"∞"}`}),(0,a.jsxs)("span",{className:`font-medium ${s.text}`,children:[e.remaining,"%"]})]})]})}),(0,a.jsx)("td",{className:`${g} w-[25%]`,children:"-"!==i||l?t?(0,a.jsx)("div",{className:`${y} text-text-primary font-medium truncate`,title:l||"",children:"-"!==i?`in ${i}`:l}):(0,a.jsxs)("div",{className:"space-y-0.5",children:["-"!==i&&(0,a.jsxs)("div",{className:`${y} text-text-primary font-medium`,children:["in ",i]}),l&&(0,a.jsx)("div",{className:`${v} text-text-muted`,children:l})]}):(0,a.jsx)("div",{className:`${y} text-text-muted italic`,children:"N/A"})})]},`${e.name}-${e.index}`)})})})}),x>1&&(0,a.jsxs)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1.5 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,a.jsxs)("span",{children:["Showing ",p,"-",b," of ",m.length]}),(0,a.jsxs)("span",{children:["Page ",o," / ",x]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>c(e=>Math.max(1,e-1)),disabled:1===o,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Prev"}),(0,a.jsx)("button",{type:"button",onClick:()=>c(e=>Math.min(x,e+1)),disabled:o===x,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Next"})]})]})]})}var u=r(98542),m=r(84588),x=r(35497),h=r(52679);function p(e){let t=e=>"string"==typeof e&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);return t(e.email)?e.email:(t(e.name),e.name)}function b(e,t){let r=t[e.id]?.quotas?.[0];return r&&"number"==typeof r.remaining?r.remaining:1/0}function g(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function f(e,t){let r=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>r.has(e)))}async function y(e,t){return await e(t)}let v="quotaCacheData";function w(){try{let e=window.localStorage.getItem(v);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function k(e,t){try{let r=w();r[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(v,JSON.stringify(r))}catch(e){console.error("Error writing quota cache:",e)}}let j="quotaAutoRefresh",N=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],S=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}],C=[10,20,50,100];function $(){let[e,t]=(0,s.useState)([]),[r,$]=(0,s.useState)({}),[A,q]=(0,s.useState)({}),[P,E]=(0,s.useState)({}),[M,T]=(0,s.useState)(!0),[D,O]=(0,s.useState)({}),[I,_]=(0,s.useState)({}),[z,L]=(0,s.useState)(null),[F,U]=(0,s.useState)(!1),[J,R]=(0,s.useState)(!1),[H,K]=(0,s.useState)(60),[V,B]=(0,s.useState)(!0),[G,Q]=(0,s.useState)(null),[W,Y]=(0,s.useState)(null),[X,Z]=(0,s.useState)(!1),[ee,et]=(0,s.useState)(null),[er,ea]=(0,s.useState)([]),[es,ei]=(0,s.useState)("all"),[en,el]=(0,s.useState)([]),[eo,ec]=(0,s.useState)("all"),[ed,eu]=(0,s.useState)("default"),[em,ex]=(0,s.useState)(!1),[eh,ep]=(0,s.useState)(!1),[eb,eg]=(0,s.useState)(!1),[ef,ey]=(0,s.useState)(1),[ev,ew]=(0,s.useState)(20),[ek,ej]=(0,s.useState)(String(20)),[eN,eS]=(0,s.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eC,e$]=(0,s.useState)({eligibleConnections:0,providerFilteredConnections:0}),eA=(0,s.useRef)(null),eq=(0,s.useRef)(null),eP=(0,s.useCallback)(async(e=ef)=>{try{var r,a;let s=new URLSearchParams({page:String(e),pageSize:String(ev),accountStatus:eo,sort:"priority"});"all"!==es&&s.set("provider",es);let i=await fetch(`/api/providers/client?${s.toString()}`);if(!i.ok)throw Error("Failed to fetch connections");let n=await i.json(),l=n.connections||[],o=(r=n.pagination,r||{page:1,pageSize:ev,total:0,totalPages:1}),c=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(n.totals,l.length);return t(l),el(n.providerOptions||[]),eS(o),e$(c),ey((a=n.pagination,a?.page||e)),l}catch(e){return console.error("Error fetching connections:",e),t([]),el([]),eS({page:1,pageSize:ev,total:0,totalPages:1}),e$({eligibleConnections:0,providerFilteredConnections:0}),[]}},[eo,em,ef,ev,es]),eE=(0,s.useCallback)(async(e,t)=>{q(t=>({...t,[e]:!0})),E(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let r=await fetch(`/api/usage/${e}`);if(!r.ok){let a=(await r.json().catch(()=>({}))).error||r.statusText;if(404===r.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===r.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,a);let r={quotas:[],message:a};$(t=>({...t,[e]:r})),k(e,r);return}throw Error(`HTTP ${r.status}: ${a}`)}let a=await r.json();console.log(`[ProviderLimits] Got quota for ${t}:`,a);let s={quotas:function(e,t){if(!t||"object"!=typeof t)return[];let r=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:t.remaining,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"qoder":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{("organization"!==e||t&&0!==(Number(t.total)||0))&&r.push({name:"user"===e?"Personal":"organization"===e?"Organization":e,used:t.used||0,total:t.total||0,unit:t.unit,resetAt:t.resetAt||null})});break;case"claude":t.message?r.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}if(e?.toLowerCase()==="claude"){let e={"session (5h)":0,"weekly (7d)":1,"weekly fable (7d)":2,"weekly opus (7d)":3,"weekly sonnet (7d)":4};return r.sort((t,r)=>(e[t.name]??99)-(e[r.name]??99)),r}let a=(0,n.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));r.sort((t,r)=>{let a=t.modelKey||t.name,s=r.modelKey||r.name;return(e.get(a)??999)-(e.get(s)??999)})}return r}(t,a),plan:a.plan||null,message:a.message||null,raw:a};$(t=>({...t,[e]:s})),k(e,s)}catch(r){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),E(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{q(t=>({...t,[e]:!1}))}},[]),eM=(0,s.useCallback)(async(e,t)=>{await eE(e,t),L(new Date)},[eE]),eT=(0,s.useCallback)(async e=>{if(confirm("Delete this connection?")){Q(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){$(t=>{let r={...t};return delete r[e],r}),q(t=>{let r={...t};return delete r[e],r}),E(t=>{let r={...t};return delete r[e],r});try{let t=w();t[e]&&(delete t[e],window.localStorage.setItem(v,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await y(eP,ef)}}catch(e){console.error("Error deleting connection:",e)}finally{Q(null)}}},[eP,ef]),eD=(0,s.useCallback)(async(e,t)=>{Y(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&($(e=>({...e})),await y(eP,ef))}catch(e){console.error("Error updating connection status:",e)}finally{Y(null)}},[eP,ef]),eO=(0,s.useCallback)(async e=>{if(!ee?.id)return;let t=ee.id,r=ee.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eP(),Z(!1),et(null),h.wb.includes(r)&&await eE(t,r))}catch(e){console.error("Error saving connection:",e)}},[ee,eP,eE]);(0,s.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&ea(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let eI=(0,s.useCallback)(async()=>{if(!J){R(!0),K(60);try{let e=await eP(ef);q(g(e)),E(t=>f(t,e)),$(t=>f(t,e)),await Promise.all(e.map(e=>eE(e.id,e.provider))),L(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{R(!1)}}},[J,eP,eE,ef]);(0,s.useEffect)(()=>{(async()=>{B(!0);let e=await eP(ef);B(!1),q(g(e)),E(t=>f(t,e)),$(t=>f(t,e)),await Promise.all(e.map(e=>eE(e.id,e.provider))),L(new Date)})()},[eP,eE,ef]),(0,s.useEffect)(()=>{let e=window.localStorage.getItem(j);T(null===e||"true"===e),U(!0)},[]),(0,s.useEffect)(()=>{F&&window.localStorage.setItem(j,String(M))},[M,F]),(0,s.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>{O(e?.claudeAutoPing?.connections||{}),_(e?.quotaVisibility||{})}).catch(()=>{})},[]);let e_=(0,s.useCallback)(async(e,t,r)=>{let a=new Set((I?.[e]?.hidden||[]).map(String));r?a.add(String(t)):a.delete(String(t));let s={...I,[e]:{...I?.[e]||{},hidden:[...a]}};_(s);try{let t=await fetch("/api/settings",{cache:"no-store"}),r={...(t.ok?await t.json():{}).quotaVisibility||{},[e]:s[e]};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({quotaVisibility:r})}),_(r)}catch{_(I)}},[I]),ez=(0,s.useCallback)(async(e,t)=>{let r={...D,[e]:t};O(r);try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{}).claudeAutoPing||{},connections:r};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({claudeAutoPing:t})})}catch{O(D)}},[D]);(0,s.useEffect)(()=>{if(!F||!M){eA.current&&(clearInterval(eA.current),eA.current=null),eq.current&&(clearInterval(eq.current),eq.current=null);return}return eA.current=setInterval(()=>{eI()},6e4),eq.current=setInterval(()=>{K(e=>e<=1?60:e-1)},1e3),()=>{eA.current&&clearInterval(eA.current),eq.current&&clearInterval(eq.current)}},[M,eI,F]),(0,s.useEffect)(()=>{let e=()=>{document.hidden?(eA.current&&(clearInterval(eA.current),eA.current=null),eq.current&&(clearInterval(eq.current),eq.current=null)):M&&F&&(eA.current=setInterval(eI,6e4),eq.current=setInterval(()=>{K(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[M,eI,F]);let eL=(0,s.useMemo)(()=>(function(e,t,r,a,s){if("codex"===a&&"default"!==s)return[...e].sort((e,r)=>{let a=b(e,t),i=b(r,t),n="remaining-asc"===s?a-i:i-a;return 0!==n?n:(p(e)||"").localeCompare(p(r)||"")});if(!r)return e;let i=e=>{let r=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return r.length>0?Math.min(...r):1/0};return[...e].sort((e,t)=>{let r=i(e)-i(t);return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(p(e)||"").localeCompare(p(t)||"")})})(e,r,em,es,ed),[e,r,em,es,ed]),eF=e=>{let t=r[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=l(e.used,e.total))},eU=(0,s.useCallback)(async(e,t)=>{if(e.length&&!eb){eg(!0);try{await Promise.all(e.map(e=>fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})}))),await y(eP,ef)}catch(e){console.error("Error bulk toggling connections:",e)}finally{eg(!1)}}},[eb,eP,ef]),eJ="all"===es?"All providers":es,eR=eC.eligibleConnections>0,eH=eL.length>0,eK=eC.eligibleConnections?eC.providerFilteredConnections?{icon:"filter_alt_off",title:"No Accounts On This Page",description:"Try moving to another page or refreshing the current filters."}:{icon:"filter_alt_off",title:"No Accounts Match Current Filters",description:"all"===es?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===eo?"turned off":"active"===eo?"active":"matching"} accounts found for ${es}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},eV=function(e){var t;let{start:r,end:a}=(t=e).total?{start:(t.page-1)*t.pageSize+1,end:Math.min(t.page*t.pageSize,t.total)}:{start:0,end:0};return`Showing ${r}-${a} of ${e.total}`}(eN),eB=!C.includes(ev);return V||eR?V||eH?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>ep(e=>!e),className:"flex h-8 items-center justify-between gap-1 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-haspopup":"menu","aria-expanded":eh,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===es?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(i.A,{src:`/providers/${es}.png`,alt:es,size:18,className:"size-[18px] rounded object-contain",fallbackText:es.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:eJ})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),eh&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>ep(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-2 w-64 overflow-hidden rounded-2xl border border-black/10 bg-surface/95 p-1.5 shadow-xl shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-72",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==es&&ey(1),ei("all"),ep(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${"all"===es?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===es&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]}),(0,a.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,a.jsx)("div",{className:"max-h-72 overflow-y-auto pr-1",children:en.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{es!==e&&ey(1),ei(e),ep(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${es===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(i.A,{src:`/providers/${e}.png`,alt:e,size:24,className:"size-6 rounded-md object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium capitalize",children:e}),es===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:eo,onChange:e=>{let t=e.target.value;eo!==t&&ey(1),ec(t)},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter accounts by status",children:N.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===es&&(0,a.jsx)("select",{value:ed,onChange:e=>eu(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Sort Codex quotas by remaining",children:S.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsxs)("button",{type:"button",onClick:()=>ex(e=>!e),"aria-pressed":em,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${em?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-black/10 text-text-primary hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5"}`,title:"Sort accounts by earliest quota reset time",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{eU(eL.filter(e=>(e.isActive??!0)&&eF(e)).map(e=>e.id),!1)},disabled:eb,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10 disabled:opacity-50",title:"Disable connections with depleted quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn off Empty"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{eU(eL.filter(e=>!(e.isActive??!0)&&!eF(e)).map(e=>e.id),!0)},disabled:eb,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-emerald-500/30 px-2 text-xs text-emerald-500 transition-colors hover:bg-emerald-500/10 disabled:opacity-50",title:"Enable connections that still have quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn on Available"})]}),(0,a.jsxs)("button",{onClick:()=>T(e=>!e),className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:M?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${M?"text-primary":"text-text-muted"}`,children:M?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),M&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",H,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:eI,disabled:J,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5 disabled:opacity-50",title:"Refresh all",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${J?"animate-spin":""}`,children:"refresh"})})]})}),em&&(0,a.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Expiring-first currently reorders accounts inside the current page. Cross-page ordering still follows backend pagination."}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:eL.map(e=>{let t,s,n,l=r[e.id],h=A[e.id],b=P[e.id],g=!1===e.isActive,f=G===e.id||W===e.id;return(0,a.jsxs)(m.default,{padding:"none",className:`min-w-0 ${g?"opacity-60":""}`,children:[(0,a.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,a.jsx)(i.A,{src:`/providers/${e.provider}.png`,alt:e.provider,size:32,className:"object-contain",fallbackText:e.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary capitalize truncate",children:e.provider}),p(e)?(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:p(e)}):null]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:["claude"===e.provider&&"oauth"===e.authType&&(0,a.jsx)(x.m_,{text:"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",children:(0,a.jsx)("button",{type:"button",onClick:()=>ez(e.id,!0!==D[e.id]),"aria-label":"Toggle auto-ping",className:`flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${!0===D[e.id]?"text-primary":"text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"})})}),(0,a.jsx)("button",{type:"button",onClick:()=>eM(e.id,e.provider),disabled:h||f,"aria-label":"Refresh quota",className:"p-1.5 rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",title:"Refresh quota",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${h?"animate-spin":""}`,children:"refresh"})}),(0,a.jsx)("button",{type:"button",onClick:()=>{et(e),Z(!0)},disabled:f,"aria-label":"Edit connection",className:"p-1.5 rounded-lg hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary transition-colors disabled:opacity-50",title:"Edit connection",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eT(e.id),disabled:f,"aria-label":"Delete connection",className:"p-1.5 rounded-lg hover:bg-red-500/10 text-red-500 transition-colors disabled:opacity-50",title:"Delete connection",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${G===e.id?"animate-pulse":""}`,children:"delete"})}),(0,a.jsx)("div",{className:"inline-flex items-center pl-0.5",title:e.isActive??!0?"Disable connection":"Enable connection",children:(0,a.jsx)(u.default,{size:"sm",checked:e.isActive??!0,disabled:f,onChange:t=>eD(e.id,t)})})]})]})}),(0,a.jsx)("div",{className:"px-2 py-1.5",children:h?(0,a.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):b?(0,a.jsxs)("div",{className:"text-center py-5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,a.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:b})]}):l?.message?(0,a.jsx)("div",{className:"text-center py-5",children:(0,a.jsx)("p",{className:"text-xs text-text-muted",children:l.message})}):(t=l?.quotas||[],s=function(e,t=[],r={}){if(!Array.isArray(t)||0===t.length)return[];let a=c(e,r);return 0===a.size?t:t.filter(e=>!a.has(o(e)))}(e.provider,t,I),n=function(e,t=[],r={}){if(!Array.isArray(t)||0===t.length)return[];let a=c(e,r);return 0===a.size?[]:t.filter(e=>a.has(o(e)))}(e.provider,t,I),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d,{quotas:s,compact:!0,sortMode:"default",showSortLabel:"codex"===e.provider&&"default"!==ed,onHideQuota:t=>e_(e.provider,o(t),!0)}),n.length>0&&(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[11px] text-text-muted",children:[(0,a.jsxs)("span",{children:[n.length," hidden:"]}),n.map(t=>{let r=o(t);return(0,a.jsxs)("button",{type:"button",onClick:()=>e_(e.provider,r,!1),className:"inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 hover:border-primary hover:text-primary transition-colors",title:`Show "${t.name}" again`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"visibility"}),t.name]},r)})]})]}))})]},e.id)})}),(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:eV}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:eB?"custom":String(ev),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(ey(1),ew(r),ej(String(r)))},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Accounts per page",children:[C.map(e=>(0,a.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,a.jsx)("option",{value:"custom",children:"Custom"})]}),(0,a.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:ek,onChange:e=>ej(e.target.value),onBlur:()=>{let e=Number.parseInt(ek,10);if(!Number.isFinite(e))return void ej(String(ev));let t=Math.min(500,Math.max(1,e));ey(1),ew(t),ej(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(ek,10);if(!Number.isFinite(t))return void ej(String(ev));let r=Math.min(500,Math.max(1,t));ey(1),ew(r),ej(String(r))},className:"h-8 w-20 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Custom accounts per page",placeholder:"Custom"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",eN.page," / ",eN.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>ey(1),disabled:eN.page<=1||V||J,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"First Page"}),(0,a.jsx)("button",{type:"button",onClick:()=>ey(e=>Math.max(1,e-1)),disabled:eN.page<=1||V||J,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Previous accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,a.jsx)("button",{type:"button",onClick:()=>ey(e=>Math.min(eN.totalPages,e+1)),disabled:eN.page>=eN.totalPages||V||J,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Next accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,a.jsx)("button",{type:"button",onClick:()=>ey(eN.totalPages),disabled:eN.page>=eN.totalPages||V||J,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Last Page"})]})]})}),(0,a.jsx)(x.wI,{isOpen:X,connection:ee,proxyPools:er,onSave:eO,onClose:()=>{Z(!1),et(null)}})]}):(0,a.jsx)(m.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:eK.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:eK.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:eK.description})]})}):(0,a.jsx)(m.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})})}}},e=>{e.O(0,[7504,1321,5497,8441,3794,7358],()=>e(e.s=7450)),_N_E=e.O()}]);
|
package/app/cli/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sifxprime/krouter",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.166",
|
|
4
4
|
"description": "Local AI gateway for Claude Code, Cursor, Codex, Copilot, Cline and any OpenAI-compatible client. Route 40+ LLM providers and 100+ models through one endpoint with automatic fallback, OAuth key management and 20-40% token savings.",
|
|
5
5
|
"homepage": "https://krouter.kodelyth.com",
|
|
6
6
|
"repository": {
|
|
@@ -112,6 +112,15 @@ function cloneSort(comparator) {
|
|
|
112
112
|
return templateFn(comparator);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
let isEvalAllowed = (function () {
|
|
116
|
+
try {
|
|
117
|
+
new Function('return 0')();
|
|
118
|
+
return true;
|
|
119
|
+
} catch {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
})();
|
|
123
|
+
|
|
115
124
|
/**
|
|
116
125
|
* Sort the given array in-place with the given comparator function.
|
|
117
126
|
*
|
|
@@ -123,7 +132,7 @@ function cloneSort(comparator) {
|
|
|
123
132
|
|
|
124
133
|
let sortCache = new WeakMap();
|
|
125
134
|
exports.quickSort = function (ary, comparator, start = 0) {
|
|
126
|
-
let doQuickSort = sortCache.get(comparator);
|
|
135
|
+
let doQuickSort = isEvalAllowed ? sortCache.get(comparator) : SortTemplate(comparator);
|
|
127
136
|
if (doQuickSort === void 0) {
|
|
128
137
|
doQuickSort = cloneSort(comparator);
|
|
129
138
|
sortCache.set(comparator, doQuickSort);
|
|
@@ -11,6 +11,14 @@ var ArraySet = require('./array-set').ArraySet;
|
|
|
11
11
|
var base64VLQ = require('./base64-vlq');
|
|
12
12
|
var quickSort = require('./quick-sort').quickSort;
|
|
13
13
|
|
|
14
|
+
// Upper bound for a section's `offset.line` in an indexed source map. A flat
|
|
15
|
+
// map spends one ';' per generated line, so a tiny indexed map with a huge
|
|
16
|
+
// offset.line turns into a huge amount of work and memory once its mappings
|
|
17
|
+
// are copied into a SourceMapGenerator (CVE-2026-93749). Ten million lines is
|
|
18
|
+
// far beyond any real generated file. Columns are VLQ-encoded as deltas and
|
|
19
|
+
// don't amplify, so they only need to be valid integers.
|
|
20
|
+
var MAX_SECTION_OFFSET_LINE = 1e7;
|
|
21
|
+
|
|
14
22
|
function SourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
15
23
|
var sourceMap = aSourceMap;
|
|
16
24
|
if (typeof aSourceMap === 'string') {
|
|
@@ -935,6 +943,7 @@ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
|
935
943
|
line: -1,
|
|
936
944
|
column: 0
|
|
937
945
|
};
|
|
946
|
+
var maxOffsetLine = 0;
|
|
938
947
|
this._sections = sections.map(function (s) {
|
|
939
948
|
if (s.url) {
|
|
940
949
|
// The url field will require support for asynchronicity.
|
|
@@ -945,12 +954,32 @@ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
|
945
954
|
var offsetLine = util.getArg(offset, 'line');
|
|
946
955
|
var offsetColumn = util.getArg(offset, 'column');
|
|
947
956
|
|
|
957
|
+
if (!isValidOffset(offsetLine) || !isValidOffset(offsetColumn)) {
|
|
958
|
+
throw new Error('Section offset line and column must be non-negative integers.');
|
|
959
|
+
}
|
|
960
|
+
if (offsetLine > MAX_SECTION_OFFSET_LINE) {
|
|
961
|
+
throw new Error('Section offset line must not exceed ' + MAX_SECTION_OFFSET_LINE + '.');
|
|
962
|
+
}
|
|
963
|
+
|
|
948
964
|
if (offsetLine < lastOffset.line ||
|
|
949
965
|
(offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
|
|
950
966
|
throw new Error('Section offsets must be ordered and non-overlapping.');
|
|
951
967
|
}
|
|
952
968
|
lastOffset = offset;
|
|
953
969
|
|
|
970
|
+
var consumer = new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL);
|
|
971
|
+
|
|
972
|
+
// Offsets of a nested indexed map add up with this one, so apply the
|
|
973
|
+
// bound to the total.
|
|
974
|
+
var totalOffsetLine = offsetLine + (consumer._maxOffsetLine || 0);
|
|
975
|
+
if (totalOffsetLine > MAX_SECTION_OFFSET_LINE) {
|
|
976
|
+
throw new Error('Section offset line must not exceed ' + MAX_SECTION_OFFSET_LINE +
|
|
977
|
+
', including offsets of nested sections.');
|
|
978
|
+
}
|
|
979
|
+
if (totalOffsetLine > maxOffsetLine) {
|
|
980
|
+
maxOffsetLine = totalOffsetLine;
|
|
981
|
+
}
|
|
982
|
+
|
|
954
983
|
return {
|
|
955
984
|
generatedOffset: {
|
|
956
985
|
// The offset fields are 0-based, but we use 1-based indices when
|
|
@@ -958,9 +987,24 @@ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
|
958
987
|
generatedLine: offsetLine + 1,
|
|
959
988
|
generatedColumn: offsetColumn + 1
|
|
960
989
|
},
|
|
961
|
-
consumer:
|
|
990
|
+
consumer: consumer
|
|
962
991
|
}
|
|
963
992
|
});
|
|
993
|
+
|
|
994
|
+
// The largest offset.line of any section, including nested sections.
|
|
995
|
+
this._maxOffsetLine = maxOffsetLine;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
/**
|
|
999
|
+
* Section offsets come from untrusted input and are used as line/column
|
|
1000
|
+
* numbers, so only accept non-negative safe integers (rejects NaN, Infinity,
|
|
1001
|
+
* strings, fractions, etc).
|
|
1002
|
+
*/
|
|
1003
|
+
function isValidOffset(aValue) {
|
|
1004
|
+
return typeof aValue === 'number' &&
|
|
1005
|
+
aValue >= 0 &&
|
|
1006
|
+
aValue <= 9007199254740991 && // Number.MAX_SAFE_INTEGER
|
|
1007
|
+
Math.floor(aValue) === aValue;
|
|
964
1008
|
}
|
|
965
1009
|
|
|
966
1010
|
IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
|
|
@@ -978,8 +1022,12 @@ Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
|
|
|
978
1022
|
get: function () {
|
|
979
1023
|
var sources = [];
|
|
980
1024
|
for (var i = 0; i < this._sections.length; i++) {
|
|
981
|
-
|
|
982
|
-
|
|
1025
|
+
// Read the getter once per section: for a nested indexed map it is
|
|
1026
|
+
// itself this getter, and re-reading it per item is exponential in the
|
|
1027
|
+
// nesting depth (CVE-2026-93749).
|
|
1028
|
+
var sectionSources = this._sections[i].consumer.sources;
|
|
1029
|
+
for (var j = 0; j < sectionSources.length; j++) {
|
|
1030
|
+
sources.push(sectionSources[j]);
|
|
983
1031
|
}
|
|
984
1032
|
}
|
|
985
1033
|
return sources;
|
|
@@ -348,10 +348,12 @@ SourceMapGenerator.prototype._serializeMappings =
|
|
|
348
348
|
|
|
349
349
|
if (mapping.generatedLine !== previousGeneratedLine) {
|
|
350
350
|
previousGeneratedColumn = 0;
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
351
|
+
// One ';' per skipped line. Build large gaps with a single flat
|
|
352
|
+
// string: appending ';' one by one creates a rope node per line, which
|
|
353
|
+
// can exhaust the heap for a big gap (CVE-2026-93749).
|
|
354
|
+
var lineDelta = mapping.generatedLine - previousGeneratedLine;
|
|
355
|
+
next += lineDelta === 1 ? ';' : ';'.repeat(lineDelta);
|
|
356
|
+
previousGeneratedLine = mapping.generatedLine;
|
|
355
357
|
}
|
|
356
358
|
else {
|
|
357
359
|
if (i > 0) {
|
|
@@ -113,6 +113,13 @@ SourceNode.fromStringWithSourceMap =
|
|
|
113
113
|
// to the SourceNode without any mapping.
|
|
114
114
|
// Each line is added as separate string.
|
|
115
115
|
while (lastGeneratedLine < mapping.generatedLine) {
|
|
116
|
+
if (remainingLinesIndex >= remainingLines.length) {
|
|
117
|
+
// The generated code is exhausted. Skip the rest instead of adding
|
|
118
|
+
// empty lines one by one: a mapping may point far past the end of
|
|
119
|
+
// the code (e.g. an indexed map section with a huge offset.line).
|
|
120
|
+
lastGeneratedLine = mapping.generatedLine;
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
116
123
|
node.add(shiftNextLine());
|
|
117
124
|
lastGeneratedLine++;
|
|
118
125
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "source-map-js",
|
|
3
3
|
"description": "Generates and consumes source maps",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"homepage": "https://github.com/7rulnik/source-map-js",
|
|
6
6
|
"author": "Valentin 7rulnik Semirulnik <v7rulnik@gmail.com>",
|
|
7
7
|
"contributors": [
|
package/app/package.json
CHANGED
package/app/src/mitm/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var nr=F((bh,jn)=>{var Du=require("fs"),Qr=require("path"),Qn=require("os"),$r="krouter";function $n(){return process.platform==="win32"?Qr.join(process.env.APPDATA||Qr.join(Qn.homedir(),"AppData","Roaming"),$r):Qr.join(Qn.homedir(),`.${$r}`)}function Uu(){let e=process.env.DATA_DIR;if(!e)return $n();try{return Du.mkdirSync(e,{recursive:!0}),e}catch(t){if(t?.code==="EACCES"||t?.code==="EPERM")return console.warn(`[DATA_DIR] '${e}' not writable \u2192 fallback ~/.${$r}`),$n();throw t}}var Yn=Uu(),Pu=Qr.join(Yn,"mitm");jn.exports={DATA_DIR:Yn,MITM_DIR:Pu,APP_NAME:$r}});var Ir=F((_h,Jn)=>{var Wn=require("fs"),Ou=process.env.NODE_ENV==="development",Vu=(()=>{if(process.platform==="win32")return null;for(let e of["/usr/sbin/lsof","/usr/bin/lsof","/sbin/lsof"])try{return Wn.accessSync(e,Wn.constants.X_OK),e}catch{}return"lsof"})(),Fu=["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","runtime.us-east-1.kiro.dev","api2.cursor.sh","api.anthropic.com"],Xn={antigravity:[":generateContent",":streamGenerateContent"],copilot:["/chat/completions","/v1/messages","/responses"],kiro:["/generateAssistantResponse"],cursor:["/BidiAppend","/RunSSE","/RunPoll","/Run"],claude:["/v1/messages"]};function Mu(e,t){return(Xn[e]||[]).some(r=>(t.url||"").includes(r))?!0:e==="kiro"?String(t.headers?.["x-amz-target"]||"").includes("GenerateAssistantResponse"):!1}var Ku={antigravity:{"gemini-default":"gemini-3.
|
|
1
|
+
var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var nr=F((bh,jn)=>{var Du=require("fs"),Qr=require("path"),Qn=require("os"),$r="krouter";function $n(){return process.platform==="win32"?Qr.join(process.env.APPDATA||Qr.join(Qn.homedir(),"AppData","Roaming"),$r):Qr.join(Qn.homedir(),`.${$r}`)}function Uu(){let e=process.env.DATA_DIR;if(!e)return $n();try{return Du.mkdirSync(e,{recursive:!0}),e}catch(t){if(t?.code==="EACCES"||t?.code==="EPERM")return console.warn(`[DATA_DIR] '${e}' not writable \u2192 fallback ~/.${$r}`),$n();throw t}}var Yn=Uu(),Pu=Qr.join(Yn,"mitm");jn.exports={DATA_DIR:Yn,MITM_DIR:Pu,APP_NAME:$r}});var Ir=F((_h,Jn)=>{var Wn=require("fs"),Ou=process.env.NODE_ENV==="development",Vu=(()=>{if(process.platform==="win32")return null;for(let e of["/usr/sbin/lsof","/usr/bin/lsof","/sbin/lsof"])try{return Wn.accessSync(e,Wn.constants.X_OK),e}catch{}return"lsof"})(),Fu=["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","runtime.us-east-1.kiro.dev","api2.cursor.sh","api.anthropic.com"],Xn={antigravity:[":generateContent",":streamGenerateContent"],copilot:["/chat/completions","/v1/messages","/responses"],kiro:["/generateAssistantResponse"],cursor:["/BidiAppend","/RunSSE","/RunPoll","/Run"],claude:["/v1/messages"]};function Mu(e,t){return(Xn[e]||[]).some(r=>(t.url||"").includes(r))?!0:e==="kiro"?String(t.headers?.["x-amz-target"]||"").includes("GenerateAssistantResponse"):!1}var Ku={antigravity:{"gemini-default":"gemini-3.8-flash-medium","gemini-3.5-flash-high":"gemini-3.8-flash-high","gemini-3.5-flash-medium":"gemini-3.8-flash-medium","gemini-3.5-flash-low":"gemini-3.8-flash-low","gemini-3.5-flash-extra-low":"gemini-3.8-flash-low","gemini-3.8-flash":"gemini-3.8-flash-medium","gemini-3.1-pro-high":"gemini-pro-agent","gemini-3-pro-high":"gemini-pro-agent","gemini-3-pro-low":"gemini-3.1-pro-low"}},qu={antigravity:[{match:/flash.*extra.*low|extra.*low.*flash|flash.*low|low.*flash/i,alias:"gemini-3.8-flash-low"},{match:/flash.*medium|medium.*flash/i,alias:"gemini-3.8-flash-medium"},{match:/flash.*agent|agent.*flash|flash/i,alias:"gemini-3.8-flash-high"},{match:/pro.*low|low.*pro/i,alias:"gemini-3.1-pro-low"},{match:/gemini.*pro|pro.*gemini/i,alias:"gemini-pro-agent"},{match:/opus.*5[.-]5.*high|5[.-]5.*opus.*high/i,alias:"claude-opus-5-5-high"},{match:/opus.*5[.-]5.*medium|5[.-]5.*opus.*medium/i,alias:"claude-opus-5-5-medium"},{match:/opus.*5[.-]5.*low|5[.-]5.*opus.*low/i,alias:"claude-opus-5-5-low"},{match:/opus.*5[.-]5|5[.-]5.*opus/i,alias:"claude-opus-5-5"},{match:/sonnet.*5[.-]5.*high|5[.-]5.*sonnet.*high/i,alias:"claude-sonnet-5-5-high"},{match:/sonnet.*5[.-]5.*medium|5[.-]5.*sonnet.*medium/i,alias:"claude-sonnet-5-5-medium"},{match:/sonnet.*5[.-]5.*low|5[.-]5.*sonnet.*low/i,alias:"claude-sonnet-5-5-low"},{match:/sonnet.*5[.-]5|5[.-]5.*sonnet/i,alias:"claude-sonnet-5-5"},{match:/opus/i,alias:"claude-opus-4-6-thinking"},{match:/sonnet|claude/i,alias:"claude-sonnet-4-6"},{match:/gpt.*oss|oss/i,alias:"gpt-oss-120b-medium"}]},Hu={antigravity:[/^tab[_-]/i]},Gu=["recordCodeAssistMetrics","recordTrajectoryAnalytics","fetchAdminControls","listExperiments","fetchUserInfo"];function zu(e){let t=(e||"").split(":")[0];return t==="api.individual.githubcopilot.com"?"copilot":t==="daily-cloudcode-pa.googleapis.com"||t==="cloudcode-pa.googleapis.com"?"antigravity":t==="q.us-east-1.amazonaws.com"||t==="codewhisperer.us-east-1.amazonaws.com"||t==="runtime.us-east-1.kiro.dev"?"kiro":t==="api2.cursor.sh"?"cursor":t==="api.anthropic.com"?"claude":null}Jn.exports={IS_DEV:Ou,LSOF_BIN:Vu,TARGET_HOSTS:Fu,URL_PATTERNS:Xn,MODEL_SYNONYMS:Ku,MODEL_PATTERNS:qu,MODEL_NO_MAP:Hu,LOG_BLACKLIST_URL_PARTS:Gu,getToolForHost:zu,isChatRequest:Mu}});var Rt=F((wh,ni)=>{var dt=require("fs"),ir=require("path"),Na=require("zlib"),{DATA_DIR:Qu}=nr(),{LOG_BLACKLIST_URL_PARTS:$u}=Ir();function Zn(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}var Yu=e=>console.log(`[${Zn()}] [MITM] ${e}`),ju=e=>console.error(`[${Zn()}] \u274C [MITM] ${e}`),ht=ir.join(Qu,"logs","mitm");dt.existsSync(ht)||dt.mkdirSync(ht,{recursive:!0});function Wu(){try{if(!dt.existsSync(ht))return;for(let e of dt.readdirSync(ht))try{dt.rmSync(ir.join(ht,e),{recursive:!0,force:!0})}catch{}}catch{}}var Xu=/^(authorization|proxy-authorization|cookie|set-cookie|x-api-key|api-key|x-goog-api-key|x-aws-.*|x-amz-.*|x-amzn-.*|x-stainless-api-key|openai-api-key|anthropic-api-key)$/i;function ei(e){if(!e||typeof e!="object")return e;let t={};for(let[a,r]of Object.entries(e))t[a]=Xu.test(a)?"[REDACTED]":r;return t}var Ju=Number(process.env.MITM_MAX_DUMP_FILES)||1e3,Zu=0;function ti(){if(++Zu%100===0)try{let e=dt.readdirSync(ht).map(t=>({f:t,t:dt.statSync(ir.join(ht,t)).mtimeMs})).sort((t,a)=>a.t-t.t);for(let{f:t}of e.slice(Ju))try{dt.rmSync(ir.join(ht,t),{force:!0})}catch{}}catch{}}var e0=/^\s*(\{\s*\}|\[\s*\]|null)?\s*$/;function ri(e,t=80){return String(e).replace(/[^a-zA-Z0-9]/g,"_").substring(0,t)}function ai(e){return e?$u.some(t=>e.includes(t)):!1}function t0(e,t){if(!e||e.length===0)return e;try{let a=(t||"").toLowerCase();if(a.includes("gzip"))return Na.gunzipSync(e);if(a.includes("br"))return Na.brotliDecompressSync(e);if(a.includes("deflate"))return Na.inflateSync(e)}catch{}return e}function r0(e,t,a="raw"){if(ai(e.url))return null;try{let r=new Date().toISOString().replace(/[:.]/g,"-"),n=ri((e.headers.host||"")+e.url),s=ir.join(ht,`${r}_${a}_${n}.req.json`),i=null;try{i=JSON.parse(t.toString())}catch{}return dt.writeFileSync(s,JSON.stringify({method:e.method,url:e.url,host:e.headers.host,headers:ei(e.headers),body:i??t.toString("utf8")},null,2)),ti(),s}catch{return null}}function a0(e,t="raw"){if(ai(e.url))return null;let a=new Date().toISOString().replace(/[:.]/g,"-"),r=ri((e.headers.host||"")+e.url),n=ir.join(ht,`${a}_${t}_${r}.res.txt`),s=0,i={},o=[];return{writeHeader:(u,l)=>{s=u,i=l||{}},writeChunk:u=>{u!=null&&o.push(Buffer.isBuffer(u)?u:Buffer.from(u))},end:()=>{try{let u=Buffer.concat(o),l=i["content-encoding"]||i["Content-Encoding"],f=t0(u,l).toString("utf8");if(e0.test(f))return;let g=ei({...i});delete g["content-encoding"],delete g["Content-Encoding"];let v=`STATUS: ${s}
|
|
2
2
|
HEADERS: ${JSON.stringify(g,null,2)}
|
|
3
3
|
---BODY---
|
|
4
4
|
${f}`;dt.writeFileSync(n,v),ti()}catch{}},file:n}}ni.exports={log:Yu,err:ju,dumpRequest:r0,createResponseDumper:a0,clearDumpDir:Wu}});var $=F((Nh,ii)=>{ii.exports={options:{usePureJavaScript:!1}}});var ui=F((Rh,oi)=>{var Ra={};oi.exports=Ra;var si={};Ra.encode=function(e,t,a){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(a!==void 0&&typeof a!="number")throw new TypeError('"maxline" must be a number.');var r="";if(!(e instanceof Uint8Array))r=n0(e,t);else{var n=0,s=t.length,i=t.charAt(0),o=[0];for(n=0;n<e.length;++n){for(var u=0,l=e[n];u<o.length;++u)l+=o[u]<<8,o[u]=l%s,l=l/s|0;for(;l>0;)o.push(l%s),l=l/s|0}for(n=0;e[n]===0&&n<e.length-1;++n)r+=i;for(n=o.length-1;n>=0;--n)r+=t[o[n]]}if(a){var c=new RegExp(".{1,"+a+"}","g");r=r.match(c).join(`\r
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sifxprime/krouter",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.166",
|
|
4
4
|
"description": "Local AI gateway for Claude Code, Cursor, Codex, Copilot, Cline and any OpenAI-compatible client. Route 40+ LLM providers and 100+ models through one endpoint with automatic fallback, OAuth key management and 20-40% token savings.",
|
|
5
5
|
"homepage": "https://krouter.kodelyth.com",
|
|
6
6
|
"repository": {
|
package/src/cli/menus/combos.js
CHANGED
|
@@ -4,6 +4,7 @@ const { clearScreen, showStatus, showHeader } = require("../utils/display");
|
|
|
4
4
|
const { formatDate } = require("../utils/format");
|
|
5
5
|
const { selectModelFromList } = require("../utils/modelSelector");
|
|
6
6
|
const { showMenuWithBack } = require("../utils/menuHelper");
|
|
7
|
+
const { comboModelId } = require("../utils/comboModelId");
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Format model to string (handle both string and object)
|
|
@@ -253,7 +254,7 @@ async function handleCreateCombo() {
|
|
|
253
254
|
|
|
254
255
|
if (selectedModels.length > 0) {
|
|
255
256
|
selectedModels.forEach((m, i) => {
|
|
256
|
-
console.log(` ${i + 1}. ${m
|
|
257
|
+
console.log(` ${i + 1}. ${m}`);
|
|
257
258
|
});
|
|
258
259
|
} else {
|
|
259
260
|
console.log(" (none)");
|
|
@@ -295,7 +296,15 @@ async function handleCreateCombo() {
|
|
|
295
296
|
continue;
|
|
296
297
|
}
|
|
297
298
|
|
|
298
|
-
|
|
299
|
+
// 0.5.166 — save the "provider/model" string, not the /api/models record,
|
|
300
|
+
// or the combo holds objects the router cannot resolve (upstream b677bfce).
|
|
301
|
+
const modelId = comboModelId(availableModels[num - 1]);
|
|
302
|
+
if (!modelId) {
|
|
303
|
+
showStatus("Selected model has no valid identifier", "error");
|
|
304
|
+
await pause();
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
selectedModels.push(modelId);
|
|
299
308
|
}
|
|
300
309
|
|
|
301
310
|
// Create combo
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// 0.5.166 — combos store "provider/model" strings. /api/models returns records
|
|
2
|
+
// ({ provider, model, fullModel, alias }), so convert before saving; null means
|
|
3
|
+
// the record has no usable identifier (upstream b677bfce).
|
|
4
|
+
function comboModelId(model) {
|
|
5
|
+
if (typeof model === "string") return model || null;
|
|
6
|
+
if (typeof model?.fullModel === "string" && model.fullModel) return model.fullModel;
|
|
7
|
+
if (typeof model?.provider === "string" && model.provider
|
|
8
|
+
&& typeof model?.model === "string" && model.model) {
|
|
9
|
+
return `${model.provider}/${model.model}`;
|
|
10
|
+
}
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
module.exports = { comboModelId };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=4746,exports.ids=[4746],exports.modules={6382:(a,b,c)=>{c.d(b,{$D:()=>m,P9:()=>j,We:()=>f,aZ:()=>n,gI:()=>i,rG:()=>h});let d="-agentic",e="-thinking";function f(a){return"google"===a||"github"===a?"arn:aws:codewhisperer:us-east-1:699475941385:profile/EHGA3GRVQMUK":"arn:aws:codewhisperer:us-east-1:638616132270:profile/AAAACCCCXXXX"}let g={none:0,minimal:512,low:1024,medium:8192,high:24576,xhigh:32768,max:128e3},h=`
|
|
2
|
-
# CRITICAL: CHUNKED WRITE PROTOCOL (MANDATORY)
|
|
3
|
-
|
|
4
|
-
You MUST follow these rules for ALL file operations. Violation causes server timeouts and task failure.
|
|
5
|
-
|
|
6
|
-
## ABSOLUTE LIMITS
|
|
7
|
-
- **MAXIMUM 350 LINES** per single write/edit operation - NO EXCEPTIONS
|
|
8
|
-
- **RECOMMENDED 300 LINES** or less for optimal performance
|
|
9
|
-
- **NEVER** write entire files in one operation if >300 lines
|
|
10
|
-
|
|
11
|
-
## MANDATORY CHUNKED WRITE STRATEGY
|
|
12
|
-
|
|
13
|
-
### For NEW FILES (>300 lines total):
|
|
14
|
-
1. FIRST: Write initial chunk (first 250-300 lines) using write_to_file/fsWrite
|
|
15
|
-
2. THEN: Append remaining content in 250-300 line chunks using file append operations
|
|
16
|
-
3. REPEAT: Continue appending until complete
|
|
17
|
-
|
|
18
|
-
### For EDITING EXISTING FILES:
|
|
19
|
-
1. Use surgical edits (apply_diff/targeted edits) - change ONLY what's needed
|
|
20
|
-
2. NEVER rewrite entire files - use incremental modifications
|
|
21
|
-
3. Split large refactors into multiple small, focused edits
|
|
22
|
-
|
|
23
|
-
### For LARGE CODE GENERATION:
|
|
24
|
-
1. Generate in logical sections (imports, types, functions separately)
|
|
25
|
-
2. Write each section as a separate operation
|
|
26
|
-
3. Use append operations for subsequent sections
|
|
27
|
-
|
|
28
|
-
## EXAMPLES OF CORRECT BEHAVIOR
|
|
29
|
-
|
|
30
|
-
CORRECT: Writing a 600-line file
|
|
31
|
-
- Operation 1: Write lines 1-300 (initial file creation)
|
|
32
|
-
- Operation 2: Append lines 301-600
|
|
33
|
-
|
|
34
|
-
CORRECT: Editing multiple functions
|
|
35
|
-
- Operation 1: Edit function A
|
|
36
|
-
- Operation 2: Edit function B
|
|
37
|
-
- Operation 3: Edit function C
|
|
38
|
-
|
|
39
|
-
WRONG: Writing 500 lines in single operation -> TIMEOUT
|
|
40
|
-
WRONG: Rewriting entire file to change 5 lines -> TIMEOUT
|
|
41
|
-
WRONG: Generating massive code blocks without chunking -> TIMEOUT
|
|
42
|
-
|
|
43
|
-
## WHY THIS MATTERS
|
|
44
|
-
- Server has 2-3 minute timeout for operations
|
|
45
|
-
- Large writes exceed timeout and FAIL completely
|
|
46
|
-
- Chunked writes are FASTER and more RELIABLE
|
|
47
|
-
- Failed writes waste time and require retry
|
|
48
|
-
|
|
49
|
-
REMEMBER: When in doubt, write LESS per operation. Multiple small operations > one large operation.
|
|
50
|
-
`.trim();function i(a,b,c){return null!==j(a,b,c)}function j(a,b,c){if(a&&"object"==typeof a){let b=a.thinking;if(b&&"object"==typeof b){if("disabled"===b.type||"off"===b.type||"none"===b.type)return null;let a=Number(b.budget_tokens);if(Number.isFinite(a)&&a>0)return a;if("enabled"===b.type)return 16e3}let c=a.output_config?.effort??a.reasoning_effort??(a.reasoning&&"object"==typeof a.reasoning?a.reasoning.effort:null);if("string"==typeof c&&c){let a=c.toLowerCase();if("none"===a||"off"===a||"disabled"===a)return null;if(Object.prototype.hasOwnProperty.call(g,a)){let b=g[a];return 0===b?null:b}if("auto"===a)return 16e3}}if(b){let a=function(a,b){if(!a)return;if("function"==typeof a.get)return a.get(b);let c=b.toLowerCase();for(let b of Object.keys(a))if(b.toLowerCase()===c)return a[b]}(b,"anthropic-beta");if("string"==typeof a&&a.toLowerCase().includes("interleaved-thinking"))return 16e3}if(function(a){for(let b of Array.isArray(a?.messages)?a.messages:[]){if(!b||"system"!==b.role&&"user"!==b.role)continue;let a=b.content;if("string"==typeof a){if(o(a))return!0}else if(Array.isArray(a))for(let b of a){let a=b?.text;if("string"==typeof a&&o(a))return!0}}return!!("string"==typeof a?.system&&o(a.system))}(a))return 16e3;if("string"==typeof c&&c){let a=c.toLowerCase();if(a.includes("thinking")||a.includes("-reason"))return 16e3}return null}function k(a){return"string"==typeof a&&a.endsWith(d)}function l(a){return"string"==typeof a&&a.endsWith(e)}function m(a){var b,c;let f=a,g=!1,h=!1;return k(f)&&(g=!0,f=k(b=f)?b.slice(0,-d.length):b),l(f)&&(h=!0,f=l(c=f)?c.slice(0,-e.length):c),{upstream:f,agentic:g,thinking:h}}function n(a=16e3){let b=Math.max(1,Math.min(32e3,Number(a)||16e3));return`<thinking_mode>enabled</thinking_mode>
|
|
51
|
-
<max_thinking_length>${b}</max_thinking_length>`}function o(a){return!!a&&!!a.includes("<thinking_mode>")&&(a.includes("<thinking_mode>enabled</thinking_mode>")||a.includes("<thinking_mode>interleaved</thinking_mode>"))}},40669:(a,b,c)=>{c.d(b,{Xh:()=>e,js:()=>f});let d={cc:"claude",cx:"codex",gc:"gemini-cli",qw:"qwen",if:"iflow",ag:"antigravity",gh:"github",kr:"kiro",cu:"cursor",kc:"kilocode",kmc:"kimi-coding",cl:"cline",clinepass:"clinepass",cbcn:"codebuddy-cn",kimchi:"kimchi",gcli:"grok-cli",oc:"opencode",ocg:"opencode-go",qd:"qoder",qoder:"qoder",el:"elevenlabs",openai:"openai",vercel:"vercel-ai-gateway","vercel-ai-gateway":"vercel-ai-gateway",anthropic:"anthropic",gemini:"gemini",openrouter:"openrouter",glm:"glm",zcode:"glm",zai:"glm","z.ai":"glm",kimi:"kimi",minimax:"minimax","minimax-cn":"minimax-cn",hf:"huggingface",huggingface:"huggingface","alitp-intl":"alitp-intl","fish-audio":"fish-audio",tr:"tokenrouter",tokenrouter:"tokenrouter",ps:"poolside",poolside:"poolside",ds:"deepseek",deepseek:"deepseek",cmc:"commandcode",commandcode:"commandcode",groq:"groq",xai:"xai",mistral:"mistral",pplx:"perplexity",perplexity:"perplexity",together:"together",fireworks:"fireworks",cerebras:"cerebras",cohere:"cohere",nvidia:"nvidia",nebius:"nebius",siliconflow:"siliconflow",hyp:"hyperbolic",hyperbolic:"hyperbolic",dg:"deepgram",deepgram:"deepgram",aai:"assemblyai",assemblyai:"assemblyai",nb:"nanobanana",nanobanana:"nanobanana",ch:"chutes",chutes:"chutes",ark:"volcengine-ark","volcengine-ark":"volcengine-ark",byteplus:"byteplus",bpm:"byteplus",cursor:"cursor",vx:"vertex",vertex:"vertex",vxp:"vertex-partner","vertex-partner":"vertex-partner",atms:"atomesus",atomesus:"atomesus",fl:"featherless",featherless:"featherless",venice:"venice","perplexity-agent":"perplexity-agent",gw:"grok-web","grok-web":"grok-web",pw:"perplexity-web","perplexity-web":"perplexity-web",mimo:"xiaomi-mimo","xiaomi-mimo":"xiaomi-mimo",xmtp:"xiaomi-tokenplan","xiaomi-tokenplan":"xiaomi-tokenplan",cf:"cloudflare-ai","cloudflare-ai":"cloudflare-ai",fal:"fal-ai","fal-ai":"fal-ai",stability:"stability-ai","stability-ai":"stability-ai",bfl:"black-forest-labs","black-forest-labs":"black-forest-labs",recraft:"recraft",topaz:"topaz",runway:"runwayml",runwayml:"runwayml",jina:"jina-ai","jina-ai":"jina-ai",polly:"aws-polly","aws-polly":"aws-polly",agentrouter:"agentrouter",aimlapi:"aimlapi",aiml:"aimlapi",novita:"novita",modal:"modal",mdl:"modal",reka:"reka",nlpcloud:"nlpcloud",nlpc:"nlpcloud",bazaarlink:"bazaarlink",bzl:"bazaarlink",completions:"completions",cpl:"completions",enally:"enally",enly:"enally",freetheai:"freetheai",fta:"freetheai",llm7:"llm7",lepton:"lepton",kluster:"kluster",ai21:"ai21","inference-net":"inference-net",inet:"inference-net",predibase:"predibase",bytez:"bytez",morph:"morph",longcat:"longcat",lc:"longcat",puter:"puter",pu:"puter",uncloseai:"uncloseai",unc:"uncloseai",scaleway:"scaleway",scw:"scaleway",deepinfra:"deepinfra",sambanova:"sambanova",samba:"sambanova",nscale:"nscale",baseten:"baseten",publicai:"publicai","nous-research":"nous-research",nous:"nous-research",glhf:"glhf",bb:"blackbox",blackbox:"blackbox"};function e(a){if(!a)return{provider:null,model:null,isAlias:!1,providerAlias:null};if(a.includes("/")){let b=a.indexOf("/"),c=a.slice(0,b),e=a.slice(b+1);return{provider:d[c]||c,model:e,isAlias:!1,providerAlias:c}}return{provider:null,model:a,isAlias:!0,providerAlias:null}}async function f(a,b){let c=e(a);if(!c.isAlias)return{provider:c.provider,model:c.model};let f="function"==typeof b?await b():b,g=function(a,b){var c,e;if(!b)return null;let f=b[a];if(!f)return null;if("string"==typeof f&&f.includes("/")){let a=f.indexOf("/");return{provider:d[c=f.slice(0,a)]||c,model:f.slice(a+1)}}return"object"==typeof f&&f.provider&&f.model?{provider:d[e=f.provider]||e,model:f.model}:null}(c.model,f);return g||{provider:function(a){if(!a)return"openai";let b=a.toLowerCase();return b.startsWith("claude-")?"anthropic":b.startsWith("gemini-")?"gemini":b.startsWith("gpt-")||b.startsWith("o1")||b.startsWith("o3")||b.startsWith("o4")?"openai":b.startsWith("deepseek-")?"openrouter":"openai"}(c.model),model:c.model}}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=6306,exports.ids=[6306],exports.modules={66306:(a,b,c)=>{function d(a,b){return RegExp("^"+a.split("*").map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")+"$","i").test(b)}c.d(b,{a0:()=>g,nl:()=>k});let e={vision:!1,pdf:!1,audioInput:!1,videoInput:!1,imageOutput:!1,audioOutput:!1,search:!1,tools:!0,reasoning:!1,thinkingFormat:null,thinkingCanDisable:!0,thinkingRange:null,contextWindow:2e5,maxOutput:64e3},f={imageToText:{vision:!0},image:{imageOutput:!0},stt:{audioInput:!0},tts:{audioOutput:!0},embedding:{tools:!1}};function g(a){return f[a]||null}let h={"claude-opus-4.6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.7":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-4.6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:64e3},"claude-sonnet-4-6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-7":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-5":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-5":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:128e3},"gpt-image-1":{imageOutput:!0,tools:!1},"glm-4.6v":{vision:!0,reasoning:!0,thinkingFormat:"zai",contextWindow:128e3},"vision-model":{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6},"coder-model":{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6}},i={"codebuddy-cn":{"glm-5.2":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:48e3},"glm-5.1":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"glm-5.0":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:48e3},"glm-5.0-turbo":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"glm-5v-turbo":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:38e3},"glm-4.7":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:48e3},"minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:48e3},"minimax-m2.7":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"kimi-k2.7":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:256e3,maxOutput:32e3},"kimi-k2.6":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:256e3,maxOutput:32e3},"kimi-k2.5":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:164e3,maxOutput:32e3},"hy3-preview":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:192e3,maxOutput:64e3},"deepseek-v4-pro":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v4-flash":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v3-2-volc":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:96e3,maxOutput:32e3}}},j=[{pattern:"*claude*opus-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.8*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*haiku*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*opus*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*sonnet*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*fable*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*mythos*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude-3*",caps:{vision:!0}},{pattern:"*claude*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*gemini*image*",caps:{vision:!0,imageOutput:!0,contextWindow:1048576}},{pattern:"*gemini-3*pro*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65535}},{pattern:"*gemini-3*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini-2.5*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-budget",thinkingRange:{min:0,max:24576},contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini-2*",caps:{vision:!0,audioInput:!0,videoInput:!0,search:!0,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini*",caps:{vision:!0,search:!0,contextWindow:1048576}},{pattern:"*gemma*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*nanobanana*",caps:{vision:!0,imageOutput:!0}},{pattern:"*gpt-5*image*",caps:{imageOutput:!0}},{pattern:"*gpt-5*codex*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-5.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3}},{pattern:"*gpt-5*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-4o*",caps:{vision:!0,search:!0,contextWindow:128e3,maxOutput:16384}},{pattern:"*gpt-4.1*",caps:{vision:!0,contextWindow:1e6,maxOutput:32768}},{pattern:"*gpt-4-turbo*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*gpt-4*",caps:{contextWindow:128e3}},{pattern:"*gpt-3.5*",caps:{contextWindow:16385,maxOutput:4096}},{pattern:"*gpt-oss*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:128e3}},{pattern:"*o1-mini*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:128e3}},{pattern:"*o1*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o3*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o4*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*grok*image*",caps:{imageOutput:!0}},{pattern:"*grok-code*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*grok-4*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*grok-3*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:131072}},{pattern:"*grok*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*qwen*vl*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*qwen*max*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen*plus*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen*235b*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*qwen*coder*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6}},{pattern:"*qwq*",caps:{reasoning:!0,thinkingFormat:"qwen",thinkingCanDisable:!1,contextWindow:131072}},{pattern:"*qwen*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*kimi*k2.7*code*",caps:{vision:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:262144}},{pattern:"*kimi*k2*",caps:{vision:!0,reasoning:!0,thinkingFormat:"kimi",contextWindow:262144,maxOutput:262144}},{pattern:"*kimi*",caps:{reasoning:!0,thinkingFormat:"kimi",contextWindow:262144}},{pattern:"*glm-5*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5,maxOutput:128e3}},{pattern:"*glm-4.7*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5,maxOutput:128e3}},{pattern:"*glm-4*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5}},{pattern:"*glm*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5}},{pattern:"*deepseek-v4*",caps:{reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:384e3}},{pattern:"*reasoner*",caps:{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:128e3}},{pattern:"*deepseek-r*",caps:{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:128e3}},{pattern:"*deepseek-chat*",caps:{contextWindow:128e3}},{pattern:"*deepseek*",caps:{reasoning:!0,thinkingFormat:"deepseek",contextWindow:128e3}},{pattern:"*minimax*image*",caps:{imageOutput:!0}},{pattern:"*minimax-m3*",caps:{reasoning:!0,thinkingFormat:"minimax",contextWindow:1048576,maxOutput:512e3}},{pattern:"*minimax-m2.7*",caps:{reasoning:!0,thinkingFormat:"minimax",thinkingCanDisable:!1,contextWindow:204800,maxOutput:131072}},{pattern:"*minimax*",caps:{reasoning:!0,thinkingFormat:"minimax",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:131072}},{pattern:"*mimo*v2.5*",caps:{vision:!0,audioInput:!0,videoInput:!0,contextWindow:1048576,maxOutput:131072}},{pattern:"*mimo*omni*",caps:{vision:!0,audioInput:!0,contextWindow:262144,maxOutput:131072}},{pattern:"*mimo*",caps:{vision:!0,contextWindow:262144,maxOutput:131072}},{pattern:"*llama-4*",caps:{vision:!0,contextWindow:1e6}},{pattern:"*llama*",caps:{contextWindow:128e3}},{pattern:"*codestral*",caps:{contextWindow:256e3}},{pattern:"*mistral-large*",caps:{vision:!0,contextWindow:256e3}},{pattern:"*mistral*",caps:{contextWindow:128e3}},{pattern:"*command-a-vision*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*command*",caps:{contextWindow:128e3}},{pattern:"*sonar*",caps:{search:!0,contextWindow:128e3}},{pattern:"*pplx*",caps:{search:!0,contextWindow:128e3}},{pattern:"*perplexity*",caps:{search:!0,contextWindow:128e3}},{pattern:"*hunyuan*",caps:{reasoning:!0,thinkingFormat:"hunyuan",contextWindow:262144,maxOutput:262144}},{pattern:"hy3*",caps:{reasoning:!0,thinkingFormat:"hunyuan",contextWindow:262144,maxOutput:262144}},{pattern:"*step-*",caps:{reasoning:!0,thinkingFormat:"step",contextWindow:128e3}},{pattern:"*nemotron*",caps:{reasoning:!0,contextWindow:128e3}},{pattern:"*ling-*",caps:{reasoning:!0,contextWindow:128e3}}];function k(a,b){if(!b)return{...e};if(a&&i[a]?.[b])return{...e,...i[a][b]};let c=b.includes("/")?b.split("/").pop():b;if(h[c])return{...e,...h[c]};if(h[b])return{...e,...h[b]};for(let{pattern:a,caps:f}of j)if(d(a,c)||d(a,b))return{...e,...f};return{...e}}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=8319,exports.ids=[8319],exports.modules={12557:(a,b,c)=>{c.d(b,{Bl:()=>j,Qo:()=>f,S5:()=>l,hk:()=>e,kJ:()=>k});var d=c(3662);function e(a,b,c=0){let f=b?("string"==typeof b?b:JSON.stringify(b)).toLowerCase():"";for(let b of d.t2)if(b.text&&f&&f.includes(b.text)||b.status&&b.status===a){if(b.backoff){let a=Math.min(c+1,d.EQ.maxLevel);return{shouldFallback:!0,cooldownMs:function(a=0){let b=Math.max(0,a-1);return Math.min(d.EQ.base*Math.pow(2,b),d.EQ.max)}(a),newBackoffLevel:a}}if(!1===b.shouldFallback)return{shouldFallback:!1,cooldownMs:b.cooldownMs,accountLock:b.accountLock||!1,permanent:b.permanent||!1};return{shouldFallback:!0,cooldownMs:b.cooldownMs,accountLock:b.accountLock||!1,permanent:b.permanent||!1}}return{shouldFallback:!0,cooldownMs:d.wf}}function f(a){if(!a)return"";let b=new Date(a).getTime()-Date.now();if(b<=0)return"reset after 0s";let c=Math.ceil(b/1e3),d=Math.floor(c/3600),e=Math.floor(c%3600/60),f=c%60,g=[];return d>0&&g.push(`${d}h`),e>0&&g.push(`${e}m`),(f>0||0===g.length)&&g.push(`${f}s`),`reset after ${g.join(" ")}`}let g="modelLock_",h=`${g}__all`;function i(a){return a?`${g}${a}`:h}function j(a,b){let c=a=>a&&new Date(a).getTime()||0;return Math.max(c(a[i(b)]),c(a[h]))>Date.now()}function k(a){if(!a)return null;let b=null,c=Date.now();for(let[d,e]of Object.entries(a)){if(!d.startsWith(g)||!e)continue;let a=new Date(e).getTime();a<=c||(!b||a<b)&&(b=a)}return b?new Date(b).toISOString():null}function l(a,b){return{[i(a)]:new Date(Date.now()+b).toISOString()}}},20669:(a,b,c)=>{c.d(b,{g:()=>v,s:()=>w});var d=c(80238),e=c(89718),f=c(38775),g=c(43659),h=c(41004),i=c(8590);let j={xai:{baseUrl:"https://api.x.ai/v1/videos"}},k=Number(process.env.VIDEO_FETCH_TIMEOUT_MS||12e4),l=new Set(["generations","edits","extensions"]);function m(a,b=null){if(!a)return a;let c=String(a).replace(/Bearer\s+[A-Za-z0-9._~+/=-]{8,}/gi,"Bearer [redacted]");for(let a of["accessToken","refreshToken","apiKey"]){let d=b?.[a];"string"==typeof d&&d.length>=8&&(c=c.split(d).join("[redacted]"))}return c}async function n({provider:a,action:b=null,requestId:c=null,rawBody:d=null,contentType:e=null,idempotencyKey:f=null,credentials:o,signal:p,timeoutMs:q=k,log:r,onCredentialsRefreshed:s}){let t,u,v,w=j[a]||null;if(!w)return(0,g.A1)(h.gx.BAD_REQUEST,`Provider '${a}' does not support video generation`);if(!c&&!l.has(b))return(0,g.A1)(h.gx.BAD_REQUEST,`Unknown video action: ${b}`);let x=c?"GET":"POST",y=(u=w.baseUrl.replace(/\/$/,""),c?`${u}/${encodeURIComponent(c)}`:`${u}/${b}`),z=(v="function"==typeof AbortSignal?.timeout?AbortSignal.timeout(q):null,p&&v&&"function"==typeof AbortSignal.any?AbortSignal.any([p,v]):p||v||void 0),A=a=>fetch(y,{method:x,headers:function({token:a,contentType:b,idempotencyKey:c}){let d={Accept:"application/json"};return a&&(d.Authorization=`Bearer ${a}`),b&&(d["Content-Type"]=b),c&&(d["Idempotency-Key"]=c),d}({token:a,contentType:"POST"===x?e:null,idempotencyKey:"POST"===x?f:null}),body:"POST"===x?d:void 0,signal:z});try{t=await A(o?.accessToken||o?.apiKey)}catch(b){if(b?.name==="AbortError"||b?.name==="TimeoutError")return(0,g.A1)(h.gx.REQUEST_TIMEOUT,`[${a}] video ${x} aborted: ${b.message}`);return(0,g.A1)(h.gx.BAD_GATEWAY,m(`[${a}] video upstream fetch failed: ${b.message}`,o))}if((t.status===h.gx.UNAUTHORIZED||t.status===h.gx.FORBIDDEN)&&o?.refreshToken){let b=null;try{b=await (0,i.$B)(a,o,r)}catch(b){r?.warn?.("TOKEN",`${a} | video refresh error: ${m(b.message,o)}`)}if(b?.accessToken){r?.info?.("TOKEN",`${a.toUpperCase()} | refreshed for video ${x}`),Object.assign(o,b),s&&await s(b);try{await t.body?.cancel?.()}catch{}try{t=await A(o.accessToken||o.apiKey)}catch(b){return(0,g.A1)(h.gx.BAD_GATEWAY,m(`[${a}] video retry after refresh failed: ${b.message}`,o))}}else r?.warn?.("TOKEN",`${a.toUpperCase()} | video refresh failed — account needs re-auth`)}let B=await t.text().catch(()=>"");if(!t.ok){let b=m(B||`HTTP ${t.status}`,o);return(0,g.A1)(t.status,`[${a}] ${b.slice(0,2e3)}`)}return{success:!0,response:new Response(B,{status:t.status,headers:{"Content-Type":t.headers.get("content-type")||"application/json","Access-Control-Allow-Origin":"*"}})}}var o=c(67828),p=c(7803);let q=new Set([h.gx.UNAUTHORIZED,h.gx.FORBIDDEN,h.gx.RATE_LIMITED]);async function r(a){let b=(0,d.Tr)(a);if((await (0,e.mt)()).requireApiKey){if(!b)return(0,g.yj)(h.gx.UNAUTHORIZED,"Missing API key");if(!await (0,d.kI)(b))return(0,g.yj)(h.gx.UNAUTHORIZED,"Invalid API key")}return null}async function s(a){let b=a.headers.get("content-type")||"";if(b.includes("application/json")){let c,d=await a.text();try{c=JSON.parse(d)}catch{return{error:(0,g.yj)(h.gx.BAD_REQUEST,"Invalid JSON body")}}return{raw:d,parsed:c,contentType:b}}return{raw:Buffer.from(await a.arrayBuffer()),parsed:null,contentType:b}}async function t(a){if(!a?.model)return{provider:"xai",model:null};let b=String(a.model),c=await (0,f.mA)(b);return c.provider?j[c.provider]?{provider:c.provider,model:c.model}:b.includes("/")?{error:(0,g.yj)(h.gx.BAD_REQUEST,`Provider '${c.provider}' does not support video generation`)}:{provider:"xai",model:b}:{error:(0,g.yj)(h.gx.BAD_REQUEST,"Combos are not supported for video generation")}}function u(a,b){if(!b)return a;let c=new Headers(a.headers);return c.set("x-9router-connection-id",String(b)),new Response(a.body,{status:a.status,headers:c})}async function v(a,b){let c=await r(a);if(c)return c;let e=await s(a);if(e.error)return e.error;let f=await t(e.parsed);if(f.error)return f.error;let{provider:i,model:j}=f,k=e.raw;e.parsed&&j&&e.parsed.model!==j&&(k=JSON.stringify({...e.parsed,model:j}));let l=a.headers.get("x-connection-id")||null,v=a.headers.get("idempotency-key")||null,w=new Set,x=null,y=null;for(;;){let c=await (0,d.c1)(i,w,j,{preferredConnectionId:l});if(!c||c.allRateLimited){if(c?.allRateLimited){let a=x||c.lastError||"Unavailable",b=y||Number(c.lastErrorCode)||h.gx.SERVICE_UNAVAILABLE;return(0,g.wO)(b,`[${i}/${j||"video"}] ${a}`,c.retryAfter,c.retryAfterHuman)}if(0===w.size)return(0,g.yj)(h.gx.BAD_REQUEST,`No credentials for provider: ${i}`);return(0,g.yj)(y||h.gx.SERVICE_UNAVAILABLE,x||"All accounts unavailable")}let f=await (0,o.eU)(i,c),r=await n({provider:i,action:b,rawBody:k,contentType:e.contentType||null,idempotencyKey:v,credentials:f,signal:a.signal,log:p,onCredentialsRefreshed:async a=>{await (0,o.vN)(c.connectionId,{accessToken:a.accessToken,refreshToken:a.refreshToken,providerSpecificData:a.providerSpecificData,testStatus:"active"})}});if(r.success)return await (0,d.Pt)(c.connectionId,c,j),p.info("VIDEO",`${i.toUpperCase()} | ${b} accepted (connection ${c.connectionId})`),u(r.response,c.connectionId);let{shouldFallback:s}=await (0,d.vk)(c.connectionId,r.status,m(r.error,f),i,j);if(s&&q.has(r.status)){w.add(c.connectionId),x=r.error,y=r.status;continue}return r.response}}async function w(a,b){let c=await r(a);if(c)return c;if(!b)return(0,g.yj)(h.gx.BAD_REQUEST,"Missing video request id");let e=a.headers.get("x-connection-id")||null,f=await (0,d.c1)("xai",null,null,{preferredConnectionId:e});if(!f||f.allRateLimited)return(0,g.yj)(h.gx.BAD_REQUEST,"No credentials for provider: xai");let i=await (0,o.eU)("xai",f),j=await n({provider:"xai",requestId:b,credentials:i,signal:a.signal,log:p,onCredentialsRefreshed:async a=>{await (0,o.vN)(f.connectionId,{accessToken:a.accessToken,refreshToken:a.refreshToken,providerSpecificData:a.providerSpecificData,testStatus:"active"})}});return j.success?(await (0,d.Pt)(f.connectionId,f,null),u(j.response,f.connectionId)):(await (0,d.vk)(f.connectionId,j.status,m(j.error,i),"xai",null),j.response)}},38775:(a,b,c)=>{c.d(b,{d_:()=>k,mA:()=>j});var d=c(89718),e=c(40669),f=c(35024),g=c(44404);let h={xmtp:"xiaomi-tokenplan","xiaomi-tokenplan":"xiaomi-tokenplan"},i=new Set([...Object.keys(h),...Object.keys(f.xq),...Object.keys(g.Xg),...Object.values(g.Xg)]);async function j(a){let b,c=(b=(0,e.Xh)(a),b?.providerAlias&&h[b.providerAlias]?{...b,provider:h[b.providerAlias]}:b);if(!c.isAlias){if(!i.has(c.providerAlias)){let a=(await (0,d.Fh)({type:"openai-compatible"})).find(a=>a.prefix===c.providerAlias);if(a)return{provider:a.id,model:c.model};let b=(await (0,d.Fh)({type:"anthropic-compatible"})).find(a=>a.prefix===c.providerAlias);if(b)return{provider:b.id,model:c.model};let e=(await (0,d.Fh)({type:"custom-embedding"})).find(a=>a.prefix===c.providerAlias);if(e)return{provider:e.id,model:c.model}}return{provider:c.provider,model:c.model}}return await (0,d.Dj)(c.model)?{provider:null,model:c.model}:(0,e.js)(a,d.OM)}async function k(a){if(a.includes("/"))return null;let b=await (0,d.Dj)(a);return b&&b.models&&b.models.length>0?b.models:null}},43659:(a,b,c)=>{c.d(b,{A1:()=>g,lR:()=>i,wO:()=>h,yj:()=>e,zL:()=>f});var d=c(3662);function e(a,b){let c;return new Response(JSON.stringify((c=d.LY[a]||(a>=500?{type:"server_error",code:"internal_server_error"}:{type:"invalid_request_error",code:""}),{error:{message:b||d.O[a]||"An error occurred",type:c.type,code:c.code}})),{status:a,headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}async function f(a,b=null){let e="";try{e=await a.text()}catch{e=""}let g=null;try{let{parseRetryAfterHeaders:b}=await c.e(8905).then(c.bind(c,68905)),{resetsAtMs:d}=b(a);d&&(g=d)}catch{}if(b&&"function"==typeof b.parseError)try{let c=b.parseError(a,e);if(c&&"object"==typeof c){let b=c.message||d.O[a.status]||`Upstream error: ${a.status}`;return{statusCode:c.status||a.status,message:b,resetsAtMs:c.resetsAtMs||g}}}catch{}let h="";try{let a=JSON.parse(e);h=a.error?.message||a.message||a.error||e}catch{h=e}let i=("string"==typeof h?h:JSON.stringify(h))||d.O[a.status]||`Upstream error: ${a.status}`;return{statusCode:a.status,message:i,resetsAtMs:g||void 0}}function g(a,b,c,d={}){return{success:!1,status:a,error:b,resetsAtMs:c,response:e(a,b),...d}}function h(a,b,c,d){let e=Math.max(Math.ceil((new Date(c).getTime()-Date.now())/1e3),1);return new Response(JSON.stringify({error:{message:`${b} (${d})`}}),{status:a,headers:{"Content-Type":"application/json","Retry-After":String(e)}})}function i(a,b,c,d){let e=d||a.code||"FETCH_FAILED",f=a.message||"Unknown error",g=a.cause?.code,h=a.cause?.message,i=g||h?` (cause: ${[g,h].filter(Boolean).join(": ")})`:"";return`[${e}]: ${f}${i}`}},93943:(a,b,c)=>{c.d(b,{Vq:()=>i,fp:()=>g});var d=c(8590);let e=new Map;function f(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function g(a,b,c=Date.now()){if(!b)return!1;let e=f(b?.expiresAt??b?.tokenExpiresAt);return!!(null!==e&&e-c<(0,d.Og)(a)||"codex"===a&&b.refreshToken&&function(a,b=Date.now()){let c=f(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!c||b-c>=6912e5}(b,c))}async function h(a,b,c){let d,f=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),g=e.get(f);if(g)return g;let h=Promise.resolve().then(c).finally(()=>{e.delete(f)});return e.set(f,h),h}async function i(a,b,c){return b?h(a,b,async()=>{let e=await (0,d.$B)(a,b,c);return function(a,b,c,e=Date.now()){var f,g;if(!c)return null;if((0,d.jT)(c))return c;let h={},i=new Date(e).toISOString();c.accessToken&&(h.accessToken=c.accessToken),c.apiKey&&(h.apiKey=c.apiKey),c.token&&(h.token=c.token);let j=c.refreshToken??b?.refreshToken;j&&(h.refreshToken=j);let k=c.idToken??b?.idToken;return k&&(h.idToken=k),c.expiresIn?(h.expiresIn=c.expiresIn,h.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,e)):c.expiresAt&&(h.expiresAt=c.expiresAt),c.projectId&&(h.projectId=c.projectId),c.providerSpecificData&&(f=b?.providerSpecificData,h.providerSpecificData=(g=c.providerSpecificData)&&"object"==typeof g?{...f||{},...g}:f),c.copilotToken&&(h.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(h.copilotTokenExpiresAt=c.copilotTokenExpiresAt),("codex"===a||h.accessToken||h.apiKey||h.token||h.refreshToken||h.copilotToken)&&(h.lastRefreshAt=c.lastRefreshAt||i),h}(a,b,e)}):null}}};
|