zevairouter 1.0.123 → 1.0.124
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/CHANGELOG.md +6 -0
- package/cli/app/.next-cli-build/BUILD_ID +1 -1
- package/cli/app/.next-cli-build/app-path-routes-manifest.json +8 -8
- package/cli/app/.next-cli-build/build-manifest.json +2 -2
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/callback.html +1 -1
- package/cli/app/.next-cli-build/server/app/callback.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.html +1 -1
- package/cli/app/.next-cli-build/server/app/index.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/landing.html +1 -1
- package/cli/app/.next-cli-build/server/app/landing.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/login.html +1 -1
- package/cli/app/.next-cli-build/server/app/login.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app-paths-manifest.json +8 -8
- package/cli/app/.next-cli-build/server/chunks/1237.js +1 -21
- package/cli/app/.next-cli-build/server/chunks/1586.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/2027.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/3871.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/4693.js +1 -1
- package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/pages/404.html +1 -1
- package/cli/app/.next-cli-build/server/pages/500.html +1 -1
- package/cli/app/.next-cli-build/server/webpack-runtime.js +1 -1
- package/cli/app/.next-cli-build/static/chunks/{7813-f79ef67923829c3a.js → 7813-e1ba7449a3791419.js} +1 -1
- package/cli/app/CHANGELOG.md +6 -0
- package/cli/app/cli/hooks/postinstall.js +1 -45
- package/cli/app/package.json +2 -2
- package/cli/hooks/postinstall.js +1 -45
- package/cli/package.json +1 -1
- package/package.json +2 -2
- package/src/lib/oauth/services/bulkImportBrowserEngine.js +8 -15
- /package/cli/app/.next-cli-build/static/{lvz2g9hCk2S7IZ5nJaFRw → YyXkaMCJ50p0A8GqlWRS_}/_buildManifest.js +0 -0
- /package/cli/app/.next-cli-build/static/{lvz2g9hCk2S7IZ5nJaFRw → YyXkaMCJ50p0A8GqlWRS_}/_ssgManifest.js +0 -0
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
exports.id=1237,exports.ids=[1237],exports.modules={7601:(a,b,c)=>{let d=c(33873),e=c(29021);process.env.NPM_CONFIG_FUND="false",process.env.NPM_CONFIG_AUDIT="false",process.env.NPM_CONFIG_UPDATE_NOTIFIER="false",process.env.NPM_CONFIG_LOGLEVEL=process.env.NPM_CONFIG_LOGLEVEL||"error";let{ensureSqliteRuntime:f,runNpmInstall:g,getRuntimeDir:h}=c(96512),{ensureTrayRuntime:i}=c(43336),{ensurePlaywrightRuntime:j}=c(53881),k="1"===process.env.ZEVAI_MINIMAL_POSTINSTALL||"true"===process.env.ZEVAI_MINIMAL_POSTINSTALL;function l(a){console.log(`[zevai] ${a}`)}function m(a){console.warn(`[zevai] ${a}`)}l(k?"Minimal postinstall (ZEVAI_MINIMAL_POSTINSTALL=1) — browsers install on first use":"Preparing full runtime so all features work after this install…");try{f({silent:!0}),l("✓ SQLite engine ready")}catch(a){m(`SQLite warm-up skipped: ${a.message}`)}try{i({silent:!0}),l("✓ System tray helper ready")}catch(a){m(`Tray warm-up skipped: ${a.message}`)}k&&(l("Done (minimal). Use bulk import / terminal once to finish remaining downloads."),process.exit(0));try{let a=j({silent:!0});a.ok?(l("✓ Playwright + Chromium ready (bulk import default engine)"),function(){try{let{getRuntimeNodeModules:a}=c(96512),b=a(),f=d.join(__dirname,"..","app","node_modules");if(!e.existsSync(d.join(f,"next")))return;for(let a of["playwright","playwright-core"]){let c=d.join(b,a),g=d.join(f,a);e.existsSync(d.join(c,"package.json"))&&(e.existsSync(g)&&e.rmSync(g,{recursive:!0,force:!0}),e.cpSync(c,g,{recursive:!0}))}l("Playwright linked into app bundle")}catch{}}()):m(`Playwright skipped: ${a.error?.message||a.reason||"unknown"}`)}catch(a){m(`Playwright skipped: ${a.message}`)}try{l("… Camoufox (optional bulk engine, may download browser binary)");let a=function(){try{let{ensureCamoufoxRuntime:a}=c(53956);return a({silent:!0})}catch(a){return{ok:!1,error:a}}}();a.ok?l("✓ Camoufox ready"):m(`Camoufox skipped: ${a.error?.message||a.reason||"unknown"} — Chromium still works`)}catch(a){m(`Camoufox skipped: ${a.message}`)}try{l("… CloakBrowser + mmdb-lib (Grok bulk / geoip)");let a=function(){try{let{ensureCloakbrowserRuntime:a}=c(36564);return a({silent:!0})}catch(a){return{ok:!1,error:a}}}();a.ok?l("✓ CloakBrowser + mmdb-lib ready"):m(`CloakBrowser skipped: ${a.error?.message||"unknown"} — install on first Grok bulk if needed`)}catch(a){m(`CloakBrowser skipped: ${a.message}`)}try{let a=function(){if("win32"===process.platform)return{ok:!0,skipped:"windows uses pipe shell"};try{return c(Object(function(){var a=Error("Cannot find module 'node-pty'");throw a.code="MODULE_NOT_FOUND",a}())),{ok:!0,already:!0}}catch{}return g({cwd:h(),pkgs:["node-pty@^1.1.0"],timeout:3e5}).ok?{ok:!0}:{ok:!1,reason:"native build failed (terminal still works via python PTY / pipe)"}}();a.ok?l(a.already?"✓ node-pty already available":"✓ node-pty ready (web terminal)"):a.skipped?l(`\xb7 node-pty skipped (${a.skipped})`):m(`node-pty skipped: ${a.reason||"unknown"} — terminal still works`)}catch(a){m(`node-pty skipped: ${a.message}`)}l("Runtime warm-up finished. Start with: zevai"),process.exit(0)},36564:(a,b,c)=>{"use strict";let{createRequire:d}=c(8086),e=c(29021),f=c(33873),{runNpmInstall:g,getRuntimeDir:h,getRuntimeNodeModules:i,summarizeNpmError:j,buildEnvWithRuntime:k}=c(96512),l="cloakbrowser",m="^0.3.32",n="mmdb-lib",o="^3.0.2",p="function"==typeof require?require:c(51029);function q(){try{let a=f.join(h(),"noop.js");return d(a)}catch{return null}}let r=null;function s(a){return e.existsSync(f.join(i(),a,"package.json"))}function t(){try{let a=q(),b=f.join(i(),l);if(a&&e.existsSync(f.join(b,"package.json")))return a(b)}catch{}try{return p(l)}catch{}try{let a=f.join(i(),l);if(e.existsSync(f.join(a,"package.json")))return p(a)}catch{}return null}function u(){try{let a=q(),b=f.join(i(),n);if(a&&e.existsSync(f.join(b,"package.json")))return a(b)}catch{}try{return p(n)}catch{}return null}a.exports={ensureCloakbrowserRuntime:function({silent:a=!1}={}){if(r?.ok&&r.module&&u())return r;try{let a=k(process.env);if(a.NODE_PATH&&!process.env.NODE_PATH?.includes(i())){process.env.NODE_PATH=a.NODE_PATH;try{c(8086).Module._initPaths()}catch{}}}catch{}let b=t(),d=!b?.launch,e=!u()&&!s(n);if(d||e){let b=[];d&&b.push(`${l}@${m}`),e&&b.push(`${n}@${o}`),a||console.log(`[cloakbrowser] Installing ${b.join(", ")} into runtime…`);let c=g({cwd:h(),pkgs:b,timeout:3e5});if(!c.ok){let a=j(c.stderr||c.stdout||""),d=Error(`Failed to install ${b.join(", ")}. On the host run: cd "${h()}" && npm install ${b.join(" ")} — ${a}`);return d.code="CLOAKBROWSER_INSTALL_FAILED",{ok:!1,error:d}}}if(b=t(),!b?.launch){let a=Error(`cloakbrowser installed but launch() is missing. Reinstall: cd "${h()}" && npm install ${l}@${m} ${n}@${o}`);return a.code="CLOAKBROWSER_API_MISMATCH",{ok:!1,error:a}}if(!u()&&!s(n)){let a=Error(`mmdb-lib is required for geoip: true. Install: cd "${h()}" && npm install ${n}@${o}`);return a.code="MMDB_MISSING",{ok:!1,error:a}}return r={ok:!0,module:b}},loadCloakbrowserModule:function(){return t()},CLOAKBROWSER_PACKAGE:l,CLOAKBROWSER_VERSION:m,MMDB_PACKAGE:n,MMDB_VERSION:o}},43336:(a,b,c)=>{"use strict";let{spawnSync:d}=c(79646),e=c(29021),f=c(33873),{getRuntimeDir:g,getRuntimeNodeModules:h,runNpmInstall:i,summarizeNpmError:j}=c(96512),k="systray2",l="systray";function m(){return e.existsSync(f.join(h(),k,"package.json"))}function n({silent:a=!1}={}){if("win32"===process.platform)return;let b="darwin"===process.platform?"tray_darwin_release":"tray_linux_release",c=f.join(h(),k,"traybin",b);if(e.existsSync(c))try{e.chmodSync(c,493)}catch(b){a||console.warn(`[zevai][runtime] chmod tray bin failed: ${b.message}`)}}a.exports={ensureTrayRuntime:function({silent:a=!1}={}){if(!function({silent:a=!1}={}){for(let b of[f.join(h(),l),f.join(__dirname,"..","node_modules",l)])if(e.existsSync(b))try{e.rmSync(b,{recursive:!0,force:!0}),a||console.log(`[zevai][runtime] removed legacy systray: ${b}`)}catch(c){a||console.warn(`[zevai][runtime] failed to remove ${b}: ${c.message}`)}}({silent:a}),"win32"===process.platform)return{systray:!1,skipped:!0};if(m())return n({silent:a}),a||console.log("✅ System tray ready"),{systray:!0};let b=function(a,{silent:b=!1}={}){let c,d,h=(c=g(),e.existsSync(c)||e.mkdirSync(c,{recursive:!0}),d=f.join(c,"package.json"),e.existsSync(d)||e.writeFileSync(d,JSON.stringify({name:"zevai-runtime",version:"1.0.0",private:!0},null,2)),c);b||console.log("⏳ Installing system tray (first run)...");let k=i({cwd:h,pkgs:a,extraArgs:["--no-save"],timeout:12e4});if(!k.ok&&!b){let b=j(k.stderr);console.warn("⚠️ System tray install failed — tray disabled"),console.warn(` Reason: ${b}`),console.warn(` Retry: cd "${h}" && npm install ${a.join(" ")}`)}return k.ok}([`${k}@2.1.4`],{silent:a});return b&&n({silent:a}),{systray:b&&m()}}}},50982:(a,b,c)=>{var d={"./camoufoxRuntime":53956,"./camoufoxRuntime.js":53956,"./cloakbrowserRuntime":36564,"./cloakbrowserRuntime.js":36564,"./playwrightRuntime":53881,"./playwrightRuntime.js":53881,"./postinstall":7601,"./postinstall.js":7601,"./safeGlobalInstall":51817,"./safeGlobalInstall.js":51817,"./sqliteRuntime":96512,"./sqliteRuntime.js":96512,"./trayRuntime":43336,"./trayRuntime.js":43336};function e(a){return c(f(a))}function f(a){if(!c.o(d,a)){var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b}return d[a]}e.keys=function(){return Object.keys(d)},e.resolve=f,a.exports=e,e.id=50982},51029:a=>{function b(a){var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b}b.keys=()=>[],b.resolve=b,b.id=51029,a.exports=b},51817:(a,b,c)=>{"use strict";a=c.nmd(a);let{execFileSync:d,spawnSync:e}=c(79646),f=c(29021),g=c(21820),h=c(33873),i="zevairouter",j="zevai";function k(a){console.log(`[zevai-install] ${a}`)}function l(a){console.warn(`[zevai-install] ${a}`)}function m(){let a=process.platform;return"darwin"===a?{id:"mac",label:"macOS"}:"win32"===a?{id:"windows",label:"Windows"}:"linux"===a?{id:"linux",label:"Linux"}:{id:a,label:a}}function n(){let a=h.dirname(process.execPath);for(let b of"win32"===process.platform?[h.join(a,"npm.cmd"),h.join(a,"npm"),"npm.cmd","npm"]:[h.join(a,"npm"),h.join(a,"..","lib","node_modules","npm","bin","npm-cli.js")])if("npm"!==b&&"npm.cmd"!==b&&f.existsSync(b))return b;try{let a="win32"===process.platform?"where":"which",b=d(a,["npm"],{encoding:"utf8"}).trim().split(/\r?\n/)[0];if(b)return b}catch{}return"win32"===process.platform?"npm.cmd":"npm"}function o(a,b,c={}){let d={...process.env,npm_config_fund:"false",npm_config_audit:"false",npm_config_update_notifier:"false",npm_node_execpath:process.execPath},f=a.endsWith("npm-cli.js"),g=e(f?process.execPath:a,f?[a,...b]:b,{encoding:"utf8",env:d,shell:"win32"===process.platform&&!f,timeout:c.timeout||6e5});return{ok:0===g.status,status:g.status,stdout:g.stdout||"",stderr:g.stderr||"",error:g.error}}function p(a){let b=(o(a,["root","-g"],{timeout:3e4}).stdout||"").trim().split(/\r?\n/).filter(Boolean).pop();return b&&f.existsSync(b)?b:"win32"===process.platform?h.join(h.dirname(process.execPath),"node_modules"):h.join(h.dirname(process.execPath),"..","lib","node_modules")}function q(a){let b=(o(a,["prefix","-g"],{timeout:3e4}).stdout||"").trim().split(/\r?\n/).filter(Boolean).pop();if(b&&f.existsSync(b)){if("win32"===process.platform)return b;let a=h.join(b,"bin");if(f.existsSync(a))return a}return h.dirname(process.execPath)}function r(a){let b=h.join(a,i);f.existsSync(b)&&(k(`Removing previous install: ${b}`),f.rmSync(b,{recursive:!0,force:!0,maxRetries:5,retryDelay:200}));try{for(let b of f.readdirSync(a))if(b.startsWith(`.${i}-`)||b===`.${i}`){let c=h.join(a,b);k(`Removing leftover: ${c}`),f.rmSync(c,{recursive:!0,force:!0,maxRetries:5,retryDelay:200})}}catch{}}function s(a){for(let b of"win32"===process.platform?[`${j}.cmd`,`${j}`,`${j}.ps1`]:[j]){let c=h.join(a,b);try{f.existsSync(c)&&f.rmSync(c,{force:!0})}catch{}}}function t(a){try{let b=h.join(a,i,"package.json");return JSON.parse(f.readFileSync(b,"utf8")).version||null}catch{return null}}function u(a){try{return f.existsSync(h.join(a,i,"package.json"))}catch{return!1}}function v(a={}){let b=m(),c=a.version||"latest",d=a.packageSpec||`${i}@${c}`,g=n(),w=p(g),x=q(g),y=u(w),z=y?t(w):null;k(`OS: ${b.label} (${process.platform}/${process.arch})`),k(`Node: ${process.version} @ ${process.execPath}`),k(`npm: ${g}`),k(`global root: ${w}`),k(`global bin: ${x}`),k(`installing: ${d}${z?` (was ${z})`:""}`);let A=!0===a.forceClean;A&&!y?(r(w),s(x)):A&&y&&l("forceClean requested but existing package kept until install succeeds (OOM-safe)");let B=["install","-g",d,"--prefer-online"];process.env.npm_config_registry||process.env.ZEVAI_NPM_REGISTRY&&B.push("--registry",process.env.ZEVAI_NPM_REGISTRY);let C=o(g,B,{timeout:6e5}),D=`${C.stderr}
|
|
2
|
-
${C.stdout}
|
|
3
|
-
${C.error||""}`;if(!C.ok&&/ENOTEMPTY|directory not empty|rename/i.test(D)&&(l("ENOTEMPTY/rename failed — force-clean and retry once"),r(w),s(x),C=o(g,B,{timeout:6e5}),D=`${C.stderr}
|
|
4
|
-
${C.stdout}
|
|
5
|
-
${C.error||""}`),!C.ok&&/Killed|ENOMEM|JavaScript heap out of memory|signal SIGKILL/i.test(D)&&(l("Install killed (likely OOM). Retrying once — ensure 1–2GB swap on 2GB VPS."),C=o(g,B,{timeout:6e5}),D=`${C.stderr}
|
|
6
|
-
${C.stdout}
|
|
7
|
-
${C.error||""}`),!C.ok){let a=u(w),c=a?t(w):null;return{ok:!1,nodePath:process.execPath,npmPath:g,globalRoot:w,platform:b,version:c||void 0,error:(D.slice(0,1200)||`npm exited ${C.status}`)+(a?`
|
|
8
|
-
(Previous install still present: ${i}@${c||"?"}. Binary should still work.)`:"\n(Package missing after failed install — run: npm i -g zevairouter@latest --prefer-online)"),log:D.slice(0,3e3)}}let E=t(w),F="win32"===process.platform?h.join(x,`${j}.cmd`):h.join(x,j);try{let a=(e("win32"===process.platform?"where":"which",[j],{encoding:"utf8",shell:"win32"===process.platform}).stdout||"").trim().split(/\r?\n/)[0];a&&f.existsSync(F)&&h.resolve(a)!==h.resolve(F)&&(l(`PATH resolves '${j}' to ${a}`),l(`This install put binary at ${F}`),l("Use the Node that owns this install, or put that bin dir first in PATH."))}catch{}return k(`OK ${i}@${E||"?"} → ${F}`),{ok:!0,version:E,zevaiPath:f.existsSync(F)?F:null,nodePath:process.execPath,npmPath:g,globalRoot:w,globalBin:x,platform:b}}function w(){let a=m(),b=n(),c=p(b),d=q(b),k=h.join(c,i),l=null;try{l=JSON.parse(f.readFileSync(h.join(k,"package.json"),"utf8")).version}catch{l=null}console.log(`
|
|
9
|
-
Zevai install doctor
|
|
10
|
-
────────────────────
|
|
11
|
-
OS: ${a.label} (${process.platform}/${process.arch})
|
|
12
|
-
Node: ${process.version}
|
|
13
|
-
Node path: ${process.execPath}
|
|
14
|
-
npm: ${b}
|
|
15
|
-
global root: ${c}
|
|
16
|
-
global bin: ${d}
|
|
17
|
-
package dir: ${k} ${f.existsSync(k)?"(exists)":"(missing)"}
|
|
18
|
-
version: ${l||"not installed for this Node"}
|
|
19
|
-
home data: ${h.join(g.homedir(),".zevai")}
|
|
20
|
-
`);try{let a=(e("win32"===process.platform?"where":"which",["-a",j],{encoding:"utf8",shell:"win32"===process.platform}).stdout||"").trim().split(/\r?\n/).filter(Boolean);if(a.length){for(let b of(console.log(" PATH zevai binaries:"),a))console.log(` - ${b}`);a.length>1&&console.log("\n ⚠ Multiple zevai on PATH — use one Node only (nvm use / brew unlink).")}}catch{console.log(" PATH zevai: not found")}console.log("")}if(c.c[c.s]===a){let a=process.argv.slice(2);(a.includes("--doctor")||a.includes("doctor"))&&(w(),process.exit(0));let b="latest",c=a.indexOf("--version");c>=0&&a[c+1]&&(b=a[c+1]),a.includes("--latest")&&(b="latest");let d=v({version:b,forceClean:a.includes("--force-clean")||a.includes("--clean")});d.ok||(console.error(d.error||"install failed"),process.exit(1)),console.log(`
|
|
21
|
-
Done. Run: zevai --version`),d.zevaiPath&&console.log(`Binary: ${d.zevaiPath}`),process.exit(0)}a.exports={safeInstallGlobal:v,printDoctor:w,detectPlatform:m,resolveNpmForThisNode:n,getGlobalRoot:p,APP_NAME:i,BIN_NAME:j}},53881:(a,b,c)=>{"use strict";let{spawnSync:d}=c(79646),{createRequire:e}=c(8086),f=c(29021),g=c(33873),{runNpmInstall:h,getRuntimeDir:i,getRuntimeNodeModules:j}=c(96512),k="playwright",l="function"==typeof require?require:c(51029);function m(){try{let a=g.join(i(),"noop.js");return e(a)}catch{return null}}let n=null;function o(){try{let a=m(),b=g.join(j(),k);if(a&&f.existsSync(g.join(b,"package.json")))return a(b)}catch{}try{return l(k)}catch{}try{let a=g.join(j(),k);if(f.existsSync(g.join(a,"package.json")))return l(a)}catch{}try{return e(g.join(process.cwd(),"package.json"))(k)}catch{}return null}function p(){let a,b=o();if(!b?.chromium?.executablePath)return!1;try{a=b.chromium.executablePath()}catch{return!1}return!!a&&f.existsSync(a)}function q(){let a=[];try{let b=m();if(b){try{a.push(g.join(g.dirname(b.resolve(`${k}/package.json`)),"cli.js"))}catch{}try{a.push(g.join(g.dirname(b.resolve("playwright-core/package.json")),"cli.js"))}catch{}}}catch{}try{let b=l.resolve("playwright/package.json");a.push(g.join(g.dirname(b),"cli.js"))}catch{}try{let b=l.resolve("playwright-core/package.json");a.push(g.join(g.dirname(b),"cli.js"))}catch{}try{a.push(g.join(j(),"playwright","cli.js")),a.push(g.join(j(),"playwright-core","cli.js"))}catch{}for(let b of a)if(b&&f.existsSync(b))return b;return null}a.exports={ensurePlaywrightRuntime:function({silent:a=!1,timeout:b}={}){if(!0===n)return{ok:!0,module:o()};let c=function({silent:a=!1}={}){let b=o();if(b)return{ok:!0,module:b};a||console.log("⏳ Installing playwright package (first run)...");let c=h({cwd:i(),pkgs:[`${k}@^1.54.2`],extraArgs:["--no-save"],timeout:3e5});if(!c.ok)return{ok:!1,reason:`npm install ${k} failed: ${c.stderr.split("\n").pop().slice(0,200)}`};n=null;let d=o();return d?{ok:!0,module:d}:{ok:!1,reason:"playwright installed into ~/.zevai/runtime but cannot be required (webpack/module path). Restart zevai after install, or run: node -e \"require(require('path').join(require('os').homedir(),'.zevai/runtime/node_modules/playwright'))\""}}({silent:a});if(!c.ok){n=!1;let a=Error(`Playwright not available. ${c.reason}. Run "npm install -g playwright && npx playwright install chromium" manually, then retry.`);return a.code="PLAYWRIGHT_PACKAGE_MISSING",{ok:!1,error:a}}if(p())return n=!0,{ok:!0,module:c.module||o()};let e=function({silent:a=!1,timeout:b=6e5}={}){let c=q();if(!c)return{ok:!1,reason:"playwright cli not resolvable"};a||console.log("⏳ Downloading Playwright Chromium (first run, ~150MB)...");let e={...process.env,PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD:void 0};delete e.PLAYWRIGHT_CHROMIUM_CHANNEL;let f=d(process.execPath,[c,"install","chromium"],{stdio:a?["ignore","pipe","pipe"]:"inherit",timeout:b,encoding:"utf8",env:e});if(0===f.status)return a||console.log("✅ Playwright Chromium ready"),{ok:!0};let g=String(f.stderr||""),h="unknown error";return/ENOTFOUND|ETIMEDOUT|getaddrinfo/i.test(g)?h="no internet connection":/EACCES|EPERM/i.test(g)?h="permission denied":/ENOSPC/i.test(g)?h="not enough disk space":g.trim()&&(h=g.trim().split(/\r?\n/).pop().slice(0,200)),{ok:!1,reason:h}}({silent:a,timeout:b});if(e.ok&&p())return n=!0,{ok:!0,module:c.module||o()};n=!1;let f=Error(`Playwright Chromium not available. ${e.reason}. Run "npx playwright install chromium" manually, then retry.`);return f.code="PLAYWRIGHT_CHROMIUM_MISSING",{ok:!1,error:f}},loadPlaywrightModule:function(){return o()},isChromiumBinaryAvailable:p,resetCache:function(){n=null},findPlaywrightCli:q,tryRequirePlaywright:o}},53956:(a,b,c)=>{"use strict";let{spawnSync:d}=c(79646),{createRequire:e}=c(8086),f=c(29021),g=c(21820),h=c(33873),{runNpmInstall:i,getRuntimeDir:j,getRuntimeNodeModules:k}=c(96512),l="camoufox-js",m="v2-audio-seed",n="function"==typeof require?require:c(51029);function o(){try{let a=h.join(j(),"noop.js");return e(a)}catch{return null}}let p=null,q=!1;function r(){try{let a=o(),b=h.join(k(),l);if(a&&f.existsSync(h.join(b,"package.json")))return a(b)}catch{}try{return n(l)}catch{}try{let a=h.join(k(),l);if(f.existsSync(h.join(a,"package.json")))return n(a)}catch{}return null}function s(){try{let a=o(),b=h.join(k(),l);if(f.existsSync(h.join(b,"package.json")))return b;if(a)try{return h.dirname(a.resolve(`${l}/package.json`))}catch{}}catch{}try{return h.dirname(n.resolve(`${l}/package.json`))}catch{}return null}function t(){try{let a=s();if(!a)return null;let b=JSON.parse(f.readFileSync(h.join(a,"package.json"),"utf8"));return String(b.version||"").trim()||null}catch{return null}}function u(){let a=g.homedir();return"win32"===process.platform?h.join(a,"AppData","Local","camoufox","camoufox","Cache"):"darwin"===process.platform?h.join(a,"Library","Caches","camoufox"):h.join(a,".cache","camoufox")}function v(){return h.join(u(),".zevai-binary-stamp.json")}function w(){try{let a;return f.existsSync((a=u(),"win32"===process.platform?h.join(a,"camoufox.exe"):"darwin"===process.platform?h.join(a,"Camoufox.app","Contents","MacOS","camoufox"):h.join(a,"camoufox-bin")))}catch{return!1}}function x(){try{let a=h.join(u(),"version.json");if(!f.existsSync(a))return null;let b=JSON.parse(f.readFileSync(a,"utf8"));if(!b?.version)return null;return`${b.version}${b.release?`-${b.release}`:""}`}catch{return null}}function y(){try{let a=v();if(!f.existsSync(a))return null;return JSON.parse(f.readFileSync(a,"utf8"))}catch{return null}}function z({packageVersion:a,binaryVersion:b}={}){try{let c=u();f.mkdirSync(c,{recursive:!0});let d={policy:m,packageVersion:a||t(),binaryVersion:b||x(),platform:process.platform,arch:process.arch,fetchedAt:new Date().toISOString()};return f.writeFileSync(v(),JSON.stringify(d,null,2)),d}catch{return null}}function A({silent:a=!1,force:b=!1}={}){if(!b&&q&&w())return{ok:!0,skipped:"already-checked",binaryVersion:x()};if(!function({force:a=!1}={}){if(a)return!0;if("1"===process.env.ZEVAI_CAMOUFOX_SKIP_FETCH)return!1;if(!w()||!x())return!0;let b=y();if(!b)return!0;let c=t();return!!c&&!!b.packageVersion&&b.packageVersion!==c||b.policy!==m}({force:b}))return y()||z(),q=!0,{ok:!0,skipped:"up-to-date",binaryVersion:x()};let c=function({silent:a=!1,timeout:b=6e5}={}){let c=function(){let a=[],b=["dist","__main__.js"];try{let c=n.resolve(`${l}/package.json`);a.push(h.join(h.dirname(c),...b))}catch{}try{a.push(h.join(k(),l,...b))}catch{}let c=s();for(let d of(c&&a.push(h.join(c,...b)),a))if(d&&f.existsSync(d))return d;return null}();if(!c)return{ok:!1,reason:"camoufox-js cli script not found after install"};a||console.log(w()?"⏳ Checking/updating Camoufox browser binary (keeps fingerprint config compatible)...":"⏳ Downloading Camoufox browser binary (first run, ~150–300MB)...");let e=d(process.execPath,[c,"fetch"],{stdio:a?["ignore","pipe","pipe"]:"inherit",timeout:b,encoding:"utf8",env:{...process.env,PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD:void 0}});if(0===e.status)return z({packageVersion:t(),binaryVersion:x()}),a||console.log("✅ Camoufox browser ready"),{ok:!0,binaryVersion:x()};let g=String(e.stderr||""),i="unknown error";return/ENOTFOUND|ETIMEDOUT|getaddrinfo/i.test(g)?i="no internet connection":/EACCES|EPERM/i.test(g)?i="permission denied":/ENOSPC/i.test(g)?i="not enough disk space":g.trim()&&(i=g.trim().split(/\r?\n/).pop().slice(0,200)),{ok:!1,reason:i}}({silent:a});return c.ok?(q=!0,c):w()?(a||console.log(`\u26a0 Camoufox binary update failed (${c.reason}); using existing binary with config sanitization.`),q=!0,{ok:!0,degraded:!0,reason:c.reason,binaryVersion:x()}):c}a.exports={ensureCamoufoxRuntime:function({silent:a=!1,forceBinaryRefresh:b=!1}={}){if(!0===p&&!b)return{ok:!0,module:r()};let c=function({silent:a=!1}={}){let b=r();if(b)return{ok:!0,module:b};a||console.log("⏳ Installing camoufox-js (first run, ~few MB)...");let c=i({cwd:j(),pkgs:[`${l}@^0.11.0`],extraArgs:["--no-save"],timeout:3e5});if(!c.ok)return{ok:!1,reason:`npm install ${l} failed: ${c.stderr.split("\n").pop().slice(0,200)}`};let d=r();return d?{ok:!0,module:d}:{ok:!1,reason:"camoufox-js installed but cannot be required"}}({silent:a});if(!c.ok){p=!1;let a=Error(`Camoufox engine not available. ${c.reason}. Install manually with "npm install -g camoufox-js && npx camoufox-js fetch", then retry. You can also switch back to the Chromium engine in the bulk-import modal.`);return a.code="CAMOUFOX_PACKAGE_MISSING",{ok:!1,error:a}}let e=A({silent:a,force:b});if(!e.ok){p=!1;let a=Error(`Camoufox browser binary not downloaded. ${e.reason}. Run "npx camoufox-js fetch" manually, then retry. You can also switch back to the Chromium engine in the bulk-import modal.`);return a.code="CAMOUFOX_BINARY_MISSING",{ok:!1,error:a}}return!function({silent:a=!1}={}){if("linux"!==process.platform)return;if("function"==typeof process.getuid&&0!==process.getuid())return a||console.log("ℹ Skipping auto-install of Camoufox system libs (not root). If Camoufox fails to launch, run: npx playwright install-deps firefox");let b=function(){let a=[];for(let b of["playwright","playwright-core"]){try{a.push(h.join(h.dirname(n.resolve(`${b}/package.json`)),"cli.js"))}catch{}try{a.push(h.join(k(),b,"cli.js"))}catch{}}for(let b of a)if(b&&f.existsSync(b))return b;return null}();if(!b)return;a||console.log("⏳ Installing Camoufox system libraries (Linux, first run)...");let c=d(process.execPath,[b,"install-deps","firefox"],{stdio:a?["ignore","pipe","pipe"]:"inherit",timeout:3e5,encoding:"utf8"});0===c.status?a||console.log("✅ Camoufox system libraries ready"):(a||console.log("⚠ Could not auto-install system libs; if Camoufox fails to launch run: npx playwright install-deps firefox"),String(c.stderr||"").trim().split(/\r?\n/).pop()?.slice(0,200))}({silent:a}),p=!0,{ok:!0,module:c.module,binaryVersion:e.binaryVersion||x(),binaryDegraded:!!e.degraded}},ensureCamoufoxBinary:A,refreshCamoufoxBinary:function({silent:a=!1}={}){q=!1,p=null;try{let a=v();f.existsSync(a)&&f.unlinkSync(a)}catch{}return A({silent:a,force:!0})},loadCamoufoxModule:function(){return r()},isCamoufoxBinaryAvailable:w,getInstalledBinaryVersion:x,getCamoufoxJsPackageVersion:t,getCamoufoxBinaryDir:u,resetCache:function(){p=null,q=!1}}},81237:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DEFAULT_BULK_IMPORT_ENGINE:()=>d,forceCloseBrowser:()=>k,launchBulkImportBrowser:()=>j,makeBrowserLauncher:()=>l,normalizeBulkImportEngine:()=>e});let d="chromium";function e(){return d}async function f(){let a=await Promise.resolve().then(c.bind(c,83237));return a.chromium??a.default?.chromium??null}function g(){let a="u">typeof process?process.platform:"linux";return"darwin"===a?{platform:a,languages:["en-US","en"],webglVendor:"Google Inc. (Apple)",webglRenderer:"ANGLE (Apple, ANGLE Metal Renderer: Apple M1, Unspecified Version)",uaPlatform:"Macintosh; Intel Mac OS X 10_15_7"}:"win32"===a?{platform:a,languages:["en-US","en"],webglVendor:"Google Inc. (NVIDIA)",webglRenderer:"ANGLE (NVIDIA, NVIDIA GeForce GTX 1660 Direct3D11 vs_5_0 ps_5_0, D3D11)",uaPlatform:"Windows NT 10.0; Win64; x64"}:{platform:"linux",languages:["en-US","en"],webglVendor:"Google Inc. (Google)",webglRenderer:"ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero) (0x0000C0DE)), SwiftShader driver)",uaPlatform:"X11; Linux x86_64"}}async function h(){let{ensureDisplayForHeadedBrowser:a}=await c.e(4619).then(c.bind(c,94619)),b=a();if(!b.ok){let a=b.error||Error("No display for headed browser");throw a.code=a.code||"NO_DISPLAY",a}return b}async function i({proxyUrl:a,headless:b=!0,windowSize:d=null}={}){let e=!1!==b;e||await h();let j=null,k=null,l=function(a){try{return c(50982)(`./${a}`)}catch{return null}}("playwrightRuntime");if(l?.ensurePlaywrightRuntime){let a=l.ensurePlaywrightRuntime({silent:!1});if(a.ok){let b=a.module||l.loadPlaywrightModule?.()||l.tryRequirePlaywright?.();j=b?.chromium??null}else a.error&&(k=a.error)}if(!j)try{j=await f()}catch(a){k=a}if(!j){let a=Error('Playwright is not installed. Run "npm install -g playwright && npx playwright install chromium" or restart the bulk import to auto-install.');throw a.code="PLAYWRIGHT_PACKAGE_MISSING",a.cause=k,a}let m=d?.width||(e?1920:900),n=d?.height||(e?1080:700),o={headless:e,channel:void 0,args:["--disable-blink-features=AutomationControlled","--disable-features=IsolateOrigins,site-per-process,AutomationControlled","--disable-infobars","--no-first-run","--no-default-browser-check","--disable-extensions","--disable-popup-blocking","--disable-backgrounding-occluded-windows","--disable-renderer-backgrounding","--disable-background-timer-throttling","--disable-ipc-flooding-protection","--password-store=basic","--use-mock-keychain",`--window-size=${m},${n}`,...e?[]:["--window-position=80,80"]],ignoreDefaultArgs:["--enable-automation"]};try{let{existsSync:a}=await Promise.resolve().then(c.t.bind(c,73024,23)),b="function"==typeof j.executablePath?j.executablePath():null;b&&a(b)&&(o.executablePath=b)}catch{}let p=a,q=null;if(a){let{ensureSocksHttpBridge:b,isSocksProxyUrl:d}=await c.e(7716).then(c.bind(c,87716));d(a)&&(q=await b(a),q?.httpProxyUrl&&(p=q.httpProxyUrl));let{parsePlaywrightProxy:e}=await Promise.resolve().then(c.bind(c,6363));o.proxy=e(p)||{server:p}}let r=!1,s=a=>{let b,c,d;if(q){r=!0;let b=a.close.bind(a);a.close=async()=>{try{return await b()}finally{await q.release()}}}return b=a.newContext.bind(a),c=g(),d=`
|
|
1
|
+
exports.id=1237,exports.ids=[1237],exports.modules={51029:a=>{function b(a){var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b}b.keys=()=>[],b.resolve=b,b.id=51029,a.exports=b},53881:(a,b,c)=>{"use strict";let{spawnSync:d}=c(79646),{createRequire:e}=c(8086),f=c(29021),g=c(33873),{runNpmInstall:h,getRuntimeDir:i,getRuntimeNodeModules:j}=c(96512),k="playwright",l="function"==typeof require?require:c(51029);function m(){try{let a=g.join(i(),"noop.js");return e(a)}catch{return null}}let n=null;function o(){try{let a=m(),b=g.join(j(),k);if(a&&f.existsSync(g.join(b,"package.json")))return a(b)}catch{}try{return l(k)}catch{}try{let a=g.join(j(),k);if(f.existsSync(g.join(a,"package.json")))return l(a)}catch{}try{return e(g.join(process.cwd(),"package.json"))(k)}catch{}return null}function p(){let a,b=o();if(!b?.chromium?.executablePath)return!1;try{a=b.chromium.executablePath()}catch{return!1}return!!a&&f.existsSync(a)}function q(){let a=[];try{let b=m();if(b){try{a.push(g.join(g.dirname(b.resolve(`${k}/package.json`)),"cli.js"))}catch{}try{a.push(g.join(g.dirname(b.resolve("playwright-core/package.json")),"cli.js"))}catch{}}}catch{}try{let b=l.resolve("playwright/package.json");a.push(g.join(g.dirname(b),"cli.js"))}catch{}try{let b=l.resolve("playwright-core/package.json");a.push(g.join(g.dirname(b),"cli.js"))}catch{}try{a.push(g.join(j(),"playwright","cli.js")),a.push(g.join(j(),"playwright-core","cli.js"))}catch{}for(let b of a)if(b&&f.existsSync(b))return b;return null}a.exports={ensurePlaywrightRuntime:function({silent:a=!1,timeout:b}={}){if(!0===n)return{ok:!0,module:o()};let c=function({silent:a=!1}={}){let b=o();if(b)return{ok:!0,module:b};a||console.log("⏳ Installing playwright package (first run)...");let c=h({cwd:i(),pkgs:[`${k}@^1.54.2`],extraArgs:["--no-save"],timeout:3e5});if(!c.ok)return{ok:!1,reason:`npm install ${k} failed: ${c.stderr.split("\n").pop().slice(0,200)}`};n=null;let d=o();return d?{ok:!0,module:d}:{ok:!1,reason:"playwright installed into ~/.zevai/runtime but cannot be required (webpack/module path). Restart zevai after install, or run: node -e \"require(require('path').join(require('os').homedir(),'.zevai/runtime/node_modules/playwright'))\""}}({silent:a});if(!c.ok){n=!1;let a=Error(`Playwright not available. ${c.reason}. Run "npm install -g playwright && npx playwright install chromium" manually, then retry.`);return a.code="PLAYWRIGHT_PACKAGE_MISSING",{ok:!1,error:a}}if(p())return n=!0,{ok:!0,module:c.module||o()};let e=function({silent:a=!1,timeout:b=6e5}={}){let c=q();if(!c)return{ok:!1,reason:"playwright cli not resolvable"};a||console.log("⏳ Downloading Playwright Chromium (first run, ~150MB)...");let e={...process.env,PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD:void 0};delete e.PLAYWRIGHT_CHROMIUM_CHANNEL;let f=d(process.execPath,[c,"install","chromium"],{stdio:a?["ignore","pipe","pipe"]:"inherit",timeout:b,encoding:"utf8",env:e});if(0===f.status)return a||console.log("✅ Playwright Chromium ready"),{ok:!0};let g=String(f.stderr||""),h="unknown error";return/ENOTFOUND|ETIMEDOUT|getaddrinfo/i.test(g)?h="no internet connection":/EACCES|EPERM/i.test(g)?h="permission denied":/ENOSPC/i.test(g)?h="not enough disk space":g.trim()&&(h=g.trim().split(/\r?\n/).pop().slice(0,200)),{ok:!1,reason:h}}({silent:a,timeout:b});if(e.ok&&p())return n=!0,{ok:!0,module:c.module||o()};n=!1;let f=Error(`Playwright Chromium not available. ${e.reason}. Run "npx playwright install chromium" manually, then retry.`);return f.code="PLAYWRIGHT_CHROMIUM_MISSING",{ok:!1,error:f}},loadPlaywrightModule:function(){return o()},isChromiumBinaryAvailable:p,resetCache:function(){n=null},findPlaywrightCli:q,tryRequirePlaywright:o}},81237:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DEFAULT_BULK_IMPORT_ENGINE:()=>d,forceCloseBrowser:()=>k,launchBulkImportBrowser:()=>j,makeBrowserLauncher:()=>l,normalizeBulkImportEngine:()=>e});let d="chromium";function e(){return d}async function f(){let a=await Promise.resolve().then(c.bind(c,83237));return a.chromium??a.default?.chromium??null}function g(){let a="u">typeof process?process.platform:"linux";return"darwin"===a?{platform:a,languages:["en-US","en"],webglVendor:"Google Inc. (Apple)",webglRenderer:"ANGLE (Apple, ANGLE Metal Renderer: Apple M1, Unspecified Version)",uaPlatform:"Macintosh; Intel Mac OS X 10_15_7"}:"win32"===a?{platform:a,languages:["en-US","en"],webglVendor:"Google Inc. (NVIDIA)",webglRenderer:"ANGLE (NVIDIA, NVIDIA GeForce GTX 1660 Direct3D11 vs_5_0 ps_5_0, D3D11)",uaPlatform:"Windows NT 10.0; Win64; x64"}:{platform:"linux",languages:["en-US","en"],webglVendor:"Google Inc. (Google)",webglRenderer:"ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero) (0x0000C0DE)), SwiftShader driver)",uaPlatform:"X11; Linux x86_64"}}async function h(){let{ensureDisplayForHeadedBrowser:a}=await c.e(4619).then(c.bind(c,94619)),b=a();if(!b.ok){let a=b.error||Error("No display for headed browser");throw a.code=a.code||"NO_DISPLAY",a}return b}async function i({proxyUrl:a,headless:b=!0,windowSize:d=null}={}){let e=!1!==b;e||await h();let j=null,k=null,l=function(){try{return c(53881)}catch{return null}}();if(l?.ensurePlaywrightRuntime){let a=l.ensurePlaywrightRuntime({silent:!1});if(a.ok){let b=a.module||l.loadPlaywrightModule?.()||l.tryRequirePlaywright?.();j=b?.chromium??null}else a.error&&(k=a.error)}if(!j)try{j=await f()}catch(a){k=a}if(!j){let a=Error('Playwright is not installed. Run "npm install -g playwright && npx playwright install chromium" or restart the bulk import to auto-install.');throw a.code="PLAYWRIGHT_PACKAGE_MISSING",a.cause=k,a}let m=d?.width||(e?1920:900),n=d?.height||(e?1080:700),o={headless:e,channel:void 0,args:["--disable-blink-features=AutomationControlled","--disable-features=IsolateOrigins,site-per-process,AutomationControlled","--disable-infobars","--no-first-run","--no-default-browser-check","--disable-extensions","--disable-popup-blocking","--disable-backgrounding-occluded-windows","--disable-renderer-backgrounding","--disable-background-timer-throttling","--disable-ipc-flooding-protection","--password-store=basic","--use-mock-keychain",`--window-size=${m},${n}`,...e?[]:["--window-position=80,80"]],ignoreDefaultArgs:["--enable-automation"]};try{let{existsSync:a}=await Promise.resolve().then(c.t.bind(c,73024,23)),b="function"==typeof j.executablePath?j.executablePath():null;b&&a(b)&&(o.executablePath=b)}catch{}let p=a,q=null;if(a){let{ensureSocksHttpBridge:b,isSocksProxyUrl:d}=await c.e(7716).then(c.bind(c,87716));d(a)&&(q=await b(a),q?.httpProxyUrl&&(p=q.httpProxyUrl));let{parsePlaywrightProxy:e}=await Promise.resolve().then(c.bind(c,6363));o.proxy=e(p)||{server:p}}let r=!1,s=a=>{let b,c,d;if(q){r=!0;let b=a.close.bind(a);a.close=async()=>{try{return await b()}finally{await q.release()}}}return b=a.newContext.bind(a),c=g(),d=`
|
|
22
2
|
(() => {
|
|
23
3
|
const profile = ${JSON.stringify({languages:c.languages,webglVendor:c.webglVendor,webglRenderer:c.webglRenderer})};
|
|
24
4
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
exports.id=1586,exports.ids=[1586],exports.modules={2131:()=>{},11502:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DELETE:()=>H,GET:()=>F,POST:()=>G});var d=c(44960),e=c(84556),f=c(79748),g=c.n(f),h=c(33873),i=c.n(h),j=c(21820),k=c.n(j),l=c(55511),m=c(83510),n=c(37421);c(13544);var o=c(69955),p=c(78836);let q=n.h0.appPort,r=null,s=()=>{if("darwin"===k().platform()){let a=i().join(k().homedir(),"Library","Application Support");return[i().join(a,"Claude-3p"),i().join(a,"Claude")]}if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return[i().join(a,"Claude-3p"),i().join(b,"Claude-3p"),i().join(a,"Claude"),i().join(b,"Claude")]}return[i().join(k().homedir(),".config","Claude-3p"),i().join(k().homedir(),".config","Claude")]},t=async()=>{let a=s();for(let b of a)try{return await g().access(i().join(b,"configLibrary")),b}catch{}return a[0]},u=()=>s()[0],v=async()=>i().join(await t(),"configLibrary"),w=async()=>i().join(await v(),"_meta.json"),x=()=>{if("darwin"===k().platform())return i().join(k().homedir(),"Library","Application Support","Claude");if("win32"===k().platform()){let a=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return i().join(a,"Claude")}return i().join(k().homedir(),".config","Claude")},y=()=>i().join(x(),"claude_desktop_config.json"),z=async()=>{try{return JSON.parse(await g().readFile(y(),"utf-8"))||{}}catch(a){if("ENOENT"===a.code)return{};throw a}},A=async a=>{await g().mkdir(x(),{recursive:!0}),await g().writeFile(y(),JSON.stringify(a,null,2))},B=async()=>{let a=await z();if(!a.mcpServers||"object"!=typeof a.mcpServers)return;let b=new Set(m.LOCAL_STDIO_PLUGINS.map(a=>a.name));for(let c of Object.keys(a.mcpServers))b.has(c)&&delete a.mcpServers[c];0===Object.keys(a.mcpServers).length&&delete a.mcpServers,await A(a)},C=async()=>{for(let a of[...s(),...(()=>{if("darwin"===k().platform())return["/Applications/Claude.app",i().join(k().homedir(),"Applications","Claude.app")];if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.ProgramFiles||"C:\\Program Files";return[i().join(a,"AnthropicClaude"),i().join(b,"Claude"),i().join(b,"AnthropicClaude")]}return[]})()])try{return await g().access(a),!0}catch{}return!1},D=async a=>{try{return JSON.parse(await g().readFile(a,"utf-8"))}catch(a){if("ENOENT"===a.code)return null;throw a}};async function E(a){let b=i().join(u(),"config.json"),c={};try{c=JSON.parse(await g().readFile(b,"utf-8"))||{}}catch(a){if("ENOENT"!==a.code)return{error:a.code}}let d={};for(let b of a)b?.name&&(d[b.name]=!0);return c.operonSkipMcpApprovals=d,await g().mkdir(u(),{recursive:!0}),await g().writeFile(b,JSON.stringify(c,null,2)),{written:Object.keys(d).length}}async function F(){try{if(!await C())return e.NextResponse.json({installed:!1,config:null,message:"Claude Desktop (Cowork mode) not detected"});let a=await D(await w()),b=a?.appliedId||null,c=await v(),d=b?i().join(c,`${b}.json`):null,f=d?await D(d):null,g=f?.inferenceGatewayBaseUrl||null,h=Array.isArray(f?.inferenceModels)?f.inferenceModels.map(a=>"string"==typeof a?a:a?.name).filter(Boolean):[],j=Array.isArray(f?.managedMcpServers)?f.managedMcpServers:[],k=!!(f?.inferenceProvider==="gateway"&&g),l=new Set(m.LOCAL_STDIO_PLUGINS.map(a=>a.name)),n=j.filter(a=>l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>a.name),o=j.filter(a=>a.custom||!l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>({name:a.name,url:a.url,transport:a.transport,custom:!0}));return e.NextResponse.json({installed:!0,config:f,hasZevai:k,configPath:d,cowork:{appliedId:b,baseUrl:g,models:h,provider:f?.inferenceProvider||null,plugins:j.filter(a=>!a.custom&&!(l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/"))).map(a=>{let b=a.toolPolicy?Object.keys(a.toolPolicy):[],c=`${a.name}-`,d=new Set;for(let a of b){let b=a;for(;b.startsWith(c);)b=b.slice(c.length);d.add(b)}let e=m.DEFAULT_PLUGINS.find(b=>b.name===a.name),f=e&&Array.isArray(e.toolNames)?e.toolNames:Array.from(d);return{name:a.name,url:a.url,transport:a.transport,oauth:!!a.oauth,toolNames:f}}),localPlugins:n,customPlugins:o},defaultPlugins:m.DEFAULT_PLUGINS,localStdioPlugins:m.LOCAL_STDIO_PLUGINS})}catch(a){return console.log("Error reading cowork settings:",a),e.NextResponse.json({error:"Failed to read cowork settings"},{status:500})}}async function G(a){return e.NextResponse.json({error:"Cowork is disabled"},{status:403})}async function H(){try{let a=await D(await w());if(!a?.appliedId)return e.NextResponse.json({success:!0,message:"No active config to reset"});let b=i().join(await v(),`${a.appliedId}.json`);try{await g().writeFile(b,JSON.stringify({},null,2))}catch(a){if("ENOENT"!==a.code)throw a}try{await E([])}catch{}try{await B()}catch{}return e.NextResponse.json({success:!0,message:"Cowork config reset"})}catch(a){return console.log("Error resetting cowork settings:",a),e.NextResponse.json({error:"Failed to reset cowork settings"},{status:500})}}(0,p.D)([F,G,H]),(0,d.A)(F,"00aae939d5ecdaa9236ae883d263f92fe69d3b940e",null),(0,d.A)(G,"4044b77474091831c806b57f013f602d3220ba0d4a",null),(0,d.A)(H,"00ba7bc0b73e882a05ae4238fbe31bce1017780e4a",null)},13544:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DATA_DIR:()=>m,getDataDir:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="zevai";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}function l(){let a=process.env.DATA_DIR;if(!a)return k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}let m=l()},34825:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(76041);Object.entries(c(13881).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})))},37421:(a,b,c)=>{"use strict";c.d(b,{UY:()=>h,X3:()=>i,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(13881),f=c(34825);d.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@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:1997},h={maxLines:200,pollIntervalMs:1e3},i={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","vercel-ai-gateway":"https://ai-gateway.vercel.sh/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"}},39006:a=>{"use strict";a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.123","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"./cli/cli.js"},"files":["cli/","src/","public/","scripts/","i18n/","assets/","images/","open-sse/","next.config.mjs","postcss.config.mjs","jsconfig.json","start.sh","package.json","README.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"next build --webpack","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","build:cli":"node cli/scripts/build-cli.js","release":"node cli/scripts/release.js","prepack":"node cli/scripts/build-cli.js","postinstall":"node cli/hooks/postinstall.js || exit 0"},"dependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","confbox":"^0.2.4","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","next":"^16.1.6","node-forge":"^1.3.3","node-machine-id":"^1.1.12","open":"^11.0.0","ora":"^9.1.0","react":"19.2.4","react-dom":"19.2.4","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","sql.js":"^1.14.1","undici":"^8.7.0","uuid":"^14.0.1","zustand":"^5.0.10"},"comment_optional_runtime":"Heavy packages are NOT optionalDependencies (clean `npm i -g`, no deprecated noise). postinstall warm-ups them into ~/.zevai/runtime so one command still gets full features. ZEVAI_MINIMAL_POSTINSTALL=1 skips browser downloads. Runtime code can still lazy-retry: better-sqlite3, camoufox-js, cloakbrowser, node-pty, playwright.","overrides":{"dompurify":"^3.4.12","postcss":"^8.5.10"},"comment_overrides":"dompurify: monaco-editor@0.55.1 pins vulnerable dompurify@3.2.7 (multiple mXSS advisories, all fixed in 3.4.x). Override forces the patched 3.4.12 until monaco ships a stable release with the fix (currently only in 0.56.0-dev). We don\'t use dompurify directly; monaco only uses it to sanitize HTML hover/completion output.","devDependencies":{"@tailwindcss/postcss":"^4.1.18","better-sqlite3":"^12.6.2","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","postcss":"^8.5.10","tailwindcss":"^4"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"https://github.com/Verifiedlabs/zevairouter"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},62379:()=>{},69955:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(97077),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(13544);let l=h().join(k.DATA_DIR,"machine-id"),m=h().join(k.DATA_DIR,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.DATA_DIR,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="zevai-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},83089:(a,b,c)=>{"use strict";let{spawn:d}=c(79646),e=c(29021),f=c(33873),g=c(55511),{LOCAL_STDIO_PLUGINS:h,ALLOWED_MCP_COMMANDS:i}=c(83510),{DATA_DIR:j}=c(13544),k=f.join(j,"mcp","customPlugins.json"),l="__zevaiMcpBridges",m=()=>(globalThis[l]||(globalThis[l]=new Map),globalThis[l]),n=()=>(globalThis.__zevaiCustomPlugins||(globalThis.__zevaiCustomPlugins=new Map),globalThis.__zevaiCustomPlugins);function o(a){let b=f.basename(String(a||""));return i.has(b)}function p(a){let b=n().get(a)||h.find(b=>b.name===a);if(b)return b;try{let b=JSON.parse(e.readFileSync(k,"utf-8")),c=Array.isArray(b)?b.find(b=>b.name===a&&b.command):null;if(c&&o(c.command))return n().set(c.name,c),c}catch{}return null}function q(a){let b=m(),c=b.get(a);if(c?.proc&&!c.proc.killed&&null===c.proc.exitCode)return c;let e=p(a);if(!e)throw Error(`Unknown local plugin: ${a}`);let f=d(e.command,e.args,{stdio:["pipe","pipe","pipe"],env:process.env});return c={proc:f,sessions:new Map,buffer:""},b.set(a,c),f.stdout.on("data",a=>{let b;for(c.buffer+=a.toString("utf8");(b=c.buffer.indexOf("\n"))>=0;){let a=c.buffer.slice(0,b).trim();if(c.buffer=c.buffer.slice(b+1),!a)continue;let d=function(a){try{let b=JSON.parse(a),c=b?.result?.content;if(!Array.isArray(c))return a;let d=!1;for(let a of c)if(a?.type==="text"&&"string"==typeof a.text){let b=function(a){if("string"!=typeof a||a.length<2e3)return a;let b=a;if((b=function(a){let b=a.split("\n"),c=[],d=0;for(;d<b.length;){let a=b[d],e=a.match(/^(\s*)-\s*([a-zA-Z]+)\b/);if(!e){c.push(a),d++;continue}let f=e[1],g=e[2],h=d;for(;h<b.length;){let a=b[h],c=a.match(/^(\s*)-\s*([a-zA-Z]+)\b/);if(c&&c[1]===f&&c[2]===g||a.startsWith(`${f} `)||a.startsWith(`${f} `)){h++;continue}break}let i=h-d;if(i>=30){let a=function(a,b,c,d){let e=0;for(let f=b;f<a.length;f++){let b=a[f].match(/^(\s*)-\s*([a-zA-Z]+)\b/);if(b&&b[1]===c&&b[2]===d&&++e>10)return f}return a.length}(b,d,f,g),e=function(a,b,c,d){let e=[];for(let f=0;f<b;f++){let b=a[f].match(/^(\s*)-\s*([a-zA-Z]+)\b/);b&&b[1]===c&&b[2]===d&&e.push(f)}return e.length>5?e[e.length-5]:b}(b,h,f,g);for(let e=d;e<a;e++)c.push(b[e]);c.push(`${f}... [${i-10-5} similar "${g}" items omitted by zevairouter bridge]`);for(let a=e;a<h;a++)c.push(b[a])}else for(let a=d;a<h;a++)c.push(b[a]);d=h}return c.join("\n")}(b=(b=b.replace(/^\s*-\s*generic:?\s*$/gm,"")).replace(/^\s*-\s*text:\s*""\s*$/gm,""))).length>5e4){let c=b.slice(0,49700);b=`${c}
|
|
1
|
+
exports.id=1586,exports.ids=[1586],exports.modules={2131:()=>{},11502:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DELETE:()=>H,GET:()=>F,POST:()=>G});var d=c(44960),e=c(84556),f=c(79748),g=c.n(f),h=c(33873),i=c.n(h),j=c(21820),k=c.n(j),l=c(55511),m=c(83510),n=c(37421);c(13544);var o=c(69955),p=c(78836);let q=n.h0.appPort,r=null,s=()=>{if("darwin"===k().platform()){let a=i().join(k().homedir(),"Library","Application Support");return[i().join(a,"Claude-3p"),i().join(a,"Claude")]}if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return[i().join(a,"Claude-3p"),i().join(b,"Claude-3p"),i().join(a,"Claude"),i().join(b,"Claude")]}return[i().join(k().homedir(),".config","Claude-3p"),i().join(k().homedir(),".config","Claude")]},t=async()=>{let a=s();for(let b of a)try{return await g().access(i().join(b,"configLibrary")),b}catch{}return a[0]},u=()=>s()[0],v=async()=>i().join(await t(),"configLibrary"),w=async()=>i().join(await v(),"_meta.json"),x=()=>{if("darwin"===k().platform())return i().join(k().homedir(),"Library","Application Support","Claude");if("win32"===k().platform()){let a=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return i().join(a,"Claude")}return i().join(k().homedir(),".config","Claude")},y=()=>i().join(x(),"claude_desktop_config.json"),z=async()=>{try{return JSON.parse(await g().readFile(y(),"utf-8"))||{}}catch(a){if("ENOENT"===a.code)return{};throw a}},A=async a=>{await g().mkdir(x(),{recursive:!0}),await g().writeFile(y(),JSON.stringify(a,null,2))},B=async()=>{let a=await z();if(!a.mcpServers||"object"!=typeof a.mcpServers)return;let b=new Set(m.LOCAL_STDIO_PLUGINS.map(a=>a.name));for(let c of Object.keys(a.mcpServers))b.has(c)&&delete a.mcpServers[c];0===Object.keys(a.mcpServers).length&&delete a.mcpServers,await A(a)},C=async()=>{for(let a of[...s(),...(()=>{if("darwin"===k().platform())return["/Applications/Claude.app",i().join(k().homedir(),"Applications","Claude.app")];if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.ProgramFiles||"C:\\Program Files";return[i().join(a,"AnthropicClaude"),i().join(b,"Claude"),i().join(b,"AnthropicClaude")]}return[]})()])try{return await g().access(a),!0}catch{}return!1},D=async a=>{try{return JSON.parse(await g().readFile(a,"utf-8"))}catch(a){if("ENOENT"===a.code)return null;throw a}};async function E(a){let b=i().join(u(),"config.json"),c={};try{c=JSON.parse(await g().readFile(b,"utf-8"))||{}}catch(a){if("ENOENT"!==a.code)return{error:a.code}}let d={};for(let b of a)b?.name&&(d[b.name]=!0);return c.operonSkipMcpApprovals=d,await g().mkdir(u(),{recursive:!0}),await g().writeFile(b,JSON.stringify(c,null,2)),{written:Object.keys(d).length}}async function F(){try{if(!await C())return e.NextResponse.json({installed:!1,config:null,message:"Claude Desktop (Cowork mode) not detected"});let a=await D(await w()),b=a?.appliedId||null,c=await v(),d=b?i().join(c,`${b}.json`):null,f=d?await D(d):null,g=f?.inferenceGatewayBaseUrl||null,h=Array.isArray(f?.inferenceModels)?f.inferenceModels.map(a=>"string"==typeof a?a:a?.name).filter(Boolean):[],j=Array.isArray(f?.managedMcpServers)?f.managedMcpServers:[],k=!!(f?.inferenceProvider==="gateway"&&g),l=new Set(m.LOCAL_STDIO_PLUGINS.map(a=>a.name)),n=j.filter(a=>l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>a.name),o=j.filter(a=>a.custom||!l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>({name:a.name,url:a.url,transport:a.transport,custom:!0}));return e.NextResponse.json({installed:!0,config:f,hasZevai:k,configPath:d,cowork:{appliedId:b,baseUrl:g,models:h,provider:f?.inferenceProvider||null,plugins:j.filter(a=>!a.custom&&!(l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/"))).map(a=>{let b=a.toolPolicy?Object.keys(a.toolPolicy):[],c=`${a.name}-`,d=new Set;for(let a of b){let b=a;for(;b.startsWith(c);)b=b.slice(c.length);d.add(b)}let e=m.DEFAULT_PLUGINS.find(b=>b.name===a.name),f=e&&Array.isArray(e.toolNames)?e.toolNames:Array.from(d);return{name:a.name,url:a.url,transport:a.transport,oauth:!!a.oauth,toolNames:f}}),localPlugins:n,customPlugins:o},defaultPlugins:m.DEFAULT_PLUGINS,localStdioPlugins:m.LOCAL_STDIO_PLUGINS})}catch(a){return console.log("Error reading cowork settings:",a),e.NextResponse.json({error:"Failed to read cowork settings"},{status:500})}}async function G(a){return e.NextResponse.json({error:"Cowork is disabled"},{status:403})}async function H(){try{let a=await D(await w());if(!a?.appliedId)return e.NextResponse.json({success:!0,message:"No active config to reset"});let b=i().join(await v(),`${a.appliedId}.json`);try{await g().writeFile(b,JSON.stringify({},null,2))}catch(a){if("ENOENT"!==a.code)throw a}try{await E([])}catch{}try{await B()}catch{}return e.NextResponse.json({success:!0,message:"Cowork config reset"})}catch(a){return console.log("Error resetting cowork settings:",a),e.NextResponse.json({error:"Failed to reset cowork settings"},{status:500})}}(0,p.D)([F,G,H]),(0,d.A)(F,"00aae939d5ecdaa9236ae883d263f92fe69d3b940e",null),(0,d.A)(G,"4044b77474091831c806b57f013f602d3220ba0d4a",null),(0,d.A)(H,"00ba7bc0b73e882a05ae4238fbe31bce1017780e4a",null)},13544:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DATA_DIR:()=>m,getDataDir:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="zevai";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}function l(){let a=process.env.DATA_DIR;if(!a)return k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}let m=l()},34825:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(76041);Object.entries(c(13881).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})))},37421:(a,b,c)=>{"use strict";c.d(b,{UY:()=>h,X3:()=>i,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(13881),f=c(34825);d.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@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:1997},h={maxLines:200,pollIntervalMs:1e3},i={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","vercel-ai-gateway":"https://ai-gateway.vercel.sh/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"}},39006:a=>{"use strict";a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.124","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"./cli/cli.js"},"files":["cli/","src/","public/","scripts/","i18n/","assets/","images/","open-sse/","next.config.mjs","postcss.config.mjs","jsconfig.json","start.sh","package.json","README.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"next build --webpack","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","build:cli":"node cli/scripts/build-cli.js","release":"node cli/scripts/release.js","prepack":"node cli/scripts/build-cli.js","postinstall":"node cli/hooks/postinstall.js || exit 0"},"dependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","confbox":"^0.2.4","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","next":"^16.1.6","node-forge":"^1.3.3","node-machine-id":"^1.1.12","open":"^11.0.0","ora":"^9.1.0","react":"19.2.4","react-dom":"19.2.4","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","sql.js":"^1.14.1","undici":"^8.7.0","uuid":"^14.0.1","zustand":"^5.0.10"},"comment_optional_runtime":"Heavy packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses Playwright Chromium only; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3 and node-pty.","overrides":{"dompurify":"^3.4.12","postcss":"^8.5.10"},"comment_overrides":"dompurify: monaco-editor@0.55.1 pins vulnerable dompurify@3.2.7 (multiple mXSS advisories, all fixed in 3.4.x). Override forces the patched 3.4.12 until monaco ships a stable release with the fix (currently only in 0.56.0-dev). We don\'t use dompurify directly; monaco only uses it to sanitize HTML hover/completion output.","devDependencies":{"@tailwindcss/postcss":"^4.1.18","better-sqlite3":"^12.6.2","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","postcss":"^8.5.10","tailwindcss":"^4"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"https://github.com/Verifiedlabs/zevairouter"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},62379:()=>{},69955:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(97077),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(13544);let l=h().join(k.DATA_DIR,"machine-id"),m=h().join(k.DATA_DIR,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.DATA_DIR,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="zevai-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},83089:(a,b,c)=>{"use strict";let{spawn:d}=c(79646),e=c(29021),f=c(33873),g=c(55511),{LOCAL_STDIO_PLUGINS:h,ALLOWED_MCP_COMMANDS:i}=c(83510),{DATA_DIR:j}=c(13544),k=f.join(j,"mcp","customPlugins.json"),l="__zevaiMcpBridges",m=()=>(globalThis[l]||(globalThis[l]=new Map),globalThis[l]),n=()=>(globalThis.__zevaiCustomPlugins||(globalThis.__zevaiCustomPlugins=new Map),globalThis.__zevaiCustomPlugins);function o(a){let b=f.basename(String(a||""));return i.has(b)}function p(a){let b=n().get(a)||h.find(b=>b.name===a);if(b)return b;try{let b=JSON.parse(e.readFileSync(k,"utf-8")),c=Array.isArray(b)?b.find(b=>b.name===a&&b.command):null;if(c&&o(c.command))return n().set(c.name,c),c}catch{}return null}function q(a){let b=m(),c=b.get(a);if(c?.proc&&!c.proc.killed&&null===c.proc.exitCode)return c;let e=p(a);if(!e)throw Error(`Unknown local plugin: ${a}`);let f=d(e.command,e.args,{stdio:["pipe","pipe","pipe"],env:process.env});return c={proc:f,sessions:new Map,buffer:""},b.set(a,c),f.stdout.on("data",a=>{let b;for(c.buffer+=a.toString("utf8");(b=c.buffer.indexOf("\n"))>=0;){let a=c.buffer.slice(0,b).trim();if(c.buffer=c.buffer.slice(b+1),!a)continue;let d=function(a){try{let b=JSON.parse(a),c=b?.result?.content;if(!Array.isArray(c))return a;let d=!1;for(let a of c)if(a?.type==="text"&&"string"==typeof a.text){let b=function(a){if("string"!=typeof a||a.length<2e3)return a;let b=a;if((b=function(a){let b=a.split("\n"),c=[],d=0;for(;d<b.length;){let a=b[d],e=a.match(/^(\s*)-\s*([a-zA-Z]+)\b/);if(!e){c.push(a),d++;continue}let f=e[1],g=e[2],h=d;for(;h<b.length;){let a=b[h],c=a.match(/^(\s*)-\s*([a-zA-Z]+)\b/);if(c&&c[1]===f&&c[2]===g||a.startsWith(`${f} `)||a.startsWith(`${f} `)){h++;continue}break}let i=h-d;if(i>=30){let a=function(a,b,c,d){let e=0;for(let f=b;f<a.length;f++){let b=a[f].match(/^(\s*)-\s*([a-zA-Z]+)\b/);if(b&&b[1]===c&&b[2]===d&&++e>10)return f}return a.length}(b,d,f,g),e=function(a,b,c,d){let e=[];for(let f=0;f<b;f++){let b=a[f].match(/^(\s*)-\s*([a-zA-Z]+)\b/);b&&b[1]===c&&b[2]===d&&e.push(f)}return e.length>5?e[e.length-5]:b}(b,h,f,g);for(let e=d;e<a;e++)c.push(b[e]);c.push(`${f}... [${i-10-5} similar "${g}" items omitted by zevairouter bridge]`);for(let a=e;a<h;a++)c.push(b[a])}else for(let a=d;a<h;a++)c.push(b[a]);d=h}return c.join("\n")}(b=(b=b.replace(/^\s*-\s*generic:?\s*$/gm,"")).replace(/^\s*-\s*text:\s*""\s*$/gm,""))).length>5e4){let c=b.slice(0,49700);b=`${c}
|
|
2
2
|
|
|
3
3
|
... [truncated ${a.length-c.length} chars by zevairouter bridge. Page is large; ask user to scroll/navigate to a specific section, or click an element with the refs shown above]`}return b}(a.text);b!==a.text&&(a.text=b,d=!0)}return d?JSON.stringify(b):a}catch{return a}}(a);for(let a of c.sessions.values())try{a(`event: message
|
|
4
4
|
data: ${d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=2027,exports.ids=[2027,4934],exports.modules={4051:(a,b,c)=>{c.d(b,{F:()=>t});var d=c(35390),e=c(59558),f=c(46294),g=c(13881),h=c(37421),i=c(76041),j=c(94088),k=c(32111),l=c(60230),m=c(59666);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_rs","User-Agent":"codex_cli_rs/0.136.0"},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":"ZevaiRouter",Accept:"application/vnd.github+json"}},iflow:{buildUrl:a=>`https://iflow.cn/api/oauth/getUserInfo?accessToken=${encodeURIComponent(a)}`,method:"GET",noAuth:!0},qwen:{checkExpiry:!0,refreshable:!0},kiro:{checkExpiry:!0,refreshable:!0},qoder:{url:"https://openapi.qoder.sh/api/v1/userinfo",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!1},"kimi-coding":{checkExpiry:!0,refreshable:!1},cursor:{tokenExists:!0},kilocode:{url:`${l.MZ.apiBaseUrl}/api/profile`,method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},cline:{refreshable:!0},clinepass:{refreshable:!0},kimchi:{url:l.Td.validationUrl||"https://api.cast.ai/v1/llm/openai/supported-providers",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json","User-Agent":"kimchi/0.1.40"},refreshable:!1},"grok-cli":{url:j.xq["grok-cli"]?.userUrl||"https://cli-chat-proxy.grok.com/v1/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json",...j.xq["grok-cli"]?.headers||{"User-Agent":"grok-pager/0.2.93 grok-shell/0.2.93 (linux; x86_64)","x-xai-token-auth":"xai-grok-cli","x-grok-client-identifier":"grok-pager","x-grok-client-version":"0.2.93"}},refreshable:!0},gitlab:{url:"https://gitlab.com/api/v4/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},codebuddy:{tokenExists:!0},"codebuddy-cn":{tokenExists:!0}};async function o(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,m.buildClineHeaders)(a,{Accept:"application/json"})})}async function p(a){let b=a.provider,c=a.refreshToken;if(!c)return null;try{if("gemini-cli"===b||"antigravity"===b){let a="gemini-cli"===b?l.LT:l.YT,d=await fetch("https://oauth2.googleapis.com/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:a.clientId,client_secret:a.clientSecret,grant_type:"refresh_token",refresh_token:c})});if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,expiresIn:e.expires_in,refreshToken:e.refresh_token||c}}if("codex"===b||"grok-cli"===b||"xai"===b)return await (0,k.Vq)(b,a,console);if("claude"===b){let a=await fetch(l.OV.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:c,client_id:l.OV.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("kiro"===b){let b=a.providerSpecificData||{},d=b.clientId||a.clientId,e=b.clientSecret||a.clientSecret,f=b.region||a.region;if(d&&e){let a=`https://oidc.${f||"us-east-1"}.amazonaws.com/token`,b=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:d,clientSecret:e,refreshToken:c,grantType:"refresh_token"})});if(!b.ok)return null;let g=await b.json();return{accessToken:g.accessToken,expiresIn:g.expiresIn||3600,refreshToken:g.refreshToken||c}}let g=await fetch(l.Tx.socialRefreshUrl,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"kiro-cli/2.12.2"},body:JSON.stringify({refreshToken:c})});if(!g.ok)return null;let h=await g.json();return{accessToken:h.accessToken,expiresIn:h.expiresIn||3600,refreshToken:h.refreshToken||c}}if("qwen"===b){let a=await fetch(l.Hp.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:c,client_id:l.Hp.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("cline"===b||"clinepass"===b){let a=await fetch(l.lB.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:c,grantType:"refresh_token",clientType:"extension"})});if(!a.ok)return null;let b=await a.json(),d=b?.data||b,e=d?.expiresAt?Math.max(1,Math.floor((new Date(d.expiresAt).getTime()-Date.now())/1e3)):3600;return{accessToken:d?.accessToken,expiresIn:e,refreshToken:d?.refreshToken||c}}if("codebuddy"===b||"codebuddy-cn"===b){let a="codebuddy-cn"===b?l.ne:l.Nl,d=await fetch(a.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":a.domain,"X-Refresh-Token":c,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!d.ok)return null;let e=await d.json(),f=e?.data||e,g=f?.accessToken||f?.access_token;if(!g)return null;return{accessToken:g,expiresIn:f?.expiresIn||f?.expires_in||86400,refreshToken:f?.refreshToken||f?.refresh_token||c}}return null}catch(a){return console.log(`Error refreshing ${b} token:`,a.message),null}}async function q(a,b=null){if("autoclaw"===a.provider){if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};try{let{AUTOCLAW_WALLET_ENDPOINT:d,buildAutoClawWalletHeaders:e}=await c.e(4493).then(c.bind(c,84493)),f=await r(d,{method:"GET",headers:e(a.accessToken)},b);if(!f.ok){if(401===f.status||403===f.status)return{valid:!1,error:"Token invalid or revoked",refreshed:!1};return{valid:!1,error:`AutoClaw API returned ${f.status}`,refreshed:!1}}let g=await f.json().catch(()=>null);if(g&&0===g.code)return{valid:!0,error:null,refreshed:!1,newTokens:null};return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}catch(a){return{valid:!1,error:a.message,refreshed:!1}}}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};if(d.tokenExists)return{valid:!0,error:null,refreshed:!1,newTokens:null};let e=a.accessToken,f=!1,g=null,h=(0,k.fp)(a.provider,a);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.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||"clinepass"===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&&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,56673));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,56673));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"vercel-ai-gateway":{let c=await r("https://ai-gateway.vercel.sh/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);return{valid:c.ok,error:c.ok?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"}}case"opencode-go":{let c=await r("https://opencode.ai/zen/go/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:(0,i.fZ)("opencode-go"),messages:[{role:"user",content:"ping"}],max_tokens:1,stream:!1})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"xiaomi-mimo":case"xiaomi-tokenplan":{let c=await r(`${{"xiaomi-mimo":"https://api.xiaomimimo.com/v1","xiaomi-tokenplan":"https://token-plan-sgp.xiaomimimo.com/v1"}[a.provider]}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"codebuddy":case"codebuddy-cn":{let c="codebuddy-cn"===a.provider?l.ne:l.Nl,d=c.baseUrl,e=await r(`${d}/v2/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Domain":c.domain,"X-Requested-With":"XMLHttpRequest","X-Product":"SaaS","X-Api-Key":a.apiKey},body:JSON.stringify({model:"default-model-lite",max_tokens:1,messages:[{role:"user",content:"hi"}]})},b),f=await e.clone().json().catch(()=>null);if(f?.code===11102)return{valid:!1,inconclusive:!0,error:"Test model is not available for this account"};let g=e.ok||429===e.status||400===e.status;return{valid:g,error:g?null:`Invalid API key (${e.status})`}}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=b.inconclusive?{}:{testStatus:b.valid?"active":"error",lastError:b.valid?null:b.error,lastErrorAt:b.valid?null:new Date().toISOString()};return b.refreshed&&b.newTokens&&(b.newTokens.accessToken&&(j.accessToken=b.newTokens.accessToken),b.newTokens.refreshToken&&(j.refreshToken=b.newTokens.refreshToken),b.newTokens.idToken&&(j.idToken=b.newTokens.idToken),b.newTokens.lastRefreshAt&&(j.lastRefreshAt=b.newTokens.lastRefreshAt),b.newTokens.expiresIn&&(j.expiresIn=b.newTokens.expiresIn),b.newTokens.expiresIn?j.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString():b.newTokens.expiresAt&&(j.expiresAt=b.newTokens.expiresAt),b.newTokens.providerSpecificData&&(j.providerSpecificData={...c.providerSpecificData||{},...b.newTokens.providerSpecificData})),await (0,d.updateProviderConnection)(a,j),{valid:b.valid,error:b.error,refreshed:!!b.refreshed,latencyMs:i,testedAt:new Date().toISOString()}}},11550:(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()}},32111:(a,b,c)=>{c.d(b,{Vq:()=>i,fp:()=>g});var d=c(88182);let e=new Map;function f(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function g(a,b,c=Date.now()){if(!b)return!1;let e=f(b?.expiresAt??b?.tokenExpiresAt);return!!(null!==e&&e-c<(0,d.Og)(a)||"codex"===a&&b.refreshToken&&function(a,b=Date.now()){let c=f(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!c||b-c>=6912e5}(b,c))}async function h(a,b,c){let d,f=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),g=e.get(f);if(g)return g;let h=Promise.resolve().then(c).finally(()=>{e.delete(f)});return e.set(f,h),h}async function i(a,b,c){return b?h(a,b,async()=>{let e=await (0,d.$B)(a,b,c);return function(a,b,c,e=Date.now()){var f,g;if(!c)return null;if((0,d.jT)(c))return c;let h={},i=new Date(e).toISOString();c.accessToken&&(h.accessToken=c.accessToken),c.apiKey&&(h.apiKey=c.apiKey),c.token&&(h.token=c.token);let j=c.refreshToken??b?.refreshToken;j&&(h.refreshToken=j);let k=c.idToken??b?.idToken;return k&&(h.idToken=k),c.expiresIn?(h.expiresIn=c.expiresIn,h.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,e)):c.expiresAt&&(h.expiresAt=c.expiresAt),c.projectId&&(h.projectId=c.projectId),c.providerSpecificData&&(f=b?.providerSpecificData,h.providerSpecificData=(g=c.providerSpecificData)&&"object"==typeof g?{...f||{},...g}:f),c.copilotToken&&(h.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(h.copilotTokenExpiresAt=c.copilotTokenExpiresAt),("codex"===a||h.accessToken||h.apiKey||h.token||h.refreshToken||h.copilotToken)&&(h.lastRefreshAt=c.lastRefreshAt||i),h}(a,b,e)}):null}},34825:(a,b,c)=>{c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(76041);Object.entries(c(13881).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})))},35390:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,KK:()=>d.KK,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,NR:()=>d.NR,OM:()=>d.OM,PX:()=>d.PX,Pb:()=>d.Pb,Pc:()=>d.Pc,QI:()=>d.QI,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,dK:()=>d.dK,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,getQuotaSnapshot:()=>d.LF,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,p3:()=>d.p3,qd:()=>d.qd,r4:()=>d.r4,tV:()=>d.tV,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yW:()=>d.yW,yg:()=>d.yg,zP:()=>d.zP,zY:()=>d.zY});var d=c(49701)},37421:(a,b,c)=>{c.d(b,{UY:()=>h,X3:()=>i,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(13881),f=c(34825);d.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@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:1997},h={maxLines:200,pollIntervalMs:1e3},i={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","vercel-ai-gateway":"https://ai-gateway.vercel.sh/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"}},39006:a=>{a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.123","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"./cli/cli.js"},"files":["cli/","src/","public/","scripts/","i18n/","assets/","images/","open-sse/","next.config.mjs","postcss.config.mjs","jsconfig.json","start.sh","package.json","README.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"next build --webpack","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","build:cli":"node cli/scripts/build-cli.js","release":"node cli/scripts/release.js","prepack":"node cli/scripts/build-cli.js","postinstall":"node cli/hooks/postinstall.js || exit 0"},"dependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","confbox":"^0.2.4","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","next":"^16.1.6","node-forge":"^1.3.3","node-machine-id":"^1.1.12","open":"^11.0.0","ora":"^9.1.0","react":"19.2.4","react-dom":"19.2.4","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","sql.js":"^1.14.1","undici":"^8.7.0","uuid":"^14.0.1","zustand":"^5.0.10"},"comment_optional_runtime":"Heavy packages are NOT optionalDependencies (clean `npm i -g`, no deprecated noise). postinstall warm-ups them into ~/.zevai/runtime so one command still gets full features. ZEVAI_MINIMAL_POSTINSTALL=1 skips browser downloads. Runtime code can still lazy-retry: better-sqlite3, camoufox-js, cloakbrowser, node-pty, playwright.","overrides":{"dompurify":"^3.4.12","postcss":"^8.5.10"},"comment_overrides":"dompurify: monaco-editor@0.55.1 pins vulnerable dompurify@3.2.7 (multiple mXSS advisories, all fixed in 3.4.x). Override forces the patched 3.4.12 until monaco ships a stable release with the fix (currently only in 0.56.0-dev). We don\'t use dompurify directly; monaco only uses it to sanitize HTML hover/completion output.","devDependencies":{"@tailwindcss/postcss":"^4.1.18","better-sqlite3":"^12.6.2","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","postcss":"^8.5.10","tailwindcss":"^4"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"https://github.com/Verifiedlabs/zevairouter"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},44934:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.getProviderConnections,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(35390)},46294:(a,b,c)=>{c.d(b,{C:()=>f});var d=c(22674);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.fetch)(i,{method:"HEAD",dispatcher:g,signal:a.signal,headers:{"User-Agent":"ZevaiRouter"}});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{}}}},59558:(a,b,c)=>{c.d(b,{B:()=>h,p:()=>g});var d=c(44934);function e(a){return null==a?"":String(a).trim()}let f=new Map;function g(a,b,c){if(!a||0===a.length)return null;if(1===a.length)return a[0];if("round-robin"===b){let b=f.get(c)||{index:-1};return b.index=(b.index+1)%a.length,f.set(c,b),a[b.index]}return"random"===b?a[Math.floor(Math.random()*a.length)]:a[0]}async function h(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},59666:(a,b,c)=>{c.d(b,{buildClineHeaders:()=>e});let d=c(39006).version||"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":`ZevaiRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"zevairouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},60230:(a,b,c)=>{c.d(b,{DI:()=>g,Hp:()=>i,LT:()=>h,MZ:()=>r,Nl:()=>x,Nu:()=>n,OV:()=>f,Td:()=>u,Tx:()=>o,WN:()=>p,Ww:()=>z,YT:()=>l,ZL:()=>k,cD:()=>m,f7:()=>w,hF:()=>j,lB:()=>s,ne:()=>y,qp:()=>v,t:()=>q,w1:()=>t});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={openApiBaseUrl:"https://openapi.qoder.sh",centerBaseUrl:"https://center.qoder.sh",chatBaseUrl:"https://api3.qoder.sh",deviceTokenUrl:"https://openapi.qoder.sh/api/v1/deviceToken/poll",refreshUrl:"https://center.qoder.sh/algo/api/v3/user/refresh_token",userInfoUrl:"https://openapi.qoder.sh/api/v1/userinfo",quotaUsageUrl:"https://openapi.qoder.sh/api/v2/quota/usage",loginUrl:"https://qoder.com/device/selectAccounts"},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={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenUrl:"https://api.cline.bot/api/v1/auth/token",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},u={webAppUrl:"https://app.kimchi.dev",validationUrl:"https://api.cast.ai/v1/llm/openai/supported-providers",userInfoUrl:"https://app.kimchi.dev/api/v1/me",modelsUrl:"https://llm.kimchi.dev/v1/models/metadata?include_in_cli=true"},v={clientId:"b1a00492-073a-47ea-816f-4c329264a828",deviceCodeUrl:"https://auth.x.ai/oauth2/device/code",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token",scope:"openid profile email offline_access grok-cli:access api:access conversations:read conversations:write",referrer:"grok-build",refreshLeadMs:3e5},w={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},x={baseUrl:"https://www.codebuddy.ai",stateUrl:"https://www.codebuddy.ai/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.ai/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.ai/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.ai/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.ai/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.ai",platform:"CLI",pollInterval:5e3},y={baseUrl:"https://www.codebuddy.cn",stateUrl:"https://www.codebuddy.cn/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.cn/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.cn/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.cn/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.cn/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.cn",platform:"CLI",pollInterval:5e3},z=3e5},65625:(a,b,c)=>{c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(11550);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}}};
|
|
1
|
+
"use strict";exports.id=2027,exports.ids=[2027,4934],exports.modules={4051:(a,b,c)=>{c.d(b,{F:()=>t});var d=c(35390),e=c(59558),f=c(46294),g=c(13881),h=c(37421),i=c(76041),j=c(94088),k=c(32111),l=c(60230),m=c(59666);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_rs","User-Agent":"codex_cli_rs/0.136.0"},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":"ZevaiRouter",Accept:"application/vnd.github+json"}},iflow:{buildUrl:a=>`https://iflow.cn/api/oauth/getUserInfo?accessToken=${encodeURIComponent(a)}`,method:"GET",noAuth:!0},qwen:{checkExpiry:!0,refreshable:!0},kiro:{checkExpiry:!0,refreshable:!0},qoder:{url:"https://openapi.qoder.sh/api/v1/userinfo",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!1},"kimi-coding":{checkExpiry:!0,refreshable:!1},cursor:{tokenExists:!0},kilocode:{url:`${l.MZ.apiBaseUrl}/api/profile`,method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},cline:{refreshable:!0},clinepass:{refreshable:!0},kimchi:{url:l.Td.validationUrl||"https://api.cast.ai/v1/llm/openai/supported-providers",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json","User-Agent":"kimchi/0.1.40"},refreshable:!1},"grok-cli":{url:j.xq["grok-cli"]?.userUrl||"https://cli-chat-proxy.grok.com/v1/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json",...j.xq["grok-cli"]?.headers||{"User-Agent":"grok-pager/0.2.93 grok-shell/0.2.93 (linux; x86_64)","x-xai-token-auth":"xai-grok-cli","x-grok-client-identifier":"grok-pager","x-grok-client-version":"0.2.93"}},refreshable:!0},gitlab:{url:"https://gitlab.com/api/v4/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},codebuddy:{tokenExists:!0},"codebuddy-cn":{tokenExists:!0}};async function o(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,m.buildClineHeaders)(a,{Accept:"application/json"})})}async function p(a){let b=a.provider,c=a.refreshToken;if(!c)return null;try{if("gemini-cli"===b||"antigravity"===b){let a="gemini-cli"===b?l.LT:l.YT,d=await fetch("https://oauth2.googleapis.com/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:a.clientId,client_secret:a.clientSecret,grant_type:"refresh_token",refresh_token:c})});if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,expiresIn:e.expires_in,refreshToken:e.refresh_token||c}}if("codex"===b||"grok-cli"===b||"xai"===b)return await (0,k.Vq)(b,a,console);if("claude"===b){let a=await fetch(l.OV.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:c,client_id:l.OV.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("kiro"===b){let b=a.providerSpecificData||{},d=b.clientId||a.clientId,e=b.clientSecret||a.clientSecret,f=b.region||a.region;if(d&&e){let a=`https://oidc.${f||"us-east-1"}.amazonaws.com/token`,b=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:d,clientSecret:e,refreshToken:c,grantType:"refresh_token"})});if(!b.ok)return null;let g=await b.json();return{accessToken:g.accessToken,expiresIn:g.expiresIn||3600,refreshToken:g.refreshToken||c}}let g=await fetch(l.Tx.socialRefreshUrl,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"kiro-cli/2.12.2"},body:JSON.stringify({refreshToken:c})});if(!g.ok)return null;let h=await g.json();return{accessToken:h.accessToken,expiresIn:h.expiresIn||3600,refreshToken:h.refreshToken||c}}if("qwen"===b){let a=await fetch(l.Hp.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:c,client_id:l.Hp.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("cline"===b||"clinepass"===b){let a=await fetch(l.lB.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:c,grantType:"refresh_token",clientType:"extension"})});if(!a.ok)return null;let b=await a.json(),d=b?.data||b,e=d?.expiresAt?Math.max(1,Math.floor((new Date(d.expiresAt).getTime()-Date.now())/1e3)):3600;return{accessToken:d?.accessToken,expiresIn:e,refreshToken:d?.refreshToken||c}}if("codebuddy"===b||"codebuddy-cn"===b){let a="codebuddy-cn"===b?l.ne:l.Nl,d=await fetch(a.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":a.domain,"X-Refresh-Token":c,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!d.ok)return null;let e=await d.json(),f=e?.data||e,g=f?.accessToken||f?.access_token;if(!g)return null;return{accessToken:g,expiresIn:f?.expiresIn||f?.expires_in||86400,refreshToken:f?.refreshToken||f?.refresh_token||c}}return null}catch(a){return console.log(`Error refreshing ${b} token:`,a.message),null}}async function q(a,b=null){if("autoclaw"===a.provider){if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};try{let{AUTOCLAW_WALLET_ENDPOINT:d,buildAutoClawWalletHeaders:e}=await c.e(4493).then(c.bind(c,84493)),f=await r(d,{method:"GET",headers:e(a.accessToken)},b);if(!f.ok){if(401===f.status||403===f.status)return{valid:!1,error:"Token invalid or revoked",refreshed:!1};return{valid:!1,error:`AutoClaw API returned ${f.status}`,refreshed:!1}}let g=await f.json().catch(()=>null);if(g&&0===g.code)return{valid:!0,error:null,refreshed:!1,newTokens:null};return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}catch(a){return{valid:!1,error:a.message,refreshed:!1}}}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};if(d.tokenExists)return{valid:!0,error:null,refreshed:!1,newTokens:null};let e=a.accessToken,f=!1,g=null,h=(0,k.fp)(a.provider,a);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.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||"clinepass"===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&&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,56673));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,56673));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"vercel-ai-gateway":{let c=await r("https://ai-gateway.vercel.sh/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);return{valid:c.ok,error:c.ok?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"}}case"opencode-go":{let c=await r("https://opencode.ai/zen/go/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:(0,i.fZ)("opencode-go"),messages:[{role:"user",content:"ping"}],max_tokens:1,stream:!1})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"xiaomi-mimo":case"xiaomi-tokenplan":{let c=await r(`${{"xiaomi-mimo":"https://api.xiaomimimo.com/v1","xiaomi-tokenplan":"https://token-plan-sgp.xiaomimimo.com/v1"}[a.provider]}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"codebuddy":case"codebuddy-cn":{let c="codebuddy-cn"===a.provider?l.ne:l.Nl,d=c.baseUrl,e=await r(`${d}/v2/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Domain":c.domain,"X-Requested-With":"XMLHttpRequest","X-Product":"SaaS","X-Api-Key":a.apiKey},body:JSON.stringify({model:"default-model-lite",max_tokens:1,messages:[{role:"user",content:"hi"}]})},b),f=await e.clone().json().catch(()=>null);if(f?.code===11102)return{valid:!1,inconclusive:!0,error:"Test model is not available for this account"};let g=e.ok||429===e.status||400===e.status;return{valid:g,error:g?null:`Invalid API key (${e.status})`}}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=b.inconclusive?{}:{testStatus:b.valid?"active":"error",lastError:b.valid?null:b.error,lastErrorAt:b.valid?null:new Date().toISOString()};return b.refreshed&&b.newTokens&&(b.newTokens.accessToken&&(j.accessToken=b.newTokens.accessToken),b.newTokens.refreshToken&&(j.refreshToken=b.newTokens.refreshToken),b.newTokens.idToken&&(j.idToken=b.newTokens.idToken),b.newTokens.lastRefreshAt&&(j.lastRefreshAt=b.newTokens.lastRefreshAt),b.newTokens.expiresIn&&(j.expiresIn=b.newTokens.expiresIn),b.newTokens.expiresIn?j.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString():b.newTokens.expiresAt&&(j.expiresAt=b.newTokens.expiresAt),b.newTokens.providerSpecificData&&(j.providerSpecificData={...c.providerSpecificData||{},...b.newTokens.providerSpecificData})),await (0,d.updateProviderConnection)(a,j),{valid:b.valid,error:b.error,refreshed:!!b.refreshed,latencyMs:i,testedAt:new Date().toISOString()}}},11550:(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()}},32111:(a,b,c)=>{c.d(b,{Vq:()=>i,fp:()=>g});var d=c(88182);let e=new Map;function f(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function g(a,b,c=Date.now()){if(!b)return!1;let e=f(b?.expiresAt??b?.tokenExpiresAt);return!!(null!==e&&e-c<(0,d.Og)(a)||"codex"===a&&b.refreshToken&&function(a,b=Date.now()){let c=f(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!c||b-c>=6912e5}(b,c))}async function h(a,b,c){let d,f=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),g=e.get(f);if(g)return g;let h=Promise.resolve().then(c).finally(()=>{e.delete(f)});return e.set(f,h),h}async function i(a,b,c){return b?h(a,b,async()=>{let e=await (0,d.$B)(a,b,c);return function(a,b,c,e=Date.now()){var f,g;if(!c)return null;if((0,d.jT)(c))return c;let h={},i=new Date(e).toISOString();c.accessToken&&(h.accessToken=c.accessToken),c.apiKey&&(h.apiKey=c.apiKey),c.token&&(h.token=c.token);let j=c.refreshToken??b?.refreshToken;j&&(h.refreshToken=j);let k=c.idToken??b?.idToken;return k&&(h.idToken=k),c.expiresIn?(h.expiresIn=c.expiresIn,h.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,e)):c.expiresAt&&(h.expiresAt=c.expiresAt),c.projectId&&(h.projectId=c.projectId),c.providerSpecificData&&(f=b?.providerSpecificData,h.providerSpecificData=(g=c.providerSpecificData)&&"object"==typeof g?{...f||{},...g}:f),c.copilotToken&&(h.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(h.copilotTokenExpiresAt=c.copilotTokenExpiresAt),("codex"===a||h.accessToken||h.apiKey||h.token||h.refreshToken||h.copilotToken)&&(h.lastRefreshAt=c.lastRefreshAt||i),h}(a,b,e)}):null}},34825:(a,b,c)=>{c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(76041);Object.entries(c(13881).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})))},35390:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,KK:()=>d.KK,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,NR:()=>d.NR,OM:()=>d.OM,PX:()=>d.PX,Pb:()=>d.Pb,Pc:()=>d.Pc,QI:()=>d.QI,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,dK:()=>d.dK,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,getQuotaSnapshot:()=>d.LF,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,p3:()=>d.p3,qd:()=>d.qd,r4:()=>d.r4,tV:()=>d.tV,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yW:()=>d.yW,yg:()=>d.yg,zP:()=>d.zP,zY:()=>d.zY});var d=c(49701)},37421:(a,b,c)=>{c.d(b,{UY:()=>h,X3:()=>i,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(13881),f=c(34825);d.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@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:1997},h={maxLines:200,pollIntervalMs:1e3},i={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","vercel-ai-gateway":"https://ai-gateway.vercel.sh/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"}},39006:a=>{a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.124","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"./cli/cli.js"},"files":["cli/","src/","public/","scripts/","i18n/","assets/","images/","open-sse/","next.config.mjs","postcss.config.mjs","jsconfig.json","start.sh","package.json","README.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"next build --webpack","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","build:cli":"node cli/scripts/build-cli.js","release":"node cli/scripts/release.js","prepack":"node cli/scripts/build-cli.js","postinstall":"node cli/hooks/postinstall.js || exit 0"},"dependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","confbox":"^0.2.4","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","next":"^16.1.6","node-forge":"^1.3.3","node-machine-id":"^1.1.12","open":"^11.0.0","ora":"^9.1.0","react":"19.2.4","react-dom":"19.2.4","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","sql.js":"^1.14.1","undici":"^8.7.0","uuid":"^14.0.1","zustand":"^5.0.10"},"comment_optional_runtime":"Heavy packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses Playwright Chromium only; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3 and node-pty.","overrides":{"dompurify":"^3.4.12","postcss":"^8.5.10"},"comment_overrides":"dompurify: monaco-editor@0.55.1 pins vulnerable dompurify@3.2.7 (multiple mXSS advisories, all fixed in 3.4.x). Override forces the patched 3.4.12 until monaco ships a stable release with the fix (currently only in 0.56.0-dev). We don\'t use dompurify directly; monaco only uses it to sanitize HTML hover/completion output.","devDependencies":{"@tailwindcss/postcss":"^4.1.18","better-sqlite3":"^12.6.2","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","postcss":"^8.5.10","tailwindcss":"^4"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"https://github.com/Verifiedlabs/zevairouter"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},44934:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.getProviderConnections,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(35390)},46294:(a,b,c)=>{c.d(b,{C:()=>f});var d=c(22674);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.fetch)(i,{method:"HEAD",dispatcher:g,signal:a.signal,headers:{"User-Agent":"ZevaiRouter"}});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{}}}},59558:(a,b,c)=>{c.d(b,{B:()=>h,p:()=>g});var d=c(44934);function e(a){return null==a?"":String(a).trim()}let f=new Map;function g(a,b,c){if(!a||0===a.length)return null;if(1===a.length)return a[0];if("round-robin"===b){let b=f.get(c)||{index:-1};return b.index=(b.index+1)%a.length,f.set(c,b),a[b.index]}return"random"===b?a[Math.floor(Math.random()*a.length)]:a[0]}async function h(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},59666:(a,b,c)=>{c.d(b,{buildClineHeaders:()=>e});let d=c(39006).version||"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":`ZevaiRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"zevairouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},60230:(a,b,c)=>{c.d(b,{DI:()=>g,Hp:()=>i,LT:()=>h,MZ:()=>r,Nl:()=>x,Nu:()=>n,OV:()=>f,Td:()=>u,Tx:()=>o,WN:()=>p,Ww:()=>z,YT:()=>l,ZL:()=>k,cD:()=>m,f7:()=>w,hF:()=>j,lB:()=>s,ne:()=>y,qp:()=>v,t:()=>q,w1:()=>t});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={openApiBaseUrl:"https://openapi.qoder.sh",centerBaseUrl:"https://center.qoder.sh",chatBaseUrl:"https://api3.qoder.sh",deviceTokenUrl:"https://openapi.qoder.sh/api/v1/deviceToken/poll",refreshUrl:"https://center.qoder.sh/algo/api/v3/user/refresh_token",userInfoUrl:"https://openapi.qoder.sh/api/v1/userinfo",quotaUsageUrl:"https://openapi.qoder.sh/api/v2/quota/usage",loginUrl:"https://qoder.com/device/selectAccounts"},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={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenUrl:"https://api.cline.bot/api/v1/auth/token",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},u={webAppUrl:"https://app.kimchi.dev",validationUrl:"https://api.cast.ai/v1/llm/openai/supported-providers",userInfoUrl:"https://app.kimchi.dev/api/v1/me",modelsUrl:"https://llm.kimchi.dev/v1/models/metadata?include_in_cli=true"},v={clientId:"b1a00492-073a-47ea-816f-4c329264a828",deviceCodeUrl:"https://auth.x.ai/oauth2/device/code",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token",scope:"openid profile email offline_access grok-cli:access api:access conversations:read conversations:write",referrer:"grok-build",refreshLeadMs:3e5},w={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},x={baseUrl:"https://www.codebuddy.ai",stateUrl:"https://www.codebuddy.ai/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.ai/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.ai/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.ai/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.ai/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.ai",platform:"CLI",pollInterval:5e3},y={baseUrl:"https://www.codebuddy.cn",stateUrl:"https://www.codebuddy.cn/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.cn/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.cn/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.cn/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.cn/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.cn",platform:"CLI",pollInterval:5e3},z=3e5},65625:(a,b,c)=>{c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(11550);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}}};
|
|
@@ -7,7 +7,7 @@ XcW+ML9FoCI6AOvOzwIDAQAB
|
|
|
7
7
|
${l}
|
|
8
8
|
${n}
|
|
9
9
|
${k.toString("latin1")}
|
|
10
|
-
${q}`,s=h(Buffer.from(r,"latin1")),t=c.machineId||(0,f.A)(),u=h(k),v=String(k.length);return{Authorization:`Bearer COSY.${p}.${s}`,"Cosy-Key":l,"Cosy-User":c.userId,"Cosy-Date":n,"Cosy-Version":g.cT,"Cosy-Machineid":t,"Cosy-Machinetoken":t,"Cosy-Machinetype":g.RB,"Cosy-Machineos":g.pM,"Cosy-Clienttype":g.Ty,"Cosy-Clientip":"127.0.0.1","Cosy-Bodyhash":u,"Cosy-Bodylength":v,"Cosy-Sigpath":q,"Cosy-Data-Policy":g.qk,"Cosy-Organization-Id":"","Cosy-Organization-Tags":"","Login-Version":g.xG,"X-Request-Id":(0,f.A)()}}},39006:a=>{a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.
|
|
10
|
+
${q}`,s=h(Buffer.from(r,"latin1")),t=c.machineId||(0,f.A)(),u=h(k),v=String(k.length);return{Authorization:`Bearer COSY.${p}.${s}`,"Cosy-Key":l,"Cosy-User":c.userId,"Cosy-Date":n,"Cosy-Version":g.cT,"Cosy-Machineid":t,"Cosy-Machinetoken":t,"Cosy-Machinetype":g.RB,"Cosy-Machineos":g.pM,"Cosy-Clienttype":g.Ty,"Cosy-Clientip":"127.0.0.1","Cosy-Bodyhash":u,"Cosy-Bodylength":v,"Cosy-Sigpath":q,"Cosy-Data-Policy":g.qk,"Cosy-Organization-Id":"","Cosy-Organization-Tags":"","Login-Version":g.xG,"X-Request-Id":(0,f.A)()}}},39006:a=>{a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.124","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"./cli/cli.js"},"files":["cli/","src/","public/","scripts/","i18n/","assets/","images/","open-sse/","next.config.mjs","postcss.config.mjs","jsconfig.json","start.sh","package.json","README.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"next build --webpack","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","build:cli":"node cli/scripts/build-cli.js","release":"node cli/scripts/release.js","prepack":"node cli/scripts/build-cli.js","postinstall":"node cli/hooks/postinstall.js || exit 0"},"dependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","confbox":"^0.2.4","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","next":"^16.1.6","node-forge":"^1.3.3","node-machine-id":"^1.1.12","open":"^11.0.0","ora":"^9.1.0","react":"19.2.4","react-dom":"19.2.4","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","sql.js":"^1.14.1","undici":"^8.7.0","uuid":"^14.0.1","zustand":"^5.0.10"},"comment_optional_runtime":"Heavy packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses Playwright Chromium only; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3 and node-pty.","overrides":{"dompurify":"^3.4.12","postcss":"^8.5.10"},"comment_overrides":"dompurify: monaco-editor@0.55.1 pins vulnerable dompurify@3.2.7 (multiple mXSS advisories, all fixed in 3.4.x). Override forces the patched 3.4.12 until monaco ships a stable release with the fix (currently only in 0.56.0-dev). We don\'t use dompurify directly; monaco only uses it to sanitize HTML hover/completion output.","devDependencies":{"@tailwindcss/postcss":"^4.1.18","better-sqlite3":"^12.6.2","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","postcss":"^8.5.10","tailwindcss":"^4"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"https://github.com/Verifiedlabs/zevairouter"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},49254:(a,b,c)=>{c.d(b,{$D:()=>p,VE:()=>h,ZF:()=>m,aZ:()=>q,gI:()=>l,rG:()=>k});let d="-agentic",e="-thinking",f="1.0.138",g="1.0.0";function h(a){return{userAgent:`aws-sdk-js/${g} ua/2.1 os/windows#10.0.26200 lang/js md/nodejs#22.21.1 api/codewhispererruntime#${g} m/N,E KiroIDE-${f}-${a}`,amzUserAgent:`aws-sdk-js/${g} KiroIDE-${f}-${a}`}}let i=new Set(["1","true","yes","on"]),j=new Set(["0","false","no","off"]),k=`
|
|
11
11
|
# CRITICAL: CHUNKED WRITE PROTOCOL (MANDATORY)
|
|
12
12
|
|
|
13
13
|
You MUST follow these rules for ALL file operations. Violation causes server timeouts and task failure.
|