vansrouter 0.5.12 → 0.7.4
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 +23 -23
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +12 -11
- package/app/.next-cli-build/build-manifest.json +4 -4
- package/app/.next-cli-build/prerender-manifest.json +27 -3
- package/app/.next-cli-build/react-loadable-manifest.json +99 -0
- package/app/.next-cli-build/required-server-files.json +13 -5
- package/app/.next-cli-build/routes-manifest.json +16 -0
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +5 -5
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +6 -6
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +4 -4
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +2 -0
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -0
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -0
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page.js +3 -3
- package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +4 -4
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
- package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +20 -19
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +20 -19
- package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/api/auth/check/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/check/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/init/route.js +1 -1
- package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/locale/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +2 -2
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +4 -2
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +3 -3
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback/page.js +2 -2
- package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +24 -23
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +24 -23
- package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +23 -22
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +23 -22
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +24 -23
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +24 -23
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +24 -23
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +24 -23
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +23 -22
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +23 -22
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +24 -23
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +24 -23
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +24 -23
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +24 -23
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -0
- package/app/.next-cli-build/server/app/dashboard/token-saver.meta +17 -0
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +26 -0
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -0
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +5 -0
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +5 -0
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +7 -0
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +26 -0
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +6 -0
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +10 -0
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +5 -0
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +26 -25
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +24 -23
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +24 -23
- package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page.js +2 -2
- package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +24 -23
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +24 -23
- package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page.js +2 -2
- package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +24 -23
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +24 -23
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +9 -8
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +1 -1
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/masuk/page.js +2 -2
- package/app/.next-cli-build/server/app/masuk/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/masuk/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +12 -11
- package/app/.next-cli-build/server/chunks/1099.js +1 -1
- package/app/.next-cli-build/server/chunks/1248.js +1 -0
- package/app/.next-cli-build/server/chunks/1253.js +1 -1
- package/app/.next-cli-build/server/chunks/127.js +1 -0
- package/app/.next-cli-build/server/chunks/1500.js +1 -1
- package/app/.next-cli-build/server/chunks/1536.js +1 -0
- package/app/.next-cli-build/server/chunks/1613.js +1 -1
- package/app/.next-cli-build/server/chunks/1688.js +1 -1
- package/app/.next-cli-build/server/chunks/2262.js +3 -0
- package/app/.next-cli-build/server/chunks/2365.js +1 -1
- package/app/.next-cli-build/server/chunks/2504.js +1 -0
- package/app/.next-cli-build/server/chunks/2554.js +23 -0
- package/app/.next-cli-build/server/chunks/2557.js +6 -6
- package/app/.next-cli-build/server/chunks/259.js +1 -0
- package/app/.next-cli-build/server/chunks/2884.js +1 -0
- package/app/.next-cli-build/server/chunks/3040.js +2 -2
- package/app/.next-cli-build/server/chunks/3133.js +1 -0
- package/app/.next-cli-build/server/chunks/3176.js +3 -3
- package/app/.next-cli-build/server/chunks/3405.js +1 -1
- package/app/.next-cli-build/server/chunks/3424.js +1 -0
- package/app/.next-cli-build/server/chunks/3652.js +1 -1
- package/app/.next-cli-build/server/chunks/3738.js +1 -0
- package/app/.next-cli-build/server/chunks/3787.js +1 -0
- package/app/.next-cli-build/server/chunks/383.js +1 -1
- package/app/.next-cli-build/server/chunks/4004.js +1 -1
- package/app/.next-cli-build/server/chunks/4029.js +7 -0
- package/app/.next-cli-build/server/chunks/403.js +1 -0
- package/app/.next-cli-build/server/chunks/4105.js +2 -2
- package/app/.next-cli-build/server/chunks/4327.js +1 -1
- package/app/.next-cli-build/server/chunks/4418.js +4 -4
- package/app/.next-cli-build/server/chunks/4486.js +1 -1
- package/app/.next-cli-build/server/chunks/4539.js +1 -1
- package/app/.next-cli-build/server/chunks/4544.js +1 -0
- package/app/.next-cli-build/server/chunks/4574.js +13 -13
- package/app/.next-cli-build/server/chunks/5006.js +2 -2
- package/app/.next-cli-build/server/chunks/5204.js +4 -4
- package/app/.next-cli-build/server/chunks/5290.js +1 -0
- package/app/.next-cli-build/server/chunks/5472.js +11 -0
- package/app/.next-cli-build/server/chunks/5577.js +1 -1
- package/app/.next-cli-build/server/chunks/5598.js +1 -1
- package/app/.next-cli-build/server/chunks/5867.js +1 -0
- package/app/.next-cli-build/server/chunks/6085.js +1 -1
- package/app/.next-cli-build/server/chunks/6120.js +1 -0
- package/app/.next-cli-build/server/chunks/6159.js +1 -0
- package/app/.next-cli-build/server/chunks/6165.js +1 -1
- package/app/.next-cli-build/server/chunks/6333.js +1 -1
- package/app/.next-cli-build/server/chunks/6723.js +1 -1
- package/app/.next-cli-build/server/chunks/6955.js +1 -1
- package/app/.next-cli-build/server/chunks/6975.js +1 -1
- package/app/.next-cli-build/server/chunks/7006.js +1 -1
- package/app/.next-cli-build/server/chunks/715.js +1 -1
- package/app/.next-cli-build/server/chunks/7502.js +1 -0
- package/app/.next-cli-build/server/chunks/7916.js +1 -1
- package/app/.next-cli-build/server/chunks/7938.js +1 -1
- package/app/.next-cli-build/server/chunks/818.js +1 -1
- package/app/.next-cli-build/server/chunks/8524.js +1 -0
- package/app/.next-cli-build/server/chunks/8685.js +1 -1
- package/app/.next-cli-build/server/chunks/8691.js +1 -1
- package/app/.next-cli-build/server/chunks/8711.js +1 -1
- package/app/.next-cli-build/server/chunks/88.js +1 -0
- package/app/.next-cli-build/server/chunks/883.js +1 -0
- package/app/.next-cli-build/server/chunks/8941.js +1 -0
- package/app/.next-cli-build/server/chunks/9614.js +7 -0
- package/app/.next-cli-build/server/chunks/9633.js +10 -2
- package/app/.next-cli-build/server/chunks/9984.js +1 -1
- package/app/.next-cli-build/server/instrumentation.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +4 -4
- package/app/.next-cli-build/server/next-font-manifest.js +1 -1
- package/app/.next-cli-build/server/next-font-manifest.json +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/5ICo_gd4bXJ9z9cGegOnS/_buildManifest.js +1 -0
- package/app/.next-cli-build/static/chunks/1049.3def0dd7804a4e6e.js +7 -0
- package/app/.next-cli-build/static/chunks/1409.b9b9883529318ba4.js +1 -0
- package/app/.next-cli-build/static/chunks/1567.a91d2debb1187f20.js +1 -0
- package/app/.next-cli-build/static/chunks/2884.39a847a6de39184f.js +1 -0
- package/app/.next-cli-build/static/chunks/3124.46a9db1d92ccc4c2.js +1 -0
- package/app/.next-cli-build/static/chunks/3245.d0758b9d4b1b5e8c.js +1 -0
- package/app/.next-cli-build/static/chunks/3257.24031050423940b5.js +1 -0
- package/app/.next-cli-build/static/chunks/3386.1d120faabbf9d807.js +1 -0
- package/app/.next-cli-build/static/chunks/3657.648ef7012a4a028b.js +1 -0
- package/app/.next-cli-build/static/chunks/{3700-5fd5ab79e1a2d076.js → 3700-507d735bbeafc1f1.js} +3 -3
- package/app/.next-cli-build/static/chunks/406.11a045def1d3b77b.js +1 -0
- package/app/.next-cli-build/static/chunks/4385-87a1b455709d7de4.js +1 -0
- package/app/.next-cli-build/static/chunks/497-240bb61834e40ac1.js +1 -0
- package/app/.next-cli-build/static/chunks/5316-fff7784e40086b07.js +31 -0
- package/app/.next-cli-build/static/chunks/5560.1044547418430d16.js +1 -0
- package/app/.next-cli-build/static/chunks/5737-b48f5e3f71caff94.js +1 -0
- package/app/.next-cli-build/static/chunks/{1884-b4477b727e9f760d.js → 6000-87aaca633cd687c1.js} +1 -1
- package/app/.next-cli-build/static/chunks/6474.3878f14b16c23d75.js +1 -0
- package/app/.next-cli-build/static/chunks/6909.bd99d4bad9fa33f9.js +1 -0
- package/app/.next-cli-build/static/chunks/7236-5d192cf1373fb7b7.js +1 -0
- package/app/.next-cli-build/static/chunks/9078.7b8723a1eed306a9.js +7 -0
- package/app/.next-cli-build/static/chunks/9131-3c6e59ad900d9f87.js +3 -0
- package/app/.next-cli-build/static/chunks/9146.71dafc04b1c0ad03.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/page-25f7aa2d037ababf.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-940078f88ad45eab.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-d76282f0fd492509.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-1e2f7ebf38beef11.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-cb3b772ef6881374.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-58a182f8d9939f66.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-33b2a2889f8a6c95.js +59 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-bbef1a0c34a9ee9e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-a10e1f3c70f5ab7f.js +4 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-6aa26f4fba64b6d2.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/page-1d917685f3312fc6.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-b101a596fe25ee31.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-7dae224f46195dd1.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-8af6425bd1f2dff0.js +10 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/page-dfc0a71f960d84d9.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-bb2e059c3f3dc49d.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-ba7f8f70c115bd1b.js +4 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-24d2ff6ef38b5076.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-b45041d3d952bc5f.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-ab94afac28af93d9.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/page-d97075035c70eff5.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-f1d9bf293afc3684.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/{error-e13acf917212088c.js → error-86fe20e969c25afa.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-0e565003b0b585f1.js +1 -0
- package/app/.next-cli-build/static/chunks/app/_not-found/{page-895b0be60b8b4398.js → page-be7cfd009d9fbd4f.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/callback/page-39e20bde55beaa9f.js +1 -0
- package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/page-dacae19b0574d92a.js +1 -0
- package/app/.next-cli-build/static/chunks/app/error-0c909c404411db68.js +1 -0
- package/app/.next-cli-build/static/chunks/app/{global-error-f79b3222f66a4d7d.js → global-error-003ccabaecca03c8.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/landing/page-29ecb0d5c302e58c.js +1 -0
- package/app/.next-cli-build/static/chunks/app/layout-b163b1ebf7b2b559.js +1 -0
- package/app/.next-cli-build/static/chunks/app/login/page-b3a411e5e3d409d6.js +1 -0
- package/app/.next-cli-build/static/chunks/app/masuk/page-7b5993b71be815c4.js +1 -0
- package/app/.next-cli-build/static/chunks/main-app-e420732cbed7b559.js +1 -0
- package/app/.next-cli-build/static/chunks/webpack-709c19c4ca395e42.js +1 -0
- package/app/.next-cli-build/static/css/1fc10f069b479895.css +1 -0
- package/app/.next-cli-build/static/css/e8723a4485b3f4ec.css +1 -0
- package/app/node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/app/package.json +7 -4
- package/app/server.js +1 -1
- package/package.json +2 -1
- package/src/cli/terminalUI.js +2 -2
- package/src/cli/tray/autostart.js +3 -3
- package/src/cli/tray/tray.js +4 -4
- package/app/.next-cli-build/server/chunks/1377.js +0 -11
- package/app/.next-cli-build/server/chunks/1798.js +0 -1
- package/app/.next-cli-build/server/chunks/185.js +0 -1
- package/app/.next-cli-build/server/chunks/3080.js +0 -1
- package/app/.next-cli-build/server/chunks/3411.js +0 -1
- package/app/.next-cli-build/server/chunks/381.js +0 -1
- package/app/.next-cli-build/server/chunks/390.js +0 -23
- package/app/.next-cli-build/server/chunks/4309.js +0 -1
- package/app/.next-cli-build/server/chunks/6131.js +0 -7
- package/app/.next-cli-build/server/chunks/7653.js +0 -1
- package/app/.next-cli-build/server/chunks/7940.js +0 -3
- package/app/.next-cli-build/static/VKvJAyxOs8Z4i-NlGV_fQ/_buildManifest.js +0 -1
- package/app/.next-cli-build/static/chunks/2585-8fd88706090c24f0.js +0 -7
- package/app/.next-cli-build/static/chunks/3347-d538c26a837eb5d9.js +0 -3
- package/app/.next-cli-build/static/chunks/3357-6bb78467d17f996d.js +0 -1
- package/app/.next-cli-build/static/chunks/4385-5ccf368da02ccc55.js +0 -1
- package/app/.next-cli-build/static/chunks/5316-cfaf927336e65a00.js +0 -31
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/page-e35edec4bd8b35f6.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-cc3a7f812ec6e2f6.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-00c86c08353d723d.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-570a07ca0addffec.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-a769b01825700eb9.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-6b0647c8bf2d45ef.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-14290d80e6f28738.js +0 -59
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-8249da575c86c499.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-178ec7f3df9fd35c.js +0 -4
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-19ea4b1b2cebd3b1.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/page-023f092008a4abff.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-9cb50b7d1d7ce028.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-ffe66fe35a77042a.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-5a1fb070ecbcfc1a.js +0 -10
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/page-5fbcf78a8c259144.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-1f4063d23a30b305.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-c61feb1af4dd493e.js +0 -4
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-563c8f44ac8e9c07.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-025c524015bdc48d.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/page-5dc6b360373ddeab.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-19c98be58beb7d43.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-b84d19383ba09e68.js +0 -1
- package/app/.next-cli-build/static/chunks/app/callback/page-cf6d6ef09f75eb67.js +0 -1
- package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/page-fc8c980648436523.js +0 -1
- package/app/.next-cli-build/static/chunks/app/error-b2bc6f017d2fe0ee.js +0 -1
- package/app/.next-cli-build/static/chunks/app/landing/page-285751bf75da17bc.js +0 -1
- package/app/.next-cli-build/static/chunks/app/layout-367acca0c0885646.js +0 -1
- package/app/.next-cli-build/static/chunks/app/login/page-501598f28ab7c5ba.js +0 -1
- package/app/.next-cli-build/static/chunks/app/masuk/page-9369035bb093aaed.js +0 -1
- package/app/.next-cli-build/static/chunks/main-app-85701dd8943d6a76.js +0 -1
- package/app/.next-cli-build/static/chunks/webpack-037b3c82a7f1309c.js +0 -1
- package/app/.next-cli-build/static/css/17ad4163408b1fa3.css +0 -1
- package/app/.next-cli-build/static/css/8f9ac5a7bd3a79e5.css +0 -1
- package/app/.next-cli-build/static/media/material-symbols-outlined.ec1fa111.woff2 +0 -0
- /package/app/.next-cli-build/static/{VKvJAyxOs8Z4i-NlGV_fQ → 5ICo_gd4bXJ9z9cGegOnS}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{1863:(e,t,a)=>{"use strict";function s(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}a.d(t,{g:()=>s})},2710:(e,t,a)=>{Promise.resolve().then(a.bind(a,4347))},4347:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>B});var s=a(5102),r=a(3278),l=a(3885),o=a.n(l),n=a(2030),i=a(497),d=a(1704),c=a(1038),m=a(1863);function u({until:e}){let[t,a]=(0,n.useState)("");return((0,n.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let s=Math.floor(t/1e3);s<60?a(`${s}s`):s<3600?a(`${Math.floor(s/60)}m ${s%60}s`):a(`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`)};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function x({connection:e,proxyPools:t,isOAuth:a,isFirst:r,isLast:l,onMoveUp:o,onMoveDown:d,onToggleActive:c,onUpdateProxy:p,onEdit:h,onDelete:b}){let[f,g]=(0,n.useState)(!1),[y,j]=(0,n.useState)(!1),[v,w]=(0,n.useState)(!1),N=(0,n.useRef)(null),k=new Map((t||[]).map(e=>[e.id,e])),C=e.providerSpecificData?.proxyPoolId||null,S=C?k.get(C):null,$=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,P=!!C||$,_=S?`Pool: ${S.name}`:C?`Pool: ${C} (inactive/missing)`:$?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",A="",I=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(I)try{let e=new URL(I);A=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{A=I}let E=S?.noProxy||e.providerSpecificData?.connectionNoProxy||"",T=S?.isActive===!0?"success":C||$?"error":"default",B=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(Boolean).sort()[0]||null;(0,n.useEffect)(()=>{let t=()=>{w(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let a=B?setInterval(t,1e3):null;return()=>{a&&clearInterval(a)}},[B]),(0,n.useEffect)(()=>{if(!f)return;let e=e=>{N.current&&!N.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);let M="unavailable"!==e.testStatus||v?e.testStatus:"active",O=a?e.name||e.email||e.displayName||"OAuth Account":e.name,K=async e=>{j(!0);try{await p("__none__"===e?null:e)}finally{j(!1),g(!1)}};return(0,s.jsxs)("div",{className:`group flex flex-col gap-3 p-2 rounded-lg sm:flex-row sm:items-center sm:justify-between hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:d,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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:a?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:O}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,s.jsx)(i.Badge,{variant:(0,m.g)(e.isActive,M),size:"sm",dot:!0,children:!1===e.isActive?"disabled":M||"Unknown"}),P&&(0,s.jsx)(i.Badge,{variant:T,size:"sm",children:"Proxy"}),v&&!1!==e.isActive&&(0,s.jsx)(u,{until:B}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),P&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:_,children:_}),A&&(0,s.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:A}),E&&(0,s.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:E,children:["no_proxy: ",E]})]})]})]}),(0,s.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(t||[]).length>0&&(0,s.jsxs)("div",{className:"relative",ref:N,children:[(0,s.jsxs)("button",{onClick:()=>g(e=>!e),className:`flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${P?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg border border-border rounded-lg shadow-lg py-1 min-w-[160px]",children:[(0,s.jsx)("button",{onClick:()=>K("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!C?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,s.jsx)("button",{onClick:()=>K(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,s.jsxs)("button",{onClick:h,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:b,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(i.Toggle,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable":"Enable"})]})]})}function p({isOpen:e,provider:t,providerName:a,proxyPools:r,onSave:l,onClose:o}){let d="__none__",[c,m]=(0,n.useState)({name:"",apiKey:"",priority:1,proxyPoolId:d}),[u,x]=(0,n.useState)(!1),[h,b]=(0,n.useState)(null),[f,g]=(0,n.useState)(!1),y=async()=>{x(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})}),a=await e.json();b(a.valid?"success":"failed")}catch{b("failed")}finally{x(!1)}},j=async()=>{if(t&&c.apiKey){g(!0);try{let e=!1;try{x(!0),b(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})});e=!!(await a.json()).valid,b(e?"success":"failed")}catch{b("failed")}finally{x(!1)}await l({name:c.name,apiKey:c.apiKey,priority:c.priority,proxyPoolId:c.proxyPoolId===d?null:c.proxyPoolId,testStatus:e?"active":"unknown"})}finally{g(!1)}}};return t?(0,s.jsx)(i.Modal,{isOpen:e,title:`Add ${a||t} API Key`,onClose:o,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.name,onChange:e=>m({...c,name:e.target.value}),placeholder:"Production Key"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,s.jsx)("input",{type:"password",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.apiKey,onChange:e=>m({...c,apiKey:e.target.value})})]}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(i.Button,{onClick:y,disabled:!c.apiKey||u||f,variant:"secondary",children:u?"Checking...":"Check"})})]}),h&&(0,s.jsx)(i.Badge,{variant:"success"===h?"success":"error",children:"success"===h?"Valid":"Invalid"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,s.jsx)("input",{type:"number",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.priority,onChange:e=>m({...c,priority:Number.parseInt(e.target.value)||1})})]}),(0,s.jsx)(i.Select,{label:"Proxy Pool",value:c.proxyPoolId,onChange:e=>m({...c,proxyPoolId:e.target.value}),options:[{value:d,label:"None"},...(r||[]).map(e=>({value:e.id,label:e.name}))]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.Button,{onClick:j,fullWidth:!0,disabled:!c.name||!c.apiKey||f,children:f?"Saving...":"Save"}),(0,s.jsx)(i.Button,{onClick:o,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function h({providerId:e,isOAuth:t}){let[a,r]=(0,n.useState)([]),[l,o]=(0,n.useState)([]),[d,c]=(0,n.useState)(!0),[m,u]=(0,n.useState)(!1),[b,f]=(0,n.useState)(!1),[g,y]=(0,n.useState)(null),[j,v]=(0,n.useState)(null),[w,N]=(0,n.useState)("1"),[k,C]=(0,n.useState)(null),S=(0,n.useCallback)(async()=>{try{let[t,a,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),l=await t.json(),n=await a.json(),i=s.ok?await s.json():{};t.ok&&r((l.connections||[]).filter(t=>t.provider===e)),a.ok&&o(n.proxyPools||[]);let d=(i.providerStrategies||{})[e]||{};v(d.fallbackStrategy||null),N(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1")}catch(e){console.log("ConnectionsCard fetch error:",e)}finally{c(!1)}},[e]);(0,n.useEffect)(()=>{S()},[S]);let $=async(t,a)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),r=(s.ok?await s.json():{}).providerStrategies||{},l={};t&&(l.fallbackStrategy=t),"round-robin"===t&&""!==a&&(l.stickyRoundRobinLimit=Number(a)||3);let o={...r};0===Object.keys(l).length?delete o[e]:o[e]=l,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:o})})}catch(e){console.log("saveStrategy error:",e)}},P=async(e,t)=>{let s=[...a];[s[e],s[t]]=[s[t],s[e]],r(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{await S()}},_=async e=>{C({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{C(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&r(t=>t.filter(t=>t.id!==e))}catch(e){console.log("delete error:",e)}}})},A=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&r(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("toggle error:",e)}},I=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&r(a=>a.map(a=>a.id===e?{...a,providerSpecificData:{...a.providerSpecificData,proxyPoolId:t||null}}:a))}catch(e){console.log("proxy error:",e)}},E=async t=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,...t})})).ok&&(await S(),u(!1))}catch(e){console.log("save apikey error:",e)}},T=async e=>{try{(await fetch(`/api/providers/${g.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await S(),f(!1))}catch(e){console.log("update connection error:",e)}};return d?(0,s.jsx)(i.Card,{children:(0,s.jsx)("div",{className:"h-20 animate-pulse bg-black/5 rounded-lg"})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i.Card,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(i.Toggle,{checked:"round-robin"===j,onChange:e=>{let t=e?"round-robin":null;v(t),e&&!w&&N("1"),$(t,e?w||"1":w)}}),"round-robin"===j&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:w,onChange:e=>{N(e.target.value),$("round-robin",e.target.value)},className:"w-16 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]}),0===a.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,s.jsx)(i.Button,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add Connection"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:a.map((e,r)=>(0,s.jsx)(x,{connection:e,proxyPools:l,isOAuth:t,isFirst:0===r,isLast:r===a.length-1,onMoveUp:()=>P(r,r-1),onMoveDown:()=>P(r,r+1),onToggleActive:t=>A(e.id,t),onUpdateProxy:t=>I(e.id,t),onEdit:()=>{y(e),f(!0)},onDelete:()=>_(e.id)},e.id))}),(0,s.jsx)("div",{className:"mt-4 flex justify-stretch sm:justify-start",children:(0,s.jsx)(i.Button,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add"})})]})]}),(0,s.jsx)(p,{isOpen:m,provider:e,proxyPools:l,onSave:E,onClose:()=>u(!1)}),(0,s.jsx)(i.EditConnectionModal,{isOpen:b,connection:g,proxyPools:l,onSave:T,onClose:()=>f(!1)}),(0,s.jsx)(i.ConfirmModal,{isOpen:!!k,onClose:()=>C(null),onConfirm:k?.onConfirm,title:k?.title||"Confirm",message:k?.message,variant:"danger"})]})}var b=a(5223),f=a(1577);function g({model:e,fullModel:t,copied:a,onCopy:r,testStatus:l,isCustom:o,isFree:n,onDeleteAlias:i,onTest:d,isTesting:c}){let m="ok"===l?"#22c55e":"error"===l?"#ef4444":void 0;return(0,s.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",style:m?{color:m}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),e.name&&(0,s.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),d&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,s.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:c?"Testing...":"Test"})]}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,s.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:a===`model-${e.id}`?"Copied!":"Copy"})]}),n&&(0,s.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:"FREE"}),o&&(0,s.jsx)("button",{onClick:i,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function y({isOpen:e,onSave:t,onClose:a}){let[r,l]=(0,n.useState)(""),o=()=>{r.trim()&&(t(r.trim()),l(""))};return(0,s.jsx)(i.Modal,{isOpen:e,title:"Add Custom Model",onClose:a,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>l(e.target.value),onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.Button,{onClick:o,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,s.jsx)(i.Button,{onClick:a,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function j({providerId:e,kindFilter:t,providerAliasOverride:a}){let{copied:r,copy:l}=(0,f.C)(),[o,d]=(0,n.useState)({}),[m,u]=(0,n.useState)([]),[x,p]=(0,n.useState)({}),[h,v]=(0,n.useState)(null),[w,N]=(0,n.useState)(""),[k,C]=(0,n.useState)(!1),[S,$]=(0,n.useState)([]),P=a||(0,c.wG)(e),_=t||"llm",A=(0,n.useCallback)(async()=>{try{let[t,a,s]=await Promise.all([fetch("/api/models/alias"),fetch("/api/providers",{cache:"no-store"}),fetch("/api/models/custom",{cache:"no-store"})]),r=await t.json(),l=await a.json(),o=await s.json();t.ok&&d(r.aliases||{}),a.ok&&$((l.connections||[]).filter(t=>t.provider===e)),s.ok&&u(o.models||[])}catch(e){console.log("ModelsCard fetch error:",e)}},[e]);(0,n.useEffect)(()=>{A()},[A]);let I=async(e,t)=>{let a=`${P}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})})).ok&&await A()}catch(e){console.log("set alias error:",e)}},E=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await A()}catch(e){console.log("delete alias error:",e)}},T=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:P,id:e,type:_})})).ok&&(await A(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("add custom model error:",e)}},B=async e=>{try{let t=new URLSearchParams({providerAlias:P,id:e,type:_});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await A(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},M=async e=>{if(!h){v(e);try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${P}/${e}`,kind:t})}),s=await a.json();p(t=>({...t,[e]:s.ok?"ok":"error"})),N(s.ok?"":s.error||"Model not reachable")}catch{p(t=>({...t,[e]:"error"})),N("Network error")}finally{v(null)}}},O=(0,b.KC)(e),K=t?O.filter(e=>e.kinds?e.kinds.includes(t):(0,b.CP)(e,"llm")===t):O,L=m.filter(e=>e.providerAlias===P&&(0,b.CP)(e,"llm")===_&&!K.some(t=>t.id===e.id));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i.Card,{children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),w&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:w}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[K.map(e=>{let t=`${P}/${e.id}`,a=Object.entries(o).find(([,e])=>e===t)?.[0];return(0,s.jsx)(g,{model:e,fullModel:`${P}/${e.id}`,alias:a,copied:r,onCopy:l,onSetAlias:t=>I(e.id,t),onDeleteAlias:()=>E(a),testStatus:x[e.id],onTest:S.length>0?()=>M(e.id):void 0,isTesting:h===e.id,isFree:e.isFree},e.id)}),L.map(e=>(0,s.jsx)(g,{model:{id:e.id,name:e.name},fullModel:`${P}/${e.id}`,copied:r,onCopy:l,onSetAlias:()=>{},onDeleteAlias:()=>B(e.id),testStatus:x[e.id],onTest:S.length>0?()=>M(e.id):void 0,isTesting:h===e.id,isCustom:!0},`${e.id}-${e.type}`)),(0,s.jsxs)("button",{onClick:()=>C(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,s.jsx)(y,{isOpen:k,onSave:async e=>{await T(e),C(!1)},onClose:()=>C(!1)})]})}function v({label:e,children:t}){return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)("span",{className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,s.jsx)("div",{className:"w-full min-w-0 flex-1",children:t})]})}let w={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
|
|
2
|
+
"results": [
|
|
3
|
+
{ "title": "...", "url": "...", "snippet": "..." }
|
|
4
|
+
]
|
|
5
|
+
}`,extraFields:[{key:"search_type",label:"Type",type:"select",default:"web",options:["web","news"]},{key:"max_results",label:"Max results",type:"number",default:5,min:1,max:100},{key:"country",label:"Country",type:"text",default:""},{key:"language",label:"Language",type:"text",default:""}]},webFetch:{inputLabel:"URL",inputPlaceholder:"https://example.com",defaultInput:"https://example.com",bodyKey:"url",defaultResponse:`{
|
|
6
|
+
"content": "...",
|
|
7
|
+
"title": "...",
|
|
8
|
+
"url": "..."
|
|
9
|
+
}`,extraFields:[{key:"format",label:"Format",type:"select",default:"markdown",options:["markdown","text","html"]},{key:"max_characters",label:"Max chars",type:"number",default:0,min:0}]},image:{inputLabel:"Prompt",inputPlaceholder:"A cute cat wearing a hat",defaultInput:"A cute cat wearing a hat",bodyKey:"prompt",defaultResponse:`{
|
|
10
|
+
"data": [
|
|
11
|
+
{ "url": "...", "b64_json": "..." }
|
|
12
|
+
]
|
|
13
|
+
}`,extraFields:[{key:"n",label:"n",type:"number",default:1,min:1,max:4},{key:"size",label:"Size",type:"select",default:"auto",options:["auto","1024x1024","1024x1536","1536x1024","1024x1792","1792x1024"]},{key:"quality",label:"Quality",type:"select",default:"auto",options:["auto","low","medium","high","standard","hd"]},{key:"background",label:"Background",type:"select",default:"auto",options:["auto","transparent","opaque"]},{key:"style",label:"Style",type:"select",default:"",options:["","vivid","natural"]},{key:"response_format",label:"Format",type:"select",default:"",options:["","url","b64_json"]},{key:"image_detail",label:"Image Detail",type:"select",default:"high",options:["auto","low","high","original"]},{key:"output_format",label:"Codec",type:"select",default:"png",options:["png","jpeg","webp"]}]},imageToText:{inputLabel:"Image URL",inputPlaceholder:"https://example.com/image.png",defaultInput:"https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg",bodyKey:"url",extraBody:{prompt:"Describe this image in detail"},defaultResponse:`{
|
|
14
|
+
"text": "A cat sitting on a windowsill...",
|
|
15
|
+
"model": "..."
|
|
16
|
+
}`},video:{inputLabel:"Prompt",inputPlaceholder:"A serene lake at sunset",defaultInput:"A serene lake at sunset",bodyKey:"prompt",defaultResponse:`{
|
|
17
|
+
"data": [
|
|
18
|
+
{ "url": "..." }
|
|
19
|
+
]
|
|
20
|
+
}`},music:{inputLabel:"Prompt",inputPlaceholder:"A calm piano melody",defaultInput:"A calm piano melody",bodyKey:"prompt",defaultResponse:`{
|
|
21
|
+
"data": [
|
|
22
|
+
{ "url": "...", "format": "mp3" }
|
|
23
|
+
]
|
|
24
|
+
}`}},N=`{
|
|
25
|
+
"object": "list",
|
|
26
|
+
"data": [{
|
|
27
|
+
"object": "embedding",
|
|
28
|
+
"index": 0,
|
|
29
|
+
"embedding": [0.002301, -0.019212, 0.004815, -0.031249, ...]
|
|
30
|
+
}],
|
|
31
|
+
"model": "...",
|
|
32
|
+
"usage": { "prompt_tokens": 9, "total_tokens": 9 }
|
|
33
|
+
}`;function k({providerId:e,customAlias:t}){let a=(0,c.gC)(e),r=a?t||e:(0,c.wG)(e),l=a?[]:(0,b.KC)(e).filter(e=>"embedding"===(0,b.CP)(e)),[o,d]=(0,n.useState)(l[0]?.id??""),[m,u]=(0,n.useState)("The quick brown fox jumps over the lazy dog"),[x,p]=(0,n.useState)(""),[h,g]=(0,n.useState)(""),[y,j]=(0,n.useState)(!1),[w,C]=(0,n.useState)(""),[S,$]=(0,n.useState)(""),[P,_]=(0,n.useState)(null),[A,I]=(0,n.useState)(!1),[E,T]=(0,n.useState)(""),{copied:B,copy:M}=(0,f.C)(),{copied:O,copy:K}=(0,f.C)();(0,n.useEffect)(()=>{C(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{g((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&$(e.publicUrl)}).catch(()=>{})},[]);let L=y?S:w,R=o?`${r}/${o}`:"",U=()=>{let e={model:R,input:m.trim()},t=Number(x);return x&&Number.isFinite(t)&&t>0&&(e.dimensions=t),e},D=`curl -X POST ${L}/v1/embeddings \\
|
|
34
|
+
-H "Content-Type: application/json" \\
|
|
35
|
+
-H "Authorization: Bearer ${h||"YOUR_KEY"}" \\
|
|
36
|
+
-d '${JSON.stringify(U())}'`,F=async()=>{if(!m.trim()||!R)return;I(!0),T(""),_(null);let e=Date.now();try{let t={"Content-Type":"application/json"};h&&(t.Authorization=`Bearer ${h}`);let a=await fetch("/api/v1/embeddings",{method:"POST",headers:t,body:JSON.stringify(U())}),s=Date.now()-e,r=await a.json();if(!a.ok)return void T(r?.error?.message||r?.error||`HTTP ${a.status}`);_({data:r,latencyMs:s})}catch(e){T(e.message||"Network error")}finally{I(!1)}},J=P?JSON.stringify(P.data,null,2):"";return(0,s.jsxs)(i.Card,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,s.jsx)(v,{label:"Model",children:a?(0,s.jsx)("input",{value:o,onChange:e=>d(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0, text-embedding-3-small",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"}):(0,s.jsx)("select",{value:o,onChange:e=>d(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:l.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,s.jsx)(v,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)("input",{value:L,onChange:e=>y?$(e.target.value):C(e.target.value),className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono",placeholder:"http://localhost:3000"}),S&&(0,s.jsxs)("button",{onClick:()=>j(e=>!e),title:y?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${y?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)(v,{label:"API Key",children:(0,s.jsx)("input",{type:"password",value:h,onChange:e=>g(e.target.value),placeholder:"sk-...",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,s.jsx)(v,{label:"Input",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:m,onChange:e=>u(e.target.value),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),m&&(0,s.jsx)("button",{type:"button",onClick:()=>u(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),(0,s.jsx)(v,{label:"Dimensions",children:(0,s.jsx)("input",{type:"number",min:"1",value:x,onChange:e=>p(e.target.value),placeholder:"optional, e.g. 512, 1024 (leave empty for default)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>M(D),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:B?"check":"content_copy"}),B?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:F,disabled:A||!m.trim()||!R,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:A?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),A?"Running...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:D})]}),E&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:E}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",P&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",P.latencyMs,"ms"]})]}),P&&(0,s.jsxs)("button",{onClick:()=>K(J),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:O?"check":"content_copy"}),O?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:(e=>{if(!e)return N;let t=JSON.parse(JSON.stringify(e));return(t.data||[]).forEach(e=>{Array.isArray(e.embedding)&&e.embedding.length>4&&(e.embedding=[...e.embedding.slice(0,4).map(e=>parseFloat(e.toFixed(6))),`... (${e.embedding.length} dims)`])}),JSON.stringify(t,null,2)})(P?.data)})]})]})]})}let C={"google-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"hardcoded"},openai:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openai-tts-models",voiceKey:"openai-tts-voices",voicesPerModel:!0},openrouter:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openrouter-tts-models",voiceKey:"openrouter-tts-voices",voicesPerModel:!0},elevenlabs:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"elevenlabs-tts-models",apiEndpoint:"/api/media-providers/tts/elevenlabs/voices"},"edge-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},"local-device":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},nvidia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},hyperbolic:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},deepgram:{hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/deepgram/voices"},huggingface:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},cartesia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},playht:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},coqui:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},tortoise:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},inworld:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"inworld-tts-models",apiEndpoint:"/api/media-providers/tts/inworld/voices"},qwen:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},minimax:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices",defaultVoiceId:"English_expressive_narrator"},"minimax-cn":{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices?provider=minimax-cn",defaultVoiceId:"English_expressive_narrator"},gemini:{hasLanguageDropdown:!1,hasLanguageHint:!0,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"gemini-tts-models",voiceKey:"gemini-tts-voices",voicesPerModel:!0}};var S=a(5851),$=a(3639);let P=`// Audio will appear here after running.
|
|
37
|
+
// Example JSON response (response_format=json):
|
|
38
|
+
{
|
|
39
|
+
"format": "mp3",
|
|
40
|
+
"audio": "//NExAANaAIIAUAAANNNNNNNN..." // base64 encoded MP3
|
|
41
|
+
}`;function _({providerId:e}){let t,a,r=(0,c.wG)(e),l=C[e]||C["edge-tts"],[o,d]=(0,n.useState)(l.defaultVoiceId||""),[m,u]=(0,n.useState)(""),[x,p]=(0,n.useState)(l.defaultVoiceId||""),[h,g]=(0,n.useState)([]),[y,j]=(0,n.useState)(""),[w,N]=(0,n.useState)(()=>{let t=c.Q2[e]?.ttsConfig?.models;if(t?.length)return t[0].id;if(l.hasModelSelector&&l.modelKey){let e=(0,b.KC)(l.modelKey);return e?.[0]?.id||""}return""}),[k,A]=(0,n.useState)("Hello, this is a text to speech test."),[I,E]=(0,n.useState)(""),[T,B]=(0,n.useState)(!1),[M,O]=(0,n.useState)(""),[K,L]=(0,n.useState)(""),[R,U]=(0,n.useState)("mp3"),[D,F]=(0,n.useState)(""),[J,z]=(0,n.useState)(null),[V,H]=(0,n.useState)(!1),[W,q]=(0,n.useState)(""),[G,Y]=(0,n.useState)(null),{copied:Q,copy:X}=(0,f.C)(),[Z,ee]=(0,n.useState)(!1),[et,ea]=(0,n.useState)([]),[es,er]=(0,n.useState)(!1),[el,eo]=(0,n.useState)(""),[en,ei]=(0,n.useState)(""),[ed,ec]=(0,n.useState)({}),[em,eu]=(0,n.useState)("");(0,n.useEffect)(()=>{if(O(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{E((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&L(e.publicUrl)}).catch(()=>{}),"hardcoded"===l.voiceSource){let t=l.hasModelSelector&&l.modelKey&&(0,b.KC)(l.modelKey)?.[0]?.id||"",a=l.voicesPerModel&&t?(0,S.jY)(e,t)||[]:(0,b.KC)(l.voiceKey||e).filter(e=>"tts"===(0,b.CP)(e));if(a.length)if(l.hasBrowseButton){let e=a.find(e=>"en"===e.id)||a[0];j(e.id),d(e.id),u(e.name),g([{id:e.id,name:e.name}])}else g(a),d(a[0].id),u(a[0].name||a[0].id)}},[e]),(0,n.useEffect)(()=>{if(!l.voicesPerModel||!w)return;let t=(0,S.jY)(e,w)||[];g(t),t.length&&(d(t[0].id),u(t[0].name||t[0].id))},[w]);let ex=async()=>{if(ee(!0),eo(""),ei(""),!et.length){er(!0);try{if("hardcoded"===l.voiceSource){let t=l.voiceKey||e,a=(0,b.KC)(t).filter(e=>"tts"===(0,b.CP)(e)),s={};for(let e of a)s[e.id]||(s[e.id]={code:e.id,name:e.name,voices:[{id:e.id,name:e.name}]});ec(s),ea(Object.values(s).sort((e,t)=>e.name.localeCompare(t.name)))}else{let t=l.apiEndpoint?l.apiEndpoint:`/api/media-providers/tts/voices?provider=${"local-device"===e?"local-device":"edge-tts"}`,a=await fetch(t),s=await a.json();if(s.error)return void ei(s.error);ea(s.languages||[]),ec(s.byLang||{})}}catch(e){ei(e.message)}finally{er(!1)}}},ep=el?et.filter(e=>e.name.toLowerCase().includes(el.toLowerCase())||e.code.toLowerCase().includes(el.toLowerCase())):et,eh=T?K:M,eb=l.hasVoiceIdInput&&x||o,ef=l.hasModelSelector&&w&&eb?`${r}/${w}/${eb}`:l.hasModelSelector&&w?`${r}/${w}`:eb?`${r}/${eb}`:"",eg=(t={model:ef,input:k},l.hasLanguageHint&&em&&(t.language=em),t),ey=`curl -X POST ${eh}/v1/audio/speech${"json"===R?"?response_format=json":""} \\
|
|
42
|
+
-H "Content-Type: application/json" \\
|
|
43
|
+
-H "Authorization: Bearer ${I||"YOUR_KEY"}" \\
|
|
44
|
+
-d '${JSON.stringify(eg)}' \\
|
|
45
|
+
${"json"===R?"":"--output speech.mp3"}`,ej=async()=>{if(!k.trim()||!ef)return;H(!0),q(""),F(""),z(null);let e=Date.now();try{let t={"Content-Type":"application/json"};I&&(t.Authorization=`Bearer ${I}`);let a=`/api/v1/audio/speech${"json"===R?"?response_format=json":""}`,s=await fetch(a,{method:"POST",headers:t,body:JSON.stringify({...eg,input:k.trim()})});if(Y(Date.now()-e),!s.ok){let e=await s.json().catch(()=>({}));q(e?.error?.message||e?.error||`HTTP ${s.status}`);return}if("json"===R){let e=await s.json();z(e);let t=await fetch(`data:audio/mp3;base64,${e.audio}`).then(e=>e.blob());F(URL.createObjectURL(t))}else{let e=await s.blob();F(URL.createObjectURL(e))}}catch(e){q(e.message||"Network error")}finally{H(!1)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i.Card,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,s.jsx)(v,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[eh,"/v1/audio/speech"]}),K&&(0,s.jsxs)("button",{onClick:()=>B(e=>!e),title:T?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${T?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)(v,{label:"API Key",children:(0,s.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:I?`${I.slice(0,8)}${"•".repeat(Math.min(20,I.length-8))}`:(0,s.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),l.hasModelSelector&&(l.modelKey||(0,b.KC)(e).some(e=>"tts"===(0,b.CP)(e)))&&(0,s.jsx)(v,{label:"Model",children:(0,s.jsx)("select",{value:w,onChange:e=>N(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:((a=(0,b.KC)(e).filter(e=>"tts"===(0,b.CP)(e))).length?a:(0,b.KC)(l.modelKey)||[]).map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),l.hasLanguageHint&&(0,s.jsx)(v,{label:"Language",children:(0,s.jsxs)("select",{value:em,onChange:e=>eu(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Auto-detect"}),$.I.map(e=>(0,s.jsx)("option",{value:e.name,children:e.name},e.id))]})}),l.hasBrowseButton&&(0,s.jsx)(v,{label:"Language",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)("button",{onClick:ex,className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm border border-border rounded-lg bg-background font-mono truncate text-left hover:border-primary/40 transition-colors",children:y?(0,s.jsx)("span",{className:"text-text-main",children:et.find(e=>e.code===y)?.name||y}):(0,s.jsx)("span",{className:"text-text-muted",children:"No language selected"})}),(0,s.jsxs)("button",{onClick:ex,className:"flex w-full items-center justify-center gap-1 text-xs px-2.5 py-1.5 rounded-lg border border-border text-text-muted hover:text-primary hover:border-primary/40 transition-colors sm:w-auto sm:shrink-0",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"language"}),"Select language"]})]})}),h.length>0&&(0,s.jsx)(v,{label:"Voice",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:h.map(e=>(0,s.jsxs)("button",{onClick:()=>{d(e.id),u(e.name),l.hasVoiceIdInput&&p(e.id)},className:`px-2.5 py-1 rounded-full text-xs border transition-colors ${o===e.id?"bg-primary/15 border-primary/40 text-primary font-medium":"border-border text-text-muted hover:text-primary hover:border-primary/40"}`,children:[e.name,e.gender?` \xb7 ${e.gender[0].toUpperCase()}`:"",!0===e.free_users_allowed&&(0,s.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-green-500/15 text-green-600 border border-green-500/20",children:"Free"}),!1===e.free_users_allowed&&(0,s.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-amber-500/15 text-amber-600 border border-amber-500/20",children:"Paid"})]},e.id))})}),l.hasVoiceIdInput&&(0,s.jsx)(v,{label:"Voice ID",children:(0,s.jsx)("div",{className:"flex flex-col gap-1",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:x,onChange:e=>{p(e.target.value),d(e.target.value)},placeholder:"e.g. CwhRBWXzGAHq8TQ4Fs17",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"}),x&&(0,s.jsx)("button",{type:"button",onClick:()=>{p(""),d("")},className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})})}),l.hasLanguageDropdown&&(0,s.jsx)(v,{label:"Language",children:(0,s.jsx)("select",{value:o,onChange:t=>{let a=(0,b.KC)(e).filter(e=>"tts"===(0,b.CP)(e)).find(e=>e.id===t.target.value);d(t.target.value),u(a?.name||t.target.value)},className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(0,b.KC)(e).filter(e=>"tts"===(0,b.CP)(e)).map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,s.jsx)(v,{label:"Input",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:k,onChange:e=>A(e.target.value),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),k&&(0,s.jsx)("button",{type:"button",onClick:()=>A(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),(0,s.jsx)(v,{label:"Output Format",children:(0,s.jsxs)("select",{value:R,onChange:e=>U(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"mp3",children:"MP3 (Binary)"}),(0,s.jsx)("option",{value:"json",children:"JSON (Base64)"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>X(ey),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:Q?"check":"content_copy"}),Q?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:ej,disabled:V||!k.trim()||!ef,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:V?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),V?"Generating...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:ey})]}),W&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:W}),D?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",G&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",G,"ms"]})]}),(0,s.jsxs)("a",{href:D,download:"speech.mp3",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})]}),(0,s.jsx)("audio",{controls:!0,src:D,className:"w-full"}),J&&(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsx)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"JSON Response"})}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:JSON.stringify({format:J.format,audio:J.audio?`${J.audio.substring(0,100)}...`:""},null,2)})]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Response"}),(0,s.jsx)("pre",{className:"mt-1.5 bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-50",children:P})]})]})]}),Z&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-end justify-center sm:items-center",style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(2px)"},onClick:()=>ee(!1),children:(0,s.jsxs)("div",{className:"border border-border rounded-xl shadow-2xl w-full max-w-md mx-4 flex flex-col max-h-[80vh]",style:{backgroundColor:"var(--color-bg)",isolation:"isolate"},onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0 rounded-t-xl",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:"Select Language"}),(0,s.jsx)("button",{onClick:()=>ee(!1),className:"text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,s.jsx)("div",{className:"px-4 py-2.5 border-b border-border shrink-0",children:(0,s.jsx)("input",{autoFocus:!0,value:el,onChange:e=>eo(e.target.value),placeholder:"Search language...",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),(0,s.jsxs)("div",{className:"overflow-y-auto flex-1 p-2",children:[en&&(0,s.jsx)("p",{className:"text-xs text-red-500 px-2 py-1",children:en}),es?(0,s.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"Loading..."}):(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[ep.map(e=>(0,s.jsxs)("button",{onClick:()=>{let t;return ee(!1),j(e.code),void(g(t=ed[e.code]?.voices||[]),t.length&&(d(t[0].id),u(t[0].name),l.hasVoiceIdInput&&p(t[0].id)))},className:`flex items-center justify-between w-full px-3 py-2 rounded-lg text-left hover:bg-sidebar transition-colors ${y===e.code?"bg-primary/10 text-primary":""}`,children:[(0,s.jsx)("span",{className:"text-sm",children:e.name}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[e.voices.length," voices"]}),y===e.code&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check"})]})]},e.code)),0===ep.length&&(0,s.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"No languages found."})]})]})]})})]})}let A="https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog.png";function I(e){let t="string"==typeof e?e.trim():"";return t?/^(data:image\/|https?:\/\/)/i.test(t)?t:`data:image/png;base64,${t}`:""}function E({providerId:e,kind:t}){let a=(0,c.wG)(e),r=(0,c.rs)(a)===e?a:e,l=c.rj.find(e=>e.id===t),o=w[t],d=o||{},m=(0,b.KC)(e).filter(e=>(0,b.CP)(e)===t),u=new Set(["image","video","music","imageToText"]).has(t),x=u&&0===m.length,[p,h]=(0,n.useState)(m[0]?.id??""),g=m.find(e=>e.id===p),y=!!g?.capabilities?.includes("edit"),j=!!g?.capabilities?.includes("mask"),[N,k]=(0,n.useState)(d.defaultInput||""),[C,S]=(0,n.useState)(""),[$,P]=(0,n.useState)(""),[_,T]=(0,n.useState)(()=>(d.extraFields||[]).reduce((e,t)=>(e[t.key]=t.default??"",e),{})),[B,M]=(0,n.useState)(""),[O,K]=(0,n.useState)(!1),[L,R]=(0,n.useState)(""),[U,D]=(0,n.useState)(""),[F,J]=(0,n.useState)(null),[z,V]=(0,n.useState)(null),[H,W]=(0,n.useState)(null),[q,G]=(0,n.useState)("json"),[Y,Q]=(0,n.useState)(""),[X,Z]=(0,n.useState)(!1),[ee,et]=(0,n.useState)(""),[ea,es]=(0,n.useState)([]),[er,el]=(0,n.useState)(""),{copied:eo,copy:en}=(0,f.C)(),{copied:ei,copy:ed}=(0,f.C)();if((0,n.useEffect)(()=>{R(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{M((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&D(e.publicUrl)}).catch(()=>{}),fetch("/api/providers/client").then(e=>e.json()).then(t=>{es((t.connections||[]).filter(t=>t.provider===e&&!1!==t.isActive))}).catch(()=>{})},[e]),!l||!o)return null;let ec=O?U:L,em=l.endpoint.path,eu=u?p?`${r}/${p}`:x?"":r:r,ex="cloudflare-ai"!==e?{}:"@cf/runwayml/stable-diffusion-v1-5-img2img"===p?{image:A}:"@cf/runwayml/stable-diffusion-v1-5-inpainting"===p?{image:A,mask_image:"https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog-mask.png"}:{},ep=C.trim()||ex.image||"",eh=$.trim()||ex.mask_image||"",eb=I(ep),ef=I(eh),eg=Object.entries(_).reduce((e,[t,a])=>(""===a||null==a||"number"==typeof a&&Number.isNaN(a)||(e[t]=a),e),{}),ey={model:eu,[o.bodyKey]:N,...o.extraBody,...eg,...y&&ep?{image:ep}:{},...j&&eh?{mask_image:eh}:{}},ej="image"===t&&"binary"===q,ev="image"===t&&"codex"===e&&!ej,ew=`${em}${ej?"?response_format=binary":""}`,eN=`-H "Content-Type: application/json" \\
|
|
46
|
+
-H "Authorization: Bearer ${B||"YOUR_KEY"}"${er?` \\
|
|
47
|
+
-H "x-connection-id: ${er}"`:""}${ev?` \\
|
|
48
|
+
-H "Accept: text/event-stream"`:""}`,ek=`curl -X ${l.endpoint.method} ${ec}${ew} \\
|
|
49
|
+
${eN.replace(/\\\n /g,"\\\n ")} \\
|
|
50
|
+
-d '${JSON.stringify(ey)}'${ej?" \\\n --output image.png":""}`,eC=async()=>{if(!N.trim()||!eu)return;if(Z(!0),et(""),J(null),V(null),W(null),Y){try{URL.revokeObjectURL(Y)}catch{}Q("")}let e=Date.now();try{let t={"Content-Type":"application/json"};B&&(t.Authorization=`Bearer ${B}`),er&&(t["x-connection-id"]=er),ev&&(t.Accept="text/event-stream");let a={...ey,model:eu},s=await fetch(`/api${ew}`,{method:l.endpoint.method,headers:t,body:JSON.stringify(a)});if(!s.ok){let e=await s.json().catch(()=>({}));et(e?.error?.message||e?.error||`HTTP ${s.status}`);return}let r=s.headers.get("content-type")||"";if(r.startsWith("image/")){let t=await s.blob(),a=URL.createObjectURL(t);Q(a),J({data:{binary:!0,mime:r,size:t.size},latencyMs:Date.now()-e});return}if(r.includes("text/event-stream")&&s.body){let t=s.body.getReader(),a=new TextDecoder,r="",l=null,o=null;for(;;){let e,{done:s,value:n}=await t.read();if(s)break;for(r+=a.decode(n,{stream:!0});-1!==(e=r.indexOf("\n\n"));){let t=r.slice(0,e);r=r.slice(e+2);let a=null,s="";for(let e of t.split("\n"))e.startsWith("event:")?a=e.slice(6).trim():e.startsWith("data:")&&(s+=e.slice(5).trim());if(a)try{let e=s?JSON.parse(s):{};"progress"===a?V(e):"partial_image"===a?W(e):"done"===a?l=e:"error"===a&&(o=e?.message||"Stream error")}catch{}}}let n=Date.now()-e;if(o)return void et(o);l&&J({data:l,latencyMs:n})}else{let t=await s.json(),a=Date.now()-e;J({data:t,latencyMs:a})}}catch(e){et(e.message||"Network error")}finally{Z(!1)}},eS=e=>{if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(eS);let t={};for(let[a,s]of Object.entries(e))t[a]="b64_json"===a&&"string"==typeof s&&s.length>100?`<${s.length} chars base64>`:eS(s);return t},e$=F?JSON.stringify(eS(F.data),null,2):"";return(0,s.jsxs)(i.Card,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[m.length>0?(0,s.jsx)(v,{label:"Model",children:(0,s.jsx)("select",{value:p,onChange:e=>h(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:m.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):x?(0,s.jsx)(v,{label:"Model",children:(0,s.jsx)("input",{value:p,onChange:e=>h(e.target.value),placeholder:"Enter model id (provider-specific)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}):null,(0,s.jsx)(v,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[ec,em]}),U&&(0,s.jsxs)("button",{onClick:()=>K(e=>!e),title:O?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${O?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)(v,{label:"API Key",children:(0,s.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:B?`${B.slice(0,8)}${"•".repeat(Math.min(20,B.length-8))}`:(0,s.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),ea.length>0&&(0,s.jsx)(v,{label:"Connection",children:(0,s.jsxs)("select",{value:er,onChange:e=>el(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Auto (by priority)"}),ea.map(e=>{let t=e.providerSpecificData?.chatgptPlanType,a=e.email||e.name||e.id.slice(0,8);return(0,s.jsxs)("option",{value:e.id,children:[a,t?` [${t}]`:""]},e.id)})]})}),(0,s.jsx)(v,{label:o.inputLabel,children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:N,onChange:e=>k(e.target.value),placeholder:o.inputPlaceholder,className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),N&&(0,s.jsx)("button",{type:"button",onClick:()=>k(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),y&&(0,s.jsx)(v,{label:"Ref Image (URL)",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:C,onChange:e=>S(e.target.value),placeholder:ex.image||"https://example.com/source.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),C&&(0,s.jsx)("button",{type:"button",onClick:()=>S(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),eb&&(0,s.jsx)("img",{src:eb,alt:"Reference",className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"}})]})}),j&&(0,s.jsx)(v,{label:"Mask (URL)",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:$,onChange:e=>P(e.target.value),placeholder:ex.mask_image||"https://example.com/mask.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),$&&(0,s.jsx)("button",{type:"button",onClick:()=>P(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),ef&&(0,s.jsx)("img",{src:ef,alt:"Mask",className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"}})]})}),(o.extraFields||[]).filter(e=>0===m.length||Array.isArray(g?.params)&&g.params.includes(e.key)).map(e=>(0,s.jsx)(v,{label:e.label,children:"select"===e.type?(0,s.jsx)("select",{value:_[e.key]??"",onChange:t=>T(a=>({...a,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(e.options||[]).map(e=>(0,s.jsx)("option",{value:e,children:""===e?"(default)":e},e))}):"text"===e.type?(0,s.jsx)("input",{type:"text",value:_[e.key]??"",placeholder:e.placeholder,onChange:t=>T(a=>({...a,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}):(0,s.jsx)("input",{type:"number",value:_[e.key]??"",min:e.min,max:e.max,onChange:t=>T(a=>({...a,[e.key]:""===t.target.value?"":Number(t.target.value)})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})},e.key)),"image"===t&&(0,s.jsx)(v,{label:"Output Format",children:(0,s.jsxs)("select",{value:q,onChange:e=>G(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"json",children:"JSON (Base64)"}),(0,s.jsx)("option",{value:"binary",children:"Binary File"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>en(ek),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eo?"check":"content_copy"}),eo?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:eC,disabled:X||!N.trim()||!eu,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:X?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),X?"Running...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:ek})]}),(X||z)&&ev&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 px-3 py-2 rounded-lg bg-sidebar border border-border sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",style:X?{animation:"spin 1s linear infinite"}:void 0,children:X?"progress_activity":"check_circle"}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[z?.stage||"starting",!X&&z?.bytesReceived?` \xb7 ${(z.bytesReceived/1024).toFixed(1)} KB`:""]})]}),H?.b64_json&&!F&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Partial preview"}),(0,s.jsx)("img",{src:`data:image/png;base64,${H.b64_json}`,alt:"Partial",className:"max-w-full rounded-lg border border-border mt-1.5 opacity-80"})]}),ee&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:ee}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",F&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",F.latencyMs,"ms"]})]}),F&&(0,s.jsxs)("button",{onClick:()=>ed(e$),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:ei?"check":"content_copy"}),ei?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:F?e$:o.defaultResponse}),"image"===t&&(Y||F?.data?.data?.[0])&&(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,s.jsxs)("a",{href:Y||(F?.data?.data?.[0]?.b64_json?`data:image/png;base64,${F.data.data[0].b64_json}`:F?.data?.data?.[0]?.url||""),download:"image.png",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,s.jsx)("img",{src:Y||(F?.data?.data?.[0]?.b64_json?`data:image/png;base64,${F.data.data[0].b64_json}`:F?.data?.data?.[0]?.url),alt:"Generated",className:"max-w-full rounded-lg border border-border"})]})]})]})]})}function T({providerId:e}){let t=(0,c.wG)(e),a=(0,b.KC)(e).filter(e=>"stt"===(0,b.CP)(e)),[r,l]=(0,n.useState)([]),o=[...a,...r],[d,m]=(0,n.useState)(a[0]?.id??""),u=o.find(e=>e.id===d),x=Array.isArray(u?.params)?u.params:[],[p,h]=(0,n.useState)(null),[g,y]=(0,n.useState)(""),[j,w]=(0,n.useState)(""),[N,k]=(0,n.useState)("json"),[C,S]=(0,n.useState)(""),[$,P]=(0,n.useState)(""),[_,A]=(0,n.useState)(!1),[I,E]=(0,n.useState)(""),[B,M]=(0,n.useState)(""),[O,K]=(0,n.useState)(null),[L,R]=(0,n.useState)(null),[U,D]=(0,n.useState)(!1),[F,J]=(0,n.useState)(""),{copied:z,copy:V}=(0,f.C)(),{copied:H,copy:W}=(0,f.C)();(0,n.useEffect)(()=>{E(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{P((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&M(e.publicUrl)}).catch(()=>{});let e=()=>{fetch("/api/models/custom",{cache:"no-store"}).then(e=>e.json()).then(e=>{l((e.models||[]).filter(e=>"stt"===(0,b.CP)(e)&&e.providerAlias===t))}).catch(()=>{})};return e(),window.addEventListener("focus",e),window.addEventListener("customModelChanged",e),()=>{window.removeEventListener("focus",e),window.removeEventListener("customModelChanged",e)}},[t]);let q=_?B:I,G=d?`${t}/${d}`:"",Y=`curl -X POST ${q}/v1/audio/transcriptions \\
|
|
51
|
+
-H "Authorization: Bearer ${$||"YOUR_KEY"}" \\
|
|
52
|
+
-F "file=@${p?.name||"audio.mp3"}" \\
|
|
53
|
+
-F "model=${G}"${x.includes("language")&&g?` \\
|
|
54
|
+
-F "language=${g}"`:""}${x.includes("response_format")?` \\
|
|
55
|
+
-F "response_format=${N}"`:""}${x.includes("temperature")&&C?` \\
|
|
56
|
+
-F "temperature=${C}"`:""}${x.includes("prompt")&&j?` \\
|
|
57
|
+
-F "prompt=${j}"`:""}`,Q=async()=>{if(!p||!G)return;D(!0),J(""),K(null);let e=Date.now();try{let t=new FormData;t.append("file",p),t.append("model",G),x.includes("language")&&g&&t.append("language",g),x.includes("response_format")&&t.append("response_format",N),x.includes("temperature")&&C&&t.append("temperature",C),x.includes("prompt")&&j&&t.append("prompt",j);let a={};$&&(a.Authorization=`Bearer ${$}`);let s=await fetch("/api/v1/audio/transcriptions",{method:"POST",headers:a,body:t});R(Date.now()-e);let r=(s.headers.get("content-type")||"").includes("application/json")?await s.json():await s.text();if(!s.ok)return void J(r?.error?.message||r?.error||r||`HTTP ${s.status}`);K(r)}catch(e){J(e.message||"Network error")}finally{D(!1)}},X="string"==typeof O?O:O?JSON.stringify(O,null,2):`{
|
|
58
|
+
"text": "Hello world..."
|
|
59
|
+
}`;return(0,s.jsxs)(i.Card,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[o.length>0?(0,s.jsx)(v,{label:"Model",children:(0,s.jsx)("select",{value:d,onChange:e=>m(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:o.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):(0,s.jsx)(v,{label:"Model",children:(0,s.jsx)("input",{value:d,onChange:e=>m(e.target.value),placeholder:"Enter model id",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,s.jsx)(v,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[q,"/v1/audio/transcriptions"]}),B&&(0,s.jsxs)("button",{onClick:()=>A(e=>!e),title:_?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${_?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)(v,{label:"API Key",children:(0,s.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:$?`${$.slice(0,8)}${"•".repeat(Math.min(20,$.length-8))}`:(0,s.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),(0,s.jsx)(v,{label:"Audio File",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("input",{type:"file",accept:"audio/*,video/mp4,.m4a,.mp3,.wav,.ogg,.flac,.webm,.opus",onChange:e=>h(e.target.files?.[0]||null),className:"w-full text-xs text-text-muted file:mr-2 file:py-1 file:px-2.5 file:rounded-lg file:border file:border-border file:bg-background file:text-text-main hover:file:bg-sidebar file:cursor-pointer"}),p&&(0,s.jsxs)("span",{className:"text-xs text-text-muted font-mono",children:[p.name," \xb7 ",(p.size/1024).toFixed(1)," KB"]})]})}),x.includes("language")&&(0,s.jsx)(v,{label:"Language",children:(0,s.jsx)("input",{value:g,onChange:e=>y(e.target.value),placeholder:"e.g. en, vi, ja (auto-detect if empty)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),x.includes("prompt")&&(0,s.jsx)(v,{label:"Prompt",children:(0,s.jsx)("input",{value:j,onChange:e=>w(e.target.value),placeholder:"optional context to improve accuracy",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),x.includes("temperature")&&(0,s.jsx)(v,{label:"Temperature",children:(0,s.jsx)("input",{type:"number",step:"0.1",min:"0",max:"1",value:C,onChange:e=>S(e.target.value),placeholder:"0 - 1 (default 0)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),x.includes("response_format")&&(0,s.jsx)(v,{label:"Response Format",children:(0,s.jsxs)("select",{value:N,onChange:e=>k(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"json",children:"json"}),(0,s.jsx)("option",{value:"text",children:"text"}),(0,s.jsx)("option",{value:"srt",children:"srt"}),(0,s.jsx)("option",{value:"verbose_json",children:"verbose_json"}),(0,s.jsx)("option",{value:"vtt",children:"vtt"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>V(Y),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:z?"check":"content_copy"}),z?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:Q,disabled:U||!p||!G,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:U?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),U?"Transcribing...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:Y})]}),F&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:F}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",O&&L&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",L,"ms"]})]}),O&&(0,s.jsxs)("button",{onClick:()=>W(X),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:H?"check":"content_copy"}),H?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:X})]})]})]})}function B(){let{kind:e,id:t}=(0,r.useParams)(),a=(0,r.useRouter)(),l=c.rj.find(t=>t.id===e),m=(0,c.gC)(t)&&"embedding"===e,u=async()=>{if(confirm("Delete this Custom Embedding node?"))try{(await fetch(`/api/provider-nodes/${t}`,{method:"DELETE"})).ok&&a.push(`/dashboard/media-providers/${e}`)}catch(e){console.log("Error deleting custom embedding node:",e)}},[x,p]=(0,n.useState)(null),[b,f]=(0,n.useState)(m),[g,y]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{if(!m)return;let e=!1;return fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(a=>{e||(p((a.nodes||[]).find(e=>e.id===t)||null),f(!1))}).catch(()=>{e||f(!1)}),()=>{e=!0}},[t,m]),!l)return(0,r.notFound)();let v=c.Q2[t],N=m?x?{id:t,name:x.name||"Custom Embedding",color:"#6366F1",textIcon:"CE"}:null:v;if(!m&&!v||m&&!b&&!x)return(0,r.notFound)();if(m&&b)return(0,s.jsx)("div",{className:"text-text-muted text-sm py-12 text-center",children:"Loading..."});let C=m?["embedding"]:N.serviceKinds??["llm"];return m||C.includes(e)?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(o(),{href:`/dashboard/media-providers/${e}`,className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),l.label]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[(0,s.jsx)("div",{className:"size-12 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${N.color}15`},children:(0,s.jsx)(d.A,{src:`/providers/${N.id}.png`,alt:N.name,size:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",fallbackText:N.textIcon||N.id.slice(0,2).toUpperCase(),fallbackColor:N.color})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[(0,s.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:N.name}),!m&&N.notice?.apiKeyUrl&&(0,s.jsxs)("a",{href:N.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API Key"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mt-1 flex-wrap",children:[m&&(0,s.jsxs)(i.Badge,{variant:"default",size:"sm",children:["Custom \xb7 ",x?.prefix]}),C.map(t=>(0,s.jsx)(i.Badge,{variant:t===e?"primary":"default",size:"sm",children:t.toUpperCase()},t))]})]}),m&&(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)(i.Button,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>y(!0),children:"Edit"}),(0,s.jsx)(i.Button,{size:"sm",variant:"secondary",icon:"delete",onClick:u,children:"Delete"})]})]})]}),!m&&N.kindNotice?.[e]&&(0,s.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-amber-500/10 border border-amber-500/30 text-amber-700 dark:text-amber-400",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px] mt-0.5",children:"warning"}),(0,s.jsx)("p",{className:"text-sm",children:N.kindNotice[e]})]}),!m&&N.notice?.text&&!N.deprecated&&(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,s.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:N.notice.text}),N.notice.apiKeyUrl&&(0,s.jsx)("a",{href:N.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 →"})]}),!m&&N.noAuth?(0,s.jsx)(i.NoAuthProxyCard,{providerId:t}):(0,s.jsx)(h,{providerId:t,isOAuth:!1}),"tts"!==e&&"webSearch"!==e&&"webFetch"!==e&&(0,s.jsx)(j,{providerId:t,kindFilter:e,providerAliasOverride:m?x?.prefix:void 0}),!m&&(N.searchConfig||N.fetchConfig||N.ttsConfig||N.sttConfig||N.embeddingConfig||N.searchViaChat)&&(0,s.jsx)(i.ProviderInfoCard,{config:"webFetch"===e?N.fetchConfig:"tts"===e?N.ttsConfig:"stt"===e?N.sttConfig:"embedding"===e?N.embeddingConfig:N.searchConfig||{mode:"chat-completions",defaultModel:N.searchViaChat?.defaultModel,pricingUrl:N.searchViaChat?.pricingUrl,freeTier:N.searchViaChat?.freeTier},provider:N,title:`${l.label} Config`}),"embedding"===e&&(0,s.jsx)(k,{providerId:t,customAlias:x?.prefix}),"tts"===e&&(0,s.jsx)(_,{providerId:t}),"stt"===e&&!m&&(0,s.jsx)(T,{providerId:t}),!m&&w[e]&&(0,s.jsx)(E,{providerId:t,kind:e}),m&&(0,s.jsx)(i.AddCustomEmbeddingModal,{isOpen:g,node:x,onClose:()=>y(!1),onSaved:e=>{p(e),y(!1)}})]}):(0,r.notFound)()}}},e=>{e.O(0,[2554,7418,3885,9458,9814,4385,497,2147,3204,7358],()=>e(e.s=2710)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6620],{6615:(e,s,t)=>{Promise.resolve().then(t.bind(t,7250))},7250:(e,s,t)=>{"use strict";t.d(s,{default:()=>b});var a=t(5102),i=t(3278),r=t(3885),n=t.n(r),l=t(2030),o=t(497),d=t(1704),c=t(1038);let m=new Set([]),x={image:"image-combo",tts:"tts-combo"};function p(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 h({isNoAuth:e,allDisabled:s,total:t,connected:i,error:r}){return e?(0,a.jsx)(o.Badge,{variant:"success",size:"sm",children:"Ready"}):s?(0,a.jsx)(o.Badge,{variant:"default",size:"sm",children:"Disabled"}):0===t?(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"No connections"}):(0,a.jsxs)(a.Fragment,{children:[i>0&&(0,a.jsxs)(o.Badge,{variant:"success",size:"sm",dot:!0,children:[i," Connected"]}),r>0&&(0,a.jsxs)(o.Badge,{variant:"error",size:"sm",dot:!0,children:[r," Error"]}),0===i&&0===r&&(0,a.jsxs)(o.Badge,{variant:"default",size:"sm",children:[t," Added"]})]})}function u({provider:e,kind:s,connections:t,isCustom:i,onToggle:r}){let l=c.Q2[e.id],m=!!l?.noAuth,x=t.filter(s=>s.provider===e.id),g=x.filter(e=>{let s=p(e);return"active"===s||"success"===s}).length,b=x.filter(e=>{let s=p(e);return"error"===s||"expired"===s||"unavailable"===s}).length,f=x.length,j=f>0&&x.every(e=>!1===e.isActive);return(0,a.jsx)(n(),{href:`/dashboard/media-providers/${s}/${e.id}`,className:"group",children:(0,a.jsx)(o.Card,{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,a.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.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,a.jsx)(d.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,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"font-semibold text-sm",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[i&&(0,a.jsx)(o.Badge,{variant:"default",size:"sm",children:"Custom"}),(0,a.jsx)(h,{isNoAuth:m,allDisabled:j,total:f,connected:g,error:b})]})]})]}),f>0&&(0,a.jsx)("button",{type:"button",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)},"aria-label":j?"Enable provider":"Disable provider",children:(0,a.jsx)(o.Toggle,{size:"sm",checked:!j,onChange:()=>{},title:j?"Enable provider":"Disable provider"})})]})})})}function g({combos:e}){return 0===e.length?null:(0,a.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>(0,a.jsx)(n(),{href:`/dashboard/media-providers/combo/${e.id}`,children:(0,a.jsx)(o.Card,{padding:"xs",className:"hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors cursor-pointer",children:(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"}),(0,a.jsx)("code",{className:"text-sm font-mono font-medium flex-1 truncate",children:e.name}),(0,a.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]:"",i=c.Q2[t];return(0,a.jsx)("div",{title:i?.name||e,className:"size-5 rounded flex items-center justify-center",style:{backgroundColor:`${i?.color??"#888"}15`},children:(0,a.jsx)(d.A,{src:`/providers/${t}.png`,alt:i?.name||t,size:18,className:"object-contain rounded max-w-[18px] max-h-[18px]",fallbackText:i?.textIcon||t.slice(0,2).toUpperCase(),fallbackColor:i?.color})},`${e}-${s}`)}),e.models.length>6&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted ml-1",children:["+",e.models.length-6]})]}),(0,a.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:e.models.length}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[16px]",children:"chevron_right"})]})})},e.id))})}function b({initialConnections:e,initialNodes:s,initialCombos:t}){let{kind:r}=(0,i.useParams)(),n=(0,i.useRouter)(),[d,p]=(0,l.useState)(e||[]),[h,f]=(0,l.useState)(s||[]),[j,v]=(0,l.useState)(t||[]),[N,y]=(0,l.useState)(!1),k=c.rj.find(e=>e.id===r),C="embedding"===r,w=m.has(r);if("webSearch"===r||"webFetch"===r)return n.replace("/dashboard/media-providers/web"),null;if(!k)return(0,i.notFound)();let $=(0,c.o5)(r),z=j.filter(e=>e.kind===r),S=h.map(e=>({id:e.id,name:e.name||"Custom Embedding",color:"#6366F1",textIcon:"CE"})),A=[...$,...S],E=async(e,s)=>{let t=d.filter(s=>s.provider===e);p(t=>t.map(t=>t.provider===e?{...t,isActive:s}:t)),await Promise.allSettled(t.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},T=async()=>{let e=x[r]||`${r}-combo`,s=e,t=1,a=new Set(j.map(e=>e.name));for(;a.has(s);)s=`${e}-${t++}`;let i=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s,models:[],kind:r})});if(i.ok){let e=await i.json();n.push(`/dashboard/media-providers/combo/${e.id}`)}else alert((await i.json()).error||"Failed to create combo")};return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(C||w)&&(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[w&&(0,a.jsx)(o.Button,{size:"sm",icon:"add",onClick:T,children:"Create Combo"}),C&&(0,a.jsx)(o.Button,{size:"sm",icon:"add",onClick:()=>y(!0),children:"Add Custom Embedding"})]}),w&&z.length>0&&(0,a.jsx)(g,{combos:z}),0===A.length?(0,a.jsxs)("div",{className:"text-center py-12 border border-dashed border-border rounded-xl text-text-muted text-sm",children:["No providers support ",(0,a.jsx)("strong",{children:k.label})," yet."]}):(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[$.map(e=>(0,a.jsx)(u,{provider:e,kind:r,connections:d,onToggle:E},e.id)),S.map(e=>(0,a.jsx)(u,{provider:e,kind:r,connections:d,isCustom:!0,onToggle:E},e.id))]}),C&&(0,a.jsx)(o.AddCustomEmbeddingModal,{isOpen:N,onClose:()=>y(!1),onCreated:e=>{f(s=>[...s,e]),y(!1)}})]})}}},e=>{e.O(0,[2554,7418,3885,9458,9814,4385,497,2147,3204,7358],()=>e(e.s=6615)),_N_E=e.O()}]);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8334],{6312:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>j});var a=s(5102),l=s(3278),r=s(2030),n=s(3885),i=s.n(n),o=s(7837),d=s(497),c=s(1704),m=s(1038);let x=/^[a-zA-Z0-9_.\-]+$/,h={webSearch:"Web Search",webFetch:"Web Fetch",image:"Text to Image",tts:"Text To Speech"},u={webSearch:"/v1/search",webFetch:"/v1/web/fetch",image:"/v1/images/generations",tts:"/v1/audio/speech"},p={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 b(e){return"webSearch"===e||"webFetch"===e?"/dashboard/media-providers/web":`/dashboard/media-providers/${e}`}function f({providers:e,onAdd:t,onMove:s,onRemove:l}){return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(d.Card,{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)(d.Button,{size:"sm",icon:"add",onClick:t,children:"Add Provider"})]}),0===e.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:e.map((t,r)=>{let{providerId:n,model:i}=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)}}(t),o=m.Q2[n];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:r+1}),(0,a.jsx)(c.A,{src:`/providers/${n}.png`,alt:o?.name||n,size:24,className:"object-contain rounded shrink-0",fallbackText:o?.textIcon||n.slice(0,2).toUpperCase(),fallbackColor:o?.color}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"text-sm font-medium truncate",children:o?.name||n}),i&&(0,a.jsx)("code",{className:"text-[10px] text-text-muted font-mono truncate block",children:i})]}),(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>s(r,-1),disabled:0===r,className:`p-1 rounded ${0===r?"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",{type:"button",onClick:()=>s(r,1),disabled:r===e.length-1,className:`p-1 rounded ${r===e.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",{type:"button",onClick:()=>l(r),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"})})]})]},`${t}-${r}`)})})]})})}function j(){let{id:e}=(0,l.useParams)(),t=(0,l.useRouter)(),[s,n]=(0,r.useState)(null),[c,j]=(0,r.useState)(!0),[g,w]=(0,r.useState)(""),[y,v]=(0,r.useState)(""),[N,k]=(0,r.useState)([]),[S,C]=(0,r.useState)(!1),[U,O]=(0,r.useState)(!1),[$,_]=(0,r.useState)([]),[T,R]=(0,r.useState)(!1),[A,L]=(0,r.useState)(null),[P,z]=(0,r.useState)(""),[E,F]=(0,r.useState)(""),[M,D]=(0,r.useState)([]),[I,B]=(0,r.useState)({}),J=(0,r.useCallback)(async()=>{try{let[t,s,a,l,r,i]=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(i.ok&&B((await i.json()).aliases||{}),l.ok){let e=await l.json();F((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}if(r.ok&&D((await r.json()).connections||[]),!t.ok){n(null),j(!1);return}let o=await t.json();n(o),w(o.name),k(o.models||[]);let d=s.ok?await s.json():{};C(d.comboStrategies?.[o.name]?.fallbackStrategy==="round-robin");let c=a.ok?await a.json():[];_(c.filter(e=>"string"==typeof e&&e.includes(o.name)).slice(0,50))}catch{}j(!1)},[e]);(0,r.useEffect)(()=>{J()},[J]);let W=e=>e.trim()?x.test(e)?(v(""),!0):(v("Only letters, numbers, -, _ and ."),!1):(v("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)},q=async()=>{!W(g)||g===s.name||await H({name:g})&&await J()},G=async e=>{let t=e?.value||e;if(!t||N.includes(t))return;let s=[...N,t];k(s),await H({models:s})},Y=async e=>{let t=e?.value||e;if(!t||!N.includes(t))return;let s=N.filter(e=>e!==t);k(s),await H({models:s})},K=async e=>{let t=N.filter((t,s)=>s!==e);k(t),await H({models:t})},Q=async(e,t)=>{let s=[...N],a=e+t;a<0||a>=s.length||([s[e],s[a]]=[s[a],s[e]],k(s),await H({models:s}))},V=async e=>{C(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})})},X=async()=>{!confirm(`Delete combo "${s.name}"?`)||(await fetch(`/api/combos/${e}`,{method:"DELETE"})).ok&&t.push(b(s.kind))},Z=async()=>{if(R(!0),L(null),z(""),A?.audioUrl)try{URL.revokeObjectURL(A.audioUrl)}catch{}if(A?.imageUrl?.startsWith("blob:"))try{URL.revokeObjectURL(A.imageUrl)}catch{}let e=Date.now();try{let t=u[s.kind],a=p[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)}),n=Date.now()-e;if(!r.ok){let e=await r.json().catch(()=>({}));z(e?.error?.message||e?.error||`HTTP ${r.status}`),L({json:JSON.stringify(e,null,2),latencyMs:n});return}let i=r.headers.get("content-type")||"";if(i.startsWith("image/")){let e=await r.blob();L({imageUrl:URL.createObjectURL(e),latencyMs:n});return}if(i.startsWith("audio/")||"application/octet-stream"===i){let e=await r.blob();L({audioUrl:URL.createObjectURL(e),latencyMs:n});return}let o=await r.json(),d=o?.data?.[0],c=d?.b64_json?`data:image/png;base64,${d.b64_json}`:d?.url||"";L({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:c,latencyMs:n})}catch(e){z(e.message||"Network error")}R(!1)};if(c)return(0,a.jsx)("div",{className:"text-text-muted text-sm",children:"Loading..."});if(!s)return(0,l.notFound)();let ee=h[s.kind]||m.rj.find(e=>e.id===s.kind)?.label||"Combo",et=u[s.kind],es=s.kind&&p[s.kind]?p[s.kind](s.name):null,ea=et?`curl -X POST http://localhost:20128${et} \\
|
|
2
|
+
-H "Content-Type: application/json" \\
|
|
3
|
+
-H "Authorization: Bearer ${E||"YOUR_KEY"}" \\
|
|
4
|
+
-d '${JSON.stringify(es)}'`:"",el=b(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)(i(),{href:el,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:[ee," Combo"]}),(0,a.jsx)("code",{className:"text-lg font-semibold font-mono",children:s.name})]})]}),(0,a.jsx)(d.Button,{variant:"outline",icon:"delete",onClick:X,className:"text-red-500 border-red-200 hover:bg-red-50",children:"Delete"})]}),(0,a.jsxs)(d.Card,{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)(d.Input,{label:"Combo Name",value:g,onChange:e=>{w(e.target.value),W(e.target.value)},onBlur:q,error:y}),(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)(d.Toggle,{checked:S,onChange:V})]})]})]}),(0,a.jsx)(f,{providers:N,onAdd:()=>O(!0),onMove:Q,onRemove:K}),s.kind&&et&&(0,a.jsxs)(d.Card,{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)(d.Button,{size:"sm",icon:"play_arrow",onClick:Z,disabled:T||0===N.length,children:T?"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:ea}),P&&(0,a.jsx)("p",{className:"mt-3 text-xs text-red-500 break-words",children:P}),A&&(0,a.jsxs)("div",{className:"mt-3 flex flex-col gap-3",children:[null!=A.latencyMs&&(0,a.jsxs)("span",{className:"text-[11px] text-text-muted",children:["⚡ ",A.latencyMs,"ms"]}),A.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:A.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)(o.default,{src:A.imageUrl,alt:"Generated",width:512,height:512,className:"max-w-full rounded-lg border border-border",unoptimized:!0})]}),A.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:A.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:A.audioUrl,className:"w-full","aria-label":"Generated speech audio",children:(0,a.jsx)("track",{kind:"captions"})})]}),A.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:A.json})]})]}),(0,a.jsxs)(d.Card,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Usage Logs"}),0===$.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:$.join("\n")})]}),(0,a.jsx)(d.ModelSelectModal,{isOpen:U,onClose:()=>O(!1),onSelect:G,onDeselect:Y,activeProviders:M,modelAliases:I,title:`Add ${ee} Model`,kindFilter:s.kind,addedModelValues:N,closeOnSelect:!1})]})}},7656:(e,t,s)=>{Promise.resolve().then(s.bind(s,6312))}},e=>{e.O(0,[2554,7418,3885,9458,9814,4385,497,2147,3204,7358],()=>e(e.s=7656)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9260],{2158:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>u});var r=t(5102),a=t(3885),i=t.n(a),l=t(2030),o=t(3278),c=t(497),n=t(1704),d=t(1038);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({isNoAuth:e,allDisabled:s,total:t,connected:a,error:i}){return e?(0,r.jsx)(c.Badge,{variant:"success",size:"sm",children:"Ready"}):s?(0,r.jsx)(c.Badge,{variant:"default",size:"sm",children:"Disabled"}):0===t?(0,r.jsx)("span",{className:"text-xs text-text-muted",children:"No connections"}):(0,r.jsxs)(r.Fragment,{children:[a>0&&(0,r.jsxs)(c.Badge,{variant:"success",size:"sm",dot:!0,children:[a," Connected"]}),i>0&&(0,r.jsxs)(c.Badge,{variant:"error",size:"sm",dot:!0,children:[i," Error"]}),0===a&&0===i&&(0,r.jsxs)(c.Badge,{variant:"default",size:"sm",children:[t," Added"]})]})}function h({provider:e,kind:s,connections:t}){let a=d.Q2[e.id],l=!!a?.noAuth,o=t.filter(s=>s.provider===e.id),p=o.filter(e=>{let s=m(e);return"active"===s||"success"===s}).length,b=o.filter(e=>{let s=m(e);return"error"===s||"expired"===s||"unavailable"===s}).length,u=o.length,f=u>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.Card,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${f?"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:(0,r.jsx)(x,{isNoAuth:l,allDisabled:f,total:u,connected:p,error:b})})]})]})})})}function p({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.Card,{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 b({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)"]})]}),(0,r.jsx)(c.Button,{size:"sm",icon:"add",onClick:o,children:"Create Combo"})]}),l.length>0&&(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(p,{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)(h,{provider:e,kind:t,connections:i},e.id))})]})}function u(){let e=(0,o.useRouter)(),[s,t]=(0,l.useState)([]),[a,i]=(0,l.useState)([]),c=async()=>{try{let[e,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/combos",{cache:"no-store"})]);e.ok&&t((await e.json()).connections||[]),s.ok&&i((await s.json()).combos||[])}catch{}};(0,l.useEffect)(()=>{c()},[]);let n=(0,d.o5)("webSearch"),m=(0,d.o5)("webFetch"),x=a.filter(e=>"webSearch"===e.kind),h=a.filter(e=>"webFetch"===e.kind),p=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)(b,{title:"Web Search",icon:"search",kind:"webSearch",providers:n,connections:s,combos:x,onCreateCombo:()=>p("webSearch")}),(0,r.jsx)("div",{className:"border-t border-border"}),(0,r.jsx)(b,{title:"Web Fetch",icon:"travel_explore",kind:"webFetch",providers:m,connections:s,combos:h,onCreateCombo:()=>p("webFetch")})]})}},8750:(e,s,t)=>{Promise.resolve().then(t.bind(t,2158))}},e=>{e.O(0,[2554,7418,3885,9458,9814,4385,497,2147,3204,7358],()=>e(e.s=8750)),_N_E=e.O()}]);
|
package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/page-1d917685f3312fc6.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6607],{581:(e,t,s)=>{"use strict";s.d(t,{default:()=>b});var a=s(5102),r=s(2030),l=s(3700),i=s(5223),n=s(1038);s(2142),s(7307),s(5590),s(8423),s(1286),s(8417);var o=s(497),d=s(7837);s(2329),s(8551),s(4855),s(6271),s(7621),s(6848),s(5539);let c="http://localhost:20128";function m({showPasswordModal:e,sudoPassword:t,dispatch:s,loading:r,modalError:l,handleConfirmPassword:i,port443Conflict:n,handleKillAndStart:d}){return(0,a.jsxs)(a.Fragment,{children:[e&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,a.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and server startup"})]}),(0,a.jsx)(o.Input,{type:"password",placeholder:"Enter sudo password",value:t,onChange:e=>s({sudoPassword:e.target.value}),onKeyDown:e=>{"Enter"!==e.key||r||i()}}),l&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,a.jsx)("span",{children:l})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)(o.Button,{variant:"ghost",size:"sm",onClick:()=>{s({showPasswordModal:!1}),s({sudoPassword:""}),s({modalError:null})},disabled:r,children:"Cancel"}),(0,a.jsx)(o.Button,{variant:"primary",size:"sm",onClick:i,loading:r,children:"Confirm"})]})]})}),n&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,a.jsx)("h3",{className:"font-semibold text-text-main",children:"Port 443 Already In Use"}),(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1 text-xs text-text-muted",children:[(0,a.jsx)("p",{children:"Port 443 is currently used by another process:"}),(0,a.jsxs)("p",{className:"font-mono text-text-main","data-i18n-skip":"true",children:[n.owner.name," (PID ",n.owner.pid,")"]}),(0,a.jsx)("p",{children:"Kill this process to start MITM Server?"})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)(o.Button,{variant:"ghost",size:"sm",onClick:()=>{s({port443Conflict:null}),s({loading:!1})},disabled:r,children:"Cancel"}),(0,a.jsx)(o.Button,{variant:"primary",size:"sm",onClick:d,loading:r,children:"Kill & Start"})]})]})})]})}function x({apiKeys:e,cloudEnabled:t,onStatusChange:s}){let[l,i]=(0,r.useReducer)((e,t)=>({...e,...t}),{status:null,loading:!1,showPasswordModal:!1,sudoPassword:"",pendingAction:null,modalError:null,actionError:null,mitmRouterBaseUrl:c,port443Conflict:null}),{status:n,loading:d,showPasswordModal:u,sudoPassword:p,pendingAction:h,modalError:f,actionError:g,mitmRouterBaseUrl:y,port443Conflict:b}=l,[j,w]=(0,r.useState)(()=>e?.[0]?.key||""),v=n?.isWin===!0,N=v||n?.hasCachedPassword||n?.needsSudoPassword===!1,S=n?.isAdmin!==!1;!S&&(v||n?.hasCachedPassword||n?.needsSudoPassword);let k=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm");if(e.ok){let t=await e.json();i({status:t}),t.mitmRouterBaseUrl&&i({mitmRouterBaseUrl:t.mitmRouterBaseUrl}),s?.(t)}}catch{i({status:{running:!1,certExists:!1,dnsStatus:{}}})}},[s]);(0,r.useEffect)(()=>{queueMicrotask(()=>{k()})},[k]);let C=e=>{i({actionError:null}),n&&(N?E(e,""):(i({pendingAction:e}),i({showPasswordModal:!0}),i({modalError:null})))},E=async(s,a,r=!1)=>{i({loading:!0}),i({actionError:null});try{let l;if("trust-cert"===s)l=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"trust-cert",sudoPassword:a})});else if("start"===s){let s=j?.trim()||(e?.length>0?e[0].key:null)||(t?null:"sk_9router");l=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:s,sudoPassword:a,mitmRouterBaseUrl:y.trim()||c,forceKillPort443:r})})}else l=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:a})});if(!l.ok){let e=await l.json().catch(()=>({}));if("PORT_443_BUSY"===e.code&&e.portOwner){i({showPasswordModal:!1}),i({port443Conflict:{owner:e.portOwner,password:a}});return}i({actionError:e.error||`Failed to ${s} MITM server`});return}i({showPasswordModal:!1}),i({sudoPassword:""}),i({port443Conflict:null}),await k()}catch(e){i({actionError:e.message||"Network error"})}finally{i({loading:!1}),i({pendingAction:null})}},T=n?.running;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Card,{padding:"sm",className:"border-primary/20 bg-primary/5",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"security"}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"MITM Server"}),T?(0,a.jsx)(o.Badge,{variant:"success",size:"sm",children:"Running"}):(0,a.jsx)(o.Badge,{variant:"default",size:"sm",children:"Stopped"})]}),(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-1 text-xs text-text-muted","data-i18n-skip":"true",children:[{label:"Cert",ok:n?.certExists},{label:"Trusted",ok:n?.certTrusted},{label:"Server",ok:T}].map(({label:e,ok:t})=>(0,a.jsxs)("span",{className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded ${t?"text-green-600":"text-text-muted"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:t?"check_circle":"cancel"}),e]},e))})]}),(0,a.jsxs)("div",{className:"px-2 py-2 rounded-lg bg-surface/50 border border-border/50 flex flex-col gap-2",children:[(0,a.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:"Purpose:"})," Use Antigravity IDE & GitHub Copilot → with ANY provider/model from VansAI"]}),(0,a.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Antigravity/Copilot IDE request → DNS redirect to localhost:443 → MITM proxy intercepts → VansAI → response to Antigravity/Copilot"]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"VansAI Base URL"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:y,onChange:e=>i({mitmRouterBaseUrl:e.target.value}),placeholder:c,disabled:T,"aria-label":"VansAI Base URL",className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50 disabled:opacity-50"})]}),!T&&(0,a.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",list:"mitm-api-keys",value:j,onChange:e=>w(e.target.value),placeholder:t?"Enter or pick API key":"sk_9router (default)","aria-label":"API Key",className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50"}),e?.length>0&&(0,a.jsx)("datalist",{id:"mitm-api-keys",children:e.map(e=>(0,a.jsx)("option",{value:e.key,children:e.name||e.key},e.id))})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center","data-i18n-skip":"true",children:[n?.certExists&&!n?.certTrusted&&(0,a.jsxs)("button",{type:"button",onClick:()=>C("trust-cert"),disabled:d,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-4 py-2 text-xs font-medium text-yellow-600 transition-colors hover:bg-yellow-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"verified_user"}),"Trust Cert"]}),T?(0,a.jsxs)("button",{type:"button",onClick:()=>C("stop"),disabled:d,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop Server"]}):(0,a.jsxs)("button",{type:"button",onClick:()=>C("start"),disabled:d||!n||v&&!S,title:v&&!S?"Administrator required":void 0,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start Server"]}),T&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),g&&(0,a.jsxs)("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5 shrink-0",children:"error"}),(0,a.jsx)("span",{children:g})]}),v&&!S&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 border border-red-500/20",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"shield_lock"}),(0,a.jsx)("span",{children:"Administrator required — restart VansAI as Administrator to use MITM"})]})]})}),(0,a.jsx)(m,{showPasswordModal:u,sudoPassword:p,dispatch:i,loading:d,modalError:f,handleConfirmPassword:()=>{p.trim()?E(h,p):i({modalError:"Sudo password is required"})},port443Conflict:b,handleKillAndStart:()=>{E("start",b?.password||"",!0)}})]})}var u=s(7853);let p={},h={};function f({dnsActive:e,handleDnsToggle:t,handleMappingBlur:s,handleModelMappingChange:r,hasActiveProviders:l,loading:i,mitmHosts:n,modelMappings:o,openModelSelector:d,saveMappings:c,serverRunning:m,tool:x,warning:u}){return(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[n.length>0&&(0,a.jsxs)("div",{className:"mt-2 rounded-md border border-border bg-surface/50 px-2 py-1.5",children:[(0,a.jsx)("p",{className:"text-[10px] font-medium tracking-wide text-text-main/80 mb-1",children:"Edit hosts file manually to add the following entries:"}),(0,a.jsx)("ul",{className:"list-none space-y-0.5 font-mono text-[10px] text-text-muted break-all",children:n.map(e=>(0,a.jsxs)("li",{children:["127.0.0.1 ",e]},e))})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted px-1",children:[(0,a.jsxs)("p",{children:["Toggle DNS to redirect ",x.name," traffic through VansAI via MITM."]}),!e&&(0,a.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),x.defaultModels?.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-2",children:x.defaultModels.map(t=>(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[9rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right",children:t.name}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,a.jsx)("input",{type:"text",value:o[t.alias]||"",onChange:e=>r(t.alias,e.target.value),onBlur:e=>s(t.alias,e.target.value),"aria-label":"Model ID",placeholder:"provider/model-id",disabled:!e,className:`w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5 ${!e?"opacity-50 cursor-not-allowed":""}`}),o[t.alias]&&(0,a.jsx)("button",{type:"button",onClick:()=>{r(t.alias,""),c({...o,[t.alias]:""})},className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,a.jsx)("button",{type:"button",onClick:()=>d(t.alias),disabled:!l||!e,className:`rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 ${l&&e?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]},t.alias))}),x.defaultModels?.length===0&&(0,a.jsx)("p",{className:"text-xs text-text-muted px-1",children:"Model mappings will be available soon."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:items-start",children:[e?(0,a.jsxs)("button",{type:"button",onClick:t,disabled:!m||i,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop DNS"]}):(0,a.jsxs)("button",{type:"button",onClick:t,disabled:!m||i,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start DNS"]}),u&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs text-amber-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,a.jsx)("span",{children:u})]})]})]})}function g({tool:e,status:{isExpanded:t,hasCachedPassword:s,needsSudoPassword:l,isWin:i}=h,onToggle:n,serverRunning:c,dnsActive:m,apiKeys:x,activeProviders:y,hasActiveProviders:b,modelAliases:j=p,cloudEnabled:w,onDnsChange:v}){let[N,S]=(0,r.useState)(!1),[k,C]=(0,r.useState)(null),[E,T]=(0,r.useState)(!1),[P,_]=(0,r.useState)(""),[A,M]=(0,r.useState)(null),[I,O]=(0,r.useState)(null),[z,B]=(0,r.useState)({}),[D,R]=(0,r.useState)(!1),[U,K]=(0,r.useState)(null),q=u.TOOL_HOSTS[e.id]??[],L=i||s||!1===l,H=(0,r.useCallback)(async()=>{try{let t=await fetch(`/api/cli-tools/antigravity-mitm/alias?tool=${e.id}`);if(t.ok){let e=await t.json();Object.keys(e.aliases||{}).length>0&&B(e.aliases)}}catch{}},[e.id]),$=(0,r.useRef)(!1),V=(0,r.useCallback)(async()=>{$.current||($.current=!0,await H())},[H]);(0,r.useCallback)(()=>{t||V(),n()},[t,V,n]),(0,r.useEffect)(()=>{V()},[V]);let F=(0,r.useCallback)(async t=>{try{await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:e.id,mappings:t})})}catch{}},[e.id]),J=async(t,s)=>{S(!0),C(null);try{let a=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:e.id,action:t,sudoPassword:s})}),r=await a.json();if(!a.ok)throw Error(r.error||"Failed to toggle DNS");"enable"===t&&C(`Restart ${e.name} to apply changes`),T(!1),_(""),v?.(r)}catch{}finally{S(!1),M(null)}},Y=()=>{P.trim()?J(A,P):O("Sudo password is required")};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(o.Card,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",className:"flex w-full items-start justify-between gap-3 hover:cursor-pointer sm:items-center text-left",onClick:n,"aria-expanded":t,"aria-label":"Toggle section",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(d.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(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)("h3",{className:"font-medium text-sm",children:e.name}),c?m?(0,a.jsx)(o.Badge,{variant:"success",size:"sm",children:"Active"}):(0,a.jsx)(o.Badge,{variant:"warning",size:"sm",children:"DNS off"}):(0,a.jsx)(o.Badge,{variant:"default",size:"sm",children:"Server off"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted sm:truncate",children:["Intercept ",e.name," requests via MITM proxy"]})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsx)(f,{dnsActive:m,handleDnsToggle:()=>{if(!c)return;let e=m?"disable":"enable";L?J(e,""):(M(e),T(!0),O(null))},handleMappingBlur:(e,t)=>{F({...z,[e]:t})},handleModelMappingChange:(e,t)=>{B(s=>({...s,[e]:t}))},hasActiveProviders:b,loading:N,mitmHosts:q,modelMappings:z,openModelSelector:e=>{K(e),R(!0)},saveMappings:F,serverRunning:c,tool:e,warning:k})]}),E&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,a.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Required to modify /etc/hosts and flush DNS cache"})]}),(0,a.jsx)(o.Input,{type:"password",placeholder:"Enter sudo password",value:P,onChange:e=>_(e.target.value),onKeyDown:e=>{"Enter"!==e.key||N||Y()}}),I&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,a.jsx)("span",{children:I})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)(o.Button,{variant:"ghost",size:"sm",onClick:()=>{T(!1),_(""),O(null)},disabled:N,children:"Cancel"}),(0,a.jsx)(o.Button,{variant:"primary",size:"sm",onClick:Y,loading:N,children:"Confirm"})]})]})}),(0,a.jsx)(o.ModelSelectModal,{isOpen:D,onClose:()=>R(!1),onSelect:e=>{if(!U||e.isPlaceholder)return;let t={...z,[U]:e.value};B(t),F(t)},selectedModel:U?z[U]:null,activeProviders:y,modelAliases:j,title:`Select model for ${U}`})]})}function y(e,t){switch(t.type){case"SET_CONNECTIONS":return{...e,connections:t.value};case"SET_API_KEYS":return{...e,apiKeys:t.value};case"SET_ALIASES":return{...e,modelAliases:t.value};case"SET_CLOUD":return{...e,cloudEnabled:t.value};case"SET_MITM_STATUS":return{...e,mitmStatus:t.value};default:return e}}function b(){let[e,t]=(0,r.useReducer)(y,{connections:[],apiKeys:[],modelAliases:{},cloudEnabled:!1,mitmStatus:{running:!1,certExists:!1,dnsStatus:{},hasCachedPassword:!1}}),{connections:s,apiKeys:o,modelAliases:d,cloudEnabled:c,mitmStatus:m}=e,[u,p]=(0,r.useState)(null);(0,r.useEffect)(()=>{h(),f(),b(),j()},[]);let h=async()=>{try{let e=await fetch("/api/providers");if(e.ok){let s=await e.json();t({type:"SET_CONNECTIONS",value:s.connections||[]})}}catch{}},f=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let s=await e.json();t({type:"SET_API_KEYS",value:s.keys||[]})}}catch{}},b=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let s=await e.json();t({type:"SET_ALIASES",value:s.aliases||{}})}}catch{}},j=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let s=await e.json();t({type:"SET_CLOUD",value:s.cloudEnabled||!1})}}catch{}},w=()=>s.filter(e=>!1!==e.isActive),v=Object.entries(l.w);return(0,a.jsxs)("div",{className:"flex w-full flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex items-start 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:"⚠️ MITM intercepts HTTPS traffic of IDE tools (Antigravity, GitHub Copilot, Kiro) via local CA to redirect requests to your providers. May violate ToS → account ban. Use at your own risk."})]}),(0,a.jsx)(x,{apiKeys:o,cloudEnabled:c,onStatusChange:e=>t({type:"SET_MITM_STATUS",value:e})}),(0,a.jsx)("div",{className:"grid gap-3 sm:gap-4",children:v.map(([e,s])=>(0,a.jsx)(g,{tool:s,status:{isExpanded:u===e,hasCachedPassword:m.hasCachedPassword||!1,needsSudoPassword:!1!==m.needsSudoPassword,isWin:!0===m.isWin},onToggle:()=>p(u===e?null:e),serverRunning:m.running,dnsActive:m.dnsStatus?.[e]||!1,apiKeys:o,activeProviders:w(),hasActiveProviders:w().some(e=>(0,i.KC)(e.provider).length>0||(0,n.mq)(e.provider)||(0,n.gb)(e.provider)),modelAliases:d,cloudEnabled:c,onDnsChange:e=>t({type:"SET_MITM_STATUS",value:{...m,dnsStatus:e.dnsStatus??m.dnsStatus}})},e))})]})}s(3895),s(2846)},1232:(e,t,s)=>{Promise.resolve().then(s.bind(s,581))},3895:(e,t,s)=>{"use strict";s.d(t,{A:()=>o});var a=s(5102),r=s(3885),l=s.n(r),i=s(497),n=s(7837);function o({tool:e}){return(0,a.jsx)(l(),{href:"/dashboard/mitm",className:"block",children:(0,a.jsx)(i.Card,{padding:"sm",className:"overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(n.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-purple-500/10 text-purple-600 dark:text-purple-400 rounded-full",children:"MITM"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"chevron_right"})]})})})}},7853:e=>{"use strict";e.exports={TOOL_HOSTS:{antigravity:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com"],copilot:["api.individual.githubcopilot.com"],kiro:["runtime.us-east-1.kiro.dev","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"],cursor:["api2.cursor.sh"]}}}},e=>{e.O(0,[2554,7418,3885,9458,9814,4385,497,3700,5316,2147,3204,7358],()=>e(e.s=1232)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{},_=>{_.O(0,[2554,7418,3885,9458,9814,4385,497,9131,2147,3204,7358],()=>_(_.s=1512)),_N_E=_.O()}]);
|
package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-7dae224f46195dd1.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3471],{3203:(e,t,s)=>{Promise.resolve().then(s.bind(s,5971))},5971:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var a=s(5102),r=s(2030),o=s(497),i=s(7665),l=s(8657),n=s(9526),d=s(3916),c=s(1434),m=s(238),x=s(4104);function u(){let{theme:e,setTheme:t,isDark:s}=(0,n.D)(),[u,p]=(0,r.useState)("en"),[h,b]=(0,r.useState)(!1),[g,y]=(0,r.useState)(!1),[f,j]=(0,r.useState)(!1),[w,N]=(0,r.useState)({fallbackStrategy:"fill-first"}),[v,C]=(0,r.useState)(!0),[k,S]=(0,r.useState)({current:"",new:"",confirm:""}),[I,P]=(0,r.useState)({type:"",message:""}),[O,L]=(0,r.useState)(!1),[R,T]=(0,r.useState)(!1),[D,U]=(0,r.useState)({type:"",message:""}),[A,E]=(0,r.useState)({open:!1,mode:"",password:""}),F=(0,r.useRef)(null),[M,q]=(0,r.useState)({authMode:"password",oidcIssuerUrl:"",oidcClientId:"",oidcScopes:"openid profile email",oidcLoginLabel:"Sign in with OIDC"}),[B,J]=(0,r.useState)(""),[$,_]=(0,r.useState)({type:"",message:""}),[H,K]=(0,r.useState)(!1),[z,W]=(0,r.useState)(!1),[Q,G]=(0,r.useState)({type:"",message:""}),[V,Y]=(0,r.useState)("/api/auth/oidc/callback"),[X,Z]=(0,r.useState)(!1),ee=(0,r.useRef)(null),[et,es]=(0,r.useState)({outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:""}),[ea,er]=(0,r.useState)({type:"",message:""}),[eo,ei]=(0,r.useState)(!1),[el,en]=(0,r.useState)(!1);(0,r.useEffect)(()=>{p(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${m.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,m.QC)(t)}())},[h]),(0,r.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{N(e),q({authMode:e?.authMode||"password",oidcIssuerUrl:e?.oidcIssuerUrl||"",oidcClientId:e?.oidcClientId||"",oidcScopes:e?.oidcScopes||"openid profile email",oidcLoginLabel:e?.oidcLoginLabel||"Sign in with OIDC"}),J(""),(e?.authMode==="oidc"||e?.authMode==="both")&&Z(!0),es({outboundProxyEnabled:e?.outboundProxyEnabled===!0,outboundProxyUrl:e?.outboundProxyUrl||"",outboundNoProxy:e?.outboundNoProxy||""}),C(!1)}).catch(e=>{console.error("Failed to fetch settings:",e),C(!1)})},[]),(0,r.useEffect)(()=>{Y(`${window.location.origin}/api/auth/oidc/callback`)},[]);let ed=async e=>{if(e.preventDefault(),!0===w.outboundProxyEnabled){ei(!0),er({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyUrl:et.outboundProxyUrl,outboundNoProxy:et.outboundNoProxy})}),t=await e.json();e.ok?(N(e=>({...e,...t})),er({type:"success",message:"Proxy settings applied"})):er({type:"error",message:t.error||"Failed to update proxy settings"})}catch(e){er({type:"error",message:"An error occurred"})}finally{ei(!1)}}},ec=async()=>{if(!0!==w.outboundProxyEnabled)return;let e=(et.outboundProxyUrl||"").trim();if(!e)return void er({type:"error",message:"Please enter a Proxy URL to test"});en(!0),er({type:"",message:""});try{let t=await fetch("/api/settings/proxy-test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyUrl:e})}),s=await t.json();t.ok&&s?.ok?er({type:"success",message:`Proxy test OK (${s.status}) in ${s.elapsedMs}ms`}):er({type:"error",message:s?.error||"Proxy test failed"})}catch(e){er({type:"error",message:"An error occurred"})}finally{en(!1)}},em=async e=>{ei(!0),er({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?(N(e=>({...e,...s})),es(e=>({...e,outboundProxyEnabled:s?.outboundProxyEnabled===!0})),er({type:"success",message:e?"Proxy enabled":"Proxy disabled"})):er({type:"error",message:s.error||"Failed to update proxy settings"})}catch(e){er({type:"error",message:"An error occurred"})}finally{ei(!1)}},ex=async e=>{if(e.preventDefault(),k.new!==k.confirm)return void P({type:"error",message:"Passwords do not match"});L(!0),P({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:k.current,newPassword:k.new})}),t=await e.json();e.ok?(P({type:"success",message:"Password updated successfully"}),S({current:"",new:"",confirm:""})):P({type:"error",message:t.error||"Failed to update password"})}catch(e){P({type:"error",message:"An error occurred"})}finally{L(!1)}},eu=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fallbackStrategy:e})})).ok&&N(t=>({...t,fallbackStrategy:e}))}catch(e){console.error("Failed to update settings:",e)}},ep=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategy:e})})).ok&&N(t=>({...t,comboStrategy:e}))}catch(e){console.error("Failed to update combo strategy:",e)}},eh=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&&N(e=>({...e,stickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update sticky limit:",e)}},eb=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&&N(e=>({...e,comboStickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update combo sticky limit:",e)}},eg=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&N(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},ey=(e,t)=>{q(s=>({...s,[e]:t}))},ef=async(e=M.authMode||"password")=>{let t=M.oidcIssuerUrl.trim(),s=M.oidcClientId.trim(),a=M.oidcScopes.trim(),r=M.oidcLoginLabel.trim(),o=B.trim();if("password"!==e&&(!t||!s||!o)&&!w.oidcConfigured)return void _({type:"error",message:"Issuer URL, client ID, and client secret are required to enable OIDC."});K(!0),_({type:"",message:""}),G({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?(N(e=>({...e,...n})),q({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"}),J(""),_({type:"success",message:"oidc"===e?"OIDC login enabled":"both"===e?"Password and OIDC login enabled":"OIDC settings saved"})):_({type:"error",message:n.error||"Failed to save OIDC settings"})}catch(e){_({type:"error",message:"An error occurred"})}finally{K(!1)}},ej=async()=>{let e=M.oidcIssuerUrl.trim(),t=M.oidcClientId.trim(),s=M.oidcScopes.trim(),a=B.trim();if(!e||!t)return void G({type:"error",message:"Issuer URL and client ID are required to test the connection."});W(!0),_({type:"",message:""}),G({type:"",message:""});try{let r=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({authMode:M.authMode||w.authMode||"password",oidcIssuerUrl:e,oidcClientId:t,oidcScopes:s||"openid profile email",oidcLoginLabel:M.oidcLoginLabel.trim()||"Sign in with OIDC",...a?{oidcClientSecret:a}:{}})}),o=await r.json().catch(()=>({}));if(!r.ok)return void G({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}.`;G({type:"success",message:e})}else G({type:"error",message:l.error||"OIDC connection test failed"})}catch(e){G({type:"error",message:"An error occurred"})}finally{W(!1)}},ew=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enableObservability:e})})).ok&&N(t=>({...t,enableObservability:e}))}catch(e){console.error("Failed to update enableObservability:",e)}},eN=async()=>{try{let e=await fetch("/api/settings");if(!e.ok)return;let t=await e.json();N(t)}catch(e){console.error("Failed to reload settings:",e)}},ev=async e=>{T(!0),U({type:"",message:""});try{let t=await fetch("/api/settings/database",{headers:{"x-9r-password":e}});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||"Failed to export database")}let s=await t.json(),a=JSON.stringify(s,null,2),r=new Blob([a],{type:"application/json"}),o=URL.createObjectURL(r),i=document.createElement("a"),l=new Date().toISOString().replace(/[.:]/g,"-");i.href=o,i.download=`9router-backup-${l}.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o),U({type:"success",message:"Database backup downloaded"})}catch(e){U({type:"error",message:e.message||"Failed to export database"})}finally{T(!1)}},eC=async e=>{let t=F.current;if(t){T(!0);try{let s=await t.text(),a=JSON.parse(s),r=await fetch("/api/settings/database",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...a,password:e})}),o=await r.json().catch(()=>({}));if(!r.ok)throw Error(o.error||"Failed to import database");await eN(),U({type:"success",message:"Database imported successfully"})}catch(e){U({type:"error",message:e.message||"Invalid backup file"})}finally{F.current=null,T(!1)}}},ek=async()=>{let{mode:e,password:t}=A;E({open:!1,mode:"",password:""}),"export"===e?await ev(t):"import"===e&&await eC(t)},eS=!0===w.enableObservability,eI=async()=>{j(!0);try{await fetch("/api/version/shutdown",{method:"POST"})}catch(e){}j(!1),y(!1)},eP=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&window.location.assign("/login")}catch(e){console.error("Failed to logout:",e)}};return(0,a.jsxs)("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.Card,{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,d.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:"~/.9router/db/data.sqlite"})]})}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,a.jsx)(o.Button,{variant:"secondary",icon:"download",onClick:()=>E({open:!0,mode:"export",password:""}),loading:R,className:"w-full sm:w-auto",children:"Download Backup"}),(0,a.jsx)(o.Button,{variant:"outline",icon:"upload",onClick:()=>ee.current?.click(),disabled:R,className:"w-full sm:w-auto",children:"Import Backup"}),(0,a.jsx)("input",{ref:ee,type:"file",accept:"application/json,.json",className:"hidden",onChange:e=>{let t=e.target.files?.[0];ee.current&&(ee.current.value=""),t&&(F.current=t,U({type:"",message:""}),E({open:!0,mode:"import",password:""}))}})]}),D.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===D.type?"text-red-500":"text-green-600 dark:text-green-400"}`,children:D.message})]})]}),(0,a.jsxs)(o.Card,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg bg-blue-500/10 text-blue-500 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"language"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Language"})]}),(0,a.jsxs)("button",{onClick:()=>b(!0),className:"flex items-center justify-between w-full p-3 rounded-lg bg-bg border border-border hover:border-primary/50 transition-colors","data-i18n-skip":"true",children:[(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Display language"}),(0,a.jsx)("span",{className:"text-2xl",children:x.h[u]||"\uD83C\uDF10"})]})]}),(0,a.jsxs)(o.Card,{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.Toggle,{checked:!0===w.requireLogin,onChange:()=>eg(!w.requireLogin),disabled:v})]}),!0===w.requireLogin&&(0,a.jsxs)("form",{onSubmit:ex,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[w.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.Input,{type:"password",placeholder:"Enter current password",value:k.current,onChange:e=>S({...k,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.Input,{type:"password",placeholder:"Enter new password",value:k.new,onChange:e=>S({...k,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.Input,{type:"password",placeholder:"Confirm new password",value:k.confirm,onChange:e=>S({...k,confirm:e.target.value}),required:!0})]})]}),I.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===I.type?"text-red-500":"text-green-500"}`,children:I.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(o.Button,{type:"submit",variant:"primary",loading:O,className:"w-full sm:w-auto",children:w.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsxs)(o.Card,{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>Z(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"===w.authMode?"OIDC active":"both"===w.authMode?"Password + OIDC active":"Optional SSO via Authentik/Keycloak/Google"})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted shrink-0",children:X?"expand_less":"expand_more"})]}),X&&(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=M.authMode===e.value;return(0,a.jsxs)("button",{type:"button",onClick:()=>ey("authMode",e.value),className:(0,d.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:v||H,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.Input,{placeholder:"https://auth.example.com/application/o/9router/",value:M.oidcIssuerUrl,onChange:e=>ey("oidcIssuerUrl",e.target.value),disabled:v||H})]}),(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.Input,{placeholder:"9router-dashboard",value:M.oidcClientId,onChange:e=>ey("oidcClientId",e.target.value),disabled:v||H})]}),(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.Input,{type:"password",placeholder:"Leave blank to keep existing secret",value:B,onChange:e=>J(e.target.value),disabled:v||H}),(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.Input,{placeholder:"openid profile email",value:M.oidcScopes,onChange:e=>ey("oidcScopes",e.target.value),disabled:v||H})]}),(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.Input,{placeholder:"Sign in with OIDC",value:M.oidcLoginLabel,onChange:e=>ey("oidcLoginLabel",e.target.value),disabled:v||H})]})]}),(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:V})]}),(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.Button,{type:"button",variant:"primary",loading:H,onClick:()=>ef(),className:"w-full sm:w-auto",children:"Save auth mode"}),(0,a.jsx)(o.Button,{type:"button",variant:"outline",loading:z,onClick:ej,className:"w-full sm:w-auto",children:"Test connection"})]}),Q.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===Q.type?"text-red-500":"text-green-500"}`,children:Q.message}),$.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===$.type?"text-red-500":"text-green-500"}`,children:$.message}),"oidc"===w.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"===w.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.Card,{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.Toggle,{checked:"round-robin"===w.fallbackStrategy,onChange:()=>eu("round-robin"===w.fallbackStrategy?"fill-first":"round-robin"),disabled:v})]}),"round-robin"===w.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.Input,{type:"number",min:"1",max:"10",value:w.stickyRoundRobinLimit||3,onChange:e=>eh(e.target.value),disabled:v,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.Toggle,{checked:"round-robin"===w.comboStrategy,onChange:()=>ep("round-robin"===w.comboStrategy?"fallback":"round-robin"),disabled:v})]}),"round-robin"===w.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.Input,{type:"number",min:"1",max:"100",value:w.comboStickyRoundRobinLimit||1,onChange:e=>eb(e.target.value),disabled:v,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"===w.fallbackStrategy?`Currently distributing requests across all available accounts with ${w.stickyRoundRobinLimit||3} calls per account.`:"Currently using accounts in priority order (Fill First).","round-robin"===w.comboStrategy?` Combos rotate after ${w.comboStickyRoundRobinLimit||1} call${1===(w.comboStickyRoundRobinLimit||1)?"":"s"} per model.`:" Combos always start with their first model."]})]})]}),(0,a.jsxs)(o.Card,{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.Toggle,{checked:!0===w.outboundProxyEnabled,onChange:()=>em(!0!==w.outboundProxyEnabled),disabled:v||eo})]}),!0===w.outboundProxyEnabled&&(0,a.jsxs)("form",{onSubmit:ed,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.Input,{placeholder:"http://127.0.0.1:7897",value:et.outboundProxyUrl,onChange:e=>es(t=>({...t,outboundProxyUrl:e.target.value})),disabled:v||eo}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Leave empty to inherit existing env proxy (if any)."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"No Proxy"}),(0,a.jsx)(o.Input,{placeholder:"localhost,127.0.0.1",value:et.outboundNoProxy,onChange:e=>es(t=>({...t,outboundNoProxy:e.target.value})),disabled:v||eo}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Comma-separated hostnames/domains to bypass the proxy."})]}),(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.Button,{type:"button",variant:"secondary",loading:el,disabled:v||eo,onClick:ec,className:"w-full sm:w-auto",children:"Test proxy URL"}),(0,a.jsx)(o.Button,{type:"submit",variant:"primary",loading:eo,className:"w-full sm:w-auto",children:"Apply"})]})]}),ea.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===ea.type?"text-red-500":"text-green-500"} pt-2 border-t border-border/50`,children:ea.message})]})]}),(0,a.jsxs)(o.Card,{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.Toggle,{checked:eS,onChange:ew,disabled:v})]})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,a.jsx)(o.Button,{variant:"outline",fullWidth:!0,icon:"power_settings_new",onClick:()=>y(!0),className:"text-red-500 border-red-200 hover:bg-red-50 hover:border-red-300",children:"Shutdown"}),(0,a.jsx)(o.Button,{variant:"outline",fullWidth:!0,icon:"logout",onClick:eP,children:"Logout"})]}),(0,a.jsxs)("div",{className:"text-center text-xs sm:text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[c.vQ.name," v",c.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:"Local Mode - All data stored on your machine"})]})]}),(0,a.jsx)(l.A,{hideTrigger:!0,isOpen:h,onClose:e=>{b(!1),p(e)}}),(0,a.jsx)(i.u,{isOpen:g,onClose:()=>y(!1),onConfirm:eI,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:f}),(0,a.jsxs)(i.A,{isOpen:A.open,onClose:()=>E({open:!1,mode:"",password:""}),title:"Confirm Password",size:"sm",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Button,{variant:"ghost",onClick:()=>E({open:!1,mode:"",password:""}),disabled:R,children:"Cancel"}),(0,a.jsx)(o.Button,{variant:"primary",onClick:ek,loading:R,disabled:!A.password,children:"Confirm"})]}),children:[(0,a.jsxs)("p",{className:"text-text-muted mb-3 text-sm",children:["Enter your current password to ","export"===A.mode?"export":"import"," the database."]}),(0,a.jsx)(o.Input,{type:"password",value:A.password,onChange:e=>E(t=>({...t,password:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&A.password&&ek()},placeholder:"Current password",autoFocus:!0})]})]})}}},e=>{e.O(0,[2554,7418,3885,9458,9814,4385,497,2147,3204,7358],()=>e(e.s=3203)),_N_E=e.O()}]);
|