ktrouter 1.0.9 â 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +13 -13
- package/app/.next/build-manifest.json +2 -2
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error.html +1 -1
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_not-found.html +1 -1
- package/app/.next/server/app/_not-found.rsc +4 -4
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/api/cli-tools/all-statuses/route.js +4 -4
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/cline-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/deepseek-tui-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/hermes-settings/route.js +3 -3
- package/app/.next/server/app/api/cli-tools/jcode-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +2 -2
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/client/route.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next/server/app/api/translator/send/route.js +1 -1
- package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next/server/app/api/translator/translate/route.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/models/info/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/compact/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/responses/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/search/route.js +1 -1
- package/app/.next/server/app/api/v1/web/fetch/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback.html +1 -1
- package/app/.next/server/app/callback.rsc +4 -4
- package/app/.next/server/app/callback.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next/server/app/dashboard/basic-chat.rsc +6 -6
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next/server/app/dashboard/cli-tools.rsc +6 -6
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.html +1 -1
- package/app/.next/server/app/dashboard/combos.rsc +6 -6
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.html +1 -1
- package/app/.next/server/app/dashboard/endpoint.rsc +6 -6
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next/server/app/dashboard/media-providers/web.rsc +6 -6
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/mitm.html +1 -1
- package/app/.next/server/app/dashboard/mitm.rsc +6 -6
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.html +1 -1
- package/app/.next/server/app/dashboard/profile.rsc +6 -6
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.html +1 -1
- package/app/.next/server/app/dashboard/providers/new.rsc +6 -6
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.html +1 -1
- package/app/.next/server/app/dashboard/providers.rsc +6 -6
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next/server/app/dashboard/proxy-pools.rsc +6 -6
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/quota.html +2 -2
- package/app/.next/server/app/dashboard/quota.rsc +7 -7
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
- package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.rsc +4 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/skills.html +1 -1
- package/app/.next/server/app/dashboard/skills.rsc +6 -6
- package/app/.next/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.html +1 -1
- package/app/.next/server/app/dashboard/translator.rsc +6 -6
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.html +1 -1
- package/app/.next/server/app/dashboard/usage.rsc +6 -6
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard.html +1 -1
- package/app/.next/server/app/dashboard.rsc +6 -6
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/index.html +1 -1
- package/app/.next/server/app/index.rsc +4 -4
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing.html +1 -1
- package/app/.next/server/app/landing.rsc +4 -4
- package/app/.next/server/app/landing.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login.html +1 -1
- package/app/.next/server/app/login.rsc +5 -5
- package/app/.next/server/app/login.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +13 -13
- package/app/.next/server/chunks/2029.js +4 -4
- package/app/.next/server/chunks/4657.js +1 -1
- package/app/.next/server/chunks/4746.js +1 -1
- package/app/.next/server/chunks/4820.js +1 -1
- package/app/.next/server/chunks/5644.js +1 -0
- package/app/.next/server/chunks/5718.js +7 -7
- package/app/.next/server/chunks/6202.js +1 -1
- package/app/.next/server/chunks/6811.js +1 -0
- package/app/.next/server/chunks/7828.js +1 -1
- package/app/.next/server/chunks/8491.js +1 -1
- package/app/.next/server/chunks/8590.js +1 -1
- package/app/.next/server/chunks/8895.js +2 -2
- package/app/.next/server/chunks/9142.js +1 -1
- package/app/.next/server/middleware-build-manifest.js +1 -1
- package/app/.next/server/pages/404.html +1 -1
- package/app/.next/server/pages/500.html +1 -1
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/1321-24b400ddf2b790cc.js +1 -0
- package/app/{.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-1277803af294689b.js â .next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-c3d63d2832bb900e.js} +8 -8
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-eaf1901db53c3f6b.js +3 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/page-da3b1a8e2887741c.js +1 -0
- package/app/.next/static/css/1026c611a39ff872.css +1 -0
- package/app/.next-cli-build/static/chunks/1321-24b400ddf2b790cc.js +1 -0
- package/app/{.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-1277803af294689b.js â .next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-c3d63d2832bb900e.js} +8 -8
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-eaf1901db53c3f6b.js +3 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-da3b1a8e2887741c.js +1 -0
- package/app/.next-cli-build/static/css/1026c611a39ff872.css +1 -0
- package/app/package.json +2 -1
- package/app/src/mitm/server.js +26 -26
- package/package.json +1 -1
- package/app/.next/server/chunks/7153.js +0 -1
- package/app/.next/server/chunks/9489.js +0 -1
- package/app/.next/server/chunks/9609.js +0 -1
- package/app/.next/static/chunks/1321-7a0fe6e57febbf39.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-7e27caddbbdfb166.js +0 -3
- package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/page-11c8df44d4fe8c2b.js +0 -1
- package/app/.next/static/css/7753c82947c05c5a.css +0 -1
- package/app/.next-cli-build/static/chunks/1321-7a0fe6e57febbf39.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-7e27caddbbdfb166.js +0 -3
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-11c8df44d4fe8c2b.js +0 -1
- package/app/.next-cli-build/static/css/7753c82947c05c5a.css +0 -1
- /package/app/.next/static/{NuyecPbqJKdNrB7EdSb2V â T_8jxnjC9lP9zXO0ueMK0}/_buildManifest.js +0 -0
- /package/app/.next/static/{NuyecPbqJKdNrB7EdSb2V â T_8jxnjC9lP9zXO0ueMK0}/_ssgManifest.js +0 -0
- /package/app/.next-cli-build/static/{NuyecPbqJKdNrB7EdSb2V â T_8jxnjC9lP9zXO0ueMK0}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{NuyecPbqJKdNrB7EdSb2V â T_8jxnjC9lP9zXO0ueMK0}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=4820,exports.ids=[4820],exports.modules={30869:(a,b,c)=>{c.d(b,{UY:()=>i,X3:()=>j,eh:()=>f.eh,fg:()=>e.fg,h0:()=>h,vQ:()=>g});var d=c(39006),e=c(75681),f=c(81329);let g={name:"KTRouter Proxy",description:"AI Infrastructure Management",version:d.rE},h={npmPackageName:"ktrouter",installCmd:"npm i -g ktrouter",installCmdLatest:"npm i -g ktrouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:3008},i={maxLines:200,pollIntervalMs:1e3},j={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat"}},35024:(a,b,c)=>{c.d(b,{Ak:()=>i,xq:()=>h});var d=c(21820);let e={"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},f={"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28","Anthropic-Dangerous-Direct-Browser-Access":"true","User-Agent":"claude-cli/2.1.92 (external, sdk-cli)","X-App":"cli","X-Stainless-Helper-Method":"stream","X-Stainless-Retry-Count":"0","X-Stainless-Runtime-Version":"v24.14.0","X-Stainless-Package-Version":"0.80.0","X-Stainless-Runtime":"node","X-Stainless-Lang":"js","X-Stainless-Arch":function(){switch((0,d.arch)()){case"x64":return"x64";case"arm64":return"arm64";case"ia32":return"x86";default:return`other::${(0,d.arch)()}`}}(),"X-Stainless-Os":function(){switch((0,d.platform)()){case"darwin":return"MacOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";default:return`Other::${(0,d.platform)()}`}}(),"X-Stainless-Timeout":"600"},g="https://api.kimi.com/coding/v1/messages",h={claude:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{...f},clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",tokenUrl:"https://api.anthropic.com/v1/oauth/token"},gemini:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",format:"gemini",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},"gemini-cli":{baseUrl:"https://cloudcode-pa.googleapis.com/v1internal",format:"gemini-cli",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},codex:{baseUrl:"https://chatgpt.com/backend-api/codex/responses",format:"openai-responses",headers:{originator:"codex-cli","User-Agent":"codex-cli/1.0.18 (macOS; arm64)"},clientId:"app_EMoamEEZ73f0CkXaXp7hrann",tokenUrl:"https://auth.openai.com/oauth/token"},qwen:{baseUrl:"https://portal.qwen.ai/v1/chat/completions",format:"openai",clientId:"f0304373b74a44d2b584a3fb70ca9e56",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",authUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{baseUrl:"https://apis.iflow.cn/v1/chat/completions",format:"openai",headers:{"User-Agent":"iFlow-Cli"},clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://iflow.cn/oauth/token",authUrl:"https://iflow.cn/oauth"},qoder:{baseUrl:"https://api.qoder.com/v1/chat/completions",format:"openai",headers:{"User-Agent":"Qoder-Cli"},clientId:process.env.QODER_OAUTH_CLIENT_ID||"10009311001",clientSecret:process.env.QODER_OAUTH_CLIENT_SECRET||"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://api.qoder.com/oauth/token",authUrl:"https://qoder.com/oauth/authorize"},antigravity:{baseUrls:["https://daily-cloudcode-pa.googleapis.com","https://daily-cloudcode-pa.sandbox.googleapis.com"],format:"antigravity",headers:{"User-Agent":`antigravity/1.107.0 ${(0,d.platform)()}/${(0,d.arch)()}`},clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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"},openrouter:{baseUrl:"https://openrouter.ai/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://endpoint-proxy.local","X-Title":"Endpoint Proxy"}},openai:{baseUrl:"https://api.openai.com/v1/chat/completions",format:"openai"},glm:{baseUrl:"https://api.z.ai/api/anthropic/v1/messages",format:"claude",headers:{...e}},"glm-cn":{baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",format:"openai",headers:{}},kimi:{baseUrl:g,format:"claude",headers:{...e}},minimax:{baseUrl:"https://api.minimax.io/anthropic/v1/messages",format:"claude",headers:{...e}},"minimax-cn":{baseUrl:"https://api.minimaxi.com/anthropic/v1/messages",format:"claude",headers:{...e}},alicode:{baseUrl:"https://coding.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},"alicode-intl":{baseUrl:"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},"volcengine-ark":{baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",format:"openai",headers:{}},byteplus:{baseUrl:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",format:"openai",headers:{}},github:{baseUrl:"https://api.githubcopilot.com/chat/completions",responsesUrl:"https://api.githubcopilot.com/responses",format:"openai",headers:{"copilot-integration-id":"vscode-chat","editor-version":"vscode/1.110.0","editor-plugin-version":"copilot-chat/0.38.0","user-agent":"GitHubCopilotChat/0.38.0","openai-intent":"conversation-panel","x-github-api-version":"2025-04-01","x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user",Accept:"application/json","Content-Type":"application/json"},clientId:"Iv1.b507a08c87ecfe98"},kiro:{baseUrl:"https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse",format:"kiro",retry:{429:2},headers:{"Content-Type":"application/json",Accept:"application/vnd.amazon.eventstream","X-Amz-Target":"AmazonCodeWhispererStreamingService.GenerateAssistantResponse","User-Agent":"AWS-SDK-JS/3.0.0 kiro-ide/1.0.0","X-Amz-User-Agent":"aws-sdk-js/3.0.0 kiro-ide/1.0.0"},tokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authUrl:"https://prod.us-east-1.auth.desktop.kiro.dev"},cursor:{baseUrl:"https://api2.cursor.sh",chatPath:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",format:"cursor",headers:{"connect-accept-encoding":"gzip","connect-protocol-version":"1","Content-Type":"application/connect+proto","User-Agent":"connect-es/1.6.1"},clientVersion:"3.1.0"},"kimi-coding":{baseUrl:g,format:"claude",headers:{...e},clientId:"17e5f671-d194-4dfb-9706-5516cb48c098",tokenUrl:"https://auth.kimi.com/api/oauth/token",refreshUrl:"https://auth.kimi.com/api/oauth/token"},kilocode:{baseUrl:"https://api.kilo.ai/api/openrouter/chat/completions",format:"openai",headers:{}},opencode:{baseUrl:"http://localhost:4096/v1/chat/completions",format:"openai",headers:{}},cline:{baseUrl:"https://api.cline.bot/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://cline.bot","X-Title":"Cline"},tokenUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},nvidia:{baseUrl:"https://integrate.api.nvidia.com/v1/chat/completions",format:"openai"},anthropic:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{...e}},deepseek:{baseUrl:"https://api.deepseek.com/chat/completions",format:"openai"},commandcode:{baseUrl:"https://api.commandcode.ai/alpha/generate",format:"commandcode",headers:{"x-command-code-version":"0.25.7","x-cli-environment":"cli"}},groq:{baseUrl:"https://api.groq.com/openai/v1/chat/completions",format:"openai"},xai:{baseUrl:"https://api.x.ai/v1/chat/completions",responsesUrl:"https://api.x.ai/v1/responses",format:"openai",clientId:"b1a00492-073a-47ea-816f-4c329264a828",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token"},mistral:{baseUrl:"https://api.mistral.ai/v1/chat/completions",format:"openai"},perplexity:{baseUrl:"https://api.perplexity.ai/chat/completions",format:"openai"},together:{baseUrl:"https://api.together.xyz/v1/chat/completions",format:"openai"},fireworks:{baseUrl:"https://api.fireworks.ai/inference/v1/chat/completions",format:"openai"},cerebras:{baseUrl:"https://api.cerebras.ai/v1/chat/completions",format:"openai"},cohere:{baseUrl:"https://api.cohere.ai/v1/chat/completions",format:"openai"},nebius:{baseUrl:"https://api.studio.nebius.ai/v1/chat/completions",format:"openai"},siliconflow:{baseUrl:"https://api.siliconflow.cn/v1/chat/completions",format:"openai"},hyperbolic:{baseUrl:"https://api.hyperbolic.xyz/v1/chat/completions",format:"openai"},deepgram:{baseUrl:"https://api.deepgram.com/v1/listen",format:"openai"},assemblyai:{baseUrl:"https://api.assemblyai.com/v1/audio/transcriptions",format:"openai"},nanobanana:{baseUrl:"https://api.nanobananaapi.ai/v1/chat/completions",format:"openai"},chutes:{baseUrl:"https://llm.chutes.ai/v1/chat/completions",format:"openai"},ollama:{baseUrl:"https://ollama.com/api/chat",format:"ollama"},"ollama-local":{baseUrl:"http://localhost:11434/api/chat",format:"ollama"},vertex:{baseUrl:"https://aiplatform.googleapis.com",format:"vertex"},"vertex-partner":{baseUrl:"https://aiplatform.googleapis.com",format:"openai"},gitlab:{baseUrl:"https://gitlab.com/api/v4/chat/completions",format:"openai"},codebuddy:{baseUrl:"https://copilot.tencent.com/v1/chat/completions",format:"openai"},opencode:{baseUrl:"https://opencode.ai",format:"openai",headers:{"x-opencode-client":"desktop"},noAuth:!0},"opencode-go":{baseUrl:"https://opencode.ai/zen/go/v1/chat/completions",format:"openai",headers:{}},"grok-web":{baseUrl:"https://grok.com/rest/app-chat/conversations/new",format:"grok-web",authType:"cookie"},"perplexity-web":{baseUrl:"https://www.perplexity.ai/rest/sse/perplexity_ask",format:"perplexity-web",authType:"cookie"},azure:{baseUrl:"",format:"openai",headers:{}},"cloudflare-ai":{baseUrl:"https://api.cloudflare.com/client/v4/accounts/{accountId}/ai/v1/chat/completions",format:"openai"},"xiaomi-mimo":{baseUrl:"https://api.xiaomimimo.com/v1/chat/completions",format:"openai"},"xiaomi-tokenplan":{baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1/chat/completions",format:"openai"},agentrouter:{baseUrl:"https://agentrouter.org/v1/messages",format:"claude",headers:{...f}},aimlapi:{baseUrl:"https://api.aimlapi.com/v1/chat/completions",format:"openai"},novita:{baseUrl:"https://api.novita.ai/v3/openai/chat/completions",format:"openai"},modal:{baseUrl:"https://api.modal.com/v1/chat/completions",format:"openai"},reka:{baseUrl:"https://api.reka.ai/v1/chat/completions",format:"openai"},nlpcloud:{baseUrl:"https://api.nlpcloud.io/v1/gpu/chatbot",format:"openai"},bazaarlink:{baseUrl:"https://bazaarlink.ai/api/v1/chat/completions",format:"openai"},completions:{baseUrl:"https://completions.me/api/v1/chat/completions",format:"openai"},enally:{baseUrl:"https://ai.enally.in/v1/chat/completions",format:"openai",authHeader:"x-api-key"},freetheai:{baseUrl:"https://api.freetheai.xyz/v1/chat/completions",format:"openai"},llm7:{baseUrl:"https://api.llm7.io/v1/chat/completions",format:"openai"},lepton:{baseUrl:"https://api.lepton.ai/api/v1/chat/completions",format:"openai"},kluster:{baseUrl:"https://api.kluster.ai/v1/chat/completions",format:"openai"},ai21:{baseUrl:"https://api.ai21.com/studio/v1/chat/completions",format:"openai"},"inference-net":{baseUrl:"https://api.inference.net/v1/chat/completions",format:"openai"},predibase:{baseUrl:"https://serving.app.predibase.com/v1/chat/completions",format:"openai"},bytez:{baseUrl:"https://api.bytez.com/models/v2",format:"openai"},morph:{baseUrl:"https://api.morphllm.com/v1/chat/completions",format:"openai"},longcat:{baseUrl:"https://api.longcat.chat/openai/v1/chat/completions",format:"openai"},puter:{baseUrl:"https://api.puter.com/puterai/openai/v1/chat/completions",format:"openai"},uncloseai:{baseUrl:"https://hermes.ai.unturf.com/v1/chat/completions",format:"openai",noAuth:!0},scaleway:{baseUrl:"https://api.scaleway.ai/v1/chat/completions",format:"openai"},deepinfra:{baseUrl:"https://api.deepinfra.com/v1/openai/chat/completions",format:"openai"},sambanova:{baseUrl:"https://api.sambanova.ai/v1/chat/completions",format:"openai"},nscale:{baseUrl:"https://inference.api.nscale.com/v1/chat/completions",format:"openai"},baseten:{baseUrl:"https://inference.baseten.co/v1/chat/completions",format:"openai"},publicai:{baseUrl:"https://api.publicai.co/v1/chat/completions",format:"openai"},"nous-research":{baseUrl:"https://inference-api.nousresearch.com/v1/chat/completions",format:"openai"},glhf:{baseUrl:"https://glhf.chat/api/openai/v1/chat/completions",format:"openai"},blackbox:{baseUrl:"https://api.blackbox.ai/chat/completions",format:"openai"}};function i(a){return(a?.providerSpecificData?.baseUrl?.trim()||"http://localhost:11434").replace(/\/$/,"")}},39006:a=>{a.exports={rE:"1.0.9"}},81329:(a,b,c)=>{c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))}};
|
|
1
|
+
"use strict";exports.id=4820,exports.ids=[4820],exports.modules={30869:(a,b,c)=>{c.d(b,{UY:()=>i,X3:()=>j,eh:()=>f.eh,fg:()=>e.fg,h0:()=>h,vQ:()=>g});var d=c(39006),e=c(75681),f=c(81329);let g={name:"KTRouter Proxy",description:"AI Infrastructure Management",version:d.rE},h={npmPackageName:"ktrouter",installCmd:"npm i -g ktrouter",installCmdLatest:"npm i -g ktrouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:3008},i={maxLines:200,pollIntervalMs:1e3},j={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat"}},35024:(a,b,c)=>{c.d(b,{Ak:()=>i,xq:()=>h});var d=c(21820);let e={"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},f={"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28","Anthropic-Dangerous-Direct-Browser-Access":"true","User-Agent":"claude-cli/2.1.92 (external, sdk-cli)","X-App":"cli","X-Stainless-Helper-Method":"stream","X-Stainless-Retry-Count":"0","X-Stainless-Runtime-Version":"v24.14.0","X-Stainless-Package-Version":"0.80.0","X-Stainless-Runtime":"node","X-Stainless-Lang":"js","X-Stainless-Arch":function(){switch((0,d.arch)()){case"x64":return"x64";case"arm64":return"arm64";case"ia32":return"x86";default:return`other::${(0,d.arch)()}`}}(),"X-Stainless-Os":function(){switch((0,d.platform)()){case"darwin":return"MacOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";default:return`Other::${(0,d.platform)()}`}}(),"X-Stainless-Timeout":"600"},g="https://api.kimi.com/coding/v1/messages",h={claude:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{...f},clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",tokenUrl:"https://api.anthropic.com/v1/oauth/token"},gemini:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",format:"gemini",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},"gemini-cli":{baseUrl:"https://cloudcode-pa.googleapis.com/v1internal",format:"gemini-cli",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},codex:{baseUrl:"https://chatgpt.com/backend-api/codex/responses",format:"openai-responses",headers:{originator:"codex-cli","User-Agent":"codex-cli/1.0.18 (macOS; arm64)"},clientId:"app_EMoamEEZ73f0CkXaXp7hrann",tokenUrl:"https://auth.openai.com/oauth/token"},qwen:{baseUrl:"https://portal.qwen.ai/v1/chat/completions",format:"openai",clientId:"f0304373b74a44d2b584a3fb70ca9e56",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",authUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{baseUrl:"https://apis.iflow.cn/v1/chat/completions",format:"openai",headers:{"User-Agent":"iFlow-Cli"},clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://iflow.cn/oauth/token",authUrl:"https://iflow.cn/oauth"},qoder:{baseUrl:"https://api.qoder.com/v1/chat/completions",format:"openai",headers:{"User-Agent":"Qoder-Cli"},clientId:process.env.QODER_OAUTH_CLIENT_ID||"10009311001",clientSecret:process.env.QODER_OAUTH_CLIENT_SECRET||"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://api.qoder.com/oauth/token",authUrl:"https://qoder.com/oauth/authorize"},antigravity:{baseUrls:["https://daily-cloudcode-pa.googleapis.com","https://daily-cloudcode-pa.sandbox.googleapis.com"],format:"antigravity",headers:{"User-Agent":`antigravity/1.107.0 ${(0,d.platform)()}/${(0,d.arch)()}`},clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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"},openrouter:{baseUrl:"https://openrouter.ai/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://endpoint-proxy.local","X-Title":"Endpoint Proxy"}},openai:{baseUrl:"https://api.openai.com/v1/chat/completions",format:"openai"},glm:{baseUrl:"https://api.z.ai/api/anthropic/v1/messages",format:"claude",headers:{...e}},"glm-cn":{baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",format:"openai",headers:{}},kimi:{baseUrl:g,format:"claude",headers:{...e}},minimax:{baseUrl:"https://api.minimax.io/anthropic/v1/messages",format:"claude",headers:{...e}},"minimax-cn":{baseUrl:"https://api.minimaxi.com/anthropic/v1/messages",format:"claude",headers:{...e}},alicode:{baseUrl:"https://coding.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},"alicode-intl":{baseUrl:"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},"volcengine-ark":{baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",format:"openai",headers:{}},byteplus:{baseUrl:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",format:"openai",headers:{}},github:{baseUrl:"https://api.githubcopilot.com/chat/completions",responsesUrl:"https://api.githubcopilot.com/responses",format:"openai",headers:{"copilot-integration-id":"vscode-chat","editor-version":"vscode/1.110.0","editor-plugin-version":"copilot-chat/0.38.0","user-agent":"GitHubCopilotChat/0.38.0","openai-intent":"conversation-panel","x-github-api-version":"2025-04-01","x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user",Accept:"application/json","Content-Type":"application/json"},clientId:"Iv1.b507a08c87ecfe98"},kiro:{baseUrl:"https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse",format:"kiro",retry:{429:2},headers:{"Content-Type":"application/json",Accept:"application/vnd.amazon.eventstream","X-Amz-Target":"AmazonCodeWhispererStreamingService.GenerateAssistantResponse","User-Agent":"AWS-SDK-JS/3.0.0 kiro-ide/1.0.0","X-Amz-User-Agent":"aws-sdk-js/3.0.0 kiro-ide/1.0.0"},tokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authUrl:"https://prod.us-east-1.auth.desktop.kiro.dev"},cursor:{baseUrl:"https://api2.cursor.sh",chatPath:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",format:"cursor",headers:{"connect-accept-encoding":"gzip","connect-protocol-version":"1","Content-Type":"application/connect+proto","User-Agent":"connect-es/1.6.1"},clientVersion:"3.1.0"},"kimi-coding":{baseUrl:g,format:"claude",headers:{...e},clientId:"17e5f671-d194-4dfb-9706-5516cb48c098",tokenUrl:"https://auth.kimi.com/api/oauth/token",refreshUrl:"https://auth.kimi.com/api/oauth/token"},kilocode:{baseUrl:"https://api.kilo.ai/api/openrouter/chat/completions",format:"openai",headers:{}},opencode:{baseUrl:"http://localhost:4096/v1/chat/completions",format:"openai",headers:{}},cline:{baseUrl:"https://api.cline.bot/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://cline.bot","X-Title":"Cline"},tokenUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},nvidia:{baseUrl:"https://integrate.api.nvidia.com/v1/chat/completions",format:"openai"},anthropic:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{...e}},deepseek:{baseUrl:"https://api.deepseek.com/chat/completions",format:"openai"},commandcode:{baseUrl:"https://api.commandcode.ai/alpha/generate",format:"commandcode",headers:{"x-command-code-version":"0.25.7","x-cli-environment":"cli"}},groq:{baseUrl:"https://api.groq.com/openai/v1/chat/completions",format:"openai"},xai:{baseUrl:"https://api.x.ai/v1/chat/completions",responsesUrl:"https://api.x.ai/v1/responses",format:"openai",clientId:"b1a00492-073a-47ea-816f-4c329264a828",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token"},mistral:{baseUrl:"https://api.mistral.ai/v1/chat/completions",format:"openai"},perplexity:{baseUrl:"https://api.perplexity.ai/chat/completions",format:"openai"},together:{baseUrl:"https://api.together.xyz/v1/chat/completions",format:"openai"},fireworks:{baseUrl:"https://api.fireworks.ai/inference/v1/chat/completions",format:"openai"},cerebras:{baseUrl:"https://api.cerebras.ai/v1/chat/completions",format:"openai"},cohere:{baseUrl:"https://api.cohere.ai/v1/chat/completions",format:"openai"},nebius:{baseUrl:"https://api.studio.nebius.ai/v1/chat/completions",format:"openai"},siliconflow:{baseUrl:"https://api.siliconflow.cn/v1/chat/completions",format:"openai"},hyperbolic:{baseUrl:"https://api.hyperbolic.xyz/v1/chat/completions",format:"openai"},deepgram:{baseUrl:"https://api.deepgram.com/v1/listen",format:"openai"},assemblyai:{baseUrl:"https://api.assemblyai.com/v1/audio/transcriptions",format:"openai"},nanobanana:{baseUrl:"https://api.nanobananaapi.ai/v1/chat/completions",format:"openai"},chutes:{baseUrl:"https://llm.chutes.ai/v1/chat/completions",format:"openai"},ollama:{baseUrl:"https://ollama.com/api/chat",format:"ollama"},"ollama-local":{baseUrl:"http://localhost:11434/api/chat",format:"ollama"},vertex:{baseUrl:"https://aiplatform.googleapis.com",format:"vertex"},"vertex-partner":{baseUrl:"https://aiplatform.googleapis.com",format:"openai"},gitlab:{baseUrl:"https://gitlab.com/api/v4/chat/completions",format:"openai"},codebuddy:{baseUrl:"https://copilot.tencent.com/v1/chat/completions",format:"openai",refreshUrl:"https://copilot.tencent.com/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2"},opencode:{baseUrl:"https://opencode.ai",format:"openai",headers:{"x-opencode-client":"desktop"},noAuth:!0},"opencode-go":{baseUrl:"https://opencode.ai/zen/go/v1/chat/completions",format:"openai",headers:{}},"grok-web":{baseUrl:"https://grok.com/rest/app-chat/conversations/new",format:"grok-web",authType:"cookie"},"perplexity-web":{baseUrl:"https://www.perplexity.ai/rest/sse/perplexity_ask",format:"perplexity-web",authType:"cookie"},azure:{baseUrl:"",format:"openai",headers:{}},"cloudflare-ai":{baseUrl:"https://api.cloudflare.com/client/v4/accounts/{accountId}/ai/v1/chat/completions",format:"openai"},"xiaomi-mimo":{baseUrl:"https://api.xiaomimimo.com/v1/chat/completions",format:"openai"},"xiaomi-tokenplan":{baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1/chat/completions",format:"openai"},agentrouter:{baseUrl:"https://agentrouter.org/v1/messages",format:"claude",headers:{...f}},aimlapi:{baseUrl:"https://api.aimlapi.com/v1/chat/completions",format:"openai"},novita:{baseUrl:"https://api.novita.ai/v3/openai/chat/completions",format:"openai"},modal:{baseUrl:"https://api.modal.com/v1/chat/completions",format:"openai"},reka:{baseUrl:"https://api.reka.ai/v1/chat/completions",format:"openai"},nlpcloud:{baseUrl:"https://api.nlpcloud.io/v1/gpu/chatbot",format:"openai"},bazaarlink:{baseUrl:"https://bazaarlink.ai/api/v1/chat/completions",format:"openai"},completions:{baseUrl:"https://completions.me/api/v1/chat/completions",format:"openai"},enally:{baseUrl:"https://ai.enally.in/v1/chat/completions",format:"openai",authHeader:"x-api-key"},freetheai:{baseUrl:"https://api.freetheai.xyz/v1/chat/completions",format:"openai"},llm7:{baseUrl:"https://api.llm7.io/v1/chat/completions",format:"openai"},lepton:{baseUrl:"https://api.lepton.ai/api/v1/chat/completions",format:"openai"},kluster:{baseUrl:"https://api.kluster.ai/v1/chat/completions",format:"openai"},ai21:{baseUrl:"https://api.ai21.com/studio/v1/chat/completions",format:"openai"},"inference-net":{baseUrl:"https://api.inference.net/v1/chat/completions",format:"openai"},predibase:{baseUrl:"https://serving.app.predibase.com/v1/chat/completions",format:"openai"},bytez:{baseUrl:"https://api.bytez.com/models/v2",format:"openai"},morph:{baseUrl:"https://api.morphllm.com/v1/chat/completions",format:"openai"},longcat:{baseUrl:"https://api.longcat.chat/openai/v1/chat/completions",format:"openai"},puter:{baseUrl:"https://api.puter.com/puterai/openai/v1/chat/completions",format:"openai"},uncloseai:{baseUrl:"https://hermes.ai.unturf.com/v1/chat/completions",format:"openai",noAuth:!0},scaleway:{baseUrl:"https://api.scaleway.ai/v1/chat/completions",format:"openai"},deepinfra:{baseUrl:"https://api.deepinfra.com/v1/openai/chat/completions",format:"openai"},sambanova:{baseUrl:"https://api.sambanova.ai/v1/chat/completions",format:"openai"},nscale:{baseUrl:"https://inference.api.nscale.com/v1/chat/completions",format:"openai"},baseten:{baseUrl:"https://inference.baseten.co/v1/chat/completions",format:"openai"},publicai:{baseUrl:"https://api.publicai.co/v1/chat/completions",format:"openai"},"nous-research":{baseUrl:"https://inference-api.nousresearch.com/v1/chat/completions",format:"openai"},glhf:{baseUrl:"https://glhf.chat/api/openai/v1/chat/completions",format:"openai"},blackbox:{baseUrl:"https://api.blackbox.ai/chat/completions",format:"openai"}};function i(a){return(a?.providerSpecificData?.baseUrl?.trim()||"http://localhost:11434").replace(/\/$/,"")}},39006:a=>{a.exports={rE:"1.1.1"}},81329:(a,b,c)=>{c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=5644,exports.ids=[5644],exports.modules={18910:(a,b,c)=>{c.d(b,{Pr:()=>i,UP:()=>g,Vu:()=>h});var d=c(12557),e=c(43659);let f=new Map;function g(a){a?f.delete(a):f.clear()}function h(a,b){if(a.includes("/"))return null;let c=(Array.isArray(b)?b:b?.combos||[]).find(b=>b.name===a);return c&&c.models&&c.models.length>0?c.models:null}async function i({body:a,models:b,handleSingleModel:c,log:g,comboName:h,comboStrategy:j,comboStickyLimit:k=1}){let l=function(a,b,c,d=1){let e;if(!a||a.length<=1||"round-robin"!==c)return a;let g=b||"__default__",h=Number.isFinite(e=Number.parseInt(d,10))&&e>0?e:1,i=f.get(g),j="number"==typeof i?{index:i,consecutiveUseCount:0}:i||{index:0,consecutiveUseCount:0},k=j.index%a.length,l=function(a,b){let c=[...a];for(let a=0;a<b;a++){let a=c.shift();c.push(a)}return c}(a,k),m=j.consecutiveUseCount+1;return m>=h?f.set(g,{index:(k+1)%a.length,consecutiveUseCount:0}):f.set(g,{index:k,consecutiveUseCount:m}),l}(b,h,j,k),m=null,n=null,o=null;for(let b=0;b<l.length;b++){let e=l[b];g.info("COMBO",`Trying model ${b+1}/${l.length}: ${e}`);try{let b=await c(a,e);if(b.ok)return g.info("COMBO",`Model ${e} succeeded`),b;let f=b.statusText||"",h=null;try{let a=await b.clone().json();f=a?.error?.message||a?.error||a?.message||f,h=a?.retryAfter||null}catch{}if(h&&(!n||new Date(h)<new Date(n))&&(n=h),"string"!=typeof f)try{f=JSON.stringify(f)}catch{f=String(f)}let{shouldFallback:i,cooldownMs:j}=(0,d.hk)(b.status,f);if(!i)return g.warn("COMBO",`Model ${e} failed (no fallback)`,{status:b.status}),b;j&&j>0&&j<=5e3&&(503===b.status||502===b.status||504===b.status)&&(g.info("COMBO",`Model ${e} transient ${b.status}, waiting ${j}ms before next`),await new Promise(a=>setTimeout(a,j))),m=f||String(b.status),o||(o=b.status),g.warn("COMBO",`Model ${e} failed, trying next`,{status:b.status})}catch(a){m=a.message||String(a),o||(o=500),g.warn("COMBO",`Model ${e} threw error, trying next`,{error:m})}}let p=m&&m.toLowerCase().includes("no credentials")?503:o||503,q=m||"All combo models unavailable";if(n){let a=(0,d.Qo)(n);return g.warn("COMBO",`All models failed | ${q} (${a})`),(0,e.wO)(p,q,n,a)}return g.warn("COMBO",`All models failed | ${q}`),new Response(JSON.stringify({error:{message:q}}),{status:p,headers:{"Content-Type":"application/json"}})}},35024:(a,b,c)=>{c.d(b,{Ak:()=>i,xq:()=>h});var d=c(21820);let e={"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},f={"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28","Anthropic-Dangerous-Direct-Browser-Access":"true","User-Agent":"claude-cli/2.1.92 (external, sdk-cli)","X-App":"cli","X-Stainless-Helper-Method":"stream","X-Stainless-Retry-Count":"0","X-Stainless-Runtime-Version":"v24.14.0","X-Stainless-Package-Version":"0.80.0","X-Stainless-Runtime":"node","X-Stainless-Lang":"js","X-Stainless-Arch":function(){switch((0,d.arch)()){case"x64":return"x64";case"arm64":return"arm64";case"ia32":return"x86";default:return`other::${(0,d.arch)()}`}}(),"X-Stainless-Os":function(){switch((0,d.platform)()){case"darwin":return"MacOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";default:return`Other::${(0,d.platform)()}`}}(),"X-Stainless-Timeout":"600"},g="https://api.kimi.com/coding/v1/messages",h={claude:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{...f},clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",tokenUrl:"https://api.anthropic.com/v1/oauth/token"},gemini:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",format:"gemini",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},"gemini-cli":{baseUrl:"https://cloudcode-pa.googleapis.com/v1internal",format:"gemini-cli",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},codex:{baseUrl:"https://chatgpt.com/backend-api/codex/responses",format:"openai-responses",headers:{originator:"codex-cli","User-Agent":"codex-cli/1.0.18 (macOS; arm64)"},clientId:"app_EMoamEEZ73f0CkXaXp7hrann",tokenUrl:"https://auth.openai.com/oauth/token"},qwen:{baseUrl:"https://portal.qwen.ai/v1/chat/completions",format:"openai",clientId:"f0304373b74a44d2b584a3fb70ca9e56",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",authUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{baseUrl:"https://apis.iflow.cn/v1/chat/completions",format:"openai",headers:{"User-Agent":"iFlow-Cli"},clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://iflow.cn/oauth/token",authUrl:"https://iflow.cn/oauth"},qoder:{baseUrl:"https://api.qoder.com/v1/chat/completions",format:"openai",headers:{"User-Agent":"Qoder-Cli"},clientId:process.env.QODER_OAUTH_CLIENT_ID||"10009311001",clientSecret:process.env.QODER_OAUTH_CLIENT_SECRET||"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://api.qoder.com/oauth/token",authUrl:"https://qoder.com/oauth/authorize"},antigravity:{baseUrls:["https://daily-cloudcode-pa.googleapis.com","https://daily-cloudcode-pa.sandbox.googleapis.com"],format:"antigravity",headers:{"User-Agent":`antigravity/1.107.0 ${(0,d.platform)()}/${(0,d.arch)()}`},clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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"},openrouter:{baseUrl:"https://openrouter.ai/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://endpoint-proxy.local","X-Title":"Endpoint Proxy"}},openai:{baseUrl:"https://api.openai.com/v1/chat/completions",format:"openai"},glm:{baseUrl:"https://api.z.ai/api/anthropic/v1/messages",format:"claude",headers:{...e}},"glm-cn":{baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",format:"openai",headers:{}},kimi:{baseUrl:g,format:"claude",headers:{...e}},minimax:{baseUrl:"https://api.minimax.io/anthropic/v1/messages",format:"claude",headers:{...e}},"minimax-cn":{baseUrl:"https://api.minimaxi.com/anthropic/v1/messages",format:"claude",headers:{...e}},alicode:{baseUrl:"https://coding.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},"alicode-intl":{baseUrl:"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},"volcengine-ark":{baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",format:"openai",headers:{}},byteplus:{baseUrl:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",format:"openai",headers:{}},github:{baseUrl:"https://api.githubcopilot.com/chat/completions",responsesUrl:"https://api.githubcopilot.com/responses",format:"openai",headers:{"copilot-integration-id":"vscode-chat","editor-version":"vscode/1.110.0","editor-plugin-version":"copilot-chat/0.38.0","user-agent":"GitHubCopilotChat/0.38.0","openai-intent":"conversation-panel","x-github-api-version":"2025-04-01","x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user",Accept:"application/json","Content-Type":"application/json"},clientId:"Iv1.b507a08c87ecfe98"},kiro:{baseUrl:"https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse",format:"kiro",retry:{429:2},headers:{"Content-Type":"application/json",Accept:"application/vnd.amazon.eventstream","X-Amz-Target":"AmazonCodeWhispererStreamingService.GenerateAssistantResponse","User-Agent":"AWS-SDK-JS/3.0.0 kiro-ide/1.0.0","X-Amz-User-Agent":"aws-sdk-js/3.0.0 kiro-ide/1.0.0"},tokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authUrl:"https://prod.us-east-1.auth.desktop.kiro.dev"},cursor:{baseUrl:"https://api2.cursor.sh",chatPath:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",format:"cursor",headers:{"connect-accept-encoding":"gzip","connect-protocol-version":"1","Content-Type":"application/connect+proto","User-Agent":"connect-es/1.6.1"},clientVersion:"3.1.0"},"kimi-coding":{baseUrl:g,format:"claude",headers:{...e},clientId:"17e5f671-d194-4dfb-9706-5516cb48c098",tokenUrl:"https://auth.kimi.com/api/oauth/token",refreshUrl:"https://auth.kimi.com/api/oauth/token"},kilocode:{baseUrl:"https://api.kilo.ai/api/openrouter/chat/completions",format:"openai",headers:{}},opencode:{baseUrl:"http://localhost:4096/v1/chat/completions",format:"openai",headers:{}},cline:{baseUrl:"https://api.cline.bot/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://cline.bot","X-Title":"Cline"},tokenUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},nvidia:{baseUrl:"https://integrate.api.nvidia.com/v1/chat/completions",format:"openai"},anthropic:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{...e}},deepseek:{baseUrl:"https://api.deepseek.com/chat/completions",format:"openai"},commandcode:{baseUrl:"https://api.commandcode.ai/alpha/generate",format:"commandcode",headers:{"x-command-code-version":"0.25.7","x-cli-environment":"cli"}},groq:{baseUrl:"https://api.groq.com/openai/v1/chat/completions",format:"openai"},xai:{baseUrl:"https://api.x.ai/v1/chat/completions",responsesUrl:"https://api.x.ai/v1/responses",format:"openai",clientId:"b1a00492-073a-47ea-816f-4c329264a828",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token"},mistral:{baseUrl:"https://api.mistral.ai/v1/chat/completions",format:"openai"},perplexity:{baseUrl:"https://api.perplexity.ai/chat/completions",format:"openai"},together:{baseUrl:"https://api.together.xyz/v1/chat/completions",format:"openai"},fireworks:{baseUrl:"https://api.fireworks.ai/inference/v1/chat/completions",format:"openai"},cerebras:{baseUrl:"https://api.cerebras.ai/v1/chat/completions",format:"openai"},cohere:{baseUrl:"https://api.cohere.ai/v1/chat/completions",format:"openai"},nebius:{baseUrl:"https://api.studio.nebius.ai/v1/chat/completions",format:"openai"},siliconflow:{baseUrl:"https://api.siliconflow.cn/v1/chat/completions",format:"openai"},hyperbolic:{baseUrl:"https://api.hyperbolic.xyz/v1/chat/completions",format:"openai"},deepgram:{baseUrl:"https://api.deepgram.com/v1/listen",format:"openai"},assemblyai:{baseUrl:"https://api.assemblyai.com/v1/audio/transcriptions",format:"openai"},nanobanana:{baseUrl:"https://api.nanobananaapi.ai/v1/chat/completions",format:"openai"},chutes:{baseUrl:"https://llm.chutes.ai/v1/chat/completions",format:"openai"},ollama:{baseUrl:"https://ollama.com/api/chat",format:"ollama"},"ollama-local":{baseUrl:"http://localhost:11434/api/chat",format:"ollama"},vertex:{baseUrl:"https://aiplatform.googleapis.com",format:"vertex"},"vertex-partner":{baseUrl:"https://aiplatform.googleapis.com",format:"openai"},gitlab:{baseUrl:"https://gitlab.com/api/v4/chat/completions",format:"openai"},codebuddy:{baseUrl:"https://copilot.tencent.com/v1/chat/completions",format:"openai",refreshUrl:"https://copilot.tencent.com/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2"},opencode:{baseUrl:"https://opencode.ai",format:"openai",headers:{"x-opencode-client":"desktop"},noAuth:!0},"opencode-go":{baseUrl:"https://opencode.ai/zen/go/v1/chat/completions",format:"openai",headers:{}},"grok-web":{baseUrl:"https://grok.com/rest/app-chat/conversations/new",format:"grok-web",authType:"cookie"},"perplexity-web":{baseUrl:"https://www.perplexity.ai/rest/sse/perplexity_ask",format:"perplexity-web",authType:"cookie"},azure:{baseUrl:"",format:"openai",headers:{}},"cloudflare-ai":{baseUrl:"https://api.cloudflare.com/client/v4/accounts/{accountId}/ai/v1/chat/completions",format:"openai"},"xiaomi-mimo":{baseUrl:"https://api.xiaomimimo.com/v1/chat/completions",format:"openai"},"xiaomi-tokenplan":{baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1/chat/completions",format:"openai"},agentrouter:{baseUrl:"https://agentrouter.org/v1/messages",format:"claude",headers:{...f}},aimlapi:{baseUrl:"https://api.aimlapi.com/v1/chat/completions",format:"openai"},novita:{baseUrl:"https://api.novita.ai/v3/openai/chat/completions",format:"openai"},modal:{baseUrl:"https://api.modal.com/v1/chat/completions",format:"openai"},reka:{baseUrl:"https://api.reka.ai/v1/chat/completions",format:"openai"},nlpcloud:{baseUrl:"https://api.nlpcloud.io/v1/gpu/chatbot",format:"openai"},bazaarlink:{baseUrl:"https://bazaarlink.ai/api/v1/chat/completions",format:"openai"},completions:{baseUrl:"https://completions.me/api/v1/chat/completions",format:"openai"},enally:{baseUrl:"https://ai.enally.in/v1/chat/completions",format:"openai",authHeader:"x-api-key"},freetheai:{baseUrl:"https://api.freetheai.xyz/v1/chat/completions",format:"openai"},llm7:{baseUrl:"https://api.llm7.io/v1/chat/completions",format:"openai"},lepton:{baseUrl:"https://api.lepton.ai/api/v1/chat/completions",format:"openai"},kluster:{baseUrl:"https://api.kluster.ai/v1/chat/completions",format:"openai"},ai21:{baseUrl:"https://api.ai21.com/studio/v1/chat/completions",format:"openai"},"inference-net":{baseUrl:"https://api.inference.net/v1/chat/completions",format:"openai"},predibase:{baseUrl:"https://serving.app.predibase.com/v1/chat/completions",format:"openai"},bytez:{baseUrl:"https://api.bytez.com/models/v2",format:"openai"},morph:{baseUrl:"https://api.morphllm.com/v1/chat/completions",format:"openai"},longcat:{baseUrl:"https://api.longcat.chat/openai/v1/chat/completions",format:"openai"},puter:{baseUrl:"https://api.puter.com/puterai/openai/v1/chat/completions",format:"openai"},uncloseai:{baseUrl:"https://hermes.ai.unturf.com/v1/chat/completions",format:"openai",noAuth:!0},scaleway:{baseUrl:"https://api.scaleway.ai/v1/chat/completions",format:"openai"},deepinfra:{baseUrl:"https://api.deepinfra.com/v1/openai/chat/completions",format:"openai"},sambanova:{baseUrl:"https://api.sambanova.ai/v1/chat/completions",format:"openai"},nscale:{baseUrl:"https://inference.api.nscale.com/v1/chat/completions",format:"openai"},baseten:{baseUrl:"https://inference.baseten.co/v1/chat/completions",format:"openai"},publicai:{baseUrl:"https://api.publicai.co/v1/chat/completions",format:"openai"},"nous-research":{baseUrl:"https://inference-api.nousresearch.com/v1/chat/completions",format:"openai"},glhf:{baseUrl:"https://glhf.chat/api/openai/v1/chat/completions",format:"openai"},blackbox:{baseUrl:"https://api.blackbox.ai/chat/completions",format:"openai"}};function i(a){return(a?.providerSpecificData?.baseUrl?.trim()||"http://localhost:11434").replace(/\/$/,"")}},38775:(a,b,c)=>{c.d(b,{d_:()=>h,mA:()=>g});var d=c(89718),e=c(40669);let f={xmtp:"xiaomi-tokenplan","xiaomi-tokenplan":"xiaomi-tokenplan"};async function g(a){let b,c=(b=(0,e.Xh)(a),b?.providerAlias&&f[b.providerAlias]?{...b,provider:f[b.providerAlias]}:b);if(!c.isAlias){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);return e?{provider:e.id,model:c.model}:{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 h(a){if(a.includes("/"))return null;let b=await (0,d.Dj)(a);return b&&b.models&&b.models.length>0?b.models:null}},79489:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{P:()=>t});var e=c(48895),f=c(80238),g=c(71750),h=c(89718),i=c(38775),j=c(92500),k=c(43659),l=c(18910),m=c(27349),n=c(41004),o=c(14170),p=c(7803),q=c(67828),r=c(38160),s=a([e,j]);async function t(a,b=null){let c;try{c=await a.json()}catch{return p.warn("CHAT","Invalid JSON body"),(0,k.yj)(n.gx.BAD_REQUEST,"Invalid JSON body")}b||(b={endpoint:new URL(a.url).pathname,body:c,headers:Object.fromEntries(a.headers.entries())}),(0,g.n)(b.headers);let d=new URL(a.url),e=c.model,j=c.messages?.length||c.input?.length||0,o=c.tools?.length||0,q=c.reasoning_effort||c.reasoning?.effort||null;p.request("POST",`${d.pathname} | ${e} | ${j} msgs${o?` | ${o} tools`:""}${q?` | effort=${q}`:""}`);let r=a.headers.get("Authorization"),s=(0,f.Tr)(a);if(r&&s){let a=p.maskKey(s);p.debug("AUTH",`API Key: ${a}`)}else p.debug("AUTH","No API key provided (local mode)");let v=await (0,h.mt)();if(v.requireApiKey){if(!s)return p.warn("AUTH","Missing API key (requireApiKey=true)"),(0,k.yj)(n.gx.UNAUTHORIZED,"Missing API key");if(!await (0,f.kI)(s))return p.warn("AUTH","Invalid API key (requireApiKey=true)"),(0,k.yj)(n.gx.UNAUTHORIZED,"Invalid API key")}if(!e)return p.warn("CHAT","Missing model"),(0,k.yj)(n.gx.BAD_REQUEST,"Missing model");let w=a?.headers?.get("user-agent")||"",x=(0,m.c)(c,e,w,!!v.ccFilterNaming);if(x)return x.response||x;let y=await (0,i.d_)(e);if(y){let d=v.comboStrategies||{},f=d[e]?.fallbackStrategy||v.comboStrategy||"fallback",g=v.comboStickyRoundRobinLimit;return p.info("CHAT",`Combo "${e}" with ${y.length} models (strategy: ${f}, sticky: ${g})`),(0,l.Pr)({body:c,models:y,handleSingleModel:(c,d)=>u(c,d,b,a,s),log:p,comboName:e,comboStrategy:f,comboStickyLimit:g})}return u(c,e,b,a,s)}async function u(a,b,c=null,d=null,e=null){let g=await (0,i.mA)(b);if(!g.provider){let f=await (0,i.d_)(b);if(f){let g=await (0,h.mt)(),i=g.comboStrategies||{},j=i[b]?.fallbackStrategy||g.comboStrategy||"fallback",k=g.comboStickyRoundRobinLimit;return p.info("CHAT",`Combo "${b}" with ${f.length} models (strategy: ${j}, sticky: ${k})`),(0,l.Pr)({body:a,models:f,handleSingleModel:(a,b)=>u(a,b,c,d,e),log:p,comboName:b,comboStrategy:j,comboStickyLimit:k})}return p.warn("CHAT","Invalid model format",{model:b}),(0,k.yj)(n.gx.BAD_REQUEST,"Invalid model format")}let{provider:m,model:s}=g;b!==`${m}/${s}`?p.info("ROUTING",`${b} â ${m}/${s}`):p.info("ROUTING",`Provider: ${m}, Model: ${s}`);let t=d?.headers?.get("user-agent")||"",v=new Set,w=null,x=null;for(;;){let b=await (0,f.c1)(m,v,s);if(!b||b.allRateLimited){if(b?.allRateLimited){let a=w||b.lastError||"Unavailable",c=x||Number(b.lastErrorCode)||n.gx.SERVICE_UNAVAILABLE;return p.warn("CHAT",`[${m}/${s}] ${a} (${b.retryAfterHuman})`),(0,k.wO)(c,`[${m}/${s}] ${a}`,b.retryAfter,b.retryAfterHuman)}if(0===v.size)return p.warn("AUTH",`No active credentials for provider: ${m}`),(0,k.yj)(n.gx.NOT_FOUND,`No active credentials for provider: ${m}`);return p.warn("CHAT","No more accounts available",{provider:m}),(0,k.yj)(x||n.gx.SERVICE_UNAVAILABLE,w||"All accounts unavailable")}p.info("AUTH",`\x1b[32mUsing ${m} account: ${b.connectionName}\x1b[0m`);let g=await (0,q.eU)(m,b);if(("antigravity"===m||"gemini-cli"===m)&&!g.projectId){let a=await (0,r.eG)(b.connectionId,g.accessToken);a&&(g.projectId=a,(0,q.vN)(b.connectionId,{projectId:a}).catch(()=>{}))}let i=await (0,h.mt)(),l=(i.providerThinking||{})[m]||null,u=await (0,j.w)({body:{...a,model:`${m}/${s}`},modelInfo:{provider:m,model:s},credentials:g,log:p,clientRawRequest:c,connectionId:b.connectionId,userAgent:t,apiKey:e,ccFilterNaming:!!i.ccFilterNaming,rtkEnabled:!!i.rtkEnabled,cavemanEnabled:!!i.cavemanEnabled,cavemanLevel:i.cavemanLevel||"full",providerThinking:l,sourceFormatOverride:d?.url?(0,o.t)(new URL(d.url).pathname,a):null,onCredentialsRefreshed:async a=>{await (0,q.vN)(b.connectionId,{...a,testStatus:"active"})},onRequestSuccess:async()=>{await (0,f.Pt)(b.connectionId,b,s)}});if(u.success)return u.response;let{shouldFallback:y}=await (0,f.vk)(b.connectionId,u.status,u.error,m,s,u.resetsAtMs);if(y){p.warn("AUTH",`Account ${b.connectionName} unavailable (${u.status}), trying fallback`),v.add(b.connectionId),w=u.error,x=u.status;continue}return u.response}}[e,j]=s.then?(await s)():s,d()}catch(a){d(a)}})}};
|
|
@@ -46,17 +46,17 @@
|
|
|
46
46
|
) -Verb RunAs -Wait -PassThru -WindowStyle Hidden;
|
|
47
47
|
if ($proc.ExitCode -ne 0) { throw "Elevated command exited with code $($proc.ExitCode)" }
|
|
48
48
|
`;return new Promise((a,b)=>{d(`powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command ${h(c)}`,{windowsHide:!0},(c,d,e)=>{if(c){let a=e||c.message;a.includes("canceled by the user")||a.includes("operation was canceled")?b(Error("User canceled UAC prompt")):b(Error(a))}else a(d)})})},quotePs:h}},66936:(a,b,c)=>{let{exec:d,spawn:e,execSync:f}=c(79646),g=c(29021),h=c(33873);c(21820);let{log:i,err:j}=c(87777),{TOOL_HOSTS:k}=c(85341),{runElevatedPowerShell:l,isAdmin:m}=c(64809);function n(a,b,c){let d=`${a}.ktrouter.new`,e=`${a}.ktrouter.bak`;try{g.writeFileSync(d,c,"utf8");try{g.unlinkSync(e)}catch{}g.renameSync(a,e);try{g.renameSync(d,a)}catch(c){try{g.renameSync(e,a)}catch{g.writeFileSync(a,b,"utf8")}throw c}try{g.unlinkSync(e)}catch{}}finally{try{g.unlinkSync(d)}catch{}}}let o="win32"===process.platform,p="darwin"===process.platform,q=o?h.join(process.env.SystemRoot||"C:\\Windows","System32","drivers","etc","hosts"):"/etc/hosts";function r(){if(o)return!1;try{return f("command -v sudo",{stdio:"ignore",windowsHide:!0}),!0}catch{return!1}}function s(){if(o||!r())return!0;try{return f("sudo -n true",{stdio:"ignore",windowsHide:!0}),!0}catch{return!1}}function t(a,b){return new Promise((c,d)=>{let f=r(),g=f?e("sudo",["-S","sh","-c",a],{stdio:["pipe","pipe","pipe"],windowsHide:!0}):e("sh",["-c",a],{stdio:["ignore","pipe","pipe"],windowsHide:!0}),h="",i="";g.stdout.on("data",a=>{h+=a}),g.stderr.on("data",a=>{i+=a}),g.on("close",a=>{0===a?c(h):d(Error(i||`Exit code ${a}`))}),f&&(g.stdin.write(`${b}
|
|
49
|
-
`),g.stdin.end())})}async function
|
|
49
|
+
`),g.stdin.end())})}function u(a){let b=[];for(let c of String(a||"").split(/\r?\n/)){let a=c.replace(/#.*/,"").trim();if(!a)continue;let d=a.split(/\s+/),e=d.shift();if(e&&0!==d.length)for(let a of d)b.push({address:e.toLowerCase(),host:a.toLowerCase()})}return b}function v(a,b){let c=String(b||"").toLowerCase();return a.some(a=>{var b;return a.host===c&&("127.0.0.1"===(b=a.address)||"::1"===b)})}async function w(a){o||(p?await t("dscacheutil -flushcache && killall -HUP mDNSResponder",a):await t("resolvectl flush-caches 2>/dev/null || true",a))}function x(a=null){try{let b=g.readFileSync(q,"utf8"),c=u(b);if(a)return v(c,a);return k.antigravity.every(a=>v(c,a))}catch{return!1}}async function y(a,b){let c=k[a];if(!c)throw Error(`Unknown tool: ${a}`);let d=c.filter(a=>!x(a));if(0===d.length)return void i(`đ DNS ${a}: already active`);try{if(o){let a=g.readFileSync(q,"utf8"),b=a.replace(/[\r\n\s]+$/g,""),c=d.map(a=>`127.0.0.1 ${a}`).join("\r\n"),e=`${b}\r
|
|
50
50
|
${c}\r
|
|
51
51
|
`;n(q,a,e),await l("ipconfig /flushdns | Out-Null")}else{let a=g.readFileSync(q,"utf8").replace(/[\r\n\s]+$/g,""),c=d.map(a=>`127.0.0.1 ${a}`).join("\n"),e=`${a}
|
|
52
52
|
${c}
|
|
53
|
-
`.replace(/'/g,"'\\''");await t(`printf '%s' '${e}' | tee ${q} > /dev/null`,b),await
|
|
54
|
-
HEADERS: ${JSON.stringify(e,null,2)}
|
|
53
|
+
`.replace(/'/g,"'\\''");await t(`printf '%s' '${e}' | tee ${q} > /dev/null`,b),await w(b)}i(`đ DNS ${a}: â
added ${d.join(", ")}`)}catch(a){throw Error(a.message?.includes("incorrect password")?"Wrong sudo password":`Failed to add DNS entry: ${a.message}`)}}async function z(a,b){let c=k[a];if(!c)throw Error(`Unknown tool: ${a}`);let d=c.filter(a=>x(a));if(0===d.length)return void i(`đ DNS ${a}: already inactive`);try{if(o){let a=g.readFileSync(q,"utf8"),b=a.split(/\r?\n/).filter(a=>!d.some(b=>a.includes(b))).join("\r\n").replace(/[\r\n\s]+$/g,"")+"\r\n";n(q,a,b),await l("ipconfig /flushdns | Out-Null")}else{let a=(g.readFileSync(q,"utf8").split(/\r?\n/).filter(a=>!d.some(b=>a.includes(b))).join("\n").replace(/[\r\n\s]+$/g,"")+"\n").replace(/'/g,"'\\''");await t(`printf '%s' '${a}' | tee ${q} > /dev/null`,b),await w(b)}i(`đ DNS ${a}: â
removed ${d.join(", ")}`)}catch(a){throw Error(a.message?.includes("incorrect password")?"Wrong sudo password":`Failed to remove DNS entry: ${a.message}`)}}async function A(a){for(let b of Object.keys(k))try{await z(b,a)}catch(a){j(`DNS ${b}: failed to remove â ${a.message}`)}}a.exports={TOOL_HOSTS:k,addDNSEntry:y,removeDNSEntry:z,removeAllDNSEntries:A,removeAllDNSEntriesSync:function(){try{if(!g.existsSync(q))return;let a=Object.values(k).flat(),b=g.readFileSync(q,"utf8"),c=o?"\r\n":"\n",d=b.split(/\r?\n/).filter(b=>!a.some(a=>b.includes(a))).join(c).replace(/[\r\n\s]+$/g,"")+c;if(d===b)return;if(g.writeFileSync(q,d,"utf8"),o)try{f("ipconfig /flushdns",{windowsHide:!0,stdio:"ignore"})}catch{}else if(p)try{f("dscacheutil -flushcache && killall -HUP mDNSResponder",{stdio:"ignore"})}catch{}else try{f("resolvectl flush-caches 2>/dev/null || true",{stdio:"ignore"})}catch{}}catch{}},execWithPassword:t,isSudoAvailable:r,canRunSudoWithoutPassword:s,isSudoPasswordRequired:function(){return!o&&r()&&!s()},checkDNSEntry:x,checkAllDNSStatus:function(){try{let a=g.readFileSync(q,"utf8"),b=u(a),c={};for(let[a,d]of Object.entries(k))c[a]=d.every(a=>v(b,a));return c}catch{return Object.fromEntries(Object.keys(k).map(a=>[a,!1]))}}}},76476:(a,b,c)=>{c.d(b,{N:()=>n,v:()=>m});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j=process.env.DATA_DIR||("win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),"ktrouter"):g().join(i().homedir(),".ktrouter")),k=g().join(j,"mitm","aliases.json");function l(a){let b=g().dirname(k);e().mkdirSync(b,{recursive:!0});let c=`${k}.tmp`;e().writeFileSync(c,JSON.stringify(a,null,2),"utf8"),e().renameSync(c,k)}async function m(){try{let{getMitmAlias:a}=await Promise.resolve().then(c.bind(c,9460)),b=await a();l(b||{})}catch(a){console.log("[mitmAliasCache] sync failed:",a.message)}}function n(a,b){try{let c={};if(e().existsSync(k))try{c=JSON.parse(e().readFileSync(k,"utf8"))}catch{}c[a]=b||{},l(c)}catch(a){console.log("[mitmAliasCache] write failed:",a.message)}}},82193:(a,b,c)=>{let d=c(29021),e=c(33873),f=c(21820),g="ktrouter";function h(){return"win32"===process.platform?e.join(process.env.APPDATA||e.join(f.homedir(),"AppData","Roaming"),g):e.join(f.homedir(),`.${g}`)}let i=function(){let a=process.env.DATA_DIR;if(!a)return h();try{return d.mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable â fallback ~/.${g}`),h();throw b}}(),j=e.join(i,"mitm");a.exports={DATA_DIR:i,MITM_DIR:j}},85341:a=>{a.exports={TOOL_HOSTS:{antigravity:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com"],copilot:["api.individual.githubcopilot.com"],kiro:["q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"],cursor:["api2.cursor.sh"]}}},87777:(a,b,c)=>{let d=c(29021),e=c(33873),f=c(74075),{DATA_DIR:g}=c(82193),{LOG_BLACKLIST_URL_PARTS:h}=c(17511);function i(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}let j=e.join(g,"logs","mitm"),k=["1","true","yes","on"].includes(String(process.env.MITM_FILE_LOG||"").toLowerCase()),l=/^\s*(\{\s*\}|\[\s*\]|null)?\s*$/,m=new Set(["authorization","proxy-authorization","cookie","set-cookie","x-api-key","api-key","apikey","access-token","refresh-token","access_token","refresh_token","id_token","token"]);function n(){d.existsSync(j)||d.mkdirSync(j,{recursive:!0})}function o(a){let b=String(a||"").toLowerCase();return m.has(b)||b.includes("token")}function p(a){return Array.isArray(a)?a.map(()=>"[redacted]"):"[redacted]"}function q(a={}){let b={};for(let[c,d]of Object.entries(a||{}))b[c]=o(c)?p(d):d;return b}function r(a,b=80){return String(a).replace(/[^a-zA-Z0-9]/g,"_").substring(0,b)}function s(a){return!!a&&h.some(b=>a.includes(b))}a.exports={log:a=>console.log(`[${i()}] [MITM] ${a}`),err:a=>console.error(`[${i()}] â [MITM] ${a}`),dumpRequest:function(a,b,c="raw"){if(!k||s(a.url))return null;try{n();let f=new Date().toISOString().replace(/[:.]/g,"-"),g=r((a.headers.host||"")+a.url),h=e.join(j,`${f}_${c}_${g}.req.json`),i=null;try{i=JSON.parse(b.toString())}catch{}return d.writeFileSync(h,JSON.stringify({method:a.method,url:a.url,host:a.headers.host,headers:q(a.headers),body:null!==i?function a(b){if(Array.isArray(b))return b.map(a);if(!b||"object"!=typeof b)return b;let c={};for(let[d,e]of Object.entries(b))c[d]=o(d)?p(e):a(e);return c}(i):b.toString("utf8")},null,2)),h}catch{return null}},createResponseDumper:function(a,b="raw"){if(!k||s(a.url))return null;n();let c=new Date().toISOString().replace(/[:.]/g,"-"),g=r((a.headers.host||"")+a.url),h=e.join(j,`${c}_${b}_${g}.res.txt`),i=0,m={},o=[];return{writeHeader:(a,b)=>{i=a,m=b||{}},writeChunk:a=>{null!=a&&o.push(Buffer.isBuffer(a)?a:Buffer.from(a))},end:()=>{try{let a=Buffer.concat(o),b=m["content-encoding"]||m["Content-Encoding"],c=(function(a,b){if(!a||0===a.length)return a;try{let c=(b||"").toLowerCase();if(c.includes("gzip"))return f.gunzipSync(a);if(c.includes("br"))return f.brotliDecompressSync(a);if(c.includes("deflate"))return f.inflateSync(a)}catch{}return a})(a,b).toString("utf8");if(l.test(c))return;let e={...m};delete e["content-encoding"],delete e["Content-Encoding"];let g=`STATUS: ${i}
|
|
54
|
+
HEADERS: ${JSON.stringify(q(e),null,2)}
|
|
55
55
|
---BODY---
|
|
56
|
-
${c}`;d.writeFileSync(h,g)}catch{}},file:h}}}},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(9248)},96182:(a,b,c)=>{let{exec:d,spawn:e,execSync:f}=c(79646),g=c(33873),h=c(29021),i=c(21820),j=c(91645),k=c(55591),l=c(55511),{addDNSEntry:m,removeDNSEntry:n,removeAllDNSEntries:o,removeAllDNSEntriesSync:p,checkAllDNSStatus:q,TOOL_HOSTS:r,isSudoAvailable:s,isSudoPasswordRequired:t}=c(66936),{isAdmin:u}=c(64809),v="win32"===process.platform,w="darwin"===process.platform,x="linux"===process.platform,{generateCert:y}=c(26033),{installCert:z,uninstallCert:A}=c(9631),{isCertExpired:B}=c(8578),{DATA_DIR:C,MITM_DIR:D}=c(82193),{log:E,err:F}=c(87777),G="http://localhost:3008";function H(a){return null==a||""===a?"''":`'${String(a).replace(/'/g,"'\\''")}'`}async function I(){if(!af)return G;try{let a=await af(),b=a&&null!=a.mitmRouterBaseUrl?String(a.mitmRouterBaseUrl).trim():"";if(!b)return G;let c=new URL(b);if("http:"!==c.protocol&&"https:"!==c.protocol)return G;return b.replace(/\/+$/,"")}catch{return G}}let J=g.join(D,".mitm.pid"),K=[5e3,1e4,2e4,3e4,6e4],L="NODE_EXTRA_CA_CERTS",M=g.join(i.homedir(),".config","environment.d"),N=g.join(M,"ktrouter-mitm.conf"),O="KTRouter MITM NODE_EXTRA_CA_CERTS",P=0,Q=0,R=!1;function S(a){try{return f(`command -v ${a}`,{stdio:"ignore",windowsHide:!0}),!0}catch{return!1}}function T(){if(!x)return[];let a=[g.join(i.homedir(),".local","share","applications"),"/usr/local/share/applications","/usr/share/applications","/var/lib/flatpak/exports/share/applications",g.join(i.homedir(),".local","share","flatpak","exports","share","applications")],b=[];for(let c of a)try{if(!h.existsSync(c))continue;for(let a of h.readdirSync(c)){if(!a.toLowerCase().endsWith(".desktop"))continue;let d=g.join(c,a),e="";try{e=h.readFileSync(d,"utf8")}catch{continue}(/antigravity/i.test(a)||/antigravity/i.test(e))&&b.push(d)}}catch{}return[...new Set(b)]}function U(a){!function(a){if(!v||!a||!h.existsSync(a))return;let b=g.resolve(a);process.env[L]=b;try{let a=f(`reg query HKCU\\Environment /v ${L}`,{encoding:"utf8",windowsHide:!0,stdio:["ignore","pipe","ignore"]});if(a&&a.includes(b))return}catch{}try{f(`setx ${L} "${b}"`,{windowsHide:!0,stdio:"ignore"}),E(`Cert: set ${L} for Windows user env`)}catch(a){E(`Cert: could not set ${L}: ${a.message}`)}}(a),x&&a&&h.existsSync(a)&&(!function(a){if(!x||!a)return;let b=g.resolve(a);process.env[L]=b;try{h.mkdirSync(M,{recursive:!0}),h.writeFileSync(N,`# ${O}
|
|
56
|
+
${c}`;d.writeFileSync(h,g)}catch{}},file:h}},isFileLoggingEnabled:function(){return k}}},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(9248)},96182:(a,b,c)=>{let{exec:d,spawn:e,execSync:f}=c(79646),g=c(33873),h=c(29021),i=c(21820),j=c(91645),k=c(55591),l=c(55511),{addDNSEntry:m,removeDNSEntry:n,removeAllDNSEntries:o,removeAllDNSEntriesSync:p,checkAllDNSStatus:q,TOOL_HOSTS:r,isSudoAvailable:s,isSudoPasswordRequired:t}=c(66936),{isAdmin:u}=c(64809),v="win32"===process.platform,w="darwin"===process.platform,x="linux"===process.platform,{generateCert:y}=c(26033),{installCert:z,uninstallCert:A}=c(9631),{isCertExpired:B}=c(8578),{DATA_DIR:C,MITM_DIR:D}=c(82193),{log:E,err:F}=c(87777),G="http://localhost:3008";function H(a){return null==a||""===a?"''":`'${String(a).replace(/'/g,"'\\''")}'`}async function I(){if(!af)return G;try{let a=await af(),b=a&&null!=a.mitmRouterBaseUrl?String(a.mitmRouterBaseUrl).trim():"";if(!b)return G;let c=new URL(b);if("http:"!==c.protocol&&"https:"!==c.protocol)return G;return b.replace(/\/+$/,"")}catch{return G}}let J=g.join(D,".mitm.pid"),K=[5e3,1e4,2e4,3e4,6e4],L="NODE_EXTRA_CA_CERTS",M=g.join(i.homedir(),".config","environment.d"),N=g.join(M,"ktrouter-mitm.conf"),O="KTRouter MITM NODE_EXTRA_CA_CERTS",P=0,Q=0,R=!1;function S(a){try{return f(`command -v ${a}`,{stdio:"ignore",windowsHide:!0}),!0}catch{return!1}}function T(){if(!x)return[];let a=[g.join(i.homedir(),".local","share","applications"),"/usr/local/share/applications","/usr/share/applications","/var/lib/flatpak/exports/share/applications",g.join(i.homedir(),".local","share","flatpak","exports","share","applications")],b=[];for(let c of a)try{if(!h.existsSync(c))continue;for(let a of h.readdirSync(c)){if(!a.toLowerCase().endsWith(".desktop"))continue;let d=g.join(c,a),e="";try{e=h.readFileSync(d,"utf8")}catch{continue}(/antigravity/i.test(a)||/antigravity/i.test(e))&&b.push(d)}}catch{}return[...new Set(b)]}function U(a){!function(a){if(!v||!a||!h.existsSync(a))return;let b=g.resolve(a);process.env[L]=b;try{let a=f(`reg query HKCU\\Environment /v ${L}`,{encoding:"utf8",windowsHide:!0,stdio:["ignore","pipe","ignore"]});if(a&&a.includes(b))return}catch{}try{f(`setx ${L} "${b}"`,{windowsHide:!0,stdio:"ignore"}),E(`Cert: set ${L} for Windows user env`)}catch(a){E(`Cert: could not set ${L}: ${a.message}`)}}(a),x&&a&&h.existsSync(a)&&(!function(a){if(!x||!a)return;let b=g.resolve(a);process.env[L]=b;try{h.mkdirSync(M,{recursive:!0}),h.writeFileSync(N,`# ${O}
|
|
57
57
|
${L}=${b}
|
|
58
|
-
`,"utf8")}catch(a){E(`Cert: could not write Linux environment.d: ${a.message}`)}try{S("systemctl")&&f(`systemctl --user set-environment ${L}=${H(b)}`,{stdio:"ignore",windowsHide:!0})}catch{}try{S("dbus-update-activation-environment")&&f(`dbus-update-activation-environment --systemd ${L}`,{stdio:"ignore",windowsHide:!0,env:{...process.env,[L]:b}})}catch{}}(a),function(a){if(!x||!a||!h.existsSync(a))return;let b=g.join(i.homedir(),".local","share","applications");try{h.mkdirSync(b,{recursive:!0})}catch{}let c=0;for(let d of T())try{let e=d.startsWith(b+g.sep)?d:g.join(b,g.basename(d));d===e||h.existsSync(e)||h.copyFileSync(d,e);let f=h.readFileSync(e,"utf8"),i=f.split(/\r?\n/).map(b=>b.startsWith("Exec=")?function(a,b){let c=a.slice(5).trim();if(!c||c.includes(O))return a;let d=`${L}="${String(b).replace(/(["\\])/g,"\\$1")}"`,e=c.replace(RegExp(`(^|\\s)${L}=(?:"[^"]*"|'[^']*'|\\S+)`,"g"),"$1").replace(/\s+/g," ").trim();return/^(?:\/usr\/bin\/)?env(?:\s|$)/.test(e)?`Exec=${e.replace(/^(?:\/usr\/bin\/)?env/,a=>`${a} ${d}`)}`:`Exec=env ${d} ${e}`}(b,g.resolve(a)):b).join("\n");if(i!==f){let a=`${e}.ktrouter-bak`;h.existsSync(a)||h.writeFileSync(a,f,"utf8"),h.writeFileSync(e,i,"utf8"),c++}}catch(a){E(`Cert: could not patch Antigravity desktop entry: ${a.message}`)}c>0&&E(`Cert: patched ${c} Antigravity desktop launcher(s) for ${L}`)}(a),E(`Cert: set ${L} for Linux user env`))}function V(){if(process.env.MITM_SERVER_PATH)return process.env.MITM_SERVER_PATH;let a=g.join(__dirname,"server.js");if(h.existsSync(a))return a;let b=g.join(process.cwd(),"src","mitm","server.js");if(h.existsSync(b))return b;let c=g.join(process.cwd(),"..","src","mitm","server.js");return h.existsSync(c)?c:b}function W(a){try{if(!a||!h.existsSync(a)||!a.includes(`${g.sep}node_modules${g.sep}`))return a;let b=g.join(C,"runtime","mitm"),c=g.join(b,"server.js");if(h.existsSync(c))try{if(h.statSync(a).size===h.statSync(c).size)return c}catch{}return h.mkdirSync(b,{recursive:!0}),h.copyFileSync(a,c),c}catch(b){try{E(`[MITM] runtime copy failed: ${b.message}`)}catch{}return a}}let X=W(V()),Y="aes-256-gcm",Z="ktrouter-mitm-pwd",$=null,_=null;function aa(){return globalThis.__mitmSudoPassword||null}function ab(a){globalThis.__mitmSudoPassword=a}function ac(a){try{return process.kill(a,0),!0}catch(a){return"EACCES"===a.code}}function ad(a,b=!1,e=null){if(v)d(`taskkill ${b?"/F ":""}/PID ${a}`,{windowsHide:!0},()=>{});else{let f=b?"SIGKILL":"SIGTERM",g=`pkill -${f} -P ${a} 2>/dev/null; kill -${f} ${a} 2>/dev/null`;if(e||s()){let{execWithPassword:a}=c(66936);a(g,e||"").catch(()=>d(g,{windowsHide:!0},()=>{}))}else d(g,{windowsHide:!0},()=>{})}}function ae(){try{let{machineIdSync:a}=c(19713),b=a();return l.createHash("sha256").update(b+Z).digest()}catch{return l.createHash("sha256").update(Z).digest()}}let af=null,ag=null;async function ah(a,b){if(ag)try{let c,d,e,f,g,h={mitmEnabled:a};b&&(c=ae(),d=l.randomBytes(12),e=l.createCipheriv(Y,c,d),f=Buffer.concat([e.update(b,"utf8"),e.final()]),g=e.getAuthTag(),h.mitmSudoEncrypted=`${d.toString("hex")}:${g.toString("hex")}:${f.toString("hex")}`),await ag(h)}catch(a){F(`Failed to save settings: ${a.message}`)}}async function ai(){if(ag)try{await ag({mitmSudoEncrypted:null})}catch(a){F(`Failed to clear encrypted password: ${a.message}`)}}async function aj(){if(!af)return null;try{let a=await af();if(!a.mitmSudoEncrypted)return null;return function(a){try{let[b,c,d]=a.split(":");if(!b||!c||!d)return null;let e=ae(),f=l.createDecipheriv(Y,e,Buffer.from(b,"hex"));return f.setAuthTag(Buffer.from(c,"hex")),f.update(Buffer.from(d,"hex"))+f.final("utf8")}catch{return null}}(a.mitmSudoEncrypted)}catch{return null}}async function ak(a,b){if(ag&&af)try{let c={...(await af()).dnsToolEnabled||{},[a]:b};await ag({dnsToolEnabled:c})}catch(a){F(`Failed to save DNS state: ${a.message}`)}}async function al(){if(!af)return{};try{return(await af()).dnsToolEnabled||{}}catch{return{}}}async function am(a){let b=await al(),c=a||aa()||await aj();for(let[a,d]of Object.entries(b))if(d&&r[a])try{await m(a,c)}catch(b){F(`DNS ${a}: restore failed â ${b.message}`)}}async function
|
|
59
|
-
`),$.stdin.end()):$=e(process.execPath,[u],{detached:!1,windowsHide:!0,cwd:i.tmpdir(),stdio:["ignore","pipe","pipe"],env:{...process.env,DATA_DIR:g.resolve(process.env.DATA_DIR||C),ROUTER_API_KEY:a,NODE_ENV:"production",MITM_ROUTER_BASE:x}});$&&(_=$.pid,h.writeFileSync(J,String(_)),Q=Date.now());let G=null;$&&($.stdout.on("data",a=>{process.stdout.write(a)}),$.stderr.on("data",a=>{let b=a.toString().trim();b&&(v||!b.includes("Password:")&&!b.includes("password for"))&&(F(b),G=b),!v&&(b.includes("incorrect password")||b.includes("no password was provided"))&&(ab(null),ai(),R=!0)}),$.on("exit",b=>{E(`Server exited (code: ${b})`),$=null,_=null;try{h.unlinkSync(J)}catch{}0===b||R||
|
|
58
|
+
`,"utf8")}catch(a){E(`Cert: could not write Linux environment.d: ${a.message}`)}try{S("systemctl")&&f(`systemctl --user set-environment ${L}=${H(b)}`,{stdio:"ignore",windowsHide:!0})}catch{}try{S("dbus-update-activation-environment")&&f(`dbus-update-activation-environment --systemd ${L}`,{stdio:"ignore",windowsHide:!0,env:{...process.env,[L]:b}})}catch{}}(a),function(a){if(!x||!a||!h.existsSync(a))return;let b=g.join(i.homedir(),".local","share","applications");try{h.mkdirSync(b,{recursive:!0})}catch{}let c=0;for(let d of T())try{let e=d.startsWith(b+g.sep)?d:g.join(b,g.basename(d));d===e||h.existsSync(e)||h.copyFileSync(d,e);let f=h.readFileSync(e,"utf8"),i=f.split(/\r?\n/).map(b=>b.startsWith("Exec=")?function(a,b){let c=a.slice(5).trim();if(!c||c.includes(O))return a;let d=`${L}="${String(b).replace(/(["\\])/g,"\\$1")}"`,e=c.replace(RegExp(`(^|\\s)${L}=(?:"[^"]*"|'[^']*'|\\S+)`,"g"),"$1").replace(/\s+/g," ").trim();return/^(?:\/usr\/bin\/)?env(?:\s|$)/.test(e)?`Exec=${e.replace(/^(?:\/usr\/bin\/)?env/,a=>`${a} ${d}`)}`:`Exec=env ${d} ${e}`}(b,g.resolve(a)):b).join("\n");if(i!==f){let a=`${e}.ktrouter-bak`;h.existsSync(a)||h.writeFileSync(a,f,"utf8"),h.writeFileSync(e,i,"utf8"),c++}}catch(a){E(`Cert: could not patch Antigravity desktop entry: ${a.message}`)}c>0&&E(`Cert: patched ${c} Antigravity desktop launcher(s) for ${L}`)}(a),E(`Cert: set ${L} for Linux user env`))}function V(){if(process.env.MITM_SERVER_PATH)return process.env.MITM_SERVER_PATH;let a=g.join(__dirname,"server.js");if(h.existsSync(a))return a;let b=g.join(process.cwd(),"src","mitm","server.js");if(h.existsSync(b))return b;let c=g.join(process.cwd(),"..","src","mitm","server.js");return h.existsSync(c)?c:b}function W(a){try{if(!a||!h.existsSync(a)||!a.includes(`${g.sep}node_modules${g.sep}`))return a;let b=g.join(C,"runtime","mitm"),c=g.join(b,"server.js");if(h.existsSync(c))try{if(h.statSync(a).size===h.statSync(c).size)return c}catch{}return h.mkdirSync(b,{recursive:!0}),h.copyFileSync(a,c),c}catch(b){try{E(`[MITM] runtime copy failed: ${b.message}`)}catch{}return a}}let X=W(V()),Y="aes-256-gcm",Z="ktrouter-mitm-pwd",$=null,_=null;function aa(){return globalThis.__mitmSudoPassword||null}function ab(a){globalThis.__mitmSudoPassword=a}function ac(a){try{return process.kill(a,0),!0}catch(a){return"EACCES"===a.code}}function ad(a,b=!1,e=null){if(v)d(`taskkill ${b?"/F ":""}/PID ${a}`,{windowsHide:!0},()=>{});else{let f=b?"SIGKILL":"SIGTERM",g=`pkill -${f} -P ${a} 2>/dev/null; kill -${f} ${a} 2>/dev/null`;if(e||s()){let{execWithPassword:a}=c(66936);a(g,e||"").catch(()=>d(g,{windowsHide:!0},()=>{}))}else d(g,{windowsHide:!0},()=>{})}}function ae(){try{let{machineIdSync:a}=c(19713),b=a();return l.createHash("sha256").update(b+Z).digest()}catch{return l.createHash("sha256").update(Z).digest()}}let af=null,ag=null;async function ah(a,b){if(ag)try{let c,d,e,f,g,h={mitmEnabled:a};b&&(c=ae(),d=l.randomBytes(12),e=l.createCipheriv(Y,c,d),f=Buffer.concat([e.update(b,"utf8"),e.final()]),g=e.getAuthTag(),h.mitmSudoEncrypted=`${d.toString("hex")}:${g.toString("hex")}:${f.toString("hex")}`),await ag(h)}catch(a){F(`Failed to save settings: ${a.message}`)}}async function ai(){if(ag)try{await ag({mitmSudoEncrypted:null})}catch(a){F(`Failed to clear encrypted password: ${a.message}`)}}async function aj(){if(!af)return null;try{let a=await af();if(!a.mitmSudoEncrypted)return null;return function(a){try{let[b,c,d]=a.split(":");if(!b||!c||!d)return null;let e=ae(),f=l.createDecipheriv(Y,e,Buffer.from(b,"hex"));return f.setAuthTag(Buffer.from(c,"hex")),f.update(Buffer.from(d,"hex"))+f.final("utf8")}catch{return null}}(a.mitmSudoEncrypted)}catch{return null}}async function ak(a,b){if(ag&&af)try{let c={...(await af()).dnsToolEnabled||{},[a]:b};await ag({dnsToolEnabled:c})}catch(a){F(`Failed to save DNS state: ${a.message}`)}}async function al(){if(!af)return{};try{return(await af()).dnsToolEnabled||{}}catch{return{}}}async function am(a){if(af&&ag&&a)try{let b={...(await af()).dnsToolEnabled||{}},c=!1;for(let d of Object.keys(r)){let e=!0===a[d];b[d]!==e&&(b[d]=e,c=!0)}c&&await ag({dnsToolEnabled:b})}catch(a){F(`Failed to sync DNS state: ${a.message}`)}}async function an(a){let b=await al(),c=a||aa()||await aj();for(let[a,d]of Object.entries(b))if(d&&r[a])try{await m(a,c)}catch(b){F(`DNS ${a}: restore failed â ${b.message}`)}}async function ao(){return v?u():!(!u()&&t())||!!(aa()||await aj())}function ap(a){return new Promise(a=>{v?d('powershell -NonInteractive -WindowStyle Hidden -Command "$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c) { $c.OwningProcess } else { 0 }"',{windowsHide:!0},(b,c)=>{if(b)return a(null);let e=parseInt(c.trim(),10);if(!e||e<=4)return a(null);d(`tasklist /FI "PID eq ${e}" /FO CSV /NH`,{windowsHide:!0},(b,c)=>{let d=c?.match(/"([^"]+)"/);a({pid:e,name:d?d[1]:"unknown"})})}):d("lsof -nP -iTCP:443 -sTCP:LISTEN -t",{windowsHide:!0},(b,c)=>{if(b||!c?.trim())return a(null);let e=parseInt(c.trim().split("\n")[0],10);if(!e||isNaN(e))return a(null);d(`ps -p ${e} -o comm=`,{windowsHide:!0},(b,c)=>{a({pid:e,name:c?.trim()||"unknown"})})})})}async function aq(a){if($&&!$.killed){try{$.kill("SIGKILL")}catch{}$=null,_=null}try{if(h.existsSync(J)){let b=parseInt(h.readFileSync(J,"utf-8").trim(),10);b&&ac(b)&&(ad(b,!0,a),await new Promise(a=>setTimeout(a,500))),h.unlinkSync(J)}}catch{}if(!v&&X)try{let b=X.replace(/'/g,"'\\''");if(a||s()){let{execWithPassword:d}=c(66936);await d(`pkill -SIGKILL -f "${b}" 2>/dev/null || true`,a||"").catch(()=>{})}else d(`pkill -SIGKILL -f "${b}" 2>/dev/null || true`,{windowsHide:!0},()=>{});await new Promise(a=>setTimeout(a,500))}catch{}}async function ar(){let a=null!==$&&!$.killed,b=_;if(!a)try{if(h.existsSync(J)){let c=parseInt(h.readFileSync(J,"utf-8").trim(),10);c&&ac(c)?(a=!0,b=c):h.unlinkSync(J)}}catch{}let d=q();await am(d);let e=g.join(D,"rootCA.crt"),f=h.existsSync(e),{checkCertInstalled:i}=c(9631),j=!!f&&await i(e);return{running:a,pid:b,certExists:f,certTrusted:j,dnsStatus:d}}async function as(a){if(R)return;if(Date.now()-Q>=6e4&&(P=0),P>=5)return void F("Max restart attempts reached. Giving up.");let b=K[Math.min(P,K.length-1)];P++,R=!0,E(`Restarting in ${b/1e3}s... (${P}/5)`),await new Promise(a=>setTimeout(a,b));try{let b=af?await af():null;if(b&&!b.mitmEnabled){E("MITM disabled, skipping restart"),R=!1;return}let c=aa()||await aj();if(!c&&!v){F("No cached password, cannot auto-restart"),R=!1;return}await au(a,c),E("\uD83D\uDD04 Restarted successfully"),P=0,R=!1}catch(b){if(String(b.message||"").includes("MITM server is already running")){E("MITM already running, restart not needed"),P=0,R=!1;return}F(`Restart attempt ${P}/5 failed: ${b.message}`),R=!1,as(a)}}async function at(a,b){if(a&&a.pid){if(v)try{f(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${a.pid} -Force -ErrorAction SilentlyContinue"`,{windowsHide:!0})}catch{}else try{let{execWithPassword:d}=c(66936);b||s()?await d(`kill -9 ${a.pid}`,b||""):f(`kill -9 ${a.pid}`,{windowsHide:!0})}catch{}await new Promise(a=>setTimeout(a,800))}}async function au(a,b,d=!1){if(!$||$.killed)try{if(h.existsSync(J)){let a=parseInt(h.readFileSync(J,"utf-8").trim(),10);if(a&&ac(a))return _=a,E(`âģī¸ Reusing existing process (PID: ${a})`),U(g.join(D,"rootCA.crt")),await ah(!0,b),b&&ab(b),{running:!0,pid:a};h.unlinkSync(J)}}catch{}if($&&!$.killed)throw Error("MITM server is already running");if(await aq(b),!v){let a=await new Promise(a=>{let b=j.createServer();b.once("error",b=>{"EADDRINUSE"===b.code?a("in-use"):a("no-permission")}),b.once("listening",()=>{b.close(()=>a("free"))}),b.listen(443,"127.0.0.1")});if("in-use"===a||"no-permission"===a){let a=await ap(b);if(a){let c=a.name.includes("/")?a.name.split("/").filter(Boolean).pop():a.name;if(d)E(`Killing process on port 443 (PID ${a.pid}, name=${c})...`),await at(a,b);else{let b=Error(`Port 443 is already in use by "${c}" (PID ${a.pid}).`);throw b.code="PORT_443_BUSY",b.portOwner={pid:a.pid,name:c},b}}}}let l=g.join(D,"rootCA.crt"),m=g.join(D,"rootCA.key"),n=h.existsSync(l)&&h.existsSync(m);if(!n||B(l)){if(n){E("\uD83D\uDD10 Cert expired â uninstalling old cert...");let a=b||aa()||await aj();try{await A(a,l)}catch{}}E("\uD83D\uDD10 Generating Root CA..."),await y()}let{checkCertInstalled:o}=c(9631),p=await o(l),r=!v&&!w&&!s();if(p)E("\uD83D\uDD10 Cert: already trusted â
");else{E("\uD83D\uDD10 Cert: not trusted â installing...");let a=b||aa()||await aj();if(r)E(`đ Cert: skipping system trust (no sudo). Install ${l} as a trusted CA on machines that use this proxy.`);else{if(!a&&t())throw Error("Sudo password required to install Root CA certificate");try{await z(a,l),E("\uD83D\uDD10 Cert: â
trusted")}catch(a){throw Error(`Failed to trust certificate: ${a.message}`)}}}U(l);let u=X;if((!u||!h.existsSync(u))&&(E(`[MITM] server.js missing at ${u} â recopying`),!(u=W(V()))||!h.existsSync(u)))throw Error(`MITM server.js not found at ${u}. Reinstall ktrouter.`);let x=await I();if(E(`đ Starting server... (router: ${x})`),v){let c=await ap(b);if(c)if(d)E(`Killing process on port 443 (PID ${c.pid}, name=${c.name})...`),await at(c,b);else{let a=Error(`Port 443 is already in use by "${c.name}" (PID ${c.pid}).`);throw a.code="PORT_443_BUSY",a.portOwner={pid:c.pid,name:c.name},a}$=e(process.execPath,[u],{detached:!1,windowsHide:!0,cwd:i.tmpdir(),stdio:["ignore","pipe","pipe"],env:{...process.env,DATA_DIR:g.resolve(process.env.DATA_DIR||C),ROUTER_API_KEY:a,NODE_ENV:"production",MITM_ROUTER_BASE:x}}),ag&&await ag({mitmCertInstalled:!0}).catch(()=>{})}else s()?(($=e("sudo",["-S","-E","sh","-c",[`HOME=${H(i.homedir())}`,`ROUTER_API_KEY=${H(a)}`,`MITM_ROUTER_BASE=${H(x)}`,"NODE_ENV=production",H(process.execPath),H(u)].join(" ")],{detached:!1,windowsHide:!0,stdio:["pipe","pipe","pipe"]})).stdin.write(`${b}
|
|
59
|
+
`),$.stdin.end()):$=e(process.execPath,[u],{detached:!1,windowsHide:!0,cwd:i.tmpdir(),stdio:["ignore","pipe","pipe"],env:{...process.env,DATA_DIR:g.resolve(process.env.DATA_DIR||C),ROUTER_API_KEY:a,NODE_ENV:"production",MITM_ROUTER_BASE:x}});$&&(_=$.pid,h.writeFileSync(J,String(_)),Q=Date.now());let G=null;$&&($.stdout.on("data",a=>{process.stdout.write(a)}),$.stderr.on("data",a=>{let b=a.toString().trim();b&&(v||!b.includes("Password:")&&!b.includes("password for"))&&(F(b),G=b),!v&&(b.includes("incorrect password")||b.includes("no password was provided"))&&(ab(null),ai(),R=!0)}),$.on("exit",b=>{E(`Server exited (code: ${b})`),$=null,_=null;try{h.unlinkSync(J)}catch{}0===b||R||as(a)}));let K=await function(a=443){return new Promise(b=>{let c=Date.now()+8e3,d=()=>{let e=k.request({hostname:"127.0.0.1",port:a,path:"/_mitm_health",method:"GET",rejectUnauthorized:!1},a=>{let c="";a.on("data",a=>{c+=a}),a.on("end",()=>{try{let a=JSON.parse(c);b(!0===a.ok?{ok:!0,pid:a.pid||null}:null)}catch{b(null)}})});e.on("error",()=>{Date.now()<c?setTimeout(d,500):b(null)}),e.end()};d()})}(443);if(!K){if($&&!$.killed){try{$.kill()}catch{}$=null}let a=function(){try{if(v){let a=f('powershell -NonInteractive -WindowStyle Hidden -Command "$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c) { $c.OwningProcess } else { 0 }"',{encoding:"utf8",windowsHide:!0}).trim(),b=parseInt(a,10);if(b&&b>4){let a=f(`tasklist /FI "PID eq ${b}" /FO CSV /NH`,{encoding:"utf8",windowsHide:!0}).match(/"([^"]+)"/);if(a)return a[1].replace(".exe","")}}else{let a=f("lsof -i :443",{encoding:"utf8",windowsHide:!0}).trim().split("\n");if(a.length>1)return a[1].split(/\s+/)[0]}}catch{}return null}(),b=a?` Port 443 already in use by ${a}.`:"",c=G||`Check sudo password or port 443 access.${b}`;throw Error(`MITM server failed to start. ${c}`)}for(let[a,b]of(ag&&await ag({mitmCertInstalled:!0}).catch(()=>{}),E(`â
Server healthy (PID: ${_||K.pid})`),Object.entries(q())))E(`đ DNS ${a}: ${b?"â
active":"â inactive"}`);return await ah(!0,b),b&&ab(b),{running:!0,pid:_}}async function av(a){var b;R=!0,P=0,E("âš Stopping server...");let d=$,e=d&&!d.killed?d.pid:(()=>{try{return parseInt(h.readFileSync(J,"utf-8").trim(),10)}catch{return null}})();if(e&&ac(e)&&(E(`Killing server (PID: ${e})...`),ad(e,!1,a),await new Promise(a=>setTimeout(a,1e3)),ac(e)&&ad(e,!0,a)),$=null,_=null,v){let a=g.join(process.env.SystemRoot||"C:\\Windows","System32","drivers","etc","hosts"),b=Object.values(r).flat();try{let{isAdmin:d,runElevatedPowerShell:e,quotePs:f}=c(64809);if(d()){let d=h.readFileSync(a,"utf8"),e=d.split(/\r?\n/).filter(a=>!b.some(b=>a.includes(b))).join("\r\n").replace(/[\r\n\s]+$/g,"")+"\r\n";e!==d&&h.writeFileSync(a,e,"utf8");try{c(79646).execSync("ipconfig /flushdns",{windowsHide:!0,stdio:"ignore"})}catch{}E("\uD83C\uDF10 DNS: â
all tool hosts removed")}else{let c=b.map(f).join(","),d=`
|
|
60
60
|
$hosts = @(${c})
|
|
61
61
|
$lines = Get-Content -LiteralPath ${f(a)}
|
|
62
62
|
$filtered = $lines | Where-Object {
|
|
@@ -65,4 +65,4 @@ ${L}=${b}
|
|
|
65
65
|
}
|
|
66
66
|
Set-Content -LiteralPath ${f(a)} -Value $filtered
|
|
67
67
|
ipconfig /flushdns | Out-Null
|
|
68
|
-
`;await e(d)}}catch(a){F(`Failed to clean hosts: ${a.message}`)}}else await o(a);try{h.unlinkSync(J)}catch{}return!function(a){if(!v||!a)return;let b=g.resolve(a).toLowerCase();String(process.env[L]||"").toLowerCase()===b&&delete process.env[L];try{if(!f(`reg query HKCU\\Environment /v ${L}`,{encoding:"utf8",windowsHide:!0,stdio:["ignore","pipe","ignore"]}).toLowerCase().includes(b))return}catch{return}try{f(`reg delete HKCU\\Environment /v ${L} /f`,{windowsHide:!0,stdio:"ignore"}),E(`Cert: removed ${L} from Windows user env`)}catch(a){E(`Cert: could not remove ${L}: ${a.message}`)}}(b=g.join(D,"rootCA.crt")),!function(a){if(!x)return;let b=a?g.resolve(a):"";b&&process.env[L]!==b||delete process.env[L];try{if(h.existsSync(N)){let a=h.readFileSync(N,"utf8");(!b||a.includes(b)||a.includes(O))&&h.unlinkSync(N)}}catch(a){E(`Cert: could not remove Linux environment.d: ${a.message}`)}try{S("systemctl")&&f(`systemctl --user unset-environment ${L}`,{stdio:"ignore",windowsHide:!0})}catch{}}(b),function(a){if(!x)return;let b=a?g.resolve(a):"";for(let a of T())try{let c=`${a}.ktrouter-bak`;if(!h.existsSync(c))continue;let d=h.readFileSync(a,"utf8");if(!d.includes(L)||b&&!d.includes(b))continue;h.copyFileSync(c,a),h.unlinkSync(c),E(`Cert: restored Antigravity desktop launcher ${g.basename(a)}`)}catch(a){E(`Cert: could not restore Antigravity desktop entry: ${a.message}`)}}(b),await ah(!1,null),R=!1,{running:!1,pid:null}}async function
|
|
68
|
+
`;await e(d)}}catch(a){F(`Failed to clean hosts: ${a.message}`)}}else await o(a);try{h.unlinkSync(J)}catch{}return!function(a){if(!v||!a)return;let b=g.resolve(a).toLowerCase();String(process.env[L]||"").toLowerCase()===b&&delete process.env[L];try{if(!f(`reg query HKCU\\Environment /v ${L}`,{encoding:"utf8",windowsHide:!0,stdio:["ignore","pipe","ignore"]}).toLowerCase().includes(b))return}catch{return}try{f(`reg delete HKCU\\Environment /v ${L} /f`,{windowsHide:!0,stdio:"ignore"}),E(`Cert: removed ${L} from Windows user env`)}catch(a){E(`Cert: could not remove ${L}: ${a.message}`)}}(b=g.join(D,"rootCA.crt")),!function(a){if(!x)return;let b=a?g.resolve(a):"";b&&process.env[L]!==b||delete process.env[L];try{if(h.existsSync(N)){let a=h.readFileSync(N,"utf8");(!b||a.includes(b)||a.includes(O))&&h.unlinkSync(N)}}catch(a){E(`Cert: could not remove Linux environment.d: ${a.message}`)}try{S("systemctl")&&f(`systemctl --user unset-environment ${L}`,{stdio:"ignore",windowsHide:!0})}catch{}}(b),function(a){if(!x)return;let b=a?g.resolve(a):"";for(let a of T())try{let c=`${a}.ktrouter-bak`;if(!h.existsSync(c))continue;let d=h.readFileSync(a,"utf8");if(!d.includes(L)||b&&!d.includes(b))continue;h.copyFileSync(c,a),h.unlinkSync(c),E(`Cert: restored Antigravity desktop launcher ${g.basename(a)}`)}catch(a){E(`Cert: could not restore Antigravity desktop entry: ${a.message}`)}}(b),await ah(!1,null),R=!1,{running:!1,pid:null}}async function aw(a,b){if(!(await ar()).running)throw Error("MITM server is not running. Start the server first.");let c=b||aa()||await aj();return await m(a,c),await ak(a,!0),{success:!0}}a.exports={getMitmStatus:ar,startServer:au,stopServer:av,enableToolDNS:aw,disableToolDNS:async function a(a,b){let c=b||aa()||await aj();return await n(a,c),await ak(a,!1),{success:!0}},trustCert:async function a(a){let b=g.join(D,"rootCA.crt");if(!h.existsSync(b))throw Error("Root CA not found. Start server first to generate it.");let{installCert:d}=c(9631);if(!v&&!w&&!s()){E(`đ Cert: system trust unavailable (no sudo). Use file: ${b}`),U(b);return}let e=a||aa()||await aj();if(!e&&t())throw Error("Sudo password required to trust certificate");await d(e,b),U(b),e&&ab(e)},startMitm:au,stopMitm:av,getCachedPassword:aa,setCachedPassword:ab,loadEncryptedPassword:aj,clearEncryptedPassword:ai,isSudoPasswordRequired:t,initDbHooks:function(a,b){af=a,ag=b},restoreToolDNS:an,hasDnsPrivilege:ao,removeAllDNSEntriesSync:p}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=6202,exports.ids=[6202],exports.modules={2574:(a,b,c)=>{c.r(b),c.d(b,{GET:()=>o,OPTIONS:()=>n,buildModelsList:()=>m});var d=c(81329),e=c(75681),f=c(89718),g=c(16655);let h=/[-_][0-9a-f]{8,}$/i,i={image:"image",tts:"tts",embedding:"embedding",stt:"stt",imageToText:"imageToText"};function j(a){return a?.type&&i[a.type]||"llm"}async function k(a){if(!a?.apiKey)return[];let b="string"==typeof a?.providerSpecificData?.baseUrl?a.providerSpecificData.baseUrl.trim().replace(/\/$/,""):"";if(!b)return[];let c=`${b}/models`,d={"Content-Type":"application/json"};if((0,e.mq)(a.provider))d.Authorization=`Bearer ${a.apiKey}`;else{if(!(0,e.gb)(a.provider))return[];c.endsWith("/messages/models")?c=c.slice(0,-9):c.endsWith("/messages")&&(c=`${c.slice(0,-9)}/models`),d["x-api-key"]=a.apiKey,d["anthropic-version"]="2023-06-01",d.Authorization=`Bearer ${a.apiKey}`}try{var f;let a=new AbortController,b=setTimeout(()=>a.abort(),5e3),e=await fetch(c,{method:"GET",headers:d,cache:"no-store",signal:a.signal});if(clearTimeout(b),!e.ok)return[];let g=(f=await e.json(),Array.isArray(f)?f:f?.data||f?.models||f?.results||[]);return Array.from(new Set(g.map(a=>a?.id||a?.name||a?.model).filter(a=>"string"==typeof a&&""!==a.trim())))}catch{return[]}}function l(a,b){let c=e.AI_PROVIDERS[a],d=Array.isArray(c?.serviceKinds)&&c.serviceKinds.length>0?c.serviceKinds:["llm"];return b.some(a=>d.includes(a))}async function m(a){let b=[];try{b=(b=await (0,f.getProviderConnections)()).filter(a=>!1!==a.isActive)}catch(a){console.log("Could not fetch providers, returning all models")}let c=[];try{c=await (0,f.Uv)()}catch(a){console.log("Could not fetch combos")}let i=[];try{i=await (0,f.uv)()}catch(a){console.log("Could not fetch custom models")}let m={};try{m=await (0,f.OM)()}catch(a){console.log("Could not fetch model aliases")}let n={};try{n=await (0,g.vF)()}catch(a){console.log("Could not fetch disabled models")}let o=(a,b)=>Array.isArray(n[a])&&n[a].includes(b),p=new Map;for(let a of b)p.has(a.provider)||p.set(a.provider,a);let q=[];for(let b of c){if(!function(a,b){let c=a?.kind||"llm";return b.includes(c)}(b,a))continue;let c={id:b.name,object:"model",context_window:1e7,owned_by:"combo"};("webSearch"===b.kind||"webFetch"===b.kind)&&(c.kind=b.kind),q.push(c)}if(0===b.length){let b=Object.fromEntries(Object.entries(d.Xg).map(([a,b])=>[b,a]));for(let[c,e]of Object.entries(d.vq))if(l(b[c]||c,a))for(let b of e)a.includes(j(b))&&(o(c,b.id)||q.push({id:`${c}/${b.id}`,object:"model",context_window:1e7,owned_by:c}));for(let b of i){if(!b?.id||b.type&&"llm"!==b.type||!a.includes("llm"))continue;let c=b.providerAlias;if(!c)continue;let d=String(b.id).trim();d&&q.push({id:`${c}/${d}`,object:"model",context_window:1e7,owned_by:c})}}else for(let[b,c]of p.entries()){if(!l(b,a))continue;let f=d.Xg[b]||b,g=(c?.providerSpecificData?.prefix||(0,e.wG)(b)||f).trim(),n=d.vq[f]||[],p=c?.providerSpecificData?.enabledModels,r=Array.isArray(p)&&p.length>0,s=(0,e.mq)(b)||(0,e.gb)(b),t=new Map(n.map(a=>[a.id,j(a)])),u=r?Array.from(new Set(p.filter(a=>"string"==typeof a&&""!==a.trim()))):n.map(a=>a.id);for(let d of(s&&0===u.length&&!h.test(b)&&(u=await k(c)),Array.from(new Set([...u.map(a=>a.startsWith(`${g}/`)?a.slice(g.length+1):a.startsWith(`${f}/`)?a.slice(f.length+1):a.startsWith(`${b}/`)?a.slice(b.length+1):a).filter(a=>"string"==typeof a&&""!==a.trim()),...i.filter(a=>{if(!a?.id||a.type&&"llm"!==a.type)return!1;let c=a.providerAlias;return c===f||c===g||c===b}).map(a=>String(a.id).trim()).filter(a=>""!==a),...Object.values(m||{}).filter(a=>"string"==typeof a&&!!a.includes("/")&&(a.startsWith(`${g}/`)||a.startsWith(`${f}/`)||a.startsWith(`${b}/`))).map(a=>a.startsWith(`${g}/`)?a.slice(g.length+1):a.startsWith(`${f}/`)?a.slice(f.length+1):a.startsWith(`${b}/`)?a.slice(b.length+1):a).filter(a=>"string"==typeof a&&""!==a.trim())])))){let b=t.get(d)||function(a){let b=String(a).toLowerCase();return/embed/.test(b)?"embedding":/tts|speech|audio|voice/.test(b)?"tts":/image|imagen|dall-?e|flux|sdxl|sd-|stable-diffusion/.test(b)?"image":"llm"}(d);a.includes(b)&&(o(g,d)||o(f,d)||q.push({id:`${g}/${d}`,object:"model",context_window:1e7,owned_by:g}))}let v=e.AI_PROVIDERS[b],w=[];if(a.includes("tts")&&Array.isArray(v?.ttsConfig?.models))for(let a of v.ttsConfig.models)a?.id&&w.push(a.id);if(a.includes("embedding")&&Array.isArray(v?.embeddingConfig?.models))for(let a of v.embeddingConfig.models)a?.id&&w.push(a.id);for(let a of w)o(g,a)||o(f,a)||q.push({id:`${g}/${a}`,object:"model",context_window:1e7,owned_by:g});a.includes("webSearch")&&v?.searchConfig&&q.push({id:`${g}/search`,object:"model",context_window:1e7,kind:"webSearch",owned_by:g}),a.includes("webFetch")&&v?.fetchConfig&&q.push({id:`${g}/fetch`,object:"model",context_window:1e7,kind:"webFetch",owned_by:g})}let r=[],s=new Set;for(let a of q)!a?.id||s.has(a.id)||(s.add(a.id),r.push(a));return r}async function n(){return new Response(null,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, OPTIONS","Access-Control-Allow-Headers":"*"}})}async function o(){try{let a=await m(["llm"]);return Response.json({object:"list",data:a},{headers:{"Access-Control-Allow-Origin":"*"}})}catch(a){return console.log("Error fetching models:",a),Response.json({error:{message:a.message,type:"server_error"}},{status:500})}}},16655:(a,b,c)=>{c.d(b,{oF:()=>d.oF,tm:()=>d.tm,vF:()=>d.vF});var d=c(9248)},19225:(a,b,c)=>{a.exports=c(44870)},35024:(a,b,c)=>{c.d(b,{Ak:()=>i,xq:()=>h});var d=c(21820);let e={"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},f={"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28","Anthropic-Dangerous-Direct-Browser-Access":"true","User-Agent":"claude-cli/2.1.92 (external, sdk-cli)","X-App":"cli","X-Stainless-Helper-Method":"stream","X-Stainless-Retry-Count":"0","X-Stainless-Runtime-Version":"v24.14.0","X-Stainless-Package-Version":"0.80.0","X-Stainless-Runtime":"node","X-Stainless-Lang":"js","X-Stainless-Arch":function(){switch((0,d.arch)()){case"x64":return"x64";case"arm64":return"arm64";case"ia32":return"x86";default:return`other::${(0,d.arch)()}`}}(),"X-Stainless-Os":function(){switch((0,d.platform)()){case"darwin":return"MacOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";default:return`Other::${(0,d.platform)()}`}}(),"X-Stainless-Timeout":"600"},g="https://api.kimi.com/coding/v1/messages",h={claude:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{...f},clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",tokenUrl:"https://api.anthropic.com/v1/oauth/token"},gemini:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",format:"gemini",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},"gemini-cli":{baseUrl:"https://cloudcode-pa.googleapis.com/v1internal",format:"gemini-cli",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},codex:{baseUrl:"https://chatgpt.com/backend-api/codex/responses",format:"openai-responses",headers:{originator:"codex-cli","User-Agent":"codex-cli/1.0.18 (macOS; arm64)"},clientId:"app_EMoamEEZ73f0CkXaXp7hrann",tokenUrl:"https://auth.openai.com/oauth/token"},qwen:{baseUrl:"https://portal.qwen.ai/v1/chat/completions",format:"openai",clientId:"f0304373b74a44d2b584a3fb70ca9e56",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",authUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{baseUrl:"https://apis.iflow.cn/v1/chat/completions",format:"openai",headers:{"User-Agent":"iFlow-Cli"},clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://iflow.cn/oauth/token",authUrl:"https://iflow.cn/oauth"},qoder:{baseUrl:"https://api.qoder.com/v1/chat/completions",format:"openai",headers:{"User-Agent":"Qoder-Cli"},clientId:process.env.QODER_OAUTH_CLIENT_ID||"10009311001",clientSecret:process.env.QODER_OAUTH_CLIENT_SECRET||"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://api.qoder.com/oauth/token",authUrl:"https://qoder.com/oauth/authorize"},antigravity:{baseUrls:["https://daily-cloudcode-pa.googleapis.com","https://daily-cloudcode-pa.sandbox.googleapis.com"],format:"antigravity",headers:{"User-Agent":`antigravity/1.107.0 ${(0,d.platform)()}/${(0,d.arch)()}`},clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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"},openrouter:{baseUrl:"https://openrouter.ai/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://endpoint-proxy.local","X-Title":"Endpoint Proxy"}},openai:{baseUrl:"https://api.openai.com/v1/chat/completions",format:"openai"},glm:{baseUrl:"https://api.z.ai/api/anthropic/v1/messages",format:"claude",headers:{...e}},"glm-cn":{baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",format:"openai",headers:{}},kimi:{baseUrl:g,format:"claude",headers:{...e}},minimax:{baseUrl:"https://api.minimax.io/anthropic/v1/messages",format:"claude",headers:{...e}},"minimax-cn":{baseUrl:"https://api.minimaxi.com/anthropic/v1/messages",format:"claude",headers:{...e}},alicode:{baseUrl:"https://coding.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},"alicode-intl":{baseUrl:"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},"volcengine-ark":{baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",format:"openai",headers:{}},byteplus:{baseUrl:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",format:"openai",headers:{}},github:{baseUrl:"https://api.githubcopilot.com/chat/completions",responsesUrl:"https://api.githubcopilot.com/responses",format:"openai",headers:{"copilot-integration-id":"vscode-chat","editor-version":"vscode/1.110.0","editor-plugin-version":"copilot-chat/0.38.0","user-agent":"GitHubCopilotChat/0.38.0","openai-intent":"conversation-panel","x-github-api-version":"2025-04-01","x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user",Accept:"application/json","Content-Type":"application/json"},clientId:"Iv1.b507a08c87ecfe98"},kiro:{baseUrl:"https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse",format:"kiro",retry:{429:2},headers:{"Content-Type":"application/json",Accept:"application/vnd.amazon.eventstream","X-Amz-Target":"AmazonCodeWhispererStreamingService.GenerateAssistantResponse","User-Agent":"AWS-SDK-JS/3.0.0 kiro-ide/1.0.0","X-Amz-User-Agent":"aws-sdk-js/3.0.0 kiro-ide/1.0.0"},tokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authUrl:"https://prod.us-east-1.auth.desktop.kiro.dev"},cursor:{baseUrl:"https://api2.cursor.sh",chatPath:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",format:"cursor",headers:{"connect-accept-encoding":"gzip","connect-protocol-version":"1","Content-Type":"application/connect+proto","User-Agent":"connect-es/1.6.1"},clientVersion:"3.1.0"},"kimi-coding":{baseUrl:g,format:"claude",headers:{...e},clientId:"17e5f671-d194-4dfb-9706-5516cb48c098",tokenUrl:"https://auth.kimi.com/api/oauth/token",refreshUrl:"https://auth.kimi.com/api/oauth/token"},kilocode:{baseUrl:"https://api.kilo.ai/api/openrouter/chat/completions",format:"openai",headers:{}},opencode:{baseUrl:"http://localhost:4096/v1/chat/completions",format:"openai",headers:{}},cline:{baseUrl:"https://api.cline.bot/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://cline.bot","X-Title":"Cline"},tokenUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},nvidia:{baseUrl:"https://integrate.api.nvidia.com/v1/chat/completions",format:"openai"},anthropic:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{...e}},deepseek:{baseUrl:"https://api.deepseek.com/chat/completions",format:"openai"},commandcode:{baseUrl:"https://api.commandcode.ai/alpha/generate",format:"commandcode",headers:{"x-command-code-version":"0.25.7","x-cli-environment":"cli"}},groq:{baseUrl:"https://api.groq.com/openai/v1/chat/completions",format:"openai"},xai:{baseUrl:"https://api.x.ai/v1/chat/completions",responsesUrl:"https://api.x.ai/v1/responses",format:"openai",clientId:"b1a00492-073a-47ea-816f-4c329264a828",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token"},mistral:{baseUrl:"https://api.mistral.ai/v1/chat/completions",format:"openai"},perplexity:{baseUrl:"https://api.perplexity.ai/chat/completions",format:"openai"},together:{baseUrl:"https://api.together.xyz/v1/chat/completions",format:"openai"},fireworks:{baseUrl:"https://api.fireworks.ai/inference/v1/chat/completions",format:"openai"},cerebras:{baseUrl:"https://api.cerebras.ai/v1/chat/completions",format:"openai"},cohere:{baseUrl:"https://api.cohere.ai/v1/chat/completions",format:"openai"},nebius:{baseUrl:"https://api.studio.nebius.ai/v1/chat/completions",format:"openai"},siliconflow:{baseUrl:"https://api.siliconflow.cn/v1/chat/completions",format:"openai"},hyperbolic:{baseUrl:"https://api.hyperbolic.xyz/v1/chat/completions",format:"openai"},deepgram:{baseUrl:"https://api.deepgram.com/v1/listen",format:"openai"},assemblyai:{baseUrl:"https://api.assemblyai.com/v1/audio/transcriptions",format:"openai"},nanobanana:{baseUrl:"https://api.nanobananaapi.ai/v1/chat/completions",format:"openai"},chutes:{baseUrl:"https://llm.chutes.ai/v1/chat/completions",format:"openai"},ollama:{baseUrl:"https://ollama.com/api/chat",format:"ollama"},"ollama-local":{baseUrl:"http://localhost:11434/api/chat",format:"ollama"},vertex:{baseUrl:"https://aiplatform.googleapis.com",format:"vertex"},"vertex-partner":{baseUrl:"https://aiplatform.googleapis.com",format:"openai"},gitlab:{baseUrl:"https://gitlab.com/api/v4/chat/completions",format:"openai"},codebuddy:{baseUrl:"https://copilot.tencent.com/v1/chat/completions",format:"openai"},opencode:{baseUrl:"https://opencode.ai",format:"openai",headers:{"x-opencode-client":"desktop"},noAuth:!0},"opencode-go":{baseUrl:"https://opencode.ai/zen/go/v1/chat/completions",format:"openai",headers:{}},"grok-web":{baseUrl:"https://grok.com/rest/app-chat/conversations/new",format:"grok-web",authType:"cookie"},"perplexity-web":{baseUrl:"https://www.perplexity.ai/rest/sse/perplexity_ask",format:"perplexity-web",authType:"cookie"},azure:{baseUrl:"",format:"openai",headers:{}},"cloudflare-ai":{baseUrl:"https://api.cloudflare.com/client/v4/accounts/{accountId}/ai/v1/chat/completions",format:"openai"},"xiaomi-mimo":{baseUrl:"https://api.xiaomimimo.com/v1/chat/completions",format:"openai"},"xiaomi-tokenplan":{baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1/chat/completions",format:"openai"},agentrouter:{baseUrl:"https://agentrouter.org/v1/messages",format:"claude",headers:{...f}},aimlapi:{baseUrl:"https://api.aimlapi.com/v1/chat/completions",format:"openai"},novita:{baseUrl:"https://api.novita.ai/v3/openai/chat/completions",format:"openai"},modal:{baseUrl:"https://api.modal.com/v1/chat/completions",format:"openai"},reka:{baseUrl:"https://api.reka.ai/v1/chat/completions",format:"openai"},nlpcloud:{baseUrl:"https://api.nlpcloud.io/v1/gpu/chatbot",format:"openai"},bazaarlink:{baseUrl:"https://bazaarlink.ai/api/v1/chat/completions",format:"openai"},completions:{baseUrl:"https://completions.me/api/v1/chat/completions",format:"openai"},enally:{baseUrl:"https://ai.enally.in/v1/chat/completions",format:"openai",authHeader:"x-api-key"},freetheai:{baseUrl:"https://api.freetheai.xyz/v1/chat/completions",format:"openai"},llm7:{baseUrl:"https://api.llm7.io/v1/chat/completions",format:"openai"},lepton:{baseUrl:"https://api.lepton.ai/api/v1/chat/completions",format:"openai"},kluster:{baseUrl:"https://api.kluster.ai/v1/chat/completions",format:"openai"},ai21:{baseUrl:"https://api.ai21.com/studio/v1/chat/completions",format:"openai"},"inference-net":{baseUrl:"https://api.inference.net/v1/chat/completions",format:"openai"},predibase:{baseUrl:"https://serving.app.predibase.com/v1/chat/completions",format:"openai"},bytez:{baseUrl:"https://api.bytez.com/models/v2",format:"openai"},morph:{baseUrl:"https://api.morphllm.com/v1/chat/completions",format:"openai"},longcat:{baseUrl:"https://api.longcat.chat/openai/v1/chat/completions",format:"openai"},puter:{baseUrl:"https://api.puter.com/puterai/openai/v1/chat/completions",format:"openai"},uncloseai:{baseUrl:"https://hermes.ai.unturf.com/v1/chat/completions",format:"openai",noAuth:!0},scaleway:{baseUrl:"https://api.scaleway.ai/v1/chat/completions",format:"openai"},deepinfra:{baseUrl:"https://api.deepinfra.com/v1/openai/chat/completions",format:"openai"},sambanova:{baseUrl:"https://api.sambanova.ai/v1/chat/completions",format:"openai"},nscale:{baseUrl:"https://inference.api.nscale.com/v1/chat/completions",format:"openai"},baseten:{baseUrl:"https://inference.baseten.co/v1/chat/completions",format:"openai"},publicai:{baseUrl:"https://api.publicai.co/v1/chat/completions",format:"openai"},"nous-research":{baseUrl:"https://inference-api.nousresearch.com/v1/chat/completions",format:"openai"},glhf:{baseUrl:"https://glhf.chat/api/openai/v1/chat/completions",format:"openai"},blackbox:{baseUrl:"https://api.blackbox.ai/chat/completions",format:"openai"}};function i(a){return(a?.providerSpecificData?.baseUrl?.trim()||"http://localhost:11434").replace(/\/$/,"")}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},81329:(a,b,c)=>{c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(9248)},92280:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},94755:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(50122);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}}};
|
|
1
|
+
"use strict";exports.id=6202,exports.ids=[6202],exports.modules={2574:(a,b,c)=>{c.r(b),c.d(b,{GET:()=>o,OPTIONS:()=>n,buildModelsList:()=>m});var d=c(81329),e=c(75681),f=c(89718),g=c(16655);let h=/[-_][0-9a-f]{8,}$/i,i={image:"image",tts:"tts",embedding:"embedding",stt:"stt",imageToText:"imageToText"};function j(a){return a?.type&&i[a.type]||"llm"}async function k(a){if(!a?.apiKey)return[];let b="string"==typeof a?.providerSpecificData?.baseUrl?a.providerSpecificData.baseUrl.trim().replace(/\/$/,""):"";if(!b)return[];let c=`${b}/models`,d={"Content-Type":"application/json"};if((0,e.mq)(a.provider))d.Authorization=`Bearer ${a.apiKey}`;else{if(!(0,e.gb)(a.provider))return[];c.endsWith("/messages/models")?c=c.slice(0,-9):c.endsWith("/messages")&&(c=`${c.slice(0,-9)}/models`),d["x-api-key"]=a.apiKey,d["anthropic-version"]="2023-06-01",d.Authorization=`Bearer ${a.apiKey}`}try{var f;let a=new AbortController,b=setTimeout(()=>a.abort(),5e3),e=await fetch(c,{method:"GET",headers:d,cache:"no-store",signal:a.signal});if(clearTimeout(b),!e.ok)return[];let g=(f=await e.json(),Array.isArray(f)?f:f?.data||f?.models||f?.results||[]);return Array.from(new Set(g.map(a=>a?.id||a?.name||a?.model).filter(a=>"string"==typeof a&&""!==a.trim())))}catch{return[]}}function l(a,b){let c=e.AI_PROVIDERS[a],d=Array.isArray(c?.serviceKinds)&&c.serviceKinds.length>0?c.serviceKinds:["llm"];return b.some(a=>d.includes(a))}async function m(a){let b=[];try{b=(b=await (0,f.getProviderConnections)()).filter(a=>!1!==a.isActive)}catch(a){console.log("Could not fetch providers, returning all models")}let c=[];try{c=await (0,f.Uv)()}catch(a){console.log("Could not fetch combos")}let i=[];try{i=await (0,f.uv)()}catch(a){console.log("Could not fetch custom models")}let m={};try{m=await (0,f.OM)()}catch(a){console.log("Could not fetch model aliases")}let n={};try{n=await (0,g.vF)()}catch(a){console.log("Could not fetch disabled models")}let o=(a,b)=>Array.isArray(n[a])&&n[a].includes(b),p=new Map;for(let a of b)p.has(a.provider)||p.set(a.provider,a);let q=[];for(let b of c){if(!function(a,b){let c=a?.kind||"llm";return b.includes(c)}(b,a))continue;let c={id:b.name,object:"model",context_window:1e7,owned_by:"combo"};("webSearch"===b.kind||"webFetch"===b.kind)&&(c.kind=b.kind),q.push(c)}if(0===b.length){let b=Object.fromEntries(Object.entries(d.Xg).map(([a,b])=>[b,a]));for(let[c,e]of Object.entries(d.vq))if(l(b[c]||c,a))for(let b of e)a.includes(j(b))&&(o(c,b.id)||q.push({id:`${c}/${b.id}`,object:"model",context_window:1e7,owned_by:c}));for(let b of i){if(!b?.id||b.type&&"llm"!==b.type||!a.includes("llm"))continue;let c=b.providerAlias;if(!c)continue;let d=String(b.id).trim();d&&q.push({id:`${c}/${d}`,object:"model",context_window:1e7,owned_by:c})}}else for(let[b,c]of p.entries()){if(!l(b,a))continue;let f=d.Xg[b]||b,g=(c?.providerSpecificData?.prefix||(0,e.wG)(b)||f).trim(),n=d.vq[f]||[],p=c?.providerSpecificData?.enabledModels,r=Array.isArray(p)&&p.length>0,s=(0,e.mq)(b)||(0,e.gb)(b),t=new Map(n.map(a=>[a.id,j(a)])),u=r?Array.from(new Set(p.filter(a=>"string"==typeof a&&""!==a.trim()))):n.map(a=>a.id);for(let d of(s&&0===u.length&&!h.test(b)&&(u=await k(c)),Array.from(new Set([...u.map(a=>a.startsWith(`${g}/`)?a.slice(g.length+1):a.startsWith(`${f}/`)?a.slice(f.length+1):a.startsWith(`${b}/`)?a.slice(b.length+1):a).filter(a=>"string"==typeof a&&""!==a.trim()),...i.filter(a=>{if(!a?.id||a.type&&"llm"!==a.type)return!1;let c=a.providerAlias;return c===f||c===g||c===b}).map(a=>String(a.id).trim()).filter(a=>""!==a),...Object.values(m||{}).filter(a=>"string"==typeof a&&!!a.includes("/")&&(a.startsWith(`${g}/`)||a.startsWith(`${f}/`)||a.startsWith(`${b}/`))).map(a=>a.startsWith(`${g}/`)?a.slice(g.length+1):a.startsWith(`${f}/`)?a.slice(f.length+1):a.startsWith(`${b}/`)?a.slice(b.length+1):a).filter(a=>"string"==typeof a&&""!==a.trim())])))){let b=t.get(d)||function(a){let b=String(a).toLowerCase();return/embed/.test(b)?"embedding":/tts|speech|audio|voice/.test(b)?"tts":/image|imagen|dall-?e|flux|sdxl|sd-|stable-diffusion/.test(b)?"image":"llm"}(d);a.includes(b)&&(o(g,d)||o(f,d)||q.push({id:`${g}/${d}`,object:"model",context_window:1e7,owned_by:g}))}let v=e.AI_PROVIDERS[b],w=[];if(a.includes("tts")&&Array.isArray(v?.ttsConfig?.models))for(let a of v.ttsConfig.models)a?.id&&w.push(a.id);if(a.includes("embedding")&&Array.isArray(v?.embeddingConfig?.models))for(let a of v.embeddingConfig.models)a?.id&&w.push(a.id);for(let a of w)o(g,a)||o(f,a)||q.push({id:`${g}/${a}`,object:"model",context_window:1e7,owned_by:g});a.includes("webSearch")&&v?.searchConfig&&q.push({id:`${g}/search`,object:"model",context_window:1e7,kind:"webSearch",owned_by:g}),a.includes("webFetch")&&v?.fetchConfig&&q.push({id:`${g}/fetch`,object:"model",context_window:1e7,kind:"webFetch",owned_by:g})}let r=[],s=new Set;for(let a of q)!a?.id||s.has(a.id)||(s.add(a.id),r.push(a));return r}async function n(){return new Response(null,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, OPTIONS","Access-Control-Allow-Headers":"*"}})}async function o(){try{let a=await m(["llm"]);return Response.json({object:"list",data:a},{headers:{"Access-Control-Allow-Origin":"*"}})}catch(a){return console.log("Error fetching models:",a),Response.json({error:{message:a.message,type:"server_error"}},{status:500})}}},16655:(a,b,c)=>{c.d(b,{oF:()=>d.oF,tm:()=>d.tm,vF:()=>d.vF});var d=c(9248)},19225:(a,b,c)=>{a.exports=c(44870)},35024:(a,b,c)=>{c.d(b,{Ak:()=>i,xq:()=>h});var d=c(21820);let e={"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},f={"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28","Anthropic-Dangerous-Direct-Browser-Access":"true","User-Agent":"claude-cli/2.1.92 (external, sdk-cli)","X-App":"cli","X-Stainless-Helper-Method":"stream","X-Stainless-Retry-Count":"0","X-Stainless-Runtime-Version":"v24.14.0","X-Stainless-Package-Version":"0.80.0","X-Stainless-Runtime":"node","X-Stainless-Lang":"js","X-Stainless-Arch":function(){switch((0,d.arch)()){case"x64":return"x64";case"arm64":return"arm64";case"ia32":return"x86";default:return`other::${(0,d.arch)()}`}}(),"X-Stainless-Os":function(){switch((0,d.platform)()){case"darwin":return"MacOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";default:return`Other::${(0,d.platform)()}`}}(),"X-Stainless-Timeout":"600"},g="https://api.kimi.com/coding/v1/messages",h={claude:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{...f},clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",tokenUrl:"https://api.anthropic.com/v1/oauth/token"},gemini:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",format:"gemini",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},"gemini-cli":{baseUrl:"https://cloudcode-pa.googleapis.com/v1internal",format:"gemini-cli",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},codex:{baseUrl:"https://chatgpt.com/backend-api/codex/responses",format:"openai-responses",headers:{originator:"codex-cli","User-Agent":"codex-cli/1.0.18 (macOS; arm64)"},clientId:"app_EMoamEEZ73f0CkXaXp7hrann",tokenUrl:"https://auth.openai.com/oauth/token"},qwen:{baseUrl:"https://portal.qwen.ai/v1/chat/completions",format:"openai",clientId:"f0304373b74a44d2b584a3fb70ca9e56",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",authUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{baseUrl:"https://apis.iflow.cn/v1/chat/completions",format:"openai",headers:{"User-Agent":"iFlow-Cli"},clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://iflow.cn/oauth/token",authUrl:"https://iflow.cn/oauth"},qoder:{baseUrl:"https://api.qoder.com/v1/chat/completions",format:"openai",headers:{"User-Agent":"Qoder-Cli"},clientId:process.env.QODER_OAUTH_CLIENT_ID||"10009311001",clientSecret:process.env.QODER_OAUTH_CLIENT_SECRET||"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://api.qoder.com/oauth/token",authUrl:"https://qoder.com/oauth/authorize"},antigravity:{baseUrls:["https://daily-cloudcode-pa.googleapis.com","https://daily-cloudcode-pa.sandbox.googleapis.com"],format:"antigravity",headers:{"User-Agent":`antigravity/1.107.0 ${(0,d.platform)()}/${(0,d.arch)()}`},clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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"},openrouter:{baseUrl:"https://openrouter.ai/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://endpoint-proxy.local","X-Title":"Endpoint Proxy"}},openai:{baseUrl:"https://api.openai.com/v1/chat/completions",format:"openai"},glm:{baseUrl:"https://api.z.ai/api/anthropic/v1/messages",format:"claude",headers:{...e}},"glm-cn":{baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",format:"openai",headers:{}},kimi:{baseUrl:g,format:"claude",headers:{...e}},minimax:{baseUrl:"https://api.minimax.io/anthropic/v1/messages",format:"claude",headers:{...e}},"minimax-cn":{baseUrl:"https://api.minimaxi.com/anthropic/v1/messages",format:"claude",headers:{...e}},alicode:{baseUrl:"https://coding.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},"alicode-intl":{baseUrl:"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},"volcengine-ark":{baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",format:"openai",headers:{}},byteplus:{baseUrl:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",format:"openai",headers:{}},github:{baseUrl:"https://api.githubcopilot.com/chat/completions",responsesUrl:"https://api.githubcopilot.com/responses",format:"openai",headers:{"copilot-integration-id":"vscode-chat","editor-version":"vscode/1.110.0","editor-plugin-version":"copilot-chat/0.38.0","user-agent":"GitHubCopilotChat/0.38.0","openai-intent":"conversation-panel","x-github-api-version":"2025-04-01","x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user",Accept:"application/json","Content-Type":"application/json"},clientId:"Iv1.b507a08c87ecfe98"},kiro:{baseUrl:"https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse",format:"kiro",retry:{429:2},headers:{"Content-Type":"application/json",Accept:"application/vnd.amazon.eventstream","X-Amz-Target":"AmazonCodeWhispererStreamingService.GenerateAssistantResponse","User-Agent":"AWS-SDK-JS/3.0.0 kiro-ide/1.0.0","X-Amz-User-Agent":"aws-sdk-js/3.0.0 kiro-ide/1.0.0"},tokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authUrl:"https://prod.us-east-1.auth.desktop.kiro.dev"},cursor:{baseUrl:"https://api2.cursor.sh",chatPath:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",format:"cursor",headers:{"connect-accept-encoding":"gzip","connect-protocol-version":"1","Content-Type":"application/connect+proto","User-Agent":"connect-es/1.6.1"},clientVersion:"3.1.0"},"kimi-coding":{baseUrl:g,format:"claude",headers:{...e},clientId:"17e5f671-d194-4dfb-9706-5516cb48c098",tokenUrl:"https://auth.kimi.com/api/oauth/token",refreshUrl:"https://auth.kimi.com/api/oauth/token"},kilocode:{baseUrl:"https://api.kilo.ai/api/openrouter/chat/completions",format:"openai",headers:{}},opencode:{baseUrl:"http://localhost:4096/v1/chat/completions",format:"openai",headers:{}},cline:{baseUrl:"https://api.cline.bot/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://cline.bot","X-Title":"Cline"},tokenUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},nvidia:{baseUrl:"https://integrate.api.nvidia.com/v1/chat/completions",format:"openai"},anthropic:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{...e}},deepseek:{baseUrl:"https://api.deepseek.com/chat/completions",format:"openai"},commandcode:{baseUrl:"https://api.commandcode.ai/alpha/generate",format:"commandcode",headers:{"x-command-code-version":"0.25.7","x-cli-environment":"cli"}},groq:{baseUrl:"https://api.groq.com/openai/v1/chat/completions",format:"openai"},xai:{baseUrl:"https://api.x.ai/v1/chat/completions",responsesUrl:"https://api.x.ai/v1/responses",format:"openai",clientId:"b1a00492-073a-47ea-816f-4c329264a828",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token"},mistral:{baseUrl:"https://api.mistral.ai/v1/chat/completions",format:"openai"},perplexity:{baseUrl:"https://api.perplexity.ai/chat/completions",format:"openai"},together:{baseUrl:"https://api.together.xyz/v1/chat/completions",format:"openai"},fireworks:{baseUrl:"https://api.fireworks.ai/inference/v1/chat/completions",format:"openai"},cerebras:{baseUrl:"https://api.cerebras.ai/v1/chat/completions",format:"openai"},cohere:{baseUrl:"https://api.cohere.ai/v1/chat/completions",format:"openai"},nebius:{baseUrl:"https://api.studio.nebius.ai/v1/chat/completions",format:"openai"},siliconflow:{baseUrl:"https://api.siliconflow.cn/v1/chat/completions",format:"openai"},hyperbolic:{baseUrl:"https://api.hyperbolic.xyz/v1/chat/completions",format:"openai"},deepgram:{baseUrl:"https://api.deepgram.com/v1/listen",format:"openai"},assemblyai:{baseUrl:"https://api.assemblyai.com/v1/audio/transcriptions",format:"openai"},nanobanana:{baseUrl:"https://api.nanobananaapi.ai/v1/chat/completions",format:"openai"},chutes:{baseUrl:"https://llm.chutes.ai/v1/chat/completions",format:"openai"},ollama:{baseUrl:"https://ollama.com/api/chat",format:"ollama"},"ollama-local":{baseUrl:"http://localhost:11434/api/chat",format:"ollama"},vertex:{baseUrl:"https://aiplatform.googleapis.com",format:"vertex"},"vertex-partner":{baseUrl:"https://aiplatform.googleapis.com",format:"openai"},gitlab:{baseUrl:"https://gitlab.com/api/v4/chat/completions",format:"openai"},codebuddy:{baseUrl:"https://copilot.tencent.com/v1/chat/completions",format:"openai",refreshUrl:"https://copilot.tencent.com/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2"},opencode:{baseUrl:"https://opencode.ai",format:"openai",headers:{"x-opencode-client":"desktop"},noAuth:!0},"opencode-go":{baseUrl:"https://opencode.ai/zen/go/v1/chat/completions",format:"openai",headers:{}},"grok-web":{baseUrl:"https://grok.com/rest/app-chat/conversations/new",format:"grok-web",authType:"cookie"},"perplexity-web":{baseUrl:"https://www.perplexity.ai/rest/sse/perplexity_ask",format:"perplexity-web",authType:"cookie"},azure:{baseUrl:"",format:"openai",headers:{}},"cloudflare-ai":{baseUrl:"https://api.cloudflare.com/client/v4/accounts/{accountId}/ai/v1/chat/completions",format:"openai"},"xiaomi-mimo":{baseUrl:"https://api.xiaomimimo.com/v1/chat/completions",format:"openai"},"xiaomi-tokenplan":{baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1/chat/completions",format:"openai"},agentrouter:{baseUrl:"https://agentrouter.org/v1/messages",format:"claude",headers:{...f}},aimlapi:{baseUrl:"https://api.aimlapi.com/v1/chat/completions",format:"openai"},novita:{baseUrl:"https://api.novita.ai/v3/openai/chat/completions",format:"openai"},modal:{baseUrl:"https://api.modal.com/v1/chat/completions",format:"openai"},reka:{baseUrl:"https://api.reka.ai/v1/chat/completions",format:"openai"},nlpcloud:{baseUrl:"https://api.nlpcloud.io/v1/gpu/chatbot",format:"openai"},bazaarlink:{baseUrl:"https://bazaarlink.ai/api/v1/chat/completions",format:"openai"},completions:{baseUrl:"https://completions.me/api/v1/chat/completions",format:"openai"},enally:{baseUrl:"https://ai.enally.in/v1/chat/completions",format:"openai",authHeader:"x-api-key"},freetheai:{baseUrl:"https://api.freetheai.xyz/v1/chat/completions",format:"openai"},llm7:{baseUrl:"https://api.llm7.io/v1/chat/completions",format:"openai"},lepton:{baseUrl:"https://api.lepton.ai/api/v1/chat/completions",format:"openai"},kluster:{baseUrl:"https://api.kluster.ai/v1/chat/completions",format:"openai"},ai21:{baseUrl:"https://api.ai21.com/studio/v1/chat/completions",format:"openai"},"inference-net":{baseUrl:"https://api.inference.net/v1/chat/completions",format:"openai"},predibase:{baseUrl:"https://serving.app.predibase.com/v1/chat/completions",format:"openai"},bytez:{baseUrl:"https://api.bytez.com/models/v2",format:"openai"},morph:{baseUrl:"https://api.morphllm.com/v1/chat/completions",format:"openai"},longcat:{baseUrl:"https://api.longcat.chat/openai/v1/chat/completions",format:"openai"},puter:{baseUrl:"https://api.puter.com/puterai/openai/v1/chat/completions",format:"openai"},uncloseai:{baseUrl:"https://hermes.ai.unturf.com/v1/chat/completions",format:"openai",noAuth:!0},scaleway:{baseUrl:"https://api.scaleway.ai/v1/chat/completions",format:"openai"},deepinfra:{baseUrl:"https://api.deepinfra.com/v1/openai/chat/completions",format:"openai"},sambanova:{baseUrl:"https://api.sambanova.ai/v1/chat/completions",format:"openai"},nscale:{baseUrl:"https://inference.api.nscale.com/v1/chat/completions",format:"openai"},baseten:{baseUrl:"https://inference.baseten.co/v1/chat/completions",format:"openai"},publicai:{baseUrl:"https://api.publicai.co/v1/chat/completions",format:"openai"},"nous-research":{baseUrl:"https://inference-api.nousresearch.com/v1/chat/completions",format:"openai"},glhf:{baseUrl:"https://glhf.chat/api/openai/v1/chat/completions",format:"openai"},blackbox:{baseUrl:"https://api.blackbox.ai/chat/completions",format:"openai"}};function i(a){return(a?.providerSpecificData?.baseUrl?.trim()||"http://localhost:11434").replace(/\/$/,"")}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},81329:(a,b,c)=>{c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(9248)},92280:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},94755:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(50122);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=6811,exports.ids=[1998,6811],exports.modules={15626:(a,b,c)=>{c.d(b,{w$:()=>e});let d=c(39006).rE||"0.0.0";function e(a,b={}){let c,f=(c=function(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}(a))?`Bearer ${c}`:"",g={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`KTRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"ktrouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},39326:(a,b,c)=>{c.d(b,{B:()=>f});var d=c(71998);function e(a){return null==a?"":String(a).trim()}async function f(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type)return{source:"vercel",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},66811:(a,b,c)=>{c.d(b,{F:()=>t});var d=c(89718),e=c(39326),f=c(74926),g=c(75681),h=c(30869),i=c(44404),j=c(35024),k=c(92990),l=c(67828),m=c(15626);let n={claude:{checkExpiry:!0,refreshable:!0},codex:{url:"https://chatgpt.com/backend-api/codex/responses",method:"POST",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"Content-Type":"application/json",originator:"codex-cli","User-Agent":"codex-cli/1.0.18 (macOS; arm64)"},body:JSON.stringify({model:"gpt-5.3-codex",input:[],stream:!1,store:!1}),acceptStatuses:[400],refreshable:!0},"gemini-cli":{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},antigravity:{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},github:{url:"https://api.github.com/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"User-Agent":"KTRouter",Accept:"application/vnd.github+json"},refreshable:!0},iflow:{buildUrl:a=>`https://iflow.cn/api/oauth/getUserInfo?accessToken=${encodeURIComponent(a)}`,method:"GET",noAuth:!0,refreshable:!0},qwen:{checkExpiry:!0,refreshable:!0},kiro:{checkExpiry:!0,refreshable:!0},"kimi-coding":{checkExpiry:!0,refreshable:!0},cursor:{tokenExists:!0},kilocode:{url:`${k.MZ.apiBaseUrl}/api/profile`,method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},cline:{refreshable:!0},xai:{url:"https://api.x.ai/v1/models",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",acceptStatuses:[403],refreshable:!0},gitlab:{url:"https://gitlab.com/api/v4/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},codebuddy:{tokenExists:!0,refreshable:!0}};async function o(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,m.w$)(a,{Accept:"application/json"})})}async function p(a){if(!a.refreshToken)return null;try{let b=await (0,l.$B)(a.provider,{accessToken:a.accessToken,refreshToken:a.refreshToken,apiKey:a.apiKey,providerSpecificData:a.providerSpecificData});return b?.accessToken?b:null}catch(b){return console.log(`Error refreshing ${a.provider} token:`,b.message),null}}async function q(a,b=null){var c;let d=n[a.provider];if(!d)return{valid:!1,error:"Provider test not supported",refreshed:!1};if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};let e=a.accessToken,f=!1,g=null,h=!!(c=a).expiresAt&&new Date(c.expiresAt).getTime()<=Date.now()+3e5;if(d.refreshable&&h&&a.refreshToken){let b=await p(a);if(!b)return{valid:!1,error:"Token expired and refresh failed",refreshed:!1};e=b.accessToken,f=!0,g=b}if(d.tokenExists)return{valid:!0,error:null,refreshed:f,newTokens:g};if(d.checkExpiry)return f?{valid:!0,error:null,refreshed:f,newTokens:g}:h?{valid:!1,error:"Token expired",refreshed:!1}:{valid:!0,error:null,refreshed:!1,newTokens:null};if("cline"===a.provider){let b=async a=>{let b=await o(a);return b.ok?{valid:!0,error:null,refreshed:f,newTokens:g}:401===b.status?{valid:!1,error:"Token invalid or revoked",refreshed:f}:403===b.status?{valid:!1,error:"Access denied",refreshed:f}:{valid:!1,error:`API returned ${b.status}`,refreshed:f}},c=await b(e);if(c.valid||"Token invalid or revoked"!==c.error||!a.refreshToken)return c;let d=await p(a);return d?.accessToken?(f=!0,g=d,e=d.accessToken,await b(e)):{valid:!1,error:"Token invalid or revoked",refreshed:!1}}try{let c=d.buildUrl?d.buildUrl(e):d.url,h=d.noAuth?{...d.extraHeaders}:{[d.authHeader]:`${d.authPrefix}${e}`,...d.extraHeaders},i={method:d.method,headers:h};d.body&&(i.body=d.body);let j=await r(c,i,b);if(j.ok||d.acceptStatuses&&d.acceptStatuses.includes(j.status))return{valid:!0,error:null,refreshed:f,newTokens:g};if((401===j.status||403===j.status)&&d.refreshable&&!f&&a.refreshToken){let e=await p(a);if(e){let a=d.buildUrl?d.buildUrl(e.accessToken):c,f=d.noAuth?{...d.extraHeaders}:{[d.authHeader]:`${d.authPrefix}${e.accessToken}`,...d.extraHeaders},g={method:d.method,headers:f};d.body&&(g.body=d.body);let h=await r(a,g,b);if(h.ok||d.acceptStatuses&&d.acceptStatuses.includes(h.status))return{valid:!0,error:null,refreshed:!0,newTokens:e}}return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}if(401===j.status)return{valid:!1,error:"Token invalid or revoked",refreshed:f};if(403===j.status)return{valid:!1,error:"Access denied",refreshed:f};return{valid:!1,error:`API returned ${j.status}`,refreshed:f}}catch(a){return{valid:!1,error:a.message,refreshed:f}}}async function r(a,b={},d=null){if(d?.vercelRelayUrl){let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{vercelRelayUrl:d.vercelRelayUrl})}if(!d?.connectionProxyEnabled||!d?.connectionProxyUrl)return fetch(a,b);let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{connectionProxyEnabled:!0,connectionProxyUrl:d.connectionProxyUrl,connectionNoProxy:d.connectionNoProxy||""})}async function s(a,b=null){if((0,g.mq)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{let d=await r(`${c.replace(/\/$/,"")}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}if((0,g.gb)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{(c=c.replace(/\/$/,"")).endsWith("/messages")&&(c=c.slice(0,-9));let d=await r(`${c}/models`,{headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01",Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}try{switch(a.provider){case"cloudflare-ai":{let c=(a.providerSpecificData||{}).accountId;if(!c)return{valid:!1,error:"Missing Account ID"};let d=`https://api.cloudflare.com/client/v4/accounts/${c}/ai/v1/chat/completions`,e=await r(d,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:(0,i.fZ)("cloudflare-ai"),messages:[{role:"user",content:"test"}],max_tokens:1})},b),f=401!==e.status&&403!==e.status&&404!==e.status;return{valid:f,error:f?null:"Invalid API token or Account ID"}}case"azure":{let c=a.providerSpecificData||{},d=(c.azureEndpoint||"").replace(/\/$/,""),e=c.deployment||"gpt-4",f=c.apiVersion||"2024-10-01-preview",g=`${d}/openai/deployments/${e}/chat/completions?api-version=${f}`,h={"api-key":a.apiKey,"Content-Type":"application/json"};c.organization&&(h["OpenAI-Organization"]=c.organization);let i=await r(g,{method:"POST",headers:h,body:JSON.stringify({messages:[{role:"user",content:"test"}],max_completion_tokens:1})},b),j=401!==i.status&&403!==i.status;return{valid:j,error:j?null:"Invalid API key or Azure configuration"}}case"openai":{let c=await r("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"anthropic":{let c=await r("https://api.anthropic.com/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"claude-3-haiku-20240307",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"gemini":{let c=await r(`https://generativelanguage.googleapis.com/v1/models?key=${a.apiKey}`,{},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"openrouter":{let c=await r("https://openrouter.ai/api/v1/auth/key",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"glm":{let c=await r("https://api.z.ai/api/anthropic/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"glm-cn":{let c=await r("https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"minimax":case"minimax-cn":{let c=await r({minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages"}[a.provider],{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"minimax-m2",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"kimi":{let c=await r("https://api.kimi.com/coding/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"kimi-latest",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"alicode":case"alicode-intl":{let c="alicode-intl"===a.provider?"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions":"https://coding.dashscope.aliyuncs.com/v1/chat/completions",d=await r(c,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),e=401!==d.status&&403!==d.status;return{valid:e,error:e?null:"Invalid API key"}}case"volcengine-ark":case"byteplus":{let c=await r(h.X3[a.provider],{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"deepseek":{let c=await r("https://api.deepseek.com/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"groq":{let c=await r("https://api.groq.com/openai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"mistral":{let c=await r("https://api.mistral.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"xai":{let c=await r("https://api.x.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b),d=c.ok||403===c.status;return{valid:d,error:d?null:"Invalid API key"}}case"nvidia":{let c=await r("https://integrate.api.nvidia.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"perplexity":{let c=await r("https://api.perplexity.ai/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"together":{let c=await r("https://api.together.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fireworks":{let c=await r("https://api.fireworks.ai/inference/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cerebras":{let c=await r("https://api.cerebras.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cohere":{let c=await r("https://api.cohere.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nebius":{let c=await r("https://api.studio.nebius.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"siliconflow":{let c=await r("https://api.siliconflow.cn/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"hyperbolic":{let c=await r("https://api.hyperbolic.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"ollama":{let b=await fetch("https://ollama.com/api/tags",{headers:{Authorization:`Bearer ${a.apiKey}`}});return{valid:b.ok,error:b.ok?null:"Invalid API key"}}case"ollama-local":{let b=(0,j.Ak)(a),c=await fetch(`${b}/api/tags`);return{valid:c.ok,error:c.ok?null:`Ollama not reachable at ${b}`}}case"deepgram":{let c=await r("https://api.deepgram.com/v1/projects",{headers:{Authorization:`Token ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"assemblyai":{let c=await r("https://api.assemblyai.com/v1/account",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nanobanana":{let c=await r("https://api.nanobananaapi.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fal-ai":{let c=await r("https://api.fal.ai/v1/models?limit=1",{headers:{Authorization:`Key ${a.apiKey}`}},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"chutes":{let c=await r("https://llm.chutes.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"grok-web":{let c=a.apiKey.startsWith("sso=")?a.apiKey.slice(4):a.apiKey,d=a=>Array.from(crypto.getRandomValues(new Uint8Array(a)),a=>a.toString(16).padStart(2,"0")).join(""),e=Buffer.from("e:TypeError: Cannot read properties of null (reading 'children')").toString("base64"),f=await r("https://grok.com/rest/app-chat/conversations/new",{method:"POST",headers:{Accept:"*/*","Content-Type":"application/json",Cookie:`sso=${c}`,Origin:"https://grok.com",Referer:"https://grok.com/","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":e,"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${d(16)}-${d(8)}-00`},body:JSON.stringify({temporary:!0,modelName:"grok-4",message:"ping",fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,sendFinalMetadata:!0})},b),g=401!==f.status&&403!==f.status;return{valid:g,error:g?null:"Invalid SSO cookie"}}case"perplexity-web":{let c=a.apiKey;c.startsWith("__Secure-next-auth.session-token=")&&(c=c.slice(33));let d=await r("https://www.perplexity.ai/api/auth/session",{method:"GET",headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",Cookie:`__Secure-next-auth.session-token=${c}`}},b);if(!d.ok)return{valid:!1,error:"Invalid session cookie"};let e=await d.json().catch(()=>null),f=!!(e&&e.user);return{valid:f,error:f?null:"Session expired â re-paste cookie"}}default:return{valid:!1,error:"Provider test not supported"}}}catch(a){return{valid:!1,error:a.message}}}async function t(a){let b,c=await (0,d.Mc)(a);if(!c)return{valid:!1,error:"Connection not found",latencyMs:0,testedAt:new Date().toISOString()};let g=await (0,e.B)(c.providerSpecificData||{});if(g.connectionProxyEnabled&&g.connectionProxyUrl&&!g.vercelRelayUrl){let b=await (0,f.C)({proxyUrl:g.connectionProxyUrl});if(!b.ok){let c=b.error||`Proxy test failed with status ${b.status}`;return await (0,d.updateProviderConnection)(a,{testStatus:"error",lastError:c,lastErrorAt:new Date().toISOString()}),{valid:!1,error:c,latencyMs:0,testedAt:new Date().toISOString()}}}let h=Date.now();b="apikey"===c.authType||"cookie"===c.authType?await s(c,g):await q(c,g);let i=Date.now()-h,j={testStatus:b.valid?"active":"error",lastError:b.valid?null:b.error,lastErrorAt:b.valid?null:new Date().toISOString()};if(b.refreshed&&b.newTokens){b.newTokens.accessToken&&(j.accessToken=b.newTokens.accessToken),b.newTokens.refreshToken&&(j.refreshToken=b.newTokens.refreshToken),b.newTokens.expiresIn&&(j.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString(),j.expiresIn=b.newTokens.expiresIn);let a={...b.newTokens.providerSpecificData||{}};b.newTokens.copilotToken&&(a.copilotToken=b.newTokens.copilotToken),b.newTokens.copilotTokenExpiresAt&&(a.copilotTokenExpiresAt=b.newTokens.copilotTokenExpiresAt),Object.keys(a).length>0&&(j.providerSpecificData={...c.providerSpecificData||{},...a})}return await (0,d.updateProviderConnection)(a,j),{valid:b.valid,error:b.error,refreshed:b.refreshed||!1,latencyMs:i,testedAt:new Date().toISOString()}}},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},74926:(a,b,c)=>{c.d(b,{C:()=>f});var d=c(47774);function e(a){return null==a?"":String(a).trim()}async function f({proxyUrl:a,testUrl:b,timeoutMs:c}={}){let g,h=e(a);if(!h)return{ok:!1,status:400,error:"proxyUrl is required"};let i=e(b)||"https://google.com/",j=Number(c),k=Number.isFinite(j)&&j>0?Math.min(j,3e4):8e3;try{try{g=new d.ProxyAgent({uri:h})}catch(a){return{ok:!1,status:400,error:`Invalid proxy URL: ${a?.message||String(a)}`}}let a=new AbortController,b=Date.now(),c=setTimeout(()=>a.abort(),k);try{let c=await (0,d.hd)(i,{method:"HEAD",dispatcher:g,signal:a.signal,headers:{"User-Agent":"KTRouter"}});return{ok:c.ok,status:c.status,statusText:c.statusText,url:i,elapsedMs:Date.now()-b}}catch(b){let a=b?.name==="AbortError"?"Proxy test timed out":function(a){if(!a)return"Unknown error";let b=a?.message||String(a),c=a?.cause?.code||a?.code,d=a?.cause?.message;return d&&d!==b?c?`${b}: ${d} (${c})`:`${b}: ${d}`:c&&!b.includes(c)?`${b} (${c})`:b}(b);return{ok:!1,status:500,error:a}}finally{clearTimeout(c)}}finally{try{await g?.close?.()}catch{}}}},92990:(a,b,c)=>{c.d(b,{DI:()=>g,Hp:()=>i,LT:()=>h,MZ:()=>r,Nl:()=>u,Nu:()=>n,OV:()=>f,Tx:()=>o,WN:()=>p,Ww:()=>v,YT:()=>l,ZL:()=>k,cD:()=>m,f7:()=>t,hF:()=>j,lB:()=>s,t:()=>q});var d=c(21820);function e(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let f={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},g={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},h={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},i={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},j={apiBaseUrl:"https://api2.qoder.sh",deviceTokenUrl:"https://api2.qoder.sh/api/v1/deviceToken/poll",deviceRefreshUrl:"https://api2.qoder.sh/api/v1/deviceToken/refresh",refreshUrl:"https://api2.qoder.sh/api/v3/user/refresh_token",userInfoUrl:"https://api2.qoder.sh/api/v1/userinfo",statusUrl:"https://api2.qoder.sh/api/v3/user/status",loginUrl:"https://qoder.com/login"},k={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},l={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:e(),pluginType:2})};function m(){return{ideType:9,platform:e(),pluginType:2}}let n={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},o={ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authMethods:["builder-id","idc","google","github","import"]},p={apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetDefaultModelNudgeData",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"},dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}},q={clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||"17e5f671-d194-4dfb-9706-5516cb48c098",deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token"},r={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},s={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},t={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},u={baseUrl:"https://copilot.tencent.com",stateUrl:"https://copilot.tencent.com/v2/plugin/auth/state",tokenUrl:"https://copilot.tencent.com/v2/plugin/auth/token",refreshUrl:"https://copilot.tencent.com/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",platform:"CLI",pollInterval:5e3},v=3e5}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=7828,exports.ids=[7828],exports.modules={38160:(a,b,c)=>{c.d(b,{Ou:()=>i,eG:()=>h});var d=c(75924);let e=new Map,f=new Map,g=null;async function h(a,b){if(!a||!b)return null;let c=e.get(a);if(c&&Date.now()-c.fetchedAt<36e5)return c.projectId;if(f.has(a))return f.get(a).promise;let d=new AbortController,g=(async()=>{try{let c=await j(b,d.signal);if(c)return e.set(a,{projectId:c,fetchedAt:Date.now()}),c;return console.warn("[ProjectId] could not fetch projectId for connection",a.slice(0,8)),null}catch(a){return console.warn(`[ProjectId] Error fetching project ID: ${a.message}`),null}finally{f.delete(a)}})();return f.set(a,{promise:g,controller:d,startedAt:Date.now()}),g}function i(a){e.delete(a)}async function j(a,b){let c=await fetch(d.nZ.loadCodeAssist,{method:"POST",headers:{...d.Ic,Authorization:`Bearer ${a}`},body:JSON.stringify({metadata:d.zv}),signal:b});if(!c.ok){let a=await c.text().catch(()=>"");throw Error(`loadCodeAssist failed: HTTP ${c.status} ${a.slice(0,200)}`)}let e=await c.json(),f=function(a){if(!a)return null;if("string"==typeof a.cloudaicompanionProject){let b=a.cloudaicompanionProject.trim();if(b)return b}if(a.cloudaicompanionProject&&"object"==typeof a.cloudaicompanionProject){let b=a.cloudaicompanionProject.id;if("string"==typeof b&&b.trim())return b.trim()}return null}(e);if(f)return f;let g="legacy-tier";if(Array.isArray(e.allowedTiers)){for(let a of e.allowedTiers)if(a&&"object"==typeof a&&!0===a.isDefault&&a.id&&"string"==typeof a.id&&a.id.trim()){g=a.id.trim();break}}return k(a,g,b)}async function k(a,b,c){console.log(`[ProjectId] Onboarding user with tier: ${b}`);let e={tierId:b,metadata:d.zv};for(let b=1;b<=5&&!c?.aborted;b++){let f=new AbortController,g=setTimeout(()=>f.abort(),3e4),h=()=>f.abort();c?.addEventListener("abort",h);try{let c=await fetch(d.nZ.onboardUser,{method:"POST",headers:{...d.Ic,Authorization:`Bearer ${a}`},body:JSON.stringify(e),signal:f.signal});if(clearTimeout(g),!c.ok){let a=await c.text().catch(()=>"");throw Error(`onboardUser HTTP ${c.status}: ${a.slice(0,200)}`)}let h=await c.json();if(!0===h.done){let a=function(a){if(!a?.response)return null;let b=a.response.cloudaicompanionProject;if("string"==typeof b){let a=b.trim();if(a)return a}if(b&&"object"==typeof b){let a=b.id;if("string"==typeof a&&a.trim())return a.trim()}return null}(h);if(a)return console.log(`[ProjectId] Successfully onboarded, project ID: ${a}`),a;throw Error("onboardUser done but no project_id in response")}console.log(`[ProjectId] Onboard attempt ${b}/5: not done yet, waiting...`),await new Promise(a=>setTimeout(a,2e3))}catch(a){if(clearTimeout(g),"AbortError"===a.name){if(console.warn(`[ProjectId] onboardUser attempt ${b} aborted (timeout or connection removed)`),c?.aborted)return null;continue}if(5===b)return console.warn(`[ProjectId] onboardUser failed after 5 attempts: ${a.message}`),null;console.warn(`[ProjectId] onboardUser attempt ${b} failed: ${a.message}, retrying...`),await new Promise(a=>setTimeout(a,2e3))}finally{clearTimeout(g),c?.removeEventListener("abort",h)}}return null}g=setInterval(()=>{try{let a=Date.now();for(let[b,c]of e)(!c||a-c.fetchedAt>=36e5)&&e.delete(b);for(let[b,c]of f){if(!c||"number"!=typeof c.startedAt){f.delete(b);continue}if(a-c.startedAt>12e4){try{c.controller.abort()}catch(a){}f.delete(b)}}}catch(a){console.warn("[ProjectId] cleanup sweep error:",a?.message??a)}},6e5),g?.unref?.()},67828:(a,b,c)=>{c.d(b,{
|
|
1
|
+
"use strict";exports.id=7828,exports.ids=[7828],exports.modules={7803:(a,b,c)=>{c.r(b),c.d(b,{debug:()=>f,error:()=>i,info:()=>g,maskKey:()=>m,request:()=>j,response:()=>k,stream:()=>l,warn:()=>h});function d(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}function e(a){if(!a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function f(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] đ [${a}] ${b}${f}`)}}function g(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] âšī¸ [${a}] ${b}${f}`)}}function h(a,b,c){c&&e(c)}function i(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] â [${a}] ${b}${f}`)}}function j(a,b,c){let f=c?` ${e(c)}`:"";console.log(`\x1b[36m[${d()}] đĨ ${a} ${b}${f}\x1b[0m`)}function k(a,b,c){let f=c?` ${e(c)}`:"";console.log(`[${d()}] ${a<400?"\uD83D\uDCE4":"\uD83D\uDCA5"} ${a} (${b}ms)${f}`)}function l(a,b){let c=b?` ${e(b)}`:"";console.log(`[${d()}] đ [STREAM] ${a}${c}`)}function m(a){return!a||a.length<8?"***":`${a.slice(0,4)}...${a.slice(-4)}`}},38160:(a,b,c)=>{c.d(b,{Ou:()=>i,eG:()=>h});var d=c(75924);let e=new Map,f=new Map,g=null;async function h(a,b){if(!a||!b)return null;let c=e.get(a);if(c&&Date.now()-c.fetchedAt<36e5)return c.projectId;if(f.has(a))return f.get(a).promise;let d=new AbortController,g=(async()=>{try{let c=await j(b,d.signal);if(c)return e.set(a,{projectId:c,fetchedAt:Date.now()}),c;return console.warn("[ProjectId] could not fetch projectId for connection",a.slice(0,8)),null}catch(a){return console.warn(`[ProjectId] Error fetching project ID: ${a.message}`),null}finally{f.delete(a)}})();return f.set(a,{promise:g,controller:d,startedAt:Date.now()}),g}function i(a){e.delete(a)}async function j(a,b){let c=await fetch(d.nZ.loadCodeAssist,{method:"POST",headers:{...d.Ic,Authorization:`Bearer ${a}`},body:JSON.stringify({metadata:d.zv}),signal:b});if(!c.ok){let a=await c.text().catch(()=>"");throw Error(`loadCodeAssist failed: HTTP ${c.status} ${a.slice(0,200)}`)}let e=await c.json(),f=function(a){if(!a)return null;if("string"==typeof a.cloudaicompanionProject){let b=a.cloudaicompanionProject.trim();if(b)return b}if(a.cloudaicompanionProject&&"object"==typeof a.cloudaicompanionProject){let b=a.cloudaicompanionProject.id;if("string"==typeof b&&b.trim())return b.trim()}return null}(e);if(f)return f;let g="legacy-tier";if(Array.isArray(e.allowedTiers)){for(let a of e.allowedTiers)if(a&&"object"==typeof a&&!0===a.isDefault&&a.id&&"string"==typeof a.id&&a.id.trim()){g=a.id.trim();break}}return k(a,g,b)}async function k(a,b,c){console.log(`[ProjectId] Onboarding user with tier: ${b}`);let e={tierId:b,metadata:d.zv};for(let b=1;b<=5&&!c?.aborted;b++){let f=new AbortController,g=setTimeout(()=>f.abort(),3e4),h=()=>f.abort();c?.addEventListener("abort",h);try{let c=await fetch(d.nZ.onboardUser,{method:"POST",headers:{...d.Ic,Authorization:`Bearer ${a}`},body:JSON.stringify(e),signal:f.signal});if(clearTimeout(g),!c.ok){let a=await c.text().catch(()=>"");throw Error(`onboardUser HTTP ${c.status}: ${a.slice(0,200)}`)}let h=await c.json();if(!0===h.done){let a=function(a){if(!a?.response)return null;let b=a.response.cloudaicompanionProject;if("string"==typeof b){let a=b.trim();if(a)return a}if(b&&"object"==typeof b){let a=b.id;if("string"==typeof a&&a.trim())return a.trim()}return null}(h);if(a)return console.log(`[ProjectId] Successfully onboarded, project ID: ${a}`),a;throw Error("onboardUser done but no project_id in response")}console.log(`[ProjectId] Onboard attempt ${b}/5: not done yet, waiting...`),await new Promise(a=>setTimeout(a,2e3))}catch(a){if(clearTimeout(g),"AbortError"===a.name){if(console.warn(`[ProjectId] onboardUser attempt ${b} aborted (timeout or connection removed)`),c?.aborted)return null;continue}if(5===b)return console.warn(`[ProjectId] onboardUser failed after 5 attempts: ${a.message}`),null;console.warn(`[ProjectId] onboardUser attempt ${b} failed: ${a.message}, retrying...`),await new Promise(a=>setTimeout(a,2e3))}finally{clearTimeout(g),c?.removeEventListener("abort",h)}}return null}g=setInterval(()=>{try{let a=Date.now();for(let[b,c]of e)(!c||a-c.fetchedAt>=36e5)&&e.delete(b);for(let[b,c]of f){if(!c||"number"!=typeof c.startedAt){f.delete(b);continue}if(a-c.startedAt>12e4){try{c.controller.abort()}catch(a){}f.delete(b)}}}catch(a){console.warn("[ProjectId] cleanup sweep error:",a?.message??a)}},6e5),g?.unref?.()},67828:(a,b,c)=>{c.d(b,{$B:()=>j,Vq:()=>i,eU:()=>n,jT:()=>k,vN:()=>m});var d=c(7803),e=c(89718),f=c(38160),g=c(8590);let h=g.oD,i=(a,b,c={})=>(0,g.Vq)(a,b,d,c),j=(a,b)=>(0,g.$B)(a,b,d),k=g.jT;function l(a){return new Date(Date.now()+1e3*a).toISOString()}async function m(a,b){try{let c={};b.accessToken&&(c.accessToken=b.accessToken),b.refreshToken&&(c.refreshToken=b.refreshToken),b.expiresIn&&(c.expiresAt=l(b.expiresIn),c.expiresIn=b.expiresIn),b.expiresAt&&(c.expiresAt=b.expiresAt),b.idToken&&(c.idToken=b.idToken);let f={...b.providerSpecificData||{}};if(b.copilotToken&&(f.copilotToken=b.copilotToken),b.copilotTokenExpiresAt&&(f.copilotTokenExpiresAt=b.copilotTokenExpiresAt),Object.keys(f).length>0){let d=b.existingProviderSpecificData?null:await (0,e.Mc)(a);c.providerSpecificData={...b.existingProviderSpecificData||d?.providerSpecificData||{},...f}}b.projectId&&(c.projectId=b.projectId),void 0!==b.testStatus&&(c.testStatus=b.testStatus);let g=await (0,e.updateProviderConnection)(a,c);return d.info("TOKEN_REFRESH","Credentials updated in localDb",{connectionId:a,success:!!g}),!!g}catch(b){return d.error("TOKEN_REFRESH","Error updating credentials in localDb",{connectionId:a,error:b.message}),!1}}async function n(a,b){let c={...b};if(c.expiresAt){let b=new Date(c.expiresAt).getTime()-Date.now(),e=(0,g.Og)(a);if(b<e){let h;d.info("TOKEN_REFRESH","Token expiring soon, refreshing proactively",{provider:a,expiresIn:Math.round(b/1e3),refreshLeadMs:e});let i=await (h=c,(0,g.iD)(a,h,d));if(i?.accessToken){let b={...i,existingProviderSpecificData:c.providerSpecificData};await m(c.connectionId,b),function(a,b,c){("antigravity"===a||"gemini-cli"===a)&&b&&c&&((0,f.Ou)(b),(0,f.eG)(b,c).then(a=>{a&&m(b,{projectId:a}).catch(a=>{d.debug("TOKEN_REFRESH","Failed to persist refreshed projectId",{connectionId:b,error:a?.message??a})})}).catch(a=>{d.debug("TOKEN_REFRESH","Failed to fetch projectId after token refresh",{connectionId:b,error:a?.message??a})}))}(a,(c={...c,accessToken:i.accessToken,refreshToken:i.refreshToken??c.refreshToken,providerSpecificData:i.providerSpecificData?{...c.providerSpecificData,...i.providerSpecificData}:c.providerSpecificData,copilotToken:i.copilotToken??i.providerSpecificData?.copilotToken??c.copilotToken,copilotTokenExpiresAt:i.copilotTokenExpiresAt??i.providerSpecificData?.copilotTokenExpiresAt??c.copilotTokenExpiresAt,expiresAt:i.expiresIn?l(i.expiresIn):c.expiresAt}).connectionId,c.accessToken)}}}if("github"===a&&c.providerSpecificData?.copilotTokenExpiresAt){let b=1e3*c.providerSpecificData.copilotTokenExpiresAt-Date.now();if(b<h){let e;d.info("TOKEN_REFRESH","Copilot token expiring soon, refreshing proactively",{provider:a,expiresIn:Math.round(b/1e3)});let f=await (e=c.accessToken,(0,g.jR)(e,d));if(f){let a={...c.providerSpecificData,copilotToken:f.token,copilotTokenExpiresAt:f.expiresAt};await m(c.connectionId,{providerSpecificData:a}),c.providerSpecificData=a,c.copilotToken=f.token}}}return c}}};
|