@amir83nasr/10router 0.1.11 → 0.1.14
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +5 -6
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +22 -50
- package/.next/routes-manifest.json +0 -6
- package/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
- package/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/[id]/page.js +2 -2
- package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/quota/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/usage/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error/page.js +2 -2
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +6 -6
- package/.next/server/app/_not-found.segments/_full.segment.rsc +6 -6
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/auth/login/route.js +1 -1
- package/.next/server/app/api/auth/logout/route.js +1 -1
- package/.next/server/app/api/auth/oidc/callback/route.js +1 -1
- package/.next/server/app/api/auth/oidc/start/route.js +1 -1
- package/.next/server/app/api/auth/oidc/test/route.js +1 -1
- package/.next/server/app/api/auth/reset-password/route.js +1 -1
- package/.next/server/app/api/auth/saml/acs/route.js +1 -1
- package/.next/server/app/api/auth/saml/metadata/route.js +2 -2
- package/.next/server/app/api/auth/saml/start/route.js +2 -2
- package/.next/server/app/api/auth/saml/test/route.js +1 -1
- package/.next/server/app/api/auth/status/route.js +1 -1
- package/.next/server/app/api/changelog/route.js +1 -1
- package/.next/server/app/api/cli-tools/all-statuses/route.js +1 -1
- package/.next/server/app/api/cli-tools/claude-settings/route.js +1 -1
- package/.next/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
- package/.next/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
- package/.next/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- package/.next/server/app/api/cli-tools/dsh-settings/route.js +1 -1
- package/.next/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/.next/server/app/api/combos/[id]/route.js +1 -1
- package/.next/server/app/api/combos/route.js +1 -1
- package/.next/server/app/api/headroom/extras/route.js +1 -1
- package/.next/server/app/api/headroom/proxy/[...path]/route.js +1 -1
- package/.next/server/app/api/headroom/restart/route.js +1 -1
- package/.next/server/app/api/headroom/start/route.js +1 -1
- package/.next/server/app/api/headroom/status/route.js +1 -1
- package/.next/server/app/api/headroom/stop/route.js +1 -1
- package/.next/server/app/api/health/route.js +1 -1
- package/.next/server/app/api/init/route.js +1 -1
- package/.next/server/app/api/keys/[id]/route.js +1 -1
- package/.next/server/app/api/keys/route.js +1 -1
- package/.next/server/app/api/locale/route.js +1 -1
- package/.next/server/app/api/mcp/[plugin]/message/route.js +1 -1
- package/.next/server/app/api/mcp/[plugin]/sse/route.js +1 -1
- package/.next/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
- package/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/.next/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
- package/.next/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
- package/.next/server/app/api/media-providers/tts/voices/route.js +1 -1
- package/.next/server/app/api/models/alias/route.js +1 -1
- package/.next/server/app/api/models/availability/route.js +1 -1
- package/.next/server/app/api/models/catalog-sync/route.js +1 -1
- package/.next/server/app/api/models/custom/route.js +1 -1
- package/.next/server/app/api/models/disabled/route.js +1 -1
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models/test/route.js +1 -1
- package/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/.next/server/app/api/oauth/codex/bulk-import/route.js +1 -1
- package/.next/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
- package/.next/server/app/api/oauth/cursor/import/route.js +1 -1
- package/.next/server/app/api/oauth/gitlab/pat/route.js +1 -1
- package/.next/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
- package/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
- package/.next/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
- package/.next/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +2 -2
- package/.next/server/app/api/pricing/route.js +1 -1
- package/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/.next/server/app/api/provider-nodes/route.js +1 -1
- package/.next/server/app/api/provider-nodes/validate/route.js +1 -1
- package/.next/server/app/api/providers/[id]/models/route.js +1 -1
- package/.next/server/app/api/providers/[id]/route.js +1 -1
- package/.next/server/app/api/providers/[id]/test/route.js +1 -1
- package/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/.next/server/app/api/providers/client/route.js +1 -1
- package/.next/server/app/api/providers/kilo/free-models/route.js +1 -1
- package/.next/server/app/api/providers/route.js +1 -1
- package/.next/server/app/api/providers/suggested-models/route.js +1 -1
- package/.next/server/app/api/providers/test-batch/route.js +1 -1
- package/.next/server/app/api/providers/validate/route.js +1 -1
- package/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
- package/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
- package/.next/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
- package/.next/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
- package/.next/server/app/api/proxy-pools/route.js +1 -1
- package/.next/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
- package/.next/server/app/api/pxpipe/health/route.js +2 -2
- package/.next/server/app/api/pxpipe/install/route.js +1 -1
- package/.next/server/app/api/pxpipe/logs/route.js +1 -1
- package/.next/server/app/api/pxpipe/restart/route.js +1 -1
- package/.next/server/app/api/pxpipe/start/route.js +1 -1
- package/.next/server/app/api/pxpipe/stats/route.js +1 -1
- package/.next/server/app/api/pxpipe/status/route.js +1 -1
- package/.next/server/app/api/pxpipe/stop/route.js +1 -1
- package/.next/server/app/api/settings/database/route.js +1 -1
- package/.next/server/app/api/settings/proxy-test/route.js +1 -1
- package/.next/server/app/api/settings/require-login/route.js +1 -1
- package/.next/server/app/api/settings/route.js +1 -1
- package/.next/server/app/api/shutdown/route.js +1 -1
- package/.next/server/app/api/tags/route.js +1 -1
- package/.next/server/app/api/translator/console-logs/route.js +1 -1
- package/.next/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/.next/server/app/api/translator/load/route.js +1 -1
- package/.next/server/app/api/translator/save/route.js +1 -1
- package/.next/server/app/api/translator/send/route.js +1 -1
- package/.next/server/app/api/translator/translate/route.js +1 -1
- package/.next/server/app/api/tunnel/disable/route.js +1 -1
- package/.next/server/app/api/tunnel/enable/route.js +1 -1
- package/.next/server/app/api/tunnel/status/route.js +1 -1
- package/.next/server/app/api/tunnel/tailscale-check/route.js +1 -1
- package/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
- package/.next/server/app/api/tunnel/tailscale-enable/route.js +1 -1
- package/.next/server/app/api/tunnel/tailscale-install/route.js +2 -2
- package/.next/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/.next/server/app/api/usage/[connectionId]/route.js +1 -1
- package/.next/server/app/api/usage/chart/route.js +1 -1
- package/.next/server/app/api/usage/health/route.js +1 -1
- package/.next/server/app/api/usage/history/route.js +1 -1
- package/.next/server/app/api/usage/logs/route.js +1 -1
- package/.next/server/app/api/usage/providers/route.js +1 -1
- package/.next/server/app/api/usage/request-details/route.js +1 -1
- package/.next/server/app/api/usage/request-logs/route.js +1 -1
- package/.next/server/app/api/usage/stats/route.js +1 -1
- package/.next/server/app/api/usage/stream/route.js +2 -2
- package/.next/server/app/api/v1/api/chat/route.js +1 -1
- package/.next/server/app/api/v1/audio/speech/route.js +1 -1
- package/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/.next/server/app/api/v1/audio/voices/route.js +1 -1
- package/.next/server/app/api/v1/chat/completions/route.js +1 -1
- package/.next/server/app/api/v1/embeddings/route.js +1 -1
- package/.next/server/app/api/v1/images/generations/route.js +2 -2
- package/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
- package/.next/server/app/api/v1/messages/route.js +1 -1
- package/.next/server/app/api/v1/models/[...model]/route.js +1 -1
- package/.next/server/app/api/v1/models/info/route.js +1 -1
- package/.next/server/app/api/v1/models/route.js +1 -1
- package/.next/server/app/api/v1/responses/compact/route.js +1 -1
- package/.next/server/app/api/v1/responses/route.js +1 -1
- package/.next/server/app/api/v1/route.js +1 -1
- package/.next/server/app/api/v1/search/route.js +1 -1
- package/.next/server/app/api/v1/systemone/route.js +1 -1
- package/.next/server/app/api/v1/videos/[id]/route.js +1 -1
- package/.next/server/app/api/v1/videos/edits/route.js +1 -1
- package/.next/server/app/api/v1/videos/extensions/route.js +1 -1
- package/.next/server/app/api/v1/videos/generations/route.js +1 -1
- package/.next/server/app/api/v1/web/fetch/route.js +1 -1
- package/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/.next/server/app/api/v1beta/models/route.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/api/version/shutdown/route.js +1 -1
- package/.next/server/app/api/version/update/route.js +1 -1
- package/.next/server/app/callback/page.js +1 -1
- package/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/.next/server/app/callback.html +1 -1
- package/.next/server/app/callback.rsc +7 -7
- package/.next/server/app/callback.segments/_full.segment.rsc +7 -7
- package/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard/cli-tools.html +1 -1
- package/.next/server/app/dashboard/cli-tools.rsc +9 -9
- package/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +8 -8
- package/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +9 -9
- package/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/dashboard/combos.html +1 -1
- package/.next/server/app/dashboard/combos.rsc +8 -8
- package/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +8 -8
- package/.next/server/app/dashboard/combos.segments/_full.segment.rsc +8 -8
- package/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/dashboard/endpoint.html +1 -1
- package/.next/server/app/dashboard/endpoint.rsc +9 -9
- package/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +8 -8
- package/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +9 -9
- package/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/dashboard/media-providers/systemone.html +1 -1
- package/.next/server/app/dashboard/media-providers/systemone.rsc +8 -8
- package/.next/server/app/dashboard/media-providers/systemone.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/systemone/__PAGE__.segment.rsc +8 -8
- package/.next/server/app/dashboard/media-providers/systemone.segments/_full.segment.rsc +8 -8
- package/.next/server/app/dashboard/media-providers/systemone.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/dashboard/profile.html +1 -1
- package/.next/server/app/dashboard/profile.rsc +8 -8
- package/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +8 -8
- package/.next/server/app/dashboard/profile.segments/_full.segment.rsc +8 -8
- package/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/dashboard/providers/new.html +1 -1
- package/.next/server/app/dashboard/providers/new.rsc +8 -8
- package/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +8 -8
- package/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +8 -8
- package/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/dashboard/providers.html +1 -1
- package/.next/server/app/dashboard/providers.rsc +8 -8
- package/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +8 -8
- package/.next/server/app/dashboard/providers.segments/_full.segment.rsc +8 -8
- package/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/dashboard/proxy-pools.html +1 -1
- package/.next/server/app/dashboard/proxy-pools.rsc +8 -8
- package/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +8 -8
- package/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +8 -8
- package/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/dashboard/pxpipe.html +1 -1
- package/.next/server/app/dashboard/pxpipe.rsc +7 -7
- package/.next/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard/pxpipe.segments/_full.segment.rsc +7 -7
- package/.next/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/dashboard/quota.html +2 -2
- package/.next/server/app/dashboard/quota.rsc +9 -9
- package/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +9 -9
- package/.next/server/app/dashboard/quota.segments/_full.segment.rsc +9 -9
- package/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/dashboard/settings/pricing/page.js +1 -1
- package/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/.next/server/app/dashboard/settings/pricing.html +1 -1
- package/.next/server/app/dashboard/settings/pricing.rsc +7 -7
- package/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +7 -7
- package/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard/token-saver.html +1 -1
- package/.next/server/app/dashboard/token-saver.rsc +8 -8
- package/.next/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +8 -8
- package/.next/server/app/dashboard/token-saver.segments/_full.segment.rsc +8 -8
- package/.next/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/dashboard/usage.html +2 -2
- package/.next/server/app/dashboard/usage.rsc +8 -8
- package/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +8 -8
- package/.next/server/app/dashboard/usage.segments/_full.segment.rsc +8 -8
- package/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/dashboard.html +1 -1
- package/.next/server/app/dashboard.rsc +9 -9
- package/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +8 -8
- package/.next/server/app/dashboard.segments/_full.segment.rsc +9 -9
- package/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +6 -6
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/index.segments/_full.segment.rsc +6 -6
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/landing/page.js +1 -1
- package/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/.next/server/app/landing.html +1 -1
- package/.next/server/app/landing.rsc +7 -7
- package/.next/server/app/landing.segments/_full.segment.rsc +7 -7
- package/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/login/page.js +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +6 -6
- package/.next/server/app/login.segments/_full.segment.rsc +6 -6
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/manifest.webmanifest/route.js +2 -2
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +5 -6
- package/.next/server/chunks/1011.js +1 -1
- package/.next/server/chunks/1194.js +1 -1
- package/.next/server/chunks/1289.js +1 -1
- package/.next/server/chunks/1633.js +1 -1
- package/.next/server/chunks/2282.js +7 -7
- package/.next/server/chunks/2339.js +1 -1
- package/.next/server/chunks/2706.js +1 -1
- package/.next/server/chunks/2801.js +1 -1
- package/.next/server/chunks/3425.js +1 -1
- package/.next/server/chunks/4129.js +1 -1
- package/.next/server/chunks/6056.js +1 -1
- package/.next/server/chunks/7816.js +1 -1
- package/.next/server/chunks/9429.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/prefetch-hints.json +0 -24
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/1278-1bef1ffb32ea7f41.js +1 -0
- package/.next/static/chunks/1660-25564899e7912146.js +1 -0
- package/.next/static/chunks/{1699-13ee6864a8a31a96.js → 1699-49be310981e2759e.js} +2 -2
- package/.next/static/chunks/{3577-cd98d40e3099e1b0.js → 3577-1f02993330d7fba7.js} +1 -1
- package/.next/static/chunks/5148-7d67073becfaf162.js +1 -0
- package/.next/static/chunks/{5862-f98c2f3d480b80d2.js → 5862-6f3a3a6d4c00100d.js} +1 -1
- package/.next/static/chunks/6428-5a5f71440049a4e6.js +1 -0
- package/.next/static/chunks/7128-78b41798c1177008.js +1 -0
- package/.next/static/chunks/7835-06b436358f3395f6.js +1 -0
- package/.next/static/chunks/9150-32b4247b1af5e206.js +1 -0
- package/.next/static/chunks/{9ce8c186-3c7d7dbc5d428052.js → 9ce8c186-6cd204e9c27ecee1.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-e8bceccb95695755.js → page-c913b130003c1672.js} +3 -3
- package/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-adee408d9de02423.js → page-3bab0c661f222ea3.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/combos/{page-d4c1e29e8d038f09.js → page-76cc2c386af12738.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/console-log/page-58a29f3cb409597a.js +1 -0
- package/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-d5f693c646ae044b.js +1 -0
- package/.next/static/chunks/app/(dashboard)/dashboard/media-providers/systemone/[id]/{page-b751d9603cb82e62.js → page-7340dad2b87640cf.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/media-providers/systemone/{page-49b3b4867d06cbe0.js → page-32e3e07a8f54ec11.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/page-a7f59da8c0db5cf1.js +1 -0
- package/.next/static/chunks/app/(dashboard)/dashboard/profile/{page-65b2c7989dbe2663.js → page-7123127fd841cfa5.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-d5d480e209fdc55a.js → page-fab6f4b4cccc1a6f.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/providers/new/{page-9b68243ab9555702.js → page-819e98f53bf2f4f7.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/providers/{page-2396571281d02804.js → page-9054f870a5e0f5c6.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-cfd6bcb7e55d7d18.js → page-3e4657b108582404.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/quota/{page-fef6edb7aafd8bd0.js → page-61780f0a2b494680.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/token-saver/{page-bcc37fc2b4089f2f.js → page-4e366abb76514be7.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/usage/{page-697f46461825d7fc.js → page-2d71fa2936b16f45.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/{layout-5039502fc12707c9.js → layout-91f41c68685ed739.js} +1 -1
- package/.next/static/chunks/app/callback/page-8b6862b2e58a129e.js +1 -0
- package/.next/static/chunks/app/dashboard/settings/pricing/page-c1dfa7608ff710d1.js +1 -0
- package/.next/static/chunks/app/landing/page-a76ba2642bd02bf5.js +1 -0
- package/.next/static/chunks/app/layout-cc98f6c7473b86a3.js +1 -0
- package/.next/static/css/efaf98e3b295f727.css +1 -0
- package/.next/static/wBARQPScPhD6SLn7WQvI9/_buildManifest.js +1 -0
- package/CHANGELOG.md +19 -0
- package/open-sse/providers/registry/opencode-go.js +4 -0
- package/open-sse/providers/registry/opencode-zen.js +4 -0
- package/open-sse/providers/registry/opencode.js +3 -0
- package/open-sse/translator/concerns/thinkingUnified.js +16 -1
- package/open-sse/translator/concerns/toolCall.js +2 -1
- package/open-sse/translator/formats/openai.js +10 -2
- package/open-sse/translator/request/claude-to-openai.js +9 -5
- package/open-sse/translator/response/openai-to-claude.js +66 -32
- package/open-sse/translator/schema/defaults.js +6 -0
- package/open-sse/translator/schema/index.js +1 -1
- package/package.json +1 -1
- package/src/app/(dashboard)/dashboard/cli-tools/components/cards/ClaudeToolCard.tsx +10 -0
- package/src/app/api/cli-tools/claude-settings/route.js +10 -0
- package/src/app/globals.css +21 -1
- package/src/shared/components/layouts/DashboardLayout.tsx +2 -8
- package/src/shared/constants/cliTools.js +5 -0
- package/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +0 -1
- package/.next/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +0 -1
- package/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +0 -1
- package/.next/server/app/dashboard/basic-chat.html +0 -1
- package/.next/server/app/dashboard/basic-chat.meta +0 -36
- package/.next/server/app/dashboard/basic-chat.rsc +0 -26
- package/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +0 -31
- package/.next/server/app/dashboard/basic-chat.segments/_full.segment.rsc +0 -26
- package/.next/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +0 -6
- package/.next/static/Xxof6vr5MvX0-6oReU23d/_buildManifest.js +0 -1
- package/.next/static/chunks/1278-f11c7d84c52342fc.js +0 -1
- package/.next/static/chunks/1471-10f225f62f7469cc.js +0 -1
- package/.next/static/chunks/159-ec207a220d7d5c16.js +0 -1
- package/.next/static/chunks/5113-5c4f5181388aab72.js +0 -1
- package/.next/static/chunks/5778-9d97ce04f2ac118c.js +0 -1
- package/.next/static/chunks/6920-e2b533c1eafa9521.js +0 -1
- package/.next/static/chunks/7835-c1ef8f5cdaaad483.js +0 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/basic-chat/page-ce1364b2b9589785.js +0 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/console-log/page-3cc58622294c8c8a.js +0 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-67516b120adbc4d7.js +0 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/page-315c9f52c472a700.js +0 -1
- package/.next/static/chunks/app/callback/page-f714c2306a1e9004.js +0 -1
- package/.next/static/chunks/app/dashboard/settings/pricing/page-86197107690a0580.js +0 -1
- package/.next/static/chunks/app/landing/page-7a83d1be493ddc8c.js +0 -1
- package/.next/static/chunks/app/layout-dc929483cad9f77f.js +0 -1
- package/.next/static/css/c66cbd684164cacf.css +0 -1
- package/src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.tsx +0 -1140
- package/src/app/(dashboard)/dashboard/basic-chat/page.tsx +0 -5
- /package/.next/static/{Xxof6vr5MvX0-6oReU23d → wBARQPScPhD6SLn7WQvI9}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3554],{7006:(e,s,t)=>{Promise.resolve().then(t.bind(t,32063))},15764:(e,s,t)=>{"use strict";t.d(s,{CK:()=>i.default,G9:()=>m.default,Iz:()=>f.default,KX:()=>j.PanelSkeleton,LF:()=>a.default,LH:()=>x.default,Mu:()=>j.StatCardSkeleton,Nf:()=>d.default,Qv:()=>r.CardSkeleton,YW:()=>y.YW,gw:()=>g.default,jK:()=>c.default,nh:()=>b.default,pV:()=>y.pV,rq:()=>n.default,uR:()=>o.default,uo:()=>l.ConfirmModal,vE:()=>u.default,vj:()=>p.default,wI:()=>h.default,wn:()=>y.wn,zY:()=>y.zY}),t(58913);var l=t(3537),r=t(58350);t(30872),t(33526),t(42535),t(1279);var a=t(92802),n=t(25908),o=t(58729),i=t(24873),d=t(5258),c=t(80599);t(949),t(56776),t(53599),t(88336),t(69561);var m=t(37753),x=t(23444),u=t(93624),p=t(86920),h=t(65461);t(14580);var g=t(14670),f=t(70296);t(57779),t(22205);var j=t(43276),b=t(75862),y=t(92412)},32063:(e,s,t)=>{"use strict";t.d(s,{default:()=>en});var l=t(29798),r=t(58913),a=t(15814),n=t(50141),o=t.n(n),i=t(15764),d=t(18055),c=t(738),m=t(90046),x=t(80159),u=t(75669),p=t(45111),h=t(1352),g=t(69221),f=t(7896),j=t(16653),b=t(51660),y=t(77345);function v({storageKey:e,changeEvent:s,itemField:t,normalize:l=e=>e,defaultName:r=e=>e}){let a=()=>{try{let s=JSON.parse(window.localStorage.getItem(e)||"[]");if(!Array.isArray(s))return[];return s.filter(e=>e?.name&&e?.[t])}catch{return[]}},n=t=>{window.localStorage.setItem(e,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(s))};return{read:a,subscribe:e=>(window.addEventListener(s,e),()=>window.removeEventListener(s,e)),upsert:(e,s)=>{let o=l(e);if(!o)return null;let i=a(),d=i.find(e=>l(e[t])===o);if(d&&!s)return d.name;let c=(s||r(o)).trim();return c?(n([...i.filter(e=>e.name!==c&&l(e[t])!==o),{name:c,[t]:o}].sort((e,s)=>e.name.localeCompare(s.name))),c):null},remove:e=>n(a().filter(s=>s.name!==e))}}let N=e=>(e||"").replace(/\/+$/,""),w=v({storageKey:"10router.cliToolEndpointPresets",changeEvent:"10router:endpoint-presets-changed",itemField:"baseUrl",normalize:N,defaultName:e=>{try{return new URL(e).host}catch{return e}}}),k=v({storageKey:"10router.cliToolApiKeyPresets",changeEvent:"10router:api-key-presets-changed",itemField:"key"}),C=w.read,_=w.subscribe,S=w.upsert,E=w.remove,A=k.read,$=k.subscribe,M=k.upsert,O=k.remove;function U(e,{tunnelPublicUrl:s,tailscaleUrl:t,cloudUrl:l}={}){let r=N(e);return!r||[`http://127.0.0.1:${b._$}`,s,t,l].filter(Boolean).flatMap(e=>[N(e),`${N(e)}/v1`]).includes(r)?null:S(r)}let P="__custom__",R="__save__",z=e=>{let s=(e||"").replace(/\/+$/,"");return s?/\/v1$/.test(s)?s:`${s}/v1`:""};function I({value:e,onChange:s,requiresExternalUrl:t=!1,tunnelEnabled:n=!1,tunnelPublicUrl:o="",tailscaleEnabled:i=!1,tailscaleUrl:d="",cloudEnabled:c=!1,cloudUrl:m="",withV1:x=!0,currentUrl:u=""}){let[g,f]=(0,a.useState)([]),[j,v]=(0,a.useState)(!1),[w,k]=(0,a.useState)(""),[A,$]=(0,a.useState)(""),M=(0,a.useRef)(!1),O=(0,a.useRef)("");(0,a.useEffect)(()=>{let e=()=>{let e=C();f(e),k(s=>{if(s!==P)return s;let t=N(O.current);if(!t)return s;let l=e.find(e=>{let s=N(e.baseUrl);return s===t||s===z(t)});return l?`saved:${l.name}`:s})};return e(),v(!0),_(e)},[]);let U=(0,a.useMemo)(()=>(({requiresExternalUrl:e,tunnelEnabled:s,tunnelPublicUrl:t,tailscaleEnabled:l,tailscaleUrl:r,cloudEnabled:a,cloudUrl:n,savedPresets:o,withV1:i})=>{let d=[],c=e=>i?z(e):(e||"").replace(/\/+$/,"");if(!e){let e=c(`http://127.0.0.1:${b._$}`);d.push({value:"local",label:e,url:e})}if(s&&t){let e=c(t);d.push({value:"tunnel",label:e,url:e})}if(l&&r){let e=c(r);d.push({value:"tailscale",label:e,url:e})}if(a&&n){let e=c(n);d.push({value:"cloud",label:e,url:e})}return o.forEach(e=>{d.push({value:`saved:${e.name}`,label:e.baseUrl,url:e.baseUrl,saved:!0})}),d.push({value:P,label:"Custom URL...",url:""}),d})({requiresExternalUrl:t,tunnelEnabled:n,tunnelPublicUrl:o,tailscaleEnabled:i,tailscaleUrl:d,cloudEnabled:c,cloudUrl:m,savedPresets:g,withV1:x}),[t,n,o,i,d,c,m,g,x]);(0,a.useEffect)(()=>{if(M.current||!j||0===U.length)return;M.current=!0;let e=N(u),t=(e?U.find(s=>s.saved&&N(s.url)===e):null)||U.find(e=>e.value!==P);t?(k(t.value),s(t.url)):k(P)},[j,U,s,u]);let T=w.startsWith("saved:"),L=w===P,K=L&&(A||"").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)(p.l6,{value:w,onValueChange:t=>{if(t===R){let s=(e||"").trim();if(!s)return;let t=s;try{t=new URL(s).host}catch{}let l=window.prompt("Save endpoint as:",t),r=l?.trim()?S(s,l.trim()):null;r&&k(`saved:${r}`);return}if(k(t),t===P){$(""),s("");return}let l=U.find(e=>e.value===t);l&&s(l.url)},children:[(0,l.jsx)(p.bq,{className:"flex-1 min-w-0 text-xs",children:(0,l.jsx)(p.yv,{placeholder:"Select endpoint"})}),(0,l.jsxs)(p.gC,{children:[U.map(e=>(0,l.jsx)(p.eb,{value:e.value,title:e.label,children:e.label},e.value)),K&&(0,l.jsx)(p.eb,{value:R,children:"+ Save current as..."})]})]}),T&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{type:"button",onClick:()=>{if(!w.startsWith("saved:"))return;E(w.slice(6)),$("");let e=U.find(e=>e.value!==P&&e.value!==w);e?(k(e.value),s(e.url)):(k(P),s(""))},className:"p-1 text-muted-foreground hover:text-red-500 rounded transition-colors shrink-0",children:(0,l.jsx)(r.default,{name:"delete",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Delete saved endpoint"})]})]}),L&&(0,l.jsx)(y.p,{type:"text",value:A,onChange:e=>{let t=e.target.value;O.current=t,$(t),s(t)},placeholder:x?"https://example.com/v1":"https://example.com",className:"h-9 text-xs"})]})}let T="__custom__",L="__save_key__";function K({value:e,onChange:s,apiKeys:t=[],cloudEnabled:n=!1,className:o=""}){let[i,d]=(0,a.useState)([]),[c,m]=(0,a.useState)(!1),[x,u]=(0,a.useState)("");(0,a.useEffect)(()=>{let e=()=>d(A());return e(),$(e)},[]);let g=(0,a.useMemo)(()=>[...t.map(e=>({value:e.key,label:e.key})),...i.map(e=>({value:`saved:${e.name}`,label:e.key,url:e.key,saved:!0})),{value:T,label:"Custom...",url:""}],[t,i]),f=e?g.find(s=>s.value===e||s.url===e):null,j=f?f.value:c||e?T:g[0]?.value??T,b=c?x:e||"",v="string"==typeof j&&j.startsWith("saved:"),N=j===T,w=N&&(e||"").trim().length>0&&!t.some(s=>s.key===e);return 0!==t.length||0!==i.length||c||e?(0,l.jsxs)("div",{className:`flex flex-col gap-1.5 ${o}`,children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(p.l6,{value:j,onValueChange:t=>{if(t===L)return void M((e||"").trim());if(t===T){m(!0),u(""),s("");return}m(!1),u("");let l=g.find(e=>e.value===t);l&&s(l.url??l.value)},children:[(0,l.jsx)(p.bq,{className:"flex-1 min-w-0 text-xs",children:(0,l.jsx)(p.yv,{placeholder:"Select key"})}),(0,l.jsxs)(p.gC,{children:[g.map(e=>(0,l.jsx)(p.eb,{value:e.value,title:e.label,children:e.label},e.value)),w&&(0,l.jsx)(p.eb,{value:L,children:"+ Save current as..."})]})]}),v&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{type:"button",onClick:()=>{if(!v)return;O(j.slice(6)),m(!1),u("");let e=g.find(e=>e.value!==T&&e.value!==j);s(e?e.url??e.value:"")},className:"p-1 text-muted-foreground hover:text-red-500 rounded transition-colors shrink-0",children:(0,l.jsx)(r.default,{name:"delete",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Delete saved key"})]})]}),N&&(0,l.jsx)(y.p,{type:"text",value:b,onChange:e=>{let t=e.target.value;m(!0),u(t),s(t)},placeholder:"sk-...",className:"h-9 text-xs"})]}):(0,l.jsx)("span",{className:`min-w-0 rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5 ${o}`,children:n?"No API keys - Create one in Keys page":"sk_10router (default)"})}let D=e=>(e||"").replace(/\/+$/,"");function W(e,s={}){if(!e)return!1;let t=D(e),{tunnelPublicUrl:l,tailscaleUrl:r,cloudUrl:a}=s;return!!(/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(t)||l&&t.startsWith(D(l))||r&&t.startsWith(D(r))||a&&t.startsWith(D(a)))}let H=/\[1m\]$/i,F=t(65746).env.NEXT_PUBLIC_CLOUD_URL,q=[{label:"Default",value:""},{label:"200K",value:"198000"},{label:"300K",value:"298000"},{label:"500K",value:"498000"},{label:"700K",value:"698000"}];function B({tool:e,isExpanded:s,onToggle:t,activeProviders:n,modelMappings:o,onModelMappingChange:c,baseUrl:m,hasActiveProviders:x,apiKeys:b,cloudEnabled:y,initialStatus:v,tunnelEnabled:N,tunnelPublicUrl:w,tailscaleEnabled:k,tailscaleUrl:C}){let _,S,E,[A,$]=(0,a.useState)(v||null),[M,O]=(0,a.useState)(!1),[P,R]=(0,a.useState)(!1),[z,T]=(0,a.useState)(!1),[L,D]=(0,a.useState)(null),[Z,Y]=(0,a.useState)(!1),[J,V]=(0,a.useState)(!1),[G,X]=(0,a.useState)(null),[Q,ee]=(0,a.useState)(""),[es,et]=(0,a.useState)({}),[el,er]=(0,a.useState)(!1),[ea,en]=(0,a.useState)(""),[eo,ei]=(0,a.useState)(!1),[ed,ec]=(0,a.useState)(!1),[em,ex]=(0,a.useState)(""),[eu,ep]=(0,a.useState)(!1),eh=(0,a.useRef)(!1),eg=A?.settings?.env?.ANTHROPIC_BASE_URL||"",ef=(()=>{if(!A?.installed)return null;let e=A.settings?.env?.ANTHROPIC_BASE_URL;return e?W(e,{tunnelPublicUrl:w,tailscaleUrl:C,cloudUrl:y?F:null})?"configured":"other":"not_configured"})();(0,a.useEffect)(()=>{b?.length>0&&!Q&&ee(b[0].key)},[b,Q]),(0,a.useEffect)(()=>{v&&($(v),ec(!!v.exaMcpEnabled))},[v]),(0,a.useEffect)(()=>{ex(A?.settings?.env?.CLAUDE_CODE_AUTO_COMPACT_WINDOW||"")},[A?.settings?.env?.CLAUDE_CODE_AUTO_COMPACT_WINDOW]),(0,a.useEffect)(()=>{let s=A?.settings?.env;s&&ep(e.defaultModels.some(e=>s[e.envKey]?.endsWith("[1m]")))},[A?.settings?.env,e.defaultModels]),(0,a.useEffect)(()=>{s&&(A||ey(),eb())},[s]),(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{ei(!!e.ccFilterNaming)}).catch(()=>{})},[]);let ej=async e=>{let s=!0===e;ei(s),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:s})}).catch(()=>{})},eb=async()=>{try{let e=await fetch("/api/models/alias"),s=await e.json();e.ok&&et(s.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(A?.installed&&!eh.current){eh.current=!0;let s=A.settings?.env||{};e.defaultModels.forEach(e=>{if(e.envKey){let t=s[e.envKey]||e.defaultValue||"";t&&c(e.alias,t)}});let t=s.ANTHROPIC_AUTH_TOKEN;t&&ee(t)}},[A,b,e.defaultModels,c]);let ey=async()=>{O(!0);try{let e=await fetch("/api/cli-tools/claude-settings"),s=await e.json();$(s),ec(!!s.exaMcpEnabled)}catch(e){$({installed:!1,error:e.message})}finally{O(!1)}},ev=()=>{let e=ea||m;return e.endsWith("/v1")?e:`${e}/v1`},eN=async()=>{R(!0),D(null);try{let s={ANTHROPIC_BASE_URL:ev()},t=Q?.trim()||(b?.length>0?b[0].key:null)||(y?null:"sk_10router");t&&(s.ANTHROPIC_AUTH_TOKEN=t),e.defaultModels.forEach(e=>{let t=o[e.alias];t&&e.envKey&&(s[e.envKey]=t)}),em&&(s.CLAUDE_CODE_AUTO_COMPACT_WINDOW=em);let l=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:s,exaMcpEnabled:ed,autoCompactWindow:em})}),r=await l.json();l.ok?(U(ev(),{tunnelPublicUrl:w,tailscaleUrl:C}),D({type:"success",text:"Settings applied successfully!"}),$(e=>({...e,hasBackup:!0,settings:{...e?.settings,env:s},exaMcpEnabled:ed}))):D({type:"error",text:r.error||"Failed to apply settings"})}catch(e){D({type:"error",text:e.message})}finally{R(!1)}},ew=async()=>{T(!0),D(null);try{let s=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),t=await s.json();s.ok?(D({type:"success",text:"Settings reset successfully!"}),e.defaultModels.forEach(e=>c(e.alias,e.defaultValue||"")),ee(""),ec(!1),ex(""),ep(!1)):D({type:"error",text:t.error||"Failed to reset settings"})}catch(e){D({type:"error",text:e.message})}finally{T(!1)}};return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,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)(j.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"},loading:"lazy",decoding:"async"})}),(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"===ef&&(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"===ef&&(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"===ef&&(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-muted-foreground truncate",children:e.description})]})]})}),s&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[M&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,l.jsx)(r.default,{name:"progress_activity",className:"animate-spin"}),(0,l.jsx)("span",{children:"Checking Claude CLI..."})]}),!M&&A&&!A.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)(r.default,{name:"warning",className:"text-yellow-500"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:A.container?"10Router runs in a container":"Claude CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:A.container?"The CLI lives on your host, not inside the container. Copy the manual config below into your host's ~/.claude/settings.json.":"Manual configuration is still available if 10router is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(d.$,{variant:"secondary",size:"sm",onClick:()=>er(!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)(r.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:()=>Y(!Z),children:[(0,l.jsx)(r.default,{name:Z?"expand_less":"help",className:"text-[18px] mr-1"}),Z?"Hide":"How to Install"]})]})]}),Z&&(0,l.jsxs)("div",{className:"p-4 bg-card 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-muted-foreground 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-muted-foreground",children:["After installation, run"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!M&&A?.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_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)(I,{value:ea||((_=ea||m).endsWith("/v1")?_:`${_}/v1`),onChange:en,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:N,tunnelPublicUrl:w,tailscaleEnabled:k,tailscaleUrl:C,currentUrl:eg})]}),A?.settings?.env?.ANTHROPIC_BASE_URL&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5",children:A.settings.env.ANTHROPIC_BASE_URL})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)(K,{value:Q,onChange:ee,apiKeys:b,cloudEnabled:y})]}),e.defaultModels.map(e=>(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:e.name}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:o[e.alias]||"",onChange:s=>c(e.alias,s.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-card 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.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>c(e.alias,""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-muted-foreground hover:text-red-500 rounded transition-colors",children:(0,l.jsx)(r.default,{name:"close",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Clear"})]})]}),(0,l.jsx)("button",{onClick:()=>{X(e.alias),V(!0)},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 bg-card border-border text-foreground hover:border-primary cursor-pointer",children:"Select Model"})]},e.alias)),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Auto-compact"}),(0,l.jsxs)(p.l6,{value:em||"__default__",onValueChange:e=>ex("__default__"===e?"":e),children:[(0,l.jsx)(p.bq,{className:"w-full text-xs",children:(0,l.jsx)(p.yv,{})}),(0,l.jsx)(p.gC,{children:q.map(e=>(0,l.jsx)(p.eb,{value:e.value||"__default__",children:e.label},e.label))})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"1M context"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)(f.S,{checked:eu,onCheckedChange:s=>{var t;ep(t=!0===s),e.defaultModels.forEach(e=>{let s=o[e.alias];s&&c(e.alias,((e,s)=>{let{model:t}=function(e){if("string"!=typeof e)return{model:e,contextMarker:null};let s=e.trim(),t=s.match(H);return t?{model:s.slice(0,-t[0].length),contextMarker:t[0].slice(1,-1).toLowerCase()}:{model:e,contextMarker:null}}(e);return s?`${t}[1m]`:t})(s,t))})}}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Append [1m] to the model name"}),(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("span",{className:"relative inline-flex",children:(0,l.jsx)(r.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,l.jsx)(h.ZI,{side:"top",children:"Claude Code otherwise assumes a 200K window, which clamps the auto-compact window above. Applied to every mapped model — only enable it for models that really accept 1M."})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Filter naming"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)(f.S,{checked:eo,onCheckedChange:ej}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Filter naming requests"}),(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("span",{className:"relative inline-flex",children:(0,l.jsx)(r.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,l.jsx)(h.ZI,{side:"top",children:"Intercepts Claude Code's topic-naming requests and returns a fake response locally, saving API tokens."})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Web Search"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)(f.S,{checked:ed,onCheckedChange:e=>ec(!0===e)}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Exa MCP"}),(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("span",{className:"relative inline-flex",children:(0,l.jsx)(r.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,l.jsx)(h.ZI,{side:"top",children:"Injects Exa MCP into ~/.claude.json so non-Claude models gain web search. Restart Claude Code after Apply."})]})]})]})]}),L&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===L.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)(r.default,{name:"success"===L.type?"check_circle":"error",className:"text-[14px]"}),(0,l.jsx)("span",{children:L.text})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(d.$,{size:"sm",onClick:eN,disabled:P,children:[P&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:ew,disabled:!A?.has10Router||z,children:[z&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,l.jsxs)(d.$,{variant:"ghost",size:"sm",onClick:()=>er(!0),children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),J&&(0,l.jsx)(i.rq,{isOpen:J,onClose:()=>V(!1),onSelect:e=>{G&&c(G,e.value)},selectedModel:G?o[G]:null,activeProviders:n,modelAliases:es,title:`Select model for ${G}`}),(0,l.jsx)(i.uR,{isOpen:el,onClose:()=>er(!1),title:"Claude CLI - Manual Configuration",configs:(S=Q&&Q.trim()?Q:y?"<API_KEY_FROM_DASHBOARD>":"sk_10router",E={ANTHROPIC_BASE_URL:ev(),ANTHROPIC_AUTH_TOKEN:S},e.defaultModels.forEach(e=>{let s=o[e.alias];s&&e.envKey&&(E[e.envKey]=s)}),em&&(E.CLAUDE_CODE_AUTO_COMPACT_WINDOW=em),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:E},null,2)}])})]})})}function Z({tool:e,isExpanded:s,onToggle:t,baseUrl:n,apiKeys:o,activeProviders:c,cloudEnabled:m,initialStatus:x,tunnelEnabled:p,tunnelPublicUrl:f,tailscaleEnabled:b,tailscaleUrl:y}){let v,N,w,[k,C]=(0,a.useState)(x||null),[_,S]=(0,a.useState)(!1),[E,A]=(0,a.useState)(!1),[$,M]=(0,a.useState)(!1),[O,P]=(0,a.useState)(null),[R,z]=(0,a.useState)(!1),[T,L]=(0,a.useState)(""),[D,H]=(0,a.useState)([]),[F,q]=(0,a.useState)(""),[B,Y]=(0,a.useState)(!1),[J,V]=(0,a.useState)(!1),[G,X]=(0,a.useState)({}),[Q,ee]=(0,a.useState)(!1),[es,et]=(0,a.useState)("");(0,a.useEffect)(()=>{o?.length>0&&!T&&L(o[0].key)},[o,T]),(0,a.useEffect)(()=>{x&&C(x)},[x]),(0,a.useEffect)(()=>{s&&(k||eo(),el())},[s]);let el=async()=>{try{let e=await fetch("/api/models/alias"),s=await e.json();e.ok&&X(s.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(k?.profiles&&H(k.profiles.map(e=>e.model).filter(Boolean)),k?.config){let e=k.config.match(/^default_subagent_model\s*=\s*"([^"]+)"/m);e&&q(e[1])}},[k]);let er=(v=k?.config?.match(/base_url\s*=\s*"([^"]+)"/))?v[1]:"",ea=k?.installed?k.config?W(er,{tunnelPublicUrl:f,tailscaleUrl:y})?"configured":"other":"not_configured":null,en=()=>{let e=es||`${n}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},eo=async()=>{S(!0);try{let e=await fetch("/api/cli-tools/codex-settings"),s=await e.json();C(s)}catch(e){C({installed:!1,error:e.message})}finally{S(!1)}},ei=async()=>{A(!0),P(null);try{let e=T&&T.trim()||m?T:"sk_10router",s=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:en(),apiKey:e,models:D,subagentModel:F})}),t=await s.json();s.ok?(U(en(),{tunnelPublicUrl:f,tailscaleUrl:y}),P({type:"success",text:"Applied — models appear in codex /model. Account default kept; use codex --profile 10router-<model> for 10Router routing."}),eo()):P({type:"error",text:t.error||"Failed to apply settings"})}catch(e){P({type:"error",text:e.message})}finally{A(!1)}},ed=async()=>{M(!0),P(null);try{let e=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),s=await e.json();e.ok?(P({type:"success",text:"Settings reset successfully!"}),H([]),q(""),eo()):P({type:"error",text:s.error||"Failed to reset settings"})}catch(e){P({type:"error",text:e.message})}finally{M(!1)}};return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,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)(j.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"},loading:"lazy",decoding:"async"})}),(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-muted-foreground truncate",children:e.description})]})]})}),s&&(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-muted-foreground",children:[(0,l.jsx)(r.default,{name:"progress_activity",className:"animate-spin"}),(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)(r.default,{name:"warning",className:"text-yellow-500"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:k.container?"10Router runs in a container":"Codex CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:k.container?"The CLI lives on your host, not inside the container. Copy the manual config below into your host's ~/.codex/config.toml.":"Manual configuration is still available if 10router is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(d.$,{variant:"secondary",size:"sm",onClick:()=>ee(!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)(r.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:()=>z(!R),children:[(0,l.jsx)(r.default,{name:R?"expand_less":"help",className:"text-[18px] mr-1"}),R?"Hide":"How to Install"]})]})]}),R&&(0,l.jsxs)("div",{className:"p-4 bg-card 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-muted-foreground 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-muted-foreground",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-muted-foreground text-xs",children:["Codex reads custom providers from"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/config.toml"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!_&&k?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[k?.rootHijacked&&(0,l.jsxs)("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-xs bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",children:[(0,l.jsx)(r.default,{name:"warning",className:"text-[14px] shrink-0 mt-0.5"}),(0,l.jsx)("span",{children:"Old settings overrode your default Codex model. Apply to restore your ChatGPT account default — added models become profiles."})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)(I,{value:es||es||`${n}/v1`,onChange:et,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:f,tailscaleEnabled:b,tailscaleUrl:y,currentUrl:er})]}),k?.config&&(er?(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5",children:er})]}):null),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)(K,{value:T,onChange:L,apiKeys:o,cloudEnabled:m})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Models"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,l.jsx)("div",{className:"flex min-h-7 flex-wrap gap-1.5 rounded border border-border bg-card px-2 py-1.5",children:0===D.length?(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"No models added"}):D.map(e=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-transparent bg-black/5 px-2 py-0.5 text-xs text-muted-foreground hover:border-border dark:bg-white/5",children:[e,(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>H(D.filter(s=>s!==e)),className:"ml-0.5 hover:text-red-500",children:(0,l.jsx)(r.default,{name:"close",className:"text-[12px]"})})}),(0,l.jsx)(h.ZI,{children:"Remove"})]})]},e))}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("button",{onClick:()=>Y(!0),className:"cursor-pointer rounded border border-border bg-card px-2 py-1 text-xs text-foreground transition-colors hover:border-primary",children:"Add Model"}),(0,l.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Launch:"," ",(0,l.jsx)("code",{className:"rounded bg-black/5 px-1 dark:bg-white/5",children:"codex --profile 10router-<model>"})]})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Subagent Model"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:F,onChange:e=>q(e.target.value),placeholder:D[0]||"provider/model-id (defaults to main model)",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-card rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),F&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>q(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-muted-foreground hover:text-red-500 rounded transition-colors",children:(0,l.jsx)(r.default,{name:"close",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Clear (will use main model)"})]})]}),(0,l.jsx)("button",{onClick:()=>V(!0),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 bg-card border-border text-foreground hover:border-primary cursor-pointer",children:"Select Model"})]})]}),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)(r.default,{name:"success"===O.type?"check_circle":"error",className:"text-[14px]"}),(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)(d.$,{size:"sm",onClick:ei,disabled:!T&&m&&o.length>0||0===D.length||E,children:[E&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:ed,disabled:$,children:[$&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,l.jsxs)(d.$,{variant:"ghost",size:"sm",onClick:()=>ee(!0),children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),B&&(0,l.jsx)(i.rq,{isOpen:B,onClose:()=>Y(!1),onSelect:e=>{D.includes(e.value)||H([...D,e.value])},onDeselect:e=>{H(D.filter(s=>s!==e.value))},selectedModel:null,addedModelValues:D,closeOnSelect:!1,title:"Add Models for Codex",activeProviders:c,modelAliases:G}),J&&(0,l.jsx)(i.rq,{isOpen:J,onClose:()=>V(!1),onSelect:e=>{q(e.value),V(!1)},selectedModel:F,activeProviders:c,modelAliases:G,title:"Select Subagent Model for Codex"}),(0,l.jsx)(i.uR,{isOpen:Q,onClose:()=>ee(!1),title:"Codex CLI - Manual Configuration",configs:(N=T&&T.trim()?T:m?"<API_KEY_FROM_DASHBOARD>":"sk_10router",w=[{filename:"~/.codex/config.toml",content:`# 10Router Configuration for Codex CLI
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3554],{7006:(e,s,t)=>{Promise.resolve().then(t.bind(t,32063))},15764:(e,s,t)=>{"use strict";t.d(s,{CK:()=>i.default,G9:()=>m.default,Iz:()=>f.default,KX:()=>j.PanelSkeleton,LF:()=>a.default,LH:()=>x.default,Mu:()=>j.StatCardSkeleton,Nf:()=>d.default,Qv:()=>r.CardSkeleton,YW:()=>v.YW,gw:()=>g.default,jK:()=>c.default,nh:()=>b.default,pV:()=>v.pV,rq:()=>n.default,uR:()=>o.default,uo:()=>l.ConfirmModal,vE:()=>u.default,vj:()=>p.default,wI:()=>h.default,wn:()=>v.wn,zY:()=>v.zY}),t(58913);var l=t(3537),r=t(58350);t(30872),t(33526),t(42535),t(1279);var a=t(92802),n=t(25908),o=t(58729),i=t(24873),d=t(5258),c=t(80599);t(949),t(56776),t(53599),t(88336),t(69561);var m=t(37753),x=t(23444),u=t(93624),p=t(86920),h=t(65461);t(14580);var g=t(14670),f=t(70296);t(57779),t(22205);var j=t(43276),b=t(75862),v=t(92412)},32063:(e,s,t)=>{"use strict";t.d(s,{default:()=>en});var l=t(29798),r=t(58913),a=t(15814),n=t(50141),o=t.n(n),i=t(15764),d=t(18055),c=t(738),m=t(90046),x=t(80159),u=t(75669),p=t(45111),h=t(1352),g=t(69221),f=t(7896),j=t(16653),b=t(51660),v=t(77345);function y({storageKey:e,changeEvent:s,itemField:t,normalize:l=e=>e,defaultName:r=e=>e}){let a=()=>{try{let s=JSON.parse(window.localStorage.getItem(e)||"[]");if(!Array.isArray(s))return[];return s.filter(e=>e?.name&&e?.[t])}catch{return[]}},n=t=>{window.localStorage.setItem(e,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(s))};return{read:a,subscribe:e=>(window.addEventListener(s,e),()=>window.removeEventListener(s,e)),upsert:(e,s)=>{let o=l(e);if(!o)return null;let i=a(),d=i.find(e=>l(e[t])===o);if(d&&!s)return d.name;let c=(s||r(o)).trim();return c?(n([...i.filter(e=>e.name!==c&&l(e[t])!==o),{name:c,[t]:o}].sort((e,s)=>e.name.localeCompare(s.name))),c):null},remove:e=>n(a().filter(s=>s.name!==e))}}let N=e=>(e||"").replace(/\/+$/,""),w=y({storageKey:"10router.cliToolEndpointPresets",changeEvent:"10router:endpoint-presets-changed",itemField:"baseUrl",normalize:N,defaultName:e=>{try{return new URL(e).host}catch{return e}}}),k=y({storageKey:"10router.cliToolApiKeyPresets",changeEvent:"10router:api-key-presets-changed",itemField:"key"}),C=w.read,_=w.subscribe,S=w.upsert,E=w.remove,A=k.read,$=k.subscribe,M=k.upsert,O=k.remove;function U(e,{tunnelPublicUrl:s,tailscaleUrl:t,cloudUrl:l}={}){let r=N(e);return!r||[`http://127.0.0.1:${b._$}`,s,t,l].filter(Boolean).flatMap(e=>[N(e),`${N(e)}/v1`]).includes(r)?null:S(r)}let P="__custom__",R="__save__",z=e=>{let s=(e||"").replace(/\/+$/,"");return s?/\/v1$/.test(s)?s:`${s}/v1`:""};function I({value:e,onChange:s,requiresExternalUrl:t=!1,tunnelEnabled:n=!1,tunnelPublicUrl:o="",tailscaleEnabled:i=!1,tailscaleUrl:d="",cloudEnabled:c=!1,cloudUrl:m="",withV1:x=!0,currentUrl:u=""}){let[g,f]=(0,a.useState)([]),[j,y]=(0,a.useState)(!1),[w,k]=(0,a.useState)(""),[A,$]=(0,a.useState)(""),M=(0,a.useRef)(!1),O=(0,a.useRef)("");(0,a.useEffect)(()=>{let e=()=>{let e=C();f(e),k(s=>{if(s!==P)return s;let t=N(O.current);if(!t)return s;let l=e.find(e=>{let s=N(e.baseUrl);return s===t||s===z(t)});return l?`saved:${l.name}`:s})};return e(),y(!0),_(e)},[]);let U=(0,a.useMemo)(()=>(({requiresExternalUrl:e,tunnelEnabled:s,tunnelPublicUrl:t,tailscaleEnabled:l,tailscaleUrl:r,cloudEnabled:a,cloudUrl:n,savedPresets:o,withV1:i})=>{let d=[],c=e=>i?z(e):(e||"").replace(/\/+$/,"");if(!e){let e=c(`http://127.0.0.1:${b._$}`);d.push({value:"local",label:e,url:e})}if(s&&t){let e=c(t);d.push({value:"tunnel",label:e,url:e})}if(l&&r){let e=c(r);d.push({value:"tailscale",label:e,url:e})}if(a&&n){let e=c(n);d.push({value:"cloud",label:e,url:e})}return o.forEach(e=>{d.push({value:`saved:${e.name}`,label:e.baseUrl,url:e.baseUrl,saved:!0})}),d.push({value:P,label:"Custom URL...",url:""}),d})({requiresExternalUrl:t,tunnelEnabled:n,tunnelPublicUrl:o,tailscaleEnabled:i,tailscaleUrl:d,cloudEnabled:c,cloudUrl:m,savedPresets:g,withV1:x}),[t,n,o,i,d,c,m,g,x]);(0,a.useEffect)(()=>{if(M.current||!j||0===U.length)return;M.current=!0;let e=N(u),t=(e?U.find(s=>s.saved&&N(s.url)===e):null)||U.find(e=>e.value!==P);t?(k(t.value),s(t.url)):k(P)},[j,U,s,u]);let T=w.startsWith("saved:"),L=w===P,K=L&&(A||"").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)(p.l6,{value:w,onValueChange:t=>{if(t===R){let s=(e||"").trim();if(!s)return;let t=s;try{t=new URL(s).host}catch{}let l=window.prompt("Save endpoint as:",t),r=l?.trim()?S(s,l.trim()):null;r&&k(`saved:${r}`);return}if(k(t),t===P){$(""),s("");return}let l=U.find(e=>e.value===t);l&&s(l.url)},children:[(0,l.jsx)(p.bq,{className:"flex-1 min-w-0 text-xs",children:(0,l.jsx)(p.yv,{placeholder:"Select endpoint"})}),(0,l.jsxs)(p.gC,{children:[U.map(e=>(0,l.jsx)(p.eb,{value:e.value,title:e.label,children:e.label},e.value)),K&&(0,l.jsx)(p.eb,{value:R,children:"+ Save current as..."})]})]}),T&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{type:"button",onClick:()=>{if(!w.startsWith("saved:"))return;E(w.slice(6)),$("");let e=U.find(e=>e.value!==P&&e.value!==w);e?(k(e.value),s(e.url)):(k(P),s(""))},className:"p-1 text-muted-foreground hover:text-red-500 rounded transition-colors shrink-0",children:(0,l.jsx)(r.default,{name:"delete",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Delete saved endpoint"})]})]}),L&&(0,l.jsx)(v.p,{type:"text",value:A,onChange:e=>{let t=e.target.value;O.current=t,$(t),s(t)},placeholder:x?"https://example.com/v1":"https://example.com",className:"h-9 text-xs"})]})}let T="__custom__",L="__save_key__";function K({value:e,onChange:s,apiKeys:t=[],cloudEnabled:n=!1,className:o=""}){let[i,d]=(0,a.useState)([]),[c,m]=(0,a.useState)(!1),[x,u]=(0,a.useState)("");(0,a.useEffect)(()=>{let e=()=>d(A());return e(),$(e)},[]);let g=(0,a.useMemo)(()=>[...t.map(e=>({value:e.key,label:e.key})),...i.map(e=>({value:`saved:${e.name}`,label:e.key,url:e.key,saved:!0})),{value:T,label:"Custom...",url:""}],[t,i]),f=e?g.find(s=>s.value===e||s.url===e):null,j=f?f.value:c||e?T:g[0]?.value??T,b=c?x:e||"",y="string"==typeof j&&j.startsWith("saved:"),N=j===T,w=N&&(e||"").trim().length>0&&!t.some(s=>s.key===e);return 0!==t.length||0!==i.length||c||e?(0,l.jsxs)("div",{className:`flex flex-col gap-1.5 ${o}`,children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(p.l6,{value:j,onValueChange:t=>{if(t===L)return void M((e||"").trim());if(t===T){m(!0),u(""),s("");return}m(!1),u("");let l=g.find(e=>e.value===t);l&&s(l.url??l.value)},children:[(0,l.jsx)(p.bq,{className:"flex-1 min-w-0 text-xs",children:(0,l.jsx)(p.yv,{placeholder:"Select key"})}),(0,l.jsxs)(p.gC,{children:[g.map(e=>(0,l.jsx)(p.eb,{value:e.value,title:e.label,children:e.label},e.value)),w&&(0,l.jsx)(p.eb,{value:L,children:"+ Save current as..."})]})]}),y&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{type:"button",onClick:()=>{if(!y)return;O(j.slice(6)),m(!1),u("");let e=g.find(e=>e.value!==T&&e.value!==j);s(e?e.url??e.value:"")},className:"p-1 text-muted-foreground hover:text-red-500 rounded transition-colors shrink-0",children:(0,l.jsx)(r.default,{name:"delete",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Delete saved key"})]})]}),N&&(0,l.jsx)(v.p,{type:"text",value:b,onChange:e=>{let t=e.target.value;m(!0),u(t),s(t)},placeholder:"sk-...",className:"h-9 text-xs"})]}):(0,l.jsx)("span",{className:`min-w-0 rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5 ${o}`,children:n?"No API keys - Create one in Keys page":"sk_10router (default)"})}let D=e=>(e||"").replace(/\/+$/,"");function W(e,s={}){if(!e)return!1;let t=D(e),{tunnelPublicUrl:l,tailscaleUrl:r,cloudUrl:a}=s;return!!(/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(t)||l&&t.startsWith(D(l))||r&&t.startsWith(D(r))||a&&t.startsWith(D(a)))}let H=/\[1m\]$/i,F=t(65746).env.NEXT_PUBLIC_CLOUD_URL,q=[{label:"Default",value:""},{label:"200K",value:"198000"},{label:"300K",value:"298000"},{label:"500K",value:"498000"},{label:"700K",value:"698000"}];function B({tool:e,isExpanded:s,onToggle:t,activeProviders:n,modelMappings:o,onModelMappingChange:c,baseUrl:m,hasActiveProviders:x,apiKeys:b,cloudEnabled:v,initialStatus:y,tunnelEnabled:N,tunnelPublicUrl:w,tailscaleEnabled:k,tailscaleUrl:C}){let _,S,E,[A,$]=(0,a.useState)(y||null),[M,O]=(0,a.useState)(!1),[P,R]=(0,a.useState)(!1),[z,T]=(0,a.useState)(!1),[L,D]=(0,a.useState)(null),[Z,V]=(0,a.useState)(!1),[Y,J]=(0,a.useState)(!1),[G,X]=(0,a.useState)(null),[Q,ee]=(0,a.useState)(""),[es,et]=(0,a.useState)({}),[el,er]=(0,a.useState)(!1),[ea,en]=(0,a.useState)(""),[eo,ei]=(0,a.useState)(!1),[ed,ec]=(0,a.useState)(!1),[em,ex]=(0,a.useState)(""),[eu,ep]=(0,a.useState)(!1),eh=(0,a.useRef)(!1),eg=A?.settings?.env?.ANTHROPIC_BASE_URL||"",ef=(()=>{if(!A?.installed)return null;let e=A.settings?.env?.ANTHROPIC_BASE_URL;return e?W(e,{tunnelPublicUrl:w,tailscaleUrl:C,cloudUrl:v?F:null})?"configured":"other":"not_configured"})();(0,a.useEffect)(()=>{b?.length>0&&!Q&&ee(b[0].key)},[b,Q]),(0,a.useEffect)(()=>{y&&($(y),ec(!!y.exaMcpEnabled))},[y]),(0,a.useEffect)(()=>{ex(A?.settings?.env?.CLAUDE_CODE_AUTO_COMPACT_WINDOW||"")},[A?.settings?.env?.CLAUDE_CODE_AUTO_COMPACT_WINDOW]),(0,a.useEffect)(()=>{let s=A?.settings?.env;s&&ep(e.defaultModels.some(e=>s[e.envKey]?.endsWith("[1m]")))},[A?.settings?.env,e.defaultModels]),(0,a.useEffect)(()=>{s&&(A||ev(),eb())},[s]),(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{ei(!!e.ccFilterNaming)}).catch(()=>{})},[]);let ej=async e=>{let s=!0===e;ei(s),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:s})}).catch(()=>{})},eb=async()=>{try{let e=await fetch("/api/models/alias"),s=await e.json();e.ok&&et(s.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(A?.installed&&!eh.current){eh.current=!0;let s=A.settings?.env||{};e.defaultModels.forEach(e=>{if(e.envKey){let t=s[e.envKey]||e.defaultValue||"";t&&c(e.alias,t)}});let t=s.ANTHROPIC_AUTH_TOKEN;t&&ee(t)}},[A,b,e.defaultModels,c]);let ev=async()=>{O(!0);try{let e=await fetch("/api/cli-tools/claude-settings"),s=await e.json();$(s),ec(!!s.exaMcpEnabled)}catch(e){$({installed:!1,error:e.message})}finally{O(!1)}},ey=()=>{let e=ea||m;return e.endsWith("/v1")?e:`${e}/v1`},eN=async()=>{R(!0),D(null);try{let s={ANTHROPIC_BASE_URL:ey()},t=Q?.trim()||(b?.length>0?b[0].key:null)||(v?null:"sk_10router");t&&(s.ANTHROPIC_AUTH_TOKEN=t),e.defaultModels.forEach(e=>{let t=o[e.alias];t&&e.envKey&&(s[e.envKey]=t)}),em&&(s.CLAUDE_CODE_AUTO_COMPACT_WINDOW=em),e.envVars?.todoTools&&(s[e.envVars.todoTools]="1");let l=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:s,exaMcpEnabled:ed,autoCompactWindow:em})}),r=await l.json();l.ok?(U(ey(),{tunnelPublicUrl:w,tailscaleUrl:C}),D({type:"success",text:"Settings applied successfully!"}),$(e=>({...e,hasBackup:!0,settings:{...e?.settings,env:s},exaMcpEnabled:ed}))):D({type:"error",text:r.error||"Failed to apply settings"})}catch(e){D({type:"error",text:e.message})}finally{R(!1)}},ew=async()=>{T(!0),D(null);try{let s=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),t=await s.json();s.ok?(D({type:"success",text:"Settings reset successfully!"}),e.defaultModels.forEach(e=>c(e.alias,e.defaultValue||"")),ee(""),ec(!1),ex(""),ep(!1)):D({type:"error",text:t.error||"Failed to reset settings"})}catch(e){D({type:"error",text:e.message})}finally{T(!1)}};return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,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)(j.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"},loading:"lazy",decoding:"async"})}),(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"===ef&&(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"===ef&&(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"===ef&&(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-muted-foreground truncate",children:e.description})]})]})}),s&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[M&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,l.jsx)(r.default,{name:"progress_activity",className:"animate-spin"}),(0,l.jsx)("span",{children:"Checking Claude CLI..."})]}),!M&&A&&!A.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)(r.default,{name:"warning",className:"text-yellow-500"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:A.container?"10Router runs in a container":"Claude CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:A.container?"The CLI lives on your host, not inside the container. Copy the manual config below into your host's ~/.claude/settings.json.":"Manual configuration is still available if 10router is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(d.$,{variant:"secondary",size:"sm",onClick:()=>er(!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)(r.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:()=>V(!Z),children:[(0,l.jsx)(r.default,{name:Z?"expand_less":"help",className:"text-[18px] mr-1"}),Z?"Hide":"How to Install"]})]})]}),Z&&(0,l.jsxs)("div",{className:"p-4 bg-card 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-muted-foreground 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-muted-foreground",children:["After installation, run"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!M&&A?.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_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)(I,{value:ea||((_=ea||m).endsWith("/v1")?_:`${_}/v1`),onChange:en,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:N,tunnelPublicUrl:w,tailscaleEnabled:k,tailscaleUrl:C,currentUrl:eg})]}),A?.settings?.env?.ANTHROPIC_BASE_URL&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5",children:A.settings.env.ANTHROPIC_BASE_URL})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)(K,{value:Q,onChange:ee,apiKeys:b,cloudEnabled:v})]}),e.defaultModels.map(e=>(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:e.name}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:o[e.alias]||"",onChange:s=>c(e.alias,s.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-card 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.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>c(e.alias,""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-muted-foreground hover:text-red-500 rounded transition-colors",children:(0,l.jsx)(r.default,{name:"close",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Clear"})]})]}),(0,l.jsx)("button",{onClick:()=>{X(e.alias),J(!0)},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 bg-card border-border text-foreground hover:border-primary cursor-pointer",children:"Select Model"})]},e.alias)),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Auto-compact"}),(0,l.jsxs)(p.l6,{value:em||"__default__",onValueChange:e=>ex("__default__"===e?"":e),children:[(0,l.jsx)(p.bq,{className:"w-full text-xs",children:(0,l.jsx)(p.yv,{})}),(0,l.jsx)(p.gC,{children:q.map(e=>(0,l.jsx)(p.eb,{value:e.value||"__default__",children:e.label},e.label))})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"1M context"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)(f.S,{checked:eu,onCheckedChange:s=>{var t;ep(t=!0===s),e.defaultModels.forEach(e=>{let s=o[e.alias];s&&c(e.alias,((e,s)=>{let{model:t}=function(e){if("string"!=typeof e)return{model:e,contextMarker:null};let s=e.trim(),t=s.match(H);return t?{model:s.slice(0,-t[0].length),contextMarker:t[0].slice(1,-1).toLowerCase()}:{model:e,contextMarker:null}}(e);return s?`${t}[1m]`:t})(s,t))})}}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Append [1m] to the model name"}),(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("span",{className:"relative inline-flex",children:(0,l.jsx)(r.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,l.jsx)(h.ZI,{side:"top",children:"Claude Code otherwise assumes a 200K window, which clamps the auto-compact window above. Applied to every mapped model — only enable it for models that really accept 1M."})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Filter naming"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)(f.S,{checked:eo,onCheckedChange:ej}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Filter naming requests"}),(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("span",{className:"relative inline-flex",children:(0,l.jsx)(r.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,l.jsx)(h.ZI,{side:"top",children:"Intercepts Claude Code's topic-naming requests and returns a fake response locally, saving API tokens."})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Web Search"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)(f.S,{checked:ed,onCheckedChange:e=>ec(!0===e)}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Exa MCP"}),(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("span",{className:"relative inline-flex",children:(0,l.jsx)(r.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,l.jsx)(h.ZI,{side:"top",children:"Injects Exa MCP into ~/.claude.json so non-Claude models gain web search. Restart Claude Code after Apply."})]})]})]})]}),L&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===L.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)(r.default,{name:"success"===L.type?"check_circle":"error",className:"text-[14px]"}),(0,l.jsx)("span",{children:L.text})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(d.$,{size:"sm",onClick:eN,disabled:P,children:[P&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:ew,disabled:!A?.has10Router||z,children:[z&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,l.jsxs)(d.$,{variant:"ghost",size:"sm",onClick:()=>er(!0),children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),Y&&(0,l.jsx)(i.rq,{isOpen:Y,onClose:()=>J(!1),onSelect:e=>{G&&c(G,e.value)},selectedModel:G?o[G]:null,activeProviders:n,modelAliases:es,title:`Select model for ${G}`}),(0,l.jsx)(i.uR,{isOpen:el,onClose:()=>er(!1),title:"Claude CLI - Manual Configuration",configs:(S=Q&&Q.trim()?Q:v?"<API_KEY_FROM_DASHBOARD>":"sk_10router",E={ANTHROPIC_BASE_URL:ey(),ANTHROPIC_AUTH_TOKEN:S},e.defaultModels.forEach(e=>{let s=o[e.alias];s&&e.envKey&&(E[e.envKey]=s)}),em&&(E.CLAUDE_CODE_AUTO_COMPACT_WINDOW=em),e.envVars?.todoTools&&(E[e.envVars.todoTools]="1"),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:E},null,2)}])})]})})}function Z({tool:e,isExpanded:s,onToggle:t,baseUrl:n,apiKeys:o,activeProviders:c,cloudEnabled:m,initialStatus:x,tunnelEnabled:p,tunnelPublicUrl:f,tailscaleEnabled:b,tailscaleUrl:v}){let y,N,w,[k,C]=(0,a.useState)(x||null),[_,S]=(0,a.useState)(!1),[E,A]=(0,a.useState)(!1),[$,M]=(0,a.useState)(!1),[O,P]=(0,a.useState)(null),[R,z]=(0,a.useState)(!1),[T,L]=(0,a.useState)(""),[D,H]=(0,a.useState)([]),[F,q]=(0,a.useState)(""),[B,V]=(0,a.useState)(!1),[Y,J]=(0,a.useState)(!1),[G,X]=(0,a.useState)({}),[Q,ee]=(0,a.useState)(!1),[es,et]=(0,a.useState)("");(0,a.useEffect)(()=>{o?.length>0&&!T&&L(o[0].key)},[o,T]),(0,a.useEffect)(()=>{x&&C(x)},[x]),(0,a.useEffect)(()=>{s&&(k||eo(),el())},[s]);let el=async()=>{try{let e=await fetch("/api/models/alias"),s=await e.json();e.ok&&X(s.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(k?.profiles&&H(k.profiles.map(e=>e.model).filter(Boolean)),k?.config){let e=k.config.match(/^default_subagent_model\s*=\s*"([^"]+)"/m);e&&q(e[1])}},[k]);let er=(y=k?.config?.match(/base_url\s*=\s*"([^"]+)"/))?y[1]:"",ea=k?.installed?k.config?W(er,{tunnelPublicUrl:f,tailscaleUrl:v})?"configured":"other":"not_configured":null,en=()=>{let e=es||`${n}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},eo=async()=>{S(!0);try{let e=await fetch("/api/cli-tools/codex-settings"),s=await e.json();C(s)}catch(e){C({installed:!1,error:e.message})}finally{S(!1)}},ei=async()=>{A(!0),P(null);try{let e=T&&T.trim()||m?T:"sk_10router",s=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:en(),apiKey:e,models:D,subagentModel:F})}),t=await s.json();s.ok?(U(en(),{tunnelPublicUrl:f,tailscaleUrl:v}),P({type:"success",text:"Applied — models appear in codex /model. Account default kept; use codex --profile 10router-<model> for 10Router routing."}),eo()):P({type:"error",text:t.error||"Failed to apply settings"})}catch(e){P({type:"error",text:e.message})}finally{A(!1)}},ed=async()=>{M(!0),P(null);try{let e=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),s=await e.json();e.ok?(P({type:"success",text:"Settings reset successfully!"}),H([]),q(""),eo()):P({type:"error",text:s.error||"Failed to reset settings"})}catch(e){P({type:"error",text:e.message})}finally{M(!1)}};return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,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)(j.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"},loading:"lazy",decoding:"async"})}),(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-muted-foreground truncate",children:e.description})]})]})}),s&&(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-muted-foreground",children:[(0,l.jsx)(r.default,{name:"progress_activity",className:"animate-spin"}),(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)(r.default,{name:"warning",className:"text-yellow-500"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:k.container?"10Router runs in a container":"Codex CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:k.container?"The CLI lives on your host, not inside the container. Copy the manual config below into your host's ~/.codex/config.toml.":"Manual configuration is still available if 10router is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(d.$,{variant:"secondary",size:"sm",onClick:()=>ee(!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)(r.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:()=>z(!R),children:[(0,l.jsx)(r.default,{name:R?"expand_less":"help",className:"text-[18px] mr-1"}),R?"Hide":"How to Install"]})]})]}),R&&(0,l.jsxs)("div",{className:"p-4 bg-card 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-muted-foreground 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-muted-foreground",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-muted-foreground text-xs",children:["Codex reads custom providers from"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/config.toml"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!_&&k?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[k?.rootHijacked&&(0,l.jsxs)("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-xs bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",children:[(0,l.jsx)(r.default,{name:"warning",className:"text-[14px] shrink-0 mt-0.5"}),(0,l.jsx)("span",{children:"Old settings overrode your default Codex model. Apply to restore your ChatGPT account default — added models become profiles."})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)(I,{value:es||es||`${n}/v1`,onChange:et,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:f,tailscaleEnabled:b,tailscaleUrl:v,currentUrl:er})]}),k?.config&&(er?(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5",children:er})]}):null),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)(K,{value:T,onChange:L,apiKeys:o,cloudEnabled:m})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Models"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,l.jsx)("div",{className:"flex min-h-7 flex-wrap gap-1.5 rounded border border-border bg-card px-2 py-1.5",children:0===D.length?(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"No models added"}):D.map(e=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-transparent bg-black/5 px-2 py-0.5 text-xs text-muted-foreground hover:border-border dark:bg-white/5",children:[e,(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>H(D.filter(s=>s!==e)),className:"ml-0.5 hover:text-red-500",children:(0,l.jsx)(r.default,{name:"close",className:"text-[12px]"})})}),(0,l.jsx)(h.ZI,{children:"Remove"})]})]},e))}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("button",{onClick:()=>V(!0),className:"cursor-pointer rounded border border-border bg-card px-2 py-1 text-xs text-foreground transition-colors hover:border-primary",children:"Add Model"}),(0,l.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Launch:"," ",(0,l.jsx)("code",{className:"rounded bg-black/5 px-1 dark:bg-white/5",children:"codex --profile 10router-<model>"})]})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Subagent Model"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:F,onChange:e=>q(e.target.value),placeholder:D[0]||"provider/model-id (defaults to main model)",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-card rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),F&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>q(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-muted-foreground hover:text-red-500 rounded transition-colors",children:(0,l.jsx)(r.default,{name:"close",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Clear (will use main model)"})]})]}),(0,l.jsx)("button",{onClick:()=>J(!0),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 bg-card border-border text-foreground hover:border-primary cursor-pointer",children:"Select Model"})]})]}),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)(r.default,{name:"success"===O.type?"check_circle":"error",className:"text-[14px]"}),(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)(d.$,{size:"sm",onClick:ei,disabled:!T&&m&&o.length>0||0===D.length||E,children:[E&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:ed,disabled:$,children:[$&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,l.jsxs)(d.$,{variant:"ghost",size:"sm",onClick:()=>ee(!0),children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),B&&(0,l.jsx)(i.rq,{isOpen:B,onClose:()=>V(!1),onSelect:e=>{D.includes(e.value)||H([...D,e.value])},onDeselect:e=>{H(D.filter(s=>s!==e.value))},selectedModel:null,addedModelValues:D,closeOnSelect:!1,title:"Add Models for Codex",activeProviders:c,modelAliases:G}),Y&&(0,l.jsx)(i.rq,{isOpen:Y,onClose:()=>J(!1),onSelect:e=>{q(e.value),J(!1)},selectedModel:F,activeProviders:c,modelAliases:G,title:"Select Subagent Model for Codex"}),(0,l.jsx)(i.uR,{isOpen:Q,onClose:()=>ee(!1),title:"Codex CLI - Manual Configuration",configs:(N=T&&T.trim()?T:m?"<API_KEY_FROM_DASHBOARD>":"sk_10router",w=[{filename:"~/.codex/config.toml",content:`# 10Router Configuration for Codex CLI
|
|
2
2
|
# Default model/provider stay on your ChatGPT account — only the provider
|
|
3
3
|
# definition below is added. Selected models are merged into
|
|
4
4
|
# model_catalog_json (~/.codex/10router-model-catalog.json) so they show in
|
|
@@ -19,7 +19,7 @@ model_catalog_json = "10router-model-catalog.json"
|
|
|
19
19
|
${F?`
|
|
20
20
|
[agents]
|
|
21
21
|
default_subagent_model = "${F}"
|
|
22
|
-
`:""}`})}),w)})]})})}var Y=t(63729),J=t(63523);function V({toolId:e,tool:s,isExpanded:t,onToggle:n,baseUrl:o,apiKeys:d,activeProviders:c=[],cloudEnabled:m=!1,tunnelEnabled:x=!1}){let[p,g]=(0,a.useState)(null),[f,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(""),[N,w]=(0,a.useState)(()=>d?.length>0?d[0].key:""),k=e=>{let s=N&&N.trim()?N:m?"your-api-key":"sk_10router",t=o||"http://localhost:20128",l=t.endsWith("/v1")?t:`${t}/v1`;return e.replace(/\{\{baseUrl\}\}/g,l).replace(/\{\{apiKey\}\}/g,s).replace(/\{\{model\}\}/g,y||"provider/model-id")},{copy:C}=(0,J.C)(),_=async(e,s)=>{await C(k(e),`toolcard-${s}`),g(s),setTimeout(()=>g(null),2e3)},S=()=>(!s.requiresExternalUrl||!!m||!!x)&&(!s.requiresCloud||!!m);return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden overflow-x-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:n,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:(()=>{if(s.image)return(0,l.jsx)(j.default,{src:s.image,alt:s.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"});if(s.icon)return(0,l.jsx)(r.default,{name:s.icon,className:"text-xl",style:{color:s.color}});let t=(0,Y.HY)(e);return t?(0,l.jsx)(j.default,{src:t,alt:s.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:s=>{(0,Y.Kw)(e),s.target.style.display="none"},loading:"lazy",decoding:"async"}):(0,l.jsx)("span",{className:"text-xs font-bold",style:{color:s.color},children:(e||"?").slice(0,2).toUpperCase()})})()}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:s.name}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:s.description})]})]})}),t&&(0,l.jsx)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:s.guideSteps?(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[s.notes&&0!==s.notes.length?(0,l.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:s.notes.map((e,s)=>{if("cloudCheck"===e.type&&(m||x))return null;let t="warning"===e.type,a="cloudCheck"===e.type&&!m&&!x,n="bg-blue-500/10 border-blue-500/30",o="text-blue-600 dark:text-blue-400",i="text-blue-500",d="info";return t?(n="bg-yellow-500/10 border-yellow-500/30",o="text-yellow-600 dark:text-yellow-400",i="text-yellow-500",d="warning"):a&&(n="bg-red-500/10 border-red-500/30",o="text-red-600 dark:text-red-400",i="text-red-500",d="error"),(0,l.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${n}`,children:[(0,l.jsx)(r.default,{name:d,className:`text-lg ${i}`}),(0,l.jsx)("p",{className:`text-sm ${o}`,children:e.text})]},s)})}):null,S()&&s.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:s.color},children:e.step}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("p",{className:"font-medium text-foreground",children:e.title}),e.desc&&(0,l.jsx)("p",{className:"text-sm text-muted-foreground 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)(K,{value:N,onChange:w,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=>v(e.target.value),placeholder:"provider/model-id",className:"w-full sm:w-auto flex-1 px-3 py-2 bg-muted rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>b(!0),className:"shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors bg-muted border-border text-foreground hover:border-primary cursor-pointer",children:"Select Model"}),y&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{onClick:()=>_(y,"model"),className:"shrink-0 px-3 py-2 bg-muted hover:bg-muted rounded-lg border border-border transition-colors",children:(0,l.jsx)(r.default,{name:"model"===p?"check":"content_copy",className:"text-lg"})}),(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>v(""),className:"p-2 text-muted-foreground hover:text-red-500 rounded transition-colors",children:(0,l.jsx)(r.default,{name:"close",className:"text-lg"})})}),(0,l.jsx)(h.ZI,{children:"Clear"})]})]})]}),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-muted rounded-lg text-sm font-mono border border-border truncate",children:k(e.value)}),e.copyable&&(0,l.jsx)("button",{onClick:()=>_(e.value,`${e.step}-${e.title}`),className:"shrink-0 px-3 py-2 bg-muted hover:bg-muted rounded-lg border border-border transition-colors",children:(0,l.jsx)(r.default,{name:p===`${e.step}-${e.title}`?"check":"content_copy",className:"text-lg"})})]})]})]},e.step)),S()&&s.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-muted-foreground uppercase tracking-wide",children:s.codeBlock.language}),(0,l.jsxs)("button",{onClick:()=>_(s.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-muted hover:bg-muted rounded border border-border transition-colors",children:[(0,l.jsx)(r.default,{name:"codeblock"===p?"check":"content_copy",className:"text-sm"}),"codeblock"===p?"Copied!":"Copy"]})]}),(0,l.jsx)("pre",{className:"p-4 bg-muted rounded-lg border border-border overflow-x-auto",children:(0,l.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:k(s.codeBlock.code)})})]})]}):(0,l.jsx)("p",{className:"text-muted-foreground text-sm",children:"Coming soon..."})}),f&&(0,l.jsx)(i.rq,{isOpen:f,onClose:()=>b(!1),onSelect:e=>{v(e.value)},selectedModel:y,activeProviders:c,title:"Select Model"})]})})}function G({tool:e,isExpanded:s,onToggle:t,baseUrl:n,apiKeys:o,activeProviders:c,cloudEnabled:m,initialStatus:x,tunnelEnabled:p,tunnelPublicUrl:f,tailscaleEnabled:b,tailscaleUrl:y}){let v,N,w,k,C,[_,S]=(0,a.useState)(x||null),[E,A]=(0,a.useState)(!1),[$,M]=(0,a.useState)(!1),[O,P]=(0,a.useState)(!1),[R,z]=(0,a.useState)(null),[T,L]=(0,a.useState)(!1),[D,H]=(0,a.useState)(""),[F,q]=(0,a.useState)(""),[B,Z]=(0,a.useState)(""),[Y,J]=(0,a.useState)(!1),[V,X]=(0,a.useState)(!1),[Q,ee]=(0,a.useState)({}),[es,et]=(0,a.useState)(!1),[el,er]=(0,a.useState)(""),[ea,en]=(0,a.useState)([]),[eo,ei]=(0,a.useState)(""),ed=(0,a.useRef)([]);(0,a.useEffect)(()=>{ed.current=ea},[ea]),(0,a.useEffect)(()=>{o?.length>0&&!D&&H(o[0].key)},[o,D]),(0,a.useEffect)(()=>{x&&S(x)},[x]),(0,a.useEffect)(()=>{s&&(_||eh(),ec())},[s]),(0,a.useEffect)(()=>{_?.opencode?.models&&en(_.opencode.models),_?.opencode?.activeModel&&ei(_.opencode.activeModel),_?.config?.agent?.explorer?.model?.startsWith("10router/")&&Z(_.config.agent.explorer.model.replace("10router/",""))},[_]);let ec=async()=>{try{let e=await fetch("/api/models/alias"),s=await e.json();e.ok&&ee(s.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},em=async e=>{try{let s=D&&D.trim()||m?D:"sk_10router",t=e.includes(eo)?eo:e[0]||"";await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ep(),apiKey:s,models:e,activeModel:t,subagentModel:B})})}catch(e){console.log("Error saving models:",e)}},ex=_?.config?.provider?.["10router"]?.options?.baseURL||"",eu=_?.installed?_.config&&_.has10Router?W(_.config?.provider?.["10router"]?.options?.baseURL||"",{tunnelPublicUrl:f,tailscaleUrl:y})?"configured":"other":"not_configured":null,ep=()=>{let e=el||n;return e.endsWith("/v1")?e:`${e}/v1`},eh=async()=>{A(!0);try{let e=await fetch("/api/cli-tools/opencode-settings"),s=await e.json();S(s)}catch(e){S({installed:!1,error:e.message})}finally{A(!1)}},eg=async()=>{M(!0),z(null);try{let e=D&&D.trim()||m?D:"sk_10router",s=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ep(),apiKey:e,models:ea,activeModel:""===eo?"":eo||ea[0],subagentModel:B})}),t=await s.json();s.ok?(U(ep(),{tunnelPublicUrl:f,tailscaleUrl:y}),z({type:"success",text:"Settings applied successfully!"}),eh()):z({type:"error",text:t.error||"Failed to apply settings"})}catch(e){z({type:"error",text:e.message})}finally{M(!1)}},ef=async()=>{P(!0),z(null);try{let e=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),s=await e.json();e.ok?(z({type:"success",text:"Settings reset successfully!"}),q(""),Z(""),en([]),ei(""),eh()):z({type:"error",text:s.error||"Failed to reset settings"})}catch(e){z({type:"error",text:e.message})}finally{P(!1)}};return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,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)(j.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"},loading:"lazy",decoding:"async"})}),(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"===eu&&(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"===eu&&(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"===eu&&(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-muted-foreground truncate",children:e.description})]})]})}),s&&(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-muted-foreground",children:[(0,l.jsx)(r.default,{name:"progress_activity",className:"animate-spin"}),(0,l.jsx)("span",{children:"Checking OpenCode 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)(r.default,{name:"warning",className:"text-yellow-500"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:_.container?"10Router runs in a container":"OpenCode CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:_.container?"The CLI lives on your host, not inside the container. Copy the manual config below into your host's opencode.json.":"Manual configuration is still available if 10router is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(d.$,{variant:"secondary",size:"sm",onClick:()=>et(!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)(r.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:()=>L(!T),children:[(0,l.jsx)(r.default,{name:T?"expand_less":"help",className:"text-[18px] mr-1"}),T?"Hide":"How to Install"]})]})]}),T&&(0,l.jsxs)("div",{className:"p-4 bg-card 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-muted-foreground 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-muted-foreground",children:["After installation, run"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"opencode"})," 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_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)(I,{value:el||el||`${n}/v1`,onChange:er,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:f,tailscaleEnabled:b,tailscaleUrl:y,currentUrl:ex})]}),_?.config?.provider?.["10router"]?.options?.baseURL&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5",children:_.config.provider["10router"].options.baseURL})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)(K,{value:D,onChange:H,apiKeys:o,cloudEnabled:m})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Models"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,l.jsx)("div",{className:"flex min-h-7 flex-wrap gap-1.5 rounded border border-border bg-card px-2 py-1.5",children:0===ea.length?(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"No models selected"}):ea.map(e=>(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsxs)("span",{onClick:async()=>{if(e===eo)try{(await fetch("/api/cli-tools/opencode-settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({clearActiveModel:!0})})).ok&&(ei(""),eh())}catch(e){console.log("Error clearing active model:",e)}else ei(e)},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs cursor-pointer transition-colors ${e===eo?"bg-primary/10 text-primary border border-primary":"bg-black/5 dark:bg-white/5 text-muted-foreground border border-transparent hover:border-border"}`,children:[e===eo&&(0,l.jsx)(r.default,{name:"star",className:"text-[10px]"}),e,(0,l.jsx)("button",{onClick:async s=>{s.stopPropagation();try{if((await fetch(`/api/cli-tools/opencode-settings?model=${encodeURIComponent(e)}`,{method:"DELETE"})).ok){let s=ea.filter(s=>s!==e);en(s),eo===e&&ei(""),eh()}}catch(e){console.log("Error removing model:",e)}},className:"ml-0.5 hover:text-red-500",children:(0,l.jsx)(r.default,{name:"close",className:"text-[12px]"})})]})}),(0,l.jsx)(h.ZI,{children:e===eo?"Click to clear active model":"Click to set as active"})]},e))}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("button",{onClick:()=>J(!0),className:"cursor-pointer rounded border border-border bg-card px-2 py-1 text-xs text-foreground transition-colors hover:border-primary",children:"Add Model"}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:ea.length>0&&eo?(0,l.jsxs)(l.Fragment,{children:["Active: ",(0,l.jsx)("span",{className:"text-primary",children:eo})]}):ea.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_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Subagent Model"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:B,onChange:e=>Z(e.target.value),placeholder:ea[0]||"provider/model-id (defaults to main model)",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-card rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),B&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>Z(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-muted-foreground hover:text-red-500 rounded transition-colors",children:(0,l.jsx)(r.default,{name:"close",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Clear (will use main model)"})]})]}),(0,l.jsx)("button",{onClick:()=>X(!0),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 bg-card border-border text-foreground hover:border-primary cursor-pointer",children:"Select Model"})]})]}),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)(r.default,{name:"success"===R.type?"check_circle":"error",className:"text-[14px]"}),(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)(d.$,{size:"sm",onClick:eg,disabled:0===ea.length||$,children:[$&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:ef,disabled:!_.has10Router||O,children:[O&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,l.jsxs)(d.$,{variant:"ghost",size:"sm",onClick:()=>et(!0),children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),Y&&(0,l.jsx)(i.rq,{isOpen:Y,onClose:()=>{J(!1),em(ed.current)},onSelect:e=>{!ea.includes(e.value)&&(en([...ea,e.value]),eo||ei(e.value))},onDeselect:e=>{let s=ea.filter(s=>s!==e.value);en(s),eo===e.value&&ei(s[0]||"")},selectedModel:null,activeProviders:c,modelAliases:Q,addedModelValues:ea,closeOnSelect:!1,title:"Add Model for OpenCode"}),V&&(0,l.jsx)(i.rq,{isOpen:V,onClose:()=>X(!1),onSelect:e=>{Z(e.value),X(!1)},selectedModel:B,activeProviders:c,modelAliases:Q,title:"Select Subagent Model for OpenCode"}),(0,l.jsx)(i.uR,{isOpen:es,onClose:()=>et(!1),title:"OpenCode - Manual Configuration",configs:(v=D&&D.trim()?D:m?"<API_KEY_FROM_DASHBOARD>":"sk_10router",N=ea.length>0?ea:["provider/model-id"],w=eo||ea[0]||N[0],k=B||w,C={},N.forEach(e=>{C[e]={name:e,modalities:{input:["text","image"],output:["text"]}}}),[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{"10router":{npm:"@ai-sdk/openai-compatible",options:{baseURL:ep(),apiKey:v},models:C}},model:`10router/${w}`,agent:{explorer:{description:"Fast explorer subagent for codebase exploration",mode:"subagent",model:`10router/${k}`}}},null,2)}])})]})})}var X=t(49787);let Q="/api/cli-tools/cowork-settings",ee=e=>(e||"").replace(/\/v1\/?$/,"");function es({tool:e,isExpanded:s,onToggle:t,baseUrl:n,apiKeys:o,activeProviders:c,hasActiveProviders:m,cloudEnabled:x,cloudUrl:p,tunnelEnabled:h,tunnelPublicUrl:b,tailscaleEnabled:v,tailscaleUrl:N,initialStatus:w}){let k,C,_,S,[E,A]=(0,a.useState)(w||null),[$,M]=(0,a.useState)(!1),[O,P]=(0,a.useState)(!1),[R,z]=(0,a.useState)(!1),[T,L]=(0,a.useState)(null),[D,W]=(0,a.useState)(""),[H,F]=(0,a.useState)([]),[q,B]=(0,a.useState)(!1),[Z,Y]=(0,a.useState)(""),[J,V]=(0,a.useState)([]),[G,et]=(0,a.useState)([]),[el,er]=(0,a.useState)([]),[ea,en]=(0,a.useState)({}),[eo,ei]=(0,a.useState)(!1),[ed,ec]=(0,a.useState)(!1),[em,ex]=(0,a.useState)(!1),[eu,ep]=(0,a.useState)(!1),[eh,eg]=(0,a.useState)({name:"",url:""});(0,a.useEffect)(()=>{o?.length>0&&!D&&W(o[0].key)},[o,D]),(0,a.useEffect)(()=>{w&&A(w)},[w]),(0,a.useEffect)(()=>{s&&!E&&ef()},[s]),(0,a.useEffect)(()=>{s&&fetch("/api/models/alias").then(e=>e.ok?e.json():null).then(e=>{e&&en(e.aliases||{})}).catch(()=>{})},[s]),(0,a.useEffect)(()=>{E?.cowork?.models?.length&&F(E.cowork.models),E?.cowork?.baseUrl&&!Z&&Y(ee(E.cowork.baseUrl)),Array.isArray(E?.cowork?.plugins)&&E.cowork.plugins.length>0?V(E.cowork.plugins):0===J.length&&Array.isArray(E?.defaultPlugins)&&V(E.defaultPlugins),Array.isArray(E?.cowork?.localPlugins)&&et(E.cowork.localPlugins),Array.isArray(E?.cowork?.customPlugins)&&E.cowork.customPlugins.length>0&&er(E.cowork.customPlugins)},[E]);let ef=async()=>{M(!0);try{let e=await fetch(Q),s=await e.json();A(s)}catch(e){A({installed:!1,error:e.message})}finally{M(!1)}},ej=()=>{let e;return(e=(Z||"").replace(/\/+$/,""))?/\/v1$/.test(e)?e:`${e}/v1`:""},eb=E?.cowork?.baseUrl||"",ey=E?.installed?E?.cowork?.baseUrl?E.has10Router?"configured":"other":"not_configured":null,ev=async()=>{L(null);let e=ej();if(0===H.length)return void L({type:"error",text:"Please select at least one model"});P(!0);try{let s=D?.trim()||(o?.length>0?o[0].key:null)||(x?null:"sk_10router"),t=await fetch(Q,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:e,apiKey:s,models:H,plugins:J,localPlugins:G,customPlugins:el})}),l=await t.json();t.ok?(U(ej(),{tunnelPublicUrl:b,tailscaleUrl:N}),L({type:"success",text:"Settings applied. Quit & reopen Claude Desktop to load."}),ef()):L({type:"error",text:l.error||"Failed to apply settings"})}catch(e){L({type:"error",text:e.message})}finally{P(!1)}},eN=async({name:e,models:s})=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,models:s})});if(!t.ok){let e=await t.json();L({type:"error",text:e.error||"Failed to create combo"});return}H.includes(e)||F([...H,e]),ei(!1),L({type:"success",text:`Combo "${e}" created and added.`})}catch(e){L({type:"error",text:e.message})}},ew=e=>{let s=e?.value||e?.name||e;F(e=>e.filter(e=>e!==s))},ek=async()=>{z(!0),L(null);try{let e=await fetch(Q,{method:"DELETE"}),s=await e.json();e.ok?(L({type:"success",text:"Settings reset successfully"}),F([]),V(E?.defaultPlugins||[]),et([]),er([]),ef()):L({type:"error",text:s.error||"Failed to reset"})}catch(e){L({type:"error",text:e.message})}finally{z(!1)}};return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,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)(j.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"},loading:"lazy",decoding:"async"})}),(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"===ey&&(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"===ey&&(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"===ey&&(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-muted-foreground truncate",children:e.description})]})]})}),s&&(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-muted-foreground",children:[(0,l.jsx)(r.default,{name:"progress_activity",className:"animate-spin"}),(0,l.jsx)("span",{children:"Checking Claude Cowork..."})]}),!$&&E&&!E.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)(r.default,{name:"warning",className:"text-yellow-500"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:E.container?"10Router runs in a container":"Claude Desktop (Cowork mode) not detected"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:E.container?"The app lives on your host, not inside the container. Copy the manual config below into the host app config.":"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)(d.$,{variant:"secondary",size:"sm",onClick:()=>B(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]})})]}),!$&&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_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)(I,{value:ej(),onChange:e=>Y(ee(e)),tunnelEnabled:h,tunnelPublicUrl:b,tailscaleEnabled:v,tailscaleUrl:N,cloudEnabled:x,cloudUrl:p,currentUrl:eb})]}),E?.cowork?.baseUrl&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5",children:E.cowork.baseUrl})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)(K,{value:D,onChange:W,apiKeys:o,cloudEnabled:x})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Models"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,l.jsx)("div",{className:"flex min-h-7 flex-wrap gap-1.5 rounded border border-border bg-card px-2 py-1.5",children:0===H.length?(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"No models selected"}):H.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-muted-foreground border border-transparent hover:border-border",children:[e,(0,l.jsx)("button",{onClick:()=>ew(e),className:"ml-0.5 hover:text-red-500",children:(0,l.jsx)(r.default,{name:"close",className:"text-[12px]"})})]},e))}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("button",{onClick:()=>ec(!0),className:"cursor-pointer rounded border border-border bg-card px-2 py-1 text-xs text-foreground transition-colors hover:border-primary",children:"Add Model"}),(0,l.jsx)("button",{onClick:()=>ei(!0),className:"shrink-0 cursor-pointer whitespace-nowrap rounded border border-primary/40 bg-primary/10 px-2 py-1 text-xs text-primary transition-colors hover:bg-primary/20",children:"+ Combo"})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"MCP"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[J.filter(e=>"exa"!==e.name).map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-card rounded border border-border",children:[(0,l.jsx)("span",{className:"text-xs font-medium min-w-0 truncate flex-shrink-0",children:e.title||e.name}),e.oauth&&(0,l.jsx)("span",{className:"text-[8px] text-amber-600 shrink-0",children:"OAuth"}),(0,l.jsxs)("div",{className:"flex-1 flex flex-wrap gap-1 overflow-hidden",style:{maxHeight:"1.5rem"},children:[Array.isArray(e.toolNames)&&e.toolNames.slice(0,6).map(e=>(0,l.jsx)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 text-muted-foreground whitespace-nowrap",children:e},e)),Array.isArray(e.toolNames)&&e.toolNames.length>6&&(0,l.jsxs)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 text-muted-foreground whitespace-nowrap",children:["+",e.toolNames.length-6]})]}),(0,l.jsx)("button",{onClick:()=>{var s;return s=e.name,void V(J.filter(e=>e.name!==s))},className:"shrink-0 hover:text-red-500 ml-auto",children:(0,l.jsx)(r.default,{name:"close",className:"text-[12px]"})})]},e.name)),el.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-card rounded border border-border",children:[(0,l.jsx)("span",{className:"text-xs font-medium min-w-0 truncate flex-shrink-0",children:e.name}),(0,l.jsx)("span",{className:"text-[8px] px-1 py-0.5 rounded bg-blue-500/10 text-blue-500 shrink-0",children:"custom"}),(0,l.jsx)("span",{className:"flex-1 text-[9px] text-muted-foreground truncate",children:e.url}),(0,l.jsx)("button",{onClick:()=>er(el.filter(s=>s.name!==e.name)),className:"shrink-0 hover:text-red-500 ml-auto",children:(0,l.jsx)(r.default,{name:"close",className:"text-[12px]"})})]},e.name)),0===J.filter(e=>"exa"!==e.name).length&&0===el.length&&(0,l.jsx)("div",{className:"px-2 py-1.5 bg-card rounded border border-border text-xs text-muted-foreground",children:"No MCPs added"}),(0,l.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,l.jsx)("button",{onClick:()=>ex(!0),className:"px-2 py-1 rounded border text-xs bg-primary/10 border-primary/40 text-primary hover:bg-primary/20 cursor-pointer whitespace-nowrap",children:"+ Browse"}),(0,l.jsx)("button",{onClick:()=>{eg({name:"",url:""}),ep(!0)},className:"px-2 py-1 rounded border text-xs bg-card border-border text-muted-foreground hover:border-primary hover:text-primary cursor-pointer whitespace-nowrap",children:"+ Custom"}),(0,l.jsx)("a",{href:"https://mcp.so",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-muted-foreground hover:text-primary underline ml-auto",children:"Find MCPs →"})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Tools"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[(k=J.some(e=>"exa"===e.name),C=(E?.defaultPlugins||[]).find(e=>"exa"===e.name),(0,l.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer px-2 py-1.5 bg-card rounded border border-border",children:[(0,l.jsx)(f.S,{checked:k,onCheckedChange:e=>{!0===e&&C?V([...J.filter(e=>"exa"!==e.name),C]):V(J.filter(e=>"exa"!==e.name))},className:"mt-0.5"}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("div",{className:"text-xs font-medium",children:"Web Search & Fetch (Exa)"}),(0,l.jsx)("p",{className:"text-[10px] text-muted-foreground leading-snug",children:"Replaces built-in WebSearch/WebFetch. Auto-strips duplicates from tool list."})]})]})),(()=>{let e=(E?.localStdioPlugins||[]).find(e=>"browsermcp"===e.name);if(!e)return null;let s=G.includes("browsermcp");return(0,l.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer px-2 py-1.5 bg-card rounded border border-border",children:[(0,l.jsx)(f.S,{checked:s,onCheckedChange:e=>et(!0===e?[...G,"browsermcp"]:G.filter(e=>"browsermcp"!==e)),className:"mt-0.5"}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("div",{className:"text-xs font-medium",children:"Browser Control (Browser MCP)"}),(0,l.jsxs)("p",{className:"text-[10px] text-muted-foreground leading-snug",children:["Controls your running Chrome. Auto-strips Cowork's built-in browser tools."," ",(0,l.jsx)("a",{href:e.extensionUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"Install Chrome extension"})]})]})]})})()]})]}),Array.isArray(E?.localStdioPlugins)&&E.localStdioPlugins.filter(e=>"browsermcp"!==e.name).length>0&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Local Plugins"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,l.jsx)("div",{className:"flex flex-col gap-1.5 px-2 py-1.5 bg-card rounded border border-border",children:E.localStdioPlugins.filter(e=>"browsermcp"!==e.name).map(e=>{let s=G.includes(e.name);return(0,l.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,l.jsx)(f.S,{checked:s,onCheckedChange:s=>et(!0===s?[...G,e.name]:G.filter(s=>s!==e.name)),className:"mt-0.5"}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-xs font-medium",children:e.title}),(0,l.jsx)("span",{className:"text-[8px] text-amber-600",children:"stdio"})]}),(0,l.jsx)("p",{className:"text-[10px] text-muted-foreground leading-snug",children:e.description}),e.extensionUrl&&(0,l.jsx)("a",{href:e.extensionUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-primary underline",children:"Install Chrome extension"})]})]},e.name)})}),(0,l.jsxs)("p",{className:"text-[10px] text-muted-foreground leading-snug",children:["⚠️ Local plugins run as subprocess via"," ",(0,l.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/5",children:"npx"}),". Requires Node.js installed."]})]})]})]}),T&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===T.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)(r.default,{name:"success"===T.type?"check_circle":"error",className:"text-[14px]"}),(0,l.jsx)("span",{children:T.text})]}),(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,l.jsxs)(d.$,{size:"sm",onClick:ev,disabled:0===H.length||O,className:"w-full sm:w-auto",children:[O&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:ek,disabled:!E.has10Router||R,className:"w-full sm:w-auto",children:[R&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,l.jsxs)(d.$,{variant:"ghost",size:"sm",onClick:()=>B(!0),className:"w-full sm:w-auto",children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),(0,l.jsx)(i.uR,{isOpen:q,onClose:()=>B(!1),title:"Claude Cowork - Manual Configuration",configs:(_=D&&D.trim()?D:x?"<API_KEY_FROM_DASHBOARD>":"sk_10router",S=H.length>0?H:["provider/model-id"],[{filename:"~/Library/Application Support/Claude-3p/configLibrary/<appliedId>.json",content:JSON.stringify({inferenceProvider:"gateway",inferenceGatewayBaseUrl:ej()||"https://your-public-host/v1",inferenceGatewayApiKey:_,inferenceModels:S.map(e=>({name:e}))},null,2)}])}),eo&&(0,l.jsx)(i.CK,{isOpen:eo,combo:null,onClose:()=>ei(!1),onSave:eN,activeProviders:c,forcePrefix:"claude-",title:"Create Cowork Combo"}),ed&&(0,l.jsx)(i.rq,{isOpen:ed,onClose:()=>ec(!1),onSelect:e=>{let s=e?.value||e?.name||e;!s||H.includes(s)||F(e=>[...e,s])},onDeselect:ew,activeProviders:c,modelAliases:ea,title:"Select Cowork Model",addedModelValues:H,closeOnSelect:!1}),(0,l.jsx)(i.Nf,{isOpen:em,onClose:()=>ex(!1),onAdd:e=>{J.some(s=>s.name===e.name)||V([...J,e])},addedNames:J.map(e=>e.name)}),(0,l.jsx)(X.lG,{open:eu,onOpenChange:ep,children:(0,l.jsxs)(X.Cf,{className:"sm:max-w-sm",children:[(0,l.jsx)(X.c7,{children:(0,l.jsx)(X.L3,{children:"Add Custom MCP"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 p-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("label",{className:"text-[11px] text-muted-foreground font-medium",children:"Name"}),(0,l.jsx)(y.p,{type:"text",placeholder:"my-mcp",value:eh.name,onChange:e=>eg(s=>({...s,name:e.target.value.replace(/\s+/g,"-").toLowerCase()})),className:"h-8 text-xs"})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("label",{className:"text-[11px] text-muted-foreground font-medium",children:"SSE URL"}),(0,l.jsx)(y.p,{type:"text",placeholder:"https://your-mcp-server.com/sse",value:eh.url,onChange:e=>eg(s=>({...s,url:e.target.value})),className:"h-8 text-xs"})]})]}),(0,l.jsx)(X.Es,{children:(0,l.jsx)(d.$,{onClick:()=>{let e=eh.name.trim();e&&eh.url.trim()&&(er(s=>[...s.filter(s=>s.name!==e),{name:e,url:eh.url.trim(),transport:"sse",custom:!0}]),ep(!1))},children:"Add"})})]})})]})})}let et="/api/cli-tools/dsh-settings",el=e=>(e||"").replace(/\/v1\/?$/,"");function er({tool:e,isExpanded:s,onToggle:t,baseUrl:n,apiKeys:o,activeProviders:c,cloudEnabled:m,initialStatus:x,tunnelEnabled:f,tunnelPublicUrl:b,tailscaleEnabled:y,tailscaleUrl:v}){let N,w,[k,C]=(0,a.useState)(x||null),[_,S]=(0,a.useState)(!1),[E,A]=(0,a.useState)(!1),[$,M]=(0,a.useState)(!1),[O,P]=(0,a.useState)(null),[R,z]=(0,a.useState)(!1),[T,L]=(0,a.useState)(""),[D,H]=(0,a.useState)([]),[F,q]=(0,a.useState)(""),[B,Z]=(0,a.useState)(!1),[Y,J]=(0,a.useState)({}),[V,G]=(0,a.useState)(!1),[X,Q]=(0,a.useState)("");(0,a.useEffect)(()=>{o?.length>0&&!T&&L(o[0].key)},[o,T]),(0,a.useEffect)(()=>{x&&C(x)},[x]),(0,a.useEffect)(()=>{s&&(k||eo(),ee())},[s]),(0,a.useEffect)(()=>{k?.dsh?.models?.length&&H(k.dsh.models),k?.dsh?.defaultModel&&q(k.dsh.defaultModel),k?.dsh?.baseURL&&!X&&Q(el(k.dsh.baseURL))},[k]);let ee=async()=>{try{let e=await fetch("/api/models/alias"),s=await e.json();e.ok&&J(s.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},es=k?.dsh?.baseURL||"",ea=k?.installed?k?.dsh?W(es,{tunnelPublicUrl:b,tailscaleUrl:v})?"configured":"other":"not_configured":null,en=()=>{let e;return(e=(X||el(n)||"").replace(/\/+$/,""))?/\/v1$/.test(e)?e:`${e}/v1`:""},eo=async()=>{S(!0);try{let e=await fetch(et),s=await e.json();C(s)}catch(e){C({installed:!1,error:e.message})}finally{S(!1)}},ei=async()=>{A(!0),P(null);try{let e=T&&T.trim()||m?T:"sk_10router",s=await fetch(et,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:en(),apiKey:e,models:D,defaultModel:F||D[0]})}),t=await s.json();s.ok?(U(en(),{tunnelPublicUrl:b,tailscaleUrl:v}),P({type:"success",text:"Applied — restart `dsh web` to pick up the 10Router provider."}),eo()):P({type:"error",text:t.error||"Failed to apply settings"})}catch(e){P({type:"error",text:e.message})}finally{A(!1)}},ed=async()=>{M(!0),P(null);try{let e=await fetch(et,{method:"DELETE"}),s=await e.json();e.ok?(P({type:"success",text:"Settings reset successfully!"}),H([]),q(""),eo()):P({type:"error",text:s.error||"Failed to reset settings"})}catch(e){P({type:"error",text:e.message})}finally{M(!1)}};return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,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)(j.default,{src:e.image||"/providers/deepseek.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"})}),(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-muted-foreground truncate",children:e.description})]})]})}),s&&(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-muted-foreground",children:[(0,l.jsx)(r.default,{name:"progress_activity",className:"animate-spin"}),(0,l.jsx)("span",{children:"Checking DSH config..."})]}),!_&&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)(r.default,{name:"warning",className:"text-yellow-500"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:k.container?"10Router runs in a container":"DSH home not found"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:k.container?"DSH lives on your host, not inside the container. Copy the manual config below into your host's ~/.dsh.":"No ~/.dsh directory found. Launch `dsh web` once first, then come back — manual configuration is still available."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(d.$,{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)(r.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:()=>z(!R),children:[(0,l.jsx)(r.default,{name:R?"expand_less":"help",className:"text-[18px] mr-1"}),R?"Hide":"How to Install"]})]})]}),R&&(0,l.jsxs)("div",{className:"p-4 bg-card 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-muted-foreground mb-1",children:"Run from npm (Node.js required):"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npx @deepseek-ai/dsh web"})]}),(0,l.jsxs)("p",{className:"text-muted-foreground",children:["The Web UI starts at"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"http://127.0.0.1:3080"})," ","and creates"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.dsh"}),' on first launch. 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_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)(I,{value:X||`${X||el(n)}/v1`,onChange:Q,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:f,tunnelPublicUrl:b,tailscaleEnabled:y,tailscaleUrl:v,currentUrl:es})]}),es?(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5",children:es})]}):null,(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)(K,{value:T,onChange:L,apiKeys:o,cloudEnabled:m})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Models"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,l.jsx)("div",{className:"flex min-h-7 flex-wrap gap-1.5 rounded border border-border bg-card px-2 py-1.5",children:0===D.length?(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"No models added"}):D.map(e=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-transparent bg-black/5 px-2 py-0.5 text-xs text-muted-foreground hover:border-border dark:bg-white/5",children:[e,(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>{let s=D.filter(s=>s!==e);H(s),F===e&&q(s[0]||"")},className:"ml-0.5 hover:text-red-500",children:(0,l.jsx)(r.default,{name:"close",className:"text-[12px]"})})}),(0,l.jsx)(h.ZI,{children:"Remove"})]})]},e))}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("button",{onClick:()=>Z(!0),className:"cursor-pointer rounded border border-border bg-card px-2 py-1 text-xs text-foreground transition-colors hover:border-primary",children:"Add Model"}),(0,l.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Written to"," ",(0,l.jsx)("code",{className:"rounded bg-black/5 px-1 dark:bg-white/5",children:"cordis.patch.yml"})," ","— restart dsh to apply."]})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Default Model"}),(0,l.jsxs)(p.l6,{value:F,onValueChange:q,children:[(0,l.jsx)(p.bq,{className:"w-full",children:(0,l.jsx)(p.yv,{placeholder:"Select default model"})}),(0,l.jsx)(p.gC,{children:D.map(e=>(0,l.jsx)(p.eb,{value:e,children:e},e))})]})]})]}),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)(r.default,{name:"success"===O.type?"check_circle":"error",className:"text-[14px]"}),(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)(d.$,{size:"sm",onClick:ei,disabled:!T&&m&&o.length>0||0===D.length||E,children:[E&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:ed,disabled:$,children:[$&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,l.jsxs)(d.$,{variant:"ghost",size:"sm",onClick:()=>G(!0),children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),B&&(0,l.jsx)(i.rq,{isOpen:B,onClose:()=>Z(!1),onSelect:e=>{!D.includes(e.value)&&(H([...D,e.value]),F||q(e.value))},onDeselect:e=>{let s=D.filter(s=>s!==e.value);H(s),F===e.value&&q(s[0]||"")},selectedModel:null,addedModelValues:D,closeOnSelect:!1,title:"Add Models for DSH",activeProviders:c,modelAliases:Y}),(0,l.jsx)(i.uR,{isOpen:V,onClose:()=>G(!1),title:"DSH - Manual Configuration",configs:(N=T&&T.trim()?T:m?"<API_KEY_FROM_DASHBOARD>":"sk_10router",w=(D.length>0?D:["provider/model-id"]).map(e=>` - id: ${e}
|
|
22
|
+
`:""}`})}),w)})]})})}var V=t(63729),Y=t(63523);function J({toolId:e,tool:s,isExpanded:t,onToggle:n,baseUrl:o,apiKeys:d,activeProviders:c=[],cloudEnabled:m=!1,tunnelEnabled:x=!1}){let[p,g]=(0,a.useState)(null),[f,b]=(0,a.useState)(!1),[v,y]=(0,a.useState)(""),[N,w]=(0,a.useState)(()=>d?.length>0?d[0].key:""),k=e=>{let s=N&&N.trim()?N:m?"your-api-key":"sk_10router",t=o||"http://localhost:20128",l=t.endsWith("/v1")?t:`${t}/v1`;return e.replace(/\{\{baseUrl\}\}/g,l).replace(/\{\{apiKey\}\}/g,s).replace(/\{\{model\}\}/g,v||"provider/model-id")},{copy:C}=(0,Y.C)(),_=async(e,s)=>{await C(k(e),`toolcard-${s}`),g(s),setTimeout(()=>g(null),2e3)},S=()=>(!s.requiresExternalUrl||!!m||!!x)&&(!s.requiresCloud||!!m);return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden overflow-x-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:n,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:(()=>{if(s.image)return(0,l.jsx)(j.default,{src:s.image,alt:s.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"});if(s.icon)return(0,l.jsx)(r.default,{name:s.icon,className:"text-xl",style:{color:s.color}});let t=(0,V.HY)(e);return t?(0,l.jsx)(j.default,{src:t,alt:s.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:s=>{(0,V.Kw)(e),s.target.style.display="none"},loading:"lazy",decoding:"async"}):(0,l.jsx)("span",{className:"text-xs font-bold",style:{color:s.color},children:(e||"?").slice(0,2).toUpperCase()})})()}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:s.name}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:s.description})]})]})}),t&&(0,l.jsx)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:s.guideSteps?(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[s.notes&&0!==s.notes.length?(0,l.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:s.notes.map((e,s)=>{if("cloudCheck"===e.type&&(m||x))return null;let t="warning"===e.type,a="cloudCheck"===e.type&&!m&&!x,n="bg-blue-500/10 border-blue-500/30",o="text-blue-600 dark:text-blue-400",i="text-blue-500",d="info";return t?(n="bg-yellow-500/10 border-yellow-500/30",o="text-yellow-600 dark:text-yellow-400",i="text-yellow-500",d="warning"):a&&(n="bg-red-500/10 border-red-500/30",o="text-red-600 dark:text-red-400",i="text-red-500",d="error"),(0,l.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${n}`,children:[(0,l.jsx)(r.default,{name:d,className:`text-lg ${i}`}),(0,l.jsx)("p",{className:`text-sm ${o}`,children:e.text})]},s)})}):null,S()&&s.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:s.color},children:e.step}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("p",{className:"font-medium text-foreground",children:e.title}),e.desc&&(0,l.jsx)("p",{className:"text-sm text-muted-foreground 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)(K,{value:N,onChange:w,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:v,onChange:e=>y(e.target.value),placeholder:"provider/model-id",className:"w-full sm:w-auto flex-1 px-3 py-2 bg-muted rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>b(!0),className:"shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors bg-muted border-border text-foreground hover:border-primary cursor-pointer",children:"Select Model"}),v&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{onClick:()=>_(v,"model"),className:"shrink-0 px-3 py-2 bg-muted hover:bg-muted rounded-lg border border-border transition-colors",children:(0,l.jsx)(r.default,{name:"model"===p?"check":"content_copy",className:"text-lg"})}),(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>y(""),className:"p-2 text-muted-foreground hover:text-red-500 rounded transition-colors",children:(0,l.jsx)(r.default,{name:"close",className:"text-lg"})})}),(0,l.jsx)(h.ZI,{children:"Clear"})]})]})]}),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-muted rounded-lg text-sm font-mono border border-border truncate",children:k(e.value)}),e.copyable&&(0,l.jsx)("button",{onClick:()=>_(e.value,`${e.step}-${e.title}`),className:"shrink-0 px-3 py-2 bg-muted hover:bg-muted rounded-lg border border-border transition-colors",children:(0,l.jsx)(r.default,{name:p===`${e.step}-${e.title}`?"check":"content_copy",className:"text-lg"})})]})]})]},e.step)),S()&&s.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-muted-foreground uppercase tracking-wide",children:s.codeBlock.language}),(0,l.jsxs)("button",{onClick:()=>_(s.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-muted hover:bg-muted rounded border border-border transition-colors",children:[(0,l.jsx)(r.default,{name:"codeblock"===p?"check":"content_copy",className:"text-sm"}),"codeblock"===p?"Copied!":"Copy"]})]}),(0,l.jsx)("pre",{className:"p-4 bg-muted rounded-lg border border-border overflow-x-auto",children:(0,l.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:k(s.codeBlock.code)})})]})]}):(0,l.jsx)("p",{className:"text-muted-foreground text-sm",children:"Coming soon..."})}),f&&(0,l.jsx)(i.rq,{isOpen:f,onClose:()=>b(!1),onSelect:e=>{y(e.value)},selectedModel:v,activeProviders:c,title:"Select Model"})]})})}function G({tool:e,isExpanded:s,onToggle:t,baseUrl:n,apiKeys:o,activeProviders:c,cloudEnabled:m,initialStatus:x,tunnelEnabled:p,tunnelPublicUrl:f,tailscaleEnabled:b,tailscaleUrl:v}){let y,N,w,k,C,[_,S]=(0,a.useState)(x||null),[E,A]=(0,a.useState)(!1),[$,M]=(0,a.useState)(!1),[O,P]=(0,a.useState)(!1),[R,z]=(0,a.useState)(null),[T,L]=(0,a.useState)(!1),[D,H]=(0,a.useState)(""),[F,q]=(0,a.useState)(""),[B,Z]=(0,a.useState)(""),[V,Y]=(0,a.useState)(!1),[J,X]=(0,a.useState)(!1),[Q,ee]=(0,a.useState)({}),[es,et]=(0,a.useState)(!1),[el,er]=(0,a.useState)(""),[ea,en]=(0,a.useState)([]),[eo,ei]=(0,a.useState)(""),ed=(0,a.useRef)([]);(0,a.useEffect)(()=>{ed.current=ea},[ea]),(0,a.useEffect)(()=>{o?.length>0&&!D&&H(o[0].key)},[o,D]),(0,a.useEffect)(()=>{x&&S(x)},[x]),(0,a.useEffect)(()=>{s&&(_||eh(),ec())},[s]),(0,a.useEffect)(()=>{_?.opencode?.models&&en(_.opencode.models),_?.opencode?.activeModel&&ei(_.opencode.activeModel),_?.config?.agent?.explorer?.model?.startsWith("10router/")&&Z(_.config.agent.explorer.model.replace("10router/",""))},[_]);let ec=async()=>{try{let e=await fetch("/api/models/alias"),s=await e.json();e.ok&&ee(s.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},em=async e=>{try{let s=D&&D.trim()||m?D:"sk_10router",t=e.includes(eo)?eo:e[0]||"";await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ep(),apiKey:s,models:e,activeModel:t,subagentModel:B})})}catch(e){console.log("Error saving models:",e)}},ex=_?.config?.provider?.["10router"]?.options?.baseURL||"",eu=_?.installed?_.config&&_.has10Router?W(_.config?.provider?.["10router"]?.options?.baseURL||"",{tunnelPublicUrl:f,tailscaleUrl:v})?"configured":"other":"not_configured":null,ep=()=>{let e=el||n;return e.endsWith("/v1")?e:`${e}/v1`},eh=async()=>{A(!0);try{let e=await fetch("/api/cli-tools/opencode-settings"),s=await e.json();S(s)}catch(e){S({installed:!1,error:e.message})}finally{A(!1)}},eg=async()=>{M(!0),z(null);try{let e=D&&D.trim()||m?D:"sk_10router",s=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ep(),apiKey:e,models:ea,activeModel:""===eo?"":eo||ea[0],subagentModel:B})}),t=await s.json();s.ok?(U(ep(),{tunnelPublicUrl:f,tailscaleUrl:v}),z({type:"success",text:"Settings applied successfully!"}),eh()):z({type:"error",text:t.error||"Failed to apply settings"})}catch(e){z({type:"error",text:e.message})}finally{M(!1)}},ef=async()=>{P(!0),z(null);try{let e=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),s=await e.json();e.ok?(z({type:"success",text:"Settings reset successfully!"}),q(""),Z(""),en([]),ei(""),eh()):z({type:"error",text:s.error||"Failed to reset settings"})}catch(e){z({type:"error",text:e.message})}finally{P(!1)}};return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,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)(j.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"},loading:"lazy",decoding:"async"})}),(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"===eu&&(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"===eu&&(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"===eu&&(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-muted-foreground truncate",children:e.description})]})]})}),s&&(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-muted-foreground",children:[(0,l.jsx)(r.default,{name:"progress_activity",className:"animate-spin"}),(0,l.jsx)("span",{children:"Checking OpenCode 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)(r.default,{name:"warning",className:"text-yellow-500"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:_.container?"10Router runs in a container":"OpenCode CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:_.container?"The CLI lives on your host, not inside the container. Copy the manual config below into your host's opencode.json.":"Manual configuration is still available if 10router is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(d.$,{variant:"secondary",size:"sm",onClick:()=>et(!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)(r.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:()=>L(!T),children:[(0,l.jsx)(r.default,{name:T?"expand_less":"help",className:"text-[18px] mr-1"}),T?"Hide":"How to Install"]})]})]}),T&&(0,l.jsxs)("div",{className:"p-4 bg-card 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-muted-foreground 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-muted-foreground",children:["After installation, run"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"opencode"})," 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_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)(I,{value:el||el||`${n}/v1`,onChange:er,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:f,tailscaleEnabled:b,tailscaleUrl:v,currentUrl:ex})]}),_?.config?.provider?.["10router"]?.options?.baseURL&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5",children:_.config.provider["10router"].options.baseURL})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)(K,{value:D,onChange:H,apiKeys:o,cloudEnabled:m})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Models"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,l.jsx)("div",{className:"flex min-h-7 flex-wrap gap-1.5 rounded border border-border bg-card px-2 py-1.5",children:0===ea.length?(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"No models selected"}):ea.map(e=>(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsxs)("span",{onClick:async()=>{if(e===eo)try{(await fetch("/api/cli-tools/opencode-settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({clearActiveModel:!0})})).ok&&(ei(""),eh())}catch(e){console.log("Error clearing active model:",e)}else ei(e)},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs cursor-pointer transition-colors ${e===eo?"bg-primary/10 text-primary border border-primary":"bg-black/5 dark:bg-white/5 text-muted-foreground border border-transparent hover:border-border"}`,children:[e===eo&&(0,l.jsx)(r.default,{name:"star",className:"text-[10px]"}),e,(0,l.jsx)("button",{onClick:async s=>{s.stopPropagation();try{if((await fetch(`/api/cli-tools/opencode-settings?model=${encodeURIComponent(e)}`,{method:"DELETE"})).ok){let s=ea.filter(s=>s!==e);en(s),eo===e&&ei(""),eh()}}catch(e){console.log("Error removing model:",e)}},className:"ml-0.5 hover:text-red-500",children:(0,l.jsx)(r.default,{name:"close",className:"text-[12px]"})})]})}),(0,l.jsx)(h.ZI,{children:e===eo?"Click to clear active model":"Click to set as active"})]},e))}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("button",{onClick:()=>Y(!0),className:"cursor-pointer rounded border border-border bg-card px-2 py-1 text-xs text-foreground transition-colors hover:border-primary",children:"Add Model"}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:ea.length>0&&eo?(0,l.jsxs)(l.Fragment,{children:["Active: ",(0,l.jsx)("span",{className:"text-primary",children:eo})]}):ea.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_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Subagent Model"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:B,onChange:e=>Z(e.target.value),placeholder:ea[0]||"provider/model-id (defaults to main model)",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-card rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),B&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>Z(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-muted-foreground hover:text-red-500 rounded transition-colors",children:(0,l.jsx)(r.default,{name:"close",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Clear (will use main model)"})]})]}),(0,l.jsx)("button",{onClick:()=>X(!0),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 bg-card border-border text-foreground hover:border-primary cursor-pointer",children:"Select Model"})]})]}),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)(r.default,{name:"success"===R.type?"check_circle":"error",className:"text-[14px]"}),(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)(d.$,{size:"sm",onClick:eg,disabled:0===ea.length||$,children:[$&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:ef,disabled:!_.has10Router||O,children:[O&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,l.jsxs)(d.$,{variant:"ghost",size:"sm",onClick:()=>et(!0),children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),V&&(0,l.jsx)(i.rq,{isOpen:V,onClose:()=>{Y(!1),em(ed.current)},onSelect:e=>{!ea.includes(e.value)&&(en([...ea,e.value]),eo||ei(e.value))},onDeselect:e=>{let s=ea.filter(s=>s!==e.value);en(s),eo===e.value&&ei(s[0]||"")},selectedModel:null,activeProviders:c,modelAliases:Q,addedModelValues:ea,closeOnSelect:!1,title:"Add Model for OpenCode"}),J&&(0,l.jsx)(i.rq,{isOpen:J,onClose:()=>X(!1),onSelect:e=>{Z(e.value),X(!1)},selectedModel:B,activeProviders:c,modelAliases:Q,title:"Select Subagent Model for OpenCode"}),(0,l.jsx)(i.uR,{isOpen:es,onClose:()=>et(!1),title:"OpenCode - Manual Configuration",configs:(y=D&&D.trim()?D:m?"<API_KEY_FROM_DASHBOARD>":"sk_10router",N=ea.length>0?ea:["provider/model-id"],w=eo||ea[0]||N[0],k=B||w,C={},N.forEach(e=>{C[e]={name:e,modalities:{input:["text","image"],output:["text"]}}}),[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{"10router":{npm:"@ai-sdk/openai-compatible",options:{baseURL:ep(),apiKey:y},models:C}},model:`10router/${w}`,agent:{explorer:{description:"Fast explorer subagent for codebase exploration",mode:"subagent",model:`10router/${k}`}}},null,2)}])})]})})}var X=t(49787);let Q="/api/cli-tools/cowork-settings",ee=e=>(e||"").replace(/\/v1\/?$/,"");function es({tool:e,isExpanded:s,onToggle:t,baseUrl:n,apiKeys:o,activeProviders:c,hasActiveProviders:m,cloudEnabled:x,cloudUrl:p,tunnelEnabled:h,tunnelPublicUrl:b,tailscaleEnabled:y,tailscaleUrl:N,initialStatus:w}){let k,C,_,S,[E,A]=(0,a.useState)(w||null),[$,M]=(0,a.useState)(!1),[O,P]=(0,a.useState)(!1),[R,z]=(0,a.useState)(!1),[T,L]=(0,a.useState)(null),[D,W]=(0,a.useState)(""),[H,F]=(0,a.useState)([]),[q,B]=(0,a.useState)(!1),[Z,V]=(0,a.useState)(""),[Y,J]=(0,a.useState)([]),[G,et]=(0,a.useState)([]),[el,er]=(0,a.useState)([]),[ea,en]=(0,a.useState)({}),[eo,ei]=(0,a.useState)(!1),[ed,ec]=(0,a.useState)(!1),[em,ex]=(0,a.useState)(!1),[eu,ep]=(0,a.useState)(!1),[eh,eg]=(0,a.useState)({name:"",url:""});(0,a.useEffect)(()=>{o?.length>0&&!D&&W(o[0].key)},[o,D]),(0,a.useEffect)(()=>{w&&A(w)},[w]),(0,a.useEffect)(()=>{s&&!E&&ef()},[s]),(0,a.useEffect)(()=>{s&&fetch("/api/models/alias").then(e=>e.ok?e.json():null).then(e=>{e&&en(e.aliases||{})}).catch(()=>{})},[s]),(0,a.useEffect)(()=>{E?.cowork?.models?.length&&F(E.cowork.models),E?.cowork?.baseUrl&&!Z&&V(ee(E.cowork.baseUrl)),Array.isArray(E?.cowork?.plugins)&&E.cowork.plugins.length>0?J(E.cowork.plugins):0===Y.length&&Array.isArray(E?.defaultPlugins)&&J(E.defaultPlugins),Array.isArray(E?.cowork?.localPlugins)&&et(E.cowork.localPlugins),Array.isArray(E?.cowork?.customPlugins)&&E.cowork.customPlugins.length>0&&er(E.cowork.customPlugins)},[E]);let ef=async()=>{M(!0);try{let e=await fetch(Q),s=await e.json();A(s)}catch(e){A({installed:!1,error:e.message})}finally{M(!1)}},ej=()=>{let e;return(e=(Z||"").replace(/\/+$/,""))?/\/v1$/.test(e)?e:`${e}/v1`:""},eb=E?.cowork?.baseUrl||"",ev=E?.installed?E?.cowork?.baseUrl?E.has10Router?"configured":"other":"not_configured":null,ey=async()=>{L(null);let e=ej();if(0===H.length)return void L({type:"error",text:"Please select at least one model"});P(!0);try{let s=D?.trim()||(o?.length>0?o[0].key:null)||(x?null:"sk_10router"),t=await fetch(Q,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:e,apiKey:s,models:H,plugins:Y,localPlugins:G,customPlugins:el})}),l=await t.json();t.ok?(U(ej(),{tunnelPublicUrl:b,tailscaleUrl:N}),L({type:"success",text:"Settings applied. Quit & reopen Claude Desktop to load."}),ef()):L({type:"error",text:l.error||"Failed to apply settings"})}catch(e){L({type:"error",text:e.message})}finally{P(!1)}},eN=async({name:e,models:s})=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,models:s})});if(!t.ok){let e=await t.json();L({type:"error",text:e.error||"Failed to create combo"});return}H.includes(e)||F([...H,e]),ei(!1),L({type:"success",text:`Combo "${e}" created and added.`})}catch(e){L({type:"error",text:e.message})}},ew=e=>{let s=e?.value||e?.name||e;F(e=>e.filter(e=>e!==s))},ek=async()=>{z(!0),L(null);try{let e=await fetch(Q,{method:"DELETE"}),s=await e.json();e.ok?(L({type:"success",text:"Settings reset successfully"}),F([]),J(E?.defaultPlugins||[]),et([]),er([]),ef()):L({type:"error",text:s.error||"Failed to reset"})}catch(e){L({type:"error",text:e.message})}finally{z(!1)}};return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,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)(j.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"},loading:"lazy",decoding:"async"})}),(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"===ev&&(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"===ev&&(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"===ev&&(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-muted-foreground truncate",children:e.description})]})]})}),s&&(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-muted-foreground",children:[(0,l.jsx)(r.default,{name:"progress_activity",className:"animate-spin"}),(0,l.jsx)("span",{children:"Checking Claude Cowork..."})]}),!$&&E&&!E.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)(r.default,{name:"warning",className:"text-yellow-500"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:E.container?"10Router runs in a container":"Claude Desktop (Cowork mode) not detected"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:E.container?"The app lives on your host, not inside the container. Copy the manual config below into the host app config.":"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)(d.$,{variant:"secondary",size:"sm",onClick:()=>B(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]})})]}),!$&&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_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)(I,{value:ej(),onChange:e=>V(ee(e)),tunnelEnabled:h,tunnelPublicUrl:b,tailscaleEnabled:y,tailscaleUrl:N,cloudEnabled:x,cloudUrl:p,currentUrl:eb})]}),E?.cowork?.baseUrl&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5",children:E.cowork.baseUrl})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)(K,{value:D,onChange:W,apiKeys:o,cloudEnabled:x})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Models"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,l.jsx)("div",{className:"flex min-h-7 flex-wrap gap-1.5 rounded border border-border bg-card px-2 py-1.5",children:0===H.length?(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"No models selected"}):H.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-muted-foreground border border-transparent hover:border-border",children:[e,(0,l.jsx)("button",{onClick:()=>ew(e),className:"ml-0.5 hover:text-red-500",children:(0,l.jsx)(r.default,{name:"close",className:"text-[12px]"})})]},e))}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("button",{onClick:()=>ec(!0),className:"cursor-pointer rounded border border-border bg-card px-2 py-1 text-xs text-foreground transition-colors hover:border-primary",children:"Add Model"}),(0,l.jsx)("button",{onClick:()=>ei(!0),className:"shrink-0 cursor-pointer whitespace-nowrap rounded border border-primary/40 bg-primary/10 px-2 py-1 text-xs text-primary transition-colors hover:bg-primary/20",children:"+ Combo"})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"MCP"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[Y.filter(e=>"exa"!==e.name).map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-card rounded border border-border",children:[(0,l.jsx)("span",{className:"text-xs font-medium min-w-0 truncate flex-shrink-0",children:e.title||e.name}),e.oauth&&(0,l.jsx)("span",{className:"text-[8px] text-amber-600 shrink-0",children:"OAuth"}),(0,l.jsxs)("div",{className:"flex-1 flex flex-wrap gap-1 overflow-hidden",style:{maxHeight:"1.5rem"},children:[Array.isArray(e.toolNames)&&e.toolNames.slice(0,6).map(e=>(0,l.jsx)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 text-muted-foreground whitespace-nowrap",children:e},e)),Array.isArray(e.toolNames)&&e.toolNames.length>6&&(0,l.jsxs)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 text-muted-foreground whitespace-nowrap",children:["+",e.toolNames.length-6]})]}),(0,l.jsx)("button",{onClick:()=>{var s;return s=e.name,void J(Y.filter(e=>e.name!==s))},className:"shrink-0 hover:text-red-500 ml-auto",children:(0,l.jsx)(r.default,{name:"close",className:"text-[12px]"})})]},e.name)),el.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-card rounded border border-border",children:[(0,l.jsx)("span",{className:"text-xs font-medium min-w-0 truncate flex-shrink-0",children:e.name}),(0,l.jsx)("span",{className:"text-[8px] px-1 py-0.5 rounded bg-blue-500/10 text-blue-500 shrink-0",children:"custom"}),(0,l.jsx)("span",{className:"flex-1 text-[9px] text-muted-foreground truncate",children:e.url}),(0,l.jsx)("button",{onClick:()=>er(el.filter(s=>s.name!==e.name)),className:"shrink-0 hover:text-red-500 ml-auto",children:(0,l.jsx)(r.default,{name:"close",className:"text-[12px]"})})]},e.name)),0===Y.filter(e=>"exa"!==e.name).length&&0===el.length&&(0,l.jsx)("div",{className:"px-2 py-1.5 bg-card rounded border border-border text-xs text-muted-foreground",children:"No MCPs added"}),(0,l.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,l.jsx)("button",{onClick:()=>ex(!0),className:"px-2 py-1 rounded border text-xs bg-primary/10 border-primary/40 text-primary hover:bg-primary/20 cursor-pointer whitespace-nowrap",children:"+ Browse"}),(0,l.jsx)("button",{onClick:()=>{eg({name:"",url:""}),ep(!0)},className:"px-2 py-1 rounded border text-xs bg-card border-border text-muted-foreground hover:border-primary hover:text-primary cursor-pointer whitespace-nowrap",children:"+ Custom"}),(0,l.jsx)("a",{href:"https://mcp.so",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-muted-foreground hover:text-primary underline ml-auto",children:"Find MCPs →"})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Tools"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[(k=Y.some(e=>"exa"===e.name),C=(E?.defaultPlugins||[]).find(e=>"exa"===e.name),(0,l.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer px-2 py-1.5 bg-card rounded border border-border",children:[(0,l.jsx)(f.S,{checked:k,onCheckedChange:e=>{!0===e&&C?J([...Y.filter(e=>"exa"!==e.name),C]):J(Y.filter(e=>"exa"!==e.name))},className:"mt-0.5"}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("div",{className:"text-xs font-medium",children:"Web Search & Fetch (Exa)"}),(0,l.jsx)("p",{className:"text-[10px] text-muted-foreground leading-snug",children:"Replaces built-in WebSearch/WebFetch. Auto-strips duplicates from tool list."})]})]})),(()=>{let e=(E?.localStdioPlugins||[]).find(e=>"browsermcp"===e.name);if(!e)return null;let s=G.includes("browsermcp");return(0,l.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer px-2 py-1.5 bg-card rounded border border-border",children:[(0,l.jsx)(f.S,{checked:s,onCheckedChange:e=>et(!0===e?[...G,"browsermcp"]:G.filter(e=>"browsermcp"!==e)),className:"mt-0.5"}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("div",{className:"text-xs font-medium",children:"Browser Control (Browser MCP)"}),(0,l.jsxs)("p",{className:"text-[10px] text-muted-foreground leading-snug",children:["Controls your running Chrome. Auto-strips Cowork's built-in browser tools."," ",(0,l.jsx)("a",{href:e.extensionUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"Install Chrome extension"})]})]})]})})()]})]}),Array.isArray(E?.localStdioPlugins)&&E.localStdioPlugins.filter(e=>"browsermcp"!==e.name).length>0&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Local Plugins"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,l.jsx)("div",{className:"flex flex-col gap-1.5 px-2 py-1.5 bg-card rounded border border-border",children:E.localStdioPlugins.filter(e=>"browsermcp"!==e.name).map(e=>{let s=G.includes(e.name);return(0,l.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,l.jsx)(f.S,{checked:s,onCheckedChange:s=>et(!0===s?[...G,e.name]:G.filter(s=>s!==e.name)),className:"mt-0.5"}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-xs font-medium",children:e.title}),(0,l.jsx)("span",{className:"text-[8px] text-amber-600",children:"stdio"})]}),(0,l.jsx)("p",{className:"text-[10px] text-muted-foreground leading-snug",children:e.description}),e.extensionUrl&&(0,l.jsx)("a",{href:e.extensionUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-primary underline",children:"Install Chrome extension"})]})]},e.name)})}),(0,l.jsxs)("p",{className:"text-[10px] text-muted-foreground leading-snug",children:["⚠️ Local plugins run as subprocess via"," ",(0,l.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/5",children:"npx"}),". Requires Node.js installed."]})]})]})]}),T&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===T.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)(r.default,{name:"success"===T.type?"check_circle":"error",className:"text-[14px]"}),(0,l.jsx)("span",{children:T.text})]}),(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,l.jsxs)(d.$,{size:"sm",onClick:ey,disabled:0===H.length||O,className:"w-full sm:w-auto",children:[O&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:ek,disabled:!E.has10Router||R,className:"w-full sm:w-auto",children:[R&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,l.jsxs)(d.$,{variant:"ghost",size:"sm",onClick:()=>B(!0),className:"w-full sm:w-auto",children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),(0,l.jsx)(i.uR,{isOpen:q,onClose:()=>B(!1),title:"Claude Cowork - Manual Configuration",configs:(_=D&&D.trim()?D:x?"<API_KEY_FROM_DASHBOARD>":"sk_10router",S=H.length>0?H:["provider/model-id"],[{filename:"~/Library/Application Support/Claude-3p/configLibrary/<appliedId>.json",content:JSON.stringify({inferenceProvider:"gateway",inferenceGatewayBaseUrl:ej()||"https://your-public-host/v1",inferenceGatewayApiKey:_,inferenceModels:S.map(e=>({name:e}))},null,2)}])}),eo&&(0,l.jsx)(i.CK,{isOpen:eo,combo:null,onClose:()=>ei(!1),onSave:eN,activeProviders:c,forcePrefix:"claude-",title:"Create Cowork Combo"}),ed&&(0,l.jsx)(i.rq,{isOpen:ed,onClose:()=>ec(!1),onSelect:e=>{let s=e?.value||e?.name||e;!s||H.includes(s)||F(e=>[...e,s])},onDeselect:ew,activeProviders:c,modelAliases:ea,title:"Select Cowork Model",addedModelValues:H,closeOnSelect:!1}),(0,l.jsx)(i.Nf,{isOpen:em,onClose:()=>ex(!1),onAdd:e=>{Y.some(s=>s.name===e.name)||J([...Y,e])},addedNames:Y.map(e=>e.name)}),(0,l.jsx)(X.lG,{open:eu,onOpenChange:ep,children:(0,l.jsxs)(X.Cf,{className:"sm:max-w-sm",children:[(0,l.jsx)(X.c7,{children:(0,l.jsx)(X.L3,{children:"Add Custom MCP"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 p-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("label",{className:"text-[11px] text-muted-foreground font-medium",children:"Name"}),(0,l.jsx)(v.p,{type:"text",placeholder:"my-mcp",value:eh.name,onChange:e=>eg(s=>({...s,name:e.target.value.replace(/\s+/g,"-").toLowerCase()})),className:"h-8 text-xs"})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("label",{className:"text-[11px] text-muted-foreground font-medium",children:"SSE URL"}),(0,l.jsx)(v.p,{type:"text",placeholder:"https://your-mcp-server.com/sse",value:eh.url,onChange:e=>eg(s=>({...s,url:e.target.value})),className:"h-8 text-xs"})]})]}),(0,l.jsx)(X.Es,{children:(0,l.jsx)(d.$,{onClick:()=>{let e=eh.name.trim();e&&eh.url.trim()&&(er(s=>[...s.filter(s=>s.name!==e),{name:e,url:eh.url.trim(),transport:"sse",custom:!0}]),ep(!1))},children:"Add"})})]})})]})})}let et="/api/cli-tools/dsh-settings",el=e=>(e||"").replace(/\/v1\/?$/,"");function er({tool:e,isExpanded:s,onToggle:t,baseUrl:n,apiKeys:o,activeProviders:c,cloudEnabled:m,initialStatus:x,tunnelEnabled:f,tunnelPublicUrl:b,tailscaleEnabled:v,tailscaleUrl:y}){let N,w,[k,C]=(0,a.useState)(x||null),[_,S]=(0,a.useState)(!1),[E,A]=(0,a.useState)(!1),[$,M]=(0,a.useState)(!1),[O,P]=(0,a.useState)(null),[R,z]=(0,a.useState)(!1),[T,L]=(0,a.useState)(""),[D,H]=(0,a.useState)([]),[F,q]=(0,a.useState)(""),[B,Z]=(0,a.useState)(!1),[V,Y]=(0,a.useState)({}),[J,G]=(0,a.useState)(!1),[X,Q]=(0,a.useState)("");(0,a.useEffect)(()=>{o?.length>0&&!T&&L(o[0].key)},[o,T]),(0,a.useEffect)(()=>{x&&C(x)},[x]),(0,a.useEffect)(()=>{s&&(k||eo(),ee())},[s]),(0,a.useEffect)(()=>{k?.dsh?.models?.length&&H(k.dsh.models),k?.dsh?.defaultModel&&q(k.dsh.defaultModel),k?.dsh?.baseURL&&!X&&Q(el(k.dsh.baseURL))},[k]);let ee=async()=>{try{let e=await fetch("/api/models/alias"),s=await e.json();e.ok&&Y(s.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},es=k?.dsh?.baseURL||"",ea=k?.installed?k?.dsh?W(es,{tunnelPublicUrl:b,tailscaleUrl:y})?"configured":"other":"not_configured":null,en=()=>{let e;return(e=(X||el(n)||"").replace(/\/+$/,""))?/\/v1$/.test(e)?e:`${e}/v1`:""},eo=async()=>{S(!0);try{let e=await fetch(et),s=await e.json();C(s)}catch(e){C({installed:!1,error:e.message})}finally{S(!1)}},ei=async()=>{A(!0),P(null);try{let e=T&&T.trim()||m?T:"sk_10router",s=await fetch(et,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:en(),apiKey:e,models:D,defaultModel:F||D[0]})}),t=await s.json();s.ok?(U(en(),{tunnelPublicUrl:b,tailscaleUrl:y}),P({type:"success",text:"Applied — restart `dsh web` to pick up the 10Router provider."}),eo()):P({type:"error",text:t.error||"Failed to apply settings"})}catch(e){P({type:"error",text:e.message})}finally{A(!1)}},ed=async()=>{M(!0),P(null);try{let e=await fetch(et,{method:"DELETE"}),s=await e.json();e.ok?(P({type:"success",text:"Settings reset successfully!"}),H([]),q(""),eo()):P({type:"error",text:s.error||"Failed to reset settings"})}catch(e){P({type:"error",text:e.message})}finally{M(!1)}};return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,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)(j.default,{src:e.image||"/providers/deepseek.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"})}),(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-muted-foreground truncate",children:e.description})]})]})}),s&&(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-muted-foreground",children:[(0,l.jsx)(r.default,{name:"progress_activity",className:"animate-spin"}),(0,l.jsx)("span",{children:"Checking DSH config..."})]}),!_&&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)(r.default,{name:"warning",className:"text-yellow-500"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:k.container?"10Router runs in a container":"DSH home not found"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:k.container?"DSH lives on your host, not inside the container. Copy the manual config below into your host's ~/.dsh.":"No ~/.dsh directory found. Launch `dsh web` once first, then come back — manual configuration is still available."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(d.$,{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)(r.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:()=>z(!R),children:[(0,l.jsx)(r.default,{name:R?"expand_less":"help",className:"text-[18px] mr-1"}),R?"Hide":"How to Install"]})]})]}),R&&(0,l.jsxs)("div",{className:"p-4 bg-card 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-muted-foreground mb-1",children:"Run from npm (Node.js required):"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npx @deepseek-ai/dsh web"})]}),(0,l.jsxs)("p",{className:"text-muted-foreground",children:["The Web UI starts at"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"http://127.0.0.1:3080"})," ","and creates"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.dsh"}),' on first launch. 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_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)(I,{value:X||`${X||el(n)}/v1`,onChange:Q,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:f,tunnelPublicUrl:b,tailscaleEnabled:v,tailscaleUrl:y,currentUrl:es})]}),es?(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5",children:es})]}):null,(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)(K,{value:T,onChange:L,apiKeys:o,cloudEnabled:m})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Models"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,l.jsx)("div",{className:"flex min-h-7 flex-wrap gap-1.5 rounded border border-border bg-card px-2 py-1.5",children:0===D.length?(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"No models added"}):D.map(e=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-transparent bg-black/5 px-2 py-0.5 text-xs text-muted-foreground hover:border-border dark:bg-white/5",children:[e,(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>{let s=D.filter(s=>s!==e);H(s),F===e&&q(s[0]||"")},className:"ml-0.5 hover:text-red-500",children:(0,l.jsx)(r.default,{name:"close",className:"text-[12px]"})})}),(0,l.jsx)(h.ZI,{children:"Remove"})]})]},e))}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("button",{onClick:()=>Z(!0),className:"cursor-pointer rounded border border-border bg-card px-2 py-1 text-xs text-foreground transition-colors hover:border-primary",children:"Add Model"}),(0,l.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Written to"," ",(0,l.jsx)("code",{className:"rounded bg-black/5 px-1 dark:bg-white/5",children:"cordis.patch.yml"})," ","— restart dsh to apply."]})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Default Model"}),(0,l.jsxs)(p.l6,{value:F,onValueChange:q,children:[(0,l.jsx)(p.bq,{className:"w-full",children:(0,l.jsx)(p.yv,{placeholder:"Select default model"})}),(0,l.jsx)(p.gC,{children:D.map(e=>(0,l.jsx)(p.eb,{value:e,children:e},e))})]})]})]}),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)(r.default,{name:"success"===O.type?"check_circle":"error",className:"text-[14px]"}),(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)(d.$,{size:"sm",onClick:ei,disabled:!T&&m&&o.length>0||0===D.length||E,children:[E&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:ed,disabled:$,children:[$&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,l.jsxs)(d.$,{variant:"ghost",size:"sm",onClick:()=>G(!0),children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),B&&(0,l.jsx)(i.rq,{isOpen:B,onClose:()=>Z(!1),onSelect:e=>{!D.includes(e.value)&&(H([...D,e.value]),F||q(e.value))},onDeselect:e=>{let s=D.filter(s=>s!==e.value);H(s),F===e.value&&q(s[0]||"")},selectedModel:null,addedModelValues:D,closeOnSelect:!1,title:"Add Models for DSH",activeProviders:c,modelAliases:V}),(0,l.jsx)(i.uR,{isOpen:J,onClose:()=>G(!1),title:"DSH - Manual Configuration",configs:(N=T&&T.trim()?T:m?"<API_KEY_FROM_DASHBOARD>":"sk_10router",w=(D.length>0?D:["provider/model-id"]).map(e=>` - id: ${e}
|
|
23
23
|
name: ${e}`).join("\n"),[{filename:"~/.dsh/profiles/web/cordis.patch.yml (append)",content:`# 10Router provider for DeepSeek Harness — restart \`dsh web\` after editing
|
|
24
24
|
- id: llm-pi-ai
|
|
25
25
|
name: "@deepseek-ai/dsh-llm-pi-ai"
|
|
@@ -37,4 +37,4 @@ ${w}
|
|
|
37
37
|
config:
|
|
38
38
|
provider: 10router
|
|
39
39
|
model: ${F||D[0]||"provider/model-id"}
|
|
40
|
-
`},{filename:"~/.dsh/.credentials.yaml (add ref)",content:`refs: { TEN_ROUTER_API_KEY: ${N} }`}])})]})})}t(56590);let ea=t(65746).env.NEXT_PUBLIC_CLOUD_URL;function en({toolId:e,machineId:s}){let t=m.d[e],[n,u]=(0,a.useState)([]),[p,h]=(0,a.useState)(!0),[g,f]=(0,a.useState)({}),[j,b]=(0,a.useState)(!1),[y
|
|
40
|
+
`},{filename:"~/.dsh/.credentials.yaml (add ref)",content:`refs: { TEN_ROUTER_API_KEY: ${N} }`}])})]})})}t(56590);let ea=t(65746).env.NEXT_PUBLIC_CLOUD_URL;function en({toolId:e,machineId:s}){let t=m.d[e],[n,u]=(0,a.useState)([]),[p,h]=(0,a.useState)(!0),[g,f]=(0,a.useState)({}),[j,b]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),[N,w]=(0,a.useState)(""),[k,C]=(0,a.useState)(!1),[_,S]=(0,a.useState)(""),[E,A]=(0,a.useState)([]);(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let[s,t,l,r]=await Promise.all([fetch("/api/providers"),fetch("/api/settings"),fetch("/api/tunnel/status"),fetch("/api/keys")]);if(!e)return;if(s.ok){let e=await s.json();u(e.connections||[])}if(t.ok){let e=await t.json();b(e.cloudEnabled||!1)}if(l.ok){let e=await l.json();y(!!(e.tunnel?.enabled||e.tunnel?.settingsEnabled)),w(e.tunnel?.publicUrl||""),C(!!(e.tailscale?.enabled||e.tailscale?.settingsEnabled)),S(e.tailscale?.tunnelUrl||"")}if(r.ok){let e=await r.json();A(e.keys||[])}}catch(e){console.log("Error loading tool data:",e)}finally{e&&h(!1)}})(),()=>{e=!1}},[]);let $=()=>n.filter(e=>!1!==e.isActive),M=(0,a.useCallback)((e,s,t)=>{f(l=>l[e]?.[s]===t?l:{...l,[e]:{...l[e],[s]:t}})},[]);return t?(0,l.jsxs)(i.YW,{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(d.$,{variant:"outline",size:"sm",asChild:!0,className:"mb-4 self-start",children:(0,l.jsxs)(o(),{href:"/dashboard/cli-tools",children:[(0,l.jsx)(r.default,{name:"arrow_back",className:"text-lg"}),"CLI Tools"]})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[(0,l.jsx)("div",{className:"size-12 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${t.color}15`},children:(0,l.jsx)(c.A,{src:t.image,alt:t.name,size:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",fallbackText:t.name.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("h1",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:t.name}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:t.description})]})]})]}),p?(0,l.jsx)(i.KX,{}):(()=>{let s,r,a,n=(s=$(),r=[],a=new Set,s.forEach(e=>{let s=x.Xg[e.provider]||e.provider,t=(0,x.KC)(e.provider);if(t.forEach(t=>{let l=`${s}/${t.id}`;a.has(l)||(a.add(l),r.push({value:l,label:`${s}/${t.id}`,provider:e.provider,alias:s,connectionName:e.name,modelId:t.id}))}),0===t.length){let t=e.providerSpecificData?.prefix||s,l=[];e.defaultModel&&l.push({id:e.defaultModel,name:e.defaultModel}),(e.providerSpecificData?.customModels||[]).forEach(e=>{e?.id&&!l.some(s=>s.id===e.id)&&l.push({id:e.id,name:e.name||e.id})}),0===l.length&&"active"===e.testStatus&&l.push({id:"model-id",name:`${t}/model-id`}),l.forEach(s=>{let l=`${t}/${s.id}`;a.has(l)||(a.add(l),r.push({value:l,label:`${t}/${s.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:s.id}))})}}),r).length>0,o={tool:t,isExpanded:!0,onToggle:()=>{},baseUrl:v&&N?N:j&&ea?ea:window.location.origin,apiKeys:E,tunnelEnabled:v,tunnelPublicUrl:N,tailscaleEnabled:k,tailscaleUrl:_};switch(e){case"claude":return(0,l.jsx)(B,{...o,activeProviders:$(),modelMappings:g[e]||{},onModelMappingChange:(s,t)=>M(e,s,t),hasActiveProviders:n,cloudEnabled:j});case"codex":return(0,l.jsx)(Z,{...o,activeProviders:$(),cloudEnabled:j});case"opencode":return(0,l.jsx)(G,{...o,activeProviders:$(),cloudEnabled:j});case"cowork":return(0,l.jsx)(es,{...o,activeProviders:$(),hasActiveProviders:n,cloudEnabled:j,cloudUrl:ea,tunnelEnabled:v,tunnelPublicUrl:N,tailscaleEnabled:k,tailscaleUrl:_});case"dsh":return(0,l.jsx)(er,{...o,activeProviders:$(),cloudEnabled:j});default:return(0,l.jsx)(J,{toolId:e,...o,activeProviders:$(),cloudEnabled:j,tunnelEnabled:v})}})()]}):(0,l.jsxs)(i.YW,{children:[(0,l.jsx)(d.$,{variant:"outline",size:"sm",asChild:!0,className:"self-start",children:(0,l.jsxs)(o(),{href:"/dashboard/cli-tools",children:[(0,l.jsx)(r.default,{name:"arrow_back",className:"text-lg"}),"CLI Tools"]})}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"Tool not found or disabled."})]})}},56590:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});var l=t(29798),r=t(53784),a=t(22205),n=t(738);let o={ok:"bg-green-500",warn:"bg-amber-500",info:"bg-blue-500",muted:"bg-muted-foreground/50"};function i({toolId:e,tool:s,status:t}){let d=s?.configType==="guide"?{label:"Guide",tone:"info"}:t?t.container&&null==t.installed?{label:"Manual setup",tone:"info"}:t.installed?t.has10Router?{label:"Connected",tone:"ok"}:{label:"Not configured",tone:"warn"}:{label:"Not installed",tone:"muted"}:{label:"Unknown",tone:"muted"};return(0,l.jsx)(a.default,{href:`/dashboard/cli-tools/${e}`,title:s.name,iconBg:s.color?`${s.color}15`:void 0,icon:(0,l.jsx)(n.A,{src:s.image,alt:s.name,size:30,className:"max-h-[30px] max-w-[30px] rounded-lg object-contain",fallbackText:s.name.slice(0,2).toUpperCase(),fallbackColor:s.color}),children:(0,l.jsxs)(r.E,{variant:"default",children:[(0,l.jsx)("span",{className:`size-1.5 rounded-full ${o[d.tone]}`}),d.label]})})}},92412:(e,s,t)=>{"use strict";t.d(s,{YW:()=>l.Page,pV:()=>l.CardGrid,wn:()=>l.Section,zY:()=>l.PageHeader}),t(16675),t(72778);var l=t(29575)}},e=>{e.O(0,[6766,5166,7552,9980,6428,4484,9150,3577,5862,5148,1699,1722,1660,4489,1278,1830,6770,427,9966,7358],()=>e(e.s=7006)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{2809:(e,t,a)=>{Promise.resolve().then(a.bind(a,24324))},15764:(e,t,a)=>{"use strict";a.d(t,{CK:()=>d.default,G9:()=>c.default,Iz:()=>j.default,KX:()=>x.PanelSkeleton,LF:()=>n.default,LH:()=>f.default,Mu:()=>x.StatCardSkeleton,Nf:()=>i.default,Qv:()=>o.CardSkeleton,YW:()=>k.YW,gw:()=>h.default,jK:()=>u.default,nh:()=>g.default,pV:()=>k.pV,rq:()=>s.default,uR:()=>r.default,uo:()=>l.ConfirmModal,vE:()=>b.default,vj:()=>p.default,wI:()=>v.default,wn:()=>k.wn,zY:()=>k.zY}),a(58913);var l=a(3537),o=a(58350);a(30872),a(33526),a(42535),a(1279);var n=a(92802),s=a(25908),r=a(58729),d=a(24873),i=a(5258),u=a(80599);a(949),a(56776),a(53599),a(88336),a(69561);var c=a(37753),f=a(23444),b=a(93624),p=a(86920),v=a(65461);a(14580);var h=a(14670),j=a(70296);a(57779),a(22205);var x=a(43276),g=a(75862),k=a(92412)},24324:(e,t,a)=>{"use strict";a.d(t,{default:()=>d});var l=a(29798),o=a(15814),n=a(15764),s=a(90046),r=a(56590);function d({machineId:e}){let[t,a]=(0,o.useState)(!0),[i,u]=(0,o.useState)({});if((0,o.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await fetch("/api/cli-tools/all-statuses");t.ok&&e&&u(await t.json())}catch(e){console.log("Error fetching tool statuses:",e)}finally{e&&a(!1)}})(),()=>{e=!1}},[]),t)return(0,l.jsxs)(n.YW,{children:[(0,l.jsx)(n.zY,{title:"CLI Tools",description:"Connect coding assistants to 10Router — point each tool at your local endpoint.",backHref:"/dashboard/providers",backLabel:"Providers"}),(0,l.jsxs)(n.pV,{children:[(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{})]})]});let c=Object.entries(s.d);return(0,l.jsxs)(n.YW,{children:[(0,l.jsx)(n.zY,{title:"CLI Tools",description:"Connect coding assistants to 10Router — point each tool at your local endpoint.",backHref:"/dashboard/providers",backLabel:"Providers"}),(0,l.jsx)(n.pV,{children:c.map(([e,t])=>(0,l.jsx)(r.A,{toolId:e,tool:t,status:i[e]},e))})]})}},56590:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var l=a(29798),o=a(53784),n=a(22205),s=a(738);let r={ok:"bg-green-500",warn:"bg-amber-500",info:"bg-blue-500",muted:"bg-muted-foreground/50"};function d({toolId:e,tool:t,status:a}){let i=t?.configType==="guide"?{label:"Guide",tone:"info"}:a?a.container&&null==a.installed?{label:"Manual setup",tone:"info"}:a.installed?a.has10Router?{label:"Connected",tone:"ok"}:{label:"Not configured",tone:"warn"}:{label:"Not installed",tone:"muted"}:{label:"Unknown",tone:"muted"};return(0,l.jsx)(n.default,{href:`/dashboard/cli-tools/${e}`,title:t.name,iconBg:t.color?`${t.color}15`:void 0,icon:(0,l.jsx)(s.A,{src:t.image,alt:t.name,size:30,className:"max-h-[30px] max-w-[30px] rounded-lg object-contain",fallbackText:t.name.slice(0,2).toUpperCase(),fallbackColor:t.color}),children:(0,l.jsxs)(o.E,{variant:"default",children:[(0,l.jsx)("span",{className:`size-1.5 rounded-full ${r[i.tone]}`}),i.label]})})}},92412:(e,t,a)=>{"use strict";a.d(t,{YW:()=>l.Page,pV:()=>l.CardGrid,wn:()=>l.Section,zY:()=>l.PageHeader}),a(16675),a(72778);var l=a(29575)}},e=>{e.O(0,[6766,5166,7552,9980,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{2809:(e,t,a)=>{Promise.resolve().then(a.bind(a,24324))},15764:(e,t,a)=>{"use strict";a.d(t,{CK:()=>d.default,G9:()=>c.default,Iz:()=>j.default,KX:()=>x.PanelSkeleton,LF:()=>n.default,LH:()=>f.default,Mu:()=>x.StatCardSkeleton,Nf:()=>i.default,Qv:()=>o.CardSkeleton,YW:()=>k.YW,gw:()=>h.default,jK:()=>u.default,nh:()=>g.default,pV:()=>k.pV,rq:()=>s.default,uR:()=>r.default,uo:()=>l.ConfirmModal,vE:()=>b.default,vj:()=>p.default,wI:()=>v.default,wn:()=>k.wn,zY:()=>k.zY}),a(58913);var l=a(3537),o=a(58350);a(30872),a(33526),a(42535),a(1279);var n=a(92802),s=a(25908),r=a(58729),d=a(24873),i=a(5258),u=a(80599);a(949),a(56776),a(53599),a(88336),a(69561);var c=a(37753),f=a(23444),b=a(93624),p=a(86920),v=a(65461);a(14580);var h=a(14670),j=a(70296);a(57779),a(22205);var x=a(43276),g=a(75862),k=a(92412)},24324:(e,t,a)=>{"use strict";a.d(t,{default:()=>d});var l=a(29798),o=a(15814),n=a(15764),s=a(90046),r=a(56590);function d({machineId:e}){let[t,a]=(0,o.useState)(!0),[i,u]=(0,o.useState)({});if((0,o.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await fetch("/api/cli-tools/all-statuses");t.ok&&e&&u(await t.json())}catch(e){console.log("Error fetching tool statuses:",e)}finally{e&&a(!1)}})(),()=>{e=!1}},[]),t)return(0,l.jsxs)(n.YW,{children:[(0,l.jsx)(n.zY,{title:"CLI Tools",description:"Connect coding assistants to 10Router — point each tool at your local endpoint.",backHref:"/dashboard/providers",backLabel:"Providers"}),(0,l.jsxs)(n.pV,{children:[(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{})]})]});let c=Object.entries(s.d);return(0,l.jsxs)(n.YW,{children:[(0,l.jsx)(n.zY,{title:"CLI Tools",description:"Connect coding assistants to 10Router — point each tool at your local endpoint.",backHref:"/dashboard/providers",backLabel:"Providers"}),(0,l.jsx)(n.pV,{children:c.map(([e,t])=>(0,l.jsx)(r.A,{toolId:e,tool:t,status:i[e]},e))})]})}},56590:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var l=a(29798),o=a(53784),n=a(22205),s=a(738);let r={ok:"bg-green-500",warn:"bg-amber-500",info:"bg-blue-500",muted:"bg-muted-foreground/50"};function d({toolId:e,tool:t,status:a}){let i=t?.configType==="guide"?{label:"Guide",tone:"info"}:a?a.container&&null==a.installed?{label:"Manual setup",tone:"info"}:a.installed?a.has10Router?{label:"Connected",tone:"ok"}:{label:"Not configured",tone:"warn"}:{label:"Not installed",tone:"muted"}:{label:"Unknown",tone:"muted"};return(0,l.jsx)(n.default,{href:`/dashboard/cli-tools/${e}`,title:t.name,iconBg:t.color?`${t.color}15`:void 0,icon:(0,l.jsx)(s.A,{src:t.image,alt:t.name,size:30,className:"max-h-[30px] max-w-[30px] rounded-lg object-contain",fallbackText:t.name.slice(0,2).toUpperCase(),fallbackColor:t.color}),children:(0,l.jsxs)(o.E,{variant:"default",children:[(0,l.jsx)("span",{className:`size-1.5 rounded-full ${r[i.tone]}`}),i.label]})})}},92412:(e,t,a)=>{"use strict";a.d(t,{YW:()=>l.Page,pV:()=>l.CardGrid,wn:()=>l.Section,zY:()=>l.PageHeader}),a(16675),a(72778);var l=a(29575)}},e=>{e.O(0,[6766,5166,7552,9980,6428,4484,9150,3577,5862,5148,1699,1722,1660,4489,1278,1830,6770,427,9966,7358],()=>e(e.s=2809)),_N_E=e.O()}]);
|