polyrouter 1.0.4 → 1.0.6
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 +67 -85
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +12 -12
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
- 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 +4 -4
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/pxpipe/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
- 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/realtime/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/realtime/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/realtime/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
- 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 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
- 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 +1 -1
- 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.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 +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- 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 +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
- 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 +8 -8
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +8 -8
- 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 +8 -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/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/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/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/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/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/reset-password/route.js.nft.json +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/cli-tools/all-statuses/route.js +9 -9
- 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/antigravity-mitm/alias/route.js +2 -2
- 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/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/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/cline-settings/route.js +1 -1
- 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/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/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/cowork-mcp-registry/route.js +2 -2
- 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-tools/route.js +1 -1
- 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-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/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/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/grok-build-settings/route.js +5 -5
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
- 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/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/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/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/opencode-settings/route.js +1 -1
- 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/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/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +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/status/route.js.nft.json +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/health/route.js.nft.json +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/keys/[id]/route.js.nft.json +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/locale/route.js.nft.json +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]/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/media-providers/tts/deepgram/voices/route.js.nft.json +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/inworld/voices/route.js.nft.json +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/voices/route.js.nft.json +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/availability/route.js.nft.json +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/disabled/route.js.nft.json +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/test/route.js.nft.json +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/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/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/cursor/auto-import/route.js.nft.json +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/gitlab/pat/route.js.nft.json +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/kiro/api-key/route.js.nft.json +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/import/route.js.nft.json +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/social-authorize/route.js.nft.json +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/pricing/route.js.nft.json +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/route.js.nft.json +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/providers/[id]/models/route.js.nft.json +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]/test/route.js.nft.json +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/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/kilo/free-models/route.js.nft.json +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/suggested-models/route.js.nft.json +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/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/proxy-pools/[id]/route.js.nft.json +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/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
- 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/route.js.nft.json +1 -1
- 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/pxpipe/health/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/realtime/authorize/route.js +1 -1
- package/app/.next-cli-build/server/app/api/realtime/authorize/route.js.nft.json +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/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/require-login/route.js.nft.json +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/shutdown/route.js.nft.json +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/translator/console-logs/route.js.nft.json +1 -1
- 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/load/route.js.nft.json +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/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/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/tunnel/disable/route.js.nft.json +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/status/route.js.nft.json +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-disable/route.js.nft.json +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-install/route.js +1 -1
- 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/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]/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/chart/route.js.nft.json +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/logs/route.js.nft.json +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/request-details/route.js.nft.json +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/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +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/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/transcriptions/route.js.nft.json +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/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/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/images/generations/route.js +1 -1
- 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/messages/count_tokens/route.js.nft.json +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/models/[kind]/route.js.nft.json +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/route.js.nft.json +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/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/route.js.nft.json +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/videos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +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/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/route.js.nft.json +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/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/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/callback/page.js +1 -1
- 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 +8 -8
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +8 -8
- 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 +8 -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 +1 -1
- 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 +10 -10
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +10 -10
- 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 +8 -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 +10 -10
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +10 -10
- 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 +8 -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 +10 -10
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +10 -10
- 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 +8 -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 +10 -10
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +10 -10
- 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 +8 -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 +10 -10
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +10 -10
- 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 +8 -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 +10 -10
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +10 -10
- 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 +8 -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 +10 -10
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +10 -10
- 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 +8 -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 +10 -10
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +10 -10
- 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 +8 -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 +10 -10
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +10 -10
- 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 +8 -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 +10 -10
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +10 -10
- 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 +8 -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/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/pxpipe.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 +11 -11
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +11 -11
- 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 +8 -8
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/realtime.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/realtime.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/realtime.segments/!KGRhc2hib2FyZCk/dashboard/realtime/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/realtime.segments/!KGRhc2hib2FyZCk/dashboard/realtime.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/realtime.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/realtime.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/realtime.segments/_full.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/realtime.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/realtime.segments/_index.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/realtime.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
- 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 +8 -8
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +8 -8
- 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 +8 -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 +1 -1
- 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 +10 -10
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +10 -10
- 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 +8 -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 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +10 -10
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +10 -10
- 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 +8 -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 +10 -10
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +10 -10
- 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 +8 -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 +10 -10
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +10 -10
- 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 +8 -8
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +8 -8
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing/page.js +1 -1
- 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 +9 -9
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +9 -9
- 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 +8 -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 +1 -1
- 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 +9 -9
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +9 -9
- 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 +8 -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.nft.json +1 -1
- package/app/.next-cli-build/server/app/page.js +1 -1
- package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +12 -12
- package/app/.next-cli-build/server/chunks/1220.js +1 -1
- package/app/.next-cli-build/server/chunks/1455.js +1 -0
- package/app/.next-cli-build/server/chunks/1605.js +1 -0
- package/app/.next-cli-build/server/chunks/2112.js +1 -1
- package/app/.next-cli-build/server/chunks/2194.js +1 -1
- package/app/.next-cli-build/server/chunks/238.js +1 -1
- package/app/.next-cli-build/server/chunks/318.js +2 -2
- package/app/.next-cli-build/server/chunks/3535.js +1 -1
- package/app/.next-cli-build/server/chunks/3726.js +1 -1
- package/app/.next-cli-build/server/chunks/3943.js +1 -1
- package/app/.next-cli-build/server/chunks/412.js +1 -1
- package/app/.next-cli-build/server/chunks/4123.js +3 -3
- package/app/.next-cli-build/server/chunks/4293.js +1 -0
- package/app/.next-cli-build/server/chunks/4433.js +1 -0
- package/app/.next-cli-build/server/chunks/4884.js +1 -1
- package/app/.next-cli-build/server/chunks/4930.js +1 -0
- package/app/.next-cli-build/server/chunks/5612.js +1 -1
- package/app/.next-cli-build/server/chunks/5615.js +1 -1
- package/app/.next-cli-build/server/chunks/6805.js +3 -3
- package/app/.next-cli-build/server/chunks/6922.js +1 -0
- package/app/.next-cli-build/server/chunks/7807.js +1 -1
- package/app/.next-cli-build/server/chunks/{3850.js → 8008.js} +1 -1
- package/app/.next-cli-build/server/chunks/8038.js +19 -19
- package/app/.next-cli-build/server/chunks/8145.js +1 -1
- package/app/.next-cli-build/server/chunks/8185.js +1 -0
- package/app/.next-cli-build/server/chunks/8251.js +2 -2
- package/app/.next-cli-build/server/chunks/827.js +1 -1
- package/app/.next-cli-build/server/chunks/8363.js +1 -0
- package/app/.next-cli-build/server/chunks/869.js +1 -1
- package/app/.next-cli-build/server/chunks/8910.js +1 -1
- package/app/.next-cli-build/server/chunks/915.js +6 -6
- package/app/.next-cli-build/server/chunks/9660.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +3 -3
- 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/chunks/{1321-5363e10d6bc83255.js → 1321-e91fcc77031966c2.js} +1 -1
- package/app/.next-cli-build/static/chunks/5116-57607d97ad30f27c.js +70 -0
- package/app/.next-cli-build/static/chunks/{533-74450af7ce8a32b6.js → 533-34fc7f5a3c79da82.js} +1 -1
- package/app/.next-cli-build/static/chunks/{5497-78a8a8716352195f.js → 5497-84dfd144b30eda56.js} +1 -1
- package/app/.next-cli-build/static/chunks/9da6db1e-d4cbd87a5f1d0209.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-3b24dec9f1a5c678.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-63a707f86838189f.js → page-c737bc25a827d251.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-26f454785dc626b1.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/realtime/{page-81a6d2a3fffb86dc.js → page-f4b382f06f0f8eb6.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-07a0044d9e135cb8.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/{page-ec365dbdc0860d04.js → page-d488121dc0c130ad.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/landing/page-1f76869d947f63aa.js +1 -0
- package/app/.next-cli-build/static/chunks/app/layout-2654a5701747e5bc.js +1 -0
- package/app/.next-cli-build/static/chunks/app/login/{page-744fd018e592b5f6.js → page-e0dc71d92b91cd3f.js} +1 -1
- package/app/.next-cli-build/static/css/ada9b169590290e6.css +1 -0
- package/app/.next-cli-build/static/css/b71ca13188930393.css +1 -0
- package/app/node_modules/baseline-browser-mapping/dist/index.cjs +1 -1
- package/app/node_modules/baseline-browser-mapping/package.json +1 -1
- package/app/package.json +11 -9
- package/app/public/i18n/literals/ar.json +4 -4
- package/app/public/i18n/literals/bn.json +4 -4
- package/app/public/i18n/literals/cs.json +4 -4
- package/app/public/i18n/literals/da.json +4 -4
- package/app/public/i18n/literals/de.json +4 -4
- package/app/public/i18n/literals/el.json +4 -4
- package/app/public/i18n/literals/es.json +4 -4
- package/app/public/i18n/literals/fa.json +33 -33
- package/app/public/i18n/literals/fi.json +4 -4
- package/app/public/i18n/literals/fr.json +4 -4
- package/app/public/i18n/literals/he.json +4 -4
- package/app/public/i18n/literals/hi.json +4 -4
- package/app/public/i18n/literals/hu.json +4 -4
- package/app/public/i18n/literals/id.json +4 -4
- package/app/public/i18n/literals/it.json +4 -4
- package/app/public/i18n/literals/ja.json +4 -4
- package/app/public/i18n/literals/km.json +33 -33
- package/app/public/i18n/literals/ko.json +4 -4
- package/app/public/i18n/literals/nl.json +4 -4
- package/app/public/i18n/literals/no.json +4 -4
- package/app/public/i18n/literals/pl.json +4 -4
- package/app/public/i18n/literals/pt-BR.json +4 -4
- package/app/public/i18n/literals/pt-PT.json +4 -4
- package/app/public/i18n/literals/ro.json +4 -4
- package/app/public/i18n/literals/ru.json +4 -4
- package/app/public/i18n/literals/sv.json +4 -4
- package/app/public/i18n/literals/th.json +33 -33
- package/app/public/i18n/literals/tl.json +4 -4
- package/app/public/i18n/literals/tr.json +4 -4
- package/app/public/i18n/literals/uk.json +4 -4
- package/app/public/i18n/literals/ur.json +4 -4
- package/app/public/i18n/literals/vi.json +4 -4
- package/app/public/i18n/literals/zh-CN.json +33 -33
- package/app/public/i18n/literals/zh-TW.json +4 -4
- package/app/src/lib/updater/updater.js +3 -3
- package/app/src/mitm/server.js +3 -3
- package/app/src/realtime/protocol.js +1 -1
- package/app/src/realtime/runtime.js +6 -4
- package/cli.js +16 -16
- package/hooks/postinstall.js +5 -5
- package/hooks/sqliteRuntime.js +4 -4
- package/hooks/trayRuntime.js +6 -6
- package/package.json +14 -8
- package/src/cli/api/client.js +2 -2
- package/src/cli/commands/xaiVideo.js +7 -7
- package/src/cli/menus/cliTools.js +16 -16
- package/src/cli/terminalUI.js +2 -2
- package/src/cli/tray/autostart.js +9 -9
- package/src/cli/tray/tray.js +5 -5
- package/src/cli/tray/tray.ps1 +1 -1
- package/app/.next-cli-build/server/chunks/3350.js +0 -1
- package/app/.next-cli-build/server/chunks/4223.js +0 -11
- package/app/.next-cli-build/server/chunks/4306.js +0 -1
- package/app/.next-cli-build/server/chunks/6832.js +0 -1
- package/app/.next-cli-build/server/chunks/6935.js +0 -1
- package/app/.next-cli-build/server/chunks/8658.js +0 -1
- package/app/.next-cli-build/server/chunks/8971.js +0 -1
- package/app/.next-cli-build/static/chunks/3122-7d92444836703c7a.js +0 -11
- package/app/.next-cli-build/static/chunks/5116-8422f68a0c01ef77.js +0 -70
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-4c5a22762fe663b8.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-f8b4e4dc27c90c0c.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-d73bd129f40d6396.js +0 -1
- package/app/.next-cli-build/static/chunks/app/landing/page-d0dc2acaf2a1c239.js +0 -1
- package/app/.next-cli-build/static/chunks/app/layout-1c95599c7054cadc.js +0 -1
- package/app/.next-cli-build/static/css/f21ca4a324c22a6c.css +0 -1
- package/app/.next-cli-build/static/css/fa9e956ea578b5b8.css +0 -1
- /package/app/.next-cli-build/static/{P86gd5BC-j6FbnOx3-K8q → Fq1kR9_FoWmz8b123uFBu}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{P86gd5BC-j6FbnOx3-K8q → Fq1kR9_FoWmz8b123uFBu}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{75882:(e,s,l)=>{"use strict";l.d(s,{default:()=>m});var t=l(95155),a=l(12115),i=l(35497),r=l(3534),c=l(49511),n=l(98500),o=l.n(n),d=l(5772);function x({toolId:e,tool:s,status:l}){let a=l?l.installed?l.hasPolyRouter?{label:"Connected",cls:"bg-green-500/10 text-green-600 dark:text-green-400"}:{label:"Not configured",cls:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"}:{label:"Not installed",cls:"bg-gray-500/10 text-gray-500"}:{label:"Unknown",cls:"bg-gray-500/10 text-gray-500"};return(0,t.jsx)(o(),{href:`/dashboard/cli-tools/${e}`,className:"block",children:(0,t.jsx)(i.Zp,{padding:"sm",className:"h-full overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,t.jsx)("div",{className:"flex h-full flex-col gap-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:s.image?(0,t.jsx)(d.default,{src:s.image,alt:s.name,width:32,height:32,className:"size-8 object-contain ",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"}):s.icon?(0,t.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:s.color},children:s.icon}):null}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"font-medium text-sm truncate",children:s.name}),(0,t.jsx)("span",{className:`inline-block mt-1 px-1.5 py-0.5 text-[10px] font-medium rounded-full ${a.cls}`,children:a.label})]}),(0,t.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px] shrink-0",children:"chevron_right"})]})})})})}function m({machineId:e}){let[s,l]=(0,a.useState)(!0),[n,o]=(0,a.useState)({});if((0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let s=await fetch("/api/cli-tools/all-statuses");s.ok&&e&&o(await s.json())}catch(e){console.log("Error fetching tool statuses:",e)}finally{e&&l(!1)}})(),()=>{e=!1}},[]),s)return(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:[(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{})]});let d=Object.entries(r.dM),g=Object.entries(r.wn);return(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6 px-1 sm:px-0",children:[(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:d.map(([e,s])=>(0,t.jsx)(x,{toolId:e,tool:s,status:n[e]},e))}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"security"}),(0,t.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"MITM Tools"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:g.map(([e,s])=>(0,t.jsx)(c.gY,{tool:s},e))})]})]})}},82564:(e,s,l)=>{Promise.resolve().then(l.bind(l,75882))}},e=>{e.O(0,[8010,5772,1321,7451,5497,5116,8441,3794,7358],()=>e(e.s=82564)),_N_E=e.O()}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{4719:(e,t,s)=>{Promise.resolve().then(s.bind(s,43003))},36579:(e,t,s)=>{"use strict";s.d(t,{default:()=>n});var a=s(95155),r=s(12115);let o=[{id:"gpt-realtime-2",name:"GPT Realtime 2"},{id:"gpt-realtime",name:"GPT Realtime"},{id:"gpt-realtime-mini",name:"GPT Realtime Mini"}];function n({providerId:e="codex",providerName:t}){let s=(0,r.useRef)(null),i=(0,r.useRef)(null),c=(0,r.useRef)(null),d=(0,r.useRef)(null),p=(0,r.useRef)(null),m=(0,r.useRef)(0),u=(0,r.useRef)(new Set),[x,h]=(0,r.useState)("Idle"),[b,f]=(0,r.useState)(""),[g,y]=(0,r.useState)(!1),[v,j]=(0,r.useState)(""),[w,N]=(0,r.useState)(""),[k,S]=(0,r.useState)("gpt-realtime-2"),C=(0,r.useCallback)(()=>{for(let e of u.current)try{e.stop()}catch{}u.current.clear(),m.current=0},[]),$=(0,r.useCallback)(()=>{y(!1),d.current?.disconnect(),p.current?.disconnect(),d.current=null,p.current=null,i.current?.getTracks().forEach(e=>e.stop()),i.current=null,s.current&&s.current.readyState<WebSocket.CLOSING&&s.current.close(),s.current=null,C(),h("Stopped")},[C]),_=(0,r.useCallback)(e=>{let t=c.current;if(!t||!e)return;let s=t.createBufferSource();s.buffer=function(e,t){let s=function(e){let t=atob(e),s=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)s[e]=t.charCodeAt(e);return s}(t),a=new DataView(s.buffer,s.byteOffset,s.byteLength),r=e.createBuffer(1,Math.floor(s.byteLength/2),24e3),o=r.getChannelData(0);for(let e=0;e<o.length;e+=1)o[e]=a.getInt16(2*e,!0)/32768;return r}(t,e),s.connect(t.destination);let a=Math.max(t.currentTime,m.current);s.start(a),m.current=a+s.buffer.duration,u.current.add(s),s.onended=()=>u.current.delete(s)},[]),P=(0,r.useCallback)(async()=>{if(!g){f(""),j(""),N(""),h("Requesting microphone permission…");try{let t=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0}}),a=window.AudioContext||window.webkitAudioContext,r=c.current||new a({sampleRate:24e3});c.current=r,await r.resume(),i.current=t;let o="https:"===window.location.protocol?"wss":"ws",n=new WebSocket(`${o}://${window.location.host}/v1/realtime?provider=${encodeURIComponent(e)}&model=${encodeURIComponent(k)}`);s.current=n,n.onopen=()=>{if(s.current!==n)return;let e=r.createMediaStreamSource(t),a=r.createScriptProcessor(4096,1,1);e.connect(a),a.connect(r.destination),a.onaudioprocess=e=>{if(n.readyState!==WebSocket.OPEN)return;let t=function(e){let t=new Int16Array(e.length);for(let s=0;s<e.length;s+=1){let a=Math.max(-1,Math.min(1,e[s]));t[s]=a<0?32768*a:32767*a}return new Uint8Array(t.buffer)}(e.inputBuffer.getChannelData(0));n.send(JSON.stringify({type:"input_audio_buffer.append",audio:function(e){let t="";for(let s=0;s<e.length;s+=32768)t+=String.fromCharCode(...e.subarray(s,s+32768));return btoa(t)}(t)}))},p.current=e,d.current=a,y(!0),h("Listening")},n.onmessage=({data:e})=>{let t;try{t=JSON.parse(e)}catch{return}("response.output_audio.delta"===t.type||"response.audio.delta"===t.type)&&t.delta&&_(t.delta),("response.output_audio_transcript.delta"===t.type||"response.audio_transcript.delta"===t.type)&&t.delta&&N(e=>e+t.delta),"conversation.item.input_audio_transcription.completed"===t.type&&t.transcript&&j(t.transcript),"input_audio_buffer.speech_started"===t.type&&(C(),h("Listening")),("response.audio.done"===t.type||"response.done"===t.type)&&h("Listening"),"error"===t.type&&f(t.error?.message||"Realtime connection failed.")},n.onerror=()=>f("Unable to connect to the local realtime service."),n.onclose=()=>{s.current===n&&(s.current=null,y(!1),h("Disconnected"))}}catch(e){f(e?.name==="NotAllowedError"?"Microphone permission was denied.":e?.message||"Could not start the microphone."),$()}}},[g,k,e,_,$,C]);return(0,r.useEffect)(()=>()=>{$(),c.current?.close().catch(()=>{})},[$]),(0,a.jsxs)("section",{className:"max-w-3xl mx-auto space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-semibold text-text-main",children:"Speech to Speech"}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-text-muted",children:["Talk naturally using your connected ",t||"OpenAI"," account. Audio stays between this browser, your local 9Router, and the realtime provider."]})]}),(0,a.jsxs)("div",{className:"border border-border-subtle bg-surface p-6 space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main",children:x}),b&&(0,a.jsx)("p",{role:"alert",className:"mt-1 text-sm text-red-500",children:b})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("select",{value:k,onChange:e=>S(e.target.value),disabled:g,className:"px-3 py-2 text-sm border border-border-subtle bg-background text-text-main","aria-label":"Realtime model",children:o.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))}),g&&(0,a.jsx)("button",{type:"button",onClick:()=>{s.current?.send(JSON.stringify({type:"response.cancel"})),C()},className:"px-4 py-2 text-sm border border-border-subtle hover:bg-surface-2",children:"Interrupt"}),(0,a.jsx)("button",{type:"button",onClick:g?$:P,className:"px-4 py-2 text-sm font-medium bg-primary text-white hover:opacity-90",children:g?"Stop":"Start talking"})]})]}),(0,a.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,a.jsx)(l,{title:"You said",text:v,empty:"Your speech transcript will appear here."}),(0,a.jsx)(l,{title:"Assistant",text:w,empty:"The assistant’s response will appear here."})]})]})]})}function l({title:e,text:t,empty:s}){return(0,a.jsxs)("div",{className:"min-h-32 border border-border-subtle bg-bg p-4",children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-text-main",children:e}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted whitespace-pre-wrap",children:t||s})]})}},43003:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>L});var a=s(95155),r=s(73321),o=s(98500),n=s.n(o),l=s(12115),i=s(35497),c=s(57250),d=s(88105),p=s(70217),m=s(14051),u=s.n(m);function x({until:e}){let[t,s]=(0,l.useState)("");return((0,l.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);a<60?s(`${a}s`):a<3600?s(`${Math.floor(a/60)}m ${a%60}s`):s(`${Math.floor(a/3600)}h ${Math.floor(a%3600/60)}m`)};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-green-500 font-mono",children:["⏱ ",t]}):null}function h({connection:e,proxyPools:t,isOAuth:s,statusMode:r,isFirst:o,isLast:n,onMoveUp:c,onMoveDown:d,onToggleActive:m,onUpdateProxy:u,onEdit:b,onDelete:f}){let[g,y]=(0,l.useState)(!1),[v,j]=(0,l.useState)(!1),w=new Map((t||[]).map(e=>[e.id,e])),N=e.providerSpecificData?.proxyPoolId||null,k=N?w.get(N):null,S=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!N||S,$=k?`Pool: ${k.name}`:N?`Pool: ${N} (inactive/missing)`:S?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",_="",P=k?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(P)try{let e=new URL(P);_=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{_=P}let R=k?.noProxy||e.providerSpecificData?.connectionNoProxy||"",A=k?.isActive===!0?"success":N||S?"error":"default",T=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(Boolean).sort()[0]||null;(0,l.useEffect)(()=>{let t=()=>{j(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=T?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[T]);let I=async e=>{y(!0);try{await u("__none__"===e?null:e)}finally{y(!1)}},E=/refresh token|token expired|invalidated|unauthorized|401/i.test(e.lastError||""),O="oauth"===r?E?"error":!1===e.isActive?"disabled":"active":"unavailable"!==e.testStatus||v?e.testStatus:"active",M=s?e.name||e.email||e.displayName||"OAuth Account":e.name;return(0,a.jsxs)("div",{className:`group flex flex-col gap-3 p-2 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,a.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("button",{onClick:c,disabled:o,className:`p-0.5 ${o?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:s?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:M}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,a.jsx)(i.Ex,{variant:(0,p.g)(e.isActive,O),size:"sm",dot:!0,children:!1===e.isActive?"disabled":O||"Unknown"}),C&&(0,a.jsx)(i.Ex,{variant:A,size:"sm",children:"Proxy"}),v&&!1!==e.isActive&&(0,a.jsx)(x,{until:T}),e.lastError&&!1!==e.isActive&&("oauth"!==r||E)&&(0,a.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),C&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:$,children:$}),_&&(0,a.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 text-text-muted",children:_}),R&&(0,a.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:R,children:["no_proxy: ",R]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(t||[]).length>0&&(0,a.jsxs)(i.ms,{trigger:(0,a.jsxs)("button",{className:`flex flex-col items-center px-2 py-1 hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:g,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:g?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),children:[(0,a.jsx)(i.tJ,{icon:null,label:"None",onClick:()=>I("__none__"),danger:!1}),(t||[]).map(e=>(0,a.jsx)(i.tJ,{icon:null,label:e.name,onClick:()=>I(e.id)},e.id))]}),(0,a.jsxs)("button",{onClick:b,className:"flex flex-col items-center px-2 py-1 hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:f,className:"flex flex-col items-center px-2 py-1 hover:bg-red-500/10 text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(i.lM,{size:"sm",checked:e.isActive??!0,onChange:m,title:e.isActive??!0?"Disable":"Enable"})]})]})}function b({isOpen:e,provider:t,providerName:s,proxyPools:r,onSave:o,onClose:n}){let c="__none__",[d,p]=(0,l.useState)({name:"",apiKey:"",priority:1,proxyPoolId:c}),[m,u]=(0,l.useState)(!1),[x,h]=(0,l.useState)(null),[f,g]=(0,l.useState)(!1),y=async()=>{u(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:d.apiKey})}),s=await e.json();h(s.valid?"success":"failed")}catch{h("failed")}finally{u(!1)}},v=async()=>{if(t&&d.apiKey){g(!0);try{let e=!1;try{u(!0),h(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:d.apiKey})});e=!!(await s.json()).valid,h(e?"success":"failed")}catch{h("failed")}finally{u(!1)}await o({name:d.name,apiKey:d.apiKey,priority:d.priority,proxyPoolId:d.proxyPoolId===c?null:d.proxyPoolId,testStatus:e?"active":"unknown"})}finally{g(!1)}}};return t?(0,a.jsx)(i.aF,{isOpen:e,title:`Add ${s||t} API Key`,onClose:n,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,a.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border bg-background focus:outline-none focus:border-primary",value:d.name,onChange:e=>p({...d,name:e.target.value}),placeholder:"Production Key"})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,a.jsx)("input",{type:"password",className:"w-full px-3 py-2 text-sm border border-border bg-background focus:outline-none focus:border-primary",value:d.apiKey,onChange:e=>p({...d,apiKey:e.target.value})})]}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(i.$n,{onClick:y,disabled:!d.apiKey||m||f,variant:"secondary",children:m?"Checking...":"Check"})})]}),x&&(0,a.jsx)(i.Ex,{variant:"success"===x?"success":"error",children:"success"===x?"Valid":"Invalid"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,a.jsx)("input",{type:"number",className:"w-full px-3 py-2 text-sm border border-border bg-background focus:outline-none focus:border-primary",value:d.priority,onChange:e=>p({...d,priority:Number.parseInt(e.target.value)||1})})]}),(0,a.jsx)(i.l6,{label:"Proxy Pool",value:d.proxyPoolId,onChange:e=>p({...d,proxyPoolId:e.target.value}),options:[{value:c,label:"None"},...(r||[]).map(e=>({value:e.id,label:e.name}))]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:v,fullWidth:!0,disabled:!d.name||!d.apiKey||f,children:f?"Saving...":"Save"}),(0,a.jsx)(i.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function f({providerId:e,authProviderId:t,isOAuth:s,statusMode:r="default"}){let o=t||e,[n,c]=(0,l.useState)([]),[p,m]=(0,l.useState)([]),[u,x]=(0,l.useState)(!0),[g,y]=(0,l.useState)(!1),[v,j]=(0,l.useState)(!1),[w,N]=(0,l.useState)(null),[k,S]=(0,l.useState)(null),[C,$]=(0,l.useState)("1"),[_,P]=(0,l.useState)(null),R=(0,l.useCallback)(async()=>{try{let[e,t,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"})]),a=await e.json(),r=await t.json(),n=s.ok?await s.json():{};e.ok&&c((a.connections||[]).filter(e=>e.provider===o)),t.ok&&m(r.proxyPools||[]);let l=(n.providerStrategies||{})[o]||{};S(l.fallbackStrategy||null),$(null!=l.stickyRoundRobinLimit?String(l.stickyRoundRobinLimit):"1")}catch(e){console.log("ConnectionsCard fetch error:",e)}finally{x(!1)}},[o]);(0,l.useEffect)(()=>{R()},[R]);let A=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},r={};e&&(r.fallbackStrategy=e),"round-robin"===e&&""!==t&&(r.stickyRoundRobinLimit=Number(t)||3);let n={...a};0===Object.keys(r).length?delete n[o]:n[o]=r,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:n})})}catch(e){console.log("saveStrategy error:",e)}},T=async(e,t)=>{let s=[...n];[s[e],s[t]]=[s[t],s[e]],c(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 R()}},I=async e=>{P({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{P(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&c(t=>t.filter(t=>t.id!==e))}catch(e){console.log("delete error:",e)}}})},E=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&c(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("toggle error:",e)}},O=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&c(s=>s.map(s=>s.id===e?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("proxy error:",e)}},M=async e=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:o,...e})})).ok&&(await R(),y(!1))}catch(e){console.log("save apikey error:",e)}},U=async e=>{try{(await fetch(`/api/providers/${w.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await R(),j(!1))}catch(e){console.log("update connection error:",e)}};return u?(0,a.jsx)(i.Zp,{children:(0,a.jsx)("div",{className:"h-20 animate-pulse bg-black/5 "})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(i.lM,{checked:"round-robin"===k,onChange:e=>{let t=e?"round-robin":null;S(t),e&&!C&&$("1"),A(t,e?C||"1":C)}}),"round-robin"===k&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:C,onChange:e=>{$(e.target.value),A("round-robin",e.target.value)},className:"w-16 px-2 py-1 text-xs border border-border bg-background focus:outline-none focus:border-primary"})]})]})]}),0===n.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,a.jsx)(i.$n,{size:"sm",icon:"add",onClick:()=>y(!0),children:"Add Connection"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:n.map((e,t)=>(0,a.jsx)(h,{connection:e,proxyPools:p,isOAuth:s,statusMode:r,isFirst:0===t,isLast:t===n.length-1,onMoveUp:()=>T(t,t-1),onMoveDown:()=>T(t,t+1),onToggleActive:t=>E(e.id,t),onUpdateProxy:t=>O(e.id,t),onEdit:()=>{N(e),j(!0)},onDelete:()=>I(e.id)},e.id))}),(0,a.jsx)("div",{className:"mt-4 flex justify-stretch sm:justify-start",children:(0,a.jsx)(i.$n,{size:"sm",icon:"add",onClick:()=>y(!0),children:"Add"})})]})]}),s?(0,a.jsx)(i.LF,{isOpen:g,provider:o,providerInfo:{...d.zN[o],name:"openai"===e?"OpenAI":d.zN[o]?.name},onSuccess:()=>{R(),y(!1)},onClose:()=>y(!1)}):(0,a.jsx)(b,{isOpen:g,provider:o,proxyPools:p,onSave:M,onClose:()=>y(!1)}),(0,a.jsx)(i.wI,{isOpen:v,connection:w,proxyPools:p,onSave:U,onClose:()=>j(!1)}),(0,a.jsx)(i.uo,{isOpen:!!_,onClose:()=>P(null),onConfirm:_?.onConfirm,title:_?.title||"Confirm",message:_?.message,variant:"danger"})]})}x.propTypes={until:u().string.isRequired},h.propTypes={connection:u().shape({id:u().string,name:u().string,email:u().string,displayName:u().string,testStatus:u().string,isActive:u().bool,lastError:u().string,priority:u().number}).isRequired,proxyPools:u().array,isOAuth:u().bool.isRequired,statusMode:u().string,isFirst:u().bool.isRequired,isLast:u().bool.isRequired,onMoveUp:u().func.isRequired,onMoveDown:u().func.isRequired,onToggleActive:u().func.isRequired,onUpdateProxy:u().func,onEdit:u().func.isRequired,onDelete:u().func.isRequired},b.propTypes={isOpen:u().bool.isRequired,provider:u().string,providerName:u().string,proxyPools:u().array,onSave:u().func.isRequired,onClose:u().func.isRequired},f.propTypes={providerId:u().string.isRequired,authProviderId:u().string,isOAuth:u().bool,statusMode:u().string};var g=s(28777),y=s(11059);function v({model:e,fullModel:t,copied:s,onCopy:r,testStatus:o,isCustom:n,isFree:l,onDeleteAlias:i,onTest:c,isTesting:d,testAlwaysVisible:p}){let m="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,a.jsx)("div",{className:`group px-3 py-2 border ${"ok"===o?"border-green-500/40":"error"===o?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",style:m?{color:m}:void 0,children:"ok"===o?"check_circle":"error"===o?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 ",children:t}),e.name&&(0,a.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),c&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:c,disabled:d,className:`p-0.5 hover:bg-sidebar text-text-muted hover:text-primary transition-opacity ${d||p?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:d?{animation:"spin 1s linear infinite"}:void 0,children:d?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:d?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e.id}`?"Copied!":"Copy"})]}),l&&(0,a.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 ",children:"FREE"}),n&&(0,a.jsx)("button",{onClick:i,className:"p-0.5 hover:bg-red-500/10 text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function j({isOpen:e,onSave:t,onClose:s}){let[r,o]=(0,l.useState)(""),n=()=>{r.trim()&&(t(r.trim()),o(""))};return(0,a.jsx)(i.aF,{isOpen:e,title:"Add Custom Model",onClose:s,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>o(e.target.value),onKeyDown:e=>"Enter"===e.key&&n(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:n,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,a.jsx)(i.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function w({providerId:e,kindFilter:t,providerAliasOverride:s,realtimeProviderId:r,testable:o=!0,allowCustomModels:n=!0,testAlwaysVisible:c=!1}){let{copied:p,copy:m}=(0,y.C)(),[u,x]=(0,l.useState)({}),[h,b]=(0,l.useState)([]),[f,N]=(0,l.useState)({}),[k,S]=(0,l.useState)(null),[C,$]=(0,l.useState)(""),[_,P]=(0,l.useState)(!1),R=s||(0,d.wG)(e),A=t||"llm",T=(0,l.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/models/alias"),fetch("/api/models/custom",{cache:"no-store"})]),s=await e.json(),a=await t.json();e.ok&&x(s.aliases||{}),t.ok&&b(a.models||[])}catch(e){console.log("ModelsCard fetch error:",e)}},[]);(0,l.useEffect)(()=>{T()},[T]);let I=async(e,t)=>{let s=`${R}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})})).ok&&await T()}catch(e){console.log("set alias error:",e)}},E=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await T()}catch(e){console.log("delete alias error:",e)}},O=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:R,id:e,type:A})})).ok&&(await T(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("add custom model error:",e)}},M=async e=>{try{let t=new URLSearchParams({providerAlias:R,id:e,type:A});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await T(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},U=async s=>{if(!k){S(s);try{if("speechToSpeech"===t){await new Promise((t,a)=>{let o="https:"===window.location.protocol?"wss":"ws",n=new WebSocket(`${o}://${window.location.host}/v1/realtime?provider=${encodeURIComponent(r||e)}&model=${encodeURIComponent(s)}`),l=window.setTimeout(()=>{n.close(),a(Error("Realtime connection timed out."))},15e3),i=(e,t)=>{window.clearTimeout(l),n.close(),e(t)};n.onmessage=e=>{try{let s=JSON.parse(e.data);"session.created"===s.type&&i(t,!0),"error"===s.type&&i(a,Error(s.error?.message||"Realtime connection failed."))}catch{}},n.onerror=()=>i(a,Error("Realtime WebSocket connection failed."))}),N(e=>({...e,[s]:"ok"})),$("");return}let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${R}/${s}`,kind:t})}),o=await a.json();N(e=>({...e,[s]:o.ok?"ok":"error"})),$(o.ok?"":o.error||"Model not reachable")}catch{N(e=>({...e,[s]:"error"})),$("Network error")}finally{S(null)}}},L=(0,g.KC)(e),K=t?L.filter(e=>e.kinds?e.kinds.includes(t):(0,g.CP)(e,"llm")===t):L,B=h.filter(e=>e.providerAlias===R&&(0,g.CP)(e,"llm")===A&&!K.some(t=>t.id===e.id));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,a.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),o&&C&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:C}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[K.map(e=>{let t=`${R}/${e.id}`,s=Object.entries(u).find(([,e])=>e===t)?.[0];return(0,a.jsx)(v,{model:e,fullModel:`${R}/${e.id}`,alias:s,copied:p,onCopy:m,onSetAlias:t=>I(e.id,t),onDeleteAlias:()=>E(s),testStatus:f[e.id],onTest:o?()=>U(e.id):void 0,isTesting:k===e.id,testAlwaysVisible:c,isFree:e.isFree},e.id)}),n&&B.map(e=>(0,a.jsx)(v,{model:{id:e.id,name:e.name},fullModel:`${R}/${e.id}`,copied:p,onCopy:m,onSetAlias:()=>{},onDeleteAlias:()=>M(e.id),testStatus:f[e.id],onTest:o?()=>U(e.id):void 0,isTesting:k===e.id,testAlwaysVisible:c,isCustom:!0},`${e.id}-${e.type}`)),n&&(0,a.jsxs)("button",{onClick:()=>P(!0),className:"flex items-center gap-1.5 px-3 py-2 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,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,a.jsx)(j,{isOpen:_,onSave:async e=>{await O(e),P(!1)},onClose:()=>P(!1)})]})}function N({label:e,children:t}){return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,a.jsx)("span",{className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,a.jsx)("div",{className:"w-full min-w-0 flex-1",children:t})]})}v.propTypes={model:u().shape({id:u().string.isRequired}).isRequired,fullModel:u().string.isRequired,copied:u().string,onCopy:u().func.isRequired,testStatus:u().oneOf(["ok","error"]),isCustom:u().bool,isFree:u().bool,onDeleteAlias:u().func,onTest:u().func,isTesting:u().bool},j.propTypes={isOpen:u().bool.isRequired,onSave:u().func.isRequired,onClose:u().func.isRequired},w.propTypes={providerId:u().string.isRequired,kindFilter:u().string,providerAliasOverride:u().string,realtimeProviderId:u().string,realtimeProviderId:u().string,testable:u().bool,allowCustomModels:u().bool,testAlwaysVisible:u().bool,testAlwaysVisible:u().bool};let k={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{4719:(e,t,s)=>{Promise.resolve().then(s.bind(s,43003))},36579:(e,t,s)=>{"use strict";s.d(t,{default:()=>n});var a=s(95155),r=s(12115);let o=[{id:"gpt-realtime-2",name:"GPT Realtime 2"},{id:"gpt-realtime",name:"GPT Realtime"},{id:"gpt-realtime-mini",name:"GPT Realtime Mini"}];function n({providerId:e="codex",providerName:t}){let s=(0,r.useRef)(null),i=(0,r.useRef)(null),c=(0,r.useRef)(null),d=(0,r.useRef)(null),p=(0,r.useRef)(null),m=(0,r.useRef)(0),u=(0,r.useRef)(new Set),[x,h]=(0,r.useState)("Idle"),[b,f]=(0,r.useState)(""),[g,y]=(0,r.useState)(!1),[v,j]=(0,r.useState)(""),[w,N]=(0,r.useState)(""),[k,S]=(0,r.useState)("gpt-realtime-2"),C=(0,r.useCallback)(()=>{for(let e of u.current)try{e.stop()}catch{}u.current.clear(),m.current=0},[]),$=(0,r.useCallback)(()=>{y(!1),d.current?.disconnect(),p.current?.disconnect(),d.current=null,p.current=null,i.current?.getTracks().forEach(e=>e.stop()),i.current=null,s.current&&s.current.readyState<WebSocket.CLOSING&&s.current.close(),s.current=null,C(),h("Stopped")},[C]),_=(0,r.useCallback)(e=>{let t=c.current;if(!t||!e)return;let s=t.createBufferSource();s.buffer=function(e,t){let s=function(e){let t=atob(e),s=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)s[e]=t.charCodeAt(e);return s}(t),a=new DataView(s.buffer,s.byteOffset,s.byteLength),r=e.createBuffer(1,Math.floor(s.byteLength/2),24e3),o=r.getChannelData(0);for(let e=0;e<o.length;e+=1)o[e]=a.getInt16(2*e,!0)/32768;return r}(t,e),s.connect(t.destination);let a=Math.max(t.currentTime,m.current);s.start(a),m.current=a+s.buffer.duration,u.current.add(s),s.onended=()=>u.current.delete(s)},[]),P=(0,r.useCallback)(async()=>{if(!g){f(""),j(""),N(""),h("Requesting microphone permission…");try{let t=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0}}),a=window.AudioContext||window.webkitAudioContext,r=c.current||new a({sampleRate:24e3});c.current=r,await r.resume(),i.current=t;let o="https:"===window.location.protocol?"wss":"ws",n=new WebSocket(`${o}://${window.location.host}/v1/realtime?provider=${encodeURIComponent(e)}&model=${encodeURIComponent(k)}`);s.current=n,n.onopen=()=>{if(s.current!==n)return;let e=r.createMediaStreamSource(t),a=r.createScriptProcessor(4096,1,1);e.connect(a),a.connect(r.destination),a.onaudioprocess=e=>{if(n.readyState!==WebSocket.OPEN)return;let t=function(e){let t=new Int16Array(e.length);for(let s=0;s<e.length;s+=1){let a=Math.max(-1,Math.min(1,e[s]));t[s]=a<0?32768*a:32767*a}return new Uint8Array(t.buffer)}(e.inputBuffer.getChannelData(0));n.send(JSON.stringify({type:"input_audio_buffer.append",audio:function(e){let t="";for(let s=0;s<e.length;s+=32768)t+=String.fromCharCode(...e.subarray(s,s+32768));return btoa(t)}(t)}))},p.current=e,d.current=a,y(!0),h("Listening")},n.onmessage=({data:e})=>{let t;try{t=JSON.parse(e)}catch{return}("response.output_audio.delta"===t.type||"response.audio.delta"===t.type)&&t.delta&&_(t.delta),("response.output_audio_transcript.delta"===t.type||"response.audio_transcript.delta"===t.type)&&t.delta&&N(e=>e+t.delta),"conversation.item.input_audio_transcription.completed"===t.type&&t.transcript&&j(t.transcript),"input_audio_buffer.speech_started"===t.type&&(C(),h("Listening")),("response.audio.done"===t.type||"response.done"===t.type)&&h("Listening"),"error"===t.type&&f(t.error?.message||"Realtime connection failed.")},n.onerror=()=>f("Unable to connect to the local realtime service."),n.onclose=()=>{s.current===n&&(s.current=null,y(!1),h("Disconnected"))}}catch(e){f(e?.name==="NotAllowedError"?"Microphone permission was denied.":e?.message||"Could not start the microphone."),$()}}},[g,k,e,_,$,C]);return(0,r.useEffect)(()=>()=>{$(),c.current?.close().catch(()=>{})},[$]),(0,a.jsxs)("section",{className:"max-w-3xl mx-auto space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-semibold text-text-main",children:"Speech to Speech"}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-text-muted",children:["Talk naturally using your connected ",t||"OpenAI"," account. Audio stays between this browser, your local PolyRouter, and the realtime provider."]})]}),(0,a.jsxs)("div",{className:"border border-border-subtle bg-surface p-6 space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main",children:x}),b&&(0,a.jsx)("p",{role:"alert",className:"mt-1 text-sm text-red-500",children:b})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("select",{value:k,onChange:e=>S(e.target.value),disabled:g,className:"px-3 py-2 text-sm border border-border-subtle bg-background text-text-main","aria-label":"Realtime model",children:o.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))}),g&&(0,a.jsx)("button",{type:"button",onClick:()=>{s.current?.send(JSON.stringify({type:"response.cancel"})),C()},className:"px-4 py-2 text-sm border border-border-subtle hover:bg-surface-2",children:"Interrupt"}),(0,a.jsx)("button",{type:"button",onClick:g?$:P,className:"px-4 py-2 text-sm font-medium bg-primary text-white hover:opacity-90",children:g?"Stop":"Start talking"})]})]}),(0,a.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,a.jsx)(l,{title:"You said",text:v,empty:"Your speech transcript will appear here."}),(0,a.jsx)(l,{title:"Assistant",text:w,empty:"The assistant’s response will appear here."})]})]})]})}function l({title:e,text:t,empty:s}){return(0,a.jsxs)("div",{className:"min-h-32 border border-border-subtle bg-bg p-4",children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-text-main",children:e}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted whitespace-pre-wrap",children:t||s})]})}},43003:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>L});var a=s(95155),r=s(73321),o=s(98500),n=s.n(o),l=s(12115),i=s(35497),c=s(57250),d=s(88105),p=s(70217),m=s(14051),u=s.n(m);function x({until:e}){let[t,s]=(0,l.useState)("");return((0,l.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);a<60?s(`${a}s`):a<3600?s(`${Math.floor(a/60)}m ${a%60}s`):s(`${Math.floor(a/3600)}h ${Math.floor(a%3600/60)}m`)};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-green-500 font-mono",children:["⏱ ",t]}):null}function h({connection:e,proxyPools:t,isOAuth:s,statusMode:r,isFirst:o,isLast:n,onMoveUp:c,onMoveDown:d,onToggleActive:m,onUpdateProxy:u,onEdit:b,onDelete:f}){let[g,y]=(0,l.useState)(!1),[v,j]=(0,l.useState)(!1),w=new Map((t||[]).map(e=>[e.id,e])),N=e.providerSpecificData?.proxyPoolId||null,k=N?w.get(N):null,S=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!N||S,$=k?`Pool: ${k.name}`:N?`Pool: ${N} (inactive/missing)`:S?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",_="",P=k?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(P)try{let e=new URL(P);_=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{_=P}let R=k?.noProxy||e.providerSpecificData?.connectionNoProxy||"",A=k?.isActive===!0?"success":N||S?"error":"default",T=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(Boolean).sort()[0]||null;(0,l.useEffect)(()=>{let t=()=>{j(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=T?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[T]);let I=async e=>{y(!0);try{await u("__none__"===e?null:e)}finally{y(!1)}},E=/refresh token|token expired|invalidated|unauthorized|401/i.test(e.lastError||""),O="oauth"===r?E?"error":!1===e.isActive?"disabled":"active":"unavailable"!==e.testStatus||v?e.testStatus:"active",M=s?e.name||e.email||e.displayName||"OAuth Account":e.name;return(0,a.jsxs)("div",{className:`group flex flex-col gap-3 p-2 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,a.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("button",{onClick:c,disabled:o,className:`p-0.5 ${o?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:s?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:M}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,a.jsx)(i.Ex,{variant:(0,p.g)(e.isActive,O),size:"sm",dot:!0,children:!1===e.isActive?"disabled":O||"Unknown"}),C&&(0,a.jsx)(i.Ex,{variant:A,size:"sm",children:"Proxy"}),v&&!1!==e.isActive&&(0,a.jsx)(x,{until:T}),e.lastError&&!1!==e.isActive&&("oauth"!==r||E)&&(0,a.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),C&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:$,children:$}),_&&(0,a.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 text-text-muted",children:_}),R&&(0,a.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:R,children:["no_proxy: ",R]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(t||[]).length>0&&(0,a.jsxs)(i.ms,{trigger:(0,a.jsxs)("button",{className:`flex flex-col items-center px-2 py-1 hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:g,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:g?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),children:[(0,a.jsx)(i.tJ,{icon:null,label:"None",onClick:()=>I("__none__"),danger:!1}),(t||[]).map(e=>(0,a.jsx)(i.tJ,{icon:null,label:e.name,onClick:()=>I(e.id)},e.id))]}),(0,a.jsxs)("button",{onClick:b,className:"flex flex-col items-center px-2 py-1 hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:f,className:"flex flex-col items-center px-2 py-1 hover:bg-red-500/10 text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(i.lM,{size:"sm",checked:e.isActive??!0,onChange:m,title:e.isActive??!0?"Disable":"Enable"})]})]})}function b({isOpen:e,provider:t,providerName:s,proxyPools:r,onSave:o,onClose:n}){let c="__none__",[d,p]=(0,l.useState)({name:"",apiKey:"",priority:1,proxyPoolId:c}),[m,u]=(0,l.useState)(!1),[x,h]=(0,l.useState)(null),[f,g]=(0,l.useState)(!1),y=async()=>{u(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:d.apiKey})}),s=await e.json();h(s.valid?"success":"failed")}catch{h("failed")}finally{u(!1)}},v=async()=>{if(t&&d.apiKey){g(!0);try{let e=!1;try{u(!0),h(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:d.apiKey})});e=!!(await s.json()).valid,h(e?"success":"failed")}catch{h("failed")}finally{u(!1)}await o({name:d.name,apiKey:d.apiKey,priority:d.priority,proxyPoolId:d.proxyPoolId===c?null:d.proxyPoolId,testStatus:e?"active":"unknown"})}finally{g(!1)}}};return t?(0,a.jsx)(i.aF,{isOpen:e,title:`Add ${s||t} API Key`,onClose:n,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,a.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border bg-background focus:outline-none focus:border-primary",value:d.name,onChange:e=>p({...d,name:e.target.value}),placeholder:"Production Key"})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,a.jsx)("input",{type:"password",className:"w-full px-3 py-2 text-sm border border-border bg-background focus:outline-none focus:border-primary",value:d.apiKey,onChange:e=>p({...d,apiKey:e.target.value})})]}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(i.$n,{onClick:y,disabled:!d.apiKey||m||f,variant:"secondary",children:m?"Checking...":"Check"})})]}),x&&(0,a.jsx)(i.Ex,{variant:"success"===x?"success":"error",children:"success"===x?"Valid":"Invalid"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,a.jsx)("input",{type:"number",className:"w-full px-3 py-2 text-sm border border-border bg-background focus:outline-none focus:border-primary",value:d.priority,onChange:e=>p({...d,priority:Number.parseInt(e.target.value)||1})})]}),(0,a.jsx)(i.l6,{label:"Proxy Pool",value:d.proxyPoolId,onChange:e=>p({...d,proxyPoolId:e.target.value}),options:[{value:c,label:"None"},...(r||[]).map(e=>({value:e.id,label:e.name}))]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:v,fullWidth:!0,disabled:!d.name||!d.apiKey||f,children:f?"Saving...":"Save"}),(0,a.jsx)(i.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function f({providerId:e,authProviderId:t,isOAuth:s,statusMode:r="default"}){let o=t||e,[n,c]=(0,l.useState)([]),[p,m]=(0,l.useState)([]),[u,x]=(0,l.useState)(!0),[g,y]=(0,l.useState)(!1),[v,j]=(0,l.useState)(!1),[w,N]=(0,l.useState)(null),[k,S]=(0,l.useState)(null),[C,$]=(0,l.useState)("1"),[_,P]=(0,l.useState)(null),R=(0,l.useCallback)(async()=>{try{let[e,t,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"})]),a=await e.json(),r=await t.json(),n=s.ok?await s.json():{};e.ok&&c((a.connections||[]).filter(e=>e.provider===o)),t.ok&&m(r.proxyPools||[]);let l=(n.providerStrategies||{})[o]||{};S(l.fallbackStrategy||null),$(null!=l.stickyRoundRobinLimit?String(l.stickyRoundRobinLimit):"1")}catch(e){console.log("ConnectionsCard fetch error:",e)}finally{x(!1)}},[o]);(0,l.useEffect)(()=>{R()},[R]);let A=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},r={};e&&(r.fallbackStrategy=e),"round-robin"===e&&""!==t&&(r.stickyRoundRobinLimit=Number(t)||3);let n={...a};0===Object.keys(r).length?delete n[o]:n[o]=r,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:n})})}catch(e){console.log("saveStrategy error:",e)}},T=async(e,t)=>{let s=[...n];[s[e],s[t]]=[s[t],s[e]],c(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 R()}},I=async e=>{P({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{P(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&c(t=>t.filter(t=>t.id!==e))}catch(e){console.log("delete error:",e)}}})},E=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&c(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("toggle error:",e)}},O=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&c(s=>s.map(s=>s.id===e?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("proxy error:",e)}},M=async e=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:o,...e})})).ok&&(await R(),y(!1))}catch(e){console.log("save apikey error:",e)}},U=async e=>{try{(await fetch(`/api/providers/${w.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await R(),j(!1))}catch(e){console.log("update connection error:",e)}};return u?(0,a.jsx)(i.Zp,{children:(0,a.jsx)("div",{className:"h-20 animate-pulse bg-black/5 "})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(i.lM,{checked:"round-robin"===k,onChange:e=>{let t=e?"round-robin":null;S(t),e&&!C&&$("1"),A(t,e?C||"1":C)}}),"round-robin"===k&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:C,onChange:e=>{$(e.target.value),A("round-robin",e.target.value)},className:"w-16 px-2 py-1 text-xs border border-border bg-background focus:outline-none focus:border-primary"})]})]})]}),0===n.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,a.jsx)(i.$n,{size:"sm",icon:"add",onClick:()=>y(!0),children:"Add Connection"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:n.map((e,t)=>(0,a.jsx)(h,{connection:e,proxyPools:p,isOAuth:s,statusMode:r,isFirst:0===t,isLast:t===n.length-1,onMoveUp:()=>T(t,t-1),onMoveDown:()=>T(t,t+1),onToggleActive:t=>E(e.id,t),onUpdateProxy:t=>O(e.id,t),onEdit:()=>{N(e),j(!0)},onDelete:()=>I(e.id)},e.id))}),(0,a.jsx)("div",{className:"mt-4 flex justify-stretch sm:justify-start",children:(0,a.jsx)(i.$n,{size:"sm",icon:"add",onClick:()=>y(!0),children:"Add"})})]})]}),s?(0,a.jsx)(i.LF,{isOpen:g,provider:o,providerInfo:{...d.zN[o],name:"openai"===e?"OpenAI":d.zN[o]?.name},onSuccess:()=>{R(),y(!1)},onClose:()=>y(!1)}):(0,a.jsx)(b,{isOpen:g,provider:o,proxyPools:p,onSave:M,onClose:()=>y(!1)}),(0,a.jsx)(i.wI,{isOpen:v,connection:w,proxyPools:p,onSave:U,onClose:()=>j(!1)}),(0,a.jsx)(i.uo,{isOpen:!!_,onClose:()=>P(null),onConfirm:_?.onConfirm,title:_?.title||"Confirm",message:_?.message,variant:"danger"})]})}x.propTypes={until:u().string.isRequired},h.propTypes={connection:u().shape({id:u().string,name:u().string,email:u().string,displayName:u().string,testStatus:u().string,isActive:u().bool,lastError:u().string,priority:u().number}).isRequired,proxyPools:u().array,isOAuth:u().bool.isRequired,statusMode:u().string,isFirst:u().bool.isRequired,isLast:u().bool.isRequired,onMoveUp:u().func.isRequired,onMoveDown:u().func.isRequired,onToggleActive:u().func.isRequired,onUpdateProxy:u().func,onEdit:u().func.isRequired,onDelete:u().func.isRequired},b.propTypes={isOpen:u().bool.isRequired,provider:u().string,providerName:u().string,proxyPools:u().array,onSave:u().func.isRequired,onClose:u().func.isRequired},f.propTypes={providerId:u().string.isRequired,authProviderId:u().string,isOAuth:u().bool,statusMode:u().string};var g=s(28777),y=s(11059);function v({model:e,fullModel:t,copied:s,onCopy:r,testStatus:o,isCustom:n,isFree:l,onDeleteAlias:i,onTest:c,isTesting:d,testAlwaysVisible:p}){let m="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,a.jsx)("div",{className:`group px-3 py-2 border ${"ok"===o?"border-green-500/40":"error"===o?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",style:m?{color:m}:void 0,children:"ok"===o?"check_circle":"error"===o?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 ",children:t}),e.name&&(0,a.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),c&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:c,disabled:d,className:`p-0.5 hover:bg-sidebar text-text-muted hover:text-primary transition-opacity ${d||p?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:d?{animation:"spin 1s linear infinite"}:void 0,children:d?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:d?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e.id}`?"Copied!":"Copy"})]}),l&&(0,a.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 ",children:"FREE"}),n&&(0,a.jsx)("button",{onClick:i,className:"p-0.5 hover:bg-red-500/10 text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function j({isOpen:e,onSave:t,onClose:s}){let[r,o]=(0,l.useState)(""),n=()=>{r.trim()&&(t(r.trim()),o(""))};return(0,a.jsx)(i.aF,{isOpen:e,title:"Add Custom Model",onClose:s,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>o(e.target.value),onKeyDown:e=>"Enter"===e.key&&n(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:n,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,a.jsx)(i.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function w({providerId:e,kindFilter:t,providerAliasOverride:s,realtimeProviderId:r,testable:o=!0,allowCustomModels:n=!0,testAlwaysVisible:c=!1}){let{copied:p,copy:m}=(0,y.C)(),[u,x]=(0,l.useState)({}),[h,b]=(0,l.useState)([]),[f,N]=(0,l.useState)({}),[k,S]=(0,l.useState)(null),[C,$]=(0,l.useState)(""),[_,P]=(0,l.useState)(!1),R=s||(0,d.wG)(e),A=t||"llm",T=(0,l.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/models/alias"),fetch("/api/models/custom",{cache:"no-store"})]),s=await e.json(),a=await t.json();e.ok&&x(s.aliases||{}),t.ok&&b(a.models||[])}catch(e){console.log("ModelsCard fetch error:",e)}},[]);(0,l.useEffect)(()=>{T()},[T]);let I=async(e,t)=>{let s=`${R}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})})).ok&&await T()}catch(e){console.log("set alias error:",e)}},E=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await T()}catch(e){console.log("delete alias error:",e)}},O=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:R,id:e,type:A})})).ok&&(await T(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("add custom model error:",e)}},M=async e=>{try{let t=new URLSearchParams({providerAlias:R,id:e,type:A});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await T(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},U=async s=>{if(!k){S(s);try{if("speechToSpeech"===t){await new Promise((t,a)=>{let o="https:"===window.location.protocol?"wss":"ws",n=new WebSocket(`${o}://${window.location.host}/v1/realtime?provider=${encodeURIComponent(r||e)}&model=${encodeURIComponent(s)}`),l=window.setTimeout(()=>{n.close(),a(Error("Realtime connection timed out."))},15e3),i=(e,t)=>{window.clearTimeout(l),n.close(),e(t)};n.onmessage=e=>{try{let s=JSON.parse(e.data);"session.created"===s.type&&i(t,!0),"error"===s.type&&i(a,Error(s.error?.message||"Realtime connection failed."))}catch{}},n.onerror=()=>i(a,Error("Realtime WebSocket connection failed."))}),N(e=>({...e,[s]:"ok"})),$("");return}let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${R}/${s}`,kind:t})}),o=await a.json();N(e=>({...e,[s]:o.ok?"ok":"error"})),$(o.ok?"":o.error||"Model not reachable")}catch{N(e=>({...e,[s]:"error"})),$("Network error")}finally{S(null)}}},L=(0,g.KC)(e),K=t?L.filter(e=>e.kinds?e.kinds.includes(t):(0,g.CP)(e,"llm")===t):L,B=h.filter(e=>e.providerAlias===R&&(0,g.CP)(e,"llm")===A&&!K.some(t=>t.id===e.id));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,a.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),o&&C&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:C}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[K.map(e=>{let t=`${R}/${e.id}`,s=Object.entries(u).find(([,e])=>e===t)?.[0];return(0,a.jsx)(v,{model:e,fullModel:`${R}/${e.id}`,alias:s,copied:p,onCopy:m,onSetAlias:t=>I(e.id,t),onDeleteAlias:()=>E(s),testStatus:f[e.id],onTest:o?()=>U(e.id):void 0,isTesting:k===e.id,testAlwaysVisible:c,isFree:e.isFree},e.id)}),n&&B.map(e=>(0,a.jsx)(v,{model:{id:e.id,name:e.name},fullModel:`${R}/${e.id}`,copied:p,onCopy:m,onSetAlias:()=>{},onDeleteAlias:()=>M(e.id),testStatus:f[e.id],onTest:o?()=>U(e.id):void 0,isTesting:k===e.id,testAlwaysVisible:c,isCustom:!0},`${e.id}-${e.type}`)),n&&(0,a.jsxs)("button",{onClick:()=>P(!0),className:"flex items-center gap-1.5 px-3 py-2 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,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,a.jsx)(j,{isOpen:_,onSave:async e=>{await O(e),P(!1)},onClose:()=>P(!1)})]})}function N({label:e,children:t}){return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,a.jsx)("span",{className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,a.jsx)("div",{className:"w-full min-w-0 flex-1",children:t})]})}v.propTypes={model:u().shape({id:u().string.isRequired}).isRequired,fullModel:u().string.isRequired,copied:u().string,onCopy:u().func.isRequired,testStatus:u().oneOf(["ok","error"]),isCustom:u().bool,isFree:u().bool,onDeleteAlias:u().func,onTest:u().func,isTesting:u().bool},j.propTypes={isOpen:u().bool.isRequired,onSave:u().func.isRequired,onClose:u().func.isRequired},w.propTypes={providerId:u().string.isRequired,kindFilter:u().string,providerAliasOverride:u().string,realtimeProviderId:u().string,realtimeProviderId:u().string,testable:u().bool,allowCustomModels:u().bool,testAlwaysVisible:u().bool,testAlwaysVisible:u().bool};let k={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
|
|
2
2
|
"results": [
|
|
3
3
|
{ "title": "...", "url": "...", "snippet": "..." }
|
|
4
4
|
]
|
package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-26f454785dc626b1.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3471],{64561:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var a=s(95155),r=s(12115),o=s(35497),i=s(81127),l=s(21931),n=s(1620),d=s(31474),c=s(90620),m=s(93308),x=s(38202);function p(){let{theme:e,setTheme:t,isDark:s}=(0,n.D)(),[p,u]=(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:""}),[P,O]=(0,r.useState)({type:"",message:""}),[I,L]=(0,r.useState)(!1),[R,D]=(0,r.useState)(!1),[U,T]=(0,r.useState)({type:"",message:""}),[A,M]=(0,r.useState)({open:!1,mode:"",password:""}),$=(0,r.useRef)(null),[E,F]=(0,r.useState)({authMode:"password",oidcIssuerUrl:"",oidcClientId:"",oidcScopes:"openid profile email",oidcLoginLabel:"Sign in with OIDC"}),[q,J]=(0,r.useState)(""),[_,H]=(0,r.useState)({type:"",message:""}),[K,Z]=(0,r.useState)(!1),[z,B]=(0,r.useState)(!1),[W,Q]=(0,r.useState)({type:"",message:""}),[G,V]=(0,r.useState)("/api/auth/oidc/callback"),[Y,X]=(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)(()=>{u(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),F({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")&&X(!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)(()=>{V(`${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 O({type:"error",message:"Passwords do not match"});L(!0),O({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?(O({type:"success",message:"Password updated successfully"}),S({current:"",new:"",confirm:""})):O({type:"error",message:t.error||"Failed to update password"})}catch(e){O({type:"error",message:"An error occurred"})}finally{L(!1)}},ep=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)}},eu=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)=>{F(s=>({...s,[e]:t}))},ef=async(e=E.authMode||"password")=>{let t=E.oidcIssuerUrl.trim(),s=E.oidcClientId.trim(),a=E.oidcScopes.trim(),r=E.oidcLoginLabel.trim(),o=q.trim();if("password"!==e&&(!t||!s||!o)&&!w.oidcConfigured)return void H({type:"error",message:"Issuer URL, client ID, and client secret are required to enable OIDC."});Z(!0),H({type:"",message:""}),Q({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})),F({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(""),H({type:"success",message:"oidc"===e?"OIDC login enabled":"both"===e?"Password and OIDC login enabled":"OIDC settings saved"})):H({type:"error",message:n.error||"Failed to save OIDC settings"})}catch(e){H({type:"error",message:"An error occurred"})}finally{Z(!1)}},ej=async()=>{let e=E.oidcIssuerUrl.trim(),t=E.oidcClientId.trim(),s=E.oidcScopes.trim(),a=q.trim();if(!e||!t)return void Q({type:"error",message:"Issuer URL and client ID are required to test the connection."});B(!0),H({type:"",message:""}),Q({type:"",message:""});try{let r=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({authMode:E.authMode||w.authMode||"password",oidcIssuerUrl:e,oidcClientId:t,oidcScopes:s||"openid profile email",oidcLoginLabel:E.oidcLoginLabel.trim()||"Sign in with OIDC",...a?{oidcClientSecret:a}:{}})}),o=await r.json().catch(()=>({}));if(!r.ok)return void Q({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}.`;Q({type:"success",message:e})}else Q({type:"error",message:l.error||"OIDC connection test failed"})}catch(e){Q({type:"error",message:"An error occurred"})}finally{B(!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=>{D(!0),T({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=`polyrouter-backup-${l}.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o),T({type:"success",message:"Database backup downloaded"})}catch(e){T({type:"error",message:e.message||"Failed to export database"})}finally{D(!1)}},eC=async e=>{let t=$.current;if(t){D(!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(),T({type:"success",message:"Database imported successfully"})}catch(e){T({type:"error",message:e.message||"Invalid backup file"})}finally{$.current=null,D(!1)}}},ek=async()=>{let{mode:e,password:t}=A;M({open:!1,mode:"",password:""}),"export"===e?await ev(t):"import"===e&&await eC(t)},eS=!0===w.enableObservability,eP=async()=>{j(!0);try{await fetch("/api/version/shutdown",{method:"POST"})}catch(e){}j(!1),y(!1)},eO=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.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"size-10 sm:size-12 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 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 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 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:"~/.polyrouter/db/data.sqlite"})]})}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,a.jsx)(o.$n,{variant:"secondary",icon:"download",onClick:()=>M({open:!0,mode:"export",password:""}),loading:R,className:"w-full sm:w-auto",children:"Download Backup"}),(0,a.jsx)(o.$n,{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&&($.current=t,T({type:"",message:""}),M({open:!0,mode:"import",password:""}))}})]}),U.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===U.type?"text-red-500":"text-green-600 dark:text-green-400"}`,children:U.message})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"size-10 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 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[p]||"\uD83C\uDF10"})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"shield"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Security"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Require login"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,a.jsx)(o.lM,{checked:!0===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.pd,{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.pd,{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.pd,{type:"password",placeholder:"Confirm new password",value:k.confirm,onChange:e=>S({...k,confirm:e.target.value}),required:!0})]})]}),P.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===P.type?"text-red-500":"text-green-500"}`,children:P.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(o.$n,{type:"submit",variant:"primary",loading:I,className:"w-full sm:w-auto",children:w.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>X(e=>!e),className:"w-full flex items-center gap-3 text-left",children:[(0,a.jsx)("div",{className:"p-2 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:Y?"expand_less":"expand_more"})]}),Y&&(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=E.authMode===e.value;return(0,a.jsxs)("button",{type:"button",onClick:()=>ey("authMode",e.value),className:(0,d.cn)("text-left 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||K,children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:e.title}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted mt-1",children:e.desc})]},e.value)})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Issuer URL"}),(0,a.jsx)(o.pd,{placeholder:"https://auth.example.com/application/o/polyrouter/",value:E.oidcIssuerUrl,onChange:e=>ey("oidcIssuerUrl",e.target.value),disabled:v||K})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Client ID"}),(0,a.jsx)(o.pd,{placeholder:"polyrouter-dashboard",value:E.oidcClientId,onChange:e=>ey("oidcClientId",e.target.value),disabled:v||K})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Client Secret"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Leave blank to keep existing secret",value:q,onChange:e=>J(e.target.value),disabled:v||K}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"This value is write-only after saving."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Scopes"}),(0,a.jsx)(o.pd,{placeholder:"openid profile email",value:E.oidcScopes,onChange:e=>ey("oidcScopes",e.target.value),disabled:v||K})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Login Button Label"}),(0,a.jsx)(o.pd,{placeholder:"Sign in with OIDC",value:E.oidcLoginLabel,onChange:e=>ey("oidcLoginLabel",e.target.value),disabled:v||K})]})]}),(0,a.jsxs)("div",{className:" 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:G})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)(o.$n,{type:"button",variant:"primary",loading:K,onClick:()=>ef(),className:"w-full sm:w-auto",children:"Save auth mode"}),(0,a.jsx)(o.$n,{type:"button",variant:"outline",loading:z,onClick:ej,className:"w-full sm:w-auto",children:"Test connection"})]}),W.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===W.type?"text-red-500":"text-green-500"}`,children:W.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-green-600 dark:text-green-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-green-600 dark:text-green-400",children:"Password and OIDC login are both active."})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 bg-blue-500/10 text-blue-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"route"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Routing Strategy"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Round Robin"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Cycle through accounts to distribute load"})]}),(0,a.jsx)(o.lM,{checked:"round-robin"===w.fallbackStrategy,onChange:()=>ep("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.pd,{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.lM,{checked:"round-robin"===w.comboStrategy,onChange:()=>eu("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.pd,{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.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 bg-purple-500/10 text-purple-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"wifi"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Network"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Outbound Proxy"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Enable proxy for OAuth + provider outbound requests."})]}),(0,a.jsx)(o.lM,{checked:!0===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.pd,{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.pd,{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.$n,{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.$n,{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.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 bg-green-500/10 text-green-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"monitoring"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Observability"})]}),(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Enable Observability"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Record request details for inspection in the logs view"})]}),(0,a.jsx)(o.lM,{checked:eS,onChange:ew,disabled:v})]})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,a.jsx)(o.$n,{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.$n,{variant:"outline",fullWidth:!0,icon:"logout",onClick:eO,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.default,{hideTrigger:!0,isOpen:h,onClose:e=>{b(!1),u(e)}}),(0,a.jsx)(i.ConfirmModal,{isOpen:g,onClose:()=>y(!1),onConfirm:eP,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.default,{isOpen:A.open,onClose:()=>M({open:!1,mode:"",password:""}),title:"Confirm Password",size:"sm",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.$n,{variant:"ghost",onClick:()=>M({open:!1,mode:"",password:""}),disabled:R,children:"Cancel"}),(0,a.jsx)(o.$n,{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.pd,{type:"password",value:A.password,onChange:e=>M(t=>({...t,password:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&A.password&&ek()},placeholder:"Current password",autoFocus:!0})]})]})}},99818:(e,t,s)=>{Promise.resolve().then(s.bind(s,64561))}},e=>{e.O(0,[8010,1321,7451,5497,8441,3794,7358],()=>e(e.s=99818)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[775],{36579:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(95155),a=r(12115);let s=[{id:"gpt-realtime-2",name:"GPT Realtime 2"},{id:"gpt-realtime",name:"GPT Realtime"},{id:"gpt-realtime-mini",name:"GPT Realtime Mini"}];function o({providerId:e="codex",providerName:t}){let r=(0,a.useRef)(null),l=(0,a.useRef)(null),c=(0,a.useRef)(null),u=(0,a.useRef)(null),d=(0,a.useRef)(null),p=(0,a.useRef)(0),m=(0,a.useRef)(new Set),[h,f]=(0,a.useState)("Idle"),[x,b]=(0,a.useState)(""),[g,y]=(0,a.useState)(!1),[w,S]=(0,a.useState)(""),[N,C]=(0,a.useState)(""),[j,v]=(0,a.useState)("gpt-realtime-2"),k=(0,a.useCallback)(()=>{for(let e of m.current)try{e.stop()}catch{}m.current.clear(),p.current=0},[]),R=(0,a.useCallback)(()=>{y(!1),u.current?.disconnect(),d.current?.disconnect(),u.current=null,d.current=null,l.current?.getTracks().forEach(e=>e.stop()),l.current=null,r.current&&r.current.readyState<WebSocket.CLOSING&&r.current.close(),r.current=null,k(),f("Stopped")},[k]),_=(0,a.useCallback)(e=>{let t=c.current;if(!t||!e)return;let r=t.createBufferSource();r.buffer=function(e,t){let r=function(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)r[e]=t.charCodeAt(e);return r}(t),n=new DataView(r.buffer,r.byteOffset,r.byteLength),a=e.createBuffer(1,Math.floor(r.byteLength/2),24e3),s=a.getChannelData(0);for(let e=0;e<s.length;e+=1)s[e]=n.getInt16(2*e,!0)/32768;return a}(t,e),r.connect(t.destination);let n=Math.max(t.currentTime,p.current);r.start(n),p.current=n+r.buffer.duration,m.current.add(r),r.onended=()=>m.current.delete(r)},[]),A=(0,a.useCallback)(async()=>{if(!g){b(""),S(""),C(""),f("Requesting microphone permission…");try{let t=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0}}),n=window.AudioContext||window.webkitAudioContext,a=c.current||new n({sampleRate:24e3});c.current=a,await a.resume(),l.current=t;let s="https:"===window.location.protocol?"wss":"ws",o=new WebSocket(`${s}://${window.location.host}/v1/realtime?provider=${encodeURIComponent(e)}&model=${encodeURIComponent(j)}`);r.current=o,o.onopen=()=>{if(r.current!==o)return;let e=a.createMediaStreamSource(t),n=a.createScriptProcessor(4096,1,1);e.connect(n),n.connect(a.destination),n.onaudioprocess=e=>{if(o.readyState!==WebSocket.OPEN)return;let t=function(e){let t=new Int16Array(e.length);for(let r=0;r<e.length;r+=1){let n=Math.max(-1,Math.min(1,e[r]));t[r]=n<0?32768*n:32767*n}return new Uint8Array(t.buffer)}(e.inputBuffer.getChannelData(0));o.send(JSON.stringify({type:"input_audio_buffer.append",audio:function(e){let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)}(t)}))},d.current=e,u.current=n,y(!0),f("Listening")},o.onmessage=({data:e})=>{let t;try{t=JSON.parse(e)}catch{return}("response.output_audio.delta"===t.type||"response.audio.delta"===t.type)&&t.delta&&_(t.delta),("response.output_audio_transcript.delta"===t.type||"response.audio_transcript.delta"===t.type)&&t.delta&&C(e=>e+t.delta),"conversation.item.input_audio_transcription.completed"===t.type&&t.transcript&&S(t.transcript),"input_audio_buffer.speech_started"===t.type&&(k(),f("Listening")),("response.audio.done"===t.type||"response.done"===t.type)&&f("Listening"),"error"===t.type&&b(t.error?.message||"Realtime connection failed.")},o.onerror=()=>b("Unable to connect to the local realtime service."),o.onclose=()=>{r.current===o&&(r.current=null,y(!1),f("Disconnected"))}}catch(e){b(e?.name==="NotAllowedError"?"Microphone permission was denied.":e?.message||"Could not start the microphone."),R()}}},[g,j,e,_,R,k]);return(0,a.useEffect)(()=>()=>{R(),c.current?.close().catch(()=>{})},[R]),(0,n.jsxs)("section",{className:"max-w-3xl mx-auto space-y-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold text-text-main",children:"Speech to Speech"}),(0,n.jsxs)("p",{className:"mt-1 text-sm text-text-muted",children:["Talk naturally using your connected ",t||"OpenAI"," account. Audio stays between this browser, your local
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[775],{36579:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(95155),a=r(12115);let s=[{id:"gpt-realtime-2",name:"GPT Realtime 2"},{id:"gpt-realtime",name:"GPT Realtime"},{id:"gpt-realtime-mini",name:"GPT Realtime Mini"}];function o({providerId:e="codex",providerName:t}){let r=(0,a.useRef)(null),l=(0,a.useRef)(null),c=(0,a.useRef)(null),u=(0,a.useRef)(null),d=(0,a.useRef)(null),p=(0,a.useRef)(0),m=(0,a.useRef)(new Set),[h,f]=(0,a.useState)("Idle"),[x,b]=(0,a.useState)(""),[g,y]=(0,a.useState)(!1),[w,S]=(0,a.useState)(""),[N,C]=(0,a.useState)(""),[j,v]=(0,a.useState)("gpt-realtime-2"),k=(0,a.useCallback)(()=>{for(let e of m.current)try{e.stop()}catch{}m.current.clear(),p.current=0},[]),R=(0,a.useCallback)(()=>{y(!1),u.current?.disconnect(),d.current?.disconnect(),u.current=null,d.current=null,l.current?.getTracks().forEach(e=>e.stop()),l.current=null,r.current&&r.current.readyState<WebSocket.CLOSING&&r.current.close(),r.current=null,k(),f("Stopped")},[k]),_=(0,a.useCallback)(e=>{let t=c.current;if(!t||!e)return;let r=t.createBufferSource();r.buffer=function(e,t){let r=function(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)r[e]=t.charCodeAt(e);return r}(t),n=new DataView(r.buffer,r.byteOffset,r.byteLength),a=e.createBuffer(1,Math.floor(r.byteLength/2),24e3),s=a.getChannelData(0);for(let e=0;e<s.length;e+=1)s[e]=n.getInt16(2*e,!0)/32768;return a}(t,e),r.connect(t.destination);let n=Math.max(t.currentTime,p.current);r.start(n),p.current=n+r.buffer.duration,m.current.add(r),r.onended=()=>m.current.delete(r)},[]),A=(0,a.useCallback)(async()=>{if(!g){b(""),S(""),C(""),f("Requesting microphone permission…");try{let t=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0}}),n=window.AudioContext||window.webkitAudioContext,a=c.current||new n({sampleRate:24e3});c.current=a,await a.resume(),l.current=t;let s="https:"===window.location.protocol?"wss":"ws",o=new WebSocket(`${s}://${window.location.host}/v1/realtime?provider=${encodeURIComponent(e)}&model=${encodeURIComponent(j)}`);r.current=o,o.onopen=()=>{if(r.current!==o)return;let e=a.createMediaStreamSource(t),n=a.createScriptProcessor(4096,1,1);e.connect(n),n.connect(a.destination),n.onaudioprocess=e=>{if(o.readyState!==WebSocket.OPEN)return;let t=function(e){let t=new Int16Array(e.length);for(let r=0;r<e.length;r+=1){let n=Math.max(-1,Math.min(1,e[r]));t[r]=n<0?32768*n:32767*n}return new Uint8Array(t.buffer)}(e.inputBuffer.getChannelData(0));o.send(JSON.stringify({type:"input_audio_buffer.append",audio:function(e){let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)}(t)}))},d.current=e,u.current=n,y(!0),f("Listening")},o.onmessage=({data:e})=>{let t;try{t=JSON.parse(e)}catch{return}("response.output_audio.delta"===t.type||"response.audio.delta"===t.type)&&t.delta&&_(t.delta),("response.output_audio_transcript.delta"===t.type||"response.audio_transcript.delta"===t.type)&&t.delta&&C(e=>e+t.delta),"conversation.item.input_audio_transcription.completed"===t.type&&t.transcript&&S(t.transcript),"input_audio_buffer.speech_started"===t.type&&(k(),f("Listening")),("response.audio.done"===t.type||"response.done"===t.type)&&f("Listening"),"error"===t.type&&b(t.error?.message||"Realtime connection failed.")},o.onerror=()=>b("Unable to connect to the local realtime service."),o.onclose=()=>{r.current===o&&(r.current=null,y(!1),f("Disconnected"))}}catch(e){b(e?.name==="NotAllowedError"?"Microphone permission was denied.":e?.message||"Could not start the microphone."),R()}}},[g,j,e,_,R,k]);return(0,a.useEffect)(()=>()=>{R(),c.current?.close().catch(()=>{})},[R]),(0,n.jsxs)("section",{className:"max-w-3xl mx-auto space-y-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold text-text-main",children:"Speech to Speech"}),(0,n.jsxs)("p",{className:"mt-1 text-sm text-text-muted",children:["Talk naturally using your connected ",t||"OpenAI"," account. Audio stays between this browser, your local PolyRouter, and the realtime provider."]})]}),(0,n.jsxs)("div",{className:"border border-border-subtle bg-surface p-6 space-y-5",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"font-medium text-text-main",children:h}),x&&(0,n.jsx)("p",{role:"alert",className:"mt-1 text-sm text-red-500",children:x})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("select",{value:j,onChange:e=>v(e.target.value),disabled:g,className:"px-3 py-2 text-sm border border-border-subtle bg-background text-text-main","aria-label":"Realtime model",children:s.map(e=>(0,n.jsx)("option",{value:e.id,children:e.name},e.id))}),g&&(0,n.jsx)("button",{type:"button",onClick:()=>{r.current?.send(JSON.stringify({type:"response.cancel"})),k()},className:"px-4 py-2 text-sm border border-border-subtle hover:bg-surface-2",children:"Interrupt"}),(0,n.jsx)("button",{type:"button",onClick:g?R:A,className:"px-4 py-2 text-sm font-medium bg-primary text-white hover:opacity-90",children:g?"Stop":"Start talking"})]})]}),(0,n.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,n.jsx)(i,{title:"You said",text:w,empty:"Your speech transcript will appear here."}),(0,n.jsx)(i,{title:"Assistant",text:N,empty:"The assistant’s response will appear here."})]})]})]})}function i({title:e,text:t,empty:r}){return(0,n.jsxs)("div",{className:"min-h-32 border border-border-subtle bg-bg p-4",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-text-main",children:e}),(0,n.jsx)("p",{className:"mt-2 text-sm text-text-muted whitespace-pre-wrap",children:t||r})]})}},95109:(e,t,r)=>{Promise.resolve().then(r.bind(r,36579))}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=95109)),_N_E=e.O()}]);
|
package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-07a0044d9e135cb8.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9516],{64082:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>b});var s=i(95155),r=i(35497),n=i(11059);let a="hkbulbul/polyrouter",o="master",l="skills",c=`https://github.com/${a}`,d=`https://raw.githubusercontent.com/${a}/refs/heads/${o}/${l}`,m=`https://github.com/${a}/blob/${o}/${l}`,p=[{id:"polyrouter",name:"PolyRouter (Entry)",description:"Setup + index of all capabilities. Start here — covers base URL, auth, model discovery, and links to every capability skill.",endpoint:null,icon:"hub",isEntry:!0},{id:"polyrouter-chat",name:"Chat",description:"Chat / code-gen via OpenAI or Anthropic format with streaming.",endpoint:"/v1/chat/completions",icon:"chat"},{id:"polyrouter-image",name:"Image Generation",description:"Text-to-image via DALL-E, Imagen, FLUX, MiniMax, SDWebUI…",endpoint:"/v1/images/generations",icon:"image"},{id:"polyrouter-tts",name:"Text-to-Speech",description:"OpenAI / ElevenLabs / Edge / Google / Deepgram voices.",endpoint:"/v1/audio/speech",icon:"record_voice_over"},{id:"polyrouter-stt",name:"Speech-to-Text",description:"Transcribe audio via OpenAI Whisper, Groq, Gemini, Deepgram, AssemblyAI…",endpoint:"/v1/audio/transcriptions",icon:"mic"},{id:"polyrouter-embeddings",name:"Embeddings",description:"Vectors for RAG / semantic search via OpenAI, Gemini, Mistral…",endpoint:"/v1/embeddings",icon:"scatter_plot"},{id:"polyrouter-web-search",name:"Web Search",description:"Tavily / Exa / Brave / Serper / SearXNG / Google PSE / You.com.",endpoint:"/v1/search",icon:"search"},{id:"polyrouter-web-fetch",name:"Web Fetch",description:"URL → markdown / text / HTML via Firecrawl, Jina, Tavily, Exa.",endpoint:"/v1/web/fetch",icon:"language"}];function x(e){return`${d}/${e}/SKILL.md`}function h({value:e,label:t="Copy link"}){let{copied:i,copy:r}=(0,n.C)(2e3);return(0,s.jsxs)("button",{onClick:()=>r(e),className:"px-2 py-1 bg-primary text-white text-[11px] font-medium hover:bg-primary/90 transition-colors cursor-pointer shrink-0 inline-flex items-center gap-1",title:e,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:i?"check":"content_copy"}),i?"Copied!":t]})}function u({skill:e}){var t;let i=x(e.id);return(0,s.jsxs)("div",{className:`flex items-start gap-3 p-4 border shadow-[var(--shadow-soft)] transition-colors ${e.isEntry?"border-brand-500/40 bg-brand-500/5":"border-border-subtle bg-surface hover:bg-surface-2"}`,children:[(0,s.jsx)("div",{className:`size-9 flex items-center justify-center shrink-0 ${e.isEntry?"bg-primary text-white":"bg-primary/10 text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e.icon})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("h3",{className:"font-semibold text-sm text-text-main",children:e.name}),e.isEntry&&(0,s.jsx)(r.Ex,{variant:"primary",size:"sm",children:"START HERE"}),e.endpoint&&(0,s.jsx)(r.Ex,{variant:"default",size:"sm",children:(0,s.jsx)("code",{className:"text-[10px]",children:e.endpoint})})]}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:e.description}),(0,s.jsxs)("a",{href:(t=e.id,`${m}/${t}/SKILL.md`),target:"_blank",rel:"noreferrer",className:"text-[11px] text-text-muted hover:text-primary mt-1 inline-flex items-center gap-1 break-all",children:[i,(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"open_in_new"})]})]}),(0,s.jsx)(h,{value:i})]})}function b(){return(0,s.jsxs)("div",{className:"max-w-4xl mx-auto space-y-6",children:[(0,s.jsxs)(r.Zp,{padding:"md",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted mb-2",children:"Paste this to your AI:"}),(0,s.jsxs)("div",{className:"px-3 py-2 bg-surface-2 font-mono text-[12px] text-text-main",children:["Read this skill and use it: ",x("polyrouter")]})]}),(0,s.jsx)("div",{className:"space-y-2",children:p.map(e=>(0,s.jsx)(u,{skill:e},e.id))}),(0,s.jsx)(r.Zp,{padding:"md",children:(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"More on GitHub"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Browse source, README, and examples."})]}),(0,s.jsxs)("a",{href:`${c}/tree/master/skills`,target:"_blank",rel:"noreferrer",className:"text-sm text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"open_in_new"}),"View on GitHub"]})]})})]})}},73215:(e,t,i)=>{Promise.resolve().then(i.bind(i,64082))}},e=>{e.O(0,[8010,1321,7451,5497,8441,3794,7358],()=>e(e.s=73215)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9839],{15536:(e,t,a)=>{"use strict";a.d(t,{Cp:()=>n,Hx:()=>r,Iv:()=>d,Nv:()=>x,RL:()=>c,ev:()=>m,fl:()=>i,hT:()=>s,oX:()=>l,t6:()=>o});let s=["zh-CN","zh-TW"],l=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],r=2e3,n=3e5,i=5e3,o=5,c=1e4,d=5e3,m=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],x=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}]},39863:(e,t,a)=>{Promise.resolve().then(a.bind(a,61203))},61203:(e,t,a)=>{"use strict";a.d(t,{default:()=>c});var s=a(95155),l=a(12115),r=a(35497),n=a(11059),i=a(73006),o=a(15536);function c(){let[e,t]=(0,l.useState)(!0),[a,c]=(0,l.useState)(!1),[d,m]=(0,l.useState)("http://localhost:8787"),[x,h]=(0,l.useState)({installed:!1,running:!1,python:null,loading:!0}),[p,u]=(0,l.useState)(!1),[f,g]=(0,l.useState)(!1),[b,y]=(0,l.useState)(""),[j,v]=(0,l.useState)({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),[N,w]=(0,l.useState)([]),[k,C]=(0,l.useState)(!1),[S,E]=(0,l.useState)(""),[P,T]=(0,l.useState)(null),[I,$]=(0,l.useState)(""),[R,L]=(0,l.useState)(null),[O,U]=(0,l.useState)(!1),[H,A]=(0,l.useState)(!0),[M,_]=(0,l.useState)(!1),D=(0,l.useRef)(null),[F,B]=(0,l.useState)(!1),[J,W]=(0,l.useState)("full"),[z,G]=(0,l.useState)(!1),[K,X]=(0,l.useState)("full"),[q,Y]=(0,l.useState)(!1),[Q,Z]=(0,l.useState)(25e3),[V,ee]=(0,l.useState)({installed:!1,installing:!1,running:!1,version:null,loading:!0}),[et,ea]=(0,l.useState)(null),[es,el]=(0,l.useState)(!1),[er,en]=(0,l.useState)(!1),[ei,eo]=(0,l.useState)(""),[ec,ed]=(0,l.useState)("en"),{copied:em,copy:ex}=(0,n.C)();(0,l.useEffect)(()=>(ed((0,i.kk)()),(0,i.oQ)(()=>ed((0,i.kk)()))),[]);let eh=o.hT.includes(ec),ep=eh?o.ev:o.ev.filter(e=>!e.wenyan);(0,l.useEffect)(()=>{let e=o.ev.find(e=>e.id===J);e?.wenyan&&!eh&&(W("ultra"),eu({cavemanLevel:"ultra"}))},[eh,J]);let eu=async e=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){console.log("Error updating setting:",e)}},ef=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&t(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},eg=async()=>{let e=d.trim()||"http://localhost:8787";m(e),await eu({headroomUrl:e}),eb()},eb=(0,l.useCallback)(async()=>{h(e=>({...e,loading:!0}));try{let e=await fetch("/api/headroom/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();if(h({...t,loading:!1}),!t?.installed){v({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),w([]);return}try{let e=await fetch("/api/headroom/extras",{headers:{"Cache-Control":"no-store"}});if(!e.ok)throw Error("extras status failed");let t=await e.json();v(e=>({...e,version:t.version??null,extras:t.extras||{code:!1,ml:!1},available:t.available||["code","ml"],loading:!1})),w([])}catch{v({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),w([])}}catch{h({installed:!1,running:!1,python:null,loading:!1}),v({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),w([])}},[]),ey=(0,l.useCallback)(async()=>{y(""),g(!0);try{let e=await fetch("/api/headroom/start",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Failed to start proxy");await eb()}catch(e){y(e.message)}finally{g(!1)}},[eb]),ej=(0,l.useCallback)(async()=>{g(!0);try{await fetch("/api/headroom/stop",{method:"POST"}),await eb()}finally{g(!1)}},[eb]),ev=(0,l.useCallback)(()=>{$(""),D.current&&clearInterval(D.current);let e=async()=>{try{let e=await fetch("/api/headroom/extras?log=1",{headers:{"Cache-Control":"no-store"}}),t=await e.json().catch(()=>({}));"string"==typeof t.log&&$(t.log)}catch{}};e(),D.current=setInterval(e,1500)},[]),eN=(0,l.useCallback)(()=>{D.current&&(clearInterval(D.current),D.current=null)},[]);(0,l.useEffect)(()=>()=>eN(),[eN]);let ew=(0,l.useCallback)(async()=>{if(0!==N.length){C(!0),E(""),ev();try{let e=await fetch("/api/headroom/extras",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:N})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Install failed");v(e=>({...e,version:t.version??e.version,extras:t.extras||e.extras})),w([])}catch(e){E(e.message)}finally{eN(),C(!1)}}},[N,ev,eN]),ek=(0,l.useCallback)(async e=>{T(e),E(""),ev();try{let t=await fetch("/api/headroom/extras",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:[e]})}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||"Remove failed");v(e=>({...e,version:a.version??e.version,extras:a.extras||e.extras}))}catch(e){E(e.message)}finally{eN(),T(null)}},[ev,eN]),eC=(0,l.useCallback)(()=>{if(0!==N.length){if(N.includes("ml"))return void L({title:"Install [ml]",message:"[ml] downloads ~1 GB (torch + huggingface-hub). Continue?",confirmText:"Install",variant:"primary",onConfirm:ew});ew()}},[N,ew]),eS=(0,l.useCallback)(e=>{L({title:`Remove [${e}]`,message:`Remove [${e}] and its packages?`,confirmText:"Remove",variant:"danger",onConfirm:()=>ek(e)})},[ek]),eE=(0,l.useCallback)(async(e,t)=>{if(E(""),"code"===e&&U(t),"ml"===e&&A(t),await eu({["code"===e?"headroomCodeAware":"headroomKompress"]:t}),x.running){_(!0);try{let e=await fetch("/api/headroom/restart",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Restart failed");await eb()}catch(e){E(e.message)}finally{_(!1)}}},[x.running,eb]),eP=(0,l.useCallback)(async()=>{ee(e=>({...e,loading:!0}));try{let e=await fetch("/api/pxpipe/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();ee({...t,loading:!1}),"number"==typeof t.minChars&&Z(t.minChars)}catch{ee({installed:!1,installing:!1,running:!1,version:null,loading:!1})}},[]),eT=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/pxpipe/health",{method:"POST"});ea(await e.json())}catch(e){ea({healthy:!1,checks:[],error:e.message})}},[]),eI=(0,l.useCallback)(async e=>{eo(""),en(!0);try{let t=await fetch(`/api/pxpipe/${e}`,{method:"POST"}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||`PXPIPE ${e} failed`);await eP(),await eT()}catch(e){eo(e.message)}finally{en(!1)}},[eP,eT]);(0,l.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/settings");if(e.ok){let a=await e.json();t(!1!==a.rtkEnabled),c(!!a.headroomEnabled),m(a.headroomUrl||"http://localhost:8787"),U(!0===a.headroomCodeAware),A(!1!==a.headroomKompress),B(!!a.cavemanEnabled),W(a.cavemanLevel||"full"),G(!!a.ponytailEnabled),X(a.ponytailLevel||"full"),Y(!!a.pxpipeEnabled),"number"==typeof a.pxpipeMinChars&&Z(a.pxpipeMinChars),eb(),eP().then(eT)}}catch{}})()},[eb,eP,eT]);let e$=!!x.running,eR=x.loading?"Checking…":e$?"Running":!1===x.localUrl||x.installed?!1!==x.localUrl?"Stopped":"External":"Not installed",eL=!1!==x.localUrl,eO=!!x.canStart,eU=eL&&!!x.managedPid,eH=et?.healthy===!0,eA=V.loading?"Checking…":V.installing?"Installing…":V.installed?eH?"Healthy":V.running?"Running":"Stopped":"Not installed";return eH||V.running,(0,s.jsxs)("div",{className:"space-y-6 p-6",children:[(0,s.jsxs)(r.Zp,{id:"rtk",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,s.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,s.jsx)(r.lM,{checked:e,onChange:()=>ef(!e)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-4 gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress context"," ",(0,s.jsx)("a",{href:"https://github.com/chopratejas/headroom",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Headroom)"})]}),(0,s.jsx)("span",{className:`text-xs px-2 py-0.5 ${e$?"bg-success/15 text-success":"bg-warning/15 text-warning"}`,children:eR}),(0,s.jsx)("button",{type:"button",onClick:()=>u(!0),className:"text-xs text-primary underline hover:opacity-80",children:e$?"Manage":"Setup"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Compress prompts via /v1/compress before routing to the model"})]}),(0,s.jsx)(r.lM,{checked:a&&e$,disabled:!e$,onChange:()=>{var e;let t;return e=!a,void(m(t=d.trim()||"http://localhost:8787"),c(e),eu({headroomEnabled:e,headroomUrl:t}))}})]}),x.installed&&(0,s.jsxs)("div",{className:"mb-3 ml-1 pl-3 pb-4 border-l-2 border-border",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Compression extras",j.version?` \xb7 v${j.version}`:"",":"]}),j.available.map(e=>{let t=!!j.extras[e],a=N.includes(e),l="code"===e?"tree-sitter AST compression for code responses":"Kompress-v2 HF model for prose/agentic traces (~+1GB)";if(t){let t="code"===e?O:H;return(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-xs px-2 py-1 border border-success/40 bg-success/5 text-text",title:l,children:[(0,s.jsx)(r.lM,{size:"sm",checked:t,disabled:M,onChange:()=>eE(e,!t)}),(0,s.jsxs)("span",{className:"font-medium",children:["[",e,"]"]}),(0,s.jsx)("button",{type:"button",onClick:()=>eS(e),disabled:P===e,className:"ml-1 text-error underline hover:opacity-80 disabled:opacity-50",title:`Uninstall [${e}]`,children:P===e?"Uninstalling…":"Uninstall"})]},e)}return(0,s.jsxs)("label",{className:`flex items-center gap-1.5 text-xs px-2 py-1 border cursor-pointer transition-colors ${a?"border-primary bg-primary/10 text-primary":"border-border text-text-muted hover:bg-surface-2"}`,title:l,children:[(0,s.jsx)("input",{type:"checkbox",className:"w-3 h-3",checked:a,onChange:()=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}}),(0,s.jsxs)("span",{className:"font-medium",children:["[",e,"]"]}),(0,s.jsx)("span",{className:"opacity-70",children:"not installed"})]},e)}),N.length>0&&(0,s.jsx)("button",{onClick:eC,disabled:k,className:"text-xs px-2.5 py-1 bg-primary text-white hover:opacity-90 disabled:opacity-50",children:k?"Installing…":`Install [proxy,${N.join(",")}]`})]}),S&&(0,s.jsx)("p",{className:"text-xs text-error mt-1",children:S}),M&&(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Restarting proxy…"}),(k||P)&&I&&(0,s.jsx)("pre",{className:"mt-2 max-h-32 overflow-auto bg-surface-2 p-2 text-[10px] leading-tight text-text-muted whitespace-pre-wrap",children:I}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Installing adds the package; use ",(0,s.jsx)("code",{children:"on"}),"/",(0,s.jsx)("code",{children:"off"})," ","to activate it (restarts the proxy). Default install is"," ",(0,s.jsx)("code",{children:"[proxy]"})," only (SmartCrusher for JSON). Adding"," ",(0,s.jsx)("code",{children:"[code]"})," enables AST compression (Python/JS/TS/Go/Rust/Java/C/C++/Perl). Adding ",(0,s.jsx)("code",{children:"[ml]"})," ","enables the Kompress-v2 HF model for prose/agentic traces but adds ~1 GB (torch + huggingface-hub)."]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,s.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[F&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:ep.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;W(t=e.id),eu({cavemanLevel:t})},className:`px-3 py-1.5 text-xs font-medium border transition-colors ${J===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:o.ev.find(e=>e.id===J)?.desc})]}),(0,s.jsx)(r.lM,{checked:F,onChange:()=>{var e;B(e=!F),eu({cavemanEnabled:e})}})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Lazy senior dev"," ",(0,s.jsx)("a",{href:"https://github.com/DietrichGebert/ponytail",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Ponytail)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Bias the model toward minimal code: YAGNI, reuse stdlib, deletion over addition"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[z&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:o.Nv.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;X(t=e.id),eu({ponytailLevel:t})},className:`px-3 py-1.5 text-xs font-medium border transition-colors ${K===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:o.Nv.find(e=>e.id===K)?.desc})]}),(0,s.jsx)(r.lM,{checked:z,onChange:()=>{var e;G(e=!z),eu({ponytailEnabled:e})}})]})]}),!1]}),(0,s.jsx)(r.aF,{isOpen:p,title:e$?"Headroom":"Setup Headroom",onClose:()=>u(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsx)("span",{className:e$?"text-success":"text-warning",children:eR})]}),e$&&(0,s.jsx)("a",{href:"/api/headroom/proxy/dashboard",target:"_blank",rel:"noreferrer",className:"w-full border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Headroom Dashboard"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Proxy URL"}),(0,s.jsx)(r.pd,{value:d,onChange:e=>m(e.target.value),onBlur:eg,placeholder:"http://localhost:8787",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a local proxy for Start/Stop, or an external Docker sidecar like http://headroom:8787."})]}),eU?(0,s.jsx)(r.$n,{onClick:ej,variant:"ghost",fullWidth:!0,disabled:f,children:f?"Stopping…":"Stop Headroom"}):e$?(0,s.jsx)("p",{className:"text-sm text-success",children:"Headroom proxy is reachable. You can enable the token saver."}):eO?(0,s.jsx)(r.$n,{onClick:ey,fullWidth:!0,disabled:f,children:f?"Starting…":"Start Headroom"}):eL?x.python?(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Install then click Start:"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("pre",{className:"flex-1 bg-black/5 dark:bg-white/5 p-2 text-xs font-mono overflow-x-auto",children:'pip install "headroom-ai[proxy]"'}),(0,s.jsx)(r.$n,{size:"sm",variant:"ghost",onClick:()=>ex('pip install "headroom-ai[proxy]"'),children:em?"Copied":"Copy"})]})]}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Python ≥ 3.10 required for local managed mode. Install Python first, or use an external proxy URL."}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Start Headroom separately at the configured URL, then recheck."}),b&&(0,s.jsx)("p",{className:"text-sm text-warning",children:b}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.$n,{onClick:()=>eb(),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(r.$n,{onClick:()=>u(!1),fullWidth:!0,children:"Done"})]})]})}),(0,s.jsx)(r.aF,{isOpen:!1,title:V.installed?"PXPIPE":"Setup PXPIPE",onClose:()=>el(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Compress prompts using multimodal encoding. Runs in-process — no extra server or environment variables required."}),(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsxs)("span",{className:eH||V.running?"text-success":"text-warning",children:[eA,V.version?` \xb7 v${V.version}`:""]})]}),et?.checks?.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-1 border border-border p-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-1",children:"Health check"}),et.checks.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,s.jsxs)("span",{className:e.ok?"text-success":"text-warning",children:[e.ok?"●":"○"," ",e.label]}),e.detail&&(0,s.jsx)("span",{className:"text-text-muted font-mono truncate max-w-[50%]",children:e.detail})]},e.id)),et.error&&(0,s.jsx)("p",{className:"text-xs text-warning mt-1",children:et.error})]}),V.installed?(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[V.running?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.$n,{onClick:()=>eI("restart"),variant:"ghost",disabled:er,children:"Restart"}),(0,s.jsx)(r.$n,{onClick:()=>eI("stop"),variant:"ghost",disabled:er,children:"Stop"})]}):(0,s.jsx)(r.$n,{onClick:()=>eI("start"),disabled:er,children:er?"Starting…":"Start"}),(0,s.jsx)(r.$n,{onClick:()=>eI("install"),variant:"ghost",disabled:er,children:"Repair"}),(0,s.jsx)("a",{href:"/dashboard/pxpipe#logs",className:"col-span-2 border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Logs"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-warning",children:"PXPIPE is not installed."}),(0,s.jsx)(r.$n,{onClick:()=>eI("install"),fullWidth:!0,disabled:er||V.installing,children:er||V.installing?"Installing…":"Install"}),(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Installs the npm package ",(0,s.jsx)("code",{className:"font-mono",children:"pxpipe-proxy"})," into the 9Router data directory. May take a few minutes."]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Minimum prompt size (chars)"}),(0,s.jsx)(r.pd,{value:String(Q),onChange:e=>Z(e.target.value),onBlur:()=>{let e=Math.max(0,Number(Q)||25e3);Z(e),eu({pxpipeMinChars:e})},placeholder:"25000",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Requests smaller than this bypass PXPIPE and are sent as-is."})]}),ei&&(0,s.jsx)("p",{className:"text-sm text-warning",children:ei}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.$n,{onClick:()=>eP().then(eT),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(r.$n,{onClick:()=>el(!1),fullWidth:!0,children:"Done"})]})]})}),(0,s.jsx)(r.uo,{isOpen:!!R,onClose:()=>L(null),onConfirm:()=>{let e=R?.onConfirm;L(null),e?.()},title:R?.title,message:R?.message,confirmText:R?.confirmText,variant:R?.variant})]})}}},e=>{e.O(0,[8010,1321,7451,5497,8441,3794,7358],()=>e(e.s=39863)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9839],{15536:(e,t,a)=>{"use strict";a.d(t,{Cp:()=>n,Hx:()=>r,Iv:()=>d,Nv:()=>x,RL:()=>c,ev:()=>m,fl:()=>i,hT:()=>s,oX:()=>l,t6:()=>o});let s=["zh-CN","zh-TW"],l=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],r=2e3,n=3e5,i=5e3,o=5,c=1e4,d=5e3,m=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],x=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}]},39863:(e,t,a)=>{Promise.resolve().then(a.bind(a,61203))},61203:(e,t,a)=>{"use strict";a.d(t,{default:()=>c});var s=a(95155),l=a(12115),r=a(35497),n=a(11059),i=a(73006),o=a(15536);function c(){let[e,t]=(0,l.useState)(!0),[a,c]=(0,l.useState)(!1),[d,m]=(0,l.useState)("http://localhost:8787"),[x,h]=(0,l.useState)({installed:!1,running:!1,python:null,loading:!0}),[p,u]=(0,l.useState)(!1),[f,g]=(0,l.useState)(!1),[b,y]=(0,l.useState)(""),[j,v]=(0,l.useState)({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),[N,w]=(0,l.useState)([]),[k,C]=(0,l.useState)(!1),[S,E]=(0,l.useState)(""),[P,T]=(0,l.useState)(null),[I,$]=(0,l.useState)(""),[R,L]=(0,l.useState)(null),[O,U]=(0,l.useState)(!1),[H,A]=(0,l.useState)(!0),[M,_]=(0,l.useState)(!1),D=(0,l.useRef)(null),[F,B]=(0,l.useState)(!1),[J,W]=(0,l.useState)("full"),[z,G]=(0,l.useState)(!1),[K,X]=(0,l.useState)("full"),[q,Y]=(0,l.useState)(!1),[Q,Z]=(0,l.useState)(25e3),[V,ee]=(0,l.useState)({installed:!1,installing:!1,running:!1,version:null,loading:!0}),[et,ea]=(0,l.useState)(null),[es,el]=(0,l.useState)(!1),[er,en]=(0,l.useState)(!1),[ei,eo]=(0,l.useState)(""),[ec,ed]=(0,l.useState)("en"),{copied:em,copy:ex}=(0,n.C)();(0,l.useEffect)(()=>(ed((0,i.kk)()),(0,i.oQ)(()=>ed((0,i.kk)()))),[]);let eh=o.hT.includes(ec),ep=eh?o.ev:o.ev.filter(e=>!e.wenyan);(0,l.useEffect)(()=>{let e=o.ev.find(e=>e.id===J);e?.wenyan&&!eh&&(W("ultra"),eu({cavemanLevel:"ultra"}))},[eh,J]);let eu=async e=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){console.log("Error updating setting:",e)}},ef=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&t(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},eg=async()=>{let e=d.trim()||"http://localhost:8787";m(e),await eu({headroomUrl:e}),eb()},eb=(0,l.useCallback)(async()=>{h(e=>({...e,loading:!0}));try{let e=await fetch("/api/headroom/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();if(h({...t,loading:!1}),!t?.installed){v({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),w([]);return}try{let e=await fetch("/api/headroom/extras",{headers:{"Cache-Control":"no-store"}});if(!e.ok)throw Error("extras status failed");let t=await e.json();v(e=>({...e,version:t.version??null,extras:t.extras||{code:!1,ml:!1},available:t.available||["code","ml"],loading:!1})),w([])}catch{v({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),w([])}}catch{h({installed:!1,running:!1,python:null,loading:!1}),v({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),w([])}},[]),ey=(0,l.useCallback)(async()=>{y(""),g(!0);try{let e=await fetch("/api/headroom/start",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Failed to start proxy");await eb()}catch(e){y(e.message)}finally{g(!1)}},[eb]),ej=(0,l.useCallback)(async()=>{g(!0);try{await fetch("/api/headroom/stop",{method:"POST"}),await eb()}finally{g(!1)}},[eb]),ev=(0,l.useCallback)(()=>{$(""),D.current&&clearInterval(D.current);let e=async()=>{try{let e=await fetch("/api/headroom/extras?log=1",{headers:{"Cache-Control":"no-store"}}),t=await e.json().catch(()=>({}));"string"==typeof t.log&&$(t.log)}catch{}};e(),D.current=setInterval(e,1500)},[]),eN=(0,l.useCallback)(()=>{D.current&&(clearInterval(D.current),D.current=null)},[]);(0,l.useEffect)(()=>()=>eN(),[eN]);let ew=(0,l.useCallback)(async()=>{if(0!==N.length){C(!0),E(""),ev();try{let e=await fetch("/api/headroom/extras",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:N})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Install failed");v(e=>({...e,version:t.version??e.version,extras:t.extras||e.extras})),w([])}catch(e){E(e.message)}finally{eN(),C(!1)}}},[N,ev,eN]),ek=(0,l.useCallback)(async e=>{T(e),E(""),ev();try{let t=await fetch("/api/headroom/extras",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:[e]})}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||"Remove failed");v(e=>({...e,version:a.version??e.version,extras:a.extras||e.extras}))}catch(e){E(e.message)}finally{eN(),T(null)}},[ev,eN]),eC=(0,l.useCallback)(()=>{if(0!==N.length){if(N.includes("ml"))return void L({title:"Install [ml]",message:"[ml] downloads ~1 GB (torch + huggingface-hub). Continue?",confirmText:"Install",variant:"primary",onConfirm:ew});ew()}},[N,ew]),eS=(0,l.useCallback)(e=>{L({title:`Remove [${e}]`,message:`Remove [${e}] and its packages?`,confirmText:"Remove",variant:"danger",onConfirm:()=>ek(e)})},[ek]),eE=(0,l.useCallback)(async(e,t)=>{if(E(""),"code"===e&&U(t),"ml"===e&&A(t),await eu({["code"===e?"headroomCodeAware":"headroomKompress"]:t}),x.running){_(!0);try{let e=await fetch("/api/headroom/restart",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Restart failed");await eb()}catch(e){E(e.message)}finally{_(!1)}}},[x.running,eb]),eP=(0,l.useCallback)(async()=>{ee(e=>({...e,loading:!0}));try{let e=await fetch("/api/pxpipe/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();ee({...t,loading:!1}),"number"==typeof t.minChars&&Z(t.minChars)}catch{ee({installed:!1,installing:!1,running:!1,version:null,loading:!1})}},[]),eT=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/pxpipe/health",{method:"POST"});ea(await e.json())}catch(e){ea({healthy:!1,checks:[],error:e.message})}},[]),eI=(0,l.useCallback)(async e=>{eo(""),en(!0);try{let t=await fetch(`/api/pxpipe/${e}`,{method:"POST"}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||`PXPIPE ${e} failed`);await eP(),await eT()}catch(e){eo(e.message)}finally{en(!1)}},[eP,eT]);(0,l.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/settings");if(e.ok){let a=await e.json();t(!1!==a.rtkEnabled),c(!!a.headroomEnabled),m(a.headroomUrl||"http://localhost:8787"),U(!0===a.headroomCodeAware),A(!1!==a.headroomKompress),B(!!a.cavemanEnabled),W(a.cavemanLevel||"full"),G(!!a.ponytailEnabled),X(a.ponytailLevel||"full"),Y(!!a.pxpipeEnabled),"number"==typeof a.pxpipeMinChars&&Z(a.pxpipeMinChars),eb(),eP().then(eT)}}catch{}})()},[eb,eP,eT]);let e$=!!x.running,eR=x.loading?"Checking…":e$?"Running":!1===x.localUrl||x.installed?!1!==x.localUrl?"Stopped":"External":"Not installed",eL=!1!==x.localUrl,eO=!!x.canStart,eU=eL&&!!x.managedPid,eH=et?.healthy===!0,eA=V.loading?"Checking…":V.installing?"Installing…":V.installed?eH?"Healthy":V.running?"Running":"Stopped":"Not installed";return eH||V.running,(0,s.jsxs)("div",{className:"space-y-6 p-6",children:[(0,s.jsxs)(r.Zp,{id:"rtk",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,s.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,s.jsx)(r.lM,{checked:e,onChange:()=>ef(!e)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-4 gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress context"," ",(0,s.jsx)("a",{href:"https://github.com/chopratejas/headroom",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Headroom)"})]}),(0,s.jsx)("span",{className:`text-xs px-2 py-0.5 ${e$?"bg-success/15 text-success":"bg-warning/15 text-warning"}`,children:eR}),(0,s.jsx)("button",{type:"button",onClick:()=>u(!0),className:"text-xs text-primary underline hover:opacity-80",children:e$?"Manage":"Setup"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Compress prompts via /v1/compress before routing to the model"})]}),(0,s.jsx)(r.lM,{checked:a&&e$,disabled:!e$,onChange:()=>{var e;let t;return e=!a,void(m(t=d.trim()||"http://localhost:8787"),c(e),eu({headroomEnabled:e,headroomUrl:t}))}})]}),x.installed&&(0,s.jsxs)("div",{className:"mb-3 ml-1 pl-3 pb-4 border-l-2 border-border",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Compression extras",j.version?` \xb7 v${j.version}`:"",":"]}),j.available.map(e=>{let t=!!j.extras[e],a=N.includes(e),l="code"===e?"tree-sitter AST compression for code responses":"Kompress-v2 HF model for prose/agentic traces (~+1GB)";if(t){let t="code"===e?O:H;return(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-xs px-2 py-1 border border-success/40 bg-success/5 text-text",title:l,children:[(0,s.jsx)(r.lM,{size:"sm",checked:t,disabled:M,onChange:()=>eE(e,!t)}),(0,s.jsxs)("span",{className:"font-medium",children:["[",e,"]"]}),(0,s.jsx)("button",{type:"button",onClick:()=>eS(e),disabled:P===e,className:"ml-1 text-error underline hover:opacity-80 disabled:opacity-50",title:`Uninstall [${e}]`,children:P===e?"Uninstalling…":"Uninstall"})]},e)}return(0,s.jsxs)("label",{className:`flex items-center gap-1.5 text-xs px-2 py-1 border cursor-pointer transition-colors ${a?"border-primary bg-primary/10 text-primary":"border-border text-text-muted hover:bg-surface-2"}`,title:l,children:[(0,s.jsx)("input",{type:"checkbox",className:"w-3 h-3",checked:a,onChange:()=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}}),(0,s.jsxs)("span",{className:"font-medium",children:["[",e,"]"]}),(0,s.jsx)("span",{className:"opacity-70",children:"not installed"})]},e)}),N.length>0&&(0,s.jsx)("button",{onClick:eC,disabled:k,className:"text-xs px-2.5 py-1 bg-primary text-white hover:opacity-90 disabled:opacity-50",children:k?"Installing…":`Install [proxy,${N.join(",")}]`})]}),S&&(0,s.jsx)("p",{className:"text-xs text-error mt-1",children:S}),M&&(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Restarting proxy…"}),(k||P)&&I&&(0,s.jsx)("pre",{className:"mt-2 max-h-32 overflow-auto bg-surface-2 p-2 text-[10px] leading-tight text-text-muted whitespace-pre-wrap",children:I}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Installing adds the package; use ",(0,s.jsx)("code",{children:"on"}),"/",(0,s.jsx)("code",{children:"off"})," ","to activate it (restarts the proxy). Default install is"," ",(0,s.jsx)("code",{children:"[proxy]"})," only (SmartCrusher for JSON). Adding"," ",(0,s.jsx)("code",{children:"[code]"})," enables AST compression (Python/JS/TS/Go/Rust/Java/C/C++/Perl). Adding ",(0,s.jsx)("code",{children:"[ml]"})," ","enables the Kompress-v2 HF model for prose/agentic traces but adds ~1 GB (torch + huggingface-hub)."]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,s.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[F&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:ep.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;W(t=e.id),eu({cavemanLevel:t})},className:`px-3 py-1.5 text-xs font-medium border transition-colors ${J===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:o.ev.find(e=>e.id===J)?.desc})]}),(0,s.jsx)(r.lM,{checked:F,onChange:()=>{var e;B(e=!F),eu({cavemanEnabled:e})}})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Lazy senior dev"," ",(0,s.jsx)("a",{href:"https://github.com/DietrichGebert/ponytail",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Ponytail)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Bias the model toward minimal code: YAGNI, reuse stdlib, deletion over addition"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[z&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:o.Nv.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;X(t=e.id),eu({ponytailLevel:t})},className:`px-3 py-1.5 text-xs font-medium border transition-colors ${K===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:o.Nv.find(e=>e.id===K)?.desc})]}),(0,s.jsx)(r.lM,{checked:z,onChange:()=>{var e;G(e=!z),eu({ponytailEnabled:e})}})]})]}),!1]}),(0,s.jsx)(r.aF,{isOpen:p,title:e$?"Headroom":"Setup Headroom",onClose:()=>u(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsx)("span",{className:e$?"text-success":"text-warning",children:eR})]}),e$&&(0,s.jsx)("a",{href:"/api/headroom/proxy/dashboard",target:"_blank",rel:"noreferrer",className:"w-full border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Headroom Dashboard"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Proxy URL"}),(0,s.jsx)(r.pd,{value:d,onChange:e=>m(e.target.value),onBlur:eg,placeholder:"http://localhost:8787",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a local proxy for Start/Stop, or an external Docker sidecar like http://headroom:8787."})]}),eU?(0,s.jsx)(r.$n,{onClick:ej,variant:"ghost",fullWidth:!0,disabled:f,children:f?"Stopping…":"Stop Headroom"}):e$?(0,s.jsx)("p",{className:"text-sm text-success",children:"Headroom proxy is reachable. You can enable the token saver."}):eO?(0,s.jsx)(r.$n,{onClick:ey,fullWidth:!0,disabled:f,children:f?"Starting…":"Start Headroom"}):eL?x.python?(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Install then click Start:"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("pre",{className:"flex-1 bg-black/5 dark:bg-white/5 p-2 text-xs font-mono overflow-x-auto",children:'pip install "headroom-ai[proxy]"'}),(0,s.jsx)(r.$n,{size:"sm",variant:"ghost",onClick:()=>ex('pip install "headroom-ai[proxy]"'),children:em?"Copied":"Copy"})]})]}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Python ≥ 3.10 required for local managed mode. Install Python first, or use an external proxy URL."}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Start Headroom separately at the configured URL, then recheck."}),b&&(0,s.jsx)("p",{className:"text-sm text-warning",children:b}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.$n,{onClick:()=>eb(),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(r.$n,{onClick:()=>u(!1),fullWidth:!0,children:"Done"})]})]})}),(0,s.jsx)(r.aF,{isOpen:!1,title:V.installed?"PXPIPE":"Setup PXPIPE",onClose:()=>el(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Compress prompts using multimodal encoding. Runs in-process — no extra server or environment variables required."}),(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsxs)("span",{className:eH||V.running?"text-success":"text-warning",children:[eA,V.version?` \xb7 v${V.version}`:""]})]}),et?.checks?.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-1 border border-border p-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-1",children:"Health check"}),et.checks.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,s.jsxs)("span",{className:e.ok?"text-success":"text-warning",children:[e.ok?"●":"○"," ",e.label]}),e.detail&&(0,s.jsx)("span",{className:"text-text-muted font-mono truncate max-w-[50%]",children:e.detail})]},e.id)),et.error&&(0,s.jsx)("p",{className:"text-xs text-warning mt-1",children:et.error})]}),V.installed?(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[V.running?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.$n,{onClick:()=>eI("restart"),variant:"ghost",disabled:er,children:"Restart"}),(0,s.jsx)(r.$n,{onClick:()=>eI("stop"),variant:"ghost",disabled:er,children:"Stop"})]}):(0,s.jsx)(r.$n,{onClick:()=>eI("start"),disabled:er,children:er?"Starting…":"Start"}),(0,s.jsx)(r.$n,{onClick:()=>eI("install"),variant:"ghost",disabled:er,children:"Repair"}),(0,s.jsx)("a",{href:"/dashboard/pxpipe#logs",className:"col-span-2 border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Logs"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-warning",children:"PXPIPE is not installed."}),(0,s.jsx)(r.$n,{onClick:()=>eI("install"),fullWidth:!0,disabled:er||V.installing,children:er||V.installing?"Installing…":"Install"}),(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Installs the npm package ",(0,s.jsx)("code",{className:"font-mono",children:"pxpipe-proxy"})," into the PolyRouter data directory. May take a few minutes."]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Minimum prompt size (chars)"}),(0,s.jsx)(r.pd,{value:String(Q),onChange:e=>Z(e.target.value),onBlur:()=>{let e=Math.max(0,Number(Q)||25e3);Z(e),eu({pxpipeMinChars:e})},placeholder:"25000",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Requests smaller than this bypass PXPIPE and are sent as-is."})]}),ei&&(0,s.jsx)("p",{className:"text-sm text-warning",children:ei}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.$n,{onClick:()=>eP().then(eT),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(r.$n,{onClick:()=>el(!1),fullWidth:!0,children:"Done"})]})]})}),(0,s.jsx)(r.uo,{isOpen:!!R,onClose:()=>L(null),onConfirm:()=>{let e=R?.onConfirm;L(null),e?.()},title:R?.title,message:R?.message,confirmText:R?.confirmText,variant:R?.variant})]})}}},e=>{e.O(0,[8010,1321,7451,5497,8441,3794,7358],()=>e(e.s=39863)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7018],{8247:(e,t,s)=>{"use strict";s.d(t,{HY:()=>o,Kw:()=>n});let a={"perplexity-agent":"perplexity","gitlab-duo":"gitlab","vercel-ai-gateway":"vercel"},r=new Set;function l(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function o(e){let t=function(e){let t=l(e);if(!t||r.has(t))return"";let s=a[t]||t;return r.has(s)?"":s}(e);return t?`/providers/${t}.png`:null}function n(e){let t=l(e);t&&r.add(t);let s=a[t];s&&r.add(s)}},11059:(e,t,s)=>{"use strict";s.d(t,{C:()=>r});var a=s(12115);function r(e=2e3){let[t,s]=(0,a.useState)(null),l=(0,a.useRef)(null);return{copied:t,copy:(0,a.useCallback)((t,a="default")=>{(async()=>{if(navigator?.clipboard?.writeText)await navigator.clipboard.writeText(t);else{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}})(),s(a),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{s(null)},e)},[e])}}},38803:(e,t,s)=>{Promise.resolve().then(s.bind(s,85941))},57250:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var a=s(95155),r=s(12115),l=s(14051),o=s.n(l),n=s(8247);function i({src:e,providerId:t,alt:s,size:l=32,className:o="",fallbackText:d="?",fallbackColor:c}){let x=function(e,t){if(t)return(0,n.HY)(t);if(!e)return null;let s=String(e).match(/^\/providers\/([^/]+)\.png$/i);return s?(0,n.HY)(s[1]):e}(e,t),[m,h]=(0,r.useState)(!1);return!x||m?(0,a.jsx)("span",{className:`inline-flex items-center justify-center font-bold ${o}`.trim(),style:{width:l,height:l,color:c,fontSize:Math.max(10,Math.floor(.38*l))},children:d}):(0,a.jsx)("img",{src:x,alt:s,width:l,height:l,className:o,loading:"lazy",decoding:"async",onError:()=>{let e=x.match(/^\/providers\/([^/]+)\.png$/i);e&&(0,n.Kw)(e[1]),t&&(0,n.Kw)(t),h(!0)}})}i.propTypes={src:o().string,providerId:o().string,alt:o().string,size:o().number,className:o().string,fallbackText:o().string,fallbackColor:o().string}},85941:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>v});var a=s(95155),r=s(39092),l=s.n(r),o=s(73321),n=s(12115);function i(){let[e,t]=(0,n.useState)(!1),s=(0,o.useRouter)();return(0,a.jsxs)("nav",{className:"fixed top-0 z-50 w-full bg-[#181411]/80 backdrop-blur-md border-b border-[#3a2f27]",children:[(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[(0,a.jsxs)("button",{type:"button",className:"flex items-center gap-3 cursor-pointer bg-transparent border-none p-0",onClick:()=>s.push("/"),"aria-label":"Navigate to home",children:[(0,a.jsx)("img",{src:"/polyrouter-logo.png",alt:"PolyRouter",className:"size-8 object-contain rounded-md"}),(0,a.jsx)("h2",{className:"text-white text-xl font-bold tracking-tight",children:"PolyRouter"})]}),(0,a.jsxs)("div",{className:"hidden md:flex items-center gap-8",children:[(0,a.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#features",children:"Features"}),(0,a.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#how-it-works",children:"How it Works"}),(0,a.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/hkbulbul/polyrouter#readme",target:"_blank",rel:"noopener noreferrer",children:"Docs"}),(0,a.jsxs)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors flex items-center gap-1",href:"https://github.com/hkbulbul/polyrouter",target:"_blank",rel:"noopener noreferrer",children:["GitHub ",(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"open_in_new"})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("button",{onClick:()=>s.push("/dashboard"),className:"hidden sm:flex h-9 items-center justify-center px-4 bg-[#16a34a] hover:bg-[#15803d] transition-all text-[#181411] text-sm font-bold shadow-[0_0_15px_rgba(249,120,21,0.4)] hover:shadow-[0_0_20px_rgba(249,120,21,0.6)]",children:"Get Started"}),(0,a.jsx)("button",{className:"md:hidden text-white",onClick:()=>t(!e),children:(0,a.jsx)("span",{className:"material-symbols-outlined",children:e?"close":"menu"})})]})]}),e&&(0,a.jsx)("div",{className:"md:hidden border-t border-[#3a2f27] bg-[#181411]/95 backdrop-blur-md",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 p-6",children:[(0,a.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#features",onClick:()=>t(!1),children:"Features"}),(0,a.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#how-it-works",onClick:()=>t(!1),children:"How it Works"}),(0,a.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/hkbulbul/polyrouter#readme",target:"_blank",rel:"noopener noreferrer",children:"Docs"}),(0,a.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/hkbulbul/polyrouter",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,a.jsx)("button",{onClick:()=>s.push("/dashboard"),className:"h-9 bg-[#16a34a] hover:bg-[#15803d] text-[#181411] text-sm font-bold",children:"Get Started"})]})})]})}function d(){return(0,a.jsxs)("section",{className:"relative pt-32 pb-20 px-6 min-h-[90vh] flex flex-col items-center justify-center overflow-hidden",children:[(0,a.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[1000px] h-[500px] bg-[#16a34a]/10 rounded-full blur-[120px] pointer-events-none"}),(0,a.jsxs)("div",{className:"relative z-10 max-w-4xl w-full text-center flex flex-col items-center gap-8",children:[(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full border border-[#3a2f27] bg-[#23180f]/50 px-3 py-1 text-xs font-medium text-[#16a34a]",children:[(0,a.jsx)("span",{className:"flex h-2 w-2 rounded-full bg-[#16a34a] animate-pulse"}),"v1.0 is now live"]}),(0,a.jsxs)("h1",{className:"text-5xl md:text-7xl font-black leading-[1.1] tracking-tight",children:["One Endpoint for ",(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:"text-[#16a34a]",children:"All AI Providers"})]}),(0,a.jsx)("p",{className:"text-lg md:text-xl text-gray-400 max-w-2xl mx-auto font-light",children:"AI endpoint proxy with web dashboard - A JavaScript port of CLIProxyAPI. Works seamlessly with Claude Code, OpenAI Codex, Cline, RooCode, and other CLI tools."}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-4 w-full",children:[(0,a.jsxs)("button",{className:"h-12 px-8 bg-[#16a34a] hover:bg-[#15803d] text-[#181411] text-base font-bold transition-all shadow-[0_0_15px_rgba(249,120,21,0.4)] flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"rocket_launch"}),"Get Started"]}),(0,a.jsxs)("a",{href:"https://github.com/hkbulbul/polyrouter",target:"_blank",rel:"noopener noreferrer",className:"h-12 px-8 border border-[#3a2f27] bg-[#23180f] hover:bg-[#3a2f27] text-white text-base font-bold transition-all flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"code"}),"View on GitHub"]})]})]})]})}var c=s(57250);let x=[{id:"claude",name:"Claude Code",image:"/providers/claude.png"},{id:"codex",name:"OpenAI Codex",image:"/providers/codex.png"},{id:"cline",name:"Cline",image:"/providers/cline.png"},{id:"cursor",name:"Cursor",image:"/providers/cursor.png"}],m=[{id:"openai",name:"OpenAI",color:"bg-emerald-500",textColor:"text-white"},{id:"anthropic",name:"Anthropic",color:"bg-green-400",textColor:"text-white"},{id:"gemini",name:"Gemini",color:"bg-blue-500",textColor:"text-white"},{id:"github",name:"GitHub Copilot",color:"bg-gray-700",textColor:"text-white"}];function h(){let[e,t]=(0,n.useState)(0);return(0,n.useEffect)(()=>{let e=setInterval(()=>{t(e=>(e+1)%m.length)},2e3);return()=>clearInterval(e)},[]),(0,a.jsxs)("div",{className:"mt-16 w-full max-w-4xl relative h-[360px] hidden md:flex items-center justify-center animate-[float_6s_ease-in-out_infinite]",children:[(0,a.jsxs)("div",{className:"relative z-20 w-32 h-32 rounded-full bg-[#23180f] border-2 border-[#16a34a] shadow-[0_0_40px_rgba(249,120,21,0.3)] flex flex-col items-center justify-center gap-1 group cursor-pointer hover:scale-105 transition-transform duration-500",children:[(0,a.jsx)("img",{src:"/polyrouter-logo.png",alt:"PolyRouter",className:"w-14 h-14 object-contain mx-auto"}),(0,a.jsx)("span",{className:"text-xs font-bold text-white tracking-widest uppercase",children:"PolyRouter"}),(0,a.jsx)("div",{className:"absolute inset-0 rounded-full border border-[#16a34a]/30 animate-ping opacity-20"})]}),(0,a.jsx)("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 flex flex-col gap-7",children:x.map(e=>(0,a.jsx)("div",{className:"flex items-center gap-3 opacity-70 hover:opacity-100 transition-opacity group",children:(0,a.jsx)("div",{className:"w-16 h-16 bg-[#23180f] border border-[#3a2f27] flex items-center justify-center overflow-hidden p-2 hover:border-[#16a34a]/50 transition-all hover:scale-105",children:(0,a.jsx)(c.A,{src:e.image,alt:e.name,size:48,className:"object-contain max-w-[48px] max-h-[48px]",fallbackText:e.name.slice(0,2).toUpperCase()})})},e.id))}),(0,a.jsxs)("svg",{className:"absolute inset-0 w-full h-full z-10 pointer-events-none stroke-yellow-700",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 50 C 250 70, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,a.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 140 C 250 140, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,a.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 210 C 250 210, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,a.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 300 C 250 280, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"})]}),(0,a.jsxs)("svg",{className:"absolute inset-0 w-full h-full z-10 pointer-events-none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{d:"M 440 180 C 550 180, 550 50, 740 50",fill:"none",stroke:0===e?"#16a34a":"rgb(75, 85, 99)",strokeWidth:0===e?"3":"2",className:0===e?"animate-pulse":""}),(0,a.jsx)("path",{d:"M 440 180 C 550 180, 550 130, 740 130",fill:"none",stroke:1===e?"#16a34a":"rgb(75, 85, 99)",strokeWidth:1===e?"3":"2",className:1===e?"animate-pulse":""}),(0,a.jsx)("path",{d:"M 440 180 C 550 180, 550 230, 740 230",fill:"none",stroke:2===e?"#16a34a":"rgb(75, 85, 99)",strokeWidth:2===e?"3":"2",className:2===e?"animate-pulse":""}),(0,a.jsx)("path",{d:"M 440 180 C 550 180, 550 310, 740 310",fill:"none",stroke:3===e?"#16a34a":"rgb(75, 85, 99)",strokeWidth:3===e?"3":"2",className:3===e?"animate-pulse":""})]}),(0,a.jsx)("div",{className:"absolute right-0 top-0 bottom-0 flex flex-col justify-between py-6",children:m.map((t,s)=>(0,a.jsx)("div",{className:`px-4 py-2 ${t.color} ${t.textColor} flex items-center justify-center font-bold text-xs shadow-lg hover:scale-110 transition-all cursor-help min-w-[140px] ${e===s?"ring-4 ring-[#16a34a]/50 scale-110":""}`,title:t.name,children:t.name},t.id))}),(0,a.jsx)("div",{className:"md:hidden mt-8 w-full p-4 bg-[#23180f] border border-[#3a2f27]",children:(0,a.jsx)("p",{className:"text-sm text-center text-gray-400",children:"Interactive diagram visible on desktop"})})]})}function u(){return(0,a.jsx)("section",{className:"py-24 border-y border-[#3a2f27] bg-[#23180f]/30",id:"how-it-works",children:(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-6",children:[(0,a.jsxs)("div",{className:"mb-16",children:[(0,a.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"How PolyRouter Works"}),(0,a.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:"Data flows seamlessly from your application through our intelligent routing layer to the best provider for the job."})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 relative",children:[(0,a.jsx)("div",{className:"hidden md:block absolute top-12 left-[16%] right-[16%] h-[2px] bg-linear-to-r from-gray-700 via-[#16a34a] to-gray-700 -z-10"}),(0,a.jsxs)("div",{className:"flex flex-col gap-6 relative group",children:[(0,a.jsx)("div",{className:"w-24 h-24 bg-[#181411] border border-[#3a2f27] flex items-center justify-center shadow-xl group-hover:border-gray-500 transition-colors z-10 mx-auto md:mx-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-4xl text-gray-300",children:"terminal"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-xl font-bold mb-2",children:"1. CLI & SDKs"}),(0,a.jsx)("p",{className:"text-sm text-gray-400",children:"Your requests start from your favorite tools or our unified SDK. Just change the base URL."})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-6 relative group md:items-center md:text-center",children:[(0,a.jsx)("div",{className:"w-24 h-24 bg-[#181411] border-2 border-[#16a34a] flex items-center justify-center shadow-[0_0_30px_rgba(249,120,21,0.2)] z-10 mx-auto",children:(0,a.jsx)("img",{src:"/polyrouter-logo.png",alt:"PolyRouter",className:"w-16 h-16 object-contain animate-pulse"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-xl font-bold mb-2 text-[#16a34a]",children:"2. PolyRouter Hub"}),(0,a.jsx)("p",{className:"text-sm text-gray-400",children:"Our engine analyzes the prompt, checks provider health, and routes for lowest latency or cost."})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-6 relative group md:items-end md:text-right",children:[(0,a.jsx)("div",{className:"w-24 h-24 bg-[#181411] border border-[#3a2f27] flex items-center justify-center shadow-xl group-hover:border-gray-500 transition-colors z-10 mx-auto md:mx-0",children:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,a.jsx)("div",{className:"w-6 h-6 bg-white/10"}),(0,a.jsx)("div",{className:"w-6 h-6 bg-white/10"}),(0,a.jsx)("div",{className:"w-6 h-6 bg-white/10"}),(0,a.jsx)("div",{className:"w-6 h-6 bg-white/10"})]})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-xl font-bold mb-2",children:"3. AI Providers"}),(0,a.jsx)("p",{className:"text-sm text-gray-400",children:"The request is fulfilled by OpenAI, Anthropic, Gemini, or others instantly."})]})]})]})]})})}let b=[{icon:"link",title:"Unified Endpoint",desc:"Access all providers via a single standard API URL.",colors:{border:"hover:border-blue-500/50",bg:"hover:bg-blue-500/5",iconBg:"bg-blue-500/10",iconText:"text-blue-500",titleHover:"group-hover:text-blue-400"}},{icon:"bolt",title:"Easy Setup",desc:"Get up and running in minutes with npx command.",colors:{border:"hover:border-green-500/50",bg:"hover:bg-green-500/5",iconBg:"bg-green-500/10",iconText:"text-green-500",titleHover:"group-hover:text-green-400"}},{icon:"shield_with_heart",title:"Model Fallback",desc:"Automatically switch providers on failure or high latency.",colors:{border:"hover:border-rose-500/50",bg:"hover:bg-rose-500/5",iconBg:"bg-rose-500/10",iconText:"text-rose-500",titleHover:"group-hover:text-rose-400"}},{icon:"monitoring",title:"Usage Tracking",desc:"Detailed analytics and cost monitoring across all models.",colors:{border:"hover:border-purple-500/50",bg:"hover:bg-purple-500/5",iconBg:"bg-purple-500/10",iconText:"text-purple-500",titleHover:"group-hover:text-purple-400"}},{icon:"key",title:"OAuth & API Keys",desc:"Securely manage credentials in one vault.",colors:{border:"hover:border-green-500/50",bg:"hover:bg-green-500/5",iconBg:"bg-green-500/10",iconText:"text-green-500",titleHover:"group-hover:text-green-400"}},{icon:"cloud_sync",title:"Cloud Sync",desc:"Sync your configurations across devices instantly.",colors:{border:"hover:border-sky-500/50",bg:"hover:bg-sky-500/5",iconBg:"bg-sky-500/10",iconText:"text-sky-500",titleHover:"group-hover:text-sky-400"}},{icon:"terminal",title:"CLI Support",desc:"Works with Claude Code, Codex, Cline, Cursor, and more.",colors:{border:"hover:border-emerald-500/50",bg:"hover:bg-emerald-500/5",iconBg:"bg-emerald-500/10",iconText:"text-emerald-500",titleHover:"group-hover:text-emerald-400"}},{icon:"dashboard",title:"Dashboard",desc:"Visual dashboard for real-time traffic analysis.",colors:{border:"hover:border-fuchsia-500/50",bg:"hover:bg-fuchsia-500/5",iconBg:"bg-fuchsia-500/10",iconText:"text-fuchsia-500",titleHover:"group-hover:text-fuchsia-400"}}];function p(){return(0,a.jsx)("section",{className:"py-24 px-6",id:"features",children:(0,a.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,a.jsxs)("div",{className:"mb-16",children:[(0,a.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Powerful Features"}),(0,a.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:"Everything you need to manage your AI infrastructure in one place, built for scale."})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:b.map(e=>(0,a.jsxs)("div",{className:`p-6 bg-[#23180f] border border-[#3a2f27] ${e.colors.border} ${e.colors.bg} transition-all duration-300 group`,children:[(0,a.jsx)("div",{className:`w-10 h-10 ${e.colors.iconBg} flex items-center justify-center mb-4 ${e.colors.iconText} group-hover:scale-110 transition-transform duration-300`,children:(0,a.jsx)("span",{className:"material-symbols-outlined",children:e.icon})}),(0,a.jsx)("h3",{className:`text-lg font-bold mb-2 ${e.colors.titleHover} transition-colors`,children:e.title}),(0,a.jsx)("p",{className:"text-sm text-gray-400 leading-relaxed",children:e.desc})]},e.title))})]})})}var g=s(11059);function f(){let{copied:e,copy:t}=(0,g.C)();return(0,a.jsx)("section",{className:"py-24 px-6 bg-[#120f0d]",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto",children:(0,a.jsxs)("div",{className:"flex flex-col lg:flex-row gap-16 items-start",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-6",children:"Get Started in 30 Seconds"}),(0,a.jsx)("p",{className:"text-gray-400 text-lg mb-8",children:"Install PolyRouter, configure your providers via web dashboard, and start routing AI requests."}),(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#16a34a]/20 text-[#16a34a] flex items-center justify-center font-bold",children:"1"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-bold text-lg",children:"Install PolyRouter"}),(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Run npx command to start the server instantly"})]})]}),(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#16a34a]/20 text-[#16a34a] flex items-center justify-center font-bold",children:"2"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-bold text-lg",children:"Open Dashboard"}),(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Configure providers and API keys via web interface"})]})]}),(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#16a34a]/20 text-[#16a34a] flex items-center justify-center font-bold",children:"3"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-bold text-lg",children:"Route Requests"}),(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Point your CLI tools to http://localhost:20128"})]})]})]})]}),(0,a.jsx)("div",{className:"flex-1 w-full",children:(0,a.jsxs)("div",{className:" overflow-hidden bg-[#1e1e1e] border border-[#3a2f27] shadow-2xl",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 bg-[#252526] border-b border-gray-700",children:[(0,a.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500"}),(0,a.jsx)("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),(0,a.jsx)("div",{className:"w-3 h-3 rounded-full bg-green-500"}),(0,a.jsx)("div",{className:"ml-2 text-xs text-gray-500 font-mono",children:"terminal"})]}),(0,a.jsxs)("div",{className:"p-6 font-mono text-sm leading-relaxed overflow-x-auto",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4 group cursor-pointer",onClick:()=>{t("npx polyrouter","landing")},children:[(0,a.jsx)("span",{className:"text-green-400",children:"$"}),(0,a.jsx)("span",{className:"text-white",children:"npx polyrouter"}),(0,a.jsx)("span",{className:"ml-auto text-gray-500 text-xs opacity-0 group-hover:opacity-100",children:"landing"===e?"✓ Copied":"Copy"})]}),(0,a.jsxs)("div",{className:"text-gray-400 mb-6",children:[(0,a.jsx)("span",{className:"text-[#16a34a]",children:">"})," Starting PolyRouter...",(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:"text-[#16a34a]",children:">"})," Server running on ",(0,a.jsx)("span",{className:"text-blue-400",children:"http://localhost:20128"}),(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:"text-[#16a34a]",children:">"})," Dashboard: ",(0,a.jsx)("span",{className:"text-blue-400",children:"http://localhost:20128/dashboard"}),(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:"text-green-400",children:">"})," Ready to route! ✓"]}),(0,a.jsx)("div",{className:"text-xs text-gray-500 mb-2 border-t border-gray-700 pt-4",children:"\uD83D\uDCDD Configure providers in dashboard or use environment variables"}),(0,a.jsxs)("div",{className:"text-gray-400 text-xs",children:[(0,a.jsx)("span",{className:"text-purple-400",children:"Data Location:"}),(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:"text-gray-500",children:" macOS/Linux:"})," ~/.polyrouter/db/data.sqlite",(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:"text-gray-500",children:" Windows:"})," %APPDATA%/polyrouter/db/data.sqlite"]})]})]})})]})})})}function j(){return(0,a.jsx)("footer",{className:"border-t border-[#3a2f27] bg-[#120f0d] pt-16 pb-8 px-6",children:(0,a.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-8 mb-16",children:[(0,a.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,a.jsx)("img",{src:"/polyrouter-logo.png",alt:"PolyRouter",className:"size-6 object-contain rounded-sm"}),(0,a.jsx)("h3",{className:"text-white text-lg font-bold",children:"PolyRouter"})]}),(0,a.jsx)("p",{className:"text-gray-500 text-sm max-w-xs mb-6",children:"The unified endpoint for AI generation. Connect, route, and manage your AI providers with ease."}),(0,a.jsx)("div",{className:"flex gap-4",children:(0,a.jsx)("a",{className:"text-gray-400 hover:text-white transition-colors",href:"https://github.com/hkbulbul/polyrouter",target:"_blank",rel:"noopener noreferrer",children:(0,a.jsx)("span",{className:"material-symbols-outlined",children:"code"})})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("h4",{className:"font-bold text-white",children:"Product"}),(0,a.jsx)("a",{className:"text-gray-400 hover:text-[#16a34a] text-sm transition-colors",href:"#features",children:"Features"}),(0,a.jsx)("a",{className:"text-gray-400 hover:text-[#16a34a] text-sm transition-colors",href:"/dashboard",children:"Dashboard"}),(0,a.jsx)("a",{className:"text-gray-400 hover:text-[#16a34a] text-sm transition-colors",href:"https://github.com/hkbulbul/polyrouter",target:"_blank",rel:"noopener noreferrer",children:"Changelog"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("h4",{className:"font-bold text-white",children:"Resources"}),(0,a.jsx)("a",{className:"text-gray-400 hover:text-[#16a34a] text-sm transition-colors",href:"https://github.com/hkbulbul/polyrouter#readme",target:"_blank",rel:"noopener noreferrer",children:"Documentation"}),(0,a.jsx)("a",{className:"text-gray-400 hover:text-[#16a34a] text-sm transition-colors",href:"https://github.com/hkbulbul/polyrouter",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,a.jsx)("a",{className:"text-gray-400 hover:text-[#16a34a] text-sm transition-colors",href:"https://www.npmjs.com/package/polyrouter",target:"_blank",rel:"noopener noreferrer",children:"NPM"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("h4",{className:"font-bold text-white",children:"Legal"}),(0,a.jsx)("a",{className:"text-gray-400 hover:text-[#16a34a] text-sm transition-colors",href:"https://github.com/hkbulbul/polyrouter/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:"MIT License"})]})]}),(0,a.jsxs)("div",{className:"border-t border-[#3a2f27] pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,a.jsx)("p",{className:"text-gray-600 text-sm",children:"\xa9 2025 PolyRouter. All rights reserved."}),(0,a.jsxs)("div",{className:"flex gap-6",children:[(0,a.jsx)("a",{className:"text-gray-600 hover:text-white text-sm transition-colors",href:"https://github.com/hkbulbul/polyrouter",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,a.jsx)("a",{className:"text-gray-600 hover:text-white text-sm transition-colors",href:"https://www.npmjs.com/package/polyrouter",target:"_blank",rel:"noopener noreferrer",children:"NPM"})]})]})]})})}function v(){let e=(0,o.useRouter)();return(0,a.jsxs)("div",{className:"jsx-3853dfda129ea3f2 relative text-white font-sans overflow-x-hidden antialiased selection:bg-[#16a34a] selection:text-white",children:[(0,a.jsxs)("div",{className:"jsx-3853dfda129ea3f2 fixed inset-0 z-0 overflow-hidden pointer-events-none bg-[#181411]",children:[(0,a.jsx)("div",{style:{backgroundImage:"linear-gradient(to right, #16a34a 1px, transparent 1px), linear-gradient(to bottom, #16a34a 1px, transparent 1px)",backgroundSize:"50px 50px"},className:"jsx-3853dfda129ea3f2 absolute inset-0 opacity-[0.06]"}),(0,a.jsx)("div",{className:"jsx-3853dfda129ea3f2 absolute top-0 left-1/4 w-[700px] h-[700px] bg-[#16a34a]/12 rounded-full blur-[130px] animate-blob"}),(0,a.jsx)("div",{style:{animationDelay:"2s",animationDuration:"22s"},className:"jsx-3853dfda129ea3f2 absolute top-1/3 right-1/4 w-[600px] h-[600px] bg-purple-500/10 rounded-full blur-[130px] animate-blob"}),(0,a.jsx)("div",{style:{animationDelay:"4s",animationDuration:"25s"},className:"jsx-3853dfda129ea3f2 absolute bottom-0 left-1/2 w-[650px] h-[650px] bg-blue-500/8 rounded-full blur-[130px] animate-blob"}),(0,a.jsx)("div",{style:{background:"radial-gradient(circle at center, transparent 0%, rgba(24, 20, 17, 0.4) 100%)"},className:"jsx-3853dfda129ea3f2 absolute inset-0"})]}),(0,a.jsxs)("div",{className:"jsx-3853dfda129ea3f2 relative z-10",children:[(0,a.jsx)(i,{}),(0,a.jsxs)("main",{className:"jsx-3853dfda129ea3f2",children:[(0,a.jsxs)("div",{className:"jsx-3853dfda129ea3f2 relative",children:[(0,a.jsx)(d,{}),(0,a.jsx)("div",{className:"jsx-3853dfda129ea3f2 flex justify-center pb-20",children:(0,a.jsx)(h,{})})]}),(0,a.jsx)(f,{}),(0,a.jsx)(u,{}),(0,a.jsx)(p,{}),(0,a.jsxs)("section",{className:"jsx-3853dfda129ea3f2 py-32 px-6 relative overflow-hidden",children:[(0,a.jsx)("div",{className:"jsx-3853dfda129ea3f2 absolute inset-0 bg-linear-to-t from-[#16a34a]/5 to-transparent pointer-events-none"}),(0,a.jsxs)("div",{className:"jsx-3853dfda129ea3f2 max-w-4xl mx-auto text-center relative z-10",children:[(0,a.jsx)("h2",{className:"jsx-3853dfda129ea3f2 text-4xl md:text-5xl font-black mb-6",children:"Ready to Simplify Your AI Infrastructure?"}),(0,a.jsx)("p",{className:"jsx-3853dfda129ea3f2 text-xl text-gray-400 mb-10 max-w-2xl mx-auto",children:"Join developers who are streamlining their AI integrations with PolyRouter. Open source and free to start."}),(0,a.jsxs)("div",{className:"jsx-3853dfda129ea3f2 flex flex-col sm:flex-row items-center justify-center gap-4",children:[(0,a.jsx)("button",{onClick:()=>e.push("/dashboard"),className:"jsx-3853dfda129ea3f2 w-full sm:w-auto h-14 px-10 bg-[#16a34a] hover:bg-[#15803d] text-[#181411] text-lg font-bold transition-all shadow-[0_0_20px_rgba(249,120,21,0.5)]",children:"Start Free"}),(0,a.jsx)("button",{onClick:()=>window.open("https://github.com/hkbulbul/polyrouter#readme","_blank"),className:"jsx-3853dfda129ea3f2 w-full sm:w-auto h-14 px-10 border border-[#3a2f27] hover:bg-[#23180f] text-white text-lg font-bold transition-all",children:"Read Documentation"})]})]})]})]}),(0,a.jsx)(j,{})]}),(0,a.jsx)(l(),{id:"3853dfda129ea3f2",children:"@keyframes float{0%,100%{transform:translatey(0)}50%{transform:translatey(-10px)}}@keyframes dash{to{stroke-dashoffset:-20}}@keyframes blob{0%,100%{transform:translate(0,0)scale(1)}33%{transform:translate(30px,-50px)scale(1.1)}66%{transform:translate(-20px,20px)scale(.9)}}.animate-blob{animation:blob 20s ease-in-out infinite}"})]})}}},e=>{e.O(0,[5242,8441,3794,7358],()=>e(e.s=38803)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{1934:(e,t,r)=>{"use strict";r.d(t,{v:()=>u});var n=r(12115);let a=e=>{let t,r=new Set,n=(e,n)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=n?n:"object"!=typeof a||null===a)?a:Object.assign({},t,a),r.forEach(r=>r(t,e))}},a=()=>t,o={setState:n,getState:a,getInitialState:()=>u,subscribe:e=>(r.add(e),()=>r.delete(e))},u=t=e(n,a,o);return o},o=e=>{let t=e?a(e):a,r=e=>(function(e,t=e=>e){let r=n.useSyncExternalStore(e.subscribe,n.useCallback(()=>t(e.getState()),[e,t]),n.useCallback(()=>t(e.getInitialState()),[e,t]));return n.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},u=e=>e?o(e):o},5887:()=>{},31692:(e,t,r)=>{"use strict";r.d(t,{Zr:()=>a});let n=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>n(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>n(t)(e)}}},a=(e,t)=>(r,a,o)=>{let u,i={storage:function(e){let t;try{t=e()}catch(e){return}return{getItem:e=>{var r;let n=e=>null===e?null:JSON.parse(e,void 0),a=null!=(r=t.getItem(e))?r:null;return a instanceof Promise?a.then(n):n(a)},setItem:(e,r)=>t.setItem(e,JSON.stringify(r,void 0)),removeItem:e=>t.removeItem(e)}}(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1,l=0,c=new Set,m=new Set,d=i.storage;if(!d)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),r(...e)},a,o);let f=()=>{let e=i.partialize({...a()});return d.setItem(i.name,{state:e,version:i.version})},h=o.setState;o.setState=(e,t)=>(h(e,t),f());let v=e((...e)=>(r(...e),f()),a,o);o.getInitialState=()=>v;let p=()=>{var e,t;if(!d)return;let o=++l;s=!1,c.forEach(e=>{var t;return e(null!=(t=a())?t:v)});let h=(null==(t=i.onRehydrateStorage)?void 0:t.call(i,null!=(e=a())?e:v))||void 0;return n(d.getItem.bind(d))(i.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===i.version)return[!1,e.state];else{if(i.migrate){let t=i.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;if(o!==l)return;let[n,s]=e;if(r(u=i.merge(s,null!=(t=a())?t:v),!0),n)return f()}).then(()=>{o===l&&(null==h||h(a(),void 0),u=a(),s=!0,m.forEach(e=>e(u)))}).catch(e=>{o===l&&(null==h||h(void 0,e))})};return o.persist={setOptions:e=>{i={...i,...e},e.storage&&(d=e.storage)},clearStorage:()=>{null==d||d.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>p(),hasHydrated:()=>s,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(m.add(e),()=>{m.delete(e)})},i.skipHydration||p(),u||v}},51743:()=>{},54642:e=>{var t;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="//"),(t={}).endianness=function(){return"LE"},t.hostname=function(){return"u">typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"u">typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"},e.exports=t},73321:(e,t,r)=>{"use strict";var n=r(74645);r.o(n,"notFound")&&r.d(t,{notFound:function(){return n.notFound}}),r.o(n,"useParams")&&r.d(t,{useParams:function(){return n.useParams}}),r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},78914:e=>{e.exports={style:{fontFamily:"'IBM Plex Sans', 'IBM Plex Sans Fallback'",fontStyle:"normal"},className:"__className_c8daab",variable:"__variable_c8daab"}},83614:(e,t,r)=>{"use strict";r.d(t,{default:()=>c});var n=r(12115),a=r(73321),o=r(32535);function u(e,t){if(!e)return null;try{let r=new URL(e,t);if("http:"!==r.protocol&&"https:"!==r.protocol)return null;return`${r.origin}${r.pathname}`}catch{return null}}var i=r(41463);let s=i.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN,l=i.env.NEXT_PUBLIC_POSTHOG_HOST||"https://us.i.posthog.com";function c({children:e}){let t=(0,a.usePathname)(),r=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{s&&t&&(r.current=!!s&&!o.Ay.__loaded&&(o.Ay.init(s,{api_host:l,capture_pageview:!1,capture_pageleave:!1,autocapture:!0,disable_session_recording:!0,mask_all_text:!0,mask_all_element_attributes:!0,advanced_disable_decide:!0}),!0)||o.Ay.__loaded,r.current&&o.Ay.capture("$pageview",function({pathname:e,origin:t,referrer:r}){let n="string"==typeof e&&e.startsWith("/")?e:"/",a=u(n,t),o=u(r);return{$current_url:a||n,...o?{$referrer:o}:{}}}({pathname:t,origin:window.location.origin,referrer:document.referrer})))},[t]),e}},91436:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,78914,23)),Promise.resolve().then(r.t.bind(r,5887,23)),Promise.resolve().then(r.t.bind(r,51743,23)),Promise.resolve().then(r.bind(r,94635)),Promise.resolve().then(r.bind(r,83614)),Promise.resolve().then(r.bind(r,21110))},94635:(e,t,r)=>{"use strict";r.d(t,{RuntimeI18nProvider:()=>i});var n=r(95155),a=r(12115),o=r(73321),u=r(73006);function i({children:e}){let t=(0,o.usePathname)();return(0,a.useEffect)(()=>{(0,u.FE)()},[]),(0,a.useEffect)(()=>{t&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{(0,u.wn)()})})},[t]),(0,n.jsx)(n.Fragment,{children:e})}}},e=>{e.O(0,[1716,3334,8229,1321,8441,3794,7358],()=>e(e.s=91436)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4520],{20785:(e,t,s)=>{Promise.resolve().then(s.bind(s,83016))},83016:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});var a=s(95155),r=s(12115),n=s(35497);function i(){let[e,t]=(0,r.useState)(""),[s,i]=(0,r.useState)(""),[l,o]=(0,r.useState)(""),[d,c]=(0,r.useState)(0),[x,u]=(0,r.useState)(!1),[h,m]=(0,r.useState)(null),[p,f]=(0,r.useState)("password"),[g,w]=(0,r.useState)(!1),[b,j]=(0,r.useState)("Sign in with OIDC"),[N,y]=(0,r.useState)(!1),[v,S]=(0,r.useState)("");(0,r.useEffect)(()=>{if(d<=0)return;let e=setInterval(()=>c(e=>e>0?e-1:0),1e3);return()=>clearInterval(e)},[d]),(0,r.useEffect)(()=>{!async function(){let e=new AbortController,t=setTimeout(()=>e.abort(),5e3),s=window.location.origin;try{let a=await fetch(`${s}/api/auth/status`,{signal:e.signal});if(clearTimeout(t),a.ok){let e=await a.json();if(!1===e.requireLogin)return void window.location.assign("/dashboard");m(!!e.hasPassword),f(e.authMode||"password"),w(!0===e.oidcConfigured),j(e.oidcLoginLabel||"Sign in with OIDC")}else m(!0)}catch(e){clearTimeout(t),m(!0)}}()},[]);let C=async t=>{t.preventDefault(),u(!0),i(""),o("");try{let t=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e})});if(t.ok){if((await t.json()).mustChangePassword)return void y(!0);window.location.assign("/dashboard")}else{let e=await t.json();i(e.error||"Invalid password"),e.resetHint&&o(e.resetHint),e.retryAfter&&c(Number(e.retryAfter))}}catch(e){i("An error occurred. Please try again.")}finally{u(!1)}},k=async t=>{t.preventDefault(),u(!0),i("");try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:e,newPassword:v})});if(t.ok)window.location.assign("/dashboard");else{let e=await t.json();i(e.error||"Failed to set password")}}catch(e){i("An error occurred. Please try again.")}finally{u(!1)}},P=g&&["oidc","both"].includes(p),O="oidc"!==p||!g;return null===h?(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-primary"}),(0,a.jsx)("p",{className:"text-text-muted mt-4",children:"Loading..."})]})}):(0,a.jsxs)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4 relative overflow-hidden",children:[(0,a.jsx)("div",{className:"landing-grid absolute inset-0 pointer-events-none","aria-hidden":"true"}),(0,a.jsxs)("div",{className:"relative z-10 w-full max-w-md",children:[(0,a.jsxs)("div",{className:"text-center mb-8",children:[(0,a.jsx)("h1",{className:"text-3xl font-bold text-primary mb-2",children:"PolyRouter"}),(0,a.jsx)("p",{className:"text-text-muted",children:"oidc"===p&&g?"Sign in with your OIDC provider to access the dashboard":"Enter your password to access the dashboard"})]}),(0,a.jsx)(n.Zp,{children:N?(0,a.jsxs)("form",{onSubmit:k,className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-green-600 dark:text-green-400 text-center",children:"Set a new password before accessing the dashboard remotely."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"New password"}),(0,a.jsx)(n.pd,{type:"password",placeholder:"Enter new password",value:v,onChange:e=>S(e.target.value),required:!0,autoFocus:!0}),s&&(0,a.jsx)("p",{className:"text-xs text-red-500",children:s})]}),(0,a.jsx)(n.$n,{type:"submit",variant:"primary",className:"w-full",loading:x,disabled:!v,children:"Set password"})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[P&&(0,a.jsx)(n.$n,{type:"button",variant:"primary",className:"w-full",onClick:()=>{window.location.href="/api/auth/oidc/start"},children:b}),P&&O&&(0,a.jsx)("div",{className:"h-px bg-border/60"}),O?(0,a.jsxs)("form",{onSubmit:C,className:"flex flex-col gap-4",children:[("oidc"===p&&!g||"both"===p&&!g)&&(0,a.jsx)("p",{className:"text-xs text-green-600 dark:text-green-400 text-center",children:"OIDC login is enabled, but the issuer/client fields are not configured yet. Password login is still available for recovery."}),"both"===p&&g&&(0,a.jsx)("p",{className:"text-xs text-text-muted text-center",children:"Password and OIDC login are both enabled."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Password"}),(0,a.jsx)(n.pd,{type:"password",placeholder:"Enter password",value:e,onChange:e=>t(e.target.value),required:!0,autoFocus:!P}),s&&(0,a.jsx)("p",{className:"text-xs text-red-500",children:s}),d>0&&(0,a.jsxs)("p",{className:"text-xs text-green-600 dark:text-green-400",children:["Locked. Retry in ",(0,a.jsxs)("span",{className:"font-mono",children:[d,"s"]}),"."]}),l&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Forgot password? Open ",(0,a.jsx)("code",{className:"bg-sidebar px-1 ",children:"
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4520],{20785:(e,t,s)=>{Promise.resolve().then(s.bind(s,83016))},83016:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});var a=s(95155),r=s(12115),n=s(35497);function i(){let[e,t]=(0,r.useState)(""),[s,i]=(0,r.useState)(""),[l,o]=(0,r.useState)(""),[d,c]=(0,r.useState)(0),[x,u]=(0,r.useState)(!1),[h,m]=(0,r.useState)(null),[p,f]=(0,r.useState)("password"),[g,w]=(0,r.useState)(!1),[b,j]=(0,r.useState)("Sign in with OIDC"),[N,y]=(0,r.useState)(!1),[v,S]=(0,r.useState)("");(0,r.useEffect)(()=>{if(d<=0)return;let e=setInterval(()=>c(e=>e>0?e-1:0),1e3);return()=>clearInterval(e)},[d]),(0,r.useEffect)(()=>{!async function(){let e=new AbortController,t=setTimeout(()=>e.abort(),5e3),s=window.location.origin;try{let a=await fetch(`${s}/api/auth/status`,{signal:e.signal});if(clearTimeout(t),a.ok){let e=await a.json();if(!1===e.requireLogin)return void window.location.assign("/dashboard");m(!!e.hasPassword),f(e.authMode||"password"),w(!0===e.oidcConfigured),j(e.oidcLoginLabel||"Sign in with OIDC")}else m(!0)}catch(e){clearTimeout(t),m(!0)}}()},[]);let C=async t=>{t.preventDefault(),u(!0),i(""),o("");try{let t=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e})});if(t.ok){if((await t.json()).mustChangePassword)return void y(!0);window.location.assign("/dashboard")}else{let e=await t.json();i(e.error||"Invalid password"),e.resetHint&&o(e.resetHint),e.retryAfter&&c(Number(e.retryAfter))}}catch(e){i("An error occurred. Please try again.")}finally{u(!1)}},k=async t=>{t.preventDefault(),u(!0),i("");try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:e,newPassword:v})});if(t.ok)window.location.assign("/dashboard");else{let e=await t.json();i(e.error||"Failed to set password")}}catch(e){i("An error occurred. Please try again.")}finally{u(!1)}},P=g&&["oidc","both"].includes(p),O="oidc"!==p||!g;return null===h?(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-primary"}),(0,a.jsx)("p",{className:"text-text-muted mt-4",children:"Loading..."})]})}):(0,a.jsxs)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4 relative overflow-hidden",children:[(0,a.jsx)("div",{className:"landing-grid absolute inset-0 pointer-events-none","aria-hidden":"true"}),(0,a.jsxs)("div",{className:"relative z-10 w-full max-w-md",children:[(0,a.jsxs)("div",{className:"text-center mb-8",children:[(0,a.jsx)("h1",{className:"text-3xl font-bold text-primary mb-2",children:"PolyRouter"}),(0,a.jsx)("p",{className:"text-text-muted",children:"oidc"===p&&g?"Sign in with your OIDC provider to access the dashboard":"Enter your password to access the dashboard"})]}),(0,a.jsx)(n.Zp,{children:N?(0,a.jsxs)("form",{onSubmit:k,className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-green-600 dark:text-green-400 text-center",children:"Set a new password before accessing the dashboard remotely."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"New password"}),(0,a.jsx)(n.pd,{type:"password",placeholder:"Enter new password",value:v,onChange:e=>S(e.target.value),required:!0,autoFocus:!0}),s&&(0,a.jsx)("p",{className:"text-xs text-red-500",children:s})]}),(0,a.jsx)(n.$n,{type:"submit",variant:"primary",className:"w-full",loading:x,disabled:!v,children:"Set password"})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[P&&(0,a.jsx)(n.$n,{type:"button",variant:"primary",className:"w-full",onClick:()=>{window.location.href="/api/auth/oidc/start"},children:b}),P&&O&&(0,a.jsx)("div",{className:"h-px bg-border/60"}),O?(0,a.jsxs)("form",{onSubmit:C,className:"flex flex-col gap-4",children:[("oidc"===p&&!g||"both"===p&&!g)&&(0,a.jsx)("p",{className:"text-xs text-green-600 dark:text-green-400 text-center",children:"OIDC login is enabled, but the issuer/client fields are not configured yet. Password login is still available for recovery."}),"both"===p&&g&&(0,a.jsx)("p",{className:"text-xs text-text-muted text-center",children:"Password and OIDC login are both enabled."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Password"}),(0,a.jsx)(n.pd,{type:"password",placeholder:"Enter password",value:e,onChange:e=>t(e.target.value),required:!0,autoFocus:!P}),s&&(0,a.jsx)("p",{className:"text-xs text-red-500",children:s}),d>0&&(0,a.jsxs)("p",{className:"text-xs text-green-600 dark:text-green-400",children:["Locked. Retry in ",(0,a.jsxs)("span",{className:"font-mono",children:[d,"s"]}),"."]}),l&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Forgot password? Open ",(0,a.jsx)("code",{className:"bg-sidebar px-1 ",children:"polyrouter"})," CLI on the host → ",(0,a.jsx)("b",{children:"Settings"})," → ",(0,a.jsx)("b",{children:"Reset Password to Default"}),"."]})]}),(0,a.jsx)(n.$n,{type:"submit",variant:"primary",className:"w-full",loading:x,disabled:d>0,children:d>0?`Wait ${d}s`:"Login"}),(0,a.jsxs)("p",{className:"text-xs text-center text-text-muted mt-2",children:["Default password is ",(0,a.jsx)("code",{className:"bg-sidebar px-1 ",children:"123456"})]}),!1===h&&(0,a.jsx)("p",{className:"text-xs text-center text-green-600 dark:text-green-400",children:"Security risk: no password set. You will be asked to set one when logging in remotely."})]}):s&&(0,a.jsx)("p",{className:"text-xs text-red-500",children:s})]})})]})]})}}},e=>{e.O(0,[8010,1321,7451,5497,8441,3794,7358],()=>e(e.s=20785)),_N_E=e.O()}]);
|