zevairouter 1.1.61 → 1.1.63
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/CHANGELOG.md +21 -0
- package/cli/app/.next-cli-build/BUILD_ID +1 -1
- package/cli/app/.next-cli-build/app-path-routes-manifest.json +10 -10
- package/cli/app/.next-cli-build/build-manifest.json +2 -2
- package/cli/app/.next-cli-build/prerender-manifest.json +5 -5
- package/cli/app/.next-cli-build/required-server-files.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +11 -11
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +4 -4
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cache/stats/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/changelog/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +8 -11
- package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +4 -4
- package/cli/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-gateway/accounts/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-gateway/accounts/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +5 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +3 -4
- package/cli/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +5 -5
- package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +4 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +4 -4
- package/cli/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +4 -4
- package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +6 -3
- package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/openbot-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/openbot-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +4 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +3 -4
- package/cli/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +3 -4
- package/cli/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/context/[id]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/context/bulk/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/context/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/context/test/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/context/test/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/dashboard/chat/completions/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/dashboard/chat/completions/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/dashboard/cli-tools/keys/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/dashboard/media/[operation]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/dashboard/media/[operation]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/dashboard/media/videos/[id]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/dashboard/media/videos/[id]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/headroom/enable/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/health/ready/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/init/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/metrics/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/latest/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/cancel/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/latest/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/latest/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-token/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/quota-cookie/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/cancel/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/latest/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/latest/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-token/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/quota-cookie/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/latest/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-token/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/json-import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/latest/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/latest/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/bulk-delete/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/bulk-delete/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/cloudflare-ai/discover-models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/cloudflare-ai/discover-models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/codebuddy/discover-models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/codebuddy/discover-models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/codebuddy-cn/discover-models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/codebuddy-cn/discover-models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/codebuddy-intl/discover-models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/codebuddy-intl/discover-models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/flow/import/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/flow/login/[jobId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/flow/login/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/kiro/discover-models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/kiro/discover-models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/kiro/models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/kiro/models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/opencode/discover-models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/opencode/discover-models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/openrouter/discover-models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/openrouter/discover-models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/web-login/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/web-login/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/settings/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/terminal/auth/setup/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/terminal/auth/status/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/terminal/auth/unlock/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/input/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/resize/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/stream/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/terminal/session/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/aggregate/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/aggregate/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/quota-stream/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/usage/quota-stream/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/routing-stream/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/content/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/callback/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/callback.html +1 -1
- package/cli/app/.next-cli-build/server/app/callback.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/skills.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.html +1 -1
- package/cli/app/.next-cli-build/server/app/index.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/landing.html +1 -1
- package/cli/app/.next-cli-build/server/app/landing.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/login/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/login.html +1 -1
- package/cli/app/.next-cli-build/server/app/login.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/page.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/provider-icons/[provider]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/provider-icons/[provider]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/skills/[skill]/SKILL.md/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app-paths-manifest.json +10 -10
- package/cli/app/.next-cli-build/server/chunks/1350.js +2 -2
- package/cli/app/.next-cli-build/server/chunks/1757.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/24.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/2731.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/3190.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/{7140.js → 3204.js} +1 -1
- package/cli/app/.next-cli-build/server/chunks/3598.js +5 -0
- package/cli/app/.next-cli-build/server/chunks/4039.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/412.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/{3227.js → 4440.js} +1 -1
- package/cli/app/.next-cli-build/server/chunks/4730.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/4780.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/5024.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/5330.js +16 -3
- package/cli/app/.next-cli-build/server/chunks/5626.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/5728.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/5992.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/{7401.js → 6486.js} +1 -1
- package/cli/app/.next-cli-build/server/chunks/6954.js +1 -0
- package/cli/app/.next-cli-build/server/chunks/7135.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/7319.js +21 -8
- package/cli/app/.next-cli-build/server/chunks/7404.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/751.js +31 -0
- package/cli/app/.next-cli-build/server/chunks/7525.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/7557.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/7793.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/8238.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/8795.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/8895.js +4 -4
- package/cli/app/.next-cli-build/server/chunks/9190.js +15 -0
- package/cli/app/.next-cli-build/server/chunks/9548.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/9609.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/9618.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/9679.js +1 -1
- package/cli/app/.next-cli-build/server/instrumentation.js +1 -1
- package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/middleware.js +1 -1
- package/cli/app/.next-cli-build/server/pages/404.html +1 -1
- package/cli/app/.next-cli-build/server/pages/500.html +1 -1
- package/cli/app/.next-cli-build/server/preview-props.json +3 -3
- package/cli/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/cli/app/.next-cli-build/static/chunks/{5497-822e6a23bcd9f3a2.js → 5497-595a86d52e3282e9.js} +2 -2
- package/cli/app/.next-cli-build/static/chunks/620-a941118f49a65497.js +1 -0
- package/cli/app/.next-cli-build/static/chunks/{866-95ac0134c200c9b4.js → 866-bb843c1c0ae9bed5.js} +1 -1
- package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-02fd3d6ccfcae9ed.js +1 -0
- package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-f6d7c9ab2bbcaa0c.js → page-fb899c1537b81045.js} +11 -11
- package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-7f6579c9e603c1c7.js → page-e55d7f6bcc1e5a92.js} +4 -4
- package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-a205615e648f47a1.js → page-bd548bf893d36787.js} +1 -1
- package/cli/app/CHANGELOG.md +21 -0
- package/cli/app/package.json +3 -1
- package/cli/app/public/providers/nvidia-build.png +0 -0
- package/cli/app/server.js +1 -1
- package/cli/package.json +1 -1
- package/package.json +3 -1
- package/cli/app/.next-cli-build/server/chunks/2399.js +0 -1
- package/cli/app/.next-cli-build/server/chunks/2750.js +0 -31
- package/cli/app/.next-cli-build/server/chunks/8067.js +0 -2
- package/cli/app/.next-cli-build/static/chunks/620-6bc0743e08675b16.js +0 -1
- package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-bccb233dc48b2cf1.js +0 -1
- /package/cli/app/.next-cli-build/static/{Vn1udaE2xDihgrgbIZTef → 8Kqnro46zXdgDtZX-RrYP}/_buildManifest.js +0 -0
- /package/cli/app/.next-cli-build/static/{Vn1udaE2xDihgrgbIZTef → 8Kqnro46zXdgDtZX-RrYP}/_ssgManifest.js +0 -0
package/cli/app/.next-cli-build/static/chunks/{866-95ac0134c200c9b4.js → 866-bb843c1c0ae9bed5.js}
RENAMED
|
@@ -56,7 +56,7 @@ api_backend = "chat_completions"
|
|
|
56
56
|
api_key = "${e}"`)}return a.length&&s.splice(1,0,`[subagents.models]
|
|
57
57
|
${a.join("\n")}`),[{filename:"~/.grok/config.toml",content:`${s.join("\n\n")}
|
|
58
58
|
`}]})()})]})}let U=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function z({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:o,apiKeys:d,activeProviders:c,cloudEnabled:m,initialStatus:u,tunnelEnabled:g,tunnelPublicUrl:f,tailscaleEnabled:y,tailscaleUrl:b}){let j,v,N,w,[k,C]=(0,l.useState)(u||null),[S,_]=(0,l.useState)(!1),[E,A]=(0,l.useState)(!1),[O,$]=(0,l.useState)(!1),[M,P]=(0,l.useState)(null),[T,R]=(0,l.useState)(""),[I,L]=(0,l.useState)([]),[D,K]=(0,l.useState)(""),[F,H]=(0,l.useState)(!1),[B,Z]=(0,l.useState)({}),[q,W]=(0,l.useState)(!1),[G,J]=(0,l.useState)(!1),[V,Y]=(0,l.useState)(""),Q=(0,l.useRef)(!1),X=(()=>{if(!k?.installed)return null;let e=k.settings?.customModels?.find(e=>e.id?.startsWith("custom:Zevai"));return e?h(e.baseUrl,{tunnelPublicUrl:f,tailscaleUrl:b,cloudUrl:m?U:null})?"configured":"other":"not_configured"})();(0,l.useEffect)(()=>{d?.length>0&&!T&&R(d[0].key)},[d,T]),(0,l.useEffect)(()=>{u&&C(u)},[u]),(0,l.useEffect)(()=>{t&&!k&&(et(),ee()),t&&ee()},[t]);let ee=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&Z(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(k?.installed&&!Q.current){Q.current=!0;let e=(k.settings?.customModels||[]).filter(e=>e.id?.startsWith("custom:Zevai")).sort((e,t)=>(e.index||0)-(t.index||0)).map(e=>e.model);e.length>0&&L(e)}},[k]);let et=async()=>{_(!0);try{let e=await fetch("/api/cli-tools/droid-settings"),t=await e.json();C(t)}catch(e){C({installed:!1,error:e.message})}finally{_(!1)}},es=()=>{let e=V||n;return e.endsWith("/v1")?e:`${e}/v1`},ea=()=>{let e=D.trim();!e||I.includes(e)||(L(t=>[...t,e]),K(""))},el=async()=>{A(!0),P(null);try{let e=T?.trim()||(d?.length>0?d[0].key:null)||(m?null:"sk_zevai"),t=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:es(),apiKey:e,models:I,activeModel:I[0]||""})}),s=await t.json();t.ok?(P({type:"success",text:"Settings applied successfully!"}),et()):P({type:"error",text:s.error||"Failed to apply settings"})}catch(e){P({type:"error",text:e.message})}finally{A(!1)}},er=async()=>{$(!0),P(null);try{let e=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),t=await e.json();e.ok?(P({type:"success",text:"Settings reset successfully!"}),L([]),et()):P({type:"error",text:t.error||"Failed to reset settings"})}catch(e){P({type:"error",text:e.message})}finally{$(!1)}};return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.A,{src:"/providers/droid.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===X&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===X&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===X&&(0,a.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,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[S&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Factory Droid CLI..."})]}),!S&&k&&!k.installed&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Factory Droid CLI not detected locally"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if ZevaiRouter is deployed on a remote server."})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,a.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>W(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>J(!G),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:G?"expand_less":"help"}),G?"Hide":"How to Install"]})]})]}),G&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,a.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,a.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"curl -fsSL https://app.factory.ai/cli | sh"})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"droid"})," to verify."]})]})]})]}),!S&&k?.installed&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:V||((j=V||n).endsWith("/v1")?j:`${j}/v1`),onChange:Y,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:g,tunnelPublicUrl:f,tailscaleEnabled:y,tailscaleUrl:b})]}),k?.settings?.customModels?.find(e=>e.id?.startsWith("custom:Zevai"))?.baseUrl&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:k.settings.customModels.find(e=>e.id?.startsWith("custom:Zevai")).baseUrl})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:T,onChange:R,apiKeys:d,cloudEnabled:m})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsxs)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:["Models ",I.length>0&&(0,a.jsxs)("span",{className:"text-primary",children:["(",I.length,")"]})]}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-1",children:[I.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-0.5 mb-1",children:I.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-bg-secondary rounded border border-border",children:[(0,a.jsx)("span",{className:"flex-1 text-xs font-mono truncate",children:e}),(0,a.jsx)("button",{onClick:()=>L(t=>t.filter(t=>t!==e)),className:"text-text-muted hover:text-red-500 transition-colors shrink-0",title:"Remove",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e))}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("input",{type:"text",value:D,onChange:e=>K(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ea())},placeholder:"provider/model-id",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),(0,a.jsx)("button",{onClick:()=>H(!0),disabled:!o,className:`px-2 py-1.5 rounded border text-xs shrink-0 ${o?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),(0,a.jsx)("button",{onClick:ea,disabled:!D.trim(),className:"px-2 py-1.5 rounded border bg-surface border-border hover:border-primary text-xs shrink-0 disabled:opacity-50",title:"Add model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"add"})})]})]})]})]}),M&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===M.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===M.type?"check_circle":"error"}),(0,a.jsx)("span",{children:M.text})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:el,disabled:0===I.length,loading:E,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:er,disabled:!k?.hasZevai,loading:O,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>W(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:F,onClose:()=>H(!1),onSelect:e=>{!e.value||I.includes(e.value)||(L(t=>[...t,e.value]),H(!1))},selectedModel:null,activeProviders:c,modelAliases:B,title:"Select Model for Factory Droid"}),(0,a.jsx)(r.uR,{isOpen:q,onClose:()=>W(!1),title:"Factory Droid - Manual Configuration",configs:(v=T&&T.trim()?T:m?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",N={customModels:I.map((e,t)=>({model:e,id:`custom:Zevai-${t}`,index:t,baseUrl:es(),apiKey:v,displayName:e,maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}))},w="u">typeof navigator&&navigator.platform,[{filename:w?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(N,null,2)}])})]})}function L({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:o,apiKeys:d,activeProviders:c,cloudEnabled:m,initialStatus:u,tunnelEnabled:g,tunnelPublicUrl:f,tailscaleEnabled:y,tailscaleUrl:b}){let j,v,[N,w]=(0,l.useState)(u||null),[k,C]=(0,l.useState)(!1),[S,_]=(0,l.useState)(!1),[E,A]=(0,l.useState)(!1),[O,$]=(0,l.useState)(null),[M,P]=(0,l.useState)(""),[T,R]=(0,l.useState)(""),[I,U]=(0,l.useState)({}),[z,D]=(0,l.useState)(null),[K,F]=(0,l.useState)(!1),[H,B]=(0,l.useState)({}),[Z,q]=(0,l.useState)(!1),[W,G]=(0,l.useState)(""),J=(0,l.useRef)(!1),V=(()=>{if(!N?.installed)return null;let e=N.settings?.models?.providers?.zevai;return e?h(e.baseUrl,{tunnelPublicUrl:f,tailscaleUrl:b})?"configured":"other":"not_configured"})();(0,l.useEffect)(()=>{d?.length>0&&!M&&P(d[0].key)},[d,M]),(0,l.useEffect)(()=>{u&&w(u)},[u]),(0,l.useEffect)(()=>{t&&!N&&(Q(),Y()),t&&Y()},[t]);let Y=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&B(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(N?.installed&&!J.current){J.current=!0;let e=N.settings?.models?.providers?.zevai;if(e){let t=N.settings?.agents?.defaults?.model?.primary;t&&R(t.replace("zevai/","")),e.apiKey&&d?.some(t=>t.key===e.apiKey)&&P(e.apiKey)}let t=N.agents||[],s={};t.forEach(e=>{e.currentModel&&(s[e.id]=e.currentModel)}),U(s)}},[N,d]);let Q=async()=>{C(!0);try{let e=await fetch("/api/cli-tools/openclaw-settings"),t=await e.json();w(t)}catch(e){w({installed:!1,error:e.message})}finally{C(!1)}},X=()=>window.location.origin.replace("://localhost","://127.0.0.1"),ee=()=>{let e=W||X();return e.endsWith("/v1")?e:`${e}/v1`},et=async()=>{_(!0),$(null);try{let e=M?.trim()||(d?.length>0?d[0].key:null)||(m?null:"sk_zevai"),t=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ee(),apiKey:e,model:T,agentModels:I})}),s=await t.json();t.ok?($({type:"success",text:"Settings applied successfully!"}),Q()):$({type:"error",text:s.error||"Failed to apply settings"})}catch(e){$({type:"error",text:e.message})}finally{_(!1)}},es=async()=>{A(!0),$(null);try{let e=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),t=await e.json();e.ok?($({type:"success",text:"Settings reset successfully!"}),R(""),P(""),Q()):$({type:"error",text:t.error||"Failed to reset settings"})}catch(e){$({type:"error",text:e.message})}finally{A(!1)}};return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.A,{src:"/providers/openclaw.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===V&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===V&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===V&&(0,a.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,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[k&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Open Claw CLI..."})]}),!k&&N&&!N.installed&&(0,a.jsx)("div",{className:"flex flex-col gap-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Open Claw CLI not detected locally"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if zevairouter is deployed on a remote server."})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 pl-9",children:(0,a.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>q(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]})}),!k&&N?.installed&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:W||((j=W||X()).endsWith("/v1")?j:`${j}/v1`),onChange:G,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:g,tunnelPublicUrl:f,tailscaleEnabled:y,tailscaleUrl:b})]}),N?.settings?.models?.providers?.zevai?.baseUrl&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:N.settings.models.providers.zevai.baseUrl})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:M,onChange:P,apiKeys:d,cloudEnabled:m})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Default Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,a.jsx)("input",{type:"text",value:T,onChange:e=>R(e.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),T&&(0,a.jsx)("button",{onClick:()=>R(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,a.jsx)("button",{onClick:()=>{D(null),F(!0)},disabled:!o,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${o?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]}),(N.agents||[]).filter(e=>e.agentDir).map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-4",children:[(0,a.jsxs)("span",{className:"w-32 shrink-0 text-xs text-primary text-right truncate",title:e.name||e.id,children:["Agent ",e.name||e.id]}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,a.jsx)("input",{type:"text",value:I[e.id]||"",onChange:t=>U(s=>({...s,[e.id]:t.target.value})),placeholder:`default (${T||"provider/model-id"})`,className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),I[e.id]&&(0,a.jsx)("button",{onClick:()=>U(t=>({...t,[e.id]:""})),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,a.jsx)("button",{onClick:()=>{D(e.id),F(!0)},disabled:!o,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${o?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]},e.id))]}),O&&(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===O.type?"check_circle":"error"}),(0,a.jsx)("span",{children:O.text})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:et,disabled:!T,loading:S,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:es,disabled:!N?.hasZevai,loading:E,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>q(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:K,onClose:()=>F(!1),onSelect:e=>{z?(U(t=>({...t,[z]:e.value})),D(null)):R(e.value),F(!1)},selectedModel:T,activeProviders:c,modelAliases:H,title:"Select Model for Open Claw"}),(0,a.jsx)(r.uR,{isOpen:Z,onClose:()=>q(!1),title:"Open Claw - Manual Configuration",configs:(v=M&&M.trim()?M:m?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`zevai/${T||"provider/model-id"}`}}},models:{providers:{zevai:{baseUrl:ee(),apiKey:v,api:"openai-completions",models:[{id:T||"provider/model-id",name:(T||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}var D=s(3534);let K="ZEVAIROUTER_API_KEY",F=e=>/[\r\n]/.test(e||""),H=e=>{let t=e.trim().toLowerCase();return/[<>]/.test(t)||t.endsWith("/model-id")||["your-api-key","api-key-from-dashboard"].includes(t)};function B(e){let t=(e||"").trim().replace(/\/+$/,"");return t?/\/v1$/i.test(t)?`${t.slice(0,-3)}/v1`:`${t}/v1`:""}function Z(e){let t=(e||"").trim();if(!t)return!1;try{let e=new URL(t).pathname.replace(/\/+$/,"");if(e){let t=e.toLowerCase(),s=/\/v1$/.test(t)||"/v1"===t,a=/\/v\d+(?!$)/.test(t)||/\/v\d+$/.test(t)&&!s;if(!s&&a)return!1}}catch{return!1}let s=B(t);try{let e=new URL(s);return["http:","https:"].includes(e.protocol)&&!!e.hostname&&!e.username&&!e.password&&!e.search&&!e.hash}catch{return!1}}function q(e){return!!Z(e)&&"https:"===new URL(B(e)).protocol}function W(e){try{let t=new URL(B(e)).hostname.replace(/^\[|\]$/g,"").replace(/\.$/,"").toLowerCase();return"localhost"===t||t.endsWith(".localhost")||"0.0.0.0"===t||"::"===t||"::1"===t||t.startsWith("::ffff:7f")||t.startsWith("127.")}catch{return!1}}var G=s(41463);let J="/api/cli-tools/hermes-settings",V=D.dM.hermes.roles,Y=G.env.NEXT_PUBLIC_CLOUD_URL||"";function Q({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:o,apiKeys:d,activeProviders:c,cloudEnabled:m,initialStatus:u,tunnelEnabled:h,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y}){let[b,j]=(0,l.useState)(u||null),[v,N]=(0,l.useState)(!1),[w,k]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[_,E]=(0,l.useState)(!1),[A,O]=(0,l.useState)(null),[$,M]=(0,l.useState)(""),[P,T]=(0,l.useState)(""),[R,I]=(0,l.useState)(!1),[U,z]=(0,l.useState)(""),[L,D]=(0,l.useState)({}),[G,X]=(0,l.useState)("boolean"==typeof u?.installed?u.installed?"router-host":"another-device":"router-host"),[ee,et]=(0,l.useState)(!1),[es,ea]=(0,l.useState)({}),[el,er]=(0,l.useState)(!1),[ei,en]=(0,l.useState)(!1),[eo,ed]=(0,l.useState)(!1),[ec,em]=(0,l.useState)(""),ex=(0,l.useRef)(!1),[ep,eu]=(0,l.useState)([{name:"default",isDefault:!0,command:"hermes"}]),[eh,eg]=(0,l.useState)("default"),ef=(0,l.useRef)("default"),ey=(0,l.useRef)(!1),eb=e=>{if(ey.current||"boolean"!=typeof e?.installed)return;let t=e.installed?"router-host":"another-device";G!==t&&(X(t),em(""))},ej=b?.installed?b.hasZevai?"configured":b.settings?.model?.base_url?"other":"not_configured":null;(0,l.useEffect)(()=>{d?.length>0&&!$&&M(d[0].key)},[d,$]),(0,l.useEffect)(()=>{u&&(j(u),eb(u))},[u]),(0,l.useEffect)(()=>{t&&(fetch("/api/cli-tools/hermes-profiles",{cache:"no-store"}).then(e=>e.json()).then(e=>{Array.isArray(e.profiles)&&e.profiles.length>0&&eu(e.profiles)}).catch(()=>{}),ek(),ev())},[t]),(0,l.useEffect)(()=>{if(b?.installed&&!ex.current){ex.current=!0;let e=b.settings?.model?.default;e&&T(e);let t=b.settings?.roles,s={};for(let[e,a]of(t?.delegation?.model&&(s.delegation=t.delegation.model),Object.entries(t?.auxiliary||{})))a?.model&&(s[e]=a.model);Object.keys(s).length&&D(s)}},[b]);let ev=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&ea(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},eN=(e=ef.current)=>e&&"default"!==e?`profile=${encodeURIComponent(e)}`:"",ew=(0,l.useRef)(0),ek=async({syncSelectedModel:e=!1}={})=>{let t=++ew.current;N(!0);try{let s=eN(),a=await fetch(s?`${J}?${s}`:J,{cache:"no-store"}),l=await a.json();if(!a.ok)throw Error(l.error||"Failed to check Hermes Agent");if(t!==ew.current)return;j(l),eb(l),e&&(ex.current=!0,T(l.settings?.model?.default||"")),l.hasZevaiStt&&(I(!0),z(l.settings?.stt?.model||""))}catch(e){if(t!==ew.current)return;j(t=>({...t||{},installed:null,error:e.message}))}finally{t===ew.current&&N(!1)}},eC=B(b?.localBaseUrl||""),eS="another-device"===G,e_=!eS&&b?.installed===!0&&b?.supported===!1,eE=B(ec||(eS?"":eC)),eA=function({selectedApiKey:e,apiKeys:t=[]}){let s=e?.trim();if(s)return s;let a=t.find(e=>e?.key?.trim())?.key?.trim();return a||""}({selectedApiKey:$,apiKeys:d}),eO=[...eS||eC?[]:["Check the ZevaiRouter host status before generating same-host settings."],...e_?["Update Hermes Agent to version 0.4.0 or newer before applying this configuration."]:[],...function({model:e,apiKey:t,baseUrl:s,remote:a=!1}){let l=[],r=e?.trim()||"",i=t?.trim()||"";return(!r||F(r)||H(r))&&l.push("Select or enter a real model ID before copying the configuration."),(!i||F(i)||H(i)||!/^[A-Za-z0-9._~+/=@:%-]+$/.test(i))&&l.push("Select or enter a ZevaiRouter API key before copying the configuration."),Z(s)?a&&W(s)?l.push("Hermes on another device cannot reach the router through localhost; choose Tunnel, Tailscale, Cloud, or another reachable URL."):a&&!q(s)&&l.push("Use an HTTPS endpoint for Hermes on another device so the API key and prompts are encrypted in transit."):l.push("Choose a valid HTTP(S) ZevaiRouter endpoint."),l}({model:P,apiKey:eA,baseUrl:eE,remote:eS})],e$=0===eO.length,eM=async()=>{if(e$&&!eS&&b?.installed&&!(ep.length<2)){k(!0),O(null);try{let e=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({applyToAll:!0,baseUrl:eE,apiKey:eA,model:P.trim()})}),t=await e.json();if(!e.ok)throw Error(t.error||"Failed to update Hermes profiles");let s=(t.results||[]).filter(e=>"updated"!==e.status);O({type:t.updated>0&&0===s.length?"success":"error",text:s.length?`${t.message}. ${s.map(e=>`${e.profile}: ${e.reason||e.status}`).join("; ")}`:`${t.message}. Restart Hermes before testing a prompt.`}),await ek()}catch(e){O({type:"error",text:e.message})}finally{k(!1)}}},eP=async()=>{if(e$&&!eS&&b?.installed){k(!0),O(null);try{let e=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({..."default"!==ef.current?{profile:ef.current}:{},baseUrl:eE,apiKey:eA,model:P.trim(),audio:{enabled:R,model:U.trim()},selections:V.map(e=>({role:e.id,model:(L[e.id]||"").trim()})).filter(e=>e.model)})}),t=await e.json();if(!e.ok)throw Error(t.error||"Failed to apply Hermes settings");let s=t.message||"Hermes settings applied on the ZevaiRouter host.";O({type:"success",text:`${s} Restart Hermes, then run hermes doctor before testing a prompt.`}),await ek()}catch(e){O({type:"error",text:e.message})}finally{k(!1)}}},eT=async()=>{S(!0),O(null);try{let e=eN(),t=await fetch(e?`${J}?${e}`:J,{method:"DELETE"}),s=await t.json();if(!t.ok)throw Error(s.error||"Failed to restore the Hermes backup");en(!1);let a=s.message||"The previous Hermes settings were restored.";O({type:"success",text:`${a} Restart Hermes so the restored settings take effect.`}),await ek({syncSelectedModel:!0})}catch(e){O({type:"error",text:e.message})}finally{S(!1)}},eR=async()=>{E(!0),O(null);try{let e=eN(),t=await fetch(`${J}?discard=1${e?`&${e}`:""}`,{method:"DELETE"}),s=await t.json();if(!t.ok)throw Error(s.error||"Failed to discard the stale Hermes backup");ed(!1),O({type:"success",text:s.message||"The stale backup was discarded without changing the current Hermes settings."}),await ek({syncSelectedModel:!0})}catch(e){O({type:"error",text:e.message})}finally{E(!1)}},eI=b?.backup,eU=!!(eI?.available&&eI.restorable),ez=!!(eI?.available&&eI.conflict),eL=b?.installed===null&&!!b?.error,eD=eS?"Run these steps on the laptop, desktop, or VPS where Hermes is installed. The selected endpoint must be reachable from that machine.":"Run these steps on the same host as ZevaiRouter. Detection and the Apply button never configure the browser device.";return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"flex size-8 shrink-0 items-center justify-center",children:(0,a.jsx)(i.A,{src:"/providers/hermes.png",alt:e.name,width:32,height:32,className:"size-8 rounded-lg object-contain",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"text-sm font-medium",children:e.name}),"configured"===ej&&(0,a.jsx)("span",{className:"rounded-full bg-green-500/10 px-1.5 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",children:"Connected on router host"}),"not_configured"===ej&&(0,a.jsx)("span",{className:"rounded-full bg-yellow-500/10 px-1.5 py-0.5 text-[10px] font-medium text-yellow-600 dark:text-yellow-400",children:"Not configured"}),"other"===ej&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"Other config"})]}),(0,a.jsx)("p",{className:"truncate text-xs text-text-muted",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] text-text-muted transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-4 border-t border-border pt-4",children:[v&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking for Hermes on the ZevaiRouter host..."})]}),!v&&b&&G&&(0,a.jsxs)(a.Fragment,{children:[ep.length>1&&!eS&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Profile"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-[14px] text-text-muted sm:inline",children:"arrow_forward"}),(0,a.jsx)("select",{value:eh,onChange:e=>{let t=e.target.value;ef.current=t,eg(t),ex.current=!1,O(null),ek({syncSelectedModel:!0})},className:"w-full min-w-0 rounded border border-border bg-surface px-2 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:ep.map(e=>(0,a.jsxs)("option",{value:e.name,children:[e.displayName||e.name," (",e.command,")"]},e.name))})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Hermes runs on"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-[14px] text-text-muted sm:inline",children:"arrow_forward"}),(0,a.jsxs)("select",{value:G,onChange:e=>{ey.current=!0,X(e.target.value),em(""),O(null)},className:"w-full min-w-0 rounded border border-border bg-surface px-2 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[(0,a.jsx)("option",{value:"router-host",children:"This ZevaiRouter host"}),(0,a.jsx)("option",{value:"another-device",children:"Another device or VPS"})]})]}),(0,a.jsx)("div",{className:`rounded-lg border px-3 py-2.5 ${eS?"border-blue-500/25 bg-blue-500/10":b.installed?"border-green-500/25 bg-green-500/10":"border-yellow-500/30 bg-yellow-500/10"}`,children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined mt-0.5 text-[17px] ${eS?"text-blue-500":b.installed?"text-green-500":"text-yellow-500"}`,children:eS?"devices":b.installed?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:eS?"Manual setup for a different machine":eL?"Hermes detection is unavailable":b.installed?"Hermes detected on the ZevaiRouter host":"Hermes not detected on the ZevaiRouter host"}),(0,a.jsx)("p",{className:"mt-0.5 text-xs leading-5 text-text-muted",children:eS?"Host detection does not inspect your browser device. Use Tunnel, Tailscale, Cloud, or a custom URL reachable from the Hermes machine.":eL?"Check the error below, then retry host detection.":b.installed?`Apply writes only the host configuration${b.configPath?` at ${b.configPath}`:""}.`:"Install Hermes on this host before using Apply, or switch to another device and follow Manual Setup there."})]})]})}),b.error&&(0,a.jsx)("div",{className:"rounded bg-red-500/10 px-2 py-1.5 text-xs text-red-600",children:b.error}),e_&&(0,a.jsxs)("div",{className:"rounded bg-yellow-500/10 px-2 py-1.5 text-xs text-yellow-700 dark:text-yellow-300",children:["Hermes ",b.version?`v${b.version}`:"on this host"," is too old for secure environment-variable API-key references. Update to v0.4.0 or newer."]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Zevai endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-[14px] text-text-muted sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:ec,onChange:em,localUrl:eC,requiresExternalUrl:eS,tunnelEnabled:h&&(!eS||q(g)),tunnelPublicUrl:g,tailscaleEnabled:f&&(!eS||q(y)),tailscaleUrl:y,cloudEnabled:m&&(!eS||q(Y)),cloudUrl:Y,recommendedUrl:eS&&[h?g:"",f?y:"",m?Y:"",n,window.location.origin].map(B).find(e=>q(e)&&!W(e))||"",recommendedLabel:"Dashboard URL"},`${G}:${eC}`)]}),!eS&&b.settings?.model?.base_url&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current host URL"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-[14px] text-text-muted sm:inline",children:"arrow_forward"}),(0,a.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:b.settings.model.base_url})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Router API key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-[14px] text-text-muted sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:$,onChange:M,apiKeys:d,cloudEnabled:m})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Default model"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-[14px] text-text-muted sm:inline",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,a.jsx)("input",{type:"text",value:P,onChange:e=>T(e.target.value),placeholder:"Select or enter an actual model ID",className:"w-full min-w-0 rounded border border-border bg-surface py-2 pl-2 pr-7 text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),P&&(0,a.jsx)("button",{type:"button",onClick:()=>T(""),className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-0.5 text-text-muted transition-colors hover:text-red-500",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,a.jsx)("button",{type:"button",onClick:()=>et(!0),disabled:!o,className:`w-full whitespace-nowrap rounded border px-2 py-2 text-xs transition-colors sm:w-auto sm:shrink-0 sm:py-1.5 ${o?"cursor-pointer border-border bg-surface text-text-main hover:border-primary":"cursor-not-allowed border-border opacity-50"}`,children:"Select"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Audio STT"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-[14px] text-text-muted sm:inline",children:"arrow_forward"}),(0,a.jsxs)("label",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)("input",{type:"checkbox",checked:R,onChange:e=>I(e.target.checked)}),"Route Hermes voice through /v1/audio/transcriptions"]})]}),(0,a.jsxs)("details",{className:"rounded border border-border px-2 py-1.5",children:[(0,a.jsx)("summary",{className:"cursor-pointer text-xs font-semibold text-text-main",children:"Model roles"}),(0,a.jsx)("p",{className:"mb-2 mt-1 text-xs text-text-muted",children:"Optional Hermes 0.21.5 slots. A blank slot is left unchanged. Web Extract is not listed because it no longer calls a model."}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:V.map(e=>(0,a.jsxs)("label",{className:"grid grid-cols-1 gap-1 sm:grid-cols-[11rem_1fr] sm:items-center",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:e.label}),(0,a.jsx)("input",{type:"text",value:L[e.id]||"",onChange:t=>D(s=>({...s,[e.id]:t.target.value})),placeholder:"Leave blank to keep the current slot",className:"w-full min-w-0 rounded border border-border bg-surface px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]},e.id))})]}),R&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"STT model"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-[14px] text-text-muted sm:inline",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:U,onChange:e=>z(e.target.value),placeholder:"provider/whisper-model-id",className:"w-full min-w-0 rounded border border-border bg-surface px-2 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"})]})]}),!e$&&(0,a.jsxs)("div",{className:"flex items-start gap-2 rounded bg-yellow-500/10 px-2 py-1.5 text-xs text-yellow-700 dark:text-yellow-300",children:[(0,a.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-[14px]",children:"info"}),(0,a.jsx)("span",{children:eO[0]})]}),eI?.conflict&&(0,a.jsxs)("div",{className:"flex items-start gap-2 rounded bg-yellow-500/10 px-2 py-1.5 text-xs text-yellow-700 dark:text-yellow-300",children:[(0,a.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-[14px]",children:"shield_lock"}),(0,a.jsx)("span",{children:"The managed Hermes fields changed after Apply. Review the current files, then discard the stale backup to keep them and allow a new Apply; Restore will never overwrite them."})]}),A&&(0,a.jsxs)("div",{className:`flex items-center gap-2 rounded px-2 py-1.5 text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,a.jsx)("span",{children:A.text})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:eP,disabled:eS||!b.installed||!e$||ez||R&&!U.trim(),loading:w,className:"w-full sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined mr-1 text-[14px]",children:"save"}),"Apply on router host"]}),ep.length>1&&(0,a.jsx)(r.$n,{variant:"secondary",size:"sm",onClick:eM,disabled:eS||!b.installed||!e$||w,loading:w,className:"w-full sm:w-auto",children:"Apply endpoint to all profiles"}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>en(!0),disabled:eS||!eU,loading:C,className:"w-full sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined mr-1 text-[14px]",children:"restore"}),"Restore backup"]}),ez&&(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>ed(!0),disabled:eS,loading:_,className:"w-full sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined mr-1 text-[14px]",children:"delete_sweep"}),"Discard stale backup"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>er(!0),className:"w-full sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined mr-1 text-[14px]",children:"terminal"}),"Manual Setup"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>ek(),loading:v,className:"w-full sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined mr-1 text-[14px]",children:"refresh"}),"Check again"]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:ee,onClose:()=>et(!1),onSelect:e=>{T(e.value),et(!1)},selectedModel:P,activeProviders:c,modelAliases:es,title:"Select Model for Hermes Agent"}),(0,a.jsx)(r.uR,{isOpen:el,onClose:()=>er(!1),title:"Hermes Agent - Manual Setup",description:eD,requirements:eO,configs:(()=>{let e=[];if((eS||b?.installed===!1)&&e.push({id:"install-posix",label:"Install Hermes - Linux, macOS, WSL2, or Termux",filename:"Terminal",description:"Official Hermes installer. Review the upstream script before running it if required by your security policy.",content:"curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash"},{id:"install-windows",label:"Install Hermes - native Windows",filename:"PowerShell",description:"Run in PowerShell. WSL2 should use the POSIX installer instead.",content:"iex (irm https://hermes-agent.nousresearch.com/install.ps1)"}),e_&&e.push({id:"update-hermes",label:"Update Hermes before configuring ZevaiRouter",filename:"Terminal or PowerShell",content:"hermes update"}),e.push({id:"discover-paths",label:"Find the active Hermes configuration files",filename:"Terminal or PowerShell",description:"Run these after installation. Their output is authoritative when HERMES_HOME or the active Hermes profile changes the defaults.",content:"hermes config path\nhermes config env-path"}),!e$)return e;let t=function({model:e,apiKey:t,baseUrl:s,sttModel:a=""}){let l=e.trim(),r=t.trim(),i=B(s),n=`$\{${K}}`;return{yaml:["model:",` default: ${JSON.stringify(l)}`,' provider: "custom"',` base_url: ${JSON.stringify(i)}`,` api_key: ${JSON.stringify(n)}`,' api_mode: "chat_completions"',...a.trim()?["stt:"," enabled: true",' provider: "openai"'," openai:",` model: ${JSON.stringify(a.trim())}`,` base_url: ${JSON.stringify(i)}`,` api_key: ${JSON.stringify(n)}`]:[],""].join("\n"),env:`${K}=${JSON.stringify(r)}
|
|
59
|
-
`}}({model:P,apiKey:eA,baseUrl:eE,sttModel:R?U:""});return e.push({id:"model-config",label:"Merge this model mapping into config.yaml",filename:!eS&&b?.configPath?b.configPath:"Path reported by: hermes config path",description:'Keep exactly one top-level model key. Replace an existing scalar such as model: "", or merge the managed keys into its existing mapping; never append a second model block. Preserve unrelated top-level settings and extra model fields you still need.',content:t.yaml},{id:"api-key",label:"Add or update this one line in .env",filename:!eS&&b?.envPath?b.envPath:"Path reported by: hermes config env-path",description:"Do not replace the whole .env file. Remove an older ZEVAIROUTER_API_KEY line before adding this one.",content:t.env},{id:"permissions",label:"Protect the secret file - POSIX only",filename:"Terminal",description:"Hermes resolves HERMES_HOME and the active profile before returning this path.",content:'chmod 600 "$(hermes config env-path)"'},{id:"restart",label:"Restart an installed gateway service - optional",filename:"Terminal or PowerShell",description:"Skip this command if Hermes runs in the foreground; quit that process and launch it again instead.",content:"hermes gateway restart"},{id:"verify",label:"Verify Hermes after restart",filename:"Terminal or PowerShell",content:"hermes doctor"}),e})(),instructions:e$?["Back up the existing config.yaml and .env files before editing them.","Run hermes config path and hermes config env-path to locate the files Hermes actually reads.",'Keep one top-level model key: replace model: "" or merge the shown managed keys into the existing model mapping; never append a duplicate model block.',"Add or update only ZEVAIROUTER_API_KEY in .env, then protect the file with chmod 600 on POSIX systems.","Restart a running gateway with hermes gateway restart, or quit and relaunch a foreground Hermes process.","Run hermes doctor, then start Hermes and send a small test prompt through the selected ZevaiRouter model."]:[],note:"The Hermes path commands are authoritative. HERMES_HOME and profile selection can override the usual ~/.hermes or %LOCALAPPDATA%\\\\hermes locations."}),(0,a.jsx)(r.uo,{isOpen:ei,onClose:()=>en(!1),onConfirm:eT,title:"Restore Hermes backup?",message:"This restores the Hermes model fields and API-key environment entry saved by the last Apply on the ZevaiRouter host. Unrelated settings are preserved.",confirmText:"Restore backup",variant:"primary",loading:C}),(0,a.jsx)(r.uo,{isOpen:eo,onClose:()=>ed(!1),onConfirm:eR,title:"Discard stale Hermes backup?",message:"This deletes only ZevaiRouter's saved rollback snapshot. The current Hermes config.yaml and .env stay unchanged, but the previous settings can no longer be restored from this backup.",confirmText:"Discard backup",variant:"danger",loading:_})]})}var X=s(11059);function ee({toolId:e,tool:t,isExpanded:s,onToggle:n,baseUrl:o,apiKeys:d,activeProviders:c=[],cloudEnabled:m=!1,tunnelEnabled:x=!1}){let[u,h]=(0,l.useState)(null),[g,f]=(0,l.useState)(!1),[y,b]=(0,l.useState)(""),[j,v]=(0,l.useState)(()=>d?.length>0?d[0].key:""),N=e=>{let t=j&&j.trim()?j:m?"your-api-key":"sk_zevai",s=o||"http://localhost:1997",a=s.endsWith("/v1")?s:`${s}/v1`;return e.replace(/\{\{baseUrl\}\}/g,a).replace(/\{\{apiKey\}\}/g,t).replace(/\{\{model\}\}/g,y||"provider/model-id")},{copy:w}=(0,X.C)(),k=async(e,t)=>{await w(N(e),`toolcard-${t}`),h(t),setTimeout(()=>h(null),2e3)},C=c.length>0,S=()=>(!t.requiresExternalUrl||!!m||!!x)&&(!t.requiresCloud||!!m);return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden overflow-x-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:n,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:t.image?(0,a.jsx)(i.A,{src:t.image,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):t.icon?(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:t.color},children:t.icon}):(0,a.jsx)(i.A,{src:`/providers/${e}.png`,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:t.name}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:t.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${s?"rotate-180":""}`,children:"expand_more"})]}),s&&(0,a.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:t.guideSteps?(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[t.notes&&0!==t.notes.length?(0,a.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:t.notes.map((e,t)=>{if("cloudCheck"===e.type&&(m||x))return null;let s="warning"===e.type,l="cloudCheck"===e.type&&!m&&!x,r="bg-blue-500/10 border-blue-500/30",i="text-blue-600 dark:text-blue-400",n="text-blue-500",o="info";return s?(r="bg-yellow-500/10 border-yellow-500/30",i="text-yellow-600 dark:text-yellow-400",n="text-yellow-500",o="warning"):l&&(r="bg-red-500/10 border-red-500/30",i="text-red-600 dark:text-red-400",n="text-red-500",o="error"),(0,a.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${r}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${n}`,children:o}),(0,a.jsx)("p",{className:`text-sm ${i}`,children:e.text})]},t)})}):null,S()&&t.guideSteps.map(e=>(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:t.color},children:e.step}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-text",children:e.title}),e.desc&&(0,a.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:e.desc}),"apiKeySelector"===e.type&&(0,a.jsx)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:(0,a.jsx)(p,{value:j,onChange:v,apiKeys:d,cloudEnabled:m,className:"flex-1"})}),"modelSelector"===e.type&&(0,a.jsxs)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:y,onChange:e=>b(e.target.value),placeholder:"provider/model-id",className:"w-full sm:w-auto flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>f(!0),disabled:!C,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${C?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),y&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:()=>k(y,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===u?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>b(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),e.value&&(0,a.jsxs)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,a.jsx)("code",{className:"w-full sm:w-auto flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:N(e.value)}),e.copyable&&(0,a.jsx)("button",{onClick:()=>k(e.value,`${e.step}-${e.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:u===`${e.step}-${e.title}`?"check":"content_copy"})})]})]})]},e.step)),S()&&t.codeBlock&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:t.codeBlock.language}),(0,a.jsxs)("button",{onClick:()=>k(t.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===u?"check":"content_copy"}),"codeblock"===u?"Copied!":"Copy"]})]}),(0,a.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,a.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:N(t.codeBlock.code)})})]})]}):(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,a.jsx)(r.rq,{isOpen:g,onClose:()=>f(!1),onSelect:e=>{b(e.value)},selectedModel:y,activeProviders:c,title:"Select Model"})]})}function et({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:u,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y}){let b,j,v,N,w,[k,S]=(0,l.useState)(m||null),[_,E]=(0,l.useState)(!1),[A,O]=(0,l.useState)(null),[$,M]=(0,l.useState)(!1),[P,T]=(0,l.useState)(!1),[R,I]=(0,l.useState)(null),[U,z]=(0,l.useState)(!1),[L,D]=(0,l.useState)(""),[K,F]=(0,l.useState)(""),[H,B]=(0,l.useState)(""),[Z,q]=(0,l.useState)(!1),[W,G]=(0,l.useState)(!1),[J,V]=(0,l.useState)({}),[Y,Q]=(0,l.useState)(!1),[X,ee]=(0,l.useState)(""),[es,ea]=(0,l.useState)([]),[el,er]=(0,l.useState)(""),ei=(0,l.useRef)([]);(0,l.useEffect)(()=>{ei.current=es},[es]),(0,l.useEffect)(()=>{o?.length>0&&!L&&D(o[0].key)},[o,L]),(0,l.useEffect)(()=>{m&&S(m)},[m]),(0,l.useEffect)(()=>{t&&(k||em(),en())},[t]),(0,l.useEffect)(()=>{k?.opencode?.models&&ea(k.opencode.models),k?.opencode?.activeModel&&er(k.opencode.activeModel);let e=k?.config?.agent?.explorer?.model;e?.startsWith("zevai/")&&B(e.slice(6))},[k]);let en=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&V(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},eo=async e=>{try{let t=L&&L.trim()||c?L:"sk_zevai",s=e.includes(el)?el:e[0]||"";await C.x6.post("/api/cli-tools/opencode-settings",{baseUrl:ec(),apiKey:t,models:e,activeModel:s,subagentModel:H}),I(null)}catch(e){I({type:"error",text:`Failed to save models: ${e.message}`})}},ed=k?.installed?k.config&&k.hasZevai?h(k.config?.provider?.zevai?.options?.baseURL||"",{tunnelPublicUrl:g,tailscaleUrl:y})?"configured":"other":"not_configured":null,ec=()=>{let e=X||n;return e.endsWith("/v1")?e:`${e}/v1`},em=async()=>{E(!0),O(null);try{let e=await C.x6.get("/api/cli-tools/opencode-settings");S(e)}catch(e){401===e.status?O({auth:!0,text:"Session expired — please log in again to check the OpenCode status."}):S({installed:!1,error:e.message})}finally{E(!1)}},ex=async()=>{M(!0),I(null);try{let e=L&&L.trim()||c?L:"sk_zevai",t=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ec(),apiKey:e,models:es,activeModel:""===el?"":el||es[0],subagentModel:H})}),s=await t.json();t.ok?(I({type:"success",text:"Settings applied successfully!"}),em()):I({type:"error",text:s.error||"Failed to apply settings"})}catch(e){I({type:"error",text:e.message})}finally{M(!1)}},ep=async()=>{T(!0),I(null);try{let e=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),t=await e.json();e.ok?(I({type:"success",text:"Settings reset successfully!"}),F(""),B(""),ea([]),er(""),em()):I({type:"error",text:t.error||"Failed to reset settings"})}catch(e){I({type:"error",text:e.message})}finally{T(!1)}};return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.A,{src:"/providers/opencode.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===ed&&(0,a.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"===ed&&(0,a.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"===ed&&(0,a.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,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[_&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking OpenCode CLI..."})]}),!_&&A&&(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500",children:"lock"}),(0,a.jsx)("p",{className:"flex-1 text-sm text-red-600",children:A.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[A.auth&&(0,a.jsxs)("a",{href:"/login",className:"inline-flex items-center px-3 py-1.5 rounded-md border border-red-500/40 bg-red-500/20 text-red-700 dark:text-red-300 text-xs font-medium hover:bg-red-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:"login"}),"Log in again"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:em,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:"refresh"}),"Retry"]})]})]}),!_&&!A&&k&&!k.installed&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"OpenCode CLI not detected locally"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if ZevaiRouter is deployed on a remote server."})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,a.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>Q(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>z(!U),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:U?"expand_less":"help"}),U?"Hide":"How to Install"]})]})]}),U&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,a.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux:"}),(0,a.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,a.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"opencode"})," to verify."]})]})]})]}),!_&&!A&&k?.installed&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:X||X||`${n}/v1`,onChange:ee,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:u,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y})]}),k?.config?.provider?.zevai?.options?.baseURL&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:k.config.provider.zevai.options.baseURL})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:L,onChange:D,apiKeys:o,cloudEnabled:c})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Models"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===es.length?(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):es.map(e=>(0,a.jsxs)("span",{onClick:async()=>{if(e===el)try{await C.x6.patch("/api/cli-tools/opencode-settings",{clearActiveModel:!0}),er(""),em()}catch(e){I({type:"error",text:`Failed to clear active model: ${e.message}`})}else er(e)},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs cursor-pointer transition-colors ${e===el?"bg-primary/10 text-primary border border-primary":"bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border"}`,title:e===el?"Click to clear active model":"Click to set as active",children:[e===el&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:"star"}),e,(0,a.jsx)("button",{onClick:async t=>{t.stopPropagation();try{await C.x6.del(`/api/cli-tools/opencode-settings?model=${encodeURIComponent(e)}`);let t=es.filter(t=>t!==e);ea(t),el===e&&er(""),em()}catch(t){I({type:"error",text:`Failed to remove "${e}": ${t.message}`})}},className:"ml-0.5 hover:text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e))}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("button",{onClick:()=>q(!0),disabled:!d?.length,className:`px-2 py-1 rounded border text-xs transition-colors ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Add Model"}),(0,a.jsx)("span",{className:"text-xs text-text-muted",children:es.length>0&&el?(0,a.jsxs)(a.Fragment,{children:["Active: ",(0,a.jsx)("span",{className:"text-primary",children:el})]}):es.length>0?(0,a.jsx)("span",{className:"text-yellow-500",children:"Click a model to set/clear active"}):"Select models to add"})]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Subagent Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:H,onChange:e=>B(e.target.value),placeholder:K||"provider/model-id (defaults to main model)",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),(0,a.jsx)("button",{onClick:()=>G(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),H&&(0,a.jsx)("button",{onClick:()=>B(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),R&&(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===R.type?"check_circle":"error"}),(0,a.jsx)("span",{children:R.text})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ex,disabled:0===es.length,loading:$,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ep,disabled:!k.hasZevai,loading:P,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>Q(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:Z,onClose:()=>{q(!1),eo(ei.current)},onSelect:e=>{ea(t=>t.includes(e.value)?t:[...t,e.value]),el||er(e.value)},onSelectBatch:e=>{ea(t=>{let s=[...t];for(let t of e)t?.value&&!s.includes(t.value)&&s.push(t.value);return s}),el||er(e[0]?.value||"")},onDeselect:e=>{ea(t=>{let s=t.filter(t=>t!==e.value);return el===e.value&&er(s[0]||""),s})},onDeselectBatch:e=>{let t=new Set(e.map(e=>e.value));ea(e=>{let s=e.filter(e=>!t.has(e));return t.has(el)&&er(s[0]||""),s})},selectedModel:null,activeProviders:d,modelAliases:J,addedModelValues:es,closeOnSelect:!1,title:"Add Model for OpenCode"}),(0,a.jsx)(r.rq,{isOpen:W,onClose:()=>G(!1),onSelect:e=>{B(e.value),G(!1)},selectedModel:H,activeProviders:d,modelAliases:J,title:"Select Subagent Model for OpenCode"}),(0,a.jsx)(r.uR,{isOpen:Y,onClose:()=>Q(!1),title:"OpenCode - Manual Configuration",configs:(b=L&&L.trim()?L:c?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",j=es.length>0?es:["provider/model-id"],v=el||es[0]||j[0],N=H||v,w={},j.forEach(e=>{w[e]={name:e,modalities:{input:["text","image"],output:["text"]}}}),[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{zevai:{npm:"@ai-sdk/openai-compatible",options:{baseURL:ec(),apiKey:b},models:w}},model:`zevai/${v}`,agent:{explorer:{description:"Fast explorer subagent for codebase exploration",mode:"subagent",model:`zevai/${N}`}}},null,2)}])})]})}let es="/api/cli-tools/cowork-settings",ea=e=>(e||"").replace(/\/v1\/?$/,""),el=e=>{let t=(e||"").replace(/\/+$/,"");return t?/\/v1$/.test(t)?t:`${t}/v1`:""};function er({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,hasActiveProviders:c,cloudEnabled:m,cloudUrl:u,tunnelEnabled:h,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y,initialStatus:b}){let j,v,N,[w,k]=(0,l.useState)(b||null),[S,_]=(0,l.useState)(!1),[E,A]=(0,l.useState)(null),[O,$]=(0,l.useState)(!1),[M,P]=(0,l.useState)(!1),[T,R]=(0,l.useState)(null),[I,U]=(0,l.useState)(""),[z,L]=(0,l.useState)([]),[D,K]=(0,l.useState)(!1),[F,H]=(0,l.useState)(""),[B,Z]=(0,l.useState)([]),[q,W]=(0,l.useState)([]),[G,J]=(0,l.useState)([]),[V,Y]=(0,l.useState)({}),[Q,X]=(0,l.useState)(!1),[ee,et]=(0,l.useState)(!1),[ei,en]=(0,l.useState)(!1),[eo,ed]=(0,l.useState)(!1),[ec,em]=(0,l.useState)({type:"url",name:"",url:"",command:"",args:""}),ex=(0,l.useRef)(!1),ep=(0,l.useRef)(!1);(0,l.useEffect)(()=>{o?.length>0&&!ep.current&&(ep.current=!0,U(o[0].key))},[o]),(0,l.useEffect)(()=>{b&&k(b)},[b]),(0,l.useEffect)(()=>{t&&!w&&eu()},[t]),(0,l.useEffect)(()=>{t&&fetch("/api/models/alias").then(e=>e.ok?e.json():null).then(e=>{e&&Y(e.aliases||{})}).catch(()=>{})},[t]),(0,l.useEffect)(()=>{!ex.current&&(w?.cowork?.models?.length&&L(w.cowork.models),w?.cowork?.baseUrl&&!F&&H(ea(w.cowork.baseUrl)),Array.isArray(w?.cowork?.plugins)&&w.cowork.plugins.length>0?Z(w.cowork.plugins):0===B.length&&Array.isArray(w?.defaultPlugins)&&Z(w.defaultPlugins),Array.isArray(w?.cowork?.localPlugins)&&W(w.cowork.localPlugins),Array.isArray(w?.cowork?.customPlugins)&&w.cowork.customPlugins.length>0&&J(w.cowork.customPlugins),w?.cowork&&(ex.current=!0))},[w]);let eu=async()=>{_(!0),A(null);try{let e=await C.x6.get(es);k(e)}catch(e){401===e.status?A({auth:!0,text:"Session expired — please log in again to check the Cowork status."}):k({installed:!1,error:e.message})}finally{_(!1)}},eh=w?.installed?w?.cowork?.baseUrl?w.hasZevai?"configured":"other":"not_configured":null,eg=async()=>{R(null);let e=el(F);if(0===z.length)return void R({type:"error",text:"Please select at least one model"});$(!0);try{let t=I?.trim()||(o?.length>0?o[0].key:null)||(m?null:"sk_zevai"),s=await fetch(es,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:e,apiKey:t,models:z,plugins:B,localPlugins:q,customPlugins:G})}),a=await s.json();s.ok?(R({type:"success",text:"Settings applied. Quit & reopen Claude Desktop to load."}),eu()):R({type:"error",text:a.error||"Failed to apply settings"})}catch(e){R({type:"error",text:e.message})}finally{$(!1)}},ef=async({name:e,models:t})=>{try{let s=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,models:t})});if(!s.ok){let e=await s.json();R({type:"error",text:e.error||"Failed to create combo"});return}z.includes(e)||L([...z,e]),X(!1),R({type:"success",text:`Combo "${e}" created and added.`})}catch(e){R({type:"error",text:e.message})}},ey=e=>{let t=e?.value||e?.name||e;L(e=>e.filter(e=>e!==t))},eb=async()=>{P(!0),R(null);try{let e=await fetch(es,{method:"DELETE"}),t=await e.json();e.ok?(R({type:"success",text:"Settings reset successfully"}),ex.current=!0,L([]),Z(w?.defaultPlugins||[]),W([]),J([]),eu()):R({type:"error",text:t.error||"Failed to reset"})}catch(e){R({type:"error",text:e.message})}finally{P(!1)}};return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.A,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===eh&&(0,a.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"===eh&&(0,a.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"===eh&&(0,a.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,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[S&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Claude Cowork..."})]}),!S&&E&&(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500",children:"lock"}),(0,a.jsx)("p",{className:"flex-1 text-sm text-red-600",children:E.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[E.auth&&(0,a.jsxs)("a",{href:"/login",className:"inline-flex items-center px-3 py-1.5 rounded-md border border-red-500/40 bg-red-500/20 text-red-700 dark:text-red-300 text-xs font-medium hover:bg-red-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:"login"}),"Log in again"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:eu,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:"refresh"}),"Retry"]})]})]}),!S&&!E&&w&&!w.installed&&(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Claude Desktop (Cowork mode) not detected"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Open Claude Desktop → Help → Troubleshooting → Enable Developer mode → Configure third-party inference, then return here."})]})]}),(0,a.jsx)("div",{className:"pl-9",children:(0,a.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>K(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]}),!S&&!E&&w?.installed&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:el(F),onChange:e=>H(ea(e)),tunnelEnabled:h,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y,cloudEnabled:m,cloudUrl:u})]}),w?.cowork?.baseUrl&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:w.cowork.baseUrl})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:I,onChange:U,apiKeys:o,cloudEnabled:m})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Models"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2",children:[(0,a.jsx)("div",{className:"flex-1 flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===z.length?(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):z.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border",children:[e,(0,a.jsx)("button",{onClick:()=>ey(e),className:"ml-0.5 hover:text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e))}),(0,a.jsx)("button",{onClick:()=>X(!0),disabled:!c,className:`shrink-0 px-2 py-1.5 rounded border text-xs whitespace-nowrap transition-colors ${c?"bg-primary/10 border-primary/40 text-primary hover:bg-primary/20 cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"+ Combo"})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-2",children:"MCP"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-2",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-1",children:[B.filter(e=>"exa"!==e.name).map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-surface rounded border border-border",children:[(0,a.jsx)("span",{className:"text-xs font-medium min-w-0 truncate flex-shrink-0",children:e.title||e.name}),e.oauth&&(0,a.jsx)("span",{className:"text-[8px] text-amber-600 shrink-0",children:"OAuth"}),(0,a.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,a.jsx)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 text-text-muted whitespace-nowrap",children:e},e)),Array.isArray(e.toolNames)&&e.toolNames.length>6&&(0,a.jsxs)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 text-text-muted whitespace-nowrap",children:["+",e.toolNames.length-6]})]}),(0,a.jsx)("button",{onClick:()=>{var t;return t=e.name,void Z(B.filter(e=>e.name!==t))},className:"shrink-0 hover:text-red-500 ml-auto",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e.name)),G.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-surface rounded border border-border",children:[(0,a.jsx)("span",{className:"text-xs font-medium min-w-0 truncate flex-shrink-0",children:e.name}),(0,a.jsx)("span",{className:"text-[8px] px-1 py-0.5 rounded bg-blue-500/10 text-blue-500 shrink-0",children:"custom"}),(0,a.jsx)("span",{className:"flex-1 text-[9px] text-text-muted truncate",children:e.url||e.command}),(0,a.jsx)("button",{onClick:()=>J(G.filter(t=>t.name!==e.name)),className:"shrink-0 hover:text-red-500 ml-auto",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e.name)),0===B.filter(e=>"exa"!==e.name).length&&0===G.length&&(0,a.jsx)("div",{className:"px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-muted",children:"No MCPs added"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,a.jsx)("button",{onClick:()=>en(!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,a.jsx)("button",{onClick:()=>{em({type:"url",name:"",url:"",command:"",args:""}),ed(!0)},className:"px-2 py-1 rounded border text-xs bg-surface border-border text-text-muted hover:border-primary hover:text-primary cursor-pointer whitespace-nowrap",children:"+ Custom"}),(0,a.jsx)("a",{href:"https://mcp.so",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-text-muted hover:text-primary underline ml-auto",children:"Find MCPs →"})]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Tools"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-1.5",children:[(j=B.some(e=>"exa"===e.name),v=(w?.defaultPlugins||[]).find(e=>"exa"===e.name),(0,a.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer px-2 py-1.5 bg-surface rounded border border-border",children:[(0,a.jsx)("input",{type:"checkbox",checked:j,onChange:e=>{e.target.checked&&v?Z([...B.filter(e=>"exa"!==e.name),v]):Z(B.filter(e=>"exa"!==e.name))},className:"mt-0.5"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-xs font-medium",children:"Web Search & Fetch (Exa)"}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted leading-snug",children:"Replaces built-in WebSearch/WebFetch. Auto-strips duplicates from tool list."})]})]})),(()=>{let e=(w?.localStdioPlugins||[]).find(e=>"browsermcp"===e.name);if(!e)return null;let t=q.includes("browsermcp");return(0,a.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer px-2 py-1.5 bg-surface rounded border border-border",children:[(0,a.jsx)("input",{type:"checkbox",checked:t,onChange:e=>W(e.target.checked?[...q,"browsermcp"]:q.filter(e=>"browsermcp"!==e)),className:"mt-0.5"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-xs font-medium",children:"Browser Control (Browser MCP)"}),(0,a.jsxs)("p",{className:"text-[10px] text-text-muted leading-snug",children:["Controls your running Chrome. Auto-strips Cowork's built-in browser tools."," ",(0,a.jsx)("a",{href:e.extensionUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"Install Chrome extension"})]})]})]})})()]})]}),Array.isArray(w?.localStdioPlugins)&&w.localStdioPlugins.filter(e=>"browsermcp"!==e.name).length>0&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Local Plugins"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"flex flex-col gap-1.5 px-2 py-1.5 bg-surface rounded border border-border",children:w.localStdioPlugins.filter(e=>"browsermcp"!==e.name).map(e=>{let t=q.includes(e.name);return(0,a.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:t,onChange:t=>W(t.target.checked?[...q,e.name]:q.filter(t=>t!==e.name)),className:"mt-0.5"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium",children:e.title}),(0,a.jsx)("span",{className:"text-[8px] text-amber-600",children:"stdio"})]}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted leading-snug",children:e.description}),e.extensionUrl&&(0,a.jsx)("a",{href:e.extensionUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-primary underline",children:"Install Chrome extension"})]})]},e.name)})}),(0,a.jsxs)("p",{className:"text-[10px] text-text-muted leading-snug",children:["⚠️ Local plugins run as subprocess via ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/5",children:"npx"}),". Requires Node.js installed."]})]})]})]}),T&&(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===T.type?"check_circle":"error"}),(0,a.jsx)("span",{children:T.text})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:eg,disabled:0===z.length,loading:O,className:"w-full sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:eb,disabled:!w.hasZevai,loading:M,className:"w-full sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>K(!0),className:"w-full sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,a.jsx)(r.uR,{isOpen:D,onClose:()=>K(!1),title:"Claude Cowork - Manual Configuration",configs:(N=I&&I.trim()?I:m?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",[{filename:"~/Library/Application Support/Claude-3p/configLibrary/<appliedId>.json",content:JSON.stringify({inferenceProvider:"gateway",inferenceGatewayBaseUrl:el(F)||(h&&g?el(g):"")||(m&&u?el(u):"")||(f&&y?el(y):"")||el(n),inferenceGatewayApiKey:N,inferenceModels:(z.length>0?z:["provider/model-id"]).map(e=>({name:e}))},null,2)}])}),(0,a.jsx)(r.CK,{isOpen:Q,combo:null,onClose:()=>X(!1),onSave:ef,activeProviders:d,forcePrefix:"claude-",title:"Create Cowork Combo"}),(0,a.jsx)(r.rq,{isOpen:ee,onClose:()=>et(!1),onSelect:e=>{let t=e?.value||e?.name||e;!t||z.includes(t)||L(e=>[...e,t])},onDeselect:ey,activeProviders:d,modelAliases:V,title:"Select Cowork Model",addedModelValues:z,closeOnSelect:!1}),(0,a.jsx)(r.Nf,{isOpen:ei,onClose:()=>en(!1),onAdd:e=>{B.some(t=>t.name===e.name)||Z([...B,e])},addedNames:B.map(e=>e.name)}),eo&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:()=>ed(!1),children:(0,a.jsxs)("div",{className:"bg-surface border border-border rounded-xl shadow-xl w-full max-w-sm mx-4 p-5 flex flex-col gap-4",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h3",{className:"font-semibold text-sm",children:"Add Custom MCP"}),(0,a.jsx)("button",{onClick:()=>ed(!1),className:"text-text-muted hover:text-text-main",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:()=>em(e=>({...e,type:"url"})),className:`flex-1 py-1.5 rounded border text-xs font-medium transition-colors ${"url"===ec.type?"bg-primary/10 border-primary/40 text-primary":"border-border text-text-muted hover:border-primary/40"}`,children:"URL (SSE)"}),(0,a.jsx)("button",{onClick:()=>em(e=>({...e,type:"cmd"})),className:`flex-1 py-1.5 rounded border text-xs font-medium transition-colors ${"cmd"===ec.type?"bg-primary/10 border-primary/40 text-primary":"border-border text-text-muted hover:border-primary/40"}`,children:"Command (stdio)"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("label",{className:"text-[11px] text-text-muted font-medium",children:"Name"}),(0,a.jsx)("input",{type:"text",placeholder:"my-mcp",value:ec.name,onChange:e=>em(t=>({...t,name:e.target.value.replace(/\s+/g,"-").toLowerCase()})),className:"px-2 py-1.5 rounded border border-border bg-surface text-xs outline-none focus:border-primary"})]}),"url"===ec.type?(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("label",{className:"text-[11px] text-text-muted font-medium",children:"SSE URL"}),(0,a.jsx)("input",{type:"text",placeholder:"https://your-mcp-server.com/sse",value:ec.url,onChange:e=>em(t=>({...t,url:e.target.value})),className:"px-2 py-1.5 rounded border border-border bg-surface text-xs outline-none focus:border-primary"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("label",{className:"text-[11px] text-text-muted font-medium",children:"Command"}),(0,a.jsx)("input",{type:"text",placeholder:"npx",value:ec.command,onChange:e=>em(t=>({...t,command:e.target.value})),className:"px-2 py-1.5 rounded border border-border bg-surface text-xs outline-none focus:border-primary"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("label",{className:"text-[11px] text-text-muted font-medium",children:["Args ",(0,a.jsx)("span",{className:"font-normal",children:"(comma-separated)"})]}),(0,a.jsx)("input",{type:"text",placeholder:"-y, @some/mcp-package",value:ec.args,onChange:e=>em(t=>({...t,args:e.target.value})),className:"px-2 py-1.5 rounded border border-border bg-surface text-xs outline-none focus:border-primary"})]})]})]}),(0,a.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,a.jsx)("button",{onClick:()=>ed(!1),className:"px-3 py-1.5 rounded border border-border text-xs text-text-muted hover:bg-surface cursor-pointer",children:"Cancel"}),(0,a.jsx)("button",{onClick:()=>{let e=ec.name.trim();if(e){if("url"===ec.type){if(!ec.url.trim())return;J(t=>[...t.filter(t=>t.name!==e),{name:e,url:ec.url.trim(),transport:"sse",custom:!0}])}else{if(!ec.command.trim())return;let t=ec.args.split(",").map(e=>e.trim()).filter(Boolean);J(s=>[...s.filter(t=>t.name!==e),{name:e,command:ec.command.trim(),args:t,custom:!0}])}ed(!1)}},className:"px-3 py-1.5 rounded bg-primary text-white text-xs font-medium hover:opacity-90 cursor-pointer",children:"Add"})]})]})})]})}function ei({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:u,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y}){let b,j,[v,N]=(0,l.useState)(m||null),[w,k]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[_,E]=(0,l.useState)(!1),[A,O]=(0,l.useState)(null),[$,M]=(0,l.useState)(""),[P,T]=(0,l.useState)(""),[R,I]=(0,l.useState)({}),[U,z]=(0,l.useState)(!1),[L,D]=(0,l.useState)([]),[K,F]=(0,l.useState)(!1),H=(0,l.useRef)([]);(0,l.useEffect)(()=>{H.current=L},[L]),(0,l.useEffect)(()=>{o?.length>0&&!$&&M(o[0].key)},[o,$]),(0,l.useEffect)(()=>{m&&N(m)},[m]),(0,l.useEffect)(()=>{t&&!v&&(G(),B()),t&&B()},[t]),(0,l.useEffect)(()=>{if(v?.config&&Array.isArray(v.config)&&0===L.length){let e=v.config.find(e=>"ZevaiRouter"===e.name);e?.models?.length>0&&D(e.models.map(e=>e.id))}},[v]);let B=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&I(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},Z=async e=>{try{let t=$&&$.trim()||c?$:"sk_zevai";await fetch("/api/cli-tools/copilot-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:W(),apiKey:t,models:e})})}catch(e){console.log("Error saving models:",e)}},q=v?v.hasZevai?h(v.currentUrl||"",{tunnelPublicUrl:g,tailscaleUrl:y})?"configured":"other":"not_configured":null,W=()=>{let e=P||n;return e.endsWith("/v1")?e:`${e}/v1`},G=async()=>{k(!0);try{let e=await fetch("/api/cli-tools/copilot-settings"),t=await e.json();N(t)}catch(e){N({error:e.message})}finally{k(!1)}},J=async()=>{S(!0),O(null);try{let e=$&&$.trim()||c?$:"sk_zevai",t=await fetch("/api/cli-tools/copilot-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:W(),apiKey:e,models:L})}),s=await t.json();t.ok?(O({type:"success",text:s.message||"Settings applied! Reload VS Code."}),G()):O({type:"error",text:s.error||"Failed to apply settings"})}catch(e){O({type:"error",text:e.message})}finally{S(!1)}},V=async()=>{E(!0),O(null);try{let e=await fetch("/api/cli-tools/copilot-settings",{method:"DELETE"}),t=await e.json();e.ok?(O({type:"success",text:"Settings reset successfully!"}),D([]),G()):O({type:"error",text:t.error||"Failed to reset settings"})}catch(e){O({type:"error",text:e.message})}finally{E(!1)}};return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.A,{src:"/providers/copilot.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===q&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===q&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===q&&(0,a.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,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[w&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Copilot config..."})]}),!w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"info"}),(0,a.jsxs)("div",{className:"text-xs text-blue-700 dark:text-blue-300",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Writes to ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/10 rounded",children:"chatLanguageModels.json"})]}),(0,a.jsx)("p",{className:"mt-0.5 opacity-80",children:"Reload VS Code after applying for changes to take effect."})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:P||P||`${n}/v1`,onChange:T,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:u,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:$,onChange:M,apiKeys:o,cloudEnabled:c})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Models"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===L.length?(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):L.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border",children:[e,(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),D(t=>t.filter(t=>t!==e))},className:"ml-0.5 hover:text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e))}),(0,a.jsx)("div",{children:(0,a.jsx)("button",{onClick:()=>F(!0),disabled:!d?.length,className:`px-2 py-1 rounded border text-xs transition-colors ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Add Model"})})]})]})]}),A&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,a.jsx)("span",{children:A.text})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:J,disabled:0===L.length,loading:C,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:V,disabled:!v?.hasZevai,loading:_,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>z(!0),disabled:0===L.length,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:K,onClose:()=>{F(!1),Z(H.current)},onSelect:e=>{D(t=>t.includes(e.value)?t:[...t,e.value])},onSelectBatch:e=>{D(t=>{let s=[...t];for(let t of e)t?.value&&!s.includes(t.value)&&s.push(t.value);return s})},onDeselect:e=>{D(t=>t.filter(t=>t!==e.value))},onDeselectBatch:e=>{let t=new Set(e.map(e=>e.value));D(e=>e.filter(e=>!t.has(e)))},selectedModel:null,activeProviders:d,modelAliases:R,addedModelValues:L,closeOnSelect:!1,title:"Add Model for GitHub Copilot"}),(0,a.jsx)(r.uR,{isOpen:U,onClose:()=>z(!1),title:"GitHub Copilot - Manual Configuration",configs:(b=$&&$.trim()?$:c?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",j=W(),[{filename:"~/Library/Application Support/Code/User/chatLanguageModels.json",content:JSON.stringify([{name:"ZevaiRouter",vendor:"azure",apiKey:b,models:(L.length>0?L:["provider/model-id"]).map(e=>({id:e,name:e,url:`${j}/chat/completions#models.ai.azure.com`,toolCalling:!0,vision:!1,maxInputTokens:128e3,maxOutputTokens:16e3}))}],null,2)}])})]})}function en({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:u,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y}){let b,j,[v,N]=(0,l.useState)(m||null),[w,k]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[_,E]=(0,l.useState)(!1),[A,O]=(0,l.useState)(null),[$,M]=(0,l.useState)(!1),[P,T]=(0,l.useState)(""),[R,I]=(0,l.useState)(""),[U,z]=(0,l.useState)(!1),[L,D]=(0,l.useState)({}),[K,F]=(0,l.useState)(!1),[H,B]=(0,l.useState)("");(0,l.useEffect)(()=>{o?.length>0&&!P&&T(o[0].key)},[o,P]),(0,l.useEffect)(()=>{m&&N(m)},[m]),(0,l.useEffect)(()=>{t&&!v&&(G(),Z()),t&&Z()},[t]),(0,l.useEffect)(()=>{v?.settings?.openAiModelId&&I(v.settings.openAiModelId)},[v]);let Z=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&D(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},q=v?.installed?v.hasZevai?h(v.settings?.openAiBaseUrl||"",{tunnelPublicUrl:g,tailscaleUrl:y})?"configured":"other":"not_configured":null,W=()=>{let e=H||`${n}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},G=async()=>{k(!0);try{let e=await fetch("/api/cli-tools/cline-settings"),t=await e.json();N(t)}catch(e){N({installed:!1,error:e.message})}finally{k(!1)}},J=async()=>{S(!0),O(null);try{let e=P&&P.trim()||c?P:"sk_zevai",t=await fetch("/api/cli-tools/cline-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:W(),apiKey:e,model:R})}),s=await t.json();t.ok?(O({type:"success",text:"Settings applied successfully!"}),G()):O({type:"error",text:s.error||"Failed to apply settings"})}catch(e){O({type:"error",text:e.message})}finally{S(!1)}},V=async()=>{E(!0),O(null);try{let e=await fetch("/api/cli-tools/cline-settings",{method:"DELETE"}),t=await e.json();e.ok?(O({type:"success",text:"Settings reset successfully!"}),I(""),G()):O({type:"error",text:t.error||"Failed to reset settings"})}catch(e){O({type:"error",text:e.message})}finally{E(!1)}};return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.A,{src:"/providers/cline.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===q&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===q&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===q&&(0,a.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,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[w&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Cline..."})]}),!w&&v&&!v.installed&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Cline not detected locally"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if zevairouter is deployed on a remote server."})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,a.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>F(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>M(!$),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:$?"expand_less":"help"}),$?"Hide":"How to Install"]})]})]}),$&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,a.jsx)("div",{className:"space-y-3 text-sm",children:(0,a.jsxs)("p",{className:"text-text-muted",children:["Install Cline VS Code extension or CLI from ",(0,a.jsx)("a",{className:"text-primary underline",href:"https://docs.cline.bot/",target:"_blank",rel:"noreferrer",children:"docs.cline.bot"}),"."]})})]})]}),!w&&v?.installed&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:H||H||`${n}/v1`,onChange:B,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:u,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y})]}),v?.settings?.openAiBaseUrl&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:v.settings.openAiBaseUrl})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:P,onChange:T,apiKeys:o,cloudEnabled:c})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,a.jsx)("input",{type:"text",value:R,onChange:e=>I(e.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),R&&(0,a.jsx)("button",{onClick:()=>I(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,a.jsx)("button",{onClick:()=>z(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),A&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,a.jsx)("span",{children:A.text})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:J,disabled:!P&&c&&o.length>0||!R,loading:C,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:V,disabled:_,loading:_,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>F(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:U,onClose:()=>z(!1),onSelect:e=>{I(e.value),z(!1)},selectedModel:R,activeProviders:d,modelAliases:L,title:"Select Model for Cline"}),(0,a.jsx)(r.uR,{isOpen:K,onClose:()=>F(!1),title:"Cline - Manual Configuration",configs:(b=P&&P.trim()?P:c?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",[{filename:"~/.cline/data/globalState.json",content:JSON.stringify({actModeApiProvider:"openai",planModeApiProvider:"openai",openAiBaseUrl:(j=W()).endsWith("/v1")?j.slice(0,-3):j,openAiModelId:R||"provider/model-id",planModeOpenAiModelId:R||"provider/model-id"},null,2)},{filename:"~/.cline/data/secrets.json",content:JSON.stringify({openAiApiKey:b},null,2)}])})]})}function eo({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:u,tunnelPublicUrl:h,tailscaleEnabled:g,tailscaleUrl:f}){let[y,b]=(0,l.useState)(m||null),[j,v]=(0,l.useState)(!1),[N,w]=(0,l.useState)(!1),[k,C]=(0,l.useState)(!1),[S,_]=(0,l.useState)(null),[E,A]=(0,l.useState)(!1),[O,$]=(0,l.useState)(""),[M,P]=(0,l.useState)(""),[T,R]=(0,l.useState)(!1),[I,U]=(0,l.useState)({}),[z,L]=(0,l.useState)(!1),[D,K]=(0,l.useState)("");(0,l.useEffect)(()=>{o?.length>0&&!O&&$(o[0].key)},[o,O]),(0,l.useEffect)(()=>{m&&b(m)},[m]),(0,l.useEffect)(()=>{t&&!y&&(Z(),F()),t&&F()},[t]);let F=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&U(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},H=y?.installed?y.hasZevai?"configured":"not_configured":null,B=()=>{let e=D||`${n}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},Z=async()=>{v(!0);try{let e=await fetch("/api/cli-tools/kilo-settings"),t=await e.json();b(t)}catch(e){b({installed:!1,error:e.message})}finally{v(!1)}},q=async()=>{w(!0),_(null);try{let e=O&&O.trim()||c?O:"sk_zevai",t=await fetch("/api/cli-tools/kilo-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:B(),apiKey:e,model:M})}),s=await t.json();t.ok?(_({type:"success",text:"Settings applied successfully!"}),Z()):_({type:"error",text:s.error||"Failed to apply settings"})}catch(e){_({type:"error",text:e.message})}finally{w(!1)}},W=async()=>{C(!0),_(null);try{let e=await fetch("/api/cli-tools/kilo-settings",{method:"DELETE"}),t=await e.json();e.ok?(_({type:"success",text:"Settings reset successfully!"}),P(""),Z()):_({type:"error",text:t.error||"Failed to reset settings"})}catch(e){_({type:"error",text:e.message})}finally{C(!1)}};return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.A,{src:"/providers/kilocode.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===H&&(0,a.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"===H&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[j&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Kilo Code..."})]}),!j&&y&&!y.installed&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Kilo Code not detected locally"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if zevairouter is deployed on a remote server."})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,a.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>L(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>A(!E),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:E?"expand_less":"help"}),E?"Hide":"How to Install"]})]})]}),E&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Install Kilo Code from ",(0,a.jsx)("a",{className:"text-primary underline",href:"https://kilocode.ai",target:"_blank",rel:"noreferrer",children:"kilocode.ai"})," or VS Code extension marketplace."]})]})]}),!j&&y?.installed&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:D||D||`${n}/v1`,onChange:K,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:u,tunnelPublicUrl:h,tailscaleEnabled:g,tailscaleUrl:f})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:O,onChange:$,apiKeys:o,cloudEnabled:c})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,a.jsx)("input",{type:"text",value:M,onChange:e=>P(e.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),M&&(0,a.jsx)("button",{onClick:()=>P(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,a.jsx)("button",{onClick:()=>R(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),S&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===S.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===S.type?"check_circle":"error"}),(0,a.jsx)("span",{children:S.text})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:q,disabled:!O&&c&&o.length>0||!M,loading:N,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:W,disabled:k,loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>L(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:T,onClose:()=>R(!1),onSelect:e=>{P(e.value),R(!1)},selectedModel:M,activeProviders:d,modelAliases:I,title:"Select Model for Kilo Code"}),(0,a.jsx)(r.uR,{isOpen:z,onClose:()=>L(!1),title:"Kilo Code - Manual Configuration",configs:[{filename:"~/.local/share/kilo/auth.json",content:JSON.stringify({"openai-compatible":{type:"api-key",apiKey:O&&O.trim()?O:c?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",baseUrl:B(),model:M||"provider/model-id"}},null,2)}]})]})}let ed="/api/cli-tools/deepseek-tui-settings";function ec({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:o,apiKeys:d,activeProviders:c,cloudEnabled:m,initialStatus:u,tunnelEnabled:g,tunnelPublicUrl:f,tailscaleEnabled:y,tailscaleUrl:b}){let j,[v,N]=(0,l.useState)(u||null),[w,k]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[_,E]=(0,l.useState)(!1),[A,O]=(0,l.useState)(null),[$,M]=(0,l.useState)(""),[P,T]=(0,l.useState)(""),[R,I]=(0,l.useState)(!1),[U,z]=(0,l.useState)({}),[L,D]=(0,l.useState)(!1),[K,F]=(0,l.useState)(""),H=(0,l.useRef)(!1),B=(()=>{if(!v?.installed)return null;let e=v.settings?.["providers.openai"];return e?.base_url?h(e.base_url,{tunnelPublicUrl:f,tailscaleUrl:b})?"configured":"other":"not_configured"})();(0,l.useEffect)(()=>{d?.length>0&&!$&&M(d[0].key)},[d,$]),(0,l.useEffect)(()=>{u&&N(u)},[u]),(0,l.useEffect)(()=>{t&&!v&&(q(),Z()),t&&Z()},[t]);let Z=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&z(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(v?.installed&&!H.current){H.current=!0;let e=v.settings?.["providers.openai"];e?.model&&T(e.model)}},[v]);let q=async()=>{k(!0);try{let e=await fetch(ed),t=await e.json();N(t)}catch(e){N({installed:!1,error:e.message})}finally{k(!1)}},W=()=>{let e=K||window.location.origin.replace("://localhost","://127.0.0.1");return e.endsWith("/v1")?e:`${e}/v1`},G=async()=>{S(!0),O(null);try{let e=$?.trim()||(d?.length>0?d[0].key:null)||(m?null:"sk_zevai"),t=await fetch(ed,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:W(),apiKey:e,model:P})}),s=await t.json();t.ok?(O({type:"success",text:"Settings applied successfully!"}),q()):O({type:"error",text:s.error||"Failed to apply settings"})}catch(e){O({type:"error",text:e.message})}finally{S(!1)}},J=async()=>{E(!0),O(null);try{let e=await fetch(ed,{method:"DELETE"}),t=await e.json();e.ok?(O({type:"success",text:"Settings reset successfully!"}),T(""),q()):O({type:"error",text:t.error||"Failed to reset settings"})}catch(e){O({type:"error",text:e.message})}finally{E(!1)}};return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.A,{src:e.image||"/providers/deepseek-tui.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===B&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===B&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===B&&(0,a.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,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[w&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking DeepSeek TUI..."})]}),!w&&v&&!v.installed&&(0,a.jsx)("div",{className:"flex flex-col gap-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"DeepSeek TUI not detected locally"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Install via npm:"}),(0,a.jsx)("code",{className:"block mt-2 p-2 bg-black/20 rounded text-xs font-mono",children:"npm install -g deepseek-tui"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-2",children:"Manual configuration is still available if zevairouter is deployed on a remote server."})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 pl-9",children:(0,a.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>D(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]})}),!w&&v?.installed&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[e.notes&&e.notes.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-2 mb-2",children:e.notes.map((e,t)=>(0,a.jsxs)("div",{className:`flex items-start gap-2 p-2 rounded text-xs ${"warning"===e.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"error"===e.type?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-blue-500/10 text-blue-600 dark:text-blue-400"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5",children:"warning"===e.type?"warning":"error"===e.type?"error":"info"}),(0,a.jsx)("span",{children:e.text})]},t))}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:K||W(),onChange:F,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:g,tunnelPublicUrl:f,tailscaleEnabled:y,tailscaleUrl:b})]}),v?.settings?.["providers.openai"]?.base_url&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:v.settings["providers.openai"].base_url})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:$,onChange:M,apiKeys:d,cloudEnabled:m})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Default Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,a.jsx)("input",{type:"text",value:P,onChange:e=>T(e.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),P&&(0,a.jsx)("button",{onClick:()=>T(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,a.jsx)("button",{onClick:()=>I(!0),disabled:!o,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${o?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]})]}),A&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,a.jsx)("span",{children:A.text})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:G,disabled:!P,loading:C,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:J,disabled:!v?.hasZevai,loading:_,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>D(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:R,onClose:()=>I(!1),onSelect:e=>{T(e.value),I(!1)},selectedModel:P,activeProviders:c,modelAliases:U,title:"Select Model for DeepSeek TUI"}),(0,a.jsx)(r.uR,{isOpen:L,onClose:()=>D(!1),title:"DeepSeek TUI - Manual Configuration",configs:(j=$&&$.trim()?$:m?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",[{filename:"~/.deepseek/config.toml",content:`[providers.openai]
|
|
59
|
+
`}}({model:P,apiKey:eA,baseUrl:eE,sttModel:R?U:""});return e.push({id:"model-config",label:"Merge this model mapping into config.yaml",filename:!eS&&b?.configPath?b.configPath:"Path reported by: hermes config path",description:'Keep exactly one top-level model key. Replace an existing scalar such as model: "", or merge the managed keys into its existing mapping; never append a second model block. Preserve unrelated top-level settings and extra model fields you still need.',content:t.yaml},{id:"api-key",label:"Add or update this one line in .env",filename:!eS&&b?.envPath?b.envPath:"Path reported by: hermes config env-path",description:"Do not replace the whole .env file. Remove an older ZEVAIROUTER_API_KEY line before adding this one.",content:t.env},{id:"permissions",label:"Protect the secret file - POSIX only",filename:"Terminal",description:"Hermes resolves HERMES_HOME and the active profile before returning this path.",content:'chmod 600 "$(hermes config env-path)"'},{id:"restart",label:"Restart an installed gateway service - optional",filename:"Terminal or PowerShell",description:"Skip this command if Hermes runs in the foreground; quit that process and launch it again instead.",content:"hermes gateway restart"},{id:"verify",label:"Verify Hermes after restart",filename:"Terminal or PowerShell",content:"hermes doctor"}),e})(),instructions:e$?["Back up the existing config.yaml and .env files before editing them.","Run hermes config path and hermes config env-path to locate the files Hermes actually reads.",'Keep one top-level model key: replace model: "" or merge the shown managed keys into the existing model mapping; never append a duplicate model block.',"Add or update only ZEVAIROUTER_API_KEY in .env, then protect the file with chmod 600 on POSIX systems.","Restart a running gateway with hermes gateway restart, or quit and relaunch a foreground Hermes process.","Run hermes doctor, then start Hermes and send a small test prompt through the selected ZevaiRouter model."]:[],note:"The Hermes path commands are authoritative. HERMES_HOME and profile selection can override the usual ~/.hermes or %LOCALAPPDATA%\\\\hermes locations."}),(0,a.jsx)(r.uo,{isOpen:ei,onClose:()=>en(!1),onConfirm:eT,title:"Restore Hermes backup?",message:"This restores the Hermes model fields and API-key environment entry saved by the last Apply on the ZevaiRouter host. Unrelated settings are preserved.",confirmText:"Restore backup",variant:"primary",loading:C}),(0,a.jsx)(r.uo,{isOpen:eo,onClose:()=>ed(!1),onConfirm:eR,title:"Discard stale Hermes backup?",message:"This deletes only ZevaiRouter's saved rollback snapshot. The current Hermes config.yaml and .env stay unchanged, but the previous settings can no longer be restored from this backup.",confirmText:"Discard backup",variant:"danger",loading:_})]})}var X=s(11059);function ee({toolId:e,tool:t,isExpanded:s,onToggle:n,baseUrl:o,apiKeys:d,activeProviders:c=[],cloudEnabled:m=!1,tunnelEnabled:x=!1}){let[u,h]=(0,l.useState)(null),[g,f]=(0,l.useState)(!1),[y,b]=(0,l.useState)(""),[j,v]=(0,l.useState)(()=>d?.length>0?d[0].key:""),N=e=>{let t=j&&j.trim()?j:m?"your-api-key":"sk_zevai",s=o||"http://localhost:1997",a=s.endsWith("/v1")?s:`${s}/v1`;return e.replace(/\{\{baseUrl\}\}/g,a).replace(/\{\{apiKey\}\}/g,t).replace(/\{\{model\}\}/g,y||"provider/model-id")},{copy:w}=(0,X.C)(),k=async(e,t)=>{await w(N(e),`toolcard-${t}`),h(t),setTimeout(()=>h(null),2e3)},C=c.length>0,S=()=>(!t.requiresExternalUrl||!!m||!!x)&&(!t.requiresCloud||!!m);return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden overflow-x-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:n,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:t.image?(0,a.jsx)(i.A,{src:t.image,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):t.icon?(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:t.color},children:t.icon}):(0,a.jsx)(i.A,{src:`/providers/${e}.png`,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:t.name}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:t.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${s?"rotate-180":""}`,children:"expand_more"})]}),s&&(0,a.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:t.guideSteps?(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[t.notes&&0!==t.notes.length?(0,a.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:t.notes.map((e,t)=>{if("cloudCheck"===e.type&&(m||x))return null;let s="warning"===e.type,l="cloudCheck"===e.type&&!m&&!x,r="bg-blue-500/10 border-blue-500/30",i="text-blue-600 dark:text-blue-400",n="text-blue-500",o="info";return s?(r="bg-yellow-500/10 border-yellow-500/30",i="text-yellow-600 dark:text-yellow-400",n="text-yellow-500",o="warning"):l&&(r="bg-red-500/10 border-red-500/30",i="text-red-600 dark:text-red-400",n="text-red-500",o="error"),(0,a.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${r}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${n}`,children:o}),(0,a.jsx)("p",{className:`text-sm ${i}`,children:e.text})]},t)})}):null,S()&&t.guideSteps.map(e=>(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:t.color},children:e.step}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-text",children:e.title}),e.desc&&(0,a.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:e.desc}),"apiKeySelector"===e.type&&(0,a.jsx)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:(0,a.jsx)(p,{value:j,onChange:v,apiKeys:d,cloudEnabled:m,className:"flex-1"})}),"modelSelector"===e.type&&(0,a.jsxs)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:y,onChange:e=>b(e.target.value),placeholder:"provider/model-id",className:"w-full sm:w-auto flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>f(!0),disabled:!C,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${C?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),y&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:()=>k(y,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===u?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>b(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),e.value&&(0,a.jsxs)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,a.jsx)("code",{className:"w-full sm:w-auto flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:N(e.value)}),e.copyable&&(0,a.jsx)("button",{onClick:()=>k(e.value,`${e.step}-${e.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:u===`${e.step}-${e.title}`?"check":"content_copy"})})]})]})]},e.step)),S()&&t.codeBlock&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:t.codeBlock.language}),(0,a.jsxs)("button",{onClick:()=>k(t.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===u?"check":"content_copy"}),"codeblock"===u?"Copied!":"Copy"]})]}),(0,a.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,a.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:N(t.codeBlock.code)})})]})]}):(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,a.jsx)(r.rq,{isOpen:g,onClose:()=>f(!1),onSelect:e=>{b(e.value)},selectedModel:y,activeProviders:c,title:"Select Model"})]})}function et({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:u,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y}){let b,j,v,N,w,k,[S,_]=(0,l.useState)(m||null),[E,A]=(0,l.useState)(!1),[O,$]=(0,l.useState)(null),[M,P]=(0,l.useState)(!1),[T,R]=(0,l.useState)(!1),[I,U]=(0,l.useState)(null),[z,L]=(0,l.useState)(!1),[D,K]=(0,l.useState)(""),[F,H]=(0,l.useState)(""),[B,Z]=(0,l.useState)(""),[q,W]=(0,l.useState)(!1),[G,J]=(0,l.useState)(!1),[V,Y]=(0,l.useState)({}),[Q,X]=(0,l.useState)(!1),[ee,es]=(0,l.useState)(""),[ea,el]=(0,l.useState)([]),[er,ei]=(0,l.useState)(""),en=(0,l.useRef)([]);(0,l.useEffect)(()=>{en.current=ea},[ea]),(0,l.useEffect)(()=>{o?.length>0&&!D&&K(o[0].key)},[o,D]),(0,l.useEffect)(()=>{m&&_(m)},[m]),(0,l.useEffect)(()=>{t&&(S||ex(),eo())},[t]),(0,l.useEffect)(()=>{S?.opencode?.models&&el(S.opencode.models),S?.opencode?.activeModel&&ei(S.opencode.activeModel);let e=S?.config?.agent?.explorer?.model;e?.startsWith("zevai/")&&Z(e.slice(6))},[S]);let eo=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&Y(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},ed=async e=>{try{let t=D&&D.trim()||c?D:"sk_zevai",s=e.includes(er)?er:e[0]||"";await C.x6.post("/api/cli-tools/opencode-settings",{baseUrl:em(),apiKey:t,models:e,activeModel:s,subagentModel:B}),U(null)}catch(e){U({type:"error",text:`Failed to save models: ${e.message}`})}},ec=S?.installed?S.config&&S.hasZevai?h(S.config?.provider?.zevai?.options?.baseURL||"",{tunnelPublicUrl:g,tailscaleUrl:y})?"configured":"other":"not_configured":null,em=()=>{let e=String(ee||n||"").trim().replace(/\/+$/,"");return e.endsWith("/v1")?e:`${e}/v1`},ex=async()=>{A(!0),$(null);try{let e=await C.x6.get("/api/cli-tools/opencode-settings");_(e)}catch(e){401===e.status?$({auth:!0,text:"Session expired — please log in again to check the OpenCode status."}):_({installed:!1,error:e.message})}finally{A(!1)}},ep=async()=>{P(!0),U(null);try{let e=D&&D.trim()||c?D:"sk_zevai",t=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:em(),apiKey:e,models:ea,activeModel:""===er?"":er||ea[0],subagentModel:B})}),s=await t.json();t.ok?(U({type:"success",text:"Settings applied successfully!"}),ex()):U({type:"error",text:s.error||"Failed to apply settings"})}catch(e){U({type:"error",text:e.message})}finally{P(!1)}},eu=async()=>{R(!0),U(null);try{let e=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),t=await e.json();e.ok?(U({type:"success",text:"Settings reset successfully!"}),H(""),Z(""),el([]),ei(""),ex()):U({type:"error",text:t.error||"Failed to reset settings"})}catch(e){U({type:"error",text:e.message})}finally{R(!1)}};return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.A,{src:"/providers/opencode.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===ec&&(0,a.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"===ec&&(0,a.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"===ec&&(0,a.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,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[E&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking OpenCode CLI..."})]}),!E&&O&&(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500",children:"lock"}),(0,a.jsx)("p",{className:"flex-1 text-sm text-red-600",children:O.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[O.auth&&(0,a.jsxs)("a",{href:"/login",className:"inline-flex items-center px-3 py-1.5 rounded-md border border-red-500/40 bg-red-500/20 text-red-700 dark:text-red-300 text-xs font-medium hover:bg-red-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:"login"}),"Log in again"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ex,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:"refresh"}),"Retry"]})]})]}),!E&&!O&&S&&!S.installed&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"OpenCode CLI not detected locally"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if ZevaiRouter is deployed on a remote server."})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,a.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>X(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>L(!z),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:z?"expand_less":"help"}),z?"Hide":"How to Install"]})]})]}),z&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,a.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux:"}),(0,a.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,a.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"opencode"})," to verify."]})]})]})]}),!E&&!O&&S?.installed&&(0,a.jsxs)(a.Fragment,{children:[(S.version||S.binaryPath)&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Detected ",S.version||"OpenCode",S.binaryPath?` at ${S.binaryPath}`:""]}),S.configError&&(0,a.jsxs)("div",{className:"flex items-start gap-2 p-3 bg-red-500/10 border border-red-500/30 rounded-lg text-sm text-red-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),(0,a.jsx)("span",{children:S.configError})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:ee||ee||`${n}/v1`,onChange:es,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:u,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y})]}),S?.config?.provider?.zevai?.options?.baseURL&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:S.config.provider.zevai.options.baseURL})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:D,onChange:K,apiKeys:o,cloudEnabled:c})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Models"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===ea.length?(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):ea.map(e=>(0,a.jsxs)("span",{onClick:async()=>{if(e===er)try{await C.x6.patch("/api/cli-tools/opencode-settings",{clearActiveModel:!0}),ei(""),ex()}catch(e){U({type:"error",text:`Failed to clear active model: ${e.message}`})}else ei(e)},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs cursor-pointer transition-colors ${e===er?"bg-primary/10 text-primary border border-primary":"bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border"}`,title:e===er?"Click to clear active model":"Click to set as active",children:[e===er&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:"star"}),e,S?.opencode?.variants?.[e]?.length>0&&(0,a.jsx)("span",{className:"ml-0.5 rounded bg-black/5 px-1 font-mono text-xs text-text-main dark:bg-white/10",title:"Reasoning effort levels written to OpenCode",children:S.opencode.variants[e].join(" \xb7 ")}),(0,a.jsx)("button",{onClick:async t=>{t.stopPropagation();try{await C.x6.del(`/api/cli-tools/opencode-settings?model=${encodeURIComponent(e)}`);let t=ea.filter(t=>t!==e);el(t),er===e&&ei(""),ex()}catch(t){U({type:"error",text:`Failed to remove "${e}": ${t.message}`})}},className:"ml-0.5 hover:text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e))}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("button",{onClick:()=>W(!0),disabled:!d?.length,className:`px-2 py-1 rounded border text-xs transition-colors ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Add Model"}),(0,a.jsx)("span",{className:"text-xs text-text-muted",children:ea.length>0&&er?(0,a.jsxs)(a.Fragment,{children:["Active: ",(0,a.jsx)("span",{className:"text-primary",children:er})]}):ea.length>0?(0,a.jsx)("span",{className:"text-yellow-500",children:"Click a model to set/clear active"}):"Select models to add"})]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Subagent Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:B,onChange:e=>Z(e.target.value),placeholder:F||"provider/model-id (defaults to main model)",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("button",{onClick:()=>J(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),B&&(0,a.jsx)("button",{onClick:()=>Z(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]})]}),I&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===I.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===I.type?"check_circle":"error"}),(0,a.jsx)("span",{children:I.text})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ep,disabled:0===ea.length,loading:M,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:eu,disabled:!S.hasZevai,loading:T,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>X(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:q,onClose:()=>{W(!1),ed(en.current)},onSelect:e=>{el(t=>t.includes(e.value)?t:[...t,e.value]),er||ei(e.value)},onSelectBatch:e=>{el(t=>{let s=[...t];for(let t of e)t?.value&&!s.includes(t.value)&&s.push(t.value);return s}),er||ei(e[0]?.value||"")},onDeselect:e=>{el(t=>{let s=t.filter(t=>t!==e.value);return er===e.value&&ei(s[0]||""),s})},onDeselectBatch:e=>{let t=new Set(e.map(e=>e.value));el(e=>{let s=e.filter(e=>!t.has(e));return t.has(er)&&ei(s[0]||""),s})},selectedModel:null,activeProviders:d,modelAliases:V,addedModelValues:ea,closeOnSelect:!1,title:"Add Model for OpenCode"}),(0,a.jsx)(r.rq,{isOpen:G,onClose:()=>J(!1),onSelect:e=>{Z(e.value),J(!1)},selectedModel:B,activeProviders:d,modelAliases:V,title:"Select Subagent Model for OpenCode"}),(0,a.jsx)(r.uR,{isOpen:Q,onClose:()=>X(!1),title:"OpenCode - Manual Configuration",configs:(b=D&&D.trim()?D:c?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",j=ea.length>0?ea:["provider/model-id"],v=er||ea[0]||j[0],N=B||v,w={},k=S?.config?.provider?.zevai?.models||{},j.forEach(e=>{w[e]=k[e]||{name:e,modalities:{input:["text","image"],output:["text"]}}}),[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{zevai:{npm:"@ai-sdk/openai-compatible",options:{baseURL:em(),apiKey:b},models:w}},model:`zevai/${v}`,agent:{explorer:{description:"Fast explorer subagent for codebase exploration",mode:"subagent",model:`zevai/${N}`}}},null,2)}])})]})}let es="/api/cli-tools/cowork-settings",ea=e=>(e||"").replace(/\/v1\/?$/,""),el=e=>{let t=(e||"").replace(/\/+$/,"");return t?/\/v1$/.test(t)?t:`${t}/v1`:""};function er({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,hasActiveProviders:c,cloudEnabled:m,cloudUrl:u,tunnelEnabled:h,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y,initialStatus:b}){let j,v,N,[w,k]=(0,l.useState)(b||null),[S,_]=(0,l.useState)(!1),[E,A]=(0,l.useState)(null),[O,$]=(0,l.useState)(!1),[M,P]=(0,l.useState)(!1),[T,R]=(0,l.useState)(null),[I,U]=(0,l.useState)(""),[z,L]=(0,l.useState)([]),[D,K]=(0,l.useState)(!1),[F,H]=(0,l.useState)(""),[B,Z]=(0,l.useState)([]),[q,W]=(0,l.useState)([]),[G,J]=(0,l.useState)([]),[V,Y]=(0,l.useState)({}),[Q,X]=(0,l.useState)(!1),[ee,et]=(0,l.useState)(!1),[ei,en]=(0,l.useState)(!1),[eo,ed]=(0,l.useState)(!1),[ec,em]=(0,l.useState)({type:"url",name:"",url:"",command:"",args:""}),ex=(0,l.useRef)(!1),ep=(0,l.useRef)(!1);(0,l.useEffect)(()=>{o?.length>0&&!ep.current&&(ep.current=!0,U(o[0].key))},[o]),(0,l.useEffect)(()=>{b&&k(b)},[b]),(0,l.useEffect)(()=>{t&&!w&&eu()},[t]),(0,l.useEffect)(()=>{t&&fetch("/api/models/alias").then(e=>e.ok?e.json():null).then(e=>{e&&Y(e.aliases||{})}).catch(()=>{})},[t]),(0,l.useEffect)(()=>{!ex.current&&(w?.cowork?.models?.length&&L(w.cowork.models),w?.cowork?.baseUrl&&!F&&H(ea(w.cowork.baseUrl)),Array.isArray(w?.cowork?.plugins)&&w.cowork.plugins.length>0?Z(w.cowork.plugins):0===B.length&&Array.isArray(w?.defaultPlugins)&&Z(w.defaultPlugins),Array.isArray(w?.cowork?.localPlugins)&&W(w.cowork.localPlugins),Array.isArray(w?.cowork?.customPlugins)&&w.cowork.customPlugins.length>0&&J(w.cowork.customPlugins),w?.cowork&&(ex.current=!0))},[w]);let eu=async()=>{_(!0),A(null);try{let e=await C.x6.get(es);k(e)}catch(e){401===e.status?A({auth:!0,text:"Session expired — please log in again to check the Cowork status."}):k({installed:!1,error:e.message})}finally{_(!1)}},eh=w?.installed?w?.cowork?.baseUrl?w.hasZevai?"configured":"other":"not_configured":null,eg=async()=>{R(null);let e=el(F);if(0===z.length)return void R({type:"error",text:"Please select at least one model"});$(!0);try{let t=I?.trim()||(o?.length>0?o[0].key:null)||(m?null:"sk_zevai"),s=await fetch(es,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:e,apiKey:t,models:z,plugins:B,localPlugins:q,customPlugins:G})}),a=await s.json();s.ok?(R({type:"success",text:"Settings applied. Quit & reopen Claude Desktop to load."}),eu()):R({type:"error",text:a.error||"Failed to apply settings"})}catch(e){R({type:"error",text:e.message})}finally{$(!1)}},ef=async({name:e,models:t})=>{try{let s=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,models:t})});if(!s.ok){let e=await s.json();R({type:"error",text:e.error||"Failed to create combo"});return}z.includes(e)||L([...z,e]),X(!1),R({type:"success",text:`Combo "${e}" created and added.`})}catch(e){R({type:"error",text:e.message})}},ey=e=>{let t=e?.value||e?.name||e;L(e=>e.filter(e=>e!==t))},eb=async()=>{P(!0),R(null);try{let e=await fetch(es,{method:"DELETE"}),t=await e.json();e.ok?(R({type:"success",text:"Settings reset successfully"}),ex.current=!0,L([]),Z(w?.defaultPlugins||[]),W([]),J([]),eu()):R({type:"error",text:t.error||"Failed to reset"})}catch(e){R({type:"error",text:e.message})}finally{P(!1)}};return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.A,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===eh&&(0,a.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"===eh&&(0,a.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"===eh&&(0,a.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,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[S&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Claude Cowork..."})]}),!S&&E&&(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500",children:"lock"}),(0,a.jsx)("p",{className:"flex-1 text-sm text-red-600",children:E.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[E.auth&&(0,a.jsxs)("a",{href:"/login",className:"inline-flex items-center px-3 py-1.5 rounded-md border border-red-500/40 bg-red-500/20 text-red-700 dark:text-red-300 text-xs font-medium hover:bg-red-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:"login"}),"Log in again"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:eu,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:"refresh"}),"Retry"]})]})]}),!S&&!E&&w&&!w.installed&&(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Claude Desktop (Cowork mode) not detected"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Open Claude Desktop → Help → Troubleshooting → Enable Developer mode → Configure third-party inference, then return here."})]})]}),(0,a.jsx)("div",{className:"pl-9",children:(0,a.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>K(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]}),!S&&!E&&w?.installed&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:el(F),onChange:e=>H(ea(e)),tunnelEnabled:h,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y,cloudEnabled:m,cloudUrl:u})]}),w?.cowork?.baseUrl&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:w.cowork.baseUrl})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:I,onChange:U,apiKeys:o,cloudEnabled:m})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Models"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2",children:[(0,a.jsx)("div",{className:"flex-1 flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===z.length?(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):z.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border",children:[e,(0,a.jsx)("button",{onClick:()=>ey(e),className:"ml-0.5 hover:text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e))}),(0,a.jsx)("button",{onClick:()=>X(!0),disabled:!c,className:`shrink-0 px-2 py-1.5 rounded border text-xs whitespace-nowrap transition-colors ${c?"bg-primary/10 border-primary/40 text-primary hover:bg-primary/20 cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"+ Combo"})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-2",children:"MCP"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-2",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-1",children:[B.filter(e=>"exa"!==e.name).map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-surface rounded border border-border",children:[(0,a.jsx)("span",{className:"text-xs font-medium min-w-0 truncate flex-shrink-0",children:e.title||e.name}),e.oauth&&(0,a.jsx)("span",{className:"text-[8px] text-amber-600 shrink-0",children:"OAuth"}),(0,a.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,a.jsx)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 text-text-muted whitespace-nowrap",children:e},e)),Array.isArray(e.toolNames)&&e.toolNames.length>6&&(0,a.jsxs)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 text-text-muted whitespace-nowrap",children:["+",e.toolNames.length-6]})]}),(0,a.jsx)("button",{onClick:()=>{var t;return t=e.name,void Z(B.filter(e=>e.name!==t))},className:"shrink-0 hover:text-red-500 ml-auto",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e.name)),G.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-surface rounded border border-border",children:[(0,a.jsx)("span",{className:"text-xs font-medium min-w-0 truncate flex-shrink-0",children:e.name}),(0,a.jsx)("span",{className:"text-[8px] px-1 py-0.5 rounded bg-blue-500/10 text-blue-500 shrink-0",children:"custom"}),(0,a.jsx)("span",{className:"flex-1 text-[9px] text-text-muted truncate",children:e.url||e.command}),(0,a.jsx)("button",{onClick:()=>J(G.filter(t=>t.name!==e.name)),className:"shrink-0 hover:text-red-500 ml-auto",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e.name)),0===B.filter(e=>"exa"!==e.name).length&&0===G.length&&(0,a.jsx)("div",{className:"px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-muted",children:"No MCPs added"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,a.jsx)("button",{onClick:()=>en(!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,a.jsx)("button",{onClick:()=>{em({type:"url",name:"",url:"",command:"",args:""}),ed(!0)},className:"px-2 py-1 rounded border text-xs bg-surface border-border text-text-muted hover:border-primary hover:text-primary cursor-pointer whitespace-nowrap",children:"+ Custom"}),(0,a.jsx)("a",{href:"https://mcp.so",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-text-muted hover:text-primary underline ml-auto",children:"Find MCPs →"})]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Tools"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-1.5",children:[(j=B.some(e=>"exa"===e.name),v=(w?.defaultPlugins||[]).find(e=>"exa"===e.name),(0,a.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer px-2 py-1.5 bg-surface rounded border border-border",children:[(0,a.jsx)("input",{type:"checkbox",checked:j,onChange:e=>{e.target.checked&&v?Z([...B.filter(e=>"exa"!==e.name),v]):Z(B.filter(e=>"exa"!==e.name))},className:"mt-0.5"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-xs font-medium",children:"Web Search & Fetch (Exa)"}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted leading-snug",children:"Replaces built-in WebSearch/WebFetch. Auto-strips duplicates from tool list."})]})]})),(()=>{let e=(w?.localStdioPlugins||[]).find(e=>"browsermcp"===e.name);if(!e)return null;let t=q.includes("browsermcp");return(0,a.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer px-2 py-1.5 bg-surface rounded border border-border",children:[(0,a.jsx)("input",{type:"checkbox",checked:t,onChange:e=>W(e.target.checked?[...q,"browsermcp"]:q.filter(e=>"browsermcp"!==e)),className:"mt-0.5"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-xs font-medium",children:"Browser Control (Browser MCP)"}),(0,a.jsxs)("p",{className:"text-[10px] text-text-muted leading-snug",children:["Controls your running Chrome. Auto-strips Cowork's built-in browser tools."," ",(0,a.jsx)("a",{href:e.extensionUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"Install Chrome extension"})]})]})]})})()]})]}),Array.isArray(w?.localStdioPlugins)&&w.localStdioPlugins.filter(e=>"browsermcp"!==e.name).length>0&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Local Plugins"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"flex flex-col gap-1.5 px-2 py-1.5 bg-surface rounded border border-border",children:w.localStdioPlugins.filter(e=>"browsermcp"!==e.name).map(e=>{let t=q.includes(e.name);return(0,a.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:t,onChange:t=>W(t.target.checked?[...q,e.name]:q.filter(t=>t!==e.name)),className:"mt-0.5"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium",children:e.title}),(0,a.jsx)("span",{className:"text-[8px] text-amber-600",children:"stdio"})]}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted leading-snug",children:e.description}),e.extensionUrl&&(0,a.jsx)("a",{href:e.extensionUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-primary underline",children:"Install Chrome extension"})]})]},e.name)})}),(0,a.jsxs)("p",{className:"text-[10px] text-text-muted leading-snug",children:["⚠️ Local plugins run as subprocess via ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/5",children:"npx"}),". Requires Node.js installed."]})]})]})]}),T&&(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===T.type?"check_circle":"error"}),(0,a.jsx)("span",{children:T.text})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:eg,disabled:0===z.length,loading:O,className:"w-full sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:eb,disabled:!w.hasZevai,loading:M,className:"w-full sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>K(!0),className:"w-full sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,a.jsx)(r.uR,{isOpen:D,onClose:()=>K(!1),title:"Claude Cowork - Manual Configuration",configs:(N=I&&I.trim()?I:m?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",[{filename:"~/Library/Application Support/Claude-3p/configLibrary/<appliedId>.json",content:JSON.stringify({inferenceProvider:"gateway",inferenceGatewayBaseUrl:el(F)||(h&&g?el(g):"")||(m&&u?el(u):"")||(f&&y?el(y):"")||el(n),inferenceGatewayApiKey:N,inferenceModels:(z.length>0?z:["provider/model-id"]).map(e=>({name:e}))},null,2)}])}),(0,a.jsx)(r.CK,{isOpen:Q,combo:null,onClose:()=>X(!1),onSave:ef,activeProviders:d,forcePrefix:"claude-",title:"Create Cowork Combo"}),(0,a.jsx)(r.rq,{isOpen:ee,onClose:()=>et(!1),onSelect:e=>{let t=e?.value||e?.name||e;!t||z.includes(t)||L(e=>[...e,t])},onDeselect:ey,activeProviders:d,modelAliases:V,title:"Select Cowork Model",addedModelValues:z,closeOnSelect:!1}),(0,a.jsx)(r.Nf,{isOpen:ei,onClose:()=>en(!1),onAdd:e=>{B.some(t=>t.name===e.name)||Z([...B,e])},addedNames:B.map(e=>e.name)}),eo&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:()=>ed(!1),children:(0,a.jsxs)("div",{className:"bg-surface border border-border rounded-xl shadow-xl w-full max-w-sm mx-4 p-5 flex flex-col gap-4",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h3",{className:"font-semibold text-sm",children:"Add Custom MCP"}),(0,a.jsx)("button",{onClick:()=>ed(!1),className:"text-text-muted hover:text-text-main",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:()=>em(e=>({...e,type:"url"})),className:`flex-1 py-1.5 rounded border text-xs font-medium transition-colors ${"url"===ec.type?"bg-primary/10 border-primary/40 text-primary":"border-border text-text-muted hover:border-primary/40"}`,children:"URL (SSE)"}),(0,a.jsx)("button",{onClick:()=>em(e=>({...e,type:"cmd"})),className:`flex-1 py-1.5 rounded border text-xs font-medium transition-colors ${"cmd"===ec.type?"bg-primary/10 border-primary/40 text-primary":"border-border text-text-muted hover:border-primary/40"}`,children:"Command (stdio)"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("label",{className:"text-[11px] text-text-muted font-medium",children:"Name"}),(0,a.jsx)("input",{type:"text",placeholder:"my-mcp",value:ec.name,onChange:e=>em(t=>({...t,name:e.target.value.replace(/\s+/g,"-").toLowerCase()})),className:"px-2 py-1.5 rounded border border-border bg-surface text-xs outline-none focus:border-primary"})]}),"url"===ec.type?(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("label",{className:"text-[11px] text-text-muted font-medium",children:"SSE URL"}),(0,a.jsx)("input",{type:"text",placeholder:"https://your-mcp-server.com/sse",value:ec.url,onChange:e=>em(t=>({...t,url:e.target.value})),className:"px-2 py-1.5 rounded border border-border bg-surface text-xs outline-none focus:border-primary"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("label",{className:"text-[11px] text-text-muted font-medium",children:"Command"}),(0,a.jsx)("input",{type:"text",placeholder:"npx",value:ec.command,onChange:e=>em(t=>({...t,command:e.target.value})),className:"px-2 py-1.5 rounded border border-border bg-surface text-xs outline-none focus:border-primary"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("label",{className:"text-[11px] text-text-muted font-medium",children:["Args ",(0,a.jsx)("span",{className:"font-normal",children:"(comma-separated)"})]}),(0,a.jsx)("input",{type:"text",placeholder:"-y, @some/mcp-package",value:ec.args,onChange:e=>em(t=>({...t,args:e.target.value})),className:"px-2 py-1.5 rounded border border-border bg-surface text-xs outline-none focus:border-primary"})]})]})]}),(0,a.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,a.jsx)("button",{onClick:()=>ed(!1),className:"px-3 py-1.5 rounded border border-border text-xs text-text-muted hover:bg-surface cursor-pointer",children:"Cancel"}),(0,a.jsx)("button",{onClick:()=>{let e=ec.name.trim();if(e){if("url"===ec.type){if(!ec.url.trim())return;J(t=>[...t.filter(t=>t.name!==e),{name:e,url:ec.url.trim(),transport:"sse",custom:!0}])}else{if(!ec.command.trim())return;let t=ec.args.split(",").map(e=>e.trim()).filter(Boolean);J(s=>[...s.filter(t=>t.name!==e),{name:e,command:ec.command.trim(),args:t,custom:!0}])}ed(!1)}},className:"px-3 py-1.5 rounded bg-primary text-white text-xs font-medium hover:opacity-90 cursor-pointer",children:"Add"})]})]})})]})}function ei({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:u,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y}){let b,j,[v,N]=(0,l.useState)(m||null),[w,k]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[_,E]=(0,l.useState)(!1),[A,O]=(0,l.useState)(null),[$,M]=(0,l.useState)(""),[P,T]=(0,l.useState)(""),[R,I]=(0,l.useState)({}),[U,z]=(0,l.useState)(!1),[L,D]=(0,l.useState)([]),[K,F]=(0,l.useState)(!1),H=(0,l.useRef)([]);(0,l.useEffect)(()=>{H.current=L},[L]),(0,l.useEffect)(()=>{o?.length>0&&!$&&M(o[0].key)},[o,$]),(0,l.useEffect)(()=>{m&&N(m)},[m]),(0,l.useEffect)(()=>{t&&!v&&(G(),B()),t&&B()},[t]),(0,l.useEffect)(()=>{if(v?.config&&Array.isArray(v.config)&&0===L.length){let e=v.config.find(e=>"ZevaiRouter"===e.name);e?.models?.length>0&&D(e.models.map(e=>e.id))}},[v]);let B=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&I(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},Z=async e=>{try{let t=$&&$.trim()||c?$:"sk_zevai";await fetch("/api/cli-tools/copilot-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:W(),apiKey:t,models:e})})}catch(e){console.log("Error saving models:",e)}},q=v?v.hasZevai?h(v.currentUrl||"",{tunnelPublicUrl:g,tailscaleUrl:y})?"configured":"other":"not_configured":null,W=()=>{let e=P||n;return e.endsWith("/v1")?e:`${e}/v1`},G=async()=>{k(!0);try{let e=await fetch("/api/cli-tools/copilot-settings"),t=await e.json();N(t)}catch(e){N({error:e.message})}finally{k(!1)}},J=async()=>{S(!0),O(null);try{let e=$&&$.trim()||c?$:"sk_zevai",t=await fetch("/api/cli-tools/copilot-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:W(),apiKey:e,models:L})}),s=await t.json();t.ok?(O({type:"success",text:s.message||"Settings applied! Reload VS Code."}),G()):O({type:"error",text:s.error||"Failed to apply settings"})}catch(e){O({type:"error",text:e.message})}finally{S(!1)}},V=async()=>{E(!0),O(null);try{let e=await fetch("/api/cli-tools/copilot-settings",{method:"DELETE"}),t=await e.json();e.ok?(O({type:"success",text:"Settings reset successfully!"}),D([]),G()):O({type:"error",text:t.error||"Failed to reset settings"})}catch(e){O({type:"error",text:e.message})}finally{E(!1)}};return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.A,{src:"/providers/copilot.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===q&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===q&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===q&&(0,a.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,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[w&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Copilot config..."})]}),!w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"info"}),(0,a.jsxs)("div",{className:"text-xs text-blue-700 dark:text-blue-300",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Writes to ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/10 rounded",children:"chatLanguageModels.json"})]}),(0,a.jsx)("p",{className:"mt-0.5 opacity-80",children:"Reload VS Code after applying for changes to take effect."})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:P||P||`${n}/v1`,onChange:T,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:u,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:$,onChange:M,apiKeys:o,cloudEnabled:c})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Models"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===L.length?(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):L.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border",children:[e,(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),D(t=>t.filter(t=>t!==e))},className:"ml-0.5 hover:text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e))}),(0,a.jsx)("div",{children:(0,a.jsx)("button",{onClick:()=>F(!0),disabled:!d?.length,className:`px-2 py-1 rounded border text-xs transition-colors ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Add Model"})})]})]})]}),A&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,a.jsx)("span",{children:A.text})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:J,disabled:0===L.length,loading:C,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:V,disabled:!v?.hasZevai,loading:_,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>z(!0),disabled:0===L.length,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:K,onClose:()=>{F(!1),Z(H.current)},onSelect:e=>{D(t=>t.includes(e.value)?t:[...t,e.value])},onSelectBatch:e=>{D(t=>{let s=[...t];for(let t of e)t?.value&&!s.includes(t.value)&&s.push(t.value);return s})},onDeselect:e=>{D(t=>t.filter(t=>t!==e.value))},onDeselectBatch:e=>{let t=new Set(e.map(e=>e.value));D(e=>e.filter(e=>!t.has(e)))},selectedModel:null,activeProviders:d,modelAliases:R,addedModelValues:L,closeOnSelect:!1,title:"Add Model for GitHub Copilot"}),(0,a.jsx)(r.uR,{isOpen:U,onClose:()=>z(!1),title:"GitHub Copilot - Manual Configuration",configs:(b=$&&$.trim()?$:c?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",j=W(),[{filename:"~/Library/Application Support/Code/User/chatLanguageModels.json",content:JSON.stringify([{name:"ZevaiRouter",vendor:"azure",apiKey:b,models:(L.length>0?L:["provider/model-id"]).map(e=>({id:e,name:e,url:`${j}/chat/completions#models.ai.azure.com`,toolCalling:!0,vision:!1,maxInputTokens:128e3,maxOutputTokens:16e3}))}],null,2)}])})]})}function en({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:u,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y}){let b,j,[v,N]=(0,l.useState)(m||null),[w,k]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[_,E]=(0,l.useState)(!1),[A,O]=(0,l.useState)(null),[$,M]=(0,l.useState)(!1),[P,T]=(0,l.useState)(""),[R,I]=(0,l.useState)(""),[U,z]=(0,l.useState)(!1),[L,D]=(0,l.useState)({}),[K,F]=(0,l.useState)(!1),[H,B]=(0,l.useState)("");(0,l.useEffect)(()=>{o?.length>0&&!P&&T(o[0].key)},[o,P]),(0,l.useEffect)(()=>{m&&N(m)},[m]),(0,l.useEffect)(()=>{t&&!v&&(G(),Z()),t&&Z()},[t]),(0,l.useEffect)(()=>{v?.settings?.openAiModelId&&I(v.settings.openAiModelId)},[v]);let Z=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&D(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},q=v?.installed?v.hasZevai?h(v.settings?.openAiBaseUrl||"",{tunnelPublicUrl:g,tailscaleUrl:y})?"configured":"other":"not_configured":null,W=()=>{let e=H||`${n}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},G=async()=>{k(!0);try{let e=await fetch("/api/cli-tools/cline-settings"),t=await e.json();N(t)}catch(e){N({installed:!1,error:e.message})}finally{k(!1)}},J=async()=>{S(!0),O(null);try{let e=P&&P.trim()||c?P:"sk_zevai",t=await fetch("/api/cli-tools/cline-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:W(),apiKey:e,model:R})}),s=await t.json();t.ok?(O({type:"success",text:"Settings applied successfully!"}),G()):O({type:"error",text:s.error||"Failed to apply settings"})}catch(e){O({type:"error",text:e.message})}finally{S(!1)}},V=async()=>{E(!0),O(null);try{let e=await fetch("/api/cli-tools/cline-settings",{method:"DELETE"}),t=await e.json();e.ok?(O({type:"success",text:"Settings reset successfully!"}),I(""),G()):O({type:"error",text:t.error||"Failed to reset settings"})}catch(e){O({type:"error",text:e.message})}finally{E(!1)}};return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.A,{src:"/providers/cline.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===q&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===q&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===q&&(0,a.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,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[w&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Cline..."})]}),!w&&v&&!v.installed&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Cline not detected locally"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if zevairouter is deployed on a remote server."})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,a.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>F(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>M(!$),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:$?"expand_less":"help"}),$?"Hide":"How to Install"]})]})]}),$&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,a.jsx)("div",{className:"space-y-3 text-sm",children:(0,a.jsxs)("p",{className:"text-text-muted",children:["Install Cline VS Code extension or CLI from ",(0,a.jsx)("a",{className:"text-primary underline",href:"https://docs.cline.bot/",target:"_blank",rel:"noreferrer",children:"docs.cline.bot"}),"."]})})]})]}),!w&&v?.installed&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:H||H||`${n}/v1`,onChange:B,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:u,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:y})]}),v?.settings?.openAiBaseUrl&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:v.settings.openAiBaseUrl})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:P,onChange:T,apiKeys:o,cloudEnabled:c})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,a.jsx)("input",{type:"text",value:R,onChange:e=>I(e.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),R&&(0,a.jsx)("button",{onClick:()=>I(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,a.jsx)("button",{onClick:()=>z(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),A&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,a.jsx)("span",{children:A.text})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:J,disabled:!P&&c&&o.length>0||!R,loading:C,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:V,disabled:_,loading:_,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>F(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:U,onClose:()=>z(!1),onSelect:e=>{I(e.value),z(!1)},selectedModel:R,activeProviders:d,modelAliases:L,title:"Select Model for Cline"}),(0,a.jsx)(r.uR,{isOpen:K,onClose:()=>F(!1),title:"Cline - Manual Configuration",configs:(b=P&&P.trim()?P:c?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",[{filename:"~/.cline/data/globalState.json",content:JSON.stringify({actModeApiProvider:"openai",planModeApiProvider:"openai",openAiBaseUrl:(j=W()).endsWith("/v1")?j.slice(0,-3):j,openAiModelId:R||"provider/model-id",planModeOpenAiModelId:R||"provider/model-id"},null,2)},{filename:"~/.cline/data/secrets.json",content:JSON.stringify({openAiApiKey:b},null,2)}])})]})}function eo({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:u,tunnelPublicUrl:h,tailscaleEnabled:g,tailscaleUrl:f}){let[y,b]=(0,l.useState)(m||null),[j,v]=(0,l.useState)(!1),[N,w]=(0,l.useState)(!1),[k,C]=(0,l.useState)(!1),[S,_]=(0,l.useState)(null),[E,A]=(0,l.useState)(!1),[O,$]=(0,l.useState)(""),[M,P]=(0,l.useState)(""),[T,R]=(0,l.useState)(!1),[I,U]=(0,l.useState)({}),[z,L]=(0,l.useState)(!1),[D,K]=(0,l.useState)("");(0,l.useEffect)(()=>{o?.length>0&&!O&&$(o[0].key)},[o,O]),(0,l.useEffect)(()=>{m&&b(m)},[m]),(0,l.useEffect)(()=>{t&&!y&&(Z(),F()),t&&F()},[t]);let F=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&U(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},H=y?.installed?y.hasZevai?"configured":"not_configured":null,B=()=>{let e=D||`${n}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},Z=async()=>{v(!0);try{let e=await fetch("/api/cli-tools/kilo-settings"),t=await e.json();b(t)}catch(e){b({installed:!1,error:e.message})}finally{v(!1)}},q=async()=>{w(!0),_(null);try{let e=O&&O.trim()||c?O:"sk_zevai",t=await fetch("/api/cli-tools/kilo-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:B(),apiKey:e,model:M})}),s=await t.json();t.ok?(_({type:"success",text:"Settings applied successfully!"}),Z()):_({type:"error",text:s.error||"Failed to apply settings"})}catch(e){_({type:"error",text:e.message})}finally{w(!1)}},W=async()=>{C(!0),_(null);try{let e=await fetch("/api/cli-tools/kilo-settings",{method:"DELETE"}),t=await e.json();e.ok?(_({type:"success",text:"Settings reset successfully!"}),P(""),Z()):_({type:"error",text:t.error||"Failed to reset settings"})}catch(e){_({type:"error",text:e.message})}finally{C(!1)}};return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.A,{src:"/providers/kilocode.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===H&&(0,a.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"===H&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[j&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Kilo Code..."})]}),!j&&y&&!y.installed&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Kilo Code not detected locally"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if zevairouter is deployed on a remote server."})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,a.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>L(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>A(!E),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:E?"expand_less":"help"}),E?"Hide":"How to Install"]})]})]}),E&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Install Kilo Code from ",(0,a.jsx)("a",{className:"text-primary underline",href:"https://kilocode.ai",target:"_blank",rel:"noreferrer",children:"kilocode.ai"})," or VS Code extension marketplace."]})]})]}),!j&&y?.installed&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:D||D||`${n}/v1`,onChange:K,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:u,tunnelPublicUrl:h,tailscaleEnabled:g,tailscaleUrl:f})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:O,onChange:$,apiKeys:o,cloudEnabled:c})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,a.jsx)("input",{type:"text",value:M,onChange:e=>P(e.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),M&&(0,a.jsx)("button",{onClick:()=>P(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,a.jsx)("button",{onClick:()=>R(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),S&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===S.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===S.type?"check_circle":"error"}),(0,a.jsx)("span",{children:S.text})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:q,disabled:!O&&c&&o.length>0||!M,loading:N,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:W,disabled:k,loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>L(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:T,onClose:()=>R(!1),onSelect:e=>{P(e.value),R(!1)},selectedModel:M,activeProviders:d,modelAliases:I,title:"Select Model for Kilo Code"}),(0,a.jsx)(r.uR,{isOpen:z,onClose:()=>L(!1),title:"Kilo Code - Manual Configuration",configs:[{filename:"~/.local/share/kilo/auth.json",content:JSON.stringify({"openai-compatible":{type:"api-key",apiKey:O&&O.trim()?O:c?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",baseUrl:B(),model:M||"provider/model-id"}},null,2)}]})]})}let ed="/api/cli-tools/deepseek-tui-settings";function ec({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:o,apiKeys:d,activeProviders:c,cloudEnabled:m,initialStatus:u,tunnelEnabled:g,tunnelPublicUrl:f,tailscaleEnabled:y,tailscaleUrl:b}){let j,[v,N]=(0,l.useState)(u||null),[w,k]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[_,E]=(0,l.useState)(!1),[A,O]=(0,l.useState)(null),[$,M]=(0,l.useState)(""),[P,T]=(0,l.useState)(""),[R,I]=(0,l.useState)(!1),[U,z]=(0,l.useState)({}),[L,D]=(0,l.useState)(!1),[K,F]=(0,l.useState)(""),H=(0,l.useRef)(!1),B=(()=>{if(!v?.installed)return null;let e=v.settings?.["providers.openai"];return e?.base_url?h(e.base_url,{tunnelPublicUrl:f,tailscaleUrl:b})?"configured":"other":"not_configured"})();(0,l.useEffect)(()=>{d?.length>0&&!$&&M(d[0].key)},[d,$]),(0,l.useEffect)(()=>{u&&N(u)},[u]),(0,l.useEffect)(()=>{t&&!v&&(q(),Z()),t&&Z()},[t]);let Z=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&z(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(v?.installed&&!H.current){H.current=!0;let e=v.settings?.["providers.openai"];e?.model&&T(e.model)}},[v]);let q=async()=>{k(!0);try{let e=await fetch(ed),t=await e.json();N(t)}catch(e){N({installed:!1,error:e.message})}finally{k(!1)}},W=()=>{let e=K||window.location.origin.replace("://localhost","://127.0.0.1");return e.endsWith("/v1")?e:`${e}/v1`},G=async()=>{S(!0),O(null);try{let e=$?.trim()||(d?.length>0?d[0].key:null)||(m?null:"sk_zevai"),t=await fetch(ed,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:W(),apiKey:e,model:P})}),s=await t.json();t.ok?(O({type:"success",text:"Settings applied successfully!"}),q()):O({type:"error",text:s.error||"Failed to apply settings"})}catch(e){O({type:"error",text:e.message})}finally{S(!1)}},J=async()=>{E(!0),O(null);try{let e=await fetch(ed,{method:"DELETE"}),t=await e.json();e.ok?(O({type:"success",text:"Settings reset successfully!"}),T(""),q()):O({type:"error",text:t.error||"Failed to reset settings"})}catch(e){O({type:"error",text:e.message})}finally{E(!1)}};return(0,a.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.A,{src:e.image||"/providers/deepseek-tui.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===B&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===B&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===B&&(0,a.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,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[w&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking DeepSeek TUI..."})]}),!w&&v&&!v.installed&&(0,a.jsx)("div",{className:"flex flex-col gap-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"DeepSeek TUI not detected locally"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Install via npm:"}),(0,a.jsx)("code",{className:"block mt-2 p-2 bg-black/20 rounded text-xs font-mono",children:"npm install -g deepseek-tui"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-2",children:"Manual configuration is still available if zevairouter is deployed on a remote server."})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 pl-9",children:(0,a.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>D(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]})}),!w&&v?.installed&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[e.notes&&e.notes.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-2 mb-2",children:e.notes.map((e,t)=>(0,a.jsxs)("div",{className:`flex items-start gap-2 p-2 rounded text-xs ${"warning"===e.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"error"===e.type?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-blue-500/10 text-blue-600 dark:text-blue-400"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5",children:"warning"===e.type?"warning":"error"===e.type?"error":"info"}),(0,a.jsx)("span",{children:e.text})]},t))}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(x,{value:K||W(),onChange:F,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:g,tunnelPublicUrl:f,tailscaleEnabled:y,tailscaleUrl:b})]}),v?.settings?.["providers.openai"]?.base_url&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:v.settings["providers.openai"].base_url})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)(p,{value:$,onChange:M,apiKeys:d,cloudEnabled:m})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Default Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,a.jsx)("input",{type:"text",value:P,onChange:e=>T(e.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),P&&(0,a.jsx)("button",{onClick:()=>T(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,a.jsx)("button",{onClick:()=>I(!0),disabled:!o,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${o?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]})]}),A&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,a.jsx)("span",{children:A.text})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:G,disabled:!P,loading:C,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:J,disabled:!v?.hasZevai,loading:_,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>D(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:R,onClose:()=>I(!1),onSelect:e=>{T(e.value),I(!1)},selectedModel:P,activeProviders:c,modelAliases:U,title:"Select Model for DeepSeek TUI"}),(0,a.jsx)(r.uR,{isOpen:L,onClose:()=>D(!1),title:"DeepSeek TUI - Manual Configuration",configs:(j=$&&$.trim()?$:m?"<API_KEY_FROM_DASHBOARD>":"sk_zevai",[{filename:"~/.deepseek/config.toml",content:`[providers.openai]
|
|
60
60
|
base_url = "${W()}"
|
|
61
61
|
api_key = "${j}"
|
|
62
62
|
model = "${P||"provider/model-id"}"
|