@yina-npm/openrouterx 0.4.10 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +250 -1124
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +9 -2
- package/app/.next/build-manifest.json +3 -3
- package/app/.next/prerender-manifest.json +3 -339
- package/app/.next/react-loadable-manifest.json +1 -8
- package/app/.next/routes-manifest.json +44 -0
- package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page.js +2 -0
- package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page.js.nft.json +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page_client-reference-manifest.js +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/admin/users/page.js +2 -0
- package/app/.next/server/app/(dashboard)/dashboard/admin/users/page.js.nft.json +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/admin/users/page_client-reference-manifest.js +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/combo/[id]/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/combo/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/user/page.js +5 -0
- package/app/.next/server/app/(dashboard)/dashboard/user/page.js.nft.json +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/user/page_client-reference-manifest.js +1 -0
- package/app/.next/server/app/_global-error/page.js +2 -2
- package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error.html +1 -1
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js +2 -2
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_not-found.html +1 -1
- package/app/.next/server/app/_not-found.rsc +4 -4
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/api/auth/login/route.js +1 -1
- package/app/.next/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next/server/app/api/auth/logout/route.js +1 -1
- package/app/.next/server/app/api/auth/me/route.js +1 -0
- package/app/.next/server/app/api/auth/me/route.js.nft.json +1 -0
- package/app/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -0
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route.js +3 -3
- package/app/.next/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cli-tools/hermes-settings/route.js +7 -7
- package/app/.next/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cloud/auth/route.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next/server/app/api/combos/route.js +1 -1
- package/app/.next/server/app/api/health/route.js +1 -1
- package/app/.next/server/app/api/init/route.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/keys/route.js +1 -1
- package/app/.next/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next/server/app/api/locale/route.js +1 -1
- package/app/.next/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
- package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/app/.next/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
- package/app/.next/server/app/api/media-providers/tts/voices/route.js +1 -1
- package/app/.next/server/app/api/models/alias/route.js +1 -1
- package/app/.next/server/app/api/models/availability/route.js +1 -1
- package/app/.next/server/app/api/models/custom/route.js +1 -1
- package/app/.next/server/app/api/models/route.js +1 -1
- package/app/.next/server/app/api/models/test/route.js +1 -1
- package/app/.next/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
- package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/gitlab/pat/route.js +1 -1
- package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next/server/app/api/pricing/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next/server/app/api/providers/client/route.js +1 -1
- package/app/.next/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/kilo/free-models/route.js +1 -1
- package/app/.next/server/app/api/providers/route.js +1 -1
- package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/suggested-models/route.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next/server/app/api/providers/validate/route.js +1 -1
- package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
- package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/proxy-pools/route.js +1 -1
- package/app/.next/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
- package/app/.next/server/app/api/settings/database/route.js +1 -1
- package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next/server/app/api/settings/route.js +1 -1
- package/app/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/shutdown/route.js +1 -1
- package/app/.next/server/app/api/tags/route.js +1 -1
- package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next/server/app/api/translator/console-logs/stream/route.js +2 -2
- package/app/.next/server/app/api/translator/load/route.js +1 -1
- package/app/.next/server/app/api/translator/save/route.js +1 -1
- package/app/.next/server/app/api/translator/send/route.js +1 -1
- package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next/server/app/api/translator/translate/route.js +1 -1
- package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
- package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
- package/app/.next/server/app/api/tunnel/status/route.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-check/route.js +2 -2
- package/app/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-enable/route.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-install/route.js +2 -2
- package/app/.next/server/app/api/tunnel/tailscale-login/route.js +3 -3
- package/app/.next/server/app/api/tunnel/tailscale-start-daemon/route.js +2 -2
- package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/api-keys/route.js +1 -0
- package/app/.next/server/app/api/usage/api-keys/route.js.nft.json +1 -0
- package/app/.next/server/app/api/usage/api-keys/route_client-reference-manifest.js +1 -0
- package/app/.next/server/app/api/usage/chart/route.js +1 -1
- package/app/.next/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/history/route.js +1 -1
- package/app/.next/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/logs/route.js +1 -1
- package/app/.next/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/providers/route.js +1 -1
- package/app/.next/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/request-details/route.js +1 -1
- package/app/.next/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/stats/route.js +1 -1
- package/app/.next/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/stream/route.js +4 -4
- package/app/.next/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next/server/app/api/users/[id]/route.js +1 -0
- package/app/.next/server/app/api/users/[id]/route.js.nft.json +1 -0
- package/app/.next/server/app/api/users/[id]/route_client-reference-manifest.js +1 -0
- package/app/.next/server/app/api/users/route.js +1 -0
- package/app/.next/server/app/api/users/route.js.nft.json +1 -0
- package/app/.next/server/app/api/users/route_client-reference-manifest.js +1 -0
- package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js +2 -2
- package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/models/route.js +1 -1
- package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/responses/compact/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/responses/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/route.js +1 -1
- package/app/.next/server/app/api/v1/search/route.js +1 -1
- package/app/.next/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/web/fetch/route.js +1 -1
- package/app/.next/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next/server/app/api/version/route.js +1 -1
- package/app/.next/server/app/api/version/update/route.js +1 -1
- package/app/.next/server/app/callback/page.js +2 -2
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback.html +1 -1
- package/app/.next/server/app/callback.rsc +4 -4
- package/app/.next/server/app/callback.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
- package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.rsc +4 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/favicon.ico/route.js +1 -1
- package/app/.next/server/app/index.html +1 -1
- package/app/.next/server/app/index.rsc +4 -4
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/landing/page.js +2 -2
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing.html +1 -1
- package/app/.next/server/app/landing.rsc +4 -4
- package/app/.next/server/app/landing.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next/server/app/login/page.js +2 -2
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login.html +1 -1
- package/app/.next/server/app/login.rsc +5 -5
- package/app/.next/server/app/login.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next/server/app/manifest.webmanifest/route.js +2 -2
- package/app/.next/server/app/page.js +2 -2
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +9 -2
- package/app/.next/server/chunks/1256.js +1 -0
- package/app/.next/server/chunks/{1202.js → 1263.js} +2 -2
- package/app/.next/server/chunks/2417.js +1 -1
- package/app/.next/server/chunks/3913.js +2 -2
- package/app/.next/server/chunks/4013.js +1 -0
- package/app/.next/server/chunks/412.js +2 -2
- package/app/.next/server/chunks/4122.js +1 -1
- package/app/.next/server/chunks/4664.js +1 -0
- package/app/.next/server/chunks/4989.js +2 -2
- package/app/.next/server/chunks/5573.js +1 -1
- package/app/.next/server/chunks/5599.js +12 -12
- package/app/.next/server/chunks/6184.js +1 -0
- package/app/.next/server/chunks/7595.js +1 -1
- package/app/.next/server/chunks/{318.js → 7937.js} +2 -2
- package/app/.next/server/chunks/8590.js +1 -1
- package/app/.next/server/chunks/8895.js +2 -2
- package/app/.next/server/chunks/9489.js +1 -1
- package/app/.next/server/chunks/{1220.js → 9641.js} +2 -2
- package/app/.next/server/chunks/9718.js +1 -1
- package/app/.next/server/middleware-build-manifest.js +1 -1
- package/app/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/app/.next/server/middleware.js +2 -2
- package/app/.next/server/pages/404.html +1 -1
- package/app/.next/server/pages/500.html +1 -1
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/{1321-4ac1e9664ca05f67.js → 1321-e040e8704e8038e6.js} +1 -1
- package/app/.next/static/chunks/5497-4da88480a15dec4c.js +7 -0
- package/app/.next/static/chunks/{5555-c4cf1b2b38d07337.js → 5555-91932fc7b159e521.js} +2 -2
- package/app/.next/static/chunks/698-64c9bb7a1ba1f521.js +23 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/admin/keys/page-e7d9455fb9021069.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/admin/users/page-c8e5a4b31bc18425.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-ece69a38800356c3.js → page-a4b2b832a4892e6d.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-4a745b1296f08667.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/{page-0d9325464cd6e849.js → page-842b00e6db9de7ae.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/console-log/page-fbdc1506f7259342.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/page-f8681cfb4c894f96.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-f0bbe6b3b1bfb85e.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-d6d08994d9d6d690.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-b2443c6d810b0207.js +2 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-48fc1f090d936818.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/user/page-e9ab0043e9b15204.js +4 -0
- package/app/.next/static/chunks/app/(dashboard)/{layout-91efa9c70d2328e0.js → layout-d368218e0e87c124.js} +1 -1
- package/app/.next/static/chunks/app/_global-error/page-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/auth/login/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/auth/logout/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/auth/me/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/auth/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/credentials/update/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/model/resolve/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/models/alias/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/combos/[id]/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/combos/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/health/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/init/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/keys/[id]/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/keys/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/locale/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/models/alias/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/models/availability/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/models/custom/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/models/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/models/test/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/cursor/import/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/import/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/pricing/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/validate/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/models/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/test/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/providers/client/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/providers/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/providers/suggested-models/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/providers/test-batch/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/providers/validate/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/proxy-pools/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/settings/database/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/settings/proxy-test/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/settings/require-login/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/settings/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/shutdown/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/tags/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/translator/console-logs/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/translator/load/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/translator/save/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/translator/send/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/translator/translate/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/disable/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/enable/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/status/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/usage/[connectionId]/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/usage/api-keys/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/usage/chart/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/usage/history/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/usage/logs/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/usage/providers/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/usage/request-details/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/usage/request-logs/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/usage/stats/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/usage/stream/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/users/[id]/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/users/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1/api/chat/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1/audio/speech/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1/chat/completions/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1/embeddings/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1/images/generations/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1/messages/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1/models/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1/responses/compact/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1/responses/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1/search/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1/web/fetch/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/v1beta/models/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/version/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/api/version/update/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/login/page-f8fd97681568bf8f.js +1 -0
- package/app/.next/static/chunks/app/manifest.webmanifest/route-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/app/page-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-24023a32c248257e.js +1 -0
- package/app/.next/static/chunks/webpack-d1740476c6ab968a.js +1 -0
- package/app/.next/static/css/733bbed45c0f373c.css +1 -0
- package/app/.next/static/kSw7ik2y0Lphlofn8QbuF/_buildManifest.js +1 -0
- package/app/package.json +1 -1
- package/app/public/i18n/literals/ar.json +4 -4
- package/app/public/i18n/literals/bn.json +4 -4
- package/app/public/i18n/literals/cs.json +4 -4
- package/app/public/i18n/literals/da.json +4 -4
- package/app/public/i18n/literals/de.json +4 -4
- package/app/public/i18n/literals/el.json +4 -4
- package/app/public/i18n/literals/es.json +4 -4
- package/app/public/i18n/literals/fi.json +4 -4
- package/app/public/i18n/literals/fr.json +4 -4
- package/app/public/i18n/literals/he.json +4 -4
- package/app/public/i18n/literals/hi.json +4 -4
- package/app/public/i18n/literals/hu.json +4 -4
- package/app/public/i18n/literals/id.json +4 -4
- package/app/public/i18n/literals/it.json +4 -4
- package/app/public/i18n/literals/ja.json +4 -4
- package/app/public/i18n/literals/ko.json +4 -4
- package/app/public/i18n/literals/nl.json +4 -4
- package/app/public/i18n/literals/no.json +4 -4
- package/app/public/i18n/literals/pl.json +4 -4
- package/app/public/i18n/literals/pt-BR.json +4 -4
- package/app/public/i18n/literals/pt-PT.json +4 -4
- package/app/public/i18n/literals/ro.json +4 -4
- package/app/public/i18n/literals/ru.json +4 -4
- package/app/public/i18n/literals/sv.json +4 -4
- package/app/public/i18n/literals/th.json +4 -4
- package/app/public/i18n/literals/tl.json +4 -4
- package/app/public/i18n/literals/tr.json +4 -4
- package/app/public/i18n/literals/uk.json +4 -4
- package/app/public/i18n/literals/ur.json +4 -4
- package/app/public/i18n/literals/vi.json +4 -4
- package/app/public/i18n/literals/zh-CN.json +7 -7
- package/app/public/i18n/literals/zh-TW.json +4 -4
- package/app/src/shared/constants/mitmToolHosts.js +12 -0
- package/package.json +1 -1
- package/app/.next/server/app/dashboard/basic-chat.html +0 -1
- package/app/.next/server/app/dashboard/basic-chat.meta +0 -17
- package/app/.next/server/app/dashboard/basic-chat.rsc +0 -24
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/basic-chat.segments/_full.segment.rsc +0 -24
- package/app/.next/server/app/dashboard/basic-chat.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/basic-chat.segments/_index.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/cli-tools.html +0 -1
- package/app/.next/server/app/dashboard/cli-tools.meta +0 -17
- package/app/.next/server/app/dashboard/cli-tools.rsc +0 -25
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/combos.html +0 -1
- package/app/.next/server/app/dashboard/combos.meta +0 -17
- package/app/.next/server/app/dashboard/combos.rsc +0 -27
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/endpoint.html +0 -1
- package/app/.next/server/app/dashboard/endpoint.meta +0 -17
- package/app/.next/server/app/dashboard/endpoint.rsc +0 -25
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/media-providers/web.html +0 -1
- package/app/.next/server/app/dashboard/media-providers/web.meta +0 -18
- package/app/.next/server/app/dashboard/media-providers/web.rsc +0 -27
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/mitm.html +0 -1
- package/app/.next/server/app/dashboard/mitm.meta +0 -17
- package/app/.next/server/app/dashboard/mitm.rsc +0 -24
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +0 -24
- package/app/.next/server/app/dashboard/mitm.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/mitm.segments/_index.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/profile.html +0 -1
- package/app/.next/server/app/dashboard/profile.meta +0 -17
- package/app/.next/server/app/dashboard/profile.rsc +0 -27
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/providers/new.html +0 -1
- package/app/.next/server/app/dashboard/providers/new.meta +0 -18
- package/app/.next/server/app/dashboard/providers/new.rsc +0 -27
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/providers.html +0 -1
- package/app/.next/server/app/dashboard/providers.meta +0 -17
- package/app/.next/server/app/dashboard/providers.rsc +0 -27
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/proxy-pools.html +0 -1
- package/app/.next/server/app/dashboard/proxy-pools.meta +0 -17
- package/app/.next/server/app/dashboard/proxy-pools.rsc +0 -27
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/quota.html +0 -2
- package/app/.next/server/app/dashboard/quota.meta +0 -17
- package/app/.next/server/app/dashboard/quota.rsc +0 -25
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +0 -7
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/translator.html +0 -1
- package/app/.next/server/app/dashboard/translator.meta +0 -17
- package/app/.next/server/app/dashboard/translator.rsc +0 -27
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/usage.html +0 -1
- package/app/.next/server/app/dashboard/usage.meta +0 -17
- package/app/.next/server/app/dashboard/usage.rsc +0 -27
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +0 -6
- package/app/.next/server/app/dashboard.html +0 -1
- package/app/.next/server/app/dashboard.meta +0 -16
- package/app/.next/server/app/dashboard.rsc +0 -25
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
- package/app/.next/server/app/dashboard.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard.segments/_index.segment.rsc +0 -9
- package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +0 -6
- package/app/.next/server/chunks/2020.js +0 -1
- package/app/.next/server/chunks/6114.js +0 -1
- package/app/.next/server/chunks/7924.js +0 -1
- package/app/.next/server/chunks/8491.js +0 -1
- package/app/.next/static/ahyS0wV6v2JdXWYSEruR6/_buildManifest.js +0 -1
- package/app/.next/static/chunks/5497-9056ce5497a8e830.js +0 -7
- package/app/.next/static/chunks/698-438ce154948ce831.js +0 -23
- package/app/.next/static/chunks/8202.1ffc6ce531e066ce.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-2f4bb06a89cb1e96.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/console-log/page-d690c6133fec8d11.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/page-ed08f60a5fb7f3eb.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-478d456890cb93f8.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-9fb9fc4557dbea57.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-4d43dabc1455a54b.js +0 -2
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-4fc78ec3c912ea4c.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-6204a1c1bfe6aee1.js +0 -1
- package/app/.next/static/chunks/app/_global-error/page-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/auth/login/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/auth/logout/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/auth/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/credentials/update/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/model/resolve/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/models/alias/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/combos/[id]/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/combos/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/health/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/init/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/keys/[id]/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/keys/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/locale/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/models/alias/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/models/availability/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/models/custom/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/models/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/models/test/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/cursor/import/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/import/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/pricing/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/validate/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/models/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/test/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/providers/client/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/providers/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/providers/suggested-models/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/providers/test-batch/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/providers/validate/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/proxy-pools/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/settings/database/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/settings/proxy-test/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/settings/require-login/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/settings/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/shutdown/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/tags/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/translator/console-logs/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/translator/load/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/translator/save/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/translator/send/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/translator/translate/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/disable/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/enable/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/status/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/usage/[connectionId]/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/usage/chart/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/usage/history/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/usage/logs/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/usage/providers/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/usage/request-details/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/usage/request-logs/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/usage/stats/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/usage/stream/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1/api/chat/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1/audio/speech/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1/chat/completions/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1/embeddings/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1/images/generations/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1/messages/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1/models/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1/responses/compact/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1/responses/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1/search/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1/web/fetch/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/v1beta/models/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/version/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/api/version/update/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/login/page-4cbcd0b23f8d9304.js +0 -1
- package/app/.next/static/chunks/app/manifest.webmanifest/route-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/app/page-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-a95908d3fe52339a.js +0 -1
- package/app/.next/static/chunks/webpack-7fe9f68a976b08ff.js +0 -1
- package/app/.next/static/css/1ef6107a5d5fd71c.css +0 -1
- /package/app/.next/static/{ahyS0wV6v2JdXWYSEruR6 → kSw7ik2y0Lphlofn8QbuF}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5555],{35555:(e,t,s)=>{Promise.resolve().then(s.bind(s,95907))},95907:(e,t,s)=>{"use strict";s.d(t,{default:()=>d});var a=s(95155),l=s(12115),r=s(14051),n=s.n(r),i=s(35497),o=s(11059);let c=[{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"}];function d({machineId:e}){let[t,s]=(0,l.useState)([]),[r,n]=(0,l.useState)(!0),[p,g]=(0,l.useState)(!1),[b,y]=(0,l.useState)(""),[f,j]=(0,l.useState)(null),[k,w]=(0,l.useState)(!1),[v,N]=(0,l.useState)(!0),[C,S]=(0,l.useState)(!0),[T,_]=(0,l.useState)(!1),[P,$]=(0,l.useState)(!0),[E,A]=(0,l.useState)(!0),[U,D]=(0,l.useState)(!1),[O,F]=(0,l.useState)(""),[I,W]=(0,l.useState)(""),[R,q]=(0,l.useState)(!1),[L,K]=(0,l.useState)(""),[J,z]=(0,l.useState)(null),[H,M]=(0,l.useState)(!1),[Z,Q]=(0,l.useState)(!1),[B,V]=(0,l.useState)(!1),[G,X]=(0,l.useState)(""),[Y,ee]=(0,l.useState)(!1),[et,es]=(0,l.useState)(""),[ea,el]=(0,l.useState)(null),[er,en]=(0,l.useState)(null),[ei,eo]=(0,l.useState)(!1),[ec,ed]=(0,l.useState)([]),[ex,em]=(0,l.useState)(""),[eh,eu]=(0,l.useState)(!1),[ep,eg]=(0,l.useState)(!1),[eb,ey]=(0,l.useState)(!1),ef=(0,l.useRef)(null),[ej,ek]=(0,l.useState)(new Set),{copied:ew,copy:ev}=(0,o.C)();(0,l.useEffect)(()=>{ef.current&&(ef.current.scrollTop=ef.current.scrollHeight)},[ec]),(0,l.useEffect)(()=>{e_(),eN()},[]);let eN=async()=>{A(!0);try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status")]);if(e.ok){let t=await e.json();w(t.requireApiKey||!1),N(!1!==t.requireLogin),S(t.hasPassword||!1),_(t.tunnelDashboardAccess||!1),$(!1!==t.rtkEnabled)}if(t.ok){let e=await t.json(),s=e.tunnel?.enabled||!1,a=e.tunnel?.tunnelUrl||"",l=e.tunnel?.publicUrl||"";F(a),W(l);let r=e.tailscale?.enabled||!1,n=e.tailscale?.tunnelUrl||"";if(X(n),r&&n){ee(!0),es("Checking Tailscale...");let e=`${n}/api/health`;try{let t=await fetch(e,{mode:"no-cors",cache:"no-store"});if(t.ok||"opaque"===t.type)V(!0);else{let e=await eD(n);V(e),e||el({type:"warning",message:"Tailscale not reachable."})}}catch{let e=await eD(n);V(e),e||el({type:"warning",message:"Tailscale not reachable."})}finally{ee(!1),es("")}}else V(r);if(s&&(l||a)){let e=`${l||a}/api/health`;try{(await fetch(e,{cache:"no-store"})).ok?D(!0):eP(l||a)}catch{eP(l||a)}}else D(s)}}catch(e){console.log("Error loading settings:",e)}finally{A(!1)}},eC=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:e})})).ok&&_(e)}catch(e){console.log("Error updating tunnelDashboardAccess:",e)}},eS=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:e})})).ok&&w(e)}catch(e){console.log("Error updating requireApiKey:",e)}},eT=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&$(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},e_=async()=>{try{let e=await fetch("/api/keys"),t=await e.json();e.ok&&s(t.keys||[])}catch(e){console.log("Error fetching data:",e)}finally{n(!1)}},eP=async e=>{q(!0),K("Waiting for tunnel ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<3e5;){await new Promise(e=>setTimeout(e,2e3));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return D(!0),q(!1),K(""),!0}catch{}if((Date.now()-s)%1e4<2e3)try{let e=await fetch("/api/tunnel/status");if(e.ok){let t=await e.json();if(!t.tunnel?.enabled)return z({type:"error",message:"Tunnel process stopped unexpectedly."}),q(!1),K(""),!1}}catch{}}return z({type:"error",message:"Tunnel created but not reachable. Please try again."}),q(!1),K(""),!1},e$=async()=>{M(!1),q(!0),z(null),K("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?K(`Downloading cloudflared... ${s.download.progress}%`):e&&K("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 z({type:"error",message:s.error||"Failed to enable tunnel"});let a=s.publicUrl||s.tunnelUrl;if(!a)return void z({type:"error",message:"No tunnel URL returned"});F(s.tunnelUrl||""),W(s.publicUrl||""),await eP(a)}catch(e){z({type:"error",message:e.message})}finally{e=!1,q(!1),K("")}},eE=async()=>{q(!0),z(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(D(!1),F(""),W(""),Q(!1),z({type:"success",message:"Tunnel disabled"})):z({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){z({type:"error",message:e.message})}finally{q(!1)}},eA=async()=>{en(null);try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok){let t=await e.json();return en(t.installed),t}}catch{}return en(!1),{installed:!1}},eU=async()=>{eo(!0),el(null),ed([]);try{let e=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:ex})});em("");let t=e.body.getReader(),s=new TextDecoder,a="";for(;;){let{done:e,value:l}=await t.read();if(e)break;let r=(a+=s.decode(l,{stream:!0})).split("\n\n");for(let e of(a=r.pop()||"",r)){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)ed(e=>[...e.slice(-50),a.message]);else if("done"===s){en(!0),eo(!1);return}else"error"===s&&el({type:"error",message:a.error||"Install failed"})}}}catch(e){el({type:"error",message:e.message})}finally{eo(!1)}},eD=async e=>{es("Waiting for Tailscale ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<3e5;){await new Promise(e=>setTimeout(e,2e3));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return!0}catch{}}return!1},eO=async e=>{let t=e||null;eg(!1),eu(!0),ee(!0),el(null),es("Connecting...");try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),s=await e.json();if(e.ok&&s.success){t&&t.close(),X(s.tunnelUrl||""),await eD(s.tunnelUrl)?(V(!0),el(null)):(V(!0),el({type:"warning",message:"Connected but not reachable yet."}));return}if(s.needsLogin&&s.authUrl){t?t.location.href=s.authUrl:window.open(s.authUrl,"tailscale_auth","width=600,height=700"),es("Waiting for login...");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){es("Starting funnel...");let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),s=await e.json();e.ok&&s.success?(t&&t.close(),X(s.tunnelUrl||""),await eD(s.tunnelUrl)?(V(!0),el(null)):(V(!0),el({type:"warning",message:"Connected but not reachable yet."}))):s.funnelNotEnabled&&s.enableUrl?await eF(s.enableUrl,t):el({type:"error",message:s.error||"Failed to start funnel"});return}}catch{}}el({type:"error",message:"Login timed out. Please try again."});return}if(s.funnelNotEnabled&&s.enableUrl)return void await eF(s.enableUrl,t);t&&t.close(),el({type:"error",message:s.error||"Failed to connect"})}catch(e){t&&t.close(),el({type:"error",message:e.message})}finally{ee(!1),eu(!1),es("")}},eF=async(e,t)=>{t?t.location.href=e:window.open(e,"tailscale_auth","width=600,height=700"),es("Enable Funnel in browser, waiting...");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"}),s=await e.json();if(e.ok&&s.success){t&&t.close(),X(s.tunnelUrl||""),await eD(s.tunnelUrl)?(V(!0),el(null)):(V(!0),el({type:"warning",message:"Connected but not reachable yet."}));return}if(s.funnelNotEnabled)continue;if(s.error)return void el({type:"error",message:s.error})}catch{}}el({type:"error",message:"Timed out waiting for Funnel to be enabled."})},eI=async()=>{ee(!0),el(null);try{let e=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),t=await e.json();e.ok?(V(!1),X(""),ey(!1),el({type:"success",message:"Tailscale disabled"})):el({type:"error",message:t.error||"Failed to disable Tailscale"})}catch(e){el({type:"error",message:e.message})}finally{ee(!1)}},eW=async()=>{el(null),ed([]),eg(!0),await eA()},eR=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&&(j(t.key),await e_(),y(""),g(!1))}catch(e){console.log("Error creating key:",e)}},eq=async e=>{if(confirm("Delete this API key?"))try{(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&(s(t.filter(t=>t.id!==e)),ek(t=>{let s=new Set(t);return s.delete(e),s}))}catch(e){console.log("Error deleting key:",e)}},eL=async(e,t)=>{try{(await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&s(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error toggling key:",e)}},[eK,eJ]=(0,l.useState)("/v1");return((0,l.useEffect)(()=>{eJ(`${window.location.origin}/v1`)},[]),r)?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(i.Qv,{}),(0,a.jsx)(i.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"API Endpoint"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(x,{label:"Local",url:eK,copyId:"local_url",copied:ew,onCopy:ev}),(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-[68px] text-center ${U?"bg-orange-100 dark:bg-orange-900/30 text-orange-600 dark:text-orange-400":"bg-sidebar text-text-muted"}`,children:"Tunnel"}),U&&!R?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${I||O}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>ev(`${I||O}/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"===ew?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>Q(!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"})})]}):R?(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"}),L||"Creating tunnel..."]}),(0,a.jsx)("button",{onClick:()=>{q(!1),K("")},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"})})]}):J?.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"}),J.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>M(!0),children:"Enable"})]}):E?(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:()=>A(!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)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{k?M(!0):z({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600 text-white!",children:"Enable"})]}),(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-[68px] text-center ${B?"bg-purple-100 dark:bg-purple-900/30 text-purple-600 dark:text-purple-400":"bg-sidebar text-text-muted"}`,children:"Tailscale"}),B&&!Y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${G}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>ev(`${G}/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"===ew?"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 Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):Y||eh?(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"}),et||"Connecting..."]}),(0,a.jsx)("button",{onClick:()=>{ee(!1),eu(!1),es("")},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"})})]}):ea?.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"}),ea.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:eW,children:"Enable"})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:eW,className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"})]})]}),(U||B)&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!k&&(0,a.jsx)(u,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!v||!C)&&(0,a.jsx)(u,{message:v?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:v?"Change password":"Enable",href:"/dashboard/profile"}})]}),(U||B)&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,a.jsx)(i.lM,{checked:T,onChange:()=>eC(!T)}),(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)(h,{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)(i.Zp,{id:"rtk",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Token Saver"})}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,a.jsxs)("div",{className:"pr-4",children:[(0,a.jsx)("p",{className:"font-medium",children:"Compress tool output"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Auto-compress tool output (git diff/grep/ls/tree/logs) before sending to LLM to save tokens. Disable if you see issues."})]}),(0,a.jsx)(i.lM,{checked:P,onChange:()=>eT(!P)})]})]}),(0,a.jsxs)(i.Zp,{id:"require-api-key",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"API Keys"}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>g(!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)(i.lM,{checked:k,onChange:()=>eS(!k)})]}),0===t.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)(i.$n,{icon:"add",onClick:()=>g(!0),children:"Create Key"})]}):(0,a.jsx)("div",{className:"flex flex-col",children:t.map(e=>{var t;return(0,a.jsxs)("div",{className:`group flex items-center justify-between 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",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono",children:ej.has(e.id)?e.key:(t=e.key)?t.length>8?t.slice(0,8)+"...":t:""}),(0,a.jsx)("button",{onClick:()=>{var t;return t=e.id,void ek(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 opacity-0 group-hover:opacity-100 transition-all",title:ej.has(e.id)?"Hide key":"Show key",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:ej.has(e.id)?"visibility_off":"visibility"})}),(0,a.jsx)("button",{onClick:()=>ev(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:ew===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"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.lM,{size:"sm",checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?confirm(`Pause API key "${e.name}"?
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5555],{35555:(e,t,s)=>{Promise.resolve().then(s.bind(s,95907))},95907:(e,t,s)=>{"use strict";s.d(t,{default:()=>d});var a=s(95155),l=s(12115),n=s(14051),r=s.n(n),i=s(35497),o=s(11059);let c=[{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"}];function d({machineId:e}){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),[p,g]=(0,l.useState)(!1),[b,y]=(0,l.useState)(""),[f,j]=(0,l.useState)(null),[k,w]=(0,l.useState)(!1),[v,N]=(0,l.useState)(!0),[C,S]=(0,l.useState)(!0),[T,_]=(0,l.useState)(!1),[P,$]=(0,l.useState)(!0),[E,A]=(0,l.useState)(!0),[U,D]=(0,l.useState)(!1),[O,F]=(0,l.useState)(""),[I,W]=(0,l.useState)(""),[R,q]=(0,l.useState)(!1),[L,K]=(0,l.useState)(""),[J,z]=(0,l.useState)(null),[H,M]=(0,l.useState)(!1),[Z,Q]=(0,l.useState)(!1),[B,V]=(0,l.useState)(!1),[G,X]=(0,l.useState)(""),[Y,ee]=(0,l.useState)(!1),[et,es]=(0,l.useState)(""),[ea,el]=(0,l.useState)(null),[en,er]=(0,l.useState)(null),[ei,eo]=(0,l.useState)(!1),[ec,ed]=(0,l.useState)([]),[ex,em]=(0,l.useState)(""),[eh,eu]=(0,l.useState)(!1),[ep,eg]=(0,l.useState)(!1),[eb,ey]=(0,l.useState)(!1),ef=(0,l.useRef)(null),[ej,ek]=(0,l.useState)(new Set),{copied:ew,copy:ev}=(0,o.C)();(0,l.useEffect)(()=>{ef.current&&(ef.current.scrollTop=ef.current.scrollHeight)},[ec]),(0,l.useEffect)(()=>{fetch("/api/auth/me").then(e=>e.json()).then(e=>{"sub_user"===e.role&&(window.location.href="/dashboard/usage")}).catch(()=>{}),e_(),eN()},[]);let eN=async()=>{A(!0);try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status")]);if(e.ok){let t=await e.json();w(t.requireApiKey||!1),N(!1!==t.requireLogin),S(t.hasPassword||!1),_(t.tunnelDashboardAccess||!1),$(!1!==t.rtkEnabled)}if(t.ok){let e=await t.json(),s=e.tunnel?.enabled||!1,a=e.tunnel?.tunnelUrl||"",l=e.tunnel?.publicUrl||"";F(a),W(l);let n=e.tailscale?.enabled||!1,r=e.tailscale?.tunnelUrl||"";if(X(r),n&&r){ee(!0),es("Checking Tailscale...");let e=`${r}/api/health`;try{let t=await fetch(e,{mode:"no-cors",cache:"no-store"});if(t.ok||"opaque"===t.type)V(!0);else{let e=await eD(r);V(e),e||el({type:"warning",message:"Tailscale not reachable."})}}catch{let e=await eD(r);V(e),e||el({type:"warning",message:"Tailscale not reachable."})}finally{ee(!1),es("")}}else V(n);if(s&&(l||a)){let e=`${l||a}/api/health`;try{(await fetch(e,{cache:"no-store"})).ok?D(!0):eP(l||a)}catch{eP(l||a)}}else D(s)}}catch(e){console.log("Error loading settings:",e)}finally{A(!1)}},eC=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:e})})).ok&&_(e)}catch(e){console.log("Error updating tunnelDashboardAccess:",e)}},eS=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:e})})).ok&&w(e)}catch(e){console.log("Error updating requireApiKey:",e)}},eT=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&$(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},e_=async()=>{try{let e=await fetch("/api/keys"),t=await e.json();e.ok&&s(t.keys||[])}catch(e){console.log("Error fetching data:",e)}finally{r(!1)}},eP=async e=>{q(!0),K("Waiting for tunnel ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<3e5;){await new Promise(e=>setTimeout(e,2e3));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return D(!0),q(!1),K(""),!0}catch{}if((Date.now()-s)%1e4<2e3)try{let e=await fetch("/api/tunnel/status");if(e.ok){let t=await e.json();if(!t.tunnel?.enabled)return z({type:"error",message:"Tunnel process stopped unexpectedly."}),q(!1),K(""),!1}}catch{}}return z({type:"error",message:"Tunnel created but not reachable. Please try again."}),q(!1),K(""),!1},e$=async()=>{M(!1),q(!0),z(null),K("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?K(`Downloading cloudflared... ${s.download.progress}%`):e&&K("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 z({type:"error",message:s.error||"Failed to enable tunnel"});let a=s.publicUrl||s.tunnelUrl;if(!a)return void z({type:"error",message:"No tunnel URL returned"});F(s.tunnelUrl||""),W(s.publicUrl||""),await eP(a)}catch(e){z({type:"error",message:e.message})}finally{e=!1,q(!1),K("")}},eE=async()=>{q(!0),z(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(D(!1),F(""),W(""),Q(!1),z({type:"success",message:"Tunnel disabled"})):z({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){z({type:"error",message:e.message})}finally{q(!1)}},eA=async()=>{er(null);try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok){let t=await e.json();return er(t.installed),t}}catch{}return er(!1),{installed:!1}},eU=async()=>{eo(!0),el(null),ed([]);try{let e=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:ex})});em("");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)ed(e=>[...e.slice(-50),a.message]);else if("done"===s){er(!0),eo(!1);return}else"error"===s&&el({type:"error",message:a.error||"Install failed"})}}}catch(e){el({type:"error",message:e.message})}finally{eo(!1)}},eD=async e=>{es("Waiting for Tailscale ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<3e5;){await new Promise(e=>setTimeout(e,2e3));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return!0}catch{}}return!1},eO=async e=>{let t=e||null;eg(!1),eu(!0),ee(!0),el(null),es("Connecting...");try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),s=await e.json();if(e.ok&&s.success){t&&t.close(),X(s.tunnelUrl||""),await eD(s.tunnelUrl)?(V(!0),el(null)):(V(!0),el({type:"warning",message:"Connected but not reachable yet."}));return}if(s.needsLogin&&s.authUrl){t?t.location.href=s.authUrl:window.open(s.authUrl,"tailscale_auth","width=600,height=700"),es("Waiting for login...");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){es("Starting funnel...");let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),s=await e.json();e.ok&&s.success?(t&&t.close(),X(s.tunnelUrl||""),await eD(s.tunnelUrl)?(V(!0),el(null)):(V(!0),el({type:"warning",message:"Connected but not reachable yet."}))):s.funnelNotEnabled&&s.enableUrl?await eF(s.enableUrl,t):el({type:"error",message:s.error||"Failed to start funnel"});return}}catch{}}el({type:"error",message:"Login timed out. Please try again."});return}if(s.funnelNotEnabled&&s.enableUrl)return void await eF(s.enableUrl,t);t&&t.close(),el({type:"error",message:s.error||"Failed to connect"})}catch(e){t&&t.close(),el({type:"error",message:e.message})}finally{ee(!1),eu(!1),es("")}},eF=async(e,t)=>{t?t.location.href=e:window.open(e,"tailscale_auth","width=600,height=700"),es("Enable Funnel in browser, waiting...");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"}),s=await e.json();if(e.ok&&s.success){t&&t.close(),X(s.tunnelUrl||""),await eD(s.tunnelUrl)?(V(!0),el(null)):(V(!0),el({type:"warning",message:"Connected but not reachable yet."}));return}if(s.funnelNotEnabled)continue;if(s.error)return void el({type:"error",message:s.error})}catch{}}el({type:"error",message:"Timed out waiting for Funnel to be enabled."})},eI=async()=>{ee(!0),el(null);try{let e=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),t=await e.json();e.ok?(V(!1),X(""),ey(!1),el({type:"success",message:"Tailscale disabled"})):el({type:"error",message:t.error||"Failed to disable Tailscale"})}catch(e){el({type:"error",message:e.message})}finally{ee(!1)}},eW=async()=>{el(null),ed([]),eg(!0),await eA()},eR=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&&(j(t.key),await e_(),y(""),g(!1))}catch(e){console.log("Error creating key:",e)}},eq=async e=>{if(confirm("Delete this API key?"))try{(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&(s(t.filter(t=>t.id!==e)),ek(t=>{let s=new Set(t);return s.delete(e),s}))}catch(e){console.log("Error deleting key:",e)}},eL=async(e,t)=>{try{(await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&s(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error toggling key:",e)}},[eK,eJ]=(0,l.useState)("/v1");return((0,l.useEffect)(()=>{eJ(`${window.location.origin}/v1`)},[]),n)?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(i.Qv,{}),(0,a.jsx)(i.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"API Endpoint"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(x,{label:"Local",url:eK,copyId:"local_url",copied:ew,onCopy:ev}),(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-[68px] text-center ${U?"bg-orange-100 dark:bg-orange-900/30 text-orange-600 dark:text-orange-400":"bg-sidebar text-text-muted"}`,children:"Tunnel"}),U&&!R?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${I||O}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>ev(`${I||O}/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"===ew?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>Q(!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"})})]}):R?(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"}),L||"Creating tunnel..."]}),(0,a.jsx)("button",{onClick:()=>{q(!1),K("")},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"})})]}):J?.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"}),J.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>M(!0),children:"Enable"})]}):E?(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:()=>A(!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)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{k?M(!0):z({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600 text-white!",children:"Enable"})]}),(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-[68px] text-center ${B?"bg-purple-100 dark:bg-purple-900/30 text-purple-600 dark:text-purple-400":"bg-sidebar text-text-muted"}`,children:"Tailscale"}),B&&!Y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${G}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>ev(`${G}/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"===ew?"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 Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):Y||eh?(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"}),et||"Connecting..."]}),(0,a.jsx)("button",{onClick:()=>{ee(!1),eu(!1),es("")},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"})})]}):ea?.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"}),ea.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:eW,children:"Enable"})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:eW,className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"})]})]}),(U||B)&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!k&&(0,a.jsx)(u,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!v||!C)&&(0,a.jsx)(u,{message:v?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:v?"Change password":"Enable",href:"/dashboard/profile"}})]}),(U||B)&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,a.jsx)(i.lM,{checked:T,onChange:()=>eC(!T)}),(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)(h,{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)(i.Zp,{id:"rtk",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Token Saver"})}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,a.jsxs)("div",{className:"pr-4",children:[(0,a.jsx)("p",{className:"font-medium",children:"Compress tool output"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Auto-compress tool output (git diff/grep/ls/tree/logs) before sending to LLM to save tokens. Disable if you see issues."})]}),(0,a.jsx)(i.lM,{checked:P,onChange:()=>eT(!P)})]})]}),(0,a.jsxs)(i.Zp,{id:"require-api-key",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"API Keys"}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>g(!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)(i.lM,{checked:k,onChange:()=>eS(!k)})]}),0===t.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)(i.$n,{icon:"add",onClick:()=>g(!0),children:"Create Key"})]}):(0,a.jsx)("div",{className:"flex flex-col",children:t.map(e=>{var t;return(0,a.jsxs)("div",{className:`group flex items-center justify-between 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",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono",children:ej.has(e.id)?e.key:(t=e.key)?t.length>8?t.slice(0,8)+"...":t:""}),(0,a.jsx)("button",{onClick:()=>{var t;return t=e.id,void ek(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 opacity-0 group-hover:opacity-100 transition-all",title:ej.has(e.id)?"Hide key":"Show key",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:ej.has(e.id)?"visibility_off":"visibility"})}),(0,a.jsx)("button",{onClick:()=>ev(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:ew===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"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.lM,{size:"sm",checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?confirm(`Pause API key "${e.name}"?
|
|
2
2
|
|
|
3
|
-
This key will stop working immediately but can be resumed later.`)&&eL(e.id,t):eL(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,a.jsx)("button",{onClick:()=>eq(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-0 group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,a.jsx)(i.aF,{isOpen:p,title:"Create API Key",onClose:()=>{g(!1),y("")},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(i.pd,{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)(i.$n,{onClick:eR,fullWidth:!0,disabled:!b.trim(),children:"Create"}),(0,a.jsx)(i.$n,{onClick:()=>{g(!1),y("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:!!f,title:"API Key Created",onClose:()=>j(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)(i.pd,{value:f||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)(i.$n,{variant:"secondary",icon:"created_key"===ew?"check":"content_copy",onClick:()=>ev(f,"created_key"),children:"created_key"===ew?"Copied!":"Copy"})]}),(0,a.jsx)(i.$n,{onClick:()=>j(null),fullWidth:!0,children:"Done"})]})}),(0,a.jsx)(i.aF,{isOpen:H,title:"Enable Tunnel",onClose:()=>M(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 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-blue-600 dark:text-blue-400",children:"cloud_upload"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium mb-1",children:"Cloudflare Tunnel"}),(0,a.jsx)("p",{className:"text-sm text-blue-700 dark:text-blue-300",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:c.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)(i.$n,{onClick:e$,fullWidth:!0,className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600 text-white!",children:"Start Tunnel"}),(0,a.jsx)(i.$n,{onClick:()=>M(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:Z,title:"Disable Tunnel",onClose:()=>!R&&Q(!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)(i.$n,{onClick:eE,fullWidth:!0,disabled:R,className:"bg-red-500! hover:bg-red-600! text-white!",children:R?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>Q(!1),variant:"ghost",fullWidth:!0,disabled:R,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:ep,title:"Tailscale Funnel",onClose:()=>{ei||(eg(!1),em(""),el(null))},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[null===
|
|
3
|
+
This key will stop working immediately but can be resumed later.`)&&eL(e.id,t):eL(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,a.jsx)("button",{onClick:()=>eq(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-0 group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,a.jsx)(i.aF,{isOpen:p,title:"Create API Key",onClose:()=>{g(!1),y("")},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(i.pd,{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)(i.$n,{onClick:eR,fullWidth:!0,disabled:!b.trim(),children:"Create"}),(0,a.jsx)(i.$n,{onClick:()=>{g(!1),y("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:!!f,title:"API Key Created",onClose:()=>j(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)(i.pd,{value:f||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)(i.$n,{variant:"secondary",icon:"created_key"===ew?"check":"content_copy",onClick:()=>ev(f,"created_key"),children:"created_key"===ew?"Copied!":"Copy"})]}),(0,a.jsx)(i.$n,{onClick:()=>j(null),fullWidth:!0,children:"Done"})]})}),(0,a.jsx)(i.aF,{isOpen:H,title:"Enable Tunnel",onClose:()=>M(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 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-blue-600 dark:text-blue-400",children:"cloud_upload"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium mb-1",children:"Cloudflare Tunnel"}),(0,a.jsx)("p",{className:"text-sm text-blue-700 dark:text-blue-300",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:c.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)(i.$n,{onClick:e$,fullWidth:!0,className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600 text-white!",children:"Start Tunnel"}),(0,a.jsx)(i.$n,{onClick:()=>M(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:Z,title:"Disable Tunnel",onClose:()=>!R&&Q(!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)(i.$n,{onClick:eE,fullWidth:!0,disabled:R,className:"bg-red-500! hover:bg-red-600! text-white!",children:R?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>Q(!1),variant:"ghost",fullWidth:!0,disabled:R,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:ep,title:"Tailscale Funnel",onClose:()=>{ei||(eg(!1),em(""),el(null))},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[null===en&&(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===en&&!ei&&(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)(i.$n,{onClick:eU,fullWidth:!0,className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Install Tailscale"}),(0,a.jsx)(i.$n,{onClick:()=>eg(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ei&&(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..."]}),ec.length>0&&(0,a.jsx)("div",{ref:ef,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:ec.map((e,t)=>(0,a.jsx)("div",{children:e},t))})]}),!0===en&&!ei&&(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)(i.$n,{onClick:()=>{let e=window.open("","tailscale_auth","width=600,height=700");e&&e.document.write("<p style='font-family:sans-serif;text-align:center;margin-top:40px'>Connecting to Tailscale...</p>"),eO(e)},fullWidth:!0,className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Connect"}),(0,a.jsx)(i.$n,{onClick:()=>eg(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ea&&(0,a.jsx)(m,{status:ea})]})}),(0,a.jsx)(i.aF,{isOpen:eb,title:"Disable Tailscale",onClose:()=>!Y&&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:"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)(i.$n,{onClick:eI,fullWidth:!0,disabled:Y,className:"bg-red-500! hover:bg-red-600! text-white!",children:Y?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>ey(!1),variant:"ghost",fullWidth:!0,disabled:Y,children:"Cancel"})]})]})})]})}function x({label:e,url:t,copyId:s,copied:l,onCopy:n,badge:r,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-[68px] text-center ${"CF"===r?"bg-orange-100 dark:bg-orange-900/30 text-orange-600 dark:text-orange-400":"TS"===r?"bg-purple-100 dark:bg-purple-900/30 text-purple-600 dark:text-purple-400":"bg-sidebar text-text-muted"}`,children:e}),(0,a.jsx)(i.pd,{value:t,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>n(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 m({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 h({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 u({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})]})}d.propTypes={machineId:r().string.isRequired}}}]);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[698],{3534:(e,t,s)=>{s.d(t,{dM:()=>a,wn:()=>l});let l={antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",mitmDomain:"daily-cloudcode-pa.googleapis.com",modelAliases:["claude-opus-4-6-thinking","claude-sonnet-4-6","gemini-3-flash","gpt-oss-120b-medium","gemini-3-pro-high","gemini-3-pro-low"],defaultModels:[{id:"gemini-3.1-pro-high",name:"Gemini 3.1 Pro High",alias:"gemini-3.1-pro-high"},{id:"gemini-3.1-pro-low",name:"Gemini 3.1 Pro Low",alias:"gemini-3.1-pro-low"},{id:"gemini-3-flash",name:"Gemini 3 Flash / Default",alias:"gemini-3-flash"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",alias:"claude-sonnet-4-6"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking",alias:"claude-opus-4-6-thinking"},{id:"gpt-oss-120b-medium",name:"GPT OSS 120B Medium",alias:"gpt-oss-120b-medium"}]},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot IDE with MITM",configType:"mitm",mitmDomain:"api.individual.githubcopilot.com",modelAliases:["gpt-4o-mini","claude-haiku-4.5","gpt-4o","gpt-5-mini"],defaultModels:[{id:"gpt-4o",name:"GPT-4o",alias:"gpt-4o"},{id:"gpt-4.1",name:"GPT-4.1",alias:"gpt-4.1"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"}]},kiro:{id:"kiro",name:"Kiro",image:"/providers/kiro.png",color:"#FF6B00",description:"Kiro IDE with MITM",configType:"mitm",mitmDomain:"q.us-east-1.amazonaws.com",defaultModels:[{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5",alias:"claude-sonnet-4.5"},{id:"claude-sonnet-4",name:"Claude Sonnet 4",alias:"claude-sonnet-4"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"},{id:"deepseek-3.2",name:"DeepSeek 3.2",alias:"deepseek-3.2"},{id:"minimax-m2.1",name:"MiniMax M2.1",alias:"minimax-m2.1"},{id:"simple-task",name:"Qwen3 Coder Next",alias:"simple-task"}]},openrouter:{id:"openrouter",name:"OpenRouter",image:"/providers/openrouter.png",color:"#8B5CF6",description:"OpenRouter with MITM",configType:"mitm",mitmDomain:"openrouter.ai",modelAliases:["openai/gpt-5.4","openai/gpt-5.5","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-4.7"],defaultModels:[{id:"openai/gpt-5.4",name:"OpenAI: GPT-5.4",alias:"openai/gpt-5.4"},{id:"openai/gpt-5.5",name:"OpenAI: GPT-5.5",alias:"openai/gpt-5.5"},{id:"anthropic/claude-sonnet-4.6",name:"Anthropic: Claude-Sonnet-4.6",alias:"anthropic/claude-sonnet-4.6"},{id:"anthropic/claude-sonnet-4.7",name:"Anthropic: Claude Sonnet 4.7",alias:"anthropic/claude-sonnet-4.7"}]}},a={claude:{id:"claude",name:"Claude Code",icon:"terminal",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL"},modelAliases:["default","sonnet","opus","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-4-6"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-4-6"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},openclaw:{id:"openclaw",name:"Open Claw",image:"/providers/openclaw.png",color:"#FF6B35",description:"Open Claw AI Assistant",configType:"custom"},codex:{id:"codex",name:"OpenAI Codex CLI",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",color:"#E87040",description:"OpenCode AI Terminal Assistant",configType:"custom"},droid:{id:"droid",name:"Factory Droid",image:"/providers/droid.png",color:"#00D4FF",description:"Factory Droid AI Assistant",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresExternalUrl:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor routes requests through its own server, so local endpoint is not supported. Please enable Tunnel or Cloud Endpoint in Settings."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]},cline:{id:"cline",name:"Cline",image:"/providers/cline.png",color:"#00D1B2",description:"Cline AI Coding Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Cline Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → OpenAI Compatible"},{step:3,title:"Base URL",value:"{{baseUrl}}/v1",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Kilo Code Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → OpenAI Compatible"},{step:3,title:"Base URL",value:"{{baseUrl}}/v1",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},roo:{id:"roo",name:"Roo",image:"/providers/roo.png",color:"#FF6B6B",description:"Roo AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Roo Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → Ollama"},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},continue:{id:"continue",name:"Continue",image:"/providers/continue.png",color:"#7C3AED",description:"Continue AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Config",desc:"Open Continue configuration file"},{step:2,title:"API Key",type:"apiKeySelector"},{step:3,title:"Select Model",type:"modelSelector"},{step:4,title:"Add Model Config",desc:"Add the following configuration to your models array:"}],codeBlock:{language:"json",code:`{
|
|
2
|
+
"apiBase": "{{baseUrl}}",
|
|
3
|
+
"title": "{{model}}",
|
|
4
|
+
"model": "{{model}}",
|
|
5
|
+
"provider": "openai",
|
|
6
|
+
"apiKey": "{{apiKey}}"
|
|
7
|
+
}`}},hermes:{id:"hermes",name:"Hermes Agent",image:"/providers/hermes.png",color:"#8B5CF6",description:"Nous Research self-improving AI agent",configType:"custom"}}},40295:e=>{e.exports={TOOL_HOSTS:{antigravity:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com"],copilot:["api.individual.githubcopilot.com"],kiro:["q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"],cursor:["api2.cursor.sh"]}}},82997:(e,t,s)=>{s.d(t,{Tk:()=>o,Ah:()=>d,a7:()=>g,ZM:()=>x,RF:()=>u,gY:()=>k,tA:()=>b,kn:()=>N,yZ:()=>m,qO:()=>f});var l=s(95155),a=s(12115),r=s(35497),n=s(5772);let i="https://9router.com";function o({tool:e,isExpanded:t,onToggle:s,activeProviders:d,modelMappings:c,onModelMappingChange:x,baseUrl:m,hasActiveProviders:p,apiKeys:u,cloudEnabled:h,initialStatus:g,manualOnly:f=!1}){let y,b,j,[N,v]=(0,a.useState)(null),[w,k]=(0,a.useState)(!1),[C,S]=(0,a.useState)(!1),[_,A]=(0,a.useState)(!1),[O,E]=(0,a.useState)(null),[M,I]=(0,a.useState)(!1),[R,T]=(0,a.useState)(!1),[P,$]=(0,a.useState)(null),[F,K]=(0,a.useState)(""),[z,D]=(0,a.useState)({}),[L,U]=(0,a.useState)(!1),[H,B]=(0,a.useState)(""),[q,W]=(0,a.useState)(!1),G=(0,a.useRef)(!1),X=N||g||null,J=X?.settings?.env?.ANTHROPIC_AUTH_TOKEN||"",Z=J&&u?.some(e=>e.key===J),Y=F||(Z?J:"")||u?.[0]?.key||"",V=(()=>{if(!X?.installed)return null;let e=X.settings?.env?.ANTHROPIC_BASE_URL;if(!e)return"not_configured";let t=e.includes("localhost")||e.includes("127.0.0.1"),s=h&&i&&e.startsWith(i),l=m&&e.startsWith(m);return t||s||l?"configured":"other"})();(0,a.useEffect)(()=>{t&&(X||fetch("/api/cli-tools/claude-settings").then(e=>e.json()).then(e=>v(e)).catch(e=>v({installed:!1,error:e.message})),fetch("/api/models/alias").then(e=>e.json()).then(e=>D(e.aliases||{})).catch(e=>console.log("Error fetching model aliases:",e)))},[t,X]),(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{W(!!e.ccFilterNaming)}).catch(()=>{})},[]);let Q=async e=>{let t=e.target.checked;W(t),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:t})}).catch(()=>{})};(0,a.useEffect)(()=>{if(X?.installed&&!G.current){G.current=!0;let t=X.settings?.env||{};e.defaultModels.forEach(e=>{if(e.envKey){let s=t[e.envKey]||e.defaultValue||"";s&&x(e.alias,s)}})}},[X,e.defaultModels,x]);let ee=()=>{let e=H||m;return e.endsWith("/v1")?e:`${e}/v1`},et=async()=>{S(!0),E(null);try{let t={ANTHROPIC_BASE_URL:ee()},s=Y?.trim()||(u?.length>0?u[0].key:null)||(h?null:"sk_openrouterx");s&&(t.ANTHROPIC_AUTH_TOKEN=s),e.defaultModels.forEach(e=>{let s=c[e.alias];s&&e.envKey&&(t[e.envKey]=s)});let l=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t})}),a=await l.json();l.ok?(E({type:"success",text:"Settings applied successfully!"}),v(e=>({...e,hasBackup:!0,settings:{...e?.settings,env:t}}))):E({type:"error",text:a.error||"Failed to apply settings"})}catch(e){E({type:"error",text:e.message})}finally{S(!1)}},es=async()=>{A(!0),E(null);try{let t=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),s=await t.json();t.ok?(E({type:"success",text:"Settings reset successfully!"}),e.defaultModels.forEach(e=>x(e.alias,e.defaultValue||"")),K("")):E({type:"error",text:s.error||"Failed to reset settings"})}catch(e){E({type:"error",text:e.message})}finally{A(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(n.default,{src:"/providers/claude.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===V&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===V&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===V&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[w&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Claude CLI..."})]}),!w&&N&&!N.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Claude CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if OpenRouterX is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>U(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),!f&&(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>I(!M),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:M?"expand_less":"help"}),M?"Hide":"How to Install"]})]})]}),!f&&M&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!w&&X?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[X?.settings?.env?.ANTHROPIC_BASE_URL&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:X.settings.env.ANTHROPIC_BASE_URL})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:(y=H||m).endsWith("/v1")?y:`${y}/v1`,onChange:e=>B(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),!f&&H&&H!==m&&(0,l.jsx)("button",{onClick:()=>B(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),u.length>0?(0,l.jsx)("select",{value:Y,onChange:e=>K(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:u.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:h?"No API keys - Create one in Keys page":"sk_openrouterx (default)"})]}),e.defaultModels.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:e.name}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:c[e.alias]||"",onChange:t=>x(e.alias,t.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>{$(e.alias),T(!0)},disabled:!p,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${p?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),!f&&c[e.alias]&&(0,l.jsx)("button",{onClick:()=>x(e.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias)),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Filter naming"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)("input",{type:"checkbox",checked:q,onChange:Q,className:"w-3.5 h-3.5 accent-primary cursor-pointer"}),(0,l.jsx)("span",{className:"text-xs text-text-muted",children:"Filter naming requests"})]}),(0,l.jsx)(r.m_,{text:"Intercepts Claude Code's topic-naming requests and returns a fake response locally, saving API tokens.",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] cursor-help",children:"info"})})]})]}),O&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===O.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===O.type?"check_circle":"error"}),(0,l.jsx)("span",{children:O.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[!f&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:et,disabled:!p,loading:C,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:es,disabled:!X?.hasOpenRouterX,loading:_,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]})]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>U(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:R,onClose:()=>T(!1),onSelect:e=>{P&&x(P,e.value)},selectedModel:P?c[P]:null,activeProviders:d,modelAliases:z,title:`Select model for ${P}`}),(0,l.jsx)(r.uR,{isOpen:L,onClose:()=>U(!1),title:"Claude CLI - Manual Configuration",configs:(b=Y&&Y.trim()?Y:h?"<API_KEY_FROM_DASHBOARD>":"sk_openrouterx",j={ANTHROPIC_BASE_URL:ee(),ANTHROPIC_AUTH_TOKEN:b},e.defaultModels.forEach(e=>{let t=c[e.alias];t&&e.envKey&&(j[e.envKey]=t)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:j},null,2)}])})]})}function d({tool:e,isExpanded:t,onToggle:s,baseUrl:i,apiKeys:o,activeProviders:c,cloudEnabled:x,initialStatus:m,manualOnly:p=!1}){let u,h,g,f,[y,b]=(0,a.useState)(null),[j,N]=(0,a.useState)(!1),[v,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(!1),[S,_]=(0,a.useState)(null),[A,O]=(0,a.useState)(!1),[E,M]=(0,a.useState)(""),[I,R]=(0,a.useState)(""),[T,P]=(0,a.useState)(""),[$,F]=(0,a.useState)(!1),[K,z]=(0,a.useState)(!1),[D,L]=(0,a.useState)({}),[U,H]=(0,a.useState)(!1),[B,q]=(0,a.useState)(""),W=y||m||null,G=W?.config?.match(/^model\s*=\s*"([^"]+)"/m)?.[1]||"",X=W?.config?.match(/\[agents\.subagent\]\s*\n\s*model\s*=\s*"([^"]+)"/m)?.[1]||"",J=E||o?.[0]?.key||"",Z=I||G,Y=T||X;async function V(){N(!0);try{let e=await fetch("/api/cli-tools/codex-settings"),t=await e.json();b(t)}catch(e){b({installed:!1,error:e.message})}finally{N(!1)}}(0,a.useEffect)(()=>{t&&(W||fetch("/api/cli-tools/codex-settings").then(e=>e.json()).then(e=>b(e)).catch(e=>b({installed:!1,error:e.message})),fetch("/api/models/alias").then(e=>e.json()).then(e=>L(e.aliases||{})).catch(e=>console.log("Error fetching model aliases:",e)))},[t,W]);let Q=W?.installed?W.config?W.config.includes(i)||W.config.includes("localhost")||W.config.includes("127.0.0.1")?"configured":"other":"not_configured":null,ee=()=>{let e=B||`${i}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},et=async()=>{w(!0),_(null);try{let e=J&&J.trim()||x?J:"sk_openrouterx",t=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ee(),apiKey:e,model:Z,subagentModel:Y||Z})}),s=await t.json();t.ok?(_({type:"success",text:"Settings applied successfully!"}),V()):_({type:"error",text:s.error||"Failed to apply settings"})}catch(e){_({type:"error",text:e.message})}finally{w(!1)}},es=async()=>{C(!0),_(null);try{let e=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),t=await e.json();e.ok?(_({type:"success",text:"Settings reset successfully!"}),R(""),P(""),V()):_({type:"error",text:t.error||"Failed to reset settings"})}catch(e){_({type:"error",text:e.message})}finally{C(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(n.default,{src:"/providers/codex.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===Q&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===Q&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===Q&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[j&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Codex CLI..."})]}),!j&&y&&!y.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Codex CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if OpenRouterX is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>H(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),!p&&(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>O(!A),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:A?"expand_less":"help"}),A?"Hide":"How to Install"]})]})]}),!p&&A&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," to verify."]}),(0,l.jsx)("div",{className:"pt-2 border-t border-border",children:(0,l.jsxs)("p",{className:"text-text-muted text-xs",children:["Codex uses ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/auth.json"})," with ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"OPENAI_API_KEY"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!j&&W?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[W?.config&&((h=(u=W.config.match(/base_url\s*=\s*"([^"]+)"/))?u[1]:null)?(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:h})]}):null),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:B||`${i}/v1`,onChange:e=>q(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),!p&&B&&B!==`${i}/v1`&&(0,l.jsx)("button",{onClick:()=>q(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),o.length>0?(0,l.jsx)("select",{value:J,onChange:e=>M(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:o.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_openrouterx (default)"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:Z,onChange:e=>R(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>F(!0),disabled:!c?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${c?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),!p&&Z&&(0,l.jsx)("button",{onClick:()=>R(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Subagent Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:Y,onChange:e=>P(e.target.value),placeholder:Z||"provider/model-id (defaults to main model)",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>z(!0),disabled:!c?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${c?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),!p&&Y&&(0,l.jsx)("button",{onClick:()=>P(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),S&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===S.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===S.type?"check_circle":"error"}),(0,l.jsx)("span",{children:S.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[!p&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:et,disabled:!E&&x&&o.length>0||!I,loading:v,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:es,disabled:k,loading:k,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]})]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>H(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:$,onClose:()=>F(!1),onSelect:e=>{R(e.value),T||P(e.value),F(!1)},selectedModel:I,activeProviders:c,modelAliases:D,title:"Select Model for Codex"}),(0,l.jsx)(r.rq,{isOpen:K,onClose:()=>z(!1),onSelect:e=>{P(e.value),z(!1)},selectedModel:T,activeProviders:c,modelAliases:D,title:"Select Subagent Model for Codex"}),(0,l.jsx)(r.uR,{isOpen:U,onClose:()=>H(!1),title:"Codex CLI - Manual Configuration",configs:(g=J&&J.trim()?J:x?"<API_KEY_FROM_DASHBOARD>":"sk_openrouterx",f=T||Z,[{filename:"~/.codex/config.toml",content:`# OpenRouterX Configuration for Codex CLI
|
|
8
|
+
model = "${Z}"
|
|
9
|
+
model_provider = "openrouterx"
|
|
10
|
+
|
|
11
|
+
[model_providers.openrouterx]
|
|
12
|
+
name = "OpenRouterX"
|
|
13
|
+
base_url = "${ee()}"
|
|
14
|
+
wire_api = "responses"
|
|
15
|
+
|
|
16
|
+
[agents.subagent]
|
|
17
|
+
model = "${f}"
|
|
18
|
+
`},{filename:"~/.codex/auth.json",content:JSON.stringify({auth_mode:"apikey",OPENAI_API_KEY:g},null,2)}])})]})}let c="https://9router.com";function x({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:o,apiKeys:d,activeProviders:m,cloudEnabled:p,initialStatus:u,manualOnly:h=!1}){let g,f,y,b,[j,N]=(0,a.useState)(null),[v,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(!1),[S,_]=(0,a.useState)(!1),[A,O]=(0,a.useState)(null),[E,M]=(0,a.useState)(""),[I,R]=(0,a.useState)([]),[T,P]=(0,a.useState)(""),[$,F]=(0,a.useState)(!1),[K,z]=(0,a.useState)({}),[D,L]=(0,a.useState)(!1),[U,H]=(0,a.useState)(!1),[B,q]=(0,a.useState)(""),W=j||u||null,G=(()=>{let e=(W?.settings?.customModels||[]).filter(e=>e.id?.startsWith("custom:openrouterx")).sort((e,t)=>(e.index||0)-(t.index||0)).map(e=>e.model).filter(Boolean);if(e.length>0)return e;let t=W?.settings?.customModels?.find(e=>"custom:openrouterx-0"===e.id);return t?.model?[t.model]:[]})(),X=I.length>0?I:G,J=E||d?.[0]?.key||"",Z=(()=>{if(!W?.installed)return null;let e=W.settings?.customModels?.find(e=>e.id?.startsWith("custom:openrouterx"));if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=p&&c&&e.baseUrl?.startsWith(c),l=i&&e.baseUrl?.startsWith(i);return t||s||l?"configured":"other"})();(0,a.useEffect)(()=>{t&&(W||fetch("/api/cli-tools/droid-settings").then(e=>e.json()).then(e=>N(e)).catch(e=>N({installed:!1,error:e.message})),fetch("/api/models/alias").then(e=>e.json()).then(e=>z(e.aliases||{})).catch(e=>console.log("Error fetching model aliases:",e)))},[t,W]);let Y=async()=>{w(!0);try{let e=await fetch("/api/cli-tools/droid-settings"),t=await e.json();N(t)}catch(e){N({installed:!1,error:e.message})}finally{w(!1)}},V=()=>{let e=B||i;return e.endsWith("/v1")?e:`${e}/v1`},Q=()=>{let e=T.trim();!e||I.includes(e)||(R(t=>[...t,e]),P(""))},ee=async()=>{C(!0),O(null);try{let e=J?.trim()||(d?.length>0?d[0].key:null)||(p?null:"sk_openrouterx"),t=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:V(),apiKey:e,models:X,activeModel:X[0]||""})}),s=await t.json();t.ok?(O({type:"success",text:"Settings applied successfully!"}),Y()):O({type:"error",text:s.error||"Failed to apply settings"})}catch(e){O({type:"error",text:e.message})}finally{C(!1)}},et=async()=>{_(!0),O(null);try{let e=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),t=await e.json();e.ok?(O({type:"success",text:"Settings reset successfully!"}),R([]),Y()):O({type:"error",text:t.error||"Failed to reset settings"})}catch(e){O({type:"error",text:e.message})}finally{_(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(n.default,{src:"/providers/droid.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===Z&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===Z&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===Z&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[v&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Factory Droid CLI..."})]}),!v&&W&&!W.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Factory Droid CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if OpenRouterX is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>L(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),!h&&(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>H(!U),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:U?"expand_less":"help"}),U?"Hide":"How to Install"]})]})]}),!h&&U&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"curl -fsSL https://app.factory.ai/cli | sh"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"droid"})," to verify."]})]})]})]}),!v&&W?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[W?.settings?.customModels?.find(e=>e.id?.startsWith("custom:openrouterx"))?.baseUrl&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:W.settings.customModels.find(e=>e.id?.startsWith("custom:openrouterx")).baseUrl})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:(g=B||i).endsWith("/v1")?g:`${g}/v1`,onChange:e=>q(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),!h&&B&&B!==i&&(0,l.jsx)("button",{onClick:()=>q(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,l.jsx)("select",{value:J,onChange:e=>M(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:p?"No API keys - Create one in Keys page":"sk_openrouterx (default)"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:["Models ",X.length>0&&(0,l.jsxs)("span",{className:"text-primary",children:["(",X.length,")"]})]}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"flex-1 flex flex-col gap-1",children:[X.length>0&&(0,l.jsx)("div",{className:"flex flex-col gap-0.5 mb-1",children:X.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-bg-secondary rounded border border-border",children:[(0,l.jsx)("span",{className:"flex-1 text-xs font-mono truncate",children:e}),(0,l.jsx)("button",{onClick:()=>R(t=>t.filter(t=>t!==e)),className:"text-text-muted hover:text-red-500 transition-colors shrink-0",title:"Remove",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e))}),(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,l.jsx)("input",{type:"text",value:T,onChange:e=>P(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),Q())},placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>F(!0),disabled:!o,className:`px-2 py-1.5 rounded border text-xs shrink-0 ${o?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),(0,l.jsx)("button",{onClick:Q,disabled:!T.trim(),className:"px-2 py-1.5 rounded border bg-surface border-border hover:border-primary text-xs shrink-0 disabled:opacity-50",title:"Add model",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"add"})})]})]})]})]}),A&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,l.jsx)("span",{children:A.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[!h&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ee,disabled:0===X.length,loading:k,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:et,disabled:!W?.hasOpenRouterX,loading:S,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]})]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>L(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:$,onClose:()=>F(!1),onSelect:e=>{!e.value||I.includes(e.value)||(R(t=>[...t,e.value]),F(!1))},selectedModel:null,activeProviders:m,modelAliases:K,title:"Select Model for Factory Droid"}),(0,l.jsx)(r.uR,{isOpen:D,onClose:()=>L(!1),title:"Factory Droid - Manual Configuration",configs:(f=J&&J.trim()?J:p?"<API_KEY_FROM_DASHBOARD>":"sk_openrouterx",y={customModels:X.map((e,t)=>({model:e,id:`custom:openrouterx-${t}`,index:t,baseUrl:V(),apiKey:f,displayName:e,maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}))},b="u">typeof navigator&&navigator.platform,[{filename:b?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(y,null,2)}])})]})}function m({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:o,apiKeys:d,activeProviders:c,cloudEnabled:x,initialStatus:p,manualOnly:u=!1}){let h,g,f,[y,b]=(0,a.useState)(p||null),[j,N]=(0,a.useState)(!1),[v,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(!1),[S,_]=(0,a.useState)(null),[A,O]=(0,a.useState)(""),[E,M]=(0,a.useState)(""),[I,R]=(0,a.useState)({}),[T,P]=(0,a.useState)(null),[$,F]=(0,a.useState)(!1),[K,z]=(0,a.useState)({}),[D,L]=(0,a.useState)(!1),[U,H]=(0,a.useState)(""),B=(0,a.useRef)(!1),q=(()=>{if(!y?.installed)return null;let e=y.settings?.models?.providers?.openrouterx;if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1")||e.baseUrl?.includes("0.0.0.0"),s=i&&e.baseUrl?.startsWith(i);return t||s?"configured":"other"})();(0,a.useEffect)(()=>{d?.length>0&&!A&&O(d[0].key)},[d,A]),(0,a.useEffect)(()=>{p&&b(p)},[p]),(0,a.useEffect)(()=>{t&&!y&&(G(),W()),t&&W()},[t]);let W=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&z(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(y?.installed&&!B.current){B.current=!0;let e=y.settings?.models?.providers?.openrouterx;if(e){let t=y.settings?.agents?.defaults?.model?.primary;t&&M(t.replace(/^openrouterx\//,"")),e.apiKey&&d?.some(t=>t.key===e.apiKey)&&O(e.apiKey)}let t=y.agents||[],s={};t.forEach(e=>{e.currentModel&&(s[e.id]=e.currentModel)}),R(s)}},[y,d]);let G=async()=>{N(!0);try{let e=await fetch("/api/cli-tools/openclaw-settings"),t=await e.json();b(t)}catch(e){b({installed:!1,error:e.message})}finally{N(!1)}},X=()=>window.location.origin.replace("://localhost","://127.0.0.1"),J=()=>{let e=U||X();return e.endsWith("/v1")?e:`${e}/v1`},Z=async()=>{w(!0),_(null);try{let e=A?.trim()||(d?.length>0?d[0].key:null)||(x?null:"sk_openrouterx"),t=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:J(),apiKey:e,model:E,agentModels:I})}),s=await t.json();t.ok?(_({type:"success",text:"Settings applied successfully!"}),G()):_({type:"error",text:s.error||"Failed to apply settings"})}catch(e){_({type:"error",text:e.message})}finally{w(!1)}},Y=async()=>{C(!0),_(null);try{let e=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),t=await e.json();e.ok?(_({type:"success",text:"Settings reset successfully!"}),M(""),O(""),G()):_({type:"error",text:t.error||"Failed to reset settings"})}catch(e){_({type:"error",text:e.message})}finally{C(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(n.default,{src:"/providers/openclaw.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===q&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===q&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===q&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[j&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Open Claw CLI..."})]}),!j&&y&&!y.installed&&(0,l.jsx)("div",{className:"flex flex-col gap-4",children:(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Open Claw CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if OpenRouterX is deployed on a remote server."})]})]}),(0,l.jsx)("div",{className:"flex items-center gap-2 pl-9",children:(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>L(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]})}),!j&&y?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[y?.settings?.models?.providers?.openrouterx?.baseUrl&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:y.settings?.models?.providers?.openrouterx?.baseUrl})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:(h=U||X()).endsWith("/v1")?h:`${h}/v1`,onChange:e=>H(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),!u&&U&&U!==i&&(0,l.jsx)("button",{onClick:()=>H(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,l.jsx)("select",{value:A,onChange:e=>O(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_openrouterx (default)"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Default Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:E,onChange:e=>M(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>{P(null),F(!0)},disabled:!o,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${o?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),!u&&E&&(0,l.jsx)("button",{onClick:()=>M(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(y.agents||[]).filter(e=>e.agentDir).map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-4",children:[(0,l.jsxs)("span",{className:"w-32 shrink-0 text-xs text-primary text-right truncate",title:e.name||e.id,children:["Agent ",e.name||e.id]}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:I[e.id]||"",onChange:t=>R(s=>({...s,[e.id]:t.target.value})),placeholder:`default (${E||"provider/model-id"})`,className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>{P(e.id),F(!0)},disabled:u||!o,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${!u&&o?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),!u&&I[e.id]&&(0,l.jsx)("button",{onClick:()=>R(t=>({...t,[e.id]:""})),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.id))]}),S&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===S.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===S.type?"check_circle":"error"}),(0,l.jsx)("span",{children:S.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[!u&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:Z,disabled:!E,loading:v,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:Y,disabled:!y?.hasOpenRouterX,loading:k,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]})]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>L(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:$,onClose:()=>F(!1),onSelect:e=>{T?(R(t=>({...t,[T]:e.value})),P(null)):M(e.value),F(!1)},selectedModel:E,activeProviders:c,modelAliases:K,title:"Select Model for Open Claw"}),(0,l.jsx)(r.uR,{isOpen:D,onClose:()=>L(!1),title:"Open Claw - Manual Configuration",configs:(f=(g=A||d?.[0]?.key||"")&&g.trim()?g:x?"<API_KEY_FROM_DASHBOARD>":"sk_openrouterx",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`openrouterx/${E||"provider/model-id"}`}}},models:{providers:{openrouterx:{baseUrl:J(),apiKey:f,api:"openai-completions",models:[{id:E||"provider/model-id",name:(E||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}let p="/api/cli-tools/hermes-settings";function u({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:o,apiKeys:d,activeProviders:c,cloudEnabled:x,initialStatus:m,manualOnly:h=!1}){let g,[f,y]=(0,a.useState)(m||null),[b,j]=(0,a.useState)(!1),[N,v]=(0,a.useState)(!1),[w,k]=(0,a.useState)(!1),[C,S]=(0,a.useState)(null),[_,A]=(0,a.useState)(""),[O,E]=(0,a.useState)(""),[M,I]=(0,a.useState)(!1),[R,T]=(0,a.useState)({}),[P,$]=(0,a.useState)(!1),[F,K]=(0,a.useState)(""),z=(0,a.useRef)(!1),D=(()=>{if(!f?.installed)return null;let e=f.settings?.model;if(!e?.base_url)return"not_configured";let t=/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(e.base_url),s=i&&e.base_url.startsWith(i);return t||s?"configured":"other"})();(0,a.useEffect)(()=>{d?.length>0&&!_&&A(d[0].key)},[d,_]),(0,a.useEffect)(()=>{m&&y(m)},[m]),(0,a.useEffect)(()=>{t&&!f&&(U(),L()),t&&L()},[t]);let L=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&T(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(f?.installed&&!z.current){z.current=!0;let e=f.settings?.model;e?.default&&E(e.default)}},[f]);let U=async()=>{j(!0);try{let e=await fetch(p),t=await e.json();y(t)}catch(e){y({installed:!1,error:e.message})}finally{j(!1)}},H=()=>{let e=F||window.location.origin.replace("://localhost","://127.0.0.1");return e.endsWith("/v1")?e:`${e}/v1`},B=async()=>{v(!0),S(null);try{let e=_?.trim()||(d?.length>0?d[0].key:null)||(x?null:"sk_openrouterx"),t=await fetch(p,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:H(),apiKey:e,model:O})}),s=await t.json();t.ok?(S({type:"success",text:"Settings applied successfully!"}),U()):S({type:"error",text:s.error||"Failed to apply settings"})}catch(e){S({type:"error",text:e.message})}finally{v(!1)}},q=async()=>{k(!0),S(null);try{let e=await fetch(p,{method:"DELETE"}),t=await e.json();e.ok?(S({type:"success",text:"Settings reset successfully!"}),E(""),U()):S({type:"error",text:t.error||"Failed to reset settings"})}catch(e){S({type:"error",text:e.message})}finally{k(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(n.default,{src:"/providers/hermes.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===D&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===D&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===D&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[b&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Hermes Agent..."})]}),!b&&f&&!f.installed&&(0,l.jsx)("div",{className:"flex flex-col gap-4",children:(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Hermes Agent not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Install: curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash"})]})]}),(0,l.jsx)("div",{className:"flex items-center gap-2 pl-9",children:(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>$(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]})}),!b&&f?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[f?.settings?.model?.base_url&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:f.settings.model.base_url})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:H(),onChange:e=>K(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),!h&&F&&F!==i&&(0,l.jsx)("button",{onClick:()=>K(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,l.jsx)("select",{value:_,onChange:e=>A(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_openrouterx (default)"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Default Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:O,onChange:e=>E(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>I(!0),disabled:!o,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${o?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),!h&&O&&(0,l.jsx)("button",{onClick:()=>E(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),C&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===C.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===C.type?"check_circle":"error"}),(0,l.jsx)("span",{children:C.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[!h&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:B,disabled:!O,loading:N,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:q,disabled:!f?.hasOpenRouterX,loading:w,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]})]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>$(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:M,onClose:()=>I(!1),onSelect:e=>{E(e.value),I(!1)},selectedModel:O,activeProviders:c,modelAliases:R,title:"Select Model for Hermes Agent"}),(0,l.jsx)(r.uR,{isOpen:P,onClose:()=>$(!1),title:"Hermes Agent - Manual Configuration",configs:(g=_&&_.trim()?_:x?"<API_KEY_FROM_DASHBOARD>":"sk_openrouterx",[{filename:"~/.hermes/config.yaml",content:`model:
|
|
19
|
+
default: "${O||"provider/model-id"}"
|
|
20
|
+
provider: "custom"
|
|
21
|
+
base_url: "${H()}"
|
|
22
|
+
`},{filename:"~/.hermes/.env",content:`OPENAI_API_KEY=${g}
|
|
23
|
+
`}])})]})}var h=s(11059);function g({toolId:e,tool:t,isExpanded:s,onToggle:i,baseUrl:o,apiKeys:d,activeProviders:c=[],cloudEnabled:x=!1,tunnelEnabled:m=!1}){let[p,u]=(0,a.useState)(null),[f,y]=(0,a.useState)(!1),[b,j]=(0,a.useState)(""),[N,v]=(0,a.useState)(()=>d?.length>0?d[0].key:""),w=e=>{let t=N&&N.trim()?N:x?"your-api-key":"sk_openrouterx",s=o||"http://localhost:20128",l=s.endsWith("/v1")?s:`${s}/v1`;return e.replace(/\{\{baseUrl\}\}/g,l).replace(/\{\{apiKey\}\}/g,t).replace(/\{\{model\}\}/g,b||"provider/model-id")},{copy:k}=(0,h.C)(),C=async(e,t)=>{await k(w(e),`toolcard-${t}`),u(t),setTimeout(()=>u(null),2e3)},S=c.length>0,_=()=>(!t.requiresExternalUrl||!!x||!!m)&&(!t.requiresCloud||!!x);return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:i,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:t.image?(0,l.jsx)(n.default,{src:t.image,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):t.icon?(0,l.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:t.color},children:t.icon}):(0,l.jsx)(n.default,{src:`/providers/${e}.png`,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:t.name}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:t.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${s?"rotate-180":""}`,children:"expand_more"})]}),s&&(0,l.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:t.guideSteps?(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[t.notes&&0!==t.notes.length?(0,l.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:t.notes.map((e,t)=>{if("cloudCheck"===e.type&&(x||m))return null;let s="warning"===e.type,a="cloudCheck"===e.type&&!x&&!m,r="bg-blue-500/10 border-blue-500/30",n="text-blue-600 dark:text-blue-400",i="text-blue-500",o="info";return s?(r="bg-yellow-500/10 border-yellow-500/30",n="text-yellow-600 dark:text-yellow-400",i="text-yellow-500",o="warning"):a&&(r="bg-red-500/10 border-red-500/30",n="text-red-600 dark:text-red-400",i="text-red-500",o="error"),(0,l.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${r}`,children:[(0,l.jsx)("span",{className:`material-symbols-outlined text-lg ${i}`,children:o}),(0,l.jsx)("p",{className:`text-sm ${n}`,children:e.text})]},t)})}):null,_()&&t.guideSteps.map(e=>(0,l.jsxs)("div",{className:"flex items-start gap-4",children:[(0,l.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:t.color},children:e.step}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("p",{className:"font-medium text-text",children:e.title}),e.desc&&(0,l.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:e.desc}),"apiKeySelector"===e.type&&(0,l.jsx)("div",{className:"mt-2 flex items-center gap-2",children:d&&d.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("select",{value:N,onChange:e=>v(e.target.value),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}),(0,l.jsx)("button",{onClick:()=>C(N,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===p?"check":"content_copy"})})]}):(0,l.jsx)("span",{className:"text-sm text-text-muted",children:x?"No API keys - Create one in Keys page":"sk_openrouterx"})}),"modelSelector"===e.type&&(0,l.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,l.jsx)("input",{type:"text",value:b,onChange:e=>j(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>y(!0),disabled:!S,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${S?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),b&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{onClick:()=>C(b,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===p?"check":"content_copy"})}),(0,l.jsx)("button",{onClick:()=>j(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),e.value&&(0,l.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,l.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:w(e.value)}),e.copyable&&(0,l.jsx)("button",{onClick:()=>C(e.value,`${e.step}-${e.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-lg",children:p===`${e.step}-${e.title}`?"check":"content_copy"})})]})]})]},e.step)),_()&&t.codeBlock&&(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,l.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:t.codeBlock.language}),(0,l.jsxs)("button",{onClick:()=>C(t.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===p?"check":"content_copy"}),"codeblock"===p?"Copied!":"Copy"]})]}),(0,l.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,l.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:w(t.codeBlock.code)})})]})]}):(0,l.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,l.jsx)(r.rq,{isOpen:f,onClose:()=>y(!1),onSelect:e=>{j(e.value)},selectedModel:b,activeProviders:c,title:"Select Model"})]})}function f({tool:e,isExpanded:t,onToggle:s,baseUrl:i,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:x,manualOnly:m=!1}){let p,u,h,g,y,[b,j]=(0,a.useState)(x||null),[N,v]=(0,a.useState)(!1),[w,k]=(0,a.useState)(!1),[C,S]=(0,a.useState)(!1),[_,A]=(0,a.useState)(null),[O,E]=(0,a.useState)(!1),[M,I]=(0,a.useState)(""),[R,T]=(0,a.useState)(""),[P,$]=(0,a.useState)(""),[F,K]=(0,a.useState)(!1),[z,D]=(0,a.useState)(!1),[L,U]=(0,a.useState)({}),[H,B]=(0,a.useState)(!1),[q,W]=(0,a.useState)(""),[G,X]=(0,a.useState)([]),[J,Z]=(0,a.useState)(""),Y=M||o?.[0]?.key||"";(0,a.useEffect)(()=>{o?.length>0&&!M&&I(o[0].key)},[o,M]),(0,a.useEffect)(()=>{x&&j(x)},[x]),(0,a.useEffect)(()=>{t&&!b&&(et(),V()),t&&V()},[t]),(0,a.useEffect)(()=>{b?.opencode?.models&&X(b.opencode.models),b?.opencode?.activeModel&&Z(b.opencode.activeModel),b?.config?.agent?.explorer?.model?.match(/^openrouterx\//)&&$(b.config.agent.explorer.model.replace(/^openrouterx\//,""))},[b]);let V=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&U(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},Q=(()=>{if(!b?.installed)return null;if(!b.config)return"not_configured";let e=b.config?.provider?.openrouterx,t=e?.options?.baseURL||"",s=t.includes("localhost")||t.includes("127.0.0.1");return b.hasOpenRouterX&&(s||t.includes(i))?"configured":b.hasOpenRouterX?"other":"not_configured"})(),ee=()=>{let e=q||i;return e.endsWith("/v1")?e:`${e}/v1`},et=async()=>{v(!0);try{let e=await fetch("/api/cli-tools/opencode-settings"),t=await e.json();j(t)}catch(e){j({installed:!1,error:e.message})}finally{v(!1)}},es=async()=>{k(!0),A(null);try{let e=M&&M.trim()?M:c?Y:"sk_openrouterx",t=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ee(),apiKey:e,models:G,activeModel:""===J?"":J||G[0],subagentModel:P})}),s=await t.json();t.ok?(A({type:"success",text:"Settings applied successfully!"}),et()):A({type:"error",text:s.error||"Failed to apply settings"})}catch(e){A({type:"error",text:e.message})}finally{k(!1)}},el=async()=>{S(!0),A(null);try{let e=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),t=await e.json();e.ok?(A({type:"success",text:"Settings reset successfully!"}),T(""),$(""),X([]),Z(""),et()):A({type:"error",text:t.error||"Failed to reset settings"})}catch(e){A({type:"error",text:e.message})}finally{S(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(n.default,{src:"/providers/opencode.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===Q&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===Q&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===Q&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[N&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking OpenCode CLI..."})]}),!N&&b&&!b.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"OpenCode CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if OpenRouterX is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>B(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),!m&&(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>E(!O),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:O?"expand_less":"help"}),O?"Hide":"How to Install"]})]})]}),!m&&O&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g opencode-ai"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"opencode"})," to verify."]})]})]})]}),!N&&b?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[b?.config?.provider?.openrouterx?.options?.baseURL&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:b.config?.provider?.openrouterx?.options?.baseURL})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:q||`${i}/v1`,onChange:e=>W(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),!m&&q&&q!==`${i}/v1`&&(0,l.jsx)("button",{onClick:()=>W(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),o.length>0?(0,l.jsx)("select",{value:M,onChange:e=>I(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:o.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:c?"No API keys - Create one in Keys page":"sk_openrouterx (default)"})]}),(0,l.jsxs)("div",{className:"flex items-start gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Models"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===G.length?(0,l.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected yet. Click Select Model."}):G.map(e=>(0,l.jsxs)("span",{onClick:async()=>{if(e===J)try{(await fetch("/api/cli-tools/opencode-settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({clearActiveModel:!0})})).ok&&(Z(""),et())}catch(e){console.log("Error clearing active model:",e)}else Z(e)},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs cursor-pointer transition-colors ${e===J?"bg-primary/10 text-primary border border-primary":"bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border"}`,title:e===J?"Click to clear active model":"Click to set as active",children:[e===J&&(0,l.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:"star"}),e,(0,l.jsx)("button",{onClick:async t=>{t.stopPropagation();try{if((await fetch(`/api/cli-tools/opencode-settings?model=${encodeURIComponent(e)}`,{method:"DELETE"})).ok){let t=G.filter(t=>t!==e);X(t),J===e&&Z(""),et()}}catch(e){console.log("Error removing model:",e)}},className:"ml-0.5 hover:text-red-500",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e))}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("button",{onClick:()=>K(!0),disabled:!d?.length,className:`px-2 py-1 rounded border text-xs transition-colors ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),(0,l.jsx)("span",{className:"text-xs text-text-muted",children:G.length>0&&J?(0,l.jsxs)(l.Fragment,{children:["Active: ",(0,l.jsx)("span",{className:"text-primary",children:J})]}):G.length>0?(0,l.jsx)("span",{className:"text-yellow-500",children:"Click a model to set/clear active"}):"Click Select Model to choose one"})]})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Subagent Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:P,onChange:e=>$(e.target.value),placeholder:R||"provider/model-id (defaults to main model)",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>D(!0),disabled:!d?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),!m&&P&&(0,l.jsx)("button",{onClick:()=>$(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),_&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===_.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===_.type?"check_circle":"error"}),(0,l.jsx)("span",{children:_.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[!m&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:es,disabled:0===G.length,loading:w,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:el,disabled:!b.hasOpenRouterX,loading:C,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]})]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>B(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:F,onClose:()=>K(!1),onSelect:e=>{!G.includes(e.value)&&(X([...G,e.value]),J||Z(e.value)),K(!1)},selectedModel:null,activeProviders:d,modelAliases:L,title:"Select Model for OpenCode"}),(0,l.jsx)(r.rq,{isOpen:z,onClose:()=>D(!1),onSelect:e=>{$(e.value),D(!1)},selectedModel:P,activeProviders:d,modelAliases:L,title:"Select Subagent Model for OpenCode"}),(0,l.jsx)(r.uR,{isOpen:H,onClose:()=>B(!1),title:"OpenCode - Manual Configuration",configs:(p=Y&&Y.trim()?Y:c?"<API_KEY_FROM_DASHBOARD>":"sk_openrouterx",u=G.length>0?G:["provider/model-id"],h=J||G[0]||u[0],g=P||h,y={},u.forEach(e=>{y[e]={name:e}}),[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{openrouterx:{npm:"@ai-sdk/openai-compatible",options:{baseURL:ee(),apiKey:p},models:y}},model:`openrouterx/${h}`,agent:{explorer:{description:"Fast explorer subagent for codebase exploration",mode:"subagent",model:`openrouterx/${g}`}}},null,2)}])})]})}let y="http://localhost:20128";function b({apiKeys:e,cloudEnabled:t,onStatusChange:s}){let[n,i]=(0,a.useState)(null),[o,d]=(0,a.useState)(!1),[c,x]=(0,a.useState)(!1),[m,p]=(0,a.useState)(""),[u,h]=(0,a.useState)(""),[g,f]=(0,a.useState)(null),[j,N]=(0,a.useState)(null),[v,w]=(0,a.useState)(null),[k,C]=(0,a.useState)(y),S="u">typeof navigator&&navigator.userAgent?.includes("Windows"),_=n?.isAdmin!==!1;(0,a.useEffect)(()=>{e?.length>0&&!u&&h(e[0].key)},[e,u]),(0,a.useEffect)(()=>{A()},[]);let A=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm");if(e.ok){let t=await e.json();i(t),t.mitmRouterBaseUrl&&C(t.mitmRouterBaseUrl),s?.(t)}}catch{i({running:!1,certExists:!1,dnsStatus:{}})}},O=e=>{w(null),S||n?.hasCachedPassword?E(e,""):(f(e),x(!0),N(null))},E=async(s,l)=>{d(!0),w(null);try{let a;if("trust-cert"===s)a=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"trust-cert",sudoPassword:l})});else if("start"===s){let s=u?.trim()||(e?.length>0?e[0].key:null)||(t?null:"sk_openrouterx");a=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:s,sudoPassword:l,mitmRouterBaseUrl:k.trim()||y})})}else a=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:l})});if(!a.ok){let e=await a.json().catch(()=>({}));w(e.error||`Failed to ${s} MITM server`);return}x(!1),p(""),await A()}catch(e){w(e.message||"Network error")}finally{d(!1),f(null)}},M=()=>{m.trim()?E(g,m):N("Sudo password is required")},I=n?.running;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.Zp,{padding:"sm",className:"border-primary/20 bg-primary/5",children:(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"security"}),(0,l.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"MITM Server"}),I?(0,l.jsx)(r.Ex,{variant:"success",size:"sm",children:"Running"}):(0,l.jsx)(r.Ex,{variant:"default",size:"sm",children:"Stopped"})]}),(0,l.jsx)("div",{className:"flex items-center gap-1 text-xs text-text-muted","data-i18n-skip":"true",children:[{label:"Cert",ok:n?.certExists},{label:"Trusted",ok:n?.certTrusted},{label:"Server",ok:I}].map(({label:e,ok:t})=>(0,l.jsxs)("span",{className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded ${t?"text-green-600":"text-text-muted"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:t?"check_circle":"cancel"}),e]},e))})]}),(0,l.jsxs)("div",{className:"px-2 py-2 rounded-lg bg-surface/50 border border-border/50 flex flex-col gap-2",children:[(0,l.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Purpose:"})," Use Antigravity IDE & GitHub Copilot → with ANY provider/model from OpenRouterX"]}),(0,l.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Antigravity/Copilot IDE request → DNS redirect to localhost:443 → MITM proxy intercepts → OpenRouterX → response to Antigravity/Copilot"]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"OpenRouterX Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:k,onChange:e=>C(e.target.value),placeholder:y,disabled:I,className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50 disabled:opacity-50"})]}),!I&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",list:"mitm-api-keys",value:u,onChange:e=>h(e.target.value),placeholder:t?"Enter or pick API key":"sk_openrouterx (default)",className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50"}),e?.length>0&&(0,l.jsx)("datalist",{id:"mitm-api-keys",children:e.map(e=>(0,l.jsx)("option",{value:e.key,children:e.name||e.key},e.id))})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 flex-wrap","data-i18n-skip":"true",children:[n?.certExists&&!n?.certTrusted&&(0,l.jsxs)("button",{onClick:()=>O("trust-cert"),disabled:o,className:"px-4 py-1.5 rounded-lg bg-yellow-500/10 border border-yellow-500/30 text-yellow-600 font-medium text-xs flex items-center gap-1.5 hover:bg-yellow-500/20 transition-colors disabled:opacity-50",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"verified_user"}),"Trust Cert"]}),I?(0,l.jsxs)("button",{onClick:()=>O("stop"),disabled:o,className:"px-4 py-1.5 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-xs flex items-center gap-1.5 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop Server"]}):(0,l.jsxs)("button",{onClick:()=>O("start"),disabled:o||S&&!_,className:"px-4 py-1.5 rounded-lg bg-primary/10 border border-primary/30 text-primary font-medium text-xs flex items-center gap-1.5 hover:bg-primary/20 transition-colors disabled:opacity-50",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start Server"]}),I&&(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),v&&(0,l.jsxs)("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5 shrink-0",children:"error"}),(0,l.jsx)("span",{children:v})]}),S&&!_&&(0,l.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 border border-red-500/20",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"shield_lock"}),(0,l.jsx)("span",{children:"Administrator required — restart OpenRouterX as Administrator to use MITM"})]})]})}),c&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,l.jsxs)("div",{className:"bg-surface border border-border rounded-xl p-6 w-full max-w-sm flex flex-col gap-4 shadow-xl",children:[(0,l.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,l.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and server startup"})]}),(0,l.jsx)(r.pd,{type:"password",placeholder:"Enter sudo password",value:m,onChange:e=>p(e.target.value),onKeyDown:e=>{"Enter"!==e.key||o||M()}}),j&&(0,l.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,l.jsx)("span",{children:j})]}),(0,l.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,l.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{x(!1),p(""),N(null)},disabled:o,children:"Cancel"}),(0,l.jsx)(r.$n,{variant:"primary",size:"sm",onClick:M,loading:o,children:"Confirm"})]})]})})]})}var j=s(40295);function N({tool:e,isExpanded:t,onToggle:s,serverRunning:i,dnsActive:o,hasCachedPassword:d,apiKeys:c,activeProviders:x,hasActiveProviders:m,modelAliases:p={},cloudEnabled:u,onDnsChange:h}){let[g,f]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null),[v,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(""),[S,_]=(0,a.useState)(null),[A,O]=(0,a.useState)(null),[E,M]=(0,a.useState)({}),[I,R]=(0,a.useState)(!1),[T,P]=(0,a.useState)(null),$=j.TOOL_HOSTS[e.id]??[],F="u">typeof navigator&&navigator.userAgent?.includes("Windows");(0,a.useEffect)(()=>{t&&K()},[t]);let K=async()=>{try{let t=await fetch(`/api/cli-tools/antigravity-mitm/alias?tool=${e.id}`);if(t.ok){let e=await t.json();Object.keys(e.aliases||{}).length>0&&M(e.aliases)}}catch{}},z=(0,a.useCallback)(async t=>{try{await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:e.id,mappings:t})})}catch{}},[e.id]),D=(e,t)=>{M(s=>({...s,[e]:t}))},L=()=>{if(!i)return;let e=o?"disable":"enable";F||d?U(e,""):(_(e),w(!0),O(null))},U=async(t,s)=>{f(!0),b(null);try{let l=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:e.id,action:t,sudoPassword:s})}),a=await l.json();if(!l.ok)throw Error(a.error||"Failed to toggle DNS");"enable"===t&&b(`Restart ${e.name} to apply changes`),w(!1),C(""),h?.(a)}catch{}finally{f(!1),_(null)}},H=()=>{k.trim()?U(S,k):O("Sudo password is required")};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(n.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),i?o?(0,l.jsx)(r.Ex,{variant:"success",size:"sm",children:"Active"}):(0,l.jsx)(r.Ex,{variant:"warning",size:"sm",children:"DNS off"}):(0,l.jsx)(r.Ex,{variant:"default",size:"sm",children:"Server off"})]}),(0,l.jsxs)("p",{className:"text-xs text-text-muted",children:["Intercept ",e.name," requests via MITM proxy"]})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[$.length>0&&(0,l.jsxs)("div",{className:"mt-2 rounded-md border border-border bg-surface/50 px-2 py-1.5",children:[(0,l.jsx)("p",{className:"text-[10px] font-medium tracking-wide text-text-main/80 mb-1",children:"Edit hosts file manually to add the following entries:"}),(0,l.jsx)("ul",{className:"list-none space-y-0.5 font-mono text-[10px] text-text-muted break-all",children:$.map(e=>(0,l.jsxs)("li",{children:["127.0.0.1 ",e]},e))})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted px-1",children:[(0,l.jsxs)("p",{children:["Toggle DNS to redirect ",e.name," traffic through OpenRouterX via MITM."]}),!o&&(0,l.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),e.defaultModels?.length>0&&(0,l.jsx)("div",{className:"flex flex-col gap-2",children:e.defaultModels.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-36 shrink-0 text-xs font-semibold text-text-main text-right",children:e.name}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:E[e.alias]||"",onChange:t=>D(e.alias,t.target.value),onBlur:t=>{var s,l;return s=e.alias,l=t.target.value,void z({...E,[s]:l})},placeholder:"provider/model-id",disabled:!o,className:`flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 ${!o?"opacity-50 cursor-not-allowed":""}`}),(0,l.jsx)("button",{onClick:()=>{P(e.alias),R(!0)},disabled:!m||!o,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 ${m&&o?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),E[e.alias]&&(0,l.jsx)("button",{onClick:()=>{D(e.alias,""),z({...E,[e.alias]:""})},className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias))}),e.defaultModels?.length===0&&(0,l.jsx)("p",{className:"text-xs text-text-muted px-1",children:"Model mappings will be available soon."}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 items-start",children:[o?(0,l.jsxs)("button",{onClick:L,disabled:!i||g,className:"px-4 py-1.5 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-xs flex items-center gap-1.5 hover:bg-red-500/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop DNS"]}):(0,l.jsxs)("button",{onClick:L,disabled:!i||g,className:"px-4 py-1.5 rounded-lg bg-primary/10 border border-primary/30 text-primary font-medium text-xs flex items-center gap-1.5 hover:bg-primary/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start DNS"]}),y&&(0,l.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs text-amber-500",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,l.jsx)("span",{children:y})]})]})]})]}),v&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,l.jsxs)("div",{className:"bg-surface border border-border rounded-xl p-6 w-full max-w-sm flex flex-col gap-4 shadow-xl",children:[(0,l.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,l.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Required to modify /etc/hosts and flush DNS cache"})]}),(0,l.jsx)(r.pd,{type:"password",placeholder:"Enter sudo password",value:k,onChange:e=>C(e.target.value),onKeyDown:e=>{"Enter"!==e.key||g||H()}}),A&&(0,l.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,l.jsx)("span",{children:A})]}),(0,l.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,l.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{w(!1),C(""),O(null)},disabled:g,children:"Cancel"}),(0,l.jsx)(r.$n,{variant:"primary",size:"sm",onClick:H,loading:g,children:"Confirm"})]})]})}),(0,l.jsx)(r.rq,{isOpen:I,onClose:()=>R(!1),onSelect:e=>{if(!T||e.isPlaceholder)return;let t={...E,[T]:e.value};M(t),z(t)},selectedModel:T?E[T]:null,activeProviders:x,modelAliases:p,title:`Select model for ${T}`})]})}var v=s(98500),w=s.n(v);function k({tool:e}){return(0,l.jsx)(w(),{href:"/dashboard/mitm",className:"block",children:(0,l.jsx)(r.Zp,{padding:"sm",className:"overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(n.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-purple-500/10 text-purple-600 dark:text-purple-400 rounded-full",children:"MITM"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"chevron_right"})]})})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7758],{36894:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>i});var n=t(95155),a=t(12115),l=t(35497);function i(){let[e,s]=(0,a.useState)([]),[t,i]=(0,a.useState)([]),[d,r]=(0,a.useState)(!0),[c,o]=(0,a.useState)(null),[u,x]=(0,a.useState)(""),[h,m]=(0,a.useState)(!1);async function p(){r(!0);try{let[e,t]=await Promise.all([fetch("/api/keys"),fetch("/api/users")]),n=await e.json(),a=await t.json();s(n.keys||[]),i(a.users||[])}finally{r(!1)}}async function f(e){m(!0);try{(await fetch(`/api/keys/${e.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:u||null})})).ok&&(o(null),x(""),p())}finally{m(!1)}}return(0,a.useEffect)(()=>{fetch("/api/auth/me").then(e=>e.json()).then(e=>{"super_admin"!==e.role?window.location.href="/dashboard/usage":p()}).catch(()=>{window.location.href="/dashboard/usage"})},[]),(0,n.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-bold",children:"API Key Management"}),(0,n.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Assign API keys to sub-users. Only the assigned user can use that key."})]}),d?(0,n.jsx)("p",{className:"text-text-muted",children:"Loading..."}):0===e.length?(0,n.jsx)(l.Zp,{children:(0,n.jsx)("p",{className:"text-text-muted text-center py-8",children:"No API keys yet. Create one in the Endpoint page."})}):(0,n.jsx)("div",{className:"space-y-3",children:e.map(e=>{let{label:s,color:a}=function(e){if(!e)return{label:"Unassigned (Admin)",color:"text-text-muted"};let s=t.find(s=>s.id===e);return{label:s?`${s.displayName} (@${s.username})`:e,color:"text-primary"}}(e.userId);return(0,n.jsxs)(l.Zp,{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center gap-4",children:[(0,n.jsx)("div",{className:"w-10 h-10 rounded-lg bg-surface-alt flex items-center justify-center",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"key"})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"font-semibold font-mono text-sm",children:e.name}),(0,n.jsxs)("p",{className:`text-xs ${a}`,children:[s,e.assignedAt&&(0,n.jsxs)("span",{className:"ml-2 text-text-muted",children:["assigned ",new Date(e.assignedAt).toLocaleDateString()]})]})]})]}),(0,n.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:()=>{o(e),x(e.userId||"")},children:e.userId?"Reassign":"Assign to User"})]},e.id)})}),c&&(0,n.jsx)(l.aF,{isOpen:!!c,title:`Assign Key: ${c.name}`,onClose:()=>o(null),children:(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsxs)(l.l6,{label:"Assign to user",value:u,onChange:e=>x(e.target.value),children:[(0,n.jsx)("option",{value:"",children:"— Unassigned (Admin only) —"}),t.map(e=>(0,n.jsxs)("option",{value:e.id,children:[e.displayName," (@",e.username,")"]},e.id))]}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(l.$n,{variant:"secondary",onClick:()=>o(null),children:"Cancel"}),(0,n.jsx)(l.$n,{loading:h,onClick:()=>f(c),children:"Save"})]})]})})]})}},45329:(e,s,t)=>{Promise.resolve().then(t.bind(t,36894))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=45329)),_N_E=e.O()}]);
|
package/app/.next/static/chunks/app/(dashboard)/dashboard/admin/users/page-c8e5a4b31bc18425.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6434],{17169:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>c});var r=a(95155),l=a(12115),t=a(35497),i=a(52679);let n=["codex","alicode"];function o(e){return Array.isArray(e)?Array.from(new Set(e.map(e=>"string"==typeof e?e.trim():"").filter(Boolean))):[]}function d(e,s=n){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"allowedProviders")?o(e.allowedProviders):o(s)}function c(){let[e,s]=(0,l.useState)([]),[a,n]=(0,l.useState)([]),[o,c]=(0,l.useState)(!0),[u,x]=(0,l.useState)(!1),[h,f]=(0,l.useState)({username:"",password:"",displayName:"",role:"sub_user",permissions:[],allowedProviders:[]}),[j,v]=(0,l.useState)(!1),[y,g]=(0,l.useState)(""),[w,b]=(0,l.useState)(null),[N,C]=(0,l.useState)({displayName:"",role:"",permissions:[],allowedProviders:[],password:""}),[P,k]=(0,l.useState)(null);async function S(){c(!0);try{let[e,a]=await Promise.all([fetch("/api/users"),fetch("/api/providers")]),r=await e.json(),l=await a.json();s(r.users||[]),n(function(e){let s=new Map;for(let a of e)!a?.provider||s.has(a.provider)||s.set(a.provider,{id:a.provider,label:i.Q2[a.provider]?.name||a.name||a.provider});return Array.from(s.values()).sort((e,s)=>e.label.localeCompare(s.label,"en"))}(l.connections||[]))}finally{c(!1)}}async function _(e){e.preventDefault(),g(""),v(!0);try{let e=await fetch("/api/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h)}),s=await e.json();if(!e.ok)return void g(s.error||"Failed");x(!1),f({username:"",password:"",displayName:"",role:"sub_user",permissions:[],allowedProviders:p(a)}),S()}catch{g("Network error")}finally{v(!1)}}async function $(e){e.preventDefault(),v(!0);try{let e={displayName:N.displayName,role:N.role,permissions:N.permissions,allowedProviders:N.allowedProviders};if(N.password&&(e.password=N.password),!(await fetch(`/api/users/${w.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)return;b(null),S()}finally{v(!1)}}async function O(e){await fetch(`/api/users/${e}`,{method:"DELETE"}),k(null),S()}(0,l.useEffect)(()=>{fetch("/api/auth/me").then(e=>e.json()).then(e=>{"super_admin"!==e.role?window.location.href="/dashboard/usage":S()}).catch(()=>{window.location.href="/dashboard/usage"})},[]);let A=["view_usage","view_logs","view_keys","manage_own_keys"],D=(e,s)=>{s(s=>{let a=s.allowedProviders.includes(e);return{...s,allowedProviders:a?s.allowedProviders.filter(s=>s!==e):[...s.allowedProviders,e]}})};return(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-bold",children:"User Management"}),(0,r.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Manage sub-users and their permissions"})]}),(0,r.jsx)(t.$n,{onClick:()=>{f({username:"",password:"",displayName:"",role:"sub_user",permissions:[],allowedProviders:p(a)}),g(""),x(!0)},children:"+ Add Sub-user"})]}),o?(0,r.jsx)("p",{className:"text-text-muted",children:"Loading..."}):0===e.length?(0,r.jsx)(t.Zp,{children:(0,r.jsx)("p",{className:"text-text-muted text-center py-8",children:"No sub-users yet. Create one to get started."})}):(0,r.jsx)("div",{className:"space-y-3",children:e.map(e=>(0,r.jsxs)(t.Zp,{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center text-primary font-semibold text-lg",children:e.displayName?.charAt(0)?.toUpperCase()||e.username?.charAt(0)?.toUpperCase()}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-semibold",children:e.displayName}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["@",e.username," \xb7 ",e.role]})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs px-2 py-1 rounded-full bg-surface-alt text-text-muted",children:e.permissions?.join(", ")||"no perms"}),(0,r.jsx)("span",{className:"text-xs px-2 py-1 rounded-full bg-primary/10 text-primary",children:function(e,s){let a=new Map(s.map(e=>[e.id,e.label])),r=d(e,p(s));if(0===r.length)return"No providers enabled";let l=r.map(e=>a.get(e)||e);return l.length<=2?l.join(", "):`${l.slice(0,2).join(", ")} +${l.length-2}`}(e,a)}),(0,r.jsx)(t.$n,{variant:"secondary",size:"sm",onClick:()=>{b(e),C({displayName:e.displayName,role:e.role,permissions:e.permissions||[],allowedProviders:d(e,p(a)),password:""})},children:"Edit"}),(0,r.jsx)(t.$n,{variant:"danger",size:"sm",onClick:()=>k(e),children:"Delete"})]})]},e.id))}),u&&(0,r.jsx)(t.aF,{isOpen:u,title:"Create Sub-user",onClose:()=>x(!1),children:(0,r.jsxs)("form",{onSubmit:_,className:"flex flex-col gap-4",children:[(0,r.jsx)(t.pd,{label:"Username",value:h.username,onChange:e=>f(s=>({...s,username:e.target.value})),required:!0}),(0,r.jsx)(t.pd,{label:"Display Name",value:h.displayName,onChange:e=>f(s=>({...s,displayName:e.target.value}))}),(0,r.jsx)(t.pd,{label:"Password",type:"password",value:h.password,onChange:e=>f(s=>({...s,password:e.target.value})),required:!0}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Permissions"}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:A.map(e=>(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-sm cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:h.permissions.includes(e),onChange:s=>f(a=>({...a,permissions:s.target.checked?[...a.permissions,e]:a.permissions.filter(s=>s!==e)}))}),e]},e))})]}),(0,r.jsx)(m,{providerOptions:a,selectedProviders:h.allowedProviders,onToggle:e=>D(e,f)}),y&&(0,r.jsx)("p",{className:"text-red-500 text-sm",children:y}),(0,r.jsxs)("div",{className:"flex justify-end gap-2 mt-2",children:[(0,r.jsx)(t.$n,{variant:"secondary",type:"button",onClick:()=>x(!1),children:"Cancel"}),(0,r.jsx)(t.$n,{type:"submit",loading:j,children:"Create"})]})]})}),w&&(0,r.jsx)(t.aF,{isOpen:!!w,title:`Edit ${w.username}`,onClose:()=>b(null),children:(0,r.jsxs)("form",{onSubmit:$,className:"flex flex-col gap-4",children:[(0,r.jsx)(t.pd,{label:"Display Name",value:N.displayName,onChange:e=>C(s=>({...s,displayName:e.target.value}))}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Permissions"}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:A.map(e=>(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-sm cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:N.permissions.includes(e),onChange:s=>C(a=>({...a,permissions:s.target.checked?[...a.permissions,e]:a.permissions.filter(s=>s!==e)}))}),e]},e))})]}),(0,r.jsx)(m,{providerOptions:a,selectedProviders:N.allowedProviders,onToggle:e=>D(e,C)}),(0,r.jsx)(t.pd,{label:"New Password (leave blank to keep)",type:"password",value:N.password,onChange:e=>C(s=>({...s,password:e.target.value}))}),(0,r.jsxs)("div",{className:"flex justify-end gap-2 mt-2",children:[(0,r.jsx)(t.$n,{variant:"secondary",type:"button",onClick:()=>b(null),children:"Cancel"}),(0,r.jsx)(t.$n,{type:"submit",loading:j,children:"Save"})]})]})}),P&&(0,r.jsxs)(t.aF,{isOpen:!!P,title:"Delete User",onClose:()=>k(null),children:[(0,r.jsxs)("p",{className:"mb-4",children:["Delete user ",(0,r.jsx)("strong",{children:P.username}),"? This cannot be undone."]}),(0,r.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,r.jsx)(t.$n,{variant:"secondary",onClick:()=>k(null),children:"Cancel"}),(0,r.jsx)(t.$n,{variant:"danger",onClick:()=>O(P.id),children:"Delete"})]})]})]})}function p(e){let s=e.map(e=>e.id),a=n.filter(e=>s.includes(e));return a.length>0?a:s}function m({providerOptions:e,selectedProviders:s,onToggle:a}){return(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Allowed Providers"}),0===e.length?(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Connect providers first, then assign them to this sub-user."}):(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(e=>(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-sm cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:s.includes(e.id),onChange:()=>a(e.id)}),e.label]},e.id))}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-2",children:"Only the selected providers will be visible and usable for this sub-user."})]})}},99139:(e,s,a)=>{Promise.resolve().then(a.bind(a,17169))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=99139)),_N_E=e.O()}]);
|