zevairouter 1.0.199 → 1.0.200
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 +5 -0
- package/cli/app/.next-cli-build/BUILD_ID +1 -1
- package/cli/app/.next-cli-build/app-path-routes-manifest.json +9 -9
- 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/settings/pricing/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/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/cli-tools/all-statuses/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +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/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/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.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- 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/skills.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.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 +4 -4
- package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
- 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 +2 -2
- 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 +9 -9
- package/cli/app/.next-cli-build/server/chunks/1131.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/3949.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/4025.js +5 -5
- package/cli/app/.next-cli-build/server/chunks/4827.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/7276.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/7319.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/8306.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/9489.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/static/chunks/{4686-3870bc6cc2baf49c.js → 4686-9853e280b3d115cd.js} +5 -5
- package/cli/app/.next-cli-build/static/chunks/{620-abe9e47b22606c8c.js → 620-03679ee6739cb2eb.js} +1 -1
- package/cli/app/CHANGELOG.md +5 -0
- package/cli/app/package.json +1 -1
- package/cli/package.json +1 -1
- package/package.json +1 -1
- /package/cli/app/.next-cli-build/static/{vXCx3sJBUb9AL2WtKv2-b → 4IsY9qFNbF0v6XZUO2EbQ}/_buildManifest.js +0 -0
- /package/cli/app/.next-cli-build/static/{vXCx3sJBUb9AL2WtKv2-b → 4IsY9qFNbF0v6XZUO2EbQ}/_ssgManifest.js +0 -0
|
@@ -2,4 +2,4 @@ exports.id=3949,exports.ids=[3949],exports.modules={12897:(a,b,c)=>{"use strict"
|
|
|
2
2
|
${b?.stderr||""}
|
|
3
3
|
${b?.message||""}`),/(?:invalid choice|unknown (?:command|subcommand)|unrecognized (?:argument|command)|no such command)/i.test(a))return null;throw new u(`Failed to discover the active Hermes ${e} path`,{code:"HERMES_PATH_DISCOVERY_FAILED",status:422})}return function(a,{platform:b,label:c}){let d="win32"===b?i().win32:i().posix,e=String(a??""),f=e.endsWith("\r\n")?e.slice(0,-2):e.endsWith("\n")?e.slice(0,-1):e;if(!(f.length>0&&f.length<=32768&&f===f.trim()&&!/[\u0000-\u001f\u007f]/.test(f)&&d.isAbsolute(f)))throw new u(`Hermes returned an invalid ${c} path`,{code:"HERMES_PATH_INVALID",status:422});return d.normalize(f)}(f?.stdout,{platform:c,label:e})},f=await e("path","config");if(!f)return b;let g=await e("env-path","environment");if(!g)return b;let h="win32"===c?i().win32:i().posix;if(y(h.dirname(f),c)!==y(h.dirname(g),c))throw new u("Hermes config and environment paths use different profiles",{code:"HERMES_PATH_INVALID",status:422});return{...b,configDir:h.dirname(f),configPath:f,envPath:g}}async function X({env:a=process.env,platform:b=n().platform(),homedir:c=n().homedir(),access:d=g().access,realpath:e=g().realpath,runVersion:f=U}={}){let h="win32"===b?l.constants.F_OK:l.constants.X_OK;for(let g of function({env:a,platform:b,homedir:c}){let d="win32"===b?i().win32:i().posix,e=x({env:a,platform:b,homedir:c}).configDir,f="win32"===b?["hermes.exe","hermes"]:["hermes"],g=String(a.PATH||"").split(d.delimiter).map(a=>a.trim().replace(/^"|"$/g,"")).filter(Boolean).flatMap(a=>f.map(b=>d.resolve(a,b)));return"win32"===b?g.push(d.join(e,"hermes-agent","venv","Scripts","hermes.exe")):(g.push(d.join(e,"hermes-agent","venv","bin","hermes")),g.push(d.join(c,".local","bin","hermes")),g.push("/usr/local/bin/hermes"),a.PREFIX&&g.push(d.join(a.PREFIX,"bin","hermes"))),[...new Set(g)]}({env:a,platform:b,homedir:c})){try{await d(g,h)}catch{continue}for(let a of[["--version"],["version"]])try{let b=await f(g,a),c=function(a){let b=S(a).match(/(?:^|\r?\n)\s*Hermes Agent\s+v?(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)(?:\s|$)/i);return b?.[1]||null}(`${b?.stdout||""}
|
|
4
4
|
${b?.stderr||""}`);if(!c)continue;let d=g;try{d=await e(g)}catch{}return{installed:!0,binaryPath:d,version:c}}catch{}}return{installed:!1,binaryPath:null,version:null}}var Y=c(30869),Z=c(24424);let $="zevairouter-host",_=Promise.resolve();function aa(a){let b=String(a??"");if(!/^[0-9]+$/.test(b))return null;let c=Number(b);return Number.isSafeInteger(c)&&c>=1&&c<=65535?c:null}function ab(a){let b=_.then(a,a);return _=b.catch(()=>{}),b}function ac(a,b){return{installationTarget:$,platform:process.platform,configDir:a.configDir,configPath:a.configPath,envPath:a.envPath,binaryPath:b?.binaryPath||null,version:b?.version||null,supported:!!(b?.installed&&T(b.version)),localBaseUrl:function(){let a=aa(process.env.PORT)??aa(Y.h0.appPort);if(null===a)throw Error("ZevaiRouter app port configuration is invalid");return`http://127.0.0.1:${a}/v1`}()}}function ad(a,b=!1){return{available:a,restorable:b,conflict:a&&!b}}function ae(a,b){return a instanceof u?j.NextResponse.json({error:a.message,code:a.code,installationTarget:$},{status:a.status}):a instanceof SyntaxError?j.NextResponse.json({error:"Request body must be valid JSON",code:"INVALID_HERMES_SETTINGS",installationTarget:$},{status:400}):(console.error(b,a instanceof Error?a.message:a),j.NextResponse.json({error:b,code:"HERMES_IO_ERROR",installationTarget:$},{status:500}))}async function af(a,b){let c;try{let d;c=await g().open(a,"r");let e=await c.stat();if(!e.isFile())throw new u("Hermes settings path is not a regular file",{code:"HERMES_PATH_INVALID",status:422});if(e.size>b)throw new u("Hermes settings file is too large to update safely",{code:"HERMES_FILE_TOO_LARGE",status:422});let f=Buffer.allocUnsafe(b+1),h=0;for(;h<f.length;){let{bytesRead:a}=await c.read(f,h,f.length-h,h);if(0===a)break;h+=a}if(h>b)throw new u("Hermes settings file is too large to update safely",{code:"HERMES_FILE_TOO_LARGE",status:422});let i=f.subarray(0,h);try{d=new TextDecoder("utf-8",{fatal:!0}).decode(i)}catch{throw new u("Hermes settings file is not valid UTF-8",{code:"HERMES_FILE_ENCODING_INVALID",status:422})}return{exists:!0,text:d,mode:511&e.mode,uid:"win32"===process.platform?null:e.uid,gid:"win32"===process.platform?null:e.gid}}catch(a){if(a?.code==="ENOENT")return{exists:!1,text:"",mode:null,uid:null,gid:null};throw a}finally{c&&await c.close().catch(()=>{})}}async function ag(a){try{let b=await g().stat(a,{bigint:!0});if(!b.isFile())throw new u("Hermes backup path is not a regular file",{code:"HERMES_PATH_INVALID",status:422});return{exists:!0,dev:b.dev,ino:b.ino,size:b.size,mode:b.mode,uid:b.uid,gid:b.gid,mtimeNs:b.mtimeNs,ctimeNs:b.ctimeNs}}catch(a){if(a?.code==="ENOENT")return{exists:!1};throw a}}async function ah(a,b){let c=await ag(a);if(!["exists","dev","ino","size","mode","uid","gid","mtimeNs","ctimeNs"].every(a=>c[a]===b[a]))throw new u("Hermes backup changed while it was being discarded",{code:"HERMES_CONFIG_CHANGED",status:409})}async function ai(a){let b;if("win32"!==process.platform)try{b=await g().open(a,"r"),await b.sync()}catch(a){if(!["EBADF","EINVAL","ENOTSUP"].includes(a?.code))throw a}finally{b&&await b.close().catch(()=>{})}}async function aj(a,b,c,{uid:d=null,gid:f=null}={}){let h,j=i().dirname(a);await g().mkdir(j,{recursive:!0,mode:448});let k=i().join(j,`.${i().basename(a)}.${process.pid}.${(0,e.randomUUID)()}.tmp`);try{h=await g().open(k,"wx",c),await h.writeFile(b,"utf8"),"win32"!==process.platform&&Number.isInteger(d)&&Number.isInteger(f)&&(d!==process.getuid()||f!==process.getgid())&&await h.chown(d,f),await h.chmod(c),await h.sync(),await h.close(),h=null,await g().rename(k,a),await ai(j)}finally{h&&await h.close().catch(()=>{}),await g().unlink(k).catch(()=>{})}}async function ak(a){try{await g().unlink(a),await ai(i().dirname(a))}catch(a){if(a?.code!=="ENOENT")throw a}}async function al(a,b){let{exists:c,text:d,mode:e}=b;c?await aj(a,d,e??384,b):await ak(a)}async function am(a,b,c){let d=await af(a,c);if(d.exists!==b.exists||d.text!==b.text||d.mode!==b.mode||d.uid!==b.uid||d.gid!==b.gid)throw new u("Hermes settings changed while the operation was in progress",{code:"HERMES_CONFIG_CHANGED",status:409})}function an(a,b){return a.exists===b.exists&&(!a.exists||a.text===b.text&&a.mode===b.mode&&(null===b.uid||a.uid===b.uid)&&(null===b.gid||a.gid===b.gid))}function ao(a,b){return null!==a?a:"win32"===process.platform?null:b()}async function ap(a,b,c,d){try{let e=await af(a,d),f=an(e,c),g=an(e,b);return f&&await al(a,b),f||g}catch{return!1}}async function aq(a){let b=await af(a.backupPath,262144);return{snapshot:b,backup:b.exists?function(a){let b;try{b=JSON.parse(a)}catch{throw new u("Hermes ZevaiRouter backup is not valid JSON",{code:"HERMES_BACKUP_INVALID",status:409})}if(!(b?.version===1&&b.paths&&"string"==typeof b.paths.configPath&&"string"==typeof b.paths.envPath&&"boolean"==typeof b.before?.configFileExisted&&"boolean"==typeof b.before?.envFileExisted&&Q(b.before.configMode)&&Q(b.before.envMode)&&P(b.before.model)&&"boolean"==typeof b.before?.env?.exists&&(!b.before.env.exists||"string"==typeof b.before.env.line)&&P(b.applied?.model)&&"string"==typeof b.applied?.envHash&&Q(b.applied?.configMode)&&Q(b.applied?.envMode)))throw new u("Hermes ZevaiRouter backup has an unsupported format",{code:"HERMES_BACKUP_INVALID",status:409});return b}(b.text):null}}async function ar(a,b,c){try{let{backup:d}=await aq(a);if(!d)return ad(!1);let e=R(d,{configText:b.text,envText:c.text,configPath:a.configPath,envPath:a.envPath,configMode:b.mode,envMode:c.mode});return ad(!0,e)}catch{return ad(!0,!1)}}function as(a){if(!function(a,{platform:b=n().platform()}={}){let c=[a.configPath,a.envPath,a.backupPath].map(a=>y(a,b));return new Set(c).size===c.length}(a))throw new u("Hermes config, environment, and backup paths must be different",{code:"HERMES_PATH_INVALID",status:422})}async function at(a){try{return await g().realpath(a)}catch(a){if(a?.code!=="ENOENT")throw a}try{if((await g().lstat(a)).isSymbolicLink())throw new u("Hermes settings path is a dangling symbolic link",{code:"HERMES_PATH_INVALID",status:422})}catch(a){if(a?.code!=="ENOENT")throw a}let b=i().dirname(a),c=[i().basename(a)];for(;;){try{let a=await g().realpath(b);return i().join(a,...c)}catch(a){if(a?.code!=="ENOENT")throw a}let d=i().dirname(b);if(d===b)return a;c.unshift(i().basename(b)),b=d}}async function au(a){let[b,c,d]=await Promise.all([at(a.configPath),at(a.envPath),at(a.backupPath)]);return{...a,configDir:i().dirname(b),configPath:b,envPath:c,backupPath:d}}async function av({useBackupPathsWhenUnavailable:a=!1}={}){let b,c=await X(),d=x();if(c.installed)b=await W({installation:c,fallbackPaths:d});else if(a){let a=await au(d);try{let{backup:c}=await aq(a);b=c?function(a,b){if([b?.paths?.configPath,b?.paths?.envPath].some(a=>"string"!=typeof a||!i().isAbsolute(a)||/[\u0000-\u001f\u007f]/.test(a)))throw new u("Hermes backup contains invalid settings paths",{code:"HERMES_BACKUP_INVALID",status:409});return{...a,configDir:i().dirname(b.paths.configPath),configPath:b.paths.configPath,envPath:b.paths.envPath}}(d,c):d}catch{b=d}}else b=d;let e=await au(b);return as(e),{installation:c,paths:e}}async function aw(){try{let{installation:a,paths:b}=await av({useBackupPathsWhenUnavailable:!0}),c=await af(b.configPath,5242880),d=await af(b.envPath,1048576),e=await ar(b,c,d);if(!a.installed)return j.NextResponse.json({installed:!1,...ac(b,a),settings:{model:null},hasZevai:!1,backup:e,message:"Hermes Agent is not installed on the ZevaiRouter host"});let f=function(a){let b=A(a),c=b.get("model",!0);if(!(0,p.jh)(c))return{model:null,hasZevai:!1};let d=C(b)?.model,e=a=>{let b=d?.[a];return"string"==typeof b?b:null},f=e("provider"),g=e("base_url"),h=e("api_key"),i=e("api_mode"),j=null;try{let a=new URL(g);["http:","https:"].includes(a.protocol)&&(a.username="",a.password="",a.search="",a.hash="",j=a.toString().replace(/\/$/,""))}catch{}let k={default:e("default"),provider:f,base_url:j,api_mode:i},l=!1;try{l=["http:","https:"].includes(new URL(g).protocol)}catch{}return{model:k,hasZevai:("custom"===f||f?.startsWith("custom:"))&&l&&h===s&&"chat_completions"===i}}(c.text);return j.NextResponse.json({installed:!0,...ac(b,a),settings:{model:f.model},hasZevai:f.hasZevai,backup:e})}catch(a){return ae(a,"Failed to inspect Hermes settings on the ZevaiRouter host")}}async function ax(a){return ab(async()=>{try{var b;let c=function(a){let b;(!a||"object"!=typeof a||Array.isArray(a))&&v("Request body must be an object");let c=z(a.model,"model",512);(c.toLowerCase().endsWith("/model-id")||/[<>]/.test(c))&&v("model must be a real model identifier, not a placeholder");let d=z(a.apiKey,"apiKey",8192);/^[A-Za-z0-9._~+/=@:%-]+$/.test(d)||v("apiKey contains unsupported characters");let e=z(a.baseUrl,"baseUrl",2048);try{b=new URL(e)}catch{v("baseUrl must be a valid URL")}b&&["http:","https:"].includes(b.protocol)&&b.hostname||v("baseUrl must use http or https"),(b.username||b.password||b.search||b.hash)&&v("baseUrl must not include credentials, a query, or a fragment");let f=b.pathname.replace(/\/+$/,"");return b.pathname=/\/v1$/i.test(f)?`${f.slice(0,-3)}/v1`:`${f}/v1`,{model:c,apiKey:d,baseUrl:b.toString().replace(/\/$/,"")}}(await a.json()),{installation:d,paths:e}=await av();if(!d.installed)throw new u("Hermes Agent is not installed on the ZevaiRouter host",{code:"HERMES_NOT_INSTALLED",status:409});if(!T(d.version))throw new u("Hermes Agent 0.4.0 or newer is required for ZevaiRouter-managed API keys",{code:"HERMES_VERSION_UNSUPPORTED",status:422});let f=await af(e.configPath,5242880),g=await af(e.envPath,1048576),h=await aq(e),i=h.backup;if(i&&!R(i,{configText:f.text,envText:g.text,configPath:e.configPath,envPath:e.envPath,configMode:f.mode,envMode:g.mode}))throw new u("Hermes settings changed after the previous ZevaiRouter Apply; reset or reconcile them first",{code:"HERMES_CONFIG_CHANGED",status:409});let k=function(a,{model:b,baseUrl:c}){let d=A(a),e=F(d),f=d.get("model",!0);for(let[a,e]of((0,p.jh)(f)||(f=H(d,"model",{})),Object.entries({default:b,provider:"custom",base_url:c,api_key:s,api_mode:"chat_completions"})))H(f,a,e);return{text:d.toString(),before:e,applied:F(d)}}(f.text,c),l=function(a,b){let c=M(a),d=c?{exists:!0,line:c.content}:{exists:!1},e=`${r}=${b}`,f=J(a);if(c)f[c.index]=`${e}${L(c.line)}`;else{if(f.length>0&&!/(?:\r\n|\n|\r)$/.test(f.at(-1))){let b=a.includes("\r\n")?"\r\n":"\n";f[f.length-1]+=b}let b=a.includes("\r\n")?"\r\n":"\n";f.push(`${e}${b}`)}return{text:f.join(""),before:d,appliedHash:N(e)}}(g.text,c.apiKey),m=(b=function({paths:a,priorBackup:b=null,configFileExisted:c,envFileExisted:d,configMode:e,envMode:f,configBefore:g,envBefore:h,configApplied:i,envAppliedHash:j,configAppliedMode:k,envAppliedMode:l,now:m=new Date}){return{version:1,createdAt:b?.createdAt||m.toISOString(),updatedAt:m.toISOString(),paths:{configPath:a.configPath,envPath:a.envPath},before:b?.before||{configFileExisted:c,envFileExisted:d,configMode:e,envMode:f,model:g,env:h},applied:{model:i,envHash:j,configMode:k,envMode:l}}}({paths:e,priorBackup:i,configFileExisted:f.exists,envFileExisted:g.exists,configMode:f.mode,envMode:g.mode,configBefore:k.before,envBefore:l.before,configApplied:k.applied,envAppliedHash:l.appliedHash,configAppliedMode:"win32"===process.platform?null:f.mode??384,envAppliedMode:"win32"===process.platform?null:384}),`${JSON.stringify(b,null,2)}
|
|
5
|
-
`);if(Buffer.byteLength(m,"utf8")>262144)throw new u("Hermes managed settings are too large to back up safely",{code:"HERMES_BACKUP_TOO_LARGE",status:422});await am(e.configPath,f,5242880),await am(e.envPath,g,1048576),await am(e.backupPath,h.snapshot,262144);let n={exists:!0,text:m,mode:384,uid:ao(h.snapshot.uid,()=>process.getuid()),gid:ao(h.snapshot.gid,()=>process.getgid())},o={exists:!0,text:k.text,mode:f.mode??384,uid:ao(f.uid,()=>process.getuid()),gid:ao(f.gid,()=>process.getgid())},q={exists:!0,text:l.text,mode:384,uid:ao(g.uid,()=>process.getuid()),gid:ao(g.gid,()=>process.getgid())};try{await al(e.backupPath,n),await al(e.configPath,o),await al(e.envPath,q)}catch(d){let a=await ap(e.envPath,g,q,1048576),b=await ap(e.configPath,f,o,5242880),c=!!a&&!!b&&await ap(e.backupPath,h.snapshot,n,262144);throw a&&b&&c||console.error("Hermes Apply rollback could not safely restore every file"),d}return j.NextResponse.json({success:!0,message:"Hermes settings applied on the ZevaiRouter host",...ac(e,d),backup:ad(!0,!0)})}catch(a){return ae(a,"Failed to update Hermes settings on the ZevaiRouter host")}})}async function ay(a){return ab(async()=>{try{if(a?.url&&"1"===new URL(a.url,"http://localhost").searchParams.get("discard")){let a=await au(x());as(a);let b=await ag(a.backupPath);if(!b.exists)throw new u("No ZevaiRouter Hermes backup is available to discard",{code:"HERMES_BACKUP_NOT_FOUND",status:404});return await ah(a.backupPath,b),await ak(a.backupPath),j.NextResponse.json({success:!0,discarded:!0,message:"Hermes backup discarded; config and environment settings were not changed",installationTarget:$,configPath:a.configPath,envPath:a.envPath,backup:ad(!1)})}let{paths:b}=await av({useBackupPathsWhenUnavailable:!0}),c=await af(b.configPath,5242880),d=await af(b.envPath,1048576),e=await aq(b);if(!e.backup)throw new u("No ZevaiRouter Hermes backup is available to restore",{code:"HERMES_BACKUP_NOT_FOUND",status:404});let f=e.backup;if(!R(f,{configText:c.text,envText:d.text,configPath:b.configPath,envPath:b.envPath,configMode:c.mode,envMode:d.mode}))throw new u("Hermes managed settings changed after ZevaiRouter applied them",{code:"HERMES_CONFIG_CHANGED",status:409});let g=I(c.text,f.before.model,f.applied.model),h=O(d.text,f.before.env,f.applied.envHash),i={exists:f.before.configFileExisted||"{}"!==g.trim(),text:g,mode:f.before.configMode??384,uid:c.uid,gid:c.gid},k={exists:f.before.envFileExisted||h.trim().length>0,text:h,mode:f.before.envMode??384,uid:d.uid,gid:d.gid};await am(b.configPath,c,5242880),await am(b.envPath,d,1048576),await am(b.backupPath,e.snapshot,262144);try{await al(b.configPath,i),await al(b.envPath,k),await ak(b.backupPath)}catch(f){let a=await ap(b.envPath,d,k,1048576),e=await ap(b.configPath,c,i,5242880);throw a&&e||console.error("Hermes Reset rollback could not safely restore every file"),f}return j.NextResponse.json({success:!0,message:"Previous Hermes settings restored on the ZevaiRouter host",installationTarget:$,configPath:b.configPath,envPath:b.envPath,backup:ad(!1)})}catch(b){let a=ae(b,"Failed to restore Hermes settings on the ZevaiRouter host");if(b instanceof u&&"HERMES_CONFIG_CHANGED"===b.code)return j.NextResponse.json({error:b.message,code:b.code,installationTarget:$,backup:ad(!0,!1)},{status:b.status});return a}})}(0,Z.D)([aw,ax,ay]),(0,d.A)(aw,"00ba3352bae61e90fe842da8971769749305cc5ce8",null),(0,d.A)(ax,"40634a43bd5ceded48b51bd424b01b8e681a76eed0",null),(0,d.A)(ay,"40f13f03b31ba8f5619033b52eaea86644ad879468",null)},30869:(a,b,c)=>{"use strict";c.d(b,{UY:()=>h,X3:()=>j,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g,oc:()=>i});var d=c(39006),e=c(75681),f=c(81329);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={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}},j={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","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.
|
|
5
|
+
`);if(Buffer.byteLength(m,"utf8")>262144)throw new u("Hermes managed settings are too large to back up safely",{code:"HERMES_BACKUP_TOO_LARGE",status:422});await am(e.configPath,f,5242880),await am(e.envPath,g,1048576),await am(e.backupPath,h.snapshot,262144);let n={exists:!0,text:m,mode:384,uid:ao(h.snapshot.uid,()=>process.getuid()),gid:ao(h.snapshot.gid,()=>process.getgid())},o={exists:!0,text:k.text,mode:f.mode??384,uid:ao(f.uid,()=>process.getuid()),gid:ao(f.gid,()=>process.getgid())},q={exists:!0,text:l.text,mode:384,uid:ao(g.uid,()=>process.getuid()),gid:ao(g.gid,()=>process.getgid())};try{await al(e.backupPath,n),await al(e.configPath,o),await al(e.envPath,q)}catch(d){let a=await ap(e.envPath,g,q,1048576),b=await ap(e.configPath,f,o,5242880),c=!!a&&!!b&&await ap(e.backupPath,h.snapshot,n,262144);throw a&&b&&c||console.error("Hermes Apply rollback could not safely restore every file"),d}return j.NextResponse.json({success:!0,message:"Hermes settings applied on the ZevaiRouter host",...ac(e,d),backup:ad(!0,!0)})}catch(a){return ae(a,"Failed to update Hermes settings on the ZevaiRouter host")}})}async function ay(a){return ab(async()=>{try{if(a?.url&&"1"===new URL(a.url,"http://localhost").searchParams.get("discard")){let a=await au(x());as(a);let b=await ag(a.backupPath);if(!b.exists)throw new u("No ZevaiRouter Hermes backup is available to discard",{code:"HERMES_BACKUP_NOT_FOUND",status:404});return await ah(a.backupPath,b),await ak(a.backupPath),j.NextResponse.json({success:!0,discarded:!0,message:"Hermes backup discarded; config and environment settings were not changed",installationTarget:$,configPath:a.configPath,envPath:a.envPath,backup:ad(!1)})}let{paths:b}=await av({useBackupPathsWhenUnavailable:!0}),c=await af(b.configPath,5242880),d=await af(b.envPath,1048576),e=await aq(b);if(!e.backup)throw new u("No ZevaiRouter Hermes backup is available to restore",{code:"HERMES_BACKUP_NOT_FOUND",status:404});let f=e.backup;if(!R(f,{configText:c.text,envText:d.text,configPath:b.configPath,envPath:b.envPath,configMode:c.mode,envMode:d.mode}))throw new u("Hermes managed settings changed after ZevaiRouter applied them",{code:"HERMES_CONFIG_CHANGED",status:409});let g=I(c.text,f.before.model,f.applied.model),h=O(d.text,f.before.env,f.applied.envHash),i={exists:f.before.configFileExisted||"{}"!==g.trim(),text:g,mode:f.before.configMode??384,uid:c.uid,gid:c.gid},k={exists:f.before.envFileExisted||h.trim().length>0,text:h,mode:f.before.envMode??384,uid:d.uid,gid:d.gid};await am(b.configPath,c,5242880),await am(b.envPath,d,1048576),await am(b.backupPath,e.snapshot,262144);try{await al(b.configPath,i),await al(b.envPath,k),await ak(b.backupPath)}catch(f){let a=await ap(b.envPath,d,k,1048576),e=await ap(b.configPath,c,i,5242880);throw a&&e||console.error("Hermes Reset rollback could not safely restore every file"),f}return j.NextResponse.json({success:!0,message:"Previous Hermes settings restored on the ZevaiRouter host",installationTarget:$,configPath:b.configPath,envPath:b.envPath,backup:ad(!1)})}catch(b){let a=ae(b,"Failed to restore Hermes settings on the ZevaiRouter host");if(b instanceof u&&"HERMES_CONFIG_CHANGED"===b.code)return j.NextResponse.json({error:b.message,code:b.code,installationTarget:$,backup:ad(!0,!1)},{status:b.status});return a}})}(0,Z.D)([aw,ax,ay]),(0,d.A)(aw,"00ba3352bae61e90fe842da8971769749305cc5ce8",null),(0,d.A)(ax,"40634a43bd5ceded48b51bd424b01b8e681a76eed0",null),(0,d.A)(ay,"40f13f03b31ba8f5619033b52eaea86644ad879468",null)},30869:(a,b,c)=>{"use strict";c.d(b,{UY:()=>h,X3:()=>j,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g,oc:()=>i});var d=c(39006),e=c(75681),f=c(81329);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={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}},j={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","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.200","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","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","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"next":"16.2.12","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4","sql.js":"1.14.1","yaml":"2.9.0"},"comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.9","dompurify":"^3.4.12","ip-address":"^10.4.0","postcss":"^8.5.10","sharp":"^0.35.0"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.9; modern minimatch uses 5.0.9 directly. Monaco still pins an old DOMPurify; Express and Next may resolve vulnerable body-parser/sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@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","@tailwindcss/postcss":"^4.1.18","@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","better-sqlite3":"^12.6.2","chalk":"^4.1.2","minimatch":"file:vendor/minimatch3-secure","confbox":"^0.2.4","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","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","node-forge":"^1.3.3","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","tailwindcss":"^4","undici":"^8.10.0","uuid":"^14.0.1","vitest":"^4.1.10","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},78335:()=>{},81329:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},96487:()=>{}};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";exports.id=4025,exports.ids=[4025],exports.modules={15180:(a,b,c)=>{c.d(b,{Tk:()=>q,aG:()=>X,Ah:()=>v,h1:()=>W,Q6:()=>V,lF:()=>$,a7:()=>Q,ZM:()=>D,E_:()=>A,RF:()=>O,mW:()=>_,c9:()=>Y,gY:()=>ag,tA:()=>ab,kn:()=>ad,yZ:()=>E,qO:()=>S});var d=c(48249),e=c(67484),f=c(50412),g=c(81220),h=c(12020);let i="__custom__",j="__save__",k=a=>{};function l({value:a,onChange:b,localUrl:c=`http://127.0.0.1:${h.h0.appPort}`,requiresExternalUrl:f=!1,tunnelEnabled:g=!1,tunnelPublicUrl:m="",tailscaleEnabled:n=!1,tailscaleUrl:o="",cloudEnabled:p=!1,cloudUrl:q="",recommendedUrl:r="",recommendedLabel:s="Dashboard URL",withV1:t=!0}){let[u,v]=(0,e.useState)([]),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)("");(0,e.useRef)(!1);let C=(0,e.useRef)(""),D=(0,e.useMemo)(()=>(({localUrl:a,requiresExternalUrl:b,tunnelEnabled:c,tunnelPublicUrl:d,tailscaleEnabled:e,tailscaleUrl:f,cloudEnabled:g,cloudUrl:h,recommendedUrl:j,recommendedLabel:k,savedPresets:l,withV1:m})=>{let n=[],o=a=>{let b;return m?(b=(a||"").replace(/\/+$/,""))?/\/v1$/i.test(b)?`${b.slice(0,-3)}/v1`:`${b}/v1`:"":(a||"").replace(/\/+$/,"")},p=new Set,q=(a,{keepDuplicate:b=!1}={})=>{let c=o(a.url);!c||!b&&p.has(c)||(p.add(c),n.push({...a,label:a.label||c,url:c}))};if(!b){let b=o(a);q({value:"local",label:b,url:b})}if(c&&d){let a=o(d);q({value:"tunnel",label:`Tunnel - ${a}`,url:a})}if(e&&f){let a=o(f);q({value:"tailscale",label:`Tailscale - ${a}`,url:a})}if(g&&h){let a=o(h);q({value:"cloud",label:`Cloud - ${a}`,url:a})}if(j){let a=o(j);q({value:"recommended",label:`${k||"Dashboard URL"} - ${a}`,url:a})}return l.forEach(a=>{q({value:`saved:${a.name}`,label:`Saved: ${a.name} - ${o(a.baseUrl)}`,url:a.baseUrl,saved:!0},{keepDuplicate:!0})}),n.push({value:i,label:"Custom URL...",url:""}),n})({localUrl:c,requiresExternalUrl:f,tunnelEnabled:g,tunnelPublicUrl:m,tailscaleEnabled:n,tailscaleUrl:o,cloudEnabled:p,cloudUrl:q,recommendedUrl:r,recommendedLabel:s,savedPresets:u,withV1:t}),[c,f,g,m,n,o,p,q,r,s,u,t]),E=y.startsWith("saved:"),F=y===i,G=F&&(A||"").trim().length>0;return(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("select",{value:y,onChange:c=>{let d=c.target.value;if(d===j){let b=(a||"").trim();if(!b)return;let c=b;try{c=new URL(b).host}catch{}let d=window.prompt("Save endpoint as:",c);if(!d?.trim())return;let e=[...u.filter(a=>a.name!==d.trim()),{name:d.trim(),baseUrl:b}].sort((a,b)=>a.name.localeCompare(b.name));v(e),k(e);return}if(z(d),d===i){C.current="",B(""),b("");return}let e=D.find(a=>a.value===d);e&&(C.current=e.url,b(e.url))},className:"flex-1 min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[D.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value)),G&&(0,d.jsx)("option",{value:j,children:"+ Save current as..."})]}),E&&(0,d.jsx)("button",{type:"button",onClick:()=>{if(!y.startsWith("saved:"))return;let a=y.slice(6),c=u.filter(b=>b.name!==a);v(c),k(c),z(i),C.current="",B(""),b("")},className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors shrink-0",title:"Delete saved endpoint",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]}),F&&(0,d.jsx)("input",{type:"text",value:A,onChange:a=>{let c=a.target.value;B(c),b(c)},placeholder:t?"https://example.com/v1":"https://example.com",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"})]})}function m({value:a,onChange:b,cloudEnabled:c=!1,className:e=""}){return(0,d.jsx)("input",{type:"password",value:a||"",onChange:a=>b(a.target.value),placeholder:c?"Enter API key":"Enter an active dashboard API key",autoComplete:"off",className:`w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5 ${e}`})}let n=a=>(a||"").replace(/\/+$/,"");function o(a,b={}){if(!a)return!1;let c=n(a),{tunnelPublicUrl:d,tailscaleUrl:e,cloudUrl:f}=b;return!!(/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(c)||d&&c.startsWith(n(d))||e&&c.startsWith(n(e))||f&&c.startsWith(n(f)))}let p=process.env.NEXT_PUBLIC_CLOUD_URL;function q({tool:a,isExpanded:b,onToggle:c,activeProviders:h,modelMappings:i,onModelMappingChange:j,baseUrl:k,hasActiveProviders:n,apiKeys:r,cloudEnabled:s,initialStatus:t,tunnelEnabled:u,tunnelPublicUrl:v,tailscaleEnabled:w,tailscaleUrl:x}){let y,z,A,[B,C]=(0,e.useState)(t||null),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(null),[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(null),[R,S]=(0,e.useState)(""),[T,U]=(0,e.useState)({}),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(""),[Z,$]=(0,e.useState)(!1);(0,e.useRef)(!1);let _=(()=>{if(!B?.installed)return null;let a=B.settings?.env?.ANTHROPIC_BASE_URL;return a?o(a,{tunnelPublicUrl:v,tailscaleUrl:x,cloudUrl:s?p:null})?"configured":"other":"not_configured"})(),aa=async a=>{let b=a.target.checked;$(b),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:b})}).catch(()=>{})},ab=()=>{let a=X||k;return a.endsWith("/v1")?a:`${a}/v1`},ac=async()=>{G(!0),K(null);try{let b={ANTHROPIC_BASE_URL:ab()},c=R?.trim()||(r?.length>0?r[0].key:null)||(s?null:"sk_zevai");c&&(b.ANTHROPIC_AUTH_TOKEN=c),a.defaultModels.forEach(a=>{let c=i[a.alias];c&&a.envKey&&(b[a.envKey]=c)});let d=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:b})}),e=await d.json();d.ok?(K({type:"success",text:"Settings applied successfully!"}),C(a=>({...a,hasBackup:!0,settings:{...a?.settings,env:b}}))):K({type:"error",text:e.error||"Failed to apply settings"})}catch(a){K({type:"error",text:a.message})}finally{G(!1)}},ad=async()=>{I(!0),K(null);try{let b=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),c=await b.json();b.ok?(K({type:"success",text:"Settings reset successfully!"}),a.defaultModels.forEach(a=>j(a.alias,a.defaultValue||"")),S("")):K({type:"error",text:c.error||"Failed to reset settings"})}catch(a){K({type:"error",text:a.message})}finally{I(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/claude.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===_&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===_&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===_&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[D&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Claude CLI..."})]}),!D&&B&&!B.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Claude CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if zevairouter is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>W(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>M(!L),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:L?"expand_less":"help"}),L?"Hide":"How to Install"]})]})]}),L&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!D&&B?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:X||((y=X||k).endsWith("/v1")?y:`${y}/v1`),onChange:Y,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:u,tunnelPublicUrl:v,tailscaleEnabled:w,tailscaleUrl:x})]}),B?.settings?.env?.ANTHROPIC_BASE_URL&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:B.settings.env.ANTHROPIC_BASE_URL})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(m,{value:R,onChange:S,apiKeys:r,cloudEnabled:s})]}),a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:i[a.alias]||"",onChange:b=>j(a.alias,b.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),i[a.alias]&&(0,d.jsx)("button",{onClick:()=>j(a.alias,""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>{Q(a.alias),O(!0)},disabled:!n,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${n?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]},a.alias)),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Filter naming"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,d.jsx)("input",{type:"checkbox",checked:Z,onChange:aa,className:"w-3.5 h-3.5 accent-primary cursor-pointer"}),(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Filter naming requests"})]}),(0,d.jsx)(f.m_,{text:"Intercepts Claude Code's topic-naming requests and returns a fake response locally, saving API tokens.",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] cursor-help",children:"info"})})]})]}),J&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===J.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===J.type?"check_circle":"error"}),(0,d.jsx)("span",{children:J.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:ac,disabled:!n,loading:F,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:ad,disabled:!B?.hasZevai,loading:H,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>W(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:N,onClose:()=>O(!1),onSelect:a=>{P&&j(P,a.value)},selectedModel:P?i[P]:null,activeProviders:h,modelAliases:T,title:`Select model for ${P}`}),(0,d.jsx)(f.uR,{isOpen:V,onClose:()=>W(!1),title:"Claude CLI - Manual Configuration",configs:(z=R&&R.trim()?R:s?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",A={ANTHROPIC_BASE_URL:ab(),ANTHROPIC_AUTH_TOKEN:z},a.defaultModels.forEach(a=>{let b=i[a.alias];b&&a.envKey&&(A[a.envKey]=b)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:A},null,2)}])})]})}var r=c(58962);let s="cx/gpt-5.6-sol";function t(a){let b=String(a||"").trim();if(!b)return"";let c=b.replace(/\/+$/,"");return c.endsWith("/v1")?c:`${c}/v1`}function u(a){let b=String(a||"").trim();return b?"auto-codex"===b||b.startsWith("router/")||b.startsWith("original/")||b.startsWith("account/")||b.startsWith("codex-account/")?b:b.startsWith("codex/")?`cx/${b.slice(6)}`:b.includes("/")?b:b.startsWith("gpt-")||/^o[134]/i.test(b)?`cx/${b}`:b:s}function v({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:n,tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:w,tailscaleUrl:x}){let y,z,A,B,C,[D,E]=(0,e.useState)(n||null),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(null),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)(null),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(""),[T,U]=(0,e.useState)(s),[V,W]=(0,e.useState)(s),[X,Y]=(0,e.useState)(!1),[Z,$]=(0,e.useState)(!1),[_,aa]=(0,e.useState)({}),[ab,ac]=(0,e.useState)(!1),[ad,ae]=(0,e.useState)(""),[af,ag]=(0,e.useState)([]),[ah,ai]=(0,e.useState)(null),aj=(0,e.useRef)(!1),ak=(()=>{if(!D?.installed)return null;if(!D.config)return"not_configured";let a=D.config.match(/base_url\s*=\s*"([^"]+)"/);return o(a?a[1]:"",{tunnelPublicUrl:q,tailscaleUrl:x})?"configured":"other"})(),al=async()=>{G(!0),I(null);try{let a=await r.x6.get("/api/cli-tools/codex-settings");E(a)}catch(a){401===a.status?I({auth:!0,text:"Session expired — please log in again to check the Codex status."}):E({installed:!1,error:a.message})}finally{G(!1)}},am=async()=>{K(!0),O(null);try{let a=R&&R.trim()||k?R:"sk_zevai",b=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:t(ad||h),apiKey:a,model:T,subagentModel:V||T})}),c=await b.json();b.ok?(O({type:"success",text:"Settings applied successfully!"}),al()):O({type:"error",text:c.error||"Failed to apply settings"})}catch(a){O({type:"error",text:a.message})}finally{K(!1)}},an=async()=>{M(!0),O(null);try{let a=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),b=await a.json();a.ok?(O({type:"success",text:"Settings reset successfully!"}),aj.current=!0,U(""),W(""),al()):O({type:"error",text:b.error||"Failed to reset settings"})}catch(a){O({type:"error",text:a.message})}finally{M(!1)}},ao=a=>{U(a),V||W(a)};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/codex.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===ak&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===ak&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===ak&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[F&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Codex CLI..."})]}),!F&&H&&(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-red-500",children:"lock"}),(0,d.jsx)("p",{className:"flex-1 text-sm text-red-600",children:H.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[H.auth&&(0,d.jsxs)("a",{href:"/login",className:"inline-flex items-center px-3 py-1.5 rounded-md border border-red-500/40 bg-red-500/20 text-red-700 dark:text-red-300 text-xs font-medium hover:bg-red-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:"login"}),"Log in again"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:al,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:"refresh"}),"Retry"]})]})]}),!F&&!H&&D&&!D.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Codex CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if zevairouter is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>ac(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>Q(!P),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:P?"expand_less":"help"}),P?"Hide":"How to Install"]})]})]}),P&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," to verify."]}),(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:(0,d.jsxs)("p",{className:"text-text-muted text-xs",children:["Codex uses ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/auth.json"})," with ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"OPENAI_API_KEY"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!F&&!H&&D?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:ad||t(ad||h),onChange:ae,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:w,tailscaleUrl:x})]}),D?.config&&((z=(y=D.config.match(/base_url\s*=\s*"([^"]+)"/))?y[1]:null)?(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:z})]}):null),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(m,{value:R,onChange:S,apiKeys:i,cloudEnabled:k})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:T,onChange:a=>U(a.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),T&&(0,d.jsx)("button",{onClick:()=>U(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>Y(!0),disabled:!j?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm sm:pt-1.5",children:"Gateway"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline sm:pt-1.5",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,d.jsx)("button",{type:"button",onClick:()=>ao("auto-codex"),className:"rounded border border-border bg-surface px-2 py-1 text-xs text-text-main transition-colors hover:border-primary/60 hover:bg-primary/5",children:"Auto Codex"}),(0,d.jsx)("button",{type:"button",onClick:()=>ao("router/gpt-5.6"),className:"rounded border border-border bg-surface px-2 py-1 text-xs text-text-main transition-colors hover:border-primary/60 hover:bg-primary/5",children:"Router Pool"}),(0,d.jsx)("button",{type:"button",title:ah?.label?`Original: ${ah.label}`:"Original Codex account",onClick:()=>ao("original/gpt-5.6"),className:"rounded border border-border bg-surface px-2 py-1 text-xs text-text-main transition-colors hover:border-primary/60 hover:bg-primary/5",children:"Original"})]}),af.length>0&&(0,d.jsxs)("select",{value:T?.startsWith("account/")?T:"",onChange:a=>{a.target.value&&ao(a.target.value)},className:"w-full min-w-0 rounded border border-border bg-surface px-2 py-2 text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[(0,d.jsx)("option",{value:"",children:"Pin specific Codex account..."}),af.map(a=>(0,d.jsxs)("option",{value:`account/${a.slug}`,children:[a.label,a.imported?" (GPTJson)":" (Original)"]},a.id))]})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Subagent Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:V,onChange:a=>W(a.target.value),placeholder:T||"provider/model-id (defaults to main model)",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),V&&(0,d.jsx)("button",{onClick:()=>W(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>$(!0),disabled:!j?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),N&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===N.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===N.type?"check_circle":"error"}),(0,d.jsx)("span",{children:N.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:am,disabled:!R&&k&&i.length>0||!T,loading:J,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:an,disabled:L||!D?.hasZevai,loading:L,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>ac(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:X,onClose:()=>Y(!1),onSelect:a=>{U(a.value),V||W(a.value),Y(!1)},selectedModel:T,activeProviders:j,modelAliases:_,title:"Select Model for Codex"}),(0,d.jsx)(f.rq,{isOpen:Z,onClose:()=>$(!1),onSelect:a=>{W(a.value),$(!1)},selectedModel:V,activeProviders:j,modelAliases:_,title:"Select Subagent Model for Codex"}),(0,d.jsx)(f.uR,{isOpen:ab,onClose:()=>ac(!1),title:"Codex CLI - Manual Configuration",configs:(A=R&&R.trim()?R:k?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",B=u(T),C=u(V||T),[{filename:"~/.codex/config.toml",content:`# ZevaiRouter Configuration for Codex CLI
|
|
2
|
-
model = "${
|
|
1
|
+
"use strict";exports.id=4025,exports.ids=[4025],exports.modules={15180:(a,b,c)=>{c.d(b,{Tk:()=>q,aG:()=>X,Ah:()=>v,h1:()=>W,Q6:()=>V,lF:()=>$,a7:()=>Q,ZM:()=>D,E_:()=>A,RF:()=>O,mW:()=>_,c9:()=>Y,gY:()=>ag,tA:()=>ab,kn:()=>ad,yZ:()=>E,qO:()=>S});var d=c(48249),e=c(67484),f=c(50412),g=c(81220),h=c(12020);let i="__custom__",j="__save__",k=a=>{};function l({value:a,onChange:b,localUrl:c=`http://127.0.0.1:${h.h0.appPort}`,requiresExternalUrl:f=!1,tunnelEnabled:g=!1,tunnelPublicUrl:m="",tailscaleEnabled:n=!1,tailscaleUrl:o="",cloudEnabled:p=!1,cloudUrl:q="",recommendedUrl:r="",recommendedLabel:s="Dashboard URL",withV1:t=!0}){let[u,v]=(0,e.useState)([]),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)("");(0,e.useRef)(!1);let C=(0,e.useRef)(""),D=(0,e.useMemo)(()=>(({localUrl:a,requiresExternalUrl:b,tunnelEnabled:c,tunnelPublicUrl:d,tailscaleEnabled:e,tailscaleUrl:f,cloudEnabled:g,cloudUrl:h,recommendedUrl:j,recommendedLabel:k,savedPresets:l,withV1:m})=>{let n=[],o=a=>{let b;return m?(b=(a||"").replace(/\/+$/,""))?/\/v1$/i.test(b)?`${b.slice(0,-3)}/v1`:`${b}/v1`:"":(a||"").replace(/\/+$/,"")},p=new Set,q=(a,{keepDuplicate:b=!1}={})=>{let c=o(a.url);!c||!b&&p.has(c)||(p.add(c),n.push({...a,label:a.label||c,url:c}))};if(!b){let b=o(a);q({value:"local",label:b,url:b})}if(c&&d){let a=o(d);q({value:"tunnel",label:`Tunnel - ${a}`,url:a})}if(e&&f){let a=o(f);q({value:"tailscale",label:`Tailscale - ${a}`,url:a})}if(g&&h){let a=o(h);q({value:"cloud",label:`Cloud - ${a}`,url:a})}if(j){let a=o(j);q({value:"recommended",label:`${k||"Dashboard URL"} - ${a}`,url:a})}return l.forEach(a=>{q({value:`saved:${a.name}`,label:`Saved: ${a.name} - ${o(a.baseUrl)}`,url:a.baseUrl,saved:!0},{keepDuplicate:!0})}),n.push({value:i,label:"Custom URL...",url:""}),n})({localUrl:c,requiresExternalUrl:f,tunnelEnabled:g,tunnelPublicUrl:m,tailscaleEnabled:n,tailscaleUrl:o,cloudEnabled:p,cloudUrl:q,recommendedUrl:r,recommendedLabel:s,savedPresets:u,withV1:t}),[c,f,g,m,n,o,p,q,r,s,u,t]),E=y.startsWith("saved:"),F=y===i,G=F&&(A||"").trim().length>0;return(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("select",{value:y,onChange:c=>{let d=c.target.value;if(d===j){let b=(a||"").trim();if(!b)return;let c=b;try{c=new URL(b).host}catch{}let d=window.prompt("Save endpoint as:",c);if(!d?.trim())return;let e=[...u.filter(a=>a.name!==d.trim()),{name:d.trim(),baseUrl:b}].sort((a,b)=>a.name.localeCompare(b.name));v(e),k(e);return}if(z(d),d===i){C.current="",B(""),b("");return}let e=D.find(a=>a.value===d);e&&(C.current=e.url,b(e.url))},className:"flex-1 min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[D.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value)),G&&(0,d.jsx)("option",{value:j,children:"+ Save current as..."})]}),E&&(0,d.jsx)("button",{type:"button",onClick:()=>{if(!y.startsWith("saved:"))return;let a=y.slice(6),c=u.filter(b=>b.name!==a);v(c),k(c),z(i),C.current="",B(""),b("")},className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors shrink-0",title:"Delete saved endpoint",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]}),F&&(0,d.jsx)("input",{type:"text",value:A,onChange:a=>{let c=a.target.value;B(c),b(c)},placeholder:t?"https://example.com/v1":"https://example.com",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"})]})}function m({value:a,onChange:b,cloudEnabled:c=!1,className:e=""}){return(0,d.jsx)("input",{type:"password",value:a||"",onChange:a=>b(a.target.value),placeholder:c?"Enter API key":"Enter an active dashboard API key",autoComplete:"off",className:`w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5 ${e}`})}let n=a=>(a||"").replace(/\/+$/,"");function o(a,b={}){if(!a)return!1;let c=n(a),{tunnelPublicUrl:d,tailscaleUrl:e,cloudUrl:f}=b;return!!(/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(c)||d&&c.startsWith(n(d))||e&&c.startsWith(n(e))||f&&c.startsWith(n(f)))}let p=process.env.NEXT_PUBLIC_CLOUD_URL;function q({tool:a,isExpanded:b,onToggle:c,activeProviders:h,modelMappings:i,onModelMappingChange:j,baseUrl:k,hasActiveProviders:n,apiKeys:r,cloudEnabled:s,initialStatus:t,tunnelEnabled:u,tunnelPublicUrl:v,tailscaleEnabled:w,tailscaleUrl:x}){let y,z,A,[B,C]=(0,e.useState)(t||null),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(null),[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(null),[R,S]=(0,e.useState)(""),[T,U]=(0,e.useState)({}),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(""),[Z,$]=(0,e.useState)(!1);(0,e.useRef)(!1);let _=(()=>{if(!B?.installed)return null;let a=B.settings?.env?.ANTHROPIC_BASE_URL;return a?o(a,{tunnelPublicUrl:v,tailscaleUrl:x,cloudUrl:s?p:null})?"configured":"other":"not_configured"})(),aa=async a=>{let b=a.target.checked;$(b),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:b})}).catch(()=>{})},ab=()=>{let a=X||k;return a.endsWith("/v1")?a:`${a}/v1`},ac=async()=>{G(!0),K(null);try{let b={ANTHROPIC_BASE_URL:ab()},c=R?.trim()||(r?.length>0?r[0].key:null)||(s?null:"sk_zevai");c&&(b.ANTHROPIC_AUTH_TOKEN=c),a.defaultModels.forEach(a=>{let c=i[a.alias];c&&a.envKey&&(b[a.envKey]=c)});let d=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:b})}),e=await d.json();d.ok?(K({type:"success",text:"Settings applied successfully!"}),C(a=>({...a,hasBackup:!0,settings:{...a?.settings,env:b}}))):K({type:"error",text:e.error||"Failed to apply settings"})}catch(a){K({type:"error",text:a.message})}finally{G(!1)}},ad=async()=>{I(!0),K(null);try{let b=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),c=await b.json();b.ok?(K({type:"success",text:"Settings reset successfully!"}),a.defaultModels.forEach(a=>j(a.alias,a.defaultValue||"")),S("")):K({type:"error",text:c.error||"Failed to reset settings"})}catch(a){K({type:"error",text:a.message})}finally{I(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/claude.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===_&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===_&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===_&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[D&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Claude CLI..."})]}),!D&&B&&!B.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Claude CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if zevairouter is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>W(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>M(!L),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:L?"expand_less":"help"}),L?"Hide":"How to Install"]})]})]}),L&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!D&&B?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:X||((y=X||k).endsWith("/v1")?y:`${y}/v1`),onChange:Y,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:u,tunnelPublicUrl:v,tailscaleEnabled:w,tailscaleUrl:x})]}),B?.settings?.env?.ANTHROPIC_BASE_URL&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:B.settings.env.ANTHROPIC_BASE_URL})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(m,{value:R,onChange:S,apiKeys:r,cloudEnabled:s})]}),a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:i[a.alias]||"",onChange:b=>j(a.alias,b.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),i[a.alias]&&(0,d.jsx)("button",{onClick:()=>j(a.alias,""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>{Q(a.alias),O(!0)},disabled:!n,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${n?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]},a.alias)),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Filter naming"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,d.jsx)("input",{type:"checkbox",checked:Z,onChange:aa,className:"w-3.5 h-3.5 accent-primary cursor-pointer"}),(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Filter naming requests"})]}),(0,d.jsx)(f.m_,{text:"Intercepts Claude Code's topic-naming requests and returns a fake response locally, saving API tokens.",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] cursor-help",children:"info"})})]})]}),J&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===J.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===J.type?"check_circle":"error"}),(0,d.jsx)("span",{children:J.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:ac,disabled:!n,loading:F,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:ad,disabled:!B?.hasZevai,loading:H,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>W(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:N,onClose:()=>O(!1),onSelect:a=>{P&&j(P,a.value)},selectedModel:P?i[P]:null,activeProviders:h,modelAliases:T,title:`Select model for ${P}`}),(0,d.jsx)(f.uR,{isOpen:V,onClose:()=>W(!1),title:"Claude CLI - Manual Configuration",configs:(z=R&&R.trim()?R:s?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",A={ANTHROPIC_BASE_URL:ab(),ANTHROPIC_AUTH_TOKEN:z},a.defaultModels.forEach(a=>{let b=i[a.alias];b&&a.envKey&&(A[a.envKey]=b)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:A},null,2)}])})]})}var r=c(58962);let s="cx/gpt-5.6-sol";function t(a){let b=String(a||"").trim();if(!b)return"";let c=b.replace(/\/+$/,"");return c.endsWith("/v1")?c:`${c}/v1`}function u(a){let b=String(a||"").trim();return b?"auto-codex"===b||b.startsWith("router/")||b.startsWith("original/")||b.startsWith("account/")||b.startsWith("codex-account/")?b:b.startsWith("codex/")?`cx/${b.slice(6)}`:b.includes("/")?b:b.startsWith("gpt-")||/^o[134]/i.test(b)?`cx/${b}`:b:s}function v({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:n,tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:w,tailscaleUrl:x}){let y,z,A,B,C,D,[E,F]=(0,e.useState)(n||null),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(null),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(""),[U,V]=(0,e.useState)(s),[W,X]=(0,e.useState)(s),[Y,Z]=(0,e.useState)(!1),[$,_]=(0,e.useState)(!1),[aa,ab]=(0,e.useState)({}),[ac,ad]=(0,e.useState)(!1),[ae,af]=(0,e.useState)(""),[ag,ah]=(0,e.useState)([]),[ai,aj]=(0,e.useState)(null),ak=(0,e.useRef)(!1),al=(()=>{if(!E?.installed)return null;if(!E.config)return"not_configured";let a=E.config.match(/base_url\s*=\s*"([^"]+)"/);return o(a?a[1]:"",{tunnelPublicUrl:q,tailscaleUrl:x})?"configured":"other"})(),am=async()=>{H(!0),J(null);try{let a=await r.x6.get("/api/cli-tools/codex-settings");F(a)}catch(a){401===a.status?J({auth:!0,text:"Session expired — please log in again to check the Codex status."}):F({installed:!1,error:a.message})}finally{H(!1)}},an=async()=>{L(!0),P(null);try{let a=S&&S.trim()||k?S:"sk_zevai",b=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:t(ae||h),apiKey:a,model:U,subagentModel:W||U})}),c=await b.json();b.ok?(P({type:"success",text:"Settings applied successfully!"}),am()):P({type:"error",text:c.error||"Failed to apply settings"})}catch(a){P({type:"error",text:a.message})}finally{L(!1)}},ao=async()=>{N(!0),P(null);try{let a=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),b=await a.json();a.ok?(P({type:"success",text:"Settings reset successfully!"}),ak.current=!0,V(""),X(""),am()):P({type:"error",text:b.error||"Failed to reset settings"})}catch(a){P({type:"error",text:a.message})}finally{N(!1)}},ap=a=>{V(a),W||X(a)};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/codex.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===al&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===al&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===al&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[G&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Codex CLI..."})]}),!G&&I&&(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-red-500",children:"lock"}),(0,d.jsx)("p",{className:"flex-1 text-sm text-red-600",children:I.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[I.auth&&(0,d.jsxs)("a",{href:"/login",className:"inline-flex items-center px-3 py-1.5 rounded-md border border-red-500/40 bg-red-500/20 text-red-700 dark:text-red-300 text-xs font-medium hover:bg-red-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:"login"}),"Log in again"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:am,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:"refresh"}),"Retry"]})]})]}),!G&&!I&&E&&!E.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Codex CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if zevairouter is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>ad(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>R(!Q),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:Q?"expand_less":"help"}),Q?"Hide":"How to Install"]})]})]}),Q&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," to verify."]}),(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:(0,d.jsxs)("p",{className:"text-text-muted text-xs",children:["Codex uses ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/auth.json"})," with ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"OPENAI_API_KEY"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!G&&!I&&E?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:ae||t(ae||h),onChange:af,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:w,tailscaleUrl:x})]}),E?.config&&((D=(C=E.config.match(/base_url\s*=\s*"([^"]+)"/))?C[1]:null)?(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:D})]}):null),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(m,{value:S,onChange:T,apiKeys:i,cloudEnabled:k})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:U,onChange:a=>V(a.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),U&&(0,d.jsx)("button",{onClick:()=>V(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>Z(!0),disabled:!j?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm sm:pt-1.5",children:"Gateway"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline sm:pt-1.5",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,d.jsx)("button",{type:"button",onClick:()=>ap("auto-codex"),className:"rounded border border-border bg-surface px-2 py-1 text-xs text-text-main transition-colors hover:border-primary/60 hover:bg-primary/5",children:"Auto Codex"}),(0,d.jsx)("button",{type:"button",onClick:()=>ap("router/gpt-5.6"),className:"rounded border border-border bg-surface px-2 py-1 text-xs text-text-main transition-colors hover:border-primary/60 hover:bg-primary/5",children:"Router Pool"}),(0,d.jsx)("button",{type:"button",title:ai?.label?`Original: ${ai.label}`:"Original Codex account",onClick:()=>ap("original/gpt-5.6"),className:"rounded border border-border bg-surface px-2 py-1 text-xs text-text-main transition-colors hover:border-primary/60 hover:bg-primary/5",children:"Original"})]}),ag.length>0&&(0,d.jsxs)("select",{value:U?.startsWith("account/")?U:"",onChange:a=>{a.target.value&&ap(a.target.value)},className:"w-full min-w-0 rounded border border-border bg-surface px-2 py-2 text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[(0,d.jsx)("option",{value:"",children:"Pin specific Codex account..."}),ag.map(a=>(0,d.jsxs)("option",{value:`account/${a.slug}`,children:[a.label,a.imported?" (GPTJson)":" (Original)"]},a.id))]})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Subagent Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:W,onChange:a=>X(a.target.value),placeholder:U||"provider/model-id (defaults to main model)",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),W&&(0,d.jsx)("button",{onClick:()=>X(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>_(!0),disabled:!j?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),O&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===O.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===O.type?"check_circle":"error"}),(0,d.jsx)("span",{children:O.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:an,disabled:!S&&k&&i.length>0||!U,loading:K,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:ao,disabled:M||!E?.hasZevai,loading:M,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>ad(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:Y,onClose:()=>Z(!1),onSelect:a=>{V(a.value),W||X(a.value),Z(!1)},selectedModel:U,activeProviders:j,modelAliases:aa,title:"Select Model for Codex"}),(0,d.jsx)(f.rq,{isOpen:$,onClose:()=>_(!1),onSelect:a=>{X(a.value),_(!1)},selectedModel:W,activeProviders:j,modelAliases:aa,title:"Select Subagent Model for Codex"}),(0,d.jsx)(f.uR,{isOpen:ac,onClose:()=>ad(!1),title:"Codex CLI - Manual Configuration",configs:(z=S&&S.trim()?S:k?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",A=u(U),B=(y=u(W||U)).startsWith("cx/")?y.slice(3):y,[{filename:"~/.codex/config.toml",content:`# ZevaiRouter Configuration for Codex CLI
|
|
2
|
+
model = "${A}"
|
|
3
3
|
model_provider = "zevai"
|
|
4
4
|
|
|
5
5
|
[model_providers.zevai]
|
|
6
6
|
name = "ZevaiRouter"
|
|
7
|
-
base_url = "${t(
|
|
7
|
+
base_url = "${t(ae||h)}"
|
|
8
8
|
wire_api = "responses"
|
|
9
9
|
requires_openai_auth = true
|
|
10
10
|
|
|
11
11
|
[agents]
|
|
12
|
-
default_subagent_model = "${
|
|
13
|
-
`},{filename:"~/.codex/auth.json",content:JSON.stringify({auth_mode:"apikey",OPENAI_API_KEY:
|
|
12
|
+
default_subagent_model = "${B}"
|
|
13
|
+
`},{filename:"~/.codex/auth.json",content:JSON.stringify({auth_mode:"apikey",OPENAI_API_KEY:z},null,2)}])})]})}let w="/api/cli-tools/grok-build-settings",x="zevai",y=[{id:"general-purpose",label:"General-purpose",help:"Implementation, testing, and delegated coding tasks"},{id:"explore",label:"Explore",help:"Read-only research and codebase investigation"},{id:"plan",label:"Plan",help:"Architecture and implementation planning"}];function z({label:a,help:b,value:c,placeholder:e,onChange:f,onSelect:g,disabled:h}){return(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsxs)("div",{className:"sm:text-right",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-sm",children:a}),b&&(0,d.jsx)("p",{className:"mt-0.5 text-[10px] leading-tight text-text-muted",children:b})]}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-[14px] text-text-muted sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative min-w-0",children:[(0,d.jsx)("input",{type:"text",value:c,onChange:a=>f(a.target.value),placeholder:e,className:"w-full rounded border border-border bg-surface py-2 pl-2 pr-8 text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),c&&(0,d.jsx)("button",{type:"button",onClick:()=>f(""),className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-1 text-text-muted hover:text-red-500",title:"Clear and inherit the main model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{type:"button",onClick:g,disabled:h,className:"w-full whitespace-nowrap rounded border border-border bg-surface px-2 py-2 text-xs text-text-main transition-colors hover:border-primary disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:"Select"})]})}function A({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i=[],activeProviders:j=[],cloudEnabled:k=!1,tunnelEnabled:n=!1,tunnelPublicUrl:p="",tailscaleEnabled:q=!1,tailscaleUrl:r=""}){let[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(null),[H,I]=(0,e.useState)(i[0]?.key||""),[J,K]=(0,e.useState)(""),[L,M]=(0,e.useState)({}),[N,O]=(0,e.useState)(null),[P,Q]=(0,e.useState)(""),[R,S]=(0,e.useState)(!1),T=(0,e.useMemo)(()=>{let a=(P||h||"http://127.0.0.1:1997").replace(/\/+$/,"");return a.endsWith("/v1")?a:`${a}/v1`},[P,h]),U=(0,e.useCallback)(a=>{K(a?.settings?.model?.model||""),M(Object.fromEntries(y.map(b=>[b.id,a?.settings?.subagentModels?.[b.id]?.model]).filter(([,a])=>!!a)))},[]),V=(0,e.useCallback)(async({shouldHydrate:a=!1}={})=>{v(!0);try{let b=await fetch(w,{cache:"no-store"}),c=await b.json();t(c),a&&U(c)}catch(a){t({installed:!1,error:a.message})}finally{v(!1)}},[U]),W=s?.settings?.model,X=s?.installed?W?.base_url?o(W.base_url,{tunnelPublicUrl:p,tailscaleUrl:r})?"configured":"other":"not_configured":null,Y=async()=>{C(!0),G(null);try{let a=Object.fromEntries(y.map(a=>[a.id,L[a.id]?.trim()]).filter(([,a])=>!!a).map(([a,b])=>[a,{model:b}])),b=await fetch(w,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:T,apiKey:H?.trim()||(k?"":"sk_zevai"),model:J.trim(),subagentModels:a})}),c=await b.json();if(!b.ok)throw Error(c.error||"Failed to apply Grok Build settings");G({type:"success",text:"Grok Build now routes through ZevaiRouter."}),await V()}catch(a){G({type:"error",text:a.message})}finally{C(!1)}},Z=async()=>{E(!0),G(null);try{let a=await fetch(w,{method:"DELETE"}),b=await a.json();if(!a.ok)throw Error(b.error||"Failed to reset Grok Build settings");K(""),M({}),G({type:"success",text:"Previous Grok Build model mappings restored."}),await V()}catch(a){G({type:"error",text:a.message})}finally{E(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex cursor-pointer items-start justify-between gap-3 sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)(g.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 rounded-lg object-contain"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"text-sm font-medium",children:a.name}),"configured"===X&&(0,d.jsx)("span",{className:"rounded-full bg-green-500/10 px-1.5 py-0.5 text-[10px] text-green-600",children:"Connected"}),"not_configured"===X&&(0,d.jsx)("span",{className:"rounded-full bg-yellow-500/10 px-1.5 py-0.5 text-[10px] text-yellow-600",children:"Not configured"}),"other"===X&&(0,d.jsx)("span",{className:"rounded-full bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-600",children:"Other endpoint"})]}),(0,d.jsx)("p",{className:"truncate text-xs text-text-muted",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-[20px] text-text-muted transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-4 border-t border-border pt-4",children:[u&&(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Checking Grok Build..."}),!u&&s&&!s.installed&&(0,d.jsxs)("div",{className:"rounded-lg border border-yellow-500/30 bg-yellow-500/10 p-4",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600",children:"Grok Build not detected locally"}),(0,d.jsx)("code",{className:"mt-2 block rounded bg-black/10 p-2 text-xs",children:"curl -fsSL https://x.ai/cli/install.sh | bash"}),(0,d.jsx)(f.$n,{variant:"secondary",size:"sm",className:"mt-3",onClick:()=>S(!0),children:"Manual Config"})]}),!u&&s?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold sm:text-right sm:text-sm",children:"Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-[14px] text-text-muted sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:T,onChange:Q,tunnelEnabled:n,tunnelPublicUrl:p,tailscaleEnabled:q,tailscaleUrl:r})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-[14px] text-text-muted sm:inline",children:"arrow_forward"}),(0,d.jsx)(m,{value:H,onChange:I,cloudEnabled:k})]}),(0,d.jsx)(z,{label:"Main Model",value:J,onChange:K,placeholder:"provider/model-id",onSelect:()=>O("main"),disabled:0===j.length}),(0,d.jsxs)("div",{className:"mt-2 border-t border-border pt-3",children:[(0,d.jsx)("p",{className:"text-xs font-semibold",children:"Subagent model overrides"}),(0,d.jsx)("p",{className:"text-[10px] text-text-muted",children:"Leave blank to inherit the main model."})]}),y.map(a=>(0,d.jsx)(z,{label:a.label,help:a.help,value:L[a.id]||"",onChange:b=>M(c=>({...c,[a.id]:b})),placeholder:`${J||"Main Model"} (inherit)`,onSelect:()=>O(a.id),disabled:0===j.length},a.id))]}),F&&(0,d.jsx)("p",{className:`rounded px-2 py-1.5 text-xs ${"success"===F.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:F.text}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,d.jsx)(f.$n,{size:"sm",loading:B,disabled:!J.trim(),onClick:Y,children:"Apply"}),(0,d.jsx)(f.$n,{size:"sm",variant:"outline",loading:D,disabled:!s?.hasZevai,onClick:Z,children:"Reset"}),(0,d.jsx)(f.$n,{size:"sm",variant:"ghost",onClick:()=>S(!0),children:"Manual Config"})]})]})]}),N&&(0,d.jsx)(f.rq,{isOpen:!0,onClose:()=>O(null),onSelect:a=>{"main"===N?K(a.value):N&&M(b=>({...b,[N]:a.value})),O(null)},selectedModel:"main"===N?J:L[N]||"",activeProviders:j,title:"main"===N?"Select Grok Build Main Model":"Select Subagent Model"}),(0,d.jsx)(f.uR,{isOpen:R,onClose:()=>S(!1),title:"Grok Build Manual Configuration",configs:(()=>{let a=H?.trim()||(k?"<API_KEY_FROM_DASHBOARD>":"sk_zevai"),b=J||"provider/model-id",c=[`[models]
|
|
14
14
|
default = "${x}"`,`[model.${x}]
|
|
15
15
|
model = "${b}"
|
|
16
16
|
base_url = "${T}"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
exports.id=4827,exports.ids=[4827],exports.modules={15754:(a,b,c)=>{"use strict";let d=c(29021),{execFileSync:e}=c(79646),f="win32"===process.platform,g="linux"===process.platform;function h(a){return Number.isInteger(a)&&a>0&&a<=4194304}function i(a,b){try{return e(a,b,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:5e3,windowsHide:!0})}catch{return null}}function j(a,b){if("string"!=typeof a||/[\r\n]/.test(a.trim()))return null;let c=a.trim(),d=c.indexOf(" ("),e=c.lastIndexOf(") ");if(d<1||e<=d+2||Number(c.slice(0,d))!==b)return null;let f=c.slice(e+2).split(/\s+/),g=f[19];return f.length<20||!/^\d+$/.test(g)?null:g}function k(a){if(!h(a))return null;if(g){let b=null;try{b=d.readFileSync(`/proc/${a}/stat`,"utf8")}catch{return null}let c=j(b,a);return c?`${a}:${c}`:null}if(f){let b=String(i("powershell",["-NonInteractive","-NoProfile","-Command",`(Get-Process -Id ${a} -ErrorAction Stop).StartTime.Ticks`])||"").trim();return/^\d+$/.test(b)?`${a}:${b}`:null}let b=String(i("ps",["-o","lstart=","-p",String(a)])||"").split(/\r?\n/).filter(a=>a.trim());if(1!==b.length)return null;let c=b[0].trim();return c?`${a}:${c}`:null}function l(a){if(!h(a))return null;if(f)return String(i("powershell",["-NonInteractive","-NoProfile","-Command",`(Get-CimInstance Win32_Process -Filter "ProcessId=${a}").CommandLine`])||"").trim()||null;let b=String(i("ps",["-o","command=","-p",String(a)])||"").split(/\r?\n/).filter(a=>a.trim());return 1!==b.length?null:b[0].trim()||null}function m(a){if(!h(a))return!1;try{return process.kill(a,0),!0}catch(a){return"EPERM"===a.code||"EACCES"===a.code}}function n(a){let b;try{b=d.readFileSync(a,"utf8").trim()}catch{return null}if(!b)return null;if(/^\d+$/.test(b)){let a=Number(b);return h(a)?{pid:a,startToken:null,kind:null,legacy:!0}:null}try{let a=JSON.parse(b),c=Number(a?.pid);if(!h(c))return null;return{pid:c,startToken:"string"==typeof a.startToken&&a.startToken?a.startToken:null,kind:"string"==typeof a.kind?a.kind:null,legacy:!1}}catch{return null}}a.exports={isValidPid:h,isProcessAlive:m,readProcessStartToken:k,readProcessCommand:l,writePidFile:function(a,b,{kind:c="process"}={}){let e=Number(b);if(!h(e))return!1;let f={v:1,kind:c,pid:e,startToken:k(e),platform:process.platform,writtenAt:new Date().toISOString()};try{let b=`${a}.${process.pid}.tmp`;return d.writeFileSync(b,JSON.stringify(f)),d.renameSync(b,a),!0}catch{return!1}},readPidFile:n,resolveVerifiedPid:function(a,{commandPattern:b=null}={}){let c=n(a);if(!c)return{pid:null,reason:"no_pid_file"};if(!m(c.pid))return{pid:null,reason:"not_running",pidFileStale:!0};let d=k(c.pid);if(c.startToken)return d?d!==c.startToken?{pid:null,reason:"pid_recycled",pidFileStale:!0}:{pid:c.pid,reason:"verified_start_token"}:{pid:null,reason:"identity_unreadable"};if(!b)return{pid:null,reason:"identity_unverifiable"};let e=l(c.pid);return e?b.test(e)?{pid:c.pid,reason:"verified_command"}:{pid:null,reason:"command_mismatch",pidFileStale:!0}:{pid:null,reason:"identity_unreadable"}},removePidFile:function(a){try{d.rmSync(a,{force:!0})}catch{}},parseLinuxStartTime:j}},21719:(a,b,c)=>{"use strict";c.d(b,{g:()=>n,l:()=>m});var d=c(79646),e=c(33873),f=c.n(e),g=c(29021),h=c.n(g),i=c(21820),j=c.n(i),k=c(30869),l=c(15754);async function m({excludePids:a=[]}={}){!function(){try{let a=f().join("win32"===process.platform?f().join(process.env.APPDATA||"","zevai"):f().join(j().homedir(),".zevai"),"mitm",".mitm.pid"),{pid:b}=(0,l.resolveVerifiedPid)(a,{commandPattern:/(mitm[\\/]server\.js|mitm[\\/]+server\b)/i});if(!b)return void(0,l.removePidFile)(a);if("win32"===process.platform)try{(0,d.execSync)(`taskkill /F /T /PID ${b}`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{try{(0,d.execSync)(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${b} -Force"`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{}}else try{(0,d.execSync)(`sudo -n kill -9 ${b} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{try{process.kill(b,"SIGKILL")}catch{}}(0,l.removePidFile)(a)}catch{}}();let b=function(a=[]){let b=[],c=process.platform,e=new Set([process.pid,...Array.isArray(a)?a:[]].filter(a=>null!=a).map(String));if("win32"===c){try{(0,d.execSync)('powershell -NonInteractive -WindowStyle Hidden -Command "Get-WmiObject Win32_Process -Filter \'Name=\\"node.exe\\"\' | Select-Object ProcessId,CommandLine | ConvertTo-Csv -NoTypeInformation"',{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").slice(1).filter(a=>a.trim()).forEach(a=>{let c=a.toLowerCase();if(c.includes("zevai")||c.includes("next-server")||c.includes("\\bin\\app\\")||c.includes("/bin/app/")||c.includes("cli.js")){let c=a.match(/^"(\d+)"/);c&&c[1]&&!e.has(c[1])&&b.push(c[1])}})}catch{}for(let a of["cloudflared","tray_windows_release"])try{let c=`powershell -NonInteractive -WindowStyle Hidden -Command "Get-Process ${a} -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Id"`;(0,d.execSync)(c,{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").forEach(a=>{let c=a.trim();!c||isNaN(c)||e.has(c)||b.push(c)})}catch{}}else try{(0,d.execSync)("ps aux 2>/dev/null",{encoding:"utf8",timeout:5e3}).split("\n").forEach(a=>{if(a.includes("zevai")||a.includes("next-server")||a.includes("cloudflared")||a.includes("/bin/app/")||a.includes("tray_darwin")||a.includes("tray_linux")){let c=a.trim().split(/\s+/)[1];!c||isNaN(c)||e.has(c)||b.push(c)}})}catch{}return b}(a),c=process.platform;b.forEach(a=>{try{"win32"===c?(0,d.execSync)(`taskkill /F /PID ${a} 2>nul`,{stdio:"ignore",shell:!0,windowsHide:!0,timeout:3e3}):(0,d.execSync)(`kill -9 ${a} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{}}),b.length>0&&await new Promise(a=>setTimeout(a,1500))}async function n(a=k.h0.npmPackageName){let b=function(a){try{if(!a||!h().existsSync(a))return a;let b=f().join(process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?f().join(process.env.APPDATA||f().join(j().homedir(),"AppData","Roaming"),"zevai"):f().join(j().homedir(),".zevai"),"runtime","updater"),c=f().join(b,"updater.js");if(h().existsSync(c))try{if(h().statSync(a).size===h().statSync(c).size)return c}catch{}return h().mkdirSync(b,{recursive:!0}),h().copyFileSync(a,c),c}catch{return a}}(function(){if(process.env.UPDATER_SCRIPT_PATH&&h().existsSync(process.env.UPDATER_SCRIPT_PATH))return process.env.UPDATER_SCRIPT_PATH;let a=f().join(process.cwd(),"src","lib","updater","updater.js");if(h().existsSync(a))return a;let b=f().join(process.cwd(),"..","src","lib","updater","updater.js");return h().existsSync(b)?b:a}()),c="1"===process.env.TRAY_MODE,e={cmd:"win32"===process.platform?"npx.cmd":"npx",args:[k.h0.npmPackageName]},g=String(process.env.PORT||k.h0.appPort||1997),i=c?[...e.args,"--tray","--skip-update"]:[...e.args,"--port",g,"--no-browser","--skip-update","--log"],l=(0,d.spawn)(process.execPath,[b],{detached:!0,stdio:"ignore",windowsHide:!0,env:function(a={}){let b={...process.env,...a};return delete b.ZEVAI_LAUNCHD_JOB,delete b.XPC_SERVICE_NAME,b}({UPDATER_PKG_NAME:a||"zevairouter",UPDATER_PORT:String(k.h0.statusPort),UPDATER_TAIL_LINES:String(k.h0.statusLogTailLines),UPDATER_RETRIES:String(k.h0.installRetries),UPDATER_RETRY_DELAY_MS:String(k.h0.installRetryDelayMs),UPDATER_LINGER_MS:String(k.h0.lingerAfterDoneMs),UPDATER_WAIT_MIN_MS:String(k.h0.waitForExitMinMs),UPDATER_WAIT_MAX_MS:String(k.h0.waitForExitMaxMs),UPDATER_WAIT_CHECK_MS:String(k.h0.waitForExitCheckMs),UPDATER_APP_PORT:g,UPDATER_RELAUNCH:"1",UPDATER_RELAUNCH_CMD:e.cmd,UPDATER_RELAUNCH_ARGS:JSON.stringify(i),ZEVAI_SERVER_MODE:c?"":"1"})});l.unref();try{await m({excludePids:[l.pid]})}catch{}return setTimeout(()=>process.exit(0),k.h0.exitDelayMs),l.pid}},30869:(a,b,c)=>{"use strict";c.d(b,{UY:()=>h,X3:()=>j,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g,oc:()=>i});var d=c(39006),e=c(75681),f=c(81329);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={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}},j={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","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.199","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","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","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"next":"16.2.12","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4","sql.js":"1.14.1","yaml":"2.9.0"},"comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.9","dompurify":"^3.4.12","ip-address":"^10.4.0","postcss":"^8.5.10","sharp":"^0.35.0"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.9; modern minimatch uses 5.0.9 directly. Monaco still pins an old DOMPurify; Express and Next may resolve vulnerable body-parser/sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@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","@tailwindcss/postcss":"^4.1.18","@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","better-sqlite3":"^12.6.2","chalk":"^4.1.2","minimatch":"file:vendor/minimatch3-secure","confbox":"^0.2.4","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","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","node-forge":"^1.3.3","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","tailwindcss":"^4","undici":"^8.10.0","uuid":"^14.0.1","vitest":"^4.1.10","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},78335:()=>{},81329:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},96487:()=>{}};
|
|
1
|
+
exports.id=4827,exports.ids=[4827],exports.modules={15754:(a,b,c)=>{"use strict";let d=c(29021),{execFileSync:e}=c(79646),f="win32"===process.platform,g="linux"===process.platform;function h(a){return Number.isInteger(a)&&a>0&&a<=4194304}function i(a,b){try{return e(a,b,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:5e3,windowsHide:!0})}catch{return null}}function j(a,b){if("string"!=typeof a||/[\r\n]/.test(a.trim()))return null;let c=a.trim(),d=c.indexOf(" ("),e=c.lastIndexOf(") ");if(d<1||e<=d+2||Number(c.slice(0,d))!==b)return null;let f=c.slice(e+2).split(/\s+/),g=f[19];return f.length<20||!/^\d+$/.test(g)?null:g}function k(a){if(!h(a))return null;if(g){let b=null;try{b=d.readFileSync(`/proc/${a}/stat`,"utf8")}catch{return null}let c=j(b,a);return c?`${a}:${c}`:null}if(f){let b=String(i("powershell",["-NonInteractive","-NoProfile","-Command",`(Get-Process -Id ${a} -ErrorAction Stop).StartTime.Ticks`])||"").trim();return/^\d+$/.test(b)?`${a}:${b}`:null}let b=String(i("ps",["-o","lstart=","-p",String(a)])||"").split(/\r?\n/).filter(a=>a.trim());if(1!==b.length)return null;let c=b[0].trim();return c?`${a}:${c}`:null}function l(a){if(!h(a))return null;if(f)return String(i("powershell",["-NonInteractive","-NoProfile","-Command",`(Get-CimInstance Win32_Process -Filter "ProcessId=${a}").CommandLine`])||"").trim()||null;let b=String(i("ps",["-o","command=","-p",String(a)])||"").split(/\r?\n/).filter(a=>a.trim());return 1!==b.length?null:b[0].trim()||null}function m(a){if(!h(a))return!1;try{return process.kill(a,0),!0}catch(a){return"EPERM"===a.code||"EACCES"===a.code}}function n(a){let b;try{b=d.readFileSync(a,"utf8").trim()}catch{return null}if(!b)return null;if(/^\d+$/.test(b)){let a=Number(b);return h(a)?{pid:a,startToken:null,kind:null,legacy:!0}:null}try{let a=JSON.parse(b),c=Number(a?.pid);if(!h(c))return null;return{pid:c,startToken:"string"==typeof a.startToken&&a.startToken?a.startToken:null,kind:"string"==typeof a.kind?a.kind:null,legacy:!1}}catch{return null}}a.exports={isValidPid:h,isProcessAlive:m,readProcessStartToken:k,readProcessCommand:l,writePidFile:function(a,b,{kind:c="process"}={}){let e=Number(b);if(!h(e))return!1;let f={v:1,kind:c,pid:e,startToken:k(e),platform:process.platform,writtenAt:new Date().toISOString()};try{let b=`${a}.${process.pid}.tmp`;return d.writeFileSync(b,JSON.stringify(f)),d.renameSync(b,a),!0}catch{return!1}},readPidFile:n,resolveVerifiedPid:function(a,{commandPattern:b=null}={}){let c=n(a);if(!c)return{pid:null,reason:"no_pid_file"};if(!m(c.pid))return{pid:null,reason:"not_running",pidFileStale:!0};let d=k(c.pid);if(c.startToken)return d?d!==c.startToken?{pid:null,reason:"pid_recycled",pidFileStale:!0}:{pid:c.pid,reason:"verified_start_token"}:{pid:null,reason:"identity_unreadable"};if(!b)return{pid:null,reason:"identity_unverifiable"};let e=l(c.pid);return e?b.test(e)?{pid:c.pid,reason:"verified_command"}:{pid:null,reason:"command_mismatch",pidFileStale:!0}:{pid:null,reason:"identity_unreadable"}},removePidFile:function(a){try{d.rmSync(a,{force:!0})}catch{}},parseLinuxStartTime:j}},21719:(a,b,c)=>{"use strict";c.d(b,{g:()=>n,l:()=>m});var d=c(79646),e=c(33873),f=c.n(e),g=c(29021),h=c.n(g),i=c(21820),j=c.n(i),k=c(30869),l=c(15754);async function m({excludePids:a=[]}={}){!function(){try{let a=f().join("win32"===process.platform?f().join(process.env.APPDATA||"","zevai"):f().join(j().homedir(),".zevai"),"mitm",".mitm.pid"),{pid:b}=(0,l.resolveVerifiedPid)(a,{commandPattern:/(mitm[\\/]server\.js|mitm[\\/]+server\b)/i});if(!b)return void(0,l.removePidFile)(a);if("win32"===process.platform)try{(0,d.execSync)(`taskkill /F /T /PID ${b}`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{try{(0,d.execSync)(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${b} -Force"`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{}}else try{(0,d.execSync)(`sudo -n kill -9 ${b} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{try{process.kill(b,"SIGKILL")}catch{}}(0,l.removePidFile)(a)}catch{}}();let b=function(a=[]){let b=[],c=process.platform,e=new Set([process.pid,...Array.isArray(a)?a:[]].filter(a=>null!=a).map(String));if("win32"===c){try{(0,d.execSync)('powershell -NonInteractive -WindowStyle Hidden -Command "Get-WmiObject Win32_Process -Filter \'Name=\\"node.exe\\"\' | Select-Object ProcessId,CommandLine | ConvertTo-Csv -NoTypeInformation"',{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").slice(1).filter(a=>a.trim()).forEach(a=>{let c=a.toLowerCase();if(c.includes("zevai")||c.includes("next-server")||c.includes("\\bin\\app\\")||c.includes("/bin/app/")||c.includes("cli.js")){let c=a.match(/^"(\d+)"/);c&&c[1]&&!e.has(c[1])&&b.push(c[1])}})}catch{}for(let a of["cloudflared","tray_windows_release"])try{let c=`powershell -NonInteractive -WindowStyle Hidden -Command "Get-Process ${a} -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Id"`;(0,d.execSync)(c,{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").forEach(a=>{let c=a.trim();!c||isNaN(c)||e.has(c)||b.push(c)})}catch{}}else try{(0,d.execSync)("ps aux 2>/dev/null",{encoding:"utf8",timeout:5e3}).split("\n").forEach(a=>{if(a.includes("zevai")||a.includes("next-server")||a.includes("cloudflared")||a.includes("/bin/app/")||a.includes("tray_darwin")||a.includes("tray_linux")){let c=a.trim().split(/\s+/)[1];!c||isNaN(c)||e.has(c)||b.push(c)}})}catch{}return b}(a),c=process.platform;b.forEach(a=>{try{"win32"===c?(0,d.execSync)(`taskkill /F /PID ${a} 2>nul`,{stdio:"ignore",shell:!0,windowsHide:!0,timeout:3e3}):(0,d.execSync)(`kill -9 ${a} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{}}),b.length>0&&await new Promise(a=>setTimeout(a,1500))}async function n(a=k.h0.npmPackageName){let b=function(a){try{if(!a||!h().existsSync(a))return a;let b=f().join(process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?f().join(process.env.APPDATA||f().join(j().homedir(),"AppData","Roaming"),"zevai"):f().join(j().homedir(),".zevai"),"runtime","updater"),c=f().join(b,"updater.js");if(h().existsSync(c))try{if(h().statSync(a).size===h().statSync(c).size)return c}catch{}return h().mkdirSync(b,{recursive:!0}),h().copyFileSync(a,c),c}catch{return a}}(function(){if(process.env.UPDATER_SCRIPT_PATH&&h().existsSync(process.env.UPDATER_SCRIPT_PATH))return process.env.UPDATER_SCRIPT_PATH;let a=f().join(process.cwd(),"src","lib","updater","updater.js");if(h().existsSync(a))return a;let b=f().join(process.cwd(),"..","src","lib","updater","updater.js");return h().existsSync(b)?b:a}()),c="1"===process.env.TRAY_MODE,e={cmd:"win32"===process.platform?"npx.cmd":"npx",args:[k.h0.npmPackageName]},g=String(process.env.PORT||k.h0.appPort||1997),i=c?[...e.args,"--tray","--skip-update"]:[...e.args,"--port",g,"--no-browser","--skip-update","--log"],l=(0,d.spawn)(process.execPath,[b],{detached:!0,stdio:"ignore",windowsHide:!0,env:function(a={}){let b={...process.env,...a};return delete b.ZEVAI_LAUNCHD_JOB,delete b.XPC_SERVICE_NAME,b}({UPDATER_PKG_NAME:a||"zevairouter",UPDATER_PORT:String(k.h0.statusPort),UPDATER_TAIL_LINES:String(k.h0.statusLogTailLines),UPDATER_RETRIES:String(k.h0.installRetries),UPDATER_RETRY_DELAY_MS:String(k.h0.installRetryDelayMs),UPDATER_LINGER_MS:String(k.h0.lingerAfterDoneMs),UPDATER_WAIT_MIN_MS:String(k.h0.waitForExitMinMs),UPDATER_WAIT_MAX_MS:String(k.h0.waitForExitMaxMs),UPDATER_WAIT_CHECK_MS:String(k.h0.waitForExitCheckMs),UPDATER_APP_PORT:g,UPDATER_RELAUNCH:"1",UPDATER_RELAUNCH_CMD:e.cmd,UPDATER_RELAUNCH_ARGS:JSON.stringify(i),ZEVAI_SERVER_MODE:c?"":"1"})});l.unref();try{await m({excludePids:[l.pid]})}catch{}return setTimeout(()=>process.exit(0),k.h0.exitDelayMs),l.pid}},30869:(a,b,c)=>{"use strict";c.d(b,{UY:()=>h,X3:()=>j,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g,oc:()=>i});var d=c(39006),e=c(75681),f=c(81329);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={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}},j={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","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.200","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","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","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"next":"16.2.12","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4","sql.js":"1.14.1","yaml":"2.9.0"},"comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.9","dompurify":"^3.4.12","ip-address":"^10.4.0","postcss":"^8.5.10","sharp":"^0.35.0"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.9; modern minimatch uses 5.0.9 directly. Monaco still pins an old DOMPurify; Express and Next may resolve vulnerable body-parser/sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@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","@tailwindcss/postcss":"^4.1.18","@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","better-sqlite3":"^12.6.2","chalk":"^4.1.2","minimatch":"file:vendor/minimatch3-secure","confbox":"^0.2.4","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","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","node-forge":"^1.3.3","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","tailwindcss":"^4","undici":"^8.10.0","uuid":"^14.0.1","vitest":"^4.1.10","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},78335:()=>{},81329:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},96487:()=>{}};
|
|
@@ -3,7 +3,7 @@ MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDA8iMH5c02LilrsERw9t6Pv5Nc
|
|
|
3
3
|
4k6Pz1EaDicBMpdpxKduSZu5OANqUq8er4GM95omAGIOPOh+Nx0spthYA2BqGz+l
|
|
4
4
|
6HRkPJ7S236FZz73In/KVuLnwI8JJ2CbuJap8kvheCCZpmAWpb/cPx/3Vr/J6I17
|
|
5
5
|
XcW+ML9FoCI6AOvOzwIDAQAB
|
|
6
|
-
-----END PUBLIC KEY-----`},39006:a=>{a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.
|
|
6
|
+
-----END PUBLIC KEY-----`},39006:a=>{a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.200","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","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","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"next":"16.2.12","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4","sql.js":"1.14.1","yaml":"2.9.0"},"comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.9","dompurify":"^3.4.12","ip-address":"^10.4.0","postcss":"^8.5.10","sharp":"^0.35.0"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.9; modern minimatch uses 5.0.9 directly. Monaco still pins an old DOMPurify; Express and Next may resolve vulnerable body-parser/sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@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","@tailwindcss/postcss":"^4.1.18","@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","better-sqlite3":"^12.6.2","chalk":"^4.1.2","minimatch":"file:vendor/minimatch3-secure","confbox":"^0.2.4","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","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","node-forge":"^1.3.3","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","tailwindcss":"^4","undici":"^8.10.0","uuid":"^14.0.1","vitest":"^4.1.10","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},52007:(a,b,c)=>{c.d(b,{av:()=>o,gK:()=>m});var d=c(55511),e=c(39609);let f="https://llm.kimchi.dev",g=new Set([429,500,502,503,504]),h=new Map,i=new Map;function j(a){return(("string"==typeof a?a.trim():"")||f).replace(/\/+$/,"")}function k(a){return a?.accessToken||a?.apiKey||a?.providerSpecificData?.apiKey||null}function l(a){if(!a||"object"!=typeof a)return null;let b=a.slug||a.id||a.model||a.name;if("string"!=typeof b||""===b.trim())return null;let c=Array.isArray(a.input_modalities)?a.input_modalities.filter(a=>"text"===a||"image"===a):[],d=a.limits&&"object"==typeof a.limits?a.limits:{},e=Number(d.context_window||a.contextLength||a.context_length)||void 0,f=Number(d.max_output_tokens||a.maxOutputTokens||a.max_output_tokens)||void 0,g="string"==typeof a.provider?a.provider:"",h=!0===a.reasoning,i=Array.isArray(c)&&c.includes("image")?"imageToText":"llm",j={...a,id:b.trim(),name:String(a.display_name||a.displayName||a.name||b).trim(),provider:g,upstreamProvider:g,reasoning:h,inputModalities:c,kind:i,type:i,capabilities:{vision:c.includes("image"),reasoning:h,...e?{contextWindow:e}:{},...f?{maxOutput:f}:{},...g?{upstreamProvider:g}:{}},...e?{contextLength:e}:{},...f?{maxOutputTokens:f}:{}};return"anthropic"===g&&(j.compat={supportsReasoningEffort:!1,cacheControlFormat:"anthropic"}),j}function m(a){if("string"!=typeof a||""===a.trim())return null;let b=a.includes("/")?a.split("/").pop():a;return i.get(b)||i.get(b.toLowerCase())||null}async function n(a,b,c={}){let d=`${j(b)}/v1/models/metadata?include_in_cli=true`,f=new AbortController,h=setTimeout(()=>f.abort(Error("Kimchi models fetch timeout")),2e4),i=c.signal?AbortSignal.any([c.signal,f.signal]):f.signal;try{let b=await (0,e.proxyAwareFetch)(d,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${a}`,"User-Agent":"kimchi/0.1.40"},cache:"no-store",signal:i},c.proxyOptions||null);if(!b.ok){let a=Error(`Kimchi models ${b.status}: ${b.statusText}`);throw a.status=b.status,a.retryable=g.has(b.status),a}let f=await b.json();return Array.isArray(f?.models)?f.models:[]}finally{clearTimeout(h)}}async function o(a,b={}){let c,e,g,m=k(a);if(!m)return null;let p=a?.providerSpecificData?.kimchiEndpoint||b.endpoint||f,q=(g=(e=a?.providerSpecificData||{}).userId||e.username||a?.refreshToken||k(a)||"anonymous",(0,d.createHash)("sha256").update(`kimchi:${j(p)}:${g}`).digest("hex")),r=Date.now();if(!b.forceRefresh){let a=h.get(q);if(a&&a.expiresAt>r)return a}try{c=await n(m,p,b)}catch(a){return b.log?.warn?.("KIMCHI_MODELS",a.message),null}let s=c.map(l).filter(Boolean);if(0===s.length)return null;for(let a of s||[])a?.id&&(i.set(a.id,a),i.set(a.id.toLowerCase(),a));let t={expiresAt:Date.now()+3e5,models:s,rawModels:c};return h.set(q,t),t}},53225:(a,b,c)=>{c.d(b,{EV:()=>l,X5:()=>k});var d=c(55511),e=c(39609),f=c(78085),g=c(30022);let h=new Map,i=new Map;async function j(a,b,c=null){let d,h,i={userId:(h=a?.providerSpecificData||{}).userId,authToken:a.accessToken,name:a.displayName||"",email:a.email||"",machineId:h.machineId||""};if(!i.userId||!i.authToken)return null;let k={Accept:"application/json","Accept-Encoding":"identity",...(0,f.d)(Buffer.alloc(0),g.t6,i)},l=new AbortController,m=null,n=null;try{m=setTimeout(()=>l.abort("timeout"),15e3),b&&"function"==typeof b.addEventListener&&(b.aborted?l.abort(b.reason):(n=()=>l.abort(b.reason),b.addEventListener("abort",n))),d=await (0,e.proxyAwareFetch)(g.t6,{method:"GET",headers:k,signal:l.signal},c)}finally{m&&clearTimeout(m),b&&n&&b.removeEventListener("abort",n)}if(!d.ok)return null;let o=await d.json().catch(()=>null);if(!o||!Array.isArray(o.chat))return null;let p=[],q=new Map;for(let a of o.chat){if(!a||"object"!=typeof a)continue;let b=a.key;if(!b||(q.set(b,a),!1===a.enable))continue;let c=a.display_name||b,d=Number(a.max_input_tokens)||131072;p.push({id:b,name:`${c}`,contextLength:d,isVL:!!a.is_vl,isReasoning:!!a.is_reasoning,maxOutputTokens:Number(a.max_output_tokens)||0,description:a.description||""})}return{models:p,rawConfigs:q}}async function k(a,b,c={}){let d=await l(a,c);if(!d)return null;let e=d.rawConfigs.get(b);return e?{...e,key:b}:null}async function l(a,b={}){let c;if(!a?.accessToken||!(a.providerSpecificData||{}).userId)return null;let e=(c=(a?.providerSpecificData||{}).userId||a?.refreshToken||a?.accessToken||"anonymous",(0,d.createHash)("sha256").update(`qoder:${c}`).digest("hex")),f=Date.now();if(!b.forceRefresh){let a=h.get(e);if(a&&a.expiresAt>f)return a}let g=i.get(e);if(g&&!b.forceRefresh)return g;let k=(async()=>{let c=await j(a,b.signal,b.proxyOptions);if(!c)return null;let d={expiresAt:Date.now()+36e5,models:c.models,rawConfigs:c.rawConfigs,fetched:!0};return h.set(e,d),d})();i.set(e,k);try{return await k}finally{i.get(e)===k&&i.delete(e)}}},78085:(a,b,c)=>{c.d(b,{d:()=>i});var d=c(55511),e=c.n(d),f=c(47293),g=c(30022);function h(a){return e().createHash("md5").update(a).digest("hex")}function i(a,b,c){var d;let i,j;if(!c?.userId)throw Error("cosy: user id is empty");if(!c?.authToken)throw Error("cosy: auth token is empty");let k=Buffer.isBuffer(a)?a:"string"==typeof a?Buffer.from(a,"latin1"):Buffer.from(a||[]),{cosyKey:l,info:m}=(d={uid:c.userId,security_oauth_token:c.authToken,name:c.name||"",aid:"",email:c.email||""},i=(0,f.A)().slice(0,16),j=function(a,b){var c;let d,f,g=Buffer.from(b,"utf8");if(16!==g.length)throw Error(`aes key must be 16 bytes, got ${g.length}`);let h=g.subarray(0,16),i=e().createCipheriv("aes-128-cbc",g,h);i.setAutoPadding(!1);let j=(d=16-(c=Buffer.from(a,"utf8")).length%16,f=Buffer.alloc(c.length+d,d),c.copy(f,0),f);return Buffer.concat([i.update(j),i.final()]).toString("base64")}(JSON.stringify(d),i),{cosyKey:e().publicEncrypt({key:g.pr,padding:e().constants.RSA_PKCS1_PADDING},Buffer.from(i,"utf8")).toString("base64"),info:j}),n=String(Math.floor(Date.now()/1e3)),o=JSON.stringify({version:"v1",requestId:(0,f.A)(),info:m,cosyVersion:g.cT,ideVersion:""}),p=Buffer.from(o,"utf8").toString("base64"),q=function(a){let b;try{b=new URL(a).pathname||""}catch{return""}return b.startsWith("/algo")?b.slice(5):b}(b),r=`${p}
|
|
7
7
|
${l}
|
|
8
8
|
${n}
|
|
9
9
|
${k.toString("latin1")}
|