@yina-npm/openrouterx 0.4.35 → 0.4.38
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/README.md +77 -0
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +4 -2
- package/app/.next/build-manifest.json +4 -4
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/required-server-files.json +4 -4
- package/app/.next/routes-manifest.json +12 -0
- package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/admin/users/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/admin/users/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/admin/users/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/focus-ui/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/focus-ui/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/focus-ui/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/network-analysis/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/network-analysis/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/network-analysis/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/skills/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/user/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/user/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/user/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error/page.js +3 -3
- package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error.html +1 -1
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js +2 -2
- package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_not-found.html +1 -1
- package/app/.next/server/app/_not-found.rsc +5 -6
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +5 -6
- package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_index.segment.rsc +5 -5
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/api/auth/login/route.js +1 -1
- package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/logout/route.js +1 -1
- package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/me/route.js +1 -1
- package/app/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/oidc/callback/route.js +1 -1
- package/app/.next/server/app/api/auth/oidc/callback/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/oidc/start/route.js +1 -1
- package/app/.next/server/app/api/auth/oidc/start/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/oidc/test/route.js +1 -1
- package/app/.next/server/app/api/auth/oidc/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/status/route.js +1 -1
- package/app/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/all-statuses/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cli-tools/all-statuses/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/inject-auth/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/inject-auth/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/restart/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/restart/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/test/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/activate-account/route.js +2 -0
- package/app/.next/server/app/api/cli-tools/codex-settings/activate-account/route.js.nft.json +1 -0
- package/app/.next/server/app/api/cli-tools/codex-settings/activate-account/route_client-reference-manifest.js +1 -0
- package/app/.next/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/copilot-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/cowork-mcp-registry/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/cowork-mcp-tools/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/cowork-settings/route.js +1 -2
- package/app/.next/server/app/api/cli-tools/cowork-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/hermes-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/hermes-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/opencode-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/route.js +1 -1
- package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/health/route.js +1 -1
- package/app/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/init/route.js +1 -1
- package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/route.js +1 -1
- package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/locale/route.js +1 -1
- package/app/.next/server/app/api/locale/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/mcp/[plugin]/message/route.js +1 -1
- package/app/.next/server/app/api/mcp/[plugin]/message/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/mcp/[plugin]/sse/route.js +2 -2
- package/app/.next/server/app/api/mcp/[plugin]/sse/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
- package/app/.next/server/app/api/media-providers/tts/deepgram/voices/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
- package/app/.next/server/app/api/media-providers/tts/inworld/voices/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/media-providers/tts/voices/route.js +1 -1
- package/app/.next/server/app/api/media-providers/tts/voices/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/alias/route.js +1 -1
- package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/availability/route.js +1 -1
- package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/custom/route.js +1 -1
- package/app/.next/server/app/api/models/custom/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/disabled/route.js +1 -1
- package/app/.next/server/app/api/models/disabled/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/route.js +1 -1
- package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/test/route.js +1 -1
- package/app/.next/server/app/api/models/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/network-analysis/route.js +2 -2
- package/app/.next/server/app/api/network-analysis/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +2 -2
- package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
- package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/gitlab/pat/route.js +1 -1
- package/app/.next/server/app/api/oauth/gitlab/pat/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
- package/app/.next/server/app/api/oauth/iflow/cookie/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/route.js +1 -1
- package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test-models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/client/route.js +1 -1
- package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/kilo/free-models/route.js +1 -1
- package/app/.next/server/app/api/providers/kilo/free-models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/route.js +1 -1
- package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/suggested-models/route.js +1 -1
- package/app/.next/server/app/api/providers/suggested-models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/validate/route.js +1 -1
- package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
- package/app/.next/server/app/api/proxy-pools/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/proxy-pools/[id]/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/proxy-pools/route.js +1 -1
- package/app/.next/server/app/api/proxy-pools/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
- package/app/.next/server/app/api/proxy-pools/vercel-deploy/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/database/route.js +1 -1
- package/app/.next/server/app/api/settings/database/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
- package/app/.next/server/app/api/settings/proxy-test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/route.js +1 -1
- package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/shutdown/route.js +1 -1
- package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/startup-notices/route.js +2 -0
- package/app/.next/server/app/api/startup-notices/route.js.nft.json +1 -0
- package/app/.next/server/app/api/startup-notices/route_client-reference-manifest.js +1 -0
- package/app/.next/server/app/api/tags/route.js +1 -1
- package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next/server/app/api/translator/console-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/console-logs/stream/route.js +2 -2
- package/app/.next/server/app/api/translator/console-logs/stream/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/load/route.js +1 -1
- package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/save/route.js +1 -1
- package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/send/route.js +1 -1
- package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/translate/route.js +1 -1
- package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
- package/app/.next/server/app/api/tunnel/disable/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
- package/app/.next/server/app/api/tunnel/enable/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tunnel/status/route.js +1 -1
- package/app/.next/server/app/api/tunnel/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-check/route.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-check/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-disable/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-enable/route.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-enable/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-install/route.js +2 -2
- package/app/.next/server/app/api/tunnel/tailscale-install/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-login/route.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-start-daemon/route.js +2 -2
- package/app/.next/server/app/api/tunnel/tailscale-start-daemon/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/api-keys/route.js +1 -1
- package/app/.next/server/app/api/usage/api-keys/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/chart/route.js +1 -1
- package/app/.next/server/app/api/usage/chart/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/history/route.js +1 -1
- package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/logs/route.js +1 -1
- package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/providers/route.js +1 -1
- package/app/.next/server/app/api/usage/providers/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/request-details/route.js +1 -1
- package/app/.next/server/app/api/usage/request-details/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/stats/route.js +1 -1
- package/app/.next/server/app/api/usage/stats/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/stream/route.js +2 -2
- package/app/.next/server/app/api/usage/stream/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/users/[id]/route.js +1 -1
- package/app/.next/server/app/api/users/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/users/route.js +1 -1
- package/app/.next/server/app/api/users/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/voices/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/voices/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/models/[kind]/route.js +1 -1
- package/app/.next/server/app/api/v1/models/[kind]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/models/info/route.js +1 -1
- package/app/.next/server/app/api/v1/models/info/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/models/route.js +1 -1
- package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/responses/compact/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/compact/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/route.js +1 -1
- package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/search/route.js +1 -1
- package/app/.next/server/app/api/v1/search/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/web/fetch/route.js +1 -1
- package/app/.next/server/app/api/v1/web/fetch/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/version/route.js +1 -1
- package/app/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next/server/app/api/version/shutdown/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/version/update/route.js +1 -1
- package/app/.next/server/app/api/version/update/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback/page.js +2 -2
- package/app/.next/server/app/callback/page.js.nft.json +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback.html +1 -1
- package/app/.next/server/app/callback.rsc +6 -7
- package/app/.next/server/app/callback.segments/_full.segment.rsc +6 -7
- package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/_index.segment.rsc +5 -5
- package/app/.next/server/app/callback.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
- package/app/.next/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.rsc +6 -7
- package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -7
- package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
- package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/favicon.ico/route.js +1 -1
- package/app/.next/server/app/index.html +1 -1
- package/app/.next/server/app/index.rsc +5 -6
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_full.segment.rsc +5 -6
- package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_index.segment.rsc +5 -5
- package/app/.next/server/app/index.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/landing/page.js +2 -2
- package/app/.next/server/app/landing/page.js.nft.json +1 -1
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing.html +1 -1
- package/app/.next/server/app/landing.rsc +6 -7
- package/app/.next/server/app/landing.segments/_full.segment.rsc +6 -7
- package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/_index.segment.rsc +5 -5
- package/app/.next/server/app/landing.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next/server/app/login/page.js +2 -2
- package/app/.next/server/app/login/page.js.nft.json +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login.html +1 -1
- package/app/.next/server/app/login.rsc +6 -7
- package/app/.next/server/app/login.segments/_full.segment.rsc +6 -7
- package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/login.segments/_index.segment.rsc +5 -5
- package/app/.next/server/app/login.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next/server/app/manifest.webmanifest/route.js +2 -2
- package/app/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/page.js +2 -2
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +4 -2
- package/app/.next/server/chunks/1350.js +2 -1
- package/app/.next/server/chunks/2560.js +1 -1
- package/app/.next/server/chunks/{9528.js → 2750.js} +2 -3
- package/app/.next/server/chunks/3110.js +1 -1
- package/app/.next/server/chunks/319.js +3 -3
- package/app/.next/server/chunks/3493.js +2 -1
- package/app/.next/server/chunks/412.js +1 -1
- package/app/.next/server/chunks/4126.js +1 -1
- package/app/.next/server/chunks/{9546.js → 4394.js} +1 -1
- package/app/.next/server/chunks/4922.js +1 -1
- package/app/.next/server/chunks/6393.js +1 -1
- package/app/.next/server/chunks/7595.js +1 -1
- package/app/.next/server/chunks/7774.js +2 -2
- package/app/.next/server/chunks/8520.js +1 -1
- package/app/.next/server/chunks/8866.js +1 -0
- package/app/.next/server/chunks/{8407.js → 9300.js} +2 -2
- package/app/.next/server/chunks/9856.js +1 -0
- package/app/.next/server/middleware-build-manifest.js +1 -1
- package/app/.next/server/middleware.js +2 -2
- package/app/.next/server/next-font-manifest.js +1 -1
- package/app/.next/server/next-font-manifest.json +1 -1
- package/app/.next/server/pages/404.html +1 -1
- package/app/.next/server/pages/500.html +1 -1
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/9qtW6KlzV_D2b828CZp1A/_buildManifest.js +1 -0
- package/app/.next/static/chunks/{1321-b764e2be7fc92cc1.js → 1321-634f2d25db77d618.js} +1 -1
- package/app/.next/static/chunks/{5769-77fa1ce7edb6f970.js → 4072-91de6609dc7e6753.js} +1 -1
- package/app/.next/static/chunks/5095-42d435b0583b2f98.js +2 -0
- package/app/.next/static/chunks/5497-4a0f0c365aea0ea7.js +7 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/admin/keys/page-0d5b57da4abb6962.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/admin/users/{page-2aa2cafdedb17bad.js → page-972703d59d2a3986.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-277c4575cca57177.js → page-e1bd21507327d2bc.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-1a36c238dc35c08e.js → page-211e322f002d5464.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-69469b6440aff8d0.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/console-log/{page-d98ac191ef4ff7e6.js → page-55598932923e41ce.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-c8f75b084231c080.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/focus-ui/{page-90a2c72d1d8122a2.js → page-fb59dea0e48968bf.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-73601a7b09338418.js → page-95d31a6372622fcf.js} +2 -2
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-3ab3cbba76b7cbad.js → page-c64dd1d0b2bd9caf.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-c0ea5a27a13640b9.js → page-9586c0b67f30a21b.js} +2 -2
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-c7fbf29bdbdabee9.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/page-7ae37df256035f59.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/network-analysis/page-0ad4db60f9d14f60.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-8fceba7ec6407143.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-f005d7a30159ce4f.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-c28344f1dd08e982.js → page-31a6e1cb19ebc4d8.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/{page-81f02e4a6ce21347.js → page-0bf3048423ab0128.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{page-a2ab26878f90c869.js → page-9d071b63170b7f71.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-67d99d453bfd8665.js → page-7762d83be0982941.js} +2 -2
- package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/{page-f30757bcda3daba7.js → page-e089ffa4138753d7.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/skills/page-9202b5ce0650c3ab.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/{page-2e9ac7094c9d8bae.js → page-f77dc916ed5a6f99.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/user/page-12765c664b3c1f6d.js +4 -0
- package/app/.next/static/chunks/app/(dashboard)/{layout-823fc1c94bc15026.js → layout-00b66bc0e6b38a14.js} +1 -1
- package/app/.next/static/chunks/app/_global-error/page-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/_not-found/page-7927650ca4037264.js +1 -0
- package/app/.next/static/chunks/app/api/auth/login/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/auth/logout/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/auth/me/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/auth/oidc/callback/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/auth/oidc/start/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/auth/oidc/test/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/auth/status/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/all-statuses/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/inject-auth/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/restart/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/test/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/codex-settings/activate-account/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/cowork-settings/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/auth/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/credentials/update/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/model/resolve/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/models/alias/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/combos/[id]/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/combos/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/health/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/init/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/keys/[id]/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/keys/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/locale/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/mcp/[plugin]/message/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/mcp/[plugin]/sse/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/models/alias/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/models/availability/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/models/custom/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/models/disabled/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/models/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/models/test/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/network-analysis/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/cursor/import/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/import/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/pricing/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/validate/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/models/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/test/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/providers/client/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/providers/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/providers/suggested-models/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/providers/test-batch/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/providers/validate/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/proxy-pools/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/settings/database/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/settings/proxy-test/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/settings/require-login/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/settings/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/shutdown/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/startup-notices/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/tags/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/translator/console-logs/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/translator/load/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/translator/save/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/translator/send/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/translator/translate/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/disable/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/enable/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/status/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/usage/[connectionId]/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/usage/api-keys/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/usage/chart/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/usage/history/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/usage/logs/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/usage/providers/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/usage/request-details/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/usage/request-logs/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/usage/stats/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/usage/stream/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/users/[id]/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/users/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/api/chat/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/audio/speech/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/audio/voices/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/chat/completions/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/embeddings/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/images/generations/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/messages/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/models/[kind]/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/models/info/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/models/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/responses/compact/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/responses/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/search/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1/web/fetch/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/v1beta/models/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/version/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/version/shutdown/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/api/version/update/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/callback/{page-0b64ce6d90bfa697.js → page-97a750f0d51c3dbe.js} +1 -1
- package/app/.next/static/chunks/app/dashboard/settings/pricing/page-9d24273d41fadd28.js +1 -0
- package/app/.next/static/chunks/app/landing/{page-370c3195c36d6e66.js → page-bf42a9c80c1e6776.js} +1 -1
- package/app/.next/static/chunks/app/layout-2f20e93bb64f203d.js +1 -0
- package/app/.next/static/chunks/app/login/page-ef8d8c379c2ef99b.js +1 -0
- package/app/.next/static/chunks/app/manifest.webmanifest/route-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/app/page-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/main-app-d5f2701c08554961.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/global-error-8d51a00b6c966622.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-1879675a73caf73c.js +1 -0
- package/app/.next/static/chunks/{webpack-786de0e184ffd859.js → webpack-b9b0d264958323b9.js} +1 -1
- package/app/.next/static/css/f6642f5333f94810.css +1 -0
- package/app/.next/static/css/fe3b2b4e527f4e99.css +1 -0
- package/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/app/package.json +1 -1
- package/app/server.js +1 -1
- package/hooks/postinstall.js +113 -22
- package/package.json +1 -1
- package/app/.next/server/chunks/1500.js +0 -1
- package/app/.next/server/chunks/702.js +0 -1
- package/app/.next/static/chunks/5095-ca2b12905f37ff4d.js +0 -1
- package/app/.next/static/chunks/5497-83030cc3d92a3519.js +0 -7
- package/app/.next/static/chunks/app/(dashboard)/dashboard/admin/keys/page-c74a5ba01f1699c5.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-f0bae00ac45dd4b0.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-d3de2fdaf4bf9b1e.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-dcb9c64e0d95cee2.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/page-63735cb68f56f3b8.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/network-analysis/page-9c41fc55ad37021e.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-5a350e79586a5c80.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-4c8ad9c53c665fe6.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/skills/page-6dd35c79bb83388b.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/user/page-86f6c9456e2e37bf.js +0 -4
- package/app/.next/static/chunks/app/_global-error/page-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/_not-found/page-8fcd6ba05909a2de.js +0 -1
- package/app/.next/static/chunks/app/api/auth/login/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/auth/logout/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/auth/me/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/auth/oidc/callback/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/auth/oidc/start/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/auth/oidc/test/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/auth/status/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/all-statuses/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/inject-auth/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/restart/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/test/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/cowork-settings/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/auth/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/credentials/update/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/model/resolve/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/models/alias/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/combos/[id]/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/combos/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/health/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/init/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/keys/[id]/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/keys/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/locale/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/mcp/[plugin]/message/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/mcp/[plugin]/sse/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/models/alias/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/models/availability/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/models/custom/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/models/disabled/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/models/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/models/test/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/network-analysis/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/cursor/import/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/import/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/pricing/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/validate/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/models/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/test/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/providers/client/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/providers/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/providers/suggested-models/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/providers/test-batch/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/providers/validate/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/proxy-pools/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/settings/database/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/settings/proxy-test/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/settings/require-login/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/settings/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/shutdown/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/tags/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/translator/console-logs/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/translator/load/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/translator/save/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/translator/send/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/translator/translate/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/disable/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/enable/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/status/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/usage/[connectionId]/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/usage/api-keys/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/usage/chart/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/usage/history/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/usage/logs/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/usage/providers/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/usage/request-details/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/usage/request-logs/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/usage/stats/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/usage/stream/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/users/[id]/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/users/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/api/chat/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/audio/speech/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/audio/voices/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/chat/completions/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/embeddings/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/images/generations/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/messages/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/models/[kind]/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/models/info/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/models/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/responses/compact/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/responses/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/search/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1/web/fetch/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/v1beta/models/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/version/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/version/shutdown/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/api/version/update/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/dashboard/settings/pricing/page-0b53c6deac19b9be.js +0 -1
- package/app/.next/static/chunks/app/layout-55318fbfdf7dfacb.js +0 -1
- package/app/.next/static/chunks/app/login/page-65d3f9612064353f.js +0 -1
- package/app/.next/static/chunks/app/manifest.webmanifest/route-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/app/page-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/main-app-5fb630e627076bfd.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/global-error-8c0dda4490abacd4.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-1172e1764d69e954.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-1172e1764d69e954.js +0 -1
- package/app/.next/static/css/16878fc1d2cbb11a.css +0 -1
- package/app/.next/static/css/2e1b7d528c228ec3.css +0 -1
- package/app/.next/static/foKo1xDQER7YWTSg2B-qB/_buildManifest.js +0 -1
- package/app/.next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
- package/app/.next/static/media/21350d82a1f187e9-s.woff2 +0 -0
- package/app/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
- package/app/.next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
- package/app/.next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
- package/app/.next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
- package/app/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
- /package/app/.next/static/{foKo1xDQER7YWTSg2B-qB → 9qtW6KlzV_D2b828CZp1A}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6620],{16144:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>g});var i=t(95155),a=t(73321),r=t(98500),n=t.n(r),o=t(12115),l=t(35497),c=t(57250),d=t(52679);let m=new Set([]),h={image:"image-combo",tts:"tts-combo"};function x(e){let s=Object.entries(e).some(([e,s])=>e.startsWith("modelLock_")&&s&&new Date(s).getTime()>Date.now());return"unavailable"!==e.testStatus||s?e.testStatus:"active"}function p({provider:e,kind:s,connections:t,isCustom:a,onToggle:r}){let o=d.Q2[e.id],m=!!o?.noAuth,h=t.filter(s=>s.provider===e.id),u=h.filter(e=>{let s=x(e);return"active"===s||"success"===s}).length,g=h.filter(e=>{let s=x(e);return"error"===s||"expired"===s||"unavailable"===s}).length,f=h.length,j=f>0&&h.every(e=>!1===e.isActive);return(0,i.jsx)(n(),{href:`/dashboard/media-providers/${s}/${e.id}`,className:"group",children:(0,i.jsx)(l.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${j?"opacity-50":""}`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${e.color?.length>7?e.color:(e.color??"#888")+"15"}`},children:(0,i.jsx)(c.A,{src:`/providers/${e.id}.png`,alt:e.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:e.textIcon||e.id.slice(0,2).toUpperCase(),fallbackColor:e.color})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h3",{className:"font-semibold text-sm",children:e.name}),(0,i.jsxs)("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[a&&(0,i.jsx)(l.Ex,{variant:"default",size:"sm",children:"Custom"}),m?(0,i.jsx)(l.Ex,{variant:"success",size:"sm",children:"Ready"}):j?(0,i.jsx)(l.Ex,{variant:"default",size:"sm",children:"Disabled"}):0===f?(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"No connections"}):(0,i.jsxs)(i.Fragment,{children:[u>0&&(0,i.jsxs)(l.Ex,{variant:"success",size:"sm",dot:!0,children:[u," Connected"]}),g>0&&(0,i.jsxs)(l.Ex,{variant:"error",size:"sm",dot:!0,children:[g," Error"]}),0===u&&0===g&&(0,i.jsxs)(l.Ex,{variant:"default",size:"sm",children:[f," Added"]})]})]})]})]}),f>0&&(0,i.jsx)("div",{className:"shrink-0 opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:s=>{s.preventDefault(),s.stopPropagation(),r&&r(e.id,j)},children:(0,i.jsx)(l.lM,{size:"sm",checked:!j,onChange:()=>{},title:j?"Enable provider":"Disable provider"})})]})})})}function u({combos:e}){return 0===e.length?null:(0,i.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>(0,i.jsx)(n(),{href:`/dashboard/media-providers/combo/${e.id}`,children:(0,i.jsx)(l.Zp,{padding:"xs",className:"hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors cursor-pointer",children:(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"}),(0,i.jsx)("code",{className:"text-sm font-mono font-medium flex-1 truncate",children:e.name}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-1 sm:shrink-0",children:[e.models.slice(0,6).map((e,s)=>{let t="string"==typeof e?e.split("/")[0]:"",a=d.Q2[t];return(0,i.jsx)("div",{title:a?.name||e,className:"size-5 rounded flex items-center justify-center",style:{backgroundColor:`${a?.color??"#888"}15`},children:(0,i.jsx)(c.A,{src:`/providers/${t}.png`,alt:a?.name||t,size:18,className:"object-contain rounded max-w-[18px] max-h-[18px]",fallbackText:a?.textIcon||t.slice(0,2).toUpperCase(),fallbackColor:a?.color})},`${e}-${s}`)}),e.models.length>6&&(0,i.jsxs)("span",{className:"text-[10px] text-text-muted ml-1",children:["+",e.models.length-6]})]}),(0,i.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:e.models.length}),(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[16px]",children:"chevron_right"})]})})},e.id))})}function g(){let{kind:e}=(0,a.useParams)(),s=(0,a.useRouter)(),[t,r]=(0,o.useState)([]),[n,c]=(0,o.useState)([]),[x,g]=(0,o.useState)([]),[f,j]=(0,o.useState)(!1),[b,v]=(0,o.useState)(!1),[N,C]=(0,o.useState)([]),[y,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{("webSearch"===e||"webFetch"===e)&&s.replace("/dashboard/media-providers/web")},[e,s]);let w=d.rj.find(s=>s.id===e),$="embedding"===e,E=m.has(e);if((0,o.useEffect)(()=>{w&&(fetch("/api/auth/me",{cache:"no-store"}).then(e=>e.json()).then(e=>{k("sub_user"===e.role),C("sub_user"===e.role&&e.allowedProviders||[])}).catch(()=>{}),fetch("/api/providers",{cache:"no-store"}).then(e=>e.json()).then(e=>r(e.connections||[])).catch(()=>{}),($||"image"===e)&&fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(e=>c((e.nodes||[]).filter(e=>e.type===($?"custom-embedding":"custom-image")))).catch(()=>{}),E&&fetch("/api/combos",{cache:"no-store"}).then(e=>e.json()).then(e=>g(e.combos||[])).catch(()=>{}))},[$,E,w]),!w)return(0,a.notFound)();let S=(0,d.o5)(e).filter(e=>!y||N.includes(e.id)),z=x.filter(s=>s.kind===e),_=n.filter(e=>!y||N.includes(e.id)).map(s=>({id:s.id,name:s.name||("image"===e?"Custom Image":"Custom Embedding"),color:"image"===e?"#EC4899":"#6366F1",textIcon:"image"===e?"CI":"CE"})),A=[...S,..._],T=async(e,s)=>{let i=t.filter(s=>s.provider===e);r(t=>t.map(t=>t.provider===e?{...t,isActive:s}:t)),await Promise.allSettled(i.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},O=async()=>{let t=h[e]||`${e}-combo`,i=t,a=1,r=new Set(x.map(e=>e.name));for(;r.has(i);)i=`${t}-${a++}`;let n=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,models:[],kind:e})});if(n.ok){let e=await n.json();s.push(`/dashboard/media-providers/combo/${e.id}`)}else alert((await n.json()).error||"Failed to create combo")};return(0,i.jsxs)("div",{className:"flex flex-col gap-6",children:[!y&&($||"image"===e||E)&&(0,i.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[E&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:O,children:"Create Combo"}),$&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>j(!0),children:"Add Custom Embedding"}),"image"===e&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>v(!0),children:"Add Custom Image"})]}),E&&z.length>0&&(0,i.jsx)(u,{combos:z}),0===A.length?(0,i.jsxs)("div",{className:"text-center py-12 border border-dashed border-border rounded-xl text-text-muted text-sm",children:["No providers support ",(0,i.jsx)("strong",{children:w.label})," yet."]}):(0,i.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[S.map(s=>(0,i.jsx)(p,{provider:s,kind:e,connections:t,onToggle:T},s.id)),_.map(s=>(0,i.jsx)(p,{provider:s,kind:e,connections:t,isCustom:!0,onToggle:T},s.id))]}),$&&(0,i.jsx)(l.x0,{isOpen:f,onClose:()=>j(!1),onCreated:e=>{c(s=>[...s,e]),j(!1)}}),"image"===e&&(0,i.jsx)(l.VW,{isOpen:b,onClose:()=>v(!1),onCreated:e=>{c(s=>[...s,e]),v(!1)}})]})}},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6620],{16144:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>g});var i=t(95155),a=t(73321),r=t(98500),n=t.n(r),o=t(12115),l=t(35497),c=t(57250),d=t(52679);let m=new Set([]),h={image:"image-combo",tts:"tts-combo"};function x(e){let s=Object.entries(e).some(([e,s])=>e.startsWith("modelLock_")&&s&&new Date(s).getTime()>Date.now());return"unavailable"!==e.testStatus||s?e.testStatus:"active"}function p({provider:e,kind:s,connections:t,isCustom:a,onToggle:r}){let o=d.Q2[e.id],m=!!o?.noAuth,h=t.filter(s=>s.provider===e.id),u=h.filter(e=>{let s=x(e);return"active"===s||"success"===s}).length,g=h.filter(e=>{let s=x(e);return"error"===s||"expired"===s||"unavailable"===s}).length,f=h.length,j=f>0&&h.every(e=>!1===e.isActive);return(0,i.jsx)(n(),{href:`/dashboard/media-providers/${s}/${e.id}`,className:"group",children:(0,i.jsx)(l.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${j?"opacity-50":""}`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${e.color?.length>7?e.color:(e.color??"#888")+"15"}`},children:(0,i.jsx)(c.A,{src:`/providers/${e.id}.png`,alt:e.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:e.textIcon||e.id.slice(0,2).toUpperCase(),fallbackColor:e.color})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h3",{className:"font-semibold text-sm",children:e.name}),(0,i.jsxs)("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[a&&(0,i.jsx)(l.Ex,{variant:"default",size:"sm",children:"Custom"}),m?(0,i.jsx)(l.Ex,{variant:"success",size:"sm",children:"Ready"}):j?(0,i.jsx)(l.Ex,{variant:"default",size:"sm",children:"Disabled"}):0===f?(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"No connections"}):(0,i.jsxs)(i.Fragment,{children:[u>0&&(0,i.jsxs)(l.Ex,{variant:"success",size:"sm",dot:!0,children:[u," Connected"]}),g>0&&(0,i.jsxs)(l.Ex,{variant:"error",size:"sm",dot:!0,children:[g," Error"]}),0===u&&0===g&&(0,i.jsxs)(l.Ex,{variant:"default",size:"sm",children:[f," Added"]})]})]})]})]}),f>0&&(0,i.jsx)("div",{className:"shrink-0 opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:s=>{s.preventDefault(),s.stopPropagation(),r&&r(e.id,j)},children:(0,i.jsx)(l.lM,{size:"sm",checked:!j,onChange:()=>{},title:j?"Enable provider":"Disable provider"})})]})})})}function u({combos:e}){return 0===e.length?null:(0,i.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>(0,i.jsx)(n(),{href:`/dashboard/media-providers/combo/${e.id}`,children:(0,i.jsx)(l.Zp,{padding:"xs",className:"hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors cursor-pointer",children:(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"}),(0,i.jsx)("code",{className:"text-sm font-mono font-medium flex-1 truncate",children:e.name}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-1 sm:shrink-0",children:[e.models.slice(0,6).map((e,s)=>{let t="string"==typeof e?e.split("/")[0]:"",a=d.Q2[t];return(0,i.jsx)("div",{title:a?.name||e,className:"size-5 rounded flex items-center justify-center",style:{backgroundColor:`${a?.color??"#888"}15`},children:(0,i.jsx)(c.A,{src:`/providers/${t}.png`,alt:a?.name||t,size:18,className:"object-contain rounded max-w-[18px] max-h-[18px]",fallbackText:a?.textIcon||t.slice(0,2).toUpperCase(),fallbackColor:a?.color})},`${e}-${s}`)}),e.models.length>6&&(0,i.jsxs)("span",{className:"text-[10px] text-text-muted ml-1",children:["+",e.models.length-6]})]}),(0,i.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:e.models.length}),(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[16px]",children:"chevron_right"})]})})},e.id))})}function g(){let{kind:e}=(0,a.useParams)(),s=(0,a.useRouter)(),[t,r]=(0,o.useState)([]),[n,c]=(0,o.useState)([]),[x,g]=(0,o.useState)([]),[f,j]=(0,o.useState)(!1),[b,v]=(0,o.useState)(!1),[N,C]=(0,o.useState)([]),[y,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{("webSearch"===e||"webFetch"===e)&&s.replace("/dashboard/media-providers/web")},[e,s]);let w=d.rj.find(s=>s.id===e),$="embedding"===e,E=m.has(e);if((0,o.useEffect)(()=>{w&&(fetch("/api/auth/me",{cache:"no-store"}).then(e=>e.json()).then(e=>{k("sub_user"===e.role),C("sub_user"===e.role&&e.allowedProviders||[])}).catch(()=>{}),fetch("/api/providers",{cache:"no-store"}).then(e=>e.json()).then(e=>r(e.connections||[])).catch(()=>{}),($||"image"===e)&&fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(e=>c((e.nodes||[]).filter(e=>e.type===($?"custom-embedding":"custom-image")))).catch(()=>{}),E&&fetch("/api/combos",{cache:"no-store"}).then(e=>e.json()).then(e=>g(e.combos||[])).catch(()=>{}))},[$,E,w]),!w)return(0,a.notFound)();let S=(0,d.o5)(e).filter(e=>!y||N.includes(e.id)),z=x.filter(s=>s.kind===e),_=n.filter(e=>!y||N.includes(e.id)).map(s=>({id:s.id,name:s.name||("image"===e?"Custom Image":"Custom Embedding"),color:"image"===e?"#EC4899":"#6366F1",textIcon:"image"===e?"CI":"CE"})),A=[...S,..._],T=async(e,s)=>{let i=t.filter(s=>s.provider===e);r(t=>t.map(t=>t.provider===e?{...t,isActive:s}:t)),await Promise.allSettled(i.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},O=async()=>{let t=h[e]||`${e}-combo`,i=t,a=1,r=new Set(x.map(e=>e.name));for(;r.has(i);)i=`${t}-${a++}`;let n=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,models:[],kind:e})});if(n.ok){let e=await n.json();s.push(`/dashboard/media-providers/combo/${e.id}`)}else alert((await n.json()).error||"Failed to create combo")};return(0,i.jsxs)("div",{className:"flex flex-col gap-6",children:[!y&&($||"image"===e||E)&&(0,i.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[E&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:O,children:"Create Combo"}),$&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>j(!0),children:"Add Custom Embedding"}),"image"===e&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>v(!0),children:"Add Custom Image"})]}),E&&z.length>0&&(0,i.jsx)(u,{combos:z}),0===A.length?(0,i.jsxs)("div",{className:"text-center py-12 border border-dashed border-border rounded-xl text-text-muted text-sm",children:["No providers support ",(0,i.jsx)("strong",{children:w.label})," yet."]}):(0,i.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[S.map(s=>(0,i.jsx)(p,{provider:s,kind:e,connections:t,onToggle:T},s.id)),_.map(s=>(0,i.jsx)(p,{provider:s,kind:e,connections:t,isCustom:!0,onToggle:T},s.id))]}),$&&(0,i.jsx)(l.x0,{isOpen:f,onClose:()=>j(!1),onCreated:e=>{c(s=>[...s,e]),j(!1)}}),"image"===e&&(0,i.jsx)(l.VW,{isOpen:b,onClose:()=>v(!1),onCreated:e=>{c(s=>[...s,e]),v(!1)}})]})}},62268:(e,s,t)=>{Promise.resolve().then(t.bind(t,16144))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=62268)),_N_E=e.O()}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8334],{
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8334],{13080:(e,t,s)=>{Promise.resolve().then(s.bind(s,22662))},22662:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var a=s(95155),l=s(73321),r=s(12115),i=s(98500),n=s.n(i),o=s(35497),c=s(57250),d=s(52679);let m=/^[a-zA-Z0-9_.\-]+$/,x={webSearch:"Web Search",webFetch:"Web Fetch",image:"Text to Image",tts:"Text To Speech"},h={webSearch:"/v1/search",webFetch:"/v1/web/fetch",image:"/v1/images/generations",tts:"/v1/audio/speech"},u={webSearch:e=>({model:e,query:"What is the latest news about AI?",search_type:"web",max_results:5}),webFetch:e=>({model:e,url:"https://example.com",format:"markdown"}),image:e=>({model:e,prompt:"A cute cat playing piano",n:1,size:"1024x1024"}),tts:e=>({model:e,input:"Hello, this is a test.",voice:"alloy"})};function p(e){return"webSearch"===e||"webFetch"===e?"/dashboard/media-providers/web":`/dashboard/media-providers/${e}`}function b(){let{id:e}=(0,l.useParams)(),t=(0,l.useRouter)(),[s,i]=(0,r.useState)(null),[b,f]=(0,r.useState)(!0),[j,g]=(0,r.useState)(""),[w,y]=(0,r.useState)(""),[v,N]=(0,r.useState)([]),[k,S]=(0,r.useState)(!1),[U,$]=(0,r.useState)(!1),[C,O]=(0,r.useState)([]),[_,T]=(0,r.useState)(!1),[R,A]=(0,r.useState)(null),[L,P]=(0,r.useState)(""),[E,z]=(0,r.useState)(""),[D,F]=(0,r.useState)([]),[M,I]=(0,r.useState)({}),J=async()=>{try{let[t,s,a,l,r,n]=await Promise.all([fetch(`/api/combos/${e}`,{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"}),fetch("/api/usage/logs",{cache:"no-store"}),fetch("/api/keys",{cache:"no-store"}),fetch("/api/providers",{cache:"no-store"}),fetch("/api/models/alias",{cache:"no-store"})]);if(n.ok&&I((await n.json()).aliases||{}),l.ok){let e=await l.json();z((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}if(r.ok&&F((await r.json()).connections||[]),!t.ok){i(null),f(!1);return}let o=await t.json();i(o),g(o.name),N(o.models||[]);let c=s.ok?await s.json():{};S(c.comboStrategies?.[o.name]?.fallbackStrategy==="round-robin");let d=a.ok?await a.json():[];O(d.filter(e=>"string"==typeof e&&e.includes(o.name)).slice(0,50))}catch{}f(!1)};(0,r.useEffect)(()=>{J()},[e]);let W=e=>e.trim()?m.test(e)?(y(""),!0):(y("Only letters, numbers, -, _ and ."),!1):(y("Name is required"),!1),H=async t=>{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return!!s.ok||(alert((await s.json()).error||"Failed to save"),!1)},Z=async()=>{!W(j)||j===s.name||await H({name:j})&&await J()},q=async e=>{let t=e?.value||e;if(!t||v.includes(t))return;let s=[...v,t];N(s),await H({models:s})},B=async e=>{let t=e?.value||e;if(!t||!v.includes(t))return;let s=v.filter(e=>e!==t);N(s),await H({models:s})},Y=async e=>{let t=v.filter((t,s)=>s!==e);N(t),await H({models:t})},G=async(e,t)=>{let s=[...v],a=e+t;a<0||a>=s.length||([s[e],s[a]]=[s[a],s[e]],N(s),await H({models:s}))},K=async e=>{S(e);let t=await fetch("/api/settings",{cache:"no-store"}),a={...(t.ok?await t.json():{}).comboStrategies||{}};e?a[s.name]={fallbackStrategy:"round-robin"}:delete a[s.name],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:a})})},Q=async()=>{!confirm(`Delete combo "${s.name}"?`)||(await fetch(`/api/combos/${e}`,{method:"DELETE"})).ok&&t.push(p(s.kind))},V=async()=>{if(T(!0),A(null),P(""),R?.audioUrl)try{URL.revokeObjectURL(R.audioUrl)}catch{}if(R?.imageUrl?.startsWith("blob:"))try{URL.revokeObjectURL(R.imageUrl)}catch{}let e=Date.now();try{let t=h[s.kind],a=u[s.kind](s.name),l={"Content-Type":"application/json"};E&&(l.Authorization=`Bearer ${E}`);let r=await fetch(`/api${t}`,{method:"POST",headers:l,body:JSON.stringify(a)}),i=Date.now()-e;if(!r.ok){let e=await r.json().catch(()=>({}));P(e?.error?.message||e?.error||`HTTP ${r.status}`),A({json:JSON.stringify(e,null,2),latencyMs:i});return}let n=r.headers.get("content-type")||"";if(n.startsWith("image/")){let e=await r.blob();A({imageUrl:URL.createObjectURL(e),latencyMs:i});return}if(n.startsWith("audio/")||"application/octet-stream"===n){let e=await r.blob();A({audioUrl:URL.createObjectURL(e),latencyMs:i});return}let o=await r.json(),c=o?.data?.[0],d=c?.b64_json?`data:image/png;base64,${c.b64_json}`:c?.url||"";A({json:JSON.stringify(function e(t){if(!t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(e);let s={};for(let[a,l]of Object.entries(t))s[a]="b64_json"===a&&"string"==typeof l&&l.length>100?`<${l.length} chars base64>`:e(l);return s}(o),null,2),imageUrl:d,latencyMs:i})}catch(e){P(e.message||"Network error")}T(!1)};if(b)return(0,a.jsx)("div",{className:"text-text-muted text-sm",children:"Loading..."});if(!s)return(0,l.notFound)();let X=x[s.kind]||d.rj.find(e=>e.id===s.kind)?.label||"Combo",ee=h[s.kind],et=s.kind&&u[s.kind]?u[s.kind](s.name):null,es=ee?`curl -X POST http://localhost:20502${ee} \\
|
|
2
2
|
-H "Content-Type: application/json" \\
|
|
3
3
|
-H "Authorization: Bearer ${E||"YOUR_KEY"}" \\
|
|
4
|
-
-d '${JSON.stringify(et)}'`:"",ea=p(s.kind);return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,a.jsx)(n(),{href:ea,className:"text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined",children:"arrow_back"})}),(0,a.jsx)("div",{className:"size-10 rounded-lg bg-primary/10 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"layers"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[X," Combo"]}),(0,a.jsx)("code",{className:"text-lg font-semibold font-mono",children:s.name})]})]}),(0,a.jsx)(o.$n,{variant:"outline",icon:"delete",onClick:Q,className:"text-red-500 border-red-200 hover:bg-red-50",children:"Delete"})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Settings"}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(o.pd,{label:"Combo Name",value:j,onChange:e=>{g(e.target.value),W(e.target.value)},onBlur:Z,error:w}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, -, _ and ."})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Round Robin"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Rotate providers across requests instead of strict fallback order."})]}),(0,a.jsx)(o.lM,{checked:k,onChange:K})]})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Providers"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Tried in order (top-down) or rotated when round-robin is on."})]}),(0,a.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>$(!0),children:"Add Provider"})]}),0===v.length?(0,a.jsx)("div",{className:"text-center py-6 border border-dashed border-border rounded-lg text-text-muted text-sm",children:"No providers yet."}):(0,a.jsx)("div",{className:"flex flex-col gap-2",children:v.map((e,t)=>{let{providerId:s,model:l}=function(e){if("string"!=typeof e)return{providerId:"",model:""};let t=e.indexOf("/");return t<0?{providerId:e,model:""}:{providerId:e.slice(0,t),model:e.slice(t+1)}}(e),r=d.Q2[s];return(0,a.jsxs)("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted w-5 text-center",children:t+1}),(0,a.jsx)(c.A,{src:`/providers/${s}.png`,alt:r?.name||s,size:24,className:"object-contain rounded shrink-0",fallbackText:r?.textIcon||s.slice(0,2).toUpperCase(),fallbackColor:r?.color}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"text-sm font-medium truncate",children:r?.name||s}),l&&(0,a.jsx)("code",{className:"text-[10px] text-text-muted font-mono truncate block",children:l})]}),(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,a.jsx)("button",{onClick:()=>G(t,-1),disabled:0===t,className:`p-1 rounded ${0===t?"text-text-muted/20":"text-text-muted hover:text-primary hover:bg-black/5"}`,title:"Move up",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})}),(0,a.jsx)("button",{onClick:()=>G(t,1),disabled:t===v.length-1,className:`p-1 rounded ${t===v.length-1?"text-text-muted/20":"text-text-muted hover:text-primary hover:bg-black/5"}`,title:"Move down",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_downward"})}),(0,a.jsx)("button",{onClick:()=>Y(t),className:"p-1 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10",title:"Remove",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]})]},`${e}-${t}`)})})]}),s.kind&&ee&&(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Test Example"}),(0,a.jsx)(o.$n,{size:"sm",icon:"play_arrow",onClick:V,disabled:_||0===v.length,children:_?"Running...":"Run"})]}),(0,a.jsx)("pre",{className:"text-xs font-mono bg-black/[0.03] dark:bg-white/[0.03] p-3 rounded-lg overflow-x-auto whitespace-pre-wrap break-all",children:es}),L&&(0,a.jsx)("p",{className:"mt-3 text-xs text-red-500 break-words",children:L}),R&&(0,a.jsxs)("div",{className:"mt-3 flex flex-col gap-3",children:[null!=R.latencyMs&&(0,a.jsxs)("span",{className:"text-[11px] text-text-muted",children:["⚡ ",R.latencyMs,"ms"]}),R.imageUrl&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,a.jsxs)("a",{href:R.imageUrl,download:"image.png",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,a.jsx)("img",{src:R.imageUrl,alt:"Generated",className:"max-w-full rounded-lg border border-border"})]}),R.audioUrl&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,a.jsxs)("a",{href:R.audioUrl,download:"speech.mp3",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,a.jsx)("audio",{controls:!0,src:R.audioUrl,className:"w-full"})]}),R.json&&(0,a.jsx)("pre",{className:"text-xs font-mono bg-black/[0.03] dark:bg-white/[0.03] p-3 rounded-lg overflow-auto max-h-[300px] whitespace-pre-wrap break-all",children:R.json})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Usage Logs"}),0===C.length?(0,a.jsx)("p",{className:"text-xs text-text-muted italic",children:"No usage yet."}):(0,a.jsx)("pre",{className:"text-[11px] font-mono bg-black/[0.03] dark:bg-white/[0.03] p-3 rounded-lg overflow-auto max-h-[400px] whitespace-pre-wrap",children:C.join("\n")})]}),(0,a.jsx)(o.rq,{isOpen:U,onClose:()=>$(!1),onSelect:q,onDeselect:B,activeProviders:D,modelAliases:M,title:`Add ${X} Model`,kindFilter:s.kind,addedModelValues:v,closeOnSelect:!1})]})}}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=
|
|
4
|
+
-d '${JSON.stringify(et)}'`:"",ea=p(s.kind);return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,a.jsx)(n(),{href:ea,className:"text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined",children:"arrow_back"})}),(0,a.jsx)("div",{className:"size-10 rounded-lg bg-primary/10 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"layers"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[X," Combo"]}),(0,a.jsx)("code",{className:"text-lg font-semibold font-mono",children:s.name})]})]}),(0,a.jsx)(o.$n,{variant:"outline",icon:"delete",onClick:Q,className:"text-red-500 border-red-200 hover:bg-red-50",children:"Delete"})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Settings"}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(o.pd,{label:"Combo Name",value:j,onChange:e=>{g(e.target.value),W(e.target.value)},onBlur:Z,error:w}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, -, _ and ."})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Round Robin"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Rotate providers across requests instead of strict fallback order."})]}),(0,a.jsx)(o.lM,{checked:k,onChange:K})]})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Providers"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Tried in order (top-down) or rotated when round-robin is on."})]}),(0,a.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>$(!0),children:"Add Provider"})]}),0===v.length?(0,a.jsx)("div",{className:"text-center py-6 border border-dashed border-border rounded-lg text-text-muted text-sm",children:"No providers yet."}):(0,a.jsx)("div",{className:"flex flex-col gap-2",children:v.map((e,t)=>{let{providerId:s,model:l}=function(e){if("string"!=typeof e)return{providerId:"",model:""};let t=e.indexOf("/");return t<0?{providerId:e,model:""}:{providerId:e.slice(0,t),model:e.slice(t+1)}}(e),r=d.Q2[s];return(0,a.jsxs)("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted w-5 text-center",children:t+1}),(0,a.jsx)(c.A,{src:`/providers/${s}.png`,alt:r?.name||s,size:24,className:"object-contain rounded shrink-0",fallbackText:r?.textIcon||s.slice(0,2).toUpperCase(),fallbackColor:r?.color}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"text-sm font-medium truncate",children:r?.name||s}),l&&(0,a.jsx)("code",{className:"text-[10px] text-text-muted font-mono truncate block",children:l})]}),(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,a.jsx)("button",{onClick:()=>G(t,-1),disabled:0===t,className:`p-1 rounded ${0===t?"text-text-muted/20":"text-text-muted hover:text-primary hover:bg-black/5"}`,title:"Move up",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})}),(0,a.jsx)("button",{onClick:()=>G(t,1),disabled:t===v.length-1,className:`p-1 rounded ${t===v.length-1?"text-text-muted/20":"text-text-muted hover:text-primary hover:bg-black/5"}`,title:"Move down",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_downward"})}),(0,a.jsx)("button",{onClick:()=>Y(t),className:"p-1 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10",title:"Remove",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]})]},`${e}-${t}`)})})]}),s.kind&&ee&&(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Test Example"}),(0,a.jsx)(o.$n,{size:"sm",icon:"play_arrow",onClick:V,disabled:_||0===v.length,children:_?"Running...":"Run"})]}),(0,a.jsx)("pre",{className:"text-xs font-mono bg-black/[0.03] dark:bg-white/[0.03] p-3 rounded-lg overflow-x-auto whitespace-pre-wrap break-all",children:es}),L&&(0,a.jsx)("p",{className:"mt-3 text-xs text-red-500 break-words",children:L}),R&&(0,a.jsxs)("div",{className:"mt-3 flex flex-col gap-3",children:[null!=R.latencyMs&&(0,a.jsxs)("span",{className:"text-[11px] text-text-muted",children:["⚡ ",R.latencyMs,"ms"]}),R.imageUrl&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,a.jsxs)("a",{href:R.imageUrl,download:"image.png",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,a.jsx)("img",{src:R.imageUrl,alt:"Generated",className:"max-w-full rounded-lg border border-border"})]}),R.audioUrl&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,a.jsxs)("a",{href:R.audioUrl,download:"speech.mp3",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,a.jsx)("audio",{controls:!0,src:R.audioUrl,className:"w-full"})]}),R.json&&(0,a.jsx)("pre",{className:"text-xs font-mono bg-black/[0.03] dark:bg-white/[0.03] p-3 rounded-lg overflow-auto max-h-[300px] whitespace-pre-wrap break-all",children:R.json})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Usage Logs"}),0===C.length?(0,a.jsx)("p",{className:"text-xs text-text-muted italic",children:"No usage yet."}):(0,a.jsx)("pre",{className:"text-[11px] font-mono bg-black/[0.03] dark:bg-white/[0.03] p-3 rounded-lg overflow-auto max-h-[400px] whitespace-pre-wrap",children:C.join("\n")})]}),(0,a.jsx)(o.rq,{isOpen:U,onClose:()=>$(!1),onSelect:q,onDeselect:B,activeProviders:D,modelAliases:M,title:`Add ${X} Model`,kindFilter:s.kind,addedModelValues:v,closeOnSelect:!1})]})}}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=13080)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9260],{71088:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>b});var r=t(95155),a=t(98500),i=t.n(a),l=t(12115),o=t(73321),c=t(35497),n=t(57250),d=t(52679);function m(e){let s=Object.entries(e).some(([e,s])=>e.startsWith("modelLock_")&&s&&new Date(s).getTime()>Date.now());return"unavailable"!==e.testStatus||s?e.testStatus:"active"}function x({provider:e,kind:s,connections:t}){let a=d.Q2[e.id],l=!!a?.noAuth,o=t.filter(s=>s.provider===e.id),h=o.filter(e=>{let s=m(e);return"active"===s||"success"===s}).length,p=o.filter(e=>{let s=m(e);return"error"===s||"expired"===s||"unavailable"===s}).length,b=o.length,u=b>0&&o.every(e=>!1===e.isActive);return(0,r.jsx)(i(),{href:`/dashboard/media-providers/${s}/${e.id}`,className:"group",children:(0,r.jsx)(c.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${u?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${e.color?.length>7?e.color:(e.color??"#888")+"15"}`},children:(0,r.jsx)(n.A,{src:`/providers/${e.id}.png`,alt:e.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:e.textIcon||e.id.slice(0,2).toUpperCase(),fallbackColor:e.color})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold text-sm",children:e.name}),(0,r.jsx)("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:l?(0,r.jsx)(c.Ex,{variant:"success",size:"sm",children:"Ready"}):u?(0,r.jsx)(c.Ex,{variant:"default",size:"sm",children:"Disabled"}):0===b?(0,r.jsx)("span",{className:"text-xs text-text-muted",children:"No connections"}):(0,r.jsxs)(r.Fragment,{children:[h>0&&(0,r.jsxs)(c.Ex,{variant:"success",size:"sm",dot:!0,children:[h," Connected"]}),p>0&&(0,r.jsxs)(c.Ex,{variant:"error",size:"sm",dot:!0,children:[p," Error"]}),0===h&&0===p&&(0,r.jsxs)(c.Ex,{variant:"default",size:"sm",children:[b," Added"]})]})})]})]})})})}function h({combos:e}){return 0===e.length?(0,r.jsx)("p",{className:"text-xs text-text-muted italic",children:"No combos yet."}):(0,r.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>(0,r.jsx)(i(),{href:`/dashboard/media-providers/combo/${e.id}`,children:(0,r.jsx)(c.Zp,{padding:"xs",className:"hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors cursor-pointer",children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"}),(0,r.jsx)("code",{className:"text-sm font-mono font-medium flex-1 truncate",children:e.name}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1 sm:shrink-0",children:[e.models.slice(0,6).map((e,s)=>{let t="string"==typeof e?e.split("/")[0]:"",a=d.Q2[t];return(0,r.jsx)("div",{title:a?.name||e,className:"size-5 rounded flex items-center justify-center",style:{backgroundColor:`${a?.color??"#888"}15`},children:(0,r.jsx)(n.A,{src:`/providers/${t}.png`,alt:a?.name||t,size:18,className:"object-contain rounded max-w-[18px] max-h-[18px]",fallbackText:a?.textIcon||t.slice(0,2).toUpperCase(),fallbackColor:a?.color})},`${e}-${s}`)}),e.models.length>6&&(0,r.jsxs)("span",{className:"text-[10px] text-text-muted ml-1",children:["+",e.models.length-6]})]}),(0,r.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:e.models.length}),(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[16px]",children:"chevron_right"})]})})},e.id))})}function p({title:e,icon:s,kind:t,providers:a,connections:i,combos:l,onCreateCombo:o}){return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-3",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary",children:s}),(0,r.jsx)("h2",{className:"text-base font-semibold",children:e}),(0,r.jsxs)("span",{className:"text-xs text-text-muted",children:["(",a.length," providers \xb7 ",l.length," combos)"]})]}),o&&(0,r.jsx)(c.$n,{size:"sm",icon:"add",onClick:o,children:"Create Combo"})]}),l.length>0&&(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(h,{combos:l})}),0===a.length?(0,r.jsx)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl text-text-muted text-sm",children:"No providers."}):(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:a.map(e=>(0,r.jsx)(x,{provider:e,kind:t,connections:i},e.id))})]})}function b(){let e=(0,o.useRouter)(),[s,t]=(0,l.useState)([]),[a,i]=(0,l.useState)([]),[c,n]=(0,l.useState)([]),[m,x]=(0,l.useState)(!1),h=async()=>{try{let[e,s,r]=await Promise.all([fetch("/api/auth/me",{cache:"no-store"}),fetch("/api/providers",{cache:"no-store"}),fetch("/api/combos",{cache:"no-store"})]);if(e.ok){let s=await e.json();x("sub_user"===s.role),n("sub_user"===s.role&&s.allowedProviders||[])}s.ok&&t((await s.json()).connections||[]),r.ok&&i((await r.json()).combos||[])}catch{}};(0,l.useEffect)(()=>{h()},[]);let b=(0,d.o5)("webSearch").filter(e=>!m||c.includes(e.id)),u=(0,d.o5)("webFetch").filter(e=>!m||c.includes(e.id)),f=a.filter(e=>"webSearch"===e.kind),j=a.filter(e=>"webFetch"===e.kind),v=async s=>{let t="webSearch"===s?"search-combo":"fetch-combo",r=t,i=1,l=new Set(a.map(e=>e.name));for(;l.has(r);)r=`${t}-${i++}`;let o=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r,models:[],kind:s})});if(o.ok){let s=await o.json();e.push(`/dashboard/media-providers/combo/${s.id}`)}else alert((await o.json()).error||"Failed to create combo")};return(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(p,{title:"Web Search",icon:"search",kind:"webSearch",providers:b,connections:s,combos:f,onCreateCombo:m?void 0:()=>v("webSearch")}),(0,r.jsx)("div",{className:"border-t border-border"}),(0,r.jsx)(p,{title:"Web Fetch",icon:"travel_explore",kind:"webFetch",providers:u,connections:s,combos:j,onCreateCombo:m?void 0:()=>v("webFetch")})]})}},87854:(e,s,t)=>{Promise.resolve().then(t.bind(t,71088))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=87854)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6607],{23879:(e,s,a)=>{"use strict";a.d(s,{default:()=>l});var t=a(95155),n=a(12115),i=a(3534),d=a(28777),o=a(52679),c=a(70151);function l(){let[e,s]=(0,n.useState)([]),[a,l]=(0,n.useState)([]),[r,u]=(0,n.useState)({}),[h,f]=(0,n.useState)(!1),[p,w]=(0,n.useState)(null),[g,v]=(0,n.useState)({running:!1,certExists:!1,dnsStatus:{},hasCachedPassword:!1});(0,n.useEffect)(()=>{fetch("/api/auth/me").then(e=>e.json()).then(e=>{"sub_user"===e.role&&(window.location.href="/dashboard/usage")}).catch(()=>{}),S(),y(),k(),b()},[]);let S=async()=>{try{let e=await fetch("/api/providers");if(e.ok){let a=await e.json();s(a.connections||[])}}catch{}},y=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let s=await e.json();l(s.keys||[])}}catch{}},k=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let s=await e.json();u(s.aliases||{})}}catch{}},b=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let s=await e.json();f(s.cloudEnabled||!1)}}catch{}},j=()=>e.filter(e=>!1!==e.isActive),m=Object.entries(i.wn);return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-6",children:[(0,t.jsx)(c.tA,{apiKeys:a,cloudEnabled:h,onStatusChange:v}),(0,t.jsx)("div",{className:"grid gap-3 sm:gap-4",children:m.map(([e,s])=>(0,t.jsx)(c.kn,{tool:s,isExpanded:p===e,onToggle:()=>w(p===e?null:e),serverRunning:g.running,dnsActive:g.dnsStatus?.[e]||!1,hasCachedPassword:g.hasCachedPassword||!1,needsSudoPassword:!1!==g.needsSudoPassword,isWin:!0===g.isWin,apiKeys:a,activeProviders:j(),hasActiveProviders:j().some(e=>(0,d.KC)(e.provider).length>0||(0,o.mq)(e.provider)||(0,o.gb)(e.provider)),modelAliases:r,cloudEnabled:h,onDnsChange:e=>v(s=>({...s,dnsStatus:e.dnsStatus??s.dnsStatus}))},e))})]})}},31760:(e,s,a)=>{Promise.resolve().then(a.bind(a,23879))}},e=>{e.O(0,[2574,3862,1051,5772,1321,5497,5964,8441,3794,7358],()=>e(e.s=31760)),_N_E=e.O()}]);
|
package/app/.next/static/chunks/app/(dashboard)/dashboard/network-analysis/page-0ad4db60f9d14f60.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7537],{12657:(e,t,s)=>{Promise.resolve().then(s.bind(s,45699))},45699:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var a=s(95155),r=s(12115),l=s(35497);function n(e){return Array.isArray(e)?e.length:0}function i({label:e,value:t,skipValue:s=!1}){return(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase text-text-muted/70",children:e}),(0,a.jsx)("p",{className:"mt-1 break-words text-sm text-text-main","data-i18n-skip":s?"true":void 0,children:t||"None"})]})}function o({icon:e,label:t,value:s,tone:r="default"}){let l={default:"text-text-main",warning:"text-yellow-600 dark:text-yellow-400",error:"text-red-600 dark:text-red-400",success:"text-green-600 dark:text-green-400"}[r];return(0,a.jsxs)("div",{className:"flex min-h-20 items-center gap-3 rounded-lg border border-border-subtle bg-bg px-4 py-3",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[22px] ${l}`,children:e}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:t}),(0,a.jsx)("p",{className:`mt-1 text-lg font-semibold ${l}`,children:s})]})]})}function d(){let[e,t]=(0,r.useState)(null),[s,d]=(0,r.useState)(!0),[c,x]=(0,r.useState)(""),m=(0,r.useCallback)(async({setBusy:e=!0}={})=>{e&&d(!0),e&&x("");try{let e=await fetch("/api/network-analysis",{cache:"no-store"}),s=await e.json();if(!e.ok)throw Error(s.error||"Failed to load diagnostics");t(s)}catch(e){x(e.message||"Failed to load diagnostics")}finally{d(!1)}},[]);(0,r.useEffect)(()=>{fetch("/api/auth/me").then(e=>e.json()).then(e=>{"sub_user"===e.role&&(window.location.href="/dashboard/usage")}).catch(()=>{});let e=setTimeout(()=>{m({setBusy:!1})},0);return()=>clearTimeout(e)},[m]);let u=(0,r.useMemo)(()=>{var t;return"healthy"===(t=e?.verdict)?{label:"Healthy",variant:"success",title:"No transport errors in sampled logs",detail:"The current app log window does not show route loss, DNS failures, proxy timeout, or socket reset patterns."}:"upstream_or_socket_instability"===t?{label:"Socket resets",variant:"warning",title:"Upstream sockets were interrupted",detail:"Requests were reset while in flight. This can come from upstream, Wi-Fi churn, or an intermediate proxy."}:{label:"External route instability",variant:"warning",title:"Network path instability is affecting OpenrouterX",detail:"The log pattern points to local route loss, transient TLS disconnects, or the configured upstream proxy timing out before API calls complete."}},[e?.verdict]),p=e?.logs?.errorCounts||{},b=e?.project||{},h=b.outboundProxy||{},g=b.mitm||{};return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(l.Ex,{variant:u.variant,dot:!0,children:u.label}),e?.generatedAt&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[(0,a.jsx)("span",{children:"Updated"})," ",(0,a.jsx)("span",{"data-i18n-skip":"true",children:function(e){if(!e)return"Unknown";let t=new Date(e);return Number.isNaN(t.getTime())?"Unknown":t.toLocaleString()}(e.generatedAt)})]})]}),(0,a.jsx)("h2",{className:"mt-2 text-xl font-semibold text-text-main",children:u.title}),(0,a.jsx)("p",{className:"mt-1 max-w-3xl text-sm text-text-muted",children:u.detail})]}),(0,a.jsx)(l.$n,{icon:"refresh",variant:"outline",loading:s,onClick:m,children:"Refresh"})]}),c&&(0,a.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 p-4 text-sm text-red-600 dark:text-red-400",children:c}),(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[(0,a.jsx)(o,{icon:"route",label:"Route loss",value:p.EADDRNOTAVAIL||0,tone:(p.EADDRNOTAVAIL||0)>0?"warning":"success"}),(0,a.jsx)(o,{icon:"sync_problem",label:"Socket resets",value:(p.ECONNRESET||0)+(p.TLS_DISCONNECTED||0),tone:p.ECONNRESET||p.TLS_DISCONNECTED?"warning":"success"}),(0,a.jsx)(o,{icon:"vpn_lock",label:"Proxy failures",value:p.PROXY_FAILED||0,tone:(p.PROXY_FAILED||0)>0?"warning":"success"}),(0,a.jsx)(o,{icon:"dns",label:"DNS errors",value:(p.ENOTFOUND||0)+(p.EAI_AGAIN||0),tone:p.ENOTFOUND||p.EAI_AGAIN?"error":"success"})]}),(0,a.jsxs)("div",{className:"grid gap-5 xl:grid-cols-[1fr_1.1fr]",children:[(0,a.jsx)(l.Zp,{title:"Project Network Scope",icon:"hub",padding:"md",children:(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,a.jsx)(i,{label:"System proxy",value:b.systemProxyEnabled?"Enabled outside OpenrouterX":"No macOS system proxy detected"}),(0,a.jsx)(i,{label:"Risk level",value:b.riskLevel||"Unknown"}),(0,a.jsx)(i,{label:"Outbound proxy",value:h.enabled?h.url:"Disabled",skipValue:h.enabled}),(0,a.jsx)(i,{label:"Outbound scope",value:"targeted"===h.scope?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:"Targeted"}),": ",(0,a.jsx)("span",{"data-i18n-skip":"true",children:(h.targets||[]).join(", ")})]}):h.scope}),(0,a.jsx)(i,{label:"MITM",value:g.enabled?"Enabled":"Disabled"}),(0,a.jsx)(i,{label:"MITM DNS tools",value:n(g.enabledTools)?g.enabledTools.join(", "):"None",skipValue:n(g.enabledTools)>0}),(0,a.jsx)(i,{label:"Cloudflare tunnel",value:b.tunnels?.cloudflareEnabled?"Enabled":"Disabled"}),(0,a.jsx)(i,{label:"Tailscale",value:b.tunnels?.tailscaleEnabled?"Enabled":"Disabled"})]})}),(0,a.jsxs)(l.Zp,{title:"Current Machine State",icon:"monitor_heart",padding:"md",children:[(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,a.jsx)(i,{label:"Platform",value:e?.system?.platform,skipValue:!0}),(0,a.jsx)(i,{label:"Hostname",value:e?.system?.hostname,skipValue:!0}),(0,a.jsx)(i,{label:"Default route",value:(e?.system?.route?.output||"").match(/interface:\s*(\S+)/)?.[1]||"Unknown",skipValue:!0}),(0,a.jsx)(i,{label:"Wi-Fi status",value:(e?.system?.ifconfig?.output||"").match(/status:\s*(\S+)/)?.[1]||"Unknown"})]}),(0,a.jsxs)("details",{className:"mt-4 rounded-lg border border-border-subtle bg-bg p-3",children:[(0,a.jsx)("summary",{className:"cursor-pointer text-sm font-semibold text-text-main",children:"Raw DNS and proxy snapshot"}),(0,a.jsx)("pre",{className:"mt-3 max-h-64 overflow-auto whitespace-pre-wrap break-words text-xs text-text-muted",children:["--- scutil --proxy ---",e?.system?.proxy?.output||"Unavailable","--- scutil --dns ---",e?.system?.dns?.output||"Unavailable"].join("\n")})]})]})]}),(0,a.jsx)(l.Zp,{title:"Findings",icon:"fact_check",padding:"md",children:(0,a.jsx)("div",{className:"space-y-3",children:(e?.logs?.findings||[]).map((e,t)=>(0,a.jsxs)("div",{className:"rounded-lg border border-border-subtle bg-bg p-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(l.Ex,{variant:"warning"===e.severity?"warning":"success"===e.severity?"success":"info",children:e.severity}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e.title})]}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted",children:e.detail})]},`${e.title}-${t}`))})}),(0,a.jsx)(l.Zp,{title:"Network Error Timeline",icon:"timeline",padding:"md",children:0===(e?.logs?.timeline||[]).length?(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No network transport errors in the sampled logs."}):(0,a.jsx)("div",{className:"max-h-[520px] overflow-auto rounded-lg border border-border-subtle",children:(e?.logs?.timeline||[]).slice().reverse().map((e,t)=>(0,a.jsxs)("div",{className:"border-b border-border-subtle bg-bg p-3 last:border-b-0",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-xs text-text-muted","data-i18n-skip":"true",children:e.time||"unknown"}),(0,a.jsx)(l.Ex,{size:"sm",variant:"mitm"===e.source?"primary":"default",children:e.source}),e.categories.map(e=>(0,a.jsx)(l.Ex,{size:"sm",variant:"EADDRNOTAVAIL"===e?"warning":"default",className:"uppercase","data-i18n-skip":"true",children:e},e))]}),(0,a.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-text-muted","data-i18n-skip":"true",children:e.message})]},`${e.time}-${t}`))})})]})}}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=12657)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{},_=>{_.O(0,[2574,3862,1051,1321,5497,4072,8441,3794,7358],()=>_(_.s=74072)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3471],{64561:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var a=s(95155),r=s(12115),o=s(35497),i=s(1620),l=s(31474),n=s(90620);let d=[{id:"openai",label:"OpenAI / Codex",targets:["api.openai.com","chatgpt.com"]},{id:"anthropic",label:"Anthropic",targets:["api.anthropic.com"]},{id:"google",label:"Google / Gemini",targets:["generativelanguage.googleapis.com","aiplatform.googleapis.com"]},{id:"antigravity",label:"Antigravity",targets:["cloudcode-pa.googleapis.com","daily-cloudcode-pa.googleapis.com","daily-cloudcode-pa.sandbox.googleapis.com"]},{id:"copilot",label:"GitHub Copilot",targets:["api.individual.githubcopilot.com"]},{id:"openrouter",label:"OpenRouter",targets:["openrouter.ai","api.openrouter.ai"]},{id:"cursor",label:"Cursor",targets:["api2.cursor.sh"]},{id:"kiro",label:"Kiro / AWS",targets:["q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"]}],c=new Set(d.flatMap(e=>e.targets));function m(e){return Array.from(new Set(e.map(e=>String(e||"").trim()).filter(Boolean)))}function x(e,t,s){let a=String(e||"").trim();if(!a||!t&&!s)return a;try{let e=/^[a-z][a-z0-9+.-]*:\/\//i.test(a),r=new URL(e?a:`http://${a}`);return r.username=t||"",r.password=s||"",r.toString()}catch{return a}}function u(e){try{return decodeURIComponent(e||"")}catch{return e||""}}function p(e){let t=String(e||"").trim();if(!t)return{proxyUrl:"",username:"",password:""};try{let e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),s=new URL(e?t:`http://${t}`),a=u(s.username),r=u(s.password);s.username="",s.password="";let o=e?s.toString():s.toString().replace(/^http:\/\//i,"");return"/"!==s.pathname||s.search||s.hash||(o=o.replace(/\/$/,"")),{proxyUrl:o,username:a,password:r}}catch{return{proxyUrl:t,username:"",password:""}}}function b(){let{theme:e,setTheme:t,isDark:s}=(0,i.D)(),[u,b]=(0,r.useState)({fallbackStrategy:"fill-first"}),[h,g]=(0,r.useState)(!0),[y,f]=(0,r.useState)({current:"",new:"",confirm:""}),[j,w]=(0,r.useState)({type:"",message:""}),[N,v]=(0,r.useState)(!1),[P,C]=(0,r.useState)(!1),[S,k]=(0,r.useState)({type:"",message:""}),[O,I]=(0,r.useState)({authMode:"password",oidcIssuerUrl:"",oidcClientId:"",oidcScopes:"openid profile email",oidcLoginLabel:"Sign in with OIDC"}),[U,L]=(0,r.useState)(""),[T,R]=(0,r.useState)({type:"",message:""}),[A,D]=(0,r.useState)(!1),[M,$]=(0,r.useState)(!1),[E,F]=(0,r.useState)({type:"",message:""}),[q,J]=(0,r.useState)("/api/auth/oidc/callback"),[H,_]=(0,r.useState)(!1),z=(0,r.useRef)(null),[K,B]=(0,r.useState)({outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:"",outboundProxyTargets:[],outboundProxyCustomTargets:"",outboundProxyUsername:"",outboundProxyPassword:"",outboundProxySavedUsername:"",outboundProxySavedPassword:""}),[Z,G]=(0,r.useState)({type:"",message:""}),[W,Q]=(0,r.useState)(!1),[V,Y]=(0,r.useState)(!1);(0,r.useEffect)(()=>{fetch("/api/auth/me").then(e=>e.json()).then(e=>{"sub_user"===e.role&&(window.location.href="/dashboard/usage")}).catch(()=>{})},[]),(0,r.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{let t=p(e?.outboundProxyUrl);b(e),I({authMode:e?.authMode||"password",oidcIssuerUrl:e?.oidcIssuerUrl||"",oidcClientId:e?.oidcClientId||"",oidcScopes:e?.oidcScopes||"openid profile email",oidcLoginLabel:e?.oidcLoginLabel||"Sign in with OIDC"}),L(""),(e?.authMode==="oidc"||e?.authMode==="both")&&_(!0),B({outboundProxyEnabled:e?.outboundProxyEnabled===!0,outboundProxyUrl:t.proxyUrl,outboundNoProxy:e?.outboundNoProxy||"",outboundProxyTargets:Array.isArray(e?.outboundProxyTargets)?e.outboundProxyTargets:[],outboundProxyCustomTargets:Array.isArray(e?.outboundProxyTargets)?e.outboundProxyTargets.filter(e=>!c.has(e)).join(","):"",outboundProxyUsername:t.username,outboundProxyPassword:"",outboundProxySavedUsername:t.username,outboundProxySavedPassword:t.password}),g(!1)}).catch(e=>{console.error("Failed to fetch settings:",e),g(!1)})},[]),(0,r.useEffect)(()=>{J(`${window.location.origin}/api/auth/oidc/callback`)},[]);let X=async e=>{if(e.preventDefault(),!0!==u.outboundProxyEnabled)return;Q(!0),G({type:"",message:""});let t=es(),s=K.outboundProxyPassword||(K.outboundProxyUsername===K.outboundProxySavedUsername?K.outboundProxySavedPassword:""),a=x(K.outboundProxyUrl,K.outboundProxyUsername,s);try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyUrl:a,outboundProxyTargets:t})}),s=await e.json();if(e.ok){let e=p(s?.outboundProxyUrl||a);b(e=>({...e,...s})),B(a=>({...a,outboundProxyUrl:e.proxyUrl,outboundProxyTargets:Array.isArray(s?.outboundProxyTargets)?s.outboundProxyTargets:t,outboundProxyUsername:e.username,outboundProxyPassword:"",outboundProxySavedUsername:e.username,outboundProxySavedPassword:e.password})),G({type:"success",message:"Proxy settings applied"})}else G({type:"error",message:s.error||"Failed to update proxy settings"})}catch(e){G({type:"error",message:"An error occurred"})}finally{Q(!1)}},ee=async()=>{if(!0!==u.outboundProxyEnabled)return;let e=K.outboundProxyPassword||(K.outboundProxyUsername===K.outboundProxySavedUsername?K.outboundProxySavedPassword:""),t=x(K.outboundProxyUrl,K.outboundProxyUsername,e);if(!t)return void G({type:"error",message:"Please enter a Proxy URL to test"});Y(!0),G({type:"",message:""});try{let e=await fetch("/api/settings/proxy-test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyUrl:t})}),s=await e.json();e.ok&&s?.ok?G({type:"success",message:`Proxy test OK (${s.status}) in ${s.elapsedMs}ms`}):G({type:"error",message:s?.error||"Proxy test failed"})}catch(e){G({type:"error",message:"An error occurred"})}finally{Y(!1)}},et=async e=>{Q(!0),G({type:"",message:""});try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyEnabled:e})}),s=await t.json();t.ok?(b(e=>({...e,...s})),B(e=>({...e,outboundProxyEnabled:s?.outboundProxyEnabled===!0})),G({type:"success",message:e?"Proxy enabled":"Proxy disabled"})):G({type:"error",message:s.error||"Failed to update proxy settings"})}catch(e){G({type:"error",message:"An error occurred"})}finally{Q(!1)}},es=()=>m([...Array.isArray(K.outboundProxyTargets)?K.outboundProxyTargets:[],...m(String(K.outboundProxyCustomTargets||"").split(","))]),ea=async e=>{if(e.preventDefault(),y.new!==y.confirm)return void w({type:"error",message:"Passwords do not match"});v(!0),w({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:y.current,newPassword:y.new})}),t=await e.json();e.ok?(w({type:"success",message:"Password updated successfully"}),f({current:"",new:"",confirm:""})):w({type:"error",message:t.error||"Failed to update password"})}catch(e){w({type:"error",message:"An error occurred"})}finally{v(!1)}},er=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fallbackStrategy:e})})).ok&&b(t=>({...t,fallbackStrategy:e}))}catch(e){console.error("Failed to update settings:",e)}},eo=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategy:e})})).ok&&b(t=>({...t,comboStrategy:e}))}catch(e){console.error("Failed to update combo strategy:",e)}},ei=async e=>{let t=parseInt(e);if(!isNaN(t)&&!(t<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stickyRoundRobinLimit:t})})).ok&&b(e=>({...e,stickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update sticky limit:",e)}},el=async e=>{let t=parseInt(e);if(!isNaN(t)&&!(t<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStickyRoundRobinLimit:t})})).ok&&b(e=>({...e,comboStickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update combo sticky limit:",e)}},en=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&b(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},ed=(e,t)=>{I(s=>({...s,[e]:t}))},ec=async(e=O.authMode||"password")=>{let t=O.oidcIssuerUrl.trim(),s=O.oidcClientId.trim(),a=O.oidcScopes.trim(),r=O.oidcLoginLabel.trim(),o=U.trim();if("password"!==e&&(!t||!s||!o)&&!u.oidcConfigured)return void R({type:"error",message:"Issuer URL, client ID, and client secret are required to enable OIDC."});D(!0),R({type:"",message:""}),F({type:"",message:""});try{let i={authMode:e,oidcIssuerUrl:t,oidcClientId:s,oidcScopes:a||"openid profile email",oidcLoginLabel:r||"Sign in with OIDC"};o&&(i.oidcClientSecret=o);let l=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),n=await l.json();l.ok?(b(e=>({...e,...n})),I({authMode:n?.authMode||e,oidcIssuerUrl:n?.oidcIssuerUrl||t,oidcClientId:n?.oidcClientId||s,oidcScopes:n?.oidcScopes||a||"openid profile email",oidcLoginLabel:n?.oidcLoginLabel||r||"Sign in with OIDC"}),L(""),R({type:"success",message:"oidc"===e?"OIDC login enabled":"both"===e?"Password and OIDC login enabled":"OIDC settings saved"})):R({type:"error",message:n.error||"Failed to save OIDC settings"})}catch(e){R({type:"error",message:"An error occurred"})}finally{D(!1)}},em=async()=>{let e=O.oidcIssuerUrl.trim(),t=O.oidcClientId.trim(),s=O.oidcScopes.trim(),a=U.trim();if(!e||!t)return void F({type:"error",message:"Issuer URL and client ID are required to test the connection."});$(!0),R({type:"",message:""}),F({type:"",message:""});try{let r=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({authMode:O.authMode||u.authMode||"password",oidcIssuerUrl:e,oidcClientId:t,oidcScopes:s||"openid profile email",oidcLoginLabel:O.oidcLoginLabel.trim()||"Sign in with OIDC",...a?{oidcClientSecret:a}:{}})}),o=await r.json().catch(()=>({}));if(!r.ok)return void F({type:"error",message:o.error||"Failed to save OIDC settings before testing"});let i=await fetch("/api/auth/oidc/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issuerUrl:o.oidcIssuerUrl||e,clientId:o.oidcClientId||t,scopes:o.oidcScopes||s||"openid profile email"})}),l=await i.json().catch(()=>({}));if(i.ok&&l?.ok){let e=l.clientSecretTested?!0===l.clientSecretValid?`Connection OK. Discovery loaded from ${l.issuerUrl}. Client secret validated too.`:`Connection OK. Discovery loaded from ${l.issuerUrl}. Client secret was not checked.`:`Connection OK. Discovery loaded from ${l.issuerUrl}.`;F({type:"success",message:e})}else F({type:"error",message:l.error||"OIDC connection test failed"})}catch(e){F({type:"error",message:"An error occurred"})}finally{$(!1)}},ex=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enableObservability:e})})).ok&&b(t=>({...t,enableObservability:e}))}catch(e){console.error("Failed to update enableObservability:",e)}},eu=async()=>{try{let e=await fetch("/api/settings");if(!e.ok)return;let t=await e.json();b(t)}catch(e){console.error("Failed to reload settings:",e)}},ep=async()=>{C(!0),k({type:"",message:""});try{let e=await fetch("/api/settings/database");if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||"Failed to export database")}let t=await e.json(),s=JSON.stringify(t,null,2),a=new Blob([s],{type:"application/json"}),r=URL.createObjectURL(a),o=document.createElement("a"),i=new Date().toISOString().replace(/[.:]/g,"-");o.href=r,o.download=`openrouterx-backup-${i}.json`,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r),k({type:"success",message:"Database backup downloaded"})}catch(e){k({type:"error",message:e.message||"Failed to export database"})}finally{C(!1)}},eb=async e=>{let t=e.target.files?.[0];if(t){C(!0),k({type:"",message:""});try{let e=await t.text(),s=JSON.parse(e),a=await fetch("/api/settings/database",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),r=await a.json().catch(()=>({}));if(!a.ok)throw Error(r.error||"Failed to import database");await eu(),k({type:"success",message:"Database imported successfully"})}catch(e){k({type:"error",message:e.message||"Invalid backup file"})}finally{z.current&&(z.current.value=""),C(!1)}}},eh=!0===u.enableObservability;return(0,a.jsx)("div",{className:"max-w-2xl mx-auto px-4 sm:px-0",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"size-10 sm:size-12 rounded-lg bg-green-500/10 text-green-500 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-xl sm:text-2xl",children:"computer"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg sm:text-xl font-semibold",children:"Local Mode"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Running on your machine"})]})]}),(0,a.jsx)("div",{className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5 w-full sm:w-auto",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{type:"button",onClick:()=>t(s),className:(0,l.cn)("flex items-center justify-center gap-1 sm:gap-1.5 px-2 sm:px-3 py-1.5 rounded-md font-medium transition-all flex-1 sm:flex-initial",e===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{className:"capitalize text-xs sm:text-sm",children:s})]},s))})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-4 border-t border-border",children:[(0,a.jsx)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-3 rounded-lg bg-bg border border-border gap-2",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Database Location"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted font-mono break-all",children:u.databasePath||"~/.openrouterx/db.json"})]})}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,a.jsx)(o.$n,{variant:"secondary",icon:"download",onClick:ep,loading:P,className:"w-full sm:w-auto",children:"Download Backup"}),(0,a.jsx)(o.$n,{variant:"outline",icon:"upload",onClick:()=>z.current?.click(),disabled:P,className:"w-full sm:w-auto",children:"Import Backup"}),(0,a.jsx)("input",{ref:z,type:"file",accept:"application/json,.json",className:"hidden",onChange:eb})]}),S.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===S.type?"text-red-500":"text-green-600 dark:text-green-400"}`,children:S.message})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"shield"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Security"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Require login"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,a.jsx)(o.lM,{checked:!0===u.requireLogin,onChange:()=>en(!u.requireLogin),disabled:h})]}),!0===u.requireLogin&&(0,a.jsxs)("form",{onSubmit:ea,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[u.hasPassword&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"Current Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Enter current password",value:y.current,onChange:e=>f({...y,current:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"New Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Enter new password",value:y.new,onChange:e=>f({...y,new:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"Confirm New Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Confirm new password",value:y.confirm,onChange:e=>f({...y,confirm:e.target.value}),required:!0})]})]}),j.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===j.type?"text-red-500":"text-green-500"}`,children:j.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(o.$n,{type:"submit",variant:"primary",loading:N,className:"w-full sm:w-auto",children:u.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>_(e=>!e),className:"w-full flex items-center gap-3 text-left",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-indigo-500/10 text-indigo-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"lock_open"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"OIDC Dashboard Login"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"oidc"===u.authMode?"OIDC active":"both"===u.authMode?"Password + OIDC active":"Optional SSO via Authentik/Keycloak/Google"})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted shrink-0",children:H?"expand_less":"expand_more"})]}),H&&(0,a.jsxs)("div",{className:"flex flex-col gap-4 mt-4",children:[(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Use Authentik or any OIDC provider to sign in to the dashboard. You can enable password-only, OIDC-only, or both for the dashboard; model API access still uses API keys."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Auth Mode"}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:[{value:"password",title:"Password only",desc:"Keep the legacy password login."},{value:"oidc",title:"OIDC only",desc:"Require OIDC for dashboard access."},{value:"both",title:"Both",desc:"Allow either password or OIDC."}].map(e=>{let t=O.authMode===e.value;return(0,a.jsxs)("button",{type:"button",onClick:()=>ed("authMode",e.value),className:(0,l.cn)("text-left rounded-lg border p-3 transition-colors",t?"border-primary bg-primary/5":"border-border bg-bg hover:bg-black/5 dark:hover:bg-white/5"),disabled:h||A,children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:e.title}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted mt-1",children:e.desc})]},e.value)})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Issuer URL"}),(0,a.jsx)(o.pd,{placeholder:"https://auth.example.com/application/o/9router/",value:O.oidcIssuerUrl,onChange:e=>ed("oidcIssuerUrl",e.target.value),disabled:h||A})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Client ID"}),(0,a.jsx)(o.pd,{placeholder:"9router-dashboard",value:O.oidcClientId,onChange:e=>ed("oidcClientId",e.target.value),disabled:h||A})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Client Secret"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Leave blank to keep existing secret",value:U,onChange:e=>L(e.target.value),disabled:h||A}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"This value is write-only after saving."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Scopes"}),(0,a.jsx)(o.pd,{placeholder:"openid profile email",value:O.oidcScopes,onChange:e=>ed("oidcScopes",e.target.value),disabled:h||A})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Login Button Label"}),(0,a.jsx)(o.pd,{placeholder:"Sign in with OIDC",value:O.oidcLoginLabel,onChange:e=>ed("oidcLoginLabel",e.target.value),disabled:h||A})]})]}),(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-bg p-3 text-xs sm:text-sm text-text-muted",children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-1",children:"Redirect URI"}),(0,a.jsx)("code",{className:"block break-all font-mono",children:q})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)(o.$n,{type:"button",variant:"primary",loading:A,onClick:()=>ec(),className:"w-full sm:w-auto",children:"Save auth mode"}),(0,a.jsx)(o.$n,{type:"button",variant:"outline",loading:M,onClick:em,className:"w-full sm:w-auto",children:"Test connection"})]}),E.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===E.type?"text-red-500":"text-green-500"}`,children:E.message}),T.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===T.type?"text-red-500":"text-green-500"}`,children:T.message}),"oidc"===u.authMode&&(0,a.jsx)("p",{className:"text-xs sm:text-sm text-amber-600 dark:text-amber-400",children:"OIDC login is currently active. Password login is disabled until you switch back."}),"both"===u.authMode&&(0,a.jsx)("p",{className:"text-xs sm:text-sm text-amber-600 dark:text-amber-400",children:"Password and OIDC login are both active."})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"route"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Routing Strategy"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Round Robin"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Cycle through accounts to distribute load"})]}),(0,a.jsx)(o.lM,{checked:"round-robin"===u.fallbackStrategy,onChange:()=>er("round-robin"===u.fallbackStrategy?"fill-first":"round-robin"),disabled:h})]}),"round-robin"===u.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Sticky Limit"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Calls per account before switching"})]}),(0,a.jsx)(o.pd,{type:"number",min:"1",max:"10",value:u.stickyRoundRobinLimit||3,onChange:e=>ei(e.target.value),disabled:h,className:"w-16 sm:w-20 text-center shrink-0"})]}),(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-4 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Combo Round Robin"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Cycle through providers in combos instead of always starting with first"})]}),(0,a.jsx)(o.lM,{checked:"round-robin"===u.comboStrategy,onChange:()=>eo("round-robin"===u.comboStrategy?"fallback":"round-robin"),disabled:h})]}),"round-robin"===u.comboStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Combo Sticky Limit"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Calls per combo model before switching"})]}),(0,a.jsx)(o.pd,{type:"number",min:"1",max:"100",value:u.comboStickyRoundRobinLimit||1,onChange:e=>el(e.target.value),disabled:h,className:"w-20 text-center"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted italic pt-2 border-t border-border/50",children:["round-robin"===u.fallbackStrategy?`Currently distributing requests across all available accounts with ${u.stickyRoundRobinLimit||3} calls per account.`:"Currently using accounts in priority order (Fill First).","round-robin"===u.comboStrategy?` Combos rotate after ${u.comboStickyRoundRobinLimit||1} call${1===(u.comboStickyRoundRobinLimit||1)?"":"s"} per model.`:" Combos always start with their first model."]})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"wifi"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Network"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Outbound Proxy"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Enable proxy for OAuth + provider outbound requests."})]}),(0,a.jsx)(o.lM,{checked:!0===u.outboundProxyEnabled,onChange:()=>et(!0!==u.outboundProxyEnabled),disabled:h||W})]}),!0===u.outboundProxyEnabled&&(0,a.jsxs)("form",{onSubmit:X,className:"flex flex-col gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Proxy URL"}),(0,a.jsx)(o.pd,{placeholder:"socks5://127.0.0.1:1080",value:K.outboundProxyUrl,onChange:e=>B(t=>({...t,outboundProxyUrl:e.target.value})),disabled:h||W}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Supports http, https, socks4, socks4a, socks5, and socks5h."})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Proxy Username"}),(0,a.jsx)(o.pd,{placeholder:"optional",value:K.outboundProxyUsername,onChange:e=>B(t=>({...t,outboundProxyUsername:e.target.value})),disabled:h||W})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Proxy Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:K.outboundProxySavedPassword?"saved (hidden)":"optional",value:K.outboundProxyPassword,onChange:e=>B(t=>({...t,outboundProxyPassword:e.target.value})),disabled:h||W})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Use Proxy For"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Default is direct. Checked targets use the proxy."})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:d.map(e=>{let t=new Set(K.outboundProxyTargets||[]),s=e.targets.every(e=>t.has(e));return(0,a.jsxs)("label",{className:(0,l.cn)("flex items-center gap-2 rounded-lg border px-3 py-2 text-sm cursor-pointer transition-colors",s?"border-primary bg-primary/5 text-text-main":"border-border bg-surface text-text-muted hover:border-primary/50"),children:[(0,a.jsx)("input",{type:"checkbox",checked:s,onChange:()=>{B(t=>{let s=new Set(t.outboundProxyTargets||[]),a=e.targets.every(e=>s.has(e));for(let t of e.targets)a?s.delete(t):s.add(t);return{...t,outboundProxyTargets:Array.from(s)}})},disabled:h||W,className:"h-4 w-4 accent-primary"}),(0,a.jsx)("span",{className:"truncate",children:e.label})]},e.id)})}),(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Custom Proxy Hosts"}),(0,a.jsx)(o.pd,{placeholder:"api.example.com,.example.org",value:K.outboundProxyCustomTargets,onChange:e=>B(t=>({...t,outboundProxyCustomTargets:e.target.value})),disabled:h||W})]}),(0,a.jsxs)("div",{className:"pt-2 border-t border-border/50 flex flex-col sm:flex-row items-stretch sm:items-center gap-2",children:[(0,a.jsx)(o.$n,{type:"button",variant:"secondary",loading:V,disabled:h||W,onClick:ee,className:"w-full sm:w-auto",children:"Test proxy URL"}),(0,a.jsx)(o.$n,{type:"submit",variant:"primary",loading:W,className:"w-full sm:w-auto",children:"Apply"})]})]}),Z.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===Z.type?"text-red-500":"text-green-500"} pt-2 border-t border-border/50`,children:Z.message})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-orange-500/10 text-orange-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"monitoring"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Observability"})]}),(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Enable Observability"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Record request details for inspection in the logs view"})]}),(0,a.jsx)(o.lM,{checked:eh,onChange:ex,disabled:h})]})]}),(0,a.jsxs)("div",{className:"text-center text-xs sm:text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[n.vQ.name," v",n.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:"Local Mode - All data stored on your machine"})]})]})})}},95747:(e,t,s)=>{Promise.resolve().then(s.bind(s,64561))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=95747)),_N_E=e.O()}]);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{7570:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>$});var a=s(95155),i=s(12115),r=s(73321),l=s(98500),o=s.n(l),n=s(5772),d=s(35497),c=s(52679),p=s(28777),m=s(11059);let x=new Map;async function u(e){if(!e?.url||!e?.type)return[];let t=x.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let a=(await s.json()).data??[];return x.set(e.url,{data:a,expiresAt:Date.now()+6e5}),a}catch{return[]}}var h=s(14051),f=s.n(h);function g({model:e,fullModel:t,displayModel:s,alias:i,copied:r,onCopy:l,testStatus:o,isCustom:n,isFree:d,onDeleteAlias:c,onTest:p,isTesting:m,onDisable:x}){let u="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===o?"border-green-500/40":"error"===o?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:u?{color:u}:void 0,children:"ok"===o?"check_circle":"error"===o?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:s||t}),e.name&&(0,a.jsx)("span",{className:"truncate pl-1 text-[9px] italic text-text-muted/70",children:e.name})]}),p&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:p,disabled:m,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${m?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:m?{animation:"spin 1s linear infinite"}:void 0,children:m?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:m?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>l(t,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:r===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:r===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,a.jsx)("button",{onClick:c,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):x?(0,a.jsx)("button",{onClick:x,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function y({modelId:e,fullModel:t,copied:s,onCopy:i,onDeleteAlias:r,onTest:l,testStatus:o,isTesting:n}){let d="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===o?"border-green-500/40":"error"===o?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===o?"check_circle":"error"===o?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),l&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:l,disabled:n,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:n?{animation:"spin 1s linear infinite"}:void 0,children:n?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:n?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:r,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function b({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,copied:r,onCopy:l,onSetAlias:o,onDeleteAlias:n,connections:c,isAnthropic:p}){let[m,x]=(0,i.useState)(""),[u,h]=(0,i.useState)(!1),[f,g]=(0,i.useState)(!1),[v,j]=(0,i.useState)(null),[N,w]=(0,i.useState)({}),k=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),a=await s.json();w(e=>({...e,[t]:a.ok?"ok":"error"}))}catch{w(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=Object.entries(s).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,s])=>({modelId:s.replace(`${e}/`,""),fullModel:s,alias:t})),S=a=>{let i,r=`${e}/${a}`;if(Object.values(s).includes(r))return null;let l=(i=a.split("/"))[i.length-1];if(!s[l])return l;let o=`${t}-${l}`;return s[o]?null:o},$=async()=>{if(!m.trim()||u)return;let t=m.trim(),s=S(t);if(!s)return void alert("All suggested aliases already exist. Please choose a different model or remove conflicting aliases.");h(!0);try{await o(t,s,e),x("")}catch(e){console.log("Error adding model:",e)}finally{h(!1)}},A=async()=>{if(f)return;let t=c.find(e=>!1!==e.isActive);if(t){g(!0);try{let s=await fetch(`/api/providers/${t.id}/models`),a=await s.json();if(!s.ok)return void alert(a.error||"Failed to import models");let i=a.models||[];if(0===i.length)return void alert("No models returned from /models.");let r=0;for(let t of i){let s=t.id||t.name||t.model;if(!s)continue;let a=S(s);a&&(await o(s,a,e),r+=1)}0===r&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{g(!1)}}},T=c.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",p?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:m,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&$(),placeholder:p?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:$,disabled:!m.trim()||u,children:u?"Adding...":"Add"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"download",onClick:A,disabled:!T||f,children:f?"Importing...":"Import from /models"})]}),!T&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({modelId:e,fullModel:s,alias:i})=>(0,a.jsx)(y,{modelId:e,fullModel:`${t}/${e}`,copied:r,onCopy:l,onDeleteAlias:()=>n(i),onTest:c.length>0?()=>k(e):void 0,testStatus:N[e],isTesting:v===e},s))})]})}function v({until:e}){let[t,s]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);if(a<60)s(`${a}s`);else if(a<3600)s(`${Math.floor(a/60)}m ${a%60}s`);else{let e=Math.floor(a/3600),t=Math.floor(a%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function j({connection:e,proxyPools:t,isOAuth:s,isFirst:r,isLast:l,onMoveUp:o,onMoveDown:n,onToggleActive:c,onUpdateProxy:p,onEdit:m,onDelete:x}){let[u,h]=(0,i.useState)(!1),[f,g]=(0,i.useState)(!1),y=(0,i.useRef)(null),b=new Map((t||[]).map(e=>[e.id,e])),N=e.providerSpecificData?.proxyPoolId||null,w=N?b.get(N):null,k=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!N||k,S=w?`Pool: ${w.name}`:N?`Pool: ${N} (inactive/missing)`:k?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",$="";if(w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);$=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{$=t}}let A=w?.noProxy||e.providerSpecificData?.connectionNoProxy||"",T="default";w?.isActive===!0?T="success":(N||k)&&(T="error"),(0,i.useEffect)(()=>{if(!u)return;let e=e=>{y.current&&!y.current.contains(e.target)&&h(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[u]);let O=async e=>{g(!0);try{await p("__none__"===e?null:e)}finally{g(!1),h(!1)}},P=e=>"string"==typeof e&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),I=s?P(e.email)?e.email:P(e.name)?e.name:e.name||e.email||e.displayName||"OAuth Account":e.name,[E,_]=(0,i.useState)(!1),R=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,i.useEffect)(()=>{let t=()=>{_(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=R?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[R]);let U="unavailable"!==e.testStatus||E?e.testStatus:"active";return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:s?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:I}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(d.Ex,{variant:!1===e.isActive?"default":"active"===U||"success"===U?"success":"error"===U||"expired"===U||"unavailable"===U?"error":"default",size:"sm",dot:!0,children:!1===e.isActive?"disabled":U||"Unknown"}),C&&(0,a.jsx)(d.Ex,{variant:T,size:"sm",children:"Proxy"}),E&&!1!==e.isActive&&(0,a.jsx)(v,{until:R}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]})]}),C&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:S,children:S}),$&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:$}),A&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:A,children:["no_proxy: ",A]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,a.jsxs)("div",{className:"relative",ref:y,children:[(0,a.jsxs)("button",{onClick:()=>h(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:f,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:f?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),u&&(0,a.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,a.jsx)("button",{onClick:()=>O("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!N?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,a.jsx)("button",{onClick:()=>O(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${N===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,a.jsxs)("button",{onClick:m,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(d.lM,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}g.propTypes={model:f().shape({id:f().string.isRequired}).isRequired,fullModel:f().string.isRequired,displayModel:f().string,alias:f().string,copied:f().string,onCopy:f().func.isRequired,testStatus:f().oneOf(["ok","error"]),isCustom:f().bool,isFree:f().bool,onDeleteAlias:f().func,onTest:f().func,isTesting:f().bool,onDisable:f().func},f().string.isRequired,f().string.isRequired,f().string,f().func.isRequired,f().func.isRequired,f().func,f().oneOf(["ok","error"]),f().bool,f().string.isRequired,f().object.isRequired,f().string,f().func.isRequired,f().func.isRequired,f().func.isRequired,b.propTypes={providerStorageAlias:f().string.isRequired,providerDisplayAlias:f().string.isRequired,modelAliases:f().object.isRequired,copied:f().string,onCopy:f().func.isRequired,onSetAlias:f().func.isRequired,onDeleteAlias:f().func.isRequired,connections:f().arrayOf(f().shape({id:f().string,isActive:f().bool})).isRequired,isAnthropic:f().bool},v.propTypes={until:f().string.isRequired},j.propTypes={connection:f().shape({id:f().string,name:f().string,email:f().string,displayName:f().string,modelLockUntil:f().string,testStatus:f().string,isActive:f().bool,lastError:f().string,priority:f().number,globalPriority:f().number}).isRequired,proxyPools:f().arrayOf(f().shape({id:f().string,name:f().string,proxyUrl:f().string,noProxy:f().string,isActive:f().bool})),isOAuth:f().bool.isRequired,isFirst:f().bool.isRequired,isLast:f().bool.isRequired,onMoveUp:f().func.isRequired,onMoveDown:f().func.isRequired,onToggleActive:f().func.isRequired,onUpdateProxy:f().func,onEdit:f().func.isRequired,onDelete:f().func.isRequired};let N=`Production|sk-...
|
|
2
2
|
Backup|sk-...
|
|
3
|
-
sk-...`;function w({isOpen:e,provider:t,providerName:s,isCompatible:r,isAnthropic:l,authType:o,authHint:n,website:c,proxyPools:p,onSave:m,onBulkDone:x,onClose:u}){let h="__none__",f="ollama-local"===t,g="cookie"===o,y=g?"Cookie Value":"API Key",b=g?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":"",v="azure"===t,j="cloudflare-ai"===t,[k,C]=(0,i.useState)({name:"",apiKey:"",priority:1,proxyPoolId:h,ollamaHostUrl:""}),[S,$]=(0,i.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[A,T]=(0,i.useState)({accountId:""}),[O,P]=(0,i.useState)(!1),[I,E]=(0,i.useState)(null),[_,R]=(0,i.useState)(!1),[U,D]=(0,i.useState)("single"),[z,q]=(0,i.useState)(""),[M,J]=(0,i.useState)(null),F=f?"Ollama Local":g?`${s||t} Cookie`:"Production Key";(0,i.useEffect)(()=>{e&&(C({name:r?F:"",apiKey:"",priority:1,proxyPoolId:h,ollamaHostUrl:""}),$({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),T({accountId:""}),P(!1),E(null),R(!1),D("single"),q(""),J(null))},[F,r,e]);let K=()=>f&&k.ollamaHostUrl.trim()?{baseUrl:k.ollamaHostUrl.trim()}:v?{azureEndpoint:S.azureEndpoint,apiVersion:S.apiVersion,deployment:S.deployment,organization:S.organization}:j?{accountId:A.accountId}:void 0,L=async()=>{P(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:k.apiKey,providerSpecificData:K()})}),s=await e.json();E(s.valid?"success":"failed")}catch{E("failed")}finally{P(!1)}},W=async()=>{if(!t||!f&&!k.apiKey)return;let e=k.name.trim()||F;R(!0);try{let s=!1;try{P(!0),E(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:k.apiKey,providerSpecificData:K()})});s=!!(await e.json()).valid,E(s?"success":"failed")}catch{E("failed")}finally{P(!1)}await m({name:e,apiKey:k.apiKey,priority:k.priority,proxyPoolId:k.proxyPoolId===h?null:k.proxyPoolId,testStatus:s?"active":"unknown",providerSpecificData:K()})}finally{R(!1)}},H=async()=>{let e=z.split("\n").map(e=>e.trim()).filter(Boolean);if(!e.length)return;R(!0),J(null);let s=0,a=0;for(let i=0;i<e.length;i++){let r=e[i].split("|"),l=r.length>=2?r.slice(1).join("|").trim():r[0].trim(),o=r.length>=2?r[0].trim():"Key",n=`${o} ${i+1}`;try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:l,name:n,priority:1,testStatus:"unknown"})})).ok?s++:a++}catch{a++}}R(!1),J({success:s,failed:a}),s>0&&x&&x()};return t?(0,a.jsx)(d.aF,{isOpen:e,title:`Add ${s||t} ${y}`,onClose:u,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"single"===U?"primary":"ghost",onClick:()=>{D("single"),J(null)},children:"Single"}),(0,a.jsx)(d.$n,{size:"sm",variant:"bulk"===U?"primary":"ghost",onClick:()=>{D("bulk"),J(null)},children:"Bulk Add"})]}),"bulk"===U&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,a.jsx)("code",{children:"name|apiKey"})," or just ",(0,a.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:N,value:z,onChange:e=>q(e.target.value)}),M&&(0,a.jsxs)("div",{className:`text-sm font-medium ${M.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",M.success," added",M.failed>0?`, ✗ ${M.failed} failed`:""]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:H,fullWidth:!0,disabled:_||!z.trim(),children:_?"Adding...":"Add All Keys"}),(0,a.jsx)(d.$n,{onClick:u,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===U&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.pd,{label:"Name",value:k.name,onChange:e=>C({...k,name:e.target.value}),placeholder:F}),f&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:"Ollama Host URL",value:k.ollamaHostUrl,onChange:e=>C({...k,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:L,disabled:O||_,variant:"secondary",children:O?"Checking...":"Check"})})]}),!f&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:y,type:g?"text":"password",value:k.apiKey,onChange:e=>C({...k,apiKey:e.target.value}),placeholder:b,className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:L,disabled:!k.apiKey||O||_,variant:"secondary",children:O?"Checking...":"Check"})})]}),g&&n&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[n,c&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsxs)("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",c.replace(/^https?:\/\//,"")]})]})]}),f&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,a.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,a.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),I&&(0,a.jsx)(d.Ex,{variant:"success"===I?"success":"error",children:"success"===I?"Valid":"Invalid"}),r&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:l?`Validation checks ${s||"Anthropic Compatible"} by verifying the API key.`:`Validation checks ${s||"OpenAI Compatible"} via /models on your base URL.`}),j&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,a.jsx)(d.pd,{label:"Account ID",value:A.accountId,onChange:e=>T({...A,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,a.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),v&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(d.pd,{label:"Azure Endpoint",value:S.azureEndpoint,onChange:e=>$({...S,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,a.jsx)(d.pd,{label:"Deployment Name",value:S.deployment,onChange:e=>$({...S,deployment:e.target.value}),placeholder:"gpt-4"}),(0,a.jsx)(d.pd,{label:"API Version",value:S.apiVersion,onChange:e=>$({...S,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,a.jsx)(d.pd,{label:"Organization",value:S.organization,onChange:e=>$({...S,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,a.jsx)(d.pd,{label:"Priority",type:"number",value:k.priority,onChange:e=>C({...k,priority:Number.parseInt(e.target.value)||1})}),(0,a.jsx)(d.l6,{label:"Proxy Pool",value:k.proxyPoolId,onChange:e=>C({...k,proxyPoolId:e.target.value}),options:[{value:h,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:W,fullWidth:!0,disabled:_||!f&&!k.apiKey||v&&(!S.azureEndpoint||!S.deployment||!S.organization)||j&&!A.accountId,children:_?"Saving...":"Save"}),(0,a.jsx)(d.$n,{onClick:u,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function k({isOpen:e,node:t,onSave:s,onClose:r,isAnthropic:l}){let[o,n]=(0,i.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[c,p]=(0,i.useState)(!1),[m,x]=(0,i.useState)(""),[u,h]=(0,i.useState)(""),[f,g]=(0,i.useState)(!1),[y,b]=(0,i.useState)(null);(0,i.useEffect)(()=>{t&&n({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(l?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,l]);let v=async()=>{if(o.name.trim()&&o.prefix.trim()&&o.baseUrl.trim()){p(!0);try{let e={name:o.name,prefix:o.prefix,baseUrl:o.baseUrl};l||(e.apiType=o.apiType),await s(e)}finally{p(!1)}}},j=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:o.baseUrl,apiKey:m,type:l?"anthropic-compatible":"openai-compatible",modelId:u.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{g(!1)}};return t?(0,a.jsx)(d.aF,{isOpen:e,title:`Edit ${l?"Anthropic":"OpenAI"} Compatible`,onClose:r,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(d.pd,{label:"Name",value:o.name,onChange:e=>n({...o,name:e.target.value}),placeholder:`${l?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,a.jsx)(d.pd,{label:"Prefix",value:o.prefix,onChange:e=>n({...o,prefix:e.target.value}),placeholder:l?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!l&&(0,a.jsx)(d.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:o.apiType,onChange:e=>n({...o,apiType:e.target.value})}),(0,a.jsx)(d.pd,{label:"Base URL",value:o.baseUrl,onChange:e=>n({...o,baseUrl:e.target.value}),placeholder:l?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${l?"Anthropic":"OpenAI"}-compatible API.`}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:e=>x(e.target.value),className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:j,disabled:!m||f||!o.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,a.jsx)(d.pd,{label:"Model ID (optional)",value:u,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),y&&(0,a.jsx)(d.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:v,fullWidth:!0,disabled:!o.name.trim()||!o.prefix.trim()||!o.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,a.jsx)(d.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function C({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:r,onClose:l}){var o;let n,[c,p]=(0,i.useState)(""),[m,x]=(0,i.useState)(null),[u,h]=(0,i.useState)(""),[f,g]=(0,i.useState)(!1);(0,i.useEffect)(()=>{e&&(p(""),x(null),h(""),g(!1))},[e]);let y=(o=c.trim(),n=`${t}/`,o.startsWith(n)?o.slice(n.length):o),b=async()=>{if(y){x("testing"),h("");try{let e=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${y}`})}),s=await e.json();x(s.ok?"ok":"error"),h(s.error||"")}catch(e){x("error"),h(e.message)}}},v=async()=>{if(y&&!f){g(!0);try{await r(y)}finally{g(!1)}}};return(0,a.jsx)(d.aF,{isOpen:e,onClose:l,title:"Add Custom Model",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:c,onChange:e=>{p(e.target.value),x(null),h("")},onKeyDown:e=>{"Enter"===e.key&&b()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,a.jsx)(d.$n,{type:"button",variant:"secondary",icon:"science",loading:"testing"===m,onClick:b,disabled:!y||"testing"===m,children:"testing"===m?"Testing...":"Test"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,a.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:y||"model-id"})]})]}),"ok"===m&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===m&&(0,a.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,a.jsx)("span",{children:u||"Model not reachable"})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(d.$n,{type:"button",onClick:l,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(d.$n,{type:"button",onClick:v,fullWidth:!0,size:"sm",disabled:!y||f,children:f?"Adding...":"Add Model"})]})]})})}function S({isOpen:e,onClose:t,onSuccess:s}){let[r,l]=(0,i.useState)([]),[o,n]=(0,i.useState)(""),[c,p]=(0,i.useState)(!1),[m,x]=(0,i.useState)(null),[u,h]=(0,i.useState)(null),f=()=>{l([]),n(""),x(null),h(null),t()},g=async()=>{p(!0),x(null),h(null);try{let e=await Promise.all(r.map(async e=>({filename:e.name,jsonText:await e.text()}))),t=o.trim()?[{filename:"pasted JSON",jsonText:o.trim()}]:[],a=[...e,...t];if(0===a.length)throw Error("Select JSON files or paste JSON first");let i=await fetch("/api/oauth/codex/import-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:a})}),l=await i.json();if(!i.ok)throw Error(l.error||"Failed to import accounts");x(l),l.imported?.length>0&&s?.()}catch(e){h(e.message||"Failed to import accounts")}finally{p(!1)}},y=m?.imported?.length||0,b=m?.skipped?.length||0;return(0,a.jsx)(d.aF,{isOpen:e,title:"Import Codex Accounts",onClose:f,size:"lg",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-surface/50 p-3",children:[(0,a.jsx)("label",{className:"mb-2 block text-sm font-medium",children:"JSON files"}),(0,a.jsx)("input",{type:"file",accept:".json,application/json",multiple:!0,onChange:e=>l(Array.from(e.target.files||[])),className:"block w-full text-sm text-text-muted file:mr-3 file:rounded-md file:border-0 file:bg-primary file:px-3 file:py-1.5 file:text-sm file:font-medium file:text-white hover:file:bg-primary/90"}),r.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:r.map(e=>(0,a.jsx)("span",{className:"rounded bg-primary/10 px-2 py-0.5 text-xs text-primary",children:e.name},`${e.name}-${e.size}`))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"mb-2 block text-sm font-medium",children:"Paste JSON"}),(0,a.jsx)("textarea",{value:o,onChange:e=>n(e.target.value),placeholder:'[{ "type": "codex", "access_token": "...", "refresh_token": "..." }]',className:"h-36 w-full resize-none rounded-md border border-black/10 bg-white px-3 py-2 font-mono text-xs text-text-main shadow-inner transition-all placeholder-text-muted/60 focus:border-primary/50 focus:outline-none focus:ring-1 focus:ring-primary/30 dark:border-white/10 dark:bg-white/5"})]}),(0,a.jsx)("div",{className:"rounded-lg border border-border bg-background/60 px-3 py-2 text-xs text-text-muted",children:"Auto-detects Codex Session JSON, CLI Proxy API Auth JSON, and Sub2API JSON."}),u&&(0,a.jsx)("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-600",children:u}),m&&(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-surface/40 p-3",children:[(0,a.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2 text-sm",children:[(0,a.jsxs)("span",{className:"font-medium text-green-600",children:[y," imported"]}),b>0&&(0,a.jsxs)("span",{className:"text-text-muted",children:[b," skipped"]})]}),m.imported?.length>0&&(0,a.jsx)("div",{className:"max-h-32 overflow-auto rounded border border-border/70",children:m.imported.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border/70 px-2 py-1.5 last:border-b-0",children:[(0,a.jsx)("span",{className:"min-w-0 truncate text-xs",children:e.email||e.displayName||e.name||e.id}),(0,a.jsx)("span",{className:"shrink-0 text-xs text-text-muted",children:e.sourceFormat})]},e.id))}),m.skipped?.length>0&&(0,a.jsx)("div",{className:"mt-2 max-h-28 overflow-auto rounded border border-border/70",children:m.skipped.map((e,t)=>(0,a.jsxs)("div",{className:"border-b border-border/70 px-2 py-1.5 text-xs last:border-b-0",children:[(0,a.jsx)("span",{className:"font-medium",children:e.filename}),(0,a.jsxs)("span",{className:"text-text-muted",children:[" \xb7 ",e.reason]})]},`${e.filename}-${t}`))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:g,loading:c,disabled:c||!r.length&&!o.trim(),fullWidth:!0,children:"Import"}),(0,a.jsx)(d.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Close"})]})]})})}function $(){let e,t=(0,r.useParams)(),s=(0,r.useRouter)(),l=t.id,[x,h]=(0,i.useState)([]),[f,y]=(0,i.useState)(!0),[v,N]=(0,i.useState)(null),[$,A]=(0,i.useState)([]),[T,O]=(0,i.useState)(!1),[P,I]=(0,i.useState)(!1),[E,_]=(0,i.useState)(!1),[R,U]=(0,i.useState)(!1),[D,z]=(0,i.useState)(null),[q,M]=(0,i.useState)(!1),[J,F]=(0,i.useState)(!1),[K,L]=(0,i.useState)(!1),[W,H]=(0,i.useState)(!1),[V,B]=(0,i.useState)(null),[G,Q]=(0,i.useState)({}),[Z,X]=(0,i.useState)(!1),[Y,ee]=(0,i.useState)({}),[et,es]=(0,i.useState)(""),[ea,ei]=(0,i.useState)(null),[er,el]=(0,i.useState)(!1),[eo,en]=(0,i.useState)([]),[ed,ec]=(0,i.useState)("__none__"),[ep,em]=(0,i.useState)(!1),[ex,eu]=(0,i.useState)(null),[eh,ef]=(0,i.useState)(""),[eg,ey]=(0,i.useState)("auto"),[eb,ev]=(0,i.useState)(!1),[ej,eN]=(0,i.useState)(!1),[ew,ek]=(0,i.useState)("super_admin"),[eC,eS]=(0,i.useState)([]),[e$,eA]=(0,i.useState)([]),[eT,eO]=(0,i.useState)([]),{copied:eP,copy:eI}=(0,m.C)(),eE=v?{id:v.id,name:v.name||("anthropic-compatible"===v.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===v.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===v.type?"AC":"OC",apiType:v.apiType,baseUrl:v.baseUrl,type:v.type}:c.zN[l]||c.fg[l]||c.IS[l]||c.nJ[l]||c.br[l],e_=!!c.zN[l]||!!c.IS[l],eR=!!c.IS[l]?.noAuth,eU=(0,p.KC)(l),eD=(0,c.wG)(l),ez=(0,c.mq)(l),eq=(0,c.gb)(l),eM=ez||eq,eJ=c.Q2[l]?.thinkingConfig||null,eF=eM?l:eD,eK=eM?v?.prefix||l:eD,eL="codex"===l,eW=(eJ?.options||[]).map(e=>({value:e,label:"auto"===e?"codex"===l?"Auto (Medium)":"Auto":"xhigh"===e?"XHigh":e.charAt(0).toUpperCase()+e.slice(1)})),eH=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(eF)}`,{cache:"no-store"}),t=await e.json();e.ok&&eO(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[eF]),eV=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:eF,ids:[e]})})).ok&&await eH()}catch(e){console.log("Error disabling model:",e)}},eB=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(eF)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await eH()}catch(e){console.log("Error enabling model:",e)}},eG=async e=>{if(e.length&&confirm(`Disable all ${e.length} model(s)?`))try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:eF,ids:e})})).ok&&await eH()}catch(e){console.log("Error disabling all models:",e)}},eQ=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(eF)}`,{method:"DELETE"})).ok&&await eH()}catch(e){console.log("Error enabling all models:",e)}},eZ=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&Q(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===l&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eA(e.models)}).catch(()=>{})},[l]);let eX=(0,i.useCallback)(async()=>{try{let[e,t,s,a,i]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"}),fetch("/api/auth/me",{cache:"no-store"})]),r=await e.json(),o=await t.json(),n=await s.json(),d=a.ok?await a.json():{},c=i.ok?await i.json():{};if(e.ok){let e=(r.connections||[]).filter(e=>e.provider===l);h(e)}s.ok&&A(n.proxyPools||[]);let p=(d.providerStrategies||{})[l]||{};eu(p.fallbackStrategy||null),ef(null!=p.stickyRoundRobinLimit?String(p.stickyRoundRobinLimit):"1");let m=(d.providerThinking||{})[l]||{},x=c.providerThinkingScopeKey||c.userId||"super_admin",u="sub_user"===c.role?(c.providerThinking||{})[l]||{}:(d.userProviderThinking||{})[x]?.[l]||{};if(ey(m.mode||"auto"),ev(!0===m.fastMode),ek(x),eN(Object.prototype.hasOwnProperty.call(u,"fastMode")?!0===u.fastMode:!0===m.fastMode),t.ok){let e=(o.nodes||[]).find(e=>e.id===l)||null;if(!e&&eM)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===l)||null))break}N(e)}}catch(e){console.log("Error fetching connections:",e)}finally{y(!1)}},[l,eM]),eY=async e=>{try{let t=await fetch(`/api/provider-nodes/${l}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(N(s.node),await eX(),L(!1))}catch(e){console.log("Error updating provider node:",e)}},e0=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let r={...a};0===Object.keys(i).length?delete r[l]:r[l]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:r})})}catch(e){console.log("Error saving provider strategy:",e)}},e1=async(e,t=eb)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a={...(s.ok?await s.json():{}).providerThinking||{}},i={};e&&"auto"!==e&&(i.mode=e),"codex"===l&&!0===t&&(i.fastMode=!0),0===Object.keys(i).length?delete a[l]:a[l]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:a})})}catch(e){console.log("Error saving thinking config:",e)}},e2=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s=(t.ok?await t.json():{}).userProviderThinking||{},a=ew||"super_admin",i=s[a]||{},r=i[l]||{},o={...s,[a]:{...i,[l]:{...r,fastMode:e}}};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({userProviderThinking:o})})}catch(e){console.log("Error saving account fast mode:",e)}};(0,i.useEffect)(()=>{(async()=>{await Promise.all([eX(),eZ(),eH()])})()},[eX,eZ,eH]),(0,i.useEffect)(()=>{let e=(c.zN[l]||c.fg[l]||c.IS[l]||c.nJ[l])?.modelsFetcher;e&&u(e).then(eS)},[l]);let e5=async(e,t,s=eD)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await eZ();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},e3=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await eZ()}catch(e){console.log("Error deleting alias:",e)}},e4=async e=>{if(confirm("Delete this connection?"))try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&h(x.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}},e6=()=>{eX(),O(!1)},e7=async()=>{if(!R){U(!0),z(null);try{let e=await fetch("/api/oauth/codex/refresh-all",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),t=await e.json();if(!e.ok&&!t?.refreshed?.length)throw Error(t.error||"Failed to refresh Codex tokens");z(t),await eX()}catch(e){z({error:e.message,refreshed:[],failed:[],skipped:[]})}finally{U(!1)}}},e8=async e=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:l,...e})})).ok&&(await eX(),M(!1))}catch(e){console.log("Error saving connection:",e)}},e9=async e=>{try{(await fetch(`/api/providers/${V.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eX(),F(!1))}catch(e){console.log("Error updating connection:",e)}},te=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&h(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},tt=async(e,t)=>{let s=[...x];[s[e],s[t]]=[s[t],s[e]],h(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await eX()}},ts=(0,i.useMemo)(()=>new Set(x.map(e=>e.id)),[x]),ta=(0,i.useMemo)(()=>eo.filter(e=>ts.has(e)),[eo,ts]),ti=x.filter(e=>ta.includes(e.id));x.length>0&&(ta.length,x.length);let tr=(()=>{if(0===ti.length)return"";let e=new Set(ti.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return"All selected currently unbound";let s=$.find(e=>e.id===t);return`All selected currently bound to ${s?.name||t}`}return"Selected connections have mixed proxy bindings"})(),tl=()=>{ep||H(!1)},to=async()=>{if(0===ta.length)return;let e="__none__"===ed?null:ed;em(!0);try{let t=[];for(let s of ta)try{let a=await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:e})});t.push(a.ok)}catch(e){console.log("Error applying bulk proxy pool for",s,e),t.push(!1)}let s=t.filter(e=>!e).length;s>0&&alert(`Updated with ${s} failed request(s).`),await eX(),en([]),ec("__none__"),H(!1)}catch(e){console.log("Error applying bulk proxy pool:",e)}finally{em(!1)}},tn=(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/3 dark:divide-white/3",children:x.map((e,t)=>(0,a.jsx)("div",{className:"flex min-w-0 items-stretch",children:(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(j,{connection:e,proxyPools:$,isOAuth:e_,isFirst:0===t,isLast:t===x.length-1,onMoveUp:()=>tt(t,t-1),onMoveDown:()=>tt(t,t+1),onToggleActive:t=>te(e.id,t),onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&h(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{B(e),F(!0)},onDelete:()=>e4(e.id)})})},e.id))}),td=[{value:"__none__",label:"None"},...$.map(e=>({value:e.id,label:e.name}))],tc=0===ta.length?"Select one or more connections, then click Proxy Action.":tr,tp=ta.length>0&&!ep,tm=(0,a.jsx)(d.aF,{isOpen:W,onClose:tl,title:`Proxy Action (${ta.length} selected)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(d.l6,{label:"Proxy Pool",value:ed,onChange:e=>ec(e.target.value),options:td,placeholder:"None"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:tc}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Selecting None will unbind selected connections from proxy pool."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,a.jsx)(d.$n,{onClick:to,fullWidth:!0,disabled:!tp,children:ep?"Applying...":"Apply"}),(0,a.jsx)(d.$n,{onClick:tl,variant:"ghost",fullWidth:!0,disabled:ep,children:"Cancel"})]})]})}),tx=async e=>{if(!ea){ei(e);try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${eF}/${e}`})}),s=await t.json();ee(t=>({...t,[e]:s.ok?"ok":"error"})),es(s.ok?"":s.error||"Model not reachable")}catch{ee(t=>({...t,[e]:"error"})),es("Network error")}finally{ei(null)}}};return f?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(d.Qv,{}),(0,a.jsx)(d.Qv,{})]}):eE?(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(o(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${eE.color}15`},children:Z?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:eE.color},children:eE.textIcon||eE.id.slice(0,2).toUpperCase()}):(0,a.jsx)(n.default,{src:ez&&eE.apiType?"responses"===eE.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":eq?"/providers/anthropic-m.png":`/providers/${eE.id}.png`,alt:eE.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>X(!0)})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:eE.name}),(eE.notice?.apiKeyUrl||eE.notice?.signupUrl||eE.website)&&(0,a.jsxs)("a",{href:eE.notice?.apiKeyUrl||eE.notice?.signupUrl||eE.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),eE.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[x.length," connection",1===x.length?"":"s"]})]})]})]}),eE.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:eE.deprecationNotice})]}),eE.notice?.text&&!eE.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:eE.notice.text}),eE.notice.apiKeyUrl&&(0,a.jsx)("a",{href:eE.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),eM&&v&&(0,a.jsx)(d.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:eq?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[eq?"Messages API":"responses"===v.apiType?"Responses API":"Chat Completions"," \xb7 ",(v.baseUrl||"").replace(/\/$/,""),"/",eq?"messages":"responses"===v.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>M(!0),disabled:x.length>0,className:"w-full sm:w-auto",children:"Add"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>L(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{if(confirm(`Delete this ${eq?"Anthropic":"OpenAI"} Compatible node?`))try{(await fetch(`/api/provider-nodes/${l}`,{method:"DELETE"})).ok&&s.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}},className:"w-full sm:w-auto",children:"Delete"})]})]})}),eR?(0,a.jsx)(d.gw,{providerId:l}):(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:["codex"===l&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-muted whitespace-nowrap",children:"Global Fast"}),(0,a.jsx)(d.lM,{checked:eb,onChange:e=>{ev(e),e1(eg,e)}})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-muted whitespace-nowrap",children:"My Fast"}),(0,a.jsx)(d.lM,{checked:ej,onChange:e=>{eN(e),e2(e)}})]})]}),eJ&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("label",{htmlFor:"provider-default-reasoning",className:"text-xs font-medium text-text-muted whitespace-nowrap",children:"Default Reasoning"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("select",{id:"provider-default-reasoning",value:eg,onChange:e=>{var t;ey(t=e.target.value),e1(t)},disabled:f,className:"h-6 w-28 appearance-none rounded-full border border-border/60 bg-surface-2 pl-3 pr-7 text-xs font-medium text-text-main transition-colors focus:border-primary/50 focus:outline-none focus:ring-2 focus:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50",children:eW.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[16px] text-text-muted",children:"expand_more"})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(d.lM,{checked:"round-robin"===ex,onChange:e=>{let t=e?"round-robin":null,s=e?eh||"1":eh;e&&!eh&&ef("1"),eu(t),e0(t,s)}}),"round-robin"===ex&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:eh,onChange:e=>{var t;ef(t=e.target.value),e0("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===x.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e_?"lock":"key"})}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"})]}),!eM&&(0,a.jsxs)("div",{className:"flex gap-2",children:["iflow"===l&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>I(!0),children:"Cookie"}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>e_?O(!0):M(!0),children:"iflow"===l?"OAuth":"Add Connection"}),"codex"===l&&(0,a.jsx)(d.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>_(!0),children:"Batch Import"}),"codex"===l&&(0,a.jsx)(d.$n,{size:"sm",icon:"sync",variant:"secondary",onClick:e7,loading:R,children:"Refresh Tokens"})]})]}):(0,a.jsxs)(a.Fragment,{children:[tn,!eM&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===l&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>I(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>e_?O(!0):M(!0),className:"w-full sm:w-auto",children:"Add"}),"codex"===l&&(0,a.jsx)(d.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>_(!0),className:"w-full sm:w-auto",children:"Batch Import"}),"codex"===l&&(0,a.jsx)(d.$n,{size:"sm",icon:"sync",variant:"secondary",onClick:e7,loading:R,className:"w-full sm:w-auto",children:"Refresh Tokens"})]})]}),"codex"===l&&D&&(0,a.jsx)("div",{className:`mt-4 rounded-lg border px-3 py-2 text-sm ${D.error?"border-red-500/30 bg-red-500/10 text-red-600":"border-green-500/30 bg-green-500/10 text-green-700 dark:text-green-300"}`,children:D.error?D.error:`Token refresh complete: ${D.refreshed?.length||0} refreshed, ${D.failed?.length||0} failed, ${D.skipped?.length||0} skipped.`})]}),(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!eM&&(e=[...eU,...e$.filter(e=>!eU.some(t=>t.id===e.id))].filter(e=>!e.type||"llm"===e.type).map(e=>e.id).filter(e=>!eT.includes(e)),(0,a.jsxs)("div",{className:"flex gap-2",children:[eT.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:eQ,children:"Active All"}),e.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>eG(e),children:"Disable All"})]}))]}),!!et&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 wrap-break-word",children:et}),(()=>{let e,t,s;if(eM)return(0,a.jsx)(b,{providerStorageAlias:eF,providerDisplayAlias:eK,modelAliases:G,copied:eP,onCopy:eI,onSetAlias:e5,onDeleteAlias:e3,connections:x,isAnthropic:eq});let i=[...eU,...e$.filter(e=>!eU.some(t=>t.id===e.id))].filter(e=>!e.type||"llm"===e.type),r=new Set(eT),o=i.filter(e=>!r.has(e.id)),n=i.filter(e=>r.has(e.id)),d=Object.entries(G).filter(([e,t])=>{let s=`${eF}/`;if(!t.startsWith(s))return!1;let a=t.slice(s.length);return eE.passthroughModels?!eU.some(e=>e.id===a):!eU.some(e=>e.id===a)&&e===a}).map(([e,t])=>({id:t.slice(`${eF}/`.length),alias:e,fullModel:t}));return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,a.jsx)(g,{model:{id:e.id},fullModel:`${eK}/${e.id}`,displayModel:eL?e.id:`${eK}/${e.id}`,alias:e.alias,copied:eP,onCopy:eI,onSetAlias:()=>{},onDeleteAlias:()=>e3(e.alias),testStatus:Y[e.id],onTest:x.length>0||eR?()=>tx(e.id):void 0,isTesting:ea===e.id,isCustom:!0,isFree:!1},e.id)),o.map(e=>{let t=`${eF}/${e.id}`,s=`${l}/${e.id}`,i=Object.entries(G).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(g,{model:e,fullModel:`${eK}/${e.id}`,displayModel:eL?e.id:`${eK}/${e.id}`,alias:i,copied:eP,onCopy:eI,onSetAlias:t=>e5(e.id,t,eF),onDeleteAlias:()=>e3(i),testStatus:Y[e.id],onTest:x.length>0||eR?()=>tx(e.id):void 0,isTesting:ea===e.id,isFree:e.isFree,onDisable:()=>eV(e.id)},e.id)}),(0,a.jsxs)("button",{onClick:()=>el(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),eC.length>0&&(e=new Set(Object.values(G)),t=new Set(eU.map(e=>e.id)),0===(s=eC.filter(s=>!e.has(`${eF}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{let t=e.id.split("/").pop();await e5(e.id,t,eF)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",n.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,a.jsxs)("button",{onClick:()=>eB(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tm,"kiro"===l?(0,a.jsx)(d.Mh,{isOpen:T,providerInfo:eE,onSuccess:e6,onClose:()=>O(!1)}):"cursor"===l?(0,a.jsx)(d.G9,{isOpen:T,onSuccess:e6,onClose:()=>O(!1)}):"gitlab"===l?(0,a.jsx)(d.vj,{isOpen:T,providerInfo:eE,onSuccess:e6,onClose:()=>O(!1)}):(0,a.jsx)(d.LF,{isOpen:T,provider:l,providerInfo:eE,onSuccess:e6,onClose:()=>O(!1)}),"iflow"===l&&(0,a.jsx)(d.vE,{isOpen:P,onSuccess:()=>{eX(),I(!1)},onClose:()=>I(!1)}),"codex"===l&&(0,a.jsx)(S,{isOpen:E,onSuccess:eX,onClose:()=>_(!1)}),(0,a.jsx)(w,{isOpen:q,provider:l,providerName:eE.name,isCompatible:eM,isAnthropic:eq,authType:eE?.authType,authHint:eE?.authHint,website:eE?.website,proxyPools:$,onSave:e8,onClose:()=>M(!1)}),(0,a.jsx)(d.wI,{isOpen:J,connection:V,proxyPools:$,onSave:e9,onClose:()=>F(!1)}),eM&&(0,a.jsx)(k,{isOpen:K,node:v,onSave:eY,onClose:()=>L(!1),isAnthropic:eq}),!eM&&(0,a.jsx)(C,{isOpen:er,providerAlias:eF,providerDisplayAlias:eK,onSave:async e=>{let t=eE?.passthroughModels?e.split("/").pop():e;await e5(e,t,eF),el(!1)},onClose:()=>el(!1)})]}):(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(o(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}w.propTypes={isOpen:f().bool.isRequired,provider:f().string,providerName:f().string,isCompatible:f().bool,isAnthropic:f().bool,authType:f().string,authHint:f().string,website:f().string,proxyPools:f().arrayOf(f().shape({id:f().string,name:f().string})),onSave:f().func.isRequired,onBulkDone:f().func,onClose:f().func.isRequired},k.propTypes={isOpen:f().bool.isRequired,node:f().shape({id:f().string,name:f().string,prefix:f().string,apiType:f().string,baseUrl:f().string}),onSave:f().func.isRequired,onClose:f().func.isRequired,isAnthropic:f().bool},C.propTypes={isOpen:f().bool.isRequired,providerAlias:f().string.isRequired,providerDisplayAlias:f().string.isRequired,onSave:f().func.isRequired,onClose:f().func.isRequired},S.propTypes={isOpen:f().bool.isRequired,onClose:f().func.isRequired,onSuccess:f().func}},25365:(e,t,s)=>{Promise.resolve().then(s.bind(s,7570))}},e=>{e.O(0,[2574,3862,1051,5772,1321,5497,8441,3794,7358],()=>e(e.s=25365)),_N_E=e.O()}]);
|
|
3
|
+
sk-...`;function w({isOpen:e,provider:t,providerName:s,isCompatible:r,isAnthropic:l,authType:o,authHint:n,website:c,proxyPools:p,onSave:m,onBulkDone:x,onClose:u}){let h="__none__",f="ollama-local"===t,g="cookie"===o,y=g?"Cookie Value":"API Key",b=g?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":"",v="azure"===t,j="cloudflare-ai"===t,[k,C]=(0,i.useState)({name:"",apiKey:"",priority:1,proxyPoolId:h,ollamaHostUrl:""}),[S,$]=(0,i.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[A,T]=(0,i.useState)({accountId:""}),[O,P]=(0,i.useState)(!1),[I,E]=(0,i.useState)(null),[_,R]=(0,i.useState)(!1),[U,D]=(0,i.useState)("single"),[z,q]=(0,i.useState)(""),[M,J]=(0,i.useState)(null),F=f?"Ollama Local":g?`${s||t} Cookie`:"Production Key";(0,i.useEffect)(()=>{e&&(C({name:r?F:"",apiKey:"",priority:1,proxyPoolId:h,ollamaHostUrl:""}),$({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),T({accountId:""}),P(!1),E(null),R(!1),D("single"),q(""),J(null))},[F,r,e]);let K=()=>f&&k.ollamaHostUrl.trim()?{baseUrl:k.ollamaHostUrl.trim()}:v?{azureEndpoint:S.azureEndpoint,apiVersion:S.apiVersion,deployment:S.deployment,organization:S.organization}:j?{accountId:A.accountId}:void 0,L=async()=>{P(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:k.apiKey,providerSpecificData:K()})}),s=await e.json();E(s.valid?"success":"failed")}catch{E("failed")}finally{P(!1)}},W=async()=>{if(!t||!f&&!k.apiKey)return;let e=k.name.trim()||F;R(!0);try{let s=!1;try{P(!0),E(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:k.apiKey,providerSpecificData:K()})});s=!!(await e.json()).valid,E(s?"success":"failed")}catch{E("failed")}finally{P(!1)}await m({name:e,apiKey:k.apiKey,priority:k.priority,proxyPoolId:k.proxyPoolId===h?null:k.proxyPoolId,testStatus:s?"active":"unknown",providerSpecificData:K()})}finally{R(!1)}},H=async()=>{let e=z.split("\n").map(e=>e.trim()).filter(Boolean);if(!e.length)return;R(!0),J(null);let s=0,a=0;for(let i=0;i<e.length;i++){let r=e[i].split("|"),l=r.length>=2?r.slice(1).join("|").trim():r[0].trim(),o=r.length>=2?r[0].trim():"Key",n=`${o} ${i+1}`;try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:l,name:n,priority:1,testStatus:"unknown"})})).ok?s++:a++}catch{a++}}R(!1),J({success:s,failed:a}),s>0&&x&&x()};return t?(0,a.jsx)(d.aF,{isOpen:e,title:`Add ${s||t} ${y}`,onClose:u,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"single"===U?"primary":"ghost",onClick:()=>{D("single"),J(null)},children:"Single"}),(0,a.jsx)(d.$n,{size:"sm",variant:"bulk"===U?"primary":"ghost",onClick:()=>{D("bulk"),J(null)},children:"Bulk Add"})]}),"bulk"===U&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,a.jsx)("code",{children:"name|apiKey"})," or just ",(0,a.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:N,value:z,onChange:e=>q(e.target.value)}),M&&(0,a.jsxs)("div",{className:`text-sm font-medium ${M.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",M.success," added",M.failed>0?`, ✗ ${M.failed} failed`:""]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:H,fullWidth:!0,disabled:_||!z.trim(),children:_?"Adding...":"Add All Keys"}),(0,a.jsx)(d.$n,{onClick:u,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===U&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.pd,{label:"Name",value:k.name,onChange:e=>C({...k,name:e.target.value}),placeholder:F}),f&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:"Ollama Host URL",value:k.ollamaHostUrl,onChange:e=>C({...k,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:L,disabled:O||_,variant:"secondary",children:O?"Checking...":"Check"})})]}),!f&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:y,type:g?"text":"password",value:k.apiKey,onChange:e=>C({...k,apiKey:e.target.value}),placeholder:b,className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:L,disabled:!k.apiKey||O||_,variant:"secondary",children:O?"Checking...":"Check"})})]}),g&&n&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[n,c&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsxs)("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",c.replace(/^https?:\/\//,"")]})]})]}),f&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,a.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,a.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),I&&(0,a.jsx)(d.Ex,{variant:"success"===I?"success":"error",children:"success"===I?"Valid":"Invalid"}),r&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:l?`Validation checks ${s||"Anthropic Compatible"} by verifying the API key.`:`Validation checks ${s||"OpenAI Compatible"} via /models on your base URL.`}),j&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,a.jsx)(d.pd,{label:"Account ID",value:A.accountId,onChange:e=>T({...A,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,a.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),v&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(d.pd,{label:"Azure Endpoint",value:S.azureEndpoint,onChange:e=>$({...S,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,a.jsx)(d.pd,{label:"Deployment Name",value:S.deployment,onChange:e=>$({...S,deployment:e.target.value}),placeholder:"gpt-4"}),(0,a.jsx)(d.pd,{label:"API Version",value:S.apiVersion,onChange:e=>$({...S,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,a.jsx)(d.pd,{label:"Organization",value:S.organization,onChange:e=>$({...S,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,a.jsx)(d.pd,{label:"Priority",type:"number",value:k.priority,onChange:e=>C({...k,priority:Number.parseInt(e.target.value)||1})}),(0,a.jsx)(d.l6,{label:"Proxy Pool",value:k.proxyPoolId,onChange:e=>C({...k,proxyPoolId:e.target.value}),options:[{value:h,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:W,fullWidth:!0,disabled:_||!f&&!k.apiKey||v&&(!S.azureEndpoint||!S.deployment||!S.organization)||j&&!A.accountId,children:_?"Saving...":"Save"}),(0,a.jsx)(d.$n,{onClick:u,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function k({isOpen:e,node:t,onSave:s,onClose:r,isAnthropic:l}){let[o,n]=(0,i.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[c,p]=(0,i.useState)(!1),[m,x]=(0,i.useState)(""),[u,h]=(0,i.useState)(""),[f,g]=(0,i.useState)(!1),[y,b]=(0,i.useState)(null);(0,i.useEffect)(()=>{t&&n({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(l?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,l]);let v=async()=>{if(o.name.trim()&&o.prefix.trim()&&o.baseUrl.trim()){p(!0);try{let e={name:o.name,prefix:o.prefix,baseUrl:o.baseUrl};l||(e.apiType=o.apiType),await s(e)}finally{p(!1)}}},j=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:o.baseUrl,apiKey:m,type:l?"anthropic-compatible":"openai-compatible",modelId:u.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{g(!1)}};return t?(0,a.jsx)(d.aF,{isOpen:e,title:`Edit ${l?"Anthropic":"OpenAI"} Compatible`,onClose:r,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(d.pd,{label:"Name",value:o.name,onChange:e=>n({...o,name:e.target.value}),placeholder:`${l?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,a.jsx)(d.pd,{label:"Prefix",value:o.prefix,onChange:e=>n({...o,prefix:e.target.value}),placeholder:l?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!l&&(0,a.jsx)(d.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:o.apiType,onChange:e=>n({...o,apiType:e.target.value})}),(0,a.jsx)(d.pd,{label:"Base URL",value:o.baseUrl,onChange:e=>n({...o,baseUrl:e.target.value}),placeholder:l?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${l?"Anthropic":"OpenAI"}-compatible API.`}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:e=>x(e.target.value),className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:j,disabled:!m||f||!o.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,a.jsx)(d.pd,{label:"Model ID (optional)",value:u,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),y&&(0,a.jsx)(d.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:v,fullWidth:!0,disabled:!o.name.trim()||!o.prefix.trim()||!o.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,a.jsx)(d.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function C({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:r,onClose:l}){var o;let n,[c,p]=(0,i.useState)(""),[m,x]=(0,i.useState)(null),[u,h]=(0,i.useState)(""),[f,g]=(0,i.useState)(!1);(0,i.useEffect)(()=>{e&&(p(""),x(null),h(""),g(!1))},[e]);let y=(o=c.trim(),n=`${t}/`,o.startsWith(n)?o.slice(n.length):o),b=async()=>{if(y){x("testing"),h("");try{let e=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${y}`})}),s=await e.json();x(s.ok?"ok":"error"),h(s.error||"")}catch(e){x("error"),h(e.message)}}},v=async()=>{if(y&&!f){g(!0);try{await r(y)}finally{g(!1)}}};return(0,a.jsx)(d.aF,{isOpen:e,onClose:l,title:"Add Custom Model",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:c,onChange:e=>{p(e.target.value),x(null),h("")},onKeyDown:e=>{"Enter"===e.key&&b()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,a.jsx)(d.$n,{type:"button",variant:"secondary",icon:"science",loading:"testing"===m,onClick:b,disabled:!y||"testing"===m,children:"testing"===m?"Testing...":"Test"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,a.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:y||"model-id"})]})]}),"ok"===m&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===m&&(0,a.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,a.jsx)("span",{children:u||"Model not reachable"})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(d.$n,{type:"button",onClick:l,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(d.$n,{type:"button",onClick:v,fullWidth:!0,size:"sm",disabled:!y||f,children:f?"Adding...":"Add Model"})]})]})})}function S({isOpen:e,onClose:t,onSuccess:s}){let[r,l]=(0,i.useState)([]),[o,n]=(0,i.useState)(""),[c,p]=(0,i.useState)(!1),[m,x]=(0,i.useState)(null),[u,h]=(0,i.useState)(null),f=()=>{l([]),n(""),x(null),h(null),t()},g=async()=>{p(!0),x(null),h(null);try{let e=await Promise.all(r.map(async e=>({filename:e.name,jsonText:await e.text()}))),t=o.trim()?[{filename:"pasted JSON",jsonText:o.trim()}]:[],a=[...e,...t];if(0===a.length)throw Error("Select JSON files or paste JSON first");let i=await fetch("/api/oauth/codex/import-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:a})}),l=await i.json();if(!i.ok)throw Error(l.error||"Failed to import accounts");x(l),l.imported?.length>0&&s?.()}catch(e){h(e.message||"Failed to import accounts")}finally{p(!1)}},y=m?.imported?.length||0,b=m?.skipped?.length||0;return(0,a.jsx)(d.aF,{isOpen:e,title:"Import Codex Accounts",onClose:f,size:"lg",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-surface/50 p-3",children:[(0,a.jsx)("label",{className:"mb-2 block text-sm font-medium",children:"JSON files"}),(0,a.jsx)("input",{type:"file",accept:".json,application/json",multiple:!0,onChange:e=>l(Array.from(e.target.files||[])),className:"block w-full text-sm text-text-muted file:mr-3 file:rounded-md file:border-0 file:bg-primary file:px-3 file:py-1.5 file:text-sm file:font-medium file:text-white hover:file:bg-primary/90"}),r.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:r.map(e=>(0,a.jsx)("span",{className:"rounded bg-primary/10 px-2 py-0.5 text-xs text-primary",children:e.name},`${e.name}-${e.size}`))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"mb-2 block text-sm font-medium",children:"Paste JSON"}),(0,a.jsx)("textarea",{value:o,onChange:e=>n(e.target.value),placeholder:'[{ "type": "codex", "access_token": "...", "refresh_token": "..." }]',className:"h-36 w-full resize-none rounded-md border border-black/10 bg-white px-3 py-2 font-mono text-xs text-text-main shadow-inner transition-all placeholder-text-muted/60 focus:border-primary/50 focus:outline-none focus:ring-1 focus:ring-primary/30 dark:border-white/10 dark:bg-white/5"})]}),(0,a.jsx)("div",{className:"rounded-lg border border-border bg-background/60 px-3 py-2 text-xs text-text-muted",children:"Auto-detects Codex Session JSON, CLI Proxy API Auth JSON, and Sub2API JSON."}),u&&(0,a.jsx)("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-600",children:u}),m&&(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-surface/40 p-3",children:[(0,a.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2 text-sm",children:[(0,a.jsxs)("span",{className:"font-medium text-green-600",children:[y," imported"]}),b>0&&(0,a.jsxs)("span",{className:"text-text-muted",children:[b," skipped"]})]}),m.imported?.length>0&&(0,a.jsx)("div",{className:"max-h-32 overflow-auto rounded border border-border/70",children:m.imported.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border/70 px-2 py-1.5 last:border-b-0",children:[(0,a.jsx)("span",{className:"min-w-0 truncate text-xs",children:e.email||e.displayName||e.name||e.id}),(0,a.jsx)("span",{className:"shrink-0 text-xs text-text-muted",children:e.sourceFormat})]},e.id))}),m.skipped?.length>0&&(0,a.jsx)("div",{className:"mt-2 max-h-28 overflow-auto rounded border border-border/70",children:m.skipped.map((e,t)=>(0,a.jsxs)("div",{className:"border-b border-border/70 px-2 py-1.5 text-xs last:border-b-0",children:[(0,a.jsx)("span",{className:"font-medium",children:e.filename}),(0,a.jsxs)("span",{className:"text-text-muted",children:[" \xb7 ",e.reason]})]},`${e.filename}-${t}`))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:g,loading:c,disabled:c||!r.length&&!o.trim(),fullWidth:!0,children:"Import"}),(0,a.jsx)(d.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Close"})]})]})})}function $(){let e,t=(0,r.useParams)(),s=(0,r.useRouter)(),l=t.id,[x,h]=(0,i.useState)([]),[f,y]=(0,i.useState)(!0),[v,N]=(0,i.useState)(null),[$,A]=(0,i.useState)([]),[T,O]=(0,i.useState)(!1),[P,I]=(0,i.useState)(!1),[E,_]=(0,i.useState)(!1),[R,U]=(0,i.useState)(!1),[D,z]=(0,i.useState)(null),[q,M]=(0,i.useState)(!1),[J,F]=(0,i.useState)(!1),[K,L]=(0,i.useState)(!1),[W,H]=(0,i.useState)(!1),[V,B]=(0,i.useState)(null),[G,Q]=(0,i.useState)({}),[Z,X]=(0,i.useState)(!1),[Y,ee]=(0,i.useState)({}),[et,es]=(0,i.useState)(""),[ea,ei]=(0,i.useState)(null),[er,el]=(0,i.useState)(!1),[eo,en]=(0,i.useState)([]),[ed,ec]=(0,i.useState)("__none__"),[ep,em]=(0,i.useState)(!1),[ex,eu]=(0,i.useState)(null),[eh,ef]=(0,i.useState)(""),[eg,ey]=(0,i.useState)("auto"),[eb,ev]=(0,i.useState)(!1),[ej,eN]=(0,i.useState)(!1),[ew,ek]=(0,i.useState)("super_admin"),[eC,eS]=(0,i.useState)([]),[e$,eA]=(0,i.useState)([]),[eT,eO]=(0,i.useState)([]),{copied:eP,copy:eI}=(0,m.C)(),eE=v?{id:v.id,name:v.name||("anthropic-compatible"===v.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===v.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===v.type?"AC":"OC",apiType:v.apiType,baseUrl:v.baseUrl,type:v.type}:c.zN[l]||c.fg[l]||c.IS[l]||c.nJ[l]||c.br[l],e_=!!c.zN[l]||!!c.IS[l],eR=!!c.IS[l]?.noAuth,eU=(0,p.KC)(l),eD=(0,c.wG)(l),ez=(0,c.mq)(l),eq=(0,c.gb)(l),eM=ez||eq,eJ=c.Q2[l]?.thinkingConfig||null,eF=eM?l:eD,eK=eM?v?.prefix||l:eD,eL="codex"===l,eW=(eJ?.options||[]).map(e=>({value:e,label:"auto"===e?"codex"===l?"Auto (Medium)":"Auto":"xhigh"===e?"XHigh":e.charAt(0).toUpperCase()+e.slice(1)})),eH=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(eF)}`,{cache:"no-store"}),t=await e.json();e.ok&&eO(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[eF]),eV=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:eF,ids:[e]})})).ok&&await eH()}catch(e){console.log("Error disabling model:",e)}},eB=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(eF)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await eH()}catch(e){console.log("Error enabling model:",e)}},eG=async e=>{if(e.length&&confirm(`Disable all ${e.length} model(s)?`))try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:eF,ids:e})})).ok&&await eH()}catch(e){console.log("Error disabling all models:",e)}},eQ=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(eF)}`,{method:"DELETE"})).ok&&await eH()}catch(e){console.log("Error enabling all models:",e)}},eZ=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&Q(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===l&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eA(e.models)}).catch(()=>{})},[l]);let eX=(0,i.useCallback)(async()=>{try{let[e,t,s,a,i]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"}),fetch("/api/auth/me",{cache:"no-store"})]),r=await e.json(),o=await t.json(),n=await s.json(),d=a.ok?await a.json():{},c=i.ok?await i.json():{};if(e.ok){let e=(r.connections||[]).filter(e=>e.provider===l);h(e)}s.ok&&A(n.proxyPools||[]);let p=(d.providerStrategies||{})[l]||{};eu(p.fallbackStrategy||null),ef(null!=p.stickyRoundRobinLimit?String(p.stickyRoundRobinLimit):"1");let m=(d.providerThinking||{})[l]||{},x=c.providerThinkingScopeKey||c.userId||"super_admin",u="sub_user"===c.role?(c.providerThinking||{})[l]||{}:(d.userProviderThinking||{})[x]?.[l]||{};if(ey(m.mode||"auto"),ev(!0===m.fastMode),ek(x),eN(Object.prototype.hasOwnProperty.call(u,"fastMode")?!0===u.fastMode:!0===m.fastMode),t.ok){let e=(o.nodes||[]).find(e=>e.id===l)||null;if(!e&&eM)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===l)||null))break}N(e)}}catch(e){console.log("Error fetching connections:",e)}finally{y(!1)}},[l,eM]),eY=async e=>{try{let t=await fetch(`/api/provider-nodes/${l}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(N(s.node),await eX(),L(!1))}catch(e){console.log("Error updating provider node:",e)}},e0=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let r={...a};0===Object.keys(i).length?delete r[l]:r[l]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:r})})}catch(e){console.log("Error saving provider strategy:",e)}},e1=async(e,t=eb)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a={...(s.ok?await s.json():{}).providerThinking||{}},i={};e&&"auto"!==e&&(i.mode=e),"codex"===l&&!0===t&&(i.fastMode=!0),0===Object.keys(i).length?delete a[l]:a[l]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:a})})}catch(e){console.log("Error saving thinking config:",e)}},e2=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s=(t.ok?await t.json():{}).userProviderThinking||{},a=ew||"super_admin",i=s[a]||{},r=i[l]||{},o={...s,[a]:{...i,[l]:{...r,fastMode:e}}};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({userProviderThinking:o})})}catch(e){console.log("Error saving account fast mode:",e)}};(0,i.useEffect)(()=>{(async()=>{await Promise.all([eX(),eZ(),eH()])})()},[eX,eZ,eH]),(0,i.useEffect)(()=>{let e=(c.zN[l]||c.fg[l]||c.IS[l]||c.nJ[l])?.modelsFetcher;e&&u(e).then(eS)},[l]);let e5=async(e,t,s=eD)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await eZ();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},e3=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await eZ()}catch(e){console.log("Error deleting alias:",e)}},e4=async e=>{if(confirm("Delete this connection?"))try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&h(x.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}},e6=()=>{eX(),O(!1)},e7=async()=>{if(!R){U(!0),z(null);try{let e=await fetch("/api/oauth/codex/refresh-all",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),t=await e.json();if(!e.ok&&!t?.refreshed?.length)throw Error(t.error||"Failed to refresh Codex tokens");z(t),await eX()}catch(e){z({error:e.message,refreshed:[],failed:[],skipped:[]})}finally{U(!1)}}},e8=async e=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:l,...e})})).ok&&(await eX(),M(!1))}catch(e){console.log("Error saving connection:",e)}},e9=async e=>{try{(await fetch(`/api/providers/${V.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eX(),F(!1))}catch(e){console.log("Error updating connection:",e)}},te=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&h(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},tt=async(e,t)=>{let s=[...x];[s[e],s[t]]=[s[t],s[e]],h(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await eX()}},ts=(0,i.useMemo)(()=>new Set(x.map(e=>e.id)),[x]),ta=(0,i.useMemo)(()=>eo.filter(e=>ts.has(e)),[eo,ts]),ti=x.filter(e=>ta.includes(e.id));x.length>0&&(ta.length,x.length);let tr=(()=>{if(0===ti.length)return"";let e=new Set(ti.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return"All selected currently unbound";let s=$.find(e=>e.id===t);return`All selected currently bound to ${s?.name||t}`}return"Selected connections have mixed proxy bindings"})(),tl=()=>{ep||H(!1)},to=async()=>{if(0===ta.length)return;let e="__none__"===ed?null:ed;em(!0);try{let t=[];for(let s of ta)try{let a=await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:e})});t.push(a.ok)}catch(e){console.log("Error applying bulk proxy pool for",s,e),t.push(!1)}let s=t.filter(e=>!e).length;s>0&&alert(`Updated with ${s} failed request(s).`),await eX(),en([]),ec("__none__"),H(!1)}catch(e){console.log("Error applying bulk proxy pool:",e)}finally{em(!1)}},tn=(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/3 dark:divide-white/3",children:x.map((e,t)=>(0,a.jsx)("div",{className:"flex min-w-0 items-stretch",children:(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(j,{connection:e,proxyPools:$,isOAuth:e_,isFirst:0===t,isLast:t===x.length-1,onMoveUp:()=>tt(t,t-1),onMoveDown:()=>tt(t,t+1),onToggleActive:t=>te(e.id,t),onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&h(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{B(e),F(!0)},onDelete:()=>e4(e.id)})})},e.id))}),td=[{value:"__none__",label:"None"},...$.map(e=>({value:e.id,label:e.name}))],tc=0===ta.length?"Select one or more connections, then click Proxy Action.":tr,tp=ta.length>0&&!ep,tm=(0,a.jsx)(d.aF,{isOpen:W,onClose:tl,title:`Proxy Action (${ta.length} selected)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(d.l6,{label:"Proxy Pool",value:ed,onChange:e=>ec(e.target.value),options:td,placeholder:"None"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:tc}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Selecting None will unbind selected connections from proxy pool."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,a.jsx)(d.$n,{onClick:to,fullWidth:!0,disabled:!tp,children:ep?"Applying...":"Apply"}),(0,a.jsx)(d.$n,{onClick:tl,variant:"ghost",fullWidth:!0,disabled:ep,children:"Cancel"})]})]})}),tx=async e=>{if(!ea){ei(e);try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${eF}/${e}`})}),s=await t.json();ee(t=>({...t,[e]:s.ok?"ok":"error"})),es(s.ok?"":s.error||"Model not reachable")}catch{ee(t=>({...t,[e]:"error"})),es("Network error")}finally{ei(null)}}};return f?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(d.Qv,{}),(0,a.jsx)(d.Qv,{})]}):eE?(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(o(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${eE.color}15`},children:Z?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:eE.color},children:eE.textIcon||eE.id.slice(0,2).toUpperCase()}):(0,a.jsx)(n.default,{src:ez&&eE.apiType?"responses"===eE.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":eq?"/providers/anthropic-m.png":`/providers/${eE.id}.png`,alt:eE.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>X(!0)})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:eE.name}),(eE.notice?.apiKeyUrl||eE.notice?.signupUrl||eE.website)&&(0,a.jsxs)("a",{href:eE.notice?.apiKeyUrl||eE.notice?.signupUrl||eE.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),eE.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[x.length," connection",1===x.length?"":"s"]})]})]})]}),eE.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:eE.deprecationNotice})]}),eE.notice?.text&&!eE.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:eE.notice.text}),eE.notice.apiKeyUrl&&(0,a.jsx)("a",{href:eE.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),eM&&v&&(0,a.jsx)(d.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:eq?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[eq?"Messages API":"responses"===v.apiType?"Responses API":"Chat Completions"," \xb7 ",(v.baseUrl||"").replace(/\/$/,""),"/",eq?"messages":"responses"===v.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>M(!0),disabled:x.length>0,className:"w-full sm:w-auto",children:"Add"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>L(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{if(confirm(`Delete this ${eq?"Anthropic":"OpenAI"} Compatible node?`))try{(await fetch(`/api/provider-nodes/${l}`,{method:"DELETE"})).ok&&s.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}},className:"w-full sm:w-auto",children:"Delete"})]})]})}),eR?(0,a.jsx)(d.gw,{providerId:l}):(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:["codex"===l&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-muted whitespace-nowrap",children:"Global Fast"}),(0,a.jsx)(d.lM,{checked:eb,onChange:e=>{ev(e),e1(eg,e)}})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-muted whitespace-nowrap",children:"My Fast"}),(0,a.jsx)(d.lM,{checked:ej,onChange:e=>{eN(e),e2(e)}})]})]}),eJ&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("label",{htmlFor:"provider-default-reasoning",className:"text-xs font-medium text-text-muted whitespace-nowrap",children:"Default Reasoning"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("select",{id:"provider-default-reasoning",value:eg,onChange:e=>{var t;ey(t=e.target.value),e1(t)},disabled:f,className:"h-6 w-28 appearance-none rounded-full border border-border/60 bg-surface-2 pl-3 pr-7 text-xs font-medium text-text-main transition-colors focus:border-primary/50 focus:outline-none focus:ring-2 focus:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50",children:eW.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[16px] text-text-muted",children:"expand_more"})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(d.lM,{checked:"round-robin"===ex,onChange:e=>{let t=e?"round-robin":null,s=e?eh||"1":eh;e&&!eh&&ef("1"),eu(t),e0(t,s)}}),"round-robin"===ex&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:eh,onChange:e=>{var t;ef(t=e.target.value),e0("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===x.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e_?"lock":"key"})}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"})]}),!eM&&(0,a.jsxs)("div",{className:"flex gap-2",children:["iflow"===l&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>I(!0),children:"Cookie"}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>e_?O(!0):M(!0),children:"iflow"===l?"OAuth":"Add Connection"}),"codex"===l&&(0,a.jsx)(d.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>_(!0),children:"Batch Import"}),"codex"===l&&(0,a.jsx)(d.$n,{size:"sm",icon:"sync",variant:"secondary",onClick:e7,loading:R,children:"Refresh Tokens"})]})]}):(0,a.jsxs)(a.Fragment,{children:[tn,!eM&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===l&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>I(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>e_?O(!0):M(!0),className:"w-full sm:w-auto",children:"Add"}),"codex"===l&&(0,a.jsx)(d.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>_(!0),className:"w-full sm:w-auto",children:"Batch Import"}),"codex"===l&&(0,a.jsx)(d.$n,{size:"sm",icon:"sync",variant:"secondary",onClick:e7,loading:R,className:"w-full sm:w-auto",children:"Refresh Tokens"})]})]}),"codex"===l&&D&&(0,a.jsx)("div",{className:`mt-4 rounded-lg border px-3 py-2 text-sm ${D.error?"border-red-500/30 bg-red-500/10 text-red-600":"border-green-500/30 bg-green-500/10 text-green-700 dark:text-green-300"}`,children:D.error?D.error:`Token refresh complete: ${D.refreshed?.length||0} refreshed, ${D.failed?.length||0} failed, ${D.skipped?.length||0} skipped.`})]}),(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!eM&&(e=[...eU,...e$.filter(e=>!eU.some(t=>t.id===e.id))].filter(e=>!e.type||"llm"===e.type).map(e=>e.id).filter(e=>!eT.includes(e)),(0,a.jsxs)("div",{className:"flex gap-2",children:[eT.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:eQ,children:"Active All"}),e.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>eG(e),children:"Disable All"})]}))]}),!!et&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 wrap-break-word",children:et}),(()=>{let e,t,s;if(eM)return(0,a.jsx)(b,{providerStorageAlias:eF,providerDisplayAlias:eK,modelAliases:G,copied:eP,onCopy:eI,onSetAlias:e5,onDeleteAlias:e3,connections:x,isAnthropic:eq});let i=[...eU,...e$.filter(e=>!eU.some(t=>t.id===e.id))].filter(e=>!e.type||"llm"===e.type),r=new Set(eT),o=i.filter(e=>!r.has(e.id)),n=i.filter(e=>r.has(e.id)),d=Object.entries(G).filter(([e,t])=>{let s=`${eF}/`;if(!t.startsWith(s))return!1;let a=t.slice(s.length);return eE.passthroughModels?!eU.some(e=>e.id===a):!eU.some(e=>e.id===a)&&e===a}).map(([e,t])=>({id:t.slice(`${eF}/`.length),alias:e,fullModel:t}));return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,a.jsx)(g,{model:{id:e.id},fullModel:`${eK}/${e.id}`,displayModel:eL?e.id:`${eK}/${e.id}`,alias:e.alias,copied:eP,onCopy:eI,onSetAlias:()=>{},onDeleteAlias:()=>e3(e.alias),testStatus:Y[e.id],onTest:x.length>0||eR?()=>tx(e.id):void 0,isTesting:ea===e.id,isCustom:!0,isFree:!1},e.id)),o.map(e=>{let t=`${eF}/${e.id}`,s=`${l}/${e.id}`,i=Object.entries(G).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(g,{model:e,fullModel:`${eK}/${e.id}`,displayModel:eL?e.id:`${eK}/${e.id}`,alias:i,copied:eP,onCopy:eI,onSetAlias:t=>e5(e.id,t,eF),onDeleteAlias:()=>e3(i),testStatus:Y[e.id],onTest:x.length>0||eR?()=>tx(e.id):void 0,isTesting:ea===e.id,isFree:e.isFree,onDisable:()=>eV(e.id)},e.id)}),(0,a.jsxs)("button",{onClick:()=>el(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),eC.length>0&&(e=new Set(Object.values(G)),t=new Set(eU.map(e=>e.id)),0===(s=eC.filter(s=>!e.has(`${eF}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{let t=e.id.split("/").pop();await e5(e.id,t,eF)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",n.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,a.jsxs)("button",{onClick:()=>eB(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tm,"kiro"===l?(0,a.jsx)(d.Mh,{isOpen:T,providerInfo:eE,onSuccess:e6,onClose:()=>O(!1)}):"cursor"===l?(0,a.jsx)(d.G9,{isOpen:T,onSuccess:e6,onClose:()=>O(!1)}):"gitlab"===l?(0,a.jsx)(d.vj,{isOpen:T,providerInfo:eE,onSuccess:e6,onClose:()=>O(!1)}):(0,a.jsx)(d.LF,{isOpen:T,provider:l,providerInfo:eE,onSuccess:e6,onClose:()=>O(!1)}),"iflow"===l&&(0,a.jsx)(d.vE,{isOpen:P,onSuccess:()=>{eX(),I(!1)},onClose:()=>I(!1)}),"codex"===l&&(0,a.jsx)(S,{isOpen:E,onSuccess:eX,onClose:()=>_(!1)}),(0,a.jsx)(w,{isOpen:q,provider:l,providerName:eE.name,isCompatible:eM,isAnthropic:eq,authType:eE?.authType,authHint:eE?.authHint,website:eE?.website,proxyPools:$,onSave:e8,onClose:()=>M(!1)}),(0,a.jsx)(d.wI,{isOpen:J,connection:V,proxyPools:$,onSave:e9,onClose:()=>F(!1)}),eM&&(0,a.jsx)(k,{isOpen:K,node:v,onSave:eY,onClose:()=>L(!1),isAnthropic:eq}),!eM&&(0,a.jsx)(C,{isOpen:er,providerAlias:eF,providerDisplayAlias:eK,onSave:async e=>{let t=eE?.passthroughModels?e.split("/").pop():e;await e5(e,t,eF),el(!1)},onClose:()=>el(!1)})]}):(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(o(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}w.propTypes={isOpen:f().bool.isRequired,provider:f().string,providerName:f().string,isCompatible:f().bool,isAnthropic:f().bool,authType:f().string,authHint:f().string,website:f().string,proxyPools:f().arrayOf(f().shape({id:f().string,name:f().string})),onSave:f().func.isRequired,onBulkDone:f().func,onClose:f().func.isRequired},k.propTypes={isOpen:f().bool.isRequired,node:f().shape({id:f().string,name:f().string,prefix:f().string,apiType:f().string,baseUrl:f().string}),onSave:f().func.isRequired,onClose:f().func.isRequired,isAnthropic:f().bool},C.propTypes={isOpen:f().bool.isRequired,providerAlias:f().string.isRequired,providerDisplayAlias:f().string.isRequired,onSave:f().func.isRequired,onClose:f().func.isRequired},S.propTypes={isOpen:f().bool.isRequired,onClose:f().func.isRequired,onSuccess:f().func}},29610:(e,t,s)=>{Promise.resolve().then(s.bind(s,7570))}},e=>{e.O(0,[2574,3862,1051,5772,1321,5497,8441,3794,7358],()=>e(e.s=29610)),_N_E=e.O()}]);
|