omniroute 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.env +110 -0
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +50 -50
- package/app/.next/build-manifest.json +3 -3
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/required-server-files.json +4 -4
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/costs/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/costs/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/logs/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error/page.js +3 -3
- package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error.html +2 -2
- package/app/.next/server/app/_global-error.rsc +4 -4
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js +2 -2
- package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/login/route.js +1 -1
- package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/logout/route.js +1 -1
- package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/status/route.js +1 -1
- package/app/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cache/route.js +1 -1
- package/app/.next/server/app/api/cache/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cache/stats/route.js +1 -1
- package/app/.next/server/app/api/cache/stats/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +3 -3
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/backups/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/backups/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/claude-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-profiles/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/codex-profiles/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/status/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/metrics/route.js +1 -1
- package/app/.next/server/app/api/combos/metrics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/route.js +1 -1
- package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/test/route.js +1 -1
- package/app/.next/server/app/api/combos/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/compliance/audit-log/route.js +1 -1
- package/app/.next/server/app/api/compliance/audit-log/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/export/route.js +1 -1
- package/app/.next/server/app/api/db-backups/export/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/exportAll/route.js +1 -1
- package/app/.next/server/app/api/db-backups/exportAll/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/import/route.js +1 -1
- package/app/.next/server/app/api/db-backups/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/route.js +1 -1
- package/app/.next/server/app/api/db-backups/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/evals/[suiteId]/route.js +1 -1
- package/app/.next/server/app/api/evals/[suiteId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/evals/route.js +1 -1
- package/app/.next/server/app/api/evals/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/fallback/chains/route.js +2 -2
- package/app/.next/server/app/api/fallback/chains/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/init/route.js +1 -1
- package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/route.js +1 -1
- package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/logs/console/route.js +1 -1
- package/app/.next/server/app/api/logs/console/route.js.nft.json +1 -1
- package/app/.next/server/app/api/logs/console/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/alias/route.js +1 -1
- package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/availability/route.js +1 -1
- package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/catalog/route.js +2 -2
- package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/route.js +2 -2
- package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/monitoring/health/route.js +2 -2
- package/app/.next/server/app/api/monitoring/health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +2 -2
- package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/policies/route.js +2 -2
- package/app/.next/server/app/api/policies/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/defaults/route.js +1 -1
- package/app/.next/server/app/api/pricing/defaults/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/models/route.js +1 -1
- package/app/.next/server/app/api/pricing/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/route.js +1 -1
- package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-metrics/route.js +2 -2
- package/app/.next/server/app/api/provider-metrics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-models/route.js +1 -1
- package/app/.next/server/app/api/provider-models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route.js +2 -2
- package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route.js +2 -2
- package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/client/route.js +1 -1
- package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/route.js +2 -2
- package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/validate/route.js +1 -1
- package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limit/route.js +1 -1
- package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limits/route.js +1 -1
- package/app/.next/server/app/api/rate-limits/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/resilience/reset/route.js +1 -1
- package/app/.next/server/app/api/resilience/reset/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/resilience/route.js +1 -1
- package/app/.next/server/app/api/resilience/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/restart/route.js +1 -1
- package/app/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sessions/route.js +1 -1
- package/app/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/combo-defaults/route.js +1 -1
- package/app/.next/server/app/api/settings/combo-defaults/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/ip-filter/route.js +1 -1
- package/app/.next/server/app/api/settings/ip-filter/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/proxy/route.js +1 -1
- package/app/.next/server/app/api/settings/proxy/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/proxy/test/route.js +1 -1
- package/app/.next/server/app/api/settings/proxy/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/route.js +1 -1
- package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route.js +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/thinking-budget/route.js +1 -1
- package/app/.next/server/app/api/settings/thinking-budget/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/shutdown/route.js +1 -1
- package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/storage/health/route.js +1 -1
- package/app/.next/server/app/api/storage/health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tags/route.js +1 -1
- package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/telemetry/summary/route.js +1 -1
- package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/token-health/route.js +1 -1
- package/app/.next/server/app/api/token-health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/detect/route.js +1 -1
- package/app/.next/server/app/api/translator/detect/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/history/route.js +1 -1
- package/app/.next/server/app/api/translator/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/load/route.js +1 -1
- package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/save/route.js +1 -1
- package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/send/route.js +1 -1
- package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/translate/route.js +1 -1
- package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/analytics/route.js +1 -1
- package/app/.next/server/app/api/usage/analytics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/budget/route.js +2 -2
- package/app/.next/server/app/api/usage/budget/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/[id]/route.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/history/route.js +1 -1
- package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/logs/route.js +1 -1
- package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/proxy-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/proxy-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/models/route.js +2 -2
- package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/moderations/route.js +1 -1
- package/app/.next/server/app/api/v1/moderations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/moderations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/rerank/route.js +1 -1
- package/app/.next/server/app/api/v1/rerank/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/rerank/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/route.js +1 -1
- package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route.js +2 -2
- package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback/page.js +2 -2
- package/app/.next/server/app/callback/page.js.nft.json +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/docs/page.js +3 -3
- package/app/.next/server/app/docs/page.js.nft.json +1 -1
- package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forbidden/page.js +2 -2
- package/app/.next/server/app/forbidden/page.js.nft.json +1 -1
- package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forgot-password/page.js +2 -2
- package/app/.next/server/app/forgot-password/page.js.nft.json +1 -1
- package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing/page.js +2 -2
- package/app/.next/server/app/landing/page.js.nft.json +1 -1
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login/page.js +2 -2
- package/app/.next/server/app/login/page.js.nft.json +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/page.js +2 -2
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/privacy/page.js +2 -2
- package/app/.next/server/app/privacy/page.js.nft.json +1 -1
- package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/terms/page.js +2 -2
- package/app/.next/server/app/terms/page.js.nft.json +1 -1
- package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +50 -50
- package/app/.next/server/chunks/2180.js +1 -1
- package/app/.next/server/chunks/2910.js +1 -1
- package/app/.next/server/chunks/3498.js +1 -1
- package/app/.next/server/chunks/3801.js +2 -0
- package/app/.next/server/chunks/4488.js +1 -1
- package/app/.next/server/chunks/7109.js +1 -1
- package/app/.next/server/chunks/8020.js +3 -3
- package/app/.next/server/chunks/9548.js +1 -0
- package/app/.next/server/chunks/9824.js +2 -2
- package/app/.next/server/middleware-build-manifest.js +1 -1
- package/app/.next/server/middleware.js +3 -3
- package/app/.next/server/next-font-manifest.js +1 -1
- package/app/.next/server/next-font-manifest.json +1 -1
- package/app/.next/server/pages/500.html +2 -2
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/{5846-4d550ce248336a0a.js → 5846-dc83396127b87ed7.js} +1 -1
- package/app/.next/static/chunks/993-95359de84711765c.js +21 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/loading-ce5214cdf489c9df.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/{page-52f76c7c91444ec2.js → page-20786f2c7fdbab57.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-12d772841a253032.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-c9b98846b8479f3f.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-6453cc8ebb7db016.js +15 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-85a3e6a423aceded.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/costs/{page-3ed2a7685adf9b91.js → page-cdb8071441476da9.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-ef0038a40cb26943.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/health/{page-9a6519bf1468f16e.js → page-b480b3cb318782d7.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/limits/page-0ae1d6cc5fc4671f.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/logs/{page-833d24f322a20f5a.js → page-ffdc1dcf074c7528.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/onboarding/{page-d424641c7e428be9.js → page-5378e9473a20cd6a.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-5c87e49261a22fd5.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-b38f2d03bae8166a.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{error-2f0177a2197dd556.js → error-f0730d6d62d02e82.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{loading-99ab4d478260d53b.js → loading-59cbccd6d5185ca9.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-a7fb36872be60fe0.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{page-1f022385b812b987.js → page-40dc5ac82df708e9.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/{error-e844916e39172c8b.js → error-cc85c3ff1f63aea6.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/{loading-bb068659ee679ff4.js → loading-19fc771a287bcb4c.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-085a5e0a1d0de919.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/{page-f10a8d4bb8236913.js → page-cbe9b21b62bbc2bd.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/{page-83b07523f81d6282.js → page-534e13a69cb60a4f.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/{page-9cc99ab874fc36e7.js → page-86a076d820931a30.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/{layout-00d5d56af65098a9.js → layout-16302e54f9ef3d0e.js} +1 -1
- package/app/.next/static/chunks/app/callback/{page-585a53f7dc6a30f1.js → page-0f0ebc0820dd18a5.js} +1 -1
- package/app/.next/static/chunks/app/docs/{page-2fe9dcbeb3f738c0.js → page-3658b3f15df3a19e.js} +1 -1
- package/app/.next/static/chunks/app/{error-0d59fc4efafbc38c.js → error-f918d9961a2368d3.js} +1 -1
- package/app/.next/static/chunks/app/forbidden/page-77657dfa95e61cd8.js +1 -0
- package/app/.next/static/chunks/app/forgot-password/page-be3bacc125c30a6b.js +1 -0
- package/app/.next/static/chunks/app/global-error-504ff9093e2a997d.js +1 -0
- package/app/.next/static/chunks/app/landing/page-75b0c988db383cfc.js +1 -0
- package/app/.next/static/chunks/app/{layout-108592eafb959363.js → layout-070972eb026af319.js} +1 -1
- package/app/.next/static/chunks/app/login/{page-121c612ee459e7c2.js → page-6c769465e407368f.js} +1 -1
- package/app/.next/static/chunks/app/not-found-11b712c853d93172.js +1 -0
- package/app/.next/static/chunks/app/privacy/{page-2fe9dcbeb3f738c0.js → page-3658b3f15df3a19e.js} +1 -1
- package/app/.next/static/chunks/app/terms/{page-2fe9dcbeb3f738c0.js → page-3658b3f15df3a19e.js} +1 -1
- package/app/.next/static/chunks/{main-app-c9da11a8061df107.js → main-app-ae230f6bf51a5edb.js} +1 -1
- package/app/logs/application/app.log +6685 -0
- package/app/package.json +3 -1
- package/app/server.js +1 -1
- package/package.json +3 -1
- package/scripts/postinstall.mjs +57 -0
- package/app/.next/server/chunks/5248.js +0 -1
- package/app/.next/server/chunks/5393.js +0 -2
- package/app/.next/static/chunks/993-cf9fe6c017bc7e67.js +0 -21
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/loading-6f1750506292c630.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-1dd4d0c348a7b0a6.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-e5bf8955e7b9a4f5.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-11e68927df2ceb77.js +0 -15
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-6abed29d64c46388.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-1420c3ca376f1585.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/limits/page-f4a2d6d07df5ddc4.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-388840686801f3f5.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-9c8ffb212f855704.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-31cdb6e15134d8c2.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-1393d4935fc087cf.js +0 -1
- package/app/.next/static/chunks/app/forbidden/page-df886dfa2d5bd9fa.js +0 -1
- package/app/.next/static/chunks/app/forgot-password/page-2a495f0b0c653ab4.js +0 -1
- package/app/.next/static/chunks/app/global-error-41eef2a698918fc1.js +0 -1
- package/app/.next/static/chunks/app/landing/page-9d540ab1716f8e3e.js +0 -1
- package/app/.next/static/chunks/app/not-found-1dbd8c3e506fe00f.js +0 -1
- /package/app/.next/static/{8-doeVY8E2CPMK7rYufd5 → GhECt_DwDldLWyCh-8168}/_buildManifest.js +0 -0
- /package/app/.next/static/{8-doeVY8E2CPMK7rYufd5 → GhECt_DwDldLWyCh-8168}/_ssgManifest.js +0 -0
package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/loading-ce5214cdf489c9df.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[597],{4053:(s,a,r)=>{"use strict";r.r(a),r.d(a,{default:()=>e});var d=r(95155);function e(){return(0,d.jsxs)("div",{className:"space-y-6 animate-pulse p-6",children:[(0,d.jsx)("div",{className:"h-8 bg-gray-200 dark:bg-gray-700 rounded w-40"}),(0,d.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[1,2,3,4].map(s=>(0,d.jsx)("div",{className:"h-24 bg-gray-200 dark:bg-gray-700 rounded-lg"},s))}),(0,d.jsx)("div",{className:"h-64 bg-gray-200 dark:bg-gray-700 rounded-lg"})]})}},12910:(s,a,r)=>{Promise.resolve().then(r.bind(r,4053))}},s=>{s.O(0,[8441,3794,7358],()=>s(s.s=12910)),_N_E=s.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8978],{53701:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var a=s(95155),l=s(12115),n=s(40993),r=s(50910),i=s(67671);let d=[{name:"contains",labelKey:"evalsStrategyContainsLabel",icon:"search",color:"text-sky-400",bg:"bg-sky-500/10",descriptionKey:"evalsStrategyContainsDescription"},{name:"exact",labelKey:"evalsStrategyExactLabel",icon:"check_circle",color:"text-emerald-400",bg:"bg-emerald-500/10",descriptionKey:"evalsStrategyExactDescription"},{name:"regex",labelKey:"evalsStrategyRegexLabel",icon:"code",color:"text-amber-400",bg:"bg-amber-500/10",descriptionKey:"evalsStrategyRegexDescription"},{name:"custom",labelKey:"evalsStrategyCustomLabel",icon:"tune",color:"text-violet-400",bg:"bg-violet-500/10",descriptionKey:"evalsStrategyCustomDescription"}];function c(){let e=(0,r.c)("usage"),[t,s]=(0,l.useState)([]),[c,m]=(0,l.useState)(null),[o,p]=(0,l.useState)(!0),[u,h]=(0,l.useState)(null),[g,b]=(0,l.useState)({current:0,total:0}),[f,j]=(0,l.useState)({}),[y,v]=(0,l.useState)(""),[N,k]=(0,l.useState)(null),[w,S]=(0,l.useState)(!1),C=(0,i.i)(),R=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/evals");if(e.ok){let t=await e.json();s(Array.isArray(t)?t:t.suites||[])}}catch{}finally{p(!1)}},[]),E=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/keys");if(!e.ok)return;let t=await e.json(),s=t?.keys?.[0]?.key||null;m(s)}catch{}},[]);(0,l.useEffect)(()=>{R(),E()},[R,E]);let D=async e=>{try{let t={"Content-Type":"application/json"};c&&(t.Authorization=`Bearer ${c}`);let s=await fetch("/v1/chat/completions",{method:"POST",headers:t,body:JSON.stringify({model:e.model||"gpt-4o",messages:e.input?.messages||[],max_tokens:512,stream:!1})});if(!s.ok)return`[ERROR: HTTP ${s.status}]`;let a=await s.json();return a.choices?.[0]?.message?.content||"[No content returned]"}catch(e){return`[ERROR: ${e.message}]`}},T=async t=>{let s=t.cases||[];if(0===s.length)return void C.warning(e("notifyNoTestCases"));h(t.id),b({current:0,total:s.length});try{let a={};for(let e=0;e<s.length;e++){b({current:e+1,total:s.length});let t=await D(s[e]);a[s[e].id]=t}let l=await fetch("/api/evals",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suiteId:t.id,outputs:a})}),n=await l.json();if(j(e=>({...e,[t.id]:n})),n.summary){let{passed:s,failed:a,total:l}=n.summary;0===a?C.success(e("notifyAllCasesPassed",{total:l}),e("notifyEvalTitle",{name:t.name||t.id})):C.warning(e("notifySomeCasesFailed",{passed:s,total:l,failed:a}),e("notifyEvalTitle",{name:t.name||t.id}))}k(t.id)}catch{C.error(e("notifyEvalRunFailed"))}finally{h(null),b({current:0,total:0})}},$=t.filter(e=>!y||e.name?.toLowerCase().includes(y.toLowerCase())||e.id?.toLowerCase().includes(y.toLowerCase())),L=t.reduce((e,t)=>e+(t.cases?.length||t.caseCount||0),0),_=[...new Set(t.flatMap(e=>(e.cases||[]).map(e=>e.model)).filter(Boolean))];if(o)return(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted p-8 animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"science"}),e("evalsLoading")]});if(0===t.length)return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(x,{}),(0,a.jsx)(n.pp,{icon:"science",title:e("noEvalSuitesFound"),description:e("noEvalSuitesDescription")})]});let K=[{key:"caseName",label:e("columnCase")},{key:"status",label:e("columnStatus")},{key:"durationMs",label:e("columnLatency")},{key:"details",label:e("columnDetails")}];return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(x,{t:e}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,a.jsxs)(n.Zp,{className:"px-4 py-3 text-center",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold tracking-wide",children:e("statsSuites")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-violet-400",children:t.length})]}),(0,a.jsxs)(n.Zp,{className:"px-4 py-3 text-center",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold tracking-wide",children:e("statsTestCases")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-sky-400",children:L})]}),(0,a.jsxs)(n.Zp,{className:"px-4 py-3 text-center",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold tracking-wide",children:e("statsModels")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-emerald-400",children:_.length})]}),(0,a.jsxs)(n.Zp,{className:"px-4 py-3 text-center",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold tracking-wide",children:e("statsCoverage")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-amber-400",children:e("statsStrategiesCount",{count:d.length})})]})]}),(0,a.jsxs)(n.Zp,{className:"p-0 overflow-hidden",children:[(0,a.jsxs)("button",{onClick:()=>S(!w),className:"w-full flex items-center justify-between px-6 py-4 hover:bg-surface/30 transition-colors text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"help"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e("howItWorks")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("howItWorksSubtitle")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted transition-transform duration-200 ${w?"rotate-180":""}`,children:"expand_more"})]}),w&&(0,a.jsxs)("div",{className:"px-6 pb-6 border-t border-border/10",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mt-4",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-4 rounded-lg bg-violet-500/5 border border-violet-500/10",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full bg-violet-500/20 flex items-center justify-center mb-3",children:(0,a.jsx)("span",{className:"text-lg font-bold text-violet-400",children:"1"})}),(0,a.jsx)("h4",{className:"text-sm font-semibold text-text-main mb-1",children:e("define")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("defineStepDescription")})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-4 rounded-lg bg-sky-500/5 border border-sky-500/10",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full bg-sky-500/20 flex items-center justify-center mb-3",children:(0,a.jsx)("span",{className:"text-lg font-bold text-sky-400",children:"2"})}),(0,a.jsx)("h4",{className:"text-sm font-semibold text-text-main mb-1",children:e("run")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("runStepDescription")})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-4 rounded-lg bg-emerald-500/5 border border-emerald-500/10",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full bg-emerald-500/20 flex items-center justify-center mb-3",children:(0,a.jsx)("span",{className:"text-lg font-bold text-emerald-400",children:"3"})}),(0,a.jsx)("h4",{className:"text-sm font-semibold text-text-main mb-1",children:e("evaluate")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("evaluateStepDescription")})]})]}),(0,a.jsxs)("div",{className:"mt-6",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide mb-3",children:e("evaluationStrategies")}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:d.map(t=>(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg ${t.bg} border border-transparent`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${t.color}`,children:t.icon}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`text-xs font-mono font-semibold ${t.color}`,children:e(t.labelKey)}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:e(t.descriptionKey)})]})]},t.name))})]}),_.length>0&&(0,a.jsxs)("div",{className:"mt-6",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide mb-3",children:e("modelsUnderTest")}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:_.map(e=>(0,a.jsx)("span",{className:"px-3 py-1.5 rounded-full text-xs font-mono font-medium bg-primary/10 text-primary border border-primary/20",children:e},e))})]})]})]}),(0,a.jsxs)(n.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-violet-500/10 text-violet-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"science"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:e("evalSuites")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("evalSuitesHint")})]})]}),(0,a.jsx)(n.Qn,{searchValue:y,onSearchChange:v,placeholder:e("searchSuitesPlaceholder"),filters:[],activeFilters:{},onFilterChange:()=>{},children:null}),(0,a.jsx)("div",{className:"flex flex-col gap-3 mt-4",children:$.map(t=>{let s=f[t.id],l=u===t.id,r=N===t.id,i=t.cases?.length||t.caseCount||0,c=[...new Set((t.cases||[]).map(e=>e.model).filter(Boolean))];return(0,a.jsxs)("div",{className:"border border-border/30 rounded-lg overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 cursor-pointer hover:bg-surface/30 transition-colors",onClick:()=>k(r?null:t.id),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted",children:r?"expand_more":"chevron_right"}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:t.name||t.id}),s?.summary&&(0,a.jsxs)("span",{className:`px-2 py-0.5 rounded-full text-xs font-semibold ${100===s.summary.passRate?"bg-emerald-500/10 text-emerald-400":s.summary.passRate>=80?"bg-amber-500/10 text-amber-400":"bg-red-500/10 text-red-400"}`,children:[s.summary.passRate,"% ",e("passSuffix")]})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[e("casesCount",{count:i}),t.description&&(0,a.jsxs)("span",{className:"ml-1",children:["— ",t.description]})]}),c.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:c.map(e=>(0,a.jsx)("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono text-text-muted bg-black/5 dark:bg-white/5",children:e},e))})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[l&&g.total>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-24 h-1.5 bg-black/10 dark:bg-white/10 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-violet-500 rounded-full transition-all duration-300",style:{width:`${g.current/g.total*100}%`}})}),(0,a.jsxs)("span",{className:"text-xs text-text-muted font-mono tabular-nums",children:[g.current,"/",g.total]})]}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",onClick:e=>{e.stopPropagation(),T(t)},loading:l,disabled:l,children:l?e("runningProgress",{current:g.current,total:g.total}):e("runEval")})]})]}),r&&(0,a.jsx)("div",{className:"border-t border-border/20 p-4",children:s?.results?(0,a.jsxs)(a.Fragment,{children:[s.summary&&(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-4 p-3 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:`text-lg font-bold ${100===s.summary.passRate?"text-emerald-400":s.summary.passRate>=80?"text-amber-400":"text-red-400"}`,children:[s.summary.passRate,"%"]}),(0,a.jsx)("span",{className:"text-xs text-text-muted",children:e("passRate")})]}),(0,a.jsx)("div",{className:"text-xs text-text-muted",children:e("summaryBreakdown",{passed:s.summary.passed,failed:s.summary.failed,total:s.summary.total})}),(0,a.jsx)("div",{className:"flex-1 h-2 bg-black/10 dark:bg-white/10 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${s.summary.passRate}%`,background:100===s.summary.passRate?"linear-gradient(90deg, #22c55e, #16a34a)":s.summary.passRate>=80?"linear-gradient(90deg, #f59e0b, #d97706)":"linear-gradient(90deg, #ef4444, #dc2626)"}})})]}),(0,a.jsx)(n.bQ,{columns:K,data:s.results.map((e,t)=>({...e,id:e.caseId||t})),renderCell:(t,s)=>{if("status"===s.key)return t.passed?(0,a.jsx)("span",{className:"text-emerald-400",children:e("passedIconLabel")}):(0,a.jsx)("span",{className:"text-red-400",children:e("failedIconLabel")});if("durationMs"===s.key)return(0,a.jsx)("span",{className:"text-text-muted text-xs font-mono",children:null!=t.durationMs?`${t.durationMs}ms`:"—"});if("details"===s.key){let s=t.details||{};return(0,a.jsx)("span",{className:"text-text-muted text-xs truncate max-w-[300px] block",children:String(s.searchTerm?e("detailsContains",{term:s.searchTerm}):s.pattern?e("detailsRegex",{pattern:s.pattern}):s.expected?e("detailsExpected",{expected:String(s.expected).slice(0,50)}):t.error||"—")})}return(0,a.jsx)("span",{className:"text-sm text-text-main",children:t[s.key]||"—"})},maxHeight:"400px",emptyMessage:e("noResultsYet")})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted",children:"checklist"}),(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:e("testCasesCount",{count:(t.cases||[]).length})})]}),(0,a.jsx)(n.bQ,{columns:[{key:"name",label:e("columnCase")},{key:"model",label:e("columnModel")},{key:"strategy",label:e("columnStrategy")},{key:"expected",label:e("columnExpected")}],data:(t.cases||[]).map((e,t)=>({id:e.id||t,name:e.name,model:e.model||"—",strategy:e.expected?.strategy||"—",expected:e.expected?.value?String(e.expected.value).slice(0,80):"—"})),renderCell:(e,t)=>{if("strategy"===t.key){let t=d.find(t=>t.name===e.strategy);return(0,a.jsx)("span",{className:`text-xs font-mono font-semibold ${t?.color||"text-text-muted"}`,children:e.strategy})}return"model"===t.key?(0,a.jsx)("span",{className:"text-xs font-mono text-primary/80",children:e.model}):"expected"===t.key?(0,a.jsx)("span",{className:"text-text-muted text-xs font-mono truncate max-w-[300px] block",children:e.expected}):(0,a.jsx)("span",{className:"text-sm text-text-main",children:e[t.key]||"—"})},maxHeight:"400px",emptyMessage:e("noTestCasesDefined")}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-3 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),e("runEvalHint")]})]})})]},t.id)})})]})]})}function x({t:e}){return(0,a.jsx)(n.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsx)("div",{className:"p-6",style:{background:"linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(59, 130, 246, 0.05) 50%, rgba(16, 185, 129, 0.05) 100%)"},children:(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"p-3 rounded-xl bg-violet-500/10 text-violet-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px]",children:"science"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h2",{className:"text-xl font-bold text-text-main mb-1",children:e("modelEvals")}),(0,a.jsx)("p",{className:"text-sm text-text-muted leading-relaxed max-w-2xl",children:e("evalsHeroDescription")}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-4 mt-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-emerald-400",children:"verified"}),e("qualityValidation")]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-sky-400",children:"compare"}),e("modelComparison")]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-400",children:"bug_report"}),e("regressionDetection")]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-violet-400",children:"speed"}),e("latencyBenchmarks")]})]})]})]})})})}function m(){let[e,t]=(0,l.useState)("overview"),s=(0,r.c)("analytics"),i={overview:s("overviewDescription"),evals:s("evalsDescription")};return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[28px]",children:"analytics"}),s("title")]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:i[e]})]}),(0,a.jsx)(n.Iz,{options:[{value:"overview",label:s("overview")},{value:"evals",label:s("evals")}],value:e,onChange:t}),"overview"===e&&(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(n.Qv,{}),children:(0,a.jsx)(n.cn,{})}),"evals"===e&&(0,a.jsx)(c,{})]})}},69589:(e,t,s)=>{Promise.resolve().then(s.bind(s,53701))}},e=>{e.O(0,[3418,8500,9751,8055,1149,5846,993,8441,3794,7358],()=>e(e.s=69589)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8978],{53701:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var a=s(95155),l=s(12115),n=s(40993),r=s(50910),i=s(67671);let d=[{name:"contains",labelKey:"evalsStrategyContainsLabel",icon:"search",color:"text-sky-400",bg:"bg-sky-500/10",descriptionKey:"evalsStrategyContainsDescription"},{name:"exact",labelKey:"evalsStrategyExactLabel",icon:"check_circle",color:"text-emerald-400",bg:"bg-emerald-500/10",descriptionKey:"evalsStrategyExactDescription"},{name:"regex",labelKey:"evalsStrategyRegexLabel",icon:"code",color:"text-amber-400",bg:"bg-amber-500/10",descriptionKey:"evalsStrategyRegexDescription"},{name:"custom",labelKey:"evalsStrategyCustomLabel",icon:"tune",color:"text-violet-400",bg:"bg-violet-500/10",descriptionKey:"evalsStrategyCustomDescription"}];function c(){let e=(0,r.c)("usage"),[t,s]=(0,l.useState)([]),[c,m]=(0,l.useState)(null),[o,p]=(0,l.useState)(!0),[u,h]=(0,l.useState)(null),[g,b]=(0,l.useState)({current:0,total:0}),[f,j]=(0,l.useState)({}),[y,v]=(0,l.useState)(""),[N,k]=(0,l.useState)(null),[w,S]=(0,l.useState)(!1),C=(0,i.i)(),R=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/evals");if(e.ok){let t=await e.json();s(Array.isArray(t)?t:t.suites||[])}}catch{}finally{p(!1)}},[]),E=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/keys");if(!e.ok)return;let t=await e.json(),s=t?.keys?.[0]?.key||null;m(s)}catch{}},[]);(0,l.useEffect)(()=>{R(),E()},[R,E]);let D=async e=>{try{let t={"Content-Type":"application/json"};c&&(t.Authorization=`Bearer ${c}`);let s=await fetch("/v1/chat/completions",{method:"POST",headers:t,body:JSON.stringify({model:e.model||"gpt-4o",messages:e.input?.messages||[],max_tokens:512,stream:!1})});if(!s.ok)return`[ERROR: HTTP ${s.status}]`;let a=await s.json();return a.choices?.[0]?.message?.content||"[No content returned]"}catch(e){return`[ERROR: ${e.message}]`}},T=async t=>{let s=t.cases||[];if(0===s.length)return void C.warning(e("notifyNoTestCases"));h(t.id),b({current:0,total:s.length});try{let a={};for(let e=0;e<s.length;e++){b({current:e+1,total:s.length});let t=await D(s[e]);a[s[e].id]=t}let l=await fetch("/api/evals",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suiteId:t.id,outputs:a})}),n=await l.json();if(j(e=>({...e,[t.id]:n})),n.summary){let{passed:s,failed:a,total:l}=n.summary;0===a?C.success(e("notifyAllCasesPassed",{total:l}),e("notifyEvalTitle",{name:t.name||t.id})):C.warning(e("notifySomeCasesFailed",{passed:s,total:l,failed:a}),e("notifyEvalTitle",{name:t.name||t.id}))}k(t.id)}catch{C.error(e("notifyEvalRunFailed"))}finally{h(null),b({current:0,total:0})}},$=t.filter(e=>!y||e.name?.toLowerCase().includes(y.toLowerCase())||e.id?.toLowerCase().includes(y.toLowerCase())),L=t.reduce((e,t)=>e+(t.cases?.length||t.caseCount||0),0),_=[...new Set(t.flatMap(e=>(e.cases||[]).map(e=>e.model)).filter(Boolean))];if(o)return(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted p-8 animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"science"}),e("evalsLoading")]});if(0===t.length)return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(x,{}),(0,a.jsx)(n.pp,{icon:"science",title:e("noEvalSuitesFound"),description:e("noEvalSuitesDescription")})]});let K=[{key:"caseName",label:e("columnCase")},{key:"status",label:e("columnStatus")},{key:"durationMs",label:e("columnLatency")},{key:"details",label:e("columnDetails")}];return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(x,{t:e}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,a.jsxs)(n.Zp,{className:"px-4 py-3 text-center",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold tracking-wide",children:e("statsSuites")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-violet-400",children:t.length})]}),(0,a.jsxs)(n.Zp,{className:"px-4 py-3 text-center",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold tracking-wide",children:e("statsTestCases")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-sky-400",children:L})]}),(0,a.jsxs)(n.Zp,{className:"px-4 py-3 text-center",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold tracking-wide",children:e("statsModels")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-emerald-400",children:_.length})]}),(0,a.jsxs)(n.Zp,{className:"px-4 py-3 text-center",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold tracking-wide",children:e("statsCoverage")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-amber-400",children:e("statsStrategiesCount",{count:d.length})})]})]}),(0,a.jsxs)(n.Zp,{className:"p-0 overflow-hidden",children:[(0,a.jsxs)("button",{onClick:()=>S(!w),className:"w-full flex items-center justify-between px-6 py-4 hover:bg-surface/30 transition-colors text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"help"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e("howItWorks")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("howItWorksSubtitle")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted transition-transform duration-200 ${w?"rotate-180":""}`,children:"expand_more"})]}),w&&(0,a.jsxs)("div",{className:"px-6 pb-6 border-t border-border/10",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mt-4",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-4 rounded-lg bg-violet-500/5 border border-violet-500/10",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full bg-violet-500/20 flex items-center justify-center mb-3",children:(0,a.jsx)("span",{className:"text-lg font-bold text-violet-400",children:"1"})}),(0,a.jsx)("h4",{className:"text-sm font-semibold text-text-main mb-1",children:e("define")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("defineStepDescription")})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-4 rounded-lg bg-sky-500/5 border border-sky-500/10",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full bg-sky-500/20 flex items-center justify-center mb-3",children:(0,a.jsx)("span",{className:"text-lg font-bold text-sky-400",children:"2"})}),(0,a.jsx)("h4",{className:"text-sm font-semibold text-text-main mb-1",children:e("run")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("runStepDescription")})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-4 rounded-lg bg-emerald-500/5 border border-emerald-500/10",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full bg-emerald-500/20 flex items-center justify-center mb-3",children:(0,a.jsx)("span",{className:"text-lg font-bold text-emerald-400",children:"3"})}),(0,a.jsx)("h4",{className:"text-sm font-semibold text-text-main mb-1",children:e("evaluate")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("evaluateStepDescription")})]})]}),(0,a.jsxs)("div",{className:"mt-6",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide mb-3",children:e("evaluationStrategies")}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:d.map(t=>(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg ${t.bg} border border-transparent`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${t.color}`,children:t.icon}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`text-xs font-mono font-semibold ${t.color}`,children:e(t.labelKey)}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:e(t.descriptionKey)})]})]},t.name))})]}),_.length>0&&(0,a.jsxs)("div",{className:"mt-6",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide mb-3",children:e("modelsUnderTest")}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:_.map(e=>(0,a.jsx)("span",{className:"px-3 py-1.5 rounded-full text-xs font-mono font-medium bg-primary/10 text-primary border border-primary/20",children:e},e))})]})]})]}),(0,a.jsxs)(n.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-violet-500/10 text-violet-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"science"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:e("evalSuites")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("evalSuitesHint")})]})]}),(0,a.jsx)(n.Qn,{searchValue:y,onSearchChange:v,placeholder:e("searchSuitesPlaceholder"),filters:[],activeFilters:{},onFilterChange:()=>{},children:null}),(0,a.jsx)("div",{className:"flex flex-col gap-3 mt-4",children:$.map(t=>{let s=f[t.id],l=u===t.id,r=N===t.id,i=t.cases?.length||t.caseCount||0,c=[...new Set((t.cases||[]).map(e=>e.model).filter(Boolean))];return(0,a.jsxs)("div",{className:"border border-border/30 rounded-lg overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 cursor-pointer hover:bg-surface/30 transition-colors",onClick:()=>k(r?null:t.id),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted",children:r?"expand_more":"chevron_right"}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:t.name||t.id}),s?.summary&&(0,a.jsxs)("span",{className:`px-2 py-0.5 rounded-full text-xs font-semibold ${100===s.summary.passRate?"bg-emerald-500/10 text-emerald-400":s.summary.passRate>=80?"bg-amber-500/10 text-amber-400":"bg-red-500/10 text-red-400"}`,children:[s.summary.passRate,"% ",e("passSuffix")]})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[e("casesCount",{count:i}),t.description&&(0,a.jsxs)("span",{className:"ml-1",children:["— ",t.description]})]}),c.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:c.map(e=>(0,a.jsx)("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono text-text-muted bg-black/5 dark:bg-white/5",children:e},e))})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[l&&g.total>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-24 h-1.5 bg-black/10 dark:bg-white/10 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-violet-500 rounded-full transition-all duration-300",style:{width:`${g.current/g.total*100}%`}})}),(0,a.jsxs)("span",{className:"text-xs text-text-muted font-mono tabular-nums",children:[g.current,"/",g.total]})]}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",onClick:e=>{e.stopPropagation(),T(t)},loading:l,disabled:l,children:l?e("runningProgress",{current:g.current,total:g.total}):e("runEval")})]})]}),r&&(0,a.jsx)("div",{className:"border-t border-border/20 p-4",children:s?.results?(0,a.jsxs)(a.Fragment,{children:[s.summary&&(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-4 p-3 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:`text-lg font-bold ${100===s.summary.passRate?"text-emerald-400":s.summary.passRate>=80?"text-amber-400":"text-red-400"}`,children:[s.summary.passRate,"%"]}),(0,a.jsx)("span",{className:"text-xs text-text-muted",children:e("passRate")})]}),(0,a.jsx)("div",{className:"text-xs text-text-muted",children:e("summaryBreakdown",{passed:s.summary.passed,failed:s.summary.failed,total:s.summary.total})}),(0,a.jsx)("div",{className:"flex-1 h-2 bg-black/10 dark:bg-white/10 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${s.summary.passRate}%`,background:100===s.summary.passRate?"linear-gradient(90deg, #22c55e, #16a34a)":s.summary.passRate>=80?"linear-gradient(90deg, #f59e0b, #d97706)":"linear-gradient(90deg, #ef4444, #dc2626)"}})})]}),(0,a.jsx)(n.bQ,{columns:K,data:s.results.map((e,t)=>({...e,id:e.caseId||t})),renderCell:(t,s)=>{if("status"===s.key)return t.passed?(0,a.jsx)("span",{className:"text-emerald-400",children:e("passedIconLabel")}):(0,a.jsx)("span",{className:"text-red-400",children:e("failedIconLabel")});if("durationMs"===s.key)return(0,a.jsx)("span",{className:"text-text-muted text-xs font-mono",children:null!=t.durationMs?`${t.durationMs}ms`:"—"});if("details"===s.key){let s=t.details||{};return(0,a.jsx)("span",{className:"text-text-muted text-xs truncate max-w-[300px] block",children:String(s.searchTerm?e("detailsContains",{term:s.searchTerm}):s.pattern?e("detailsRegex",{pattern:s.pattern}):s.expected?e("detailsExpected",{expected:String(s.expected).slice(0,50)}):t.error||"—")})}return(0,a.jsx)("span",{className:"text-sm text-text-main",children:t[s.key]||"—"})},maxHeight:"400px",emptyMessage:e("noResultsYet")})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted",children:"checklist"}),(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:e("testCasesCount",{count:(t.cases||[]).length})})]}),(0,a.jsx)(n.bQ,{columns:[{key:"name",label:e("columnCase")},{key:"model",label:e("columnModel")},{key:"strategy",label:e("columnStrategy")},{key:"expected",label:e("columnExpected")}],data:(t.cases||[]).map((e,t)=>({id:e.id||t,name:e.name,model:e.model||"—",strategy:e.expected?.strategy||"—",expected:e.expected?.value?String(e.expected.value).slice(0,80):"—"})),renderCell:(e,t)=>{if("strategy"===t.key){let t=d.find(t=>t.name===e.strategy);return(0,a.jsx)("span",{className:`text-xs font-mono font-semibold ${t?.color||"text-text-muted"}`,children:e.strategy})}return"model"===t.key?(0,a.jsx)("span",{className:"text-xs font-mono text-primary/80",children:e.model}):"expected"===t.key?(0,a.jsx)("span",{className:"text-text-muted text-xs font-mono truncate max-w-[300px] block",children:e.expected}):(0,a.jsx)("span",{className:"text-sm text-text-main",children:e[t.key]||"—"})},maxHeight:"400px",emptyMessage:e("noTestCasesDefined")}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-3 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),e("runEvalHint")]})]})})]},t.id)})})]})]})}function x({t:e}){return(0,a.jsx)(n.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsx)("div",{className:"p-6",style:{background:"linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(59, 130, 246, 0.05) 50%, rgba(16, 185, 129, 0.05) 100%)"},children:(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"p-3 rounded-xl bg-violet-500/10 text-violet-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px]",children:"science"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h2",{className:"text-xl font-bold text-text-main mb-1",children:e("modelEvals")}),(0,a.jsx)("p",{className:"text-sm text-text-muted leading-relaxed max-w-2xl",children:e("evalsHeroDescription")}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-4 mt-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-emerald-400",children:"verified"}),e("qualityValidation")]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-sky-400",children:"compare"}),e("modelComparison")]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-400",children:"bug_report"}),e("regressionDetection")]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-violet-400",children:"speed"}),e("latencyBenchmarks")]})]})]})]})})})}function m(){let[e,t]=(0,l.useState)("overview"),s=(0,r.c)("analytics"),i={overview:s("overviewDescription"),evals:s("evalsDescription")};return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[28px]",children:"analytics"}),s("title")]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:i[e]})]}),(0,a.jsx)(n.Iz,{options:[{value:"overview",label:s("overview")},{value:"evals",label:s("evals")}],value:e,onChange:t}),"overview"===e&&(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(n.Qv,{}),children:(0,a.jsx)(n.cn,{})}),"evals"===e&&(0,a.jsx)(c,{})]})}},94369:(e,t,s)=>{Promise.resolve().then(s.bind(s,53701))}},e=>{e.O(0,[3418,8500,9751,8055,1149,5846,993,8441,3794,7358],()=>e(e.s=94369)),_N_E=e.O()}]);
|
package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-12d772841a253032.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2888],{15534:(e,t,s)=>{Promise.resolve().then(s.bind(s,42712))},42712:(e,t,s)=>{"use strict";s.d(t,{default:()=>c});var l=s(95155),a=s(12115),r=s(40993),i=s(30949),n=s(50910);function c(){let e=(0,n.c)("apiManager"),t=(0,n.c)("common"),[s,c]=(0,a.useState)([]),[o,x]=(0,a.useState)([]),[m,h]=(0,a.useState)(!0),[p,u]=(0,a.useState)(!1),[g,j]=(0,a.useState)(""),[b,f]=(0,a.useState)(null),[y,N]=(0,a.useState)(null),[v,k]=(0,a.useState)(!1),[w,C]=(0,a.useState)(""),[S,_]=(0,a.useState)(null),[M,$]=(0,a.useState)(!1),[K,A]=(0,a.useState)({}),{copied:D,copy:E}=(0,i.C)();(0,a.useEffect)(()=>{R(),O()},[]);let O=async()=>{try{let e=await fetch("/v1/models");if(e.ok){let t=await e.json();x(t.data||[])}}catch(e){console.log("Error fetching models:",e)}},R=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let t=await e.json();c(t.keys||[]),T(t.keys||[])}}catch(e){console.log("Error fetching keys:",e)}finally{h(!1)}},T=async e=>{if(0!==e.length)try{let t=await fetch("/api/usage/call-logs?limit=1000");if(!t.ok)return;let s=await t.json(),l={};for(let t of e){let e=(s||[]).filter(e=>e.apiKeyId===t.id||e.apiKeyName===t.name);l[t.id]={totalRequests:e.length,lastUsed:e.length>0?e.sort((e,t)=>new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime())[0]?.timestamp:null}}A(l)}catch(e){console.log("Error fetching usage stats:",e)}},P=(0,a.useCallback)(()=>_(null),[]),U=async()=>{let t=g.replace(/[<>]/g,"").replace(/"/g,"").replace(/'/g,"").trim().slice(0,100),s=t&&t.trim()?t.length>100?{valid:!1,error:e("keyNameTooLong",{max:100})}:/^[a-zA-Z0-9_\-\s]+$/.test(t)?{valid:!0}:{valid:!1,error:e("keyNameInvalid")}:{valid:!1,error:e("keyNameRequired")};if(!s.valid)return void _(s.error||e("invalidKeyName"));$(!0),P();try{let s=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t})}),l=await s.json();s.ok?(f(l.key),await R(),j(""),u(!1)):_(l.error||e("failedCreateKey"))}catch(t){console.error("Error creating key:",t),_(e("failedCreateKeyRetry"))}finally{$(!1)}},Z=async t=>{if(!t||"string"!=typeof t||!/^[a-zA-Z0-9_-]+$/.test(t))return void _(e("invalidKeyId"));if(confirm(e("deleteConfirm"))){$(!0),P();try{let s=await fetch(`/api/keys/${encodeURIComponent(t)}`,{method:"DELETE"});if(s.ok)c(e=>e.filter(e=>e.id!==t));else{let t=await s.json();_(t.error||e("failedDeleteKey"))}}catch(t){console.error("Error deleting key:",t),_(e("failedDeleteKeyRetry"))}finally{$(!1)}}},z=e=>{e&&e.id&&(N(e),k(!0))},F=async t=>{if(!y||!y.id)return;if(!Array.isArray(t))return void _(e("invalidModelsSelection"));if(t.length>500)return void _(e("cannotSelectMoreThanModels",{max:500}));let s=t.filter(e=>"string"==typeof e&&e.length>0&&e.length<200);$(!0),P();try{let t=await fetch(`/api/keys/${encodeURIComponent(y.id)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({allowedModels:s})});if(t.ok)await R(),k(!1),N(null);else{let s=await t.json();_(s.error||e("failedUpdatePermissions"))}}catch(t){console.error("Error updating permissions:",t),_(e("failedUpdatePermissionsRetry"))}finally{$(!1)}},L=function(e,t){let[s,l]=(0,a.useState)(e);return(0,a.useEffect)(()=>{let t=setTimeout(()=>l(e),150);return()=>clearTimeout(t)},[e,150]),s}(w,0),q=(0,a.useMemo)(()=>{let t={};for(let s of o){let l=s.owned_by||e("unknownProvider");t[l]||(t[l]=[]),t[l].push(s)}return Object.entries(t).sort((e,t)=>e[0].localeCompare(t[0]))},[o]),I=(0,a.useMemo)(()=>{if(!L.trim())return q;let e=L.toLowerCase();return q.map(([t,s])=>[t,s.filter(s=>s.id.toLowerCase().includes(e)||t.toLowerCase().includes(e))]).filter(([,e])=>e.length>0)},[q,L]);return m?(0,l.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,l.jsx)(r.Qv,{}),(0,l.jsx)(r.Qv,{})]}):(0,l.jsxs)("div",{className:"flex flex-col gap-8",children:[S&&(0,l.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-red-500",children:"error"}),(0,l.jsx)("p",{className:"text-sm text-red-700 dark:text-red-300 flex-1",children:S}),(0,l.jsx)("button",{onClick:P,className:"text-red-500 hover:text-red-700 transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined",children:"close"})})]}),s.length>0&&(0,l.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,l.jsx)(r.Zp,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-9 rounded-lg bg-primary/10",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-lg",children:"vpn_key"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-2xl font-bold",children:s.length}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:e("totalKeys")})]})]})}),(0,l.jsx)(r.Zp,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-9 rounded-lg bg-amber-500/10",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-amber-500 text-lg",children:"lock"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-2xl font-bold",children:s.filter(e=>Array.isArray(e.allowedModels)&&e.allowedModels.length>0).length}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:e("restricted")})]})]})}),(0,l.jsx)(r.Zp,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-9 rounded-lg bg-blue-500/10",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"bar_chart"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-2xl font-bold",children:Object.values(K).reduce((e,t)=>e+t.totalRequests,0)}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:e("totalRequests")})]})]})}),(0,l.jsx)(r.Zp,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-9 rounded-lg bg-emerald-500/10",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-emerald-500 text-lg",children:"model_training"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-2xl font-bold",children:o.length}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:e("modelsAvailable")})]})]})})]}),(0,l.jsx)(r.Zp,{children:(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:e("keyManagement")}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:e("keyManagementDesc")})]}),(0,l.jsx)(r.$n,{icon:"add",onClick:()=>u(!0),children:e("createKey")})]})}),(0,l.jsxs)(r.Zp,{children:[(0,l.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-10 rounded-lg bg-amber-500/10 shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-xl text-amber-500",children:"vpn_key"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"font-semibold",children:e("registeredKeys")}),(0,l.jsxs)("p",{className:"text-xs text-text-muted",children:[s.length," ",1===s.length?e("keyRegistered",{count:s.length}):e("keysRegistered",{count:s.length})]})]})]})}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-4",children:e("keysSecurityNote")}),0===s.length?(0,l.jsxs)("div",{className:"text-center py-12 border border-dashed border-border rounded-lg",children:[(0,l.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,l.jsx)("p",{className:"text-text-main font-medium mb-2",children:e("noKeys")}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-4",children:e("noKeysDesc")}),(0,l.jsx)(r.$n,{icon:"add",onClick:()=>u(!0),children:e("createFirstKey")})]}):(0,l.jsxs)("div",{className:"flex flex-col border border-border rounded-lg overflow-hidden",children:[(0,l.jsxs)("div",{className:"grid grid-cols-12 gap-4 px-4 py-3 bg-surface/50 border-b border-border text-xs font-semibold text-text-muted uppercase tracking-wider",children:[(0,l.jsx)("div",{className:"col-span-2",children:e("name")}),(0,l.jsx)("div",{className:"col-span-3",children:e("key")}),(0,l.jsx)("div",{className:"col-span-2",children:e("permissions")}),(0,l.jsx)("div",{className:"col-span-2",children:e("usage")}),(0,l.jsx)("div",{className:"col-span-1",children:e("created")}),(0,l.jsx)("div",{className:"col-span-2 text-right",children:e("actions")})]}),s.map(t=>{let s=K[t.id],a=Array.isArray(t.allowedModels)&&t.allowedModels.length>0;return(0,l.jsxs)("div",{className:"grid grid-cols-12 gap-4 px-4 py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 hover:bg-surface/30 transition-colors group",children:[(0,l.jsxs)("div",{className:"col-span-2 flex items-center gap-2",children:[(0,l.jsx)("span",{className:`material-symbols-outlined text-sm ${a?"text-amber-500":"text-emerald-500"}`,children:a?"lock":"lock_open"}),(0,l.jsx)("span",{className:"text-sm font-medium truncate",title:t.name,children:t.name})]}),(0,l.jsxs)("div",{className:"col-span-3 flex items-center gap-1.5",children:[(0,l.jsx)("code",{className:"text-sm text-text-muted font-mono truncate",children:t.key}),(0,l.jsx)("button",{onClick:()=>E(t.key,t.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all shrink-0",title:e("copyMaskedKey"),children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:D===t.id?"check":"content_copy"})})]}),(0,l.jsx)("div",{className:"col-span-2 flex items-center",children:a?(0,l.jsxs)("button",{onClick:()=>z(t),className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-amber-500/10 text-amber-600 dark:text-amber-400 text-xs font-medium hover:bg-amber-500/20 transition-colors",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"lock"}),e("modelsCount",{count:t.allowedModels.length})]}):(0,l.jsxs)("button",{onClick:()=>z(t),className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-green-500/10 text-green-600 dark:text-green-400 text-xs font-medium hover:bg-green-500/20 transition-colors",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"lock_open"}),e("allModels")]})}),(0,l.jsxs)("div",{className:"col-span-2 flex flex-col justify-center",children:[(0,l.jsxs)("span",{className:"text-sm font-medium tabular-nums",children:[s?.totalRequests??0," ",(0,l.jsx)("span",{className:"text-text-muted font-normal text-xs",children:e("reqs")})]}),s?.lastUsed?(0,l.jsx)("span",{className:"text-[10px] text-text-muted",children:e("lastUsedOn",{date:new Date(s.lastUsed).toLocaleDateString()})}):(0,l.jsx)("span",{className:"text-[10px] text-text-muted italic",children:e("neverUsed")})]}),(0,l.jsx)("div",{className:"col-span-1 flex items-center text-sm text-text-muted",children:new Date(t.createdAt).toLocaleDateString()}),(0,l.jsxs)("div",{className:"col-span-2 flex items-center justify-end gap-1",children:[(0,l.jsx)("button",{onClick:()=>z(t),className:"p-2 hover:bg-primary/10 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all",title:e("editPermissions"),children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tune"})}),(0,l.jsx)("button",{onClick:()=>Z(t.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-0 group-hover:opacity-100 transition-all",title:e("deleteKey"),children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},t.id)})]})]}),(0,l.jsx)(r.Zp,{children:(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-10 rounded-lg bg-blue-500/10 shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-xl text-blue-500",children:"lightbulb"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"font-semibold mb-2",children:e("usageTips")}),(0,l.jsxs)("ul",{className:"text-sm text-text-muted space-y-1.5",children:[(0,l.jsxs)("li",{className:"flex items-start gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-xs text-primary mt-1",children:"check"}),(0,l.jsx)("span",{children:e("tipAuth")})]}),(0,l.jsxs)("li",{className:"flex items-start gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-xs text-primary mt-1",children:"check"}),(0,l.jsx)("span",{children:e("tipSecure")})]}),(0,l.jsxs)("li",{className:"flex items-start gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-xs text-primary mt-1",children:"check"}),(0,l.jsx)("span",{children:e("tipSeparate")})]}),(0,l.jsxs)("li",{className:"flex items-start gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-xs text-primary mt-1",children:"check"}),(0,l.jsx)("span",{children:e("tipRestrict")})]})]})]})]})}),(0,l.jsx)(r.aF,{isOpen:p,title:e("createKey"),onClose:()=>{u(!1),j("")},children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"text-sm font-medium text-text-main mb-1.5 block",children:e("keyName")}),(0,l.jsx)(r.pd,{value:g,onChange:e=>j(e.target.value),placeholder:e("keyNamePlaceholder"),autoFocus:!0}),(0,l.jsx)("p",{className:"text-xs text-text-muted mt-1.5",children:e("keyNameDesc")})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(r.$n,{onClick:()=>{u(!1),j("")},variant:"ghost",fullWidth:!0,children:t("cancel")}),(0,l.jsx)(r.$n,{onClick:U,fullWidth:!0,disabled:!g.trim(),children:e("createKey")})]})]})}),(0,l.jsx)(r.aF,{isOpen:!!b,title:e("keyCreated"),onClose:()=>f(null),children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4",children:(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium mb-1",children:e("keyCreatedSuccess")}),(0,l.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:e("keyCreatedNote")})]})]})}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(r.pd,{value:b||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,l.jsx)(r.$n,{variant:"secondary",icon:"created_key"===D?"check":"content_copy",onClick:()=>E(b,"created_key"),children:t("created_key"===D?"copied":"copy")})]}),(0,l.jsx)(r.$n,{onClick:()=>f(null),fullWidth:!0,children:e("done")})]})}),y&&(0,l.jsx)(d,{isOpen:v,onClose:()=>{k(!1),N(null)},apiKey:y,modelsByProvider:I,allModels:o,searchModel:w,onSearchChange:C,onSave:F},y.id)]})}let d=(0,a.memo)(function({isOpen:e,onClose:t,apiKey:s,modelsByProvider:i,allModels:c,searchModel:d,onSearchChange:o,onSave:x}){let m=(0,n.c)("apiManager"),h=(0,n.c)("common"),p=Array.isArray(s?.allowedModels)?s.allowedModels:[],[u,g]=(0,a.useState)(p),[j,b]=(0,a.useState)(0===p.length),[f,y]=(0,a.useState)(()=>p.length>0?new Set(i.map(([e])=>e)):new Set),N=(0,a.useCallback)(e=>{j||g(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[j]),v=(0,a.useCallback)((e,t)=>{if(j)return;let s=t.map(e=>e.id);g(e=>s.every(t=>e.includes(t))?e.filter(e=>!s.includes(e)):[...new Set([...e,...s])])},[j]),k=(0,a.useCallback)(()=>{b(!0),g([])},[]),w=(0,a.useCallback)(()=>{b(!1),y(new Set(i.map(([e])=>e)))},[i]),C=(0,a.useCallback)(e=>{y(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),S=(0,a.useCallback)(()=>{g(c.map(e=>e.id))},[c]),_=(0,a.useCallback)(()=>{g([])},[]),M=(0,a.useCallback)(()=>{x(j?[]:u)},[x,j,u]);(0,a.useCallback)(()=>{o("")},[o]);let $=u.length,K=c.length;return(0,l.jsx)(r.aF,{isOpen:!!t&&e,title:m("permissionsTitle",{name:s?.name||""}),onClose:t,children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex gap-2 p-1 bg-surface rounded-lg",children:[(0,l.jsxs)("button",{onClick:k,className:`flex-1 flex items-center justify-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-all ${j?"bg-primary text-white":"text-text-muted hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"lock_open"}),m("allowAll")]}),(0,l.jsxs)("button",{onClick:w,className:`flex-1 flex items-center justify-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-all ${!j?"bg-primary text-white":"text-text-muted hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"lock"}),m("restrict")]})]}),(0,l.jsxs)("div",{className:`flex items-start gap-2 p-3 rounded-lg ${j?"bg-green-500/10 border border-green-500/30":"bg-amber-500/10 border border-amber-500/30"}`,children:[(0,l.jsx)("span",{className:`material-symbols-outlined text-[18px] ${j?"text-green-500":"text-amber-500"}`,children:j?"info":"warning"}),(0,l.jsx)("p",{className:`text-xs ${j?"text-green-700 dark:text-green-300":"text-amber-700 dark:text-amber-300"}`,children:j?m("allowAllDesc"):m("restrictDesc",{selectedCount:$,totalModels:K})})]}),!j&&$>0&&(0,l.jsxs)("div",{className:"flex flex-col gap-1.5 p-2 bg-primary/5 rounded-lg border border-primary/20",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-xs font-medium text-primary",children:m("selectedCount",{count:$})}),(0,l.jsxs)("div",{className:"flex gap-1",children:[(0,l.jsx)("button",{onClick:S,className:"text-[10px] text-primary hover:bg-primary/10 px-1.5 py-0.5 rounded transition-colors",children:h("all")}),(0,l.jsx)("button",{onClick:_,className:"text-[10px] text-red-500 hover:bg-red-500/10 px-1.5 py-0.5 rounded transition-colors",children:m("clear")})]})]}),(0,l.jsx)("div",{className:"flex flex-wrap gap-1 max-h-16 overflow-y-auto content-start",children:u.map(e=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-white dark:bg-surface text-text-main text-[10px] rounded border border-border",children:[(0,l.jsx)("span",{className:"font-mono truncate max-w-[120px]",title:e,children:e}),(0,l.jsx)("button",{onClick:()=>N(e),className:"text-text-muted hover:text-red-500 transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e))})]}),!j&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)(r.pd,{value:d,onChange:e=>o(e.target.value),placeholder:m("searchModels"),icon:"search"}),d&&(0,l.jsx)("button",{onClick:()=>o(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-main",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,l.jsx)("div",{className:"max-h-[280px] overflow-y-auto border border-border rounded-lg divide-y divide-border",children:0===i.length?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-6 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1",children:"search_off"}),(0,l.jsx)("p",{className:"text-xs",children:m("noModelsFound")})]}):i.map(([e,t])=>{let s=u.filter(e=>t.some(t=>t.id===e)).length,a=t.every(e=>u.includes(e.id)),r=s>0&&!a;return(0,l.jsxs)("div",{className:"group",children:[(0,l.jsxs)("button",{onClick:()=>C(e),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-surface/50 transition-colors text-left",children:[(0,l.jsx)("span",{className:`material-symbols-outlined text-base transition-transform duration-200 ${f.has(e)?"rotate-90":""}`,children:"chevron_right"}),(0,l.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,l.jsx)("div",{className:"relative flex items-center cursor-pointer shrink-0",onClick:s=>{s.stopPropagation(),v(e,t)},children:(0,l.jsxs)("div",{className:`w-4 h-4 rounded border-2 transition-colors flex items-center justify-center ${a?"bg-primary border-primary":r?"bg-primary/20 border-primary":"border-border hover:border-primary/50"}`,children:[a&&(0,l.jsx)("span",{className:"material-symbols-outlined text-white text-[12px]",children:"check"}),r&&!a&&(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[12px]",children:"remove"})]})}),(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main truncate",children:e}),(0,l.jsx)("span",{className:"text-[10px] text-text-muted bg-surface px-1 py-0.5 rounded shrink-0",children:t.length})]}),s>0&&(0,l.jsx)("span",{className:"text-[10px] font-medium text-primary bg-primary/10 px-1.5 py-0.5 rounded-full shrink-0",children:s})]}),f.has(e)&&(0,l.jsx)("div",{className:"px-3 pb-2 pl-9",children:(0,l.jsx)("div",{className:"flex flex-wrap gap-1",children:t.map(e=>{let t=u.includes(e.id);return(0,l.jsx)("button",{onClick:()=>N(e.id),className:`inline-flex items-center gap-1 px-2 py-1 rounded-full text-[10px] font-mono transition-all ${t?"bg-primary text-white":"bg-surface border border-border text-text-muted hover:border-primary/50 hover:text-text-main"}`,title:e.id,children:e.id},e.id)})})})]},e)})})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(r.$n,{onClick:M,fullWidth:!0,children:m("savePermissions")}),(0,l.jsx)(r.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:h("cancel")})]})]})})})}},e=>{e.O(0,[3418,8500,9751,8055,1149,5846,993,8441,3794,7358],()=>e(e.s=15534)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6782],{19213:(e,t,r)=>{Promise.resolve().then(r.bind(r,29698))},29698:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var o=r(95155),a=r(12115),l=r(50910);function s(){let e=(0,l.c)("auditLog"),t=(0,l.c)("common"),[r,s]=(0,a.useState)([]),[c,d]=(0,a.useState)(!0),[n,i]=(0,a.useState)(null),[x,u]=(0,a.useState)(""),[m,b]=(0,a.useState)(""),[p,h]=(0,a.useState)(0),[v,f]=(0,a.useState)(!1),g=(0,a.useCallback)(async()=>{d(!0),i(null);try{let e=new URLSearchParams;x&&e.set("action",x),m&&e.set("actor",m),e.set("limit",String(26)),e.set("offset",String(p));let t=await fetch(`/api/compliance/audit-log?${e.toString()}`);if(!t.ok)throw Error(`HTTP ${t.status}`);let r=await t.json();f(r.length>25),s(r.slice(0,25))}catch(t){i(t.message||e("failedFetchAuditLog"))}finally{d(!1)}},[x,m,p,e]);(0,a.useEffect)(()=>{g()},[g]);let y=()=>{h(0),g()};return(0,o.jsxs)("div",{className:"max-w-6xl mx-auto p-6 space-y-6",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"text-2xl font-bold text-[var(--color-text-main)]",children:e("title")}),(0,o.jsx)("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:e("description")})]}),(0,o.jsx)("button",{onClick:g,disabled:c,"aria-label":e("refreshAuditLogAria"),className:"px-4 py-2 rounded-lg text-sm font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] transition-colors disabled:opacity-50",children:t(c?"loading":"refresh")})]}),(0,o.jsxs)("div",{className:"flex flex-wrap gap-3 p-4 rounded-xl bg-[var(--color-surface)] border border-[var(--color-border)]",role:"search","aria-label":e("filterEntriesAria"),children:[(0,o.jsx)("input",{type:"text",placeholder:e("filterByAction"),value:x,onChange:e=>u(e.target.value),onKeyDown:e=>"Enter"===e.key&&y(),"aria-label":e("filterByActionTypeAria"),className:"flex-1 min-w-[180px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,o.jsx)("input",{type:"text",placeholder:e("filterByActor"),value:m,onChange:e=>b(e.target.value),onKeyDown:e=>"Enter"===e.key&&y(),"aria-label":e("filterByActorAria"),className:"flex-1 min-w-[180px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,o.jsx)("button",{onClick:y,className:"px-4 py-2 rounded-lg text-sm font-medium bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors focus:outline-2 focus:outline-offset-2 focus:outline-[var(--color-accent)]",children:t("search")})]}),n&&(0,o.jsx)("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",role:"alert",children:n}),(0,o.jsx)("div",{className:"overflow-x-auto rounded-xl border border-[var(--color-border)]",children:(0,o.jsxs)("table",{className:"w-full text-sm",role:"table","aria-label":e("tableAria"),children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{className:"bg-[var(--color-bg-alt)] border-b border-[var(--color-border)]",children:[(0,o.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:e("timestamp")}),(0,o.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:e("action")}),(0,o.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:e("actor")}),(0,o.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:e("target")}),(0,o.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:t("details")}),(0,o.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:e("ipAddress")})]})}),(0,o.jsx)("tbody",{children:0!==r.length||c?r.map(t=>{var r;return(0,o.jsxs)("tr",{className:"border-b border-[var(--color-border)] hover:bg-[var(--color-bg-alt)] transition-colors",children:[(0,o.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-[var(--color-text-muted)] font-mono text-xs",children:(e=>{try{return new Date(e).toLocaleString()}catch{return e}})(t.timestamp)}),(0,o.jsx)("td",{className:"px-4 py-3",children:(0,o.jsx)("span",{className:`inline-block px-2 py-0.5 rounded-md text-xs font-medium border ${(r=t.action).includes("delete")||r.includes("remove")?"bg-red-500/15 text-red-400 border-red-500/20":r.includes("create")||r.includes("add")?"bg-green-500/15 text-green-400 border-green-500/20":r.includes("update")||r.includes("change")?"bg-blue-500/15 text-blue-400 border-blue-500/20":r.includes("login")||r.includes("auth")?"bg-purple-500/15 text-purple-400 border-purple-500/20":"bg-gray-500/15 text-gray-400 border-gray-500/20"}`,children:t.action})}),(0,o.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-main)]",children:t.actor}),(0,o.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] max-w-[200px] truncate",children:t.target||e("notAvailable")}),(0,o.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] max-w-[300px] truncate font-mono text-xs",children:t.details?JSON.stringify(t.details):e("notAvailable")}),(0,o.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] font-mono text-xs whitespace-nowrap",children:t.ip_address||e("notAvailable")})]},t.id)}):(0,o.jsx)("tr",{children:(0,o.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-[var(--color-text-muted)]",children:e("noEntries")})})})]})}),(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("p",{className:"text-xs text-[var(--color-text-muted)]",children:e("showing",{count:r.length,offset:p})}),(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsxs)("button",{onClick:()=>h(Math.max(0,p-25)),disabled:0===p,className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-30 transition-colors",children:["← ",e("previous")]}),(0,o.jsxs)("button",{onClick:()=>h(p+25),disabled:!v,className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-30 transition-colors",children:[t("next")," →"]})]})]})]})}},50910:(e,t,r)=>{"use strict";r.d(t,{c:()=>l});var o=r(33418);function a(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let l=a(0,o.c3);a(0,o.kc)}},e=>{e.O(0,[3418,8441,3794,7358],()=>e(e.s=19213)),_N_E=e.O()}]);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{44058:(e,t,s)=>{Promise.resolve().then(s.bind(s,96758))},96758:(e,t,s)=>{"use strict";s.d(t,{default:()=>C});var a=s(95155),l=s(12115),r=s(40993);let i={claude:{id:"claude",name:"Claude Code",icon:"terminal",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL"},modelAliases:["default","sonnet","opus","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-4-5-20251101"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-4-5-20250929"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},codex:{id:"codex",name:"OpenAI Codex CLI",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},droid:{id:"droid",name:"Factory Droid",image:"/providers/droid.png",color:"#00D4FF",description:"Factory Droid AI Assistant",configType:"custom"},openclaw:{id:"openclaw",name:"Open Claw",image:"/providers/openclaw.png",color:"#FF6B35",description:"Open Claw AI Assistant",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresCloud:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor routes requests through its own server, so local endpoint is not supported. Please enable Cloud Endpoint in Settings."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]},cline:{id:"cline",name:"Cline",image:"/providers/cline.png",color:"#00D1B2",description:"Cline AI Coding Assistant CLI",configType:"custom"},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant CLI",configType:"custom"},continue:{id:"continue",name:"Continue",image:"/providers/continue.png",color:"#7C3AED",description:"Continue AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Config",desc:"Open Continue configuration file"},{step:2,title:"API Key",type:"apiKeySelector"},{step:3,title:"Select Model",type:"modelSelector"},{step:4,title:"Add Model Config",desc:"Add the following configuration to your models array:"}],codeBlock:{language:"json",code:`{
|
|
2
|
+
"apiBase": "{{baseUrl}}",
|
|
3
|
+
"title": "{{model}}",
|
|
4
|
+
"model": "{{model}}",
|
|
5
|
+
"provider": "openai",
|
|
6
|
+
"apiKey": "{{apiKey}}"
|
|
7
|
+
}`}},antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",modelAliases:["claude-opus-4-6-thinking","claude-sonnet-4-6","gemini-3-flash","gpt-oss-120b-medium","gemini-3.1-pro-high","gemini-3.1-pro-low"],defaultModels:[{id:"gemini-3.1-pro-high",name:"Gemini 3.1 Pro High",alias:"gemini-3.1-pro-high"},{id:"gemini-3.1-pro-low",name:"Gemini 3.1 Pro Low",alias:"gemini-3.1-pro-low"},{id:"gemini-3-flash",name:"Gemini 3 Flash",alias:"gemini-3-flash"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",alias:"claude-sonnet-4-6"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking",alias:"claude-opus-4-6-thinking"},{id:"gpt-oss-120b-medium",name:"GPT OSS 120B Medium",alias:"gpt-oss-120b-medium"}]}};var n=s(81135),o=s(5772),c=s(50910),d=s(33418);function x({effectiveConfigStatus:e,batchStatus:t,lastConfiguredAt:s=null}){let l=(0,c.c)("cliTools"),r=(0,d.Ym)(),i=e||t?.configStatus||null,n={configured:{dotClass:"bg-green-500",badgeClass:"bg-green-500/10 text-green-600 dark:text-green-400",text:l("configured")},not_configured:{dotClass:"bg-yellow-500",badgeClass:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",text:l("notConfigured")},not_installed:{dotClass:"bg-zinc-400 dark:bg-zinc-500",badgeClass:"bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",text:l("notInstalled")},other:{dotClass:"bg-blue-500",badgeClass:"bg-blue-500/10 text-blue-600 dark:text-blue-400",text:l("custom")},unknown:{dotClass:"bg-zinc-400 dark:bg-zinc-500",badgeClass:"bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",text:l("unknown")}},o=i?n[i]||n.unknown:null;return(0,a.jsxs)(a.Fragment,{children:[o&&(0,a.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full ${o.badgeClass}`,children:[(0,a.jsx)("span",{className:`size-1.5 rounded-full ${o.dotClass}`}),o.text]}),s?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] text-text-muted",title:l("lastSavedAt",{date:new Date(s).toLocaleString(r)}),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"schedule"}),function(e,t){let s=Date.now()-new Date(e).getTime();if(s<0)return t("justNow");let a=Math.floor(s/1e3);if(a<60)return t("justNow");let l=Math.floor(a/60);if(l<60)return t("minutesAgoShort",{count:l});let r=Math.floor(l/60);if(r<24)return t("hoursAgoShort",{count:r});let i=Math.floor(r/24);if(i<30)return t("daysAgoShort",{count:i});let n=Math.floor(i/30);return n<12?t("monthsAgoShort",{count:n}):t("yearsAgoShort",{count:Math.floor(n/12)})}(s,l)]}):i&&"not_installed"!==i?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"schedule"}),l("never")]}):null]})}let m="https://cloud.omniroute.online";function p({tool:e,isExpanded:t,onToggle:s,activeProviders:i,modelMappings:n,onModelMappingChange:d,baseUrl:p,hasActiveProviders:u,apiKeys:h,cloudEnabled:g,batchStatus:f,lastConfiguredAt:y}){let b,j,N,v=(0,c.c)("cliTools"),[k,w]=(0,l.useState)(null),[C,S]=(0,l.useState)(!1),[_,A]=(0,l.useState)(!1),[O,E]=(0,l.useState)(!1),[P,T]=(0,l.useState)(null),[$,R]=(0,l.useState)(!1),[M,z]=(0,l.useState)(!1),[K,D]=(0,l.useState)(null),[I,U]=(0,l.useState)(""),[F,L]=(0,l.useState)({}),[B,H]=(0,l.useState)(!1),[J,W]=(0,l.useState)(""),q=(0,l.useRef)(!1),[Y,V]=(0,l.useState)([]),[Z,G]=(0,l.useState)(!1),[Q,X]=(0,l.useState)(null),ee=!!(k?.installed&&k?.runnable),et=(()=>{if(!ee)return null;let e=k.settings?.env?.ANTHROPIC_BASE_URL;if(!e)return"not_configured";let t=e.includes("localhost")||e.includes("127.0.0.1"),s=g&&m&&e.startsWith(m);return t||s?"configured":"other"})()||f?.configStatus||null;(0,l.useEffect)(()=>{h?.length>0&&!I&&U(h[0].key)},[h,I]),(0,l.useEffect)(()=>{t&&!k&&(ea(),es(),en())},[t,k]);let es=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&L(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(k?.installed&&!q.current){q.current=!0;let t=k.settings?.env||{};e.defaultModels.forEach(e=>{if(e.envKey){let s=t[e.envKey]||e.defaultValue||"";s&&d(e.alias,s)}});let s=t.ANTHROPIC_AUTH_TOKEN;s&&h?.some(e=>e.key===s)&&U(s)}},[k,h,e.defaultModels,d]);let ea=async()=>{S(!0);try{let e=await fetch("/api/cli-tools/claude-settings"),t=await e.json();w(t)}catch(e){w({installed:!1,error:e.message})}finally{S(!1)}},el=()=>{let e=J||p;return e.endsWith("/v1")?e:`${e}/v1`},er=async()=>{A(!0),T(null);try{let t={ANTHROPIC_BASE_URL:el()},s=I?.trim()||(h?.length>0?h[0].key:null)||(g?null:"sk_omniroute");s&&(t.ANTHROPIC_AUTH_TOKEN=s),e.defaultModels.forEach(e=>{let s=n[e.alias];s&&e.envKey&&(t[e.envKey]=s)});let a=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t})}),l=await a.json();a.ok?(T({type:"success",text:v("settingsApplied")}),w(e=>({...e,hasBackup:!0,settings:{...e?.settings,env:t}}))):T({type:"error",text:l.error||v("failedApplySettings")})}catch(e){T({type:"error",text:e.message})}finally{A(!1)}},ei=async()=>{E(!0),T(null);try{let t=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),s=await t.json();t.ok?(T({type:"success",text:v("settingsReset")}),e.defaultModels.forEach(e=>d(e.alias,e.defaultValue||"")),U("")):T({type:"error",text:s.error||v("failedResetSettings")})}catch(e){T({type:"error",text:e.message})}finally{E(!1)}},en=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=claude"),t=await e.json();e.ok&&V(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},eo=async e=>{X(e),T(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"claude",backupId:e})}),s=await t.json();t.ok?(T({type:"success",text:v("backupRestored")}),ea(),en()):T({type:"error",text:s.error||v("failedRestore")})}catch(e){T({type:"error",text:e.message})}finally{X(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/claude.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:et,batchStatus:f,lastConfiguredAt:y})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:v("toolDescriptions.claude")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[C&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:v("checkingCli",{tool:"Claude"})})]}),!C&&k&&!ee&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:k.installed?v("cliNotRunnable",{tool:"Claude"}):v("cliNotInstalled",{tool:"Claude"})}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:k.installed?v("cliFoundFailedHealthcheck",{tool:"Claude",reason:k.reason?` (${k.reason})`:""}):v("installCliPrompt",{tool:"Claude"})})]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>R(!$),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:$?"expand_less":"help"}),$?v("hide"):v("howToInstall")]})]}),$&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:v("installationGuide")}),(0,a.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted mb-1",children:v("platforms")}),(0,a.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[v("afterInstallationRun")," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," ",v("toVerify")]})]})]})]}),!C&&ee&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[k?.settings?.env?.ANTHROPIC_BASE_URL&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:v("current")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:k.settings.env.ANTHROPIC_BASE_URL})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:v("baseUrl")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(b=J||p).endsWith("/v1")?b:`${b}/v1`,onChange:e=>W(e.target.value),placeholder:v("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),J&&J!==p&&(0,a.jsx)("button",{onClick:()=>W(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:v("resetToDefault"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:v("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),h.length>0?(0,a.jsx)("select",{value:I,onChange:e=>U(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:h.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:g?v("noApiKeysCreateOne"):v("defaultOmnirouteKey")})]}),e.defaultModels.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:e.name}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:n[e.alias]||"",onChange:t=>d(e.alias,t.target.value),placeholder:v("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>{D(e.alias),z(!0)},disabled:!u,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${u?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:v("selectModel")}),n[e.alias]&&(0,a.jsx)("button",{onClick:()=>d(e.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:v("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias))]}),P&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===P.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===P.type?"check_circle":"error"}),(0,a.jsx)("span",{children:P.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:er,disabled:!u,loading:_,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),v("apply")]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ei,disabled:!k?.hasOmniRoute,loading:O,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),v("reset")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>H(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),v("manualConfig")]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{G(!Z),Z||en()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),v("backups"),Y.length>0&&` (${Y.length})`]})]}),Z&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),v("configBackups")]}),0===Y.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:v("noBackupsYet")}):(0,a.jsx)("div",{className:"space-y-1.5",children:Y.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>eo(e.id),disabled:Q===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:Q===e.id?"...":v("restore")})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:M,onClose:()=>z(!1),onSelect:e=>{K&&d(K,e.value)},selectedModel:K?n[K]:null,activeProviders:i,modelAliases:F,title:v("selectModelForAlias",{alias:K||""})}),(0,a.jsx)(r.uR,{isOpen:B,onClose:()=>H(!1),title:v("claudeManualConfiguration"),configs:(j=I&&I.trim()?I:g?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",N={ANTHROPIC_BASE_URL:el(),ANTHROPIC_AUTH_TOKEN:j},e.defaultModels.forEach(e=>{let t=n[e.alias];t&&e.envKey&&(N[e.envKey]=t)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({env:N},null,2)}])})]})}function u({tool:e,isExpanded:t,onToggle:s,baseUrl:i,apiKeys:n,activeProviders:d,cloudEnabled:m,batchStatus:p,lastConfiguredAt:u}){let h,g,f,y=(0,c.c)("cliTools"),[b,j]=(0,l.useState)(null),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[_,A]=(0,l.useState)(null),[O,E]=(0,l.useState)(!1),[P,T]=(0,l.useState)(""),[$,R]=(0,l.useState)(""),[M,z]=(0,l.useState)(!1),[K,D]=(0,l.useState)({}),[I,U]=(0,l.useState)(!1),[F,L]=(0,l.useState)(""),[B,H]=(0,l.useState)([]),[J,W]=(0,l.useState)(!1),[q,Y]=(0,l.useState)(""),[V,Z]=(0,l.useState)(!1),[G,Q]=(0,l.useState)(null),[X,ee]=(0,l.useState)([]),[et,es]=(0,l.useState)(!1),[ea,el]=(0,l.useState)(null),er=!!(b?.installed&&b?.runnable);(0,l.useEffect)(()=>{n?.length>0&&!P&&T(n[0].key)},[n,P]),(0,l.useEffect)(()=>{t&&!b&&(ec(),ei(),em(),eg())},[t,b]);let ei=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&D(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(b?.config){let e=b.config.match(/^model\s*=\s*"([^"]+)"/m);e&&R(e[1])}},[b]);let en=(er?b.config?b.config.includes(i)||b.config.includes("localhost")||b.config.includes("127.0.0.1")?"configured":"other":"not_configured":null)||p?.configStatus||null,eo=()=>{let e=F||`${i}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},ec=async()=>{v(!0);try{let e=await fetch("/api/cli-tools/codex-settings"),t=await e.json();j(t)}catch(e){j({installed:!1,error:e.message})}finally{v(!1)}},ed=async()=>{w(!0),A(null);try{let e=P&&P.trim()||m?P:"sk_omniroute",t=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:eo(),apiKey:e,model:$})}),s=await t.json();t.ok?(A({type:"success",text:y("settingsApplied")}),ec()):A({type:"error",text:s.error||y("failedApplySettings")})}catch(e){A({type:"error",text:e.message})}finally{w(!1)}},ex=async()=>{S(!0),A(null);try{let e=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),t=await e.json();e.ok?(A({type:"success",text:y("settingsReset")}),R(""),ec()):A({type:"error",text:t.error||y("failedResetSettings")})}catch(e){A({type:"error",text:e.message})}finally{S(!1)}},em=async()=>{try{let e=await fetch("/api/cli-tools/codex-profiles"),t=await e.json();e.ok&&H(t.profiles||[])}catch(e){console.log("Error fetching profiles:",e)}},ep=async()=>{if(q.trim()){Z(!0),A(null);try{let e=await fetch("/api/cli-tools/codex-profiles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:q.trim()})}),t=await e.json();e.ok?(A({type:"success",text:y("profileSaved",{name:q})}),Y(""),em()):A({type:"error",text:t.error||y("failedSaveProfile")})}catch(e){A({type:"error",text:e.message})}finally{Z(!1)}}},eu=async e=>{Q(e),A(null);try{let t=await fetch("/api/cli-tools/codex-profiles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e})}),s=await t.json();t.ok?(A({type:"success",text:s.message||y("profileActivated")}),ec(),eg()):A({type:"error",text:s.error||y("failedActivateProfile")})}catch(e){A({type:"error",text:e.message})}finally{Q(null)}},eh=async e=>{try{(await fetch("/api/cli-tools/codex-profiles",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e})})).ok&&em()}catch(e){console.log("Error deleting profile:",e)}},eg=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=codex"),t=await e.json();e.ok&&ee(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},ef=async e=>{el(e),A(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"codex",backupId:e})}),s=await t.json();t.ok?(A({type:"success",text:y("backupRestored")}),ec(),eg()):A({type:"error",text:s.error||y("failedRestore")})}catch(e){A({type:"error",text:e.message})}finally{el(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/codex.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:en,batchStatus:p,lastConfiguredAt:u})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:y("toolDescriptions.codex")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[N&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:y("checkingCli",{tool:"Codex"})})]}),!N&&b&&!er&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:b.installed?y("cliNotRunnable",{tool:"Codex"}):y("cliNotInstalled",{tool:"Codex"})}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:b.installed?y("cliFoundFailedHealthcheck",{tool:"Codex",reason:b.reason?` (${b.reason})`:""}):y("installCodexPrompt")})]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>E(!O),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:O?"expand_less":"help"}),O?y("hide"):y("howToInstall")]})]}),O&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:y("installationGuide")}),(0,a.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted mb-1",children:y("platforms")}),(0,a.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[y("afterInstallationRun")," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," ",y("toVerify")]}),(0,a.jsx)("div",{className:"pt-2 border-t border-border",children:(0,a.jsxs)("p",{className:"text-text-muted text-xs",children:[y("codexAuthNotePrefix")," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/auth.json"})," ",y("codexAuthNoteMiddle")," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"OPENAI_API_KEY"}),". ",y("codexAuthNoteSuffix")]})})]})]})]}),!N&&er&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[b?.config&&((g=(h=b.config.match(/base_url\s*=\s*"([^"]+)"/))?h[1]:null)?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("current")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:g})]}):null),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("baseUrl")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:F||`${i}/v1`,onChange:e=>L(e.target.value),placeholder:y("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),F&&F!==`${i}/v1`&&(0,a.jsx)("button",{onClick:()=>L(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:y("resetToDefault"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),n.length>0?(0,a.jsx)("select",{value:P,onChange:e=>T(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:n.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:m?y("noApiKeysCreateOne"):y("defaultOmnirouteKey")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("model")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:$,onChange:e=>R(e.target.value),placeholder:y("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>z(!0),disabled:!d?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:y("selectModel")}),$&&(0,a.jsx)("button",{onClick:()=>R(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:y("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),_&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===_.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===_.type?"check_circle":"error"}),(0,a.jsx)("span",{children:_.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ed,disabled:!P||!$,loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),y("apply")]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ex,disabled:!b.hasOmniRoute,loading:C,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),y("reset")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>U(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),y("manualConfig")]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{W(!J),J||em()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"manage_accounts"}),y("profiles")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{es(!et),et||eg()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),y("backups"),X.length>0&&` (${X.length})`]})]}),J&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"manage_accounts"}),y("savedProfiles")]}),0===B.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:y("noProfilesYet")}):(0,a.jsx)("div",{className:"space-y-1.5 mb-3",children:B.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"person"}),(0,a.jsx)("span",{className:"font-medium flex-1 truncate",children:e.name}),(0,a.jsx)("span",{className:"text-text-muted truncate max-w-[140px]",title:e.authLabel,children:e.authLabel}),(0,a.jsx)("button",{onClick:()=>eu(e.id),disabled:G===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:G===e.id?"...":y("activate")}),(0,a.jsx)("button",{onClick:()=>eh(e.id),className:"p-0.5 text-text-muted hover:text-red-500 transition-colors",title:y("deleteProfile"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]},e.id))}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:q,onChange:e=>Y(e.target.value),placeholder:y("profileNamePlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50",onKeyDown:e=>"Enter"===e.key&&ep()}),(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ep,disabled:!q.trim(),loading:V,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),y("saveCurrent")]})]})]}),et&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),y("configBackups")]}),0===X.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:y("noBackupsYet")}):(0,a.jsx)("div",{className:"space-y-1.5",children:X.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>ef(e.id),disabled:ea===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:ea===e.id?"...":y("restore")})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:M,onClose:()=>z(!1),onSelect:e=>{R(e.value),z(!1)},selectedModel:$,activeProviders:d,modelAliases:K,title:y("selectModelForTool",{tool:"Codex"})}),(0,a.jsx)(r.uR,{isOpen:I,onClose:()=>U(!1),title:y("codexManualConfiguration"),configs:(f=P&&P.trim()?P:m?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",[{filename:"~/.codex/config.toml",content:`# OmniRoute Configuration for Codex CLI
|
|
8
|
+
model = "${$}"
|
|
9
|
+
model_provider = "omniroute"
|
|
10
|
+
|
|
11
|
+
[model_providers.omniroute]
|
|
12
|
+
name = "OmniRoute"
|
|
13
|
+
base_url = "${eo()}"
|
|
14
|
+
wire_api = "responses"
|
|
15
|
+
`},{filename:"~/.codex/auth.json",content:JSON.stringify({OPENAI_API_KEY:f},null,2)}])})]})}let h="https://cloud.omniroute.online";function g({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:m,cloudEnabled:p,batchStatus:u,lastConfiguredAt:g}){let f,y,b,j,N=(0,c.c)("cliTools"),[v,k]=(0,l.useState)(null),[w,C]=(0,l.useState)(!1),[S,_]=(0,l.useState)(!1),[A,O]=(0,l.useState)(!1),[E,P]=(0,l.useState)(null),[T,$]=(0,l.useState)(""),[R,M]=(0,l.useState)(""),[z,K]=(0,l.useState)(!1),[D,I]=(0,l.useState)({}),[U,F]=(0,l.useState)(!1),[L,B]=(0,l.useState)(""),H=(0,l.useRef)(!1),[J,W]=(0,l.useState)([]),[q,Y]=(0,l.useState)(!1),[V,Z]=(0,l.useState)(null),G=!!(v?.installed&&v?.runnable),Q=(()=>{if(!G)return null;let e=v.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id);if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=p&&h&&e.baseUrl?.startsWith(h);return t||s?"configured":"other"})()||u?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!T&&$(d[0].key)},[d,T]),(0,l.useEffect)(()=>{t&&!v&&(ee(),X(),el())},[t,v]);let X=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&I(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(v?.installed&&!H.current){H.current=!0;let e=v.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id);e&&(e.model&&M(e.model),e.apiKey&&d?.some(t=>t.key===e.apiKey)&&$(e.apiKey))}},[v,d]);let ee=async()=>{C(!0);try{let e=await fetch("/api/cli-tools/droid-settings"),t=await e.json();k(t)}catch(e){k({installed:!1,error:e.message})}finally{C(!1)}},et=()=>{let e=L||i;return e.endsWith("/v1")?e:`${e}/v1`},es=async()=>{_(!0),P(null);try{let e=T?.trim()||(d?.length>0?d[0].key:null)||(p?null:"sk_omniroute"),t=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:et(),apiKey:e,model:R})}),s=await t.json();t.ok?(P({type:"success",text:N("settingsApplied")}),ee()):P({type:"error",text:s.error||N("failedApplySettings")})}catch(e){P({type:"error",text:e.message})}finally{_(!1)}},ea=async()=>{O(!0),P(null);try{let e=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),t=await e.json();e.ok?(P({type:"success",text:N("settingsReset")}),M(""),$(""),ee()):P({type:"error",text:t.error||N("failedResetSettings")})}catch(e){P({type:"error",text:e.message})}finally{O(!1)}},el=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=droid"),t=await e.json();e.ok&&W(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},er=async e=>{Z(e),P(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"droid",backupId:e})}),s=await t.json();t.ok?(P({type:"success",text:N("backupRestored")}),ee(),el()):P({type:"error",text:s.error||N("failedRestore")})}catch(e){P({type:"error",text:e.message})}finally{Z(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/droid.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:Q,batchStatus:u,lastConfiguredAt:g})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:N("toolDescriptions.droid")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[w&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:N("checkingCli",{tool:"Factory Droid"})})]}),!w&&v&&!G&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:v.installed?N("cliNotRunnable",{tool:"Factory Droid"}):N("cliNotInstalled",{tool:"Factory Droid"})}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:v.installed?N("cliFoundFailedHealthcheck",{tool:"Factory Droid",reason:v.reason?` (${v.reason})`:""}):N("installCliPrompt",{tool:"Factory Droid"})})]})]}),!w&&G&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[v?.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id)?.baseUrl&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:N("current")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:v.settings.customModels.find(e=>"custom:OmniRoute-0"===e.id).baseUrl})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:N("baseUrl")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(f=L||i).endsWith("/v1")?f:`${f}/v1`,onChange:e=>B(e.target.value),placeholder:N("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),L&&L!==i&&(0,a.jsx)("button",{onClick:()=>B(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:N("resetToDefault"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:N("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,a.jsx)("select",{value:T,onChange:e=>$(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:p?N("noApiKeysCreateOne"):N("defaultOmnirouteKey")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:N("model")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:R,onChange:e=>M(e.target.value),placeholder:N("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>K(!0),disabled:!n,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${n?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:N("selectModel")}),R&&(0,a.jsx)("button",{onClick:()=>M(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:N("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),E&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===E.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===E.type?"check_circle":"error"}),(0,a.jsx)("span",{children:E.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:es,disabled:!R,loading:S,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),N("apply")]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ea,disabled:!v?.hasOmniRoute,loading:A,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),N("reset")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>F(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),N("manualConfig")]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{Y(!q),q||el()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),N("backups"),J.length>0&&` (${J.length})`]})]}),q&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),N("configBackups")]}),0===J.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:N("noBackupsYet")}):(0,a.jsx)("div",{className:"space-y-1.5",children:J.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>er(e.id),disabled:V===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:V===e.id?"...":N("restore")})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:z,onClose:()=>K(!1),onSelect:e=>{M(e.value),K(!1)},selectedModel:R,activeProviders:m,modelAliases:D,title:N("selectModelForTool",{tool:"Factory Droid"})}),(0,a.jsx)(r.uR,{isOpen:U,onClose:()=>F(!1),title:N("droidManualConfiguration"),configs:(y=T&&T.trim()?T:p?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",b={customModels:[{model:R||"provider/model-id",id:"custom:OmniRoute-0",index:0,baseUrl:et(),apiKey:y,displayName:R||"provider/model-id",maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}]},j="u">typeof navigator&&navigator.platform,[{filename:j?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(b,null,2)}])})]})}let f="https://cloud.omniroute.online";function y({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:m,cloudEnabled:p,batchStatus:u,lastConfiguredAt:h}){let g,y,b=(0,c.c)("cliTools"),[j,N]=(0,l.useState)(null),[v,k]=(0,l.useState)(!1),[w,C]=(0,l.useState)(!1),[S,_]=(0,l.useState)(!1),[A,O]=(0,l.useState)(null),[E,P]=(0,l.useState)(""),[T,$]=(0,l.useState)(""),[R,M]=(0,l.useState)(!1),[z,K]=(0,l.useState)({}),[D,I]=(0,l.useState)(!1),[U,F]=(0,l.useState)(""),L=(0,l.useRef)(!1),[B,H]=(0,l.useState)([]),[J,W]=(0,l.useState)(!1),[q,Y]=(0,l.useState)(null),V=!!(j?.installed&&j?.runnable),Z=(()=>{if(!V)return null;let e=j.settings?.models?.providers?.omniroute;if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=p&&f&&e.baseUrl?.startsWith(f);return t||s?"configured":"other"})()||u?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!E&&P(d[0].key)},[d,E]),(0,l.useEffect)(()=>{t&&!j&&(Q(),G(),es())},[t,j]);let G=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&K(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(j?.installed&&!L.current){L.current=!0;let e=j.settings?.models?.providers?.omniroute;if(e){let t=j.settings?.agents?.defaults?.model?.primary;t&&$(t.replace("omniroute/","")),e.apiKey&&d?.some(t=>t.key===e.apiKey)&&P(e.apiKey)}}},[j,d]);let Q=async()=>{k(!0);try{let e=await fetch("/api/cli-tools/openclaw-settings"),t=await e.json();N(t)}catch(e){N({installed:!1,error:e.message})}finally{k(!1)}},X=()=>{let e=U||i;return e.endsWith("/v1")?e:`${e}/v1`},ee=async()=>{C(!0),O(null);try{let e=E?.trim()||(d?.length>0?d[0].key:null)||(p?null:"sk_omniroute"),t=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:X(),apiKey:e,model:T})}),s=await t.json();t.ok?(O({type:"success",text:b("settingsApplied")}),Q()):O({type:"error",text:s.error||b("failedApplySettings")})}catch(e){O({type:"error",text:e.message})}finally{C(!1)}},et=async()=>{_(!0),O(null);try{let e=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),t=await e.json();e.ok?(O({type:"success",text:b("settingsReset")}),$(""),P(""),Q()):O({type:"error",text:t.error||b("failedResetSettings")})}catch(e){O({type:"error",text:e.message})}finally{_(!1)}},es=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=openclaw"),t=await e.json();e.ok&&H(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},ea=async e=>{Y(e),O(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"openclaw",backupId:e})}),s=await t.json();t.ok?(O({type:"success",text:b("backupRestored")}),Q(),es()):O({type:"error",text:s.error||b("failedRestore")})}catch(e){O({type:"error",text:e.message})}finally{Y(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/openclaw.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:Z,batchStatus:u,lastConfiguredAt:h})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:b("toolDescriptions.openclaw")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[v&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:b("checkingCli",{tool:"Open Claw"})})]}),!v&&j&&!V&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:j.installed?b("cliNotRunnable",{tool:"Open Claw"}):b("cliNotInstalled",{tool:"Open Claw"})}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:j.installed?b("cliFoundFailedHealthcheck",{tool:"Open Claw",reason:j.reason?` (${j.reason})`:""}):b("installCliPrompt",{tool:"Open Claw"})})]})]}),!v&&V&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[j?.settings?.models?.providers?.omniroute?.baseUrl&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:b("current")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:j.settings.models.providers.omniroute.baseUrl})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:b("baseUrl")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(g=U||i).endsWith("/v1")?g:`${g}/v1`,onChange:e=>F(e.target.value),placeholder:b("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),U&&U!==i&&(0,a.jsx)("button",{onClick:()=>F(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:b("resetToDefault"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:b("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,a.jsx)("select",{value:E,onChange:e=>P(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:p?b("noApiKeysCreateOne"):b("defaultOmnirouteKey")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:b("model")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:T,onChange:e=>$(e.target.value),placeholder:b("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>M(!0),disabled:!n,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${n?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:b("selectModel")}),T&&(0,a.jsx)("button",{onClick:()=>$(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:b("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),A&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,a.jsx)("span",{children:A.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ee,disabled:!T,loading:w,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),b("apply")]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:et,disabled:!j?.hasOmniRoute,loading:S,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),b("reset")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>I(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),b("manualConfig")]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{W(!J),J||es()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),b("backups"),B.length>0&&` (${B.length})`]})]}),J&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),b("configBackups")]}),0===B.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:b("noBackupsYet")}):(0,a.jsx)("div",{className:"space-y-1.5",children:B.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>ea(e.id),disabled:q===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:q===e.id?"...":b("restore")})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:R,onClose:()=>M(!1),onSelect:e=>{$(e.value),M(!1)},selectedModel:T,activeProviders:m,modelAliases:z,title:b("selectModelForTool",{tool:"Open Claw"})}),(0,a.jsx)(r.uR,{isOpen:D,onClose:()=>I(!1),title:b("openClawManualConfiguration"),configs:(y=E&&E.trim()?E:p?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`omniroute/${T||"provider/model-id"}`}}},models:{providers:{omniroute:{baseUrl:X(),apiKey:y,api:"openai-completions",models:[{id:T||"provider/model-id",name:(T||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}let b="https://cloud.omniroute.online";function j({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:m,cloudEnabled:p,batchStatus:u,lastConfiguredAt:h}){let g=(0,c.c)("cliTools"),[f,y]=(0,l.useState)(null),[j,N]=(0,l.useState)(!1),[v,k]=(0,l.useState)(!1),[w,C]=(0,l.useState)(!1),[S,_]=(0,l.useState)(null),[A,O]=(0,l.useState)(""),[E,P]=(0,l.useState)(""),[T,$]=(0,l.useState)(!1),[R,M]=(0,l.useState)({}),[z,K]=(0,l.useState)(!1),[D,I]=(0,l.useState)(""),U=(0,l.useRef)(!1),[F,L]=(0,l.useState)([]),[B,H]=(0,l.useState)(!1),[J,W]=(0,l.useState)(null),q=!!(f?.installed&&f?.runnable),Y=(()=>{if(!q)return null;if(!f.hasOmniRoute)return"not_configured";let e=f.settings?.openAiBaseUrl||"",t=e.includes("localhost")||e.includes("127.0.0.1"),s=p&&b&&e.startsWith(b);return t||s?"configured":"other"})(),V=Y||u?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!A&&O(d[0].key)},[d,A]),(0,l.useEffect)(()=>{t&&!f&&(X(),Z(),G())},[t,f]),(0,l.useEffect)(()=>{if(f?.settings&&!U.current){let e=f.settings.openAiModelId;e&&(P(e),U.current=!0)}},[f]);let Z=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let t=await e.json();M(t.aliases||{})}}catch{}},G=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=cline");if(e.ok){let t=await e.json();L(t.backups||[])}}catch{}},Q=async e=>{W(e);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"cline",backupId:e})});if(t.ok)_({type:"success",text:g("backupRestoredReloading")}),await X(),await G();else{let e=await t.json();_({type:"error",text:e.error||g("failedRestoreBackup")})}}catch(e){_({type:"error",text:e.message})}finally{W(null)}},X=async()=>{N(!0);try{let e=await fetch("/api/cli-tools/cline-settings"),t=await e.json();y(t)}catch(e){y({error:e.message})}finally{N(!1)}},ee=async()=>{k(!0),_(null);try{let e=D||i||"http://localhost:20128",t=e.endsWith("/v1")?e:`${e}/v1`,s=await fetch("/api/cli-tools/cline-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:t,apiKey:A||"sk_omniroute",model:E})}),a=await s.json();s.ok?(_({type:"success",text:a.message||g("applied")}),await X(),await G()):_({type:"error",text:a.error||g("failed")})}catch(e){_({type:"error",text:e.message})}finally{k(!1)}},et=async()=>{C(!0),_(null);try{let e=await fetch("/api/cli-tools/cline-settings",{method:"DELETE"}),t=await e.json();e.ok?(_({type:"success",text:t.message||g("resetDone")}),P(""),U.current=!1,await X(),await G()):_({type:"error",text:t.error||g("failed")})}catch(e){_({type:"error",text:e.message})}finally{C(!1)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:e.image?(0,a.jsx)(o.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}}):(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:e.color},children:"terminal"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:V,batchStatus:u,lastConfiguredAt:h})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:g("toolDescriptions.cline")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[j&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:g("checkingCli",{tool:"Cline"})})]}),f&&!j&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${q?"text-green-500":"text-yellow-500"}`,children:q?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:q?g("cliDetectedReady",{tool:"Cline"}):f.installed?g("cliNotRunnable",{tool:"Cline"}):g("cliNotDetected",{tool:"Cline"})}),f.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("binary"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.commandPath})]}),f.globalStatePath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("configPathShort"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.globalStatePath})]})]})]}),q&&(0,a.jsxs)(a.Fragment,{children:["configured"===Y&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:g("omnirouteConfiguredOpenAiCompatible")}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("provider"),": ",(0,a.jsx)("strong",{children:"openai"})," • ",g("model"),":"," ",(0,a.jsx)("strong",{children:f.settings?.openAiModelId||"—"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:g("model")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:E,onChange:e=>P(e.target.value),placeholder:g("providerModelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)(r.$n,{variant:"outline",size:"sm",onClick:()=>$(!0),disabled:!n,children:g("select")}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>K(!0),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:g("apiKey")}),d&&d.length>0?(0,a.jsx)("select",{value:A,onChange:e=>O(e.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:p?g("noApiKeysAvailable"):g("usingDefaultOmniroute")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ee,disabled:!E,loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===Y?g("updateConfig"):g("applyConfig")]}),"configured"===Y&&(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:et,loading:w,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),g("reset")]})]}),S&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===S.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===S.type?"check_circle":"error"}),(0,a.jsx)("span",{children:S.text})]}),(0,a.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,a.jsxs)("button",{onClick:()=>H(!B),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${B?"rotate-90":""}`,children:"chevron_right"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),g("backups")," ",F.length>0&&`(${F.length})`]}),B&&F.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:F.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-medium",children:e.originalFile}),(0,a.jsx)("span",{className:"text-text-muted",children:new Date(e.createdAt).toLocaleString()})]}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>Q(e.id),loading:J===e.id,children:g("restore")})]},e.id))}),B&&0===F.length&&(0,a.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:g("noBackupsAvailable")})]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:T,onClose:()=>$(!1),onSelect:e=>{P(e.value),$(!1)},selectedModel:E,activeProviders:m,title:g("selectModelForTool",{tool:"Cline"})}),z&&(0,a.jsx)(r.uR,{isOpen:z,onClose:()=>K(!1),title:g("clineManualConfiguration"),...{onApply:e=>{e.model&&P(e.model),e.apiKey&&O(e.apiKey),e.baseUrl&&I(e.baseUrl),K(!1)},currentConfig:{model:E,apiKey:A,baseUrl:D||i}}})]})}function N({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:m,cloudEnabled:p,batchStatus:u,lastConfiguredAt:h}){let g=(0,c.c)("cliTools"),[f,y]=(0,l.useState)(null),[b,j]=(0,l.useState)(!1),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)(null),[_,A]=(0,l.useState)(""),[O,E]=(0,l.useState)(""),[P,T]=(0,l.useState)(!1),[$,R]=(0,l.useState)({}),[M,z]=(0,l.useState)(!1),[K,D]=(0,l.useState)(""),I=(0,l.useRef)(!1),[U,F]=(0,l.useState)([]),[L,B]=(0,l.useState)(!1),[H,J]=(0,l.useState)(null),W=!!(f?.installed&&f?.runnable),q=W?f.hasOmniRoute?"configured":"not_configured":null,Y=q||u?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!_&&A(d[0].key)},[d,_]),(0,l.useEffect)(()=>{t&&!f&&(Q(),V(),Z())},[t,f]);let V=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let t=await e.json();R(t.aliases||{})}}catch{}},Z=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=kilo");if(e.ok){let t=await e.json();F(t.backups||[])}}catch{}},G=async e=>{J(e);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"kilo",backupId:e})});if(t.ok)S({type:"success",text:g("backupRestoredReloading")}),await Q(),await Z();else{let e=await t.json();S({type:"error",text:e.error||g("failedRestoreBackup")})}}catch(e){S({type:"error",text:e.message})}finally{J(null)}},Q=async()=>{j(!0);try{let e=await fetch("/api/cli-tools/kilo-settings"),t=await e.json();y(t)}catch(e){y({error:e.message})}finally{j(!1)}},X=async()=>{v(!0),S(null);try{let e=K||i||"http://localhost:20128",t=e.endsWith("/v1")?e:`${e}/v1`,s=await fetch("/api/cli-tools/kilo-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:t,apiKey:_||"sk_omniroute",model:O})}),a=await s.json();s.ok?(S({type:"success",text:a.message||g("applied")}),await Q(),await Z()):S({type:"error",text:a.error||g("failed")})}catch(e){S({type:"error",text:e.message})}finally{v(!1)}},ee=async()=>{w(!0),S(null);try{let e=await fetch("/api/cli-tools/kilo-settings",{method:"DELETE"}),t=await e.json();e.ok?(S({type:"success",text:t.message||g("resetDone")}),E(""),I.current=!1,await Q(),await Z()):S({type:"error",text:t.error||g("failed")})}catch(e){S({type:"error",text:e.message})}finally{w(!1)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:e.image?(0,a.jsx)(o.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}}):(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:e.color},children:"terminal"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:Y,batchStatus:u,lastConfiguredAt:h})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:g("toolDescriptions.kilo")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[b&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:g("checkingCli",{tool:"Kilo Code"})})]}),f&&!b&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${W?"text-green-500":"text-yellow-500"}`,children:W?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:W?g("cliDetectedReady",{tool:"Kilo Code"}):f.installed?g("cliNotRunnable",{tool:"Kilo Code"}):g("cliNotDetected",{tool:"Kilo Code"})}),f.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("binary"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.commandPath})]}),f.authPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("auth"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.authPath})]})]})]}),W&&(0,a.jsxs)(a.Fragment,{children:["configured"===q&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:g("omnirouteConfiguredOpenAiCompatible")}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("providers"),":"," ",(0,a.jsx)("strong",{children:f.settings?.auth?.join(", ")||"—"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:g("model")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:O,onChange:e=>E(e.target.value),placeholder:g("providerModelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)(r.$n,{variant:"outline",size:"sm",onClick:()=>T(!0),disabled:!n,children:g("select")}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>z(!0),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:g("apiKey")}),d&&d.length>0?(0,a.jsx)("select",{value:_,onChange:e=>A(e.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:p?g("noApiKeysAvailable"):g("usingDefaultOmniroute")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:X,disabled:!O,loading:N,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===q?g("updateConfig"):g("applyConfig")]}),"configured"===q&&(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ee,loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),g("reset")]})]}),C&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===C.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===C.type?"check_circle":"error"}),(0,a.jsx)("span",{children:C.text})]}),(0,a.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,a.jsxs)("button",{onClick:()=>B(!L),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${L?"rotate-90":""}`,children:"chevron_right"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),g("backups")," ",U.length>0&&`(${U.length})`]}),L&&U.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:U.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-medium",children:e.originalFile}),(0,a.jsx)("span",{className:"text-text-muted",children:new Date(e.createdAt).toLocaleString()})]}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>G(e.id),loading:H===e.id,children:g("restore")})]},e.id))}),L&&0===U.length&&(0,a.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:g("noBackupsAvailable")})]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:P,onClose:()=>T(!1),onSelect:e=>{E(e.value),T(!1)},selectedModel:O,activeProviders:m,title:g("selectModelForTool",{tool:"Kilo Code"})}),M&&(0,a.jsx)(r.uR,{isOpen:M,onClose:()=>z(!1),title:g("kiloManualConfiguration"),...{onApply:e=>{e.model&&E(e.model),e.apiKey&&A(e.apiKey),e.baseUrl&&D(e.baseUrl),z(!1)},currentConfig:{model:O,apiKey:_,baseUrl:K||i}}})]})}function v({toolId:e,tool:t,isExpanded:s,onToggle:i,baseUrl:n,apiKeys:d,activeProviders:x=[],cloudEnabled:m=!1,batchStatus:p}){let u,h,g,f=(0,c.c)("cliTools"),y=(0,l.useCallback)((e,t,s)=>{try{return f(e,s)}catch{return t}},[f]),[b,j]=(0,l.useState)(null),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(""),[C,S]=(0,l.useState)(null),[_,A]=(0,l.useState)(null),[O,E]=(0,l.useState)(!1),P=(0,l.useRef)(!1),[T,$]=(0,l.useState)(()=>d?.length>0?d[0].key:"");(0,l.useEffect)(()=>{let t=localStorage.getItem(`omniroute-cli-model-${e}`);t&&w(t);let s=localStorage.getItem(`omniroute-cli-key-${e}`);s&&d?.some(e=>e.key===s)&&$(s)},[e,d]);let R=(0,l.useCallback)(t=>{w(t),t?localStorage.setItem(`omniroute-cli-model-${e}`,t):localStorage.removeItem(`omniroute-cli-model-${e}`)},[e]),M=(0,l.useCallback)(t=>{$(t),t&&localStorage.setItem(`omniroute-cli-key-${e}`,t)},[e]);(0,l.useEffect)(()=>{!s||C||P.current||(P.current=!0,fetch(`/api/cli-tools/runtime/${e}`).then(e=>e.json()).then(e=>S(e)).catch(e=>S({error:e?.message||f("runtimeCheckFailed")})))},[s,C,e]);let z=e=>{let t=T&&T.trim()?T:m?f("yourApiKeyPlaceholder"):"sk_omniroute",s=n||"http://localhost:20128",a=s.endsWith("/v1")?s:`${s}/v1`;return e.replace(/\{\{baseUrl\}\}/g,a).replace(/\{\{apiKey\}\}/g,t).replace(/\{\{model\}\}/g,k||f("modelPlaceholder"))},K=async(e,t)=>{await navigator.clipboard.writeText(z(e)),j(t),setTimeout(()=>j(null),2e3)},D=x.length>0,I=s&&null===C,U=async()=>{E(!0),A(null);try{let t=T&&T.trim()?T:m?"":"sk_omniroute",s=n||"http://localhost:20128",a=s.endsWith("/v1")?s:`${s}/v1`,l=await fetch(`/api/cli-tools/guide-settings/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:a,apiKey:t,model:k})}),r=await l.json();l.ok?A({type:"success",text:r.message||f("configurationSaved")}):A({type:"error",text:r.error||f("failedToSave")})}catch(e){A({type:"error",text:e.message})}finally{E(!1)}},F=["continue"].includes(e),L=()=>!t.requiresCloud||!!m;return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:i,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:t.image?(0,a.jsx)(o.default,{src:t.image,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}}):t.icon?(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:t.color},children:t.icon}):(0,a.jsx)(o.default,{src:`/providers/${e}.png`,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:t.name}),(u=C?.reason==="not_required"||"guide"===t.configType,h=C?C.installed&&C.runnable:p?.installed&&p?.runnable,g=C?C.installed:p?.installed,u?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-blue-500/10 text-blue-600 dark:text-blue-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-blue-500"}),f("guide")]}):h?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-green-500/10 text-green-600 dark:text-green-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-green-500"}),f("detected")]}):!1===g&&(C||p)?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-zinc-400 dark:bg-zinc-500"}),f("notInstalled")]}):g&&!h&&(C||p)?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-yellow-500"}),f("notReady")]}):null)]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:y(`toolDescriptions.${e}`,t.description)})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${s?"rotate-180":""}`,children:"expand_more"})]}),s&&(0,a.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:t.guideSteps?(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[I&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:f("checkingRuntime")})]}),!I&&C&&!C.error&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"not_required"===C.reason?"info":C.installed&&C.runnable?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"not_required"===C.reason?f("guideOnlyIntegration"):C.installed&&C.runnable?f("cliRuntimeDetected"):C.installed?f("cliFoundNotRunnable",{reason:C.reason?`: ${C.reason}`:""}):f("cliRuntimeNotDetected")}),C.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[f("binary"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:C.commandPath})]}),C.configPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[f("configPath"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:C.configPath})]})]})]}),!I&&C?.error&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500 text-lg",children:"error"}),(0,a.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:f("failedCheckRuntimeStatus")})]}),t.notes&&0!==t.notes.length?(0,a.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:t.notes.map((t,s)=>{if("cloudCheck"===t.type&&m)return null;let l="warning"===t.type,r="cloudCheck"===t.type&&!m,i="bg-blue-500/10 border-blue-500/30",n="text-blue-600 dark:text-blue-400",o="text-blue-500",c="info";return l?(i="bg-yellow-500/10 border-yellow-500/30",n="text-yellow-600 dark:text-yellow-400",o="text-yellow-500",c="warning"):r&&(i="bg-red-500/10 border-red-500/30",n="text-red-600 dark:text-red-400",o="text-red-500",c="error"),(0,a.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${i}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${o}`,children:c}),(0,a.jsx)("p",{className:`text-sm ${n}`,children:y(`guides.${e}.notes.${s}`,t.text)})]},s)})}):null,L()&&t.guideSteps.map(s=>(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:t.color},children:s.step}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-text",children:y(`guides.${e}.steps.${s.step}.title`,s.title)}),s.desc&&(0,a.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:y(`guides.${e}.steps.${s.step}.desc`,s.desc)}),"apiKeySelector"===s.type&&(0,a.jsx)("div",{className:"mt-2 flex items-center gap-2",children:d&&d.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("select",{value:T,onChange:e=>M(e.target.value),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}),(0,a.jsx)("button",{onClick:()=>K(T,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===b?"check":"content_copy"})})]}):(0,a.jsx)("span",{className:"text-sm text-text-muted",children:m?f("noApiKeysCreateOne"):"sk_omniroute"})}),"modelSelector"===s.type&&(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:k,onChange:e=>R(e.target.value),placeholder:f("modelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>v(!0),disabled:!D,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${D?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:f("selectModel")}),k&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:()=>K(k,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===b?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>R(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:f("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),s.value&&(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,a.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:z(s.value)}),s.copyable&&(0,a.jsx)("button",{onClick:()=>K(s.value,`${s.step}-${s.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:b===`${s.step}-${s.title}`?"check":"content_copy"})})]})]})]},s.step)),L()&&t.codeBlock&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:t.codeBlock.language}),(0,a.jsxs)("button",{onClick:()=>K(t.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===b?"check":"content_copy"}),"codeblock"===b?f("copied"):f("copy")]})]}),(0,a.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,a.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:z(t.codeBlock.code)})})]}),L()&&(0,a.jsxs)("div",{className:"mt-2",children:[_&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs mb-2 ${"success"===_.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===_.type?"check_circle":"error"}),(0,a.jsx)("span",{children:_.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[F&&(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:U,disabled:!k,loading:O,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),f("saveConfig")]}),t.codeBlock&&(0,a.jsxs)(r.$n,{variant:F?"outline":"primary",size:"sm",onClick:()=>K(t.codeBlock.code,"codeblock"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"codeblock"===b?"check":"content_copy"}),"codeblock"===b?f("copied"):f("copyConfig")]}),k&&(0,a.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-green-500",children:"check_circle"}),f("selectionSaved")]})]})]})]}):(0,a.jsx)("p",{className:"text-text-muted text-sm",children:f("comingSoon")})}),(0,a.jsx)(r.rq,{isOpen:N,onClose:()=>v(!1),onSelect:e=>{R(e.value)},selectedModel:k,activeProviders:x,title:f("selectModel")})]})}function k({tool:e,isExpanded:t,onToggle:s,baseUrl:i,apiKeys:n,activeProviders:d,hasActiveProviders:x,cloudEnabled:m}){let p=(0,c.c)("cliTools"),[u,h]=(0,l.useState)(null),[g,f]=(0,l.useState)(!1),[y,b]=(0,l.useState)(!1),[j,N]=(0,l.useState)(""),[v,k]=(0,l.useState)(""),[w,C]=(0,l.useState)(null),[S,_]=(0,l.useState)({}),[A,O]=(0,l.useState)(!1),[E,P]=(0,l.useState)(null);(0,l.useEffect)(()=>{n?.length>0&&!v&&k(n[0].key)},[n,v]),(0,l.useEffect)(()=>{t&&!u&&($(),T())},[t,u]);let T=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm/alias?tool=antigravity");if(e.ok){let t=(await e.json()).aliases||{};Object.keys(t).length>0&&_(t)}}catch(e){console.log("Error loading saved mappings:",e)}},$=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm");if(e.ok){let t=await e.json();h(t)}}catch(e){console.log("Error fetching status:",e),h({running:!1})}},R="u">typeof navigator&&navigator.userAgent?.includes("Windows"),M=async e=>{f(!0),C(null);try{let t=v?.trim()||(n?.length>0?n[0].key:null)||(m?null:"sk_omniroute"),s=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t,sudoPassword:e})}),a=await s.json();s.ok?(C({type:"success",text:p("mitmStarted")}),b(!1),N(""),$()):C({type:"error",text:a.error||p("failedStart")})}catch(e){C({type:"error",text:e.message})}finally{f(!1)}},z=async e=>{f(!0),C(null);try{let t=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:e})}),s=await t.json();t.ok?(C({type:"success",text:p("mitmStopped")}),b(!1),N(""),$()):C({type:"error",text:s.error||p("failedStop")})}catch(e){C({type:"error",text:e.message})}finally{f(!1)}},K=()=>{j.trim()?u?.running?z(j):M(j):C({type:"error",text:p("sudoPasswordRequiredError")})},D=(e,t)=>{_(s=>({...s,[e]:t}))},I=async()=>{f(!0),C(null);try{let e=await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"antigravity",mappings:S})});if(!e.ok){let t=await e.json();throw Error(t.error||p("failedSaveMappings"))}C({type:"success",text:p("mappingsSaved")})}catch(e){C({type:"error",text:e.message})}finally{f(!1)}},U=u?.running;return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/antigravity.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),U?(0,a.jsx)(r.Ex,{variant:"success",size:"sm",children:p("active")}):(0,a.jsx)(r.Ex,{variant:"default",size:"sm",children:p("inactive")})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:p("toolDescriptions.antigravity")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"flex items-center gap-2",children:U?(0,a.jsxs)("button",{onClick:()=>{R||u?.hasCachedPassword?z(""):(b(!0),C(null))},disabled:g,className:"px-4 py-2 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-sm flex items-center gap-2 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"stop_circle"}),p("stopMitm")]}):(0,a.jsxs)("button",{onClick:()=>{R||u?.hasCachedPassword?M(""):(b(!0),C(null))},disabled:g||!x,className:"px-4 py-2 rounded-lg bg-primary/10 border border-primary/30 text-primary font-medium text-sm flex items-center gap-2 hover:bg-primary/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"play_circle"}),p("startMitm")]})}),w?.type==="error"&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,a.jsx)("span",{children:w.text})]}),U&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:p("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),n.length>0?(0,a.jsx)("select",{value:v,onChange:e=>k(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:n.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:m?p("noApiKeysCreateOne"):p("defaultOmnirouteKey")})]}),e.defaultModels.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:e.name}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:S[e.alias]||"",onChange:t=>D(e.alias,t.target.value),placeholder:p("modelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>{P(e.alias),O(!0)},disabled:!x,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${x?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:p("select")}),S[e.alias]&&(0,a.jsx)("button",{onClick:()=>D(e.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:p("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias)),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:I,disabled:g||0===Object.keys(S).length,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),p("saveMappings")]})})]}),!U&&(0,a.jsxs)("div",{className:"flex flex-col gap-1.5 px-1",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:p("howItWorks")})," ",p("antigravityHowWorksDesc")]}),(0,a.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted",children:[(0,a.jsx)("span",{children:p("antigravityStep1")}),(0,a.jsxs)("span",{children:[p("antigravityStep2Prefix")," ",(0,a.jsx)("code",{className:"text-[10px] bg-surface px-1 rounded",children:"daily-cloudcode-pa.googleapis.com"})," ",p("antigravityStep2Suffix")]}),(0,a.jsx)("span",{children:p("antigravityStep3")})]})]})]}),(0,a.jsx)(r.aF,{isOpen:y,onClose:()=>{b(!1),N(""),C(null)},title:p("sudoPasswordRequiredTitle"),size:"sm",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:p("sudoPasswordHint")})]}),(0,a.jsx)(r.pd,{type:"password",placeholder:p("enterSudoPassword"),value:j,onChange:e=>N(e.target.value),onKeyDown:e=>{"Enter"!==e.key||g||K()}}),w&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===w.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===w.type?"check_circle":"error"}),(0,a.jsx)("span",{children:w.text})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{b(!1),N(""),C(null)},disabled:g,children:p("cancel")}),(0,a.jsx)(r.$n,{variant:"primary",size:"sm",onClick:K,loading:g,children:p("confirm")})]})]})}),(0,a.jsx)(r.rq,{isOpen:A,onClose:()=>O(!1),onSelect:e=>{E&&_(t=>({...t,[E]:e.value}))},selectedModel:E?S[E]:null,activeProviders:d,title:p("selectModelForAlias",{alias:E||""})})]})}let w="https://cloud.omniroute.online";function C({machineId:e}){let t,s,o,d=(0,c.c)("cliTools"),[x,m]=(0,l.useState)([]),[h,f]=(0,l.useState)(!0),[b,C]=(0,l.useState)(null),[S,_]=(0,l.useState)({}),[A,O]=(0,l.useState)(!1),[E,P]=(0,l.useState)([]),[T,$]=(0,l.useState)({}),[R,M]=(0,l.useState)(!1),[z,K]=(0,l.useState)("");(0,l.useEffect)(()=>{F(),D(),I(),U()},[]);let D=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let t=await e.json();O(t.cloudEnabled||!1);{let e=window.location.protocol,s=window.location.hostname,a=t?.apiPort||20128;K(`${e}//${s}:${a}`)}}}catch(e){console.log("Error loading cloud settings:",e)}},I=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let t=await e.json();P(t.keys||[])}}catch(e){console.log("Error fetching API keys:",e)}},U=async()=>{try{let e=new AbortController,t=setTimeout(()=>e.abort(),8e3),s=await fetch("/api/cli-tools/status",{signal:e.signal});if(clearTimeout(t),s.ok){let e=await s.json();$(e||{})}}catch(e){console.log("CLI tool status check timed out or failed:",e)}finally{M(!0)}},F=async()=>{try{let e=await fetch("/api/providers"),t=await e.json();e.ok&&m(t.connections||[])}catch(e){console.log("Error fetching connections:",e)}finally{f(!1)}},L=()=>x.filter(e=>!1!==e.isActive),B=(0,l.useCallback)((e,t,s)=>{_(a=>a[e]?.[t]===s?a:{...a,[e]:{...a[e],[t]:s}})},[]);if(h||!R)return(0,a.jsx)("div",{className:"flex flex-col gap-6",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{})]})});let H=(t=L(),s=[],o=new Set,t.forEach(e=>{let t=n.Xg[e.provider]||e.provider;(0,n.KC)(e.provider).forEach(a=>{let l=`${t}/${a.id}`;o.has(l)||(o.add(l),s.push({value:l,label:`${t}/${a.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:a.id}))})}),s).length>0;return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[!H&&(0,a.jsx)(r.Zp,{className:"border-yellow-500/50 bg-yellow-500/5",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:d("noActiveProviders")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:d("noActiveProvidersDesc")})]})]})}),(0,a.jsx)("div",{className:"flex flex-col gap-4",children:Object.entries(i).map(([e,t])=>((e,t)=>{let s={tool:t,isExpanded:b===e,onToggle:()=>C(b===e?null:e),baseUrl:A&&w?w:z||window.location.origin,apiKeys:E,batchStatus:T[e]||null,lastConfiguredAt:T[e]?.lastConfiguredAt||null};switch(e){case"claude":return(0,a.jsx)(p,{...s,activeProviders:L(),modelMappings:S[e]||{},onModelMappingChange:(t,s)=>B(e,t,s),hasActiveProviders:H,cloudEnabled:A},e);case"codex":return(0,a.jsx)(u,{...s,activeProviders:L(),cloudEnabled:A},e);case"droid":return(0,a.jsx)(g,{...s,activeProviders:L(),hasActiveProviders:H,cloudEnabled:A},e);case"openclaw":return(0,a.jsx)(y,{...s,activeProviders:L(),hasActiveProviders:H,cloudEnabled:A},e);case"antigravity":return(0,a.jsx)(k,{...s,activeProviders:L(),hasActiveProviders:H,cloudEnabled:A},e);case"cline":return(0,a.jsx)(j,{...s,activeProviders:L(),hasActiveProviders:H,cloudEnabled:A},e);case"kilo":return(0,a.jsx)(N,{...s,activeProviders:L(),hasActiveProviders:H,cloudEnabled:A},e);default:return(0,a.jsx)(v,{toolId:e,...s,activeProviders:L(),cloudEnabled:A},e)}})(e,t))})]})}}},e=>{e.O(0,[3418,8500,9751,8055,1149,5846,993,8441,3794,7358],()=>e(e.s=44058)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{2729:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>m});var s=a(95155),r=a(12115),l=a(40993),i=a(30949),o=a(67671),n=a(50910);let d=/^[a-zA-Z0-9_/.-]+$/;function c(e){return"string"==typeof e?{model:e,weight:0}:{model:e.model,weight:e.weight||0}}function m(){let e=(0,n.c)("combos");(0,n.c)("common");let[t,a]=(0,r.useState)([]),[d,c]=(0,r.useState)(!0),[m,h]=(0,r.useState)(!1),[b,g]=(0,r.useState)(null),[f,y]=(0,r.useState)([]),[v,j]=(0,r.useState)({}),[N,k]=(0,r.useState)(null),[w,C]=(0,r.useState)(null),{copied:S,copy:$}=(0,i.C)(),M=(0,o.i)(),[T,P]=(0,r.useState)(null),[_,O]=(0,r.useState)(null),[D,E]=(0,r.useState)([]);(0,r.useEffect)(()=>{R(),fetch("/api/settings/proxy").then(e=>e.ok?e.json():null).then(e=>O(e)).catch(()=>{})},[]);let R=async()=>{try{let[e,t,s,r]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/combos/metrics"),fetch("/api/provider-nodes")]),l=await e.json(),i=await t.json(),o=await s.json(),n=r.ok?await r.json():{nodes:[]};if(e.ok&&a(l.combos||[]),t.ok){let e=(i.connections||[]).filter(e=>"active"===e.testStatus||"success"===e.testStatus);y(e)}s.ok&&j(o.metrics||{}),E(n.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{c(!1)}},q=async t=>{try{let a=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(a.ok)await R(),h(!1),M.success(e("comboCreated"));else{let t=await a.json();M.error(t.error?.message||t.error||e("failedCreate"))}}catch(t){M.error(e("errorCreating"))}},A=async(t,a)=>{try{let s=await fetch(`/api/combos/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(s.ok)await R(),g(null),M.success(e("comboUpdated"));else{let t=await s.json();M.error(t.error?.message||t.error||e("failedUpdate"))}}catch(t){M.error(e("errorUpdating"))}},z=async s=>{if(confirm(e("deleteConfirm")))try{(await fetch(`/api/combos/${s}`,{method:"DELETE"})).ok&&(a(t.filter(e=>e.id!==s)),M.success(e("comboDeleted")))}catch(t){M.error(e("errorDeleting"))}},U=async e=>{let a=e.name.replace(/-copy(-\d+)?$/,""),s=t.map(e=>e.name),r=`${a}-copy`,l=1;for(;s.includes(r);)l++,r=`${a}-copy-${l}`;let i={name:r,models:e.models,strategy:e.strategy||"priority",config:e.config||{}};await q(i)},F=async t=>{C(t.name),k(null);try{let e=await fetch("/api/combos/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboName:t.name})}),a=await e.json();k(a)}catch(t){k({error:e("testFailed")}),M.error(e("testFailed"))}},J=async t=>{let s=!1===t.isActive;a(e=>e.map(e=>e.id===t.id?{...e,isActive:s}:e));try{await fetch(`/api/combos/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})}catch(r){a(e=>e.map(e=>e.id===t.id?{...e,isActive:!s}:e)),M.error(e("failedToggle"))}};return d?(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsx)(l.Qv,{}),(0,s.jsx)(l.Qv,{})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold",children:e("title")}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:e("description")})]}),(0,s.jsx)(l.$n,{icon:"add",onClick:()=>h(!0),children:e("createCombo")})]}),0===t.length?(0,s.jsx)(l.pp,{icon:"\uD83E\uDDE9",title:e("noCombosYet"),description:e("description"),actionLabel:e("createCombo"),onAction:()=>h(!0)}):(0,s.jsx)("div",{className:"flex flex-col gap-4",children:t.map(e=>(0,s.jsx)(x,{combo:e,metrics:v[e.name],providerNodes:D,copied:S,onCopy:$,onEdit:()=>g(e),onDelete:()=>z(e.id),onDuplicate:()=>U(e),onTest:()=>F(e),testing:w===e.name,onProxy:()=>P(e),hasProxy:!!_?.combos?.[e.id],onToggle:()=>J(e)},e.id))}),N&&(0,s.jsx)(l.aF,{isOpen:!!N,onClose:()=>{k(null),C(null)},title:e("testResults",{name:w}),children:(0,s.jsx)(u,{results:N})}),(0,s.jsx)(p,{isOpen:m,onClose:()=>h(!1),onSave:q,activeProviders:f,combo:null},"create"),(0,s.jsx)(p,{isOpen:!!b,combo:b,onClose:()=>g(null),onSave:e=>A(b.id,e),activeProviders:f},b?.id||"new"),T&&(0,s.jsx)(l.KN,{isOpen:!!T,onClose:()=>P(null),level:"combo",levelId:T.id,levelLabel:T.name})]})}function x({combo:e,metrics:t,copied:a,onCopy:r,onEdit:i,onDelete:o,onDuplicate:d,onTest:m,testing:x,onProxy:u,hasProxy:p,onToggle:h,providerNodes:b}){let g=e.strategy||"priority",f=e.models||[],y=!1===e.isActive,v=(0,n.c)("combos"),j=(0,n.c)("common");return(0,s.jsx)(l.Zp,{padding:"sm",className:`group ${y?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,s.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("code",{className:"text-sm font-medium font-mono truncate",children:e.name}),(0,s.jsx)("span",{className:`text-[9px] uppercase font-semibold px-1.5 py-0.5 rounded-full ${"weighted"===g?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"round-robin"===g?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"random"===g?"bg-purple-500/15 text-purple-600 dark:text-purple-400":"least-used"===g?"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400":"cost-optimized"===g?"bg-teal-500/15 text-teal-600 dark:text-teal-400":"bg-blue-500/15 text-blue-600 dark:text-blue-400"}`,children:g}),p&&(0,s.jsxs)("span",{className:"text-[9px] uppercase font-semibold px-1.5 py-0.5 rounded-full bg-primary/15 text-primary flex items-center gap-0.5",title:v("proxyConfigured"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"vpn_lock"}),"proxy"]}),(0,s.jsx)("button",{onClick:t=>{t.stopPropagation(),r(e.name,`combo-${e.id}`)},className:"p-0.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors opacity-0 group-hover:opacity-100",title:v("copyComboName"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:a===`combo-${e.id}`?"check":"content_copy"})})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[0===f.length?(0,s.jsx)("span",{className:"text-xs text-text-muted italic",children:v("noModels")}):f.slice(0,3).map((e,t)=>{let{model:a,weight:r}=c(e);return(0,s.jsxs)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1.5 py-0.5 rounded text-text-muted",children:[(e=>{let t=e.split("/");if(2!==t.length)return e;let[a,s]=t,r=(b||[]).find(e=>e.id===a||e.prefix===a);return r?`${r.name}/${s}`:e})(a),"weighted"===g&&r>0?` (${r}%)`:""]},t)}),f.length>3&&(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:v("more",{count:f.length-3})})]}),t&&(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-1",children:[(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:[(0,s.jsx)("span",{className:"text-emerald-500",children:t.totalSuccesses}),"/",t.totalRequests," ",v("reqs")]}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:[t.successRate,"% ",v("success")]}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:["~",t.avgLatencyMs,"ms"]}),t.fallbackRate>0&&(0,s.jsxs)("span",{className:"text-[10px] text-amber-500",children:[t.fallbackRate,"% fallback"]})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[(0,s.jsx)(l.lM,{size:"sm",checked:!y,onChange:h,title:v(y?"enableCombo":"disableCombo")}),(0,s.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,s.jsx)("button",{onClick:m,disabled:x,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-emerald-500 transition-colors",title:v("testCombo"),children:(0,s.jsx)("span",{className:`material-symbols-outlined text-[16px] ${x?"animate-spin":""}`,children:x?"progress_activity":"play_arrow"})}),(0,s.jsx)("button",{onClick:d,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:v("duplicate"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"content_copy"})}),(0,s.jsx)("button",{onClick:u,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:v("proxyConfig"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"vpn_lock"})}),(0,s.jsx)("button",{onClick:i,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:j("edit"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})}),(0,s.jsx)("button",{onClick:o,className:"p-1.5 hover:bg-red-500/10 rounded text-red-500 transition-colors",title:j("delete"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]})]})})}function u({results:e}){return e.error?(0,s.jsxs)("div",{className:"flex items-center gap-2 text-red-500 text-sm",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),"string"==typeof e.error?e.error:JSON.stringify(e.error)]}):(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[e.resolvedBy&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-emerald-500 text-[18px]",children:"check_circle"}),(0,s.jsxs)("span",{children:["Resolved by:"," ",(0,s.jsx)("code",{className:"text-xs bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 px-1.5 py-0.5 rounded",children:e.resolvedBy})]})]}),e.results?.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs px-2 py-1.5 rounded bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px] ${"ok"===e.status?"text-emerald-500":"skipped"===e.status?"text-text-muted":"text-red-500"}`,children:"ok"===e.status?"check_circle":"skipped"===e.status?"skip_next":"error"}),(0,s.jsx)("code",{className:"font-mono flex-1",children:e.model}),void 0!==e.latencyMs&&(0,s.jsxs)("span",{className:"text-text-muted",children:[e.latencyMs,"ms"]}),(0,s.jsx)("span",{className:`text-[10px] uppercase font-medium ${"ok"===e.status?"text-emerald-500":"skipped"===e.status?"text-text-muted":"text-red-500"}`,children:e.status})]},t))]})}function p({isOpen:e,combo:t,onClose:a,onSave:i,activeProviders:o}){let m=(0,n.c)("combos"),x=(0,n.c)("common"),[u,p]=(0,r.useState)(t?.name||""),[b,g]=(0,r.useState)(()=>(t?.models||[]).map(e=>c(e))),[f,y]=(0,r.useState)(t?.strategy||"priority"),[v,j]=(0,r.useState)(!1),[N,k]=(0,r.useState)(!1),[w,C]=(0,r.useState)(""),[S,$]=(0,r.useState)({}),[M,T]=(0,r.useState)([]),[P,_]=(0,r.useState)(!1),[O,D]=(0,r.useState)(t?.config||{}),[E,R]=(0,r.useState)(null),[q,A]=(0,r.useState)(null),z=async()=>{try{let[e,t]=await Promise.all([fetch("/api/models/alias"),fetch("/api/provider-nodes")]);if(!e.ok||!t.ok)throw Error(`Failed to fetch data: aliases=${e.status}, nodes=${t.status}`);let[a,s]=await Promise.all([e.json(),t.json()]);$(a.aliases||{}),T(s.nodes||[])}catch(e){console.error("Error fetching modal data:",e)}};(0,r.useEffect)(()=>{e&&z()},[e]);let U=e=>e.trim()?d.test(e)?(C(""),!0):(C(m("nameInvalid")),!1):(C(m("nameRequired")),!1),F=(0,r.useCallback)(e=>{let t=e.split("/");if(2!==t.length)return e;let[a,s]=t,r=M.find(e=>e.id===a||e.prefix===a);return r?`${r.name}/${s}`:e},[M]),J=e=>{e.target&&(e.currentTarget.style.opacity="1"),R(null),A(null)},L=async()=>{if(!U(u))return;k(!0);let e={name:u.trim(),models:"weighted"===f?b:b.map(e=>e.model),strategy:f},t={...O};"round-robin"===f&&(void 0!==O.concurrencyPerModel&&(t.concurrencyPerModel=O.concurrencyPerModel),void 0!==O.queueTimeoutMs&&(t.queueTimeoutMs=O.queueTimeoutMs)),Object.keys(t).length>0&&(e.config=t),await i(e),k(!1)},B=!!t;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.aF,{isOpen:e,onClose:a,title:B?m("editCombo"):m("createCombo"),children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(l.pd,{label:m("comboName"),value:u,onChange:e=>{let t=e.target.value;p(t),t?U(t):C("")},placeholder:m("comboNamePlaceholder"),error:w}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:m("nameHint")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:m("routingStrategy")}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-1 p-0.5 bg-black/5 dark:bg-white/5 rounded-lg",children:[{value:"priority",label:"Priority",icon:"sort"},{value:"weighted",label:"Weighted",icon:"percent"},{value:"round-robin",label:"Round-Robin",icon:"autorenew"},{value:"random",label:"Random",icon:"shuffle"},{value:"least-used",label:"Least-Used",icon:"low_priority"},{value:"cost-optimized",label:"Cost-Opt",icon:"savings"}].map(e=>(0,s.jsxs)("button",{onClick:()=>y(e.value),className:`py-1.5 px-2 rounded-md text-xs font-medium transition-all ${f===e.value?"bg-white dark:bg-bg-main shadow-sm text-primary":"text-text-muted hover:text-text-main"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] align-middle mr-0.5",children:e.icon}),e.label]},e.value))}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:{priority:"Sequential fallback: tries model 1 first, then 2, etc.",weighted:"Distributes traffic by weight percentage with fallback","round-robin":"Circular distribution: each request goes to the next model in rotation",random:"Uniform random selection, then fallback to remaining models","least-used":"Picks the model with fewest requests, balancing load over time","cost-optimized":"Routes to the cheapest model first based on pricing"}[f]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,s.jsx)("label",{className:"text-sm font-medium",children:m("models")}),"weighted"===f&&b.length>1&&(0,s.jsx)("button",{onClick:()=>{let e=b.length;if(0===e)return;let t=Math.floor(100/e),a=100-t*e;g(b.map((e,s)=>({...e,weight:t+(0===s?a:0)})))},className:"text-[10px] text-primary hover:text-primary/80 transition-colors",children:m("autoBalance")})]}),0===b.length?(0,s.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:m("noModelsYet")})]}):(0,s.jsx)("div",{className:"flex flex-col gap-1 max-h-[240px] overflow-y-auto",children:b.map((e,t)=>(0,s.jsxs)("div",{draggable:!0,onDragStart:e=>{R(t),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",t.toString()),e.target&&setTimeout(()=>e.currentTarget.style.opacity="0.5",0)},onDragEnd:J,onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="move",A(t)},onDrop:e=>((e,t)=>{if(e.preventDefault(),null===E||E===t)return;let a=[...b],[s]=a.splice(E,1);a.splice(t,0,s),g(a),R(null),A(null)})(e,t),className:`group/item flex items-center gap-1.5 px-2 py-1.5 rounded-md transition-all cursor-grab active:cursor-grabbing ${q===t&&E!==t?"bg-primary/10 border border-primary/30":"bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] border border-transparent"} ${E===t?"opacity-50":""}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted/40 cursor-grab shrink-0",children:"drag_indicator"}),(0,s.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:t+1}),(0,s.jsx)("div",{className:"flex-1 min-w-0 px-1 text-xs text-text-main truncate",children:F(e.model)}),"weighted"===f&&(0,s.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,s.jsx)("input",{type:"number",min:"0",max:"100",value:e.weight,onChange:e=>{var a;let s;return a=e.target.value,void((s=[...b])[t]={...s[t],weight:Math.max(0,Math.min(100,Number(a)||0))},g(s))},className:"w-10 text-[11px] text-center py-0.5 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"%"})]}),"priority"===f&&(0,s.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,s.jsx)("button",{onClick:()=>(e=>{if(0===e)return;let t=[...b];[t[e-1],t[e]]=[t[e],t[e-1]],g(t)})(t),disabled:0===t,className:`p-0.5 rounded ${0===t?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:m("moveUp"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,s.jsx)("button",{onClick:()=>(e=>{if(e===b.length-1)return;let t=[...b];[t[e],t[e+1]]=[t[e+1],t[e]],g(t)})(t),disabled:t===b.length-1,className:`p-0.5 rounded ${t===b.length-1?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:m("moveDown"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,s.jsx)("button",{onClick:()=>{g(b.filter((e,a)=>a!==t))},className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:m("removeModel"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},`${e.model}-${t}`))}),"weighted"===f&&b.length>0&&(0,s.jsx)(h,{models:b}),(0,s.jsxs)("button",{onClick:()=>j(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-text-muted hover:text-primary hover:border-primary/30 transition-colors flex items-center justify-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),m("addModel")]})]}),(0,s.jsxs)("button",{onClick:()=>_(!P),className:"flex items-center gap-1 text-xs text-text-muted hover:text-text-main transition-colors self-start",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:P?"expand_less":"expand_more"}),m("advancedSettings")]}),P&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 p-3 bg-black/[0.02] dark:bg-white/[0.02] rounded-lg border border-black/5 dark:border-white/5",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:m("maxRetries")}),(0,s.jsx)("input",{type:"number",min:"0",max:"10",value:O.maxRetries??"",placeholder:"1",onChange:e=>D({...O,maxRetries:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:m("retryDelay")}),(0,s.jsx)("input",{type:"number",min:"0",max:"60000",step:"500",value:O.retryDelayMs??"",placeholder:"2000",onChange:e=>D({...O,retryDelayMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:m("timeout")}),(0,s.jsx)("input",{type:"number",min:"1000",max:"600000",step:"1000",value:O.timeoutMs??"",placeholder:"120000",onChange:e=>D({...O,timeoutMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("label",{className:"text-[10px] text-text-muted",children:m("healthcheck")}),(0,s.jsx)("input",{type:"checkbox",checked:!1!==O.healthCheckEnabled,onChange:e=>D({...O,healthCheckEnabled:e.target.checked}),className:"accent-primary"})]})]}),"round-robin"===f&&(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2 pt-2 border-t border-black/5 dark:border-white/5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:m("concurrencyPerModel")}),(0,s.jsx)("input",{type:"number",min:"1",max:"20",value:O.concurrencyPerModel??"",placeholder:"3",onChange:e=>D({...O,concurrencyPerModel:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:m("queueTimeout")}),(0,s.jsx)("input",{type:"number",min:"1000",max:"120000",step:"1000",value:O.queueTimeoutMs??"",placeholder:"30000",onChange:e=>D({...O,queueTimeoutMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]})]}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted",children:m("advancedHint")})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)(l.$n,{onClick:a,variant:"ghost",fullWidth:!0,size:"sm",children:x("cancel")}),(0,s.jsx)(l.$n,{onClick:L,fullWidth:!0,size:"sm",disabled:!u.trim()||!!w||N,children:N?m("saving"):B?x("save"):m("createCombo")})]})]})}),(0,s.jsx)(l.rq,{isOpen:v,onClose:()=>j(!1),onSelect:e=>{b.find(t=>t.model===e.value)||g([...b,{model:e.value,weight:0}])},activeProviders:o,modelAliases:S,title:m("addModelToCombo"),selectedModel:null})]})}function h({models:e}){let t=e.reduce((e,t)=>e+(t.weight||0),0),a=100===t,r=["bg-blue-500","bg-emerald-500","bg-amber-500","bg-purple-500","bg-rose-500","bg-cyan-500","bg-orange-500","bg-indigo-500"];return(0,s.jsxs)("div",{className:"mt-1.5",children:[(0,s.jsx)("div",{className:"h-1.5 rounded-full bg-black/5 dark:bg-white/5 overflow-hidden flex",children:e.map((e,t)=>e.weight?(0,s.jsx)("div",{className:`${r[t%r.length]} transition-all duration-300`,style:{width:`${Math.min(e.weight,100)}%`}},t):null)}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,s.jsx)("div",{className:"flex gap-1",children:e.map((e,t)=>e.weight>0&&(0,s.jsxs)("span",{className:"flex items-center gap-0.5 text-[9px] text-text-muted",children:[(0,s.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${r[t%r.length]}`}),e.weight,"%"]},t))}),(0,s.jsxs)("span",{className:`text-[10px] font-medium ${a?"text-emerald-500":t>100?"text-red-500":"text-amber-500"}`,children:[t,"%",!a&&t>0&&" ≠ 100%"]})]})]})}},93062:(e,t,a)=>{Promise.resolve().then(a.bind(a,2729))}},e=>{e.O(0,[3418,8500,9751,8055,1149,5846,993,8441,3794,7358],()=>e(e.s=93062)),_N_E=e.O()}]);
|