omniroute 0.3.0 → 0.5.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.md +86 -1135
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +30 -24
- package/app/.next/build-manifest.json +2 -2
- package/app/.next/prerender-manifest.json +99 -3
- package/app/.next/routes-manifest.json +36 -0
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js +2 -0
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js +2 -0
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error/page.js +2 -2
- 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 +3 -3
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +3 -3
- 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 +2 -2
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js +1 -1
- package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_not-found.html +1 -1
- package/app/.next/server/app/_not-found.rsc +5 -5
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- 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 +2 -2
- package/app/.next/server/app/api/auth/login/route.js +1 -1
- package/app/.next/server/app/api/auth/login/route.js.nft.json +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.js +2 -0
- package/app/.next/server/app/api/cache/route.js.nft.json +1 -0
- package/app/.next/server/app/api/cache/route_client-reference-manifest.js +1 -0
- package/app/.next/server/app/api/cache/stats/route.js +1 -1
- package/app/.next/server/app/api/cache/stats/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -157
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- 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 +2 -2
- package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-profiles/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/codex-profiles/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route.js +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 +1 -1
- 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/cloud/auth/route.js +1 -156
- package/app/.next/server/app/api/cloud/auth/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -156
- package/app/.next/server/app/api/cloud/credentials/update/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -156
- package/app/.next/server/app/api/cloud/model/resolve/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/test/route.js +1 -156
- package/app/.next/server/app/api/combos/test/route.js.nft.json +1 -1
- package/app/.next/server/app/api/combos/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/compliance/audit-log/route.js +1 -156
- package/app/.next/server/app/api/compliance/audit-log/route.js.nft.json +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.js +1 -156
- package/app/.next/server/app/api/db-backups/route.js.nft.json +1 -1
- package/app/.next/server/app/api/db-backups/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/evals/[suiteId]/route.js +1 -1
- package/app/.next/server/app/api/evals/[suiteId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/evals/route.js +1 -1
- package/app/.next/server/app/api/evals/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/fallback/chains/route.js +3 -1
- package/app/.next/server/app/api/fallback/chains/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/init/route.js.nft.json +1 -1
- package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/route.js +1 -1
- package/app/.next/server/app/api/keys/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/models/alias/route.js.nft.json +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.js +2 -156
- package/app/.next/server/app/api/models/catalog/route.js.nft.json +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 +2 -156
- package/app/.next/server/app/api/models/route.js.nft.json +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 +2 -0
- package/app/.next/server/app/api/monitoring/health/route.js.nft.json +1 -0
- package/app/.next/server/app/api/monitoring/health/route_client-reference-manifest.js +1 -0
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +2 -2
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/policies/route.js +3 -1
- package/app/.next/server/app/api/policies/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/pricing/defaults/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/models/route.js +1 -156
- package/app/.next/server/app/api/pricing/models/route.js.nft.json +1 -1
- package/app/.next/server/app/api/pricing/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/route.js +1 -156
- package/app/.next/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-models/route.js +1 -156
- package/app/.next/server/app/api/provider-models/route.js.nft.json +1 -1
- package/app/.next/server/app/api/provider-models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -156
- package/app/.next/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route.js +2 -156
- package/app/.next/server/app/api/provider-nodes/route.js.nft.json +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.js +2 -156
- package/app/.next/server/app/api/providers/[id]/models/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/client/route.js +1 -156
- package/app/.next/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/route.js +2 -1
- package/app/.next/server/app/api/providers/route.js.nft.json +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.js +2 -156
- package/app/.next/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/validate/route.js +1 -156
- package/app/.next/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limit/route.js +1 -156
- package/app/.next/server/app/api/rate-limit/route.js.nft.json +1 -1
- package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limits/route.js +1 -1
- package/app/.next/server/app/api/rate-limits/route.js.nft.json +1 -1
- package/app/.next/server/app/api/rate-limits/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/resilience/reset/route.js +1 -1
- package/app/.next/server/app/api/resilience/reset/route.js.nft.json +1 -1
- package/app/.next/server/app/api/resilience/reset/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/resilience/route.js +1 -156
- package/app/.next/server/app/api/resilience/route.js.nft.json +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.js +1 -156
- package/app/.next/server/app/api/settings/combo-defaults/route.js.nft.json +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.js +1 -156
- package/app/.next/server/app/api/settings/proxy/route.js.nft.json +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.js +1 -156
- package/app/.next/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/route.js +1 -1
- package/app/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route.js +1 -156
- package/app/.next/server/app/api/settings/system-prompt/route.js.nft.json +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/thinking-budget/route.js +1 -156
- package/app/.next/server/app/api/settings/thinking-budget/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route.js.nft.json +1 -1
- package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/token-health/route.js +1 -156
- package/app/.next/server/app/api/token-health/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/translate/route.js +1 -156
- package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/analytics/route.js +1 -156
- package/app/.next/server/app/api/usage/analytics/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/analytics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/budget/route.js +3 -1
- package/app/.next/server/app/api/usage/budget/route.js.nft.json +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.js +1 -156
- package/app/.next/server/app/api/usage/call-logs/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/call-logs/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/route.js +1 -156
- package/app/.next/server/app/api/usage/call-logs/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/call-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/history/route.js +1 -156
- package/app/.next/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/logs/route.js +1 -156
- package/app/.next/server/app/api/usage/logs/route.js.nft.json +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.js +1 -156
- package/app/.next/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js +1 -156
- package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js +1 -156
- package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/models/route.js +2 -1
- package/app/.next/server/app/api/v1/models/route.js.nft.json +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.js +1 -156
- package/app/.next/server/app/api/v1/moderations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/moderations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js +1 -156
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js +1 -156
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/rerank/route.js +1 -156
- package/app/.next/server/app/api/v1/rerank/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/rerank/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js +1 -156
- package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -156
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route.js +2 -1
- package/app/.next/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback/page.js +1 -1
- package/app/.next/server/app/callback/page.js.nft.json +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback.html +1 -1
- package/app/.next/server/app/callback.rsc +5 -5
- package/app/.next/server/app/callback.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
- 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 -0
- package/app/.next/server/app/dashboard/analytics.meta +17 -0
- package/app/.next/server/app/dashboard/analytics.rsc +24 -0
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +9 -0
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics.segment.rsc +4 -0
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +4 -0
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk.segment.rsc +5 -0
- package/app/.next/server/app/dashboard/analytics.segments/_full.segment.rsc +24 -0
- package/app/.next/server/app/dashboard/analytics.segments/_head.segment.rsc +6 -0
- package/app/.next/server/app/dashboard/analytics.segments/_index.segment.rsc +9 -0
- package/app/.next/server/app/dashboard/analytics.segments/_tree.segment.rsc +5 -0
- package/app/.next/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next/server/app/dashboard/cli-tools.rsc +7 -7
- 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 +7 -7
- 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 +4 -4
- package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.html +1 -1
- package/app/.next/server/app/dashboard/combos.rsc +7 -7
- 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 +7 -7
- package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.html +1 -1
- package/app/.next/server/app/dashboard/endpoint.rsc +7 -7
- 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 +7 -7
- package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/health.html +1 -0
- package/app/.next/server/app/dashboard/health.meta +17 -0
- package/app/.next/server/app/dashboard/health.rsc +24 -0
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health/__PAGE__.segment.rsc +9 -0
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health.segment.rsc +4 -0
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +4 -0
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk.segment.rsc +5 -0
- package/app/.next/server/app/dashboard/health.segments/_full.segment.rsc +24 -0
- package/app/.next/server/app/dashboard/health.segments/_head.segment.rsc +6 -0
- package/app/.next/server/app/dashboard/health.segments/_index.segment.rsc +9 -0
- package/app/.next/server/app/dashboard/health.segments/_tree.segment.rsc +5 -0
- package/app/.next/server/app/dashboard/onboarding.html +1 -1
- package/app/.next/server/app/dashboard/onboarding.rsc +6 -6
- 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 +6 -6
- package/app/.next/server/app/dashboard/onboarding.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/onboarding.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/onboarding.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.html +1 -1
- package/app/.next/server/app/dashboard/profile.rsc +6 -6
- 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 +6 -6
- package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.html +1 -1
- package/app/.next/server/app/dashboard/providers/new.rsc +7 -7
- 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 +7 -7
- 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 +4 -4
- package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.html +1 -1
- package/app/.next/server/app/dashboard/providers.rsc +7 -7
- 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 +7 -7
- package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.rsc +7 -7
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
- 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 +7 -7
- 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 +4 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings.html +1 -1
- package/app/.next/server/app/dashboard/settings.rsc +7 -7
- 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 +7 -7
- package/app/.next/server/app/dashboard/settings.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/settings.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.html +2 -2
- package/app/.next/server/app/dashboard/translator.rsc +7 -7
- 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 +7 -7
- package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.html +2 -2
- package/app/.next/server/app/dashboard/usage.rsc +7 -7
- 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 +7 -7
- package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/docs/page.js +3 -2
- package/app/.next/server/app/docs/page.js.nft.json +1 -1
- package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/docs.html +1 -1
- package/app/.next/server/app/docs.rsc +21 -20
- package/app/.next/server/app/docs.segments/_full.segment.rsc +21 -20
- package/app/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/docs.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
- 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.js +2 -0
- package/app/.next/server/app/forbidden/page.js.nft.json +1 -0
- package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -0
- package/app/.next/server/app/forbidden.html +1 -0
- package/app/.next/server/app/forbidden.meta +15 -0
- package/app/.next/server/app/forbidden.rsc +23 -0
- package/app/.next/server/app/forbidden.segments/_full.segment.rsc +23 -0
- package/app/.next/server/app/forbidden.segments/_head.segment.rsc +6 -0
- package/app/.next/server/app/forbidden.segments/_index.segment.rsc +9 -0
- package/app/.next/server/app/forbidden.segments/_tree.segment.rsc +5 -0
- package/app/.next/server/app/forbidden.segments/forbidden/__PAGE__.segment.rsc +9 -0
- package/app/.next/server/app/forbidden.segments/forbidden.segment.rsc +4 -0
- package/app/.next/server/app/forgot-password/page.js +2 -0
- package/app/.next/server/app/forgot-password/page.js.nft.json +1 -0
- package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -0
- package/app/.next/server/app/forgot-password.html +1 -0
- package/app/.next/server/app/forgot-password.meta +15 -0
- package/app/.next/server/app/forgot-password.rsc +23 -0
- package/app/.next/server/app/forgot-password.segments/_full.segment.rsc +23 -0
- package/app/.next/server/app/forgot-password.segments/_head.segment.rsc +6 -0
- package/app/.next/server/app/forgot-password.segments/_index.segment.rsc +9 -0
- package/app/.next/server/app/forgot-password.segments/_tree.segment.rsc +5 -0
- package/app/.next/server/app/forgot-password.segments/forgot-password/__PAGE__.segment.rsc +9 -0
- package/app/.next/server/app/forgot-password.segments/forgot-password.segment.rsc +4 -0
- package/app/.next/server/app/index.html +1 -1
- package/app/.next/server/app/index.rsc +5 -5
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/landing/page.js +1 -1
- package/app/.next/server/app/landing/page.js.nft.json +1 -1
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing.html +1 -1
- package/app/.next/server/app/landing.rsc +6 -6
- package/app/.next/server/app/landing.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next/server/app/login/page.js +1 -1
- package/app/.next/server/app/login/page.js.nft.json +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login.html +1 -1
- package/app/.next/server/app/login.rsc +6 -6
- package/app/.next/server/app/login.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- 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.js +1 -1
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/privacy/page.js +1 -1
- package/app/.next/server/app/privacy/page.js.nft.json +1 -1
- package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/privacy.html +1 -1
- package/app/.next/server/app/privacy.rsc +20 -21
- package/app/.next/server/app/privacy.segments/_full.segment.rsc +20 -21
- package/app/.next/server/app/privacy.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/privacy.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/privacy.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/privacy.segments/privacy/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/privacy.segments/privacy.segment.rsc +1 -1
- package/app/.next/server/app/terms/page.js +1 -1
- package/app/.next/server/app/terms/page.js.nft.json +1 -1
- package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/terms.html +1 -1
- package/app/.next/server/app/terms.rsc +21 -19
- package/app/.next/server/app/terms.segments/_full.segment.rsc +21 -19
- package/app/.next/server/app/terms.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/terms.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/terms.segments/_tree.segment.rsc +2 -2
- 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 +30 -24
- package/app/.next/server/chunks/1228.js +3 -1
- package/app/.next/server/chunks/152.js +1 -1
- package/app/.next/server/chunks/1746.js +1 -0
- package/app/.next/server/chunks/216.js +37 -0
- package/app/.next/server/chunks/2399.js +1 -1
- package/app/.next/server/chunks/3676.js +2 -1
- package/app/.next/server/chunks/4004.js +1 -1
- package/app/.next/server/chunks/4352.js +46 -0
- package/app/.next/server/chunks/4443.js +1 -1
- package/app/.next/server/chunks/{8259.js → 4469.js} +52 -2
- package/app/.next/server/chunks/4755.js +3 -3
- package/app/.next/server/chunks/4832.js +2 -2
- package/app/.next/server/chunks/5040.js +1 -1
- package/app/.next/server/chunks/5727.js +1 -0
- package/app/.next/server/chunks/6599.js +1 -1
- package/app/.next/server/chunks/7093.js +2 -0
- package/app/.next/server/chunks/7615.js +9 -2
- package/app/.next/server/chunks/7763.js +1 -0
- package/app/.next/server/chunks/7802.js +1 -0
- package/app/.next/server/chunks/7968.js +3 -1
- package/app/.next/server/chunks/8392.js +1 -0
- package/app/.next/server/chunks/8847.js +3 -0
- package/app/.next/server/chunks/9263.js +1 -0
- package/app/.next/server/middleware.js +207 -2
- 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/1525-886426e50105474d.js +21 -0
- package/app/.next/static/chunks/3191-0bbb8ebd1bd32d1d.js +1 -0
- package/app/.next/static/chunks/7896-42bb02212fd79c37.js +2 -0
- package/app/.next/static/chunks/9751-3a35163d337d54ea.js +37 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/page-7a3dc7db5858bb3b.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-148b0ad18f6bec86.js → page-4cec40aa933b932e.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-bdb5be890b523066.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-c08e4e402bafcf57.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/health/page-f2287385af528be2.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-47808673eb1f72ec.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-958706ed6aa9d18b.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/{page-4bd8ea64f2e8008b.js → page-9667287d75830fd5.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-2af3523f530f984a.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-a94b8f5327b8392c.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/page-834e40170968cf11.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/{page-c891465a1a2938d2.js → page-6190920e7526556c.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-32e5d24d60a03c23.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/{layout-e84875e22efbf437.js → layout-b6fc79d0628b97e3.js} +1 -1
- package/app/.next/static/chunks/app/_global-error/page-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/_not-found/page-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/auth/login/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/auth/logout/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cache/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cache/stats/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/backups/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/codex-profiles/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/guide-settings/[toolId]/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/runtime/[toolId]/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/auth/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/credentials/update/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/model/resolve/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/models/alias/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/combos/[id]/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/combos/metrics/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/combos/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/combos/test/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/compliance/audit-log/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/db-backups/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/evals/[suiteId]/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/evals/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/fallback/chains/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/init/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/keys/[id]/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/keys/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/models/alias/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/models/availability/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/models/catalog/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/models/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/monitoring/health/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/cursor/import/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/import/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/policies/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/pricing/defaults/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/pricing/models/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/pricing/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/provider-models/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/validate/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/models/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/test/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/providers/client/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/providers/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/providers/test-batch/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/providers/validate/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/rate-limit/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/rate-limits/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/resilience/reset/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/resilience/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/restart/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/sessions/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/settings/combo-defaults/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/settings/ip-filter/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/settings/proxy/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/settings/proxy/test/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/settings/require-login/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/settings/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/settings/system-prompt/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/settings/thinking-budget/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/shutdown/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/storage/health/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/sync/cloud/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/sync/initialize/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/tags/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/telemetry/summary/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/token-health/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/translator/detect/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/translator/history/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/translator/load/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/translator/save/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/translator/send/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/translator/translate/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/usage/[connectionId]/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/usage/analytics/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/usage/budget/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/usage/call-logs/[id]/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/usage/call-logs/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/usage/history/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/usage/logs/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/usage/proxy-logs/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/usage/request-logs/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/api/chat/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/audio/speech/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/chat/completions/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/embeddings/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/images/generations/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/messages/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/models/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/moderations/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/providers/[provider]/chat/completions/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/providers/[provider]/embeddings/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/providers/[provider]/images/generations/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/rerank/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/responses/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/api/v1beta/models/route-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/app/forbidden/page-6806872971c364f0.js +1 -0
- package/app/.next/static/chunks/app/forgot-password/page-9c116a597f3df4d1.js +1 -0
- package/app/.next/static/chunks/app/global-error-6abc2976016d7bd1.js +1 -0
- package/app/.next/static/chunks/app/landing/page-174931045e0028b2.js +1 -0
- package/app/.next/static/chunks/app/layout-6504ce60623b0a41.js +1 -0
- package/app/.next/static/chunks/app/login/{page-e99ed6a85e91ae7c.js → page-93ac51059ef434b7.js} +1 -1
- package/app/.next/static/chunks/app/not-found-e1af8b9c5785b71b.js +1 -0
- package/app/.next/static/chunks/app/page-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-c02303813bcb9777.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-c02303813bcb9777.js +1 -0
- package/app/.next/static/css/61fcae3369881104.css +1 -0
- package/app/.next/static/sTDitYd6vQZvJjlRJcZVe/_buildManifest.js +1 -0
- package/app/package.json +2 -2
- package/package.json +2 -2
- package/app/.next/server/chunks/1969.js +0 -1
- package/app/.next/server/chunks/21.js +0 -46
- package/app/.next/server/chunks/4412.js +0 -156
- package/app/.next/server/chunks/4436.js +0 -1
- package/app/.next/server/chunks/481.js +0 -156
- package/app/.next/server/chunks/5267.js +0 -1
- package/app/.next/server/chunks/5640.js +0 -1
- package/app/.next/server/chunks/9328.js +0 -156
- package/app/.next/static/HcUrNktdfL89Ss5F7FHxP/_buildManifest.js +0 -1
- package/app/.next/static/chunks/1525-213a0aff01eb1c70.js +0 -21
- package/app/.next/static/chunks/6941-0643e7aebf5ed645.js +0 -1
- package/app/.next/static/chunks/7896-5591822b8348e380.js +0 -1
- package/app/.next/static/chunks/8013-04b90e92e614b5d9.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-28e46119138cf102.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-ab8b870377087bc7.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-bc5764734a448526.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-fb1fa9ae8a3af8c8.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-fc3451fe77f856f1.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-95b884cdbf859e56.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/page-a22d14af518d5b43.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-7a0943932e7e5e51.js +0 -1
- package/app/.next/static/chunks/app/_global-error/page-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/_not-found/page-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/auth/login/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/auth/logout/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cache/stats/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/backups/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/codex-profiles/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/guide-settings/[toolId]/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/runtime/[toolId]/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/auth/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/credentials/update/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/model/resolve/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/models/alias/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/combos/[id]/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/combos/metrics/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/combos/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/combos/test/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/compliance/audit-log/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/db-backups/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/evals/[suiteId]/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/evals/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/fallback/chains/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/init/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/keys/[id]/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/keys/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/models/alias/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/models/availability/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/models/catalog/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/models/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/cursor/import/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/import/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/policies/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/pricing/defaults/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/pricing/models/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/pricing/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/provider-models/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/validate/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/models/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/test/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/providers/client/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/providers/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/providers/test-batch/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/providers/validate/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/rate-limit/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/rate-limits/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/resilience/reset/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/resilience/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/restart/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/sessions/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/settings/combo-defaults/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/settings/ip-filter/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/settings/proxy/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/settings/proxy/test/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/settings/require-login/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/settings/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/settings/system-prompt/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/settings/thinking-budget/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/shutdown/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/storage/health/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/sync/cloud/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/sync/initialize/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/tags/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/telemetry/summary/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/token-health/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/translator/detect/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/translator/history/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/translator/load/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/translator/save/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/translator/send/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/translator/translate/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/usage/[connectionId]/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/usage/analytics/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/usage/budget/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/usage/call-logs/[id]/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/usage/call-logs/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/usage/history/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/usage/logs/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/usage/proxy-logs/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/usage/request-logs/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/api/chat/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/audio/speech/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/chat/completions/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/embeddings/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/images/generations/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/messages/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/models/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/moderations/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/providers/[provider]/chat/completions/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/providers/[provider]/embeddings/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/providers/[provider]/images/generations/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/rerank/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/responses/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/api/v1beta/models/route-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/app/global-error-bbdc13af28c5aba1.js +0 -1
- package/app/.next/static/chunks/app/landing/page-19e96efb956a6d32.js +0 -1
- package/app/.next/static/chunks/app/layout-485b011f69e6ed37.js +0 -1
- package/app/.next/static/chunks/app/not-found-2ba4520c9df30430.js +0 -1
- package/app/.next/static/chunks/app/page-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-329f30be723f33ce.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-329f30be723f33ce.js +0 -1
- package/app/.next/static/css/2862d4067eab20b2.css +0 -1
- /package/app/.next/static/{HcUrNktdfL89Ss5F7FHxP → sTDitYd6vQZvJjlRJcZVe}/_ssgManifest.js +0 -0
|
@@ -12,4 +12,4 @@ model_provider = "omniroute"
|
|
|
12
12
|
name = "OmniRoute"
|
|
13
13
|
base_url = "${ea()}"
|
|
14
14
|
wire_api = "responses"
|
|
15
|
-
`},{filename:"~/.codex/auth.json",content:JSON.stringify({OPENAI_API_KEY:p},null,2)}])})]})}let m=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function p({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:i,apiKeys:c,activeProviders:d,cloudEnabled:x}){let p,u,h,g,[y,f]=(0,l.useState)(null),[b,j]=(0,l.useState)(!1),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)(null),[_,O]=(0,l.useState)(""),[A,E]=(0,l.useState)(""),[I,P]=(0,l.useState)(!1),[$,L]=(0,l.useState)({}),[R,T]=(0,l.useState)(!1),[M,U]=(0,l.useState)(""),K=(0,l.useRef)(!1),[F,z]=(0,l.useState)([]),[D,B]=(0,l.useState)(!1),[H,J]=(0,l.useState)(null),q=!!(y?.installed&&y?.runnable),W=(()=>{if(!q)return null;let e=y.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id);if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=x&&m&&e.baseUrl?.startsWith(m);return t||s?"configured":"other"})();(0,l.useEffect)(()=>{c?.length>0&&!_&&O(c[0].key)},[c,_]),(0,l.useEffect)(()=>{t&&!y&&(Z(),G(),Q())},[t,y]);let G=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&L(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(y?.installed&&!K.current){K.current=!0;let e=y.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id);e&&(e.model&&E(e.model),e.apiKey&&c?.some(t=>t.key===e.apiKey)&&O(e.apiKey))}},[y,c]);let Z=async()=>{j(!0);try{let e=await fetch("/api/cli-tools/droid-settings"),t=await e.json();f(t)}catch(e){f({installed:!1,error:e.message})}finally{j(!1)}},V=()=>{let e=M||n;return e.endsWith("/v1")?e:`${e}/v1`},X=async()=>{v(!0),S(null);try{let e=_?.trim()||(c?.length>0?c[0].key:null)||(x?null:"sk_omniroute"),t=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:V(),apiKey:e,model:A})}),s=await t.json();t.ok?(S({type:"success",text:"Settings applied successfully!"}),Z()):S({type:"error",text:s.error||"Failed to apply settings"})}catch(e){S({type:"error",text:e.message})}finally{v(!1)}},Y=async()=>{w(!0),S(null);try{let e=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),t=await e.json();e.ok?(S({type:"success",text:"Settings reset successfully!"}),E(""),O(""),Z()):S({type:"error",text:t.error||"Failed to reset settings"})}catch(e){S({type:"error",text:e.message})}finally{w(!1)}},Q=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=droid"),t=await e.json();e.ok&&z(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},ee=async e=>{J(e),S(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"droid",backupId:e})}),s=await t.json();t.ok?(S({type:"success",text:"Backup restored!"}),Z(),Q()):S({type:"error",text:s.error||"Failed to restore"})}catch(e){S({type:"error",text:e.message})}finally{J(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/droid.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===W&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===W&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===W&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[b&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Factory Droid CLI..."})]}),!b&&y&&!q&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:y.installed?"Factory Droid CLI not runnable":"Factory Droid CLI not installed"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:y.installed?`Factory Droid CLI was found but failed runtime healthcheck${y.reason?` (${y.reason})`:""}.`:"Please install Factory Droid CLI to use this feature."})]})]}),!b&&q&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[y?.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id)?.baseUrl&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:y.settings.customModels.find(e=>"custom:OmniRoute-0"===e.id).baseUrl})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(p=M||n).endsWith("/v1")?p:`${p}/v1`,onChange:e=>U(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),M&&M!==n&&(0,a.jsx)("button",{onClick:()=>U(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),c.length>0?(0,a.jsx)("select",{value:_,onChange:e=>O(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:c.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_omniroute (default)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:A,onChange:e=>E(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>P(!0),disabled:!i,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),A&&(0,a.jsx)("button",{onClick:()=>E(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),C&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===C.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===C.type?"check_circle":"error"}),(0,a.jsx)("span",{children:C.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:X,disabled:!A,loading:N,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:Y,disabled:!y?.hasOmniRoute,loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>T(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{B(!D),D||Q()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),"Backups",F.length>0&&` (${F.length})`]})]}),D&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),"Config Backups"]}),0===F.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No backups yet. Backups are created automatically before each Apply or Reset."}):(0,a.jsx)("div",{className:"space-y-1.5",children:F.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>ee(e.id),disabled:H===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:H===e.id?"...":"Restore"})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:I,onClose:()=>P(!1),onSelect:e=>{E(e.value),P(!1)},selectedModel:A,activeProviders:d,modelAliases:$,title:"Select Model for Factory Droid"}),(0,a.jsx)(r.uR,{isOpen:R,onClose:()=>T(!1),title:"Factory Droid - Manual Configuration",configs:(u=_&&_.trim()?_:x?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",h={customModels:[{model:A||"provider/model-id",id:"custom:OmniRoute-0",index:0,baseUrl:V(),apiKey:u,displayName:A||"provider/model-id",maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}]},g="u">typeof navigator&&navigator.platform,[{filename:g?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(h,null,2)}])})]})}let u=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function h({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:i,apiKeys:c,activeProviders:d,cloudEnabled:x}){let m,p,[h,g]=(0,l.useState)(null),[y,f]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!1),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(null),[C,S]=(0,l.useState)(""),[_,O]=(0,l.useState)(""),[A,E]=(0,l.useState)(!1),[I,P]=(0,l.useState)({}),[$,L]=(0,l.useState)(!1),[R,T]=(0,l.useState)(""),M=(0,l.useRef)(!1),[U,K]=(0,l.useState)([]),[F,z]=(0,l.useState)(!1),[D,B]=(0,l.useState)(null),H=!!(h?.installed&&h?.runnable),J=(()=>{if(!H)return null;let e=h.settings?.models?.providers?.omniroute;if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=x&&u&&e.baseUrl?.startsWith(u);return t||s?"configured":"other"})();(0,l.useEffect)(()=>{c?.length>0&&!C&&S(c[0].key)},[c,C]),(0,l.useEffect)(()=>{t&&!h&&(W(),q(),X())},[t,h]);let q=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&P(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(h?.installed&&!M.current){M.current=!0;let e=h.settings?.models?.providers?.omniroute;if(e){let t=h.settings?.agents?.defaults?.model?.primary;t&&O(t.replace("omniroute/","")),e.apiKey&&c?.some(t=>t.key===e.apiKey)&&S(e.apiKey)}}},[h,c]);let W=async()=>{f(!0);try{let e=await fetch("/api/cli-tools/openclaw-settings"),t=await e.json();g(t)}catch(e){g({installed:!1,error:e.message})}finally{f(!1)}},G=()=>{let e=R||n;return e.endsWith("/v1")?e:`${e}/v1`},Z=async()=>{j(!0),w(null);try{let e=C?.trim()||(c?.length>0?c[0].key:null)||(x?null:"sk_omniroute"),t=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:G(),apiKey:e,model:_})}),s=await t.json();t.ok?(w({type:"success",text:"Settings applied successfully!"}),W()):w({type:"error",text:s.error||"Failed to apply settings"})}catch(e){w({type:"error",text:e.message})}finally{j(!1)}},V=async()=>{v(!0),w(null);try{let e=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),t=await e.json();e.ok?(w({type:"success",text:"Settings reset successfully!"}),O(""),S(""),W()):w({type:"error",text:t.error||"Failed to reset settings"})}catch(e){w({type:"error",text:e.message})}finally{v(!1)}},X=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=openclaw"),t=await e.json();e.ok&&K(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},Y=async e=>{B(e),w(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"openclaw",backupId:e})}),s=await t.json();t.ok?(w({type:"success",text:"Backup restored!"}),W(),X()):w({type:"error",text:s.error||"Failed to restore"})}catch(e){w({type:"error",text:e.message})}finally{B(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/openclaw.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===J&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===J&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===J&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[y&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Open Claw CLI..."})]}),!y&&h&&!H&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:h.installed?"Open Claw CLI not runnable":"Open Claw CLI not installed"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:h.installed?`Open Claw CLI was found but failed runtime healthcheck${h.reason?` (${h.reason})`:""}.`:"Please install Open Claw CLI to use this feature."})]})]}),!y&&H&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[h?.settings?.models?.providers?.omniroute?.baseUrl&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:h.settings.models.providers.omniroute.baseUrl})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(m=R||n).endsWith("/v1")?m:`${m}/v1`,onChange:e=>T(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),R&&R!==n&&(0,a.jsx)("button",{onClick:()=>T(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),c.length>0?(0,a.jsx)("select",{value:C,onChange:e=>S(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:c.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_omniroute (default)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:_,onChange:e=>O(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>E(!0),disabled:!i,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),_&&(0,a.jsx)("button",{onClick:()=>O(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),k&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===k.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===k.type?"check_circle":"error"}),(0,a.jsx)("span",{children:k.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:Z,disabled:!_,loading:b,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:V,disabled:!h?.hasOmniRoute,loading:N,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>L(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{z(!F),F||X()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),"Backups",U.length>0&&` (${U.length})`]})]}),F&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),"Config Backups"]}),0===U.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No backups yet. Backups are created automatically before each Apply or Reset."}):(0,a.jsx)("div",{className:"space-y-1.5",children:U.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>Y(e.id),disabled:D===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:D===e.id?"...":"Restore"})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:A,onClose:()=>E(!1),onSelect:e=>{O(e.value),E(!1)},selectedModel:_,activeProviders:d,modelAliases:I,title:"Select Model for Open Claw"}),(0,a.jsx)(r.uR,{isOpen:$,onClose:()=>L(!1),title:"Open Claw - Manual Configuration",configs:(p=C&&C.trim()?C:x?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`omniroute/${_||"provider/model-id"}`}}},models:{providers:{omniroute:{baseUrl:G(),apiKey:p,api:"openai-completions",models:[{id:_||"provider/model-id",name:(_||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}let g=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function y({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:i,apiKeys:c,activeProviders:d,cloudEnabled:x}){let[m,p]=(0,l.useState)(null),[u,h]=(0,l.useState)(!1),[y,f]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!1),[N,v]=(0,l.useState)(null),[k,w]=(0,l.useState)(""),[C,S]=(0,l.useState)(""),[_,O]=(0,l.useState)(!1),[A,E]=(0,l.useState)({}),[I,P]=(0,l.useState)(!1),[$,L]=(0,l.useState)(""),R=(0,l.useRef)(!1),[T,M]=(0,l.useState)([]),[U,K]=(0,l.useState)(!1),[F,z]=(0,l.useState)(null),D=!!(m?.installed&&m?.runnable),B=(()=>{if(!D)return null;if(!m.hasOmniRoute)return"not_configured";let e=m.settings?.openAiBaseUrl||"",t=e.includes("localhost")||e.includes("127.0.0.1"),s=x&&g&&e.startsWith(g);return t||s?"configured":"other"})();(0,l.useEffect)(()=>{c?.length>0&&!k&&w(c[0].key)},[c,k]),(0,l.useEffect)(()=>{t&&!m&&(W(),H(),J())},[t,m]),(0,l.useEffect)(()=>{if(m?.settings&&!R.current){let e=m.settings.openAiModelId;e&&(S(e),R.current=!0)}},[m]);let H=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let t=await e.json();E(t.aliases||{})}}catch{}},J=async()=>{try{let e=await fetch("/api/cli-tools/backups?toolId=cline");if(e.ok){let t=await e.json();M(t.backups||[])}}catch{}},q=async e=>{z(e);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolId:"cline",backupId:e})});if(t.ok)v({type:"success",text:"Backup restored! Reloading status..."}),await W(),await J();else{let e=await t.json();v({type:"error",text:e.error||"Failed to restore backup"})}}catch(e){v({type:"error",text:e.message})}finally{z(null)}},W=async()=>{h(!0);try{let e=await fetch("/api/cli-tools/cline-settings"),t=await e.json();p(t)}catch(e){p({error:e.message})}finally{h(!1)}},G=async()=>{f(!0),v(null);try{let e=$||n||"http://localhost:20128",t=e.endsWith("/v1")?e:`${e}/v1`,s=await fetch("/api/cli-tools/cline-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:t,apiKey:k||"sk_omniroute",model:C})}),a=await s.json();s.ok?(v({type:"success",text:a.message||"Applied!"}),await W(),await J()):v({type:"error",text:a.error||"Failed"})}catch(e){v({type:"error",text:e.message})}finally{f(!1)}},Z=async()=>{j(!0),v(null);try{let e=await fetch("/api/cli-tools/cline-settings",{method:"DELETE"}),t=await e.json();e.ok?(v({type:"success",text:t.message||"Reset!"}),S(""),R.current=!1,await W(),await J()):v({type:"error",text:t.error||"Failed"})}catch(e){v({type:"error",text:e.message})}finally{j(!1)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:e.image?(0,a.jsx)(o.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:e.color},children:"terminal"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(()=>{if(!D)return null;let e={configured:{class:"bg-green-500/10 text-green-600 dark:text-green-400",text:"Connected"},not_configured:{class:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",text:"Not configured"},other:{class:"bg-blue-500/10 text-blue-600 dark:text-blue-400",text:"Custom config"}}[B];return e?(0,a.jsx)("span",{className:`px-1.5 py-0.5 text-[10px] font-medium rounded-full ${e.class}`,children:e.text}):null})()]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[u&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Cline CLI..."})]}),m&&!u&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${D?"text-green-500":"text-yellow-500"}`,children:D?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:D?"Cline CLI detected and ready":m.installed?"Cline CLI installed but not runnable":"Cline CLI not detected"}),m.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Binary:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:m.commandPath})]}),m.globalStatePath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Config:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:m.globalStatePath})]})]})]}),D&&(0,a.jsxs)(a.Fragment,{children:["configured"===B&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:"OmniRoute is configured as OpenAI-compatible provider"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Provider: ",(0,a.jsx)("strong",{children:"openai"})," • Model:"," ",(0,a.jsx)("strong",{children:m.settings?.openAiModelId||"—"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:"Model"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:C,onChange:e=>S(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)(r.$n,{variant:"outline",size:"sm",onClick:()=>O(!0),disabled:!i,children:"Select"}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>P(!0),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:"API Key"}),c&&c.length>0?(0,a.jsx)("select",{value:k,onChange:e=>w(e.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:c.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x?"No API keys available":"Using default: sk_omniroute"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:G,disabled:!C,loading:y,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===B?"Update Config":"Apply Config"]}),"configured"===B&&(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:Z,loading:b,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),"Reset"]})]}),N&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===N.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===N.type?"check_circle":"error"}),(0,a.jsx)("span",{children:N.text})]}),(0,a.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,a.jsxs)("button",{onClick:()=>K(!U),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${U?"rotate-90":""}`,children:"chevron_right"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),"Backups ",T.length>0&&`(${T.length})`]}),U&&T.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:T.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-medium",children:e.originalFile}),(0,a.jsx)("span",{className:"text-text-muted",children:new Date(e.createdAt).toLocaleString()})]}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>q(e.id),loading:F===e.id,children:"Restore"})]},e.id))}),U&&0===T.length&&(0,a.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:"No backups available."})]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:_,onClose:()=>O(!1),onSelect:e=>{S(e.value),O(!1)},selectedModel:C,activeProviders:d,title:"Select Model for Cline"}),(0,a.jsx)(r.uR,{isOpen:I,onClose:()=>P(!1),onApply:e=>{e.model&&S(e.model),e.apiKey&&w(e.apiKey),e.baseUrl&&L(e.baseUrl),P(!1)},currentConfig:{model:C,apiKey:k,baseUrl:$||n},title:"Cline Manual Configuration"})]})}function f({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:i,apiKeys:c,activeProviders:d,cloudEnabled:x}){let[m,p]=(0,l.useState)(null),[u,h]=(0,l.useState)(!1),[g,y]=(0,l.useState)(!1),[f,b]=(0,l.useState)(!1),[j,N]=(0,l.useState)(null),[v,k]=(0,l.useState)(""),[w,C]=(0,l.useState)(""),[S,_]=(0,l.useState)(!1),[O,A]=(0,l.useState)({}),[E,I]=(0,l.useState)(!1),[P,$]=(0,l.useState)(""),L=(0,l.useRef)(!1),[R,T]=(0,l.useState)([]),[M,U]=(0,l.useState)(!1),[K,F]=(0,l.useState)(null),z=!!(m?.installed&&m?.runnable),D=z?m.hasOmniRoute?"configured":"not_configured":null;(0,l.useEffect)(()=>{c?.length>0&&!v&&k(c[0].key)},[c,v]),(0,l.useEffect)(()=>{t&&!m&&(q(),B(),H())},[t,m]);let B=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let t=await e.json();A(t.aliases||{})}}catch{}},H=async()=>{try{let e=await fetch("/api/cli-tools/backups?toolId=kilo");if(e.ok){let t=await e.json();T(t.backups||[])}}catch{}},J=async e=>{F(e);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolId:"kilo",backupId:e})});if(t.ok)N({type:"success",text:"Backup restored! Reloading status..."}),await q(),await H();else{let e=await t.json();N({type:"error",text:e.error||"Failed to restore backup"})}}catch(e){N({type:"error",text:e.message})}finally{F(null)}},q=async()=>{h(!0);try{let e=await fetch("/api/cli-tools/kilo-settings"),t=await e.json();p(t)}catch(e){p({error:e.message})}finally{h(!1)}},W=async()=>{y(!0),N(null);try{let e=P||n||"http://localhost:20128",t=e.endsWith("/v1")?e:`${e}/v1`,s=await fetch("/api/cli-tools/kilo-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:t,apiKey:v||"sk_omniroute",model:w})}),a=await s.json();s.ok?(N({type:"success",text:a.message||"Applied!"}),await q(),await H()):N({type:"error",text:a.error||"Failed"})}catch(e){N({type:"error",text:e.message})}finally{y(!1)}},G=async()=>{b(!0),N(null);try{let e=await fetch("/api/cli-tools/kilo-settings",{method:"DELETE"}),t=await e.json();e.ok?(N({type:"success",text:t.message||"Reset!"}),C(""),L.current=!1,await q(),await H()):N({type:"error",text:t.error||"Failed"})}catch(e){N({type:"error",text:e.message})}finally{b(!1)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:e.image?(0,a.jsx)(o.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:e.color},children:"terminal"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(()=>{if(!z)return null;let e={configured:{class:"bg-green-500/10 text-green-600 dark:text-green-400",text:"Connected"},not_configured:{class:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",text:"Not configured"}}[D];return e?(0,a.jsx)("span",{className:`px-1.5 py-0.5 text-[10px] font-medium rounded-full ${e.class}`,children:e.text}):null})()]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[u&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Kilo Code CLI..."})]}),m&&!u&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${z?"text-green-500":"text-yellow-500"}`,children:z?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:z?"Kilo Code CLI detected and ready":m.installed?"Kilo Code CLI installed but not runnable":"Kilo Code CLI not detected"}),m.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Binary:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:m.commandPath})]}),m.authPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Auth:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:m.authPath})]})]})]}),z&&(0,a.jsxs)(a.Fragment,{children:["configured"===D&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:"OmniRoute is configured as OpenAI-compatible provider"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Providers: ",(0,a.jsx)("strong",{children:m.settings?.auth?.join(", ")||"—"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:"Model"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:w,onChange:e=>C(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)(r.$n,{variant:"outline",size:"sm",onClick:()=>_(!0),disabled:!i,children:"Select"}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>I(!0),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:"API Key"}),c&&c.length>0?(0,a.jsx)("select",{value:v,onChange:e=>k(e.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:c.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x?"No API keys available":"Using default: sk_omniroute"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:W,disabled:!w,loading:g,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===D?"Update Config":"Apply Config"]}),"configured"===D&&(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:G,loading:f,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),"Reset"]})]}),j&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===j.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===j.type?"check_circle":"error"}),(0,a.jsx)("span",{children:j.text})]}),(0,a.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,a.jsxs)("button",{onClick:()=>U(!M),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${M?"rotate-90":""}`,children:"chevron_right"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),"Backups ",R.length>0&&`(${R.length})`]}),M&&R.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:R.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-medium",children:e.originalFile}),(0,a.jsx)("span",{className:"text-text-muted",children:new Date(e.createdAt).toLocaleString()})]}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>J(e.id),loading:K===e.id,children:"Restore"})]},e.id))}),M&&0===R.length&&(0,a.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:"No backups available."})]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:S,onClose:()=>_(!1),onSelect:e=>{C(e.value),_(!1)},selectedModel:w,activeProviders:d,title:"Select Model for Kilo Code"}),(0,a.jsx)(r.uR,{isOpen:E,onClose:()=>I(!1),onApply:e=>{e.model&&C(e.model),e.apiKey&&k(e.apiKey),e.baseUrl&&$(e.baseUrl),I(!1)},currentConfig:{model:w,apiKey:v,baseUrl:P||n},title:"Kilo Code Manual Configuration"})]})}function b({toolId:e,tool:t,isExpanded:s,onToggle:n,baseUrl:i,apiKeys:c,activeProviders:d=[],cloudEnabled:x=!1}){let[m,p]=(0,l.useState)(null),[u,h]=(0,l.useState)(!1),[g,y]=(0,l.useState)(""),[f,b]=(0,l.useState)(null),[j,N]=(0,l.useState)(null),[v,k]=(0,l.useState)(!1),w=(0,l.useRef)(!1),[C,S]=(0,l.useState)(()=>c?.length>0?c[0].key:"");(0,l.useEffect)(()=>{let t=localStorage.getItem(`omniroute-cli-model-${e}`);t&&y(t);let s=localStorage.getItem(`omniroute-cli-key-${e}`);s&&c?.some(e=>e.key===s)&&S(s)},[e,c]);let _=(0,l.useCallback)(t=>{y(t),t?localStorage.setItem(`omniroute-cli-model-${e}`,t):localStorage.removeItem(`omniroute-cli-model-${e}`)},[e]),O=(0,l.useCallback)(t=>{S(t),t&&localStorage.setItem(`omniroute-cli-key-${e}`,t)},[e]);(0,l.useEffect)(()=>{!s||f||w.current||(w.current=!0,fetch(`/api/cli-tools/runtime/${e}`).then(e=>e.json()).then(e=>b(e)).catch(e=>b({error:e?.message||"runtime_check_failed"})))},[s,f,e]);let A=e=>{let t=C&&C.trim()?C:x?"your-api-key":"sk_omniroute",s=i||"http://localhost:20128",a=s.endsWith("/v1")?s:`${s}/v1`;return e.replace(/\{\{baseUrl\}\}/g,a).replace(/\{\{apiKey\}\}/g,t).replace(/\{\{model\}\}/g,g||"provider/model-id")},E=async(e,t)=>{await navigator.clipboard.writeText(A(e)),p(t),setTimeout(()=>p(null),2e3)},I=d.length>0,P=s&&null===f,$=async()=>{k(!0),N(null);try{let t=C&&C.trim()?C:x?"":"sk_omniroute",s=i||"http://localhost:20128",a=s.endsWith("/v1")?s:`${s}/v1`,l=await fetch(`/api/cli-tools/guide-settings/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:a,apiKey:t,model:g})}),r=await l.json();l.ok?N({type:"success",text:r.message||"Configuration saved!"}):N({type:"error",text:r.error||"Failed to save"})}catch(e){N({type:"error",text:e.message})}finally{k(!1)}},L=["continue"].includes(e),R=()=>!t.requiresCloud||!!x;return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:n,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:t.image?(0,a.jsx)(o.default,{src:t.image,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):t.icon?(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:t.color},children:t.icon}):(0,a.jsx)(o.default,{src:`/providers/${e}.png`,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:t.name}),f&&!f.error&&(0,a.jsx)("span",{className:`px-1.5 py-0.5 text-[10px] font-medium rounded-full ${"not_required"===f.reason?"bg-blue-500/10 text-blue-600 dark:text-blue-400":f.installed&&f.runnable?"bg-green-500/10 text-green-600 dark:text-green-400":"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"}`,children:"not_required"===f.reason?"Guide":f.installed&&f.runnable?"Detected":"Not ready"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:t.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${s?"rotate-180":""}`,children:"expand_more"})]}),s&&(0,a.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:t.guideSteps?(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[P&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking runtime..."})]}),!P&&f&&!f.error&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"not_required"===f.reason?"info":f.installed&&f.runnable?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"not_required"===f.reason?"Guide-only integration: no local binary required":f.installed&&f.runnable?"CLI runtime detected and healthy":f.installed?`CLI found but not runnable${f.reason?` (${f.reason})`:""}`:"CLI runtime not detected"}),f.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Binary:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.commandPath})]}),f.configPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Config path:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.configPath})]})]})]}),!P&&f?.error&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500 text-lg",children:"error"}),(0,a.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:"Failed to check runtime status."})]}),t.notes&&0!==t.notes.length?(0,a.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:t.notes.map((e,t)=>{if("cloudCheck"===e.type&&x)return null;let s="warning"===e.type,l="cloudCheck"===e.type&&!x,r="bg-blue-500/10 border-blue-500/30",n="text-blue-600 dark:text-blue-400",i="text-blue-500",o="info";return s?(r="bg-yellow-500/10 border-yellow-500/30",n="text-yellow-600 dark:text-yellow-400",i="text-yellow-500",o="warning"):l&&(r="bg-red-500/10 border-red-500/30",n="text-red-600 dark:text-red-400",i="text-red-500",o="error"),(0,a.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${r}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${i}`,children:o}),(0,a.jsx)("p",{className:`text-sm ${n}`,children:e.text})]},t)})}):null,R()&&t.guideSteps.map(e=>(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:t.color},children:e.step}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-text",children:e.title}),e.desc&&(0,a.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:e.desc}),"apiKeySelector"===e.type&&(0,a.jsx)("div",{className:"mt-2 flex items-center gap-2",children:c&&c.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("select",{value:C,onChange:e=>O(e.target.value),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:c.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}),(0,a.jsx)("button",{onClick:()=>E(C,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===m?"check":"content_copy"})})]}):(0,a.jsx)("span",{className:"text-sm text-text-muted",children:x?"No API keys - Create one in Keys page":"sk_omniroute"})}),"modelSelector"===e.type&&(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:g,onChange:e=>_(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>h(!0),disabled:!I,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${I?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),g&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:()=>E(g,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===m?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>_(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),e.value&&(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,a.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:A(e.value)}),e.copyable&&(0,a.jsx)("button",{onClick:()=>E(e.value,`${e.step}-${e.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:m===`${e.step}-${e.title}`?"check":"content_copy"})})]})]})]},e.step)),R()&&t.codeBlock&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:t.codeBlock.language}),(0,a.jsxs)("button",{onClick:()=>E(t.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===m?"check":"content_copy"}),"codeblock"===m?"Copied!":"Copy"]})]}),(0,a.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,a.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:A(t.codeBlock.code)})})]}),R()&&(0,a.jsxs)("div",{className:"mt-2",children:[j&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs mb-2 ${"success"===j.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===j.type?"check_circle":"error"}),(0,a.jsx)("span",{children:j.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[L&&(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:$,disabled:!g,loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Save Config"]}),t.codeBlock&&(0,a.jsxs)(r.$n,{variant:L?"outline":"primary",size:"sm",onClick:()=>E(t.codeBlock.code,"codeblock"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"codeblock"===m?"check":"content_copy"}),"codeblock"===m?"Copied!":"Copy Config"]}),g&&(0,a.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-green-500",children:"check_circle"}),"Selection saved"]})]})]})]}):(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,a.jsx)(r.rq,{isOpen:u,onClose:()=>h(!1),onSelect:e=>{_(e.value)},selectedModel:g,activeProviders:d,title:"Select Model"})]})}function j({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:i,activeProviders:c,hasActiveProviders:d,cloudEnabled:x}){let[m,p]=(0,l.useState)(null),[u,h]=(0,l.useState)(!1),[g,y]=(0,l.useState)(!1),[f,b]=(0,l.useState)(""),[j,N]=(0,l.useState)(""),[v,k]=(0,l.useState)(null),[w,C]=(0,l.useState)({}),[S,_]=(0,l.useState)(!1),[O,A]=(0,l.useState)(null);(0,l.useEffect)(()=>{i?.length>0&&!j&&N(i[0].key)},[i,j]),(0,l.useEffect)(()=>{t&&!m&&(I(),E())},[t,m]);let E=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm/alias?tool=antigravity");if(e.ok){let t=(await e.json()).aliases||{};Object.keys(t).length>0&&C(t)}}catch(e){console.log("Error loading saved mappings:",e)}},I=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm");if(e.ok){let t=await e.json();p(t)}}catch(e){console.log("Error fetching status:",e),p({running:!1})}},P="u">typeof navigator&&navigator.userAgent?.includes("Windows"),$=async e=>{h(!0),k(null);try{let t=j?.trim()||(i?.length>0?i[0].key:null)||(x?null:"sk_omniroute"),s=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t,sudoPassword:e})}),a=await s.json();s.ok?(k({type:"success",text:"MITM started"}),y(!1),b(""),I()):k({type:"error",text:a.error||"Failed to start"})}catch(e){k({type:"error",text:e.message})}finally{h(!1)}},L=async e=>{h(!0),k(null);try{let t=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:e})}),s=await t.json();t.ok?(k({type:"success",text:"MITM stopped"}),y(!1),b(""),I()):k({type:"error",text:s.error||"Failed to stop"})}catch(e){k({type:"error",text:e.message})}finally{h(!1)}},R=()=>{f.trim()?m?.running?L(f):$(f):k({type:"error",text:"Sudo password is required"})},T=(e,t)=>{C(s=>({...s,[e]:t}))},M=async()=>{h(!0),k(null);try{let e=await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"antigravity",mappings:w})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to save mappings")}k({type:"success",text:"Mappings saved!"})}catch(e){k({type:"error",text:e.message})}finally{h(!1)}},U=m?.running;return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/antigravity.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),U?(0,a.jsx)(r.Ex,{variant:"success",size:"sm",children:"Active"}):(0,a.jsx)(r.Ex,{variant:"default",size:"sm",children:"Inactive"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"flex items-center gap-2",children:U?(0,a.jsxs)("button",{onClick:()=>{P||m?.hasCachedPassword?L(""):(y(!0),k(null))},disabled:u,className:"px-4 py-2 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-sm flex items-center gap-2 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"stop_circle"}),"Stop MITM"]}):(0,a.jsxs)("button",{onClick:()=>{P||m?.hasCachedPassword?$(""):(y(!0),k(null))},disabled:u||!d,className:"px-4 py-2 rounded-lg bg-primary/10 border border-primary/30 text-primary font-medium text-sm flex items-center gap-2 hover:bg-primary/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"play_circle"}),"Start MITM"]})}),v?.type==="error"&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,a.jsx)("span",{children:v.text})]}),U&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),i.length>0?(0,a.jsx)("select",{value:j,onChange:e=>N(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:i.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_omniroute (default)"})]}),e.defaultModels.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:e.name}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:w[e.alias]||"",onChange:t=>T(e.alias,t.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>{A(e.alias),_(!0)},disabled:!d,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${d?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),w[e.alias]&&(0,a.jsx)("button",{onClick:()=>T(e.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias)),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:M,disabled:u||0===Object.keys(w).length,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Save Mappings"]})})]}),!U&&(0,a.jsxs)("div",{className:"flex flex-col gap-1.5 px-1",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Intercepts Antigravity traffic via DNS redirect, letting you reroute models through OmniRoute."]}),(0,a.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted",children:[(0,a.jsx)("span",{children:"1. Generates SSL cert & adds to system keychain"}),(0,a.jsxs)("span",{children:["2. Redirects"," ",(0,a.jsx)("code",{className:"text-[10px] bg-surface px-1 rounded",children:"daily-cloudcode-pa.googleapis.com"})," ","→ localhost"]}),(0,a.jsx)("span",{children:"3. Maps Antigravity models to any provider via OmniRoute"})]})]})]}),(0,a.jsx)(r.aF,{isOpen:g,onClose:()=>{y(!1),b(""),k(null)},title:"Sudo Password Required",size:"sm",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and DNS configuration"})]}),(0,a.jsx)(r.pd,{type:"password",placeholder:"Enter sudo password",value:f,onChange:e=>b(e.target.value),onKeyDown:e=>{"Enter"!==e.key||u||R()}}),v&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===v.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===v.type?"check_circle":"error"}),(0,a.jsx)("span",{children:v.text})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{y(!1),b(""),k(null)},disabled:u,children:"Cancel"}),(0,a.jsx)(r.$n,{variant:"primary",size:"sm",onClick:R,loading:u,children:"Confirm"})]})]})}),(0,a.jsx)(r.rq,{isOpen:S,onClose:()=>_(!1),onSelect:e=>{O&&C(t=>({...t,[O]:e.value}))},selectedModel:O?w[O]:null,activeProviders:c,title:`Select model for ${O}`})]})}s(41463).env.NEXT_PUBLIC_CLOUD_URL;let N=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function v({machineId:e}){let t,s,o,[c,m]=(0,l.useState)([]),[u,g]=(0,l.useState)(!0),[v,k]=(0,l.useState)(null),[w,C]=(0,l.useState)({}),[S,_]=(0,l.useState)(!1),[O,A]=(0,l.useState)([]);(0,l.useEffect)(()=>{P(),E(),I()},[]);let E=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let t=await e.json();_(t.cloudEnabled||!1)}}catch(e){console.log("Error loading cloud settings:",e)}},I=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let t=await e.json();A(t.keys||[])}}catch(e){console.log("Error fetching API keys:",e)}},P=async()=>{try{let e=await fetch("/api/providers"),t=await e.json();e.ok&&m(t.connections||[])}catch(e){console.log("Error fetching connections:",e)}finally{g(!1)}},$=()=>c.filter(e=>!1!==e.isActive),L=(0,l.useCallback)((e,t,s)=>{C(a=>a[e]?.[t]===s?a:{...a,[e]:{...a[e],[t]:s}})},[]);if(u)return(0,a.jsx)("div",{className:"flex flex-col gap-6",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{})]})});let R=(t=$(),s=[],o=new Set,t.forEach(e=>{let t=i.Xg[e.provider]||e.provider;(0,i.KC)(e.provider).forEach(a=>{let l=`${t}/${a.id}`;o.has(l)||(o.add(l),s.push({value:l,label:`${t}/${a.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:a.id}))})}),s).length>0;return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[!R&&(0,a.jsx)(r.Zp,{className:"border-yellow-500/50 bg-yellow-500/5",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"No active providers"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Please add and connect providers first to configure CLI tools."})]})]})}),(0,a.jsx)("div",{className:"flex flex-col gap-4",children:Object.entries(n).map(([e,t])=>((e,t)=>{let s={tool:t,isExpanded:v===e,onToggle:()=>k(v===e?null:e),baseUrl:S&&N?N:window.location.origin,apiKeys:O};switch(e){case"claude":return(0,a.jsx)(d,{...s,activeProviders:$(),modelMappings:w[e]||{},onModelMappingChange:(t,s)=>L(e,t,s),hasActiveProviders:R,cloudEnabled:S},e);case"codex":return(0,a.jsx)(x,{...s,activeProviders:$(),cloudEnabled:S},e);case"droid":return(0,a.jsx)(p,{...s,activeProviders:$(),hasActiveProviders:R,cloudEnabled:S},e);case"openclaw":return(0,a.jsx)(h,{...s,activeProviders:$(),hasActiveProviders:R,cloudEnabled:S},e);case"antigravity":return(0,a.jsx)(j,{...s,activeProviders:$(),hasActiveProviders:R,cloudEnabled:S},e);case"cline":return(0,a.jsx)(y,{...s,activeProviders:$(),hasActiveProviders:R,cloudEnabled:S},e);case"kilo":return(0,a.jsx)(f,{...s,activeProviders:$(),hasActiveProviders:R,cloudEnabled:S},e);default:return(0,a.jsx)(b,{toolId:e,...s,activeProviders:$(),cloudEnabled:S},e)}})(e,t))})]})}},46556:(e,t,s)=>{Promise.resolve().then(s.bind(s,9958))}},e=>{e.O(0,[8500,600,8013,7896,1525,8441,3794,7358],()=>e(e.s=46556)),_N_E=e.O()}]);
|
|
15
|
+
`},{filename:"~/.codex/auth.json",content:JSON.stringify({OPENAI_API_KEY:p},null,2)}])})]})}let m=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function p({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:i,apiKeys:c,activeProviders:d,cloudEnabled:x}){let p,u,h,g,[y,f]=(0,l.useState)(null),[b,j]=(0,l.useState)(!1),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)(null),[_,O]=(0,l.useState)(""),[A,E]=(0,l.useState)(""),[I,P]=(0,l.useState)(!1),[$,L]=(0,l.useState)({}),[R,T]=(0,l.useState)(!1),[M,U]=(0,l.useState)(""),K=(0,l.useRef)(!1),[F,z]=(0,l.useState)([]),[D,B]=(0,l.useState)(!1),[H,J]=(0,l.useState)(null),q=!!(y?.installed&&y?.runnable),W=(()=>{if(!q)return null;let e=y.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id);if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=x&&m&&e.baseUrl?.startsWith(m);return t||s?"configured":"other"})();(0,l.useEffect)(()=>{c?.length>0&&!_&&O(c[0].key)},[c,_]),(0,l.useEffect)(()=>{t&&!y&&(Z(),G(),Q())},[t,y]);let G=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&L(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(y?.installed&&!K.current){K.current=!0;let e=y.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id);e&&(e.model&&E(e.model),e.apiKey&&c?.some(t=>t.key===e.apiKey)&&O(e.apiKey))}},[y,c]);let Z=async()=>{j(!0);try{let e=await fetch("/api/cli-tools/droid-settings"),t=await e.json();f(t)}catch(e){f({installed:!1,error:e.message})}finally{j(!1)}},V=()=>{let e=M||n;return e.endsWith("/v1")?e:`${e}/v1`},X=async()=>{v(!0),S(null);try{let e=_?.trim()||(c?.length>0?c[0].key:null)||(x?null:"sk_omniroute"),t=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:V(),apiKey:e,model:A})}),s=await t.json();t.ok?(S({type:"success",text:"Settings applied successfully!"}),Z()):S({type:"error",text:s.error||"Failed to apply settings"})}catch(e){S({type:"error",text:e.message})}finally{v(!1)}},Y=async()=>{w(!0),S(null);try{let e=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),t=await e.json();e.ok?(S({type:"success",text:"Settings reset successfully!"}),E(""),O(""),Z()):S({type:"error",text:t.error||"Failed to reset settings"})}catch(e){S({type:"error",text:e.message})}finally{w(!1)}},Q=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=droid"),t=await e.json();e.ok&&z(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},ee=async e=>{J(e),S(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"droid",backupId:e})}),s=await t.json();t.ok?(S({type:"success",text:"Backup restored!"}),Z(),Q()):S({type:"error",text:s.error||"Failed to restore"})}catch(e){S({type:"error",text:e.message})}finally{J(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/droid.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===W&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===W&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===W&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[b&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Factory Droid CLI..."})]}),!b&&y&&!q&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:y.installed?"Factory Droid CLI not runnable":"Factory Droid CLI not installed"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:y.installed?`Factory Droid CLI was found but failed runtime healthcheck${y.reason?` (${y.reason})`:""}.`:"Please install Factory Droid CLI to use this feature."})]})]}),!b&&q&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[y?.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id)?.baseUrl&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:y.settings.customModels.find(e=>"custom:OmniRoute-0"===e.id).baseUrl})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(p=M||n).endsWith("/v1")?p:`${p}/v1`,onChange:e=>U(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),M&&M!==n&&(0,a.jsx)("button",{onClick:()=>U(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),c.length>0?(0,a.jsx)("select",{value:_,onChange:e=>O(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:c.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_omniroute (default)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:A,onChange:e=>E(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>P(!0),disabled:!i,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),A&&(0,a.jsx)("button",{onClick:()=>E(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),C&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===C.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===C.type?"check_circle":"error"}),(0,a.jsx)("span",{children:C.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:X,disabled:!A,loading:N,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:Y,disabled:!y?.hasOmniRoute,loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>T(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{B(!D),D||Q()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),"Backups",F.length>0&&` (${F.length})`]})]}),D&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),"Config Backups"]}),0===F.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No backups yet. Backups are created automatically before each Apply or Reset."}):(0,a.jsx)("div",{className:"space-y-1.5",children:F.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>ee(e.id),disabled:H===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:H===e.id?"...":"Restore"})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:I,onClose:()=>P(!1),onSelect:e=>{E(e.value),P(!1)},selectedModel:A,activeProviders:d,modelAliases:$,title:"Select Model for Factory Droid"}),(0,a.jsx)(r.uR,{isOpen:R,onClose:()=>T(!1),title:"Factory Droid - Manual Configuration",configs:(u=_&&_.trim()?_:x?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",h={customModels:[{model:A||"provider/model-id",id:"custom:OmniRoute-0",index:0,baseUrl:V(),apiKey:u,displayName:A||"provider/model-id",maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}]},g="u">typeof navigator&&navigator.platform,[{filename:g?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(h,null,2)}])})]})}let u=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function h({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:i,apiKeys:c,activeProviders:d,cloudEnabled:x}){let m,p,[h,g]=(0,l.useState)(null),[y,f]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!1),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(null),[C,S]=(0,l.useState)(""),[_,O]=(0,l.useState)(""),[A,E]=(0,l.useState)(!1),[I,P]=(0,l.useState)({}),[$,L]=(0,l.useState)(!1),[R,T]=(0,l.useState)(""),M=(0,l.useRef)(!1),[U,K]=(0,l.useState)([]),[F,z]=(0,l.useState)(!1),[D,B]=(0,l.useState)(null),H=!!(h?.installed&&h?.runnable),J=(()=>{if(!H)return null;let e=h.settings?.models?.providers?.omniroute;if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=x&&u&&e.baseUrl?.startsWith(u);return t||s?"configured":"other"})();(0,l.useEffect)(()=>{c?.length>0&&!C&&S(c[0].key)},[c,C]),(0,l.useEffect)(()=>{t&&!h&&(W(),q(),X())},[t,h]);let q=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&P(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(h?.installed&&!M.current){M.current=!0;let e=h.settings?.models?.providers?.omniroute;if(e){let t=h.settings?.agents?.defaults?.model?.primary;t&&O(t.replace("omniroute/","")),e.apiKey&&c?.some(t=>t.key===e.apiKey)&&S(e.apiKey)}}},[h,c]);let W=async()=>{f(!0);try{let e=await fetch("/api/cli-tools/openclaw-settings"),t=await e.json();g(t)}catch(e){g({installed:!1,error:e.message})}finally{f(!1)}},G=()=>{let e=R||n;return e.endsWith("/v1")?e:`${e}/v1`},Z=async()=>{j(!0),w(null);try{let e=C?.trim()||(c?.length>0?c[0].key:null)||(x?null:"sk_omniroute"),t=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:G(),apiKey:e,model:_})}),s=await t.json();t.ok?(w({type:"success",text:"Settings applied successfully!"}),W()):w({type:"error",text:s.error||"Failed to apply settings"})}catch(e){w({type:"error",text:e.message})}finally{j(!1)}},V=async()=>{v(!0),w(null);try{let e=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),t=await e.json();e.ok?(w({type:"success",text:"Settings reset successfully!"}),O(""),S(""),W()):w({type:"error",text:t.error||"Failed to reset settings"})}catch(e){w({type:"error",text:e.message})}finally{v(!1)}},X=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=openclaw"),t=await e.json();e.ok&&K(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},Y=async e=>{B(e),w(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"openclaw",backupId:e})}),s=await t.json();t.ok?(w({type:"success",text:"Backup restored!"}),W(),X()):w({type:"error",text:s.error||"Failed to restore"})}catch(e){w({type:"error",text:e.message})}finally{B(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/openclaw.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===J&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===J&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===J&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[y&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Open Claw CLI..."})]}),!y&&h&&!H&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:h.installed?"Open Claw CLI not runnable":"Open Claw CLI not installed"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:h.installed?`Open Claw CLI was found but failed runtime healthcheck${h.reason?` (${h.reason})`:""}.`:"Please install Open Claw CLI to use this feature."})]})]}),!y&&H&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[h?.settings?.models?.providers?.omniroute?.baseUrl&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:h.settings.models.providers.omniroute.baseUrl})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(m=R||n).endsWith("/v1")?m:`${m}/v1`,onChange:e=>T(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),R&&R!==n&&(0,a.jsx)("button",{onClick:()=>T(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),c.length>0?(0,a.jsx)("select",{value:C,onChange:e=>S(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:c.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_omniroute (default)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:_,onChange:e=>O(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>E(!0),disabled:!i,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),_&&(0,a.jsx)("button",{onClick:()=>O(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),k&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===k.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===k.type?"check_circle":"error"}),(0,a.jsx)("span",{children:k.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:Z,disabled:!_,loading:b,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:V,disabled:!h?.hasOmniRoute,loading:N,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>L(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{z(!F),F||X()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),"Backups",U.length>0&&` (${U.length})`]})]}),F&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),"Config Backups"]}),0===U.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No backups yet. Backups are created automatically before each Apply or Reset."}):(0,a.jsx)("div",{className:"space-y-1.5",children:U.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>Y(e.id),disabled:D===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:D===e.id?"...":"Restore"})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:A,onClose:()=>E(!1),onSelect:e=>{O(e.value),E(!1)},selectedModel:_,activeProviders:d,modelAliases:I,title:"Select Model for Open Claw"}),(0,a.jsx)(r.uR,{isOpen:$,onClose:()=>L(!1),title:"Open Claw - Manual Configuration",configs:(p=C&&C.trim()?C:x?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`omniroute/${_||"provider/model-id"}`}}},models:{providers:{omniroute:{baseUrl:G(),apiKey:p,api:"openai-completions",models:[{id:_||"provider/model-id",name:(_||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}let g=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function y({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:i,apiKeys:c,activeProviders:d,cloudEnabled:x}){let[m,p]=(0,l.useState)(null),[u,h]=(0,l.useState)(!1),[y,f]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!1),[N,v]=(0,l.useState)(null),[k,w]=(0,l.useState)(""),[C,S]=(0,l.useState)(""),[_,O]=(0,l.useState)(!1),[A,E]=(0,l.useState)({}),[I,P]=(0,l.useState)(!1),[$,L]=(0,l.useState)(""),R=(0,l.useRef)(!1),[T,M]=(0,l.useState)([]),[U,K]=(0,l.useState)(!1),[F,z]=(0,l.useState)(null),D=!!(m?.installed&&m?.runnable),B=(()=>{if(!D)return null;if(!m.hasOmniRoute)return"not_configured";let e=m.settings?.openAiBaseUrl||"",t=e.includes("localhost")||e.includes("127.0.0.1"),s=x&&g&&e.startsWith(g);return t||s?"configured":"other"})();(0,l.useEffect)(()=>{c?.length>0&&!k&&w(c[0].key)},[c,k]),(0,l.useEffect)(()=>{t&&!m&&(W(),H(),J())},[t,m]),(0,l.useEffect)(()=>{if(m?.settings&&!R.current){let e=m.settings.openAiModelId;e&&(S(e),R.current=!0)}},[m]);let H=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let t=await e.json();E(t.aliases||{})}}catch{}},J=async()=>{try{let e=await fetch("/api/cli-tools/backups?toolId=cline");if(e.ok){let t=await e.json();M(t.backups||[])}}catch{}},q=async e=>{z(e);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolId:"cline",backupId:e})});if(t.ok)v({type:"success",text:"Backup restored! Reloading status..."}),await W(),await J();else{let e=await t.json();v({type:"error",text:e.error||"Failed to restore backup"})}}catch(e){v({type:"error",text:e.message})}finally{z(null)}},W=async()=>{h(!0);try{let e=await fetch("/api/cli-tools/cline-settings"),t=await e.json();p(t)}catch(e){p({error:e.message})}finally{h(!1)}},G=async()=>{f(!0),v(null);try{let e=$||n||"http://localhost:20128",t=e.endsWith("/v1")?e:`${e}/v1`,s=await fetch("/api/cli-tools/cline-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:t,apiKey:k||"sk_omniroute",model:C})}),a=await s.json();s.ok?(v({type:"success",text:a.message||"Applied!"}),await W(),await J()):v({type:"error",text:a.error||"Failed"})}catch(e){v({type:"error",text:e.message})}finally{f(!1)}},Z=async()=>{j(!0),v(null);try{let e=await fetch("/api/cli-tools/cline-settings",{method:"DELETE"}),t=await e.json();e.ok?(v({type:"success",text:t.message||"Reset!"}),S(""),R.current=!1,await W(),await J()):v({type:"error",text:t.error||"Failed"})}catch(e){v({type:"error",text:e.message})}finally{j(!1)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:e.image?(0,a.jsx)(o.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:e.color},children:"terminal"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(()=>{if(!D)return null;let e={configured:{class:"bg-green-500/10 text-green-600 dark:text-green-400",text:"Connected"},not_configured:{class:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",text:"Not configured"},other:{class:"bg-blue-500/10 text-blue-600 dark:text-blue-400",text:"Custom config"}}[B];return e?(0,a.jsx)("span",{className:`px-1.5 py-0.5 text-[10px] font-medium rounded-full ${e.class}`,children:e.text}):null})()]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[u&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Cline CLI..."})]}),m&&!u&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${D?"text-green-500":"text-yellow-500"}`,children:D?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:D?"Cline CLI detected and ready":m.installed?"Cline CLI installed but not runnable":"Cline CLI not detected"}),m.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Binary:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:m.commandPath})]}),m.globalStatePath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Config:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:m.globalStatePath})]})]})]}),D&&(0,a.jsxs)(a.Fragment,{children:["configured"===B&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:"OmniRoute is configured as OpenAI-compatible provider"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Provider: ",(0,a.jsx)("strong",{children:"openai"})," • Model:"," ",(0,a.jsx)("strong",{children:m.settings?.openAiModelId||"—"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:"Model"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:C,onChange:e=>S(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)(r.$n,{variant:"outline",size:"sm",onClick:()=>O(!0),disabled:!i,children:"Select"}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>P(!0),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:"API Key"}),c&&c.length>0?(0,a.jsx)("select",{value:k,onChange:e=>w(e.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:c.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x?"No API keys available":"Using default: sk_omniroute"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:G,disabled:!C,loading:y,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===B?"Update Config":"Apply Config"]}),"configured"===B&&(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:Z,loading:b,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),"Reset"]})]}),N&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===N.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===N.type?"check_circle":"error"}),(0,a.jsx)("span",{children:N.text})]}),(0,a.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,a.jsxs)("button",{onClick:()=>K(!U),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${U?"rotate-90":""}`,children:"chevron_right"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),"Backups ",T.length>0&&`(${T.length})`]}),U&&T.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:T.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-medium",children:e.originalFile}),(0,a.jsx)("span",{className:"text-text-muted",children:new Date(e.createdAt).toLocaleString()})]}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>q(e.id),loading:F===e.id,children:"Restore"})]},e.id))}),U&&0===T.length&&(0,a.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:"No backups available."})]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:_,onClose:()=>O(!1),onSelect:e=>{S(e.value),O(!1)},selectedModel:C,activeProviders:d,title:"Select Model for Cline"}),(0,a.jsx)(r.uR,{isOpen:I,onClose:()=>P(!1),onApply:e=>{e.model&&S(e.model),e.apiKey&&w(e.apiKey),e.baseUrl&&L(e.baseUrl),P(!1)},currentConfig:{model:C,apiKey:k,baseUrl:$||n},title:"Cline Manual Configuration"})]})}function f({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:i,apiKeys:c,activeProviders:d,cloudEnabled:x}){let[m,p]=(0,l.useState)(null),[u,h]=(0,l.useState)(!1),[g,y]=(0,l.useState)(!1),[f,b]=(0,l.useState)(!1),[j,N]=(0,l.useState)(null),[v,k]=(0,l.useState)(""),[w,C]=(0,l.useState)(""),[S,_]=(0,l.useState)(!1),[O,A]=(0,l.useState)({}),[E,I]=(0,l.useState)(!1),[P,$]=(0,l.useState)(""),L=(0,l.useRef)(!1),[R,T]=(0,l.useState)([]),[M,U]=(0,l.useState)(!1),[K,F]=(0,l.useState)(null),z=!!(m?.installed&&m?.runnable),D=z?m.hasOmniRoute?"configured":"not_configured":null;(0,l.useEffect)(()=>{c?.length>0&&!v&&k(c[0].key)},[c,v]),(0,l.useEffect)(()=>{t&&!m&&(q(),B(),H())},[t,m]);let B=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let t=await e.json();A(t.aliases||{})}}catch{}},H=async()=>{try{let e=await fetch("/api/cli-tools/backups?toolId=kilo");if(e.ok){let t=await e.json();T(t.backups||[])}}catch{}},J=async e=>{F(e);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolId:"kilo",backupId:e})});if(t.ok)N({type:"success",text:"Backup restored! Reloading status..."}),await q(),await H();else{let e=await t.json();N({type:"error",text:e.error||"Failed to restore backup"})}}catch(e){N({type:"error",text:e.message})}finally{F(null)}},q=async()=>{h(!0);try{let e=await fetch("/api/cli-tools/kilo-settings"),t=await e.json();p(t)}catch(e){p({error:e.message})}finally{h(!1)}},W=async()=>{y(!0),N(null);try{let e=P||n||"http://localhost:20128",t=e.endsWith("/v1")?e:`${e}/v1`,s=await fetch("/api/cli-tools/kilo-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:t,apiKey:v||"sk_omniroute",model:w})}),a=await s.json();s.ok?(N({type:"success",text:a.message||"Applied!"}),await q(),await H()):N({type:"error",text:a.error||"Failed"})}catch(e){N({type:"error",text:e.message})}finally{y(!1)}},G=async()=>{b(!0),N(null);try{let e=await fetch("/api/cli-tools/kilo-settings",{method:"DELETE"}),t=await e.json();e.ok?(N({type:"success",text:t.message||"Reset!"}),C(""),L.current=!1,await q(),await H()):N({type:"error",text:t.error||"Failed"})}catch(e){N({type:"error",text:e.message})}finally{b(!1)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:e.image?(0,a.jsx)(o.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:e.color},children:"terminal"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(()=>{if(!z)return null;let e={configured:{class:"bg-green-500/10 text-green-600 dark:text-green-400",text:"Connected"},not_configured:{class:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",text:"Not configured"}}[D];return e?(0,a.jsx)("span",{className:`px-1.5 py-0.5 text-[10px] font-medium rounded-full ${e.class}`,children:e.text}):null})()]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[u&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Kilo Code CLI..."})]}),m&&!u&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${z?"text-green-500":"text-yellow-500"}`,children:z?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:z?"Kilo Code CLI detected and ready":m.installed?"Kilo Code CLI installed but not runnable":"Kilo Code CLI not detected"}),m.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Binary:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:m.commandPath})]}),m.authPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Auth:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:m.authPath})]})]})]}),z&&(0,a.jsxs)(a.Fragment,{children:["configured"===D&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:"OmniRoute is configured as OpenAI-compatible provider"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Providers: ",(0,a.jsx)("strong",{children:m.settings?.auth?.join(", ")||"—"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:"Model"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:w,onChange:e=>C(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)(r.$n,{variant:"outline",size:"sm",onClick:()=>_(!0),disabled:!i,children:"Select"}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>I(!0),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:"API Key"}),c&&c.length>0?(0,a.jsx)("select",{value:v,onChange:e=>k(e.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:c.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x?"No API keys available":"Using default: sk_omniroute"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:W,disabled:!w,loading:g,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===D?"Update Config":"Apply Config"]}),"configured"===D&&(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:G,loading:f,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),"Reset"]})]}),j&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===j.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===j.type?"check_circle":"error"}),(0,a.jsx)("span",{children:j.text})]}),(0,a.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,a.jsxs)("button",{onClick:()=>U(!M),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${M?"rotate-90":""}`,children:"chevron_right"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),"Backups ",R.length>0&&`(${R.length})`]}),M&&R.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:R.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-medium",children:e.originalFile}),(0,a.jsx)("span",{className:"text-text-muted",children:new Date(e.createdAt).toLocaleString()})]}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>J(e.id),loading:K===e.id,children:"Restore"})]},e.id))}),M&&0===R.length&&(0,a.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:"No backups available."})]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:S,onClose:()=>_(!1),onSelect:e=>{C(e.value),_(!1)},selectedModel:w,activeProviders:d,title:"Select Model for Kilo Code"}),(0,a.jsx)(r.uR,{isOpen:E,onClose:()=>I(!1),onApply:e=>{e.model&&C(e.model),e.apiKey&&k(e.apiKey),e.baseUrl&&$(e.baseUrl),I(!1)},currentConfig:{model:w,apiKey:v,baseUrl:P||n},title:"Kilo Code Manual Configuration"})]})}function b({toolId:e,tool:t,isExpanded:s,onToggle:n,baseUrl:i,apiKeys:c,activeProviders:d=[],cloudEnabled:x=!1}){let[m,p]=(0,l.useState)(null),[u,h]=(0,l.useState)(!1),[g,y]=(0,l.useState)(""),[f,b]=(0,l.useState)(null),[j,N]=(0,l.useState)(null),[v,k]=(0,l.useState)(!1),w=(0,l.useRef)(!1),[C,S]=(0,l.useState)(()=>c?.length>0?c[0].key:"");(0,l.useEffect)(()=>{let t=localStorage.getItem(`omniroute-cli-model-${e}`);t&&y(t);let s=localStorage.getItem(`omniroute-cli-key-${e}`);s&&c?.some(e=>e.key===s)&&S(s)},[e,c]);let _=(0,l.useCallback)(t=>{y(t),t?localStorage.setItem(`omniroute-cli-model-${e}`,t):localStorage.removeItem(`omniroute-cli-model-${e}`)},[e]),O=(0,l.useCallback)(t=>{S(t),t&&localStorage.setItem(`omniroute-cli-key-${e}`,t)},[e]);(0,l.useEffect)(()=>{!s||f||w.current||(w.current=!0,fetch(`/api/cli-tools/runtime/${e}`).then(e=>e.json()).then(e=>b(e)).catch(e=>b({error:e?.message||"runtime_check_failed"})))},[s,f,e]);let A=e=>{let t=C&&C.trim()?C:x?"your-api-key":"sk_omniroute",s=i||"http://localhost:20128",a=s.endsWith("/v1")?s:`${s}/v1`;return e.replace(/\{\{baseUrl\}\}/g,a).replace(/\{\{apiKey\}\}/g,t).replace(/\{\{model\}\}/g,g||"provider/model-id")},E=async(e,t)=>{await navigator.clipboard.writeText(A(e)),p(t),setTimeout(()=>p(null),2e3)},I=d.length>0,P=s&&null===f,$=async()=>{k(!0),N(null);try{let t=C&&C.trim()?C:x?"":"sk_omniroute",s=i||"http://localhost:20128",a=s.endsWith("/v1")?s:`${s}/v1`,l=await fetch(`/api/cli-tools/guide-settings/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:a,apiKey:t,model:g})}),r=await l.json();l.ok?N({type:"success",text:r.message||"Configuration saved!"}):N({type:"error",text:r.error||"Failed to save"})}catch(e){N({type:"error",text:e.message})}finally{k(!1)}},L=["continue"].includes(e),R=()=>!t.requiresCloud||!!x;return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:n,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:t.image?(0,a.jsx)(o.default,{src:t.image,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):t.icon?(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:t.color},children:t.icon}):(0,a.jsx)(o.default,{src:`/providers/${e}.png`,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:t.name}),f&&!f.error&&(0,a.jsx)("span",{className:`px-1.5 py-0.5 text-[10px] font-medium rounded-full ${"not_required"===f.reason?"bg-blue-500/10 text-blue-600 dark:text-blue-400":f.installed&&f.runnable?"bg-green-500/10 text-green-600 dark:text-green-400":"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"}`,children:"not_required"===f.reason?"Guide":f.installed&&f.runnable?"Detected":"Not ready"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:t.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${s?"rotate-180":""}`,children:"expand_more"})]}),s&&(0,a.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:t.guideSteps?(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[P&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking runtime..."})]}),!P&&f&&!f.error&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"not_required"===f.reason?"info":f.installed&&f.runnable?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"not_required"===f.reason?"Guide-only integration: no local binary required":f.installed&&f.runnable?"CLI runtime detected and healthy":f.installed?`CLI found but not runnable${f.reason?` (${f.reason})`:""}`:"CLI runtime not detected"}),f.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Binary:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.commandPath})]}),f.configPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Config path:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.configPath})]})]})]}),!P&&f?.error&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500 text-lg",children:"error"}),(0,a.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:"Failed to check runtime status."})]}),t.notes&&0!==t.notes.length?(0,a.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:t.notes.map((e,t)=>{if("cloudCheck"===e.type&&x)return null;let s="warning"===e.type,l="cloudCheck"===e.type&&!x,r="bg-blue-500/10 border-blue-500/30",n="text-blue-600 dark:text-blue-400",i="text-blue-500",o="info";return s?(r="bg-yellow-500/10 border-yellow-500/30",n="text-yellow-600 dark:text-yellow-400",i="text-yellow-500",o="warning"):l&&(r="bg-red-500/10 border-red-500/30",n="text-red-600 dark:text-red-400",i="text-red-500",o="error"),(0,a.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${r}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${i}`,children:o}),(0,a.jsx)("p",{className:`text-sm ${n}`,children:e.text})]},t)})}):null,R()&&t.guideSteps.map(e=>(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:t.color},children:e.step}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-text",children:e.title}),e.desc&&(0,a.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:e.desc}),"apiKeySelector"===e.type&&(0,a.jsx)("div",{className:"mt-2 flex items-center gap-2",children:c&&c.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("select",{value:C,onChange:e=>O(e.target.value),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:c.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}),(0,a.jsx)("button",{onClick:()=>E(C,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===m?"check":"content_copy"})})]}):(0,a.jsx)("span",{className:"text-sm text-text-muted",children:x?"No API keys - Create one in Keys page":"sk_omniroute"})}),"modelSelector"===e.type&&(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:g,onChange:e=>_(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>h(!0),disabled:!I,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${I?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),g&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:()=>E(g,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===m?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>_(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),e.value&&(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,a.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:A(e.value)}),e.copyable&&(0,a.jsx)("button",{onClick:()=>E(e.value,`${e.step}-${e.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:m===`${e.step}-${e.title}`?"check":"content_copy"})})]})]})]},e.step)),R()&&t.codeBlock&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:t.codeBlock.language}),(0,a.jsxs)("button",{onClick:()=>E(t.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===m?"check":"content_copy"}),"codeblock"===m?"Copied!":"Copy"]})]}),(0,a.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,a.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:A(t.codeBlock.code)})})]}),R()&&(0,a.jsxs)("div",{className:"mt-2",children:[j&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs mb-2 ${"success"===j.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===j.type?"check_circle":"error"}),(0,a.jsx)("span",{children:j.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[L&&(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:$,disabled:!g,loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Save Config"]}),t.codeBlock&&(0,a.jsxs)(r.$n,{variant:L?"outline":"primary",size:"sm",onClick:()=>E(t.codeBlock.code,"codeblock"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"codeblock"===m?"check":"content_copy"}),"codeblock"===m?"Copied!":"Copy Config"]}),g&&(0,a.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-green-500",children:"check_circle"}),"Selection saved"]})]})]})]}):(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,a.jsx)(r.rq,{isOpen:u,onClose:()=>h(!1),onSelect:e=>{_(e.value)},selectedModel:g,activeProviders:d,title:"Select Model"})]})}function j({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:i,activeProviders:c,hasActiveProviders:d,cloudEnabled:x}){let[m,p]=(0,l.useState)(null),[u,h]=(0,l.useState)(!1),[g,y]=(0,l.useState)(!1),[f,b]=(0,l.useState)(""),[j,N]=(0,l.useState)(""),[v,k]=(0,l.useState)(null),[w,C]=(0,l.useState)({}),[S,_]=(0,l.useState)(!1),[O,A]=(0,l.useState)(null);(0,l.useEffect)(()=>{i?.length>0&&!j&&N(i[0].key)},[i,j]),(0,l.useEffect)(()=>{t&&!m&&(I(),E())},[t,m]);let E=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm/alias?tool=antigravity");if(e.ok){let t=(await e.json()).aliases||{};Object.keys(t).length>0&&C(t)}}catch(e){console.log("Error loading saved mappings:",e)}},I=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm");if(e.ok){let t=await e.json();p(t)}}catch(e){console.log("Error fetching status:",e),p({running:!1})}},P="u">typeof navigator&&navigator.userAgent?.includes("Windows"),$=async e=>{h(!0),k(null);try{let t=j?.trim()||(i?.length>0?i[0].key:null)||(x?null:"sk_omniroute"),s=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t,sudoPassword:e})}),a=await s.json();s.ok?(k({type:"success",text:"MITM started"}),y(!1),b(""),I()):k({type:"error",text:a.error||"Failed to start"})}catch(e){k({type:"error",text:e.message})}finally{h(!1)}},L=async e=>{h(!0),k(null);try{let t=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:e})}),s=await t.json();t.ok?(k({type:"success",text:"MITM stopped"}),y(!1),b(""),I()):k({type:"error",text:s.error||"Failed to stop"})}catch(e){k({type:"error",text:e.message})}finally{h(!1)}},R=()=>{f.trim()?m?.running?L(f):$(f):k({type:"error",text:"Sudo password is required"})},T=(e,t)=>{C(s=>({...s,[e]:t}))},M=async()=>{h(!0),k(null);try{let e=await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"antigravity",mappings:w})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to save mappings")}k({type:"success",text:"Mappings saved!"})}catch(e){k({type:"error",text:e.message})}finally{h(!1)}},U=m?.running;return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/antigravity.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),U?(0,a.jsx)(r.Ex,{variant:"success",size:"sm",children:"Active"}):(0,a.jsx)(r.Ex,{variant:"default",size:"sm",children:"Inactive"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"flex items-center gap-2",children:U?(0,a.jsxs)("button",{onClick:()=>{P||m?.hasCachedPassword?L(""):(y(!0),k(null))},disabled:u,className:"px-4 py-2 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-sm flex items-center gap-2 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"stop_circle"}),"Stop MITM"]}):(0,a.jsxs)("button",{onClick:()=>{P||m?.hasCachedPassword?$(""):(y(!0),k(null))},disabled:u||!d,className:"px-4 py-2 rounded-lg bg-primary/10 border border-primary/30 text-primary font-medium text-sm flex items-center gap-2 hover:bg-primary/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"play_circle"}),"Start MITM"]})}),v?.type==="error"&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,a.jsx)("span",{children:v.text})]}),U&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),i.length>0?(0,a.jsx)("select",{value:j,onChange:e=>N(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:i.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_omniroute (default)"})]}),e.defaultModels.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:e.name}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:w[e.alias]||"",onChange:t=>T(e.alias,t.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>{A(e.alias),_(!0)},disabled:!d,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${d?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),w[e.alias]&&(0,a.jsx)("button",{onClick:()=>T(e.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias)),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:M,disabled:u||0===Object.keys(w).length,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Save Mappings"]})})]}),!U&&(0,a.jsxs)("div",{className:"flex flex-col gap-1.5 px-1",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Intercepts Antigravity traffic via DNS redirect, letting you reroute models through OmniRoute."]}),(0,a.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted",children:[(0,a.jsx)("span",{children:"1. Generates SSL cert & adds to system keychain"}),(0,a.jsxs)("span",{children:["2. Redirects"," ",(0,a.jsx)("code",{className:"text-[10px] bg-surface px-1 rounded",children:"daily-cloudcode-pa.googleapis.com"})," ","→ localhost"]}),(0,a.jsx)("span",{children:"3. Maps Antigravity models to any provider via OmniRoute"})]})]})]}),(0,a.jsx)(r.aF,{isOpen:g,onClose:()=>{y(!1),b(""),k(null)},title:"Sudo Password Required",size:"sm",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and DNS configuration"})]}),(0,a.jsx)(r.pd,{type:"password",placeholder:"Enter sudo password",value:f,onChange:e=>b(e.target.value),onKeyDown:e=>{"Enter"!==e.key||u||R()}}),v&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===v.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===v.type?"check_circle":"error"}),(0,a.jsx)("span",{children:v.text})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{y(!1),b(""),k(null)},disabled:u,children:"Cancel"}),(0,a.jsx)(r.$n,{variant:"primary",size:"sm",onClick:R,loading:u,children:"Confirm"})]})]})}),(0,a.jsx)(r.rq,{isOpen:S,onClose:()=>_(!1),onSelect:e=>{O&&C(t=>({...t,[O]:e.value}))},selectedModel:O?w[O]:null,activeProviders:c,title:`Select model for ${O}`})]})}s(41463).env.NEXT_PUBLIC_CLOUD_URL;let N=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function v({machineId:e}){let t,s,o,[c,m]=(0,l.useState)([]),[u,g]=(0,l.useState)(!0),[v,k]=(0,l.useState)(null),[w,C]=(0,l.useState)({}),[S,_]=(0,l.useState)(!1),[O,A]=(0,l.useState)([]);(0,l.useEffect)(()=>{P(),E(),I()},[]);let E=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let t=await e.json();_(t.cloudEnabled||!1)}}catch(e){console.log("Error loading cloud settings:",e)}},I=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let t=await e.json();A(t.keys||[])}}catch(e){console.log("Error fetching API keys:",e)}},P=async()=>{try{let e=await fetch("/api/providers"),t=await e.json();e.ok&&m(t.connections||[])}catch(e){console.log("Error fetching connections:",e)}finally{g(!1)}},$=()=>c.filter(e=>!1!==e.isActive),L=(0,l.useCallback)((e,t,s)=>{C(a=>a[e]?.[t]===s?a:{...a,[e]:{...a[e],[t]:s}})},[]);if(u)return(0,a.jsx)("div",{className:"flex flex-col gap-6",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{})]})});let R=(t=$(),s=[],o=new Set,t.forEach(e=>{let t=i.Xg[e.provider]||e.provider;(0,i.KC)(e.provider).forEach(a=>{let l=`${t}/${a.id}`;o.has(l)||(o.add(l),s.push({value:l,label:`${t}/${a.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:a.id}))})}),s).length>0;return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[!R&&(0,a.jsx)(r.Zp,{className:"border-yellow-500/50 bg-yellow-500/5",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"No active providers"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Please add and connect providers first to configure CLI tools."})]})]})}),(0,a.jsx)("div",{className:"flex flex-col gap-4",children:Object.entries(n).map(([e,t])=>((e,t)=>{let s={tool:t,isExpanded:v===e,onToggle:()=>k(v===e?null:e),baseUrl:S&&N?N:window.location.origin,apiKeys:O};switch(e){case"claude":return(0,a.jsx)(d,{...s,activeProviders:$(),modelMappings:w[e]||{},onModelMappingChange:(t,s)=>L(e,t,s),hasActiveProviders:R,cloudEnabled:S},e);case"codex":return(0,a.jsx)(x,{...s,activeProviders:$(),cloudEnabled:S},e);case"droid":return(0,a.jsx)(p,{...s,activeProviders:$(),hasActiveProviders:R,cloudEnabled:S},e);case"openclaw":return(0,a.jsx)(h,{...s,activeProviders:$(),hasActiveProviders:R,cloudEnabled:S},e);case"antigravity":return(0,a.jsx)(j,{...s,activeProviders:$(),hasActiveProviders:R,cloudEnabled:S},e);case"cline":return(0,a.jsx)(y,{...s,activeProviders:$(),hasActiveProviders:R,cloudEnabled:S},e);case"kilo":return(0,a.jsx)(f,{...s,activeProviders:$(),hasActiveProviders:R,cloudEnabled:S},e);default:return(0,a.jsx)(b,{toolId:e,...s,activeProviders:$(),cloudEnabled:S},e)}})(e,t))})]})}},46556:(e,t,s)=>{Promise.resolve().then(s.bind(s,9958))}},e=>{e.O(0,[8500,9751,600,3191,7896,1525,8441,3794,7358],()=>e(e.s=46556)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{11313:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var a=s(95155),r=s(12115),l=s(71525),o=s(26853),i=s(45567);let n=/^[a-zA-Z0-9_/.-]+$/;function d(e){return"string"==typeof e?{model:e,weight:0}:{model:e.model,weight:e.weight||0}}function c(){let[e,t]=(0,r.useState)([]),[s,n]=(0,r.useState)(!0),[d,c]=(0,r.useState)(!1),[p,h]=(0,r.useState)(null),[b,g]=(0,r.useState)([]),[f,y]=(0,r.useState)({}),[v,j]=(0,r.useState)(null),[N,k]=(0,r.useState)(null),{copied:w,copy:C}=(0,o.C)(),S=(0,i.i)(),[$,M]=(0,r.useState)(null),[T,_]=(0,r.useState)(null);(0,r.useEffect)(()=>{P(),fetch("/api/settings/proxy").then(e=>e.ok?e.json():null).then(e=>_(e)).catch(()=>{})},[]);let P=async()=>{try{let[e,s,a]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/combos/metrics")]),r=await e.json(),l=await s.json(),o=await a.json();if(e.ok&&t(r.combos||[]),s.ok){let e=(l.connections||[]).filter(e=>"active"===e.testStatus||"success"===e.testStatus);g(e)}a.ok&&y(o.metrics||{})}catch(e){console.log("Error fetching data:",e)}finally{n(!1)}},E=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await P(),c(!1),S.success("Combo created successfully");else{let e=await t.json();S.error(e.error?.message||e.error||"Failed to create combo")}}catch(e){S.error("Error creating combo")}},O=async(e,t)=>{try{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.ok)await P(),h(null),S.success("Combo updated successfully");else{let e=await s.json();S.error(e.error?.message||e.error||"Failed to update combo")}}catch(e){S.error("Error updating combo")}},D=async s=>{if(confirm("Delete this combo?"))try{(await fetch(`/api/combos/${s}`,{method:"DELETE"})).ok&&(t(e.filter(e=>e.id!==s)),S.success("Combo deleted"))}catch(e){S.error("Error deleting combo")}},R=async t=>{let s=t.name.replace(/-copy(-\d+)?$/,""),a=e.map(e=>e.name),r=`${s}-copy`,l=1;for(;a.includes(r);)l++,r=`${s}-copy-${l}`;let o={name:r,models:t.models,strategy:t.strategy||"priority",config:t.config||{}};await E(o)},q=async e=>{k(e.name),j(null);try{let t=await fetch("/api/combos/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboName:e.name})}),s=await t.json();j(s)}catch(e){j({error:"Test request failed"}),S.error("Test request failed")}};return s?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(l.Qv,{}),(0,a.jsx)(l.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-semibold",children:"Combos"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Create model combos with weighted routing and fallback support"})]}),(0,a.jsx)(l.$n,{icon:"add",onClick:()=>c(!0),children:"Create Combo"})]}),0===e.length?(0,a.jsx)(l.pp,{icon:"\uD83E\uDDE9",title:"No combos yet",description:"Create model combos with weighted routing and fallback support",actionLabel:"Create Combo",onAction:()=>c(!0)}):(0,a.jsx)("div",{className:"flex flex-col gap-4",children:e.map(e=>(0,a.jsx)(m,{combo:e,metrics:f[e.name],copied:w,onCopy:C,onEdit:()=>h(e),onDelete:()=>D(e.id),onDuplicate:()=>R(e),onTest:()=>q(e),testing:N===e.name,onProxy:()=>M(e),hasProxy:!!T?.combos?.[e.id]},e.id))}),v&&(0,a.jsx)(l.aF,{isOpen:!!v,onClose:()=>{j(null),k(null)},title:`Test Results — ${N}`,children:(0,a.jsx)(x,{results:v})}),(0,a.jsx)(u,{isOpen:d,onClose:()=>c(!1),onSave:E,activeProviders:b},"create"),(0,a.jsx)(u,{isOpen:!!p,combo:p,onClose:()=>h(null),onSave:e=>O(p.id,e),activeProviders:b},p?.id||"new"),$&&(0,a.jsx)(l.KN,{isOpen:!!$,onClose:()=>M(null),level:"combo",levelId:$.id,levelLabel:$.name})]})}function m({combo:e,metrics:t,copied:s,onCopy:r,onEdit:o,onDelete:i,onDuplicate:n,onTest:c,testing:m,onProxy:x,hasProxy:u}){let p=e.strategy||"priority",h=e.models||[];return(0,a.jsx)(l.Zp,{padding:"sm",className:"group",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("code",{className:"text-sm font-medium font-mono truncate",children:e.name}),(0,a.jsx)("span",{className:`text-[9px] uppercase font-semibold px-1.5 py-0.5 rounded-full ${"weighted"===p?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"round-robin"===p?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"random"===p?"bg-purple-500/15 text-purple-600 dark:text-purple-400":"least-used"===p?"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400":"cost-optimized"===p?"bg-teal-500/15 text-teal-600 dark:text-teal-400":"bg-blue-500/15 text-blue-600 dark:text-blue-400"}`,children:p}),u&&(0,a.jsxs)("span",{className:"text-[9px] uppercase font-semibold px-1.5 py-0.5 rounded-full bg-primary/15 text-primary flex items-center gap-0.5",title:"Proxy configured",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"vpn_lock"}),"proxy"]}),(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),r(e.name,`combo-${e.id}`)},className:"p-0.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors opacity-0 group-hover:opacity-100",title:"Copy combo name",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:s===`combo-${e.id}`?"check":"content_copy"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[0===h.length?(0,a.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):h.slice(0,3).map((e,t)=>{let{model:s,weight:r}=d(e);return(0,a.jsxs)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1.5 py-0.5 rounded text-text-muted",children:[s,"weighted"===p&&r>0?` (${r}%)`:""]},t)}),h.length>3&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",h.length-3," more"]})]}),t&&(0,a.jsxs)("div",{className:"flex items-center gap-3 mt-1",children:[(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:[(0,a.jsx)("span",{className:"text-emerald-500",children:t.totalSuccesses}),"/",t.totalRequests," reqs"]}),(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:[t.successRate,"% success"]}),(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["~",t.avgLatencyMs,"ms"]}),t.fallbackRate>0&&(0,a.jsxs)("span",{className:"text-[10px] text-amber-500",children:[t.fallbackRate,"% fallback"]})]})]})]}),(0,a.jsxs)("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[(0,a.jsx)("button",{onClick:c,disabled:m,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-emerald-500 transition-colors",title:"Test combo",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${m?"animate-spin":""}`,children:m?"progress_activity":"play_arrow"})}),(0,a.jsx)("button",{onClick:n,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:"Duplicate",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"content_copy"})}),(0,a.jsx)("button",{onClick:x,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:"Proxy configuration",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"vpn_lock"})}),(0,a.jsx)("button",{onClick:o,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:"Edit",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})}),(0,a.jsx)("button",{onClick:i,className:"p-1.5 hover:bg-red-500/10 rounded text-red-500 transition-colors",title:"Delete",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]})})}function x({results:e}){return e.error?(0,a.jsxs)("div",{className:"flex items-center gap-2 text-red-500 text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),"string"==typeof e.error?e.error:JSON.stringify(e.error)]}):(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[e.resolvedBy&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-emerald-500 text-[18px]",children:"check_circle"}),(0,a.jsxs)("span",{children:["Resolved by:"," ",(0,a.jsx)("code",{className:"text-xs bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 px-1.5 py-0.5 rounded",children:e.resolvedBy})]})]}),e.results?.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs px-2 py-1.5 rounded bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${"ok"===e.status?"text-emerald-500":"skipped"===e.status?"text-text-muted":"text-red-500"}`,children:"ok"===e.status?"check_circle":"skipped"===e.status?"skip_next":"error"}),(0,a.jsx)("code",{className:"font-mono flex-1",children:e.model}),void 0!==e.latencyMs&&(0,a.jsxs)("span",{className:"text-text-muted",children:[e.latencyMs,"ms"]}),(0,a.jsx)("span",{className:`text-[10px] uppercase font-medium ${"ok"===e.status?"text-emerald-500":"skipped"===e.status?"text-text-muted":"text-red-500"}`,children:e.status})]},t))]})}function u({isOpen:e,combo:t,onClose:s,onSave:o,activeProviders:i}){let[c,m]=(0,r.useState)(t?.name||""),[x,u]=(0,r.useState)(()=>(t?.models||[]).map(e=>d(e))),[h,b]=(0,r.useState)(t?.strategy||"priority"),[g,f]=(0,r.useState)(!1),[y,v]=(0,r.useState)(!1),[j,N]=(0,r.useState)(""),[k,w]=(0,r.useState)({}),[C,S]=(0,r.useState)([]),[$,M]=(0,r.useState)(!1),[T,_]=(0,r.useState)(t?.config||{}),[P,E]=(0,r.useState)(null),[O,D]=(0,r.useState)(null),R=async()=>{try{let[e,t]=await Promise.all([fetch("/api/models/alias"),fetch("/api/provider-nodes")]);if(!e.ok||!t.ok)throw Error(`Failed to fetch data: aliases=${e.status}, nodes=${t.status}`);let[s,a]=await Promise.all([e.json(),t.json()]);w(s.aliases||{}),S(a.nodes||[])}catch(e){console.error("Error fetching modal data:",e)}};(0,r.useEffect)(()=>{e&&R()},[e]);let q=e=>e.trim()?n.test(e)?(N(""),!0):(N("Only letters, numbers, -, _, / and . allowed"),!1):(N("Name is required"),!1),A=(0,r.useCallback)(e=>{let t=e.split("/");if(2!==t.length)return e;let[s,a]=t,r=C.find(e=>e.id===s);return r?`${r.name}/${a}`:e},[C]),z=e=>{e.target&&(e.target.style.opacity="1"),E(null),D(null)},L=async()=>{if(!q(c))return;v(!0);let e={name:c.trim(),models:"weighted"===h?x:x.map(e=>e.model),strategy:h},t={...T};"round-robin"===h&&(void 0!==T.concurrencyPerModel&&(t.concurrencyPerModel=T.concurrencyPerModel),void 0!==T.queueTimeoutMs&&(t.queueTimeoutMs=T.queueTimeoutMs)),Object.keys(t).length>0&&(e.config=t),await o(e),v(!1)},F=!!t;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.aF,{isOpen:e,onClose:s,title:F?"Edit Combo":"Create Combo",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(l.pd,{label:"Combo Name",value:c,onChange:e=>{let t=e.target.value;m(t),t?q(t):N("")},placeholder:"my-combo",error:j}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Letters, numbers, -, _, / and . allowed"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Routing Strategy"}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-1 p-0.5 bg-black/5 dark:bg-white/5 rounded-lg",children:[{value:"priority",label:"Priority",icon:"sort"},{value:"weighted",label:"Weighted",icon:"percent"},{value:"round-robin",label:"Round-Robin",icon:"autorenew"},{value:"random",label:"Random",icon:"shuffle"},{value:"least-used",label:"Least-Used",icon:"low_priority"},{value:"cost-optimized",label:"Cost-Opt",icon:"savings"}].map(e=>(0,a.jsxs)("button",{onClick:()=>b(e.value),className:`py-1.5 px-2 rounded-md text-xs font-medium transition-all ${h===e.value?"bg-white dark:bg-bg-main shadow-sm text-primary":"text-text-muted hover:text-text-main"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] align-middle mr-0.5",children:e.icon}),e.label]},e.value))}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:{priority:"Sequential fallback: tries model 1 first, then 2, etc.",weighted:"Distributes traffic by weight percentage with fallback","round-robin":"Circular distribution: each request goes to the next model in rotation",random:"Uniform random selection, then fallback to remaining models","least-used":"Picks the model with fewest requests, balancing load over time","cost-optimized":"Routes to the cheapest model first based on pricing"}[h]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Models"}),"weighted"===h&&x.length>1&&(0,a.jsx)("button",{onClick:()=>{let e=x.length;if(0===e)return;let t=Math.floor(100/e),s=100-t*e;u(x.map((e,a)=>({...e,weight:t+(0===a?s:0)})))},className:"text-[10px] text-primary hover:text-primary/80 transition-colors",children:"Auto-balance"})]}),0===x.length?(0,a.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,a.jsx)("div",{className:"flex flex-col gap-1 max-h-[240px] overflow-y-auto",children:x.map((e,t)=>(0,a.jsxs)("div",{draggable:!0,onDragStart:e=>{E(t),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",t.toString()),e.target&&setTimeout(()=>e.target.style.opacity="0.5",0)},onDragEnd:z,onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="move",D(t)},onDrop:e=>((e,t)=>{if(e.preventDefault(),null===P||P===t)return;let s=[...x],[a]=s.splice(P,1);s.splice(t,0,a),u(s),E(null),D(null)})(e,t),className:`group/item flex items-center gap-1.5 px-2 py-1.5 rounded-md transition-all cursor-grab active:cursor-grabbing ${O===t&&P!==t?"bg-primary/10 border border-primary/30":"bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] border border-transparent"} ${P===t?"opacity-50":""}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted/40 cursor-grab shrink-0",children:"drag_indicator"}),(0,a.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:t+1}),(0,a.jsx)("div",{className:"flex-1 min-w-0 px-1 text-xs text-text-main truncate",children:A(e.model)}),"weighted"===h&&(0,a.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,a.jsx)("input",{type:"number",min:"0",max:"100",value:e.weight,onChange:e=>{var s;let a;return s=e.target.value,void((a=[...x])[t]={...a[t],weight:Math.max(0,Math.min(100,Number(s)||0))},u(a))},className:"w-10 text-[11px] text-center py-0.5 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"%"})]}),"priority"===h&&(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,a.jsx)("button",{onClick:()=>(e=>{if(0===e)return;let t=[...x];[t[e-1],t[e]]=[t[e],t[e-1]],u(t)})(t),disabled:0===t,className:`p-0.5 rounded ${0===t?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,a.jsx)("button",{onClick:()=>(e=>{if(e===x.length-1)return;let t=[...x];[t[e],t[e+1]]=[t[e+1],t[e]],u(t)})(t),disabled:t===x.length-1,className:`p-0.5 rounded ${t===x.length-1?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,a.jsx)("button",{onClick:()=>{u(x.filter((e,s)=>s!==t))},className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},`${e.model}-${t}`))}),"weighted"===h&&x.length>0&&(0,a.jsx)(p,{models:x}),(0,a.jsxs)("button",{onClick:()=>f(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-text-muted hover:text-primary hover:border-primary/30 transition-colors flex items-center justify-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,a.jsxs)("button",{onClick:()=>M(!$),className:"flex items-center gap-1 text-xs text-text-muted hover:text-text-main transition-colors self-start",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:$?"expand_less":"expand_more"}),"Advanced Settings"]}),$&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 p-3 bg-black/[0.02] dark:bg-white/[0.02] rounded-lg border border-black/5 dark:border-white/5",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Max Retries"}),(0,a.jsx)("input",{type:"number",min:"0",max:"10",value:T.maxRetries??"",placeholder:"1",onChange:e=>_({...T,maxRetries:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Retry Delay (ms)"}),(0,a.jsx)("input",{type:"number",min:"0",max:"60000",step:"500",value:T.retryDelayMs??"",placeholder:"2000",onChange:e=>_({...T,retryDelayMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Timeout (ms)"}),(0,a.jsx)("input",{type:"number",min:"1000",max:"600000",step:"1000",value:T.timeoutMs??"",placeholder:"120000",onChange:e=>_({...T,timeoutMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted",children:"Healthcheck"}),(0,a.jsx)("input",{type:"checkbox",checked:!1!==T.healthCheckEnabled,onChange:e=>_({...T,healthCheckEnabled:e.target.checked}),className:"accent-primary"})]})]}),"round-robin"===h&&(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 pt-2 border-t border-black/5 dark:border-white/5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Concurrency / Model"}),(0,a.jsx)("input",{type:"number",min:"1",max:"20",value:T.concurrencyPerModel??"",placeholder:"3",onChange:e=>_({...T,concurrencyPerModel:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Queue Timeout (ms)"}),(0,a.jsx)("input",{type:"number",min:"1000",max:"120000",step:"1000",value:T.queueTimeoutMs??"",placeholder:"30000",onChange:e=>_({...T,queueTimeoutMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]})]}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted",children:"Leave empty to use global defaults. These override per-provider settings."})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(l.$n,{onClick:s,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(l.$n,{onClick:L,fullWidth:!0,size:"sm",disabled:!c.trim()||!!j||y,children:y?"Saving...":F?"Save":"Create"})]})]})}),(0,a.jsx)(l.rq,{isOpen:g,onClose:()=>f(!1),onSelect:e=>{x.find(t=>t.model===e.value)||u([...x,{model:e.value,weight:0}])},activeProviders:i,modelAliases:k,title:"Add Model to Combo"})]})}function p({models:e}){let t=e.reduce((e,t)=>e+(t.weight||0),0),s=100===t,r=["bg-blue-500","bg-emerald-500","bg-amber-500","bg-purple-500","bg-rose-500","bg-cyan-500","bg-orange-500","bg-indigo-500"];return(0,a.jsxs)("div",{className:"mt-1.5",children:[(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-black/5 dark:bg-white/5 overflow-hidden flex",children:e.map((e,t)=>e.weight?(0,a.jsx)("div",{className:`${r[t%r.length]} transition-all duration-300`,style:{width:`${Math.min(e.weight,100)}%`}},t):null)}),(0,a.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,a.jsx)("div",{className:"flex gap-1",children:e.map((e,t)=>e.weight>0&&(0,a.jsxs)("span",{className:"flex items-center gap-0.5 text-[9px] text-text-muted",children:[(0,a.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${r[t%r.length]}`}),e.weight,"%"]},t))}),(0,a.jsxs)("span",{className:`text-[10px] font-medium ${s?"text-emerald-500":t>100?"text-red-500":"text-amber-500"}`,children:[t,"%",!s&&t>0&&" ≠ 100%"]})]})]})}},66618:(e,t,s)=>{Promise.resolve().then(s.bind(s,11313))}},e=>{e.O(0,[8500,9751,600,3191,7896,1525,8441,3794,7358],()=>e(e.s=66618)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099],{31449:(e,t,s)=>{"use strict";s.d(t,{default:()=>m});var i=s(95155),l=s(12115),r=s(14051),a=(s(5772),s(71525)),n=s(26853),o=s(55757);let d=s(41463).env.NEXT_PUBLIC_CLOUD_URL,c=15e3;function m({machineId:e}){let[t,s]=(0,l.useState)([]),[r,m]=(0,l.useState)([]),[u,h]=(0,l.useState)(!0),[g,y]=(0,l.useState)(!1),[b,f]=(0,l.useState)(""),[j,v]=(0,l.useState)(null),[N,k]=(0,l.useState)([]),[C,w]=(0,l.useState)(null),[S,_]=(0,l.useState)(!1),[R,T]=(0,l.useState)(!1),[q,$]=(0,l.useState)(!1),[E,A]=(0,l.useState)(!1),[P,O]=(0,l.useState)(null),[I,D]=(0,l.useState)(""),[U,F]=(0,l.useState)(null),{copied:W,copy:B}=(0,n.C)();(0,l.useEffect)(()=>{Q(),L(),K()},[]);let K=async()=>{try{let e=await fetch("/v1/models");if(e.ok){let t=await e.json();k(t.data||[])}}catch(e){console.log("Error fetching models:",e)}},M=(0,l.useMemo)(()=>{let e=N.filter(e=>!e.type),t=N.filter(e=>"embedding"===e.type),s=N.filter(e=>"image"===e.type),i=N.filter(e=>"rerank"===e.type),l=N.filter(e=>"audio"===e.type&&"transcription"===e.subtype);return{chat:e,embeddings:t,images:s,rerank:i,audioTranscription:l,audioSpeech:N.filter(e=>"audio"===e.type&&"speech"===e.subtype),moderation:N.filter(e=>"moderation"===e.type)}},[N]);(0,l.useMemo)(()=>Object.entries(o.Q2).map(([e,t])=>{let s=r.filter(t=>t.provider===e),i=s.filter(e=>!1!==e.isActive&&("active"===e.testStatus||"success"===e.testStatus||"unknown"===e.testStatus)).length,l=s.filter(e=>!1!==e.isActive&&("error"===e.testStatus||"expired"===e.testStatus||"unavailable"===e.testStatus)).length;return{id:e,provider:t,total:s.length,connected:i,errors:l}}),[r]);let z=async(e,t=c)=>{let s=new AbortController,i=setTimeout(()=>s.abort(),t);try{let t=await fetch("/api/sync/cloud",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e}),signal:s.signal}),i=await t.json().catch(()=>({}));return{ok:t.ok,status:t.status,data:i}}catch(e){if(e?.name==="AbortError")return{ok:!1,status:408,data:{error:"Cloud request timeout"}};return{ok:!1,status:500,data:{error:e.message||"Cloud request failed"}}}finally{clearTimeout(i)}},L=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let t=await e.json();_(t.cloudEnabled||!1)}}catch(e){console.log("Error loading cloud settings:",e)}},Q=async()=>{try{let[e,t]=await Promise.all([fetch("/api/keys"),fetch("/api/providers")]),[i,l]=await Promise.all([e.json(),t.json()]);e.ok&&s(i.keys||[]),t.ok&&m(l.connections||[])}catch(e){console.log("Error fetching data:",e)}finally{h(!1)}},G=e=>{e?T(!0):$(!0)},J=async()=>{A(!0),D("syncing");try{let{ok:e,data:t}=await z("enable");e?(D("verifying"),t.verified?(_(!0),O({type:"success",message:"Cloud Proxy connected and verified!"})):(_(!0),O({type:"warning",message:t.verifyError||"Connected but verification failed"})),T(!1),t.createdKey&&await Q()):O({type:"error",message:t.error||"Failed to enable cloud"})}catch(e){O({type:"error",message:e.message})}finally{A(!1),D("")}},V=async()=>{A(!0),D("syncing");try{await z("sync"),D("disabling");let{ok:e,data:t}=await z("disable");e?(_(!1),O({type:"success",message:"Cloud disabled"}),$(!1)):O({type:"error",message:t.error||"Failed to disable cloud"})}catch(e){console.log("Error disabling cloud:",e),O({type:"error",message:"Failed to disable cloud"})}finally{A(!1),D("")}},Z=async()=>{if(b.trim())try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b})}),t=await e.json();e.ok&&(v(t.key),await Q(),f(""),y(!1))}catch(e){console.log("Error creating key:",e)}},X=async e=>{if(confirm("Delete this API key?"))try{(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&s(t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting key:",e)}},[H,Y]=(0,l.useState)("/v1"),ee=`${d}/v1`;if((0,l.useEffect)(()=>{Y(`${window.location.origin}/v1`)},[]),u)return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(a.Qv,{}),(0,i.jsx)(a.Qv,{})]});let et=S?ee:H;return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsxs)(a.Zp,{className:"",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"API Endpoint"}),(0,i.jsx)("p",{className:"text-sm text-text-muted",children:S?"Using Cloud Proxy":"Using Local Server"}),e&&(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Machine ID: ",e.slice(0,8),"..."]})]}),(0,i.jsx)("div",{className:"flex items-center gap-2",children:S?(0,i.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"cloud_off",onClick:()=>G(!1),disabled:E,className:"bg-red-500/10! text-red-500! hover:bg-red-500/20! border-red-500/30!",children:"Disable Cloud"}):(0,i.jsx)(a.$n,{variant:"primary",icon:"cloud_upload",onClick:()=>G(!0),disabled:E,className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600",children:"Enable Cloud"})})]}),(0,i.jsxs)("div",{className:"flex gap-2 mb-3",children:[(0,i.jsx)(a.pd,{value:et,readOnly:!0,className:`flex-1 font-mono text-sm ${S?"animate-border-glow":""}`}),(0,i.jsx)(a.$n,{variant:"secondary",icon:"endpoint_url"===W?"check":"content_copy",onClick:()=>B(et,"endpoint_url"),children:"endpoint_url"===W?"Copied!":"Copy"})]}),(0,i.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden mt-4",children:[(0,i.jsxs)("button",{onClick:()=>w("keys"===C?null:"keys"),className:"w-full flex items-center gap-3 p-4 hover:bg-surface/50 transition-colors text-left",children:[(0,i.jsx)("div",{className:"flex items-center justify-center size-10 rounded-lg bg-amber-500/10 shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-xl text-amber-500",children:"vpn_key"})}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"font-semibold text-sm",children:"Registered Keys"}),(0,i.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded-full bg-surface text-text-muted font-medium",children:[t.length," ",1===t.length?"key":"keys"]})]}),(0,i.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Manage API keys used to authenticate requests to this endpoint"})]}),(0,i.jsx)("span",{className:`material-symbols-outlined text-text-muted text-lg transition-transform ${"keys"===C?"rotate-180":""}`,children:"expand_more"})]}),"keys"===C&&(0,i.jsxs)("div",{className:"border-t border-border px-4 pb-4",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mt-3 mb-3",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Each key isolates usage tracking and can be revoked independently."}),(0,i.jsx)(a.$n,{size:"sm",icon:"add",onClick:()=>y(!0),children:"Create Key"})]}),0===t.length?(0,i.jsxs)("div",{className:"text-center py-8",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-primary/10 text-primary mb-3",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:"vpn_key"})}),(0,i.jsx)("p",{className:"text-text-main font-medium mb-1 text-sm",children:"No API keys yet"}),(0,i.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Create your first API key to get started"}),(0,i.jsx)(a.$n,{size:"sm",icon:"add",onClick:()=>y(!0),children:"Create Key"})]}):(0,i.jsx)("div",{className:"flex flex-col",children:t.map(e=>(0,i.jsxs)("div",{className:"group flex items-center justify-between py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0",children:[(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,i.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,i.jsx)("code",{className:"text-xs text-text-muted font-mono",children:e.key}),(0,i.jsx)("button",{onClick:()=>B(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:W===e.id?"check":"content_copy"})})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]})]}),(0,i.jsx)("button",{onClick:()=>X(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-0 group-hover:opacity-100 transition-all",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},e.id))})]})]})]}),(0,i.jsxs)(a.Zp,{children:[(0,i.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,i.jsxs)("div",{children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Available Endpoints"}),(0,i.jsxs)("p",{className:"text-sm text-text-muted",children:[N.length," models across"," ",[M.chat,M.embeddings,M.images,M.rerank,M.audioTranscription,M.audioSpeech,M.moderation].filter(e=>e.length>0).length," ","endpoints"]})]})}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(p,{icon:"chat",iconColor:"text-blue-500",iconBg:"bg-blue-500/10",title:"Chat Completions",path:"/v1/chat/completions",description:"Streaming & non-streaming chat with all providers",models:M.chat,expanded:"chat"===C,onToggle:()=>w("chat"===C?null:"chat"),copy:B,copied:W,baseUrl:et}),(0,i.jsx)(p,{icon:"data_array",iconColor:"text-emerald-500",iconBg:"bg-emerald-500/10",title:"Embeddings",path:"/v1/embeddings",description:"Text embeddings for search & RAG pipelines",models:M.embeddings,expanded:"embeddings"===C,onToggle:()=>w("embeddings"===C?null:"embeddings"),copy:B,copied:W,baseUrl:et}),(0,i.jsx)(p,{icon:"image",iconColor:"text-purple-500",iconBg:"bg-purple-500/10",title:"Image Generation",path:"/v1/images/generations",description:"Generate images from text prompts",models:M.images,expanded:"images"===C,onToggle:()=>w("images"===C?null:"images"),copy:B,copied:W,baseUrl:et}),(0,i.jsx)(p,{icon:"sort",iconColor:"text-amber-500",iconBg:"bg-amber-500/10",title:"Rerank",path:"/v1/rerank",description:"Rerank documents by relevance to a query",models:M.rerank,expanded:"rerank"===C,onToggle:()=>w("rerank"===C?null:"rerank"),copy:B,copied:W,baseUrl:et}),(0,i.jsx)(p,{icon:"mic",iconColor:"text-rose-500",iconBg:"bg-rose-500/10",title:"Audio Transcription",path:"/v1/audio/transcriptions",description:"Transcribe audio files to text (Whisper)",models:M.audioTranscription,expanded:"audioTranscription"===C,onToggle:()=>w("audioTranscription"===C?null:"audioTranscription"),copy:B,copied:W,baseUrl:et}),(0,i.jsx)(p,{icon:"record_voice_over",iconColor:"text-cyan-500",iconBg:"bg-cyan-500/10",title:"Text to Speech",path:"/v1/audio/speech",description:"Convert text to natural-sounding speech",models:M.audioSpeech,expanded:"audioSpeech"===C,onToggle:()=>w("audioSpeech"===C?null:"audioSpeech"),copy:B,copied:W,baseUrl:et}),(0,i.jsx)(p,{icon:"shield",iconColor:"text-orange-500",iconBg:"bg-orange-500/10",title:"Moderations",path:"/v1/moderations",description:"Content moderation and safety classification",models:M.moderation,expanded:"moderation"===C,onToggle:()=>w("moderation"===C?null:"moderation"),copy:B,copied:W,baseUrl:et})]})]}),!1,(0,i.jsx)(a.aF,{isOpen:R,title:"Enable Cloud Proxy",onClose:()=>T(!1),children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:[(0,i.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium mb-2",children:"What you will get"}),(0,i.jsxs)("ul",{className:"text-sm text-blue-700 dark:text-blue-300 space-y-1",children:[(0,i.jsx)("li",{children:"• Access your API from anywhere in the world"}),(0,i.jsx)("li",{children:"• Share endpoint with your team easily"}),(0,i.jsx)("li",{children:"• No need to open ports or configure firewall"}),(0,i.jsx)("li",{children:"• Fast global edge network"})]})]}),(0,i.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,i.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:"Note"}),(0,i.jsxs)("ul",{className:"text-sm text-yellow-700 dark:text-yellow-300 space-y-1",children:[(0,i.jsx)("li",{children:"• Cloud will keep your auth session for 1 day. If not used, it will be automatically deleted."}),(0,i.jsx)("li",{children:"• Cloud is currently unstable with Claude Code OAuth in some cases."})]})]}),E&&(0,i.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-primary/10 border border-primary/30 rounded-lg",children:[(0,i.jsx)("span",{className:"material-symbols-outlined animate-spin text-primary",children:"progress_activity"}),(0,i.jsx)("div",{className:"flex-1",children:(0,i.jsxs)("p",{className:"text-sm font-medium text-primary",children:["syncing"===I&&"Syncing data to cloud...","verifying"===I&&"Verifying connection..."]})})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(a.$n,{onClick:J,fullWidth:!0,disabled:E,children:E?(0,i.jsxs)("span",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"syncing"===I?"Syncing...":"Verifying..."]}):"Enable Cloud"}),(0,i.jsx)(a.$n,{onClick:()=>T(!1),variant:"ghost",fullWidth:!0,disabled:E,children:"Cancel"})]})]})}),(0,i.jsx)(a.aF,{isOpen:g,title:"Create API Key",onClose:()=>{y(!1),f("")},children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(a.pd,{label:"Key Name",value:b,onChange:e=>f(e.target.value),placeholder:"Production Key"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(a.$n,{onClick:Z,fullWidth:!0,disabled:!b.trim(),children:"Create"}),(0,i.jsx)(a.$n,{onClick:()=>{y(!1),f("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,i.jsx)(a.aF,{isOpen:!!j,title:"API Key Created",onClose:()=>v(null),children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,i.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,i.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(a.pd,{value:j||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,i.jsx)(a.$n,{variant:"secondary",icon:"created_key"===W?"check":"content_copy",onClick:()=>B(j,"created_key"),children:"created_key"===W?"Copied!":"Copy"})]}),(0,i.jsx)(a.$n,{onClick:()=>v(null),fullWidth:!0,children:"Done"})]})}),(0,i.jsx)(a.aF,{isOpen:q,title:"Disable Cloud Proxy",onClose:()=>!E&&$(!1),children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4",children:(0,i.jsxs)("div",{className:"flex items-start gap-3",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-red-600 dark:text-red-400",children:"warning"}),(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-1",children:"Warning"}),(0,i.jsx)("p",{className:"text-sm text-red-700 dark:text-red-300",children:"All auth sessions will be deleted from cloud."})]})]})}),E&&(0,i.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-primary/10 border border-primary/30 rounded-lg",children:[(0,i.jsx)("span",{className:"material-symbols-outlined animate-spin text-primary",children:"progress_activity"}),(0,i.jsx)("div",{className:"flex-1",children:(0,i.jsxs)("p",{className:"text-sm font-medium text-primary",children:["syncing"===I&&"Syncing latest data...","disabling"===I&&"Disabling cloud..."]})})]}),(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"Are you sure you want to disable cloud proxy?"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(a.$n,{onClick:V,fullWidth:!0,disabled:E,className:"bg-red-500! hover:bg-red-600! text-white!",children:E?(0,i.jsxs)("span",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"syncing"===I?"Syncing...":"Disabling..."]}):"Disable Cloud"}),(0,i.jsx)(a.$n,{onClick:()=>$(!1),variant:"ghost",fullWidth:!0,disabled:E,children:"Cancel"})]})]})}),U&&(0,i.jsx)(x,{provider:U,models:N,copy:B,copied:W,onClose:()=>F(null)})]})}function x({provider:e,models:t,copy:s,copied:r,onClose:n}){let o=e.provider.alias||e.id,d=(0,l.useMemo)(()=>t.filter(t=>t.owned_by===o||t.owned_by===e.id),[t,o,e.id]),c=d.filter(e=>!e.type),m=d.filter(e=>"embedding"===e.type),x=d.filter(e=>"image"===e.type),p=(e,t,l)=>0===l.length?null:(0,i.jsxs)("div",{className:"mb-4",children:[(0,i.jsxs)("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2 flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:t}),e," (",l.length,")"]}),(0,i.jsx)("div",{className:"flex flex-col gap-1",children:l.map(e=>{let t=`modal-${e.id}`;return(0,i.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-surface/60 group",children:[(0,i.jsx)("code",{className:"text-sm font-mono flex-1 truncate",children:e.id}),e.custom&&(0,i.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary",children:"custom"}),(0,i.jsx)("button",{onClick:()=>s(e.id,t),className:"p-1 hover:bg-sidebar rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy model ID",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:r===t?"check":"content_copy"})})]},e.id)})})]});return(0,i.jsx)(a.aF,{isOpen:!0,onClose:n,title:`${e.provider.name} — Models`,children:(0,i.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:0===d.length?(0,i.jsx)("p",{className:"text-sm text-text-muted py-4 text-center",children:"No models available for this provider."}):(0,i.jsxs)(i.Fragment,{children:[p("Chat","chat",c),p("Embedding","data_array",m),p("Image","image",x)]})})})}function p({icon:e,iconColor:t,iconBg:s,title:r,path:a,description:n,models:d,expanded:c,onToggle:m,copy:x,copied:p,baseUrl:u}){let h=(0,l.useMemo)(()=>{let e={};for(let t of d){let s=t.owned_by||"unknown";e[s]||(e[s]=[]),e[s].push(t)}return Object.entries(e).sort((e,t)=>t[1].length-e[1].length)},[d]),g=e=>o.Q2[e]||(0,o.zt)(e),y=`endpoint_${a}`;return(0,i.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,i.jsxs)("button",{onClick:m,className:"w-full flex items-center gap-3 p-4 hover:bg-surface/50 transition-colors text-left",children:[(0,i.jsx)("div",{className:`flex items-center justify-center size-10 rounded-lg ${s} shrink-0`,children:(0,i.jsx)("span",{className:`material-symbols-outlined text-xl ${t}`,children:e})}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"font-semibold text-sm",children:r}),(0,i.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded-full bg-surface text-text-muted font-medium",children:[d.length," ",1===d.length?"model":"models"]})]}),(0,i.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:n})]}),(0,i.jsx)("span",{className:`material-symbols-outlined text-text-muted text-lg transition-transform ${c?"rotate-180":""}`,children:"expand_more"})]}),c&&(0,i.jsxs)("div",{className:"border-t border-border px-4 pb-4",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 mt-3 mb-3",children:[(0,i.jsxs)("code",{className:"flex-1 text-xs font-mono text-text-muted bg-surface/80 px-3 py-1.5 rounded-lg truncate",children:[u.replace(/\/v1$/,""),a]}),(0,i.jsx)("button",{onClick:()=>x(`${u.replace(/\/v1$/,"")}${a}`,y),className:"p-1.5 hover:bg-surface rounded-lg text-text-muted hover:text-primary transition-colors shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:p===y?"check":"content_copy"})})]}),(0,i.jsx)("div",{className:"flex flex-col gap-2",children:h.map(([e,t])=>(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,i.jsx)("div",{className:"size-2.5 rounded-full shrink-0",style:{backgroundColor:g(e)?.color||"#888"}}),(0,i.jsx)("span",{className:"text-xs font-semibold text-text-main",children:g(e)?.name||e}),(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["(",t.length,")"]})]}),(0,i.jsx)("div",{className:"ml-5 flex flex-wrap gap-1.5",children:t.map(e=>(0,i.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-md bg-surface/80 text-text-muted font-mono",title:e.id,children:e.root||e.id.split("/").pop()},e.id))})]},e))})]})]})}m.propTypes={machineId:r.string.isRequired},r.shape({id:r.string.isRequired,provider:r.shape({id:r.string.isRequired,name:r.string.isRequired,color:r.string,textIcon:r.string}).isRequired,total:r.number.isRequired,connected:r.number.isRequired,errors:r.number.isRequired}).isRequired,r.func,x.propTypes={provider:r.object.isRequired,models:r.array.isRequired,copy:r.func.isRequired,copied:r.string,onClose:r.func.isRequired},p.propTypes={icon:r.string.isRequired,iconColor:r.string.isRequired,iconBg:r.string.isRequired,title:r.string.isRequired,path:r.string.isRequired,description:r.string.isRequired,models:r.array.isRequired,expanded:r.bool.isRequired,onToggle:r.func.isRequired,copy:r.func.isRequired,copied:r.string,baseUrl:r.string.isRequired}},86941:(e,t,s)=>{Promise.resolve().then(s.bind(s,31449))}},e=>{e.O(0,[8500,9751,600,3191,7896,1525,8441,3794,7358],()=>e(e.s=86941)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8192],{47503:(e,t,s)=>{Promise.resolve().then(s.bind(s,93086))},93086:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var a=s(95155),l=s(12115),r=s(71525);function i(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}let n={CLOSED:{bg:"bg-green-500/10",text:"text-green-500",label:"Healthy"},OPEN:{bg:"bg-red-500/10",text:"text-red-500",label:"Open"},HALF_OPEN:{bg:"bg-amber-500/10",text:"text-amber-500",label:"Half-Open"}};function x(){var e;let t,s,x,[d,m]=(0,l.useState)(null),[c,o]=(0,l.useState)(null),[h,p]=(0,l.useState)(null),[u,j]=(0,l.useState)(null),[b,N]=(0,l.useState)(null),[f,g]=(0,l.useState)(null),y=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/monitoring/health");if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();m(t),o(null),p(new Date)}catch(e){o(e.message)}},[]),v=(0,l.useCallback)(async()=>{let e=await Promise.allSettled([fetch("/api/telemetry/summary").then(e=>e.json()),fetch("/api/cache/stats").then(e=>e.json()),fetch("/api/rate-limits").then(e=>e.json())]);"fulfilled"===e[0].status&&j(e[0].value),"fulfilled"===e[1].status&&N(e[1].value),"fulfilled"===e[2].status&&e[2].value.cacheStats&&g(e[2].value.cacheStats)},[]);(0,l.useEffect)(()=>{y(),v();let e=setInterval(()=>{y(),v()},15e3);return()=>clearInterval(e)},[y,v]);let w=e=>null!=e?`${Math.round(e)}ms`:"—";if(!d&&!c)return(0,a.jsx)("div",{className:"p-6 flex items-center justify-center min-h-[400px]",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-primary"}),(0,a.jsx)("p",{className:"text-text-muted mt-4",children:"Loading health data..."})]})});if(c&&!d)return(0,a.jsx)("div",{className:"p-6",children:(0,a.jsxs)("div",{className:"bg-red-500/10 border border-red-500/30 rounded-xl p-6 text-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2",children:"error"}),(0,a.jsxs)("p",{className:"text-red-400",children:["Failed to load health data: ",c]}),(0,a.jsx)("button",{onClick:y,className:"mt-4 px-4 py-2 rounded-lg bg-primary/10 text-primary text-sm hover:bg-primary/20 transition-colors",children:"Retry"})]})});let{system:S,providerHealth:$,rateLimitStatus:k,lockouts:O}=d,L=Object.entries($||{}),C=Object.entries(O||{});return(0,a.jsxs)("div",{className:"p-6 space-y-6 max-w-6xl mx-auto",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"System Health"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Real-time monitoring of your OmniRoute instance"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[h&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Updated ",h.toLocaleTimeString()]}),(0,a.jsx)("button",{onClick:()=>{y(),v()},className:"p-2 rounded-lg bg-surface hover:bg-surface/80 text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"refresh"})})]})]}),(0,a.jsxs)("div",{role:"status","aria-live":"polite",className:`rounded-xl p-4 flex items-center gap-3 ${"healthy"===d.status?"bg-green-500/10 border border-green-500/20":"bg-red-500/10 border border-red-500/20"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[24px] ${"healthy"===d.status?"text-green-500":"text-red-500"}`,children:"healthy"===d.status?"check_circle":"error"}),(0,a.jsx)("span",{className:"healthy"===d.status?"text-green-400":"text-red-400",children:"healthy"===d.status?"All systems operational":"System issues detected"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"timer"})}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Uptime"})]}),(0,a.jsx)("p",{className:"text-xl font-semibold text-text-main",children:(t=Math.floor((e=S.uptime)/86400),s=Math.floor(e%86400/3600),x=Math.floor(e%3600/60),t>0?`${t}d ${s}h ${x}m`:s>0?`${s}h ${x}m`:`${x}m`)})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"info"})}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Version"})]}),(0,a.jsxs)("p",{className:"text-xl font-semibold text-text-main",children:["v",S.version]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Node ",S.nodeVersion]})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"memory"})}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Memory (RSS)"})]}),(0,a.jsx)("p",{className:"text-xl font-semibold text-text-main",children:i(S.memoryUsage?.rss||0)}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Heap: ",i(S.memoryUsage?.heapUsed||0)," /"," ",i(S.memoryUsage?.heapTotal||0)]})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"dns"})}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Providers"})]}),(0,a.jsx)("p",{className:"text-xl font-semibold text-text-main",children:L.length}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:[L.filter(([,e])=>"CLOSED"===e.state).length," healthy"]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold text-text-muted mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"speed"}),"Latency"]}),u?(0,a.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"p50"}),(0,a.jsx)("span",{className:"font-mono",children:w(u.p50)})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"p95"}),(0,a.jsx)("span",{className:"font-mono",children:w(u.p95)})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"p99"}),(0,a.jsx)("span",{className:"font-mono",children:w(u.p99)})]}),(0,a.jsxs)("div",{className:"flex justify-between border-t border-border pt-2 mt-2",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Total requests"}),(0,a.jsx)("span",{className:"font-mono",children:u.totalRequests??0})]})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No data yet"})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold text-text-muted mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"cached"}),"Prompt Cache"]}),b?(0,a.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Entries"}),(0,a.jsxs)("span",{className:"font-mono",children:[b.size,"/",b.maxSize]})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Hit Rate"}),(0,a.jsxs)("span",{className:"font-mono",children:[b.hitRate?.toFixed(1)??0,"%"]})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Hits / Misses"}),(0,a.jsxs)("span",{className:"font-mono",children:[b.hits??0," / ",b.misses??0]})]})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No data yet"})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold text-text-muted mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"database"}),"Signature Cache"]}),f?(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[{label:"Defaults",value:f.defaultCount,color:"text-text-muted"},{label:"Tool",value:`${f.tool.entries}/${f.tool.patterns}`,color:"text-blue-400"},{label:"Family",value:`${f.family.entries}/${f.family.patterns}`,color:"text-purple-400"},{label:"Session",value:`${f.session.entries}/${f.session.patterns}`,color:"text-cyan-400"}].map(({label:e,value:t,color:s})=>(0,a.jsxs)("div",{className:"text-center p-2 rounded-lg bg-surface/30 border border-border/30",children:[(0,a.jsx)("p",{className:`text-lg font-bold tabular-nums ${s}`,children:t}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:e})]},e))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No data yet"})]})]}),(0,a.jsxs)(r.Zp,{className:"p-5",role:"region","aria-label":"Provider health status",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-text-main mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-primary",children:"health_and_safety"}),"Provider Health"]}),0===L.length?(0,a.jsx)("p",{className:"text-sm text-text-muted text-center py-4",children:"No circuit breaker data available. Make some requests first."}):(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:L.map(([e,t])=>{let s=n[t.state]||n.CLOSED;return(0,a.jsxs)("div",{className:`rounded-lg p-3 ${s.bg} border border-white/5`,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-text-main",children:e}),(0,a.jsx)("span",{className:`text-xs font-semibold ${s.text}`,children:s.label})]}),(0,a.jsxs)("div",{className:"text-xs text-text-muted",children:["Failures: ",t.failures||0,t.lastFailure&&(0,a.jsxs)("span",{className:"ml-2",children:["Last: ",new Date(t.lastFailure).toLocaleTimeString()]})]})]},e)})})]}),k&&Object.keys(k).length>0&&(0,a.jsxs)(r.Zp,{className:"p-5",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-text-main mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-amber-500",children:"speed"}),"Rate Limit Status"]}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-text-muted text-left border-b border-white/5",children:[(0,a.jsx)("th",{className:"pb-2 font-medium",children:"Provider"}),(0,a.jsx)("th",{className:"pb-2 font-medium",children:"Status"}),(0,a.jsx)("th",{className:"pb-2 font-medium",children:"Requests"})]})}),(0,a.jsx)("tbody",{children:Object.entries(k).map(([e,t])=>(0,a.jsxs)("tr",{className:"border-b border-white/5 last:border-0",children:[(0,a.jsx)("td",{className:"py-2 text-text-main",children:e}),(0,a.jsx)("td",{className:"py-2",children:(0,a.jsx)("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${t.limited?"bg-red-500/10 text-red-400":"bg-green-500/10 text-green-400"}`,children:t.limited?"Limited":"OK"})}),(0,a.jsxs)("td",{className:"py-2 text-text-muted",children:[t.requestsInWindow||0," / ",t.limit||"∞"]})]},e))})]})})]}),C.length>0&&(0,a.jsxs)(r.Zp,{className:"p-5",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-text-main mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-red-500",children:"lock"}),"Active Lockouts"]}),(0,a.jsx)("div",{className:"space-y-2",children:C.map(([e,t])=>(0,a.jsxs)("div",{className:"rounded-lg p-3 bg-red-500/5 border border-red-500/10 flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-sm font-medium text-text-main",children:e}),t.reason&&(0,a.jsxs)("span",{className:"text-xs text-text-muted ml-2",children:["(",t.reason,")"]})]}),t.until&&(0,a.jsxs)("span",{className:"text-xs text-red-400",children:["Until ",new Date(t.until).toLocaleTimeString()]})]},e))})]})]})}}},e=>{e.O(0,[8500,9751,600,3191,7896,1525,8441,3794,7358],()=>e(e.s=47503)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{9153:(e,t,s)=>{"use strict";s.d(t,{default:()=>m});var r=s(95155),l=s(12115),i=s(14051),o=s(5772),n=s(98500),a=s(73321),d=s(71525),c=s(55757),x=s(45567);function m({machineId:e}){let[t,s]=(0,l.useState)([]),[i,o]=(0,l.useState)([]),[a,x]=(0,l.useState)(!0),[m,h]=(0,l.useState)("/v1"),[b,f]=(0,l.useState)(null);(0,l.useEffect)(()=>{h(`${window.location.origin}/v1`)},[]);let g=(0,l.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers"),fetch("/api/models")]);if(e.ok){let t=await e.json();s(t.connections||[])}if(t.ok){let e=await t.json();o(e.models||[])}}catch(e){console.log("Error fetching data:",e)}finally{x(!1)}},[]);(0,l.useEffect)(()=>{g()},[g]);let v=(0,l.useMemo)(()=>Object.entries(c.Q2).map(([e,s])=>{let r=t.filter(t=>t.provider===e),l=r.filter(e=>!1!==e.isActive&&("active"===e.testStatus||"success"===e.testStatus||"unknown"===e.testStatus)).length,o=r.filter(e=>!1!==e.isActive&&("error"===e.testStatus||"expired"===e.testStatus||"unavailable"===e.testStatus)).length,n=new Set([e,s.alias].filter(Boolean)),a=i.filter(e=>n.has(e.provider));return{id:e,provider:s,total:r.length,connected:l,errors:o,modelCount:a.length}}),[t,i]),j=(0,l.useMemo)(()=>{if(!b)return[];let e=new Set([b.id,b.provider?.alias].filter(Boolean));return i.filter(t=>e.has(t.provider))},[b,i]);return a?(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(d.Qv,{}),(0,r.jsx)(d.Qv,{})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(d.Zp,{children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Quick Start"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"First-time setup checklist for API clients and IDE tools."})]}),(0,r.jsxs)("ol",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-3",children:[(0,r.jsx)("span",{className:"font-semibold",children:"1. Create API key"}),(0,r.jsx)("p",{className:"text-text-muted mt-1",children:"Generate one key per environment to isolate usage and revoke safely."})]}),(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-3",children:[(0,r.jsx)("span",{className:"font-semibold",children:"2. Connect provider account"}),(0,r.jsx)("p",{className:"text-text-muted mt-1",children:"Configure providers in Dashboard and validate with Test Connection."})]}),(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-3",children:[(0,r.jsx)("span",{className:"font-semibold",children:"3. Use endpoint"}),(0,r.jsxs)("p",{className:"text-text-muted mt-1",children:["Point clients to ",(0,r.jsx)("code",{children:m})," and send requests to"," ",(0,r.jsx)("code",{children:"/chat/completions"}),"."]})]}),(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-3",children:[(0,r.jsx)("span",{className:"font-semibold",children:"4. Monitor usage"}),(0,r.jsx)("p",{className:"text-text-muted mt-1",children:"Track requests, tokens, errors, and cost in Usage and Request Logger."})]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:[{label:"Documentation",href:"/docs"},{label:"OpenAI API compatibility",href:"/docs#api-reference"},{label:"Cherry/Codex compatibility",href:"/docs#client-compatibility"},{label:"Report issue",href:"https://github.com/decolua/omniroute/issues",external:!0}].map(e=>(0,r.jsxs)("a",{href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border border-border text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:e.external?"open_in_new":"arrow_forward"}),e.label]},e.href))})]})}),(0,r.jsxs)(d.Zp,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Providers Overview"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:[v.filter(e=>e.total>0).length," configured of"," ",v.length," available providers"]})]}),(0,r.jsxs)(n,{href:"/dashboard/providers",className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border border-border text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"settings"}),"Manage Providers"]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:v.map(e=>(0,r.jsx)(u,{item:e,onClick:()=>f(e)},e.id))})]}),b&&(0,r.jsx)(p,{provider:b,models:j,onClose:()=>f(null)})]})}function u({item:e,onClick:t}){let[s,i]=(0,l.useState)(!1),n=e.errors>0?"text-red-500":e.connected>0?"text-green-500":"text-text-muted";return(0,r.jsx)("button",{onClick:t,className:"border border-border rounded-lg p-3 hover:bg-surface/40 transition-colors text-left cursor-pointer w-full",children:(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${e.provider.color||"#888"}15`},children:s?(0,r.jsx)("span",{className:"text-[10px] font-bold",style:{color:e.provider.color||"#888"},children:e.provider.textIcon||e.provider.id.slice(0,2).toUpperCase()}):(0,r.jsx)(o.default,{src:`/providers/${e.provider.id}.png`,alt:e.provider.name,width:26,height:26,className:"object-contain rounded-lg",sizes:"26px",onError:()=>i(!0)})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-semibold truncate",children:e.provider.name}),(0,r.jsx)("p",{className:`text-xs ${n}`,children:0===e.total?"Not configured":`${e.connected} active \xb7 ${e.errors} error`})]}),(0,r.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.modelCount]})]})})}function p({provider:e,models:t,onClose:s}){let[i,o]=(0,l.useState)(null),n=(0,x.i)(),c=(0,a.useRouter)(),m=e=>{s(),c.push(e)};return(0,r.jsx)(d.aF,{isOpen:!0,title:`${e.provider.name} — Models`,onClose:s,children:(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"token"}),t.length," model",1!==t.length?"s":""," available",e.total>0&&(0,r.jsxs)("span",{className:"ml-auto text-xs text-green-500",children:["● ",e.connected," connection",1!==e.connected?"s":""," active"]})]}),0===t.length?(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"No models available for this provider."}),(0,r.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Configure a connection first in"," ",(0,r.jsx)("button",{onClick:()=>m("/dashboard/providers"),className:"text-primary hover:underline cursor-pointer",children:"Providers"})]})]}):(0,r.jsx)("div",{className:"flex flex-col gap-1 max-h-[400px] overflow-y-auto",children:t.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg hover:bg-surface/50 transition-colors group",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"font-mono text-sm text-text-main truncate",children:e.fullModel}),e.alias!==e.model&&(0,r.jsxs)("p",{className:"text-[10px] text-text-muted",children:["alias: ",e.alias]})]}),(0,r.jsx)("button",{onClick:()=>{var t;return t=e.fullModel,void(navigator.clipboard.writeText(t),o(t),n.success(`Copied: ${t}`),setTimeout(()=>o(null),2e3))},className:"shrink-0 ml-2 p-1.5 rounded-lg text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors opacity-0 group-hover:opacity-100",title:"Copy model name",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:i===e.fullModel?"check":"content_copy"})})]},e.fullModel))}),(0,r.jsxs)("div",{className:"flex gap-2 pt-2 border-t border-border",children:[(0,r.jsxs)(d.$n,{variant:"secondary",fullWidth:!0,size:"sm",onClick:()=>m(`/dashboard/providers/${e.id}`),className:"flex-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"settings"}),"Configure Provider"]}),(0,r.jsx)(d.$n,{variant:"ghost",size:"sm",onClick:s,children:"Close"})]})]})})}m.propTypes={machineId:i.string},u.propTypes={item:i.shape({id:i.string.isRequired,provider:i.shape({id:i.string.isRequired,name:i.string.isRequired,color:i.string,textIcon:i.string}).isRequired,total:i.number.isRequired,connected:i.number.isRequired,errors:i.number.isRequired,modelCount:i.number.isRequired}).isRequired,onClick:i.func.isRequired},p.propTypes={provider:i.object.isRequired,models:i.array.isRequired,onClose:i.func.isRequired}},41657:(e,t,s)=>{Promise.resolve().then(s.bind(s,9153))}},e=>{e.O(0,[8500,9751,600,3191,7896,1525,8441,3794,7358],()=>e(e.s=41657)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,449,516,552,747,748,853,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1701,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3246,3254,3394,3461,3471,3472,3549,3954,4120,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5396,5466,5568,5616,5677,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7249,7295,7346,7429,7442,7457,7520,7545,7597,7758,7855,7899,8167,8207,8246,8406,8453,8461,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9389,9461,9492,9794,9998],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
|