zevairouter 1.1.80 → 1.1.81
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 +10 -0
- package/cli/app/.next-cli-build/BUILD_ID +1 -1
- package/cli/app/.next-cli-build/app-path-routes-manifest.json +13 -13
- package/cli/app/.next-cli-build/build-manifest.json +2 -2
- package/cli/app/.next-cli-build/prerender-manifest.json +3 -3
- 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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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 +1 -1
- 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.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.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.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.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.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.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.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.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.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.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.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 +5 -5
- 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 +1 -1
- 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 +2 -2
- 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.nft.json +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 +2 -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 +1 -1
- 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 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -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/dsh-settings/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/dsh-settings/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +3 -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 +2 -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 +2 -2
- 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 +2 -2
- 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.nft.json +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.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/dashboard/models/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.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.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.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.nft.json +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.nft.json +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.nft.json +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.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.nft.json +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.nft.json +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.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.nft.json +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.nft.json +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.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.nft.json +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.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.nft.json +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.nft.json +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/aistudio/helper/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/aistudio/models/route.js.nft.json +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.nft.json +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.nft.json +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.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.nft.json +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.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 +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.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.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 +1 -1
- 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.nft.json +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.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/quota-stream/route.js +1 -1
- 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/music/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/audio/music/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.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.nft.json +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.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.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.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.nft.json +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.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 +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +4 -4
- 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 +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +3 -3
- 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.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.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.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.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 +13 -13
- package/cli/app/.next-cli-build/server/chunks/1257.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/1283.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/1350.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/1509.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/1757.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/1852.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/2025.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/267.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/2990.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/3792.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/3815.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/412.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/4128.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/4177.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/4549.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/4631.js +1 -0
- package/cli/app/.next-cli-build/server/chunks/5024.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/5330.js +4 -2
- package/cli/app/.next-cli-build/server/chunks/5626.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/5744.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/6166.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/6396.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/6492.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/6936.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/7135.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/7319.js +13 -11
- package/cli/app/.next-cli-build/server/chunks/7364.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/7404.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/8517.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/8725.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/8749.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/9548.js +1 -1
- package/cli/app/.next-cli-build/server/middleware-build-manifest.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-71a02c6639ddb92b.js → 5497-44af6e5aafe6256a.js} +1 -1
- package/cli/app/.next-cli-build/static/chunks/620-7ee9e671a83a36e2.js +1 -0
- package/cli/app/.next-cli-build/static/chunks/{7001-da01aaca36365276.js → 7001-8bbc6a14335afd88.js} +1 -1
- package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-936f29821afd7d28.js → page-342ac0d9d2fb15c7.js} +1 -1
- package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-808e3749cba268ff.js +1 -0
- package/cli/app/CHANGELOG.md +10 -0
- package/cli/app/package.json +1 -1
- package/cli/app/src/mitm/server.js +1 -1
- package/cli/package.json +1 -1
- package/package.json +1 -1
- package/cli/app/.next-cli-build/server/chunks/8972.js +0 -1
- package/cli/app/.next-cli-build/static/chunks/620-0f6bd4f59fa0cd33.js +0 -1
- package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-926a39b841570eda.js +0 -1
- /package/cli/app/.next-cli-build/static/{Vbe_S3ECwU1yAXUWqmRCl → 3CLejW1UKDHu2Eb5QKNoj}/_buildManifest.js +0 -0
- /package/cli/app/.next-cli-build/static/{Vbe_S3ECwU1yAXUWqmRCl → 3CLejW1UKDHu2Eb5QKNoj}/_ssgManifest.js +0 -0
package/cli/app/.next-cli-build/static/chunks/{7001-da01aaca36365276.js → 7001-8bbc6a14335afd88.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7001],{3534:(e,t,s)=>{s.d(t,{dM:()=>l,wn:()=>a});let a={antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",mitmDomain:"daily-cloudcode-pa.googleapis.com",modelAliases:["gemini-4-argon-high","gemini-4-argon-medium","gemini-4-argon-low","gemini-4-carbon-high","gemini-4-carbon-medium","gemini-4-carbon-low","gemini-4-hydrogen-xhigh","gemini-4-hydrogen-high","gemini-4-hydrogen-medium","gemini-4-hydrogen-low","gemini-3.8-flash-high","gemini-3.8-flash-medium","gemini-3.8-flash-low","claude-sonnet-5-5","claude-sonnet-5-5-low","claude-sonnet-5-5-medium","claude-sonnet-5-5-high","claude-opus-5-5","claude-opus-5-5-low","claude-opus-5-5-medium","claude-opus-5-5-high","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium","gemini-3-flash"],defaultModels:[{id:"gemini-4-argon-high",name:"Gemini 4 Argon (High)",alias:"gemini-4-argon-high"},{id:"gemini-4-argon-medium",name:"Gemini 4 Argon (Medium)",alias:"gemini-4-argon-medium"},{id:"gemini-4-argon-low",name:"Gemini 4 Argon (Low)",alias:"gemini-4-argon-low"},{id:"gemini-4-carbon-high",name:"Gemini 4 Carbon (High)",alias:"gemini-4-carbon-high"},{id:"gemini-4-carbon-medium",name:"Gemini 4 Carbon (Medium)",alias:"gemini-4-carbon-medium"},{id:"gemini-4-carbon-low",name:"Gemini 4 Carbon (Low)",alias:"gemini-4-carbon-low"},{id:"gemini-4-hydrogen-xhigh",name:"Gemini 4 Hydrogen (xHigh)",alias:"gemini-4-hydrogen-xhigh"},{id:"gemini-4-hydrogen-high",name:"Gemini 4 Hydrogen (High)",alias:"gemini-4-hydrogen-high"},{id:"gemini-4-hydrogen-medium",name:"Gemini 4 Hydrogen (Medium)",alias:"gemini-4-hydrogen-medium"},{id:"gemini-4-hydrogen-low",name:"Gemini 4 Hydrogen (Low)",alias:"gemini-4-hydrogen-low"},{id:"gemini-3.8-flash-high",name:"Gemini 3.8 Flash (High)",alias:"gemini-3.8-flash-high"},{id:"gemini-3.8-flash-medium",name:"Gemini 3.8 Flash (Medium)",alias:"gemini-3.8-flash-medium"},{id:"gemini-3.8-flash-low",name:"Gemini 3.8 Flash (Low)",alias:"gemini-3.8-flash-low"},{id:"claude-sonnet-5-5",name:"Claude Sonnet 5.5 (Thinking)",alias:"claude-sonnet-5-5"},{id:"claude-sonnet-5-5-low",name:"Claude Sonnet 5.5 (Low)",alias:"claude-sonnet-5-5-low"},{id:"claude-sonnet-5-5-medium",name:"Claude Sonnet 5.5 (Medium)",alias:"claude-sonnet-5-5-medium"},{id:"claude-sonnet-5-5-high",name:"Claude Sonnet 5.5 (High)",alias:"claude-sonnet-5-5-high"},{id:"claude-opus-5-5",name:"Claude Opus 5.5 (Thinking)",alias:"claude-opus-5-5"},{id:"claude-opus-5-5-low",name:"Claude Opus 5.5 (Low)",alias:"claude-opus-5-5-low"},{id:"claude-opus-5-5-medium",name:"Claude Opus 5.5 (Medium)",alias:"claude-opus-5-5-medium"},{id:"claude-opus-5-5-high",name:"Claude Opus 5.5 (High)",alias:"claude-opus-5-5-high"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6 (Thinking)",alias:"claude-sonnet-4-6"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 (Thinking)",alias:"claude-opus-4-6-thinking"},{id:"gpt-oss-120b-medium",name:"GPT-OSS 120B (Medium)",alias:"gpt-oss-120b-medium"},{id:"gemini-3-flash",name:"Gemini 3 Flash (Command)",alias:"gemini-3-flash"}]},kiro:{id:"kiro",name:"Kiro",image:"/providers/kiro.png",color:"#FF6B00",description:"Kiro IDE with MITM",configType:"mitm",mitmDomain:"q.us-east-1.amazonaws.com",defaultModels:[{id:"auto",name:"Auto (Kiro Agent)",alias:"auto"},{id:"claude-opus-5.5",name:"Claude Opus 5.5",alias:"claude-opus-5.5"},{id:"claude-sonnet-5.5",name:"Claude Sonnet 5.5",alias:"claude-sonnet-5.5"},{id:"claude-haiku-5.5",name:"Claude Haiku 5.5",alias:"claude-haiku-5.5"},{id:"gpt-5.6-sol",name:"GPT 5.6 Sol",alias:"gpt-5.6-sol"},{id:"gpt-5.6-terra",name:"GPT 5.6 Terra",alias:"gpt-5.6-terra"},{id:"gpt-5.6-luna",name:"GPT 5.6 Luna",alias:"gpt-5.6-luna"},{id:"grok-4.7",name:"Grok 4.7",alias:"grok-4.7"},{id:"kimi-k3",name:"Kimi K3",alias:"kimi-k3"},{id:"claude-opus-5",name:"Claude Opus 5",alias:"claude-opus-5"},{id:"claude-sonnet-5",name:"Claude Sonnet 5",alias:"claude-sonnet-5"},{id:"claude-opus-4.8",name:"Claude Opus 4.8",alias:"claude-opus-4.8"},{id:"claude-opus-4.7",name:"Claude Opus 4.7",alias:"claude-opus-4.7"},{id:"claude-opus-4.6",name:"Claude Opus 4.6",alias:"claude-opus-4.6"},{id:"claude-sonnet-4.6",name:"Claude Sonnet 4.6",alias:"claude-sonnet-4.6"},{id:"claude-opus-4.5",name:"Claude Opus 4.5",alias:"claude-opus-4.5"},{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5",alias:"claude-sonnet-4.5"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"},{id:"deepseek-3.2",name:"DeepSeek 3.2",alias:"deepseek-3.2"},{id:"minimax-m2.5",name:"MiniMax M2.5",alias:"minimax-m2.5"},{id:"minimax-m2.1",name:"MiniMax M2.1",alias:"minimax-m2.1"},{id:"glm-5",name:"GLM 5",alias:"glm-5"},{id:"qwen3-coder-next",name:"Qwen3 Coder Next",alias:"qwen3-coder-next"},{id:"simple-task",name:"Simple Task (background)",alias:"simple-task"}]}},l={claude:{id:"claude",name:"Claude Code",image:"/providers/claude.png",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL"},modelAliases:["default","sonnet","opus","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-4-6"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-4-6"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},openclaw:{id:"openclaw",name:"Open Claw",image:"/providers/openclaw.png",color:"#FF6B35",description:"Open Claw AI Assistant",configType:"custom"},codex:{id:"codex",name:"OpenAI Codex CLI / App",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot Chat in VS Code via an OpenAI-compatible model provider",configType:"guide",docsUrl:"https://code.visualstudio.com/docs/copilot/customization/language-models",guideSteps:[{step:1,title:"Open Manage Models",desc:"In VS Code, open Copilot Chat, click the model picker at the bottom, then choose 'Manage Models...' and add an 'OpenAI Compatible' provider."},{step:2,title:"Configure Server",desc:"Enter this Base URL, then paste a ZevaiRouter API key when VS Code asks for it:",value:"{{baseUrl}}",copyable:!0},{step:3,title:"Select Model in Copilot Chat",desc:"Open Copilot Chat, click the model picker at the bottom → 'Manage Models...' → check the ZevaiRouter models to use."}]},"grok-build":{id:"grok-build",name:"Grok Build",image:"/providers/grok-cli.png",color:"#111111",description:"xAI coding agent with ZevaiRouter main and subagent model routing",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",color:"#E87040",description:"OpenCode AI Terminal Assistant",configType:"custom"},cowork:{id:"cowork",name:"Claude Cowork",image:"/providers/claude.png",color:"#D97757",description:"Claude Desktop Cowork (third-party inference)",configType:"custom"},hermes:{id:"hermes",name:"Hermes Agent",image:"/providers/hermes.png",color:"#8B5CF6",description:"Nous Research self-improving AI agent",configType:"custom",roles:[{id:"delegation",label:"Delegation (subagents)"},{id:"vision",label:"Vision"},{id:"compression",label:"Compression"},{id:"title_generation",label:"Title Generation"},{id:"approval",label:"Approval"},{id:"skills_hub",label:"Skills Hub"},{id:"mcp",label:"MCP"},{id:"review",label:"Review (/review subagent)"},{id:"memory_query_rewrite",label:"Memory Query Rewrite"},{id:"background_review",label:"Background Review"},{id:"curator",label:"Curator"},{id:"monitor",label:"Monitor"},{id:"tts_audio_tags",label:"TTS Audio Tags"},{id:"triage_specifier",label:"Triage Specifier"},{id:"kanban_decomposer",label:"Kanban Decomposer"},{id:"profile_describer",label:"Profile Describer"},{id:"goal_judge",label:"Goal Judge"}]},droid:{id:"droid",name:"Factory Droid",image:"/providers/droid.png",color:"#00D4FF",description:"Factory Droid AI Assistant",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresExternalUrl:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor's custom OpenAI endpoint is called from Cursor's server, so a local base URL is not supported. Use Tunnel or Cloud Endpoint, or map models in the Cursor MITM tool instead."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]},cline:{id:"cline",name:"Cline",image:"/providers/cline.png",color:"#00D1B2",description:"Cline AI Coding Assistant",configType:"custom"},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant",configType:"custom"},roo:{id:"roo",name:"Roo",image:"/providers/roo.png",color:"#FF6B6B",description:"Roo AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Roo Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → Ollama"},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},continue:{id:"continue",name:"Continue",image:"/providers/continue.png",color:"#7C3AED",description:"Continue AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Config",desc:"Open Continue configuration file"},{step:2,title:"API Key",type:"apiKeySelector"},{step:3,title:"Select Model",type:"modelSelector"},{step:4,title:"Add Model Config",desc:"Add the following configuration to your models array:"}],codeBlock:{language:"json",code:`{
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7001],{3534:(e,t,s)=>{s.d(t,{dM:()=>l,wn:()=>a});let a={antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",mitmDomain:"daily-cloudcode-pa.googleapis.com",modelAliases:["gemini-4-argon-high","gemini-4-argon-medium","gemini-4-argon-low","gemini-4-carbon-high","gemini-4-carbon-medium","gemini-4-carbon-low","gemini-4-hydrogen-xhigh","gemini-4-hydrogen-high","gemini-4-hydrogen-medium","gemini-4-hydrogen-low","gemini-4-neon-xhigh","gemini-4-neon-high","gemini-4-neon-medium","gemini-4-neon-low","gemini-3.8-flash-high","gemini-3.8-flash-medium","gemini-3.8-flash-low","claude-sonnet-5-5","claude-sonnet-5-5-low","claude-sonnet-5-5-medium","claude-sonnet-5-5-high","claude-opus-5-5","claude-opus-5-5-low","claude-opus-5-5-medium","claude-opus-5-5-high","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium","gemini-3-flash"],defaultModels:[{id:"gemini-4-argon-high",name:"Gemini 4 Argon (High)",alias:"gemini-4-argon-high"},{id:"gemini-4-argon-medium",name:"Gemini 4 Argon (Medium)",alias:"gemini-4-argon-medium"},{id:"gemini-4-argon-low",name:"Gemini 4 Argon (Low)",alias:"gemini-4-argon-low"},{id:"gemini-4-carbon-high",name:"Gemini 4 Carbon (High)",alias:"gemini-4-carbon-high"},{id:"gemini-4-carbon-medium",name:"Gemini 4 Carbon (Medium)",alias:"gemini-4-carbon-medium"},{id:"gemini-4-carbon-low",name:"Gemini 4 Carbon (Low)",alias:"gemini-4-carbon-low"},{id:"gemini-4-hydrogen-xhigh",name:"Gemini 4 Hydrogen (xHigh)",alias:"gemini-4-hydrogen-xhigh"},{id:"gemini-4-hydrogen-high",name:"Gemini 4 Hydrogen (High)",alias:"gemini-4-hydrogen-high"},{id:"gemini-4-hydrogen-medium",name:"Gemini 4 Hydrogen (Medium)",alias:"gemini-4-hydrogen-medium"},{id:"gemini-4-hydrogen-low",name:"Gemini 4 Hydrogen (Low)",alias:"gemini-4-hydrogen-low"},{id:"gemini-4-neon-xhigh",name:"Gemini 4 Neon (xHigh)",alias:"gemini-4-neon-xhigh"},{id:"gemini-4-neon-high",name:"Gemini 4 Neon (High)",alias:"gemini-4-neon-high"},{id:"gemini-4-neon-medium",name:"Gemini 4 Neon (Medium)",alias:"gemini-4-neon-medium"},{id:"gemini-4-neon-low",name:"Gemini 4 Neon (Low)",alias:"gemini-4-neon-low"},{id:"gemini-3.8-flash-high",name:"Gemini 3.8 Flash (High)",alias:"gemini-3.8-flash-high"},{id:"gemini-3.8-flash-medium",name:"Gemini 3.8 Flash (Medium)",alias:"gemini-3.8-flash-medium"},{id:"gemini-3.8-flash-low",name:"Gemini 3.8 Flash (Low)",alias:"gemini-3.8-flash-low"},{id:"claude-sonnet-5-5",name:"Claude Sonnet 5.5 (Thinking)",alias:"claude-sonnet-5-5"},{id:"claude-sonnet-5-5-low",name:"Claude Sonnet 5.5 (Low)",alias:"claude-sonnet-5-5-low"},{id:"claude-sonnet-5-5-medium",name:"Claude Sonnet 5.5 (Medium)",alias:"claude-sonnet-5-5-medium"},{id:"claude-sonnet-5-5-high",name:"Claude Sonnet 5.5 (High)",alias:"claude-sonnet-5-5-high"},{id:"claude-opus-5-5",name:"Claude Opus 5.5 (Thinking)",alias:"claude-opus-5-5"},{id:"claude-opus-5-5-low",name:"Claude Opus 5.5 (Low)",alias:"claude-opus-5-5-low"},{id:"claude-opus-5-5-medium",name:"Claude Opus 5.5 (Medium)",alias:"claude-opus-5-5-medium"},{id:"claude-opus-5-5-high",name:"Claude Opus 5.5 (High)",alias:"claude-opus-5-5-high"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6 (Thinking)",alias:"claude-sonnet-4-6"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 (Thinking)",alias:"claude-opus-4-6-thinking"},{id:"gpt-oss-120b-medium",name:"GPT-OSS 120B (Medium)",alias:"gpt-oss-120b-medium"},{id:"gemini-3-flash",name:"Gemini 3 Flash (Command)",alias:"gemini-3-flash"}]},kiro:{id:"kiro",name:"Kiro",image:"/providers/kiro.png",color:"#FF6B00",description:"Kiro IDE with MITM",configType:"mitm",mitmDomain:"q.us-east-1.amazonaws.com",defaultModels:[{id:"auto",name:"Auto (Kiro Agent)",alias:"auto"},{id:"claude-opus-5.5",name:"Claude Opus 5.5",alias:"claude-opus-5.5"},{id:"claude-sonnet-5.5",name:"Claude Sonnet 5.5",alias:"claude-sonnet-5.5"},{id:"claude-haiku-5.5",name:"Claude Haiku 5.5",alias:"claude-haiku-5.5"},{id:"gpt-5.6-sol",name:"GPT 5.6 Sol",alias:"gpt-5.6-sol"},{id:"gpt-5.6-terra",name:"GPT 5.6 Terra",alias:"gpt-5.6-terra"},{id:"gpt-5.6-luna",name:"GPT 5.6 Luna",alias:"gpt-5.6-luna"},{id:"grok-4.7",name:"Grok 4.7",alias:"grok-4.7"},{id:"kimi-k3",name:"Kimi K3",alias:"kimi-k3"},{id:"claude-opus-5",name:"Claude Opus 5",alias:"claude-opus-5"},{id:"claude-sonnet-5",name:"Claude Sonnet 5",alias:"claude-sonnet-5"},{id:"claude-opus-4.8",name:"Claude Opus 4.8",alias:"claude-opus-4.8"},{id:"claude-opus-4.7",name:"Claude Opus 4.7",alias:"claude-opus-4.7"},{id:"claude-opus-4.6",name:"Claude Opus 4.6",alias:"claude-opus-4.6"},{id:"claude-sonnet-4.6",name:"Claude Sonnet 4.6",alias:"claude-sonnet-4.6"},{id:"claude-opus-4.5",name:"Claude Opus 4.5",alias:"claude-opus-4.5"},{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5",alias:"claude-sonnet-4.5"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"},{id:"deepseek-3.2",name:"DeepSeek 3.2",alias:"deepseek-3.2"},{id:"minimax-m2.5",name:"MiniMax M2.5",alias:"minimax-m2.5"},{id:"minimax-m2.1",name:"MiniMax M2.1",alias:"minimax-m2.1"},{id:"glm-5",name:"GLM 5",alias:"glm-5"},{id:"qwen3-coder-next",name:"Qwen3 Coder Next",alias:"qwen3-coder-next"},{id:"simple-task",name:"Simple Task (background)",alias:"simple-task"}]}},l={claude:{id:"claude",name:"Claude Code",image:"/providers/claude.png",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL"},modelAliases:["default","sonnet","opus","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-4-6"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-4-6"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},openclaw:{id:"openclaw",name:"Open Claw",image:"/providers/openclaw.png",color:"#FF6B35",description:"Open Claw AI Assistant",configType:"custom"},codex:{id:"codex",name:"OpenAI Codex CLI / App",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot Chat in VS Code via an OpenAI-compatible model provider",configType:"guide",docsUrl:"https://code.visualstudio.com/docs/copilot/customization/language-models",guideSteps:[{step:1,title:"Open Manage Models",desc:"In VS Code, open Copilot Chat, click the model picker at the bottom, then choose 'Manage Models...' and add an 'OpenAI Compatible' provider."},{step:2,title:"Configure Server",desc:"Enter this Base URL, then paste a ZevaiRouter API key when VS Code asks for it:",value:"{{baseUrl}}",copyable:!0},{step:3,title:"Select Model in Copilot Chat",desc:"Open Copilot Chat, click the model picker at the bottom → 'Manage Models...' → check the ZevaiRouter models to use."}]},"grok-build":{id:"grok-build",name:"Grok Build",image:"/providers/grok-cli.png",color:"#111111",description:"xAI coding agent with ZevaiRouter main and subagent model routing",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",color:"#E87040",description:"OpenCode AI Terminal Assistant",configType:"custom"},cowork:{id:"cowork",name:"Claude Cowork",image:"/providers/claude.png",color:"#D97757",description:"Claude Desktop Cowork (third-party inference)",configType:"custom"},hermes:{id:"hermes",name:"Hermes Agent",image:"/providers/hermes.png",color:"#8B5CF6",description:"Nous Research self-improving AI agent",configType:"custom",roles:[{id:"delegation",label:"Delegation (subagents)"},{id:"vision",label:"Vision"},{id:"compression",label:"Compression"},{id:"title_generation",label:"Title Generation"},{id:"approval",label:"Approval"},{id:"skills_hub",label:"Skills Hub"},{id:"mcp",label:"MCP"},{id:"review",label:"Review (/review subagent)"},{id:"memory_query_rewrite",label:"Memory Query Rewrite"},{id:"background_review",label:"Background Review"},{id:"curator",label:"Curator"},{id:"monitor",label:"Monitor"},{id:"tts_audio_tags",label:"TTS Audio Tags"},{id:"triage_specifier",label:"Triage Specifier"},{id:"kanban_decomposer",label:"Kanban Decomposer"},{id:"profile_describer",label:"Profile Describer"},{id:"goal_judge",label:"Goal Judge"}]},droid:{id:"droid",name:"Factory Droid",image:"/providers/droid.png",color:"#00D4FF",description:"Factory Droid AI Assistant",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresExternalUrl:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor's custom OpenAI endpoint is called from Cursor's server, so a local base URL is not supported. Use Tunnel or Cloud Endpoint, or map models in the Cursor MITM tool instead."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]},cline:{id:"cline",name:"Cline",image:"/providers/cline.png",color:"#00D1B2",description:"Cline AI Coding Assistant",configType:"custom"},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant",configType:"custom"},roo:{id:"roo",name:"Roo",image:"/providers/roo.png",color:"#FF6B6B",description:"Roo AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Roo Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → Ollama"},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},continue:{id:"continue",name:"Continue",image:"/providers/continue.png",color:"#7C3AED",description:"Continue AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Config",desc:"Open Continue configuration file"},{step:2,title:"API Key",type:"apiKeySelector"},{step:3,title:"Select Model",type:"modelSelector"},{step:4,title:"Add Model Config",desc:"Add the following configuration to your models array:"}],codeBlock:{language:"json",code:`{
|
|
2
2
|
"apiBase": "{{baseUrl}}",
|
|
3
3
|
"title": "{{model}}",
|
|
4
4
|
"model": "{{model}}",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{28915:(e,t,s)=>{"use strict";s.d(t,{x6:()=>a.fetchJson,E2:()=>r,gs:()=>i});var a=s(68211);function r(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}function i(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}},65219:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>eY});var a=s(95155),r=s(12115),i=s(73321),n=s(98500),l=s.n(n),o=s(5772),d=s(35497),c=s(1791);let m=["kiro","codebuddy","codebuddy-cn","qoder","antigravity","cloudflare-ai","grok-cli"];function u(e){return m.includes(String(e||""))}function p(e){let t=String(e||"").trim();return t&&u(t)?`/dashboard/automation?provider=${encodeURIComponent(t)}`:"/dashboard/automation"}var x=s(28777),h=s(11059),b=s(73006);let f=new Map;async function g(e){if(!e?.url||!e?.type)return[];let t=f.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let a=(await s.json()).data??[];return f.set(e.url,{data:a,expiresAt:Date.now()+6e5}),a}catch{return[]}}var y=s(12252),v=s(40671),j=s(70217),k=s(51716);let w=Object.freeze({oauth:Object.freeze({id:"oauth",label:"OAuth",icon:"lock",description:"Connect through the provider sign-in flow."}),apikey:Object.freeze({id:"apikey",label:"API Key",icon:"key",description:"Connect with an API key or provider credential."}),cookie:Object.freeze({id:"cookie",label:"Browser Cookie",icon:"cookie",description:"Connect with a signed-in browser session cookie."}),"quota-cookie":Object.freeze({id:"quota-cookie",label:"Quota Cookie",icon:"cookie",description:"Attach a web session so Quota Tracker can read credits."})}),N=Object.freeze({codebuddy:Object.freeze(["quota-cookie"]),"codebuddy-cn":Object.freeze(["quota-cookie"]),iflow:Object.freeze(["cookie"])}),C=Object.freeze({qoder:Object.freeze({apikey:Object.freeze({label:"Qoder PAT"})}),"qoder-cn":Object.freeze({apikey:Object.freeze({label:"Qoder PAT"})}),xai:Object.freeze({oauth:Object.freeze({label:"Grok Build OAuth"}),apikey:Object.freeze({label:"xAI API Key"})}),kimi:Object.freeze({oauth:Object.freeze({label:"Kimi Coding OAuth"}),apikey:Object.freeze({label:"Kimi API Key"})}),muse:Object.freeze({oauth:Object.freeze({label:"OAuth"}),apikey:Object.freeze({label:"API Key"})}),"grok-cli":Object.freeze({oauth:Object.freeze({label:"Grok CLI Device Login"})})});function S(e,t){e.includes(t)||e.push(t)}var $=s(65921),A=s(7031),T=s(14051),O=s.n(T);function P({model:e,fullModel:t,alias:s,copied:r,onCopy:i,testStatus:n,isCustom:l,isFree:o,onDeleteAlias:d,onTest:c,isTesting:m,onDisable:u,thinkingSuffix:p}){let x="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0,h=p?`${t}(${p})`:t;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:x?{color:x}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:h}),e.name&&(0,a.jsx)("span",{className:"truncate pl-1 text-[9px] italic text-text-muted/70",children:e.name})]}),c&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:c,disabled:m,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${m?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:m?{animation:"spin 1s linear infinite"}:void 0,children:m?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:m?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(h,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:r===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:r===`model-${e.id}`?"Copied!":"Copy"})]}),l?(0,a.jsx)("button",{onClick:d,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,a.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function I({models:e,modelAliases:t,providerStorageAlias:s,providerDisplayAlias:a}){let r={...t||{}},i=new Set(Object.values(r)),n=[];for(let t of Array.isArray(e)?e:[]){let e=function(e){if(!e)return"";if("string"==typeof e)return e.trim();let t=e.id||e.name||e.model;return"string"==typeof t?t.trim():""}(t);if(!e)continue;let l=`${s}/${e}`;if(i.has(l))continue;let o=function(e,t,s){let a=e.split("/"),r=a[a.length-1];if(!r)return"";if(!t[r])return r;let i=`${s}-${r}`;if(!t[i])return i;let n=2;for(;t[`${i}-${n}`];)n+=1;return`${i}-${n}`}(e,r,a);o&&(n.push({alias:o,model:l,modelId:e}),r[o]=l,i.add(l))}return n}function z({modelId:e,fullModel:t,copied:s,onCopy:r,onDeleteAlias:i,onTest:n,testStatus:l,isTesting:o}){let d="ok"===l?"#22c55e":"error"===l?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>r(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),n&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:n,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:i,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function E({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,copied:i,onCopy:n,onSetAlias:l,onDeleteAlias:o,onAliasesChanged:c,connections:m,isAnthropic:u}){let[p,x]=(0,r.useState)(""),[h,b]=(0,r.useState)(!1),[f,g]=(0,r.useState)(!1),[y,v]=(0,r.useState)(()=>new Set),[j,k]=(0,r.useState)({}),w=async t=>{let s=`${e}/${t}`;v(e=>new Set(e).add(t));try{let e=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s})}),t=await e.json();k(e=>({...e,[s]:t.ok?"ok":"error"}))}catch{k(e=>({...e,[s]:"error"}))}finally{v(e=>{let s=new Set(e);return s.delete(t),s})}},N=Object.entries(s).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,s])=>({modelId:s.replace(`${e}/`,""),fullModel:s,alias:t})),C=async()=>{if(!p.trim()||h)return;let a=p.trim(),[r]=I({models:[{id:a}],modelAliases:s,providerStorageAlias:e,providerDisplayAlias:t});if(!r)return void alert("This model already exists.");b(!0);try{await l(a,r.alias,e),x("")}catch(e){console.log("Error adding model:",e),alert(e?.message||`Failed to add model "${a}".`)}finally{b(!1)}},S=async()=>{if(f)return;let a=m.find(e=>!1!==e.isActive);if(a){g(!0);try{let r=await fetch(`/api/providers/${a.id}/models`),i=await r.json();if(!r.ok)return void alert(i.error||"Failed to import models");let n=i.models||[];if(0===n.length)return void alert("No models returned from /models.");let l=I({models:n,modelAliases:s,providerStorageAlias:e,providerDisplayAlias:t});if(0===l.length)return void alert("No new models were added.");let o=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({aliases:l.map(({alias:e,model:t})=>({alias:e,model:t}))})}),d=await o.json();if(!o.ok)throw Error(d.error||"Failed to save imported models.");await c(),alert(`Successfully added ${d.count||l.length} models.`)}catch(e){console.log("Error importing models:",e),alert(e?.message||"Failed to import models from /models.")}finally{g(!1)}}},$=m.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:p,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&C(),placeholder:u?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:C,disabled:!p.trim()||h,children:h?"Adding...":"Add"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"download",onClick:S,disabled:!$||f,children:f?"Importing...":"Import from /models"})]}),!$&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),N.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-3",children:N.map(({modelId:s,fullModel:r,alias:l})=>(0,a.jsx)(z,{modelId:s,fullModel:`${t}/${s}`,copied:i,onCopy:n,onDeleteAlias:()=>o(l),onTest:m.length>0?()=>w(s):void 0,testStatus:j[`${e}/${s}`],isTesting:y.has(s)},r))})]})}P.propTypes={model:O().shape({id:O().string.isRequired}).isRequired,fullModel:O().string.isRequired,alias:O().string,copied:O().string,onCopy:O().func.isRequired,testStatus:O().oneOf(["ok","error"]),isCustom:O().bool,isFree:O().bool,onDeleteAlias:O().func,onTest:O().func,isTesting:O().bool,onDisable:O().func,thinkingSuffix:O().string},O().string.isRequired,O().string.isRequired,O().string,O().func.isRequired,O().func.isRequired,O().func,O().oneOf(["ok","error"]),O().bool,O().string.isRequired,O().object.isRequired,O().string,O().func.isRequired,O().func.isRequired,O().func.isRequired,E.propTypes={providerStorageAlias:O().string.isRequired,providerDisplayAlias:O().string.isRequired,modelAliases:O().object.isRequired,copied:O().string,onCopy:O().func.isRequired,onSetAlias:O().func.isRequired,onDeleteAlias:O().func.isRequired,onAliasesChanged:O().func.isRequired,connections:O().arrayOf(O().shape({id:O().string,isActive:O().bool})).isRequired,isAnthropic:O().bool};var R=s(47650),q=s(81277);function M({until:e}){let[t,s]=(0,r.useState)("");return((0,r.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime();if(!Number.isFinite(t))return void s("");let a=t-Date.now();if(a<=0)return void s("");let r=Math.floor(a/1e3);if(r<60)s(`${r}s`);else if(r<3600)s(`${Math.floor(r/60)}m ${r%60}s`);else{let e=Math.floor(r/3600),t=Math.floor(r%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}M.propTypes={until:O().string.isRequired};var D=s(22942);function _({connection:e,proxyPools:t,isOAuth:s,isFirst:i,isLast:n,onMoveUp:l,onMoveDown:o,onToggleActive:c,onUpdateProxy:m,onEdit:u,onDelete:p,autoPingEnabled:x=!1,onToggleAutoPing:h,autoPingScheduled:b=!1,onOpenAutoPingSchedule:f,onTogglePaid:g,oneByOneStatus:y=null}){let[v,k]=(0,r.useState)(!1),[w,N]=(0,r.useState)(null),C=(0,r.useRef)(null),[S,$]=(0,r.useState)(!1),A=(0,r.useRef)(null),T=(0,r.useMemo)(()=>new Map((t||[]).map(e=>[e.id,e])),[t]),O=(0,r.useMemo)(()=>t||[],[t]),P=e.providerSpecificData?.proxyPoolId||null,I=P?T.get(P):null,z=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,E=!!P||z,U=I?`Pool: ${I.name}`:P?`Pool: ${P} (inactive/missing)`:z?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",L="";if(I?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=I?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);L=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{L=t}}let K=I?.noProxy||e.providerSpecificData?.connectionNoProxy||"",F="default";I?.isActive===!0?F="success":(P||z)&&(F="error"),(0,r.useEffect)(()=>{if(!v)return;let e=e=>{A.current?.contains(e.target)||C.current?.contains(e.target)||k(!1)},t=()=>k(!1);return document.addEventListener("mousedown",e),window.addEventListener("resize",t),document.addEventListener("scroll",t,!0),()=>{document.removeEventListener("mousedown",e),window.removeEventListener("resize",t),document.removeEventListener("scroll",t,!0)}},[v]);let B=async e=>{$(!0);try{await m("__none__"===e?null:e)}finally{$(!1),k(!1)}},J=e.authType||(s?"oauth":"apikey"),H="oauth"===J,W="cookie"===J,G=e=>"string"==typeof e&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),V=H?G(e.email)?e.email:G(e.name)?e.name:e.name||e.email||e.displayName||"OAuth Account":e.name||e.email||e.displayName||"API Key",Q=(0,q.c)(e),Z=null!==Q,Y="unavailable"!==e.testStatus||Z?e.testStatus:"active",X=(0,j.d4)(e),ee=!!e.quarantinedAt,et={policy_suspended:"Policy suspension",account_validation_required:"Account verification required",credential_rejected:"Credential rejected",reauth_required:"Sign-in required",authentication:"Repeated authentication failure"}[e.failureClass]||e.quarantineReason||"Account quarantined",es=Number.isFinite(Date.parse(e.quarantinedAt))?new Date(e.quarantinedAt).toLocaleString():e.quarantinedAt||null,ea=e.modelLockReason?.resetsAt,er=Number.isFinite(Date.parse(ea))?new Date(ea).toLocaleString():ea||null,ei=()=>y?"queued"===y.state?"queued":"testing"===y.state?"testing":"success"===y.state?y.error?`connected: ${y.error}`:"success":"failed"===y.state?y.error?`failed: ${y.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive&&!ee?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:l,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:o,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:W?"cookie":H?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:V}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(d.Ex,{variant:(()=>{if(!1===e.isActive)return"default";let t=(0,j.BU)(X);return"active"!==X.key?t:"active"===Y||"success"===Y?"success":"error"===Y||"expired"===Y||"unavailable"===Y?"error":"default"})(),size:"sm",dot:!0,children:X.label||Y||"unknown"}),(0,a.jsx)(d.Ex,{variant:"default",size:"sm",children:H?"OAuth":W?"Cookie":"API Key"}),ee&&(0,a.jsx)(d.Ex,{variant:"error",size:"sm",children:"Quarantined"}),E&&(0,a.jsx)(d.Ex,{variant:F,size:"sm",children:"Proxy"}),e.autoDisabledAt&&!ee&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["token_expired"===e.autoDisabledReason?"Token expired":"banned"===e.autoDisabledReason?"Banned":"quota_exhausted"===e.autoDisabledReason?"Quota exhausted":"Auto-disabled"," — ",new Date(e.autoDisabledAt).toLocaleDateString()]}),ee&&(0,a.jsxs)("span",{className:"max-w-full truncate text-xs text-red-600 dark:text-red-400 sm:max-w-[420px]",title:`${e.quarantineReason||et}${es?` - ${es}`:""}`,children:[et,es?` - ${es}`:""]}),Z&&!1!==e.isActive&&(0,a.jsx)(M,{until:Q}),Z&&e.modelLockReason&&!1!==e.isActive&&(0,a.jsxs)("span",{className:"max-w-full truncate text-xs text-amber-600 dark:text-amber-400 sm:max-w-[360px]",title:`${e.modelLockReason.reason}${er?` — resets ${er}`:""}`,children:[e.modelLockReason.model,e.modelLockReason.providerErrorCode?` (${e.modelLockReason.providerErrorCode})`:"",er?` — resets ${er}`:""]}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),ei()&&(0,a.jsx)(d.Ex,{variant:y?"success"===y.state?"success":"failed"===y.state?"error":"testing"===y.state?"primary":"default":"default",size:"sm",children:ei()})]}),E&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:U,children:U}),L&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:L}),K&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:K,children:["no_proxy: ",K]})]}),ee&&!1===e.isActive&&(0,a.jsx)("p",{className:"mt-1 text-[11px] leading-relaxed text-text-muted",children:"Re-enable only permits router requests again; it does not change the account's upstream status."})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[O.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{ref:C,type:"button",onClick:()=>{if(v)return void k(!1);let e=C.current?.getBoundingClientRect();e&&N((0,D.x)(e,O.length,{width:window.innerWidth,height:window.innerHeight})),k(!0)},className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${E?"text-primary":"text-text-muted hover:text-primary"}`,disabled:S,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:S?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),v&&"u">typeof document&&(0,R.createPortal)((0,a.jsxs)("div",{ref:A,style:w,className:"z-50 max-w-[78vw] min-w-[160px] overflow-y-auto rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,a.jsx)("button",{onClick:()=>B("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!P?"text-primary font-medium":"text-text-main"}`,children:"None"}),O.map(e=>(0,a.jsx)("button",{onClick:()=>B(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${P===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]}),document.body)]}),g&&(0,a.jsxs)("button",{type:"button",onClick:()=>g(e.providerSpecificData?.paidSubscription!==!0),"aria-pressed":e.providerSpecificData?.paidSubscription===!0,className:`flex flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${e.providerSpecificData?.paidSubscription===!0?"text-primary":"text-text-muted hover:text-primary"}`,title:"Paid subscription: may serve Argon and Claude 5.5 when Google's quota data doesn't say",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"workspace_premium"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Paid"})]}),h&&(0,a.jsxs)("button",{onClick:()=>h(!x),className:`flex flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${x?"text-primary":"text-text-muted hover:text-primary"}`,title:x?"Disable quota auto-ping for this account":"Warm the 5-hour quota window after reset with a tiny request",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]}),f&&(0,a.jsxs)("button",{type:"button",onClick:f,className:`flex flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${b?"text-primary":"text-text-muted hover:text-primary"}`,title:"Ping at fixed local times",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"schedule"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Schedule"})]}),(0,a.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(d.lM,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":ee?"Re-enable routing only; upstream suspension or credential status is unchanged":"Enable connection"})]})]})}_.propTypes={connection:O().shape({id:O().string,name:O().string,email:O().string,displayName:O().string,modelLockUntil:O().string,testStatus:O().string,isActive:O().bool,lastError:O().string,failureClass:O().string,quarantinedAt:O().string,quarantineReason:O().string,priority:O().number,globalPriority:O().number}).isRequired,proxyPools:O().arrayOf(O().shape({id:O().string,name:O().string,proxyUrl:O().string,noProxy:O().string,isActive:O().bool})),isOAuth:O().bool.isRequired,isFirst:O().bool.isRequired,isLast:O().bool.isRequired,onMoveUp:O().func.isRequired,onMoveDown:O().func.isRequired,onToggleActive:O().func.isRequired,onUpdateProxy:O().func,autoPingEnabled:O().bool,onToggleAutoPing:O().func,autoPingScheduled:O().bool,onOpenAutoPingSchedule:O().func,onTogglePaid:O().func,onEdit:O().func.isRequired,onDelete:O().func.isRequired,oneByOneStatus:O().shape({state:O().string,error:O().string})};var U=s(31474);function L(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}let K={anchor:"09:30",timezone:L(),windowHours:5,slotsPerDay:3};function F(e){let t=/^(\d{1,2}):(\d{2})$/.exec(String(e||"").trim());if(!t)return null;let s=Number(t[1]),a=Number(t[2]);return s>23||a>59?null:{hour:s,minute:a}}function B(e){return Math.max(1,Math.floor(24/e))}function J(e,t,s,a){let r="number"==typeof e?e:Number(e);return Number.isFinite(r)?Math.min(a,Math.max(s,r)):t}let H=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function W({isOpen:e,onClose:t,onSave:s,connection:i,reactive:n=!1,schedule:l=null}){let[o,c]=(0,r.useState)(()=>({mode:l?.enabled===!0?"schedule":!0===n?"reset":"off",anchor:l?.anchor||K.anchor,timezone:L(),windowHours:String(l?.windowHours??K.windowHours),slotsPerDay:String(l?.slotsPerDay??K.slotsPerDay)})),m=Number(o.windowHours),u=Number(o.slotsPerDay),p=!!F(o.anchor),x=Number.isFinite(m)&&m>=.5&&m<=24,h=x?B(m):24,b=Number.isInteger(u)&&u>=1&&u<=h,f="schedule"!==o.mode||p&&x&&b,g=p&&x&&b?function(e){let t=function(e){if(!e||!0!==e.enabled)return null;let t=F(e.anchor)||F(K.anchor),s=`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}`,a=!function(e){if(!e||"string"!=typeof e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return!1}}(e.timezone)?K.timezone:e.timezone,r=J(e.windowHours,K.windowHours,.5,24),i=Math.round(J(e.slotsPerDay,K.slotsPerDay,1,B(r)));return{enabled:!0,anchor:s,timezone:a,windowHours:r,slotsPerDay:i}}(e);if(!t)return[];let{hour:s,minute:a}=F(t.anchor),r=60*s+a;return Array.from({length:t.slotsPerDay},(e,s)=>{let a=Math.round(r+s*t.windowHours*60)%1440;return`${String(Math.floor(a/60)).padStart(2,"0")}:${String(a%60).padStart(2,"0")}`})}({enabled:!0,...o,windowHours:m,slotsPerDay:u}):[],y=g.length?(()=>{let{hour:e,minute:t}=F(o.anchor),s=Math.round(60*e+t+u*m*60)%1440;return`${String(Math.floor(s/60)).padStart(2,"0")}:${String(s%60).padStart(2,"0")}`})():"";return(0,a.jsx)(d.aF,{isOpen:e,onClose:t,title:"Auto-ping settings",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{variant:"secondary",onClick:t,children:"Cancel"}),(0,a.jsx)(d.$n,{onClick:()=>{f&&(s({reactive:"reset"===o.mode,schedule:"schedule"===o.mode?{enabled:!0,anchor:o.anchor,timezone:o.timezone,windowHours:m,slotsPerDay:u}:{enabled:!1}}),t())},disabled:!f,children:"Save"})]}),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Warm the 5-hour window",i?.name?` for ${i.name}`:"",". Pick one mode."]}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-lg bg-black/[0.03] p-1 dark:bg-white/[0.03]",children:H.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>c(t=>({...t,mode:e.value})),className:(0,U.cn)("flex h-9 items-center justify-center gap-1.5 rounded-md text-sm font-medium",o.mode===e.value?"bg-surface text-text-main":"text-text-muted"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:e.icon}),e.label]},e.value))}),"reset"===o.mode&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pings once after the window resets."}),"schedule"===o.mode&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,a.jsx)(d.pd,{label:"Anchor time",type:"time",value:o.anchor,onChange:e=>c(t=>({...t,anchor:e.target.value})),error:p?"":"Use HH:MM"}),(0,a.jsx)(d.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:o.windowHours,onChange:e=>c(t=>({...t,windowHours:e.target.value})),error:x?"":"0.5 – 24"}),(0,a.jsx)(d.pd,{label:"Pings per day",type:"number",min:"1",max:String(h),step:"1",value:o.slotsPerDay,onChange:e=>c(t=>({...t,slotsPerDay:e.target.value})),error:b?"":`1 – ${h}`})]}),g.length>0&&(0,a.jsxs)("p",{className:"text-sm text-text-main",children:[g.join(" → ")," (",o.timezone,"). Covers until ",y,"."]})]})]})})}W.propTypes={isOpen:O().bool.isRequired,onClose:O().func.isRequired,onSave:O().func.isRequired,connection:O().object,reactive:O().bool,schedule:O().object};var G=s(28915),V=s(33315);let Q=`name1|sk-key1
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{28915:(e,t,s)=>{"use strict";s.d(t,{x6:()=>a.fetchJson,E2:()=>r,gs:()=>i});var a=s(68211);function r(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}function i(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}},65219:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>eY});var a=s(95155),r=s(12115),i=s(73321),n=s(98500),l=s.n(n),o=s(5772),d=s(35497),c=s(1791);let m=["kiro","codebuddy","codebuddy-cn","qoder","antigravity","cloudflare-ai","grok-cli"];function u(e){return m.includes(String(e||""))}function p(e){let t=String(e||"").trim();return t&&u(t)?`/dashboard/automation?provider=${encodeURIComponent(t)}`:"/dashboard/automation"}var x=s(28777),h=s(11059),b=s(73006);let f=new Map;async function g(e){if(!e?.url||!e?.type)return[];let t=f.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let a=(await s.json()).data??[];return f.set(e.url,{data:a,expiresAt:Date.now()+6e5}),a}catch{return[]}}var y=s(12252),v=s(40671),j=s(70217),k=s(51716);let w=Object.freeze({oauth:Object.freeze({id:"oauth",label:"OAuth",icon:"lock",description:"Connect through the provider sign-in flow."}),apikey:Object.freeze({id:"apikey",label:"API Key",icon:"key",description:"Connect with an API key or provider credential."}),cookie:Object.freeze({id:"cookie",label:"Browser Cookie",icon:"cookie",description:"Connect with a signed-in browser session cookie."}),"quota-cookie":Object.freeze({id:"quota-cookie",label:"Quota Cookie",icon:"cookie",description:"Attach a web session so Quota Tracker can read credits."})}),N=Object.freeze({codebuddy:Object.freeze(["quota-cookie"]),"codebuddy-cn":Object.freeze(["quota-cookie"]),iflow:Object.freeze(["cookie"])}),C=Object.freeze({qoder:Object.freeze({apikey:Object.freeze({label:"Qoder PAT"})}),"qoder-cn":Object.freeze({apikey:Object.freeze({label:"Qoder PAT"})}),xai:Object.freeze({oauth:Object.freeze({label:"Grok Build OAuth"}),apikey:Object.freeze({label:"xAI API Key"})}),kimi:Object.freeze({oauth:Object.freeze({label:"Kimi Coding OAuth"}),apikey:Object.freeze({label:"Kimi API Key"})}),muse:Object.freeze({oauth:Object.freeze({label:"OAuth"}),apikey:Object.freeze({label:"API Key"})}),"grok-cli":Object.freeze({oauth:Object.freeze({label:"Grok CLI Device Login"})})});function S(e,t){e.includes(t)||e.push(t)}var $=s(65921),A=s(7031),T=s(14051),O=s.n(T);function P({model:e,fullModel:t,alias:s,copied:r,onCopy:i,testStatus:n,isCustom:l,isFree:o,onDeleteAlias:d,onTest:c,isTesting:m,onDisable:u,thinkingSuffix:p}){let x="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0,h=p?`${t}(${p})`:t;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:x?{color:x}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:h}),e.name&&(0,a.jsx)("span",{className:"truncate pl-1 text-[9px] italic text-text-muted/70",children:e.name})]}),c&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:c,disabled:m,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${m?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:m?{animation:"spin 1s linear infinite"}:void 0,children:m?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:m?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(h,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:r===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:r===`model-${e.id}`?"Copied!":"Copy"})]}),l?(0,a.jsx)("button",{onClick:d,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,a.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function I({models:e,modelAliases:t,providerStorageAlias:s,providerDisplayAlias:a}){let r={...t||{}},i=new Set(Object.values(r)),n=[];for(let t of Array.isArray(e)?e:[]){let e=function(e){if(!e)return"";if("string"==typeof e)return e.trim();let t=e.id||e.name||e.model;return"string"==typeof t?t.trim():""}(t);if(!e)continue;let l=`${s}/${e}`;if(i.has(l))continue;let o=function(e,t,s){let a=e.split("/"),r=a[a.length-1];if(!r)return"";if(!t[r])return r;let i=`${s}-${r}`;if(!t[i])return i;let n=2;for(;t[`${i}-${n}`];)n+=1;return`${i}-${n}`}(e,r,a);o&&(n.push({alias:o,model:l,modelId:e}),r[o]=l,i.add(l))}return n}function z({modelId:e,fullModel:t,copied:s,onCopy:r,onDeleteAlias:i,onTest:n,testStatus:l,isTesting:o}){let d="ok"===l?"#22c55e":"error"===l?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>r(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),n&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:n,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:i,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function E({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,copied:i,onCopy:n,onSetAlias:l,onDeleteAlias:o,onAliasesChanged:c,connections:m,isAnthropic:u}){let[p,x]=(0,r.useState)(""),[h,b]=(0,r.useState)(!1),[f,g]=(0,r.useState)(!1),[y,v]=(0,r.useState)(()=>new Set),[j,k]=(0,r.useState)({}),w=async t=>{let s=`${e}/${t}`;v(e=>new Set(e).add(t));try{let e=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s})}),t=await e.json();k(e=>({...e,[s]:t.ok?"ok":"error"}))}catch{k(e=>({...e,[s]:"error"}))}finally{v(e=>{let s=new Set(e);return s.delete(t),s})}},N=Object.entries(s).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,s])=>({modelId:s.replace(`${e}/`,""),fullModel:s,alias:t})),C=async()=>{if(!p.trim()||h)return;let a=p.trim(),[r]=I({models:[{id:a}],modelAliases:s,providerStorageAlias:e,providerDisplayAlias:t});if(!r)return void alert("This model already exists.");b(!0);try{await l(a,r.alias,e),x("")}catch(e){console.log("Error adding model:",e),alert(e?.message||`Failed to add model "${a}".`)}finally{b(!1)}},S=async()=>{if(f)return;let a=m.find(e=>!1!==e.isActive);if(a){g(!0);try{let r=await fetch(`/api/providers/${a.id}/models`),i=await r.json();if(!r.ok)return void alert(i.error||"Failed to import models");let n=i.models||[];if(0===n.length)return void alert("No models returned from /models.");let l=I({models:n,modelAliases:s,providerStorageAlias:e,providerDisplayAlias:t});if(0===l.length)return void alert("No new models were added.");let o=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({aliases:l.map(({alias:e,model:t})=>({alias:e,model:t}))})}),d=await o.json();if(!o.ok)throw Error(d.error||"Failed to save imported models.");await c(),alert(`Successfully added ${d.count||l.length} models.`)}catch(e){console.log("Error importing models:",e),alert(e?.message||"Failed to import models from /models.")}finally{g(!1)}}},$=m.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:p,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&C(),placeholder:u?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:C,disabled:!p.trim()||h,children:h?"Adding...":"Add"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"download",onClick:S,disabled:!$||f,children:f?"Importing...":"Import from /models"})]}),!$&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),N.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-3",children:N.map(({modelId:s,fullModel:r,alias:l})=>(0,a.jsx)(z,{modelId:s,fullModel:`${t}/${s}`,copied:i,onCopy:n,onDeleteAlias:()=>o(l),onTest:m.length>0?()=>w(s):void 0,testStatus:j[`${e}/${s}`],isTesting:y.has(s)},r))})]})}P.propTypes={model:O().shape({id:O().string.isRequired}).isRequired,fullModel:O().string.isRequired,alias:O().string,copied:O().string,onCopy:O().func.isRequired,testStatus:O().oneOf(["ok","error"]),isCustom:O().bool,isFree:O().bool,onDeleteAlias:O().func,onTest:O().func,isTesting:O().bool,onDisable:O().func,thinkingSuffix:O().string},O().string.isRequired,O().string.isRequired,O().string,O().func.isRequired,O().func.isRequired,O().func,O().oneOf(["ok","error"]),O().bool,O().string.isRequired,O().object.isRequired,O().string,O().func.isRequired,O().func.isRequired,O().func.isRequired,E.propTypes={providerStorageAlias:O().string.isRequired,providerDisplayAlias:O().string.isRequired,modelAliases:O().object.isRequired,copied:O().string,onCopy:O().func.isRequired,onSetAlias:O().func.isRequired,onDeleteAlias:O().func.isRequired,onAliasesChanged:O().func.isRequired,connections:O().arrayOf(O().shape({id:O().string,isActive:O().bool})).isRequired,isAnthropic:O().bool};var R=s(47650),q=s(81277);function M({until:e}){let[t,s]=(0,r.useState)("");return((0,r.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime();if(!Number.isFinite(t))return void s("");let a=t-Date.now();if(a<=0)return void s("");let r=Math.floor(a/1e3);if(r<60)s(`${r}s`);else if(r<3600)s(`${Math.floor(r/60)}m ${r%60}s`);else{let e=Math.floor(r/3600),t=Math.floor(r%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}M.propTypes={until:O().string.isRequired};var D=s(22942);function _({connection:e,proxyPools:t,isOAuth:s,isFirst:i,isLast:n,onMoveUp:l,onMoveDown:o,onToggleActive:c,onUpdateProxy:m,onEdit:u,onDelete:p,autoPingEnabled:x=!1,onToggleAutoPing:h,autoPingScheduled:b=!1,onOpenAutoPingSchedule:f,onTogglePaid:g,oneByOneStatus:y=null}){let[v,k]=(0,r.useState)(!1),[w,N]=(0,r.useState)(null),C=(0,r.useRef)(null),[S,$]=(0,r.useState)(!1),A=(0,r.useRef)(null),T=(0,r.useMemo)(()=>new Map((t||[]).map(e=>[e.id,e])),[t]),O=(0,r.useMemo)(()=>t||[],[t]),P=e.providerSpecificData?.proxyPoolId||null,I=P?T.get(P):null,z=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,E=!!P||z,U=I?`Pool: ${I.name}`:P?`Pool: ${P} (inactive/missing)`:z?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",L="";if(I?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=I?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);L=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{L=t}}let K=I?.noProxy||e.providerSpecificData?.connectionNoProxy||"",F="default";I?.isActive===!0?F="success":(P||z)&&(F="error"),(0,r.useEffect)(()=>{if(!v)return;let e=e=>{A.current?.contains(e.target)||C.current?.contains(e.target)||k(!1)},t=()=>k(!1);return document.addEventListener("mousedown",e),window.addEventListener("resize",t),document.addEventListener("scroll",t,!0),()=>{document.removeEventListener("mousedown",e),window.removeEventListener("resize",t),document.removeEventListener("scroll",t,!0)}},[v]);let B=async e=>{$(!0);try{await m("__none__"===e?null:e)}finally{$(!1),k(!1)}},J=e.authType||(s?"oauth":"apikey"),H="oauth"===J,W="cookie"===J,G=e=>"string"==typeof e&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),V=H?G(e.email)?e.email:G(e.name)?e.name:e.name||e.email||e.displayName||"OAuth Account":e.name||e.email||e.displayName||"API Key",Q=(0,q.c)(e),Z=null!==Q,Y="unavailable"!==e.testStatus||Z?e.testStatus:"active",X=(0,j.d4)(e),ee=!!e.quarantinedAt,et={policy_suspended:"Policy suspension",tos_violation:"Terms of Service violation",account_validation_required:"Account verification required",credential_rejected:"Credential rejected",reauth_required:"Sign-in required",authentication:"Repeated authentication failure"}[e.failureClass]||e.quarantineReason||"Account quarantined",es=Number.isFinite(Date.parse(e.quarantinedAt))?new Date(e.quarantinedAt).toLocaleString():e.quarantinedAt||null,ea=e.modelLockReason?.resetsAt,er=Number.isFinite(Date.parse(ea))?new Date(ea).toLocaleString():ea||null,ei=()=>y?"queued"===y.state?"queued":"testing"===y.state?"testing":"success"===y.state?y.error?`connected: ${y.error}`:"success":"failed"===y.state?y.error?`failed: ${y.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive&&!ee?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:l,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:o,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:W?"cookie":H?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:V}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(d.Ex,{variant:(()=>{if(!1===e.isActive)return"default";let t=(0,j.BU)(X);return"active"!==X.key?t:"active"===Y||"success"===Y?"success":"error"===Y||"expired"===Y||"unavailable"===Y?"error":"default"})(),size:"sm",dot:!0,children:X.label||Y||"unknown"}),(0,a.jsx)(d.Ex,{variant:"default",size:"sm",children:H?"OAuth":W?"Cookie":"API Key"}),ee&&(0,a.jsx)(d.Ex,{variant:"error",size:"sm",children:"Quarantined"}),E&&(0,a.jsx)(d.Ex,{variant:F,size:"sm",children:"Proxy"}),e.autoDisabledAt&&!ee&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["token_expired"===e.autoDisabledReason?"Token expired":"banned"===e.autoDisabledReason?"Banned":"quota_exhausted"===e.autoDisabledReason?"Quota exhausted":"Auto-disabled"," — ",new Date(e.autoDisabledAt).toLocaleDateString()]}),ee&&(0,a.jsxs)("span",{className:"max-w-full truncate text-xs text-red-600 dark:text-red-400 sm:max-w-[420px]",title:`${e.quarantineReason||et}${es?` - ${es}`:""}`,children:[et,es?` - ${es}`:""]}),Z&&!1!==e.isActive&&(0,a.jsx)(M,{until:Q}),Z&&e.modelLockReason&&!1!==e.isActive&&(0,a.jsxs)("span",{className:"max-w-full truncate text-xs text-amber-600 dark:text-amber-400 sm:max-w-[360px]",title:`${e.modelLockReason.reason}${er?` — resets ${er}`:""}`,children:[e.modelLockReason.model,e.modelLockReason.providerErrorCode?` (${e.modelLockReason.providerErrorCode})`:"",er?` — resets ${er}`:""]}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),ei()&&(0,a.jsx)(d.Ex,{variant:y?"success"===y.state?"success":"failed"===y.state?"error":"testing"===y.state?"primary":"default":"default",size:"sm",children:ei()})]}),E&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:U,children:U}),L&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:L}),K&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:K,children:["no_proxy: ",K]})]}),ee&&!1===e.isActive&&(0,a.jsx)("p",{className:"mt-1 text-[11px] leading-relaxed text-text-muted",children:"Re-enable only permits router requests again; it does not change the account's upstream status."})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[O.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{ref:C,type:"button",onClick:()=>{if(v)return void k(!1);let e=C.current?.getBoundingClientRect();e&&N((0,D.x)(e,O.length,{width:window.innerWidth,height:window.innerHeight})),k(!0)},className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${E?"text-primary":"text-text-muted hover:text-primary"}`,disabled:S,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:S?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),v&&"u">typeof document&&(0,R.createPortal)((0,a.jsxs)("div",{ref:A,style:w,className:"z-50 max-w-[78vw] min-w-[160px] overflow-y-auto rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,a.jsx)("button",{onClick:()=>B("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!P?"text-primary font-medium":"text-text-main"}`,children:"None"}),O.map(e=>(0,a.jsx)("button",{onClick:()=>B(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${P===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]}),document.body)]}),g&&(0,a.jsxs)("button",{type:"button",onClick:()=>g(e.providerSpecificData?.paidSubscription!==!0),"aria-pressed":e.providerSpecificData?.paidSubscription===!0,className:`flex flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${e.providerSpecificData?.paidSubscription===!0?"text-primary":"text-text-muted hover:text-primary"}`,title:"Paid subscription: may serve Argon and Claude 5.5 when Google's quota data doesn't say",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"workspace_premium"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Paid"})]}),h&&(0,a.jsxs)("button",{onClick:()=>h(!x),className:`flex flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${x?"text-primary":"text-text-muted hover:text-primary"}`,title:x?"Disable quota auto-ping for this account":"Warm the 5-hour quota window after reset with a tiny request",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]}),f&&(0,a.jsxs)("button",{type:"button",onClick:f,className:`flex flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${b?"text-primary":"text-text-muted hover:text-primary"}`,title:"Ping at fixed local times",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"schedule"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Schedule"})]}),(0,a.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(d.lM,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":ee?"Re-enable routing only; upstream suspension or credential status is unchanged":"Enable connection"})]})]})}_.propTypes={connection:O().shape({id:O().string,name:O().string,email:O().string,displayName:O().string,modelLockUntil:O().string,testStatus:O().string,isActive:O().bool,lastError:O().string,failureClass:O().string,quarantinedAt:O().string,quarantineReason:O().string,priority:O().number,globalPriority:O().number}).isRequired,proxyPools:O().arrayOf(O().shape({id:O().string,name:O().string,proxyUrl:O().string,noProxy:O().string,isActive:O().bool})),isOAuth:O().bool.isRequired,isFirst:O().bool.isRequired,isLast:O().bool.isRequired,onMoveUp:O().func.isRequired,onMoveDown:O().func.isRequired,onToggleActive:O().func.isRequired,onUpdateProxy:O().func,autoPingEnabled:O().bool,onToggleAutoPing:O().func,autoPingScheduled:O().bool,onOpenAutoPingSchedule:O().func,onTogglePaid:O().func,onEdit:O().func.isRequired,onDelete:O().func.isRequired,oneByOneStatus:O().shape({state:O().string,error:O().string})};var U=s(31474);function L(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}let K={anchor:"09:30",timezone:L(),windowHours:5,slotsPerDay:3};function F(e){let t=/^(\d{1,2}):(\d{2})$/.exec(String(e||"").trim());if(!t)return null;let s=Number(t[1]),a=Number(t[2]);return s>23||a>59?null:{hour:s,minute:a}}function B(e){return Math.max(1,Math.floor(24/e))}function J(e,t,s,a){let r="number"==typeof e?e:Number(e);return Number.isFinite(r)?Math.min(a,Math.max(s,r)):t}let H=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function W({isOpen:e,onClose:t,onSave:s,connection:i,reactive:n=!1,schedule:l=null}){let[o,c]=(0,r.useState)(()=>({mode:l?.enabled===!0?"schedule":!0===n?"reset":"off",anchor:l?.anchor||K.anchor,timezone:L(),windowHours:String(l?.windowHours??K.windowHours),slotsPerDay:String(l?.slotsPerDay??K.slotsPerDay)})),m=Number(o.windowHours),u=Number(o.slotsPerDay),p=!!F(o.anchor),x=Number.isFinite(m)&&m>=.5&&m<=24,h=x?B(m):24,b=Number.isInteger(u)&&u>=1&&u<=h,f="schedule"!==o.mode||p&&x&&b,g=p&&x&&b?function(e){let t=function(e){if(!e||!0!==e.enabled)return null;let t=F(e.anchor)||F(K.anchor),s=`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}`,a=!function(e){if(!e||"string"!=typeof e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return!1}}(e.timezone)?K.timezone:e.timezone,r=J(e.windowHours,K.windowHours,.5,24),i=Math.round(J(e.slotsPerDay,K.slotsPerDay,1,B(r)));return{enabled:!0,anchor:s,timezone:a,windowHours:r,slotsPerDay:i}}(e);if(!t)return[];let{hour:s,minute:a}=F(t.anchor),r=60*s+a;return Array.from({length:t.slotsPerDay},(e,s)=>{let a=Math.round(r+s*t.windowHours*60)%1440;return`${String(Math.floor(a/60)).padStart(2,"0")}:${String(a%60).padStart(2,"0")}`})}({enabled:!0,...o,windowHours:m,slotsPerDay:u}):[],y=g.length?(()=>{let{hour:e,minute:t}=F(o.anchor),s=Math.round(60*e+t+u*m*60)%1440;return`${String(Math.floor(s/60)).padStart(2,"0")}:${String(s%60).padStart(2,"0")}`})():"";return(0,a.jsx)(d.aF,{isOpen:e,onClose:t,title:"Auto-ping settings",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{variant:"secondary",onClick:t,children:"Cancel"}),(0,a.jsx)(d.$n,{onClick:()=>{f&&(s({reactive:"reset"===o.mode,schedule:"schedule"===o.mode?{enabled:!0,anchor:o.anchor,timezone:o.timezone,windowHours:m,slotsPerDay:u}:{enabled:!1}}),t())},disabled:!f,children:"Save"})]}),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Warm the 5-hour window",i?.name?` for ${i.name}`:"",". Pick one mode."]}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-lg bg-black/[0.03] p-1 dark:bg-white/[0.03]",children:H.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>c(t=>({...t,mode:e.value})),className:(0,U.cn)("flex h-9 items-center justify-center gap-1.5 rounded-md text-sm font-medium",o.mode===e.value?"bg-surface text-text-main":"text-text-muted"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:e.icon}),e.label]},e.value))}),"reset"===o.mode&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pings once after the window resets."}),"schedule"===o.mode&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,a.jsx)(d.pd,{label:"Anchor time",type:"time",value:o.anchor,onChange:e=>c(t=>({...t,anchor:e.target.value})),error:p?"":"Use HH:MM"}),(0,a.jsx)(d.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:o.windowHours,onChange:e=>c(t=>({...t,windowHours:e.target.value})),error:x?"":"0.5 – 24"}),(0,a.jsx)(d.pd,{label:"Pings per day",type:"number",min:"1",max:String(h),step:"1",value:o.slotsPerDay,onChange:e=>c(t=>({...t,slotsPerDay:e.target.value})),error:b?"":`1 – ${h}`})]}),g.length>0&&(0,a.jsxs)("p",{className:"text-sm text-text-main",children:[g.join(" → ")," (",o.timezone,"). Covers until ",y,"."]})]})]})})}W.propTypes={isOpen:O().bool.isRequired,onClose:O().func.isRequired,onSave:O().func.isRequired,connection:O().object,reactive:O().bool,schedule:O().object};var G=s(28915),V=s(33315);let Q=`name1|sk-key1
|
|
2
2
|
name2|sk-key2
|
|
3
3
|
sk-key-only-auto-named`;function Z({isOpen:e,provider:t,providerName:s,isCompatible:i,isAnthropic:n,authType:l,authHint:o,website:m,proxyPools:u,existingNames:p=[],error:x,onSave:h,onBulkDone:b,onClose:f}){let g="__none__",y="ollama-local"===t,v="flow"===t,j="cookie"===l,k="xai"===t&&!j,w="aws-polly"===t,N="qoder"===t||"qoder-cn"===t,C="bedrock"===t||"bedrock-xai"===t,S="aistudio"===t,$=w||C?"Secret Access Key":v?"Daemon token":S?"Storage state JSON":j?"Cookie Value":N?"Personal Access Token (PAT)":"API Key",A=S?'{"cookies":[...],"origins":[...]}':j?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":k?"xai-...":N?"pt-...":"",T="azure"===t,O="cloudflare-ai"===t,P=c.Q2?.[t]?.regions||null,I=c.Q2?.[t]?.defaultRegion||P?.[0]?.id||"",[z,E]=(0,r.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:g,ollamaHostUrl:"",flowProfile:"",flowBaseUrl:"http://127.0.0.1:8077/mcp",flowI2vReady:!1}),[R,q]=(0,r.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[M,D]=(0,r.useState)({accountId:""}),[_,U]=(0,r.useState)({accessKeyId:"",region:""}),[L,K]=(0,r.useState)({accessKeyId:"",region:"",sessionToken:""}),[F,B]=(0,r.useState)(I),[J,H]=(0,r.useState)(!1),[W,Y]=(0,r.useState)(null),[X,ee]=(0,r.useState)(""),[et,es]=(0,r.useState)(null),[ea,er]=(0,r.useState)(!1),[ei,en]=(0,r.useState)("single"),[el,eo]=(0,r.useState)(""),[ed,ec]=(0,r.useState)(null),em=(0,r.useRef)(!1);(0,r.useEffect)(()=>{e&&!em.current&&(E({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:g,ollamaHostUrl:"",flowProfile:"",flowBaseUrl:"http://127.0.0.1:8077/mcp",flowI2vReady:!1}),q({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),D({accountId:""}),U({accessKeyId:"",region:""}),K({accessKeyId:"",region:"",sessionToken:""}),B(I),Y(null),es(null),en("single"),eo(""),ec(null)),em.current=e},[e]);let eu=()=>{if(y&&z.ollamaHostUrl.trim())return{baseUrl:z.ollamaHostUrl.trim()};if(v)return{profile:z.flowProfile.trim(),baseUrl:z.flowBaseUrl.trim()||"http://127.0.0.1:8077/mcp",i2vReady:z.flowI2vReady};if(T)return{azureEndpoint:R.azureEndpoint,apiVersion:R.apiVersion,deployment:R.deployment,organization:R.organization};if(O)return{accountId:M.accountId};if(w){let e={accessKeyId:_.accessKeyId.trim()};return _.region.trim()&&(e.region=_.region.trim()),e}if(C){let e={accessKeyId:L.accessKeyId.trim()};return L.region.trim()&&(e.region=L.region.trim()),L.sessionToken.trim()&&(e.sessionToken=L.sessionToken.trim()),e}if(P&&F)return{region:F}},ep=async()=>{H(!0);try{let e=await (0,G.x6)("/api/providers/validate",{method:"POST",body:{provider:t,apiKey:z.apiKey,providerSpecificData:eu()}});Y(e.valid?"success":"failed"),ee(e.valid?"":(0,V.o)(e.error,z.apiKey)),es(e.valid&&e.details||null)}catch{ee(""),Y("unknown")}finally{H(!1)}},ex=async()=>{if(t&&(y||z.apiKey)&&(!v||z.flowProfile.trim())&&(y||z.name)&&(!i||z.defaultModel.trim())){er(!0);try{let e=!1,s=null;try{H(!0),Y(null);let a=await (0,G.x6)("/api/providers/validate",{method:"POST",body:{provider:t,apiKey:z.apiKey,providerSpecificData:eu()}});e=!!a.valid,Y(e?"success":"failed"),ee(e?"":(0,V.o)(a.error,z.apiKey)),s=e&&a.details||null,es(s)}catch{ee(""),Y("unknown")}finally{H(!1)}let a=Number.parseInt(z.priority,10);await h({name:z.name||(y?"Ollama Local":""),apiKey:z.apiKey,defaultModel:i?z.defaultModel.trim():void 0,priority:Number.isFinite(a)?a:1,proxyPoolId:v||z.proxyPoolId===g?null:z.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:S&&s?.catalog?{...eu()||{},aistudioCatalog:s.catalog}:eu()})}finally{er(!1)}}},eh=async()=>{let e=function(e,t,s={}){let a=new Set((Array.isArray(t)?t:[]).filter(e=>"string"==typeof e).map(e=>e.toLowerCase())),r=[];for(let t of Array.isArray(e)?e:[]){let e="string"==typeof t?t.trim():"";if(!e)continue;let i=function(e,{isCloudflareAi:t=!1}={}){let s=e.split("|");if(t&&s.length>=3){let e=s[0].trim(),t=s[s.length-1].trim(),a=s.slice(1,-1).join("|").trim();return a&&t?{baseName:e||"Key",apiKey:a,providerSpecificData:{accountId:t}}:null}if(s.length>=2){let e=s[0].trim(),t=s.slice(1).join("|").trim();return t?{baseName:e||"Key",apiKey:t}:null}let a=s[0].trim();return a?{baseName:"Key",apiKey:a}:null}(e,s);if(!i)continue;let n=1,l=`${i.baseName} ${n}`;for(;a.has(l.toLowerCase());)n+=1,l=`${i.baseName} ${n}`;a.add(l.toLowerCase()),r.push({name:l,apiKey:i.apiKey,...i.providerSpecificData?{providerSpecificData:i.providerSpecificData}:{}})}return r}(el.split("\n").map(e=>e.trim()).filter(Boolean),p,{isCloudflareAi:O});if(!e.length)return;er(!0),ec(null);let s=0,a=0,r=[],i=[];for(let n of e)try{await (0,G.x6)("/api/providers",{method:"POST",body:{provider:t,apiKey:n.apiKey,name:n.name,priority:1,testStatus:"unknown",...n.providerSpecificData?{providerSpecificData:n.providerSpecificData}:{}}}),s++}catch(e){a++,r.push({line:n.name,message:e?.message||"Request failed"}),i.push(n.providerSpecificData?`${n.name.replace(/ \d+$/,"")}|${n.apiKey}|${n.providerSpecificData.accountId}`:`${n.name.replace(/ \d+$/,"")}|${n.apiKey}`)}er(!1),ec({success:s,failed:a,failedRows:r}),eo(i.join("\n")),s>0&&b&&b()};return t?(0,a.jsx)(d.aF,{isOpen:e,title:v?"Add Google Flow Account":`Add ${s||t} ${$}`,onClose:f,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[!v&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"single"===ei?"primary":"ghost",onClick:()=>{en("single"),ec(null)},children:"Single"}),(0,a.jsx)(d.$n,{size:"sm",variant:"bulk"===ei?"primary":"ghost",onClick:()=>{en("bulk"),ec(null)},children:"Bulk Add"})]}),"bulk"===ei&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,a.jsx)("code",{children:"name|apiKey"})," or just ",(0,a.jsx)("code",{children:"apiKey"}),". A name that is already used gets the next free number, so an earlier key is not replaced.",O?" Cloudflare also accepts name|apiKey|accountId.":""]}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:Q,value:el,onChange:e=>eo(e.target.value)}),ed&&(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${ed.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",ed.success," added",ed.failed>0?`, ✗ ${ed.failed} failed`:""]}),ed.failedRows?.length>0&&(0,a.jsx)("ul",{className:"text-xs text-red-500 flex flex-col gap-0.5",children:ed.failedRows.map((e,t)=>(0,a.jsxs)("li",{className:"break-words",children:[(0,a.jsx)("span",{className:"font-mono",children:e.line.length>40?`${e.line.slice(0,40)}…`:e.line}),` — ${e.message}`]},t))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:eh,fullWidth:!0,disabled:ea||!el.trim(),children:ea?"Adding...":"Add All Keys"}),(0,a.jsx)(d.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===ei&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.pd,{label:v?"Account name":"Name",value:z.name,onChange:e=>E({...z,name:e.target.value}),placeholder:v?"Google account email":y?"Ollama Local":"Production Key"}),v&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20 flex flex-col gap-3",children:[(0,a.jsx)(d.pd,{label:"gflow profile",value:z.flowProfile,onChange:e=>E({...z,flowProfile:e.target.value}),placeholder:"from: gflow auth list",hint:"One connection maps to one Google Flow browser profile.",required:!0}),(0,a.jsx)(d.pd,{label:"Daemon URL",value:z.flowBaseUrl,onChange:e=>E({...z,flowBaseUrl:e.target.value}),placeholder:"http://127.0.0.1:8077/mcp"}),(0,a.jsxs)("label",{className:"flex items-start gap-2 text-sm text-text-main",children:[(0,a.jsx)("input",{type:"checkbox",checked:z.flowI2vReady,onChange:e=>E({...z,flowI2vReady:e.target.checked}),className:"mt-1"}),(0,a.jsxs)("span",{children:["I2V upload consent confirmed ",(0,a.jsx)("span",{className:"block text-xs text-text-muted",children:"Enable only after uploading an image you own once on flow.google.com and accepting Google's rights dialog. Required for 20–60s videos."})]})]})]}),y&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:"Ollama Host URL",value:z.ollamaHostUrl,onChange:e=>E({...z,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:ep,disabled:J||ea,variant:"secondary",children:J?"Checking...":"Check"})})]}),!y&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:$,type:j?"text":"password",value:z.apiKey,onChange:e=>E({...z,apiKey:e.target.value}),placeholder:v?"GFLOW_DAEMON_TOKEN":A,hint:v?"Must match the token used by `gflow serve`.":void 0,className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:ep,disabled:!z.apiKey||v&&!z.flowProfile.trim()||J||ea,variant:"secondary",children:J?"Checking...":"Check"})})]}),k&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),j&&o&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[o,m&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsxs)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",m.replace(/^https?:\/\//,"")]})]})]}),P&&(0,a.jsx)(d.l6,{label:"Region",value:F,onChange:e=>B(e.target.value),options:P.map(e=>({value:e.id,label:e.label}))}),i&&(0,a.jsx)(d.pd,{label:"Default Model",value:z.defaultModel,onChange:e=>E({...z,defaultModel:e.target.value}),placeholder:n?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),y&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,a.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,a.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),W&&(0,a.jsx)(d.Ex,{variant:"success"===W?"success":"failed"===W?"error":"default",children:"success"===W?"Valid":"failed"===W?"Invalid":"Could not validate"}),"success"===W&&et?.tier&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[et.tier," tier \xb7 ",et.modelCount," models"]}),"success"===W&&et?.warning&&(0,a.jsx)("p",{className:"text-xs text-yellow-500 break-words",children:et.warning}),"failed"===W&&X&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:X}),x&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:x}),i&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),C&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"AWS Bedrock"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(d.pd,{label:"Access Key ID",value:L.accessKeyId,onChange:e=>K({...L,accessKeyId:e.target.value}),placeholder:"AKIA..."}),(0,a.jsx)(d.pd,{label:"Region",value:L.region,onChange:e=>K({...L,region:e.target.value}),placeholder:"us-east-1"}),(0,a.jsx)(d.pd,{label:"Session Token",value:L.sessionToken,onChange:e=>K({...L,sessionToken:e.target.value}),placeholder:"Only for temporary keys"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-2",children:"Leave region empty to use us-east-1. A profile name is not accepted."})]}),w&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"AWS Polly"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(d.pd,{label:"Access Key ID",value:_.accessKeyId,onChange:e=>U({..._,accessKeyId:e.target.value}),placeholder:"AKIA..."}),(0,a.jsx)(d.pd,{label:"Region",value:_.region,onChange:e=>U({..._,region:e.target.value}),placeholder:"us-east-1"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-2",children:"Leave region empty to use us-east-1. The voice id is chosen on the TTS page."})]}),O&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,a.jsx)(d.pd,{label:"Account ID",value:M.accountId,onChange:e=>D({...M,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,a.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),T&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(d.pd,{label:"Azure Endpoint",value:R.azureEndpoint,onChange:e=>q({...R,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,a.jsx)(d.pd,{label:"Deployment Name",value:R.deployment,onChange:e=>q({...R,deployment:e.target.value}),placeholder:"gpt-4"}),(0,a.jsx)(d.pd,{label:"API Version",value:R.apiVersion,onChange:e=>q({...R,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,a.jsx)(d.pd,{label:"Organization",value:R.organization,onChange:e=>q({...R,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,a.jsx)(d.pd,{label:"Priority",type:"number",value:z.priority,onChange:e=>E({...z,priority:e.target.value}),onBlur:e=>{let t=Number.parseInt(e.target.value,10);E(e=>({...e,priority:Number.isFinite(t)?t:1}))}}),!v&&(0,a.jsx)(d.l6,{label:"Proxy Pool",value:z.proxyPoolId,onChange:e=>E({...z,proxyPoolId:e.target.value}),options:[{value:g,label:"None"},...(u||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),!v&&0===(u||[]).length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),!v&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:ex,fullWidth:!0,disabled:ea||!y&&(!z.name||!z.apiKey)||v&&!z.flowProfile.trim()||i&&!z.defaultModel.trim()||T&&(!R.azureEndpoint||!R.deployment||!R.organization)||O&&!M.accountId||w&&!_.accessKeyId.trim()||C&&!L.accessKeyId.trim(),children:ea?"Saving...":"Save"}),(0,a.jsx)(d.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function Y({isOpen:e,node:t,onSave:s,onClose:i,isAnthropic:n}){let[l,o]=(0,r.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[c,m]=(0,r.useState)(!1),[u,p]=(0,r.useState)(""),[x,h]=(0,r.useState)(""),[b,f]=(0,r.useState)(!1),[g,y]=(0,r.useState)(null);(0,r.useEffect)(()=>{t&&(o({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(n?"https://api.anthropic.com/v1":"https://api.openai.com/v1")}),p(""),h(""),y(null))},[t,n]);let v=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){m(!0);try{let e={name:l.name,prefix:l.prefix,baseUrl:l.baseUrl};n||(e.apiType=l.apiType),await s(e)}finally{m(!1)}}},j=async()=>{f(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:u,type:n?"anthropic-compatible":"openai-compatible",modelId:x.trim()||void 0})}),t=await e.json();y(t.valid?"success":"failed")}catch{y("failed")}finally{f(!1)}};return t?(0,a.jsx)(d.aF,{isOpen:e,title:`Edit ${n?"Anthropic":"OpenAI"} Compatible`,onClose:i,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(d.pd,{label:"Name",value:l.name,onChange:e=>o({...l,name:e.target.value}),placeholder:`${n?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,a.jsx)(d.pd,{label:"Prefix",value:l.prefix,onChange:e=>o({...l,prefix:e.target.value}),placeholder:n?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!n&&(0,a.jsx)(d.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:l.apiType,onChange:e=>o({...l,apiType:e.target.value})}),(0,a.jsx)(d.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>o({...l,baseUrl:e.target.value}),placeholder:n?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${n?"Anthropic":"OpenAI"}-compatible API.`}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:"API Key (for Check)",type:"password",value:u,onChange:e=>p(e.target.value),className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:j,disabled:!u||b||!l.baseUrl.trim(),variant:"secondary",children:b?"Checking...":"Check"})})]}),(0,a.jsx)(d.pd,{label:"Model ID (optional)",value:x,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),g&&(0,a.jsx)(d.Ex,{variant:"success"===g?"success":"error",children:"success"===g?"Valid":"Invalid"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:v,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,a.jsx)(d.$n,{onClick:i,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function X({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:i,onClose:n}){let[l,o]=(0,r.useState)(""),[c,m]=(0,r.useState)(null),[u,p]=(0,r.useState)(""),[x,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>{e&&(o(""),m(null),p(""))},[e]);let b=e=>{let s=`${t}/`;return e.startsWith(s)?e.slice(s.length):e},f=async()=>{let e=b(l.trim());if(e){m("testing"),p("");try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),a=await s.json();m(a.ok?"ok":"error"),p(a.error||"")}catch(e){m("error"),p(e.message)}}},g=async()=>{let e=b(l.trim());if(e&&!x){h(!0);try{await i(e)}finally{h(!1)}}};return(0,a.jsx)(d.aF,{isOpen:e,onClose:n,title:"Add Custom Model",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:l,onChange:e=>{o(e.target.value),m(null),p("")},onKeyDown:e=>{"Enter"===e.key&&f()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,a.jsx)(d.$n,{variant:"secondary",icon:"science",loading:"testing"===c,onClick:f,disabled:!l.trim()||"testing"===c,children:"testing"===c?"Testing...":"Test"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,a.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:b(l.trim())||"model-id"})]})]}),"ok"===c&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===c&&(0,a.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,a.jsx)("span",{children:u||"Model not reachable"})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(d.$n,{onClick:n,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(d.$n,{onClick:g,fullWidth:!0,size:"sm",disabled:!l.trim()||x,children:x?"Adding...":"Add Model"})]})]})})}Z.propTypes={isOpen:O().bool.isRequired,provider:O().string,providerName:O().string,isCompatible:O().bool,isAnthropic:O().bool,authType:O().string,authHint:O().string,website:O().string,proxyPools:O().arrayOf(O().shape({id:O().string,name:O().string})),error:O().string,onSave:O().func.isRequired,onBulkDone:O().func,existingNames:O().arrayOf(O().string),onClose:O().func.isRequired},Y.propTypes={isOpen:O().bool.isRequired,node:O().shape({id:O().string,name:O().string,prefix:O().string,apiType:O().string,baseUrl:O().string}),onSave:O().func.isRequired,onClose:O().func.isRequired,isAnthropic:O().bool},X.propTypes={isOpen:O().bool.isRequired,providerAlias:O().string.isRequired,providerDisplayAlias:O().string.isRequired,onSave:O().func.isRequired,onClose:O().func.isRequired};let ee="/api/providers/codebuddy/discover-models",et={verified:"Verified",recognized:"Recognized",unavailable:"Unavailable",credential_rejected:"Credential rejected",error:"Inconclusive",skipped:"Skipped"},es={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",recognized:"border-sky-500/30 bg-sky-500/[0.08] text-sky-700 dark:text-sky-300",unavailable:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]",credential_rejected:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",error:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",skipped:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]"};function ea(e,t){return e?.error||t}function er({isOpen:e,connections:t,onModelsAdded:s,onClose:i}){let n=(0,r.useMemo)(()=>t.filter(e=>"codebuddy"===e.provider&&!1!==e.isActive),[t]),[l,o]=(0,r.useState)(null),[c,m]=(0,r.useState)(!1),[u,p]=(0,r.useState)(""),[x,h]=(0,r.useState)(""),[b,f]=(0,r.useState)(()=>new Set),[g,y]=(0,r.useState)(""),[v,j]=(0,r.useState)(!1),[k,w]=(0,r.useState)(!1),[N,C]=(0,r.useState)([]),[S,$]=(0,r.useState)(()=>new Set),A=(0,r.useCallback)(async()=>{m(!0),p(""),h(""),j(!1),C([]);try{let e=await fetch(ee,{cache:"no-store"}),t=await e.json();if(!e.ok)throw Error(ea(t,"Could not refresh model candidates"));o(t),f(new Set((t.hidden||[]).map(e=>e.id)))}catch(e){p(e.message)}finally{m(!1)}},[]);(0,r.useEffect)(()=>{e&&(y(e=>n.some(t=>t.id===e)?e:n[0]?.id||""),A())},[n,e,A]);let T=async()=>{if(g&&0!==b.size&&!k){w(!0),p(""),h("");try{let e=await fetch(ee,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:g,models:[...b]})}),t=await e.json();if(!e.ok)throw Error(ea(t,"Hidden model scan failed"));C(t.results||[]),j(!1)}catch(e){p(e.message)}finally{w(!1)}}},O=(0,r.useMemo)(()=>new Map(N.map(e=>[e.id,e])),[N]),P=(0,r.useMemo)(()=>(l?.hidden||[]).filter(e=>{let t=O.get(e.id)?.status;return e.previouslyVerified||"verified"===t||"recognized"===t}),[l,O]),I=async e=>{let t=e.filter(e=>!S.has(e.id));if(!t.length)return;$(e=>new Set([...e,...t.map(e=>e.id)])),p(""),h("");let a=[];try{for(let e of t){let t=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:"cb",id:e.id,type:"llm",name:e.name})}),s=await t.json();if(!t.ok)throw Error(ea(s,`Could not add ${e.id}`));a.push(e)}window.dispatchEvent(new Event("customModelChanged")),await s?.(a),h(`${a.length} model${1===a.length?"":"s"} added to CodeBuddy Global.`)}catch(e){a.length&&(window.dispatchEvent(new Event("customModelChanged")),await s?.(a)),p(e.message)}finally{$(e=>{let s=new Set(e);return t.forEach(e=>s.delete(e.id)),s})}},z=P.filter(e=>b.has(e.id));return(0,a.jsx)(d.aF,{isOpen:e,onClose:i,title:"Discover CodeBuddy Global Models",size:"full",children:(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsx)("div",{className:"live-probe-panel p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Live package candidates"}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:"Refreshing reads Tencent's current CLI manifests and does not call a model or use credits."}),l?.version&&(0,a.jsxs)("p",{className:"mt-2 font-mono text-xs text-primary",children:["codebuddy-code@",l.version]})]}),(0,a.jsx)(d.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:c,onClick:A,children:"Refresh Candidates"})]})}),u&&(0,a.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:u}),x&&(0,a.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:x}),l?.warnings?.map(e=>(0,a.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-300",children:e},e)),l&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:l.official?.length||0}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Official Global"})]}),(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:l.hidden?.length||0}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Hidden candidates"})]}),(0,a.jsxs)("div",{className:"col-span-2 rounded-lg border border-border bg-surface-2 px-3 py-2 sm:col-span-1",children:[(0,a.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:l.hidden?.filter(e=>e.previouslyVerified).length||0}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Previously verified"})]})]}),(0,a.jsxs)("section",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Hidden route candidates"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"From alternate official manifests; availability is not guaranteed on Global SaaS."})]}),(0,a.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>f(b.size===(l.hidden?.length||0)?new Set:new Set(l.hidden.map(e=>e.id))),children:b.size===(l.hidden?.length||0)?"Clear":"Select all"})]}),(0,a.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:(l.hidden||[]).map(e=>{let t=O.get(e.id);return(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,a.jsx)("input",{type:"checkbox",checked:b.has(e.id),onChange:()=>{var t;return t=e.id,void f(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"mt-1 accent-primary"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate text-sm font-medium text-text-main",children:e.name}),(0,a.jsx)("span",{className:"block truncate font-mono text-[11px] text-text-muted",children:e.id}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:e.sources.length?e.sources.join(" + "):"request history"})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[e.previouslyVerified&&(0,a.jsx)("span",{className:"rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-300",children:"previous success"}),t&&(0,a.jsx)("span",{className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${es[t.status]||es.error}`,children:et[t.status]||t.status}),(e.previouslyVerified||["verified","recognized"].includes(t?.status))&&(0,a.jsx)("button",{type:"button",onClick:t=>{t.preventDefault(),I([e])},className:"text-xs font-semibold text-primary hover:underline",disabled:S.has(e.id),children:S.has(e.id)?"Adding...":"Add"})]})]},e.id)})})]}),(0,a.jsxs)("section",{className:"live-probe-bar",children:[(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto] sm:items-end",children:[(0,a.jsx)(d.l6,{label:"CodeBuddy Global connection",value:g,onChange:e=>y(e.target.value),options:n.map(e=>({value:e.id,label:e.name||e.email||e.id})),placeholder:"No active Global connection",disabled:!n.length||k,hint:"Every probe is pinned to this connection."}),(0,a.jsxs)(d.$n,{size:"sm",icon:"radar",onClick:()=>j(!0),disabled:!g||0===b.size||k,children:["Scan Hidden Models (",b.size,")"]})]}),!n.length&&(0,a.jsx)("p",{className:"mt-2 text-xs text-red-500",children:"Add and activate a CodeBuddy Global connection before scanning."}),v&&(0,a.jsxs)("div",{className:"live-probe-confirm",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Confirm credit-using scan"}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:"These are real completion probes and may consume CodeBuddy credits. Scanning uses at most 3 concurrent requests and stops scheduling if the selected credential is rejected."}),(0,a.jsxs)("div",{className:"mt-3 flex justify-end gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",onClick:()=>j(!1),disabled:k,children:"Cancel"}),(0,a.jsx)(d.$n,{size:"sm",icon:"science",loading:k,onClick:T,children:"Start Credit Scan"})]})]})]}),N.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[N.filter(e=>"verified"===e.status).length," verified, ",N.filter(e=>"recognized"===e.status).length," recognized, ",N.filter(e=>"unavailable"===e.status).length," unavailable"]}),(0,a.jsxs)(d.$n,{size:"sm",icon:"playlist_add",onClick:()=>I(z),disabled:!z.length||S.size>0,children:["Add Selected Available (",z.length,")"]})]})]})]})})}er.propTypes={isOpen:O().bool.isRequired,connections:O().arrayOf(O().object).isRequired,onModelsAdded:O().func,onClose:O().func.isRequired};let ei={"codebuddy-intl":{label:"CodeBuddy",alias:"cbai",title:"Live Probe CodeBuddy Models"},"codebuddy-cn":{label:"CodeBuddy CN",alias:"cb-cn",title:"Live Probe CodeBuddy CN Models"}},en={verified:"Verified",recognized:"Recognized",unavailable:"Unavailable",credential_rejected:"Credential rejected",error:"Inconclusive",skipped:"Skipped"},el={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",recognized:"border-sky-500/30 bg-sky-500/[0.08] text-sky-700 dark:text-sky-300",unavailable:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]",credential_rejected:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",error:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",skipped:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]"};function eo({isOpen:e,providerId:t,connections:s,onModelsAdded:i,onClose:n}){let l=ei[t]||ei["codebuddy-intl"],o=(0,r.useMemo)(()=>(s||[]).filter(e=>e.provider===t&&!1!==e.isActive),[s,t]),[c,m]=(0,r.useState)([]),[u,p]=(0,r.useState)(!1),[x,h]=(0,r.useState)(""),[b,f]=(0,r.useState)(""),[g,y]=(0,r.useState)(()=>new Set),[v,j]=(0,r.useState)(""),[k,w]=(0,r.useState)(!1),[N,C]=(0,r.useState)(!1),[S,$]=(0,r.useState)([]),[A,T]=(0,r.useState)(()=>new Set),O=(0,r.useCallback)(async()=>{p(!0),h(""),f(""),w(!1),$([]);try{let e=await fetch(`/api/providers/${t}/discover-models`,{cache:"no-store"}),s=await e.json();if(!e.ok)throw Error(s?.error||"Could not load model candidates");let a=s.candidates||[];m(a),y(new Set(a.map(e=>e.id)))}catch(e){h(e.message)}finally{p(!1)}},[t]);(0,r.useEffect)(()=>{e&&(j(e=>o.some(t=>t.id===e)?e:o[0]?.id||""),O())},[o,e,O]);let P=async()=>{if(v&&0!==g.size&&!N){C(!0),h(""),f("");try{let e=await fetch(`/api/providers/${t}/discover-models`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:v,models:[...g]})}),s=await e.json();if(!e.ok)throw Error(s?.error||"Live probe failed");$(s.results||[]),w(!1)}catch(e){h(e.message)}finally{C(!1)}}},I=(0,r.useMemo)(()=>new Map(S.map(e=>[e.id,e])),[S]),z=async e=>{let t=e.filter(e=>"catalog"!==e.source&&!A.has(e.id));if(!t.length)return;T(e=>new Set([...e,...t.map(e=>e.id)])),h(""),f("");let s=[];try{for(let e of t){let t=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:l.alias,id:e.id,type:"llm",name:e.name})}),a=await t.json();if(!t.ok)throw Error(a?.error||`Could not add ${e.id}`);s.push(e)}window.dispatchEvent(new Event("customModelChanged")),await i?.(s),f(`${s.length} model${1===s.length?"":"s"} added to ${l.label}.`)}catch(e){s.length&&(window.dispatchEvent(new Event("customModelChanged")),await i?.(s)),h(e.message)}finally{T(e=>{let s=new Set(e);return t.forEach(e=>s.delete(e.id)),s})}};return(0,a.jsx)(d.aF,{isOpen:e,onClose:n,title:l.title,size:"full",children:(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsxs)("div",{className:"live-probe-panel p-4",children:[(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto] sm:items-end",children:[(0,a.jsx)(d.l6,{label:`${l.label} connection`,value:v,onChange:e=>j(e.target.value),options:o.map(e=>({value:e.id,label:e.name||e.email||e.id})),placeholder:`No active ${l.label} connection`,disabled:!o.length||N,hint:"Every probe is pinned to this connection."}),(0,a.jsx)(d.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:u,disabled:N,onClick:O,children:"Refresh Catalog"})]}),(0,a.jsxs)("p",{className:"mt-3 text-xs leading-relaxed text-text-muted",children:["Probes the models this router already knows for ",l.label,". A probe sends one short completion and may use credits."]}),!o.length&&(0,a.jsxs)("p",{className:"mt-2 text-xs text-red-500",children:["Add and activate a ",l.label," connection first."]})]}),x&&(0,a.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:x}),b&&(0,a.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:b}),(0,a.jsxs)("section",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Models"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[c.length," candidate",1===c.length?"":"s"]})]}),(0,a.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>y(g.size===c.length?new Set:new Set(c.map(e=>e.id))),disabled:!c.length,children:g.size===c.length?"Clear":"Select all"})]}),(0,a.jsxs)("div",{className:"max-h-80 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:[c.map(e=>{let t=I.get(e.id);return(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,a.jsx)("input",{type:"checkbox",checked:g.has(e.id),onChange:()=>{var t;return t=e.id,void y(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"mt-1 accent-primary"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate text-sm font-medium text-text-main",children:e.name}),(0,a.jsx)("span",{className:"block truncate font-mono text-[11px] text-text-muted",children:e.id})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[t&&(0,a.jsx)("span",{className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${el[t.status]||el.error}`,children:en[t.status]||t.status}),"catalog"!==e.source&&["verified","recognized"].includes(t?.status)&&(0,a.jsx)("button",{type:"button",onClick:t=>{t.preventDefault(),z([e])},className:"text-xs font-semibold text-primary hover:underline",disabled:A.has(e.id),children:A.has(e.id)?"Adding...":"Add"})]})]},e.id)}),!u&&0===c.length&&(0,a.jsx)("p",{className:"px-3 py-6 text-center text-sm text-text-muted",children:"No model candidates yet."})]})]}),(0,a.jsxs)("section",{className:"live-probe-bar",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:S.length>0?`${S.filter(e=>"verified"===e.status).length} verified, ${S.filter(e=>"unavailable"===e.status).length} unavailable`:"Probe sends one real completion per selected model."}),(0,a.jsxs)(d.$n,{size:"sm",icon:"radar",onClick:()=>w(!0),disabled:!v||0===g.size||N,children:["Live Probe (",g.size,")"]})]}),k&&(0,a.jsxs)("div",{className:"live-probe-confirm",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Confirm credit-using probe"}),(0,a.jsxs)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:["These are real completion probes and may consume ",l.label," credits. Probing uses at most 3 concurrent requests and stops scheduling if the selected credential is rejected."]}),(0,a.jsxs)("div",{className:"mt-3 flex justify-end gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",onClick:()=>w(!1),disabled:N,children:"Cancel"}),(0,a.jsx)(d.$n,{size:"sm",icon:"science",loading:N,onClick:P,children:"Start Probe"})]})]})]})]})})}eo.propTypes={isOpen:O().bool,providerId:O().string.isRequired,connections:O().arrayOf(O().object),onModelsAdded:O().func,onClose:O().func.isRequired};let ed="/api/providers/opencode/discover-models",ec={verified:"Works",quota_exhausted:"Free quota used up",skipped:"Not tested",overloaded:"Overloaded",unavailable:"Unavailable",deprecated:"Deprecated",unsupported:"Protocol unsupported",error:"Error"},em={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",quota_exhausted:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",skipped:"border-zinc-500/30 bg-zinc-500/[0.08] text-zinc-600 dark:text-zinc-400",overloaded:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",unavailable:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",deprecated:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",unsupported:"border-purple-500/30 bg-purple-500/[0.08] text-purple-700 dark:text-purple-300",error:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300"},eu=new Set(["unavailable","deprecated","unsupported"]);function ep({isOpen:e,onModelsAdded:t,onClose:s}){let[i,n]=(0,r.useState)([]),[l,o]=(0,r.useState)(!1),[c,m]=(0,r.useState)(""),[u,p]=(0,r.useState)(""),[x,h]=(0,r.useState)(()=>new Set),[b,f]=(0,r.useState)(!1),[g,y]=(0,r.useState)([]),[v,j]=(0,r.useState)(()=>new Set),[k,w]=(0,r.useState)(()=>new Set),N=(0,r.useCallback)(async()=>{o(!0),m(""),p(""),y([]);try{let e=await fetch(ed,{cache:"no-store"}),t=await e.json();if(!e.ok)throw Error(t?.error||"Could not fetch OpenCode models");let s=t.candidates||[];n(s),h(new Set(s.filter(e=>!1!==e.inCatalog).map(e=>e.id))),w(new Set(s.filter(e=>e.isConfigured).map(e=>e.id))),!1===t.catalogAvailable&&p("OpenCode's model catalog could not be fetched; showing configured models only.")}catch(e){m(e.message)}finally{o(!1)}},[]);(0,r.useEffect)(()=>{e&&N()},[e,N]);let C=async()=>{if(0!==x.size&&!b){f(!0),m(""),p("");try{let e=await fetch(ed,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:[...x]})}),t=await e.json();if(!e.ok)throw Error(t?.error||"Live probe failed");let s=t.results||[];y(s);let a=s.find(e=>"quota_exhausted"===e.status);a&&m(`OpenCode's free quota for this IP is used up (${a.id}). The remaining models were not tested; this says nothing about whether they work. Try again later.`)}catch(e){m(e.message)}finally{f(!1)}}},S=(0,r.useMemo)(()=>new Map(g.map(e=>[e.id,e])),[g]),$=async e=>{let s=e.filter(e=>!v.has(e.id)&&!k.has(e.id));if(!s.length)return;j(e=>new Set([...e,...s.map(e=>e.id)])),m(""),p("");let a=[];try{for(let e of s){let t=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:"oc",id:e.id,type:"llm",name:e.name||e.id})}),s=await t.json();if(!t.ok)throw Error(s?.error||`Could not add ${e.id}`);a.push(e)}window.dispatchEvent(new Event("customModelChanged")),w(e=>new Set([...e,...a.map(e=>e.id)])),await t?.(a),p(`${a.length} model${1===a.length?"":"s"} added to OpenCode Free!`)}catch(e){a.length&&(window.dispatchEvent(new Event("customModelChanged")),w(e=>new Set([...e,...a.map(e=>e.id)])),await t?.(a)),m(e.message)}finally{j(e=>{let t=new Set(e);return s.forEach(e=>t.delete(e.id)),t})}},A=(0,r.useMemo)(()=>i.filter(e=>{let t=S.get(e.id);return t?.ok&&!k.has(e.id)}),[i,S,k]);return(0,a.jsx)(d.aF,{isOpen:e,onClose:s,title:"Live Probe OpenCode Free Models",size:"full",children:(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsx)("div",{className:"live-probe-panel p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Upstream Catalog Live Probe"}),(0,a.jsxs)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:["Pulls candidates directly from ",(0,a.jsx)("span",{className:"font-mono",children:"opencode.ai/zen/v1/models"})," and tests real-time completions to verify which free models are alive."]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(d.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:l,onClick:N,children:"Refresh Catalog"}),(0,a.jsx)(d.$n,{size:"sm",icon:"radar",loading:b,disabled:0===x.size||b,onClick:C,children:b?"Probing Upstream...":`Live Probe (${x.size})`})]})]})}),c&&(0,a.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:c}),u&&(0,a.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:u}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Total Candidates: ",(0,a.jsx)("strong",{className:"text-text-main",children:i.length})]}),g.length>0&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["• Works: ",(0,a.jsx)("strong",{className:"text-green-600",children:g.filter(e=>e.ok).length})," ","• Dead: ",(0,a.jsx)("strong",{className:"text-red-600",children:g.filter(e=>eu.has(e.status)).length})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[A.length>0&&(0,a.jsxs)("button",{type:"button",onClick:()=>$(A),disabled:v.size>0,className:"text-xs font-semibold text-primary hover:underline",children:["+ Add All Verified (",A.length,")"]}),(0,a.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>h(x.size===i.length?new Set:new Set(i.map(e=>e.id))),children:x.size===i.length?"Deselect All":"Select All"})]})]}),(0,a.jsx)("div",{className:"max-h-96 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:i.map(e=>{let t=S.get(e.id),s=k.has(e.id),r=v.has(e.id);return(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,a.jsxs)("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-3",children:[(0,a.jsx)("input",{type:"checkbox",checked:x.has(e.id),onChange:()=>{var t;return t=e.id,void h(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"accent-primary"}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-text-main truncate",children:e.name}),s&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"Active in Router"}),!1===e.inCatalog&&(0,a.jsx)("span",{className:"rounded-full bg-red-500/10 px-2 py-0.5 text-[10px] font-medium text-red-600 dark:text-red-400",title:"Not listed in opencode.ai/zen/v1/models anymore",children:"Retired upstream"})]}),(0,a.jsxs)("span",{className:"block font-mono text-[11px] text-text-muted truncate",children:["oc/",e.id]})]})]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-3",children:[t?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`rounded-full border px-2.5 py-0.5 text-[11px] font-medium ${em[t.status]||em.error}`,title:t.error||t.message,children:ec[t.status]||t.status}),t.latencyMs>0&&(0,a.jsxs)("span",{className:"text-[11px] text-text-muted font-mono",children:[t.latencyMs,"ms"]})]}):(0,a.jsx)("span",{className:"text-[11px] text-text-muted italic",children:"Ready to probe"}),!s&&!1!==e.inCatalog&&!eu.has(t?.status)&&(0,a.jsx)("button",{type:"button",onClick:()=>$([e]),disabled:r,className:"text-xs font-semibold text-primary hover:underline disabled:opacity-50",children:r?"Adding...":"+ Add"})]})]},e.id)})}),(0,a.jsx)("div",{className:"flex justify-end gap-2 pt-2 border-t border-border",children:(0,a.jsx)(d.$n,{variant:"secondary",size:"sm",onClick:s,children:"Close"})})]})})}ep.propTypes={isOpen:O().bool.isRequired,onModelsAdded:O().func,onClose:O().func.isRequired};var ex=s(42835);let eh="/api/providers/kiro/discover-models",eb={verified:"Verified",recognized:"Recognized (quota)",unavailable:"Unavailable",credential_rejected:"Credential rejected",error:"Inconclusive",skipped:"Skipped"},ef={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",recognized:"border-sky-500/30 bg-sky-500/[0.08] text-sky-700 dark:text-sky-300",unavailable:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]",credential_rejected:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",error:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",skipped:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]"},eg={live:"live catalog",known:"known Kiro model",saved:"saved on account",alias:"your alias"};function ey(e){return e?e>=1e6?`${e/1e6}M`:`${Math.round(e/1e3)}K`:null}function ev({isOpen:e,connections:t,onClose:s}){let i=(0,r.useMemo)(()=>t.filter(e=>"kiro"===e.provider&&!1!==e.isActive&&!e.quarantinedAt),[t]),[n,l]=(0,r.useState)(""),[o,c]=(0,r.useState)(null),[m,u]=(0,r.useState)(!1),[p,x]=(0,r.useState)(""),[h,b]=(0,r.useState)(()=>new Set),[f,g]=(0,r.useState)(!1),[y,v]=(0,r.useState)(!1),[j,k]=(0,r.useState)([]),[w,N]=(0,r.useState)(!1),[C,S]=(0,r.useState)(""),$=(0,r.useCallback)(async e=>{if(e){u(!0),x(""),S(""),g(!1),k([]);try{let t=await fetch(`${eh}?connectionId=${encodeURIComponent(e)}`,{cache:"no-store"}),s=await t.json();if(!t.ok)throw Error(s?.error||"Could not refresh Kiro candidates");c(s),b(new Set((s.candidates||[]).filter(e=>!e.inLive).map(e=>e.id)))}catch(e){c(null),x(e.message)}finally{u(!1)}}},[]);(0,r.useEffect)(()=>{!e||i.some(e=>e.id===n)||l(i[0]?.id||"")},[i,n,e]),(0,r.useEffect)(()=>{e&&n&&$(n)},[n,e,$]);let A=async()=>{if(n&&0!==h.size&&!y){v(!0),x("");try{let e=await fetch(eh,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:n,models:[...h]})}),t=await e.json();if(!e.ok)throw Error(t?.error||"Kiro model probe failed");k(t.results||[]),g(!1)}catch(e){x(e.message)}finally{v(!1)}}},T=(0,r.useMemo)(()=>new Map(j.map(e=>[e.id,e])),[j]),O=o?.candidates||[],P=O.filter(e=>e.inLive).length,I=O.length-P,z=j.filter(e=>"verified"===e.status).map(e=>e.id),E=!!o&&!o.hasProfile&&z.length>0,R=async()=>{if(E&&!w){N(!0),x(""),S("");try{let e=await fetch(eh,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:n,models:z})}),t=await e.json();if(!e.ok)throw Error(t?.error||"Saving verified models failed");S(`${t.saved.length} verified model${1===t.saved.length?"":"s"} saved to this connection.`)}catch(e){x(e.message)}finally{N(!1)}}};return(0,a.jsx)(d.aF,{isOpen:e,onClose:s,title:"Live Probe Kiro Models",size:"full",children:(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsxs)("div",{className:"live-probe-panel p-4",children:[(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto] sm:items-end",children:[(0,a.jsx)(d.l6,{label:"Kiro connection",value:n,onChange:e=>l(e.target.value),options:i.map(e=>({value:e.id,label:e.name||e.email||e.id})),placeholder:"No active Kiro connection",disabled:!i.length||y,hint:"The catalog and every probe are pinned to this connection."}),(0,a.jsx)(d.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:m,disabled:!n||y,onClick:()=>$(n),children:"Refresh Catalog"})]}),(0,a.jsx)("p",{className:"mt-3 text-xs leading-relaxed text-text-muted",children:"Refreshing calls Kiro's ListAvailableModels for this account and does not use credits."}),!i.length&&(0,a.jsx)("p",{className:"mt-2 text-xs text-red-500",children:"Add and activate a Kiro connection first."})]}),p&&(0,a.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:p}),C&&(0,a.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:C}),o?.warnings?.map(e=>(0,a.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-300",children:e},e)),o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:P}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"In live catalog"})]}),(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-2xl font-semibold text-text-main",children:I}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Saved / alias only"})]}),(0,a.jsxs)("div",{className:"col-span-2 rounded-lg border border-border bg-surface-2 px-3 py-2 sm:col-span-1",children:[(0,a.jsx)("p",{className:`text-sm font-semibold ${o.liveCatalog?"text-green-700 dark:text-green-300":"text-amber-700 dark:text-amber-300"}`,children:o.liveCatalog?"Live catalog readable":"Live catalog unavailable"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:o.hasProfile?"Account has a CodeWhisperer profile":"No profile (API-key login)"})]})]}),(0,a.jsxs)("section",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Base models"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"-thinking and -agentic variants share their base model and are not probed separately."})]}),(0,a.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>b(h.size===O.length?new Set:new Set(O.map(e=>e.id))),children:h.size===O.length?"Clear":"Select all"})]}),(0,a.jsx)("div",{className:"max-h-80 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:O.map(e=>{let t=T.get(e.id),s=[ey(e.contextLength),ey(e.maxOutputTokens)].filter(Boolean).join(" / ");return(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,a.jsx)("input",{type:"checkbox",checked:h.has(e.id),onChange:()=>{var t;return t=e.id,void b(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"mt-1 accent-primary"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate text-sm font-medium text-text-main",children:e.name}),(0,a.jsxs)("span",{className:"block truncate font-mono text-[11px] text-text-muted",children:["kr/",e.id]}),(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:[e.sources.map(e=>eg[e]||e).join(" + "),s&&` \xb7 ${s}`,e.rateMultiplier&&1!==e.rateMultiplier&&` \xb7 ${e.rateMultiplier}x credit`]})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[e.inLive&&(0,a.jsx)("span",{className:"rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-300",children:"live"}),t&&(0,a.jsxs)("span",{title:t.error||"",className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${ef[t.status]||ef.error}`,children:[eb[t.status]||t.status,"verified"===t.status&&Number.isFinite(t.latencyMs)&&` \xb7 ${t.latencyMs}ms`]})]})]},e.id)})})]}),(0,a.jsxs)("section",{className:"live-probe-bar",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:j.length>0?`${j.filter(e=>"verified"===e.status).length} verified, ${j.filter(e=>"unavailable"===e.status).length} unavailable, ${j.filter(e=>!["verified","unavailable"].includes(e.status)).length} other`:"Probe sends one real completion per selected model."}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[E&&(0,a.jsxs)(d.$n,{size:"sm",variant:"secondary",icon:"save",loading:w,onClick:R,children:["Save Verified to Connection (",z.length,")"]}),(0,a.jsxs)(d.$n,{size:"sm",icon:"radar",onClick:()=>g(!0),disabled:!n||0===h.size||y,children:["Probe Selected (",h.size,")"]})]})]}),f&&(0,a.jsxs)("div",{className:"live-probe-confirm",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Confirm credit-using probe"}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:"These are real completion requests and may consume Kiro credits. Probing uses at most 3 concurrent requests and stops scheduling if the selected credential is rejected."}),(0,a.jsxs)("div",{className:"mt-3 flex justify-end gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",onClick:()=>g(!1),disabled:y,children:"Cancel"}),(0,a.jsx)(d.$n,{size:"sm",icon:"science",loading:y,onClick:A,children:"Start Probe"})]})]})]})]})]})})}ev.propTypes={isOpen:O().bool.isRequired,connections:O().arrayOf(O().object).isRequired,onClose:O().func.isRequired};let ej="/api/providers/cloudflare-ai/discover-models",ek={verified:"Works",paid_only:"Paid plan only",no_access:"No access",unavailable:"Unavailable",deprecated:"Deprecated",unsupported:"Not a chat model",agreement_required:"License agreement needed",input_rejected:"Input rejected",quota_exhausted:"Daily quota used up",credential_rejected:"Token rejected",rate_limited:"Rate limited",skipped:"Not tested",error:"Inconclusive"},ew={verified:"border-green-500/30 bg-green-500/[0.08] text-green-700 dark:text-green-300",paid_only:"border-sky-500/30 bg-sky-500/[0.08] text-sky-700 dark:text-sky-300",no_access:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",unavailable:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",input_rejected:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",deprecated:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",unsupported:"border-purple-500/30 bg-purple-500/[0.08] text-purple-700 dark:text-purple-300",agreement_required:"border-sky-500/30 bg-sky-500/[0.08] text-sky-700 dark:text-sky-300",quota_exhausted:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",credential_rejected:"border-red-500/30 bg-red-500/[0.08] text-red-700 dark:text-red-300",rate_limited:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300",skipped:"border-black/10 bg-black/[0.03] text-text-muted dark:border-white/10 dark:bg-white/[0.04]",error:"border-amber-500/30 bg-amber-500/[0.08] text-amber-700 dark:text-amber-300"},eN=new Set(["unavailable","no_access","deprecated","unsupported"]),eC=[{kind:"llm",title:"Chat models",hint:"Probed with one short chat completion."},{kind:"image",title:"Image models",hint:"Probed with one small generation. Image probes use far more neurons than chat."}];function eS({isOpen:e,connections:t,onModelsAdded:s,onClose:i}){let n=(0,r.useMemo)(()=>t.filter(e=>"cloudflare-ai"===e.provider&&!1!==e.isActive&&!e.quarantinedAt),[t]),[l,o]=(0,r.useState)(""),[c,m]=(0,r.useState)(null),[u,p]=(0,r.useState)(!1),[x,h]=(0,r.useState)(""),[b,f]=(0,r.useState)(""),[g,y]=(0,r.useState)(()=>new Set),[v,j]=(0,r.useState)(!1),[k,w]=(0,r.useState)(!1),[N,C]=(0,r.useState)([]),[S,$]=(0,r.useState)(()=>new Set),[A,T]=(0,r.useState)(()=>new Set),O=(0,r.useCallback)(async e=>{if(e){p(!0),h(""),f(""),j(!1),C([]);try{let t=await fetch(`${ej}?connectionId=${encodeURIComponent(e)}`,{cache:"no-store"}),s=await t.json();if(!t.ok)throw Error(s?.error||"Could not read the Cloudflare model catalog");m(s),y(new Set((s.candidates||[]).filter(e=>!e.paidOnly).map(e=>e.id))),T(new Set((s.candidates||[]).filter(e=>e.builtIn||e.aliased).map(e=>e.id))),s.catalogAvailable||f("Cloudflare's model catalog could not be read; showing built-in and saved models only.")}catch(e){m(null),h(e.message)}finally{p(!1)}}},[]);(0,r.useEffect)(()=>{!e||n.some(e=>e.id===l)||o(n[0]?.id||"")},[n,l,e]),(0,r.useEffect)(()=>{e&&l&&O(l)},[l,e,O]);let P=(0,r.useMemo)(()=>c?.candidates||[],[c]),I=(0,r.useMemo)(()=>new Map(N.map(e=>[e.id,e])),[N]),z=P.filter(e=>"image"===e.kind&&g.has(e.id)).length,E=async()=>{if(l&&0!==g.size&&!k){w(!0),h(""),f("");try{let e=P.filter(e=>g.has(e.id)).map(e=>({id:e.id,kind:e.kind})),t=await fetch(ej,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:l,models:e})}),s=await t.json();if(!t.ok)throw Error(s?.error||"Cloudflare model probe failed");let a=s.results||[];C(a),j(!1);let r=a.find(e=>"quota_exhausted"===e.status||"credential_rejected"===e.status);r&&h("quota_exhausted"===r.status?`This account's daily Workers AI allocation is used up (${r.id}). The remaining models were not tested; try again after the daily reset or pick another connection.`:`Cloudflare rejected this connection's API token (${r.id}). The remaining models were not tested.`)}catch(e){h(e.message)}finally{w(!1)}}},R=async e=>{let t=e.filter(e=>!A.has(e.id)&&!S.has(e.id));if(t.length){$(e=>new Set([...e,...t.map(e=>e.id)])),h(""),f("");try{await s?.(t),T(e=>new Set([...e,...t.map(e=>e.id)])),f(`${t.length} model${1===t.length?"":"s"} added to the router.`)}catch(e){h(e.message)}finally{$(e=>{let s=new Set(e);return t.forEach(e=>s.delete(e.id)),s})}}},q=P.filter(e=>"llm"===e.kind&&I.get(e.id)?.status==="verified"&&!A.has(e.id)),M={works:N.filter(e=>"verified"===e.status).length,dead:N.filter(e=>eN.has(e.status)).length,paid:N.filter(e=>"paid_only"===e.status).length,other:N.filter(e=>!["verified","paid_only"].includes(e.status)&&!eN.has(e.status)).length};return(0,a.jsx)(d.aF,{isOpen:e,onClose:i,title:"Live Probe Cloudflare Workers AI Models",size:"full",children:(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsxs)("div",{className:"live-probe-panel p-4",children:[(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto] sm:items-end",children:[(0,a.jsx)(d.l6,{label:"Cloudflare connection",value:l,onChange:e=>o(e.target.value),options:n.map(e=>({value:e.id,label:e.name||e.email||e.id})),placeholder:"No active Cloudflare connection",disabled:!n.length||k,hint:"The catalog and every probe use this account."}),(0,a.jsx)(d.$n,{variant:"secondary",size:"sm",icon:"refresh",loading:u,disabled:!l||k,onClick:()=>O(l),children:"Refresh Catalog"})]}),(0,a.jsx)("p",{className:"mt-3 text-xs leading-relaxed text-text-muted",children:"Refreshing reads this account's Workers AI model catalog and does not use neurons. Only chat and text-to-image models are listed."}),!n.length&&(0,a.jsx)("p",{className:"mt-2 text-xs text-red-500",children:"Add and activate a Cloudflare connection first."})]}),x&&(0,a.jsx)("p",{role:"alert",className:"rounded-lg border border-red-500/25 bg-red-500/[0.08] px-3 py-2 text-sm text-red-600 dark:text-red-300",children:x}),b&&(0,a.jsx)("p",{className:"rounded-lg border border-green-500/25 bg-green-500/[0.08] px-3 py-2 text-sm text-green-700 dark:text-green-300",children:b}),c&&eC.map(e=>{let t=P.filter(t=>t.kind===e.kind);if(!t.length)return null;let s=t.every(e=>g.has(e.id));return(0,a.jsxs)("section",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold text-text-main",children:[e.title," (",t.length,")"]}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e.hint})]}),(0,a.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>{var t;let s,a;return t=e.kind,a=(s=P.filter(e=>e.kind===t).map(e=>e.id)).every(e=>g.has(e)),void y(e=>{let t=new Set(e);for(let e of s)a?t.delete(e):t.add(e);return t})},children:s?"Clear":"Select all"})]}),(0,a.jsx)("div",{className:"max-h-80 overflow-y-auto rounded-xl border border-border custom-scrollbar",children:t.map(e=>{var t;let s=I.get(e.id),r=A.has(e.id),i="llm"===e.kind&&!r&&s?.status==="verified",n=[!(t=e.contextLength)?null:t>=1e6?`${Math.round(t/1e5)/10}M ctx`:`${Math.round(t/1e3)}K ctx`,...e.flags].filter(Boolean).join(" \xb7 ");return(0,a.jsxs)("div",{className:"flex items-start gap-3 border-b border-border-subtle px-3 py-2.5 last:border-b-0 hover:bg-surface-2",children:[(0,a.jsxs)("label",{className:"flex min-w-0 flex-1 cursor-pointer items-start gap-3",children:[(0,a.jsx)("input",{type:"checkbox",checked:g.has(e.id),onChange:()=>{var t;return t=e.id,void y(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"mt-1 accent-primary"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsx)("span",{className:"truncate text-sm font-medium text-text-main",children:e.name}),r&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"In router"}),e.paidOnly&&(0,a.jsx)("span",{className:"rounded-full bg-sky-500/10 px-2 py-0.5 text-[10px] font-medium text-sky-700 dark:text-sky-300",children:"Workers Paid"}),!1===e.inCatalog&&(0,a.jsx)("span",{className:"rounded-full bg-zinc-500/10 px-2 py-0.5 text-[10px] font-medium text-text-muted",title:"Not listed in this account's Workers AI catalog",children:"Not in catalog"})]}),(0,a.jsxs)("span",{className:"block truncate font-mono text-[11px] text-text-muted",children:["cf/",e.id]}),n&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:n})]})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-2 pt-0.5",children:[s&&(0,a.jsxs)("span",{title:s.error||"",className:`rounded-full border px-2 py-0.5 text-[10px] font-medium ${ew[s.status]||ew.error}`,children:[ek[s.status]||s.status,"verified"===s.status&&Number.isFinite(s.latencyMs)&&` \xb7 ${s.latencyMs}ms`]}),i&&(0,a.jsx)("button",{type:"button",onClick:()=>R([e]),disabled:S.has(e.id),className:"text-xs font-semibold text-primary hover:underline disabled:opacity-50",children:S.has(e.id)?"Adding...":"+ Add"})]})]},e.id)})})]},e.kind)}),c&&(0,a.jsxs)("section",{className:"live-probe-bar",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:N.length>0?`${M.works} work, ${M.dead} dead, ${M.paid} need Workers Paid, ${M.other} other`:"Probe sends one real request per selected model."}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[q.length>0&&(0,a.jsxs)(d.$n,{size:"sm",variant:"secondary",icon:"add",loading:S.size>0,onClick:()=>R(q),children:["Add Working Chat Models (",q.length,")"]}),(0,a.jsxs)(d.$n,{size:"sm",icon:"radar",onClick:()=>j(!0),disabled:!l||0===g.size||k,children:["Probe Selected (",g.size,")"]})]})]}),v&&(0,a.jsxs)("div",{className:"live-probe-confirm",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Confirm neuron-using probe"}),(0,a.jsxs)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:["These are real Workers AI requests on the selected account and count toward its daily free allocation of 10,000 neurons.",z>0&&` ${z} image model${1===z?"":"s"} selected; each image probe costs much more than a chat probe.`," ","At most 3 run at once, and the scan stops if the allocation runs out or the token is rejected."]}),(0,a.jsxs)("div",{className:"mt-3 flex justify-end gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",onClick:()=>j(!1),disabled:k,children:"Cancel"}),(0,a.jsx)(d.$n,{size:"sm",icon:"science",loading:k,onClick:E,children:"Start Probe"})]})]})]})]})})}function e$({showAutomation:e,showAddConnection:t,onOpenAutomation:s,onAddConnection:r,methods:i=null,onSelectMethod:n=null,extra:l=null}){let o=Array.isArray(i)?i.filter(e=>"oauth"===e.id||"apikey"===e.id):[],c=2===o.length&&"function"==typeof n,m=Array.isArray(i)?i.filter(e=>"oauth"!==e.id&&"apikey"!==e.id):[];return e||t||c||l||0!==m.length?(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:flex-wrap sm:justify-end",children:[e?(0,a.jsx)(d.$n,{size:"sm",icon:"automation",variant:"secondary",onClick:s,className:"w-full sm:w-auto",children:"Open Automation"}):null,c?(0,a.jsxs)(a.Fragment,{children:[o.map(e=>(0,a.jsx)(d.$n,{size:"sm",icon:e.icon||("oauth"===e.id?"lock":"key"),variant:"oauth"===e.id?"secondary":void 0,onClick:()=>n(e.id),disabled:e.disabled,className:"w-full sm:w-auto",children:e.label},e.id)),m.map(e=>(0,a.jsx)(d.$n,{size:"sm",icon:e.icon||"add",variant:"secondary",onClick:()=>n(e.id),disabled:e.disabled,className:"w-full sm:w-auto",children:e.label},e.id))]}):t?(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:r,className:"w-full sm:w-auto",children:"Add Connection"}):null,l]}):null}eS.propTypes={isOpen:O().bool.isRequired,connections:O().arrayOf(O().object).isRequired,onModelsAdded:O().func,onClose:O().func.isRequired},e$.propTypes={showAutomation:O().bool.isRequired,showAddConnection:O().bool.isRequired,onOpenAutomation:O().func.isRequired,onAddConnection:O().func.isRequired,methods:O().arrayOf(O().shape({id:O().string.isRequired,label:O().string.isRequired,icon:O().string,disabled:O().bool})),onSelectMethod:O().func,extra:O().node};let eA=`[
|
|
4
4
|
{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{28915:(e,t,s)=>{"use strict";s.d(t,{x6:()=>r.fetchJson,E2:()=>a,gs:()=>i});var r=s(68211);function a(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}function i(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let r=Math.floor(s/24);return`${r}d ago`}},44459:(e,t,s)=>{Promise.resolve().then(s.bind(s,59123))},59123:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>k});var r=s(95155),a=s(12115),i=s(14051),l=s.n(i),n=s(35497),o=s(57250),d=s(90620),c=s(1791),m=s(98500),p=s.n(m),u=s(28915),x=s(65921),h=s(38003);let f={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function g(){let[e,t]=(0,a.useState)(null),[s,i]=(0,a.useState)(!0),[l,o]=(0,a.useState)(!1),[d,c]=(0,a.useState)(null),m=(0,a.useRef)(null),p=(0,x.i)(),u=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let s=await e.json();t(s)}}catch{}finally{i(!1)}},[]);(0,a.useEffect)(()=>{u();let e=setInterval(u,3e4);return()=>clearInterval(e)},[u]),(0,a.useEffect)(()=>{let e=e=>{m.current&&!m.current.contains(e.target)&&o(!1)};return l&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[l]);let h=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(p.success(`Cooldown cleared for ${t}`),await u()):p.error("Failed to clear cooldown")}catch{p.error("Failed to clear cooldown")}finally{c(null)}};if(s)return null;let g=e?.models||[],b=e?.unavailableCount||g.filter(e=>"available"!==e.status).length,v=0===b,y={};return g.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";y[t]||(y[t]=[]),y[t].push(e)}),(0,r.jsxs)("div",{className:"relative",ref:m,children:[(0,r.jsxs)("button",{onClick:()=>o(!l),className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-all ${v?"bg-emerald-500/10 border-emerald-500/20 text-emerald-500 hover:bg-emerald-500/15":"bg-amber-500/10 border-amber-500/20 text-amber-500 hover:bg-amber-500/15"}`,children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:v?"verified":"warning"}),v?"All models operational":`${b} model${1!==b?"s":""} with issues`]}),l&&(0,r.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:v?"#22c55e":"#f59e0b"},children:v?"verified":"warning"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,r.jsx)("button",{onClick:u,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,r.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:v?(0,r.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,r.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(y).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=f[e.status]||f.unknown,s=d===`${e.provider}:${e.model}`;return(0,r.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,r.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,r.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>h(e.provider,e.model),disabled:s,className:"text-[10px] px-1.5! py-0.5! ml-2",children:s?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})]})}var b=s(66430),v=s(40728);let y=[{value:"all",label:"All"},{value:"connected",label:"Connected"},{value:"paused",label:"Paused"},{value:"ready",label:"Ready"},{value:"setup",label:"Needs setup"}];function j(e,t,s){if(e>0)return(0,r.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1.5 text-[11px] font-medium text-success",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"size-1.5 shrink-0 rounded-full bg-success"}),e," connected"]});if(t>0){let e=s?`${t} Error (${s})`:`${t} Error`;return(0,r.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1.5 text-[11px] font-medium text-error",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"size-1.5 shrink-0 rounded-full bg-error"}),e]})}return(0,r.jsx)("span",{className:"text-[11px] text-text-muted",children:"No connections"})}let N={claude:10,kiro:10,openrouter:10,antigravity:20,"gemini-cli":20,nvidia:20,codex:30,ollama:30,qoder:30,"qoder-cn":30,github:40,opencode:40,vertex:40,cursor:50,gemini:50,"cloudflare-ai":60,poolside:60,nous:65,byteplus:70,kilocode:70,cline:80,"minimax-code":80,"minimax-code-global":80,clinepass:85,"codebuddy-cn":90,"codebuddy-intl":90,kimchi:95,agnes:120,muse:120,glm:140,kimi:170,"grok-cli":275,xai:280,"xiaomi-mimo":290};async function w(e){let t=new AbortController,s=window.setTimeout(()=>t.abort(),8e3);try{let s=await fetch(e,{cache:"no-store",signal:t.signal}),r=null;try{r=await s.json()}catch{r=null}return{response:s,data:r}}finally{window.clearTimeout(s)}}function k(){let[e,t]=(0,a.useState)([]),[s,i]=(0,a.useState)([]),[l,o]=(0,a.useState)(!0),[m,p]=(0,a.useState)(""),[f,j]=(0,a.useState)(1),[k,S]=(0,a.useState)(20),[E,P]=(0,a.useState)(!1),[O,_]=(0,a.useState)(!1),[U,q]=(0,a.useState)(()=>new Set),[z,M]=(0,a.useState)(null),[D,F]=(0,a.useState)("all"),[L,J]=(0,a.useState)({custom:!1,oauth:!1,free:!0,apikey:!0}),K=(0,x.i)(),H=(0,h.C)(e=>e.query),W=(0,h.C)(e=>e.setQuery),B=(0,h.C)(e=>e.unregister);(0,a.useEffect)(()=>()=>B(),[B]),(0,a.useEffect)(()=>{j(1)},[H,k,D]);let Q=e=>!H.trim()||e.toLowerCase().includes(H.trim().toLowerCase()),G=(e,t)=>"apikey"===t?e?.authModes?.includes("oauth")||e?.hasOAuth?["oauth","apikey"]:"apikey":"oauth"===t?e?.authModes?.includes("apikey")?["oauth","apikey"]:"oauth":t,V=(e,t)=>t.priority??N[e]??999,X=(e,t,s=null)=>el(e,s?G(s,t):t).connected>0?0:1,Z=(e,t)=>[...e].sort(([e,s],[r,a])=>{let i=X(e,t,s),l=X(r,t,a);return i!==l?i-l:(s.name||"").localeCompare(a.name||"")}),Y=(e,t,{noAuthFirst:s=!1}={})=>[...e].sort(([e,r],[a,i])=>{let l=V(e,r),n=V(a,i);if(l!==n)return l-n;if(s){let e=Number(!!i.noAuth)-Number(!!r.noAuth);if(e)return e}let o=X(e,t,r),d=X(a,t,i);return o!==d?o-d:(r.name||"").localeCompare(i.name||"")});(0,a.useEffect)(()=>{(async()=>{try{p("");let[e,s]=await Promise.allSettled([(0,b.b7)("providers:list",v.t7),w("/api/provider-nodes")]);"fulfilled"===e.status?t(e.value?.connections||[]):(t([]),p("Provider connection stats could not be loaded. The provider catalog is still available.")),"fulfilled"===s.status&&s.value.response.ok?i(s.value.data?.nodes||[]):(i([]),p(e=>e||"Custom provider data could not be loaded. The provider catalog is still available."))}catch(e){console.log("Error fetching data:",e),p("Provider data could not be loaded. The provider catalog is still available.")}finally{o(!1)}})()},[]);let ee=(0,a.useMemo)(()=>{let t=new Map;for(let s of e){let e=s.provider||s.id;t.has(e)||t.set(e,[]),t.get(e).push(s)}return t},[e]),et=e.length,es=(0,a.useMemo)(()=>e.filter(e=>!1!==e.isActive).length,[e]),er=ee.size,ea=Math.max(0,et-es),ei=et>0?Math.round(es/et*100):0,el=(e,t)=>{let s=Array.isArray(t)?t:[t],r=(ee.get(e)||[]).filter(e=>s.includes(e.authType)),a=r.filter(e=>{let t,s=(t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now()),"unavailable"!==e.testStatus||t?e.testStatus:"active");return"error"===s||"expired"===s||"unavailable"===s}),i=r.length>0?r.length:0,l=r.length>0?0:a.length,n=r.length,o=n>0&&r.every(e=>!1===e.isActive),d=a.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:i,error:l,total:n,errorCode:d?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let s=Number(e.errorCode);if(Number.isFinite(s)&&s>=400)return String(s);let r=(0,u.E2)(e.lastError);if("401"===r||"403"===r)return"AUTH";if(r&&"ERR"!==r)return r;let a=(e.lastError||"").toLowerCase();return a.includes("runtime")||a.includes("not runnable")||a.includes("not installed")?"RUNTIME":a.includes("invalid api key")||a.includes("token invalid")||a.includes("revoked")||a.includes("unauthorized")?"AUTH":"ERR"}(d):null,errorTime:d?.lastErrorAt?(0,u.gs)(d.lastErrorAt):null,allDisabled:o}},en=(e,t,s)=>{var r;return r=el(e,s),"all"===D||("connected"===D?(r?.connected||0)>0:"paused"===D?r?.allDisabled===!0:"ready"===D?0===(r?.connected||0)&&t?.noAuth===!0:0===(r?.connected||0)&&t?.noAuth!==!0)},eo=e=>{J(t=>({...t,[e]:!t[e]}))},ed=async(s,r,a)=>{let i=Array.isArray(r)?r:[r],l=e.filter(e=>e.provider===s&&i.includes(e.authType));t(e=>e.map(e=>e.provider===s&&i.includes(e.authType)?{...e,isActive:a}:e));let n=(await Promise.allSettled(l.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:a})}).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e})))).filter(e=>"rejected"===e.status).length;n>0?(t(e=>e.map(e=>e.provider===s&&i.includes(e.authType)?{...e,isActive:!a}:e)),K.error(`Failed to update ${n} connection${n>1?"s":""} — reverted`)):(0,b.au)("providers:list")},ec=async(e,t=null)=>{let s="provider"===e?t:e;if(s){q(e=>new Set(e).add(s)),M(null);try{let s=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),r=await s.json();if(M(r),r.summary){let{passed:e,failed:t,total:s}=r.summary;0===t?K.success(`All ${s} tests passed`):K.warning(`${e}/${s} passed, ${t} failed`)}}catch(e){M({error:"Test request failed"}),K.error("Provider test failed")}finally{q(e=>{let t=new Set(e);return t.delete(s),t})}}},em=s.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>Q(e.name)&&en(e.id,e,"apikey")),ep=s.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"})).filter(e=>Q(e.name)&&en(e.id,e,"apikey")),eu=e=>(e.serviceKinds??["llm"]).includes("llm"),ex=Y(Object.entries(d.zN).filter(([e,t])=>{let s=t?.authModes?.includes("apikey")?["oauth","apikey"]:"oauth";return!t.hidden&&Q(t.name)&&en(e,t,s)}),"oauth"),eh=Object.entries(c.IS).filter(([e,t])=>{let s=Array.isArray(t?.authModes)&&t.authModes.includes("apikey");return!t.hidden&&Q(t.name)&&en(e,t,s?["oauth","apikey"]:"oauth")}).sort(([,e],[,t])=>Number(!!t.noAuth)-Number(!!e.noAuth)),ef=Y(Object.entries(c.nJ).filter(([e,t])=>!t.hidden&&eu(t)&&Q(t.name)&&en(e,t,t?.authModes?.includes("oauth")?["oauth","apikey"]:"apikey")),"apikey",{noAuthFirst:!0}),eg=Z(Object.entries(d.fg).filter(([e,t])=>!t.hidden&&(t.serviceKinds??["llm"]).includes("llm")&&Q(t.name)&&en(e,t,"apikey")),"apikey"),eb=Z(Object.entries(c.br).filter(([e,t])=>!t.hidden&&eu(t)&&Q(t.name)&&en(e,t,"cookie")),"cookie"),ev=Math.min(f,Math.max(1,Math.ceil(eg.length/k))),ey=eg.slice((ev-1)*k,ev*k);if(l)return(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(n.Qv,{}),(0,r.jsx)(n.Qv,{})]});let ej=ex.length>0||eh.length>0||ef.length>0||eg.length>0||eb.length>0||em.length>0||ep.length>0,eN=em.length>0||ep.length>0||"all"===D&&!H.trim();return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[et>0&&(0,r.jsx)("div",{className:"overflow-hidden rounded-xl border border-border bg-surface/80 shadow-sm",children:(0,r.jsxs)("div",{className:"grid grid-cols-3 divide-x divide-y divide-border-subtle sm:grid-cols-4 sm:divide-y-0",children:[(0,r.jsxs)("div",{className:"col-span-3 flex items-center gap-3 px-4 py-3 sm:col-span-1",children:[(0,r.jsx)("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/[0.08] text-primary",children:(0,r.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined",style:{fontSize:18},children:"dns"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[11px] font-medium text-text-muted",children:"Connection health"}),(0,r.jsxs)("p",{className:"mt-0.5 text-sm font-semibold tabular-nums text-text-main",children:[ei,"% active"]})]})]}),(0,r.jsxs)("div",{className:"px-4 py-3",children:[(0,r.jsx)("p",{className:"text-[11px] font-medium text-text-muted",children:"Connections"}),(0,r.jsx)("p",{className:"mt-0.5 text-lg font-semibold tabular-nums text-text-main",children:et})]}),(0,r.jsxs)("div",{className:"px-4 py-3",children:[(0,r.jsx)("p",{className:"text-[11px] font-medium text-text-muted",children:"Active"}),(0,r.jsxs)("div",{className:"mt-0.5 flex items-baseline gap-2",children:[(0,r.jsx)("p",{className:"text-lg font-semibold tabular-nums text-success",children:es}),ea>0&&(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:[ea," paused"]})]})]}),(0,r.jsxs)("div",{className:"px-4 py-3",children:[(0,r.jsx)("p",{className:"text-[11px] font-medium text-text-muted",children:"Providers"}),(0,r.jsx)("p",{className:"mt-0.5 text-lg font-semibold tabular-nums text-info",children:er})]})]})}),m&&(0,r.jsx)(n.Gi,{tone:"warning",title:"Some provider status is unavailable",children:m}),(0,r.jsxs)(n.i5,{label:"Provider search and filters",children:[(0,r.jsx)(n.pd,{"aria-label":"Search providers",icon:"search",placeholder:"Search providers...",value:H,onChange:e=>W(e.target.value),className:"w-full sm:min-w-56 sm:max-w-72",inputClassName:"h-11 sm:h-9"}),(0,r.jsx)("div",{className:"flex w-full min-w-0 gap-1 overflow-x-auto rounded-xl bg-bg/70 p-1 [scrollbar-width:none] sm:w-auto [&::-webkit-scrollbar]:hidden",children:y.map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>{F(e.value),j(1),J({custom:!1,oauth:!1,free:!1,apikey:!1})},"aria-pressed":D===e.value,className:`flex h-11 flex-1 items-center justify-center whitespace-nowrap rounded-lg px-3 text-xs font-medium transition-colors sm:h-8 sm:flex-none sm:px-3 ${D===e.value?"bg-primary text-white shadow-sm":"text-text-muted hover:bg-black/5 hover:text-text-main dark:hover:bg-white/5"}`,children:e.label},e.value))})]}),!ej&&(0,r.jsx)(n.pp,{icon:"search_off",title:H.trim()?"No providers match your search":"No providers match this filter",description:"Adjust the search or status filter to see more providers.",action:(0,r.jsx)(n.$n,{variant:"secondary",onClick:()=>{W(""),F("all")},children:"Clear filters"})}),eN&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(C,{icon:"extension",title:"Custom Providers",description:"OpenAI and Anthropic-compatible endpoints",count:em.length+ep.length,collapsed:L.custom&&!H.trim(),onToggle:()=>eo("custom"),children:(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:w-auto",children:[(0,r.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>_(!0),className:"min-h-11 w-full sm:min-h-0 sm:w-auto",children:"Add Anthropic Compatible"}),(0,r.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>P(!0),className:"min-h-11 w-full sm:min-h-0 sm:w-auto",children:"Add OpenAI Compatible"})]})}),(0,r.jsx)("div",{className:L.custom&&!H.trim()?"hidden":"",children:0===em.length&&0===ep.length?(0,r.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border border-dashed border-border bg-surface/45 px-4 py-3 text-text-muted",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-2 text-[18px]",children:"add_link"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium text-text-main",children:"No custom endpoints yet"}),(0,r.jsx)("p",{className:"mt-0.5 text-xs",children:"Add an OpenAI or Anthropic-compatible endpoint when you need one."})]})]}):(0,r.jsx)("div",{className:"grid grid-cols-1 gap-2.5 sm:grid-cols-2 sm:gap-3 lg:grid-cols-3 xl:grid-cols-4",children:[...em,...ep].map(e=>(0,r.jsx)(A,{providerId:e.id,provider:e,stats:el(e.id,"apikey"),onToggle:t=>ed(e.id,"apikey",t)},e.id))})})]}),ex.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(C,{icon:"passkey",title:"OAuth Providers",description:"Connect existing provider accounts securely",count:ex.length,collapsed:L.oauth&&!H.trim(),onToggle:()=>eo("oauth"),children:(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,r.jsx)(g,{}),(0,r.jsxs)("button",{onClick:()=>ec("oauth"),disabled:U.has("oauth"),className:`flex h-11 w-full items-center justify-center gap-1.5 rounded-xl border px-3 text-xs font-medium transition-colors sm:h-8 sm:w-auto sm:rounded-lg ${U.has("oauth")?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${U.has("oauth")?" animate-spin":""}`,children:"play_arrow"}),U.has("oauth")?"Testing...":"Test All"]})]})}),(0,r.jsx)("div",{className:`${L.oauth&&!H.trim()?"hidden":"grid"} grid-cols-1 gap-2.5 sm:grid-cols-2 sm:gap-3 lg:grid-cols-3 xl:grid-cols-4`,children:ex.map(([e,t])=>{let s=G(t,"oauth");return(0,r.jsx)(T,{providerId:e,provider:t,stats:el(e,s),onToggle:t=>ed(e,s,t)},e)})})]}),(eh.length>0||ef.length>0)&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(C,{icon:"savings",title:"Free Tier Providers",description:"Ready-to-use and free-tier routing options",count:eh.length+ef.length,collapsed:L.free&&!H.trim(),onToggle:()=>eo("free"),children:(0,r.jsxs)("button",{onClick:()=>ec("free"),disabled:U.has("free"),className:`flex h-11 w-full items-center justify-center gap-1.5 rounded-xl border px-3 text-xs font-medium transition-colors sm:h-8 sm:w-auto sm:rounded-lg ${U.has("free")?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${U.has("free")?" animate-spin":""}`,children:"play_arrow"}),U.has("free")?"Testing...":"Test All"]})}),(0,r.jsxs)("div",{className:`${L.free&&!H.trim()?"hidden":"grid"} grid-cols-1 gap-2.5 sm:grid-cols-2 sm:gap-3 lg:grid-cols-3 xl:grid-cols-4`,children:[eh.map(([e,t])=>{let s=Array.isArray(t?.authModes)&&t.authModes.includes("apikey");return(0,r.jsx)(T,{providerId:e,provider:t,stats:el(e,s?["oauth","apikey"]:"oauth"),onToggle:t=>ed(e,s?"apikey":"oauth",t)},e)}),ef.map(([e,t])=>{let s=G(t,"apikey");return(0,r.jsx)(A,{providerId:e,provider:t,stats:el(e,s),onToggle:t=>ed(e,s,t)},e)})]})]}),(eg.length>0||eb.length>0)&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(C,{icon:"key",title:"API Key Providers",description:"Bring your own provider credentials",count:eg.length+eb.length,collapsed:L.apikey&&!H.trim(),onToggle:()=>eo("apikey"),children:(0,r.jsxs)("button",{onClick:()=>ec("apikey"),disabled:U.has("apikey"),className:`flex h-11 w-full items-center justify-center gap-1.5 rounded-xl border px-3 text-xs font-medium transition-colors sm:h-8 sm:w-auto sm:rounded-lg ${U.has("apikey")?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${U.has("apikey")?" animate-spin":""}`,children:"play_arrow"}),U.has("apikey")?"Testing...":"Test All"]})}),(0,r.jsxs)("div",{className:`${L.apikey&&!H.trim()?"hidden":"grid"} grid-cols-1 gap-2.5 sm:grid-cols-2 sm:gap-3 lg:grid-cols-3 xl:grid-cols-4`,children:[ey.map(([e,t])=>(0,r.jsx)(A,{providerId:e,provider:t,stats:el(e,"apikey"),onToggle:t=>ed(e,"apikey",t)},e)),eb.map(([e,t])=>(0,r.jsx)(A,{providerId:e,provider:t,stats:el(e,"cookie"),onToggle:t=>ed(e,"cookie",t)},e))]}),eg.length>0&&(0,r.jsx)("div",{className:L.apikey&&!H.trim()?"hidden":"",children:(0,r.jsx)(n.dK,{currentPage:ev,pageSize:k,totalItems:eg.length,onPageChange:j,onPageSizeChange:e=>{S(e),j(1)}})})]}),(0,r.jsx)($,{isOpen:E,onClose:()=>P(!1),onCreated:e=>{i(t=>[...t,e]),P(!1)}}),(0,r.jsx)(I,{isOpen:O,onClose:()=>_(!1),onCreated:e=>{i(t=>[...t,e]),_(!1)}}),z&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>M(null),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,r.jsx)("button",{onClick:()=>M(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,r.jsx)("div",{className:"p-5",children:(0,r.jsx)(R,{results:z})})]})]})]})}function C({icon:e,title:t,description:s,count:a,collapsed:i,onToggle:l,children:n}){return(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{className:"flex w-full min-w-0 items-center gap-2.5 sm:w-auto",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2.5 sm:flex-none",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/[0.08] text-[17px] text-primary",children:e}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h2",{className:"truncate text-lg font-semibold leading-tight",children:t}),(0,r.jsx)("span",{className:"rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold tabular-nums text-text-muted",children:a})]}),(0,r.jsx)("p",{className:"mt-0.5 truncate text-[11px] text-text-muted sm:text-xs",children:s})]})]}),(0,r.jsx)("button",{type:"button",onClick:l,className:"flex size-11 shrink-0 items-center justify-center rounded-xl border border-border text-text-muted transition-colors hover:border-primary/30 hover:text-primary sm:size-9 sm:rounded-lg","aria-expanded":!i,"aria-label":`${i?"Expand":"Collapse"} ${t}`,children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:i?"expand_more":"expand_less"})})]}),n&&(0,r.jsx)("div",{className:"block",children:n})]})}C.propTypes={icon:l().string.isRequired,title:l().string.isRequired,description:l().string.isRequired,count:l().number.isRequired,collapsed:l().bool.isRequired,onToggle:l().func.isRequired,children:l().node};let T=(0,a.memo)(function({providerId:e,provider:t,stats:s,onToggle:a}){let{connected:i,error:l,errorCode:d,allDisabled:c}=s,m=!!t.noAuth;return(0,r.jsx)("div",{className:"provider-catalog-card group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"none",className:`relative h-[76px] min-h-[76px] cursor-pointer overflow-hidden transition-[border-color,box-shadow,opacity] group-hover:border-primary/30 group-hover:shadow-[0_10px_26px_-22px_rgba(var(--brand-rgb),0.55)] sm:h-[78px] sm:min-h-[78px] ${c?"opacity-55":""}`,children:(0,r.jsxs)("div",{className:"flex h-full min-w-0 items-center justify-between gap-2.5 p-3",children:[(0,r.jsxs)(p(),{href:`/dashboard/providers/${e}`,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40",children:[(0,r.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg ring-1 ring-black/[0.04] dark:ring-white/[0.06]",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:"",size:28,className:"max-h-7 max-w-7 rounded-md object-contain",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate text-sm font-semibold text-text-main",children:t.name}),(0,r.jsx)("div",{className:"mt-1 flex min-w-0 items-center overflow-hidden whitespace-nowrap",children:c?(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] text-text-muted",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[13px]",children:"pause_circle"}),"Disabled"]}):m?(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-medium text-success",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full bg-success"}),"Ready"]}):j(i,l,d)})]})]}),(0,r.jsxs)("div",{className:"hidden shrink-0 items-center gap-2 sm:flex",children:[s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),a(!!c)},children:(0,r.jsx)(n.lM,{size:"sm",touchTarget:!0,checked:!c,onChange:()=>{},title:c?"Enable provider":"Disable provider"})}),(0,r.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[17px] text-text-subtle transition-[transform,color] group-hover:translate-x-0.5 group-hover:text-primary",children:"chevron_right"})]}),(0,r.jsx)(S,{providerId:e,hasConnections:s.total>0,active:!c,onToggle:a})]})})})});T.propTypes={providerId:l().string.isRequired,provider:l().shape({id:l().string.isRequired,name:l().string.isRequired,color:l().string,textIcon:l().string}).isRequired,stats:l().shape({connected:l().number,error:l().number,errorCode:l().string,errorTime:l().string,total:l().number,allDisabled:l().bool}).isRequired,onToggle:l().func};let A=(0,a.memo)(function({providerId:e,provider:t,stats:s,onToggle:a}){let{connected:i,error:l,errorCode:d,allDisabled:m}=s,u=e.startsWith(c.JH),x=e.startsWith(c.DI);return(0,r.jsx)("div",{className:"provider-catalog-card group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"none",className:`relative h-[76px] min-h-[76px] cursor-pointer overflow-hidden transition-[border-color,box-shadow,opacity] group-hover:border-primary/30 group-hover:shadow-[0_10px_26px_-22px_rgba(var(--brand-rgb),0.55)] sm:h-[78px] sm:min-h-[78px] ${m?"opacity-55":""}`,children:(0,r.jsxs)("div",{className:"flex h-full min-w-0 items-center justify-between gap-2.5 p-3",children:[(0,r.jsxs)(p(),{href:`/dashboard/providers/${e}`,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40",children:[(0,r.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg ring-1 ring-black/[0.04] dark:ring-white/[0.06]",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:u?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":x?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:"",size:28,className:"max-h-7 max-w-7 rounded-md object-contain",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate text-sm font-semibold text-text-main",children:t.name}),(0,r.jsx)("div",{className:"mt-1 flex min-w-0 items-center gap-1.5 overflow-hidden whitespace-nowrap",children:m?(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] text-text-muted",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[13px]",children:"pause_circle"}),"Disabled"]}):(0,r.jsxs)(r.Fragment,{children:[j(i,l,d),u&&(0,r.jsxs)("span",{className:"text-[10px] text-text-subtle",children:["\xb7 ","responses"===t.apiType?"Responses":"Chat"]}),x&&(0,r.jsx)("span",{className:"text-[10px] text-text-subtle",children:"\xb7 Messages"})]})})]})]}),(0,r.jsxs)("div",{className:"hidden shrink-0 items-center gap-2 sm:flex",children:[s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),a(!!m)},children:(0,r.jsx)(n.lM,{size:"sm",touchTarget:!0,checked:!m,onChange:()=>{},title:m?"Enable provider":"Disable provider"})}),(0,r.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[17px] text-text-subtle transition-[transform,color] group-hover:translate-x-0.5 group-hover:text-primary",children:"chevron_right"})]}),(0,r.jsx)(S,{providerId:e,hasConnections:s.total>0,active:!m,onToggle:a})]})})})});function S({providerId:e,hasConnections:t,active:s,onToggle:i}){let[l,n]=(0,a.useState)(!1),o=(0,a.useRef)(null),d=(0,a.useId)();return(0,a.useEffect)(()=>{if(!l)return;let e=e=>{"Escape"!==e.key&&o.current?.contains(e.target)||n(!1)};return document.addEventListener("keydown",e),document.addEventListener("pointerdown",e),()=>{document.removeEventListener("keydown",e),document.removeEventListener("pointerdown",e)}},[l]),(0,r.jsxs)("div",{ref:o,className:"relative shrink-0 sm:hidden",children:[(0,r.jsx)("button",{type:"button","aria-label":"Provider actions","aria-expanded":l,"aria-controls":d,onClick:()=>n(e=>!e),className:"grid size-11 place-items-center rounded-xl text-text-muted transition-colors hover:bg-surface-2 hover:text-text-main focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40",children:(0,r.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined",children:"more_vert"})}),l&&(0,r.jsxs)("div",{id:d,className:"absolute right-0 top-full z-20 mt-1 w-48 overflow-hidden rounded-xl border border-border bg-surface p-1 shadow-[var(--shadow-elev)]",children:[(0,r.jsxs)(p(),{href:`/dashboard/providers/${e}`,className:"flex min-h-11 items-center gap-2 rounded-lg px-3 text-sm text-text-main hover:bg-surface-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[18px]",children:"arrow_forward"}),"Open provider"]}),t&&(0,r.jsxs)("button",{type:"button",onClick:()=>{i(!s),n(!1)},className:"flex min-h-11 w-full items-center gap-2 rounded-lg px-3 text-left text-sm text-text-main hover:bg-surface-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[18px]",children:s?"pause_circle":"play_circle"}),s?"Disable provider":"Enable provider"]})]})]})}function $({isOpen:e,onClose:t,onCreated:s}){let[i,l]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[o,d]=(0,a.useState)(!1),[c,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),[b,v]=(0,a.useState)("");(0,a.useEffect)(()=>{let e="https://api.openai.com/v1";l(t=>t.baseUrl&&t.baseUrl!==e?t:{...t,baseUrl:e})},[i.apiType]);let y=async()=>{if(i.name.trim()&&i.prefix.trim()&&i.baseUrl.trim()){d(!0),v("");try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i.name,prefix:i.prefix,apiType:i.apiType,baseUrl:i.baseUrl,type:"openai-compatible"})}),t=await e.json().catch(()=>({}));e.ok?(s(t.node),l({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),m(""),g(null)):v(t?.error||`Failed to create node (HTTP ${e.status})`)}catch(e){console.log("Error creating OpenAI Compatible node:",e),v("Network error — could not create the node")}finally{d(!1)}}},j=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:i.baseUrl,apiKey:c,type:"openai-compatible",modelId:p.trim()||void 0})}),t=await e.json();g(t)}catch{g({valid:!1,error:"Network error"})}finally{h(!1)}};return(0,r.jsx)(n.aF,{isOpen:e,title:"Add OpenAI Compatible",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:i.name,onChange:e=>l({...i,name:e.target.value}),placeholder:"OpenAI Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,r.jsx)(n.pd,{label:"Prefix",value:i.prefix,onChange:e=>l({...i,prefix:e.target.value}),placeholder:"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,r.jsx)(n.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:i.apiType,onChange:e=>l({...i,apiType:e.target.value})}),(0,r.jsx)(n.pd,{label:"Base URL",value:i.baseUrl,onChange:e=>l({...i,baseUrl:e.target.value}),placeholder:"https://api.openai.com/v1",hint:"Use the base URL (ending in /v1) for your OpenAI-compatible API."}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>m(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:p,onChange:e=>u(e.target.value),placeholder:"e.g. gpt-4, claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),b&&(0,r.jsx)("p",{className:"text-sm text-red-500 break-words",children:b}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,r.jsx)(n.$n,{onClick:j,disabled:!c||x||!i.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:x?"Checking...":"Check"}),(()=>{if(!f)return null;let{valid:e,error:t,method:s}=f;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,r.jsx)(n.$n,{onClick:y,fullWidth:!0,disabled:!i.name.trim()||!i.prefix.trim()||!i.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function I({isOpen:e,onClose:t,onCreated:s}){let[i,l]=(0,a.useState)({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),[o,d]=(0,a.useState)(!1),[c,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),[b,v]=(0,a.useState)("");(0,a.useEffect)(()=>{e&&(g(null),m(""),u(""),v(""))},[e]);let y=async()=>{if(i.name.trim()&&i.prefix.trim()&&i.baseUrl.trim()){d(!0),v("");try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i.name,prefix:i.prefix,baseUrl:i.baseUrl,type:"anthropic-compatible"})}),t=await e.json().catch(()=>({}));e.ok?(s(t.node),l({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),m(""),g(null)):v(t?.error||`Failed to create node (HTTP ${e.status})`)}catch(e){console.log("Error creating Anthropic Compatible node:",e),v("Network error — could not create the node")}finally{d(!1)}}},j=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:i.baseUrl,apiKey:c,type:"anthropic-compatible",modelId:p.trim()||void 0})}),t=await e.json();g(t)}catch{g({valid:!1,error:"Network error"})}finally{h(!1)}};return(0,r.jsx)(n.aF,{isOpen:e,title:"Add Anthropic Compatible",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:i.name,onChange:e=>l({...i,name:e.target.value}),placeholder:"Anthropic Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,r.jsx)(n.pd,{label:"Prefix",value:i.prefix,onChange:e=>l({...i,prefix:e.target.value}),placeholder:"ac-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,r.jsx)(n.pd,{label:"Base URL",value:i.baseUrl,onChange:e=>l({...i,baseUrl:e.target.value}),placeholder:"https://api.anthropic.com/v1",hint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages."}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>m(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:p,onChange:e=>u(e.target.value),placeholder:"e.g. claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),b&&(0,r.jsx)("p",{className:"text-sm text-red-500 break-words",children:b}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,r.jsx)(n.$n,{onClick:j,disabled:!c||x||!i.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:x?"Checking...":"Check"}),(()=>{if(!f)return null;let{valid:e,error:t,method:s}=f;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,r.jsx)(n.$n,{onClick:y,fullWidth:!0,disabled:!i.name.trim()||!i.prefix.trim()||!i.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function R({results:e}){if(e.error&&!e.results)return(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,r.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:s}=e,a=e.results||[];return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,r.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[s]||s," Test"]}),(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,r.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),a.map((e,t)=>(0,r.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,r.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,r.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,r.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]}),!e.valid&&(e.diagnosis?.message||e.error)&&(0,r.jsx)("span",{className:"block truncate text-[11px] text-red-400/90",title:String(e.diagnosis?.message||e.error),children:String(e.diagnosis?.message||e.error)})]}),void 0!==e.latencyMs&&(0,r.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,r.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===a.length&&(0,r.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}S.propTypes={providerId:l().string.isRequired,hasConnections:l().bool.isRequired,active:l().bool.isRequired,onToggle:l().func.isRequired},A.propTypes={providerId:l().string.isRequired,provider:l().shape({id:l().string.isRequired,name:l().string.isRequired,color:l().string,textIcon:l().string,apiType:l().string}).isRequired,stats:l().shape({connected:l().number,error:l().number,errorCode:l().string,errorTime:l().string,total:l().number,allDisabled:l().bool}).isRequired,onToggle:l().func},$.propTypes={isOpen:l().bool.isRequired,onClose:l().func.isRequired,onCreated:l().func.isRequired},I.propTypes={isOpen:l().bool.isRequired,onClose:l().func.isRequired,onCreated:l().func.isRequired},R.propTypes={results:l().shape({mode:l().string,results:l().array,summary:l().shape({total:l().number,passed:l().number,failed:l().number}),error:l().string}).isRequired}},68211:(e,t,s)=>{"use strict";s.d(t,{fetchJson:()=>a});let r={"Content-Type":"application/json"};async function a(e,t={}){let{body:s,headers:i,...l}=t,n={...l,headers:{...r,...i}};void 0!==s&&"string"!=typeof s?n.body=JSON.stringify(s):void 0!==s&&(n.body=s);let o=await fetch(e,n),d=await o.text(),c=null;if(d)try{c=JSON.parse(d)}catch{let t=Error(`Non-JSON response from ${e} (HTTP ${o.status})`);throw t.status=o.status,t.rawBody=d.slice(0,300),t}if(!o.ok){let e=c&&(c.error?.message||c.error||c.message)||`Request failed (HTTP ${o.status})`,t=Error("string"==typeof e?e:`HTTP ${o.status}`);throw t.status=o.status,t.data=c,t}return c}a.get=(e,t)=>a(e,{...t,method:"GET"}),a.post=(e,t,s)=>a(e,{...s,method:"POST",body:t}),a.put=(e,t,s)=>a(e,{...s,method:"PUT",body:t}),a.patch=(e,t,s)=>a(e,{...s,method:"PATCH",body:t}),a.del=(e,t)=>a(e,{...t,method:"DELETE"})}},e=>{e.O(0,[2574,3862,3745,3416,9501,620,5497,8441,3794,7358],()=>e(e.s=44459)),_N_E=e.O()}]);
|
package/cli/app/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Unreleased
|
|
2
2
|
|
|
3
|
+
# v1.1.81 (2026-11-19)
|
|
4
|
+
|
|
5
|
+
## Changes
|
|
6
|
+
- **AI Studio (`ais/`) and Antigravity (`ag/`/`agy/`) Gemini 4 Neon catalog.** Added `gemini-4-neon` to Google AI Studio and `gemini-4-neon-xhigh`, `gemini-4-neon-high`, `gemini-4-neon-medium`, and `gemini-4-neon-low` to the Antigravity OAuth catalog, quota tracker, and MITM tool aliases.
|
|
7
|
+
- **Nous Research (`nous/`) OAuth token refresh, quota tracker, and free catalog.** Added OAuth refresh-token exchange, dashboard Test/Validate health probes, and a Nous usage tracker reading OAuth JWT rate-limit/spend claims and live `/v1/models` verification, plus updated the free model catalog (`qwen/qwen4-max:free`, `google/gemma-4-31b-it:free`, `stepfun/step-3.7-flash:free`, `poolside/laguna-s-2.1:free`, `poolside/laguna-xs-2.1:free`, `stealth/missingno`).
|
|
8
|
+
|
|
9
|
+
## Fixes
|
|
10
|
+
- **Antigravity (`ag/`/`agy/`) Google Cloud Code WAF prompt/tool sanitization, stealth sideloading, and anti-cascade `403 TOS_VIOLATION` protection.** Upgraded Antigravity CLI/IDE fingerprints (`1.5.9` / `2.32.1`, Piper `cl=1021296516`) with CLI fingerprint routing for all `gemini-4-*` models and OAuth `aicode` scope; added literal WAF prompt/tool directive sanitization and `<system-instruction>` stealth sideloading; stopped credential rotation on `403 TOS_VIOLATION` with immediate quarantine and appeal URL surfacing; aligned quota polling hosts with inference (`Daily -> Sandbox`); and added auto-heal downgrade for `400` unsupported `XHIGH` thinking level errors.
|
|
11
|
+
- **Dashboard Free Tier provider connection badge.** Fixed Free Tier provider cards (`nous`, `kimchi`) on `/dashboard/providers` to count, sort, and toggle both OAuth and API key connections.
|
|
12
|
+
|
|
3
13
|
# v1.1.80 (2026-11-18)
|
|
4
14
|
|
|
5
15
|
## Fixes
|