9router 0.4.28 → 0.4.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +11 -9
- package/app/.next/build-manifest.json +3 -3
- package/app/.next/routes-manifest.json +12 -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 +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/skills/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_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.js.nft.json +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_not-found.html +1 -1
- package/app/.next/server/app/_not-found.rsc +18 -20
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +18 -20
- package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/api/auth/login/route.js +1 -1
- package/app/.next/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next/server/app/api/auth/logout/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/all-statuses/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/cline-settings/route.js +2 -0
- package/app/.next/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -0
- package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -0
- package/app/.next/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/cowork-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/hermes-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +2 -0
- package/app/.next/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -0
- package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -0
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js.nft.json +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/combos/route.js +1 -1
- package/app/.next/server/app/api/combos/route.js.nft.json +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/init/route.js.nft.json +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/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
- package/app/.next/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +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/alias/route.js.nft.json +1 -1
- package/app/.next/server/app/api/models/availability/route.js +1 -1
- package/app/.next/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next/server/app/api/models/custom/route.js +1 -1
- package/app/.next/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next/server/app/api/models/disabled/route.js +1 -1
- package/app/.next/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next/server/app/api/models/route.js +1 -1
- package/app/.next/server/app/api/models/route.js.nft.json +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 +2 -2
- 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/cursor/import/route.js.nft.json +1 -1
- package/app/.next/server/app/api/oauth/gitlab/pat/route.js +1 -1
- package/app/.next/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
- package/app/.next/server/app/api/oauth/iflow/cookie/route.js.nft.json +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/import/route.js.nft.json +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/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next/server/app/api/pricing/route.js +1 -1
- package/app/.next/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route.js.nft.json +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]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test-models/route.js.nft.json +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/test-batch/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/validate/route.js +1 -1
- package/app/.next/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
- package/app/.next/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next/server/app/api/proxy-pools/route.js +1 -1
- package/app/.next/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
- package/app/.next/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next/server/app/api/settings/database/route.js +1 -1
- package/app/.next/server/app/api/settings/database/route.js.nft.json +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/require-login/route.js.nft.json +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/disable/route.js.nft.json +1 -1
- package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
- package/app/.next/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next/server/app/api/tunnel/status/route.js +1 -1
- package/app/.next/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-check/route.js +1 -15
- package/app/.next/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-enable/route.js +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-install/route.js +3 -3
- package/app/.next/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next/server/app/api/tunnel/tailscale-login/route.js +2 -2
- package/app/.next/server/app/api/tunnel/tailscale-start-daemon/route.js +2 -2
- package/app/.next/server/app/api/tunnel/tailscale-start-daemon/route.js.nft.json +1 -1
- 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/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/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 +2 -2
- package/app/.next/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.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/audio/transcriptions/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/audio/voices/route.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.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/[kind]/route.js +1 -1
- package/app/.next/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/models/info/route.js +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/route.js.nft.json +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/shutdown/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.js.nft.json +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback.html +1 -1
- package/app/.next/server/app/callback.rsc +22 -24
- package/app/.next/server/app/callback.segments/_full.segment.rsc +22 -24
- package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/callback.segments/_tree.segment.rsc +3 -4
- 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/basic-chat.html +1 -1
- package/app/.next/server/app/dashboard/basic-chat.rsc +20 -22
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/basic-chat.segments/_full.segment.rsc +20 -22
- package/app/.next/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/basic-chat.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next/server/app/dashboard/cli-tools.rsc +21 -23
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +21 -23
- package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/combos.html +1 -1
- package/app/.next/server/app/dashboard/combos.rsc +23 -25
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +23 -25
- package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/endpoint.html +1 -1
- package/app/.next/server/app/dashboard/endpoint.rsc +21 -23
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +21 -23
- package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next/server/app/dashboard/media-providers/web.rsc +23 -27
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +23 -27
- package/app/.next/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/mitm.html +1 -1
- package/app/.next/server/app/dashboard/mitm.rsc +20 -22
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +20 -22
- package/app/.next/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/mitm.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/profile.html +1 -1
- package/app/.next/server/app/dashboard/profile.rsc +23 -26
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +23 -26
- package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/providers/new.html +1 -1
- package/app/.next/server/app/dashboard/providers/new.rsc +23 -27
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +23 -27
- package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/providers.html +1 -1
- package/app/.next/server/app/dashboard/providers.rsc +23 -26
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +23 -26
- package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next/server/app/dashboard/proxy-pools.rsc +23 -26
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +23 -26
- package/app/.next/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/quota.html +2 -2
- package/app/.next/server/app/dashboard/quota.rsc +21 -23
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +21 -23
- package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
- package/app/.next/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.rsc +22 -24
- package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +22 -24
- 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 +7 -9
- package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +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/dashboard/skills.html +1 -1
- package/app/.next/server/app/dashboard/skills.rsc +23 -25
- package/app/.next/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/skills.segments/_full.segment.rsc +23 -25
- package/app/.next/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/skills.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard/skills.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/translator.html +1 -1
- package/app/.next/server/app/dashboard/translator.rsc +23 -26
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +23 -26
- package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard/usage.html +1 -1
- package/app/.next/server/app/dashboard/usage.rsc +23 -25
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +23 -25
- package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/dashboard.html +1 -1
- package/app/.next/server/app/dashboard.rsc +21 -23
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard.segments/_full.segment.rsc +21 -23
- package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +3 -4
- 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 +17 -19
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_full.segment.rsc +17 -19
- package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/index.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/landing/page.js +2 -2
- package/app/.next/server/app/landing/page.js.nft.json +1 -1
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing.html +1 -1
- package/app/.next/server/app/landing.rsc +22 -24
- package/app/.next/server/app/landing.segments/_full.segment.rsc +22 -24
- package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/landing.segments/_tree.segment.rsc +3 -4
- 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.js.nft.json +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login.html +1 -1
- package/app/.next/server/app/login.rsc +22 -24
- package/app/.next/server/app/login.segments/_full.segment.rsc +22 -24
- package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/login.segments/_index.segment.rsc +7 -9
- package/app/.next/server/app/login.segments/_tree.segment.rsc +3 -4
- package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next/server/app/manifest.webmanifest/route.js +2 -2
- package/app/.next/server/app/page.js +2 -2
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +11 -9
- package/app/.next/server/chunks/1071.js +1 -0
- package/app/.next/server/chunks/1574.js +1 -1
- package/app/.next/server/chunks/1795.js +1 -0
- package/app/.next/server/chunks/2009.js +1 -0
- package/app/.next/server/chunks/2035.js +23 -0
- package/app/.next/server/chunks/21.js +1 -1
- package/app/.next/server/chunks/3774.js +4 -3
- package/app/.next/server/chunks/450.js +1 -1
- package/app/.next/server/chunks/{8367.js → 514.js} +2 -2
- package/app/.next/server/chunks/5159.js +1 -1
- package/app/.next/server/chunks/5882.js +1 -0
- package/app/.next/server/chunks/6263.js +1 -1
- package/app/.next/server/chunks/6283.js +1 -1
- package/app/.next/server/chunks/6288.js +1 -1
- package/app/.next/server/chunks/6379.js +3 -3
- package/app/.next/server/chunks/6799.js +1 -1
- package/app/.next/server/chunks/7301.js +1 -1
- package/app/.next/server/chunks/7686.js +13 -0
- package/app/.next/server/chunks/7810.js +1 -1
- package/app/.next/server/chunks/7973.js +1 -1
- package/app/.next/server/chunks/8035.js +1 -1
- package/app/.next/server/chunks/8202.js +3 -3
- package/app/.next/server/chunks/8647.js +1 -1
- package/app/.next/server/middleware-build-manifest.js +1 -1
- package/app/.next/server/middleware.js +4 -4
- 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/505-990698fbfcc0d04a.js +1 -0
- package/app/.next/static/chunks/5810-bd2e4da0ce1402e5.js +23 -0
- package/app/.next/static/chunks/8035-49b6b5ee48c18a8f.js +3 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/basic-chat/page-39cd0425e50727ce.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-8ff504b85ad321a1.js → page-5bfce2cfa6f14e2c.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/{page-bad9a5af75575018.js → page-e9d61c090a6ab757.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-4e03960f4d7085d8.js +1 -0
- package/app/.next/static/chunks/app/_global-error/page-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/auth/login/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/auth/logout/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/all-statuses/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/cowork-settings/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/auth/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/credentials/update/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/model/resolve/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/models/alias/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/combos/[id]/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/combos/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/health/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/init/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/keys/[id]/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/keys/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/locale/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/models/alias/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/models/availability/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/models/custom/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/models/disabled/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/models/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/models/test/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/cursor/import/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/import/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/pricing/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/validate/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/models/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/test/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/providers/client/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/providers/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/providers/suggested-models/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/providers/test-batch/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/providers/validate/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/proxy-pools/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/settings/database/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/settings/proxy-test/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/settings/require-login/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/settings/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/shutdown/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/tags/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/translator/console-logs/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/translator/load/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/translator/save/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/translator/send/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/translator/translate/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/disable/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/enable/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/status/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/usage/[connectionId]/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/usage/chart/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/usage/history/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/usage/providers/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/usage/request-details/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/usage/request-logs/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/usage/stats/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/usage/stream/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/api/chat/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/audio/speech/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/audio/voices/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/chat/completions/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/embeddings/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/images/generations/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/messages/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/models/[kind]/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/models/info/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/models/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/responses/compact/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/responses/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/search/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1/web/fetch/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/v1beta/models/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/version/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/version/shutdown/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/api/version/update/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/layout-fcda570933db809f.js +1 -0
- package/app/.next/static/chunks/app/manifest.webmanifest/route-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/app/page-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-84de94ffd1225dd4.js +1 -0
- package/app/.next/static/chunks/{webpack-86e40ea2022f394c.js → webpack-ab7d9d893d55abd4.js} +1 -1
- package/app/.next/static/css/234ff1f50eae62d1.css +1 -0
- package/app/.next/static/css/{081a0afca5a9bd20.css → 2e1b7d528c228ec3.css} +1 -1
- package/app/.next/static/media/material-symbols-outlined.1060ac06.woff2 +0 -0
- package/app/.next/static/pAkL-eAklQyioXImGSk6m/_buildManifest.js +1 -0
- package/app/package.json +2 -1
- package/app/src/mitm/server.js +41 -43
- package/hooks/sqliteRuntime.js +4 -4
- package/package.json +1 -1
- package/src/cli/api/client.js +31 -0
- package/src/cli/menus/providers.js +240 -5
- package/app/.next/server/chunks/2049.js +0 -1
- package/app/.next/server/chunks/2371.js +0 -1
- package/app/.next/server/chunks/4116.js +0 -1
- package/app/.next/server/chunks/4892.js +0 -13
- package/app/.next/server/chunks/5978.js +0 -1
- package/app/.next/server/chunks/6890.js +0 -23
- package/app/.next/static/chunks/1939-d9b80a9e484ae21d.js +0 -23
- package/app/.next/static/chunks/505-34993b83fbc3f56a.js +0 -1
- package/app/.next/static/chunks/8035-b43a2fdebf8069b1.js +0 -3
- package/app/.next/static/chunks/app/(dashboard)/dashboard/basic-chat/page-cd02fe7b10810144.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-6c6bb4f9b3b7e5f8.js +0 -1
- package/app/.next/static/chunks/app/_global-error/page-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/auth/login/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/auth/logout/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/all-statuses/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/cowork-settings/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/auth/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/credentials/update/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/model/resolve/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/models/alias/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/combos/[id]/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/combos/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/health/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/init/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/keys/[id]/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/keys/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/locale/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/models/alias/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/models/availability/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/models/custom/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/models/disabled/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/models/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/models/test/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/cursor/import/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/import/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/pricing/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/validate/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/models/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/test/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/providers/client/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/providers/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/providers/suggested-models/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/providers/test-batch/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/providers/validate/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/proxy-pools/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/settings/database/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/settings/proxy-test/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/settings/require-login/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/settings/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/shutdown/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/tags/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/translator/console-logs/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/translator/load/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/translator/save/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/translator/send/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/translator/translate/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/disable/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/enable/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/status/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/usage/[connectionId]/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/usage/chart/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/usage/history/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/usage/providers/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/usage/request-details/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/usage/request-logs/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/usage/stats/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/usage/stream/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/api/chat/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/audio/speech/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/audio/voices/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/chat/completions/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/embeddings/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/images/generations/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/messages/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/models/[kind]/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/models/info/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/models/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/responses/compact/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/responses/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/search/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1/web/fetch/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/v1beta/models/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/version/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/version/shutdown/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/api/version/update/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/layout-c47481f46f5ae72b.js +0 -1
- package/app/.next/static/chunks/app/manifest.webmanifest/route-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/app/page-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-5ea305bd1a1dc348.js +0 -1
- package/app/.next/static/css/8c050f20c62e3425.css +0 -1
- package/app/.next/static/zRbzYKfSwZoKLIJvdVXO-/_buildManifest.js +0 -1
- /package/app/.next/static/{zRbzYKfSwZoKLIJvdVXO- → pAkL-eAklQyioXImGSk6m}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5810],{45727: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"]}}},51141:(e,t,s)=>{s.d(t,{Tk:()=>y,aG:()=>$,Ah:()=>b,h1:()=>O,Q6:()=>M,a7:()=>_,ZM:()=>N,RF:()=>k,c9:()=>P,gY:()=>D,tA:()=>R,kn:()=>U,yZ:()=>v,qO:()=>S});var l=s(73365),a=s(1521),r=s(74156),i=s(58872),n=s(43202);let o="9router.cliToolEndpointPresets",d="__custom__",c="__save__",m=e=>{window.localStorage.setItem(o,JSON.stringify(e))};function x({value:e,onChange:t,requiresExternalUrl:s=!1,tunnelEnabled:r=!1,tunnelPublicUrl:i="",tailscaleEnabled:p=!1,tailscaleUrl:u="",cloudEnabled:h=!1,cloudUrl:g="",withV1:f=!0}){let[y,b]=(0,a.useState)([]),[j,N]=(0,a.useState)(""),[v,w]=(0,a.useState)(""),k=(0,a.useRef)(!1);(0,a.useEffect)(()=>{b((()=>{try{let e=JSON.parse(window.localStorage.getItem(o)||"[]");if(!Array.isArray(e))return[];return e.filter(e=>e?.name&&e?.baseUrl)}catch{return[]}})())},[]);let C=(0,a.useMemo)(()=>(({requiresExternalUrl:e,tunnelEnabled:t,tunnelPublicUrl:s,tailscaleEnabled:l,tailscaleUrl:a,cloudEnabled:r,cloudUrl:i,savedPresets:o,withV1:c})=>{let m=[],x=e=>{let t;return c?(t=(e||"").replace(/\/+$/,""))?/\/v1$/.test(t)?t:`${t}/v1`:"":(e||"").replace(/\/+$/,"")};if(!e){let e=x(`http://127.0.0.1:${n.h0.appPort}`);m.push({value:"local",label:e,url:e})}if(t&&s){let e=x(s);m.push({value:"tunnel",label:e,url:e})}if(l&&a){let e=x(a);m.push({value:"tailscale",label:e,url:e})}if(r&&i){let e=x(i);m.push({value:"cloud",label:e,url:e})}return o.forEach(e=>{m.push({value:`saved:${e.name}`,label:e.baseUrl,url:e.baseUrl,saved:!0})}),m.push({value:d,label:"Custom URL...",url:""}),m})({requiresExternalUrl:s,tunnelEnabled:r,tunnelPublicUrl:i,tailscaleEnabled:p,tailscaleUrl:u,cloudEnabled:h,cloudUrl:g,savedPresets:y,withV1:f}),[s,r,i,p,u,h,g,y,f]);(0,a.useEffect)(()=>{if(k.current||0===C.length)return;k.current=!0;let e=C.find(e=>e.value!==d);e?(N(e.value),t(e.url)):N(d)},[C,t]);let _=j.startsWith("saved:"),S=j===d,E=S&&(v||"").trim().length>0;return(0,l.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("select",{value:j,onChange:s=>{let l=s.target.value;if(l===c){let t=(e||"").trim();if(!t)return;let s=t;try{s=new URL(t).host}catch{}let l=window.prompt("Save endpoint as:",s);if(!l?.trim())return;let a=[...y.filter(e=>e.name!==l.trim()),{name:l.trim(),baseUrl:t}].sort((e,t)=>e.name.localeCompare(t.name));b(a),m(a);return}if(N(l),l===d){w(""),t("");return}let a=C.find(e=>e.value===l);a&&t(a.url)},className:"flex-1 min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[C.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value)),E&&(0,l.jsx)("option",{value:c,children:"+ Save current as..."})]}),_&&(0,l.jsx)("button",{type:"button",onClick:()=>{if(!j.startsWith("saved:"))return;let e=j.slice(6),s=y.filter(t=>t.name!==e);b(s),m(s),N(d),w(""),t("")},className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors shrink-0",title:"Delete saved endpoint",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]}),S&&(0,l.jsx)("input",{type:"text",value:v,onChange:e=>{let s=e.target.value;w(s),t(s)},placeholder:f?"https://example.com/v1":"https://example.com",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"})]})}let p="__custom__";function u({value:e,onChange:t,apiKeys:s=[],cloudEnabled:r=!1,className:i=""}){let n=!s.some(t=>t.key===e)&&""!==e,[o,d]=(0,a.useState)(()=>e?s.some(t=>t.key===e)?e:p:s.length>0?s[0].key:p),[c,m]=(0,a.useState)(n?e:"");return 0===s.length&&o!==p&&o!==p?(0,l.jsx)("span",{className:`min-w-0 rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5 ${i}`,children:r?"No API keys - Create one in Keys page":"sk_9router (default)"}):(0,l.jsxs)("div",{className:`flex flex-col gap-1.5 ${i}`,children:[(0,l.jsxs)("select",{value:o,onChange:e=>{let s=e.target.value;d(s),s===p?(m(""),t("")):t(s)},className:"w-full min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[s.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id)),(0,l.jsx)("option",{value:p,children:"Custom..."})]}),o===p&&(0,l.jsx)("input",{type:"text",value:c,onChange:e=>{let s=e.target.value;m(s),t(s)},placeholder:"sk-...",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"})]})}let h=e=>(e||"").replace(/\/+$/,"");function g(e,t={}){if(!e)return!1;let s=h(e),{tunnelPublicUrl:l,tailscaleUrl:a,cloudUrl:r}=t;return!!(/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(s)||l&&s.startsWith(h(l))||a&&s.startsWith(h(a))||r&&s.startsWith(h(r)))}let f=s(89651).env.NEXT_PUBLIC_CLOUD_URL;function y({tool:e,isExpanded:t,onToggle:s,activeProviders:n,modelMappings:o,onModelMappingChange:d,baseUrl:c,hasActiveProviders:m,apiKeys:p,cloudEnabled:h,initialStatus:b,tunnelEnabled:j,tunnelPublicUrl:N,tailscaleEnabled:v,tailscaleUrl:w}){let k,C,_,[S,E]=(0,a.useState)(b||null),[A,M]=(0,a.useState)(!1),[O,$]=(0,a.useState)(!1),[P,I]=(0,a.useState)(!1),[R,T]=(0,a.useState)(null),[U,z]=(0,a.useState)(!1),[K,D]=(0,a.useState)(!1),[F,L]=(0,a.useState)(null),[H,q]=(0,a.useState)(""),[B,J]=(0,a.useState)({}),[W,G]=(0,a.useState)(!1),[Y,Z]=(0,a.useState)(""),[V,Q]=(0,a.useState)(!1),X=(0,a.useRef)(!1),ee=(()=>{if(!S?.installed)return null;let e=S.settings?.env?.ANTHROPIC_BASE_URL;return e?g(e,{tunnelPublicUrl:N,tailscaleUrl:w,cloudUrl:h?f:null})?"configured":"other":"not_configured"})();(0,a.useEffect)(()=>{p?.length>0&&!H&&q(p[0].key)},[p,H]),(0,a.useEffect)(()=>{b&&E(b)},[b]),(0,a.useEffect)(()=>{t&&!S&&(el(),es()),t&&es()},[t]),(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{Q(!!e.ccFilterNaming)}).catch(()=>{})},[]);let et=async e=>{let t=e.target.checked;Q(t),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:t})}).catch(()=>{})},es=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&J(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(S?.installed&&!X.current){X.current=!0;let t=S.settings?.env||{};e.defaultModels.forEach(e=>{if(e.envKey){let s=t[e.envKey]||e.defaultValue||"";s&&d(e.alias,s)}});let s=t.ANTHROPIC_AUTH_TOKEN;s&&p?.some(e=>e.key===s)&&q(s)}},[S,p,e.defaultModels,d]);let el=async()=>{M(!0);try{let e=await fetch("/api/cli-tools/claude-settings"),t=await e.json();E(t)}catch(e){E({installed:!1,error:e.message})}finally{M(!1)}},ea=()=>{let e=Y||c;return e.endsWith("/v1")?e:`${e}/v1`},er=async()=>{$(!0),T(null);try{let t={ANTHROPIC_BASE_URL:ea()},s=H?.trim()||(p?.length>0?p[0].key:null)||(h?null:"sk_9router");s&&(t.ANTHROPIC_AUTH_TOKEN=s),e.defaultModels.forEach(e=>{let s=o[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?(T({type:"success",text:"Settings applied successfully!"}),E(e=>({...e,hasBackup:!0,settings:{...e?.settings,env:t}}))):T({type:"error",text:a.error||"Failed to apply settings"})}catch(e){T({type:"error",text:e.message})}finally{$(!1)}},ei=async()=>{I(!0),T(null);try{let t=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),s=await t.json();t.ok?(T({type:"success",text:"Settings reset successfully!"}),e.defaultModels.forEach(e=>d(e.alias,e.defaultValue||"")),q("")):T({type:"error",text:s.error||"Failed to reset settings"})}catch(e){T({type:"error",text:e.message})}finally{I(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.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 min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===ee&&(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"===ee&&(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"===ee&&(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:[A&&(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..."})]}),!A&&S&&!S.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 9router 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:()=>G(!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"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>z(!U),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:U?"expand_less":"help"}),U?"Hide":"How to Install"]})]})]}),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:"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."]})]})]})]}),!A&&S?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(x,{value:Y||((k=Y||c).endsWith("/v1")?k:`${k}/v1`),onChange:Z,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:j,tunnelPublicUrl:N,tailscaleEnabled:v,tailscaleUrl:w})]}),S?.settings?.env?.ANTHROPIC_BASE_URL&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:S.settings.env.ANTHROPIC_BASE_URL})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(u,{value:H,onChange:q,apiKeys:p,cloudEnabled:h})]}),e.defaultModels.map(e=>(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:e.name}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:o[e.alias]||"",onChange:t=>d(e.alias,t.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),o[e.alias]&&(0,l.jsx)("button",{onClick:()=>d(e.alias,""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>{L(e.alias),D(!0)},disabled:!m,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${m?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]},e.alias)),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Filter naming"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",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:V,onChange:et,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"})})]})]}),R&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===R.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"===R.type?"check_circle":"error"}),(0,l.jsx)("span",{children:R.text})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:er,disabled:!m,loading:O,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:ei,disabled:!S?.has9Router,loading:P,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:()=>G(!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:K,onClose:()=>D(!1),onSelect:e=>{F&&d(F,e.value)},selectedModel:F?o[F]:null,activeProviders:n,modelAliases:B,title:`Select model for ${F}`}),(0,l.jsx)(r.uR,{isOpen:W,onClose:()=>G(!1),title:"Claude CLI - Manual Configuration",configs:(C=H&&H.trim()?H:h?"<API_KEY_FROM_DASHBOARD>":"sk_9router",_={ANTHROPIC_BASE_URL:ea(),ANTHROPIC_AUTH_TOKEN:C},e.defaultModels.forEach(e=>{let t=o[e.alias];t&&e.envKey&&(_[e.envKey]=t)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:_},null,2)}])})]})}function b({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:p,tunnelPublicUrl:h,tailscaleEnabled:f,tailscaleUrl:y}){let j,N,v,w,[k,C]=(0,a.useState)(m||null),[_,S]=(0,a.useState)(!1),[E,A]=(0,a.useState)(!1),[M,O]=(0,a.useState)(!1),[$,P]=(0,a.useState)(null),[I,R]=(0,a.useState)(!1),[T,U]=(0,a.useState)(""),[z,K]=(0,a.useState)(""),[D,F]=(0,a.useState)(""),[L,H]=(0,a.useState)(!1),[q,B]=(0,a.useState)(!1),[J,W]=(0,a.useState)({}),[G,Y]=(0,a.useState)(!1),[Z,V]=(0,a.useState)("");(0,a.useEffect)(()=>{o?.length>0&&!T&&U(o[0].key)},[o,T]),(0,a.useEffect)(()=>{m&&C(m)},[m]),(0,a.useEffect)(()=>{t&&!k&&(et(),Q()),t&&Q()},[t]);let Q=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&W(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(k?.config){let e=k.config.match(/^model\s*=\s*"([^"]+)"/m);e&&K(e[1]);let t=k.config.match(/\[agents\.subagent\]\s*\n\s*model\s*=\s*"([^"]+)"/m);t&&F(t[1])}},[k]);let X=(()=>{if(!k?.installed)return null;if(!k.config)return"not_configured";let e=k.config.match(/base_url\s*=\s*"([^"]+)"/);return g(e?e[1]:"",{tunnelPublicUrl:h,tailscaleUrl:y})?"configured":"other"})(),ee=()=>{let e=Z||`${n}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},et=async()=>{S(!0);try{let e=await fetch("/api/cli-tools/codex-settings"),t=await e.json();C(t)}catch(e){C({installed:!1,error:e.message})}finally{S(!1)}},es=async()=>{A(!0),P(null);try{let e=T&&T.trim()||c?T:"sk_9router",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:D||z})}),s=await t.json();t.ok?(P({type:"success",text:"Settings applied successfully!"}),et()):P({type:"error",text:s.error||"Failed to apply settings"})}catch(e){P({type:"error",text:e.message})}finally{A(!1)}},el=async()=>{O(!0),P(null);try{let e=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),t=await e.json();e.ok?(P({type:"success",text:"Settings reset successfully!"}),K(""),F(""),et()):P({type:"error",text:t.error||"Failed to reset settings"})}catch(e){P({type:"error",text:e.message})}finally{O(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.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 min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===X&&(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"===X&&(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"===X&&(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:[_&&(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..."})]}),!_&&k&&!k.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 9router 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:()=>Y(!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"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>R(!I),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:I?"expand_less":"help"}),I?"Hide":"How to Install"]})]})]}),I&&(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.']})})]})]})]}),!_&&k?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(x,{value:Z||Z||`${n}/v1`,onChange:V,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:h,tailscaleEnabled:f,tailscaleUrl:y})]}),k?.config&&((N=(j=k.config.match(/base_url\s*=\s*"([^"]+)"/))?j[1]:null)?(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:N})]}):null),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(u,{value:T,onChange:U,apiKeys:o,cloudEnabled:c})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:z,onChange:e=>K(e.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),z&&(0,l.jsx)("button",{onClick:()=>K(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>H(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${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.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Subagent Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:D,onChange:e=>F(e.target.value),placeholder:z||"provider/model-id (defaults to main model)",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),D&&(0,l.jsx)("button",{onClick:()=>F(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>B(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${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.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:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:es,disabled:!T&&c&&o.length>0||!z,loading:E,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:M,loading:M,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:()=>Y(!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:L,onClose:()=>H(!1),onSelect:e=>{K(e.value),D||F(e.value),H(!1)},selectedModel:z,activeProviders:d,modelAliases:J,title:"Select Model for Codex"}),(0,l.jsx)(r.rq,{isOpen:q,onClose:()=>B(!1),onSelect:e=>{F(e.value),B(!1)},selectedModel:D,activeProviders:d,modelAliases:J,title:"Select Subagent Model for Codex"}),(0,l.jsx)(r.uR,{isOpen:G,onClose:()=>Y(!1),title:"Codex CLI - Manual Configuration",configs:(v=T&&T.trim()?T:c?"<API_KEY_FROM_DASHBOARD>":"sk_9router",w=D||z,[{filename:"~/.codex/config.toml",content:`# 9Router Configuration for Codex CLI
|
|
2
|
+
model = "${z}"
|
|
3
|
+
model_provider = "9router"
|
|
4
|
+
|
|
5
|
+
[model_providers.9router]
|
|
6
|
+
name = "9Router"
|
|
7
|
+
base_url = "${ee()}"
|
|
8
|
+
wire_api = "responses"
|
|
9
|
+
|
|
10
|
+
[agents.subagent]
|
|
11
|
+
model = "${w}"
|
|
12
|
+
`},{filename:"~/.codex/auth.json",content:JSON.stringify({auth_mode:"apikey",OPENAI_API_KEY:v},null,2)}])})]})}let j=s(89651).env.NEXT_PUBLIC_CLOUD_URL;function N({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:o,apiKeys:d,activeProviders:c,cloudEnabled:m,initialStatus:p,tunnelEnabled:h,tunnelPublicUrl:f,tailscaleEnabled:y,tailscaleUrl:b}){let v,w,k,C,[_,S]=(0,a.useState)(p||null),[E,A]=(0,a.useState)(!1),[M,O]=(0,a.useState)(!1),[$,P]=(0,a.useState)(!1),[I,R]=(0,a.useState)(null),[T,U]=(0,a.useState)(""),[z,K]=(0,a.useState)([]),[D,F]=(0,a.useState)(""),[L,H]=(0,a.useState)(!1),[q,B]=(0,a.useState)({}),[J,W]=(0,a.useState)(!1),[G,Y]=(0,a.useState)(!1),[Z,V]=(0,a.useState)(""),Q=(0,a.useRef)(!1),X=(()=>{if(!_?.installed)return null;let e=_.settings?.customModels?.find(e=>e.id?.startsWith("custom:9Router"));return e?g(e.baseUrl,{tunnelPublicUrl:f,tailscaleUrl:b,cloudUrl:m?j:null})?"configured":"other":"not_configured"})();(0,a.useEffect)(()=>{d?.length>0&&!T&&U(d[0].key)},[d,T]),(0,a.useEffect)(()=>{p&&S(p)},[p]),(0,a.useEffect)(()=>{t&&!_&&(et(),ee()),t&&ee()},[t]);let ee=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&B(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(_?.installed&&!Q.current){Q.current=!0;let e=(_.settings?.customModels||[]).filter(e=>e.id?.startsWith("custom:9Router")).sort((e,t)=>(e.index||0)-(t.index||0)).map(e=>e.model);if(e.length>0)K(e);else{let e=_.settings?.customModels?.find(e=>"custom:9Router-0"===e.id);e?.model&&K([e.model])}}},[_]);let et=async()=>{A(!0);try{let e=await fetch("/api/cli-tools/droid-settings"),t=await e.json();S(t)}catch(e){S({installed:!1,error:e.message})}finally{A(!1)}},es=()=>{let e=Z||n;return e.endsWith("/v1")?e:`${e}/v1`},el=()=>{let e=D.trim();!e||z.includes(e)||(K(t=>[...t,e]),F(""))},ea=async()=>{O(!0),R(null);try{let e=T?.trim()||(d?.length>0?d[0].key:null)||(m?null:"sk_9router"),t=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:es(),apiKey:e,models:z,activeModel:z[0]||""})}),s=await t.json();t.ok?(R({type:"success",text:"Settings applied successfully!"}),et()):R({type:"error",text:s.error||"Failed to apply settings"})}catch(e){R({type:"error",text:e.message})}finally{O(!1)}},er=async()=>{P(!0),R(null);try{let e=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),t=await e.json();e.ok?(R({type:"success",text:"Settings reset successfully!"}),K([]),et()):R({type:"error",text:t.error||"Failed to reset settings"})}catch(e){R({type:"error",text:e.message})}finally{P(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.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 min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===X&&(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"===X&&(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"===X&&(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:[E&&(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..."})]}),!E&&_&&!_.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 9router 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:()=>W(!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"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>Y(!G),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:G?"expand_less":"help"}),G?"Hide":"How to Install"]})]})]}),G&&(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."]})]})]})]}),!E&&_?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(x,{value:Z||((v=Z||n).endsWith("/v1")?v:`${v}/v1`),onChange:V,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:h,tunnelPublicUrl:f,tailscaleEnabled:y,tailscaleUrl:b})]}),_?.settings?.customModels?.find(e=>e.id?.startsWith("custom:9Router"))?.baseUrl&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:_.settings.customModels.find(e=>e.id?.startsWith("custom:9Router")).baseUrl})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(u,{value:T,onChange:U,apiKeys:d,cloudEnabled:m})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsxs)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:["Models ",z.length>0&&(0,l.jsxs)("span",{className:"text-primary",children:["(",z.length,")"]})]}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"flex-1 flex flex-col gap-1",children:[z.length>0&&(0,l.jsx)("div",{className:"flex flex-col gap-0.5 mb-1",children:z.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:()=>K(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:D,onChange:e=>F(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),el())},placeholder:"provider/model-id",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),(0,l.jsx)("button",{onClick:()=>H(!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:el,disabled:!D.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"})})]})]})]})]}),I&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===I.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"===I.type?"check_circle":"error"}),(0,l.jsx)("span",{children:I.text})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ea,disabled:0===z.length,loading:M,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:er,disabled:!_?.has9Router,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:()=>W(!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:L,onClose:()=>H(!1),onSelect:e=>{!e.value||z.includes(e.value)||(K(t=>[...t,e.value]),H(!1))},selectedModel:null,activeProviders:c,modelAliases:q,title:"Select Model for Factory Droid"}),(0,l.jsx)(r.uR,{isOpen:J,onClose:()=>W(!1),title:"Factory Droid - Manual Configuration",configs:(w=T&&T.trim()?T:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",k={customModels:z.map((e,t)=>({model:e,id:`custom:9Router-${t}`,index:t,baseUrl:es(),apiKey:w,displayName:e,maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}))},C="u">typeof navigator&&navigator.platform,[{filename:C?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(k,null,2)}])})]})}function v({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:o,apiKeys:d,activeProviders:c,cloudEnabled:m,initialStatus:p,tunnelEnabled:h,tunnelPublicUrl:f,tailscaleEnabled:y,tailscaleUrl:b}){let j,N,[w,k]=(0,a.useState)(p||null),[C,_]=(0,a.useState)(!1),[S,E]=(0,a.useState)(!1),[A,M]=(0,a.useState)(!1),[O,$]=(0,a.useState)(null),[P,I]=(0,a.useState)(""),[R,T]=(0,a.useState)(""),[U,z]=(0,a.useState)({}),[K,D]=(0,a.useState)(null),[F,L]=(0,a.useState)(!1),[H,q]=(0,a.useState)({}),[B,J]=(0,a.useState)(!1),[W,G]=(0,a.useState)(""),Y=(0,a.useRef)(!1),Z=(()=>{if(!w?.installed)return null;let e=w.settings?.models?.providers?.["9router"];return e?g(e.baseUrl,{tunnelPublicUrl:f,tailscaleUrl:b})?"configured":"other":"not_configured"})();(0,a.useEffect)(()=>{d?.length>0&&!P&&I(d[0].key)},[d,P]),(0,a.useEffect)(()=>{p&&k(p)},[p]),(0,a.useEffect)(()=>{t&&!w&&(Q(),V()),t&&V()},[t]);let V=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&q(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(w?.installed&&!Y.current){Y.current=!0;let e=w.settings?.models?.providers?.["9router"];if(e){let t=w.settings?.agents?.defaults?.model?.primary;t&&T(t.replace("9router/","")),e.apiKey&&d?.some(t=>t.key===e.apiKey)&&I(e.apiKey)}let t=w.agents||[],s={};t.forEach(e=>{e.currentModel&&(s[e.id]=e.currentModel)}),z(s)}},[w,d]);let Q=async()=>{_(!0);try{let e=await fetch("/api/cli-tools/openclaw-settings"),t=await e.json();k(t)}catch(e){k({installed:!1,error:e.message})}finally{_(!1)}},X=()=>window.location.origin.replace("://localhost","://127.0.0.1"),ee=()=>{let e=W||X();return e.endsWith("/v1")?e:`${e}/v1`},et=async()=>{E(!0),$(null);try{let e=P?.trim()||(d?.length>0?d[0].key:null)||(m?null:"sk_9router"),t=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ee(),apiKey:e,model:R,agentModels:U})}),s=await t.json();t.ok?($({type:"success",text:"Settings applied successfully!"}),Q()):$({type:"error",text:s.error||"Failed to apply settings"})}catch(e){$({type:"error",text:e.message})}finally{E(!1)}},es=async()=>{M(!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!"}),T(""),I(""),Q()):$({type:"error",text:t.error||"Failed to reset settings"})}catch(e){$({type:"error",text:e.message})}finally{M(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.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 min-w-0 flex-wrap 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:[C&&(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..."})]}),!C&&w&&!w.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 9router 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:()=>J(!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"]})})]})}),!C&&w?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(x,{value:W||((j=W||X()).endsWith("/v1")?j:`${j}/v1`),onChange:G,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:h,tunnelPublicUrl:f,tailscaleEnabled:y,tailscaleUrl:b})]}),w?.settings?.models?.providers?.["9router"]?.baseUrl&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:w.settings.models.providers["9router"].baseUrl})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(u,{value:P,onChange:I,apiKeys:d,cloudEnabled:m})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Default Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:R,onChange:e=>T(e.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),R&&(0,l.jsx)("button",{onClick:()=>T(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>{D(null),L(!0)},disabled:!o,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${o?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]}),(w.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 hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:U[e.id]||"",onChange:t=>z(s=>({...s,[e.id]:t.target.value})),placeholder:`default (${R||"provider/model-id"})`,className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),U[e.id]&&(0,l.jsx)("button",{onClick:()=>z(t=>({...t,[e.id]:""})),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>{D(e.id),L(!0)},disabled:!o,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${o?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]},e.id))]}),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:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:et,disabled:!R,loading:S,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:!w?.has9Router,loading:A,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:()=>J(!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:()=>L(!1),onSelect:e=>{K?(z(t=>({...t,[K]:e.value})),D(null)):T(e.value),L(!1)},selectedModel:R,activeProviders:c,modelAliases:H,title:"Select Model for Open Claw"}),(0,l.jsx)(r.uR,{isOpen:B,onClose:()=>J(!1),title:"Open Claw - Manual Configuration",configs:(N=P&&P.trim()?P:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`9router/${R||"provider/model-id"}`}}},models:{providers:{"9router":{baseUrl:ee(),apiKey:N,api:"openai-completions",models:[{id:R||"provider/model-id",name:(R||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}let w="/api/cli-tools/hermes-settings";function k({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:o,apiKeys:d,activeProviders:c,cloudEnabled:m,initialStatus:p,tunnelEnabled:h,tunnelPublicUrl:f,tailscaleEnabled:y,tailscaleUrl:b}){let j,[N,v]=(0,a.useState)(p||null),[C,_]=(0,a.useState)(!1),[S,E]=(0,a.useState)(!1),[A,M]=(0,a.useState)(!1),[O,$]=(0,a.useState)(null),[P,I]=(0,a.useState)(""),[R,T]=(0,a.useState)(""),[U,z]=(0,a.useState)(!1),[K,D]=(0,a.useState)({}),[F,L]=(0,a.useState)(!1),[H,q]=(0,a.useState)(""),B=(0,a.useRef)(!1),J=(()=>{if(!N?.installed)return null;let e=N.settings?.model;return e?.base_url?g(e.base_url,{tunnelPublicUrl:f,tailscaleUrl:b})?"configured":"other":"not_configured"})();(0,a.useEffect)(()=>{d?.length>0&&!P&&I(d[0].key)},[d,P]),(0,a.useEffect)(()=>{p&&v(p)},[p]),(0,a.useEffect)(()=>{t&&!N&&(G(),W()),t&&W()},[t]);let W=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&D(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(N?.installed&&!B.current){B.current=!0;let e=N.settings?.model;e?.default&&T(e.default)}},[N]);let G=async()=>{_(!0);try{let e=await fetch(w),t=await e.json();v(t)}catch(e){v({installed:!1,error:e.message})}finally{_(!1)}},Y=()=>{let e=H||window.location.origin.replace("://localhost","://127.0.0.1");return e.endsWith("/v1")?e:`${e}/v1`},Z=async()=>{E(!0),$(null);try{let e=P?.trim()||(d?.length>0?d[0].key:null)||(m?null:"sk_9router"),t=await fetch(w,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:Y(),apiKey:e,model:R})}),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{E(!1)}},V=async()=>{M(!0),$(null);try{let e=await fetch(w,{method:"DELETE"}),t=await e.json();e.ok?($({type:"success",text:"Settings reset successfully!"}),T(""),G()):$({type:"error",text:t.error||"Failed to reset settings"})}catch(e){$({type:"error",text:e.message})}finally{M(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.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 min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===J&&(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"===J&&(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"===J&&(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:[C&&(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..."})]}),!C&&N&&!N.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 flex-col sm:flex-row sm:items-center gap-2 pl-0 sm:pl-9",children:(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>L(!0),className:"w-full sm:w-auto !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"]})})]})}),!C&&N?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(x,{value:H||Y(),onChange:q,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:h,tunnelPublicUrl:f,tailscaleEnabled:y,tailscaleUrl:b})]}),N?.settings?.model?.base_url&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:N.settings.model.base_url})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(u,{value:P,onChange:I,apiKeys:d,cloudEnabled:m})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Default Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:R,onChange:e=>T(e.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),R&&(0,l.jsx)("button",{onClick:()=>T(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>z(!0),disabled:!o,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${o?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]})]}),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 flex-col sm:flex-row sm:items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:Z,disabled:!R,loading:S,className:"w-full sm:w-auto",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:V,disabled:!N?.has9Router,loading:A,className:"w-full sm:w-auto",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),className:"w-full sm:w-auto",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:U,onClose:()=>z(!1),onSelect:e=>{T(e.value),z(!1)},selectedModel:R,activeProviders:c,modelAliases:K,title:"Select Model for Hermes Agent"}),(0,l.jsx)(r.uR,{isOpen:F,onClose:()=>L(!1),title:"Hermes Agent - Manual Configuration",configs:(j=P&&P.trim()?P:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.hermes/config.yaml",content:`model:
|
|
13
|
+
default: "${R||"provider/model-id"}"
|
|
14
|
+
provider: "custom"
|
|
15
|
+
base_url: "${Y()}"
|
|
16
|
+
`},{filename:"~/.hermes/.env",content:`OPENAI_API_KEY=${j}
|
|
17
|
+
`}])})]})}var C=s(96459);function _({toolId:e,tool:t,isExpanded:s,onToggle:n,baseUrl:o,apiKeys:d,activeProviders:c=[],cloudEnabled:m=!1,tunnelEnabled:x=!1}){let[p,h]=(0,a.useState)(null),[g,f]=(0,a.useState)(!1),[y,b]=(0,a.useState)(""),[j,N]=(0,a.useState)(()=>d?.length>0?d[0].key:""),v=e=>{let t=j&&j.trim()?j:m?"your-api-key":"sk_9router",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,y||"provider/model-id")},{copy:w}=(0,C.C)(),k=async(e,t)=>{await w(v(e),`toolcard-${t}`),h(t),setTimeout(()=>h(null),2e3)},S=c.length>0,E=()=>(!t.requiresExternalUrl||!!m||!!x)&&(!t.requiresCloud||!!m);return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden overflow-x-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:n,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)(i.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)(i.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&&(m||x))return null;let s="warning"===e.type,a="cloudCheck"===e.type&&!m&&!x,r="bg-blue-500/10 border-blue-500/30",i="text-blue-600 dark:text-blue-400",n="text-blue-500",o="info";return s?(r="bg-yellow-500/10 border-yellow-500/30",i="text-yellow-600 dark:text-yellow-400",n="text-yellow-500",o="warning"):a&&(r="bg-red-500/10 border-red-500/30",i="text-red-600 dark:text-red-400",n="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 ${n}`,children:o}),(0,l.jsx)("p",{className:`text-sm ${i}`,children:e.text})]},t)})}):null,E()&&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 flex-col sm:flex-row sm:items-center gap-2",children:(0,l.jsx)(u,{value:j,onChange:N,apiKeys:d,cloudEnabled:m,className:"flex-1"})}),"modelSelector"===e.type&&(0,l.jsxs)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,l.jsx)("input",{type:"text",value:y,onChange:e=>b(e.target.value),placeholder:"provider/model-id",className:"w-full sm:w-auto 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:()=>f(!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"}),y&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{onClick:()=>k(y,"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:()=>b(""),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 flex-col sm:flex-row sm:items-center gap-2",children:[(0,l.jsx)("code",{className:"w-full sm:w-auto flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:v(e.value)}),e.copyable&&(0,l.jsx)("button",{onClick:()=>k(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)),E()&&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:()=>k(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:v(t.codeBlock.code)})})]})]}):(0,l.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,l.jsx)(r.rq,{isOpen:g,onClose:()=>f(!1),onSelect:e=>{b(e.value)},selectedModel:y,activeProviders:c,title:"Select Model"})]})}function S({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:p,tunnelPublicUrl:h,tailscaleEnabled:f,tailscaleUrl:y}){let b,j,N,v,w,[k,C]=(0,a.useState)(m||null),[_,E]=(0,a.useState)(!1),[A,M]=(0,a.useState)(!1),[O,$]=(0,a.useState)(!1),[P,I]=(0,a.useState)(null),[R,T]=(0,a.useState)(!1),[U,z]=(0,a.useState)(""),[K,D]=(0,a.useState)(""),[F,L]=(0,a.useState)(""),[H,q]=(0,a.useState)(!1),[B,J]=(0,a.useState)(!1),[W,G]=(0,a.useState)({}),[Y,Z]=(0,a.useState)(!1),[V,Q]=(0,a.useState)(""),[X,ee]=(0,a.useState)([]),[et,es]=(0,a.useState)("");(0,a.useEffect)(()=>{o?.length>0&&!U&&z(o[0].key)},[o,U]),(0,a.useEffect)(()=>{m&&C(m)},[m]),(0,a.useEffect)(()=>{t&&!k&&(ei(),el()),t&&el()},[t]),(0,a.useEffect)(()=>{k?.opencode?.models&&ee(k.opencode.models),k?.opencode?.activeModel&&es(k.opencode.activeModel),k?.config?.agent?.explorer?.model?.startsWith("9router/")&&L(k.config.agent.explorer.model.replace("9router/",""))},[k]);let el=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&G(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},ea=k?.installed?k.config&&k.has9Router?g(k.config?.provider?.["9router"]?.options?.baseURL||"",{tunnelPublicUrl:h,tailscaleUrl:y})?"configured":"other":"not_configured":null,er=()=>{let e=V||n;return e.endsWith("/v1")?e:`${e}/v1`},ei=async()=>{E(!0);try{let e=await fetch("/api/cli-tools/opencode-settings"),t=await e.json();C(t)}catch(e){C({installed:!1,error:e.message})}finally{E(!1)}},en=async()=>{M(!0),I(null);try{let e=U&&U.trim()||c?U:"sk_9router",t=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:er(),apiKey:e,models:X,activeModel:""===et?"":et||X[0],subagentModel:F})}),s=await t.json();t.ok?(I({type:"success",text:"Settings applied successfully!"}),ei()):I({type:"error",text:s.error||"Failed to apply settings"})}catch(e){I({type:"error",text:e.message})}finally{M(!1)}},eo=async()=>{$(!0),I(null);try{let e=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),t=await e.json();e.ok?(I({type:"success",text:"Settings reset successfully!"}),D(""),L(""),ee([]),es(""),ei()):I({type:"error",text:t.error||"Failed to reset settings"})}catch(e){I({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-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.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 min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===ea&&(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"===ea&&(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"===ea&&(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:[_&&(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..."})]}),!_&&k&&!k.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 9router 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:()=>Z(!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"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>T(!R),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:R?"expand_less":"help"}),R?"Hide":"How to Install"]})]})]}),R&&(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."]})]})]})]}),!_&&k?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(x,{value:V||V||`${n}/v1`,onChange:Q,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:h,tailscaleEnabled:f,tailscaleUrl:y})]}),k?.config?.provider?.["9router"]?.options?.baseURL&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:k.config.provider["9router"].options.baseURL})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(u,{value:U,onChange:z,apiKeys:o,cloudEnabled:c})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm: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===X.length?(0,l.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):X.map(e=>(0,l.jsxs)("span",{onClick:async()=>{if(e===et)try{(await fetch("/api/cli-tools/opencode-settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({clearActiveModel:!0})})).ok&&(es(""),ei())}catch(e){console.log("Error clearing active model:",e)}else es(e)},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs cursor-pointer transition-colors ${e===et?"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===et?"Click to clear active model":"Click to set as active",children:[e===et&&(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=X.filter(t=>t!==e);ee(t),et===e&&es(""),ei()}}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:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("button",{onClick:()=>q(!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:"Add Model"}),(0,l.jsx)("span",{className:"text-xs text-text-muted",children:X.length>0&&et?(0,l.jsxs)(l.Fragment,{children:["Active: ",(0,l.jsx)("span",{className:"text-primary",children:et})]}):X.length>0?(0,l.jsx)("span",{className:"text-yellow-500",children:"Click a model to set/clear active"}):"Select models to add"})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Subagent Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:F,onChange:e=>L(e.target.value),placeholder:K||"provider/model-id (defaults to main model)",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),(0,l.jsx)("button",{onClick:()=>J(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),F&&(0,l.jsx)("button",{onClick:()=>L(""),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"})})]})]}),P&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===P.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"===P.type?"check_circle":"error"}),(0,l.jsx)("span",{children:P.text})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:en,disabled:0===X.length,loading:A,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:eo,disabled:!k.has9Router,loading:O,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:()=>Z(!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:H,onClose:()=>q(!1),onSelect:e=>{!X.includes(e.value)&&(ee([...X,e.value]),et||es(e.value)),q(!1)},selectedModel:null,activeProviders:d,modelAliases:W,title:"Add Model for OpenCode"}),(0,l.jsx)(r.rq,{isOpen:B,onClose:()=>J(!1),onSelect:e=>{L(e.value),J(!1)},selectedModel:F,activeProviders:d,modelAliases:W,title:"Select Subagent Model for OpenCode"}),(0,l.jsx)(r.uR,{isOpen:Y,onClose:()=>Z(!1),title:"OpenCode - Manual Configuration",configs:(b=U&&U.trim()?U:c?"<API_KEY_FROM_DASHBOARD>":"sk_9router",j=X.length>0?X:["provider/model-id"],N=et||X[0]||j[0],v=F||N,w={},j.forEach(e=>{w[e]={name:e}}),[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{"9router":{npm:"@ai-sdk/openai-compatible",options:{baseURL:er(),apiKey:b},models:w}},model:`9router/${N}`,agent:{explorer:{description:"Fast explorer subagent for codebase exploration",mode:"subagent",model:`9router/${v}`}}},null,2)}])})]})}let E="/api/cli-tools/cowork-settings",A=e=>(e||"").replace(/\/v1\/?$/,"");function M({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,hasActiveProviders:c,cloudEnabled:m,cloudUrl:p,tunnelEnabled:h,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y,initialStatus:b}){let j,N,[v,w]=(0,a.useState)(b||null),[k,C]=(0,a.useState)(!1),[_,S]=(0,a.useState)(!1),[O,$]=(0,a.useState)(!1),[P,I]=(0,a.useState)(null),[R,T]=(0,a.useState)(""),[U,z]=(0,a.useState)([]),[K,D]=(0,a.useState)(!1),[F,L]=(0,a.useState)(""),[H,q]=(0,a.useState)([]),[B,J]=(0,a.useState)(!1),[W,G]=(0,a.useState)(!1);(0,a.useEffect)(()=>{o?.length>0&&!R&&T(o[0].key)},[o,R]),(0,a.useEffect)(()=>{b&&w(b)},[b]),(0,a.useEffect)(()=>{t&&!v&&Y()},[t]),(0,a.useEffect)(()=>{v?.cowork?.models?.length&&z(v.cowork.models),v?.cowork?.baseUrl&&!F&&L(A(v.cowork.baseUrl)),Array.isArray(v?.cowork?.plugins)&&v.cowork.plugins.length>0?q(v.cowork.plugins):0===H.length&&Array.isArray(v?.defaultPlugins)&&q(v.defaultPlugins)},[v]);let Y=async()=>{C(!0);try{let e=await fetch(E),t=await e.json();w(t)}catch(e){w({installed:!1,error:e.message})}finally{C(!1)}},Z=()=>{let e;return(e=(F||"").replace(/\/+$/,""))?/\/v1$/.test(e)?e:`${e}/v1`:""},V=v?.installed?v?.cowork?.baseUrl?v.has9Router?"configured":"other":"not_configured":null,Q=async()=>{I(null);let e=Z();if(0===U.length)return void I({type:"error",text:"Please select at least one model"});S(!0);try{let t=R?.trim()||(o?.length>0?o[0].key:null)||(m?null:"sk_9router"),s=await fetch(E,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:e,apiKey:t,models:U,plugins:H})}),l=await s.json();s.ok?(I({type:"success",text:"Settings applied. Quit & reopen Claude Desktop to load."}),Y()):I({type:"error",text:l.error||"Failed to apply settings"})}catch(e){I({type:"error",text:e.message})}finally{S(!1)}},X=async({name:e,models:t})=>{try{let s=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,models:t})});if(!s.ok){let e=await s.json();I({type:"error",text:e.error||"Failed to create combo"});return}U.includes(e)||z([...U,e]),J(!1),I({type:"success",text:`Combo "${e}" created and added.`})}catch(e){I({type:"error",text:e.message})}},ee=async()=>{$(!0),I(null);try{let e=await fetch(E,{method:"DELETE"}),t=await e.json();e.ok?(I({type:"success",text:"Settings reset successfully"}),z([]),q(v?.defaultPlugins||[]),Y()):I({type:"error",text:t.error||"Failed to reset"})}catch(e){I({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-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.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 min-w-0 flex-wrap 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:[k&&(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 Cowork..."})]}),!k&&v&&!v.installed&&(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 Desktop (Cowork mode) not detected"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Open Claude Desktop → Help → Troubleshooting → Enable Developer mode → Configure third-party inference, then return here."})]})]}),(0,l.jsx)("div",{className:"pl-9",children:(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>D(!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"]})})]}),!k&&v?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(x,{value:Z(),onChange:e=>L(A(e)),tunnelEnabled:h,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y,cloudEnabled:m,cloudUrl:p})]}),v?.cowork?.baseUrl&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:v.cowork.baseUrl})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(u,{value:R,onChange:T,apiKeys:o,cloudEnabled:m})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm: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===U.length?(0,l.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):U.map(e=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border",children:[e,(0,l.jsx)("button",{onClick:()=>z(t=>t.filter(t=>t!==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.jsx)("button",{onClick:()=>J(!0),disabled:!c,className:`self-start px-2 py-1 rounded border text-xs transition-colors ${c?"bg-primary/10 border-primary/40 text-primary hover:bg-primary/20 cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"+ Add Combo (claude-)"})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Plugins"}),(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===H.filter(e=>"exa"!==e.name).length?(0,l.jsx)("span",{className:"text-xs text-text-muted",children:"No plugins"}):H.filter(e=>"exa"!==e.name).map(e=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border",children:[e.title||e.name,e.oauth&&(0,l.jsx)("span",{className:"text-[8px] text-amber-600",children:"OAuth"}),(0,l.jsx)("button",{onClick:()=>{var t;return t=e.name,void q(H.filter(e=>e.name!==t))},className:"ml-0.5 hover:text-red-500",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e.name))}),(0,l.jsx)("button",{onClick:()=>G(!0),className:"self-start px-2 py-1 rounded border text-xs bg-primary/10 border-primary/40 text-primary hover:bg-primary/20 cursor-pointer",children:"+ Browse MCP marketplace"}),(0,l.jsxs)("p",{className:"text-[10px] text-text-muted leading-snug",children:["\uD83D\uDCA1 Exa is auto-installed. Prefer ",(0,l.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/5",children:"web_search_exa"})," for web search and ",(0,l.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/5",children:"web_fetch_exa"})," for reading pages."]})]})]})]}),P&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===P.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"===P.type?"check_circle":"error"}),(0,l.jsx)("span",{children:P.text})]}),(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:Q,disabled:0===U.length,loading:_,className:"w-full sm:w-auto",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:ee,disabled:!v.has9Router,loading:O,className:"w-full sm:w-auto",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:()=>D(!0),className:"w-full sm:w-auto",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.uR,{isOpen:K,onClose:()=>D(!1),title:"Claude Cowork - Manual Configuration",configs:(j=R&&R.trim()?R:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",N=U.length>0?U:["provider/model-id"],[{filename:"~/Library/Application Support/Claude-3p/configLibrary/<appliedId>.json",content:JSON.stringify({inferenceProvider:"gateway",inferenceGatewayBaseUrl:Z()||"https://your-public-host/v1",inferenceGatewayApiKey:j,inferenceModels:N.map(e=>({name:e}))},null,2)}])}),(0,l.jsx)(r.CK,{isOpen:B,combo:null,onClose:()=>J(!1),onSave:X,activeProviders:d,forcePrefix:"claude-",title:"Create Cowork Combo"}),(0,l.jsx)(r.Nf,{isOpen:W,onClose:()=>G(!1),onAdd:e=>{H.some(t=>t.name===e.name)||q([...H,e])},addedNames:H.map(e=>e.name)})]})}function O({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:p,tunnelPublicUrl:h,tailscaleEnabled:f,tailscaleUrl:y}){let b,j,[N,v]=(0,a.useState)(m||null),[w,k]=(0,a.useState)(!1),[C,_]=(0,a.useState)(!1),[S,E]=(0,a.useState)(!1),[A,M]=(0,a.useState)(null),[$,P]=(0,a.useState)(""),[I,R]=(0,a.useState)(""),[T,U]=(0,a.useState)({}),[z,K]=(0,a.useState)(!1),[D,F]=(0,a.useState)([]),[L,H]=(0,a.useState)(!1);(0,a.useEffect)(()=>{o?.length>0&&!$&&P(o[0].key)},[o,$]),(0,a.useEffect)(()=>{m&&v(m)},[m]),(0,a.useEffect)(()=>{t&&!N&&(W(),q()),t&&q()},[t]),(0,a.useEffect)(()=>{if(N?.config&&Array.isArray(N.config)&&0===D.length){let e=N.config.find(e=>"9Router"===e.name);e?.models?.length>0&&F(e.models.map(e=>e.id))}},[N]);let q=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)}},B=N?N.has9Router?g(N.currentUrl||"",{tunnelPublicUrl:h,tailscaleUrl:y})?"configured":"other":"not_configured":null,J=()=>{let e=I||n;return e.endsWith("/v1")?e:`${e}/v1`},W=async()=>{k(!0);try{let e=await fetch("/api/cli-tools/copilot-settings"),t=await e.json();v(t)}catch(e){v({error:e.message})}finally{k(!1)}},G=async()=>{_(!0),M(null);try{let e=$&&$.trim()||c?$:"sk_9router",t=await fetch("/api/cli-tools/copilot-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:J(),apiKey:e,models:D})}),s=await t.json();t.ok?(M({type:"success",text:s.message||"Settings applied! Reload VS Code."}),W()):M({type:"error",text:s.error||"Failed to apply settings"})}catch(e){M({type:"error",text:e.message})}finally{_(!1)}},Y=async()=>{E(!0),M(null);try{let e=await fetch("/api/cli-tools/copilot-settings",{method:"DELETE"}),t=await e.json();e.ok?(M({type:"success",text:"Settings reset successfully!"}),F([]),W()):M({type:"error",text:t.error||"Failed to reset settings"})}catch(e){M({type:"error",text:e.message})}finally{E(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.default,{src:"/providers/copilot.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 min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===B&&(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"===B&&(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"===B&&(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 Copilot config..."})]}),!w&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"info"}),(0,l.jsxs)("div",{className:"text-xs text-blue-700 dark:text-blue-300",children:[(0,l.jsxs)("p",{className:"font-medium",children:["Writes to ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/10 rounded",children:"chatLanguageModels.json"})]}),(0,l.jsx)("p",{className:"mt-0.5 opacity-80",children:"Reload VS Code after applying for changes to take effect."})]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(x,{value:I||I||`${n}/v1`,onChange:R,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:h,tailscaleEnabled:f,tailscaleUrl:y})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(u,{value:$,onChange:P,apiKeys:o,cloudEnabled:c})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm: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===D.length?(0,l.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):D.map(e=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border",children:[e,(0,l.jsx)("button",{onClick:t=>{t.stopPropagation(),F(t=>t.filter(t=>t!==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.jsx)("div",{children:(0,l.jsx)("button",{onClick:()=>H(!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:"Add Model"})})]})]})]}),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:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:G,disabled:0===D.length,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:Y,disabled:!N?.has9Router,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:()=>K(!0),disabled:0===D.length,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:L,onClose:()=>H(!1),onSelect:e=>{D.includes(e.value)||F([...D,e.value]),H(!1)},selectedModel:null,activeProviders:d,modelAliases:T,title:"Add Model for GitHub Copilot"}),(0,l.jsx)(r.uR,{isOpen:z,onClose:()=>K(!1),title:"GitHub Copilot - Manual Configuration",configs:(b=$&&$.trim()?$:c?"<API_KEY_FROM_DASHBOARD>":"sk_9router",j=J(),[{filename:"~/Library/Application Support/Code/User/chatLanguageModels.json",content:JSON.stringify([{name:"9Router",vendor:"azure",apiKey:b,models:(D.length>0?D:["provider/model-id"]).map(e=>({id:e,name:e,url:`${j}/chat/completions#models.ai.azure.com`,toolCalling:!0,vision:!1,maxInputTokens:128e3,maxOutputTokens:16e3}))}],null,2)}])})]})}function $({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:p,tunnelPublicUrl:h,tailscaleEnabled:f,tailscaleUrl:y}){let b,j,[N,v]=(0,a.useState)(m||null),[w,k]=(0,a.useState)(!1),[C,_]=(0,a.useState)(!1),[S,E]=(0,a.useState)(!1),[A,M]=(0,a.useState)(null),[O,P]=(0,a.useState)(!1),[I,R]=(0,a.useState)(""),[T,U]=(0,a.useState)(""),[z,K]=(0,a.useState)(!1),[D,F]=(0,a.useState)({}),[L,H]=(0,a.useState)(!1),[q,B]=(0,a.useState)("");(0,a.useEffect)(()=>{o?.length>0&&!I&&R(o[0].key)},[o,I]),(0,a.useEffect)(()=>{m&&v(m)},[m]),(0,a.useEffect)(()=>{t&&!N&&(Y(),J()),t&&J()},[t]),(0,a.useEffect)(()=>{N?.settings?.openAiModelId&&U(N.settings.openAiModelId)},[N]);let J=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&F(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},W=N?.installed?N.has9Router?g(N.settings?.openAiBaseUrl||"",{tunnelPublicUrl:h,tailscaleUrl:y})?"configured":"other":"not_configured":null,G=()=>{let e=q||`${n}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},Y=async()=>{k(!0);try{let e=await fetch("/api/cli-tools/cline-settings"),t=await e.json();v(t)}catch(e){v({installed:!1,error:e.message})}finally{k(!1)}},Z=async()=>{_(!0),M(null);try{let e=I&&I.trim()||c?I:"sk_9router",t=await fetch("/api/cli-tools/cline-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:G(),apiKey:e,model:T})}),s=await t.json();t.ok?(M({type:"success",text:"Settings applied successfully!"}),Y()):M({type:"error",text:s.error||"Failed to apply settings"})}catch(e){M({type:"error",text:e.message})}finally{_(!1)}},V=async()=>{E(!0),M(null);try{let e=await fetch("/api/cli-tools/cline-settings",{method:"DELETE"}),t=await e.json();e.ok?(M({type:"success",text:"Settings reset successfully!"}),U(""),Y()):M({type:"error",text:t.error||"Failed to reset settings"})}catch(e){M({type:"error",text:e.message})}finally{E(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.default,{src:"/providers/cline.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 min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===W&&(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"===W&&(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"===W&&(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 Cline..."})]}),!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:"Cline not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router 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"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>P(!O),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:O?"expand_less":"help"}),O?"Hide":"How to Install"]})]})]}),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.jsx)("div",{className:"space-y-3 text-sm",children:(0,l.jsxs)("p",{className:"text-text-muted",children:["Install Cline VS Code extension or CLI from ",(0,l.jsx)("a",{className:"text-primary underline",href:"https://docs.cline.bot/",target:"_blank",rel:"noreferrer",children:"docs.cline.bot"}),"."]})})]})]}),!w&&N?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(x,{value:q||q||`${n}/v1`,onChange:B,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:h,tailscaleEnabled:f,tailscaleUrl:y})]}),N?.settings?.openAiBaseUrl&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:N.settings.openAiBaseUrl})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(u,{value:I,onChange:R,apiKeys:o,cloudEnabled:c})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:T,onChange:e=>U(e.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),T&&(0,l.jsx)("button",{onClick:()=>U(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>K(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),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:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:Z,disabled:!I&&c&&o.length>0||!T,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:V,disabled:S,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:()=>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:z,onClose:()=>K(!1),onSelect:e=>{U(e.value),K(!1)},selectedModel:T,activeProviders:d,modelAliases:D,title:"Select Model for Cline"}),(0,l.jsx)(r.uR,{isOpen:L,onClose:()=>H(!1),title:"Cline - Manual Configuration",configs:(b=I&&I.trim()?I:c?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.cline/data/globalState.json",content:JSON.stringify({actModeApiProvider:"openai",planModeApiProvider:"openai",openAiBaseUrl:(j=G()).endsWith("/v1")?j.slice(0,-3):j,openAiModelId:T||"provider/model-id",planModeOpenAiModelId:T||"provider/model-id"},null,2)},{filename:"~/.cline/data/secrets.json",content:JSON.stringify({openAiApiKey:b},null,2)}])})]})}function P({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:p,tunnelPublicUrl:h,tailscaleEnabled:g,tailscaleUrl:f}){let[y,b]=(0,a.useState)(m||null),[j,N]=(0,a.useState)(!1),[v,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(!1),[_,S]=(0,a.useState)(null),[E,A]=(0,a.useState)(!1),[M,O]=(0,a.useState)(""),[$,I]=(0,a.useState)(""),[R,T]=(0,a.useState)(!1),[U,z]=(0,a.useState)({}),[K,D]=(0,a.useState)(!1),[F,L]=(0,a.useState)("");(0,a.useEffect)(()=>{o?.length>0&&!M&&O(o[0].key)},[o,M]),(0,a.useEffect)(()=>{m&&b(m)},[m]),(0,a.useEffect)(()=>{t&&!y&&(J(),H()),t&&H()},[t]);let H=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)}},q=y?.installed?y.has9Router?"configured":"not_configured":null,B=()=>{let e=F||`${n}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},J=async()=>{N(!0);try{let e=await fetch("/api/cli-tools/kilo-settings"),t=await e.json();b(t)}catch(e){b({installed:!1,error:e.message})}finally{N(!1)}},W=async()=>{w(!0),S(null);try{let e=M&&M.trim()||c?M:"sk_9router",t=await fetch("/api/cli-tools/kilo-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:B(),apiKey:e,model:$})}),s=await t.json();t.ok?(S({type:"success",text:"Settings applied successfully!"}),J()):S({type:"error",text:s.error||"Failed to apply settings"})}catch(e){S({type:"error",text:e.message})}finally{w(!1)}},G=async()=>{C(!0),S(null);try{let e=await fetch("/api/cli-tools/kilo-settings",{method:"DELETE"}),t=await e.json();e.ok?(S({type:"success",text:"Settings reset successfully!"}),I(""),J()):S({type:"error",text:t.error||"Failed to reset settings"})}catch(e){S({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-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.default,{src:"/providers/kilocode.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 min-w-0 flex-wrap 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"})]}),(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 Kilo Code..."})]}),!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:"Kilo Code not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router 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:()=>D(!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"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>A(!E),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:E?"expand_less":"help"}),E?"Hide":"How to Install"]})]})]}),E&&(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)("p",{className:"text-sm text-text-muted",children:["Install Kilo Code from ",(0,l.jsx)("a",{className:"text-primary underline",href:"https://kilocode.ai",target:"_blank",rel:"noreferrer",children:"kilocode.ai"})," or VS Code extension marketplace."]})]})]}),!j&&y?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(x,{value:F||F||`${n}/v1`,onChange:L,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:h,tailscaleEnabled:g,tailscaleUrl:f})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(u,{value:M,onChange:O,apiKeys:o,cloudEnabled:c})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:$,onChange:e=>I(e.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),$&&(0,l.jsx)("button",{onClick:()=>I(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>T(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${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.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:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:W,disabled:!M&&c&&o.length>0||!$,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:G,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:()=>D(!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=>{I(e.value),T(!1)},selectedModel:$,activeProviders:d,modelAliases:U,title:"Select Model for Kilo Code"}),(0,l.jsx)(r.uR,{isOpen:K,onClose:()=>D(!1),title:"Kilo Code - Manual Configuration",configs:[{filename:"~/.local/share/kilo/auth.json",content:JSON.stringify({"openai-compatible":{type:"api-key",apiKey:M&&M.trim()?M:c?"<API_KEY_FROM_DASHBOARD>":"sk_9router",baseUrl:B(),model:$||"provider/model-id"}},null,2)}]})]})}let I="http://localhost:20128";function R({apiKeys:e,cloudEnabled:t,onStatusChange:s}){let[i,n]=(0,a.useState)(null),[o,d]=(0,a.useState)(!1),[c,m]=(0,a.useState)(!1),[x,p]=(0,a.useState)(""),[u,h]=(0,a.useState)(()=>e?.[0]?.key||""),[g,f]=(0,a.useState)(null),[y,b]=(0,a.useState)(null),[j,N]=(0,a.useState)(null),[v,w]=(0,a.useState)(I),[k,C]=(0,a.useState)(null),_=i?.isWin===!0,S=_||i?.hasCachedPassword||i?.needsSudoPassword===!1,E=i?.isAdmin!==!1;!E&&(_||i?.hasCachedPassword||i?.needsSudoPassword);let A=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm");if(e.ok){let t=await e.json();n(t),t.mitmRouterBaseUrl&&w(t.mitmRouterBaseUrl),s?.(t)}}catch{n({running:!1,certExists:!1,dnsStatus:{}})}},[s]);(0,a.useEffect)(()=>{queueMicrotask(()=>{A()})},[A]);let M=e=>{N(null),i&&(S?O(e,""):(f(e),m(!0),b(null)))},O=async(s,l,a=!1)=>{d(!0),N(null);try{let r;if("trust-cert"===s)r=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_9router");r=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:s,sudoPassword:l,mitmRouterBaseUrl:v.trim()||I,forceKillPort443:a})})}else r=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:l})});if(!r.ok){let e=await r.json().catch(()=>({}));if("PORT_443_BUSY"===e.code&&e.portOwner){m(!1),C({owner:e.portOwner,password:l});return}N(e.error||`Failed to ${s} MITM server`);return}m(!1),p(""),C(null),await A()}catch(e){N(e.message||"Network error")}finally{d(!1),f(null)}},$=()=>{x.trim()?O(g,x):b("Sudo password is required")},P=i?.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 flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap 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"}),P?(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 flex-wrap items-center gap-1 text-xs text-text-muted","data-i18n-skip":"true",children:[{label:"Cert",ok:i?.certExists},{label:"Trusted",ok:i?.certTrusted},{label:"Server",ok:P}].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 9Router"]}),(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 → 9Router → response to Antigravity/Copilot"]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"9Router Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:v,onChange:e=>w(e.target.value),placeholder:I,disabled:P,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"})]}),!P&&(0,l.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",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_9router (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 flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center","data-i18n-skip":"true",children:[i?.certExists&&!i?.certTrusted&&(0,l.jsxs)("button",{onClick:()=>M("trust-cert"),disabled:o,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-4 py-2 text-xs font-medium text-yellow-600 transition-colors hover:bg-yellow-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"verified_user"}),"Trust Cert"]}),P?(0,l.jsxs)("button",{onClick:()=>M("stop"),disabled:o,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop Server"]}):(0,l.jsxs)("button",{onClick:()=>M("start"),disabled:o||!i||_&&!E,title:_&&!E?"Administrator required":void 0,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start Server"]}),P&&(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),j&&(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:j})]}),_&&!E&&(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 9Router 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:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,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:x,onChange:e=>p(e.target.value),onKeyDown:e=>{"Enter"!==e.key||o||$()}}),y&&(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:y})]}),(0,l.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,l.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{m(!1),p(""),b(null)},disabled:o,children:"Cancel"}),(0,l.jsx)(r.$n,{variant:"primary",size:"sm",onClick:$,loading:o,children:"Confirm"})]})]})}),k&&(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:"mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,l.jsx)("h3",{className:"font-semibold text-text-main",children:"Port 443 Already In Use"}),(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.jsxs)("div",{className:"flex flex-col gap-1 text-xs text-text-muted",children:[(0,l.jsx)("p",{children:"Port 443 is currently used by another process:"}),(0,l.jsxs)("p",{className:"font-mono text-text-main","data-i18n-skip":"true",children:[k.owner.name," (PID ",k.owner.pid,")"]}),(0,l.jsx)("p",{children:"Kill this process to start MITM Server?"})]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,l.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{C(null),d(!1)},disabled:o,children:"Cancel"}),(0,l.jsx)(r.$n,{variant:"primary",size:"sm",onClick:()=>{O("start",k?.password||"",!0)},loading:o,children:"Kill & Start"})]})]})})]})}var T=s(45727);function U({tool:e,isExpanded:t,onToggle:s,serverRunning:n,dnsActive:o,hasCachedPassword:d,needsSudoPassword:c,isWin:m,apiKeys:x,activeProviders:p,hasActiveProviders:u,modelAliases:h={},cloudEnabled:g,onDnsChange:f}){let[y,b]=(0,a.useState)(!1),[j,N]=(0,a.useState)(null),[v,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(""),[_,S]=(0,a.useState)(null),[E,A]=(0,a.useState)(null),[M,O]=(0,a.useState)({}),[$,P]=(0,a.useState)(!1),[I,R]=(0,a.useState)(null),z=T.TOOL_HOSTS[e.id]??[],K=m||d||!1===c;(0,a.useEffect)(()=>{t&&D()},[t]);let D=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&&O(e.aliases)}}catch{}},F=(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]),L=(e,t)=>{O(s=>({...s,[e]:t}))},H=()=>{if(!n)return;let e=o?"disable":"enable";K?q(e,""):(S(e),w(!0),A(null))},q=async(t,s)=>{b(!0),N(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&&N(`Restart ${e.name} to apply changes`),w(!1),C(""),f?.(a)}catch{}finally{b(!1),S(null)}},B=()=>{k.trim()?q(_,k):A("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-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.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 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),n?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 sm:truncate",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:[z.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:z.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 9Router 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:"grid grid-cols-1 gap-1.5 sm:grid-cols-[9rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right",children:e.name}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:M[e.alias]||"",onChange:t=>L(e.alias,t.target.value),onBlur:t=>{var s,l;return s=e.alias,l=t.target.value,void F({...M,[s]:l})},placeholder:"provider/model-id",disabled:!o,className:`w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5 ${!o?"opacity-50 cursor-not-allowed":""}`}),M[e.alias]&&(0,l.jsx)("button",{onClick:()=>{L(e.alias,""),F({...M,[e.alias]:""})},className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>{R(e.alias),P(!0)},disabled:!u||!o,className:`rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 ${u&&o?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]},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 sm:items-start",children:[o?(0,l.jsxs)("button",{onClick:H,disabled:!n||y,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop DNS"]}):(0,l.jsxs)("button",{onClick:H,disabled:!n||y,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start DNS"]}),j&&(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:j})]})]})]})]}),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:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,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||y||B()}}),E&&(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:E})]}),(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(""),A(null)},disabled:y,children:"Cancel"}),(0,l.jsx)(r.$n,{variant:"primary",size:"sm",onClick:B,loading:y,children:"Confirm"})]})]})}),(0,l.jsx)(r.rq,{isOpen:$,onClose:()=>P(!1),onSelect:e=>{if(!I||e.isPlaceholder)return;let t={...M,[I]:e.value};O(t),F(t)},selectedModel:I?M[I]:null,activeProviders:p,modelAliases:h,title:`Select model for ${I}`})]})}var z=s(99568),K=s.n(z);function D({tool:e}){return(0,l.jsx)(K(),{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)(i.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"})]})})})}},97990:(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"}]}},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 / App",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"},cowork:{id:"cowork",name:"Claude Cowork",image:"/providers/claude.png",color:"#D97757",description:"Claude Desktop Cowork (third-party inference)",configType:"custom"},hermes:{id:"hermes",name:"Hermes Agent",image:"/providers/hermes.png",color:"#8B5CF6",description:"Nous Research self-improving AI agent",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:"custom"},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant",configType:"custom"},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:`{
|
|
18
|
+
"apiBase": "{{baseUrl}}",
|
|
19
|
+
"title": "{{model}}",
|
|
20
|
+
"model": "{{model}}",
|
|
21
|
+
"provider": "openai",
|
|
22
|
+
"apiKey": "{{apiKey}}"
|
|
23
|
+
}`}}}}}]);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8035],{64795:(e,t,s)=>{"use strict";s.d(t,{default:()=>x});var a=s(73365),l=s(1521),n=s(86447),r=s.n(n),i=s(74156),o=s(96459);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"}];async function d(e){if(!e)return!1;try{return await fetch(`${e}/api/health`,{mode:"no-cors",cache:"no-store",signal:AbortSignal.timeout(5e3)}),!0}catch{return!1}}let m=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"}];function x({machineId:e}){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),[g,y]=(0,l.useState)(!1),[f,j]=(0,l.useState)(""),[k,v]=(0,l.useState)(null),[w,N]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!0),[T,_]=(0,l.useState)(!0),[P,E]=(0,l.useState)(!1),[$,A]=(0,l.useState)(!0),[U,O]=(0,l.useState)(!1),[D,F]=(0,l.useState)("full"),[I,R]=(0,l.useState)(!0),[L,W]=(0,l.useState)(!1),[q,K]=(0,l.useState)(!1),[J,z]=(0,l.useState)(""),[H,M]=(0,l.useState)(""),[Z,B]=(0,l.useState)(!1),[Q,V]=(0,l.useState)(""),[G,X]=(0,l.useState)(null),[Y,ee]=(0,l.useState)(!1),[et,es]=(0,l.useState)(!1),[ea,el]=(0,l.useState)(!1),[en,er]=(0,l.useState)(!1),[ei,eo]=(0,l.useState)(""),[ec,ed]=(0,l.useState)(!1),[em,ex]=(0,l.useState)(""),[eu,eh]=(0,l.useState)(null),[ep,eb]=(0,l.useState)(""),[eg,ey]=(0,l.useState)(""),[ef,ej]=(0,l.useState)(null),[ek,ev]=(0,l.useState)(!1),[ew,eN]=(0,l.useState)([]),[eC,eS]=(0,l.useState)(""),[eT,e_]=(0,l.useState)(!1),[eP,eE]=(0,l.useState)(!1),[e$,eA]=(0,l.useState)(!1),eU=(0,l.useRef)(null),eO=(0,l.useRef)(0),eD=(0,l.useRef)(0),eF=(0,l.useRef)(!1),eI=(0,l.useRef)(!1),eR=(0,l.useRef)(!1),eL=(0,l.useRef)(!1),[eW,eq]=(0,l.useState)(!1),[eK,eJ]=(0,l.useState)(!1),[ez,eH]=(0,l.useState)(new Set),{copied:eM,copy:eZ}=(0,o.C)();(0,l.useEffect)(()=>{eU.current&&(eU.current.scrollTop=eU.current.scrollHeight)},[ew]),(0,l.useEffect)(()=>{e1(),eV();let e=setInterval(()=>{eQ()},5e3),t=()=>{document.hidden||eQ()};return document.addEventListener("visibilitychange",t),()=>{clearInterval(e),document.removeEventListener("visibilitychange",t)}},[]),(0,l.useEffect)(()=>{let e=async()=>{if(L&&(H||J)){let e=await d(H||J);eF.current=e,e&&(eO.current=0,K(!0),eR.current||(eR.current=!0,eq(!0)))}else eF.current=!1;if(ea&&ei){let e=await d(ei);eI.current=e,e&&(eD.current=0,er(!0),eL.current||(eL.current=!0,eJ(!0)))}else eI.current=!1};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[L,H,J,ea,ei]);let eB=(0,l.useCallback)((e,t,s,a,l,n)=>{e||t.current?(s.current=0,a(!0),l.current||(l.current=!0,n(!0))):(s.current+=1,s.current>=5&&a(!1))},[]),eQ=async()=>{try{let e=await fetch("/api/tunnel/status",{cache:"no-store"});if(!e.ok)return;let t=await e.json(),s=t.tunnel?.settingsEnabled??t.tunnel?.enabled??!1,a=t.tunnel?.tunnelUrl||"",l=t.tunnel?.publicUrl||"";z(a),M(l),W(s),eB(!!t.tunnel?.reachable,eF,eO,K,eR,eq);let n=t.tailscale?.settingsEnabled??t.tailscale?.enabled??!1,r=t.tailscale?.tunnelUrl||"";eo(r),el(n),eB(!!t.tailscale?.reachable,eI,eD,er,eL,eJ)}catch{}},eV=async()=>{R(!0);try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status",{cache:"no-store"})]);if(e.ok){let t=await e.json();N(t.requireApiKey||!1),S(!1!==t.requireLogin),_(t.hasPassword||!1),E(t.tunnelDashboardAccess||!1),A(!1!==t.rtkEnabled),O(!!t.cavemanEnabled),F(t.cavemanLevel||"full")}if(t.ok){let e=await t.json(),s=e.tunnel?.settingsEnabled??e.tunnel?.enabled??!1,a=e.tunnel?.tunnelUrl||"",l=e.tunnel?.publicUrl||"";z(a),M(l),W(s),eB(!!e.tunnel?.reachable,eF,eO,K,eR,eq);let n=e.tailscale?.settingsEnabled??e.tailscale?.enabled??!1,r=e.tailscale?.tunnelUrl||"";eo(r),el(n),eB(!!e.tailscale?.reachable,eI,eD,er,eL,eJ)}}catch(e){console.log("Error loading settings:",e)}finally{R(!1)}},eG=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:e})})).ok&&E(e)}catch(e){console.log("Error updating tunnelDashboardAccess:",e)}},eX=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:e})})).ok&&N(e)}catch(e){console.log("Error updating requireApiKey:",e)}},eY=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&A(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},e0=async e=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){console.log("Error updating setting:",e)}},e1=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)}},e5=async e=>{B(!0),V("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 W(!0),B(!1),V(""),!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 X({type:"error",message:"Tunnel process stopped unexpectedly."}),B(!1),V(""),!1}}catch{}}return X({type:"error",message:"Tunnel created but not reachable. Please try again."}),B(!1),V(""),!1},e2=async()=>{ee(!1),B(!0),X(null),V("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?V(`Downloading cloudflared... ${s.download.progress}%`):e&&V("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 X({type:"error",message:s.error||"Failed to enable tunnel"});let a=s.publicUrl||s.tunnelUrl;if(!a)return void X({type:"error",message:"No tunnel URL returned"});z(s.tunnelUrl||""),M(s.publicUrl||""),await e5(a)}catch(e){X({type:"error",message:e.message})}finally{e=!1,B(!1),V("")}},e4=async()=>{B(!0),X(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(W(!1),z(""),M(""),es(!1),X({type:"success",message:"Tunnel disabled"})):X({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){X({type:"error",message:e.message})}finally{B(!1)}},e3=async()=>{ej(null);try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok){let t=await e.json();return ej(t.installed),t}}catch{}return ej(!1),{installed:!1}},e8=async()=>{ev(!0),eh(null),eN([]);try{let e=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:eC})});eS("");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)eN(e=>[...e.slice(-50),a.message]);else if("done"===s){ej(!0),ev(!1),eE(!1),te();return}else"error"===s&&eh({type:"error",message:a.error||"Install failed"})}}}catch(e){eh({type:"error",message:e.message})}finally{ev(!1)}},e6=async e=>{ex("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},e7=(e,t)=>{eb(e),ey(t)},e9=()=>{eb(""),ey("")},te=async()=>{eE(!1),e_(!0),ed(!0),eh(null),ex("Connecting..."),e9();try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){eo(t.tunnelUrl||"");let e=await e6(t.tunnelUrl);el(!0),eh(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.needsLogin&&t.authUrl){e7(t.authUrl,"Open Login Page"),ex('Login required — click "Open Login Page" to continue');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok&&(await e.json()).loggedIn){e9(),ex("Starting funnel...");let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){eo(t.tunnelUrl||"");let e=await e6(t.tunnelUrl);el(!0),eh(e?null:{type:"warning",message:"Connected but not reachable yet."})}else t.funnelNotEnabled&&t.enableUrl?await tt(t.enableUrl):eh({type:"error",message:t.error||"Failed to start funnel"});return}}catch{}}e9(),eh({type:"error",message:"Login timed out. Please try again."});return}if(t.funnelNotEnabled&&t.enableUrl)return void await tt(t.enableUrl);eh({type:"error",message:t.error||"Failed to connect"})}catch(e){eh({type:"error",message:e.message})}finally{ed(!1),e_(!1),ex(""),e9()}},tt=async e=>{e7(e,"Open Funnel Settings"),ex('Click "Open Funnel Settings" to enable Funnel...');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){e9(),eo(t.tunnelUrl||"");let e=await e6(t.tunnelUrl);el(!0),eh(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.funnelNotEnabled)continue;if(t.error){e9(),eh({type:"error",message:t.error});return}}catch{}}e9(),eh({type:"error",message:"Timed out waiting for Funnel to be enabled."})},ts=async()=>{ed(!0),eh(null);try{let e=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),t=await e.json();e.ok?(el(!1),eo(""),eA(!1),eh({type:"success",message:"Tailscale disabled"})):eh({type:"error",message:t.error||"Failed to disable Tailscale"})}catch(e){eh({type:"error",message:e.message})}finally{ed(!1)}},ta=async()=>{eh(null),eN([]);let e=await e3();e?.installed&&e?.hasCachedPassword?te():eE(!0)},tl=async()=>{if(f.trim())try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:f})}),t=await e.json();e.ok&&(v(t.key),await e1(),j(""),y(!1))}catch(e){console.log("Error creating key:",e)}},tn=async e=>{if(confirm("Delete this API key?"))try{(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&(s(t.filter(t=>t.id!==e)),eH(t=>{let s=new Set(t);return s.delete(e),s}))}catch(e){console.log("Error deleting key:",e)}},tr=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)}},[ti,to]=(0,l.useState)("/v1");return((0,l.useEffect)(()=>{to(`${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.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(u,{label:"Local",url:ti,copyId:"local_url",copied:eM,onCopy:eZ}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${L?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),L&&!Z&&q?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${H||J}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>eZ(`${H||J}/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"===eM?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>es(!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"})})]}):!L||Z||q?Z?(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"}),Q||"Creating tunnel..."]}),(0,a.jsx)("button",{onClick:()=>{B(!1),V("")},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"})})]}):G?.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"}),G.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>ee(!0),children:"Enable"})]}):I?(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:()=>R(!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:()=>{w?ee(!0):X({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),eW?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,a.jsx)("button",{onClick:()=>es(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${ea?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),ea&&!ec&&en?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${ei}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>eZ(`${ei}/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"===eM?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>eA(!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"})})]}):!ea||ec||en?ec||eT?(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"}),em||"Connecting..."]}),ep&&(0,a.jsx)(i.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(ep,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:eg||"Open"}),(0,a.jsx)("button",{onClick:()=>{ed(!1),e_(!1),ex(""),e9()},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"})})]}):eu?.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"}),eu.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:ta,children:"Enable"})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:ta,className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),eK?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,a.jsx)("button",{onClick:()=>eA(!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"})})]})]})]}),(L||ea)&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!w&&(0,a.jsx)(b,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!C||!T)&&(0,a.jsx)(b,{message:C?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:C?"Change password":"Enable",href:"/dashboard/profile"}})]}),(L||ea)&&(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:P,onChange:()=>eG(!P)}),(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)(p,{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.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,a.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,a.jsx)(i.lM,{checked:$,onChange:()=>eY(!$)})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4 gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,a.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[U&&(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:m.map(e=>(0,a.jsx)("button",{onClick:()=>{var t;F(t=e.id),e0({cavemanLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${D===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,a.jsx)(i.lM,{checked:U,onChange:()=>{var e;O(e=!U),e0({cavemanEnabled:e})}})]})]})]}),(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.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>y(!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:w,onChange:()=>eX(!w)})]}),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:()=>y(!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:ez.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 eH(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:ez.has(e.id)?"Hide key":"Show key",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:ez.has(e.id)?"visibility_off":"visibility"})}),(0,a.jsx)("button",{onClick:()=>eZ(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:eM===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
|
+
|
|
3
|
+
This key will stop working immediately but can be resumed later.`)&&tr(e.id,t):tr(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,a.jsx)("button",{onClick:()=>tn(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:g,title:"Create API Key",onClose:()=>{y(!1),j("")},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(i.pd,{label:"Key Name",value:f,onChange:e=>j(e.target.value),placeholder:"Production Key"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:tl,fullWidth:!0,disabled:!f.trim(),children:"Create"}),(0,a.jsx)(i.$n,{onClick:()=>{y(!1),j("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:!!k,title:"API Key Created",onClose:()=>v(null),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,a.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.pd,{value:k||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)(i.$n,{variant:"secondary",icon:"created_key"===eM?"check":"content_copy",onClick:()=>eZ(k,"created_key"),children:"created_key"===eM?"Copied!":"Copy"})]}),(0,a.jsx)(i.$n,{onClick:()=>v(null),fullWidth:!0,children:"Done"})]})}),(0,a.jsx)(i.aF,{isOpen:Y,title:"Enable Tunnel",onClose:()=>ee(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local 9Router to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3",children: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:e2,fullWidth:!0,children:"Start Tunnel"}),(0,a.jsx)(i.$n,{onClick:()=>ee(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:et,title:"Disable Tunnel",onClose:()=>!Z&&es(!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:e4,fullWidth:!0,disabled:Z,variant:"danger",children:Z?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>es(!1),variant:"ghost",fullWidth:!0,disabled:Z,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:eP,title:"Tailscale Funnel",onClose:()=>{ek||(eE(!1),eS(""),eh(null))},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[null===ef&&(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===ef&&!ek&&(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:e8,fullWidth:!0,children:"Install Tailscale"}),(0,a.jsx)(i.$n,{onClick:()=>eE(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ek&&(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..."]}),ew.length>0&&(0,a.jsx)("div",{ref:eU,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:ew.map((e,t)=>(0,a.jsx)("div",{children:e},t))})]}),!0===ef&&!ek&&(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:()=>te(),fullWidth:!0,children:"Connect"}),(0,a.jsx)(i.$n,{onClick:()=>eE(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),eu&&(0,a.jsx)(h,{status:eu})]})}),(0,a.jsx)(i.aF,{isOpen:e$,title:"Disable Tailscale",onClose:()=>!ec&&eA(!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:ts,fullWidth:!0,disabled:ec,variant:"danger",children:ec?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>eA(!1),variant:"ghost",fullWidth:!0,disabled:ec,children:"Cancel"})]})]})})]})}function u({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-[88px] text-center ${"CF"===r||"TS"===r?"bg-primary/10 text-primary":"bg-surface-2 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 h({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 p({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 b({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})]})}x.propTypes={machineId:r().string.isRequired}},78035:(e,t,s)=>{Promise.resolve().then(s.bind(s,64795))}}]);
|