9router 0.2.71 → 0.2.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +42 -40
- package/app/.next/build-manifest.json +2 -2
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/routes-manifest.json +12 -0
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error.html +2 -2
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_not-found.html +1 -1
- package/app/.next/server/app/_not-found.rsc +3 -3
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/api/auth/login/route.js +1 -1
- package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +4 -5
- 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/claude-settings/route.js +2 -2
- 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/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 +2 -2
- package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/route.js +1 -1
- package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/route.js +1 -1
- package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/alias/route.js +1 -1
- package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/route.js +1 -1
- package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/validate/route.js +1 -1
- package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/route.js +1 -1
- package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route_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/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 -1
- 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/history/route.js +1 -2
- 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/providers/route.js +45 -0
- package/app/.next/server/app/api/usage/providers/route.js.nft.json +1 -0
- package/app/.next/server/app/api/usage/providers/route_client-reference-manifest.js +1 -0
- package/app/.next/server/app/api/usage/request-details/route.js +1 -0
- package/app/.next/server/app/api/usage/request-details/route.js.nft.json +1 -0
- package/app/.next/server/app/api/usage/request-details/route_client-reference-manifest.js +1 -0
- package/app/.next/server/app/api/usage/request-logs/route.js +1 -2
- 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 -1
- package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/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/messages/count_tokens/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/models/route.js +1 -1
- package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback.html +1 -1
- package/app/.next/server/app/callback.rsc +3 -3
- package/app/.next/server/app/callback.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/_index.segment.rsc +3 -3
- 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/cli-tools.html +1 -1
- package/app/.next/server/app/dashboard/cli-tools.rsc +5 -5
- 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 +5 -5
- 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 +3 -3
- 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 +5 -5
- 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 +5 -5
- package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
- 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 +5 -5
- 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 +5 -5
- package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.html +1 -1
- package/app/.next/server/app/dashboard/profile.rsc +5 -5
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- 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 +5 -5
- package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
- 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 +5 -5
- 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 +5 -5
- 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 +3 -3
- 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 +5 -5
- 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 +5 -5
- package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.rsc +3 -3
- package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.html +1 -1
- package/app/.next/server/app/dashboard/translator.rsc +5 -5
- 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 +5 -5
- package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.html +1 -1
- package/app/.next/server/app/dashboard/usage.rsc +5 -5
- 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 +5 -5
- package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard.html +1 -1
- package/app/.next/server/app/dashboard.rsc +5 -5
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/index.html +1 -1
- package/app/.next/server/app/index.rsc +3 -3
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- 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 +3 -3
- package/app/.next/server/app/landing.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login.html +1 -1
- package/app/.next/server/app/login.rsc +4 -4
- package/app/.next/server/app/login.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/login.segments/_index.segment.rsc +3 -3
- 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_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +42 -40
- package/app/.next/server/chunks/3110.js +2 -2
- package/app/.next/server/chunks/3990.js +41 -0
- package/app/.next/server/chunks/412.js +4 -4
- package/app/.next/server/chunks/5330.js +2 -3
- package/app/.next/server/chunks/7647.js +1 -0
- package/app/.next/server/chunks/8152.js +1 -1
- package/app/.next/server/chunks/8954.js +1 -1
- package/app/.next/server/chunks/9718.js +1 -1
- package/app/.next/server/chunks/9862.js +1 -1
- package/app/.next/server/pages/404.html +1 -1
- package/app/.next/server/pages/500.html +2 -2
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/1393-ec22348a03d98802.js +1 -0
- package/app/.next/static/chunks/8729-30cb66f318ac2d23.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-738071ba2546b274.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-d48c3e28182c53fd.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-874d3494c011eaf2.js +1 -0
- package/app/.next/static/chunks/app/_global-error/page-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/auth/login/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/auth/logout/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/auth/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/credentials/update/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/model/resolve/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/models/alias/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/combos/[id]/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/combos/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/init/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/keys/[id]/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/keys/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/models/alias/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/models/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/cursor/import/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/import/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/pricing/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/validate/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/models/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/test/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/providers/client/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/providers/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/providers/validate/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/settings/require-login/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/settings/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/shutdown/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/sync/cloud/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/sync/initialize/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/tags/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/translator/load/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/translator/save/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/translator/send/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/translator/translate/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/usage/[connectionId]/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/usage/history/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/usage/providers/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/usage/request-details/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/usage/request-logs/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/v1/api/chat/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/v1/chat/completions/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/v1/messages/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/v1/models/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/v1/responses/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/v1/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/api/v1beta/models/route-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/app/page-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-1968aadfb379c0a3.js +1 -0
- package/app/.next/static/css/e4a2c774b676c378.css +3 -0
- package/app/.next/static/jnuJ7xmQaeiHg9oUUDqGs/_buildManifest.js +1 -0
- package/app/package.json +1 -1
- package/app/public/providers/glm-cn.png +0 -0
- package/app/src/mitm/cert/generate.js +44 -0
- package/app/src/mitm/cert/install.js +136 -0
- package/app/src/mitm/dns/dnsConfig.js +130 -0
- package/app/src/mitm/manager.js +227 -0
- package/cli.js +110 -144
- package/package.json +1 -1
- package/src/cli/utils/input.js +7 -1
- package/src/cli/utils/menuHelper.js +2 -1
- package/app/.next/server/chunks/9707.js +0 -1
- package/app/.next/static/FcGNHUA9390qBi1g02a_v/_buildManifest.js +0 -1
- package/app/.next/static/chunks/1393-3fdad0258c0b525c.js +0 -1
- package/app/.next/static/chunks/8729-9d273189141eb6fb.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-b61f704bc7de9783.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-e8509c35110f8541.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-15eac98ba6db9df4.js +0 -1
- package/app/.next/static/chunks/app/_global-error/page-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/auth/login/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/auth/logout/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/auth/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/credentials/update/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/model/resolve/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/models/alias/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/combos/[id]/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/combos/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/init/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/keys/[id]/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/keys/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/models/alias/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/models/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/cursor/import/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/import/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/pricing/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/validate/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/models/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/test/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/providers/client/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/providers/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/providers/validate/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/settings/require-login/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/settings/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/shutdown/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/sync/cloud/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/sync/initialize/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/tags/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/translator/load/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/translator/save/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/translator/send/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/translator/translate/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/usage/[connectionId]/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/usage/history/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/usage/request-logs/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/v1/api/chat/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/v1/chat/completions/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/v1/messages/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/v1/models/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/v1/responses/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/v1/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/api/v1beta/models/route-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/app/page-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-901ec69b71429e39.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-901ec69b71429e39.js +0 -1
- package/app/.next/static/css/69b23ffd995e0cf4.css +0 -3
- /package/app/.next/static/{FcGNHUA9390qBi1g02a_v → jnuJ7xmQaeiHg9oUUDqGs}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=9718,exports.ids=[9718],exports.modules={89718:(a,b,c)=>{c.d(b,{CG:()=>O,Dj:()=>L,Fh:()=>t,Iq:()=>Q,KJ:()
|
|
1
|
+
"use strict";exports.id=9718,exports.ids=[9718],exports.modules={89718:(a,b,c)=>{c.d(b,{CG:()=>O,Dj:()=>L,Fh:()=>t,Iq:()=>Q,KJ:()=>$,L:()=>K,L9:()=>I,Lh:()=>R,Mc:()=>z,Nx:()=>W,OM:()=>E,PX:()=>P,Pc:()=>x,Qu:()=>u,Uv:()=>J,VT:()=>aa,Xx:()=>V,bI:()=>T,c:()=>H,ek:()=>S,fK:()=>C,fv:()=>G,getPricingForModel:()=>Z,getProviderConnections:()=>s,getSettings:()=>U,ho:()=>w,i0:()=>v,iE:()=>A,jd:()=>M,o5:()=>F,oG:()=>N,op:()=>y,r4:()=>Y,rj:()=>B,yF:()=>_,z9:()=>X});var d=c(82996),e=c(11259),f=c(94755),g=c(76760),h=c.n(g),i=c(48161),j=c.n(i),k=c(73024),l=c.n(k);let m="u">typeof caches||"object"==typeof caches,n=function(){if(m)return"/tmp";if(process.env.DATA_DIR)return process.env.DATA_DIR;let a=process.platform,b=j().homedir(),c="9router";return"win32"===a?h().join(process.env.APPDATA||h().join(b,"AppData","Roaming"),c):h().join(b,`.${c}`)}(),o=m?null:h().join(n,"db.json");function p(){return{providerConnections:[],providerNodes:[],modelAliases:{},mitmAlias:{},combos:[],apiKeys:[],settings:{cloudEnabled:!1,stickyRoundRobinLimit:3,requireLogin:!0,observabilityMaxRecords:1e3,observabilityBatchSize:20,observabilityFlushIntervalMs:5e3,observabilityMaxJsonSize:1024},pricing:{}}}m||l().existsSync(n)||l().mkdirSync(n,{recursive:!0});let q=null;async function r(){if(m){if(!q){let a=p();(q=new d.t({read:async()=>{},write:async()=>{}},a)).data=a}return q}if(!q){let a=new e.Pv(o);q=new d.t(a,p())}try{await q.read()}catch(a){if(a instanceof SyntaxError)console.warn("[DB] Corrupt JSON detected, resetting to defaults..."),q.data=p(),await q.write();else throw a}if(q.data){let{data:a,changed:b}=function(a){let b=p(),c=a&&"object"==typeof a?a:{},d=!1;for(let[a,e]of Object.entries(b)){if(void 0===c[a]||null===c[a]){c[a]=e,d=!0;continue}if("settings"===a&&("object"!=typeof c.settings||Array.isArray(c.settings))){c.settings={...e},d=!0;continue}if("settings"===a&&"object"==typeof c.settings&&!Array.isArray(c.settings))for(let[a,b]of Object.entries(e))void 0===c.settings[a]&&(c.settings[a]=b,d=!0)}return{data:c,changed:d}}(q.data);q.data=a,b&&await q.write()}else q.data=p(),await q.write();return q}async function s(a={}){let b=(await r()).data.providerConnections||[];return a.provider&&(b=b.filter(b=>b.provider===a.provider)),void 0!==a.isActive&&(b=b.filter(b=>b.isActive===a.isActive)),b.sort((a,b)=>(a.priority||999)-(b.priority||999)),b}async function t(a={}){let b=(await r()).data.providerNodes||[];return a.type&&(b=b.filter(b=>b.type===a.type)),b}async function u(a){return(await r()).data.providerNodes.find(b=>b.id===a)||null}async function v(a){let b=await r();b.data.providerNodes||(b.data.providerNodes=[]);let c=new Date().toISOString(),d={id:a.id||(0,f.A)(),type:a.type,name:a.name,prefix:a.prefix,apiType:a.apiType,baseUrl:a.baseUrl,createdAt:c,updatedAt:c};return b.data.providerNodes.push(d),await b.write(),d}async function w(a,b){let c=await r();c.data.providerNodes||(c.data.providerNodes=[]);let d=c.data.providerNodes.findIndex(b=>b.id===a);return -1===d?null:(c.data.providerNodes[d]={...c.data.providerNodes[d],...b,updatedAt:new Date().toISOString()},await c.write(),c.data.providerNodes[d])}async function x(a){let b=await r();b.data.providerNodes||(b.data.providerNodes=[]);let c=b.data.providerNodes.findIndex(b=>b.id===a);if(-1===c)return null;let[d]=b.data.providerNodes.splice(c,1);return await b.write(),d}async function y(a){let b=await r(),c=b.data.providerConnections.length;b.data.providerConnections=b.data.providerConnections.filter(b=>b.provider!==a);let d=c-b.data.providerConnections.length;return await b.write(),d}async function z(a){return(await r()).data.providerConnections.find(b=>b.id===a)||null}async function A(a){let b=await r(),c=new Date().toISOString(),d=-1;if("oauth"===a.authType&&a.email?d=b.data.providerConnections.findIndex(b=>b.provider===a.provider&&"oauth"===b.authType&&b.email===a.email):"apikey"===a.authType&&a.name&&(d=b.data.providerConnections.findIndex(b=>b.provider===a.provider&&"apikey"===b.authType&&b.name===a.name)),-1!==d)return b.data.providerConnections[d]={...b.data.providerConnections[d],...a,updatedAt:c},await b.write(),b.data.providerConnections[d];let e=a.name||null;if(!e&&"oauth"===a.authType)if(a.email)e=a.email;else{let c=b.data.providerConnections.filter(b=>b.provider===a.provider).length;e=`Account ${c+1}`}let g=a.priority;g||(g=b.data.providerConnections.filter(b=>b.provider===a.provider).reduce((a,b)=>Math.max(a,b.priority||0),0)+1);let h={id:(0,f.A)(),provider:a.provider,authType:a.authType||"oauth",name:e,priority:g,isActive:void 0===a.isActive||a.isActive,createdAt:c,updatedAt:c};for(let b of["displayName","email","globalPriority","defaultModel","accessToken","refreshToken","expiresAt","tokenType","scope","idToken","projectId","apiKey","testStatus","lastTested","lastError","lastErrorAt","rateLimitedUntil","expiresIn","errorCode","consecutiveUseCount"])void 0!==a[b]&&null!==a[b]&&(h[b]=a[b]);return a.providerSpecificData&&Object.keys(a.providerSpecificData).length>0&&(h.providerSpecificData=a.providerSpecificData),b.data.providerConnections.push(h),await b.write(),await D(a.provider),h}async function B(a,b){let c=await r(),d=c.data.providerConnections.findIndex(b=>b.id===a);if(-1===d)return null;let e=c.data.providerConnections[d].provider;return c.data.providerConnections[d]={...c.data.providerConnections[d],...b,updatedAt:new Date().toISOString()},await c.write(),void 0!==b.priority&&await D(e),c.data.providerConnections[d]}async function C(a){let b=await r(),c=b.data.providerConnections.findIndex(b=>b.id===a);if(-1===c)return!1;let d=b.data.providerConnections[c].provider;return b.data.providerConnections.splice(c,1),await b.write(),await D(d),!0}async function D(a){let b=await r();b.data.providerConnections&&(b.data.providerConnections.filter(b=>b.provider===a).sort((a,b)=>{let c=(a.priority||0)-(b.priority||0);return 0!==c?c:new Date(b.updatedAt||0)-new Date(a.updatedAt||0)}).forEach((a,b)=>{a.priority=b+1}),await b.write())}async function E(){return(await r()).data.modelAliases||{}}async function F(a,b){let c=await r();c.data.modelAliases[a]=b,await c.write()}async function G(a){let b=await r();delete b.data.modelAliases[a],await b.write()}async function H(a){let b=(await r()).data.mitmAlias||{};return a?b[a]||{}:b}async function I(a,b){let c=await r();c.data.mitmAlias||(c.data.mitmAlias={}),c.data.mitmAlias[a]=b||{},await c.write()}async function J(){return(await r()).data.combos||[]}async function K(a){return((await r()).data.combos||[]).find(b=>b.id===a)||null}async function L(a){return((await r()).data.combos||[]).find(b=>b.name===a)||null}async function M(a){let b=await r();b.data.combos||(b.data.combos=[]);let c=new Date().toISOString(),d={id:(0,f.A)(),name:a.name,models:a.models||[],createdAt:c,updatedAt:c};return b.data.combos.push(d),await b.write(),d}async function N(a,b){let c=await r();c.data.combos||(c.data.combos=[]);let d=c.data.combos.findIndex(b=>b.id===a);return -1===d?null:(c.data.combos[d]={...c.data.combos[d],...b,updatedAt:new Date().toISOString()},await c.write(),c.data.combos[d])}async function O(a){let b=await r();if(!b.data.combos)return!1;let c=b.data.combos.findIndex(b=>b.id===a);return -1!==c&&(b.data.combos.splice(c,1),await b.write(),!0)}async function P(){return(await r()).data.apiKeys||[]}async function Q(a,b){if(!b)throw Error("machineId is required");let d=await r(),e=new Date().toISOString(),{generateApiKeyWithMachine:g}=await c.e(6844).then(c.bind(c,86844)),h=g(b),i={id:(0,f.A)(),name:a,key:h.key,machineId:b,createdAt:e};return d.data.apiKeys.push(i),await d.write(),i}async function R(a){let b=await r(),c=b.data.apiKeys.findIndex(b=>b.id===a);return -1!==c&&(b.data.apiKeys.splice(c,1),await b.write(),!0)}async function S(a){return(await r()).data.apiKeys.some(b=>b.key===a)}async function T(){let a=await r(),b=["displayName","email","globalPriority","defaultModel","accessToken","refreshToken","expiresAt","tokenType","scope","idToken","projectId","apiKey","testStatus","lastTested","lastError","lastErrorAt","rateLimitedUntil","expiresIn","consecutiveUseCount"],c=0;for(let d of a.data.providerConnections){for(let a of b)(null===d[a]||void 0===d[a])&&(delete d[a],c++);d.providerSpecificData&&0===Object.keys(d.providerSpecificData).length&&(delete d.providerSpecificData,c++)}return c>0&&await a.write(),c}async function U(){return(await r()).data.settings||{cloudEnabled:!1}}async function V(a){let b=await r();return b.data.settings={...b.data.settings,...a},await b.write(),b.data.settings}async function W(){return!0===(await U()).cloudEnabled}async function X(){return(await U()).cloudUrl||process.env.CLOUD_URL||"https://9router.com"}async function Y(){let a=(await r()).data.pricing||{},{getDefaultPricing:b}=await c.e(7341).then(c.bind(c,57341)),d=b(),e={};for(let[b,c]of Object.entries(d))if(e[b]={...c},a[b])for(let[c,d]of Object.entries(a[b]))e[b][c]?e[b][c]={...e[b][c],...d}:e[b][c]=d;for(let[b,c]of Object.entries(a))if(e[b])for(let[a,d]of Object.entries(c))e[b][a]||(e[b][a]=d);else e[b]={...c};return e}async function Z(a,b){let c=await Y();if(c[a]?.[b])return c[a][b];let d={claude:"cc",codex:"cx","gemini-cli":"gc",qwen:"qw",iflow:"if",antigravity:"ag",github:"gh",openai:"openai",anthropic:"anthropic",gemini:"gemini",openrouter:"openrouter",glm:"glm",kimi:"kimi",minimax:"minimax"}[a];return d&&c[d]&&c[d][b]||null}async function $(a){let b=await r();for(let[c,d]of(b.data.pricing||(b.data.pricing={}),Object.entries(a)))for(let[a,e]of(b.data.pricing[c]||(b.data.pricing[c]={}),Object.entries(d)))b.data.pricing[c][a]=e;return await b.write(),b.data.pricing}async function _(a,b){let c=await r();return c.data.pricing||(c.data.pricing={}),b?c.data.pricing[a]&&(delete c.data.pricing[a][b],0===Object.keys(c.data.pricing[a]).length&&delete c.data.pricing[a]):delete c.data.pricing[a],await c.write(),c.data.pricing}async function aa(){let a=await r();return a.data.pricing={},await a.write(),a.data.pricing}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
exports.id=9862,exports.ids=[9862],exports.modules={14807:(a,b,c)=>{Promise.resolve().then(c.bind(c,43173))},43173:(a,b,c)=>{"use strict";c.d(b,{default:()=>k});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377);let j=15e3;function k({machineId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(null),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(""),{copied:C,copy:D}=(0,i.C)(),E=async(a,b=j)=>{let c=new AbortController,d=setTimeout(()=>c.abort(),b);try{let b=await fetch("/api/sync/cloud",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:a}),signal:c.signal}),d=await b.json().catch(()=>({}));return{ok:b.ok,status:b.status,data:d}}catch(a){if(a?.name==="AbortError")return{ok:!1,status:408,data:{error:"Cloud request timeout"}};return{ok:!1,status:500,data:{error:a.message||"Cloud request failed"}}}finally{clearTimeout(d)}},F=async()=>{try{let a=await fetch("/api/keys"),b=await a.json();a.ok&&c(b.keys||[])}catch(a){console.log("Error fetching data:",a)}finally{g(!1)}},G=a=>{a?t(!0):v(!0)},H=async()=>{x(!0),B("syncing");try{let{ok:a,data:b}=await E("enable");a?(B("verifying"),b.verified?(r(!0),z({type:"success",message:"Cloud Proxy connected and verified!"})):(r(!0),z({type:"warning",message:b.verifyError||"Connected but verification failed"})),t(!1),b.createdKey&&await F()):z({type:"error",message:b.error||"Failed to enable cloud"})}catch(a){z({type:"error",message:a.message})}finally{x(!1),B("")}},I=async()=>{x(!0),B("syncing");try{await E("sync"),B("disabling");let{ok:a,data:b}=await E("disable");a?(r(!1),z({type:"success",message:"Cloud disabled"}),v(!1)):z({type:"error",message:b.error||"Failed to disable cloud"})}catch(a){console.log("Error disabling cloud:",a),z({type:"error",message:"Failed to disable cloud"})}finally{x(!1),B("")}},J=async()=>{if(m.trim())try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:m})}),b=await a.json();a.ok&&(p(b.key),await F(),n(""),l(!1))}catch(a){console.log("Error creating key:",a)}},K=async a=>{if(confirm("Delete this API key?"))try{(await fetch(`/api/keys/${a}`,{method:"DELETE"})).ok&&c(b.filter(b=>b.id!==a))}catch(a){console.log("Error deleting key:",a)}},[L,M]=(0,e.useState)("/v1");if(f)return(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(h.Qv,{}),(0,d.jsx)(h.Qv,{})]});let N=q?"https://9router.com/v1":L;return(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsxs)(h.Zp,{className:"",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"API Endpoint"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:q?"Using Cloud Proxy":"Using Local Server"})]}),(0,d.jsx)("div",{className:"flex items-center gap-2",children:q?(0,d.jsx)(h.$n,{size:"sm",variant:"secondary",icon:"cloud_off",onClick:()=>G(!1),disabled:w,className:"bg-red-500/10! text-red-500! hover:bg-red-500/20! border-red-500/30!",children:"Disable Cloud"}):(0,d.jsx)(h.$n,{variant:"primary",icon:"cloud_upload",onClick:()=>G(!0),disabled:w,className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600",children:"Enable Cloud"})})]}),(0,d.jsxs)("div",{className:"flex gap-2 mb-3",children:[(0,d.jsx)(h.pd,{value:N,readOnly:!0,className:`flex-1 font-mono text-sm ${q?"animate-border-glow":""}`}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"endpoint_url"===C?"check":"content_copy",onClick:()=>D(N,"endpoint_url"),children:"endpoint_url"===C?"Copied!":"Copy"})]})]}),(0,d.jsxs)(h.Zp,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"API Keys"}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>l(!0),children:"Create Key"})]}),0===b.length?(0,d.jsxs)("div",{className:"text-center py-12",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,d.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>l(!0),children:"Create Key"})]}):(0,d.jsx)("div",{className:"flex flex-col",children:b.map(a=>(0,d.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,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono",children:a.key}),(0,d.jsx)("button",{onClick:()=>D(a.key,a.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,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:C===a.id?"check":"content_copy"})})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(a.createdAt).toLocaleDateString()]})]}),(0,d.jsx)("button",{onClick:()=>K(a.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-0 group-hover:opacity-100 transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},a.id))})]}),!1,(0,d.jsx)(h.aF,{isOpen:s,title:"Enable Cloud Proxy",onClose:()=>t(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.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,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium mb-2",children:"What you will get"}),(0,d.jsxs)("ul",{className:"text-sm text-blue-700 dark:text-blue-300 space-y-1",children:[(0,d.jsx)("li",{children:"• Access your API from anywhere in the world"}),(0,d.jsx)("li",{children:"• Share endpoint with your team easily"}),(0,d.jsx)("li",{children:"• No need to open ports or configure firewall"}),(0,d.jsx)("li",{children:"• Fast global edge network"})]})]}),(0,d.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,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:"Note"}),(0,d.jsxs)("ul",{className:"text-sm text-yellow-700 dark:text-yellow-300 space-y-1",children:[(0,d.jsx)("li",{children:"• Cloud will keep your auth session for 1 day. If not used, it will be automatically deleted."}),(0,d.jsx)("li",{children:"• Cloud is currently unstable with Claude Code OAuth in some cases."})]})]}),w&&(0,d.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-primary/10 border border-primary/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-primary",children:"progress_activity"}),(0,d.jsx)("div",{className:"flex-1",children:(0,d.jsxs)("p",{className:"text-sm font-medium text-primary",children:["syncing"===A&&"Syncing data to cloud...","verifying"===A&&"Verifying connection..."]})})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:H,fullWidth:!0,disabled:w,children:w?(0,d.jsxs)("span",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"syncing"===A?"Syncing...":"Verifying..."]}):"Enable Cloud"}),(0,d.jsx)(h.$n,{onClick:()=>t(!1),variant:"ghost",fullWidth:!0,disabled:w,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:k,title:"Create API Key",onClose:()=>{l(!1),n("")},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(h.pd,{label:"Key Name",value:m,onChange:a=>n(a.target.value),placeholder:"Production Key"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:J,fullWidth:!0,disabled:!m.trim(),children:"Create"}),(0,d.jsx)(h.$n,{onClick:()=>{l(!1),n("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:!!o,title:"API Key Created",onClose:()=>p(null),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.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,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,d.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,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:o||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"created_key"===C?"check":"content_copy",onClick:()=>D(o,"created_key"),children:"created_key"===C?"Copied!":"Copy"})]}),(0,d.jsx)(h.$n,{onClick:()=>p(null),fullWidth:!0,children:"Done"})]})}),(0,d.jsx)(h.aF,{isOpen:u,title:"Disable Cloud Proxy",onClose:()=>!w&&v(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.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,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-red-600 dark:text-red-400",children:"warning"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-1",children:"Warning"}),(0,d.jsx)("p",{className:"text-sm text-red-700 dark:text-red-300",children:"All auth sessions will be deleted from cloud."})]})]})}),w&&(0,d.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-primary/10 border border-primary/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-primary",children:"progress_activity"}),(0,d.jsx)("div",{className:"flex-1",children:(0,d.jsxs)("p",{className:"text-sm font-medium text-primary",children:["syncing"===A&&"Syncing latest data...","disabling"===A&&"Disabling cloud..."]})})]}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Are you sure you want to disable cloud proxy?"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:I,fullWidth:!0,disabled:w,className:"bg-red-500! hover:bg-red-600! text-white!",children:w?(0,d.jsxs)("span",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"syncing"===A?"Syncing...":"Disabling..."]}):"Disable Cloud"}),(0,d.jsx)(h.$n,{onClick:()=>v(!1),variant:"ghost",fullWidth:!0,disabled:w,children:"Cancel"})]})]})})]})}k.propTypes={machineId:g().string.isRequired}},51747:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js","default")},77855:(a,b,c)=>{Promise.resolve().then(c.bind(c,51747))},87250:(a,b,c)=>{"use strict";c.d(b,{D1:()=>e});var d=c(54603);async function e(){return await (0,d.Xj)()}}};
|
|
1
|
+
exports.id=9862,exports.ids=[9862],exports.modules={14807:(a,b,c)=>{Promise.resolve().then(c.bind(c,43173))},43173:(a,b,c)=>{"use strict";c.d(b,{default:()=>l});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377);let j="https://9router.com",k=15e3;function l({machineId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(j),[v,w]=(0,e.useState)(j),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(null),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(null),[L,M]=(0,e.useState)(""),{copied:N,copy:O}=(0,i.C)(),P=async(a,b=k)=>{let c=new AbortController,d=setTimeout(()=>c.abort(),b);try{let b=await fetch("/api/sync/cloud",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:a}),signal:c.signal}),d=await b.json().catch(()=>({}));return{ok:b.ok,status:b.status,data:d}}catch(a){if(a?.name==="AbortError")return{ok:!1,status:408,data:{error:"Cloud request timeout"}};return{ok:!1,status:500,data:{error:a.message||"Cloud request failed"}}}finally{clearTimeout(d)}},Q=async()=>{try{let a=await fetch("/api/keys"),b=await a.json();a.ok&&c(b.keys||[])}catch(a){console.log("Error fetching data:",a)}finally{g(!1)}},R=a=>{a?A(!0):C(!0)},S=async()=>{I(!0),M("syncing");try{let{ok:a,data:b}=await P("enable");a?(M("verifying"),b.verified?(s(!0),K({type:"success",message:"Cloud Proxy connected and verified!"})):(s(!0),K({type:"warning",message:b.verifyError||"Connected but verification failed"})),A(!1),b.createdKey&&await Q()):K({type:"error",message:b.error||"Failed to enable cloud"})}catch(a){K({type:"error",message:a.message})}finally{I(!1),M("")}},T=async()=>{I(!0),M("syncing");try{await P("sync"),M("disabling");let{ok:a,data:b}=await P("disable");a?(s(!1),K({type:"success",message:"Cloud disabled"}),C(!1)):K({type:"error",message:b.error||"Failed to disable cloud"})}catch(a){console.log("Error disabling cloud:",a),K({type:"error",message:"Failed to disable cloud"})}finally{I(!1),M("")}},U=async()=>{let a=v.trim().replace(/\/v1\/?$/,"").replace(/\/+$/,"");if(a){y(!0),G(null);try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({cloudUrl:a})})).ok?(u(a),w(a),G({type:"success",message:"Worker URL saved"})):G({type:"error",message:"Failed to save Worker URL"})}catch(a){G({type:"error",message:a.message})}finally{y(!1)}}},V=async()=>{if(t){I(!0),G(null);try{let{ok:a,data:b}=await P("check",8e3);a?G({type:"success",message:b.message||"Worker is running"}):G({type:"error",message:b.error||"Check failed"})}catch{G({type:"error",message:"Cannot reach worker"})}finally{I(!1)}}},W=async()=>{if(n.trim())try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n})}),b=await a.json();a.ok&&(q(b.key),await Q(),o(""),m(!1))}catch(a){console.log("Error creating key:",a)}},X=async a=>{if(confirm("Delete this API key?"))try{(await fetch(`/api/keys/${a}`,{method:"DELETE"})).ok&&c(b.filter(b=>b.id!==a))}catch(a){console.log("Error deleting key:",a)}},[Y,Z]=(0,e.useState)("/v1"),$=t?`${t}/v1`:"";if(f)return(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(h.Qv,{}),(0,d.jsx)(h.Qv,{})]});let _=r?$:Y;return(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsxs)(h.Zp,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"API Endpoint"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:r?"Using Cloud Proxy":"Using Local Server"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(h.$n,{size:"sm",variant:"secondary",icon:"settings",onClick:()=>E(!0),children:"Setup Cloudflare"}),r?(0,d.jsx)(h.$n,{size:"sm",variant:"secondary",icon:"cloud_off",onClick:()=>R(!1),disabled:H,className:"bg-red-500/10! text-red-500! hover:bg-red-500/20! border-red-500/30!",children:"Disable Cloud"}):(0,d.jsx)(h.$n,{variant:"primary",icon:"cloud_upload",onClick:()=>R(!0),disabled:H||!t,className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600",children:"Enable Cloud"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:_,readOnly:!0,className:`flex-1 font-mono text-sm ${r?"animate-border-glow":""}`}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"endpoint_url"===N?"check":"content_copy",onClick:()=>O(_,"endpoint_url"),children:"endpoint_url"===N?"Copied!":"Copy"})]}),J&&(0,d.jsx)("div",{className:`mt-3 p-2 rounded text-sm ${"success"===J.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===J.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:J.message})]}),(0,d.jsxs)(h.Zp,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"API Keys"}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>m(!0),children:"Create Key"})]}),0===b.length?(0,d.jsxs)("div",{className:"text-center py-12",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,d.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>m(!0),children:"Create Key"})]}):(0,d.jsx)("div",{className:"flex flex-col",children:b.map(a=>(0,d.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,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono",children:a.key}),(0,d.jsx)("button",{onClick:()=>O(a.key,a.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,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:N===a.id?"check":"content_copy"})})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(a.createdAt).toLocaleDateString()]})]}),(0,d.jsx)("button",{onClick:()=>X(a.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-0 group-hover:opacity-100 transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},a.id))})]}),(0,d.jsx)(h.aF,{isOpen:D,title:"Setup Cloudflare Worker",onClose:()=>{E(!1),G(null)},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-3",children:(0,d.jsxs)("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:[(0,d.jsx)("code",{className:"font-semibold",children:"https://9router.com"})," is a pre-configured worker ready to use. You can also deploy your own."]})}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Worker URL"}),(0,d.jsx)("div",{className:"flex gap-2",children:(0,d.jsx)(h.pd,{value:v,onChange:a=>w(a.target.value),placeholder:"https://9router.your-subdomain.workers.dev",className:"flex-1 font-mono text-sm"})}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Deploy your own worker from ",(0,d.jsx)("code",{className:"text-xs bg-sidebar px-1 py-0.5 rounded",children:"app/cloud/"})," directory."," ",(0,d.jsx)("a",{href:"https://github.com/decolua/9router/tree/main/app/cloud",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Setup guide →"})]})]}),F&&(0,d.jsx)("div",{className:`p-2 rounded text-sm ${"success"===F.type?"bg-green-500/10 text-green-600 dark:text-green-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:F.message}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:U,fullWidth:!0,disabled:x||!v.trim()||v.trim().replace(/\/v1\/?$/,"").replace(/\/+$/,"")===t,children:x?"Saving...":"Save"}),(0,d.jsx)(h.$n,{onClick:V,variant:"secondary",fullWidth:!0,disabled:H||!t,icon:"check_circle",children:H?"Checking...":"Check"})]})]})}),(0,d.jsx)(h.aF,{isOpen:z,title:"Enable Cloud Proxy",onClose:()=>A(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.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,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium mb-2",children:"What you will get"}),(0,d.jsxs)("ul",{className:"text-sm text-blue-700 dark:text-blue-300 space-y-1",children:[(0,d.jsx)("li",{children:"• Access your API from anywhere in the world"}),(0,d.jsx)("li",{children:"• Share endpoint with your team easily"}),(0,d.jsx)("li",{children:"• No need to open ports or configure firewall"}),(0,d.jsx)("li",{children:"• Fast global edge network"})]})]}),(0,d.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,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:"Note"}),(0,d.jsxs)("ul",{className:"text-sm text-yellow-700 dark:text-yellow-300 space-y-1",children:[(0,d.jsx)("li",{children:"• Cloud will keep your auth session for 1 day. If not used, it will be automatically deleted."}),(0,d.jsx)("li",{children:"• Cloud is currently unstable with Claude Code OAuth in some cases."})]})]}),H&&(0,d.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-primary/10 border border-primary/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-primary",children:"progress_activity"}),(0,d.jsx)("div",{className:"flex-1",children:(0,d.jsxs)("p",{className:"text-sm font-medium text-primary",children:["syncing"===L&&"Syncing data to cloud...","verifying"===L&&"Verifying connection..."]})})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:S,fullWidth:!0,disabled:H,children:H?(0,d.jsxs)("span",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"syncing"===L?"Syncing...":"Verifying..."]}):"Enable Cloud"}),(0,d.jsx)(h.$n,{onClick:()=>A(!1),variant:"ghost",fullWidth:!0,disabled:H,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:l,title:"Create API Key",onClose:()=>{m(!1),o("")},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(h.pd,{label:"Key Name",value:n,onChange:a=>o(a.target.value),placeholder:"Production Key"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:W,fullWidth:!0,disabled:!n.trim(),children:"Create"}),(0,d.jsx)(h.$n,{onClick:()=>{m(!1),o("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:!!p,title:"API Key Created",onClose:()=>q(null),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.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,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,d.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,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:p||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"created_key"===N?"check":"content_copy",onClick:()=>O(p,"created_key"),children:"created_key"===N?"Copied!":"Copy"})]}),(0,d.jsx)(h.$n,{onClick:()=>q(null),fullWidth:!0,children:"Done"})]})}),(0,d.jsx)(h.aF,{isOpen:B,title:"Disable Cloud Proxy",onClose:()=>!H&&C(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.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,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-red-600 dark:text-red-400",children:"warning"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-1",children:"Warning"}),(0,d.jsx)("p",{className:"text-sm text-red-700 dark:text-red-300",children:"All auth sessions will be deleted from cloud."})]})]})}),H&&(0,d.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-primary/10 border border-primary/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-primary",children:"progress_activity"}),(0,d.jsx)("div",{className:"flex-1",children:(0,d.jsxs)("p",{className:"text-sm font-medium text-primary",children:["syncing"===L&&"Syncing latest data...","disabling"===L&&"Disabling cloud..."]})})]}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Are you sure you want to disable cloud proxy?"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:T,fullWidth:!0,disabled:H,className:"bg-red-500! hover:bg-red-600! text-white!",children:H?(0,d.jsxs)("span",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"syncing"===L?"Syncing...":"Disabling..."]}):"Disable Cloud"}),(0,d.jsx)(h.$n,{onClick:()=>C(!1),variant:"ghost",fullWidth:!0,disabled:H,children:"Cancel"})]})]})})]})}l.propTypes={machineId:g().string.isRequired}},51747:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js","default")},77855:(a,b,c)=>{Promise.resolve().then(c.bind(c,51747))},87250:(a,b,c)=>{"use strict";c.d(b,{D1:()=>e});var d=c(54603);async function e(){return await (0,d.Xj)()}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--jnuJ7xmQaeiHg9oUUDqGs--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/e4af272ccee01ff0-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/e4a2c774b676c378.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-34add7e75711617f.js"/><script src="/_next/static/chunks/4bd1b696-bf5e0dbacfa5baef.js" async=""></script><script src="/_next/static/chunks/3794-cd98b5cd5fb65b19.js" async=""></script><script src="/_next/static/chunks/main-app-8bfa111f852aed9b.js" async=""></script><script src="/_next/static/chunks/600-698f3e9fe5d9a2a4.js" async=""></script><script src="/_next/static/chunks/3624-b4d607564b40b24d.js" async=""></script><script src="/_next/static/chunks/8729-30cb66f318ac2d23.js" async=""></script><script src="/_next/static/chunks/5497-ad7fb90ac4a481cb.js" async=""></script><script src="/_next/static/chunks/app/(dashboard)/layout-2951a18467171aa4.js" async=""></script><link rel="preload" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap" as="style"/><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous"/><title>404: This page could not be found.</title><title>9Router - AI Infrastructure Management</title><meta name="description" content="One endpoint for all your AI providers. Manage keys, monitor usage, and scale effortlessly."/><link rel="icon" href="/favicon.ico?603d046c9a6fdfbb" type="image/x-icon" sizes="16x16"/><link rel="icon" href="/favicon.svg"/><link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap" rel="stylesheet"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="__variable_f367f3 font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-34add7e75711617f.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[1110,[\"600\",\"static/chunks/600-698f3e9fe5d9a2a4.js\",\"3624\",\"static/chunks/3624-b4d607564b40b24d.js\",\"8729\",\"static/chunks/8729-30cb66f318ac2d23.js\",\"5497\",\"static/chunks/5497-ad7fb90ac4a481cb.js\",\"9305\",\"static/chunks/app/(dashboard)/layout-2951a18467171aa4.js\"],\"ThemeProvider\"]\n3:I[7121,[],\"\"]\n4:I[4581,[],\"\"]\n5:I[484,[],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[484,[],\"ViewportBoundary\"]\na:I[484,[],\"MetadataBoundary\"]\nc:I[7123,[],\"\"]\n:HL[\"/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/e4a2c774b676c378.css\",\"style\"]\n:HL[\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200\u0026display=swap\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"jnuJ7xmQaeiHg9oUUDqGs\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/e4a2c774b676c378.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200\u0026display=swap\",\"rel\":\"stylesheet\"}]]}],[\"$\",\"body\",null,{\"className\":\"__variable_f367f3 font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[6869,[],\"IconMark\"]\n7:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"9Router - AI Infrastructure Management\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"One endpoint for all your AI providers. Manage keys, monitor usage, and scale effortlessly.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?603d046c9a6fdfbb\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"3\",{\"rel\":\"icon\",\"href\":\"/favicon.svg\"}],[\"$\",\"$Ld\",\"4\",{}]]\n"])</script></body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
2
|
-
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-34add7e75711617f.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[7121,[],\"\"]\n3:I[4581,[],\"\"]\n4:I[484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[484,[],\"ViewportBoundary\"]\n9:I[484,[],\"MetadataBoundary\"]\nb:I[7123,[],\"\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"
|
|
1
|
+
<!DOCTYPE html><!--jnuJ7xmQaeiHg9oUUDqGs--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-34add7e75711617f.js"/><script src="/_next/static/chunks/4bd1b696-bf5e0dbacfa5baef.js" async=""></script><script src="/_next/static/chunks/3794-cd98b5cd5fb65b19.js" async=""></script><script src="/_next/static/chunks/main-app-8bfa111f852aed9b.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
|
|
2
|
+
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-34add7e75711617f.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[7121,[],\"\"]\n3:I[4581,[],\"\"]\n4:I[484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[484,[],\"ViewportBoundary\"]\n9:I[484,[],\"MetadataBoundary\"]\nb:I[7123,[],\"\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"jnuJ7xmQaeiHg9oUUDqGs\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\na:[]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__RSC_SERVER_MANIFEST="{\"node\":{\"
|
|
1
|
+
self.__RSC_SERVER_MANIFEST="{\"node\":{\"00b830cb3ad8ae488716b54de8f59f7a5dff59a87a\":{\"workers\":{\"app/api/cli-tools/claude-settings/route\":{\"moduleId\":\"48101\",\"async\":false}},\"layer\":{\"app/api/cli-tools/claude-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/claude-settings/route.js\",\"exportedName\":\"GET\"},\"00f0521a01f1371abc196c1a806c7d817aba6f24fd\":{\"workers\":{\"app/api/cli-tools/claude-settings/route\":{\"moduleId\":\"48101\",\"async\":false}},\"layer\":{\"app/api/cli-tools/claude-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/claude-settings/route.js\",\"exportedName\":\"DELETE\"},\"406b5421c0d9278c73508c39a731577bf6ed4d02ca\":{\"workers\":{\"app/api/cli-tools/claude-settings/route\":{\"moduleId\":\"48101\",\"async\":false}},\"layer\":{\"app/api/cli-tools/claude-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/claude-settings/route.js\",\"exportedName\":\"POST\"},\"00abc210d509c2a5babe45934cdf44cae1726962fc\":{\"workers\":{\"app/api/cli-tools/codex-settings/route\":{\"moduleId\":\"83722\",\"async\":false}},\"layer\":{\"app/api/cli-tools/codex-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/codex-settings/route.js\",\"exportedName\":\"DELETE\"},\"00fef668d38ed6414dbbb7377ecfdac61e74ecd9c2\":{\"workers\":{\"app/api/cli-tools/codex-settings/route\":{\"moduleId\":\"83722\",\"async\":false}},\"layer\":{\"app/api/cli-tools/codex-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/codex-settings/route.js\",\"exportedName\":\"GET\"},\"401d76d3f257906bfd6662f16431180c76be75d9f0\":{\"workers\":{\"app/api/cli-tools/codex-settings/route\":{\"moduleId\":\"83722\",\"async\":false}},\"layer\":{\"app/api/cli-tools/codex-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/codex-settings/route.js\",\"exportedName\":\"POST\"},\"4020dc1456d7b92cfc27cdc401d0f2b121fc9377c4\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/alias/route\":{\"moduleId\":\"76200\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/alias/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/alias/route.js\",\"exportedName\":\"GET\"},\"40c6354f22d4b97d20eaf7f65d95101321602958f5\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/alias/route\":{\"moduleId\":\"76200\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/alias/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/alias/route.js\",\"exportedName\":\"PUT\"},\"00ae22a114a5e0ea29ffb51186f926f0a14a628651\":{\"workers\":{\"app/api/cli-tools/openclaw-settings/route\":{\"moduleId\":\"85589\",\"async\":false}},\"layer\":{\"app/api/cli-tools/openclaw-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/openclaw-settings/route.js\",\"exportedName\":\"DELETE\"},\"00edbbed331af43249c958f0d2d72f5e24364912a1\":{\"workers\":{\"app/api/cli-tools/openclaw-settings/route\":{\"moduleId\":\"85589\",\"async\":false}},\"layer\":{\"app/api/cli-tools/openclaw-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/openclaw-settings/route.js\",\"exportedName\":\"GET\"},\"40b069e711997d56fd1cd254d764ab93da9bc876b6\":{\"workers\":{\"app/api/cli-tools/openclaw-settings/route\":{\"moduleId\":\"85589\",\"async\":false}},\"layer\":{\"app/api/cli-tools/openclaw-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/openclaw-settings/route.js\",\"exportedName\":\"POST\"},\"0037d08db2fa5d1389469ea6e9a3d0ff9d7423e1c7\":{\"workers\":{\"app/api/cli-tools/droid-settings/route\":{\"moduleId\":\"49043\",\"async\":false}},\"layer\":{\"app/api/cli-tools/droid-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/droid-settings/route.js\",\"exportedName\":\"DELETE\"},\"009d98e0ae529f78f46e8404a9524e03a3321240f5\":{\"workers\":{\"app/api/cli-tools/droid-settings/route\":{\"moduleId\":\"49043\",\"async\":false}},\"layer\":{\"app/api/cli-tools/droid-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/droid-settings/route.js\",\"exportedName\":\"GET\"},\"40613914d9a56a3a4950332d356a40550e1766b3c9\":{\"workers\":{\"app/api/cli-tools/droid-settings/route\":{\"moduleId\":\"49043\",\"async\":false}},\"layer\":{\"app/api/cli-tools/droid-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/droid-settings/route.js\",\"exportedName\":\"POST\"},\"00dcc02aeae88f74d9ec0124fb371c6b098b79905c\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/route\":{\"moduleId\":\"85298\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/route.js\",\"exportedName\":\"GET\"},\"400d20ae0577d77ba3f21d96e3193f2eab341eaca1\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/route\":{\"moduleId\":\"85298\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/route.js\",\"exportedName\":\"DELETE\"},\"40fb22a5994d3f3d53998969358fe69c9b793a2552\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/route\":{\"moduleId\":\"85298\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/route.js\",\"exportedName\":\"POST\"}},\"edge\":{},\"encryptionKey\":\"process.env.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY\"}"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"node":{"
|
|
1
|
+
{"node":{"00b830cb3ad8ae488716b54de8f59f7a5dff59a87a":{"workers":{"app/api/cli-tools/claude-settings/route":{"moduleId":"48101","async":false}},"layer":{"app/api/cli-tools/claude-settings/route":"rsc"},"filename":"app/api/cli-tools/claude-settings/route.js","exportedName":"GET"},"00f0521a01f1371abc196c1a806c7d817aba6f24fd":{"workers":{"app/api/cli-tools/claude-settings/route":{"moduleId":"48101","async":false}},"layer":{"app/api/cli-tools/claude-settings/route":"rsc"},"filename":"app/api/cli-tools/claude-settings/route.js","exportedName":"DELETE"},"406b5421c0d9278c73508c39a731577bf6ed4d02ca":{"workers":{"app/api/cli-tools/claude-settings/route":{"moduleId":"48101","async":false}},"layer":{"app/api/cli-tools/claude-settings/route":"rsc"},"filename":"app/api/cli-tools/claude-settings/route.js","exportedName":"POST"},"00abc210d509c2a5babe45934cdf44cae1726962fc":{"workers":{"app/api/cli-tools/codex-settings/route":{"moduleId":"83722","async":false}},"layer":{"app/api/cli-tools/codex-settings/route":"rsc"},"filename":"app/api/cli-tools/codex-settings/route.js","exportedName":"DELETE"},"00fef668d38ed6414dbbb7377ecfdac61e74ecd9c2":{"workers":{"app/api/cli-tools/codex-settings/route":{"moduleId":"83722","async":false}},"layer":{"app/api/cli-tools/codex-settings/route":"rsc"},"filename":"app/api/cli-tools/codex-settings/route.js","exportedName":"GET"},"401d76d3f257906bfd6662f16431180c76be75d9f0":{"workers":{"app/api/cli-tools/codex-settings/route":{"moduleId":"83722","async":false}},"layer":{"app/api/cli-tools/codex-settings/route":"rsc"},"filename":"app/api/cli-tools/codex-settings/route.js","exportedName":"POST"},"4020dc1456d7b92cfc27cdc401d0f2b121fc9377c4":{"workers":{"app/api/cli-tools/antigravity-mitm/alias/route":{"moduleId":"76200","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/alias/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/alias/route.js","exportedName":"GET"},"40c6354f22d4b97d20eaf7f65d95101321602958f5":{"workers":{"app/api/cli-tools/antigravity-mitm/alias/route":{"moduleId":"76200","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/alias/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/alias/route.js","exportedName":"PUT"},"00ae22a114a5e0ea29ffb51186f926f0a14a628651":{"workers":{"app/api/cli-tools/openclaw-settings/route":{"moduleId":"85589","async":false}},"layer":{"app/api/cli-tools/openclaw-settings/route":"rsc"},"filename":"app/api/cli-tools/openclaw-settings/route.js","exportedName":"DELETE"},"00edbbed331af43249c958f0d2d72f5e24364912a1":{"workers":{"app/api/cli-tools/openclaw-settings/route":{"moduleId":"85589","async":false}},"layer":{"app/api/cli-tools/openclaw-settings/route":"rsc"},"filename":"app/api/cli-tools/openclaw-settings/route.js","exportedName":"GET"},"40b069e711997d56fd1cd254d764ab93da9bc876b6":{"workers":{"app/api/cli-tools/openclaw-settings/route":{"moduleId":"85589","async":false}},"layer":{"app/api/cli-tools/openclaw-settings/route":"rsc"},"filename":"app/api/cli-tools/openclaw-settings/route.js","exportedName":"POST"},"0037d08db2fa5d1389469ea6e9a3d0ff9d7423e1c7":{"workers":{"app/api/cli-tools/droid-settings/route":{"moduleId":"49043","async":false}},"layer":{"app/api/cli-tools/droid-settings/route":"rsc"},"filename":"app/api/cli-tools/droid-settings/route.js","exportedName":"DELETE"},"009d98e0ae529f78f46e8404a9524e03a3321240f5":{"workers":{"app/api/cli-tools/droid-settings/route":{"moduleId":"49043","async":false}},"layer":{"app/api/cli-tools/droid-settings/route":"rsc"},"filename":"app/api/cli-tools/droid-settings/route.js","exportedName":"GET"},"40613914d9a56a3a4950332d356a40550e1766b3c9":{"workers":{"app/api/cli-tools/droid-settings/route":{"moduleId":"49043","async":false}},"layer":{"app/api/cli-tools/droid-settings/route":"rsc"},"filename":"app/api/cli-tools/droid-settings/route.js","exportedName":"POST"},"00dcc02aeae88f74d9ec0124fb371c6b098b79905c":{"workers":{"app/api/cli-tools/antigravity-mitm/route":{"moduleId":"85298","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/route.js","exportedName":"GET"},"400d20ae0577d77ba3f21d96e3193f2eab341eaca1":{"workers":{"app/api/cli-tools/antigravity-mitm/route":{"moduleId":"85298","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/route.js","exportedName":"DELETE"},"40fb22a5994d3f3d53998969358fe69c9b793a2552":{"workers":{"app/api/cli-tools/antigravity-mitm/route":{"moduleId":"85298","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/route.js","exportedName":"POST"}},"edge":{},"encryptionKey":"E6OgI/JOYq7mbTvnRXFd/GnwtbNhE8Dcgo/IQqnzEws="}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1393],{1393:(e,s,t)=>{Promise.resolve().then(t.bind(t,5907))},5907:(e,s,t)=>{"use strict";t.d(s,{default:()=>x});var l=t(5155),r=t(2115),a=t(4051),i=t.n(a),n=t(5497),d=t(1059);let o="https://9router.com",c=15e3;function x({machineId:e}){let[s,t]=(0,r.useState)([]),[a,i]=(0,r.useState)(!0),[x,m]=(0,r.useState)(!1),[u,h]=(0,r.useState)(""),[y,p]=(0,r.useState)(null),[g,b]=(0,r.useState)(!1),[f,j]=(0,r.useState)(o),[k,v]=(0,r.useState)(o),[N,w]=(0,r.useState)(!1),[C,S]=(0,r.useState)(!1),[$,_]=(0,r.useState)(!1),[E,P]=(0,r.useState)(!1),[A,W]=(0,r.useState)(null),[O,D]=(0,r.useState)(!1),[T,F]=(0,r.useState)(null),[I,K]=(0,r.useState)(""),{copied:U,copy:L}=(0,d.C)();(0,r.useEffect)(()=>{J(),q()},[]);let R=async(e,s=c)=>{let t=new AbortController,l=setTimeout(()=>t.abort(),s);try{let s=await fetch("/api/sync/cloud",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e}),signal:t.signal}),l=await s.json().catch(()=>({}));return{ok:s.ok,status:s.status,data:l}}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(l)}},q=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let s=await e.json();b(s.cloudEnabled||!1);let t=s.cloudUrl||o;j(t),v(t)}}catch(e){console.log("Error loading cloud settings:",e)}},J=async()=>{try{let e=await fetch("/api/keys"),s=await e.json();e.ok&&t(s.keys||[])}catch(e){console.log("Error fetching data:",e)}finally{i(!1)}},z=e=>{e?S(!0):_(!0)},Q=async()=>{D(!0),K("syncing");try{let{ok:e,data:s}=await R("enable");e?(K("verifying"),s.verified?(b(!0),F({type:"success",message:"Cloud Proxy connected and verified!"})):(b(!0),F({type:"warning",message:s.verifyError||"Connected but verification failed"})),S(!1),s.createdKey&&await J()):F({type:"error",message:s.error||"Failed to enable cloud"})}catch(e){F({type:"error",message:e.message})}finally{D(!1),K("")}},V=async()=>{D(!0),K("syncing");try{await R("sync"),K("disabling");let{ok:e,data:s}=await R("disable");e?(b(!1),F({type:"success",message:"Cloud disabled"}),_(!1)):F({type:"error",message:s.error||"Failed to disable cloud"})}catch(e){console.log("Error disabling cloud:",e),F({type:"error",message:"Failed to disable cloud"})}finally{D(!1),K("")}},Z=async()=>{let e=k.trim().replace(/\/v1\/?$/,"").replace(/\/+$/,"");if(e){w(!0),W(null);try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({cloudUrl:e})})).ok?(j(e),v(e),W({type:"success",message:"Worker URL saved"})):W({type:"error",message:"Failed to save Worker URL"})}catch(e){W({type:"error",message:e.message})}finally{w(!1)}}},H=async()=>{if(f){D(!0),W(null);try{let{ok:e,data:s}=await R("check",8e3);e?W({type:"success",message:s.message||"Worker is running"}):W({type:"error",message:s.error||"Check failed"})}catch{W({type:"error",message:"Cannot reach worker"})}finally{D(!1)}}},Y=async()=>{if(u.trim())try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:u})}),s=await e.json();e.ok&&(p(s.key),await J(),h(""),m(!1))}catch(e){console.log("Error creating key:",e)}},B=async e=>{if(confirm("Delete this API key?"))try{(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&t(s.filter(s=>s.id!==e))}catch(e){console.log("Error deleting key:",e)}},[G,M]=(0,r.useState)("/v1"),X=f?`${f}/v1`:"";if((0,r.useEffect)(()=>{M(`${window.location.origin}/v1`)},[]),a)return(0,l.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{})]});let ee=g?X:G;return(0,l.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,l.jsxs)(n.Zp,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:"API Endpoint"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:g?"Using Cloud Proxy":"Using Local Server"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"settings",onClick:()=>P(!0),children:"Setup Cloudflare"}),g?(0,l.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"cloud_off",onClick:()=>z(!1),disabled:O,className:"bg-red-500/10! text-red-500! hover:bg-red-500/20! border-red-500/30!",children:"Disable Cloud"}):(0,l.jsx)(n.$n,{variant:"primary",icon:"cloud_upload",onClick:()=>z(!0),disabled:O||!f,className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600",children:"Enable Cloud"})]})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.pd,{value:ee,readOnly:!0,className:`flex-1 font-mono text-sm ${g?"animate-border-glow":""}`}),(0,l.jsx)(n.$n,{variant:"secondary",icon:"endpoint_url"===U?"check":"content_copy",onClick:()=>L(ee,"endpoint_url"),children:"endpoint_url"===U?"Copied!":"Copy"})]}),T&&(0,l.jsx)("div",{className:`mt-3 p-2 rounded text-sm ${"success"===T.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===T.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:T.message})]}),(0,l.jsxs)(n.Zp,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:"API Keys"}),(0,l.jsx)(n.$n,{icon:"add",onClick:()=>m(!0),children:"Create Key"})]}),0===s.length?(0,l.jsxs)("div",{className:"text-center py-12",children:[(0,l.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,l.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,l.jsx)(n.$n,{icon:"add",onClick:()=>m(!0),children:"Create Key"})]}):(0,l.jsx)("div",{className:"flex flex-col",children:s.map(e=>(0,l.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,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,l.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,l.jsx)("code",{className:"text-xs text-text-muted font-mono",children:e.key}),(0,l.jsx)("button",{onClick:()=>L(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,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:U===e.id?"check":"content_copy"})})]}),(0,l.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]})]}),(0,l.jsx)("button",{onClick:()=>B(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-0 group-hover:opacity-100 transition-all",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},e.id))})]}),(0,l.jsx)(n.aF,{isOpen:E,title:"Setup Cloudflare Worker",onClose:()=>{P(!1),W(null)},children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-3",children:(0,l.jsxs)("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:[(0,l.jsx)("code",{className:"font-semibold",children:"https://9router.com"})," is a pre-configured worker ready to use. You can also deploy your own."]})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm font-medium mb-2",children:"Worker URL"}),(0,l.jsx)("div",{className:"flex gap-2",children:(0,l.jsx)(n.pd,{value:k,onChange:e=>v(e.target.value),placeholder:"https://9router.your-subdomain.workers.dev",className:"flex-1 font-mono text-sm"})}),(0,l.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Deploy your own worker from ",(0,l.jsx)("code",{className:"text-xs bg-sidebar px-1 py-0.5 rounded",children:"app/cloud/"})," directory."," ",(0,l.jsx)("a",{href:"https://github.com/decolua/9router/tree/main/app/cloud",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Setup guide →"})]})]}),A&&(0,l.jsx)("div",{className:`p-2 rounded text-sm ${"success"===A.type?"bg-green-500/10 text-green-600 dark:text-green-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:A.message}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.$n,{onClick:Z,fullWidth:!0,disabled:N||!k.trim()||k.trim().replace(/\/v1\/?$/,"").replace(/\/+$/,"")===f,children:N?"Saving...":"Save"}),(0,l.jsx)(n.$n,{onClick:H,variant:"secondary",fullWidth:!0,disabled:O||!f,icon:"check_circle",children:O?"Checking...":"Check"})]})]})}),(0,l.jsx)(n.aF,{isOpen:C,title:"Enable Cloud Proxy",onClose:()=>S(!1),children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.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,l.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium mb-2",children:"What you will get"}),(0,l.jsxs)("ul",{className:"text-sm text-blue-700 dark:text-blue-300 space-y-1",children:[(0,l.jsx)("li",{children:"• Access your API from anywhere in the world"}),(0,l.jsx)("li",{children:"• Share endpoint with your team easily"}),(0,l.jsx)("li",{children:"• No need to open ports or configure firewall"}),(0,l.jsx)("li",{children:"• Fast global edge network"})]})]}),(0,l.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,l.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:"Note"}),(0,l.jsxs)("ul",{className:"text-sm text-yellow-700 dark:text-yellow-300 space-y-1",children:[(0,l.jsx)("li",{children:"• Cloud will keep your auth session for 1 day. If not used, it will be automatically deleted."}),(0,l.jsx)("li",{children:"• Cloud is currently unstable with Claude Code OAuth in some cases."})]})]}),O&&(0,l.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-primary/10 border border-primary/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin text-primary",children:"progress_activity"}),(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsxs)("p",{className:"text-sm font-medium text-primary",children:["syncing"===I&&"Syncing data to cloud...","verifying"===I&&"Verifying connection..."]})})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.$n,{onClick:Q,fullWidth:!0,disabled:O,children:O?(0,l.jsxs)("span",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"syncing"===I?"Syncing...":"Verifying..."]}):"Enable Cloud"}),(0,l.jsx)(n.$n,{onClick:()=>S(!1),variant:"ghost",fullWidth:!0,disabled:O,children:"Cancel"})]})]})}),(0,l.jsx)(n.aF,{isOpen:x,title:"Create API Key",onClose:()=>{m(!1),h("")},children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(n.pd,{label:"Key Name",value:u,onChange:e=>h(e.target.value),placeholder:"Production Key"}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.$n,{onClick:Y,fullWidth:!0,disabled:!u.trim(),children:"Create"}),(0,l.jsx)(n.$n,{onClick:()=>{m(!1),h("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,l.jsx)(n.aF,{isOpen:!!y,title:"API Key Created",onClose:()=>p(null),children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.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,l.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,l.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,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.pd,{value:y||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,l.jsx)(n.$n,{variant:"secondary",icon:"created_key"===U?"check":"content_copy",onClick:()=>L(y,"created_key"),children:"created_key"===U?"Copied!":"Copy"})]}),(0,l.jsx)(n.$n,{onClick:()=>p(null),fullWidth:!0,children:"Done"})]})}),(0,l.jsx)(n.aF,{isOpen:$,title:"Disable Cloud Proxy",onClose:()=>!O&&_(!1),children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.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,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-red-600 dark:text-red-400",children:"warning"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-1",children:"Warning"}),(0,l.jsx)("p",{className:"text-sm text-red-700 dark:text-red-300",children:"All auth sessions will be deleted from cloud."})]})]})}),O&&(0,l.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-primary/10 border border-primary/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin text-primary",children:"progress_activity"}),(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsxs)("p",{className:"text-sm font-medium text-primary",children:["syncing"===I&&"Syncing latest data...","disabling"===I&&"Disabling cloud..."]})})]}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Are you sure you want to disable cloud proxy?"}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.$n,{onClick:V,fullWidth:!0,disabled:O,className:"bg-red-500! hover:bg-red-600! text-white!",children:O?(0,l.jsxs)("span",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"syncing"===I?"Syncing...":"Disabling..."]}):"Disable Cloud"}),(0,l.jsx)(n.$n,{onClick:()=>_(!1),variant:"ghost",fullWidth:!0,disabled:O,children:"Cancel"})]})]})})]})}x.propTypes={machineId:i().string.isRequired}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8729],{85:(i,e,n)=>{n.d(e,{A:()=>t});var a=n(1934),o=n(9311),m=n(620);function d(i){let e=document.documentElement,n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";"dark"===("system"===i?n:i)?e.classList.add("dark"):e.classList.remove("dark")}let t=(0,a.v)((0,o.Zr)((i,e)=>({theme:m.B2.defaultTheme,setTheme:e=>{i({theme:e}),d(e)},toggleTheme:()=>{let n="dark"===e().theme?"light":"dark";i({theme:n}),d(n)},initTheme:()=>{d(e().theme)}}),{name:m.B2.storageKey}))},620:(i,e,n)=>{n.d(e,{Q2:()=>a.Q2,fg:()=>a.fg,vQ:()=>o,MA:()=>a.MA,zN:()=>a.zN,B2:()=>m});var a=n(2679);n(8777);let o={name:"Endpoint Proxy",description:"AI Infrastructure Management",version:"0.2.73"},m={storageKey:"theme",defaultTheme:"system"}},1110:(i,e,n)=>{n.d(e,{ThemeProvider:()=>d});var a=n(5155),o=n(2115),m=n(85);function d({children:i}){let{initTheme:e}=(0,m.A)();return(0,o.useEffect)(()=>{e()},[e]),(0,a.jsx)(a.Fragment,{children:i})}},2679:(i,e,n)=>{n.d(e,{DI:()=>t,IS:()=>a,JH:()=>d,MA:()=>u,Q2:()=>r,fg:()=>m,gb:()=>c,mq:()=>l,wG:()=>s,wb:()=>p,zN:()=>o,zt:()=>g});let a={iflow:{id:"iflow",alias:"if",name:"iFlow AI",icon:"water_drop",color:"#6366F1"},qwen:{id:"qwen",alias:"qw",name:"Qwen Code",icon:"psychology",color:"#10B981"}},o={claude:{id:"claude",alias:"cc",name:"Claude Code",icon:"smart_toy",color:"#D97757"},antigravity:{id:"antigravity",alias:"ag",name:"Antigravity",icon:"rocket_launch",color:"#F59E0B"},codex:{id:"codex",alias:"cx",name:"OpenAI Codex",icon:"code",color:"#3B82F6"},"gemini-cli":{id:"gemini-cli",alias:"gc",name:"Gemini CLI",icon:"terminal",color:"#4285F4"},github:{id:"github",alias:"gh",name:"GitHub Copilot",icon:"code",color:"#333333"},kiro:{id:"kiro",alias:"kr",name:"Kiro AI",icon:"psychology_alt",color:"#FF6B35"},cursor:{id:"cursor",alias:"cu",name:"Cursor IDE",icon:"edit_note",color:"#00D4AA"}},m={openrouter:{id:"openrouter",alias:"openrouter",name:"OpenRouter",icon:"router",color:"#6366F1",textIcon:"OR",passthroughModels:!0},glm:{id:"glm",alias:"glm",name:"GLM Coding",icon:"code",color:"#2563EB",textIcon:"GL"},"glm-cn":{id:"glm-cn",alias:"glm-cn",name:"GLM Coding (China)",icon:"code",color:"#DC2626",textIcon:"GC"},kimi:{id:"kimi",alias:"kimi",name:"Kimi Coding",icon:"psychology",color:"#1E3A8A",textIcon:"KM"},minimax:{id:"minimax",alias:"minimax",name:"Minimax Coding",icon:"memory",color:"#7C3AED",textIcon:"MM"},"minimax-cn":{id:"minimax-cn",alias:"minimax-cn",name:"Minimax (China)",icon:"memory",color:"#DC2626",textIcon:"MC"},openai:{id:"openai",alias:"openai",name:"OpenAI",icon:"auto_awesome",color:"#10A37F",textIcon:"OA"},anthropic:{id:"anthropic",alias:"anthropic",name:"Anthropic",icon:"smart_toy",color:"#D97757",textIcon:"AN"},gemini:{id:"gemini",alias:"gemini",name:"Gemini",icon:"diamond",color:"#4285F4",textIcon:"GE"}},d="openai-compatible-",t="anthropic-compatible-";function l(i){return"string"==typeof i&&i.startsWith(d)}function c(i){return"string"==typeof i&&i.startsWith(t)}let r={...a,...o,...m},u={oauth:{id:"oauth",name:"OAuth",icon:"lock"},apikey:{id:"apikey",name:"API Key",icon:"key"}};function g(i){for(let e of Object.values(r))if(e.alias===i||e.id===i)return e;return null}function s(i){let e=r[i];return e?.alias||i}Object.values(r).reduce((i,e)=>(i[e.alias]=e.id,i),{}),Object.values(r).reduce((i,e)=>(i[e.id]=e.alias,i),{});let p=["antigravity","kiro","github"]},3097:(i,e,n)=>{n.d(e,{KC:()=>m,Xg:()=>o,vq:()=>a});let a={cc:[{id:"claude-opus-4-6",name:"Claude Opus 4.6"},{id:"claude-opus-4-5-20251101",name:"Claude 4.5 Opus"},{id:"claude-sonnet-4-5-20250929",name:"Claude 4.5 Sonnet"},{id:"claude-haiku-4-5-20251001",name:"Claude 4.5 Haiku"}],cx:[{id:"gpt-5.3-codex",name:"GPT 5.3 Codex"},{id:"gpt-5.3-codex-xhigh",name:"GPT 5.3 Codex (xHigh)"},{id:"gpt-5.3-codex-high",name:"GPT 5.3 Codex (High)"},{id:"gpt-5.3-codex-low",name:"GPT 5.3 Codex (Low)"},{id:"gpt-5.3-codex-none",name:"GPT 5.3 Codex (None)"},{id:"gpt-5.1-codex-mini",name:"GPT 5.1 Codex Mini"},{id:"gpt-5.1-codex-mini-high",name:"GPT 5.1 Codex Mini (High)"},{id:"gpt-5.2-codex",name:"GPT 5.2 Codex"},{id:"gpt-5.2",name:"GPT 5.2"},{id:"gpt-5.1-codex-max",name:"GPT 5.1 Codex Max"},{id:"gpt-5.1-codex",name:"GPT 5.1 Codex"},{id:"gpt-5.1",name:"GPT 5.1"},{id:"gpt-5-codex",name:"GPT 5 Codex"},{id:"gpt-5-codex-mini",name:"GPT 5 Codex Mini"}],gc:[{id:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview"},{id:"gemini-3-pro-preview",name:"Gemini 3 Pro Preview"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite"}],qw:[{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus"},{id:"qwen3-coder-flash",name:"Qwen3 Coder Flash"},{id:"vision-model",name:"Qwen3 Vision Model"}],if:[{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus"},{id:"kimi-k2",name:"Kimi K2"},{id:"kimi-k2-thinking",name:"Kimi K2 Thinking"},{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"deepseek-r1",name:"DeepSeek R1"},{id:"deepseek-v3.2-chat",name:"DeepSeek V3.2 Chat"},{id:"deepseek-v3.2-reasoner",name:"DeepSeek V3.2 Reasoner"},{id:"minimax-m2.1",name:"MiniMax M2.1"},{id:"glm-4.7",name:"GLM 4.7"}],ag:[{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking"},{id:"claude-opus-4-5-thinking",name:"Claude Opus 4.5 Thinking"},{id:"claude-sonnet-4-5-thinking",name:"Claude Sonnet 4.5 Thinking"},{id:"claude-sonnet-4-5",name:"Claude Sonnet 4.5"},{id:"gemini-3-pro-high",name:"Gemini 3 Pro High"},{id:"gemini-3-pro-low",name:"Gemini 3 Pro Low"},{id:"gemini-3-flash",name:"Gemini 3 Flash"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"}],gh:[{id:"gpt-4.1",name:"GPT-4.1"},{id:"gpt-5",name:"GPT-5"},{id:"gpt-5-mini",name:"GPT-5 Mini"},{id:"gpt-5-codex",name:"GPT-5 Codex"},{id:"gpt-5.1",name:"GPT-5.1"},{id:"gpt-5.1-codex",name:"GPT-5.1 Codex"},{id:"gpt-5.1-codex-mini",name:"GPT-5.1 Codex Mini"},{id:"gpt-5.1-codex-max",name:"GPT-5.1 Codex Max"},{id:"gpt-5.2",name:"GPT-5.2"},{id:"gpt-5.2-codex",name:"GPT-5.2 Codex"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5"},{id:"claude-opus-4.1",name:"Claude Opus 4.1"},{id:"claude-opus-4-5-20251101",name:"Claude Opus 4.5 (Full ID)"},{id:"claude-sonnet-4",name:"Claude Sonnet 4"},{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-3-flash",name:"Gemini 3 Flash"},{id:"gemini-3-pro",name:"Gemini 3 Pro"},{id:"grok-code-fast-1",name:"Grok Code Fast 1"},{id:"raptor-mini",name:"Raptor Mini"}],kr:[{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5"}],cu:[{id:"default",name:"Auto (Server Picks)"},{id:"claude-4.5-opus-high-thinking",name:"Claude 4.5 Opus High Thinking"},{id:"claude-4.5-opus-high",name:"Claude 4.5 Opus High"},{id:"claude-4.5-sonnet-thinking",name:"Claude 4.5 Sonnet Thinking"},{id:"claude-4.5-sonnet",name:"Claude 4.5 Sonnet"},{id:"claude-4.5-haiku",name:"Claude 4.5 Haiku"},{id:"claude-4.5-opus",name:"Claude 4.5 Opus"},{id:"gpt-5.2-codex",name:"GPT 5.2 Codex"}],openai:[{id:"gpt-4o",name:"GPT-4o"},{id:"gpt-4o-mini",name:"GPT-4o Mini"},{id:"gpt-4-turbo",name:"GPT-4 Turbo"},{id:"o1",name:"O1"},{id:"o1-mini",name:"O1 Mini"}],anthropic:[{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4"},{id:"claude-opus-4-20250514",name:"Claude Opus 4"},{id:"claude-3-5-sonnet-20241022",name:"Claude 3.5 Sonnet"}],gemini:[{id:"gemini-3-pro-preview",name:"Gemini 3 Pro Preview"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite"}],openrouter:[{id:"auto",name:"Auto (Best Available)"}],glm:[{id:"glm-4.7",name:"GLM 4.7"},{id:"glm-4.6v",name:"GLM 4.6V (Vision)"}],"glm-cn":[{id:"glm-4.7",name:"GLM-4.7"},{id:"glm-4.6",name:"GLM-4.6"},{id:"glm-4.5",name:"GLM-4.5"},{id:"glm-4.5-air",name:"GLM-4.5-Air"}],kimi:[{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"kimi-k2.5-thinking",name:"Kimi K2.5 Thinking"},{id:"kimi-latest",name:"Kimi Latest"}],minimax:[{id:"MiniMax-M2.1",name:"MiniMax M2.1"}]},o={claude:"cc",codex:"cx","gemini-cli":"gc",qwen:"qw",iflow:"if",antigravity:"ag",github:"gh",kiro:"kr",cursor:"cu",openai:"openai",anthropic:"anthropic",gemini:"gemini",openrouter:"openrouter",glm:"glm","glm-cn":"glm-cn",kimi:"kimi",minimax:"minimax","minimax-cn":"minimax"};function m(i){return a[o[i]||i]||[]}},8777:(i,e,n)=>{n.d(e,{KC:()=>a.KC,Xg:()=>a.Xg});var a=n(3097);Object.entries(n(2679).Q2).filter(([,i])=>i.passthroughModels).map(([i])=>i),Object.entries(a.vq).flatMap(([i,e])=>e.map(e=>({provider:i,model:e.id,name:e.name})))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3471],{4561:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>c});var a=t(5155),r=t(2115),i=t(5497),l=t(1620),n=t(1474),d=t(620);function c(){let{theme:e,setTheme:s,isDark:t}=(0,l.D)(),[c,o]=(0,r.useState)({fallbackStrategy:"fill-first"}),[m,x]=(0,r.useState)(!0),[h,p]=(0,r.useState)({current:"",new:"",confirm:""}),[u,b]=(0,r.useState)({type:"",message:""}),[j,f]=(0,r.useState)(!1);(0,r.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{o(e),x(!1)}).catch(e=>{console.error("Failed to fetch settings:",e),x(!1)})},[]);let g=async e=>{if(e.preventDefault(),h.new!==h.confirm)return void b({type:"error",message:"Passwords do not match"});f(!0),b({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:h.current,newPassword:h.new})}),s=await e.json();e.ok?(b({type:"success",message:"Password updated successfully"}),p({current:"",new:"",confirm:""})):b({type:"error",message:s.error||"Failed to update password"})}catch(e){b({type:"error",message:"An error occurred"})}finally{f(!1)}},N=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fallbackStrategy:e})})).ok&&o(s=>({...s,fallbackStrategy:e}))}catch(e){console.error("Failed to update settings:",e)}},y=async e=>{let s=parseInt(e);if(!isNaN(s)&&!(s<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stickyRoundRobinLimit:s})})).ok&&o(e=>({...e,stickyRoundRobinLimit:s}))}catch(e){console.error("Failed to update sticky limit:",e)}},v=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&o(s=>({...s,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},w=async(e,s)=>{let t=parseInt(s);if(!isNaN(t)&&!(t<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:t})})).ok&&o(s=>({...s,[e]:t}))}catch(s){console.error(`Failed to update ${e}:`,s)}};return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-4",children:[(0,a.jsx)("div",{className:"size-12 rounded-lg bg-green-500/10 text-green-500 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-2xl",children:"computer"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"Local Mode"}),(0,a.jsx)("p",{className:"text-text-muted",children:"Running on your machine"})]})]}),(0,a.jsx)("div",{className:"pt-4 border-t border-border",children:(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["All data is stored locally in the ",(0,a.jsx)("code",{className:"bg-sidebar px-1 rounded",children:"~/.9router/db.json"})," file."]})})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"shield"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Security"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require login"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,a.jsx)(i.lM,{checked:!0===c.requireLogin,onChange:()=>v(!c.requireLogin),disabled:m})]}),!0===c.requireLogin&&(0,a.jsxs)("form",{onSubmit:g,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[c.hasPassword&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Current Password"}),(0,a.jsx)(i.pd,{type:"password",placeholder:"Enter current password",value:h.current,onChange:e=>p({...h,current:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"New Password"}),(0,a.jsx)(i.pd,{type:"password",placeholder:"Enter new password",value:h.new,onChange:e=>p({...h,new:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Confirm New Password"}),(0,a.jsx)(i.pd,{type:"password",placeholder:"Confirm new password",value:h.confirm,onChange:e=>p({...h,confirm:e.target.value}),required:!0})]})]}),u.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===u.type?"text-red-500":"text-green-500"}`,children:u.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(i.$n,{type:"submit",variant:"primary",loading:j,children:c.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"route"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Routing Strategy"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Round Robin"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Cycle through accounts to distribute load"})]}),(0,a.jsx)(i.lM,{checked:"round-robin"===c.fallbackStrategy,onChange:()=>N("round-robin"===c.fallbackStrategy?"fill-first":"round-robin"),disabled:m})]}),"round-robin"===c.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Sticky Limit"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Calls per account before switching"})]}),(0,a.jsx)(i.pd,{type:"number",min:"1",max:"10",value:c.stickyRoundRobinLimit||3,onChange:e=>y(e.target.value),disabled:m,className:"w-20 text-center"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted italic pt-2 border-t border-border/50",children:"round-robin"===c.fallbackStrategy?`Currently distributing requests across all available accounts with ${c.stickyRoundRobinLimit||3} calls per account.`:"Currently using accounts in priority order (Fill First)."})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"palette"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Appearance"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Dark Mode"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Switch between light and dark themes"})]}),(0,a.jsx)(i.lM,{checked:t,onChange:()=>s(t?"light":"dark")})]}),(0,a.jsx)("div",{className:"pt-4 border-t border-border",children:(0,a.jsx)("div",{className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5",children:["light","dark","system"].map(t=>(0,a.jsxs)("button",{type:"button",onClick:()=>s(t),className:(0,n.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all",e===t?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"light"===t?"light_mode":"dark"===t?"dark_mode":"contrast"}),(0,a.jsx)("span",{className:"capitalize",children:t})]},t))})})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-green-500/10 text-green-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"database"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Data"})]}),(0,a.jsx)("div",{className:"flex flex-col gap-3",children:(0,a.jsx)("div",{className:"flex items-center justify-between p-4 rounded-lg bg-bg border border-border",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Database Location"}),(0,a.jsx)("p",{className:"text-sm text-text-muted font-mono",children:"~/.9router/db.json"})]})})})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-orange-500/10 text-orange-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"monitoring"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Observability"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Max Records"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Maximum request detail records to keep (older records are auto-deleted)"})]}),(0,a.jsx)(i.pd,{type:"number",min:"100",max:"10000",step:"100",value:c.observabilityMaxRecords||1e3,onChange:e=>w("observabilityMaxRecords",parseInt(e.target.value)),disabled:m,className:"w-28 text-center"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Batch Size"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Number of items to accumulate before writing to database (higher = better performance)"})]}),(0,a.jsx)(i.pd,{type:"number",min:"5",max:"100",step:"5",value:c.observabilityBatchSize||20,onChange:e=>w("observabilityBatchSize",parseInt(e.target.value)),disabled:m,className:"w-28 text-center"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Flush Interval (ms)"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Maximum time to wait before flushing buffer (prevents data loss during low traffic)"})]}),(0,a.jsx)(i.pd,{type:"number",min:"1000",max:"30000",step:"1000",value:c.observabilityFlushIntervalMs||5e3,onChange:e=>w("observabilityFlushIntervalMs",parseInt(e.target.value)),disabled:m,className:"w-28 text-center"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Max JSON Size (KB)"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Maximum size for each JSON field (request/response) before truncation"})]}),(0,a.jsx)(i.pd,{type:"number",min:"100",max:"10240",step:"100",value:c.observabilityMaxJsonSize||1024,onChange:e=>w("observabilityMaxJsonSize",parseInt(e.target.value)),disabled:m,className:"w-28 text-center"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted italic pt-2 border-t border-border/50",children:["Current: Keeps ",c.observabilityMaxRecords||1e3," records, batches every ",c.observabilityBatchSize||20," requests, max ",c.observabilityMaxJsonSize||1024,"KB per field"]})]})]}),(0,a.jsxs)("div",{className:"text-center text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[d.vQ.name," v",d.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:"Local Mode - All data stored on your machine"})]})]})})}},6086:(e,s,t)=>{Promise.resolve().then(t.bind(t,4561))}},e=>{e.O(0,[600,3624,8729,5497,8441,3794,7358],()=>e(e.s=6086)),_N_E=e.O()}]);
|
package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-d48c3e28182c53fd.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{2397:(e,t,i)=>{Promise.resolve().then(i.bind(i,7162))},7162:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>h});var s=i(5155),a=i(2115),l=i(4051),r=i.n(l),n=i(3321),o=i(8500),d=i.n(o),c=i(5772),p=i(5497),m=i(2679),u=i(8777),x=i(1059);function h(){let e=(0,n.useParams)(),t=(0,n.useRouter)(),i=e.id,[l,r]=(0,a.useState)([]),[o,h]=(0,a.useState)(!0),[v,b]=(0,a.useState)(null),[w,k]=(0,a.useState)(!1),[S,$]=(0,a.useState)(!1),[T,O]=(0,a.useState)(!1),[E,R]=(0,a.useState)(!1),[I,q]=(0,a.useState)(null),[P,U]=(0,a.useState)({}),[K,D]=(0,a.useState)(!1),{copied:M,copy:L}=(0,x.C)(),_=v?{id:v.id,name:v.name||("anthropic-compatible"===v.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===v.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===v.type?"AC":"OC",apiType:v.apiType,baseUrl:v.baseUrl,type:v.type}:m.zN[i]||m.fg[i]||m.IS[i],F=!!m.zN[i]||!!m.IS[i],z=(0,u.KC)(i),J=(0,m.wG)(i),W=(0,m.mq)(i),V=(0,m.gb)(i),B=W||V,Z=B?i:J,G=B?v?.prefix||i:J,Q=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&U(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),H=(0,a.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"})]),s=await e.json(),a=await t.json();if(e.ok){let e=(s.connections||[]).filter(e=>e.provider===i);r(e)}if(t.ok){let e=(a.nodes||[]).find(e=>e.id===i)||null;if(!e&&B)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===i)||null))break}b(e)}}catch(e){console.log("Error fetching connections:",e)}finally{h(!1)}},[i,B]),X=async e=>{try{let t=await fetch(`/api/provider-nodes/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(b(s.node),await H(),R(!1))}catch(e){console.log("Error updating provider node:",e)}};(0,a.useEffect)(()=>{H(),Q()},[H,Q]);let Y=async(e,t,i=J)=>{let s=`${i}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})});if(e.ok)await Q();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},ee=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await Q()}catch(e){console.log("Error deleting alias:",e)}},et=async e=>{if(confirm("Delete this connection?"))try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&r(l.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}},ei=()=>{H(),k(!1)},es=async e=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:i,...e})})).ok&&(await H(),$(!1))}catch(e){console.log("Error saving connection:",e)}},ea=async e=>{try{(await fetch(`/api/providers/${I.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await H(),O(!1))}catch(e){console.log("Error updating connection:",e)}},el=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&r(i=>i.map(i=>i.id===e?{...i,isActive:t}:i))}catch(e){console.log("Error updating connection status:",e)}},er=async(e,t)=>{if(e&&t)try{let i=t.priority,s=e.priority;i===s&&(i=l.indexOf(e)>l.indexOf(t)?t.priority-.5:t.priority+.5),await Promise.all([fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:i})}),fetch(`/api/providers/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:s})})]),await H()}catch(e){console.log("Error swapping priority:",e)}};return o?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(p.Qv,{}),(0,s.jsx)(p.Qv,{})]}):_?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(d(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("div",{className:"rounded-lg flex items-center justify-center",style:{backgroundColor:`${_.color}15`},children:K?(0,s.jsx)("span",{className:"text-sm font-bold",style:{color:_.color},children:_.textIcon||_.id.slice(0,2).toUpperCase()}):(0,s.jsx)(c.default,{src:W&&_.apiType?"responses"===_.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":V?"/providers/anthropic-m.png":`/providers/${_.id}.png`,alt:_.name,width:48,height:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",sizes:"48px",onError:()=>D(!0)})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:_.name}),(0,s.jsxs)("p",{className:"text-text-muted",children:[l.length," connection",1===l.length?"":"s"]})]})]})]}),B&&v&&(0,s.jsxs)(p.Zp,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:V?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:[V?"Messages API":"responses"===v.apiType?"Responses API":"Chat Completions"," \xb7 ",(v.baseUrl||"").replace(/\/$/,""),"/",V?"messages":"responses"===v.apiType?"responses":"chat/completions"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(p.$n,{size:"sm",icon:"add",onClick:()=>$(!0),disabled:l.length>0,children:"Add"}),(0,s.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>R(!0),children:"Edit"}),(0,s.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{if(confirm(`Delete this ${V?"Anthropic":"OpenAI"} Compatible node?`))try{(await fetch(`/api/provider-nodes/${i}`,{method:"DELETE"})).ok&&t.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}},children:"Delete"})]})]}),l.length>0&&(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Only one connection is allowed per compatible node. Add another node if you need more connections."})]}),(0,s.jsxs)(p.Zp,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),!B&&(0,s.jsx)(p.$n,{size:"sm",icon:"add",onClick:()=>F?k(!0):$(!0),children:"Add"})]}),0===l.length?(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:F?"lock":"key"})}),(0,s.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No connections yet"}),(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Add your first connection to get started"}),!B&&(0,s.jsx)(p.$n,{icon:"add",onClick:()=>F?k(!0):$(!0),children:"Add Connection"})]}):(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:l.sort((e,t)=>(e.priority||0)-(t.priority||0)).map((e,t)=>(0,s.jsx)(j,{connection:e,isOAuth:F,isFirst:0===t,isLast:t===l.length-1,onMoveUp:()=>er(e,l[t-1]),onMoveDown:()=>er(e,l[t+1]),onToggleActive:t=>el(e.id,t),onEdit:()=>{q(e),O(!0)},onDelete:()=>et(e.id)},e.id))})]}),(0,s.jsxs)(p.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:_.passthroughModels?"Model Aliases":"Available Models"}),B?(0,s.jsx)(g,{providerStorageAlias:Z,providerDisplayAlias:G,modelAliases:P,copied:M,onCopy:L,onSetAlias:Y,onDeleteAlias:ee,connections:l,isAnthropic:V}):_.passthroughModels?(0,s.jsx)(f,{providerAlias:J,modelAliases:P,copied:M,onCopy:L,onSetAlias:Y,onDeleteAlias:ee}):0===z.length?(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No models configured"}):(0,s.jsx)("div",{className:"flex flex-wrap gap-3",children:z.map(e=>{let t=`${Z}/${e.id}`,a=`${i}/${e.id}`,l=Object.entries(P).find(([,e])=>e===t||e===a)?.[0];return(0,s.jsx)(y,{model:e,fullModel:`${G}/${e.id}`,alias:l,copied:M,onCopy:L,onSetAlias:t=>Y(e.id,t,Z),onDeleteAlias:()=>ee(l)},e.id)})})]}),"kiro"===i?(0,s.jsx)(p.Mh,{isOpen:w,providerInfo:_,onSuccess:ei,onClose:()=>k(!1)}):"cursor"===i?(0,s.jsx)(p.G9,{isOpen:w,onSuccess:ei,onClose:()=>k(!1)}):(0,s.jsx)(p.LF,{isOpen:w,provider:i,providerInfo:_,onSuccess:ei,onClose:()=>k(!1)}),(0,s.jsx)(N,{isOpen:S,provider:i,providerName:_.name,isCompatible:B,isAnthropic:V,onSave:es,onClose:()=>$(!1)}),(0,s.jsx)(C,{isOpen:T,connection:I,onSave:ea,onClose:()=>O(!1)}),B&&(0,s.jsx)(A,{isOpen:E,node:v,onSave:X,onClose:()=>R(!1),isAnthropic:V})]}):(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,s.jsx)(d(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}function y({model:e,fullModel:t,alias:i,copied:a,onCopy:l}){return(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg border border-border hover:bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:"smart_toy"}),(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,s.jsx)("button",{onClick:()=>l(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:"Copy model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})})]})}function f({providerAlias:e,modelAliases:t,copied:i,onCopy:l,onSetAlias:r,onDeleteAlias:n}){let[o,d]=(0,a.useState)(""),[c,m]=(0,a.useState)(!1),u=Object.entries(t).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,i])=>({modelId:i.replace(`${e}/`,""),fullModel:i,alias:t})),x=async()=>{let e;if(!o.trim()||c)return;let i=o.trim(),s=(e=i.split("/"))[e.length-1];if(t[s])return void alert(`Alias "${s}" already exists. Please use a different model or edit existing alias.`);m(!0);try{await r(i,s),d("")}catch(e){console.log("Error adding model:",e)}finally{m(!1)}};return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"OpenRouter supports any model. Add models and create aliases for quick access."}),(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{htmlFor:"new-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID (from OpenRouter)"}),(0,s.jsx)("input",{id:"new-model-input",type:"text",value:o,onChange:e=>d(e.target.value),onKeyDown:e=>"Enter"===e.key&&x(),placeholder:"anthropic/claude-3-opus",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsx)(p.$n,{size:"sm",icon:"add",onClick:x,disabled:!o.trim()||c,children:c?"Adding...":"Add"})]}),u.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:u.map(({modelId:e,fullModel:t,alias:a})=>(0,s.jsx)(v,{modelId:e,fullModel:t,copied:i,onCopy:l,onDeleteAlias:()=>n(a)},t))})]})}function v({modelId:e,fullModel:t,copied:i,onCopy:a,onDeleteAlias:l}){return(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:"smart_toy"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,s.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:"Copy model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e}`?"check":"content_copy"})})]})]}),(0,s.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function g({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:i,copied:l,onCopy:r,onSetAlias:n,onDeleteAlias:o,connections:d,isAnthropic:c}){let[m,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),[y,f]=(0,a.useState)(!1),g=Object.entries(i).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,i])=>({modelId:i.replace(`${e}/`,""),fullModel:i,alias:t})),b=e=>{let s,a=(s=e.split("/"))[s.length-1];if(!i[a])return a;let l=`${t}-${a}`;return i[l]?null:l},j=async()=>{if(!m.trim()||x)return;let t=m.trim(),i=b(t);if(!i)return void alert("All suggested aliases already exist. Please choose a different model or remove conflicting aliases.");h(!0);try{await n(t,i,e),u("")}catch(e){console.log("Error adding model:",e)}finally{h(!1)}},N=async()=>{if(y)return;let t=d.find(e=>!1!==e.isActive);if(t){f(!0);try{let i=await fetch(`/api/providers/${t.id}/models`),s=await i.json();if(!i.ok)return void alert(s.error||"Failed to import models");let a=s.models||[];if(0===a.length)return void alert("No models returned from /models.");let l=0;for(let t of a){let i=t.id||t.name||t.model;if(!i)continue;let s=b(i);s&&(await n(i,s,e),l+=1)}0===l&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{f(!1)}}},C=d.some(e=>!1!==e.isActive);return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",c?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,s.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,s.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{id:"new-compatible-model-input",type:"text",value:m,onChange:e=>u(e.target.value),onKeyDown:e=>"Enter"===e.key&&j(),placeholder:c?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsx)(p.$n,{size:"sm",icon:"add",onClick:j,disabled:!m.trim()||x,children:x?"Adding...":"Add"}),(0,s.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"download",onClick:N,disabled:!C||y,children:y?"Importing...":"Import from /models"})]}),!C&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),g.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:g.map(({modelId:e,fullModel:i,alias:a})=>(0,s.jsx)(v,{modelId:e,fullModel:`${t}/${e}`,copied:l,onCopy:r,onDeleteAlias:()=>o(a)},i))})]})}function b({until:e}){let[t,i]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void i("");let s=Math.floor(t/1e3);if(s<60)i(`${s}s`);else if(s<3600)i(`${Math.floor(s/60)}m ${s%60}s`);else{let e=Math.floor(s/3600),t=Math.floor(s%3600/60);i(`${e}h ${t}m`)}};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function j({connection:e,isOAuth:t,isFirst:i,isLast:l,onMoveUp:r,onMoveDown:n,onToggleActive:o,onEdit:d,onDelete:c}){let m=t?e.name||e.email||e.displayName||"OAuth Account":e.name,[u,x]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let t=()=>{x(e.rateLimitedUntil&&new Date(e.rateLimitedUntil).getTime()>Date.now())};t();let i=e.rateLimitedUntil?setInterval(t,1e3):null;return()=>{i&&clearInterval(i)}},[e.rateLimitedUntil]);let h="unavailable"!==e.testStatus||u?e.testStatus:"active";return(0,s.jsxs)("div",{className:`group flex items-center justify-between p-3 rounded-lg hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{onClick:r,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:t?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:m}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,s.jsx)(p.Ex,{variant:!1===e.isActive?"default":"active"===h||"success"===h?"success":"error"===h||"expired"===h||"unavailable"===h?"error":"default",size:"sm",dot:!0,children:!1===e.isActive?"disabled":h||"Unknown"}),u&&!1!==e.isActive&&(0,s.jsx)(b,{until:e.rateLimitedUntil}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(p.lM,{size:"sm",checked:e.isActive??!0,onChange:o,title:e.isActive??!0?"Disable connection":"Enable connection"}),(0,s.jsxs)("div",{className:"flex gap-1 ml-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,s.jsx)("button",{onClick:d,className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})}),(0,s.jsx)("button",{onClick:c,className:"p-2 hover:bg-red-500/10 rounded text-red-500",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]})]})}function N({isOpen:e,provider:t,providerName:i,isCompatible:l,isAnthropic:r,onSave:n,onClose:o}){let[d,c]=(0,a.useState)({name:"",apiKey:"",priority:1}),[m,u]=(0,a.useState)(!1),[x,h]=(0,a.useState)(null),[y,f]=(0,a.useState)(!1),v=async()=>{u(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:d.apiKey})}),i=await e.json();h(i.valid?"success":"failed")}catch{h("failed")}finally{u(!1)}},g=async()=>{if(t&&d.apiKey){f(!0);try{let e=!1;try{u(!0),h(null);let i=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:d.apiKey})});e=!!(await i.json()).valid,h(e?"success":"failed")}catch{h("failed")}finally{u(!1)}await n({name:d.name,apiKey:d.apiKey,priority:d.priority,testStatus:e?"active":"unknown"})}finally{f(!1)}}};return t?(0,s.jsx)(p.aF,{isOpen:e,title:`Add ${i||t} API Key`,onClose:o,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(p.pd,{label:"Name",value:d.name,onChange:e=>c({...d,name:e.target.value}),placeholder:"Production Key"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.pd,{label:"API Key",type:"password",value:d.apiKey,onChange:e=>c({...d,apiKey:e.target.value}),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(p.$n,{onClick:v,disabled:!d.apiKey||m||y,variant:"secondary",children:m?"Checking...":"Check"})})]}),x&&(0,s.jsx)(p.Ex,{variant:"success"===x?"success":"error",children:"success"===x?"Valid":"Invalid"}),l&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:r?`Validation checks ${i||"Anthropic Compatible"} by verifying the API key.`:`Validation checks ${i||"OpenAI Compatible"} via /models on your base URL.`}),(0,s.jsx)(p.pd,{label:"Priority",type:"number",value:d.priority,onChange:e=>c({...d,priority:Number.parseInt(e.target.value)||1})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.$n,{onClick:g,fullWidth:!0,disabled:!d.name||!d.apiKey||y,children:y?"Saving...":"Save"}),(0,s.jsx)(p.$n,{onClick:o,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function C({isOpen:e,connection:t,onSave:i,onClose:l}){let[r,n]=(0,a.useState)({name:"",priority:1,apiKey:""}),[o,d]=(0,a.useState)(!1),[c,u]=(0,a.useState)(null),[x,h]=(0,a.useState)(!1),[y,f]=(0,a.useState)(null),[v,g]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t&&(n({name:t.name||"",priority:t.priority||1,apiKey:""}),u(null),f(null))},[t]);let b=async()=>{if(t?.provider){d(!0),u(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),i=await e.json();u(i.valid?"success":"failed")}catch{u("failed")}finally{d(!1)}}},j=async()=>{if(t?.provider&&r.apiKey){h(!0),f(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:r.apiKey})}),i=await e.json();f(i.valid?"success":"failed")}catch{f("failed")}finally{h(!1)}}},N=async()=>{g(!0);try{let e={name:r.name,priority:r.priority};if(!C&&r.apiKey){e.apiKey=r.apiKey;let i="success"===y;if(!i)try{h(!0),f(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:r.apiKey})});i=!!(await e.json()).valid,f(i?"success":"failed")}catch{f("failed")}finally{h(!1)}i&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null)}await i(e)}finally{g(!1)}};if(!t)return null;let C="oauth"===t.authType,A=(0,m.mq)(t.provider)||(0,m.gb)(t.provider);return(0,s.jsx)(p.aF,{isOpen:e,title:"Edit Connection",onClose:l,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(p.pd,{label:"Name",value:r.name,onChange:e=>n({...r,name:e.target.value}),placeholder:C?"Account name":"Production Key"}),C&&t.email&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,s.jsx)("p",{className:"font-medium",children:t.email})]}),(0,s.jsx)(p.pd,{label:"Priority",type:"number",value:r.priority,onChange:e=>n({...r,priority:Number.parseInt(e.target.value)||1})}),!C&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.pd,{label:"API Key",type:"password",value:r.apiKey,onChange:e=>n({...r,apiKey:e.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(p.$n,{onClick:j,disabled:!r.apiKey||x||v,variant:"secondary",children:x?"Checking...":"Check"})})]}),y&&(0,s.jsx)(p.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"})]}),!A&&(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(p.$n,{onClick:b,variant:"secondary",disabled:o,children:o?"Testing...":"Test Connection"}),c&&(0,s.jsx)(p.Ex,{variant:"success"===c?"success":"error",children:"success"===c?"Valid":"Failed"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.$n,{onClick:N,fullWidth:!0,disabled:v,children:v?"Saving...":"Save"}),(0,s.jsx)(p.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function A({isOpen:e,node:t,onSave:i,onClose:l,isAnthropic:r}){let[n,o]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[d,c]=(0,a.useState)(!1),[m,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),[y,f]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&o({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(r?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,r]);let v=async()=>{if(n.name.trim()&&n.prefix.trim()&&n.baseUrl.trim()){c(!0);try{let e={name:n.name,prefix:n.prefix,baseUrl:n.baseUrl};r||(e.apiType=n.apiType),await i(e)}finally{c(!1)}}},g=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:n.baseUrl,apiKey:m,type:r?"anthropic-compatible":"openai-compatible"})}),t=await e.json();f(t.valid?"success":"failed")}catch{f("failed")}finally{h(!1)}};return t?(0,s.jsx)(p.aF,{isOpen:e,title:`Edit ${r?"Anthropic":"OpenAI"} Compatible`,onClose:l,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(p.pd,{label:"Name",value:n.name,onChange:e=>o({...n,name:e.target.value}),placeholder:`${r?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,s.jsx)(p.pd,{label:"Prefix",value:n.prefix,onChange:e=>o({...n,prefix:e.target.value}),placeholder:r?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!r&&(0,s.jsx)(p.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:n.apiType,onChange:e=>o({...n,apiType:e.target.value})}),(0,s.jsx)(p.pd,{label:"Base URL",value:n.baseUrl,onChange:e=>o({...n,baseUrl:e.target.value}),placeholder:r?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${r?"Anthropic":"OpenAI"}-compatible API.`}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:e=>u(e.target.value),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(p.$n,{onClick:g,disabled:!m||x||!n.baseUrl.trim(),variant:"secondary",children:x?"Checking...":"Check"})})]}),y&&(0,s.jsx)(p.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.$n,{onClick:v,fullWidth:!0,disabled:!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim()||d,children:d?"Saving...":"Save"}),(0,s.jsx)(p.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}y.propTypes={model:r().shape({id:r().string.isRequired}).isRequired,fullModel:r().string.isRequired,alias:r().string,copied:r().string,onCopy:r().func.isRequired},f.propTypes={providerAlias:r().string.isRequired,modelAliases:r().object.isRequired,copied:r().string,onCopy:r().func.isRequired,onSetAlias:r().func.isRequired,onDeleteAlias:r().func.isRequired},v.propTypes={modelId:r().string.isRequired,fullModel:r().string.isRequired,copied:r().string,onCopy:r().func.isRequired,onDeleteAlias:r().func.isRequired},g.propTypes={providerStorageAlias:r().string.isRequired,providerDisplayAlias:r().string.isRequired,modelAliases:r().object.isRequired,copied:r().string,onCopy:r().func.isRequired,onSetAlias:r().func.isRequired,onDeleteAlias:r().func.isRequired,connections:r().arrayOf(r().shape({id:r().string,isActive:r().bool})).isRequired,isAnthropic:r().bool},b.propTypes={until:r().string.isRequired},j.propTypes={connection:r().shape({id:r().string,name:r().string,email:r().string,displayName:r().string,rateLimitedUntil:r().string,testStatus:r().string,isActive:r().bool,lastError:r().string,priority:r().number,globalPriority:r().number}).isRequired,isOAuth:r().bool.isRequired,isFirst:r().bool.isRequired,isLast:r().bool.isRequired,onMoveUp:r().func.isRequired,onMoveDown:r().func.isRequired,onToggleActive:r().func.isRequired,onEdit:r().func.isRequired,onDelete:r().func.isRequired},N.propTypes={isOpen:r().bool.isRequired,provider:r().string,providerName:r().string,isCompatible:r().bool,isAnthropic:r().bool,onSave:r().func.isRequired,onClose:r().func.isRequired},C.propTypes={isOpen:r().bool.isRequired,connection:r().shape({id:r().string,name:r().string,email:r().string,priority:r().number,authType:r().string,provider:r().string}),onSave:r().func.isRequired,onClose:r().func.isRequired},A.propTypes={isOpen:r().bool.isRequired,node:r().shape({id:r().string,name:r().string,prefix:r().string,apiType:r().string,baseUrl:r().string}),onSave:r().func.isRequired,onClose:r().func.isRequired,isAnthropic:r().bool}}},e=>{e.O(0,[600,3624,8729,5497,8441,3794,7358],()=>e(e.s=2397)),_N_E=e.O()}]);
|