omniroute 0.8.8 → 0.9.0
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/README.de.md +995 -0
- package/README.es.md +995 -0
- package/README.fr.md +995 -0
- package/README.it.md +995 -0
- package/README.md +694 -72
- package/README.pt-BR.md +995 -0
- package/README.ru.md +995 -0
- package/README.zh-CN.md +995 -0
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +21 -21
- package/app/.next/build-manifest.json +2 -2
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error.html +2 -2
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_not-found.html +1 -1
- package/app/.next/server/app/_not-found.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +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_client-reference-manifest.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_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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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_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 +1 -1
- 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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/route_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/route.js +1 -1
- package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/monitoring/health/route.js +1 -1
- 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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/policies/route_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- 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_client-reference-manifest.js +1 -1
- 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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/route.js +1 -1
- package/app/.next/server/app/api/providers/route_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback.html +1 -1
- package/app/.next/server/app/callback.rsc +2 -2
- package/app/.next/server/app/callback.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/analytics.html +1 -1
- package/app/.next/server/app/dashboard/analytics.rsc +4 -4
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/analytics.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/analytics.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/analytics.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/analytics.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next/server/app/dashboard/cli-tools.rsc +4 -4
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.html +1 -1
- package/app/.next/server/app/dashboard/combos.rsc +4 -4
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/costs.html +1 -1
- package/app/.next/server/app/dashboard/costs.rsc +4 -4
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard/costs/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard/costs.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/costs.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/costs.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/costs.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/costs.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.html +1 -1
- package/app/.next/server/app/dashboard/endpoint.rsc +4 -4
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/health.html +1 -1
- package/app/.next/server/app/dashboard/health.rsc +4 -4
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/health.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/health.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/health.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/health.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/limits.html +2 -2
- package/app/.next/server/app/dashboard/limits.rsc +4 -4
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk/dashboard/limits/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk/dashboard/limits.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/limits.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/limits.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/limits.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/limits.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/onboarding.html +1 -1
- package/app/.next/server/app/dashboard/onboarding.rsc +3 -3
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard/onboarding/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard/onboarding.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/onboarding.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/onboarding.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/onboarding.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/onboarding.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.html +1 -1
- package/app/.next/server/app/dashboard/profile.rsc +3 -3
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.html +1 -1
- package/app/.next/server/app/dashboard/providers/new.rsc +4 -4
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.html +1 -1
- package/app/.next/server/app/dashboard/providers.rsc +4 -4
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.rsc +3 -3
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings.html +1 -1
- package/app/.next/server/app/dashboard/settings.rsc +4 -4
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/settings.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.html +2 -2
- package/app/.next/server/app/dashboard/translator.rsc +4 -4
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.html +1 -1
- package/app/.next/server/app/dashboard/usage.rsc +4 -4
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/docs/page.js +1 -1
- package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/docs.html +1 -1
- package/app/.next/server/app/docs.rsc +2 -2
- package/app/.next/server/app/docs.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/docs.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forbidden.html +1 -1
- package/app/.next/server/app/forbidden.rsc +2 -2
- package/app/.next/server/app/forbidden.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/forbidden.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/forbidden.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/forbidden.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/forbidden.segments/forbidden/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/forbidden.segments/forbidden.segment.rsc +1 -1
- package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forgot-password.html +1 -1
- package/app/.next/server/app/forgot-password.rsc +3 -3
- package/app/.next/server/app/forgot-password.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/forgot-password.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/forgot-password.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/forgot-password.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/forgot-password.segments/forgot-password/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/forgot-password.segments/forgot-password.segment.rsc +1 -1
- package/app/.next/server/app/index.html +1 -1
- package/app/.next/server/app/index.rsc +2 -2
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing.html +1 -1
- package/app/.next/server/app/landing.rsc +2 -2
- package/app/.next/server/app/landing.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login.html +1 -1
- package/app/.next/server/app/login.rsc +3 -3
- package/app/.next/server/app/login.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/login.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/privacy.html +1 -1
- package/app/.next/server/app/privacy.rsc +2 -2
- package/app/.next/server/app/privacy.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/privacy.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/privacy.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/privacy.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/privacy.segments/privacy/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/privacy.segments/privacy.segment.rsc +1 -1
- package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/terms.html +1 -1
- package/app/.next/server/app/terms.rsc +2 -2
- package/app/.next/server/app/terms.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/terms.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/terms.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/terms.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/terms.segments/terms/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/terms.segments/terms.segment.rsc +1 -1
- package/app/.next/server/app-paths-manifest.json +21 -21
- package/app/.next/server/chunks/5583.js +1 -1
- package/app/.next/server/chunks/8369.js +1 -1
- package/app/.next/server/chunks/9824.js +1 -1
- package/app/.next/server/pages/404.html +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-b70d10291438712b.js → 5846-0541241939d8c7e3.js} +1 -1
- package/app/.next/static/chunks/{993-d43d3ceef35b3300.js → 993-b74bac8c882e8d1a.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/{page-3ac21c16bcfde2e4.js → page-038687bc5d2c3bb5.js} +1 -1
- package/app/package.json +1 -1
- package/app/public/providers/ironclaw.png +0 -0
- package/app/public/providers/nanobot.png +0 -0
- package/app/public/providers/opencode.svg +18 -0
- package/app/public/providers/picoclaw.jpg +0 -0
- package/app/public/providers/zeroclaw.png +0 -0
- package/package.json +1 -1
- /package/app/.next/static/{xW2ax6VohvDsTIIwd1zWK → 8ACUE6hz9uxBNe_Q_ZH6y}/_buildManifest.js +0 -0
- /package/app/.next/static/{xW2ax6VohvDsTIIwd1zWK → 8ACUE6hz9uxBNe_Q_ZH6y}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2791],{57950:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>D});var a=s(95155),l=s(12115),r=s(67040),i=s(52529),n=s(40993);function c(){let[e,t]=(0,l.useState)([]),[s,r]=(0,l.useState)(!1),[i,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)({type:"",message:""}),[m,x]=(0,l.useState)(null),[u,h]=(0,l.useState)(null),[p,b]=(0,l.useState)(!1),[f,g]=(0,l.useState)({type:"",message:""}),[j,v]=(0,l.useState)({driver:"sqlite",dbPath:"~/.omniroute/storage.sqlite",sizeBytes:0,retentionDays:90,lastBackupAt:null}),y=async()=>{r(!0);try{let e=await fetch("/api/db-backups"),s=await e.json();t(s.backups||[])}catch(e){console.error("Failed to fetch backups:",e)}finally{r(!1)}},N=async()=>{try{let e=await fetch("/api/storage/health");if(!e.ok)return;let t=await e.json();v(e=>({...e,...t}))}catch(e){console.error("Failed to fetch storage health:",e)}},k=async()=>{b(!0),g({type:"",message:""});try{let e=await fetch("/api/db-backups",{method:"PUT"}),t=await e.json();e.ok?(t.filename?g({type:"success",message:`Backup created: ${t.filename}`}):g({type:"info",message:t.message||"No changes since last backup"}),await N(),i&&await y()):g({type:"error",message:t.error||"Backup failed"})}catch{g({type:"error",message:"An error occurred"})}finally{b(!1)}},w=async e=>{x(e),o({type:"",message:""});try{let t=await fetch("/api/db-backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({backupId:e})}),s=await t.json();t.ok?(o({type:"success",message:`Restored! ${s.connectionCount} connections, ${s.nodeCount} nodes, ${s.comboCount} combos, ${s.apiKeyCount} API keys.`}),await y(),await N()):o({type:"error",message:s.error||"Restore failed"})}catch{o({type:"error",message:"An error occurred during restore"})}finally{x(null),h(null)}};(0,l.useEffect)(()=>{N()},[]);let C=e=>e&&0!==e?e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`:"0 B";return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-green-500/10 text-green-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"database"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"System & Storage"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"All data stored locally on your machine"})]}),(0,a.jsx)(n.Ex,{variant:"success",size:"sm",children:j.driver||"json"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[(0,a.jsxs)("div",{className:"p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wide mb-1",children:"Database Path"}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main break-all",children:j.dbPath||"~/.omniroute/storage.sqlite"})]}),(0,a.jsxs)("div",{className:"p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wide mb-1",children:"Database Size"}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main",children:C(j.sizeBytes)})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-bg border border-border mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-500","aria-hidden":"true",children:"schedule"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Last Backup"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:j.lastBackupAt?`${new Date(j.lastBackupAt).toLocaleString("pt-BR")} (${(e=>{if(!e)return null;let t=Math.floor((new Date-new Date(e))/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`})(j.lastBackupAt)})`:"No backup yet"})]})]}),(0,a.jsxs)(n.$n,{variant:"outline",size:"sm",onClick:k,loading:p,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"backup"}),"Backup Now"]})]}),f.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-4 text-sm ${"success"===f.type?"bg-green-500/10 text-green-500 border border-green-500/20":"info"===f.type?"bg-blue-500/10 text-blue-500 border border-blue-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===f.type?"check_circle":"info"===f.type?"info":"error"}),f.message]})}),(0,a.jsxs)("div",{className:"pt-3 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-amber-500","aria-hidden":"true",children:"restore"}),(0,a.jsx)("p",{className:"font-medium",children:"Backup & Restore"})]}),(0,a.jsx)(n.$n,{variant:"outline",size:"sm",onClick:()=>{c(!i),i||0!==e.length||y()},children:i?"Hide":"View Backups"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Database snapshots are created automatically before restore and every 15 minutes when data changes. Retention: 24 hourly + 30 daily backups with smart rotation."}),d.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-3 text-sm ${"success"===d.type?"bg-green-500/10 text-green-500 border border-green-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===d.type?"check_circle":"error"}),d.message]})}),i&&(0,a.jsx)("div",{className:"flex flex-col gap-2",children:s?(0,a.jsxs)("div",{className:"flex items-center justify-center py-6 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px] mr-2","aria-hidden":"true",children:"progress_activity"}),"Loading backups..."]}):0===e.length?(0,a.jsxs)("div",{className:"text-center py-6 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] mb-2 block opacity-40","aria-hidden":"true",children:"folder_off"}),"No backups available yet. Backups will be created automatically when data changes."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.length," backup(s) available"]}),(0,a.jsxs)("button",{onClick:y,className:"text-xs text-primary hover:underline flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"refresh"}),"Refresh"]})]}),e.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-black/[0.02] dark:bg-white/[0.02] border border-border/50 hover:border-border transition-colors",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-500","aria-hidden":"true",children:"description"}),(0,a.jsx)("span",{className:"text-sm font-medium truncate",children:new Date(e.createdAt).toLocaleString("pt-BR")}),(0,a.jsx)(n.Ex,{variant:"pre-restore"===e.reason?"warning":"manual"===e.reason?"success":"default",size:"sm",children:e.reason})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted ml-6",children:[(0,a.jsxs)("span",{children:[e.connectionCount," connection(s)"]}),(0,a.jsx)("span",{children:"•"}),(0,a.jsx)("span",{children:C(e.size)})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 ml-3",children:u===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-xs text-amber-500 font-medium",children:"Confirm?"}),(0,a.jsx)(n.$n,{variant:"primary",size:"sm",onClick:()=>w(e.id),loading:m===e.id,className:"!bg-amber-500 hover:!bg-amber-600",children:"Yes"}),(0,a.jsx)(n.$n,{variant:"outline",size:"sm",onClick:()=>h(null),children:"No"})]}):(0,a.jsxs)(n.$n,{variant:"outline",size:"sm",onClick:()=>h(e.id),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"restore"}),"Restore"]})})]},e.id))]})})]})]})}let d=[{value:"disabled",label:"Disabled",icon:"block"},{value:"blacklist",label:"Blacklist",icon:"do_not_disturb"},{value:"whitelist",label:"Whitelist",icon:"verified_user"},{value:"whitelist-priority",label:"WL Priority",icon:"priority_high"}];function o(){let[e,t]=(0,l.useState)({enabled:!1,mode:"blacklist",blacklist:[],whitelist:[],tempBans:[]}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(""),[o,m]=(0,l.useState)("blacklist");(0,l.useEffect)(()=>{x()},[]);let x=async()=>{try{let e=await fetch("/api/settings/ip-filter");e.ok&&t(await e.json())}catch{}finally{r(!1)}},u=async e=>{try{let s=await fetch("/api/settings/ip-filter",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});s.ok&&t(await s.json())}catch{}},h=()=>{i.trim()&&(u({["blacklist"===o?"addBlacklist":"addWhitelist"]:i.trim()}),c(""))},p=(e,t)=>{u({["blacklist"===t?"removeBlacklist":"removeWhitelist"]:e})},b=e.enabled?e.mode:"disabled";return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-red-500/10 text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"security"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"IP Access Control"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Block or allow specific IP addresses"})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-4 gap-2 mb-5",children:d.map(e=>(0,a.jsxs)("button",{onClick:()=>{var t;"disabled"===(t=e.value)?u({enabled:!1}):u({enabled:!0,mode:t})},disabled:s,className:`flex flex-col items-center gap-1.5 p-3 rounded-lg border text-center transition-all ${b===e.value?"border-red-500/50 bg-red-500/5 ring-1 ring-red-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] ${b===e.value?"text-red-400":"text-text-muted"}`,children:e.icon}),(0,a.jsx)("span",{className:`text-xs font-medium ${b===e.value?"text-red-400":"text-text-muted"}`,children:e.label})]},e.value))}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex gap-2 items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(n.pd,{label:"Add IP Address",placeholder:"192.168.1.0/24 or 10.0.*.*",value:i,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&h()})}),(0,a.jsxs)("div",{className:"flex gap-1 pb-[2px]",children:[(0,a.jsx)(n.$n,{size:"sm",variant:"blacklist"===o?"danger":"secondary",onClick:()=>{m("blacklist"),i.trim()&&h()},children:"+ Block"}),(0,a.jsx)(n.$n,{size:"sm",variant:"whitelist"===o?"primary":"secondary",onClick:()=>{m("whitelist"),i.trim()&&h()},children:"+ Allow"})]})]}),e.blacklist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:["Blocked (",e.blacklist.length,")"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.blacklist.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-mono bg-red-500/10 text-red-400 border border-red-500/20",children:[e,(0,a.jsx)("button",{onClick:()=>p(e,"blacklist"),className:"hover:text-red-300",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))})]}),e.whitelist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:["Allowed (",e.whitelist.length,")"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.whitelist.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-mono bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[e,(0,a.jsx)("button",{onClick:()=>p(e,"whitelist"),className:"hover:text-emerald-300",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))})]}),e.tempBans.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:["Temporary Bans (",e.tempBans.length,")"]}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:e.tempBans.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-orange-500/5 border border-orange-500/20 text-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-xs text-orange-400",children:e.ip}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["— ",e.reason]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted tabular-nums",children:[Math.ceil(e.remainingMs/6e4),"m left"]}),(0,a.jsx)("button",{onClick:()=>u({removeBan:e.ip}),className:"text-text-muted hover:text-orange-400",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]},e.ip))})]})]})]})}function m(){let[e,t]=(0,l.useState)({requireLogin:!1,hasPassword:!1}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)({current:"",new:"",confirm:""}),[d,m]=(0,l.useState)({type:"",message:""}),[x,u]=(0,l.useState)(!1);(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let h=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&t(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},p=async e=>{if(e.preventDefault(),i.new!==i.confirm)return void m({type:"error",message:"Passwords do not match"});u(!0),m({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:i.current,newPassword:i.new})}),t=await e.json();e.ok?(m({type:"success",message:"Password updated successfully"}),c({current:"",new:"",confirm:""})):m({type:"error",message:t.error||"Failed to update password"})}catch{m({type:"error",message:"An error occurred"})}finally{u(!1)}};return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",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]","aria-hidden":"true",children:"shield"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Security"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require login"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,a.jsx)(n.lM,{checked:!0===e.requireLogin,onChange:()=>h(!e.requireLogin),disabled:s})]}),!0===e.requireLogin&&(0,a.jsxs)("form",{onSubmit:p,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[e.hasPassword&&(0,a.jsx)(n.pd,{label:"Current Password",type:"password",placeholder:"Enter current password",value:i.current,onChange:e=>c({...i,current:e.target.value}),required:!0}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsx)(n.pd,{label:"New Password",type:"password",placeholder:"Enter new password",value:i.new,onChange:e=>c({...i,new:e.target.value}),required:!0}),(0,a.jsx)(n.pd,{label:"Confirm New Password",type:"password",placeholder:"Confirm new password",value:i.confirm,onChange:e=>c({...i,confirm:e.target.value}),required:!0})]}),d.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===d.type?"text-red-500":"text-green-500"}`,children:d.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(n.$n,{type:"submit",variant:"primary",loading:x,children:e.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsx)(o,{})]})}var x=s(67671);let u=["#6366f1","#22c55e","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#14b8a6"];function h(){let[e,t]=(0,l.useState)({}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)(""),[m,h]=(0,l.useState)(""),[p,b]=(0,l.useState)(!1),f=(0,x.i)(),g=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/fallback/chains");if(e.ok){let s=await e.json();t(s.chains||s||{})}}catch{}finally{r(!1)}},[]);(0,l.useEffect)(()=>{g()},[g]);let j=async()=>{if(!d.trim()||!m.trim())return void f.warning("Please fill model name and providers");let e=m.split(",").map(e=>e.trim()).filter(Boolean).map((e,t)=>({provider:e,priority:t+1,enabled:!0}));if(0===e.length)return void f.warning("Add at least one provider");b(!0);try{(await fetch("/api/fallback/chains",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d.trim(),chain:e})})).ok?(f.success(`Chain created for ${d.trim()}`),o(""),h(""),c(!1),await g()):f.error("Failed to create chain")}catch{f.error("Failed to create chain")}finally{b(!1)}},v=async e=>{if(confirm(`Delete fallback chain for "${e}"?`))try{(await fetch("/api/fallback/chains",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:e})})).ok?(f.success(`Chain deleted for ${e}`),await g()):f.error("Failed to delete chain")}catch{f.error("Failed to delete chain")}};if(s)return(0,a.jsx)(n.Zp,{className:"p-6 mt-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"timeline"}),"Loading fallback chains..."]})});let y=Object.entries(e);return(0,a.jsxs)(n.Zp,{className:"mt-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4 p-6 pb-0",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-cyan-500/10 text-cyan-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"timeline"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Fallback Chains"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Define provider fallback order per model"})]}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",onClick:()=>c(!i),children:i?"Cancel":"+ Add Chain"})]}),i&&(0,a.jsxs)("div",{className:"mx-6 p-4 rounded-lg border border-border/30 bg-surface/20 mb-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mb-3",children:[(0,a.jsx)(n.pd,{label:"Model Name",placeholder:"claude-sonnet-4-20250514",value:d,onChange:e=>o(e.target.value)}),(0,a.jsx)(n.pd,{label:"Providers (comma-separated, in priority order)",placeholder:"anthropic, openai, gemini",value:m,onChange:e=>h(e.target.value)})]}),(0,a.jsx)(n.$n,{variant:"primary",size:"sm",onClick:j,loading:p,children:"Create Chain"})]}),(0,a.jsx)("div",{className:"px-6 pb-6",children:0===y.length?(0,a.jsx)(n.pp,{icon:"timeline",title:"No Fallback Chains",description:"Create a chain to define provider fallback order for a model."}):(0,a.jsx)("div",{className:"flex flex-col gap-2",children:y.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 rounded-lg border border-border/20 bg-surface/20 hover:bg-surface/40 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,a.jsx)("span",{className:"font-mono text-sm text-text-main truncate max-w-[200px]",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("div",{className:"flex gap-1.5 flex-wrap",children:(Array.isArray(t)?t:[]).map((e,t)=>(0,a.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium",style:{backgroundColor:`${u[t%u.length]}20`,color:u[t%u.length],border:`1px solid ${u[t%u.length]}40`},children:[t+1,". ",e.provider]},`${e.provider}-${t}`))})]}),(0,a.jsx)("button",{onClick:()=>v(e),className:"text-text-muted hover:text-red-400 transition-colors ml-2",title:"Delete chain",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},e))})})]})}let p=[{value:"fill-first",label:"Fill First",desc:"Use accounts in priority order",icon:"vertical_align_top"},{value:"round-robin",label:"Round Robin",desc:"Cycle through all accounts",icon:"loop"},{value:"p2c",label:"P2C",desc:"Pick 2 random, use the healthier one",icon:"balance"},{value:"random",label:"Random",desc:"Random account each request",icon:"shuffle"},{value:"least-used",label:"Least Used",desc:"Pick least recently used account",icon:"low_priority"},{value:"cost-optimized",label:"Cost Opt",desc:"Prefer cheapest available account",icon:"savings"}];function b(){let[e,t]=(0,l.useState)({fallbackStrategy:"fill-first"}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)([]),[d,o]=(0,l.useState)(""),[m,x]=(0,l.useState)("");(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),c(e.wildcardAliases||[]),r(!1)}).catch(()=>r(!1))},[]);let u=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&t(t=>({...t,...e}))}catch(e){console.error("Failed to update settings:",e)}},b=async()=>{if(!d.trim()||!m.trim())return;let e=[...i,{pattern:d.trim(),target:m.trim()}];await u({wildcardAliases:e}),c(e),o(""),x("")},f=async e=>{let t=i.filter((t,s)=>s!==e);await u({wildcardAliases:t}),c(t)};return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"route"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Routing Strategy"})]}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2 mb-4",style:{gridAutoRows:"1fr"},children:p.map(t=>(0,a.jsxs)("button",{onClick:()=>u({fallbackStrategy:t.value}),disabled:s,className:`flex flex-col items-center gap-2 p-4 rounded-lg border text-center transition-all ${e.fallbackStrategy===t.value?"border-blue-500/50 bg-blue-500/5 ring-1 ring-blue-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[24px] ${e.fallbackStrategy===t.value?"text-blue-400":"text-text-muted"}`,children:t.icon}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:`text-sm font-medium ${e.fallbackStrategy===t.value?"text-blue-400":""}`,children:t.label}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:t.desc})]})]},t.value))}),"round-robin"===e.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-3 border-t border-border/30",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Sticky Limit"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Calls per account before switching"})]}),(0,a.jsx)(n.pd,{type:"number",min:"1",max:"10",value:e.stickyRoundRobinLimit||3,onChange:e=>u({stickyRoundRobinLimit:parseInt(e.target.value)}),disabled:s,className:"w-20 text-center"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted italic pt-3 border-t border-border/30 mt-3",children:["round-robin"===e.fallbackStrategy&&`Distributing requests across accounts with ${e.stickyRoundRobinLimit||3} calls per account.`,"fill-first"===e.fallbackStrategy&&"Using accounts in priority order (Fill First).","p2c"===e.fallbackStrategy&&"Power of Two Choices: picks 2 random accounts and routes to the healthier one.","random"===e.fallbackStrategy&&"Randomly selects an available account for each request.","least-used"===e.fallbackStrategy&&"Picks the account that was used least recently.","cost-optimized"===e.fallbackStrategy&&"Prefers accounts with the lowest cost (priority-based, extensible with actual cost data)."]})]}),(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"alt_route"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Model Aliases"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Wildcard patterns to remap model names • Use * and ?"})]})]}),i.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-1.5 mb-4",children:i.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 text-sm",children:[(0,a.jsx)("span",{className:"font-mono text-purple-400",children:e.pattern}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("span",{className:"font-mono text-text-main",children:e.target})]}),(0,a.jsx)("button",{onClick:()=>f(t),className:"text-text-muted hover:text-red-400 transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},t))}),(0,a.jsxs)("div",{className:"flex gap-2 items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(n.pd,{label:"Pattern",placeholder:"claude-sonnet-*",value:d,onChange:e=>o(e.target.value)})}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(n.pd,{label:"Target Model",placeholder:"claude-sonnet-4-20250514",value:m,onChange:e=>x(e.target.value)})}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",onClick:b,className:"mb-[2px]",children:"+ Add"})]})]}),(0,a.jsx)(h,{})]})}function f(){let[e,t]=(0,l.useState)({strategy:"priority",maxRetries:1,retryDelayMs:2e3,timeoutMs:12e4,healthCheckEnabled:!0,healthCheckTimeoutMs:3e3,maxComboDepth:3,trackMetrics:!0}),[s,i]=(0,l.useState)({}),[c,d]=(0,l.useState)(""),[o,m]=(0,l.useState)(!1);(0,l.useEffect)(()=>{fetch("/api/settings/combo-defaults").then(e=>e.json()).then(e=>{e.comboDefaults&&t(e.comboDefaults),e.providerOverrides&&i(e.providerOverrides)}).catch(e=>console.error("Failed to fetch combo defaults:",e))},[]);let x=async()=>{m(!0);try{await fetch("/api/settings/combo-defaults",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboDefaults:e,providerOverrides:s})})}catch(e){console.error("Failed to save combo defaults:",e)}finally{m(!1)}},u=()=>{let e=c.trim().toLowerCase();e&&!s[e]&&(i(t=>({...t,[e]:{maxRetries:1,timeoutMs:12e4}})),d(""))};return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"tune"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Combo Defaults"}),(0,a.jsx)("span",{className:"text-xs text-text-muted ml-auto",children:"Global combo configuration"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Default Strategy"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applied to new combos without explicit strategy"})]}),(0,a.jsx)("div",{role:"tablist","aria-label":"Combo strategy",className:"grid grid-cols-3 gap-1 p-0.5 rounded-md bg-black/5 dark:bg-white/5",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(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e.strategy===s.value,onClick:()=>t(e=>({...e,strategy:s.value})),className:(0,r.cn)("px-2 py-1 rounded text-xs font-medium transition-all flex items-center justify-center gap-0.5",e.strategy===s.value?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:s.icon}),s.label]},s.value))})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 pt-3 border-t border-border/50",children:[{key:"maxRetries",label:"Max Retries",min:0,max:5},{key:"retryDelayMs",label:"Retry Delay (ms)",min:500,max:1e4,step:500},{key:"timeoutMs",label:"Timeout (ms)",min:5e3,max:3e5,step:5e3},{key:"maxComboDepth",label:"Max Nesting Depth",min:1,max:10}].map(({key:s,label:l,min:r,max:i,step:c})=>(0,a.jsx)(n.pd,{label:l,type:"number",min:r,max:i,step:c||1,value:e[s]??"",onChange:e=>t(t=>({...t,[s]:parseInt(e.target.value)||0})),className:"text-sm"},s))}),"round-robin"===e.strategy&&(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 pt-3 border-t border-border/50",children:[(0,a.jsx)(n.pd,{label:"Concurrency / Model",type:"number",min:1,max:20,value:e.concurrencyPerModel??"",placeholder:"3",onChange:e=>t(t=>({...t,concurrencyPerModel:parseInt(e.target.value)||0})),className:"text-sm"}),(0,a.jsx)(n.pd,{label:"Queue Timeout (ms)",type:"number",min:1e3,max:12e4,step:1e3,value:e.queueTimeoutMs??"",placeholder:"30000",onChange:e=>t(t=>({...t,queueTimeoutMs:parseInt(e.target.value)||0})),className:"text-sm"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-3 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Health Check"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pre-check provider availability"})]}),(0,a.jsx)(n.lM,{checked:!1!==e.healthCheckEnabled,onChange:()=>t(e=>({...e,healthCheckEnabled:!e.healthCheckEnabled}))})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Track Metrics"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Record per-combo request metrics"})]}),(0,a.jsx)(n.lM,{checked:!1!==e.trackMetrics,onChange:()=>t(e=>({...e,trackMetrics:!e.trackMetrics}))})]})]}),(0,a.jsxs)("div",{className:"pt-3 border-t border-border/50",children:[(0,a.jsx)("p",{className:"font-medium text-sm mb-2",children:"Provider Overrides"}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Override timeout and retries per provider. Provider settings override global defaults."}),Object.entries(s).map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2 p-2 rounded-lg bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,a.jsx)("span",{className:"text-xs font-mono font-medium min-w-[80px]",children:e}),(0,a.jsx)(n.pd,{type:"number",min:"0",max:"5",value:t.maxRetries??1,onChange:t=>i(s=>({...s,[e]:{...s[e],maxRetries:parseInt(t.target.value)||0}})),className:"text-xs w-16","aria-label":`${e} max retries`}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"retries"}),(0,a.jsx)(n.pd,{type:"number",min:"5000",max:"300000",step:"5000",value:t.timeoutMs??12e4,onChange:t=>i(s=>({...s,[e]:{...s[e],timeoutMs:parseInt(t.target.value)||12e4}})),className:"text-xs w-24","aria-label":`${e} timeout ms`}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"ms"}),(0,a.jsx)("button",{onClick:()=>{i(t=>{let s={...t};return delete s[e],s})},className:"ml-auto text-red-400 hover:text-red-500 transition-colors","aria-label":`Remove ${e} override`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"close"})})]},e)),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,a.jsx)(n.pd,{type:"text",placeholder:"e.g. google, openai...",value:c,onChange:e=>d(e.target.value),onKeyDown:e=>"Enter"===e.key&&u(),className:"text-xs flex-1","aria-label":"New provider name"}),(0,a.jsx)(n.$n,{variant:"outline",size:"sm",onClick:u,disabled:!c.trim(),children:"Add"})]})]}),(0,a.jsx)("div",{className:"pt-3 border-t border-border/50",children:(0,a.jsx)(n.$n,{variant:"primary",size:"sm",onClick:x,loading:o,children:"Save Combo Defaults"})})]})]})}function g(){let[e,t]=(0,l.useState)(!1),[s,r]=(0,l.useState)(null),i=(0,l.useRef)(!0),c=async()=>{try{let e=await fetch("/api/settings/proxy?level=global");if(e.ok){let t=await e.json();r(t.proxy||null)}}catch{}};return(0,l.useEffect)(()=>(i.current=!0,async function(){try{let e=await fetch("/api/settings/proxy?level=global");if(!i.current)return;if(e.ok){let t=await e.json();i.current&&r(t.proxy||null)}}catch{}}(),()=>{i.current=!1}),[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"vpn_lock"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:"Global Proxy"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Configure a global outbound proxy for all API calls. Individual providers, combos, and keys can override this."}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[s?(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)("span",{className:"px-2.5 py-1 rounded text-xs font-bold uppercase bg-emerald-500/15 text-emerald-400 border border-emerald-500/30",children:[s.type,"://",s.host,":",s.port]})}):(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"No global proxy configured"}),(0,a.jsx)(n.$n,{size:"sm",variant:s?"secondary":"primary",icon:"settings",onClick:()=>{c(),t(!0)},children:s?"Edit":"Configure"})]})]})}),(0,a.jsx)(n.KN,{isOpen:e,onClose:()=>t(!1),level:"global",levelLabel:"Global",onSaved:c})]})}var j=s(97550);function v(){let{theme:e,setTheme:t,isDark:s}=(0,j.D)();return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"palette"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Appearance"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Dark Mode"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Switch between light and dark themes"})]}),(0,a.jsx)(n.lM,{checked:s,onChange:()=>t(s?"light":"dark")})]}),(0,a.jsx)("div",{className:"pt-4 border-t border-border",children:(0,a.jsx)("div",{role:"tablist","aria-label":"Theme selection",className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e===s,onClick:()=>t(s),className:(0,r.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all",e===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{className:"capitalize",children:s})]},s))})})]})]})}let y=[{value:"passthrough",label:"Passthrough",desc:"No changes — client controls thinking budget",icon:"arrow_forward"},{value:"auto",label:"Auto",desc:"Strip all thinking config — let provider decide",icon:"auto_awesome"},{value:"custom",label:"Custom",desc:"Set a fixed token budget for all requests",icon:"tune"},{value:"adaptive",label:"Adaptive",desc:"Scale budget based on request complexity",icon:"trending_up"}],N=[{value:"none",label:"None (0 tokens)"},{value:"low",label:"Low (1K tokens)"},{value:"medium",label:"Medium (10K tokens)"},{value:"high",label:"High (128K tokens)"}];function k(){let[e,t]=(0,l.useState)({mode:"passthrough",customBudget:10240,effortLevel:"medium"}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)("");(0,l.useEffect)(()=>{fetch("/api/settings/thinking-budget").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let m=async s=>{let a={...e,...s};t(a),c(!0),o("");try{(await fetch("/api/settings/thinking-budget",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok?(o("saved"),setTimeout(()=>o(""),2e3)):o("error")}catch{o("error")}finally{c(!1)}};return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",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]","aria-hidden":"true",children:"psychology"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Thinking Budget"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Control AI reasoning token usage across all requests"})]}),"saved"===d&&(0,a.jsxs)("span",{className:"ml-auto text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," Saved"]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2 mb-5",children:y.map(t=>(0,a.jsxs)("button",{onClick:()=>m({mode:t.value}),disabled:s||i,className:`flex items-start gap-3 p-3 rounded-lg border text-left transition-all ${e.mode===t.value?"border-violet-500/50 bg-violet-500/5 ring-1 ring-violet-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] mt-0.5 ${e.mode===t.value?"text-violet-500":"text-text-muted"}`,children:t.icon}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:`text-sm font-medium ${e.mode===t.value?"text-violet-400":""}`,children:t.label}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5 leading-relaxed",children:t.desc})]})]},t.value))}),"custom"===e.mode&&(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Token Budget"}),(0,a.jsxs)("span",{className:"text-sm font-mono tabular-nums text-violet-400",children:[e.customBudget.toLocaleString()," tokens"]})]}),(0,a.jsx)("input",{type:"range",min:"0",max:"131072",step:"1024",value:e.customBudget,onChange:e=>m({customBudget:parseInt(e.target.value)}),className:"w-full accent-violet-500"}),(0,a.jsxs)("div",{className:"flex justify-between text-xs text-text-muted mt-1",children:[(0,a.jsx)("span",{children:"Off"}),(0,a.jsx)("span",{children:"1K"}),(0,a.jsx)("span",{children:"10K"}),(0,a.jsx)("span",{children:"64K"}),(0,a.jsx)("span",{children:"128K"})]})]}),"adaptive"===e.mode&&(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30",children:[(0,a.jsx)("p",{className:"text-sm font-medium mb-3",children:"Base Effort Level"}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Adaptive mode scales from this base level based on message count, tool usage, and prompt length."}),(0,a.jsx)("div",{className:"grid grid-cols-4 gap-2",children:N.map(t=>(0,a.jsx)("button",{onClick:()=>m({effortLevel:t.value}),disabled:s||i,className:`px-3 py-2 rounded-lg text-xs font-medium border transition-all ${e.effortLevel===t.value?"border-violet-500/50 bg-violet-500/10 text-violet-400":"border-border/50 text-text-muted hover:border-border"}`,children:t.value.charAt(0).toUpperCase()+t.value.slice(1)},t.value))})]})]})}function w(){let[e,t]=(0,l.useState)({enabled:!1,prompt:""}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(""),[d,o]=(0,l.useState)(null);(0,l.useEffect)(()=>{fetch("/api/settings/system-prompt").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let m=async s=>{let a={...e,...s};t(a),c("");try{(await fetch("/api/settings/system-prompt",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(c("saved"),setTimeout(()=>c(""),2e3))}catch{c("error")}};return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"edit_note"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Global System Prompt"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Injected into all requests at proxy level"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:["saved"===i&&(0,a.jsxs)("span",{className:"text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," Saved"]}),(0,a.jsx)(n.lM,{checked:e.enabled,onChange:()=>m({enabled:!e.enabled}),disabled:s})]})]}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("textarea",{value:e.prompt,onChange:e=>{var s;return s=e.target.value,void(t(e=>({...e,prompt:s})),d&&clearTimeout(d),o(setTimeout(()=>{m({prompt:s})},800)))},placeholder:"Enter system prompt to inject into all requests...",rows:5,className:"w-full px-4 py-3 rounded-lg border border-border/50 bg-surface/30 text-sm placeholder:text-text-muted/50 resize-y min-h-[120px] focus:outline-none focus:ring-1 focus:ring-amber-500/30 focus:border-amber-500/50 transition-colors",disabled:s}),(0,a.jsxs)("div",{className:"absolute bottom-2 right-3 text-xs text-text-muted/60 tabular-nums",children:[e.prompt.length," chars"]})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted/70 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),"This prompt is prepended to the system message of every request. Use for global instructions, safety guidelines, or response formatting rules. Send ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-surface/50",children:"_skipSystemPrompt: true"})," in a request to bypass."]})]})]})}let C=[{key:"timestamp",label:"Time"},{key:"action",label:"Action"},{key:"actor",label:"Actor"},{key:"details",label:"Details"}];function S(){let[e,t]=(0,l.useState)([]),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(""),[d,o]=(0,l.useState)({}),[m,u]=(0,l.useState)({timestamp:!0,action:!0,actor:!0,details:!0}),h=(0,x.i)();(0,l.useEffect)(()=>{fetch("/api/compliance/audit-log?limit=100").then(e=>e.json()).then(e=>{t(Array.isArray(e)?e:e.logs||[]),r(!1)}).catch(()=>{r(!1),h.error("Failed to load audit log")})},[]);let p=[...new Set(e.map(e=>e.action).filter(Boolean))],b=[...new Set(e.map(e=>e.actor).filter(Boolean))],f=e.filter(e=>{if(i){let t=i.toLowerCase();if(!(e.action?.toLowerCase().includes(t)||e.actor?.toLowerCase().includes(t)||e.details&&JSON.stringify(e.details).toLowerCase().includes(t)))return!1}return(!d.action||e.action===d.action)&&(!d.actor||e.actor===d.actor)}),g=C.filter(e=>m[e.key]),j=(0,l.useCallback)(e=>{u(t=>({...t,[e]:!t[e]}))},[]),v=(0,l.useCallback)((e,t)=>{switch(t.key){case"timestamp":return(0,a.jsx)("span",{className:"font-mono text-xs text-text-muted whitespace-nowrap",children:e.timestamp?new Date(e.timestamp).toLocaleString():"—"});case"action":return(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-accent/10 text-accent",children:e.action||"—"});case"actor":return(0,a.jsx)("span",{className:"text-text-main",children:e.actor||"system"});case"details":return(0,a.jsx)("span",{className:"text-text-muted text-xs max-w-xs truncate block",children:e.details?JSON.stringify(e.details):"—"});default:return e[t.key]||"—"}},[]);return(0,a.jsxs)(n.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"policy"}),"Audit Log"]}),(0,a.jsx)(n.tD,{columns:C,visible:m,onToggle:j})]}),(0,a.jsx)(n.Qn,{searchValue:i,onSearchChange:c,placeholder:"Search audit logs...",filters:[{key:"action",label:"Action",options:p},{key:"actor",label:"Actor",options:b}],activeFilters:d,onFilterChange:(e,t)=>o(s=>({...s,[e]:t})),children:null}),(0,a.jsx)(n.bQ,{columns:g,data:f,renderCell:v,loading:s,maxHeight:"400px",emptyIcon:"\uD83D\uDCCB",emptyMessage:"No audit events found"})]})}function $(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!1),i=()=>{fetch("/api/cache/stats").then(e=>e.json()).then(t).catch(()=>{})};(0,l.useEffect)(i,[]);let c=async()=>{r(!0);try{await fetch("/api/cache/stats",{method:"DELETE"}),i()}finally{r(!1)}};return(0,a.jsxs)(n.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"cached"}),"Prompt Cache"]}),(0,a.jsx)("button",{onClick:c,disabled:s,className:"px-3 py-1.5 text-xs rounded-lg bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:s?"Flushing…":"Flush Cache"})]}),e?(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Size"}),(0,a.jsxs)("p",{className:"font-mono text-lg text-text-main",children:[e.size,"/",e.maxSize]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Hit Rate"}),(0,a.jsxs)("p",{className:"font-mono text-lg text-text-main",children:[e.hitRate?.toFixed(1)??0,"%"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Hits"}),(0,a.jsx)("p",{className:"font-mono text-text-main",children:e.hits??0})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Evictions"}),(0,a.jsx)("p",{className:"font-mono text-text-main",children:e.evictions??0})]})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Loading cache stats…"})]})}let P={CLOSED:{bg:"bg-emerald-500/15",text:"text-emerald-400",border:"border-emerald-500/30",label:"CLOSED",icon:"check_circle"},OPEN:{bg:"bg-red-500/15",text:"text-red-400",border:"border-red-500/30",label:"OPEN",icon:"error"},HALF_OPEN:{bg:"bg-amber-500/15",text:"text-amber-400",border:"border-amber-500/30",label:"HALF-OPEN",icon:"warning"}},A={closed:{icon:"check_circle",color:"#22c55e",label:"Closed"},"half-open":{icon:"pending",color:"#f59e0b",label:"Half-Open"},open:{icon:"error",color:"#ef4444",label:"Open"}};function L(e){return!e||e<=0?"—":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function T({profiles:e,onSave:t,saving:s}){let[r,i]=(0,l.useState)(!1),[c,d]=(0,l.useState)(e);(0,l.useEffect)(()=>{d(e)},[e]);let o=[{key:"transientCooldown",label:"Transient Cooldown",suffix:"ms"},{key:"rateLimitCooldown",label:"Rate Limit Cooldown",suffix:"ms"},{key:"maxBackoffLevel",label:"Max Backoff Level",suffix:""},{key:"circuitBreakerThreshold",label:"CB Threshold",suffix:" fails"},{key:"circuitBreakerReset",label:"CB Reset Time",suffix:"ms"}];return(0,a.jsx)(n.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"tune"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:"Provider Profiles"})]}),r?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.$n,{size:"sm",variant:"secondary",onClick:()=>i(!1),children:"Cancel"}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{t(c),i(!1)},disabled:s,children:"Save"})]}):(0,a.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>i(!0),children:"Edit"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Separate resilience settings for OAuth (session-based) and API Key (metered) providers. OAuth providers have stricter thresholds due to lower rate limits."}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:["oauth","apikey"].map(t=>(0,a.jsxs)("div",{className:"rounded-lg bg-black/5 dark:bg-white/5 p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-bold uppercase tracking-wider mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base","aria-hidden":"true",children:"oauth"===t?"lock":"key"}),"oauth"===t?"OAuth Providers":"API Key Providers"]}),(0,a.jsx)("div",{className:"space-y-2",children:o.map(({key:s,label:l,suffix:i})=>(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:l}),r?(0,a.jsx)("input",{type:"number",min:"0",value:c?.[t]?.[s]??0,onChange:e=>d({...c,[t]:{...c[t],[s]:Number(e.target.value)}}),className:"w-24 px-2 py-1 text-xs rounded bg-white/10 border border-white/20 text-right"}):(0,a.jsxs)("span",{className:"text-sm font-mono",children:[e?.[t]?.[s]??"—",i&&e?.[t]?.[s]!=null?i:""]})]},s))})]},t))})]})})}function B({rateLimitStatus:e,defaults:t,onSaveDefaults:s,saving:r}){let[i,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)(t||{});return(0,l.useEffect)(()=>{t&&o(t)},[t]),(0,a.jsx)(n.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"speed"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:"Rate Limiting"})]}),i?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.$n,{size:"sm",variant:"secondary",onClick:()=>c(!1),children:"Cancel"}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{s(d),c(!1)},disabled:r,children:"Save"})]}):(0,a.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>c(!0),children:"Edit"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"API Key providers are automatically rate-limited with safe defaults. Limits are learned from response headers and adapt over time."}),(0,a.jsxs)("div",{className:"rounded-lg bg-black/5 dark:bg-white/5 p-4 mb-4",children:[(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider mb-3 text-text-muted",children:"Default Safety Net"}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-4",children:[{key:"requestsPerMinute",label:"RPM",suffix:""},{key:"minTimeBetweenRequests",label:"Min Gap",suffix:"ms",format:L},{key:"concurrentRequests",label:"Max Concurrent",suffix:""}].map(({key:e,label:s,format:l})=>(0,a.jsxs)("div",{children:[i?(0,a.jsx)("input",{type:"number",min:"1",value:d[e]??0,onChange:t=>o(s=>({...s,[e]:parseInt(t.target.value)||0})),className:"w-full px-2 py-1 text-lg font-bold rounded bg-white/10 border border-white/20"}):(0,a.jsx)("div",{className:"text-lg font-bold",children:l?l(t?.[e]):t?.[e]??"—"}),(0,a.jsx)("div",{className:"text-xs text-text-muted",children:s})]},e))})]}),e&&e.length>0?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text-muted",children:"Active Limiters"}),e.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-black/5 dark:bg-white/5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.provider||e.key}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[null!=e.reservoir&&(0,a.jsxs)("span",{children:["Reservoir: ",e.reservoir]}),null!=e.running&&(0,a.jsxs)("span",{children:["Running: ",e.running]}),null!=e.queued&&(0,a.jsxs)("span",{children:["Queued: ",e.queued]})]})]},t))]}):(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No active rate limiters yet."})]})})}function E({breakers:e,onReset:t,loading:s}){let l=e.filter(e=>"CLOSED"!==e.state),r=e.length;return(0,a.jsx)(n.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"electrical_services"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:"Circuit Breakers"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:l.length>0?`${l.length} tripped`:`${r} healthy`}),l.length>0&&(0,a.jsx)(n.$n,{size:"sm",variant:"danger",icon:"restart_alt",onClick:t,disabled:s,children:"Reset All"})]})]}),0===e.length?(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No circuit breakers active yet. They are created automatically when requests flow through the combo pipeline."}):(0,a.jsx)("div",{className:"space-y-2",children:e.map(e=>{let t=P[e.state]||P.CLOSED;return(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-black/5 dark:bg-white/5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-base ${t.text}`,"aria-hidden":"true",children:t.icon}),(0,a.jsx)("span",{className:"text-sm font-medium",children:e.name.replace("combo:","")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[e.failureCount>0&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.failureCount," failure",1!==e.failureCount?"s":""]}),(0,a.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-bold uppercase ${t.bg} ${t.text} border ${t.border}`,children:t.label})]})]},e.name)})})]})})}function R(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(null),d=(0,x.i)(),o=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/policies");if(e.ok){let s=await e.json();t(s)}}catch{}finally{r(!1)}},[]);(0,l.useEffect)(()=>{o();let e=setInterval(o,15e3);return()=>clearInterval(e)},[o]);let m=async e=>{c(e);try{(await fetch("/api/policies",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"unlock",identifier:e})})).ok?(d.success(`Unlocked: ${e}`),await o()):d.error("Failed to unlock")}catch{d.error("Failed to unlock")}finally{c(null)}},u=e?.circuitBreakers||[],h=e?.lockedIdentifiers||[],p=u.some(e=>"closed"!==e.state)||h.length>0;return s?(0,a.jsx)(n.Zp,{className:"p-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"policy"}),"Loading policies..."]})}):(0,a.jsx)(n.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"policy"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:"Policies & Locked Identifiers"})]}),p&&(0,a.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:o,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"refresh"})})]}),p?(0,a.jsxs)(a.Fragment,{children:[u.filter(e=>"closed"!==e.state).length>0&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:"Circuit Breakers"}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:u.filter(e=>"closed"!==e.state).map((e,t)=>{let s=A[e.state]||A.open;return(0,a.jsx)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:s.color},children:s.icon}),(0,a.jsx)("span",{className:"text-sm text-text-main font-medium",children:e.name||e.provider||"Unknown"}),(0,a.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:`${s.color}15`,color:s.color},children:s.label}),e.failures>0&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.failures," failures"]})]})},e.name||t)})})]}),h.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:"Locked Identifiers"}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:h.map((e,t)=>{let s="string"==typeof e?e:e.identifier||e.id;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-red-400",children:"lock"}),(0,a.jsx)("span",{className:"font-mono text-sm text-text-main",children:s}),"object"==typeof e&&e.lockedAt&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["since ",new Date(e.lockedAt).toLocaleString()]})]}),(0,a.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>m(s),disabled:i===s,className:"text-xs",children:i===s?"Unlocking...":"Force Unlock"})]},s||t)})})]})]}):(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-emerald-500/10 text-emerald-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"verified_user"})}),(0,a.jsx)("div",{children:(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"All systems operational — no lockouts or tripped breakers"})})]})]})})}function O(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)(null),m=(0,l.useCallback)(async()=>{try{r(!0);let e=await fetch("/api/resilience");if(!e.ok)throw Error(`Failed to load: ${e.status}`);let s=await e.json();t(s),o(null)}catch(e){o(e.message)}finally{r(!1)}},[]);(0,l.useEffect)(()=>{m();let e=setInterval(m,1e4);return()=>clearInterval(e)},[m]);let x=async()=>{try{if(r(!0),!(await fetch("/api/resilience/reset",{method:"POST"})).ok)throw Error("Reset failed");await m()}catch(e){o(e.message)}finally{r(!1)}},u=async e=>{try{if(c(!0),!(await fetch("/api/resilience",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({profiles:e})})).ok)throw Error("Save failed");await m()}catch(e){o(e.message)}finally{c(!1)}},h=async e=>{try{if(c(!0),!(await fetch("/api/resilience",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaults:e})})).ok)throw Error("Save failed");await m()}catch(e){o(e.message)}finally{c(!1)}};return s&&!e?(0,a.jsxs)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"hourglass_empty"}),"Loading resilience status..."]}):d&&!e?(0,a.jsxs)(n.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"error"}),(0,a.jsx)("span",{className:"text-sm",children:d})]}),(0,a.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:m,className:"mt-3",children:"Retry"})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(T,{profiles:e?.profiles||{},onSave:u,saving:i}),(0,a.jsx)(B,{rateLimitStatus:e?.rateLimitStatus||[],defaults:e?.defaults||{},onSaveDefaults:h,saving:i}),(0,a.jsx)(E,{breakers:e?.circuitBreakers||[],onReset:x,loading:s}),(0,a.jsx)(R,{})]})}let M=[{id:"general",label:"General",icon:"settings"},{id:"ai",label:"AI",icon:"smart_toy"},{id:"security",label:"Security",icon:"shield"},{id:"routing",label:"Routing",icon:"route"},{id:"resilience",label:"Resilience",icon:"electrical_services"},{id:"advanced",label:"Advanced",icon:"tune"},{id:"compliance",label:"Compliance",icon:"policy"}];function D(){let[e,t]=(0,l.useState)("general");return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)("div",{role:"tablist","aria-label":"Settings sections",className:"inline-flex items-center p-1 rounded-lg bg-black/5 dark:bg-white/5 self-start",children:M.map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e===s.id,tabIndex:e===s.id?0:-1,onClick:()=>t(s.id),className:(0,r.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all text-sm",e===s.id?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]","aria-hidden":"true",children:s.icon}),(0,a.jsx)("span",{className:"hidden sm:inline",children:s.label})]},s.id))}),(0,a.jsxs)("div",{role:"tabpanel","aria-label":M.find(t=>t.id===e)?.label,children:["general"===e&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(c,{}),(0,a.jsx)(v,{})]})}),"ai"===e&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(k,{}),(0,a.jsx)(w,{}),(0,a.jsx)($,{})]}),"security"===e&&(0,a.jsx)(m,{}),"routing"===e&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(b,{}),(0,a.jsx)(f,{})]}),"resilience"===e&&(0,a.jsx)(O,{}),"advanced"===e&&(0,a.jsx)(g,{}),"compliance"===e&&(0,a.jsx)(S,{})]}),(0,a.jsxs)("div",{className:"text-center text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[i.vQ.name," v",i.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:"Local Mode — All data stored on your machine"})]})]})})}},99344:(e,t,s)=>{Promise.resolve().then(s.bind(s,57950))}},e=>{e.O(0,[8500,9751,782,1149,5846,993,8441,3794,7358],()=>e(e.s=99344)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2791],{73100:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>O});var a=s(95155),l=s(12115),r=s(67040),i=s(52529),n=s(40993);function c(){let[e,t]=(0,l.useState)([]),[s,r]=(0,l.useState)(!1),[i,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)({type:"",message:""}),[m,x]=(0,l.useState)(null),[u,h]=(0,l.useState)(null),[p,b]=(0,l.useState)(!1),[f,g]=(0,l.useState)({type:"",message:""}),[j,v]=(0,l.useState)({driver:"sqlite",dbPath:"~/.omniroute/storage.sqlite",sizeBytes:0,retentionDays:90,lastBackupAt:null}),y=async()=>{r(!0);try{let e=await fetch("/api/db-backups"),s=await e.json();t(s.backups||[])}catch(e){console.error("Failed to fetch backups:",e)}finally{r(!1)}},N=async()=>{try{let e=await fetch("/api/storage/health");if(!e.ok)return;let t=await e.json();v(e=>({...e,...t}))}catch(e){console.error("Failed to fetch storage health:",e)}},k=async()=>{b(!0),g({type:"",message:""});try{let e=await fetch("/api/db-backups",{method:"PUT"}),t=await e.json();e.ok?(t.filename?g({type:"success",message:`Backup created: ${t.filename}`}):g({type:"info",message:t.message||"No changes since last backup"}),await N(),i&&await y()):g({type:"error",message:t.error||"Backup failed"})}catch{g({type:"error",message:"An error occurred"})}finally{b(!1)}},w=async e=>{x(e),o({type:"",message:""});try{let t=await fetch("/api/db-backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({backupId:e})}),s=await t.json();t.ok?(o({type:"success",message:`Restored! ${s.connectionCount} connections, ${s.nodeCount} nodes, ${s.comboCount} combos, ${s.apiKeyCount} API keys.`}),await y(),await N()):o({type:"error",message:s.error||"Restore failed"})}catch{o({type:"error",message:"An error occurred during restore"})}finally{x(null),h(null)}};(0,l.useEffect)(()=>{N()},[]);let C=e=>e&&0!==e?e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`:"0 B";return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-green-500/10 text-green-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"database"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"System & Storage"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"All data stored locally on your machine"})]}),(0,a.jsx)(n.Ex,{variant:"success",size:"sm",children:j.driver||"json"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[(0,a.jsxs)("div",{className:"p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wide mb-1",children:"Database Path"}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main break-all",children:j.dbPath||"~/.omniroute/storage.sqlite"})]}),(0,a.jsxs)("div",{className:"p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wide mb-1",children:"Database Size"}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main",children:C(j.sizeBytes)})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-bg border border-border mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-500","aria-hidden":"true",children:"schedule"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Last Backup"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:j.lastBackupAt?`${new Date(j.lastBackupAt).toLocaleString("pt-BR")} (${(e=>{if(!e)return null;let t=Math.floor((new Date-new Date(e))/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`})(j.lastBackupAt)})`:"No backup yet"})]})]}),(0,a.jsxs)(n.$n,{variant:"outline",size:"sm",onClick:k,loading:p,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"backup"}),"Backup Now"]})]}),f.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-4 text-sm ${"success"===f.type?"bg-green-500/10 text-green-500 border border-green-500/20":"info"===f.type?"bg-blue-500/10 text-blue-500 border border-blue-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===f.type?"check_circle":"info"===f.type?"info":"error"}),f.message]})}),(0,a.jsxs)("div",{className:"pt-3 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-amber-500","aria-hidden":"true",children:"restore"}),(0,a.jsx)("p",{className:"font-medium",children:"Backup & Restore"})]}),(0,a.jsx)(n.$n,{variant:"outline",size:"sm",onClick:()=>{c(!i),i||0!==e.length||y()},children:i?"Hide":"View Backups"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Database snapshots are created automatically before restore and every 15 minutes when data changes. Retention: 24 hourly + 30 daily backups with smart rotation."}),d.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-3 text-sm ${"success"===d.type?"bg-green-500/10 text-green-500 border border-green-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===d.type?"check_circle":"error"}),d.message]})}),i&&(0,a.jsx)("div",{className:"flex flex-col gap-2",children:s?(0,a.jsxs)("div",{className:"flex items-center justify-center py-6 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px] mr-2","aria-hidden":"true",children:"progress_activity"}),"Loading backups..."]}):0===e.length?(0,a.jsxs)("div",{className:"text-center py-6 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] mb-2 block opacity-40","aria-hidden":"true",children:"folder_off"}),"No backups available yet. Backups will be created automatically when data changes."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.length," backup(s) available"]}),(0,a.jsxs)("button",{onClick:y,className:"text-xs text-primary hover:underline flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"refresh"}),"Refresh"]})]}),e.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-black/[0.02] dark:bg-white/[0.02] border border-border/50 hover:border-border transition-colors",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-500","aria-hidden":"true",children:"description"}),(0,a.jsx)("span",{className:"text-sm font-medium truncate",children:new Date(e.createdAt).toLocaleString("pt-BR")}),(0,a.jsx)(n.Ex,{variant:"pre-restore"===e.reason?"warning":"manual"===e.reason?"success":"default",size:"sm",children:e.reason})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted ml-6",children:[(0,a.jsxs)("span",{children:[e.connectionCount," connection(s)"]}),(0,a.jsx)("span",{children:"•"}),(0,a.jsx)("span",{children:C(e.size)})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 ml-3",children:u===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-xs text-amber-500 font-medium",children:"Confirm?"}),(0,a.jsx)(n.$n,{variant:"primary",size:"sm",onClick:()=>w(e.id),loading:m===e.id,className:"!bg-amber-500 hover:!bg-amber-600",children:"Yes"}),(0,a.jsx)(n.$n,{variant:"outline",size:"sm",onClick:()=>h(null),children:"No"})]}):(0,a.jsxs)(n.$n,{variant:"outline",size:"sm",onClick:()=>h(e.id),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"restore"}),"Restore"]})})]},e.id))]})})]})]})}let d=[{value:"disabled",label:"Disabled",icon:"block"},{value:"blacklist",label:"Blacklist",icon:"do_not_disturb"},{value:"whitelist",label:"Whitelist",icon:"verified_user"},{value:"whitelist-priority",label:"WL Priority",icon:"priority_high"}];function o(){let[e,t]=(0,l.useState)({enabled:!1,mode:"blacklist",blacklist:[],whitelist:[],tempBans:[]}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(""),[o,m]=(0,l.useState)("blacklist");(0,l.useEffect)(()=>{x()},[]);let x=async()=>{try{let e=await fetch("/api/settings/ip-filter");e.ok&&t(await e.json())}catch{}finally{r(!1)}},u=async e=>{try{let s=await fetch("/api/settings/ip-filter",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});s.ok&&t(await s.json())}catch{}},h=()=>{i.trim()&&(u({["blacklist"===o?"addBlacklist":"addWhitelist"]:i.trim()}),c(""))},p=(e,t)=>{u({["blacklist"===t?"removeBlacklist":"removeWhitelist"]:e})},b=e.enabled?e.mode:"disabled";return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-red-500/10 text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"security"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"IP Access Control"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Block or allow specific IP addresses"})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-4 gap-2 mb-5",children:d.map(e=>(0,a.jsxs)("button",{onClick:()=>{var t;"disabled"===(t=e.value)?u({enabled:!1}):u({enabled:!0,mode:t})},disabled:s,className:`flex flex-col items-center gap-1.5 p-3 rounded-lg border text-center transition-all ${b===e.value?"border-red-500/50 bg-red-500/5 ring-1 ring-red-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] ${b===e.value?"text-red-400":"text-text-muted"}`,children:e.icon}),(0,a.jsx)("span",{className:`text-xs font-medium ${b===e.value?"text-red-400":"text-text-muted"}`,children:e.label})]},e.value))}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex gap-2 items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(n.pd,{label:"Add IP Address",placeholder:"192.168.1.0/24 or 10.0.*.*",value:i,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&h()})}),(0,a.jsxs)("div",{className:"flex gap-1 pb-[2px]",children:[(0,a.jsx)(n.$n,{size:"sm",variant:"blacklist"===o?"danger":"secondary",onClick:()=>{m("blacklist"),i.trim()&&h()},children:"+ Block"}),(0,a.jsx)(n.$n,{size:"sm",variant:"whitelist"===o?"primary":"secondary",onClick:()=>{m("whitelist"),i.trim()&&h()},children:"+ Allow"})]})]}),e.blacklist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:["Blocked (",e.blacklist.length,")"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.blacklist.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-mono bg-red-500/10 text-red-400 border border-red-500/20",children:[e,(0,a.jsx)("button",{onClick:()=>p(e,"blacklist"),className:"hover:text-red-300",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))})]}),e.whitelist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:["Allowed (",e.whitelist.length,")"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.whitelist.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-mono bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[e,(0,a.jsx)("button",{onClick:()=>p(e,"whitelist"),className:"hover:text-emerald-300",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))})]}),e.tempBans.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:["Temporary Bans (",e.tempBans.length,")"]}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:e.tempBans.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-orange-500/5 border border-orange-500/20 text-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-xs text-orange-400",children:e.ip}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["— ",e.reason]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted tabular-nums",children:[Math.ceil(e.remainingMs/6e4),"m left"]}),(0,a.jsx)("button",{onClick:()=>u({removeBan:e.ip}),className:"text-text-muted hover:text-orange-400",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]},e.ip))})]})]})]})}function m(){let[e,t]=(0,l.useState)({requireLogin:!1,hasPassword:!1}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)({current:"",new:"",confirm:""}),[d,m]=(0,l.useState)({type:"",message:""}),[x,u]=(0,l.useState)(!1);(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let h=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&t(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},p=async e=>{if(e.preventDefault(),i.new!==i.confirm)return void m({type:"error",message:"Passwords do not match"});u(!0),m({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:i.current,newPassword:i.new})}),t=await e.json();e.ok?(m({type:"success",message:"Password updated successfully"}),c({current:"",new:"",confirm:""})):m({type:"error",message:t.error||"Failed to update password"})}catch{m({type:"error",message:"An error occurred"})}finally{u(!1)}};return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",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]","aria-hidden":"true",children:"shield"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Security"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require login"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,a.jsx)(n.lM,{checked:!0===e.requireLogin,onChange:()=>h(!e.requireLogin),disabled:s})]}),!0===e.requireLogin&&(0,a.jsxs)("form",{onSubmit:p,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[e.hasPassword&&(0,a.jsx)(n.pd,{label:"Current Password",type:"password",placeholder:"Enter current password",value:i.current,onChange:e=>c({...i,current:e.target.value}),required:!0}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsx)(n.pd,{label:"New Password",type:"password",placeholder:"Enter new password",value:i.new,onChange:e=>c({...i,new:e.target.value}),required:!0}),(0,a.jsx)(n.pd,{label:"Confirm New Password",type:"password",placeholder:"Confirm new password",value:i.confirm,onChange:e=>c({...i,confirm:e.target.value}),required:!0})]}),d.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===d.type?"text-red-500":"text-green-500"}`,children:d.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(n.$n,{type:"submit",variant:"primary",loading:x,children:e.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsx)(o,{})]})}var x=s(67671);let u=["#6366f1","#22c55e","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#14b8a6"];function h(){let[e,t]=(0,l.useState)({}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)(""),[m,h]=(0,l.useState)(""),[p,b]=(0,l.useState)(!1),f=(0,x.i)(),g=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/fallback/chains");if(e.ok){let s=await e.json();t(s.chains||s||{})}}catch{}finally{r(!1)}},[]);(0,l.useEffect)(()=>{g()},[g]);let j=async()=>{if(!d.trim()||!m.trim())return void f.warning("Please fill model name and providers");let e=m.split(",").map(e=>e.trim()).filter(Boolean).map((e,t)=>({provider:e,priority:t+1,enabled:!0}));if(0===e.length)return void f.warning("Add at least one provider");b(!0);try{(await fetch("/api/fallback/chains",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d.trim(),chain:e})})).ok?(f.success(`Chain created for ${d.trim()}`),o(""),h(""),c(!1),await g()):f.error("Failed to create chain")}catch{f.error("Failed to create chain")}finally{b(!1)}},v=async e=>{if(confirm(`Delete fallback chain for "${e}"?`))try{(await fetch("/api/fallback/chains",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:e})})).ok?(f.success(`Chain deleted for ${e}`),await g()):f.error("Failed to delete chain")}catch{f.error("Failed to delete chain")}};if(s)return(0,a.jsx)(n.Zp,{className:"p-6 mt-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"timeline"}),"Loading fallback chains..."]})});let y=Object.entries(e);return(0,a.jsxs)(n.Zp,{className:"mt-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4 p-6 pb-0",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-cyan-500/10 text-cyan-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"timeline"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Fallback Chains"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Define provider fallback order per model"})]}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",onClick:()=>c(!i),children:i?"Cancel":"+ Add Chain"})]}),i&&(0,a.jsxs)("div",{className:"mx-6 p-4 rounded-lg border border-border/30 bg-surface/20 mb-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mb-3",children:[(0,a.jsx)(n.pd,{label:"Model Name",placeholder:"claude-sonnet-4-20250514",value:d,onChange:e=>o(e.target.value)}),(0,a.jsx)(n.pd,{label:"Providers (comma-separated, in priority order)",placeholder:"anthropic, openai, gemini",value:m,onChange:e=>h(e.target.value)})]}),(0,a.jsx)(n.$n,{variant:"primary",size:"sm",onClick:j,loading:p,children:"Create Chain"})]}),(0,a.jsx)("div",{className:"px-6 pb-6",children:0===y.length?(0,a.jsx)(n.pp,{icon:"timeline",title:"No Fallback Chains",description:"Create a chain to define provider fallback order for a model."}):(0,a.jsx)("div",{className:"flex flex-col gap-2",children:y.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 rounded-lg border border-border/20 bg-surface/20 hover:bg-surface/40 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,a.jsx)("span",{className:"font-mono text-sm text-text-main truncate max-w-[200px]",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("div",{className:"flex gap-1.5 flex-wrap",children:(Array.isArray(t)?t:[]).map((e,t)=>(0,a.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium",style:{backgroundColor:`${u[t%u.length]}20`,color:u[t%u.length],border:`1px solid ${u[t%u.length]}40`},children:[t+1,". ",e.provider]},`${e.provider}-${t}`))})]}),(0,a.jsx)("button",{onClick:()=>v(e),className:"text-text-muted hover:text-red-400 transition-colors ml-2",title:"Delete chain",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},e))})})]})}let p=[{value:"fill-first",label:"Fill First",desc:"Use accounts in priority order",icon:"vertical_align_top"},{value:"round-robin",label:"Round Robin",desc:"Cycle through all accounts",icon:"loop"},{value:"p2c",label:"P2C",desc:"Pick 2 random, use the healthier one",icon:"balance"},{value:"random",label:"Random",desc:"Random account each request",icon:"shuffle"},{value:"least-used",label:"Least Used",desc:"Pick least recently used account",icon:"low_priority"},{value:"cost-optimized",label:"Cost Opt",desc:"Prefer cheapest available account",icon:"savings"}];function b(){let[e,t]=(0,l.useState)({fallbackStrategy:"fill-first"}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)([]),[d,o]=(0,l.useState)(""),[m,x]=(0,l.useState)("");(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),c(e.wildcardAliases||[]),r(!1)}).catch(()=>r(!1))},[]);let u=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&t(t=>({...t,...e}))}catch(e){console.error("Failed to update settings:",e)}},b=async()=>{if(!d.trim()||!m.trim())return;let e=[...i,{pattern:d.trim(),target:m.trim()}];await u({wildcardAliases:e}),c(e),o(""),x("")},f=async e=>{let t=i.filter((t,s)=>s!==e);await u({wildcardAliases:t}),c(t)};return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"route"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Routing Strategy"})]}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2 mb-4",style:{gridAutoRows:"1fr"},children:p.map(t=>(0,a.jsxs)("button",{onClick:()=>u({fallbackStrategy:t.value}),disabled:s,className:`flex flex-col items-center gap-2 p-4 rounded-lg border text-center transition-all ${e.fallbackStrategy===t.value?"border-blue-500/50 bg-blue-500/5 ring-1 ring-blue-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[24px] ${e.fallbackStrategy===t.value?"text-blue-400":"text-text-muted"}`,children:t.icon}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:`text-sm font-medium ${e.fallbackStrategy===t.value?"text-blue-400":""}`,children:t.label}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:t.desc})]})]},t.value))}),"round-robin"===e.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-3 border-t border-border/30",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Sticky Limit"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Calls per account before switching"})]}),(0,a.jsx)(n.pd,{type:"number",min:"1",max:"10",value:e.stickyRoundRobinLimit||3,onChange:e=>u({stickyRoundRobinLimit:parseInt(e.target.value)}),disabled:s,className:"w-20 text-center"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted italic pt-3 border-t border-border/30 mt-3",children:["round-robin"===e.fallbackStrategy&&`Distributing requests across accounts with ${e.stickyRoundRobinLimit||3} calls per account.`,"fill-first"===e.fallbackStrategy&&"Using accounts in priority order (Fill First).","p2c"===e.fallbackStrategy&&"Power of Two Choices: picks 2 random accounts and routes to the healthier one.","random"===e.fallbackStrategy&&"Randomly selects an available account for each request.","least-used"===e.fallbackStrategy&&"Picks the account that was used least recently.","cost-optimized"===e.fallbackStrategy&&"Prefers accounts with the lowest cost (priority-based, extensible with actual cost data)."]})]}),(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"alt_route"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Model Aliases"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Wildcard patterns to remap model names • Use * and ?"})]})]}),i.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-1.5 mb-4",children:i.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 text-sm",children:[(0,a.jsx)("span",{className:"font-mono text-purple-400",children:e.pattern}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("span",{className:"font-mono text-text-main",children:e.target})]}),(0,a.jsx)("button",{onClick:()=>f(t),className:"text-text-muted hover:text-red-400 transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},t))}),(0,a.jsxs)("div",{className:"flex gap-2 items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(n.pd,{label:"Pattern",placeholder:"claude-sonnet-*",value:d,onChange:e=>o(e.target.value)})}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(n.pd,{label:"Target Model",placeholder:"claude-sonnet-4-20250514",value:m,onChange:e=>x(e.target.value)})}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",onClick:b,className:"mb-[2px]",children:"+ Add"})]})]}),(0,a.jsx)(h,{})]})}function f(){let[e,t]=(0,l.useState)({strategy:"priority",maxRetries:1,retryDelayMs:2e3,timeoutMs:12e4,healthCheckEnabled:!0,healthCheckTimeoutMs:3e3,maxComboDepth:3,trackMetrics:!0}),[s,i]=(0,l.useState)({}),[c,d]=(0,l.useState)(""),[o,m]=(0,l.useState)(!1);(0,l.useEffect)(()=>{fetch("/api/settings/combo-defaults").then(e=>e.json()).then(e=>{e.comboDefaults&&t(e.comboDefaults),e.providerOverrides&&i(e.providerOverrides)}).catch(e=>console.error("Failed to fetch combo defaults:",e))},[]);let x=async()=>{m(!0);try{await fetch("/api/settings/combo-defaults",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboDefaults:e,providerOverrides:s})})}catch(e){console.error("Failed to save combo defaults:",e)}finally{m(!1)}},u=()=>{let e=c.trim().toLowerCase();e&&!s[e]&&(i(t=>({...t,[e]:{maxRetries:1,timeoutMs:12e4}})),d(""))};return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"tune"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Combo Defaults"}),(0,a.jsx)("span",{className:"text-xs text-text-muted ml-auto",children:"Global combo configuration"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Default Strategy"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applied to new combos without explicit strategy"})]}),(0,a.jsx)("div",{role:"tablist","aria-label":"Combo strategy",className:"grid grid-cols-3 gap-1 p-0.5 rounded-md bg-black/5 dark:bg-white/5",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(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e.strategy===s.value,onClick:()=>t(e=>({...e,strategy:s.value})),className:(0,r.cn)("px-2 py-1 rounded text-xs font-medium transition-all flex items-center justify-center gap-0.5",e.strategy===s.value?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:s.icon}),s.label]},s.value))})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 pt-3 border-t border-border/50",children:[{key:"maxRetries",label:"Max Retries",min:0,max:5},{key:"retryDelayMs",label:"Retry Delay (ms)",min:500,max:1e4,step:500},{key:"timeoutMs",label:"Timeout (ms)",min:5e3,max:3e5,step:5e3},{key:"maxComboDepth",label:"Max Nesting Depth",min:1,max:10}].map(({key:s,label:l,min:r,max:i,step:c})=>(0,a.jsx)(n.pd,{label:l,type:"number",min:r,max:i,step:c||1,value:e[s]??"",onChange:e=>t(t=>({...t,[s]:parseInt(e.target.value)||0})),className:"text-sm"},s))}),"round-robin"===e.strategy&&(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 pt-3 border-t border-border/50",children:[(0,a.jsx)(n.pd,{label:"Concurrency / Model",type:"number",min:1,max:20,value:e.concurrencyPerModel??"",placeholder:"3",onChange:e=>t(t=>({...t,concurrencyPerModel:parseInt(e.target.value)||0})),className:"text-sm"}),(0,a.jsx)(n.pd,{label:"Queue Timeout (ms)",type:"number",min:1e3,max:12e4,step:1e3,value:e.queueTimeoutMs??"",placeholder:"30000",onChange:e=>t(t=>({...t,queueTimeoutMs:parseInt(e.target.value)||0})),className:"text-sm"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-3 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Health Check"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pre-check provider availability"})]}),(0,a.jsx)(n.lM,{checked:!1!==e.healthCheckEnabled,onChange:()=>t(e=>({...e,healthCheckEnabled:!e.healthCheckEnabled}))})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Track Metrics"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Record per-combo request metrics"})]}),(0,a.jsx)(n.lM,{checked:!1!==e.trackMetrics,onChange:()=>t(e=>({...e,trackMetrics:!e.trackMetrics}))})]})]}),(0,a.jsxs)("div",{className:"pt-3 border-t border-border/50",children:[(0,a.jsx)("p",{className:"font-medium text-sm mb-2",children:"Provider Overrides"}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Override timeout and retries per provider. Provider settings override global defaults."}),Object.entries(s).map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2 p-2 rounded-lg bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,a.jsx)("span",{className:"text-xs font-mono font-medium min-w-[80px]",children:e}),(0,a.jsx)(n.pd,{type:"number",min:"0",max:"5",value:t.maxRetries??1,onChange:t=>i(s=>({...s,[e]:{...s[e],maxRetries:parseInt(t.target.value)||0}})),className:"text-xs w-16","aria-label":`${e} max retries`}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"retries"}),(0,a.jsx)(n.pd,{type:"number",min:"5000",max:"300000",step:"5000",value:t.timeoutMs??12e4,onChange:t=>i(s=>({...s,[e]:{...s[e],timeoutMs:parseInt(t.target.value)||12e4}})),className:"text-xs w-24","aria-label":`${e} timeout ms`}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"ms"}),(0,a.jsx)("button",{onClick:()=>{i(t=>{let s={...t};return delete s[e],s})},className:"ml-auto text-red-400 hover:text-red-500 transition-colors","aria-label":`Remove ${e} override`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"close"})})]},e)),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,a.jsx)(n.pd,{type:"text",placeholder:"e.g. google, openai...",value:c,onChange:e=>d(e.target.value),onKeyDown:e=>"Enter"===e.key&&u(),className:"text-xs flex-1","aria-label":"New provider name"}),(0,a.jsx)(n.$n,{variant:"outline",size:"sm",onClick:u,disabled:!c.trim(),children:"Add"})]})]}),(0,a.jsx)("div",{className:"pt-3 border-t border-border/50",children:(0,a.jsx)(n.$n,{variant:"primary",size:"sm",onClick:x,loading:o,children:"Save Combo Defaults"})})]})]})}function g(){let[e,t]=(0,l.useState)(!1),[s,r]=(0,l.useState)(null),i=(0,l.useRef)(!0),c=async()=>{try{let e=await fetch("/api/settings/proxy?level=global");if(e.ok){let t=await e.json();r(t.proxy||null)}}catch{}};return(0,l.useEffect)(()=>(i.current=!0,async function(){try{let e=await fetch("/api/settings/proxy?level=global");if(!i.current)return;if(e.ok){let t=await e.json();i.current&&r(t.proxy||null)}}catch{}}(),()=>{i.current=!1}),[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"vpn_lock"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:"Global Proxy"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Configure a global outbound proxy for all API calls. Individual providers, combos, and keys can override this."}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[s?(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)("span",{className:"px-2.5 py-1 rounded text-xs font-bold uppercase bg-emerald-500/15 text-emerald-400 border border-emerald-500/30",children:[s.type,"://",s.host,":",s.port]})}):(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"No global proxy configured"}),(0,a.jsx)(n.$n,{size:"sm",variant:s?"secondary":"primary",icon:"settings",onClick:()=>{c(),t(!0)},children:s?"Edit":"Configure"})]})]})}),(0,a.jsx)(n.KN,{isOpen:e,onClose:()=>t(!1),level:"global",levelLabel:"Global",onSaved:c})]})}var j=s(97550);function v(){let{theme:e,setTheme:t,isDark:s}=(0,j.D)();return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"palette"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Appearance"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Dark Mode"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Switch between light and dark themes"})]}),(0,a.jsx)(n.lM,{checked:s,onChange:()=>t(s?"light":"dark")})]}),(0,a.jsx)("div",{className:"pt-4 border-t border-border",children:(0,a.jsx)("div",{role:"tablist","aria-label":"Theme selection",className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e===s,onClick:()=>t(s),className:(0,r.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all",e===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{className:"capitalize",children:s})]},s))})})]})]})}let y=[{value:"passthrough",label:"Passthrough",desc:"No changes — client controls thinking budget",icon:"arrow_forward"},{value:"auto",label:"Auto",desc:"Strip all thinking config — let provider decide",icon:"auto_awesome"},{value:"custom",label:"Custom",desc:"Set a fixed token budget for all requests",icon:"tune"},{value:"adaptive",label:"Adaptive",desc:"Scale budget based on request complexity",icon:"trending_up"}],N=[{value:"none",label:"None (0 tokens)"},{value:"low",label:"Low (1K tokens)"},{value:"medium",label:"Medium (10K tokens)"},{value:"high",label:"High (128K tokens)"}];function k(){let[e,t]=(0,l.useState)({mode:"passthrough",customBudget:10240,effortLevel:"medium"}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)("");(0,l.useEffect)(()=>{fetch("/api/settings/thinking-budget").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let m=async s=>{let a={...e,...s};t(a),c(!0),o("");try{(await fetch("/api/settings/thinking-budget",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok?(o("saved"),setTimeout(()=>o(""),2e3)):o("error")}catch{o("error")}finally{c(!1)}};return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",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]","aria-hidden":"true",children:"psychology"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Thinking Budget"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Control AI reasoning token usage across all requests"})]}),"saved"===d&&(0,a.jsxs)("span",{className:"ml-auto text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," Saved"]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2 mb-5",children:y.map(t=>(0,a.jsxs)("button",{onClick:()=>m({mode:t.value}),disabled:s||i,className:`flex items-start gap-3 p-3 rounded-lg border text-left transition-all ${e.mode===t.value?"border-violet-500/50 bg-violet-500/5 ring-1 ring-violet-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] mt-0.5 ${e.mode===t.value?"text-violet-500":"text-text-muted"}`,children:t.icon}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:`text-sm font-medium ${e.mode===t.value?"text-violet-400":""}`,children:t.label}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5 leading-relaxed",children:t.desc})]})]},t.value))}),"custom"===e.mode&&(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Token Budget"}),(0,a.jsxs)("span",{className:"text-sm font-mono tabular-nums text-violet-400",children:[e.customBudget.toLocaleString()," tokens"]})]}),(0,a.jsx)("input",{type:"range",min:"0",max:"131072",step:"1024",value:e.customBudget,onChange:e=>m({customBudget:parseInt(e.target.value)}),className:"w-full accent-violet-500"}),(0,a.jsxs)("div",{className:"flex justify-between text-xs text-text-muted mt-1",children:[(0,a.jsx)("span",{children:"Off"}),(0,a.jsx)("span",{children:"1K"}),(0,a.jsx)("span",{children:"10K"}),(0,a.jsx)("span",{children:"64K"}),(0,a.jsx)("span",{children:"128K"})]})]}),"adaptive"===e.mode&&(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30",children:[(0,a.jsx)("p",{className:"text-sm font-medium mb-3",children:"Base Effort Level"}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Adaptive mode scales from this base level based on message count, tool usage, and prompt length."}),(0,a.jsx)("div",{className:"grid grid-cols-4 gap-2",children:N.map(t=>(0,a.jsx)("button",{onClick:()=>m({effortLevel:t.value}),disabled:s||i,className:`px-3 py-2 rounded-lg text-xs font-medium border transition-all ${e.effortLevel===t.value?"border-violet-500/50 bg-violet-500/10 text-violet-400":"border-border/50 text-text-muted hover:border-border"}`,children:t.value.charAt(0).toUpperCase()+t.value.slice(1)},t.value))})]})]})}function w(){let[e,t]=(0,l.useState)({enabled:!1,prompt:""}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(""),[d,o]=(0,l.useState)(null);(0,l.useEffect)(()=>{fetch("/api/settings/system-prompt").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let m=async s=>{let a={...e,...s};t(a),c("");try{(await fetch("/api/settings/system-prompt",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(c("saved"),setTimeout(()=>c(""),2e3))}catch{c("error")}};return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"edit_note"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Global System Prompt"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Injected into all requests at proxy level"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:["saved"===i&&(0,a.jsxs)("span",{className:"text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," Saved"]}),(0,a.jsx)(n.lM,{checked:e.enabled,onChange:()=>m({enabled:!e.enabled}),disabled:s})]})]}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("textarea",{value:e.prompt,onChange:e=>{var s;return s=e.target.value,void(t(e=>({...e,prompt:s})),d&&clearTimeout(d),o(setTimeout(()=>{m({prompt:s})},800)))},placeholder:"Enter system prompt to inject into all requests...",rows:5,className:"w-full px-4 py-3 rounded-lg border border-border/50 bg-surface/30 text-sm placeholder:text-text-muted/50 resize-y min-h-[120px] focus:outline-none focus:ring-1 focus:ring-amber-500/30 focus:border-amber-500/50 transition-colors",disabled:s}),(0,a.jsxs)("div",{className:"absolute bottom-2 right-3 text-xs text-text-muted/60 tabular-nums",children:[e.prompt.length," chars"]})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted/70 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),"This prompt is prepended to the system message of every request. Use for global instructions, safety guidelines, or response formatting rules. Send ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-surface/50",children:"_skipSystemPrompt: true"})," in a request to bypass."]})]})]})}function C(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!1),i=()=>{fetch("/api/cache/stats").then(e=>e.json()).then(t).catch(()=>{})};(0,l.useEffect)(i,[]);let c=async()=>{r(!0);try{await fetch("/api/cache/stats",{method:"DELETE"}),i()}finally{r(!1)}};return(0,a.jsxs)(n.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"cached"}),"Prompt Cache"]}),(0,a.jsx)("button",{onClick:c,disabled:s,className:"px-3 py-1.5 text-xs rounded-lg bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:s?"Flushing…":"Flush Cache"})]}),e?(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Size"}),(0,a.jsxs)("p",{className:"font-mono text-lg text-text-main",children:[e.size,"/",e.maxSize]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Hit Rate"}),(0,a.jsxs)("p",{className:"font-mono text-lg text-text-main",children:[e.hitRate?.toFixed(1)??0,"%"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Hits"}),(0,a.jsx)("p",{className:"font-mono text-text-main",children:e.hits??0})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Evictions"}),(0,a.jsx)("p",{className:"font-mono text-text-main",children:e.evictions??0})]})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Loading cache stats…"})]})}let S={CLOSED:{bg:"bg-emerald-500/15",text:"text-emerald-400",border:"border-emerald-500/30",label:"CLOSED",icon:"check_circle"},OPEN:{bg:"bg-red-500/15",text:"text-red-400",border:"border-red-500/30",label:"OPEN",icon:"error"},HALF_OPEN:{bg:"bg-amber-500/15",text:"text-amber-400",border:"border-amber-500/30",label:"HALF-OPEN",icon:"warning"}},$={closed:{icon:"check_circle",color:"#22c55e",label:"Closed"},"half-open":{icon:"pending",color:"#f59e0b",label:"Half-Open"},open:{icon:"error",color:"#ef4444",label:"Open"}};function P(e){return!e||e<=0?"—":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function A({profiles:e,onSave:t,saving:s}){let[r,i]=(0,l.useState)(!1),[c,d]=(0,l.useState)(e);(0,l.useEffect)(()=>{d(e)},[e]);let o=[{key:"transientCooldown",label:"Transient Cooldown",suffix:"ms"},{key:"rateLimitCooldown",label:"Rate Limit Cooldown",suffix:"ms"},{key:"maxBackoffLevel",label:"Max Backoff Level",suffix:""},{key:"circuitBreakerThreshold",label:"CB Threshold",suffix:" fails"},{key:"circuitBreakerReset",label:"CB Reset Time",suffix:"ms"}];return(0,a.jsx)(n.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"tune"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:"Provider Profiles"})]}),r?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.$n,{size:"sm",variant:"secondary",onClick:()=>i(!1),children:"Cancel"}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{t(c),i(!1)},disabled:s,children:"Save"})]}):(0,a.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>i(!0),children:"Edit"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Separate resilience settings for OAuth (session-based) and API Key (metered) providers. OAuth providers have stricter thresholds due to lower rate limits."}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:["oauth","apikey"].map(t=>(0,a.jsxs)("div",{className:"rounded-lg bg-black/5 dark:bg-white/5 p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-bold uppercase tracking-wider mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base","aria-hidden":"true",children:"oauth"===t?"lock":"key"}),"oauth"===t?"OAuth Providers":"API Key Providers"]}),(0,a.jsx)("div",{className:"space-y-2",children:o.map(({key:s,label:l,suffix:i})=>(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:l}),r?(0,a.jsx)("input",{type:"number",min:"0",value:c?.[t]?.[s]??0,onChange:e=>d({...c,[t]:{...c[t],[s]:Number(e.target.value)}}),className:"w-24 px-2 py-1 text-xs rounded bg-white/10 border border-white/20 text-right"}):(0,a.jsxs)("span",{className:"text-sm font-mono",children:[e?.[t]?.[s]??"—",i&&e?.[t]?.[s]!=null?i:""]})]},s))})]},t))})]})})}function R({rateLimitStatus:e,defaults:t,onSaveDefaults:s,saving:r}){let[i,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)(t||{});return(0,l.useEffect)(()=>{t&&o(t)},[t]),(0,a.jsx)(n.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"speed"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:"Rate Limiting"})]}),i?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.$n,{size:"sm",variant:"secondary",onClick:()=>c(!1),children:"Cancel"}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{s(d),c(!1)},disabled:r,children:"Save"})]}):(0,a.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>c(!0),children:"Edit"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"API Key providers are automatically rate-limited with safe defaults. Limits are learned from response headers and adapt over time."}),(0,a.jsxs)("div",{className:"rounded-lg bg-black/5 dark:bg-white/5 p-4 mb-4",children:[(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider mb-3 text-text-muted",children:"Default Safety Net"}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-4",children:[{key:"requestsPerMinute",label:"RPM",suffix:""},{key:"minTimeBetweenRequests",label:"Min Gap",suffix:"ms",format:P},{key:"concurrentRequests",label:"Max Concurrent",suffix:""}].map(({key:e,label:s,format:l})=>(0,a.jsxs)("div",{children:[i?(0,a.jsx)("input",{type:"number",min:"1",value:d[e]??0,onChange:t=>o(s=>({...s,[e]:parseInt(t.target.value)||0})),className:"w-full px-2 py-1 text-lg font-bold rounded bg-white/10 border border-white/20"}):(0,a.jsx)("div",{className:"text-lg font-bold",children:l?l(t?.[e]):t?.[e]??"—"}),(0,a.jsx)("div",{className:"text-xs text-text-muted",children:s})]},e))})]}),e&&e.length>0?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text-muted",children:"Active Limiters"}),e.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-black/5 dark:bg-white/5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.provider||e.key}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[null!=e.reservoir&&(0,a.jsxs)("span",{children:["Reservoir: ",e.reservoir]}),null!=e.running&&(0,a.jsxs)("span",{children:["Running: ",e.running]}),null!=e.queued&&(0,a.jsxs)("span",{children:["Queued: ",e.queued]})]})]},t))]}):(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No active rate limiters yet."})]})})}function T({breakers:e,onReset:t,loading:s}){let l=e.filter(e=>"CLOSED"!==e.state),r=e.length;return(0,a.jsx)(n.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"electrical_services"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:"Circuit Breakers"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:l.length>0?`${l.length} tripped`:`${r} healthy`}),l.length>0&&(0,a.jsx)(n.$n,{size:"sm",variant:"danger",icon:"restart_alt",onClick:t,disabled:s,children:"Reset All"})]})]}),0===e.length?(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No circuit breakers active yet. They are created automatically when requests flow through the combo pipeline."}):(0,a.jsx)("div",{className:"space-y-2",children:e.map(e=>{let t=S[e.state]||S.CLOSED;return(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-black/5 dark:bg-white/5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-base ${t.text}`,"aria-hidden":"true",children:t.icon}),(0,a.jsx)("span",{className:"text-sm font-medium",children:e.name.replace("combo:","")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[e.failureCount>0&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.failureCount," failure",1!==e.failureCount?"s":""]}),(0,a.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-bold uppercase ${t.bg} ${t.text} border ${t.border}`,children:t.label})]})]},e.name)})})]})})}function E(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(null),d=(0,x.i)(),o=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/policies");if(e.ok){let s=await e.json();t(s)}}catch{}finally{r(!1)}},[]);(0,l.useEffect)(()=>{o();let e=setInterval(o,15e3);return()=>clearInterval(e)},[o]);let m=async e=>{c(e);try{(await fetch("/api/policies",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"unlock",identifier:e})})).ok?(d.success(`Unlocked: ${e}`),await o()):d.error("Failed to unlock")}catch{d.error("Failed to unlock")}finally{c(null)}},u=e?.circuitBreakers||[],h=e?.lockedIdentifiers||[],p=u.some(e=>"closed"!==e.state)||h.length>0;return s?(0,a.jsx)(n.Zp,{className:"p-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"policy"}),"Loading policies..."]})}):(0,a.jsx)(n.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"policy"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:"Policies & Locked Identifiers"})]}),p&&(0,a.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:o,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"refresh"})})]}),p?(0,a.jsxs)(a.Fragment,{children:[u.filter(e=>"closed"!==e.state).length>0&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:"Circuit Breakers"}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:u.filter(e=>"closed"!==e.state).map((e,t)=>{let s=$[e.state]||$.open;return(0,a.jsx)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:s.color},children:s.icon}),(0,a.jsx)("span",{className:"text-sm text-text-main font-medium",children:e.name||e.provider||"Unknown"}),(0,a.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:`${s.color}15`,color:s.color},children:s.label}),e.failures>0&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.failures," failures"]})]})},e.name||t)})})]}),h.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:"Locked Identifiers"}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:h.map((e,t)=>{let s="string"==typeof e?e:e.identifier||e.id;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-red-400",children:"lock"}),(0,a.jsx)("span",{className:"font-mono text-sm text-text-main",children:s}),"object"==typeof e&&e.lockedAt&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["since ",new Date(e.lockedAt).toLocaleString()]})]}),(0,a.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>m(s),disabled:i===s,className:"text-xs",children:i===s?"Unlocking...":"Force Unlock"})]},s||t)})})]})]}):(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-emerald-500/10 text-emerald-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"verified_user"})}),(0,a.jsx)("div",{children:(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"All systems operational — no lockouts or tripped breakers"})})]})]})})}function B(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)(null),m=(0,l.useCallback)(async()=>{try{r(!0);let e=await fetch("/api/resilience");if(!e.ok)throw Error(`Failed to load: ${e.status}`);let s=await e.json();t(s),o(null)}catch(e){o(e.message)}finally{r(!1)}},[]);(0,l.useEffect)(()=>{m();let e=setInterval(m,1e4);return()=>clearInterval(e)},[m]);let x=async()=>{try{if(r(!0),!(await fetch("/api/resilience/reset",{method:"POST"})).ok)throw Error("Reset failed");await m()}catch(e){o(e.message)}finally{r(!1)}},u=async e=>{try{if(c(!0),!(await fetch("/api/resilience",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({profiles:e})})).ok)throw Error("Save failed");await m()}catch(e){o(e.message)}finally{c(!1)}},h=async e=>{try{if(c(!0),!(await fetch("/api/resilience",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaults:e})})).ok)throw Error("Save failed");await m()}catch(e){o(e.message)}finally{c(!1)}};return s&&!e?(0,a.jsxs)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"hourglass_empty"}),"Loading resilience status..."]}):d&&!e?(0,a.jsxs)(n.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"error"}),(0,a.jsx)("span",{className:"text-sm",children:d})]}),(0,a.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:m,className:"mt-3",children:"Retry"})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(A,{profiles:e?.profiles||{},onSave:u,saving:i}),(0,a.jsx)(R,{rateLimitStatus:e?.rateLimitStatus||[],defaults:e?.defaults||{},onSaveDefaults:h,saving:i}),(0,a.jsx)(T,{breakers:e?.circuitBreakers||[],onReset:x,loading:s}),(0,a.jsx)(E,{})]})}let L=[{id:"general",label:"General",icon:"settings"},{id:"ai",label:"AI",icon:"smart_toy"},{id:"security",label:"Security",icon:"shield"},{id:"routing",label:"Routing",icon:"route"},{id:"resilience",label:"Resilience",icon:"electrical_services"},{id:"advanced",label:"Advanced",icon:"tune"}];function O(){let[e,t]=(0,l.useState)("general");return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)("div",{role:"tablist","aria-label":"Settings sections",className:"inline-flex items-center p-1 rounded-lg bg-black/5 dark:bg-white/5 self-start",children:L.map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e===s.id,tabIndex:e===s.id?0:-1,onClick:()=>t(s.id),className:(0,r.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all text-sm",e===s.id?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]","aria-hidden":"true",children:s.icon}),(0,a.jsx)("span",{className:"hidden sm:inline",children:s.label})]},s.id))}),(0,a.jsxs)("div",{role:"tabpanel","aria-label":L.find(t=>t.id===e)?.label,children:["general"===e&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(c,{}),(0,a.jsx)(v,{})]})}),"ai"===e&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(k,{}),(0,a.jsx)(w,{}),(0,a.jsx)(C,{})]}),"security"===e&&(0,a.jsx)(m,{}),"routing"===e&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(b,{}),(0,a.jsx)(f,{})]}),"resilience"===e&&(0,a.jsx)(B,{}),"advanced"===e&&(0,a.jsx)(g,{})]}),(0,a.jsxs)("div",{className:"text-center text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[i.vQ.name," v",i.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:"Local Mode — All data stored on your machine"})]})]})})}},99344:(e,t,s)=>{Promise.resolve().then(s.bind(s,73100))}},e=>{e.O(0,[8500,9751,782,1149,5846,993,8441,3794,7358],()=>e(e.s=99344)),_N_E=e.O()}]);
|
package/app/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omniroute",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg width="234" height="42" viewBox="0 0 234 42" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M18 30H6V18H18V30Z" fill="#4B4646"/>
|
|
3
|
+
<path d="M18 12H6V30H18V12ZM24 36H0V6H24V36Z" fill="#B7B1B1"/>
|
|
4
|
+
<path d="M48 30H36V18H48V30Z" fill="#4B4646"/>
|
|
5
|
+
<path d="M36 30H48V12H36V30ZM54 36H36V42H30V6H54V36Z" fill="#B7B1B1"/>
|
|
6
|
+
<path d="M84 24V30H66V24H84Z" fill="#4B4646"/>
|
|
7
|
+
<path d="M84 24H66V30H84V36H60V6H84V24ZM66 18H78V12H66V18Z" fill="#B7B1B1"/>
|
|
8
|
+
<path d="M108 36H96V18H108V36Z" fill="#4B4646"/>
|
|
9
|
+
<path d="M108 12H96V36H90V6H108V12ZM114 36H108V12H114V36Z" fill="#B7B1B1"/>
|
|
10
|
+
<path d="M144 30H126V18H144V30Z" fill="#4B4646"/>
|
|
11
|
+
<path d="M144 12H126V30H144V36H120V6H144V12Z" fill="#F1ECEC"/>
|
|
12
|
+
<path d="M168 30H156V18H168V30Z" fill="#4B4646"/>
|
|
13
|
+
<path d="M168 12H156V30H168V12ZM174 36H150V6H174V36Z" fill="#F1ECEC"/>
|
|
14
|
+
<path d="M198 30H186V18H198V30Z" fill="#4B4646"/>
|
|
15
|
+
<path d="M198 12H186V30H198V12ZM204 36H180V6H198V0H204V36Z" fill="#F1ECEC"/>
|
|
16
|
+
<path d="M234 24V30H216V24H234Z" fill="#4B4646"/>
|
|
17
|
+
<path d="M216 12V18H228V12H216ZM234 24H216V30H234V36H210V6H234V24Z" fill="#F1ECEC"/>
|
|
18
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omniroute",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
File without changes
|
|
File without changes
|