vansrouter 0.91.86 → 0.91.89
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/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +15 -15
- package/app/.next-cli-build/build-manifest.json +3 -3
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- package/app/.next-cli-build/react-loadable-manifest.json +4 -4
- 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 +1 -1
- 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 +19 -19
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
- 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 +3 -3
- 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-fitness/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-fitness/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-fitness/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 +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +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 +2 -2
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +2 -2
- 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 +2 -2
- 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 +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- 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 +2 -2
- package/app/.next-cli-build/server/app/api/auth/check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +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.nft.json +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.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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
- 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.nft.json +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 +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +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 +1 -1
- 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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- 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/crush-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
- 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/devin-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
- 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/forge-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +2 -2
- 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-profiles/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +1 -1
- 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/omp-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/omp-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 +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/smelt-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/presets/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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.nft.json +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.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.nft.json +1 -1
- 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 +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 +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/catalog-sync/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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 +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/grok-cli/bulk-import/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 +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 +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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/import/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 +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 +2 -2
- 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]/gcp-projects/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/gcp-projects/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/bulk/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/bulk/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/circuit-breakers/[name]/reset/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/circuit-breakers/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 +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 +2 -2
- 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 +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]/fitness/clear/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 +2 -2
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/fitness/clear-all/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/fitness/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/netlify-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 +2 -2
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +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.nft.json +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.nft.json +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.nft.json +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/ready/route.js +1 -1
- package/app/.next-cli-build/server/app/api/ready/route.js.nft.json +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 +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 +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 +2 -2
- 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]/claude-reset/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/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 +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/[id]/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 +7 -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 +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 +2 -2
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
- 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 +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- 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 +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk/dashboard/proxy-fitness/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk/dashboard/proxy-fitness.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +4 -4
- 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 +9 -9
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- 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 +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page.js +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 +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- 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 +5 -5
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
- 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 +4 -4
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
- 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/masuk/page.js +1 -1
- package/app/.next-cli-build/server/app/masuk/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/masuk/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +15 -15
- package/app/.next-cli-build/server/chunks/1253.js +1 -1
- package/app/.next-cli-build/server/chunks/1685.js +4 -4
- package/app/.next-cli-build/server/chunks/1693.js +14 -14
- package/app/.next-cli-build/server/chunks/2098.js +1 -1
- package/app/.next-cli-build/server/chunks/224.js +1 -1
- package/app/.next-cli-build/server/chunks/2247.js +1 -1
- package/app/.next-cli-build/server/chunks/228.js +1 -1
- package/app/.next-cli-build/server/chunks/2365.js +1 -1
- package/app/.next-cli-build/server/chunks/2557.js +9 -9
- package/app/.next-cli-build/server/chunks/2741.js +5 -5
- package/app/.next-cli-build/server/chunks/2994.js +1 -1
- package/app/.next-cli-build/server/chunks/3059.js +1 -1
- package/app/.next-cli-build/server/chunks/3129.js +9 -0
- package/app/.next-cli-build/server/chunks/3519.js +1 -1
- package/app/.next-cli-build/server/chunks/{4574.js → 3548.js} +4 -12
- package/app/.next-cli-build/server/chunks/3738.js +1 -1
- package/app/.next-cli-build/server/chunks/3909.js +7 -0
- package/app/.next-cli-build/server/chunks/4105.js +1 -1
- package/app/.next-cli-build/server/chunks/4121.js +1 -1
- package/app/.next-cli-build/server/chunks/4387.js +1 -1
- package/app/.next-cli-build/server/chunks/4784.js +1 -0
- package/app/.next-cli-build/server/chunks/5376.js +1 -1
- package/app/.next-cli-build/server/chunks/5661.js +2 -0
- package/app/.next-cli-build/server/chunks/6127.js +1 -0
- package/app/.next-cli-build/server/chunks/6385.js +1 -1
- package/app/.next-cli-build/server/chunks/6635.js +120 -0
- package/app/.next-cli-build/server/chunks/6723.js +1 -1
- package/app/.next-cli-build/server/chunks/6797.js +1 -0
- package/app/.next-cli-build/server/chunks/7010.js +1 -1
- package/app/.next-cli-build/server/chunks/7074.js +1 -1
- package/app/.next-cli-build/server/chunks/7104.js +1 -1
- package/app/.next-cli-build/server/chunks/7173.js +1 -0
- package/app/.next-cli-build/server/chunks/7601.js +1 -0
- package/app/.next-cli-build/server/chunks/7622.js +1 -0
- package/app/.next-cli-build/server/chunks/77.js +1 -0
- package/app/.next-cli-build/server/chunks/7863.js +1 -1
- package/app/.next-cli-build/server/chunks/7950.js +1 -1
- package/app/.next-cli-build/server/chunks/8413.js +1 -1
- package/app/.next-cli-build/server/chunks/8695.js +1 -0
- package/app/.next-cli-build/server/chunks/9152.js +1 -0
- package/app/.next-cli-build/server/chunks/9462.js +3 -3
- package/app/.next-cli-build/server/chunks/9536.js +1 -1
- package/app/.next-cli-build/server/chunks/9813.js +1 -1
- package/app/.next-cli-build/server/chunks/9974.js +1 -1
- package/app/.next-cli-build/server/instrumentation.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +6 -6
- 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/4385-cbf2781a85164825.js +1 -0
- package/app/.next-cli-build/static/chunks/{5882-1249cbe42852fd96.js → 5882-bb73715e79a1edc7.js} +15 -15
- package/app/.next-cli-build/static/chunks/7811.44f1e90e48ee2405.js +7 -0
- package/app/.next-cli-build/static/chunks/{9131-d37a1bf502688d4e.js → 9131-5c48f6b07c55928d.js} +2 -2
- package/app/.next-cli-build/static/chunks/{8667.b22b7da66acd945f.js → 9752.f8753c75713960c0.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-695c6386c328069c.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-7a18b45a954e3c68.js → page-6fb9dbec413202a9.js} +24 -24
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-a6d3f510934cc6a5.js → page-b15161b2f2dbe57a.js} +4 -4
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-350e9dd8ec551006.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-f3837ee992c42414.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/page-c7d23dc2ea52f500.js +1 -0
- package/app/.next-cli-build/static/chunks/webpack-a0ce735078312e9a.js +1 -0
- package/app/.next-cli-build/static/css/e277fef3d96cd619.css +1 -0
- package/app/package.json +3 -3
- package/app/public/i18n/literals/fa.json +1 -1
- package/app/public/i18n/literals/id.json +1366 -170
- package/app/public/i18n/literals/km.json +1398 -0
- package/app/public/i18n/literals/pt-BR.json +1 -1
- package/app/public/i18n/literals/th.json +1 -1
- package/app/public/i18n/literals/zh-CN.json +1 -1
- package/app/public/providers/nace.png +0 -0
- package/app/public/providers/sensenova.png +0 -0
- package/app/src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js +69 -11
- package/app/src/app/(dashboard)/dashboard/combos/page.js +71 -19
- package/app/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js +1 -1
- package/app/src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js +2 -5
- package/app/src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js +94 -11
- package/app/src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/exampleShared.js +2 -0
- package/app/src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +6 -1
- package/app/src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js +18 -0
- package/app/src/app/(dashboard)/dashboard/token-saver/TokenSaverSettings.js +37 -0
- package/app/src/app/(dashboard)/dashboard/translator/page.js +9 -2
- package/app/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaTable.js +4 -2
- package/app/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js +16 -1
- package/app/src/app/api/cli-tools/pi-settings/route.js +32 -14
- package/app/src/app/api/providers/[id]/test/testUtils.js +40 -1
- package/app/src/app/api/providers/validate/route.js +1 -0
- package/app/src/lib/db/driver.js +27 -0
- package/app/src/lib/db/helpers/nullBytes.js +28 -0
- package/app/src/lib/db/repos/settingsRepo.js +3 -0
- package/app/src/mitm/server.js +24 -24
- package/app/src/shared/constants/monaco.js +7 -0
- package/app/src/shared/constants/ttsProviders.js +16 -0
- package/app/src/shared/utils/bulkAdd.js +3 -0
- package/app/src/shared/utils/modelSearchFilter.js +2 -0
- package/app/src/sse/handlers/chat.js +2 -0
- package/app/src/sse/handlers/imageGeneration.js +12 -0
- package/app/src/sse/handlers/stt.js +31 -4
- package/app/src/sse/handlers/tts.js +9 -2
- package/package.json +1 -1
- package/app/.next-cli-build/server/chunks/1691.js +0 -1
- package/app/.next-cli-build/server/chunks/2445.js +0 -1
- package/app/.next-cli-build/server/chunks/2764.js +0 -1
- package/app/.next-cli-build/server/chunks/3280.js +0 -7
- package/app/.next-cli-build/server/chunks/3398.js +0 -120
- package/app/.next-cli-build/server/chunks/3650.js +0 -1
- package/app/.next-cli-build/server/chunks/3712.js +0 -1
- package/app/.next-cli-build/server/chunks/3750.js +0 -1
- package/app/.next-cli-build/server/chunks/5302.js +0 -1
- package/app/.next-cli-build/server/chunks/634.js +0 -1
- package/app/.next-cli-build/server/chunks/8729.js +0 -2
- package/app/.next-cli-build/server/chunks/9984.js +0 -1
- package/app/.next-cli-build/static/chunks/4385-03a808bbdffe02b8.js +0 -1
- package/app/.next-cli-build/static/chunks/7811.b41ad2c055232420.js +0 -7
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-db17236a5b2183ab.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-85770718a5ce696c.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-700aef5520cd0812.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/page-7fa12dc3d0d68dca.js +0 -1
- package/app/.next-cli-build/static/chunks/webpack-619acf270537f5d4.js +0 -1
- package/app/.next-cli-build/static/css/918f11e454be0692.css +0 -1
- /package/app/.next-cli-build/static/{fsKDOeZp8VajlUCbjVxvj → LbAvi6x-snQC6rsQ9_c6d}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{fsKDOeZp8VajlUCbjVxvj → LbAvi6x-snQC6rsQ9_c6d}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7811],{21863:(e,t,r)=>{function l(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}function s(e){let t={};for(let r of e||[])r?.provider&&(t[r.provider]||(t[r.provider]={total:0,active:0}),t[r.provider].total+=1,!1!==r.isActive&&(t[r.provider].active+=1));let r=new Set;for(let[e,l]of Object.entries(t))l.total>0&&0===l.active&&r.add(e);return r}r.d(t,{g:()=>l,i:()=>s})},85479:(e,t,r)=>{r.d(t,{y:()=>n});var l=r(82030),s=r(24332);let a=null,i=null;function n(){let[e,t]=(0,l.useState)(()=>a?.byFull||{}),[r,n]=(0,l.useState)(()=>a?.byId||{});return(0,l.useEffect)(()=>{if(a)return;let e=!0;return(a?Promise.resolve(a):i||(i=fetch("/api/models").then(async e=>{if(!e.ok)throw Error(`models ${e.status}`);return a=function(e){let t={},r={};for(let l of e||[])l.caps&&(l.fullModel&&(t[l.fullModel]=l.caps),l.routedModel&&(t[l.routedModel]=l.caps),l.model&&(r[l.model]=l.caps));return{byFull:t,byId:r}}((await e.json()).models)}).catch(()=>({byFull:{},byId:{}})).finally(()=>{i=null}))).then(r=>{e&&(t(r.byFull),n(r.byId))}),()=>{e=!1}},[]),{getCaps:(0,l.useCallback)(t=>(function(e,t,r){if(!r)return null;if(e[r])return e[r];let l=r.includes("/")?r.slice(r.indexOf("/")+1):r;if(t[l])return t[l];let a=r.includes("/")?r.slice(0,r.indexOf("/")):null,i=(0,s.nl)(a,l);return{vision:i.vision,search:i.search,reasoning:i.reasoning,contextWindow:i.contextWindow,maxOutput:i.maxOutput}})(e,r,t),[e,r])}}},87811:(e,t,r)=>{r.r(t),r.d(t,{default:()=>y});var l=r(15102),s=r(82030),a=r(28937),i=r.n(a),n=r(7665),o=r(31704),d=r(24260),c=r(85479),m=r(55223),u=r(31038);function p(e){if(!e||"string"!=typeof e)return{raw:"",isEmpty:!0,isRegex:!1,regex:null,positiveTerms:[],negativeTerms:[]};let t=e.trim();if(!t)return{raw:"",isEmpty:!0,isRegex:!1,regex:null,positiveTerms:[],negativeTerms:[]};if(t.startsWith("/")){let e=t.match(/^\/(.+)\/([a-z]*)$/i);if(e)try{let r=e[2]||"i",l=new RegExp(e[1],r);return{raw:t,isEmpty:!1,isRegex:!0,regex:l,positiveTerms:[],negativeTerms:[]}}catch{}else if(t.length>1)try{let e=RegExp(t.slice(1),"i");return{raw:t,isEmpty:!1,isRegex:!0,regex:e,positiveTerms:[],negativeTerms:[]}}catch{}}let r=t.split(/\s+/),l=[],s=[];for(let e of r)e&&((e.startsWith("!")||e.startsWith("-"))&&e.length>1?s.push(e.slice(1).toLowerCase()):l.push(e.toLowerCase()));return{raw:t,isEmpty:0===l.length&&0===s.length,isRegex:!1,regex:null,positiveTerms:l,negativeTerms:s}}function h(e,t){let r="string"!=typeof t&&t?t:p(t);if(r.isEmpty)return!0;let l=[];if("string"==typeof e?l=[e]:Array.isArray(e)?l=e.filter(e=>"string"==typeof e):e&&"object"==typeof e&&(l=[e.name,e.id,e.value,e.alias,e.provider].filter(e=>"string"==typeof e)),0===l.length)return!1;if(r.isRegex&&r.regex){r.regex.lastIndex=0;let e=l.join(" ");return/\(\?!|\(\?<!/.test(r.raw)?r.regex.test(e):l.some(e=>r.regex.test(e))||r.regex.test(e)}let s=l.map(e=>e.toLowerCase());if(r.negativeTerms.length>0){for(let e of r.negativeTerms)if(s.some(t=>t.includes(e)))return!1}if(r.positiveTerms.length>0){for(let e of r.positiveTerms)if(!s.some(t=>t.includes(e)))return!1}return!0}var f=r(21863);let x=[...Object.keys(u.zN),...Object.keys(u.IS),...Object.keys(u.nJ),...Object.keys(u.fg)],g=Object.keys(u.IS).filter(e=>u.IS[e].noAuth),v=["cursor","cline","clinepass","zed"];function b(e,t,r){let[l,a]=(0,s.useState)([]),i=(t??[]).join("|");return(0,s.useEffect)(()=>{let t=i?i.split("|"):[];if(!e||0===t.length)return void a([]);let l=!1;return Promise.all(t.map(async e=>{let t=await fetch(`/api/providers/${e}/models`,{cache:"no-store"});if(!t.ok)return[];let r=await t.json();return Array.isArray(r.models)?r.models:[]})).then(e=>{if(l)return;let t=new Set;a(e.flat().filter(e=>!(!e?.id||t.has(e.id))&&(t.add(e.id),!0)))}).catch(e=>{console.warn(`Unable to load ${r} models for selector:`,e),l||a([])}),()=>{l=!0}},[e,i,r]),l}function y({isOpen:e,onClose:t,onSelect:r,onDeselect:a,onSelectBatch:i,onDeselectBatch:j,selectedModel:w,activeProviders:C=[],title:k="Select Model",size:$="lg",modelAliases:S={},kindFilter:N=null,capFilter:E=null,addedModelValues:O=[],closeOnSelect:M=!0,allowProviderWildcard:P=!1}){let[A,T]=(0,s.useState)(null),R=async()=>{try{let e=await fetch("/api/providers");if(!e.ok)throw Error(`Failed to fetch providers: ${e.status}`);let t=await e.json();T(t.connections||[])}catch(e){console.error("Error fetching providers in ModelSelectModal:",e),T([])}};(0,s.useEffect)(()=>{e&&R()},[e]);let z=(0,s.useMemo)(()=>null!==A?A:C||[],[A,C]),F=(0,s.useMemo)(()=>{let e=z.filter(e=>e&&!1!==e.isActive);return N?e.filter(e=>{let t=u.Q2[e.provider];return(t?.serviceKinds||["llm"]).includes(N)}):e},[z,N]),D=(0,s.useMemo)(()=>(0,f.i)(z),[z]),{getCaps:I}=(0,c.y)(),[W,_]=(0,s.useState)(""),[K,q]=(0,s.useState)([]),[B,G]=(0,s.useState)([]),[L,J]=(0,s.useState)([]),[Q,U]=(0,s.useState)({}),V=(0,s.useMemo)(()=>{let e=Object.fromEntries(v.map(e=>[e,[]]));for(let t of F)t?.id&&Object.prototype.hasOwnProperty.call(e,t.provider)&&e[t.provider].push(t.id);return e},[F]),Z=V.cursor,H=V.cline,X=V.clinepass,Y=V.zed,ee=b(e,Z,"Cursor"),et=b(e,H,"Cline"),er=b(e,X,"ClinePass"),el=b(e,Y,"Zed"),es=async()=>{try{let e=await fetch("/api/combos");if(!e.ok)throw Error(`Failed to fetch combos: ${e.status}`);let t=await e.json();q(t.combos||[])}catch(e){console.error("Error fetching combos:",e),q([])}};(0,s.useEffect)(()=>{e&&es()},[e]);let ea=async()=>{try{let e=await fetch("/api/provider-nodes");if(!e.ok)throw Error(`Failed to fetch provider nodes: ${e.status}`);let t=await e.json();G(t.nodes||[])}catch(e){console.error("Error fetching provider nodes:",e),G([])}};(0,s.useEffect)(()=>{e&&ea()},[e]);let ei=async()=>{try{let e=await fetch("/api/models/custom");if(!e.ok)throw Error(`Failed to fetch custom models: ${e.status}`);let t=await e.json();J(t.models||[])}catch(e){console.error("Error fetching custom models:",e),J([])}};(0,s.useEffect)(()=>{e&&ei()},[e]);let en=async()=>{try{let e=await fetch("/api/models/disabled");if(!e.ok)throw Error(`Failed to fetch disabled models: ${e.status}`);let t=await e.json();U(t.disabled||{})}catch(e){console.error("Error fetching disabled models:",e),U({})}};(0,s.useEffect)(()=>{e&&en()},[e]);let eo=(0,s.useMemo)(()=>({...u.zN,...u.IS,...u.nJ,...u.fg}),[]),ed=(0,s.useMemo)(()=>{let e={},t=new Set(["webSearch","webFetch"]),r=new Set(["image","tts","stt","embedding","imageToText"]),l=new Set(["tts","image","webFetch"]),s=F.map(e=>e.provider),a=(N?g.filter(e=>(u.Q2[e]?.serviceKinds||["llm"]).includes(N)):g).filter(e=>!D.has(e)),i=new Set((B||[]).map(e=>e?.id).filter(Boolean));return[...new Set([...s,...a,...N?[]:L.map(e=>e.providerAlias).filter(e=>((0,u.mq)(e)||(0,u.gb)(e))&&i.has(e)&&!D.has(e))].filter(e=>!D.has(e)))].sort((e,t)=>{let r=x.indexOf(e),l=x.indexOf(t);return(-1===r?999:r)-(-1===l?999:l)}).forEach(s=>{let a=(0,u.wG)(s),i=eo[s]||{name:s,color:"#666"},n=(0,u.mq)(s)||(0,u.gb)(s);if(N&&t.has(N)){e[s]={name:i.name,alias:a,color:i.color,models:[{id:s,name:i.name,value:s}]};return}if(i.passthroughModels){let t=Object.entries(S).filter(([,e])=>e.startsWith(`${a}/`)).map(([e,t])=>({id:t.replace(`${a}/`,""),name:e,value:t})),n=L.filter(e=>e.providerAlias===a).map(e=>({id:e.id,name:e.name||e.id,value:`${a}/${e.id}`,kind:(0,m.CP)(e),isCustom:!0})),o=t;if(N&&r.has(N)){let e=n.filter(e=>(0,m.CP)(e)===N);0===(o=[...e,...(0,m.KC)(s).filter(e=>(0,m.CP)(e)===N).map(e=>({id:e.id,name:e.name,value:`${a}/${e.id}`,kind:(0,m.CP)(e)})).filter(t=>!e.some(e=>e.value===t.value))]).length&&l.has(N)&&(i.serviceKinds||["llm"]).includes(N)&&(o=[{id:s,name:i.name,value:a}])}else{let e=n.filter(e=>!(0,m.CP)(e)||"llm"===(0,m.CP)(e)),r=new Set([...t,...e].map(e=>e.value)),l=(0,m.KC)(s).filter(e=>!(0,m.CP)(e)||"llm"===(0,m.CP)(e)).map(e=>({id:e.id,name:e.name,value:`${a}/${e.id}`,kind:(0,m.CP)(e)})).filter(e=>!r.has(e.value));o=[...e,...t.filter(t=>!e.some(e=>e.value===t.value)),...l]}if(o.length>0){let t=B.find(e=>e.id===s),r=t?.name||i.name;e[s]={name:r,alias:a,color:i.color,models:o}}}else if(n){if(N&&r.has(N))return;let t=F.find(e=>e.provider===s)||z.find(e=>e.provider===s),l=B.find(e=>e.id===s),a=l?.name||t?.name||i.name,n=t?.providerSpecificData?.prefix||l?.prefix||s,o=Object.entries(S).filter(([,e])=>e.startsWith(`${s}/`)).map(([e,t])=>({id:t.replace(`${s}/`,""),name:e,value:`${n}/${t.replace(`${s}/`,"")}`})),d=L.filter(e=>e.providerAlias===s).map(e=>({id:e.id,name:e.name||e.id,value:`${n}/${e.id}`,isCustom:!0})),c=new Set(o.map(e=>e.value)),m=[...o,...d.filter(e=>!c.has(e.value))],u=m.length>0?m:[{id:`__placeholder__${s}`,name:`${n}/model-id`,value:`${n}/model-id`,isPlaceholder:!0}];e[s]={name:a,alias:n,color:i.color,models:u,isCustom:!0,hasModels:m.length>0}}else{var o;let t="cursor"===s?ee:"cline"===s?et:"clinepass"===s?er:"zed"===s?el:[],n=t.length>0?t:(0,m.KC)(s),d=new Set(n.map(e=>e.id)),c=n.length>0,u=Object.entries(S).filter(([e,t])=>t.startsWith(`${a}/`)&&(!c||e===t.replace(`${a}/`,""))&&!d.has(t.replace(`${a}/`,""))).map(([e,t])=>({id:t.replace(`${a}/`,""),name:e,value:t,isCustom:!0})),p=new Set(u.map(e=>e.id)),h=L.filter(e=>e.providerAlias===a&&!d.has(e.id)&&!p.has(e.id)).map(e=>({id:e.id,name:e.name||e.id,value:`${a}/${e.id}`,isCustom:!0})),f=[...n.map(e=>({id:e.id,name:e.name,value:`${a}/${e.id}`,kind:(0,m.CP)(e)})),...u,...h],x=new Set,g=(o=f.filter(e=>!x.has(e.value)&&(x.add(e.value),!0)),N?r.has(N)?o.filter(e=>e.isPlaceholder||(0,m.CP)(e)===N):o:o.filter(e=>e.isPlaceholder||e.isCustom||!(0,m.CP)(e)||"llm"===(0,m.CP)(e)));0===g.length&&N&&l.has(N)&&(i.serviceKinds||["llm"]).includes(N)&&(g=[{id:s,name:i.name,value:a}]),g.length>0&&(e[s]={name:i.name,alias:a,color:i.color,models:g})}}),Object.entries(e).forEach(([t,r])=>{let l=new Set([...Q[(0,u.wG)(t)]||[],...Q[t]||[]]);0!==l.size&&(r.models=r.models.filter(e=>!l.has(e.id)),0===r.models.length&&delete e[t])}),Object.entries(e).forEach(([t,r])=>{let l=F.filter(e=>e.provider===t),s=[];for(let e of l)Array.isArray(e.providerSpecificData?.enabledModels)&&e.providerSpecificData.enabledModels.length>0&&s.push(...e.providerSpecificData.enabledModels);if(s.length>0){let l=new Set(s),a=r.alias||(0,u.wG)(t)||t;r.models=r.models.filter(e=>l.has(e.id)||l.has(e.value)||l.has(`${a}/${e.id}`)||e.value&&l.has(e.value.replace(`${a}/`,""))),0===r.models.length&&delete e[t]}}),e},[F,S,eo,B,L,Q,N,z,D,ee,et,er,el]),ec=(0,s.useMemo)(()=>p(W),[W]),em=(0,s.useMemo)(()=>N||E?[]:ec.isEmpty?K:K.filter(e=>h(e.name,ec)),[K,ec,N,E]),eu=(0,s.useMemo)(()=>{let e={};return Object.entries(ed).forEach(([t,r])=>{var l;let s=r.models;if(!E||0!==(s=s.filter(e=>I(e.value)?.[E]===!0)).length){if(!ec.isEmpty){let e=h(r.name,ec),l=P&&(r.alias&&h(r.alias,ec)||t&&h(t,ec)||h(`${r.alias}/*`,ec));if(0===(s=s.filter(t=>!!h(t,ec)||(!!e||!!l)&&(!(ec.negativeTerms.length>0)||h(t,{...ec,positiveTerms:[]})))).length)return}e[t]={...r,models:[...(l=s).filter(e=>O.includes(e.value)).sort((e,t)=>e.name.localeCompare(t.name)),...l.filter(e=>!O.includes(e.value)).sort((e,t)=>e.name.localeCompare(t.name))]}}}),e},[ed,ec,O,P]),ep=(0,s.useMemo)(()=>{let e=[];return Object.values(eu).forEach(t=>{t.models.forEach(t=>{t.isPlaceholder||e.push(t)})}),e},[eu]),eh=(0,s.useMemo)(()=>ep.filter(e=>!O.includes(e.value)),[ep,O]),ef=(0,s.useMemo)(()=>ep.filter(e=>O.includes(e.value)),[ep,O]),ex=e=>{let l=e?.value||e?.name||e;O.includes(l)&&a?a(e):r(e),M&&(t(),_(""))};return(0,l.jsxs)(n.A,{isOpen:e,onClose:()=>{t(),_("")},title:k,size:$,className:"p-4!",footer:null,children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-2.5 py-2 bg-primary/8 border border-primary/20 rounded-lg text-xs text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-primary shrink-0",style:{fontSize:"14px"},children:"info"}),(0,l.jsx)("span",{children:P?"Click to add/remove a model, or click a provider name for wildcard (e.g. provider/*). Search supports exclusions (e.g. claude -haiku) and RegEx (/pattern/).":"Click to add, click again to remove. Search supports exclusions (e.g. claude -haiku) and RegEx (/pattern/)."})]}),(0,l.jsxs)("div",{className:"mb-3 space-y-2",children:[(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,l.jsx)("input",{type:"text",placeholder:P?"Search models (e.g. claude -haiku, oc/*, /regex/)...":"Search models (e.g. claude -haiku, !embed, /regex/)...",value:W,onChange:e=>_(e.target.value),className:"w-full pl-8 pr-20 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsxs)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[ec.isRegex&&(0,l.jsx)("span",{className:"text-[10px] px-1 py-0.2 rounded bg-primary/10 text-primary font-mono font-medium",children:"regex"}),ec.negativeTerms.length>0&&!ec.isRegex&&(0,l.jsx)("span",{className:"text-[10px] px-1 py-0.2 rounded bg-amber-500/10 text-amber-500 font-mono font-medium",children:"!exclude"}),W&&(0,l.jsx)("button",{type:"button",onClick:()=>_(""),className:"text-text-muted hover:text-text-main cursor-pointer p-0.5 rounded",title:"Clear search",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] leading-none",children:"close"})})]})]}),!M&&ep.length>0&&(0,l.jsxs)("div",{className:"flex items-center justify-between px-1 text-[11px] text-text-muted",children:[(0,l.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,l.jsxs)("span",{children:[ep.length," models"]}),O.length>0&&(0,l.jsxs)("span",{className:"text-primary font-medium",children:["(",O.length," selected)"]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[eh.length>0&&(0,l.jsxs)("button",{type:"button",onClick:()=>{0!==eh.length&&(i?i(eh):eh.forEach(e=>r(e)))},className:"px-2 py-0.5 rounded text-[11px] font-medium bg-primary/10 text-primary hover:bg-primary/20 transition-colors cursor-pointer",title:"Select all filtered models",children:["Select All (",eh.length,")"]}),ef.length>0&&(0,l.jsxs)("button",{type:"button",onClick:()=>{0!==ef.length&&(j?j(ef):a&&ef.forEach(e=>a(e)))},className:"px-2 py-0.5 rounded text-[11px] font-medium bg-border/40 text-text-muted hover:text-text-main hover:bg-border/60 transition-colors cursor-pointer",title:"Deselect all filtered models",children:["Deselect All (",ef.length,")"]})]})]})]}),(0,l.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-3",children:[em.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,l.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",em.length,")"]})]}),(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:em.map(e=>{let t=w===e.name;return(0,l.jsxs)("button",{onClick:()=>ex({id:e.name,name:e.name,value:e.name}),className:`
|
|
2
|
+
px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer flex items-center gap-1
|
|
3
|
+
${t?"bg-primary text-white border-primary":O.includes(e.name)?"bg-primary border-primary text-white hover:bg-primary-hover":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
|
|
4
|
+
`,children:[O.includes(e.name)&&(0,l.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),e.name]},e.id)})})]}),Object.entries(eu).map(([e,t])=>{let r=`${t.alias||e}/*`,s=P&&O.includes(r);return(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5 z-10",children:[(0,l.jsx)(o.A,{src:`/providers/${e}.png`,alt:t.name,size:14,fallbackText:(t.name||e).slice(0,2).toUpperCase(),fallbackColor:t.color}),P?(0,l.jsxs)("button",{type:"button",onClick:()=>ex({value:r,name:r}),title:s?`Click to remove wildcard ${r}`:`Click to allow all models from ${t.name} (${r})`,className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-xs font-medium transition-all cursor-pointer border ${s?"bg-primary text-white border-primary shadow-2xs hover:bg-primary-hover":"text-primary border-transparent hover:bg-primary/10 hover:border-primary/20"}`,children:[s&&(0,l.jsx)("span",{className:"material-symbols-outlined leading-none text-[12px]",children:"check"}),(0,l.jsx)("span",{children:t.name}),(0,l.jsx)("span",{className:`text-[10px] font-mono px-1 py-0.2 rounded ${s?"bg-white/20 text-white":"text-text-muted bg-sidebar border border-border/50"}`,children:r})]}):(0,l.jsx)("span",{className:"text-xs font-medium text-primary",children:t.name}),(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",t.models.length,")"]})]}),(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.models.map(e=>{let t=w===e.value,r=e.isPlaceholder;return(0,l.jsx)("button",{onClick:()=>ex(e),title:r?"Select to pre-fill, then edit model ID in the input":void 0,className:`
|
|
5
|
+
px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
|
|
6
|
+
${r?"border-dashed border-border text-text-muted hover:border-primary/50 hover:text-primary bg-surface italic":t?"bg-primary text-white border-primary":O.includes(e.value)?"bg-primary border-primary text-white hover:bg-primary-hover":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
|
|
7
|
+
`,children:(0,l.jsxs)("span",{className:"flex items-center gap-1",children:[O.includes(e.value)&&!r&&(0,l.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),r?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),e.name]}):e.isCustom?(0,l.jsxs)(l.Fragment,{children:[e.name,(0,l.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"}),(0,l.jsx)(d.A,{caps:I(e.value)})]}):(0,l.jsxs)(l.Fragment,{children:[e.name,(0,l.jsx)(d.A,{caps:I(e.value)})]})]})},e.value)})})]},e)}),0===Object.keys(eu).length&&0===em.length&&(0,l.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,l.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}y.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onSelect:i().func.isRequired,onDeselect:i().func,onSelectBatch:i().func,onDeselectBatch:i().func,selectedModel:i().string,activeProviders:i().arrayOf(i().shape({provider:i().string.isRequired})),title:i().string,size:i().string,modelAliases:i().object,kindFilter:i().string,addedModelValues:i().arrayOf(i().string),closeOnSelect:i().bool,allowProviderWildcard:i().bool}}}]);
|
package/app/.next-cli-build/static/chunks/{9131-d37a1bf502688d4e.js → 9131-5c48f6b07c55928d.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9131],{11512:(e,t,s)=>{Promise.resolve().then(s.bind(s,46378))},29674:(e,t,s)=>{"use strict";s.d(t,{Cp:()=>r,Hx:()=>n,Iv:()=>d,Nv:()=>x,RL:()=>c,ev:()=>m,fl:()=>i,hT:()=>a,oX:()=>l,t6:()=>o});let a=["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"}],n=2e3,r=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"}]},46378:(e,t,s)=>{"use strict";s.d(t,{default:()=>p});var a=s(15102),l=s(82030),n=s(10736),r=s(21577),i=s(20264),o=s(29674);async function c(e){if(!e)return!1;try{return(await fetch(`${e}/api/health`,{mode:"cors",cache:"no-store",signal:AbortSignal.timeout(o.Iv)})).ok}catch{return!1}}async function d(...e){let t=e.filter(Boolean).map(c);return!!t.length&&new Promise(e=>{let s=t.length;t.forEach(t=>t.then(t=>{t?e(!0):0==--s&&e(!1)}))})}function m({label:e,url:t,copyId:s,copied:l,onCopy:r,badge:i,actions:o}){return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===i||"TS"===i?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:e}),(0,a.jsx)(n.Input,{value:t,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>r(t,s),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l===s?"check":"content_copy"})}),o]})}function x({status:e,className:t=""}){return(0,a.jsx)("div",{className:`p-2 rounded text-sm ${t} ${"success"===e.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===e.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===e.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:e.message.split(/(https?:\/\/[^\s]+)/g).map((e,t)=>/^https?:\/\//.test(e)?(0,a.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:e},t):e)})}function u({text:e}){return(0,a.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,a.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:e})]})}function h({message:e,action:t}){return(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,a.jsx)("p",{className:"text-xs flex-1",children:e}),t&&(0,a.jsx)("a",{href:t.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:t.href.startsWith("#")?e=>{e.preventDefault(),document.getElementById(t.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:t.label})]})}function p(){let[e,t]=(0,l.useState)([]),[s,p]=(0,l.useState)(!0),[g,b]=(0,l.useState)(!1),[f,y]=(0,l.useState)(""),[j,v]=(0,l.useState)(null),[N,w]=(0,l.useState)(null),[k,C]=(0,l.useState)(null),[S,T]=(0,l.useState)(""),[P,E]=(0,l.useState)([]),[A,_]=(0,l.useState)([]),[U,I]=(0,l.useState)([]),[O,L]=(0,l.useState)(!0),[R,B]=(0,l.useState)(!0),[D,K]=(0,l.useState)(!0),[W,F]=(0,l.useState)(!1),[$,q]=(0,l.useState)([]),[H,M]=(0,l.useState)({}),[z,J]=(0,l.useState)([]),[G,Y]=(0,l.useState)(!1),[X,Q]=(0,l.useState)(!1),[V,Z]=(0,l.useState)(!0),[ee,et]=(0,l.useState)(!0),[es,ea]=(0,l.useState)(!1),[el,en]=(0,l.useState)(!0),[er,ei]=(0,l.useState)(!1),[eo,ec]=(0,l.useState)("http://localhost:8787"),[ed,em]=(0,l.useState)(!1),[ex,eu]=(0,l.useState)({installed:!1,running:!1,python:null,loading:!0}),[eh,ep]=(0,l.useState)(!1),[eg,eb]=(0,l.useState)(!1),[ef,ey]=(0,l.useState)(""),[ej,ev]=(0,l.useState)(!1),[eN,ew]=(0,l.useState)("full"),[ek,eC]=(0,l.useState)(!1),[eS,eT]=(0,l.useState)("full"),[eP,eE]=(0,l.useState)("en"),[eA,e_]=(0,l.useState)(!0),[eU,eI]=(0,l.useState)(!1),[eO,eL]=(0,l.useState)(!1),[eR,eB]=(0,l.useState)(""),[eD,eK]=(0,l.useState)(""),[eW,eF]=(0,l.useState)(!1),[e$,eq]=(0,l.useState)(""),[eH,eM]=(0,l.useState)(null),[ez,eJ]=(0,l.useState)(!1),[eG,eY]=(0,l.useState)(!1),[eX,eQ]=(0,l.useState)(!1),[eV,eZ]=(0,l.useState)(!1),[e0,e1]=(0,l.useState)(""),[e5,e2]=(0,l.useState)(!1),[e4,e8]=(0,l.useState)(""),[e3,e6]=(0,l.useState)(null),[e7,e9]=(0,l.useState)(""),[te,tt]=(0,l.useState)(""),[ts,ta]=(0,l.useState)(null),[tl,tn]=(0,l.useState)(!1),[tr,ti]=(0,l.useState)([]),[to,tc]=(0,l.useState)(""),[td,tm]=(0,l.useState)(!1),[tx,tu]=(0,l.useState)(!1),[th,tp]=(0,l.useState)(!1),tg=(0,l.useRef)(null),tb=(0,l.useRef)(0),tf=(0,l.useRef)(0),ty=(0,l.useRef)(!1),tj=(0,l.useRef)(!1),tv=(0,l.useRef)(!1),tN=(0,l.useRef)(!1),[tw,tk]=(0,l.useState)(!1),[tC,tS]=(0,l.useState)(!1),[tT,tP]=(0,l.useState)(new Set),[tE,tA]=(0,l.useState)(!1);(0,l.useEffect)(()=>{tA(!["localhost","127.0.0.1","::1"].includes(window.location.hostname))},[]),(0,l.useEffect)(()=>(eE((0,i.kk)()),(0,i.oQ)(()=>eE((0,i.kk)()))),[]);let t_=o.hT.includes(eP),tU=t_?o.ev:o.ev.filter(e=>!e.wenyan);(0,l.useEffect)(()=>{let e=o.ev.find(e=>e.id===eN);e?.wenyan&&!t_&&(ew("ultra"),tH({cavemanLevel:"ultra"}))},[t_,eN]);let{copied:tI,copy:tO}=(0,r.C)(),tL=!V||!ee,tR=V?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,l.useEffect)(()=>{tg.current&&(tg.current.scrollTop=tg.current.scrollHeight)},[tr]),(0,l.useEffect)(()=>{tQ(),tK()},[]),(0,l.useEffect)(()=>{if(!(eU||eX))return;let e=!eU||eO,t=!eX||eV,s=()=>{document.hidden||tD()};if(document.addEventListener("visibilitychange",s),e&&t)return()=>document.removeEventListener("visibilitychange",s);let a=setInterval(()=>{document.hidden||tD()},o.fl);return()=>{clearInterval(a),document.removeEventListener("visibilitychange",s)}},[eU,eX,eO,eV]),(0,l.useEffect)(()=>{let e=async()=>{if(!document.hidden){if(eU&&(eR||eD)){let e=await d(eD,eR);ty.current=e,e?(tb.current=0,eL(!0),tv.current||(tv.current=!0,tk(!0))):(tb.current+=1,tb.current>=o.t6&&eL(!1))}else ty.current=!1;if(eX&&e0){let e=await c(e0);tj.current=e,e?(tf.current=0,eZ(!0),tN.current||(tN.current=!0,tS(!0))):(tf.current+=1,tf.current>=o.t6&&eZ(!1))}else tj.current=!1}};if(!(eU&&(eR||eD)||eX&&e0))return;e();let t=!eX||eV;if((!eU||eO)&&t)return;let s=setInterval(e,o.RL);return()=>clearInterval(s)},[eU,eR,eD,eX,e0,eO,eV]);let tB=(0,l.useCallback)((e,t,s,a,l,n)=>{t.current?(s.current=0,a(!0),l.current||(l.current=!0,n(!0))):(s.current+=1,s.current>=o.t6&&a(!1))},[]),tD=async()=>{try{let e=await fetch("/api/tunnel/status",{cache:"no-store"});if(!e.ok)return;let t=await e.json(),s=t.tunnel?.settingsEnabled??t.tunnel?.enabled??!1,a=t.tunnel?.tunnelUrl||"";eB(a),eK(t.tunnel?.publicUrl||""),eI(s),tB(null,ty,tb,eL,tv,tk);let l=t.tailscale?.settingsEnabled??t.tailscale?.enabled??!1,n=t.tailscale?.tunnelUrl||"";e1(n),eQ(l),tB(null,tj,tf,eZ,tN,tS)}catch{}},tK=async()=>{e_(!0);try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status",{cache:"no-store"})]);if(e.ok){let t=await e.json();Y(t.requireApiKey||!1),Q(t.allowRemoteNoApiKey||!1),Z(!1!==t.requireLogin),et(t.hasPassword||!1),ea(t.tunnelDashboardAccess||!1),en(!1!==t.rtkEnabled),ei(!!t.headroomEnabled),ec(t.headroomUrl||"http://localhost:8787"),em(!!t.headroomCompressUserMessages),tz(),ev(!!t.cavemanEnabled),ew(t.cavemanLevel||"full"),eC(!!t.ponytailEnabled),eT(t.ponytailLevel||"full")}if(t.ok){let e=await t.json(),s=e.tunnel?.settingsEnabled??e.tunnel?.enabled??!1,a=e.tunnel?.tunnelUrl||"";eB(a),eK(e.tunnel?.publicUrl||""),eI(s),tB(null,ty,tb,eL,tv,tk);let l=e.tailscale?.settingsEnabled??e.tailscale?.enabled??!1,n=e.tailscale?.tunnelUrl||"";e1(n),eQ(l),tB(null,tj,tf,eZ,tN,tS)}}catch(e){console.log("Error loading settings:",e)}finally{e_(!1)}},tW=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:e})})).ok&&ea(e)}catch(e){console.log("Error updating tunnelDashboardAccess:",e)}},tF=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:e})})).ok&&Y(e)}catch(e){console.log("Error updating requireApiKey:",e)}},t$=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({allowRemoteNoApiKey:e})})).ok&&Q(e)}catch(e){console.log("Error updating allowRemoteNoApiKey:",e)}},tq=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&en(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},tH=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)}},tM=async()=>{let e=eo.trim()||"http://localhost:8787";ec(e),await tH({headroomUrl:e}),tz()},tz=(0,l.useCallback)(async()=>{eu(e=>({...e,loading:!0}));try{let e=await fetch("/api/headroom/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();eu({...t,loading:!1})}catch{eu({installed:!1,running:!1,python:null,loading:!1})}},[]),tJ=(0,l.useCallback)(async()=>{ey(""),eb(!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 tz()}catch(e){ey(e.message)}finally{eb(!1)}},[tz]),tG=(0,l.useCallback)(async()=>{eb(!0);try{await fetch("/api/headroom/stop",{method:"POST"}),await tz()}finally{eb(!1)}},[tz]),tY=async e=>{C(e),T(e.name||"");let t=e.allowedProviders,s=e.allowedCombos,a=e.allowedKinds;if(B(!t),K(!s),L(!a),I(s||[]),E(a||[]),t&&$.length>0){let e=new Set;for(let s of t){let t=$.find(e=>e.id===s);if(t){e.add(t.id);continue}let a=$.find(e=>e.alias===s);if(a){e.add(a.id);continue}let l=$.find(e=>e.prefix===s);if(l){e.add(l.id);continue}e.add(s)}_([...e])}else _([])},tX=async()=>{if(k){F(!0);try{let e={name:S.trim()||k.name||"",allowedProviders:R?null:A,allowedCombos:D?null:U,allowedKinds:O?null:P},s=await fetch(`/api/keys/${k.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(s.ok){let e=await s.json();t(t=>t.map(t=>t.id===k.id?{...t,...e.key}:t)),C(null)}}catch(e){console.log("Error saving key ACL:",e)}finally{F(!1)}}},tQ=async()=>{try{let[e,s,a,l]=await Promise.all([fetch("/api/keys",{cache:"no-store"}),fetch("/api/providers",{cache:"no-store"}),fetch("/api/combos",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"})]),n=await e.json();e.ok&&t(n.keys||[]);let r=[],i=[],o=[];if(s.ok){let e=await s.json();r=e.connections||[],e.aliasMap&&M(e.aliasMap),o=e.providers||[]}if(l.ok&&(i=(await l.json()).nodes||[]),q(function(e,t,s=[]){let a={};for(let e of t||[])a[e.id]={name:e.name,prefix:e.prefix||null,type:e.type};let l={};for(let t of e||[]){let e=t.provider;l[e]||(l[e]={id:e,count:0,alias:t.alias||null}),l[e].count++}for(let e of s||[])e.noAuth&&(l[e.id]||(l[e.id]={id:e.id,count:0,alias:e.alias||null}));let n={};for(let e of s||[])n[e.id]=e;return Object.values(l).map(({id:e,count:t,alias:s})=>{let l=a[e],r=n[e],i=r?.displayName||e,o=null;return l&&(i=l.name||e,o=l.prefix||null),{id:e,displayName:i,prefix:o,alias:s,count:t,serviceKinds:r?.serviceKinds||["llm"]}}).sort((e,t)=>e.displayName.localeCompare(t.displayName))}(r,i,o)),a.ok){let e=await a.json();J(e.combos||[])}}catch(e){console.log("Error fetching data:",e)}finally{p(!1)}},tV=async(...e)=>{eF(!0),eq("Waiting for tunnel ready...");let t=e.filter(Boolean).map(e=>`${e}/api/health`),s=Date.now();for(;Date.now()-s<o.Cp;){if(await new Promise(e=>setTimeout(e,o.Hx)),await Promise.any(t.map(async e=>{if((await fetch(e,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return eI(!0),eF(!1),eq(""),!0;if((Date.now()-s)%1e4<o.Hx)try{let e=await fetch("/api/tunnel/status");if(e.ok){let t=await e.json();if(!t.tunnel?.enabled)return eM({type:"error",message:"Tunnel process stopped unexpectedly."}),eF(!1),eq(""),!1}}catch{}}return eM({type:"error",message:"Tunnel created but not reachable. Please try again."}),eF(!1),eq(""),!1},tZ=async()=>{eJ(!1),eF(!0),eM(null),eq("Creating tunnel...");let e=!0;(async()=>{for(;e;){try{let t=await fetch("/api/tunnel/status");if(t.ok){let s=await t.json();s.download?.downloading?eq(`Downloading cloudflared... ${s.download.progress}%`):e&&eq("Creating tunnel...")}}catch{}await new Promise(e=>setTimeout(e,1e3))}})();try{let t=await fetch("/api/tunnel/enable",{method:"POST"});e=!1;let s=await t.json();if(!t.ok)return void eM({type:"error",message:s.error||"Failed to enable tunnel"});let a=s.tunnelUrl;if(!a)return void eM({type:"error",message:"No tunnel URL returned"});eB(a),eK(s.publicUrl||""),await tV(s.publicUrl,a)}catch(e){eM({type:"error",message:e.message})}finally{e=!1,eF(!1),eq("")}},t0=async()=>{eF(!0),eM(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(eI(!1),eB(""),eY(!1),eM({type:"success",message:"Tunnel disabled"})):eM({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){eM({type:"error",message:e.message})}finally{eF(!1)}},t1=async()=>{ta(null);try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok){let t=await e.json();return ta(t.installed),t}}catch{}return ta(!1),{installed:!1}},t5=async()=>{tn(!0),e6(null),ti([]);try{let e=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:to})});tc("");let t=e.body.getReader(),s=new TextDecoder,a="";for(;;){let{done:e,value:l}=await t.read();if(e)break;let n=(a+=s.decode(l,{stream:!0})).split("\n\n");for(let e of(a=n.pop()||"",n)){let t=e.split("\n"),s="progress",a=null;for(let e of t)if(e.startsWith("event: ")&&(s=e.slice(7).trim()),e.startsWith("data: "))try{a=JSON.parse(e.slice(6))}catch{}if(a)if("progress"===s)ti(e=>[...e.slice(-50),a.message]);else if("done"===s){ta(!0),tn(!1),tu(!1),t3();return}else"error"===s&&e6({type:"error",message:a.error||"Install failed"})}}}catch(e){e6({type:"error",message:e.message})}finally{tn(!1)}},t2=async e=>{e8("Waiting for Tailscale ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<o.Cp;){await new Promise(e=>setTimeout(e,o.Hx));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return!0}catch{}}return!1},t4=(e,t)=>{e9(e),tt(t)},t8=()=>{e9(""),tt("")},t3=async()=>{tu(!1),tm(!0),e2(!0),e6(null),e8("Connecting..."),t8();try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){e1(t.tunnelUrl||"");let e=await t2(t.tunnelUrl);eQ(!0),e6(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.needsLogin&&t.authUrl){t4(t.authUrl,"Open Login Page"),e8('Login required — click "Open Login Page" to continue');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok&&(await e.json()).loggedIn){t8(),e8("Starting funnel...");let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){e1(t.tunnelUrl||"");let e=await t2(t.tunnelUrl);eQ(!0),e6(e?null:{type:"warning",message:"Connected but not reachable yet."})}else t.funnelNotEnabled&&t.enableUrl?await t6(t.enableUrl):e6({type:"error",message:t.error||"Failed to start funnel"});return}}catch{}}t8(),e6({type:"error",message:"Login timed out. Please try again."});return}if(t.funnelNotEnabled&&t.enableUrl)return void await t6(t.enableUrl);e6({type:"error",message:t.error||"Failed to connect"})}catch(e){e6({type:"error",message:e.message})}finally{e2(!1),tm(!1),e8(""),t8()}},t6=async e=>{t4(e,"Open Funnel Settings"),e8('Click "Open Funnel Settings" to enable Funnel...');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){t8(),e1(t.tunnelUrl||"");let e=await t2(t.tunnelUrl);eQ(!0),e6(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.funnelNotEnabled)continue;if(t.error){t8(),e6({type:"error",message:t.error});return}}catch{}}t8(),e6({type:"error",message:"Timed out waiting for Funnel to be enabled."})},t7=async()=>{e2(!0),e6(null);try{let e=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),t=await e.json();e.ok?(eQ(!1),e1(""),tp(!1),e6({type:"success",message:"Tailscale disabled"})):e6({type:"error",message:t.error||"Failed to disable Tailscale"})}catch(e){e6({type:"error",message:e.message})}finally{e2(!1)}},t9=async()=>{e6(null),ti([]);let e=await t1();e?.installed&&e?.hasCachedPassword?t3():tu(!0)},se=async()=>{if(f.trim())try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:f})}),t=await e.json();e.ok&&(v(t.key),await tQ(),y(""),b(!1))}catch(e){console.log("Error creating key:",e)}},st=async s=>{w({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{w(null);try{(await fetch(`/api/keys/${s}`,{method:"DELETE"})).ok&&(t(e.filter(e=>e.id!==s)),tP(e=>{let t=new Set(e);return t.delete(s),t}))}catch(e){console.log("Error deleting key:",e)}}})},ss=async(e,s)=>{try{(await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})).ok&&t(t=>t.map(t=>t.id===e?{...t,isActive:s}:t))}catch(e){console.log("Error toggling key:",e)}},[sa,sl]=(0,l.useState)("/v1");if((0,l.useEffect)(()=>{sl(`${window.location.origin}/v1`)},[]),s)return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(n.CardSkeleton,{}),(0,a.jsx)(n.CardSkeleton,{})]});let sn=!!ex.running,sr=!1!==ex.localUrl,si=!!ex.canStart,so=sr&&!!ex.managedPid,sc=ex.loading?"Checking…":sn?"Running":sr&&!ex.installed?"Not installed":sr?"Proxy off":"Unreachable";return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsxs)(n.Card,{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(m,{label:"Local",url:sa,copyId:"local_url",copied:tI,onCopy:tO}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${eU?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),eU&&!eW&&eO?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Input,{value:`${eD||eR}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>tO(`${eD||eR}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===tI?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>eY(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!eU||eW||eO?eW?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),e$||"Creating tunnel..."]}),(0,a.jsx)("button",{onClick:()=>{eF(!1),eq("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):eH?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),eH.message]}),(0,a.jsx)(n.Button,{size:"sm",icon:"cloud_upload",onClick:()=>eJ(!0),children:"Enable"})]}):eA?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,a.jsx)("button",{onClick:()=>e_(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,a.jsx)(n.Button,{size:"sm",icon:"cloud_upload",onClick:()=>{tL?eM({type:"error",message:`Security required: ${tR}`}):G?eJ(!0):eM({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),tw?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,a.jsx)("button",{onClick:()=>eY(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${eX?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),eX&&!e5&&eV?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Input,{value:`${e0}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>tO(`${e0}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===tI?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>tp(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!eX||e5||eV?e5||td?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),e4||"Connecting..."]}),e7&&(0,a.jsx)(n.Button,{size:"sm",icon:"open_in_new",onClick:()=>window.open(e7,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:te||"Open"}),(0,a.jsx)("button",{onClick:()=>{e2(!1),tm(!1),e8(""),t8()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):e3?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),e3.message]}),(0,a.jsx)(n.Button,{size:"sm",icon:"vpn_lock",onClick:t9,children:"Enable"})]}):(0,a.jsx)(n.Button,{size:"sm",icon:"vpn_lock",onClick:()=>{tL?e6({type:"error",message:`Security required: ${tR}`}):t9()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),tC?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,a.jsx)("button",{onClick:()=>tp(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),tL&&!eU&&!eX&&(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(h,{message:tR,action:{label:"Open settings",href:"/dashboard/profile"}})}),(eU||eX)&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!G&&(0,a.jsx)(h,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!V||!ee)&&(0,a.jsx)(h,{message:V?"Dashboard is using the new-installation default — change it in Profile settings before exposing access.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:V?"Change password":"Enable",href:"/dashboard/profile"}})]}),(eU||eX)&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,a.jsx)(n.Toggle,{checked:es,onChange:()=>tW(!es)}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,a.jsx)(u,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,a.jsxs)(n.Card,{id:"rtk",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,a.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,a.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,a.jsx)(n.Toggle,{checked:el,onChange:()=>tq(!el)})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between py-4 border-b border-border gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress context"," ",(0,a.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,a.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${sn?"bg-success/15 text-success":"bg-warning/15 text-warning"}`,children:sc}),(0,a.jsx)("button",{type:"button",onClick:()=>ep(!0),className:"text-xs text-primary underline hover:opacity-80",children:sn?"Manage":"Setup"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Compress prompts via /v1/compress before routing to the model"})]}),(0,a.jsx)(n.Toggle,{checked:er,onChange:()=>{var e;let t;return e=!er,void(ec(t=eo.trim()||"http://localhost:8787"),ei(e),tH({headroomEnabled:e,headroomUrl:t}))}})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4 gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,a.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,a.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[ej&&(0,a.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:tU.map(e=>(0,a.jsx)("button",{onClick:()=>{var t;ew(t=e.id),tH({cavemanLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${eN===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,a.jsx)("p",{className:"text-xs text-primary",children:o.ev.find(e=>e.id===eN)?.desc})]}),(0,a.jsx)(n.Toggle,{checked:ej,onChange:()=>{var e;ev(e=!ej),tH({cavemanEnabled:e})}})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Lazy senior dev"," ",(0,a.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,a.jsx)("p",{className:"text-sm text-text-muted",children:"Bias the model toward minimal code: YAGNI, reuse stdlib, deletion over addition"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[ek&&(0,a.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:o.Nv.map(e=>(0,a.jsx)("button",{onClick:()=>{var t;eT(t=e.id),tH({ponytailLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${eS===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,a.jsx)("p",{className:"text-xs text-primary",children:o.Nv.find(e=>e.id===eS)?.desc})]}),(0,a.jsx)(n.Toggle,{checked:ek,onChange:()=>{var e;eC(e=!ek),tH({ponytailEnabled:e})}})]})]})]}),(0,a.jsxs)(n.Card,{id:"require-api-key",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,a.jsx)(n.Button,{icon:"add",onClick:()=>b(!0),children:"Create Key"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,a.jsx)(n.Toggle,{checked:G,onChange:()=>tF(!G)})]}),tE&&!G&&(0,a.jsx)("div",{className:"mb-4 -mt-2",children:(0,a.jsx)(h,{message:"Endpoint is exposed without an API key."})}),!G&&tE&&(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl bg-surface/50 border border-border/30 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:"Allow Remote Access Without API Key"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Let non-loopback requests reach /v1/* without a key (use with caution)"})]}),(0,a.jsx)(n.Toggle,{checked:X,onChange:()=>t$(!X)})]}),!G&&X&&(0,a.jsx)("div",{className:"mb-4 -mt-2",children:(0,a.jsx)(h,{message:"Remote access without an API key is enabled — anyone who can reach this endpoint can use your providers."})}),0===e.length?(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,a.jsx)(n.Button,{icon:"add",onClick:()=>b(!0),children:"Create Key"})]}):(0,a.jsx)("div",{className:"flex flex-col",children:e.map(e=>{var t;return(0,a.jsxs)("div",{className:`group flex items-start justify-between gap-3 py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1 min-w-0 flex-wrap",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono break-all min-w-0",children:tT.has(e.id)?e.key:(t=e.key)&&!(t.length<=10)?t.slice(0,6)+"•".repeat(t.length-10)+t.slice(-4):t||""}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,a.jsx)("button",{onClick:()=>{var t;return t=e.id,void tP(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",title:tT.has(e.id)?"Hide key":"Show key",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:tT.has(e.id)?"visibility_off":"visibility"})}),(0,a.jsx)("button",{onClick:()=>tO(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:tI===e.id?"check":"content_copy"})})]})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]}),!1===e.isActive&&(0,a.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"}),(e.allowedProviders||e.allowedCombos||e.allowedKinds)&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.allowedProviders&&(0,a.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-500 dark:bg-blue-500/20",title:e.allowedProviders.join(", "),children:0===e.allowedProviders.length?"No providers":e.allowedProviders.map(e=>{let t=$.find(t=>t.id===e||t.alias===e||t.prefix===e);if(t)return t.displayName;let s=H[e];return s||e}).join(", ")}),e.allowedCombos&&(0,a.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-purple-500/10 text-purple-500 dark:bg-purple-500/20",children:0===e.allowedCombos.length?"No combos":e.allowedCombos.join(", ")}),e.allowedKinds&&(0,a.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-green-500/10 text-green-500 dark:bg-green-500/20",children:0===e.allowedKinds.length?"No kinds":e.allowedKinds.join(", ")})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0 pt-0.5",children:[(0,a.jsx)("button",{onClick:()=>tY(e),className:"p-2 hover:bg-primary/10 rounded text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",title:"Edit access control",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tune"})}),(0,a.jsx)(n.Toggle,{size:"sm",checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?w({title:"Pause API Key",message:`Pause API key "${e.name}"?
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9131],{11512:(e,t,s)=>{Promise.resolve().then(s.bind(s,46378))},29674:(e,t,s)=>{"use strict";s.d(t,{Cp:()=>r,Hx:()=>n,Iv:()=>d,Nv:()=>x,RL:()=>c,ev:()=>m,fl:()=>i,hT:()=>a,oX:()=>l,t6:()=>o});let a=["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"}],n=2e3,r=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"}]},46378:(e,t,s)=>{"use strict";s.d(t,{default:()=>p});var a=s(15102),l=s(82030),n=s(10736),r=s(21577),i=s(20264),o=s(29674);async function c(e){if(!e)return!1;try{return(await fetch(`${e}/api/health`,{mode:"cors",cache:"no-store",signal:AbortSignal.timeout(o.Iv)})).ok}catch{return!1}}async function d(...e){let t=e.filter(Boolean).map(c);return!!t.length&&new Promise(e=>{let s=t.length;t.forEach(t=>t.then(t=>{t?e(!0):0==--s&&e(!1)}))})}function m({label:e,url:t,copyId:s,copied:l,onCopy:r,badge:i,actions:o}){return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===i||"TS"===i?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:e}),(0,a.jsx)(n.Input,{value:t,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>r(t,s),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l===s?"check":"content_copy"})}),o]})}function x({status:e,className:t=""}){return(0,a.jsx)("div",{className:`p-2 rounded text-sm ${t} ${"success"===e.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===e.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===e.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:e.message.split(/(https?:\/\/[^\s]+)/g).map((e,t)=>/^https?:\/\//.test(e)?(0,a.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:e},t):e)})}function u({text:e}){return(0,a.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,a.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:e})]})}function h({message:e,action:t}){return(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,a.jsx)("p",{className:"text-xs flex-1",children:e}),t&&(0,a.jsx)("a",{href:t.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:t.href.startsWith("#")?e=>{e.preventDefault(),document.getElementById(t.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:t.label})]})}function p(){let[e,t]=(0,l.useState)([]),[s,p]=(0,l.useState)(!0),[g,f]=(0,l.useState)(!1),[b,y]=(0,l.useState)(""),[j,v]=(0,l.useState)(null),[N,w]=(0,l.useState)(null),[k,C]=(0,l.useState)(null),[S,T]=(0,l.useState)(""),[P,E]=(0,l.useState)([]),[A,_]=(0,l.useState)([]),[I,U]=(0,l.useState)([]),[O,L]=(0,l.useState)(!0),[R,B]=(0,l.useState)(!0),[D,K]=(0,l.useState)(!0),[W,F]=(0,l.useState)(!1),[$,q]=(0,l.useState)([]),[H,M]=(0,l.useState)({}),[z,J]=(0,l.useState)([]),[Y,G]=(0,l.useState)(!1),[X,Q]=(0,l.useState)(!1),[V,Z]=(0,l.useState)(!0),[ee,et]=(0,l.useState)(!0),[es,ea]=(0,l.useState)(!1),[el,en]=(0,l.useState)(!0),[er,ei]=(0,l.useState)(!1),[eo,ec]=(0,l.useState)("http://localhost:8787"),[ed,em]=(0,l.useState)(!1),[ex,eu]=(0,l.useState)({installed:!1,running:!1,python:null,loading:!0}),[eh,ep]=(0,l.useState)(!1),[eg,ef]=(0,l.useState)(!1),[eb,ey]=(0,l.useState)(""),[ej,ev]=(0,l.useState)(!1),[eN,ew]=(0,l.useState)("full"),[ek,eC]=(0,l.useState)(!1),[eS,eT]=(0,l.useState)("full"),[eP,eE]=(0,l.useState)("en"),[eA,e_]=(0,l.useState)(!0),[eI,eU]=(0,l.useState)(!1),[eO,eL]=(0,l.useState)(!1),[eR,eB]=(0,l.useState)(""),[eD,eK]=(0,l.useState)(""),[eW,eF]=(0,l.useState)(!1),[e$,eq]=(0,l.useState)(""),[eH,eM]=(0,l.useState)(null),[ez,eJ]=(0,l.useState)(!1),[eY,eG]=(0,l.useState)(!1),[eX,eQ]=(0,l.useState)(!1),[eV,eZ]=(0,l.useState)(!1),[e0,e1]=(0,l.useState)(""),[e5,e2]=(0,l.useState)(!1),[e4,e8]=(0,l.useState)(""),[e3,e6]=(0,l.useState)(null),[e7,e9]=(0,l.useState)(""),[te,tt]=(0,l.useState)(""),[ts,ta]=(0,l.useState)(null),[tl,tn]=(0,l.useState)(!1),[tr,ti]=(0,l.useState)([]),[to,tc]=(0,l.useState)(""),[td,tm]=(0,l.useState)(!1),[tx,tu]=(0,l.useState)(!1),[th,tp]=(0,l.useState)(!1),tg=(0,l.useRef)(null),tf=(0,l.useRef)(0),tb=(0,l.useRef)(0),ty=(0,l.useRef)(!1),tj=(0,l.useRef)(!1),tv=(0,l.useRef)(!1),tN=(0,l.useRef)(!1),[tw,tk]=(0,l.useState)(!1),[tC,tS]=(0,l.useState)(!1),[tT,tP]=(0,l.useState)(new Set),[tE,tA]=(0,l.useState)(!1);(0,l.useEffect)(()=>{tA(!["localhost","127.0.0.1","::1"].includes(window.location.hostname))},[]),(0,l.useEffect)(()=>(eE((0,i.kk)()),(0,i.oQ)(()=>eE((0,i.kk)()))),[]);let t_=o.hT.includes(eP),tI=t_?o.ev:o.ev.filter(e=>!e.wenyan);(0,l.useEffect)(()=>{let e=o.ev.find(e=>e.id===eN);e?.wenyan&&!t_&&(ew("ultra"),tH({cavemanLevel:"ultra"}))},[t_,eN]);let{copied:tU,copy:tO}=(0,r.C)(),tL=!V||!ee,tR=V?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,l.useEffect)(()=>{tg.current&&(tg.current.scrollTop=tg.current.scrollHeight)},[tr]),(0,l.useEffect)(()=>{tQ(),tK()},[]),(0,l.useEffect)(()=>{if(!(eI||eX))return;let e=!eI||eO,t=!eX||eV,s=()=>{document.hidden||tD()};if(document.addEventListener("visibilitychange",s),e&&t)return()=>document.removeEventListener("visibilitychange",s);let a=setInterval(()=>{document.hidden||tD()},o.fl);return()=>{clearInterval(a),document.removeEventListener("visibilitychange",s)}},[eI,eX,eO,eV]),(0,l.useEffect)(()=>{let e=async()=>{if(!document.hidden){if(eI&&(eR||eD)){let e=await d(eD,eR);ty.current=e,e?(tf.current=0,eL(!0),tv.current||(tv.current=!0,tk(!0))):(tf.current+=1,tf.current>=o.t6&&eL(!1))}else ty.current=!1;if(eX&&e0){let e=await c(e0);tj.current=e,e?(tb.current=0,eZ(!0),tN.current||(tN.current=!0,tS(!0))):(tb.current+=1,tb.current>=o.t6&&eZ(!1))}else tj.current=!1}};if(!(eI&&(eR||eD)||eX&&e0))return;e();let t=!eX||eV;if((!eI||eO)&&t)return;let s=setInterval(e,o.RL);return()=>clearInterval(s)},[eI,eR,eD,eX,e0,eO,eV]);let tB=(0,l.useCallback)((e,t,s,a,l,n)=>{t.current?(s.current=0,a(!0),l.current||(l.current=!0,n(!0))):(s.current+=1,s.current>=o.t6&&a(!1))},[]),tD=async()=>{try{let e=await fetch("/api/tunnel/status",{cache:"no-store"});if(!e.ok)return;let t=await e.json(),s=t.tunnel?.settingsEnabled??t.tunnel?.enabled??!1,a=t.tunnel?.tunnelUrl||"";eB(a),eK(t.tunnel?.publicUrl||""),eU(s),tB(null,ty,tf,eL,tv,tk);let l=t.tailscale?.settingsEnabled??t.tailscale?.enabled??!1,n=t.tailscale?.tunnelUrl||"";e1(n),eQ(l),tB(null,tj,tb,eZ,tN,tS)}catch{}},tK=async()=>{e_(!0);try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status",{cache:"no-store"})]);if(e.ok){let t=await e.json();G(t.requireApiKey||!1),Q(t.allowRemoteNoApiKey||!1),Z(!1!==t.requireLogin),et(t.hasPassword||!1),ea(t.tunnelDashboardAccess||!1),en(!1!==t.rtkEnabled),ei(!!t.headroomEnabled),ec(t.headroomUrl||"http://localhost:8787"),em(!!t.headroomCompressUserMessages),tz(),ev(!!t.cavemanEnabled),ew(t.cavemanLevel||"full"),eC(!!t.ponytailEnabled),eT(t.ponytailLevel||"full")}if(t.ok){let e=await t.json(),s=e.tunnel?.settingsEnabled??e.tunnel?.enabled??!1,a=e.tunnel?.tunnelUrl||"";eB(a),eK(e.tunnel?.publicUrl||""),eU(s),tB(null,ty,tf,eL,tv,tk);let l=e.tailscale?.settingsEnabled??e.tailscale?.enabled??!1,n=e.tailscale?.tunnelUrl||"";e1(n),eQ(l),tB(null,tj,tb,eZ,tN,tS)}}catch(e){console.log("Error loading settings:",e)}finally{e_(!1)}},tW=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:e})})).ok&&ea(e)}catch(e){console.log("Error updating tunnelDashboardAccess:",e)}},tF=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:e})})).ok&&G(e)}catch(e){console.log("Error updating requireApiKey:",e)}},t$=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({allowRemoteNoApiKey:e})})).ok&&Q(e)}catch(e){console.log("Error updating allowRemoteNoApiKey:",e)}},tq=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&en(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},tH=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)}},tM=async()=>{let e=eo.trim()||"http://localhost:8787";ec(e),await tH({headroomUrl:e}),tz()},tz=(0,l.useCallback)(async()=>{eu(e=>({...e,loading:!0}));try{let e=await fetch("/api/headroom/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();eu({...t,loading:!1})}catch{eu({installed:!1,running:!1,python:null,loading:!1})}},[]),tJ=(0,l.useCallback)(async()=>{ey(""),ef(!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 tz()}catch(e){ey(e.message)}finally{ef(!1)}},[tz]),tY=(0,l.useCallback)(async()=>{ef(!0);try{await fetch("/api/headroom/stop",{method:"POST"}),await tz()}finally{ef(!1)}},[tz]),tG=async e=>{C(e),T(e.name||"");let t=e.allowedProviders,s=e.allowedCombos,a=e.allowedKinds;if(B(!t),K(!s),L(!a),U(s||[]),E(a||[]),t&&$.length>0){let e=new Set;for(let s of t){let t=$.find(e=>e.id===s);if(t){e.add(t.id);continue}let a=$.find(e=>e.alias===s);if(a){e.add(a.id);continue}let l=$.find(e=>e.prefix===s);if(l){e.add(l.id);continue}e.add(s)}_([...e])}else _([])},tX=async()=>{if(k){F(!0);try{let e={name:S.trim()||k.name||"",allowedProviders:R?null:A,allowedCombos:D?null:I,allowedKinds:O?null:P},s=await fetch(`/api/keys/${k.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(s.ok){let e=await s.json();t(t=>t.map(t=>t.id===k.id?{...t,...e.key}:t)),C(null)}}catch(e){console.log("Error saving key ACL:",e)}finally{F(!1)}}},tQ=async()=>{try{let[e,s,a,l]=await Promise.all([fetch("/api/keys",{cache:"no-store"}),fetch("/api/providers",{cache:"no-store"}),fetch("/api/combos",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"})]),n=await e.json();e.ok&&t(n.keys||[]);let r=[],i=[],o=[];if(s.ok){let e=await s.json();r=e.connections||[],e.aliasMap&&M(e.aliasMap),o=e.providers||[]}if(l.ok&&(i=(await l.json()).nodes||[]),q(function(e,t,s=[]){let a={};for(let e of t||[])a[e.id]={name:e.name,prefix:e.prefix||null,type:e.type};let l={};for(let t of e||[]){let e=t.provider;l[e]||(l[e]={id:e,count:0,alias:t.alias||null}),l[e].count++}for(let e of s||[])e.noAuth&&(l[e.id]||(l[e.id]={id:e.id,count:0,alias:e.alias||null}));let n={};for(let e of s||[])n[e.id]=e;return Object.values(l).map(({id:e,count:t,alias:s})=>{let l=a[e],r=n[e],i=r?.displayName||e,o=null;return l&&(i=l.name||e,o=l.prefix||null),{id:e,displayName:i,prefix:o,alias:s,count:t,serviceKinds:r?.serviceKinds||["llm"]}}).sort((e,t)=>e.displayName.localeCompare(t.displayName))}(r,i,o)),a.ok){let e=await a.json();J(e.combos||[])}}catch(e){console.log("Error fetching data:",e)}finally{p(!1)}},tV=async(...e)=>{eF(!0),eq("Waiting for tunnel ready...");let t=e.filter(Boolean).map(e=>`${e}/api/health`),s=Date.now();for(;Date.now()-s<o.Cp;){if(await new Promise(e=>setTimeout(e,o.Hx)),await Promise.any(t.map(async e=>{if((await fetch(e,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return eU(!0),eF(!1),eq(""),!0;if((Date.now()-s)%1e4<o.Hx)try{let e=await fetch("/api/tunnel/status");if(e.ok){let t=await e.json();if(!t.tunnel?.enabled)return eM({type:"error",message:"Tunnel process stopped unexpectedly."}),eF(!1),eq(""),!1}}catch{}}return eM({type:"error",message:"Tunnel created but not reachable. Please try again."}),eF(!1),eq(""),!1},tZ=async()=>{eJ(!1),eF(!0),eM(null),eq("Creating tunnel...");let e=!0;(async()=>{for(;e;){try{let t=await fetch("/api/tunnel/status");if(t.ok){let s=await t.json();s.download?.downloading?eq(`Downloading cloudflared... ${s.download.progress}%`):e&&eq("Creating tunnel...")}}catch{}await new Promise(e=>setTimeout(e,1e3))}})();try{let t=await fetch("/api/tunnel/enable",{method:"POST"});e=!1;let s=await t.json();if(!t.ok)return void eM({type:"error",message:s.error||"Failed to enable tunnel"});let a=s.tunnelUrl;if(!a)return void eM({type:"error",message:"No tunnel URL returned"});eB(a),eK(s.publicUrl||""),await tV(s.publicUrl,a)}catch(e){eM({type:"error",message:e.message})}finally{e=!1,eF(!1),eq("")}},t0=async()=>{eF(!0),eM(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(eU(!1),eB(""),eG(!1),eM({type:"success",message:"Tunnel disabled"})):eM({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){eM({type:"error",message:e.message})}finally{eF(!1)}},t1=async()=>{ta(null);try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok){let t=await e.json();return ta(t.installed),t}}catch{}return ta(!1),{installed:!1}},t5=async()=>{tn(!0),e6(null),ti([]);try{let e=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:to})});tc("");let t=e.body.getReader(),s=new TextDecoder,a="";for(;;){let{done:e,value:l}=await t.read();if(e)break;let n=(a+=s.decode(l,{stream:!0})).split("\n\n");for(let e of(a=n.pop()||"",n)){let t=e.split("\n"),s="progress",a=null;for(let e of t)if(e.startsWith("event: ")&&(s=e.slice(7).trim()),e.startsWith("data: "))try{a=JSON.parse(e.slice(6))}catch{}if(a)if("progress"===s)ti(e=>[...e.slice(-50),a.message]);else if("done"===s){ta(!0),tn(!1),tu(!1),t3();return}else"error"===s&&e6({type:"error",message:a.error||"Install failed"})}}}catch(e){e6({type:"error",message:e.message})}finally{tn(!1)}},t2=async e=>{e8("Waiting for Tailscale ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<o.Cp;){await new Promise(e=>setTimeout(e,o.Hx));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return!0}catch{}}return!1},t4=(e,t)=>{e9(e),tt(t)},t8=()=>{e9(""),tt("")},t3=async()=>{tu(!1),tm(!0),e2(!0),e6(null),e8("Connecting..."),t8();try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){e1(t.tunnelUrl||"");let e=await t2(t.tunnelUrl);eQ(!0),e6(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.needsLogin&&t.authUrl){t4(t.authUrl,"Open Login Page"),e8('Login required — click "Open Login Page" to continue');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok&&(await e.json()).loggedIn){t8(),e8("Starting funnel...");let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){e1(t.tunnelUrl||"");let e=await t2(t.tunnelUrl);eQ(!0),e6(e?null:{type:"warning",message:"Connected but not reachable yet."})}else t.funnelNotEnabled&&t.enableUrl?await t6(t.enableUrl):e6({type:"error",message:t.error||"Failed to start funnel"});return}}catch{}}t8(),e6({type:"error",message:"Login timed out. Please try again."});return}if(t.funnelNotEnabled&&t.enableUrl)return void await t6(t.enableUrl);e6({type:"error",message:t.error||"Failed to connect"})}catch(e){e6({type:"error",message:e.message})}finally{e2(!1),tm(!1),e8(""),t8()}},t6=async e=>{t4(e,"Open Funnel Settings"),e8('Click "Open Funnel Settings" to enable Funnel...');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){t8(),e1(t.tunnelUrl||"");let e=await t2(t.tunnelUrl);eQ(!0),e6(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.funnelNotEnabled)continue;if(t.error){t8(),e6({type:"error",message:t.error});return}}catch{}}t8(),e6({type:"error",message:"Timed out waiting for Funnel to be enabled."})},t7=async()=>{e2(!0),e6(null);try{let e=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),t=await e.json();e.ok?(eQ(!1),e1(""),tp(!1),e6({type:"success",message:"Tailscale disabled"})):e6({type:"error",message:t.error||"Failed to disable Tailscale"})}catch(e){e6({type:"error",message:e.message})}finally{e2(!1)}},t9=async()=>{e6(null),ti([]);let e=await t1();e?.installed&&e?.hasCachedPassword?t3():tu(!0)},se=async()=>{if(b.trim())try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b})}),t=await e.json();e.ok&&(v(t.key),await tQ(),y(""),f(!1))}catch(e){console.log("Error creating key:",e)}},st=async s=>{w({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{w(null);try{(await fetch(`/api/keys/${s}`,{method:"DELETE"})).ok&&(t(e.filter(e=>e.id!==s)),tP(e=>{let t=new Set(e);return t.delete(s),t}))}catch(e){console.log("Error deleting key:",e)}}})},ss=async(e,s)=>{try{(await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})).ok&&t(t=>t.map(t=>t.id===e?{...t,isActive:s}:t))}catch(e){console.log("Error toggling key:",e)}},[sa,sl]=(0,l.useState)("/v1");if((0,l.useEffect)(()=>{sl(`${window.location.origin}/v1`)},[]),s)return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(n.CardSkeleton,{}),(0,a.jsx)(n.CardSkeleton,{})]});let sn=!!ex.running,sr=!1!==ex.localUrl,si=!!ex.canStart,so=sr&&!!ex.managedPid,sc=ex.loading?"Checking…":sn?"Running":sr&&!ex.installed?"Not installed":sr?"Proxy off":"Unreachable";return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsxs)(n.Card,{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(m,{label:"Local",url:sa,copyId:"local_url",copied:tU,onCopy:tO}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${eI?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),eI&&!eW&&eO?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Input,{value:`${eD||eR}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>tO(`${eD||eR}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===tU?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>eG(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!eI||eW||eO?eW?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),e$||"Creating tunnel..."]}),(0,a.jsx)("button",{onClick:()=>{eF(!1),eq("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):eH?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),eH.message]}),(0,a.jsx)(n.Button,{size:"sm",icon:"cloud_upload",onClick:()=>eJ(!0),children:"Enable"})]}):eA?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,a.jsx)("button",{onClick:()=>e_(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,a.jsx)(n.Button,{size:"sm",icon:"cloud_upload",onClick:()=>{tL?eM({type:"error",message:`Security required: ${tR}`}):Y?eJ(!0):eM({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),tw?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,a.jsx)("button",{onClick:()=>eG(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${eX?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),eX&&!e5&&eV?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Input,{value:`${e0}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>tO(`${e0}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===tU?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>tp(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!eX||e5||eV?e5||td?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),e4||"Connecting..."]}),e7&&(0,a.jsx)(n.Button,{size:"sm",icon:"open_in_new",onClick:()=>window.open(e7,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:te||"Open"}),(0,a.jsx)("button",{onClick:()=>{e2(!1),tm(!1),e8(""),t8()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):e3?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),e3.message]}),(0,a.jsx)(n.Button,{size:"sm",icon:"vpn_lock",onClick:t9,children:"Enable"})]}):(0,a.jsx)(n.Button,{size:"sm",icon:"vpn_lock",onClick:()=>{tL?e6({type:"error",message:`Security required: ${tR}`}):t9()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),tC?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,a.jsx)("button",{onClick:()=>tp(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),tL&&!eI&&!eX&&(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(h,{message:tR,action:{label:"Open settings",href:"/dashboard/profile"}})}),(eI||eX)&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!Y&&(0,a.jsx)(h,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!V||!ee)&&(0,a.jsx)(h,{message:V?"Dashboard is using the new-installation default — change it in Profile settings before exposing access.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:V?"Change password":"Enable",href:"/dashboard/profile"}})]}),(eI||eX)&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,a.jsx)(n.Toggle,{checked:es,onChange:()=>tW(!es)}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,a.jsx)(u,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,a.jsxs)(n.Card,{id:"rtk",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,a.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,a.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,a.jsx)(n.Toggle,{checked:el,onChange:()=>tq(!el)})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between py-4 border-b border-border gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress context"," ",(0,a.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,a.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${sn?"bg-success/15 text-success":"bg-warning/15 text-warning"}`,children:sc}),(0,a.jsx)("button",{type:"button",onClick:()=>ep(!0),className:"text-xs text-primary underline hover:opacity-80",children:sn?"Manage":"Setup"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Compress prompts via /v1/compress before routing to the model"})]}),(0,a.jsx)(n.Toggle,{checked:er,onChange:()=>{var e;let t;return e=!er,void(ec(t=eo.trim()||"http://localhost:8787"),ei(e),tH({headroomEnabled:e,headroomUrl:t}))}})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4 gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,a.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,a.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[ej&&(0,a.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:tI.map(e=>(0,a.jsx)("button",{onClick:()=>{var t;ew(t=e.id),tH({cavemanLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${eN===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,a.jsx)("p",{className:"text-xs text-primary",children:o.ev.find(e=>e.id===eN)?.desc})]}),(0,a.jsx)(n.Toggle,{checked:ej,onChange:()=>{var e;ev(e=!ej),tH({cavemanEnabled:e})}})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Lazy senior dev"," ",(0,a.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,a.jsx)("p",{className:"text-sm text-text-muted",children:"Bias the model toward minimal code: YAGNI, reuse stdlib, deletion over addition"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[ek&&(0,a.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:o.Nv.map(e=>(0,a.jsx)("button",{onClick:()=>{var t;eT(t=e.id),tH({ponytailLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${eS===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,a.jsx)("p",{className:"text-xs text-primary",children:o.Nv.find(e=>e.id===eS)?.desc})]}),(0,a.jsx)(n.Toggle,{checked:ek,onChange:()=>{var e;eC(e=!ek),tH({ponytailEnabled:e})}})]})]})]}),(0,a.jsxs)(n.Card,{id:"require-api-key",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,a.jsx)(n.Button,{icon:"add",onClick:()=>f(!0),children:"Create Key"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,a.jsx)(n.Toggle,{checked:Y,onChange:()=>tF(!Y)})]}),tE&&!Y&&(0,a.jsx)("div",{className:"mb-4 -mt-2",children:(0,a.jsx)(h,{message:"Endpoint is exposed without an API key."})}),!Y&&tE&&(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl bg-surface/50 border border-border/30 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:"Allow Remote Access Without API Key"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Let non-loopback requests reach /v1/* without a key (use with caution)"})]}),(0,a.jsx)(n.Toggle,{checked:X,onChange:()=>t$(!X)})]}),!Y&&X&&(0,a.jsx)("div",{className:"mb-4 -mt-2",children:(0,a.jsx)(h,{message:"Remote access without an API key is enabled — anyone who can reach this endpoint can use your providers."})}),0===e.length?(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,a.jsx)(n.Button,{icon:"add",onClick:()=>f(!0),children:"Create Key"})]}):(0,a.jsx)("div",{className:"flex flex-col",children:e.map(e=>{var t;return(0,a.jsxs)("div",{className:`group flex items-start justify-between gap-3 py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1 min-w-0 flex-wrap",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono break-all min-w-0",children:tT.has(e.id)?e.key:(t=e.key)&&!(t.length<=10)?t.slice(0,6)+"•".repeat(t.length-10)+t.slice(-4):t||""}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,a.jsx)("button",{onClick:()=>{var t;return t=e.id,void tP(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",title:tT.has(e.id)?"Hide key":"Show key",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:tT.has(e.id)?"visibility_off":"visibility"})}),(0,a.jsx)("button",{onClick:()=>tO(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:tU===e.id?"check":"content_copy"})})]})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]}),!1===e.isActive&&(0,a.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"}),(e.allowedProviders||e.allowedCombos||e.allowedKinds)&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.allowedProviders&&(0,a.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-500 dark:bg-blue-500/20",title:e.allowedProviders.join(", "),children:0===e.allowedProviders.length?"No providers":e.allowedProviders.map(e=>{let t=$.find(t=>t.id===e||t.alias===e||t.prefix===e);if(t)return t.displayName;let s=H[e];return s||e}).join(", ")}),e.allowedCombos&&(0,a.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-purple-500/10 text-purple-500 dark:bg-purple-500/20",children:0===e.allowedCombos.length?"No combos":e.allowedCombos.join(", ")}),e.allowedKinds&&(0,a.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-green-500/10 text-green-500 dark:bg-green-500/20",children:0===e.allowedKinds.length?"No kinds":e.allowedKinds.join(", ")})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0 pt-0.5",children:[(0,a.jsx)("button",{onClick:()=>tG(e),className:"p-2 hover:bg-primary/10 rounded text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",title:"Edit access control",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tune"})}),(0,a.jsx)(n.Toggle,{size:"sm",checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?w({title:"Pause API Key",message:`Pause API key "${e.name}"?
|
|
2
2
|
|
|
3
|
-
This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{w(null),ss(e.id,t)}}):ss(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,a.jsx)("button",{onClick:()=>st(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,a.jsx)(n.Modal,{isOpen:g,title:"Create API Key",onClose:()=>{b(!1),y("")},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(n.Input,{label:"Key Name",value:f,onChange:e=>y(e.target.value),placeholder:"Production Key"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Button,{onClick:se,fullWidth:!0,disabled:!f.trim(),children:"Create"}),(0,a.jsx)(n.Button,{onClick:()=>{b(!1),y("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(n.Modal,{isOpen:!!j,title:"API Key Created",onClose:()=>v(null),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,a.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Input,{value:j||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)(n.Button,{variant:"secondary",icon:"created_key"===tI?"check":"content_copy",onClick:()=>tO(j,"created_key"),children:"created_key"===tI?"Copied!":"Copy"})]}),(0,a.jsx)(n.Button,{onClick:()=>v(null),fullWidth:!0,children:"Done"})]})}),(0,a.jsx)(n.Modal,{isOpen:!!k,title:`Edit Access: ${k?.name||""}`,onClose:()=>!W&&C(null),children:(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium mb-1",children:"Key Name"}),(0,a.jsx)(n.Input,{value:S,onChange:e=>T(e.target.value),placeholder:"Key name"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Service Kinds"}),(0,a.jsxs)("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:O,onChange:e=>L(e.target.checked)}),(0,a.jsx)("span",{className:"text-text-muted",children:"All allowed"})]})]}),!O&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:["llm","embedding","image","video","tts","stt","webSearch","webFetch"].map(e=>(0,a.jsxs)("label",{className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg border text-xs cursor-pointer transition-colors ${P.includes(e)?"border-primary bg-primary/10 text-primary":"border-border-subtle text-text-muted hover:border-primary/40"}`,children:[(0,a.jsx)("input",{type:"checkbox",className:"hidden",checked:P.includes(e),onChange:()=>{E(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}}),e]},e))}),O&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"This key can access all service kinds."})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Providers"}),(0,a.jsxs)("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:R,onChange:e=>B(e.target.checked)}),(0,a.jsx)("span",{className:"text-text-muted",children:"All allowed"})]})]}),!R&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"max-h-60 overflow-y-auto border border-border-subtle rounded-lg p-2 space-y-1",children:0===$.length?(0,a.jsx)("p",{className:"text-xs text-text-muted p-2",children:"No providers configured."}):$.map(e=>{let t=A.includes(e.id);return(0,a.jsxs)("label",{className:`flex items-center gap-2 px-2 py-2 rounded text-xs cursor-pointer transition-colors ${t?"bg-primary/10 text-primary":"hover:bg-surface-2"}`,children:[(0,a.jsx)("input",{type:"checkbox",checked:t,onChange:()=>{var t;return t=e.id,void _(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"rounded"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("span",{className:"font-medium",children:e.displayName}),e.prefix&&(0,a.jsx)("span",{className:"ml-1.5 text-[10px] px-1 py-0.5 rounded bg-surface-2 text-text-muted font-mono",children:e.prefix})]}),(0,a.jsxs)("span",{className:"text-text-muted text-[10px] shrink-0",children:[e.count," conn"]})]},e.id)})}),0===A.length&&(0,a.jsxs)("p",{className:"text-xs text-warning bg-warning/10 border border-warning/20 rounded px-2 py-1 mt-1.5 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,a.jsx)("span",{children:"Warning: Zero providers selected. This key will have NO access to any providers (Deny All)."})]})]}),R&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["This key can access all providers (",$.length,")."]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Combos"}),(0,a.jsxs)("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:D,onChange:e=>K(e.target.checked)}),(0,a.jsx)("span",{className:"text-text-muted",children:"All allowed"})]})]}),!D&&(0,a.jsx)("div",{className:"max-h-40 overflow-y-auto border border-border-subtle rounded-lg p-2 space-y-1",children:0===z.length?(0,a.jsx)("p",{className:"text-xs text-text-muted p-2",children:"No combos configured."}):z.map(e=>{let t=e.name||e.id,s=U.includes(t);return(0,a.jsxs)("label",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs cursor-pointer transition-colors ${s?"bg-primary/10 text-primary":"hover:bg-surface-2"}`,children:[(0,a.jsx)("input",{type:"checkbox",checked:s,onChange:()=>{I(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"rounded"}),(0,a.jsx)("span",{children:t}),(0,a.jsxs)("span",{className:"text-text-muted ml-auto text-[10px]",children:[Array.isArray(e.models)?e.models.length:0," models"]})]},t)})}),D&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"This key can access all combos."})]}),(0,a.jsxs)("div",{className:"text-xs text-text-muted bg-surface-2 rounded-lg p-3 border border-border-subtle",children:[(0,a.jsx)("p",{className:"font-medium mb-1",children:"How it works:"}),(0,a.jsxs)("ul",{className:"list-disc pl-4 space-y-0.5",children:[(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"All allowed"})," = unrestricted (default). No ACL filtering."]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"Unchecked + empty"})," = deny everything of that type."]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"Checked items"})," = only those items are accessible."]})]})]}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)(n.Button,{onClick:()=>C(null),variant:"ghost",fullWidth:!0,disabled:W,children:"Cancel"}),(0,a.jsx)(n.Button,{onClick:tX,fullWidth:!0,disabled:W,children:W?"Saving...":"Save ACL"})]})]})}),(0,a.jsx)(n.Modal,{isOpen:ez,title:"Enable Tunnel",onClose:()=>eJ(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local 9Router to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3",children:o.oX.map(e=>(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:e.icon}),(0,a.jsx)("p",{className:"text-xs font-semibold",children:e.title}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e.desc})]},e.title))}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Button,{onClick:tZ,fullWidth:!0,children:"Start Tunnel"}),(0,a.jsx)(n.Button,{onClick:()=>eJ(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(n.Modal,{isOpen:eG,title:"Disable Tunnel",onClose:()=>!eW&&eY(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Button,{onClick:t0,fullWidth:!0,disabled:eW,variant:"danger",children:eW?"Disabling...":"Disable"}),(0,a.jsx)(n.Button,{onClick:()=>eY(!1),variant:"ghost",fullWidth:!0,disabled:eW,children:"Cancel"})]})]})}),(0,a.jsx)(n.Modal,{isOpen:tx,title:"Tailscale Funnel",onClose:()=>{tl||(tu(!1),tc(""),e6(null))},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[null===ts&&(0,a.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===ts&&!tl&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Button,{onClick:t5,fullWidth:!0,children:"Install Tailscale"}),(0,a.jsx)(n.Button,{onClick:()=>tu(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),tl&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),tr.length>0&&(0,a.jsx)("div",{ref:tg,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:tr.map((e,t)=>(0,a.jsx)("div",{children:e},t))})]}),!0===ts&&!tl&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Button,{onClick:()=>t3(),fullWidth:!0,children:"Connect"}),(0,a.jsx)(n.Button,{onClick:()=>tu(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),e3&&(0,a.jsx)(x,{status:e3})]})}),(0,a.jsx)(n.Modal,{isOpen:th,title:"Disable Tailscale",onClose:()=>!e5&&tp(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Button,{onClick:t7,fullWidth:!0,disabled:e5,variant:"danger",children:e5?"Disabling...":"Disable"}),(0,a.jsx)(n.Button,{onClick:()=>tp(!1),variant:"ghost",fullWidth:!0,disabled:e5,children:"Cancel"})]})]})}),(0,a.jsx)(n.Modal,{isOpen:eh,title:sn?"Headroom":"Setup Headroom",onClose:()=>ep(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,a.jsx)("span",{children:"Status"}),(0,a.jsx)("span",{className:sn?"text-success":"text-warning",children:sc})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Proxy URL"}),(0,a.jsx)(n.Input,{value:eo,onChange:e=>ec(e.target.value),onBlur:tM,placeholder:"http://localhost:8787",className:"font-mono text-sm"}),(0,a.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."})]}),so?(0,a.jsx)(n.Button,{onClick:tG,variant:"ghost",fullWidth:!0,disabled:eg,children:eg?"Stopping…":"Stop Headroom"}):sn?(0,a.jsx)("p",{className:"text-sm text-success",children:"Headroom proxy is reachable. You can enable the token saver."}):si?(0,a.jsx)(n.Button,{onClick:tJ,fullWidth:!0,disabled:eg,children:eg?"Starting…":"Start Headroom"}):sr?ex.python?(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Install then click Start:"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("pre",{className:"flex-1 rounded bg-black/5 dark:bg-white/5 p-2 text-xs font-mono overflow-x-auto",children:'pip install "headroom-ai[proxy]"'}),(0,a.jsx)(n.Button,{size:"sm",variant:"ghost",onClick:()=>tO('pip install "headroom-ai[proxy]"'),children:tI?"Copied":"Copy"})]})]}):(0,a.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,a.jsx)("p",{className:"text-sm text-warning",children:"Start Headroom separately at the configured URL, then recheck."}),ef&&(0,a.jsx)("p",{className:"text-sm text-warning",children:ef}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Button,{onClick:()=>tz(),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,a.jsx)(n.Button,{onClick:()=>ep(!1),fullWidth:!0,children:"Done"})]})]})}),(0,a.jsx)(n.ConfirmModal,{isOpen:!!N,onClose:()=>w(null),onConfirm:N?.onConfirm,title:N?.title||"Confirm",message:N?.message,variant:"danger"})]})}}}]);
|
|
3
|
+
This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{w(null),ss(e.id,t)}}):ss(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,a.jsx)("button",{onClick:()=>st(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,a.jsx)(n.Modal,{isOpen:g,title:"Create API Key",onClose:()=>{f(!1),y("")},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(n.Input,{label:"Key Name",value:b,onChange:e=>y(e.target.value),placeholder:"Production Key"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Button,{onClick:se,fullWidth:!0,disabled:!b.trim(),children:"Create"}),(0,a.jsx)(n.Button,{onClick:()=>{f(!1),y("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(n.Modal,{isOpen:!!j,title:"API Key Created",onClose:()=>v(null),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,a.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"Store this key securely. You can view or copy it later from the API Keys list."})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Input,{value:j||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)(n.Button,{variant:"secondary",icon:"created_key"===tU?"check":"content_copy",onClick:()=>tO(j,"created_key"),children:"created_key"===tU?"Copied!":"Copy"})]}),(0,a.jsx)(n.Button,{onClick:()=>v(null),fullWidth:!0,children:"Done"})]})}),(0,a.jsx)(n.Modal,{isOpen:!!k,title:`Edit Access: ${k?.name||""}`,onClose:()=>!W&&C(null),children:(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium mb-1",children:"Key Name"}),(0,a.jsx)(n.Input,{value:S,onChange:e=>T(e.target.value),placeholder:"Key name"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Service Kinds"}),(0,a.jsxs)("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:O,onChange:e=>L(e.target.checked)}),(0,a.jsx)("span",{className:"text-text-muted",children:"All allowed"})]})]}),!O&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:["llm","embedding","image","video","tts","stt","webSearch","webFetch"].map(e=>(0,a.jsxs)("label",{className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg border text-xs cursor-pointer transition-colors ${P.includes(e)?"border-primary bg-primary/10 text-primary":"border-border-subtle text-text-muted hover:border-primary/40"}`,children:[(0,a.jsx)("input",{type:"checkbox",className:"hidden",checked:P.includes(e),onChange:()=>{E(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}}),e]},e))}),O&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"This key can access all service kinds."})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Providers"}),(0,a.jsxs)("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:R,onChange:e=>B(e.target.checked)}),(0,a.jsx)("span",{className:"text-text-muted",children:"All allowed"})]})]}),!R&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"max-h-60 overflow-y-auto border border-border-subtle rounded-lg p-2 space-y-1",children:0===$.length?(0,a.jsx)("p",{className:"text-xs text-text-muted p-2",children:"No providers configured."}):$.map(e=>{let t=A.includes(e.id);return(0,a.jsxs)("label",{className:`flex items-center gap-2 px-2 py-2 rounded text-xs cursor-pointer transition-colors ${t?"bg-primary/10 text-primary":"hover:bg-surface-2"}`,children:[(0,a.jsx)("input",{type:"checkbox",checked:t,onChange:()=>{var t;return t=e.id,void _(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"rounded"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("span",{className:"font-medium",children:e.displayName}),e.prefix&&(0,a.jsx)("span",{className:"ml-1.5 text-[10px] px-1 py-0.5 rounded bg-surface-2 text-text-muted font-mono",children:e.prefix})]}),(0,a.jsxs)("span",{className:"text-text-muted text-[10px] shrink-0",children:[e.count," conn"]})]},e.id)})}),0===A.length&&(0,a.jsxs)("p",{className:"text-xs text-warning bg-warning/10 border border-warning/20 rounded px-2 py-1 mt-1.5 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,a.jsx)("span",{children:"Warning: Zero providers selected. This key will have NO access to any providers (Deny All)."})]})]}),R&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["This key can access all providers (",$.length,")."]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Combos"}),(0,a.jsxs)("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:D,onChange:e=>K(e.target.checked)}),(0,a.jsx)("span",{className:"text-text-muted",children:"All allowed"})]})]}),!D&&(0,a.jsx)("div",{className:"max-h-40 overflow-y-auto border border-border-subtle rounded-lg p-2 space-y-1",children:0===z.length?(0,a.jsx)("p",{className:"text-xs text-text-muted p-2",children:"No combos configured."}):z.map(e=>{let t=e.name||e.id,s=I.includes(t);return(0,a.jsxs)("label",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs cursor-pointer transition-colors ${s?"bg-primary/10 text-primary":"hover:bg-surface-2"}`,children:[(0,a.jsx)("input",{type:"checkbox",checked:s,onChange:()=>{U(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"rounded"}),(0,a.jsx)("span",{children:t}),(0,a.jsxs)("span",{className:"text-text-muted ml-auto text-[10px]",children:[Array.isArray(e.models)?e.models.length:0," models"]})]},t)})}),D&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"This key can access all combos."})]}),(0,a.jsxs)("div",{className:"text-xs text-text-muted bg-surface-2 rounded-lg p-3 border border-border-subtle",children:[(0,a.jsx)("p",{className:"font-medium mb-1",children:"How it works:"}),(0,a.jsxs)("ul",{className:"list-disc pl-4 space-y-0.5",children:[(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"All allowed"})," = unrestricted (default). No ACL filtering."]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"Unchecked + empty"})," = deny everything of that type."]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"Checked items"})," = only those items are accessible."]})]})]}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)(n.Button,{onClick:()=>C(null),variant:"ghost",fullWidth:!0,disabled:W,children:"Cancel"}),(0,a.jsx)(n.Button,{onClick:tX,fullWidth:!0,disabled:W,children:W?"Saving...":"Save ACL"})]})]})}),(0,a.jsx)(n.Modal,{isOpen:ez,title:"Enable Tunnel",onClose:()=>eJ(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local 9Router to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3",children:o.oX.map(e=>(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:e.icon}),(0,a.jsx)("p",{className:"text-xs font-semibold",children:e.title}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e.desc})]},e.title))}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Button,{onClick:tZ,fullWidth:!0,children:"Start Tunnel"}),(0,a.jsx)(n.Button,{onClick:()=>eJ(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(n.Modal,{isOpen:eY,title:"Disable Tunnel",onClose:()=>!eW&&eG(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Button,{onClick:t0,fullWidth:!0,disabled:eW,variant:"danger",children:eW?"Disabling...":"Disable"}),(0,a.jsx)(n.Button,{onClick:()=>eG(!1),variant:"ghost",fullWidth:!0,disabled:eW,children:"Cancel"})]})]})}),(0,a.jsx)(n.Modal,{isOpen:tx,title:"Tailscale Funnel",onClose:()=>{tl||(tu(!1),tc(""),e6(null))},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[null===ts&&(0,a.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===ts&&!tl&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Button,{onClick:t5,fullWidth:!0,children:"Install Tailscale"}),(0,a.jsx)(n.Button,{onClick:()=>tu(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),tl&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),tr.length>0&&(0,a.jsx)("div",{ref:tg,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:tr.map((e,t)=>(0,a.jsx)("div",{children:e},t))})]}),!0===ts&&!tl&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Button,{onClick:()=>t3(),fullWidth:!0,children:"Connect"}),(0,a.jsx)(n.Button,{onClick:()=>tu(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),e3&&(0,a.jsx)(x,{status:e3})]})}),(0,a.jsx)(n.Modal,{isOpen:th,title:"Disable Tailscale",onClose:()=>!e5&&tp(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Button,{onClick:t7,fullWidth:!0,disabled:e5,variant:"danger",children:e5?"Disabling...":"Disable"}),(0,a.jsx)(n.Button,{onClick:()=>tp(!1),variant:"ghost",fullWidth:!0,disabled:e5,children:"Cancel"})]})]})}),(0,a.jsx)(n.Modal,{isOpen:eh,title:sn?"Headroom":"Setup Headroom",onClose:()=>ep(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,a.jsx)("span",{children:"Status"}),(0,a.jsx)("span",{className:sn?"text-success":"text-warning",children:sc})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Proxy URL"}),(0,a.jsx)(n.Input,{value:eo,onChange:e=>ec(e.target.value),onBlur:tM,placeholder:"http://localhost:8787",className:"font-mono text-sm"}),(0,a.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."})]}),so?(0,a.jsx)(n.Button,{onClick:tY,variant:"ghost",fullWidth:!0,disabled:eg,children:eg?"Stopping…":"Stop Headroom"}):sn?(0,a.jsx)("p",{className:"text-sm text-success",children:"Headroom proxy is reachable. You can enable the token saver."}):si?(0,a.jsx)(n.Button,{onClick:tJ,fullWidth:!0,disabled:eg,children:eg?"Starting…":"Start Headroom"}):sr?ex.python?(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Install then click Start:"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("pre",{className:"flex-1 rounded bg-black/5 dark:bg-white/5 p-2 text-xs font-mono overflow-x-auto",children:'pip install "headroom-ai[proxy]"'}),(0,a.jsx)(n.Button,{size:"sm",variant:"ghost",onClick:()=>tO('pip install "headroom-ai[proxy]"'),children:tU?"Copied":"Copy"})]})]}):(0,a.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,a.jsx)("p",{className:"text-sm text-warning",children:"Start Headroom separately at the configured URL, then recheck."}),eb&&(0,a.jsx)("p",{className:"text-sm text-warning",children:eb}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.Button,{onClick:()=>tz(),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,a.jsx)(n.Button,{onClick:()=>ep(!1),fullWidth:!0,children:"Done"})]})]})}),(0,a.jsx)(n.ConfirmModal,{isOpen:!!N,onClose:()=>w(null),onConfirm:N?.onConfirm,title:N?.title||"Confirm",message:N?.message,variant:"danger"})]})}}}]);
|
package/app/.next-cli-build/static/chunks/{8667.b22b7da66acd945f.js → 9752.f8753c75713960c0.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8667],{58667:(e,t,r)=>{function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){var n,o;n=t,o=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e){return function t(){for(var r=this,n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(r,[].concat(o,n))}}}function l(e){return({}).toString.call(e).includes("Object")}function s(e){return"function"==typeof e}r.r(t),r.d(t,{DiffEditor:()=>K,Editor:()=>Z,default:()=>ee,loader:()=>L,useMonaco:()=>Q});var f,d,g=a(function(e,t){throw Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),p=function(e,t){return l(t)||g("changeType"),Object.keys(t).some(function(t){return!Object.prototype.hasOwnProperty.call(e,t)})&&g("changeField"),t},h=function(e){s(e)||g("selectorType")},y=function(e){s(e)||l(e)||g("handlerType"),l(e)&&Object.values(e).some(function(e){return!s(e)})&&g("handlersType")},m=function(e){e||g("initialIsRequired"),l(e)||g("initialType"),Object.keys(e).length||g("initialContent")};function v(e,t){return s(t)?t(e.current):t}function b(e,t){return e.current=u(u({},e.current),t),t}function O(e,t,r){return s(t)?t(e.current):Object.keys(r).forEach(function(r){var n;return null==(n=t[r])?void 0:n.call(t,e.current[r])}),r}var w={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},j=(f=function(e,t){throw Error(e[t]||e.default)},function e(){for(var t=this,r=arguments.length,n=Array(r),o=0;o<r;o++)n[o]=arguments[o];return n.length>=f.length?f.apply(this,n):function(){for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return e.apply(t,[].concat(n,o))}})(w),M=function(e){return(e||j("configIsRequired"),({}).toString.call(e).includes("Object")||j("configType"),e.urls)?(console.warn(w.deprecation),{paths:{vs:e.urls.monacoBase}}):e},E=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}},P={type:"cancelation",msg:"operation is manually canceled"};function R(e){var t=!1,r=new Promise(function(r,n){e.then(function(e){return t?n(P):r(e)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var S=["monaco"],k=function(e){if(Array.isArray(e))return e}(d=({create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(e),y(t);var r={current:e},n=a(O)(r,t),o=a(b)(r),i=a(p)(e),c=a(v)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return h(e),e(r.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}})(n,o,i,c)(e)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,n,o,i,c=[],u=!0,a=!1;try{o=(t=t.call(e)).next,!1;for(;!(u=(r=o.call(t)).done)&&(c.push(r.value),2!==c.length);u=!0);}catch(e){a=!0,n=e}finally{try{if(!u&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(a)throw n}}return c}}(d)||function(e){if(e){if("string"==typeof e)return n(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,2):void 0}}(d)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),T=k[0],C=k[1];function I(e){return document.body.appendChild(e)}function x(e){var t,r,n=T(function(e){return{config:e.config,reject:e.reject}}),o=(t="".concat(n.config.paths.vs,"/loader.js"),r=document.createElement("script"),t&&(r.src=t),r);return o.onload=function(){return e()},o.onerror=n.reject,o}function A(){var e=T(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var r=t.m||t;D(r),e.resolve(r)},function(t){e.reject(t)})}function D(e){T().monaco||C({monaco:e})}var V=new Promise(function(e,t){return C({resolve:e,reject:t})}),L={config:function(e){var t=M(e),r=t.monaco,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,S);C(function(e){return{config:function e(t,r){return Object.keys(r).forEach(function(n){r[n]instanceof Object&&t[n]&&Object.assign(r[n],e(t[n],r[n]))}),i(i({},t),r)}(e.config,n),monaco:r}})},init:function(){var e=T(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(C({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),R(V);if(window.monaco&&window.monaco.editor)return D(window.monaco),e.resolve(window.monaco),R(V);E(I,x)(A)}return R(V)},__getMonacoInstance:function(){return T(function(e){return e.monaco})}},_=r(82030),N={display:"flex",position:"relative",textAlign:"initial"},q={width:"100%"},z={display:"none"},F={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"},U=function({children:e}){return _.createElement("div",{style:F},e)},B=(0,_.memo)(function({width:e,height:t,isEditorReady:r,loading:n,_ref:o,className:i,wrapperProps:c}){return _.createElement("section",{style:{...N,width:e,height:t},...c},!r&&_.createElement(U,null,n),_.createElement("div",{ref:o,style:{...q,...!r&&z},className:i}))}),Y=function(e){(0,_.useEffect)(e,[])},$=function(e,t,r=!0){let n=(0,_.useRef)(!0);(0,_.useEffect)(n.current||!r?()=>{n.current=!1}:e,t)};function G(){}function H(e,t,r,n){var o,i,c,u,a,l;return o=e,i=n,o.editor.getModel(J(o,i))||(c=e,u=t,a=r,l=n,c.editor.createModel(u,a,l?J(c,l):void 0))}function J(e,t){return e.Uri.parse(t)}var K=(0,_.memo)(function({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:c,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:a=!1,theme:l="light",loading:s="Loading...",options:f={},height:d="100%",width:g="100%",className:p,wrapperProps:h={},beforeMount:y=G,onMount:m=G}){let[v,b]=(0,_.useState)(!1),[O,w]=(0,_.useState)(!0),j=(0,_.useRef)(null),M=(0,_.useRef)(null),E=(0,_.useRef)(null),P=(0,_.useRef)(m),R=(0,_.useRef)(y),S=(0,_.useRef)(!1);Y(()=>{let e=L.init();return e.then(e=>(M.current=e)&&w(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return j.current?(t=j.current?.getModel(),void(u||t?.original?.dispose(),a||t?.modified?.dispose(),j.current?.dispose())):e.cancel()}}),$(()=>{if(j.current&&M.current){let t=j.current.getOriginalEditor(),o=H(M.current,e||"",n||r||"text",i||"");o!==t.getModel()&&t.setModel(o)}},[i],v),$(()=>{if(j.current&&M.current){let e=j.current.getModifiedEditor(),n=H(M.current,t||"",o||r||"text",c||"");n!==e.getModel()&&e.setModel(n)}},[c],v),$(()=>{let e=j.current.getModifiedEditor();e.getOption(M.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),$(()=>{j.current?.getModel()?.original.setValue(e||"")},[e],v),$(()=>{let{original:e,modified:t}=j.current.getModel();M.current.editor.setModelLanguage(e,n||r||"text"),M.current.editor.setModelLanguage(t,o||r||"text")},[r,n,o],v),$(()=>{M.current?.editor.setTheme(l)},[l],v),$(()=>{j.current?.updateOptions(f)},[f],v);let k=(0,_.useCallback)(()=>{if(!M.current)return;R.current(M.current);let u=H(M.current,e||"",n||r||"text",i||""),a=H(M.current,t||"",o||r||"text",c||"");j.current?.setModel({original:u,modified:a})},[r,t,o,e,n,i,c]),T=(0,_.useCallback)(()=>{!S.current&&E.current&&(j.current=M.current.editor.createDiffEditor(E.current,{automaticLayout:!0,...f}),k(),M.current?.editor.setTheme(l),b(!0),S.current=!0)},[f,l,k]);return(0,_.useEffect)(()=>{v&&P.current(j.current,M.current)},[v]),(0,_.useEffect)(()=>{O||v||T()},[O,v,T]),_.createElement(B,{width:g,height:d,isEditorReady:v,loading:s,_ref:E,className:p,wrapperProps:h})}),Q=function(){let[e,t]=(0,_.useState)(L.__getMonacoInstance());return Y(()=>{let r;return e||(r=L.init()).then(e=>{t(e)}),()=>r?.cancel()}),e},W=function(e){let t=(0,_.useRef)();return(0,_.useEffect)(()=>{t.current=e},[e]),t.current},X=new Map,Z=(0,_.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:o,path:i,theme:c="light",line:u,loading:a="Loading...",options:l={},overrideServices:s={},saveViewState:f=!0,keepCurrentModel:d=!1,width:g="100%",height:p="100%",className:h,wrapperProps:y={},beforeMount:m=G,onMount:v=G,onChange:b,onValidate:O=G}){let[w,j]=(0,_.useState)(!1),[M,E]=(0,_.useState)(!0),P=(0,_.useRef)(null),R=(0,_.useRef)(null),S=(0,_.useRef)(null),k=(0,_.useRef)(v),T=(0,_.useRef)(m),C=(0,_.useRef)(),I=(0,_.useRef)(n),x=W(i),A=(0,_.useRef)(!1),D=(0,_.useRef)(!1);Y(()=>{let e=L.init();return e.then(e=>(P.current=e)&&E(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>R.current?void(C.current?.dispose(),d?f&&X.set(i,R.current.saveViewState()):R.current.getModel()?.dispose(),R.current.dispose()):e.cancel()}),$(()=>{let c=H(P.current,e||n||"",t||o||"",i||r||"");c!==R.current?.getModel()&&(f&&X.set(x,R.current?.saveViewState()),R.current?.setModel(c),f&&R.current?.restoreViewState(X.get(i)))},[i],w),$(()=>{R.current?.updateOptions(l)},[l],w),$(()=>{R.current&&void 0!==n&&(R.current.getOption(P.current.editor.EditorOption.readOnly)?R.current.setValue(n):n!==R.current.getValue()&&(D.current=!0,R.current.executeEdits("",[{range:R.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),R.current.pushUndoStop(),D.current=!1))},[n],w),$(()=>{let e=R.current?.getModel();e&&o&&P.current?.editor.setModelLanguage(e,o)},[o],w),$(()=>{void 0!==u&&R.current?.revealLine(u)},[u],w),$(()=>{P.current?.editor.setTheme(c)},[c],w);let V=(0,_.useCallback)(()=>{if(!(!S.current||!P.current)&&!A.current){T.current(P.current);let a=i||r,d=H(P.current,n||e||"",t||o||"",a||"");R.current=P.current?.editor.create(S.current,{model:d,automaticLayout:!0,...l},s),f&&R.current.restoreViewState(X.get(a)),P.current.editor.setTheme(c),void 0!==u&&R.current.revealLine(u),j(!0),A.current=!0}},[e,t,r,n,o,i,l,s,f,c,u]);return(0,_.useEffect)(()=>{w&&k.current(R.current,P.current)},[w]),(0,_.useEffect)(()=>{M||w||V()},[M,w,V]),I.current=n,(0,_.useEffect)(()=>{w&&b&&(C.current?.dispose(),C.current=R.current?.onDidChangeModelContent(e=>{D.current||b(R.current.getValue(),e)}))},[w,b]),(0,_.useEffect)(()=>{if(w){let e=P.current.editor.onDidChangeMarkers(e=>{let t=R.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=P.current.editor.getModelMarkers({resource:t});O?.(e)}});return()=>{e?.dispose()}}return()=>{}},[w,O]),_.createElement(B,{width:g,height:p,isEditorReady:w,loading:a,_ref:S,className:h,wrapperProps:y})}),ee=Z}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9752],{29752:(e,t,r)=>{function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){var n,o;n=t,o=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e){return function t(){for(var r=this,n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(r,[].concat(o,n))}}}function l(e){return({}).toString.call(e).includes("Object")}function s(e){return"function"==typeof e}r.r(t),r.d(t,{DiffEditor:()=>K,Editor:()=>Z,default:()=>ee,loader:()=>L,useMonaco:()=>Q});var f,d,g=a(function(e,t){throw Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),p=function(e,t){return l(t)||g("changeType"),Object.keys(t).some(function(t){return!Object.prototype.hasOwnProperty.call(e,t)})&&g("changeField"),t},h=function(e){s(e)||g("selectorType")},y=function(e){s(e)||l(e)||g("handlerType"),l(e)&&Object.values(e).some(function(e){return!s(e)})&&g("handlersType")},m=function(e){e||g("initialIsRequired"),l(e)||g("initialType"),Object.keys(e).length||g("initialContent")};function v(e,t){return s(t)?t(e.current):t}function b(e,t){return e.current=u(u({},e.current),t),t}function O(e,t,r){return s(t)?t(e.current):Object.keys(r).forEach(function(r){var n;return null==(n=t[r])?void 0:n.call(t,e.current[r])}),r}var w={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},j=(f=function(e,t){throw Error(e[t]||e.default)},function e(){for(var t=this,r=arguments.length,n=Array(r),o=0;o<r;o++)n[o]=arguments[o];return n.length>=f.length?f.apply(this,n):function(){for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return e.apply(t,[].concat(n,o))}})(w),M=function(e){return(e||j("configIsRequired"),({}).toString.call(e).includes("Object")||j("configType"),e.urls)?(console.warn(w.deprecation),{paths:{vs:e.urls.monacoBase}}):e},E=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}},P={type:"cancelation",msg:"operation is manually canceled"};function R(e){var t=!1,r=new Promise(function(r,n){e.then(function(e){return t?n(P):r(e)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var S=["monaco"],k=function(e){if(Array.isArray(e))return e}(d=({create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(e),y(t);var r={current:e},n=a(O)(r,t),o=a(b)(r),i=a(p)(e),c=a(v)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return h(e),e(r.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}})(n,o,i,c)(e)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,n,o,i,c=[],u=!0,a=!1;try{o=(t=t.call(e)).next,!1;for(;!(u=(r=o.call(t)).done)&&(c.push(r.value),2!==c.length);u=!0);}catch(e){a=!0,n=e}finally{try{if(!u&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(a)throw n}}return c}}(d)||function(e){if(e){if("string"==typeof e)return n(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,2):void 0}}(d)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),T=k[0],C=k[1];function I(e){return document.body.appendChild(e)}function x(e){var t,r,n=T(function(e){return{config:e.config,reject:e.reject}}),o=(t="".concat(n.config.paths.vs,"/loader.js"),r=document.createElement("script"),t&&(r.src=t),r);return o.onload=function(){return e()},o.onerror=n.reject,o}function A(){var e=T(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var r=t.m||t;D(r),e.resolve(r)},function(t){e.reject(t)})}function D(e){T().monaco||C({monaco:e})}var V=new Promise(function(e,t){return C({resolve:e,reject:t})}),L={config:function(e){var t=M(e),r=t.monaco,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,S);C(function(e){return{config:function e(t,r){return Object.keys(r).forEach(function(n){r[n]instanceof Object&&t[n]&&Object.assign(r[n],e(t[n],r[n]))}),i(i({},t),r)}(e.config,n),monaco:r}})},init:function(){var e=T(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(C({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),R(V);if(window.monaco&&window.monaco.editor)return D(window.monaco),e.resolve(window.monaco),R(V);E(I,x)(A)}return R(V)},__getMonacoInstance:function(){return T(function(e){return e.monaco})}},_=r(82030),N={display:"flex",position:"relative",textAlign:"initial"},q={width:"100%"},z={display:"none"},F={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"},U=function({children:e}){return _.createElement("div",{style:F},e)},B=(0,_.memo)(function({width:e,height:t,isEditorReady:r,loading:n,_ref:o,className:i,wrapperProps:c}){return _.createElement("section",{style:{...N,width:e,height:t},...c},!r&&_.createElement(U,null,n),_.createElement("div",{ref:o,style:{...q,...!r&&z},className:i}))}),Y=function(e){(0,_.useEffect)(e,[])},$=function(e,t,r=!0){let n=(0,_.useRef)(!0);(0,_.useEffect)(n.current||!r?()=>{n.current=!1}:e,t)};function G(){}function H(e,t,r,n){var o,i,c,u,a,l;return o=e,i=n,o.editor.getModel(J(o,i))||(c=e,u=t,a=r,l=n,c.editor.createModel(u,a,l?J(c,l):void 0))}function J(e,t){return e.Uri.parse(t)}var K=(0,_.memo)(function({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:c,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:a=!1,theme:l="light",loading:s="Loading...",options:f={},height:d="100%",width:g="100%",className:p,wrapperProps:h={},beforeMount:y=G,onMount:m=G}){let[v,b]=(0,_.useState)(!1),[O,w]=(0,_.useState)(!0),j=(0,_.useRef)(null),M=(0,_.useRef)(null),E=(0,_.useRef)(null),P=(0,_.useRef)(m),R=(0,_.useRef)(y),S=(0,_.useRef)(!1);Y(()=>{let e=L.init();return e.then(e=>(M.current=e)&&w(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return j.current?(t=j.current?.getModel(),void(u||t?.original?.dispose(),a||t?.modified?.dispose(),j.current?.dispose())):e.cancel()}}),$(()=>{if(j.current&&M.current){let t=j.current.getOriginalEditor(),o=H(M.current,e||"",n||r||"text",i||"");o!==t.getModel()&&t.setModel(o)}},[i],v),$(()=>{if(j.current&&M.current){let e=j.current.getModifiedEditor(),n=H(M.current,t||"",o||r||"text",c||"");n!==e.getModel()&&e.setModel(n)}},[c],v),$(()=>{let e=j.current.getModifiedEditor();e.getOption(M.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),$(()=>{j.current?.getModel()?.original.setValue(e||"")},[e],v),$(()=>{let{original:e,modified:t}=j.current.getModel();M.current.editor.setModelLanguage(e,n||r||"text"),M.current.editor.setModelLanguage(t,o||r||"text")},[r,n,o],v),$(()=>{M.current?.editor.setTheme(l)},[l],v),$(()=>{j.current?.updateOptions(f)},[f],v);let k=(0,_.useCallback)(()=>{if(!M.current)return;R.current(M.current);let u=H(M.current,e||"",n||r||"text",i||""),a=H(M.current,t||"",o||r||"text",c||"");j.current?.setModel({original:u,modified:a})},[r,t,o,e,n,i,c]),T=(0,_.useCallback)(()=>{!S.current&&E.current&&(j.current=M.current.editor.createDiffEditor(E.current,{automaticLayout:!0,...f}),k(),M.current?.editor.setTheme(l),b(!0),S.current=!0)},[f,l,k]);return(0,_.useEffect)(()=>{v&&P.current(j.current,M.current)},[v]),(0,_.useEffect)(()=>{O||v||T()},[O,v,T]),_.createElement(B,{width:g,height:d,isEditorReady:v,loading:s,_ref:E,className:p,wrapperProps:h})}),Q=function(){let[e,t]=(0,_.useState)(L.__getMonacoInstance());return Y(()=>{let r;return e||(r=L.init()).then(e=>{t(e)}),()=>r?.cancel()}),e},W=function(e){let t=(0,_.useRef)();return(0,_.useEffect)(()=>{t.current=e},[e]),t.current},X=new Map,Z=(0,_.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:o,path:i,theme:c="light",line:u,loading:a="Loading...",options:l={},overrideServices:s={},saveViewState:f=!0,keepCurrentModel:d=!1,width:g="100%",height:p="100%",className:h,wrapperProps:y={},beforeMount:m=G,onMount:v=G,onChange:b,onValidate:O=G}){let[w,j]=(0,_.useState)(!1),[M,E]=(0,_.useState)(!0),P=(0,_.useRef)(null),R=(0,_.useRef)(null),S=(0,_.useRef)(null),k=(0,_.useRef)(v),T=(0,_.useRef)(m),C=(0,_.useRef)(),I=(0,_.useRef)(n),x=W(i),A=(0,_.useRef)(!1),D=(0,_.useRef)(!1);Y(()=>{let e=L.init();return e.then(e=>(P.current=e)&&E(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>R.current?void(C.current?.dispose(),d?f&&X.set(i,R.current.saveViewState()):R.current.getModel()?.dispose(),R.current.dispose()):e.cancel()}),$(()=>{let c=H(P.current,e||n||"",t||o||"",i||r||"");c!==R.current?.getModel()&&(f&&X.set(x,R.current?.saveViewState()),R.current?.setModel(c),f&&R.current?.restoreViewState(X.get(i)))},[i],w),$(()=>{R.current?.updateOptions(l)},[l],w),$(()=>{R.current&&void 0!==n&&(R.current.getOption(P.current.editor.EditorOption.readOnly)?R.current.setValue(n):n!==R.current.getValue()&&(D.current=!0,R.current.executeEdits("",[{range:R.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),R.current.pushUndoStop(),D.current=!1))},[n],w),$(()=>{let e=R.current?.getModel();e&&o&&P.current?.editor.setModelLanguage(e,o)},[o],w),$(()=>{void 0!==u&&R.current?.revealLine(u)},[u],w),$(()=>{P.current?.editor.setTheme(c)},[c],w);let V=(0,_.useCallback)(()=>{if(!(!S.current||!P.current)&&!A.current){T.current(P.current);let a=i||r,d=H(P.current,n||e||"",t||o||"",a||"");R.current=P.current?.editor.create(S.current,{model:d,automaticLayout:!0,...l},s),f&&R.current.restoreViewState(X.get(a)),P.current.editor.setTheme(c),void 0!==u&&R.current.revealLine(u),j(!0),A.current=!0}},[e,t,r,n,o,i,l,s,f,c,u]);return(0,_.useEffect)(()=>{w&&k.current(R.current,P.current)},[w]),(0,_.useEffect)(()=>{M||w||V()},[M,w,V]),I.current=n,(0,_.useEffect)(()=>{w&&b&&(C.current?.dispose(),C.current=R.current?.onDidChangeModelContent(e=>{D.current||b(R.current.getValue(),e)}))},[w,b]),(0,_.useEffect)(()=>{if(w){let e=P.current.editor.onDidChangeMarkers(e=>{let t=R.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=P.current.editor.getModelMarkers({resource:t});O?.(e)}});return()=>{e?.dispose()}}return()=>{}},[w,O]),_.createElement(B,{width:g,height:p,isEditorReady:w,loading:a,_ref:S,className:h,wrapperProps:y})}),ee=Z}}]);
|
package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-695c6386c328069c.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{1117:(e,t,s)=>{Promise.resolve().then(s.bind(s,14813))},14813:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});var a=s(15102),l=s(82030),r=s(10736),o=s(21577),n=s(85479);function i(){let[e,t]=(0,l.useState)([]),[s,i]=(0,l.useState)(!0),[m,x]=(0,l.useState)(!1),[u,p]=(0,l.useState)(null),[h,f]=(0,l.useState)([]),[g,b]=(0,l.useState)({}),[y,j]=(0,l.useState)(null),[N,w]=(0,l.useState)([]),[v,C]=(0,l.useState)(!1),{getCaps:k}=(0,n.y)(),[S,$]=(0,l.useState)(null),[E,D]=(0,l.useState)(""),{copied:F,copy:O}=(0,o.C)();(0,l.useEffect)(()=>{A()},[]),(0,l.useEffect)(()=>{let t=new Set(e.map(e=>e.id));w(e=>e.filter(e=>t.has(e)))},[e]);let P=e.filter(e=>N.includes(e.id)),T=N.length>0,M=E.trim().toLowerCase(),_=M?e.filter(e=>!!String(e.name||"").toLowerCase().includes(M)||(e.models||[]).some(e=>String(e).toLowerCase().includes(M))):e,B=_.length>0&&_.every(e=>N.includes(e.id)),A=async()=>{try{let[e,s,a]=await Promise.all([fetch("/api/combos",{cache:"no-store"}),fetch("/api/providers",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),l=await e.json(),r=await s.json(),o=a.ok?await a.json():{};e.ok&&t((l.combos||[]).filter(e=>!e.kind||"llm"===e.kind)),s.ok&&f((r.connections||[]).filter(e=>!1!==e.isActive)),b(o.comboStrategies||{})}catch(e){console.log("Error fetching data:",e)}finally{i(!1)}},I=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await A(),x(!1);else{let e=await t.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},R=async(e,t)=>{try{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.ok)await A(),p(null);else{let e=await s.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},J=async e=>{let t="cursor"===e?"Cursor Default":"Claude Default";j(e);try{let s=await fetch(`/api/combos/presets?source=${e}`),a=await s.json();if(!s.ok)return void alert(a.error||`Failed to preview ${t}`);let l=(a.items||[]).length,r=a.toCreate??(a.items||[]).filter(e=>!e.exists).length,o=a.toSkip??(a.items||[]).filter(e=>e.exists).length;if(0===l)return void alert(`No ${t} models available to generate.`);if(0===r)return void alert(`All ${l} ${t} combos already exist. Nothing to create.`);$({title:`Generate ${t}`,message:`Create ${r} combo${1===r?"":"s"} named like ${"cursor"===e?"Cursor":"Claude"} model IDs (seeded with cu/… or cc/…). ${o} already exist and will be skipped. You can edit any combo afterward to add fallbacks.`,confirmText:"Generate",variant:"primary",onConfirm:async()=>{$(e=>e?{...e,loading:!0}:null);try{let s=await fetch("/api/combos/presets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:e})}),a=await s.json();if(!s.ok){alert(a.error||`Failed to generate ${t}`),$(e=>e?{...e,loading:!1}:null);return}await A(),$(null)}catch(e){console.log(`Error generating ${t}:`,e),alert(`Failed to generate ${t}`),$(e=>e?{...e,loading:!1}:null)}}})}catch(e){console.log(`Error previewing ${t}:`,e),alert(`Failed to preview ${t}`)}finally{j(null)}},L=(e,t=g)=>{let s={...t};for(let t of e)delete s[t];return s},z=async e=>{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:e})}),b(e)},G=async s=>{let a=e.find(e=>e.id===s);$({title:"Delete Combo",message:a?`Delete combo "${a.name}"?`:"Delete this combo?",onConfirm:async()=>{$(e=>e?{...e,loading:!0}:null);try{(await fetch(`/api/combos/${s}`,{method:"DELETE"})).ok&&(a?.name&&await z(L([a.name])),t(e=>e.filter(e=>e.id!==s)),w(e=>e.filter(e=>e!==s))),$(null)}catch(e){console.log("Error deleting combo:",e),$(e=>e?{...e,loading:!1}:null)}}})},q=async(e,t)=>{try{let s={...g},a={...s[e]||{},...t};a.fallbackStrategy&&"fallback"!==a.fallbackStrategy?s[e]=a:delete s[e],await z(s)}catch(e){console.log("Error updating combo strategy:",e)}},U=async e=>{if(0!==P.length&&e){C(!0);try{let t={...g};for(let s of P)"fallback"===e?delete t[s.name]:t[s.name]={...t[s.name]||{},fallbackStrategy:e};await z(t)}catch(e){console.log("Error bulk updating combo strategy:",e),alert("Failed to update strategy for selected combos")}finally{C(!1)}}};return s?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(r.CardSkeleton,{}),(0,a.jsx)(r.CardSkeleton,{})]}):(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Group models under one name, then pick a strategy per combo."}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 mt-3",children:[(0,a.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-surface-2/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary mt-0.5 shrink-0",children:"arrow_downward"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-main",children:"Fallback"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Tries models in order, next on failure"})]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-surface-2/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary mt-0.5 shrink-0",children:"sync"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-main",children:"Round Robin"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Rotates across requests to spread load"})]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-surface-2/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary mt-0.5 shrink-0",children:"hub"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-main",children:"Fusion"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Parallel query + judge synthesis (N+1 calls)"})]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-surface-2/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary mt-0.5 shrink-0",children:"auto_awesome"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-main",children:"Capacity auto-switch"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Routes image/PDF/audio to capable models"})]})]})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-3 max-w-2xl",children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:"Cursor / Claude Default"})," create combos named exactly like those clients' model IDs (e.g. ",(0,a.jsx)("code",{className:"font-mono",children:"composer-2.5"}),", ",(0,a.jsx)("code",{className:"font-mono",children:"opus"}),"), seeded with the matching ",(0,a.jsx)("code",{className:"font-mono",children:"cu/…"})," or ",(0,a.jsx)("code",{className:"font-mono",children:"cc/…"})," route so traffic can hit the router without the prefix."," ",'Note: Cursor IDE often blocks built-in Composer / Grok from Override OpenAI Base URL ("model does not support custom API"); add them via Cursor\'s ',(0,a.jsx)("span",{className:"font-medium text-text-main",children:"Add Custom Model"})," using the combo name, or pick a model Cursor allows through the custom endpoint."]})]}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:shrink-0",children:[(0,a.jsxs)("div",{className:"relative w-full sm:w-64",children:[(0,a.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-[18px] text-text-muted",children:"search"}),(0,a.jsx)("input",{type:"text",value:E,onChange:e=>D(e.target.value),placeholder:"Search combos…","aria-label":"Search combos",className:"w-full rounded-[10px] border border-transparent bg-surface-2 py-2 pl-10 pr-9 text-sm text-text-main transition-all duration-150 ease-out placeholder-text-muted/70 focus:border-brand-500/40 focus:outline-none focus:ring-2 focus:ring-brand-500/30"}),E&&(0,a.jsx)("button",{type:"button",onClick:()=>D(""),"aria-label":"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 rounded p-1 text-text-muted transition-colors hover:text-text-main",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]}),(0,a.jsx)(r.Button,{icon:"add",onClick:()=>x(!0),className:"w-full sm:w-auto whitespace-nowrap",children:"Create Combo"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,a.jsx)(r.Button,{variant:"secondary",size:"sm",icon:"edit_note",loading:"cursor"===y,disabled:!!y,onClick:()=>J("cursor"),className:"w-full whitespace-nowrap",children:"Cursor Default"}),(0,a.jsx)(r.Button,{variant:"secondary",size:"sm",icon:"smart_toy",loading:"claude"===y,disabled:!!y,onClick:()=>J("claude"),className:"w-full whitespace-nowrap",children:"Claude Default"})]})]})]}),0===e.length?(0,a.jsx)(r.Card,{children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"layers"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No combos yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create model combos with fallback support"}),(0,a.jsx)(r.Button,{icon:"add",onClick:()=>x(!0),className:"w-full sm:w-auto",children:"Create Combo"})]})}):(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 rounded-lg border border-black/5 bg-black/[0.015] px-3 py-2 dark:border-white/5 dark:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-text-muted hover:text-primary select-none",children:[(0,a.jsx)("input",{type:"checkbox",checked:B,ref:e=>{e&&(e.indeterminate=T&&!B)},onChange:()=>w(B?[]:_.map(e=>e.id)),className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary","aria-label":"Select all combos"}),(0,a.jsx)("span",{children:T?`${N.length} selected`:`Select all (${_.length})`})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[M&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[_.length," of ",e.length," shown"]}),T&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"w-full min-w-[160px] sm:w-[200px]",children:(0,a.jsx)(r.Select,{options:c,value:"",placeholder:"Set strategy…",disabled:v,onChange:e=>{let t=e.target.value;t&&U(t)},selectClassName:"py-1.5 text-xs"})}),(0,a.jsxs)(r.Button,{size:"sm",variant:"danger",icon:"delete",disabled:v,loading:v,onClick:()=>{if(0===P.length)return;let e=P.length;$({title:"Delete Selected Combos",message:`Delete ${e} selected combo${1===e?"":"s"}? This cannot be undone.`,confirmText:"Delete",variant:"danger",onConfirm:async()=>{$(e=>e?{...e,loading:!0}:null),C(!0);try{let e=P.map(e=>e.id),s=await Promise.all(e.map(e=>fetch(`/api/combos/${e}`,{method:"DELETE"}))),a=P.filter((e,t)=>s[t]?.ok),l=new Set(a.map(e=>e.id)),r=e.length-a.length;a.length>0&&(await z(L(a.map(e=>e.name))),t(e=>e.filter(e=>!l.has(e.id))),w(e=>e.filter(e=>!l.has(e)))),$(null),r>0&&alert(`Deleted with ${r} failure${1===r?"":"s"}.`)}catch(e){console.log("Error bulk deleting combos:",e),alert("Failed to delete selected combos"),$(e=>e?{...e,loading:!1}:null)}finally{C(!1)}}})},className:"whitespace-nowrap",children:["Delete (",N.length,")"]}),(0,a.jsx)(r.Button,{size:"sm",variant:"ghost",onClick:()=>w([]),disabled:v,children:"Clear"})]})]})]}),(0,a.jsx)("div",{className:"flex flex-col gap-3",children:0===_.length?(0,a.jsx)(r.Card,{children:(0,a.jsxs)("div",{className:"text-center py-10",children:[(0,a.jsxs)("p",{className:"text-text-main font-medium mb-1",children:["No combos match “",E.trim(),"”"]}),(0,a.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Try a shorter query, or clear the search to see all ",e.length," combos."]}),(0,a.jsx)(r.Button,{variant:"secondary",onClick:()=>D(""),children:"Clear search"})]})}):_.map(e=>(0,a.jsx)(d,{combo:e,getCaps:k,activeProviders:h,copied:F,onCopy:O,onEdit:()=>p(e),onDelete:()=>G(e.id),strategy:g[e.name]||{},onSetStrategy:t=>q(e.name,t),selected:N.includes(e.id),onToggleSelect:()=>{var t;return t=e.id,void w(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])}},e.id))})]}),m&&(0,a.jsx)(r.ComboFormModal,{isOpen:m,onClose:()=>x(!1),onSave:I,activeProviders:h},"create"),u&&(0,a.jsx)(r.ComboFormModal,{isOpen:!!u,combo:u,onClose:()=>p(null),onSave:e=>R(u.id,e),activeProviders:h},u.id),(0,a.jsx)(r.ConfirmModal,{isOpen:!!S,onClose:()=>!S?.loading&&$(null),onConfirm:S?.onConfirm,title:S?.title||"Confirm",message:S?.message,confirmText:S?.confirmText||"Confirm",variant:S?.variant||"danger",loading:!!S?.loading})]})}s(31038);let c=[{value:"fallback",label:"Fallback — try in order"},{value:"round-robin",label:"Round Robin — rotate"},{value:"fusion",label:"Fusion — panel + judge"}];function d({combo:e,getCaps:t,activeProviders:s=[],copied:o,onCopy:n,onEdit:i,onDelete:m,strategy:x={},onSetStrategy:u,selected:p=!1,onToggleSelect:h}){let[f,g]=(0,l.useState)(!1),b=x.fallbackStrategy||"fallback",y=x.judgeModel||"";return(0,a.jsxs)(r.Card,{padding:"sm",className:`group ${p?"ring-1 ring-primary/40 bg-primary/[0.03]":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,a.jsx)("label",{className:"flex shrink-0 items-center pt-1 sm:pt-0 cursor-pointer",title:"Select combo",children:(0,a.jsx)("input",{type:"checkbox",checked:p,onChange:h,onClick:e=>e.stopPropagation(),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary","aria-label":`Select ${e.name}`})}),(0,a.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("code",{className:"block truncate font-mono text-sm font-medium",children:e.name}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===e.models.length?(0,a.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):e.models.slice(0,3).map((e,s)=>(0,a.jsxs)("code",{className:"inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-text-muted dark:bg-white/5",children:[(0,a.jsx)("span",{children:e}),(0,a.jsx)(r.CapacityBadges,{caps:t?.(e)})]},s)),e.models.length>3&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",e.models.length-3," more"]})]}),e.models.length>0&&e.models.every(e=>t?.(e)?.vision===!1)&&(0,a.jsxs)("button",{type:"button",onClick:i,className:"mt-1 inline-flex items-center gap-1 text-[11px] text-amber-600 hover:text-amber-700 dark:text-amber-400 dark:hover:text-amber-300",title:"Edit combo to add a vision-capable model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"visibility_off"}),"Cannot see images — edit combo"]}),"fusion"===b&&(0,a.jsxs)("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-[11px] font-medium text-text-muted",children:"Judge"}),(0,a.jsxs)("button",{onClick:()=>g(!0),className:"inline-flex max-w-full items-center gap-1 rounded border border-dashed border-primary/40 px-1.5 py-0.5 font-mono text-[11px] text-primary hover:border-primary hover:bg-primary/5 transition-colors",title:"Pick the model that fuses panel answers",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"gavel"}),(0,a.jsx)("span",{className:"truncate",children:y||`Auto — ${e.models[0]||"first model"}`})]}),y&&(0,a.jsx)("button",{onClick:()=>u({judgeModel:""}),className:"p-0.5 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-colors",title:"Reset judge to Auto",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,a.jsx)("div",{className:"w-full sm:w-[200px]",children:(0,a.jsx)(r.Select,{options:c,value:b,onChange:e=>u({fallbackStrategy:e.target.value}),selectClassName:"py-1.5 text-xs"})}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-1 sm:flex",children:[(0,a.jsxs)("button",{onClick:t=>{t.stopPropagation(),n(e.name,`combo-${e.id}`)},className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Copy combo name",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o===`combo-${e.id}`?"check":"content_copy"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Copy"})]}),(0,a.jsxs)("button",{onClick:i,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Edit",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:m,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 transition-colors hover:bg-red-500/10",title:"Delete",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]})]})]}),f&&(0,a.jsx)(r.ModelSelectModal,{isOpen:f,onClose:()=>g(!1),onSelect:e=>{u({judgeModel:e?.value||""}),g(!1)},activeProviders:s,title:"Select Judge Model",addedModelValues:y?[y]:[],closeOnSelect:!0})]})}},85479:(e,t,s)=>{"use strict";s.d(t,{y:()=>n});var a=s(82030),l=s(24332);let r=null,o=null;function n(){let[e,t]=(0,a.useState)(()=>r?.byFull||{}),[s,n]=(0,a.useState)(()=>r?.byId||{});return(0,a.useEffect)(()=>{if(r)return;let e=!0;return(r?Promise.resolve(r):o||(o=fetch("/api/models").then(async e=>{if(!e.ok)throw Error(`models ${e.status}`);return r=function(e){let t={},s={};for(let a of e||[])a.caps&&(a.fullModel&&(t[a.fullModel]=a.caps),a.routedModel&&(t[a.routedModel]=a.caps),a.model&&(s[a.model]=a.caps));return{byFull:t,byId:s}}((await e.json()).models)}).catch(()=>({byFull:{},byId:{}})).finally(()=>{o=null}))).then(s=>{e&&(t(s.byFull),n(s.byId))}),()=>{e=!1}},[]),{getCaps:(0,a.useCallback)(t=>(function(e,t,s){if(!s)return null;if(e[s])return e[s];let a=s.includes("/")?s.slice(s.indexOf("/")+1):s;if(t[a])return t[a];let r=s.includes("/")?s.slice(0,s.indexOf("/")):null,o=(0,l.nl)(r,a);return{vision:o.vision,search:o.search,reasoning:o.reasoning,contextWindow:o.contextWindow,maxOutput:o.maxOutput}})(e,s,t),[e,s])}}}},e=>{e.O(0,[3885,7523,7236,4385,736,2147,3204,7358],()=>e(e.s=1117)),_N_E=e.O()}]);
|