@amir83nasr/10router 0.1.8 → 0.1.9
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +6 -6
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +23 -23
- package/.next/react-loadable-manifest.json +9 -0
- package/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
- package/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/[id]/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/[id]/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +2 -2
- package/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/quota/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/usage/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +5 -5
- package/.next/server/app/_not-found.segments/_full.segment.rsc +5 -5
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/cli-tools/all-statuses/route.js +1 -1
- package/.next/server/app/api/cli-tools/claude-settings/route.js +1 -1
- package/.next/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
- package/.next/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
- package/.next/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- package/.next/server/app/api/cli-tools/dsh-settings/route.js +1 -1
- package/.next/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/.next/server/app/api/combos/[id]/route.js +1 -1
- package/.next/server/app/api/combos/route.js +1 -1
- package/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/.next/server/app/api/oauth/codex/bulk-import/route.js +1 -1
- package/.next/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/.next/server/app/api/providers/[id]/models/route.js +1 -1
- package/.next/server/app/api/providers/client/route.js +1 -1
- package/.next/server/app/api/providers/route.js +1 -1
- package/.next/server/app/api/translator/send/route.js +1 -1
- package/.next/server/app/api/translator/translate/route.js +1 -1
- package/.next/server/app/api/tunnel/tailscale-install/route.js +2 -2
- package/.next/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/.next/server/app/api/usage/[connectionId]/route.js +1 -1
- package/.next/server/app/api/usage/stream/route.js +2 -6
- package/.next/server/app/api/v1/audio/speech/route.js +1 -1
- package/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/.next/server/app/api/v1/embeddings/route.js +1 -1
- package/.next/server/app/api/v1/images/generations/route.js +1 -1
- package/.next/server/app/api/v1/systemone/route.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/.next/server/app/callback.html +1 -1
- package/.next/server/app/callback.rsc +6 -6
- package/.next/server/app/callback.segments/_full.segment.rsc +6 -6
- package/.next/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/dashboard/basic-chat.html +1 -1
- package/.next/server/app/dashboard/basic-chat.rsc +7 -7
- package/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
- package/.next/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard/cli-tools.html +1 -1
- package/.next/server/app/dashboard/cli-tools.rsc +7 -7
- package/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
- package/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard/combos.html +1 -1
- package/.next/server/app/dashboard/combos.rsc +7 -7
- package/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
- package/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard/endpoint.html +1 -1
- package/.next/server/app/dashboard/endpoint.rsc +7 -7
- package/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
- package/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard/media-providers/systemone.html +1 -1
- package/.next/server/app/dashboard/media-providers/systemone.rsc +7 -7
- package/.next/server/app/dashboard/media-providers/systemone.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/systemone/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard/media-providers/systemone.segments/_full.segment.rsc +7 -7
- package/.next/server/app/dashboard/media-providers/systemone.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard/profile.html +1 -1
- package/.next/server/app/dashboard/profile.rsc +7 -7
- package/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
- package/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard/providers/new.html +1 -1
- package/.next/server/app/dashboard/providers/new.rsc +7 -7
- package/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
- package/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard/providers.html +1 -1
- package/.next/server/app/dashboard/providers.rsc +7 -7
- package/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
- package/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard/proxy-pools.html +1 -1
- package/.next/server/app/dashboard/proxy-pools.rsc +7 -7
- package/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
- package/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard/pxpipe.html +1 -1
- package/.next/server/app/dashboard/pxpipe.rsc +7 -7
- package/.next/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard/pxpipe.segments/_full.segment.rsc +7 -7
- package/.next/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard/quota.html +2 -2
- package/.next/server/app/dashboard/quota.rsc +8 -8
- package/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +8 -8
- package/.next/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
- package/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/.next/server/app/dashboard/settings/pricing.html +1 -1
- package/.next/server/app/dashboard/settings/pricing.rsc +6 -6
- package/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
- package/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/dashboard/token-saver.html +1 -1
- package/.next/server/app/dashboard/token-saver.rsc +6 -6
- package/.next/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
- package/.next/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard/usage.html +2 -2
- package/.next/server/app/dashboard/usage.rsc +7 -7
- package/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
- package/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard.html +1 -1
- package/.next/server/app/dashboard.rsc +7 -7
- package/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard.segments/_full.segment.rsc +7 -7
- package/.next/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +5 -5
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/index.segments/_full.segment.rsc +5 -5
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/.next/server/app/landing.html +1 -1
- package/.next/server/app/landing.rsc +6 -6
- package/.next/server/app/landing.segments/_full.segment.rsc +6 -6
- package/.next/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +5 -5
- package/.next/server/app/login.segments/_full.segment.rsc +5 -5
- package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +6 -6
- package/.next/server/chunks/1003.js +1 -1
- package/.next/server/chunks/1011.js +1 -1
- package/.next/server/chunks/1194.js +1 -1
- package/.next/server/chunks/1289.js +1 -1
- package/.next/server/chunks/1412.js +1 -1
- package/.next/server/chunks/1633.js +1 -1
- package/.next/server/chunks/1985.js +1 -1
- package/.next/server/chunks/2282.js +8 -4
- package/.next/server/chunks/2339.js +1 -1
- package/.next/server/chunks/2801.js +1 -1
- package/.next/server/chunks/3425.js +1 -1
- package/.next/server/chunks/4364.js +1 -1
- package/.next/server/chunks/460.js +1 -1
- package/.next/server/chunks/5761.js +1 -1
- package/.next/server/chunks/6056.js +1 -1
- package/.next/server/chunks/6343.js +3 -3
- package/.next/server/chunks/6823.js +1 -1
- package/.next/server/chunks/7019.js +2 -2
- package/.next/server/chunks/7348.js +1 -1
- package/.next/server/chunks/7504.js +1 -1
- package/.next/server/chunks/7535.js +2 -2
- package/.next/server/chunks/8923.js +1 -1
- package/.next/server/chunks/9018.js +1 -1
- package/.next/server/chunks/9250.js +1 -1
- package/.next/server/chunks/9429.js +1 -1
- package/.next/server/chunks/9646.js +1 -1
- package/.next/server/chunks/9817.js +67 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/middleware.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{1278-605cc36f762c2ea7.js → 1278-efb46cc82262aa4e.js} +1 -1
- package/.next/static/chunks/{1471-69a7c30abf98c656.js → 1471-10f225f62f7469cc.js} +1 -1
- package/.next/static/chunks/{1699-49be310981e2759e.js → 1699-13ee6864a8a31a96.js} +2 -2
- package/.next/static/chunks/{1830-901fe48c3c62604f.js → 1830-d26d77c95932d7ce.js} +1 -1
- package/.next/static/chunks/1940.1f30124180f22498.js +1 -0
- package/.next/static/chunks/{2836-8e7f4c382297ac97.js → 2836-d97f0aa2718945d5.js} +1 -1
- package/.next/static/chunks/3445-99e12528f235cedb.js +1 -0
- package/.next/static/chunks/{3577-1f02993330d7fba7.js → 3577-cd98d40e3099e1b0.js} +1 -1
- package/.next/static/chunks/{5862-6f3a3a6d4c00100d.js → 5862-f98c2f3d480b80d2.js} +1 -1
- package/.next/static/chunks/6770-e2921b2ce695ed57.js +1 -0
- package/.next/static/chunks/7276-a15e4d56ec28aba8.js +1 -0
- package/.next/static/chunks/{9369-7ef21480b9132957.js → 9369-0d43b295968c2168.js} +1 -1
- package/.next/static/chunks/{9ce8c186-6cd204e9c27ecee1.js → 9ce8c186-3c7d7dbc5d428052.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-9efe55fed2f7c81f.js → page-e8bceccb95695755.js} +2 -2
- package/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-9dcb29085167b384.js → page-adee408d9de02423.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/combos/{page-f5db9f681c6bface.js → page-d4c1e29e8d038f09.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/console-log/{page-d134cc313c9fa0b8.js → page-139200833f7a4ecc.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/endpoint/{page-f2d1a733e7f841cb.js → page-67516b120adbc4d7.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/media-providers/systemone/[id]/{page-0d6e623de6134598.js → page-b751d9603cb82e62.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/{page-e8f1d8be5e294fb0.js → page-315c9f52c472a700.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-c96cbcc4f5736e36.js → page-d5d480e209fdc55a.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/providers/new/{page-cc51346e464158b1.js → page-61b87a31ba21a055.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/providers/{page-1ee147fbe0693dc1.js → page-2396571281d02804.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-2287b1915fa887fc.js → page-cfd6bcb7e55d7d18.js} +2 -2
- package/.next/static/chunks/app/(dashboard)/dashboard/pxpipe/{page-696cb5c2703ca1ec.js → page-4d758f53c8cfc308.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/quota/{page-54a329d725734a1f.js → page-fef6edb7aafd8bd0.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/dashboard/usage/{page-a81f78bb43042c30.js → page-697f46461825d7fc.js} +1 -1
- package/.next/static/chunks/app/(dashboard)/{layout-c199eb2ad56ae96a.js → layout-5039502fc12707c9.js} +1 -1
- package/.next/static/chunks/app/{layout-9bd5877ae6198856.js → layout-8810d4df3081b5df.js} +1 -1
- package/.next/static/chunks/webpack-cb89101193742e2b.js +1 -0
- package/CHANGELOG.md +19 -0
- package/open-sse/executors/zed.js +98 -5
- package/open-sse/handlers/chatCore/sseToJsonHandler.js +11 -4
- package/open-sse/providers/pricing.js +24 -10
- package/open-sse/services/usage/antigravity-weekly.js +10 -0
- package/open-sse/services/usage/claude.js +15 -0
- package/open-sse/shared/zedAuth.js +43 -2
- package/open-sse/translator/concerns/prefetch.js +12 -4
- package/open-sse/translator/response/claude-to-openai.js +2 -2
- package/open-sse/utils/streamHandler.js +1 -5
- package/package.json +1 -1
- package/src/app/(dashboard)/dashboard/providers/[id]/BulkImportGrokCliModal.tsx +1 -1
- package/src/app/(dashboard)/dashboard/providers/[id]/page.tsx +1 -1
- package/src/app/(dashboard)/dashboard/usage/components/ProviderTopology.tsx +5 -2
- package/src/app/api/combos/[id]/route.js +38 -1
- package/src/app/api/combos/route.js +27 -2
- package/src/app/api/providers/[id]/models/route.js +12 -1
- package/src/app/api/providers/route.js +4 -1
- package/src/app/api/usage/stream/route.js +74 -68
- package/src/app/api/v1/models/route.js +20 -6
- package/src/lib/db/index.js +3 -0
- package/src/lib/db/repos/settingsRepo.js +22 -1
- package/src/lib/oauth/services/xai.js +4 -4
- package/src/lib/validateComboModels.ts +48 -0
- package/src/shared/components/UsageStats.tsx +7 -1
- package/src/shared/hooks/useShutdown.ts +2 -4
- package/src/sse/handlers/chat.js +5 -1
- package/src/sse/services/antigravityQuota.ts +7 -3
- package/src/sse/services/model.ts +9 -20
- package/.next/server/chunks/5351.js +0 -67
- package/.next/static/chunks/3973-424848b943e2ecab.js +0 -1
- package/.next/static/chunks/7276-16ef14f7b2cd478d.js +0 -1
- package/.next/static/chunks/webpack-452a2f4aec1a53ee.js +0 -1
- /package/.next/static/{iz7psrsEuHZGPvj7rbSWc → awjDWqWCZbU3VVSuN7-oA}/_buildManifest.js +0 -0
- /package/.next/static/{iz7psrsEuHZGPvj7rbSWc → awjDWqWCZbU3VVSuN7-oA}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3554],{7006:(e,s,t)=>{Promise.resolve().then(t.bind(t,32063))},15764:(e,s,t)=>{"use strict";t.d(s,{CK:()=>i.default,G9:()=>m.default,Iz:()=>f.default,KX:()=>j.PanelSkeleton,LF:()=>a.default,LH:()=>x.default,Mu:()=>j.StatCardSkeleton,Nf:()=>d.default,Qv:()=>r.CardSkeleton,YW:()=>y.YW,gw:()=>g.default,jK:()=>c.default,nh:()=>b.default,pV:()=>y.pV,rq:()=>n.default,uR:()=>o.default,uo:()=>l.ConfirmModal,vE:()=>u.default,vj:()=>p.default,wI:()=>h.default,wn:()=>y.wn,zY:()=>y.zY}),t(58913);var l=t(3537),r=t(58350);t(30872),t(33526),t(42535),t(1279);var a=t(92802),n=t(25908),o=t(58729),i=t(24873),d=t(5258),c=t(59553);t(949),t(56776),t(53599),t(88336),t(69561);var m=t(37753),x=t(23444),u=t(93624),p=t(86920),h=t(65461);t(14580);var g=t(14670),f=t(70296);t(57779),t(22205);var j=t(43276),b=t(75862),y=t(92412)},32063:(e,s,t)=>{"use strict";t.d(s,{default:()=>en});var l=t(29798),r=t(58913),a=t(15814),n=t(50141),o=t.n(n),i=t(15764),d=t(18055),c=t(738),m=t(90046),x=t(80159),u=t(75669),p=t(45111),h=t(1352),g=t(69221),f=t(7896),j=t(16653),b=t(51660),y=t(77345);function v({storageKey:e,changeEvent:s,itemField:t,normalize:l=e=>e,defaultName:r=e=>e}){let a=()=>{try{let s=JSON.parse(window.localStorage.getItem(e)||"[]");if(!Array.isArray(s))return[];return s.filter(e=>e?.name&&e?.[t])}catch{return[]}},n=t=>{window.localStorage.setItem(e,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(s))};return{read:a,subscribe:e=>(window.addEventListener(s,e),()=>window.removeEventListener(s,e)),upsert:(e,s)=>{let o=l(e);if(!o)return null;let i=a(),d=i.find(e=>l(e[t])===o);if(d&&!s)return d.name;let c=(s||r(o)).trim();return c?(n([...i.filter(e=>e.name!==c&&l(e[t])!==o),{name:c,[t]:o}].sort((e,s)=>e.name.localeCompare(s.name))),c):null},remove:e=>n(a().filter(s=>s.name!==e))}}let N=e=>(e||"").replace(/\/+$/,""),w=v({storageKey:"10router.cliToolEndpointPresets",changeEvent:"10router:endpoint-presets-changed",itemField:"baseUrl",normalize:N,defaultName:e=>{try{return new URL(e).host}catch{return e}}}),k=v({storageKey:"10router.cliToolApiKeyPresets",changeEvent:"10router:api-key-presets-changed",itemField:"key"}),C=w.read,_=w.subscribe,S=w.upsert,E=w.remove,A=k.read,$=k.subscribe,M=k.upsert,O=k.remove;function U(e,{tunnelPublicUrl:s,tailscaleUrl:t,cloudUrl:l}={}){let r=N(e);return!r||[`http://127.0.0.1:${b._$}`,s,t,l].filter(Boolean).flatMap(e=>[N(e),`${N(e)}/v1`]).includes(r)?null:S(r)}let P="__custom__",R="__save__",z=e=>{let s=(e||"").replace(/\/+$/,"");return s?/\/v1$/.test(s)?s:`${s}/v1`:""};function I({value:e,onChange:s,requiresExternalUrl:t=!1,tunnelEnabled:n=!1,tunnelPublicUrl:o="",tailscaleEnabled:i=!1,tailscaleUrl:d="",cloudEnabled:c=!1,cloudUrl:m="",withV1:x=!0,currentUrl:u=""}){let[g,f]=(0,a.useState)([]),[j,v]=(0,a.useState)(!1),[w,k]=(0,a.useState)(""),[A,$]=(0,a.useState)(""),M=(0,a.useRef)(!1),O=(0,a.useRef)("");(0,a.useEffect)(()=>{let e=()=>{let e=C();f(e),k(s=>{if(s!==P)return s;let t=N(O.current);if(!t)return s;let l=e.find(e=>{let s=N(e.baseUrl);return s===t||s===z(t)});return l?`saved:${l.name}`:s})};return e(),v(!0),_(e)},[]);let U=(0,a.useMemo)(()=>(({requiresExternalUrl:e,tunnelEnabled:s,tunnelPublicUrl:t,tailscaleEnabled:l,tailscaleUrl:r,cloudEnabled:a,cloudUrl:n,savedPresets:o,withV1:i})=>{let d=[],c=e=>i?z(e):(e||"").replace(/\/+$/,"");if(!e){let e=c(`http://127.0.0.1:${b._$}`);d.push({value:"local",label:e,url:e})}if(s&&t){let e=c(t);d.push({value:"tunnel",label:e,url:e})}if(l&&r){let e=c(r);d.push({value:"tailscale",label:e,url:e})}if(a&&n){let e=c(n);d.push({value:"cloud",label:e,url:e})}return o.forEach(e=>{d.push({value:`saved:${e.name}`,label:e.baseUrl,url:e.baseUrl,saved:!0})}),d.push({value:P,label:"Custom URL...",url:""}),d})({requiresExternalUrl:t,tunnelEnabled:n,tunnelPublicUrl:o,tailscaleEnabled:i,tailscaleUrl:d,cloudEnabled:c,cloudUrl:m,savedPresets:g,withV1:x}),[t,n,o,i,d,c,m,g,x]);(0,a.useEffect)(()=>{if(M.current||!j||0===U.length)return;M.current=!0;let e=N(u),t=(e?U.find(s=>s.saved&&N(s.url)===e):null)||U.find(e=>e.value!==P);t?(k(t.value),s(t.url)):k(P)},[j,U,s,u]);let T=w.startsWith("saved:"),L=w===P,K=L&&(A||"").trim().length>0;return(0,l.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(p.l6,{value:w,onValueChange:t=>{if(t===R){let s=(e||"").trim();if(!s)return;let t=s;try{t=new URL(s).host}catch{}let l=window.prompt("Save endpoint as:",t),r=l?.trim()?S(s,l.trim()):null;r&&k(`saved:${r}`);return}if(k(t),t===P){$(""),s("");return}let l=U.find(e=>e.value===t);l&&s(l.url)},children:[(0,l.jsx)(p.bq,{className:"flex-1 min-w-0 text-xs",children:(0,l.jsx)(p.yv,{placeholder:"Select endpoint"})}),(0,l.jsxs)(p.gC,{children:[U.map(e=>(0,l.jsx)(p.eb,{value:e.value,title:e.label,children:e.label},e.value)),K&&(0,l.jsx)(p.eb,{value:R,children:"+ Save current as..."})]})]}),T&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{type:"button",onClick:()=>{if(!w.startsWith("saved:"))return;E(w.slice(6)),$("");let e=U.find(e=>e.value!==P&&e.value!==w);e?(k(e.value),s(e.url)):(k(P),s(""))},className:"p-1 text-muted-foreground hover:text-red-500 rounded transition-colors shrink-0",children:(0,l.jsx)(r.default,{name:"delete",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Delete saved endpoint"})]})]}),L&&(0,l.jsx)(y.p,{type:"text",value:A,onChange:e=>{let t=e.target.value;O.current=t,$(t),s(t)},placeholder:x?"https://example.com/v1":"https://example.com",className:"h-9 text-xs"})]})}let T="__custom__",L="__save_key__";function K({value:e,onChange:s,apiKeys:t=[],cloudEnabled:n=!1,className:o=""}){let[i,d]=(0,a.useState)([]),[c,m]=(0,a.useState)(!1),[x,u]=(0,a.useState)("");(0,a.useEffect)(()=>{let e=()=>d(A());return e(),$(e)},[]);let g=(0,a.useMemo)(()=>[...t.map(e=>({value:e.key,label:e.key})),...i.map(e=>({value:`saved:${e.name}`,label:e.key,url:e.key,saved:!0})),{value:T,label:"Custom...",url:""}],[t,i]),f=e?g.find(s=>s.value===e||s.url===e):null,j=f?f.value:c||e?T:g[0]?.value??T,b=c?x:e||"",v="string"==typeof j&&j.startsWith("saved:"),N=j===T,w=N&&(e||"").trim().length>0&&!t.some(s=>s.key===e);return 0!==t.length||0!==i.length||c||e?(0,l.jsxs)("div",{className:`flex flex-col gap-1.5 ${o}`,children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(p.l6,{value:j,onValueChange:t=>{if(t===L)return void M((e||"").trim());if(t===T){m(!0),u(""),s("");return}m(!1),u("");let l=g.find(e=>e.value===t);l&&s(l.url??l.value)},children:[(0,l.jsx)(p.bq,{className:"flex-1 min-w-0 text-xs",children:(0,l.jsx)(p.yv,{placeholder:"Select key"})}),(0,l.jsxs)(p.gC,{children:[g.map(e=>(0,l.jsx)(p.eb,{value:e.value,title:e.label,children:e.label},e.value)),w&&(0,l.jsx)(p.eb,{value:L,children:"+ Save current as..."})]})]}),v&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{type:"button",onClick:()=>{if(!v)return;O(j.slice(6)),m(!1),u("");let e=g.find(e=>e.value!==T&&e.value!==j);s(e?e.url??e.value:"")},className:"p-1 text-muted-foreground hover:text-red-500 rounded transition-colors shrink-0",children:(0,l.jsx)(r.default,{name:"delete",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Delete saved key"})]})]}),N&&(0,l.jsx)(y.p,{type:"text",value:b,onChange:e=>{let t=e.target.value;m(!0),u(t),s(t)},placeholder:"sk-...",className:"h-9 text-xs"})]}):(0,l.jsx)("span",{className:`min-w-0 rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5 ${o}`,children:n?"No API keys - Create one in Keys page":"sk_10router (default)"})}let D=e=>(e||"").replace(/\/+$/,"");function W(e,s={}){if(!e)return!1;let t=D(e),{tunnelPublicUrl:l,tailscaleUrl:r,cloudUrl:a}=s;return!!(/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(t)||l&&t.startsWith(D(l))||r&&t.startsWith(D(r))||a&&t.startsWith(D(a)))}let H=/\[1m\]$/i,F=t(65746).env.NEXT_PUBLIC_CLOUD_URL,q=[{label:"Default",value:""},{label:"200K",value:"198000"},{label:"300K",value:"298000"},{label:"500K",value:"498000"},{label:"700K",value:"698000"}];function B({tool:e,isExpanded:s,onToggle:t,activeProviders:n,modelMappings:o,onModelMappingChange:c,baseUrl:m,hasActiveProviders:x,apiKeys:b,cloudEnabled:y,initialStatus:v,tunnelEnabled:N,tunnelPublicUrl:w,tailscaleEnabled:k,tailscaleUrl:C}){let _,S,E,[A,$]=(0,a.useState)(v||null),[M,O]=(0,a.useState)(!1),[P,R]=(0,a.useState)(!1),[z,T]=(0,a.useState)(!1),[L,D]=(0,a.useState)(null),[Z,Y]=(0,a.useState)(!1),[J,V]=(0,a.useState)(!1),[G,X]=(0,a.useState)(null),[Q,ee]=(0,a.useState)(""),[es,et]=(0,a.useState)({}),[el,er]=(0,a.useState)(!1),[ea,en]=(0,a.useState)(""),[eo,ei]=(0,a.useState)(!1),[ed,ec]=(0,a.useState)(!1),[em,ex]=(0,a.useState)(""),[eu,ep]=(0,a.useState)(!1),eh=(0,a.useRef)(!1),eg=A?.settings?.env?.ANTHROPIC_BASE_URL||"",ef=(()=>{if(!A?.installed)return null;let e=A.settings?.env?.ANTHROPIC_BASE_URL;return e?W(e,{tunnelPublicUrl:w,tailscaleUrl:C,cloudUrl:y?F:null})?"configured":"other":"not_configured"})();(0,a.useEffect)(()=>{b?.length>0&&!Q&&ee(b[0].key)},[b,Q]),(0,a.useEffect)(()=>{v&&($(v),ec(!!v.exaMcpEnabled))},[v]),(0,a.useEffect)(()=>{ex(A?.settings?.env?.CLAUDE_CODE_AUTO_COMPACT_WINDOW||"")},[A?.settings?.env?.CLAUDE_CODE_AUTO_COMPACT_WINDOW]),(0,a.useEffect)(()=>{let s=A?.settings?.env;s&&ep(e.defaultModels.some(e=>s[e.envKey]?.endsWith("[1m]")))},[A?.settings?.env,e.defaultModels]),(0,a.useEffect)(()=>{s&&(A||ey(),eb())},[s]),(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{ei(!!e.ccFilterNaming)}).catch(()=>{})},[]);let ej=async e=>{let s=!0===e;ei(s),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:s})}).catch(()=>{})},eb=async()=>{try{let e=await fetch("/api/models/alias"),s=await e.json();e.ok&&et(s.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(A?.installed&&!eh.current){eh.current=!0;let s=A.settings?.env||{};e.defaultModels.forEach(e=>{if(e.envKey){let t=s[e.envKey]||e.defaultValue||"";t&&c(e.alias,t)}});let t=s.ANTHROPIC_AUTH_TOKEN;t&&ee(t)}},[A,b,e.defaultModels,c]);let ey=async()=>{O(!0);try{let e=await fetch("/api/cli-tools/claude-settings"),s=await e.json();$(s),ec(!!s.exaMcpEnabled)}catch(e){$({installed:!1,error:e.message})}finally{O(!1)}},ev=()=>{let e=ea||m;return e.endsWith("/v1")?e:`${e}/v1`},eN=async()=>{R(!0),D(null);try{let s={ANTHROPIC_BASE_URL:ev()},t=Q?.trim()||(b?.length>0?b[0].key:null)||(y?null:"sk_10router");t&&(s.ANTHROPIC_AUTH_TOKEN=t),e.defaultModels.forEach(e=>{let t=o[e.alias];t&&e.envKey&&(s[e.envKey]=t)}),em&&(s.CLAUDE_CODE_AUTO_COMPACT_WINDOW=em);let l=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:s,exaMcpEnabled:ed,autoCompactWindow:em})}),r=await l.json();l.ok?(U(ev(),{tunnelPublicUrl:w,tailscaleUrl:C}),D({type:"success",text:"Settings applied successfully!"}),$(e=>({...e,hasBackup:!0,settings:{...e?.settings,env:s},exaMcpEnabled:ed}))):D({type:"error",text:r.error||"Failed to apply settings"})}catch(e){D({type:"error",text:e.message})}finally{R(!1)}},ew=async()=>{T(!0),D(null);try{let s=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),t=await s.json();s.ok?(D({type:"success",text:"Settings reset successfully!"}),e.defaultModels.forEach(e=>c(e.alias,e.defaultValue||"")),ee(""),ec(!1),ex(""),ep(!1)):D({type:"error",text:t.error||"Failed to reset settings"})}catch(e){D({type:"error",text:e.message})}finally{T(!1)}};return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,children:(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(j.default,{src:"/providers/claude.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===ef&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===ef&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===ef&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.description})]})]})}),s&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[M&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,l.jsx)(r.default,{name:"progress_activity",className:"animate-spin"}),(0,l.jsx)("span",{children:"Checking Claude CLI..."})]}),!M&&A&&!A.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)(r.default,{name:"warning",className:"text-yellow-500"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:A.container?"10Router runs in a container":"Claude CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:A.container?"The CLI lives on your host, not inside the container. Copy the manual config below into your host's ~/.claude/settings.json.":"Manual configuration is still available if 10router is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(d.$,{variant:"secondary",size:"sm",onClick:()=>er(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:()=>Y(!Z),children:[(0,l.jsx)(r.default,{name:Z?"expand_less":"help",className:"text-[18px] mr-1"}),Z?"Hide":"How to Install"]})]})]}),Z&&(0,l.jsxs)("div",{className:"p-4 bg-card border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-muted-foreground mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,l.jsxs)("p",{className:"text-muted-foreground",children:["After installation, run"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!M&&A?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)(I,{value:ea||((_=ea||m).endsWith("/v1")?_:`${_}/v1`),onChange:en,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:N,tunnelPublicUrl:w,tailscaleEnabled:k,tailscaleUrl:C,currentUrl:eg})]}),A?.settings?.env?.ANTHROPIC_BASE_URL&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5",children:A.settings.env.ANTHROPIC_BASE_URL})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)(K,{value:Q,onChange:ee,apiKeys:b,cloudEnabled:y})]}),e.defaultModels.map(e=>(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:e.name}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:o[e.alias]||"",onChange:s=>c(e.alias,s.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-card rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),o[e.alias]&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>c(e.alias,""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-muted-foreground hover:text-red-500 rounded transition-colors",children:(0,l.jsx)(r.default,{name:"close",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Clear"})]})]}),(0,l.jsx)("button",{onClick:()=>{X(e.alias),V(!0)},className:"w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 bg-card border-border text-foreground hover:border-primary cursor-pointer",children:"Select Model"})]},e.alias)),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Auto-compact"}),(0,l.jsxs)(p.l6,{value:em||"__default__",onValueChange:e=>ex("__default__"===e?"":e),children:[(0,l.jsx)(p.bq,{className:"w-full text-xs",children:(0,l.jsx)(p.yv,{})}),(0,l.jsx)(p.gC,{children:q.map(e=>(0,l.jsx)(p.eb,{value:e.value||"__default__",children:e.label},e.label))})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"1M context"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)(f.S,{checked:eu,onCheckedChange:s=>{var t;ep(t=!0===s),e.defaultModels.forEach(e=>{let s=o[e.alias];s&&c(e.alias,((e,s)=>{let{model:t}=function(e){if("string"!=typeof e)return{model:e,contextMarker:null};let s=e.trim(),t=s.match(H);return t?{model:s.slice(0,-t[0].length),contextMarker:t[0].slice(1,-1).toLowerCase()}:{model:e,contextMarker:null}}(e);return s?`${t}[1m]`:t})(s,t))})}}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Append [1m] to the model name"}),(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("span",{className:"relative inline-flex",children:(0,l.jsx)(r.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,l.jsx)(h.ZI,{side:"top",children:"Claude Code otherwise assumes a 200K window, which clamps the auto-compact window above. Applied to every mapped model — only enable it for models that really accept 1M."})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Filter naming"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)(f.S,{checked:eo,onCheckedChange:ej}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Filter naming requests"}),(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("span",{className:"relative inline-flex",children:(0,l.jsx)(r.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,l.jsx)(h.ZI,{side:"top",children:"Intercepts Claude Code's topic-naming requests and returns a fake response locally, saving API tokens."})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Web Search"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)(f.S,{checked:ed,onCheckedChange:e=>ec(!0===e)}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Exa MCP"}),(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("span",{className:"relative inline-flex",children:(0,l.jsx)(r.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,l.jsx)(h.ZI,{side:"top",children:"Injects Exa MCP into ~/.claude.json so non-Claude models gain web search. Restart Claude Code after Apply."})]})]})]})]}),L&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===L.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)(r.default,{name:"success"===L.type?"check_circle":"error",className:"text-[14px]"}),(0,l.jsx)("span",{children:L.text})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(d.$,{size:"sm",onClick:eN,disabled:P,children:[P&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:ew,disabled:!A?.has10Router||z,children:[z&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,l.jsxs)(d.$,{variant:"ghost",size:"sm",onClick:()=>er(!0),children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),J&&(0,l.jsx)(i.rq,{isOpen:J,onClose:()=>V(!1),onSelect:e=>{G&&c(G,e.value)},selectedModel:G?o[G]:null,activeProviders:n,modelAliases:es,title:`Select model for ${G}`}),(0,l.jsx)(i.uR,{isOpen:el,onClose:()=>er(!1),title:"Claude CLI - Manual Configuration",configs:(S=Q&&Q.trim()?Q:y?"<API_KEY_FROM_DASHBOARD>":"sk_10router",E={ANTHROPIC_BASE_URL:ev(),ANTHROPIC_AUTH_TOKEN:S},e.defaultModels.forEach(e=>{let s=o[e.alias];s&&e.envKey&&(E[e.envKey]=s)}),em&&(E.CLAUDE_CODE_AUTO_COMPACT_WINDOW=em),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:E},null,2)}])})]})})}function Z({tool:e,isExpanded:s,onToggle:t,baseUrl:n,apiKeys:o,activeProviders:c,cloudEnabled:m,initialStatus:x,tunnelEnabled:p,tunnelPublicUrl:f,tailscaleEnabled:b,tailscaleUrl:y}){let v,N,w,[k,C]=(0,a.useState)(x||null),[_,S]=(0,a.useState)(!1),[E,A]=(0,a.useState)(!1),[$,M]=(0,a.useState)(!1),[O,P]=(0,a.useState)(null),[R,z]=(0,a.useState)(!1),[T,L]=(0,a.useState)(""),[D,H]=(0,a.useState)([]),[F,q]=(0,a.useState)(""),[B,Y]=(0,a.useState)(!1),[J,V]=(0,a.useState)(!1),[G,X]=(0,a.useState)({}),[Q,ee]=(0,a.useState)(!1),[es,et]=(0,a.useState)("");(0,a.useEffect)(()=>{o?.length>0&&!T&&L(o[0].key)},[o,T]),(0,a.useEffect)(()=>{x&&C(x)},[x]),(0,a.useEffect)(()=>{s&&(k||eo(),el())},[s]);let el=async()=>{try{let e=await fetch("/api/models/alias"),s=await e.json();e.ok&&X(s.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(k?.profiles&&H(k.profiles.map(e=>e.model).filter(Boolean)),k?.config){let e=k.config.match(/^default_subagent_model\s*=\s*"([^"]+)"/m);e&&q(e[1])}},[k]);let er=(v=k?.config?.match(/base_url\s*=\s*"([^"]+)"/))?v[1]:"",ea=k?.installed?k.config?W(er,{tunnelPublicUrl:f,tailscaleUrl:y})?"configured":"other":"not_configured":null,en=()=>{let e=es||`${n}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},eo=async()=>{S(!0);try{let e=await fetch("/api/cli-tools/codex-settings"),s=await e.json();C(s)}catch(e){C({installed:!1,error:e.message})}finally{S(!1)}},ei=async()=>{A(!0),P(null);try{let e=T&&T.trim()||m?T:"sk_10router",s=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:en(),apiKey:e,models:D,subagentModel:F})}),t=await s.json();s.ok?(U(en(),{tunnelPublicUrl:f,tailscaleUrl:y}),P({type:"success",text:"Applied — models appear in codex /model. Account default kept; use codex --profile 10router-<model> for 10Router routing."}),eo()):P({type:"error",text:t.error||"Failed to apply settings"})}catch(e){P({type:"error",text:e.message})}finally{A(!1)}},ed=async()=>{M(!0),P(null);try{let e=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),s=await e.json();e.ok?(P({type:"success",text:"Settings reset successfully!"}),H([]),q(""),eo()):P({type:"error",text:s.error||"Failed to reset settings"})}catch(e){P({type:"error",text:e.message})}finally{M(!1)}};return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,children:(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(j.default,{src:"/providers/codex.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===ea&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===ea&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===ea&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.description})]})]})}),s&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[_&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,l.jsx)(r.default,{name:"progress_activity",className:"animate-spin"}),(0,l.jsx)("span",{children:"Checking Codex CLI..."})]}),!_&&k&&!k.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)(r.default,{name:"warning",className:"text-yellow-500"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:k.container?"10Router runs in a container":"Codex CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:k.container?"The CLI lives on your host, not inside the container. Copy the manual config below into your host's ~/.codex/config.toml.":"Manual configuration is still available if 10router is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(d.$,{variant:"secondary",size:"sm",onClick:()=>ee(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:()=>z(!R),children:[(0,l.jsx)(r.default,{name:R?"expand_less":"help",className:"text-[18px] mr-1"}),R?"Hide":"How to Install"]})]})]}),R&&(0,l.jsxs)("div",{className:"p-4 bg-card border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-muted-foreground mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,l.jsxs)("p",{className:"text-muted-foreground",children:["After installation, run"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," to verify."]}),(0,l.jsx)("div",{className:"pt-2 border-t border-border",children:(0,l.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Codex reads custom providers from"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/config.toml"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!_&&k?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[k?.rootHijacked&&(0,l.jsxs)("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-xs bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",children:[(0,l.jsx)(r.default,{name:"warning",className:"text-[14px] shrink-0 mt-0.5"}),(0,l.jsx)("span",{children:"Old settings overrode your default Codex model. Apply to restore your ChatGPT account default — added models become profiles."})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)(I,{value:es||es||`${n}/v1`,onChange:et,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:f,tailscaleEnabled:b,tailscaleUrl:y,currentUrl:er})]}),k?.config&&(er?(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5",children:er})]}):null),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)(K,{value:T,onChange:L,apiKeys:o,cloudEnabled:m})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Models"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,l.jsx)("div",{className:"flex min-h-7 flex-wrap gap-1.5 rounded border border-border bg-card px-2 py-1.5",children:0===D.length?(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"No models added"}):D.map(e=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-transparent bg-black/5 px-2 py-0.5 text-xs text-muted-foreground hover:border-border dark:bg-white/5",children:[e,(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>H(D.filter(s=>s!==e)),className:"ml-0.5 hover:text-red-500",children:(0,l.jsx)(r.default,{name:"close",className:"text-[12px]"})})}),(0,l.jsx)(h.ZI,{children:"Remove"})]})]},e))}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("button",{onClick:()=>Y(!0),className:"cursor-pointer rounded border border-border bg-card px-2 py-1 text-xs text-foreground transition-colors hover:border-primary",children:"Add Model"}),(0,l.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Launch:"," ",(0,l.jsx)("code",{className:"rounded bg-black/5 px-1 dark:bg-white/5",children:"codex --profile 10router-<model>"})]})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Subagent Model"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:F,onChange:e=>q(e.target.value),placeholder:D[0]||"provider/model-id (defaults to main model)",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-card rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),F&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>q(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-muted-foreground hover:text-red-500 rounded transition-colors",children:(0,l.jsx)(r.default,{name:"close",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Clear (will use main model)"})]})]}),(0,l.jsx)("button",{onClick:()=>V(!0),className:"w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 bg-card border-border text-foreground hover:border-primary cursor-pointer",children:"Select Model"})]})]}),O&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===O.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)(r.default,{name:"success"===O.type?"check_circle":"error",className:"text-[14px]"}),(0,l.jsx)("span",{children:O.text})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(d.$,{size:"sm",onClick:ei,disabled:!T&&m&&o.length>0||0===D.length||E,children:[E&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:ed,disabled:$,children:[$&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,l.jsxs)(d.$,{variant:"ghost",size:"sm",onClick:()=>ee(!0),children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),B&&(0,l.jsx)(i.rq,{isOpen:B,onClose:()=>Y(!1),onSelect:e=>{D.includes(e.value)||H([...D,e.value])},onDeselect:e=>{H(D.filter(s=>s!==e.value))},selectedModel:null,addedModelValues:D,closeOnSelect:!1,title:"Add Models for Codex",activeProviders:c,modelAliases:G}),J&&(0,l.jsx)(i.rq,{isOpen:J,onClose:()=>V(!1),onSelect:e=>{q(e.value),V(!1)},selectedModel:F,activeProviders:c,modelAliases:G,title:"Select Subagent Model for Codex"}),(0,l.jsx)(i.uR,{isOpen:Q,onClose:()=>ee(!1),title:"Codex CLI - Manual Configuration",configs:(N=T&&T.trim()?T:m?"<API_KEY_FROM_DASHBOARD>":"sk_10router",w=[{filename:"~/.codex/config.toml",content:`# 10Router Configuration for Codex CLI
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3554],{7006:(e,s,t)=>{Promise.resolve().then(t.bind(t,32063))},15764:(e,s,t)=>{"use strict";t.d(s,{CK:()=>i.default,G9:()=>m.default,Iz:()=>f.default,KX:()=>j.PanelSkeleton,LF:()=>a.default,LH:()=>x.default,Mu:()=>j.StatCardSkeleton,Nf:()=>d.default,Qv:()=>r.CardSkeleton,YW:()=>y.YW,gw:()=>g.default,jK:()=>c.default,nh:()=>b.default,pV:()=>y.pV,rq:()=>n.default,uR:()=>o.default,uo:()=>l.ConfirmModal,vE:()=>u.default,vj:()=>p.default,wI:()=>h.default,wn:()=>y.wn,zY:()=>y.zY}),t(58913);var l=t(3537),r=t(58350);t(30872),t(33526),t(42535),t(1279);var a=t(92802),n=t(25908),o=t(58729),i=t(24873),d=t(5258),c=t(80599);t(949),t(56776),t(53599),t(88336),t(69561);var m=t(37753),x=t(23444),u=t(93624),p=t(86920),h=t(65461);t(14580);var g=t(14670),f=t(70296);t(57779),t(22205);var j=t(43276),b=t(75862),y=t(92412)},32063:(e,s,t)=>{"use strict";t.d(s,{default:()=>en});var l=t(29798),r=t(58913),a=t(15814),n=t(50141),o=t.n(n),i=t(15764),d=t(18055),c=t(738),m=t(90046),x=t(80159),u=t(75669),p=t(45111),h=t(1352),g=t(69221),f=t(7896),j=t(16653),b=t(51660),y=t(77345);function v({storageKey:e,changeEvent:s,itemField:t,normalize:l=e=>e,defaultName:r=e=>e}){let a=()=>{try{let s=JSON.parse(window.localStorage.getItem(e)||"[]");if(!Array.isArray(s))return[];return s.filter(e=>e?.name&&e?.[t])}catch{return[]}},n=t=>{window.localStorage.setItem(e,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(s))};return{read:a,subscribe:e=>(window.addEventListener(s,e),()=>window.removeEventListener(s,e)),upsert:(e,s)=>{let o=l(e);if(!o)return null;let i=a(),d=i.find(e=>l(e[t])===o);if(d&&!s)return d.name;let c=(s||r(o)).trim();return c?(n([...i.filter(e=>e.name!==c&&l(e[t])!==o),{name:c,[t]:o}].sort((e,s)=>e.name.localeCompare(s.name))),c):null},remove:e=>n(a().filter(s=>s.name!==e))}}let N=e=>(e||"").replace(/\/+$/,""),w=v({storageKey:"10router.cliToolEndpointPresets",changeEvent:"10router:endpoint-presets-changed",itemField:"baseUrl",normalize:N,defaultName:e=>{try{return new URL(e).host}catch{return e}}}),k=v({storageKey:"10router.cliToolApiKeyPresets",changeEvent:"10router:api-key-presets-changed",itemField:"key"}),C=w.read,_=w.subscribe,S=w.upsert,E=w.remove,A=k.read,$=k.subscribe,M=k.upsert,O=k.remove;function U(e,{tunnelPublicUrl:s,tailscaleUrl:t,cloudUrl:l}={}){let r=N(e);return!r||[`http://127.0.0.1:${b._$}`,s,t,l].filter(Boolean).flatMap(e=>[N(e),`${N(e)}/v1`]).includes(r)?null:S(r)}let P="__custom__",R="__save__",z=e=>{let s=(e||"").replace(/\/+$/,"");return s?/\/v1$/.test(s)?s:`${s}/v1`:""};function I({value:e,onChange:s,requiresExternalUrl:t=!1,tunnelEnabled:n=!1,tunnelPublicUrl:o="",tailscaleEnabled:i=!1,tailscaleUrl:d="",cloudEnabled:c=!1,cloudUrl:m="",withV1:x=!0,currentUrl:u=""}){let[g,f]=(0,a.useState)([]),[j,v]=(0,a.useState)(!1),[w,k]=(0,a.useState)(""),[A,$]=(0,a.useState)(""),M=(0,a.useRef)(!1),O=(0,a.useRef)("");(0,a.useEffect)(()=>{let e=()=>{let e=C();f(e),k(s=>{if(s!==P)return s;let t=N(O.current);if(!t)return s;let l=e.find(e=>{let s=N(e.baseUrl);return s===t||s===z(t)});return l?`saved:${l.name}`:s})};return e(),v(!0),_(e)},[]);let U=(0,a.useMemo)(()=>(({requiresExternalUrl:e,tunnelEnabled:s,tunnelPublicUrl:t,tailscaleEnabled:l,tailscaleUrl:r,cloudEnabled:a,cloudUrl:n,savedPresets:o,withV1:i})=>{let d=[],c=e=>i?z(e):(e||"").replace(/\/+$/,"");if(!e){let e=c(`http://127.0.0.1:${b._$}`);d.push({value:"local",label:e,url:e})}if(s&&t){let e=c(t);d.push({value:"tunnel",label:e,url:e})}if(l&&r){let e=c(r);d.push({value:"tailscale",label:e,url:e})}if(a&&n){let e=c(n);d.push({value:"cloud",label:e,url:e})}return o.forEach(e=>{d.push({value:`saved:${e.name}`,label:e.baseUrl,url:e.baseUrl,saved:!0})}),d.push({value:P,label:"Custom URL...",url:""}),d})({requiresExternalUrl:t,tunnelEnabled:n,tunnelPublicUrl:o,tailscaleEnabled:i,tailscaleUrl:d,cloudEnabled:c,cloudUrl:m,savedPresets:g,withV1:x}),[t,n,o,i,d,c,m,g,x]);(0,a.useEffect)(()=>{if(M.current||!j||0===U.length)return;M.current=!0;let e=N(u),t=(e?U.find(s=>s.saved&&N(s.url)===e):null)||U.find(e=>e.value!==P);t?(k(t.value),s(t.url)):k(P)},[j,U,s,u]);let T=w.startsWith("saved:"),L=w===P,K=L&&(A||"").trim().length>0;return(0,l.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(p.l6,{value:w,onValueChange:t=>{if(t===R){let s=(e||"").trim();if(!s)return;let t=s;try{t=new URL(s).host}catch{}let l=window.prompt("Save endpoint as:",t),r=l?.trim()?S(s,l.trim()):null;r&&k(`saved:${r}`);return}if(k(t),t===P){$(""),s("");return}let l=U.find(e=>e.value===t);l&&s(l.url)},children:[(0,l.jsx)(p.bq,{className:"flex-1 min-w-0 text-xs",children:(0,l.jsx)(p.yv,{placeholder:"Select endpoint"})}),(0,l.jsxs)(p.gC,{children:[U.map(e=>(0,l.jsx)(p.eb,{value:e.value,title:e.label,children:e.label},e.value)),K&&(0,l.jsx)(p.eb,{value:R,children:"+ Save current as..."})]})]}),T&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{type:"button",onClick:()=>{if(!w.startsWith("saved:"))return;E(w.slice(6)),$("");let e=U.find(e=>e.value!==P&&e.value!==w);e?(k(e.value),s(e.url)):(k(P),s(""))},className:"p-1 text-muted-foreground hover:text-red-500 rounded transition-colors shrink-0",children:(0,l.jsx)(r.default,{name:"delete",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Delete saved endpoint"})]})]}),L&&(0,l.jsx)(y.p,{type:"text",value:A,onChange:e=>{let t=e.target.value;O.current=t,$(t),s(t)},placeholder:x?"https://example.com/v1":"https://example.com",className:"h-9 text-xs"})]})}let T="__custom__",L="__save_key__";function K({value:e,onChange:s,apiKeys:t=[],cloudEnabled:n=!1,className:o=""}){let[i,d]=(0,a.useState)([]),[c,m]=(0,a.useState)(!1),[x,u]=(0,a.useState)("");(0,a.useEffect)(()=>{let e=()=>d(A());return e(),$(e)},[]);let g=(0,a.useMemo)(()=>[...t.map(e=>({value:e.key,label:e.key})),...i.map(e=>({value:`saved:${e.name}`,label:e.key,url:e.key,saved:!0})),{value:T,label:"Custom...",url:""}],[t,i]),f=e?g.find(s=>s.value===e||s.url===e):null,j=f?f.value:c||e?T:g[0]?.value??T,b=c?x:e||"",v="string"==typeof j&&j.startsWith("saved:"),N=j===T,w=N&&(e||"").trim().length>0&&!t.some(s=>s.key===e);return 0!==t.length||0!==i.length||c||e?(0,l.jsxs)("div",{className:`flex flex-col gap-1.5 ${o}`,children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(p.l6,{value:j,onValueChange:t=>{if(t===L)return void M((e||"").trim());if(t===T){m(!0),u(""),s("");return}m(!1),u("");let l=g.find(e=>e.value===t);l&&s(l.url??l.value)},children:[(0,l.jsx)(p.bq,{className:"flex-1 min-w-0 text-xs",children:(0,l.jsx)(p.yv,{placeholder:"Select key"})}),(0,l.jsxs)(p.gC,{children:[g.map(e=>(0,l.jsx)(p.eb,{value:e.value,title:e.label,children:e.label},e.value)),w&&(0,l.jsx)(p.eb,{value:L,children:"+ Save current as..."})]})]}),v&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{type:"button",onClick:()=>{if(!v)return;O(j.slice(6)),m(!1),u("");let e=g.find(e=>e.value!==T&&e.value!==j);s(e?e.url??e.value:"")},className:"p-1 text-muted-foreground hover:text-red-500 rounded transition-colors shrink-0",children:(0,l.jsx)(r.default,{name:"delete",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Delete saved key"})]})]}),N&&(0,l.jsx)(y.p,{type:"text",value:b,onChange:e=>{let t=e.target.value;m(!0),u(t),s(t)},placeholder:"sk-...",className:"h-9 text-xs"})]}):(0,l.jsx)("span",{className:`min-w-0 rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5 ${o}`,children:n?"No API keys - Create one in Keys page":"sk_10router (default)"})}let D=e=>(e||"").replace(/\/+$/,"");function W(e,s={}){if(!e)return!1;let t=D(e),{tunnelPublicUrl:l,tailscaleUrl:r,cloudUrl:a}=s;return!!(/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(t)||l&&t.startsWith(D(l))||r&&t.startsWith(D(r))||a&&t.startsWith(D(a)))}let H=/\[1m\]$/i,F=t(65746).env.NEXT_PUBLIC_CLOUD_URL,q=[{label:"Default",value:""},{label:"200K",value:"198000"},{label:"300K",value:"298000"},{label:"500K",value:"498000"},{label:"700K",value:"698000"}];function B({tool:e,isExpanded:s,onToggle:t,activeProviders:n,modelMappings:o,onModelMappingChange:c,baseUrl:m,hasActiveProviders:x,apiKeys:b,cloudEnabled:y,initialStatus:v,tunnelEnabled:N,tunnelPublicUrl:w,tailscaleEnabled:k,tailscaleUrl:C}){let _,S,E,[A,$]=(0,a.useState)(v||null),[M,O]=(0,a.useState)(!1),[P,R]=(0,a.useState)(!1),[z,T]=(0,a.useState)(!1),[L,D]=(0,a.useState)(null),[Z,Y]=(0,a.useState)(!1),[J,V]=(0,a.useState)(!1),[G,X]=(0,a.useState)(null),[Q,ee]=(0,a.useState)(""),[es,et]=(0,a.useState)({}),[el,er]=(0,a.useState)(!1),[ea,en]=(0,a.useState)(""),[eo,ei]=(0,a.useState)(!1),[ed,ec]=(0,a.useState)(!1),[em,ex]=(0,a.useState)(""),[eu,ep]=(0,a.useState)(!1),eh=(0,a.useRef)(!1),eg=A?.settings?.env?.ANTHROPIC_BASE_URL||"",ef=(()=>{if(!A?.installed)return null;let e=A.settings?.env?.ANTHROPIC_BASE_URL;return e?W(e,{tunnelPublicUrl:w,tailscaleUrl:C,cloudUrl:y?F:null})?"configured":"other":"not_configured"})();(0,a.useEffect)(()=>{b?.length>0&&!Q&&ee(b[0].key)},[b,Q]),(0,a.useEffect)(()=>{v&&($(v),ec(!!v.exaMcpEnabled))},[v]),(0,a.useEffect)(()=>{ex(A?.settings?.env?.CLAUDE_CODE_AUTO_COMPACT_WINDOW||"")},[A?.settings?.env?.CLAUDE_CODE_AUTO_COMPACT_WINDOW]),(0,a.useEffect)(()=>{let s=A?.settings?.env;s&&ep(e.defaultModels.some(e=>s[e.envKey]?.endsWith("[1m]")))},[A?.settings?.env,e.defaultModels]),(0,a.useEffect)(()=>{s&&(A||ey(),eb())},[s]),(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{ei(!!e.ccFilterNaming)}).catch(()=>{})},[]);let ej=async e=>{let s=!0===e;ei(s),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:s})}).catch(()=>{})},eb=async()=>{try{let e=await fetch("/api/models/alias"),s=await e.json();e.ok&&et(s.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(A?.installed&&!eh.current){eh.current=!0;let s=A.settings?.env||{};e.defaultModels.forEach(e=>{if(e.envKey){let t=s[e.envKey]||e.defaultValue||"";t&&c(e.alias,t)}});let t=s.ANTHROPIC_AUTH_TOKEN;t&&ee(t)}},[A,b,e.defaultModels,c]);let ey=async()=>{O(!0);try{let e=await fetch("/api/cli-tools/claude-settings"),s=await e.json();$(s),ec(!!s.exaMcpEnabled)}catch(e){$({installed:!1,error:e.message})}finally{O(!1)}},ev=()=>{let e=ea||m;return e.endsWith("/v1")?e:`${e}/v1`},eN=async()=>{R(!0),D(null);try{let s={ANTHROPIC_BASE_URL:ev()},t=Q?.trim()||(b?.length>0?b[0].key:null)||(y?null:"sk_10router");t&&(s.ANTHROPIC_AUTH_TOKEN=t),e.defaultModels.forEach(e=>{let t=o[e.alias];t&&e.envKey&&(s[e.envKey]=t)}),em&&(s.CLAUDE_CODE_AUTO_COMPACT_WINDOW=em);let l=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:s,exaMcpEnabled:ed,autoCompactWindow:em})}),r=await l.json();l.ok?(U(ev(),{tunnelPublicUrl:w,tailscaleUrl:C}),D({type:"success",text:"Settings applied successfully!"}),$(e=>({...e,hasBackup:!0,settings:{...e?.settings,env:s},exaMcpEnabled:ed}))):D({type:"error",text:r.error||"Failed to apply settings"})}catch(e){D({type:"error",text:e.message})}finally{R(!1)}},ew=async()=>{T(!0),D(null);try{let s=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),t=await s.json();s.ok?(D({type:"success",text:"Settings reset successfully!"}),e.defaultModels.forEach(e=>c(e.alias,e.defaultValue||"")),ee(""),ec(!1),ex(""),ep(!1)):D({type:"error",text:t.error||"Failed to reset settings"})}catch(e){D({type:"error",text:e.message})}finally{T(!1)}};return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,children:(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(j.default,{src:"/providers/claude.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===ef&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===ef&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===ef&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.description})]})]})}),s&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[M&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,l.jsx)(r.default,{name:"progress_activity",className:"animate-spin"}),(0,l.jsx)("span",{children:"Checking Claude CLI..."})]}),!M&&A&&!A.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)(r.default,{name:"warning",className:"text-yellow-500"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:A.container?"10Router runs in a container":"Claude CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:A.container?"The CLI lives on your host, not inside the container. Copy the manual config below into your host's ~/.claude/settings.json.":"Manual configuration is still available if 10router is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(d.$,{variant:"secondary",size:"sm",onClick:()=>er(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:()=>Y(!Z),children:[(0,l.jsx)(r.default,{name:Z?"expand_less":"help",className:"text-[18px] mr-1"}),Z?"Hide":"How to Install"]})]})]}),Z&&(0,l.jsxs)("div",{className:"p-4 bg-card border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-muted-foreground mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,l.jsxs)("p",{className:"text-muted-foreground",children:["After installation, run"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!M&&A?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)(I,{value:ea||((_=ea||m).endsWith("/v1")?_:`${_}/v1`),onChange:en,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:N,tunnelPublicUrl:w,tailscaleEnabled:k,tailscaleUrl:C,currentUrl:eg})]}),A?.settings?.env?.ANTHROPIC_BASE_URL&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5",children:A.settings.env.ANTHROPIC_BASE_URL})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)(K,{value:Q,onChange:ee,apiKeys:b,cloudEnabled:y})]}),e.defaultModels.map(e=>(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:e.name}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:o[e.alias]||"",onChange:s=>c(e.alias,s.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-card rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),o[e.alias]&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>c(e.alias,""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-muted-foreground hover:text-red-500 rounded transition-colors",children:(0,l.jsx)(r.default,{name:"close",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Clear"})]})]}),(0,l.jsx)("button",{onClick:()=>{X(e.alias),V(!0)},className:"w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 bg-card border-border text-foreground hover:border-primary cursor-pointer",children:"Select Model"})]},e.alias)),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Auto-compact"}),(0,l.jsxs)(p.l6,{value:em||"__default__",onValueChange:e=>ex("__default__"===e?"":e),children:[(0,l.jsx)(p.bq,{className:"w-full text-xs",children:(0,l.jsx)(p.yv,{})}),(0,l.jsx)(p.gC,{children:q.map(e=>(0,l.jsx)(p.eb,{value:e.value||"__default__",children:e.label},e.label))})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"1M context"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)(f.S,{checked:eu,onCheckedChange:s=>{var t;ep(t=!0===s),e.defaultModels.forEach(e=>{let s=o[e.alias];s&&c(e.alias,((e,s)=>{let{model:t}=function(e){if("string"!=typeof e)return{model:e,contextMarker:null};let s=e.trim(),t=s.match(H);return t?{model:s.slice(0,-t[0].length),contextMarker:t[0].slice(1,-1).toLowerCase()}:{model:e,contextMarker:null}}(e);return s?`${t}[1m]`:t})(s,t))})}}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Append [1m] to the model name"}),(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("span",{className:"relative inline-flex",children:(0,l.jsx)(r.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,l.jsx)(h.ZI,{side:"top",children:"Claude Code otherwise assumes a 200K window, which clamps the auto-compact window above. Applied to every mapped model — only enable it for models that really accept 1M."})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Filter naming"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)(f.S,{checked:eo,onCheckedChange:ej}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Filter naming requests"}),(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("span",{className:"relative inline-flex",children:(0,l.jsx)(r.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,l.jsx)(h.ZI,{side:"top",children:"Intercepts Claude Code's topic-naming requests and returns a fake response locally, saving API tokens."})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Web Search"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)(f.S,{checked:ed,onCheckedChange:e=>ec(!0===e)}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Exa MCP"}),(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("span",{className:"relative inline-flex",children:(0,l.jsx)(r.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,l.jsx)(h.ZI,{side:"top",children:"Injects Exa MCP into ~/.claude.json so non-Claude models gain web search. Restart Claude Code after Apply."})]})]})]})]}),L&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===L.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)(r.default,{name:"success"===L.type?"check_circle":"error",className:"text-[14px]"}),(0,l.jsx)("span",{children:L.text})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(d.$,{size:"sm",onClick:eN,disabled:P,children:[P&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:ew,disabled:!A?.has10Router||z,children:[z&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,l.jsxs)(d.$,{variant:"ghost",size:"sm",onClick:()=>er(!0),children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),J&&(0,l.jsx)(i.rq,{isOpen:J,onClose:()=>V(!1),onSelect:e=>{G&&c(G,e.value)},selectedModel:G?o[G]:null,activeProviders:n,modelAliases:es,title:`Select model for ${G}`}),(0,l.jsx)(i.uR,{isOpen:el,onClose:()=>er(!1),title:"Claude CLI - Manual Configuration",configs:(S=Q&&Q.trim()?Q:y?"<API_KEY_FROM_DASHBOARD>":"sk_10router",E={ANTHROPIC_BASE_URL:ev(),ANTHROPIC_AUTH_TOKEN:S},e.defaultModels.forEach(e=>{let s=o[e.alias];s&&e.envKey&&(E[e.envKey]=s)}),em&&(E.CLAUDE_CODE_AUTO_COMPACT_WINDOW=em),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:E},null,2)}])})]})})}function Z({tool:e,isExpanded:s,onToggle:t,baseUrl:n,apiKeys:o,activeProviders:c,cloudEnabled:m,initialStatus:x,tunnelEnabled:p,tunnelPublicUrl:f,tailscaleEnabled:b,tailscaleUrl:y}){let v,N,w,[k,C]=(0,a.useState)(x||null),[_,S]=(0,a.useState)(!1),[E,A]=(0,a.useState)(!1),[$,M]=(0,a.useState)(!1),[O,P]=(0,a.useState)(null),[R,z]=(0,a.useState)(!1),[T,L]=(0,a.useState)(""),[D,H]=(0,a.useState)([]),[F,q]=(0,a.useState)(""),[B,Y]=(0,a.useState)(!1),[J,V]=(0,a.useState)(!1),[G,X]=(0,a.useState)({}),[Q,ee]=(0,a.useState)(!1),[es,et]=(0,a.useState)("");(0,a.useEffect)(()=>{o?.length>0&&!T&&L(o[0].key)},[o,T]),(0,a.useEffect)(()=>{x&&C(x)},[x]),(0,a.useEffect)(()=>{s&&(k||eo(),el())},[s]);let el=async()=>{try{let e=await fetch("/api/models/alias"),s=await e.json();e.ok&&X(s.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(k?.profiles&&H(k.profiles.map(e=>e.model).filter(Boolean)),k?.config){let e=k.config.match(/^default_subagent_model\s*=\s*"([^"]+)"/m);e&&q(e[1])}},[k]);let er=(v=k?.config?.match(/base_url\s*=\s*"([^"]+)"/))?v[1]:"",ea=k?.installed?k.config?W(er,{tunnelPublicUrl:f,tailscaleUrl:y})?"configured":"other":"not_configured":null,en=()=>{let e=es||`${n}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},eo=async()=>{S(!0);try{let e=await fetch("/api/cli-tools/codex-settings"),s=await e.json();C(s)}catch(e){C({installed:!1,error:e.message})}finally{S(!1)}},ei=async()=>{A(!0),P(null);try{let e=T&&T.trim()||m?T:"sk_10router",s=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:en(),apiKey:e,models:D,subagentModel:F})}),t=await s.json();s.ok?(U(en(),{tunnelPublicUrl:f,tailscaleUrl:y}),P({type:"success",text:"Applied — models appear in codex /model. Account default kept; use codex --profile 10router-<model> for 10Router routing."}),eo()):P({type:"error",text:t.error||"Failed to apply settings"})}catch(e){P({type:"error",text:e.message})}finally{A(!1)}},ed=async()=>{M(!0),P(null);try{let e=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),s=await e.json();e.ok?(P({type:"success",text:"Settings reset successfully!"}),H([]),q(""),eo()):P({type:"error",text:s.error||"Failed to reset settings"})}catch(e){P({type:"error",text:e.message})}finally{M(!1)}};return(0,l.jsx)(u.Zp,{size:"sm",className:"overflow-hidden",children:(0,l.jsxs)(u.Wu,{children:[(0,l.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,children:(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(j.default,{src:"/providers/codex.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===ea&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===ea&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===ea&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.description})]})]})}),s&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[_&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,l.jsx)(r.default,{name:"progress_activity",className:"animate-spin"}),(0,l.jsx)("span",{children:"Checking Codex CLI..."})]}),!_&&k&&!k.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)(r.default,{name:"warning",className:"text-yellow-500"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:k.container?"10Router runs in a container":"Codex CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:k.container?"The CLI lives on your host, not inside the container. Copy the manual config below into your host's ~/.codex/config.toml.":"Manual configuration is still available if 10router is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(d.$,{variant:"secondary",size:"sm",onClick:()=>ee(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:()=>z(!R),children:[(0,l.jsx)(r.default,{name:R?"expand_less":"help",className:"text-[18px] mr-1"}),R?"Hide":"How to Install"]})]})]}),R&&(0,l.jsxs)("div",{className:"p-4 bg-card border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-muted-foreground mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,l.jsxs)("p",{className:"text-muted-foreground",children:["After installation, run"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," to verify."]}),(0,l.jsx)("div",{className:"pt-2 border-t border-border",children:(0,l.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Codex reads custom providers from"," ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/config.toml"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!_&&k?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[k?.rootHijacked&&(0,l.jsxs)("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-xs bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",children:[(0,l.jsx)(r.default,{name:"warning",className:"text-[14px] shrink-0 mt-0.5"}),(0,l.jsx)("span",{children:"Old settings overrode your default Codex model. Apply to restore your ChatGPT account default — added models become profiles."})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)(I,{value:es||es||`${n}/v1`,onChange:et,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:f,tailscaleEnabled:b,tailscaleUrl:y,currentUrl:er})]}),k?.config&&(er?(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5",children:er})]}):null),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)(K,{value:T,onChange:L,apiKeys:o,cloudEnabled:m})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,l.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Models"}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,l.jsx)("div",{className:"flex min-h-7 flex-wrap gap-1.5 rounded border border-border bg-card px-2 py-1.5",children:0===D.length?(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"No models added"}):D.map(e=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-transparent bg-black/5 px-2 py-0.5 text-xs text-muted-foreground hover:border-border dark:bg-white/5",children:[e,(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>H(D.filter(s=>s!==e)),className:"ml-0.5 hover:text-red-500",children:(0,l.jsx)(r.default,{name:"close",className:"text-[12px]"})})}),(0,l.jsx)(h.ZI,{children:"Remove"})]})]},e))}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("button",{onClick:()=>Y(!0),className:"cursor-pointer rounded border border-border bg-card px-2 py-1 text-xs text-foreground transition-colors hover:border-primary",children:"Add Model"}),(0,l.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Launch:"," ",(0,l.jsx)("code",{className:"rounded bg-black/5 px-1 dark:bg-white/5",children:"codex --profile 10router-<model>"})]})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Subagent Model"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:F,onChange:e=>q(e.target.value),placeholder:D[0]||"provider/model-id (defaults to main model)",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-card rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),F&&(0,l.jsxs)(h.m_,{children:[(0,l.jsx)(h.k$,{asChild:!0,children:(0,l.jsx)("button",{onClick:()=>q(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-muted-foreground hover:text-red-500 rounded transition-colors",children:(0,l.jsx)(r.default,{name:"close",className:"text-[14px]"})})}),(0,l.jsx)(h.ZI,{children:"Clear (will use main model)"})]})]}),(0,l.jsx)("button",{onClick:()=>V(!0),className:"w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 bg-card border-border text-foreground hover:border-primary cursor-pointer",children:"Select Model"})]})]}),O&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===O.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)(r.default,{name:"success"===O.type?"check_circle":"error",className:"text-[14px]"}),(0,l.jsx)("span",{children:O.text})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(d.$,{size:"sm",onClick:ei,disabled:!T&&m&&o.length>0||0===D.length||E,children:[E&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,l.jsxs)(d.$,{variant:"outline",size:"sm",onClick:ed,disabled:$,children:[$&&(0,l.jsx)(g.A,{className:"size-4 animate-spin"}),(0,l.jsx)(r.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,l.jsxs)(d.$,{variant:"ghost",size:"sm",onClick:()=>ee(!0),children:[(0,l.jsx)(r.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),B&&(0,l.jsx)(i.rq,{isOpen:B,onClose:()=>Y(!1),onSelect:e=>{D.includes(e.value)||H([...D,e.value])},onDeselect:e=>{H(D.filter(s=>s!==e.value))},selectedModel:null,addedModelValues:D,closeOnSelect:!1,title:"Add Models for Codex",activeProviders:c,modelAliases:G}),J&&(0,l.jsx)(i.rq,{isOpen:J,onClose:()=>V(!1),onSelect:e=>{q(e.value),V(!1)},selectedModel:F,activeProviders:c,modelAliases:G,title:"Select Subagent Model for Codex"}),(0,l.jsx)(i.uR,{isOpen:Q,onClose:()=>ee(!1),title:"Codex CLI - Manual Configuration",configs:(N=T&&T.trim()?T:m?"<API_KEY_FROM_DASHBOARD>":"sk_10router",w=[{filename:"~/.codex/config.toml",content:`# 10Router Configuration for Codex CLI
|
|
2
2
|
# Default model/provider stay on your ChatGPT account — only the provider
|
|
3
3
|
# definition below is added. Selected models are merged into
|
|
4
4
|
# model_catalog_json (~/.codex/10router-model-catalog.json) so they show in
|
|
@@ -37,4 +37,4 @@ ${w}
|
|
|
37
37
|
config:
|
|
38
38
|
provider: 10router
|
|
39
39
|
model: ${F||D[0]||"provider/model-id"}
|
|
40
|
-
`},{filename:"~/.dsh/.credentials.yaml (add ref)",content:`refs: { TEN_ROUTER_API_KEY: ${N} }`}])})]})})}t(56590);let ea=t(65746).env.NEXT_PUBLIC_CLOUD_URL;function en({toolId:e,machineId:s}){let t=m.d[e],[n,u]=(0,a.useState)([]),[p,h]=(0,a.useState)(!0),[g,f]=(0,a.useState)({}),[j,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(!1),[N,w]=(0,a.useState)(""),[k,C]=(0,a.useState)(!1),[_,S]=(0,a.useState)(""),[E,A]=(0,a.useState)([]);(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let[s,t,l,r]=await Promise.all([fetch("/api/providers"),fetch("/api/settings"),fetch("/api/tunnel/status"),fetch("/api/keys")]);if(!e)return;if(s.ok){let e=await s.json();u(e.connections||[])}if(t.ok){let e=await t.json();b(e.cloudEnabled||!1)}if(l.ok){let e=await l.json();v(!!(e.tunnel?.enabled||e.tunnel?.settingsEnabled)),w(e.tunnel?.publicUrl||""),C(!!(e.tailscale?.enabled||e.tailscale?.settingsEnabled)),S(e.tailscale?.tunnelUrl||"")}if(r.ok){let e=await r.json();A(e.keys||[])}}catch(e){console.log("Error loading tool data:",e)}finally{e&&h(!1)}})(),()=>{e=!1}},[]);let $=()=>n.filter(e=>!1!==e.isActive),M=(0,a.useCallback)((e,s,t)=>{f(l=>l[e]?.[s]===t?l:{...l,[e]:{...l[e],[s]:t}})},[]);return t?(0,l.jsxs)(i.YW,{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(d.$,{variant:"outline",size:"sm",asChild:!0,className:"mb-4 self-start",children:(0,l.jsxs)(o(),{href:"/dashboard/cli-tools",children:[(0,l.jsx)(r.default,{name:"arrow_back",className:"text-lg"}),"CLI Tools"]})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[(0,l.jsx)("div",{className:"size-12 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${t.color}15`},children:(0,l.jsx)(c.A,{src:t.image,alt:t.name,size:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",fallbackText:t.name.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("h1",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:t.name}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:t.description})]})]})]}),p?(0,l.jsx)(i.KX,{}):(()=>{let s,r,a,n=(s=$(),r=[],a=new Set,s.forEach(e=>{let s=x.Xg[e.provider]||e.provider,t=(0,x.KC)(e.provider);if(t.forEach(t=>{let l=`${s}/${t.id}`;a.has(l)||(a.add(l),r.push({value:l,label:`${s}/${t.id}`,provider:e.provider,alias:s,connectionName:e.name,modelId:t.id}))}),0===t.length){let t=e.providerSpecificData?.prefix||s,l=[];e.defaultModel&&l.push({id:e.defaultModel,name:e.defaultModel}),(e.providerSpecificData?.customModels||[]).forEach(e=>{e?.id&&!l.some(s=>s.id===e.id)&&l.push({id:e.id,name:e.name||e.id})}),0===l.length&&"active"===e.testStatus&&l.push({id:"model-id",name:`${t}/model-id`}),l.forEach(s=>{let l=`${t}/${s.id}`;a.has(l)||(a.add(l),r.push({value:l,label:`${t}/${s.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:s.id}))})}}),r).length>0,o={tool:t,isExpanded:!0,onToggle:()=>{},baseUrl:y&&N?N:j&&ea?ea:window.location.origin,apiKeys:E,tunnelEnabled:y,tunnelPublicUrl:N,tailscaleEnabled:k,tailscaleUrl:_};switch(e){case"claude":return(0,l.jsx)(B,{...o,activeProviders:$(),modelMappings:g[e]||{},onModelMappingChange:(s,t)=>M(e,s,t),hasActiveProviders:n,cloudEnabled:j});case"codex":return(0,l.jsx)(Z,{...o,activeProviders:$(),cloudEnabled:j});case"opencode":return(0,l.jsx)(G,{...o,activeProviders:$(),cloudEnabled:j});case"cowork":return(0,l.jsx)(es,{...o,activeProviders:$(),hasActiveProviders:n,cloudEnabled:j,cloudUrl:ea,tunnelEnabled:y,tunnelPublicUrl:N,tailscaleEnabled:k,tailscaleUrl:_});case"dsh":return(0,l.jsx)(er,{...o,activeProviders:$(),cloudEnabled:j});default:return(0,l.jsx)(V,{toolId:e,...o,activeProviders:$(),cloudEnabled:j,tunnelEnabled:y})}})()]}):(0,l.jsxs)(i.YW,{children:[(0,l.jsx)(d.$,{variant:"outline",size:"sm",asChild:!0,className:"self-start",children:(0,l.jsxs)(o(),{href:"/dashboard/cli-tools",children:[(0,l.jsx)(r.default,{name:"arrow_back",className:"text-lg"}),"CLI Tools"]})}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"Tool not found or disabled."})]})}},56590:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});var l=t(29798),r=t(53784),a=t(22205),n=t(738);let o={ok:"bg-green-500",warn:"bg-amber-500",info:"bg-blue-500",muted:"bg-muted-foreground/50"};function i({toolId:e,tool:s,status:t}){let d=s?.configType==="guide"?{label:"Guide",tone:"info"}:t?t.container&&null==t.installed?{label:"Manual setup",tone:"info"}:t.installed?t.has10Router?{label:"Connected",tone:"ok"}:{label:"Not configured",tone:"warn"}:{label:"Not installed",tone:"muted"}:{label:"Unknown",tone:"muted"};return(0,l.jsx)(a.default,{href:`/dashboard/cli-tools/${e}`,title:s.name,iconBg:s.color?`${s.color}15`:void 0,icon:(0,l.jsx)(n.A,{src:s.image,alt:s.name,size:30,className:"max-h-[30px] max-w-[30px] rounded-lg object-contain",fallbackText:s.name.slice(0,2).toUpperCase(),fallbackColor:s.color}),children:(0,l.jsxs)(r.E,{variant:"default",children:[(0,l.jsx)("span",{className:`size-1.5 rounded-full ${o[d.tone]}`}),d.label]})})}},92412:(e,s,t)=>{"use strict";t.d(s,{YW:()=>l.Page,pV:()=>l.CardGrid,wn:()=>l.Section,zY:()=>l.PageHeader}),t(16675),t(72778);var l=t(29575)}},e=>{e.O(0,[6766,5166,7552,9980,1471,5778,4484,3577,5862,5113,1699,
|
|
40
|
+
`},{filename:"~/.dsh/.credentials.yaml (add ref)",content:`refs: { TEN_ROUTER_API_KEY: ${N} }`}])})]})})}t(56590);let ea=t(65746).env.NEXT_PUBLIC_CLOUD_URL;function en({toolId:e,machineId:s}){let t=m.d[e],[n,u]=(0,a.useState)([]),[p,h]=(0,a.useState)(!0),[g,f]=(0,a.useState)({}),[j,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(!1),[N,w]=(0,a.useState)(""),[k,C]=(0,a.useState)(!1),[_,S]=(0,a.useState)(""),[E,A]=(0,a.useState)([]);(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let[s,t,l,r]=await Promise.all([fetch("/api/providers"),fetch("/api/settings"),fetch("/api/tunnel/status"),fetch("/api/keys")]);if(!e)return;if(s.ok){let e=await s.json();u(e.connections||[])}if(t.ok){let e=await t.json();b(e.cloudEnabled||!1)}if(l.ok){let e=await l.json();v(!!(e.tunnel?.enabled||e.tunnel?.settingsEnabled)),w(e.tunnel?.publicUrl||""),C(!!(e.tailscale?.enabled||e.tailscale?.settingsEnabled)),S(e.tailscale?.tunnelUrl||"")}if(r.ok){let e=await r.json();A(e.keys||[])}}catch(e){console.log("Error loading tool data:",e)}finally{e&&h(!1)}})(),()=>{e=!1}},[]);let $=()=>n.filter(e=>!1!==e.isActive),M=(0,a.useCallback)((e,s,t)=>{f(l=>l[e]?.[s]===t?l:{...l,[e]:{...l[e],[s]:t}})},[]);return t?(0,l.jsxs)(i.YW,{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(d.$,{variant:"outline",size:"sm",asChild:!0,className:"mb-4 self-start",children:(0,l.jsxs)(o(),{href:"/dashboard/cli-tools",children:[(0,l.jsx)(r.default,{name:"arrow_back",className:"text-lg"}),"CLI Tools"]})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[(0,l.jsx)("div",{className:"size-12 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${t.color}15`},children:(0,l.jsx)(c.A,{src:t.image,alt:t.name,size:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",fallbackText:t.name.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("h1",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:t.name}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:t.description})]})]})]}),p?(0,l.jsx)(i.KX,{}):(()=>{let s,r,a,n=(s=$(),r=[],a=new Set,s.forEach(e=>{let s=x.Xg[e.provider]||e.provider,t=(0,x.KC)(e.provider);if(t.forEach(t=>{let l=`${s}/${t.id}`;a.has(l)||(a.add(l),r.push({value:l,label:`${s}/${t.id}`,provider:e.provider,alias:s,connectionName:e.name,modelId:t.id}))}),0===t.length){let t=e.providerSpecificData?.prefix||s,l=[];e.defaultModel&&l.push({id:e.defaultModel,name:e.defaultModel}),(e.providerSpecificData?.customModels||[]).forEach(e=>{e?.id&&!l.some(s=>s.id===e.id)&&l.push({id:e.id,name:e.name||e.id})}),0===l.length&&"active"===e.testStatus&&l.push({id:"model-id",name:`${t}/model-id`}),l.forEach(s=>{let l=`${t}/${s.id}`;a.has(l)||(a.add(l),r.push({value:l,label:`${t}/${s.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:s.id}))})}}),r).length>0,o={tool:t,isExpanded:!0,onToggle:()=>{},baseUrl:y&&N?N:j&&ea?ea:window.location.origin,apiKeys:E,tunnelEnabled:y,tunnelPublicUrl:N,tailscaleEnabled:k,tailscaleUrl:_};switch(e){case"claude":return(0,l.jsx)(B,{...o,activeProviders:$(),modelMappings:g[e]||{},onModelMappingChange:(s,t)=>M(e,s,t),hasActiveProviders:n,cloudEnabled:j});case"codex":return(0,l.jsx)(Z,{...o,activeProviders:$(),cloudEnabled:j});case"opencode":return(0,l.jsx)(G,{...o,activeProviders:$(),cloudEnabled:j});case"cowork":return(0,l.jsx)(es,{...o,activeProviders:$(),hasActiveProviders:n,cloudEnabled:j,cloudUrl:ea,tunnelEnabled:y,tunnelPublicUrl:N,tailscaleEnabled:k,tailscaleUrl:_});case"dsh":return(0,l.jsx)(er,{...o,activeProviders:$(),cloudEnabled:j});default:return(0,l.jsx)(V,{toolId:e,...o,activeProviders:$(),cloudEnabled:j,tunnelEnabled:y})}})()]}):(0,l.jsxs)(i.YW,{children:[(0,l.jsx)(d.$,{variant:"outline",size:"sm",asChild:!0,className:"self-start",children:(0,l.jsxs)(o(),{href:"/dashboard/cli-tools",children:[(0,l.jsx)(r.default,{name:"arrow_back",className:"text-lg"}),"CLI Tools"]})}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"Tool not found or disabled."})]})}},56590:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});var l=t(29798),r=t(53784),a=t(22205),n=t(738);let o={ok:"bg-green-500",warn:"bg-amber-500",info:"bg-blue-500",muted:"bg-muted-foreground/50"};function i({toolId:e,tool:s,status:t}){let d=s?.configType==="guide"?{label:"Guide",tone:"info"}:t?t.container&&null==t.installed?{label:"Manual setup",tone:"info"}:t.installed?t.has10Router?{label:"Connected",tone:"ok"}:{label:"Not configured",tone:"warn"}:{label:"Not installed",tone:"muted"}:{label:"Unknown",tone:"muted"};return(0,l.jsx)(a.default,{href:`/dashboard/cli-tools/${e}`,title:s.name,iconBg:s.color?`${s.color}15`:void 0,icon:(0,l.jsx)(n.A,{src:s.image,alt:s.name,size:30,className:"max-h-[30px] max-w-[30px] rounded-lg object-contain",fallbackText:s.name.slice(0,2).toUpperCase(),fallbackColor:s.color}),children:(0,l.jsxs)(r.E,{variant:"default",children:[(0,l.jsx)("span",{className:`size-1.5 rounded-full ${o[d.tone]}`}),d.label]})})}},92412:(e,s,t)=>{"use strict";t.d(s,{YW:()=>l.Page,pV:()=>l.CardGrid,wn:()=>l.Section,zY:()=>l.PageHeader}),t(16675),t(72778);var l=t(29575)}},e=>{e.O(0,[6766,5166,7552,9980,1471,5778,4484,3577,5862,5113,1699,1722,159,4489,1278,1830,6770,427,9966,7358],()=>e(e.s=7006)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{2809:(e,t,a)=>{Promise.resolve().then(a.bind(a,24324))},15764:(e,t,a)=>{"use strict";a.d(t,{CK:()=>d.default,G9:()=>c.default,Iz:()=>j.default,KX:()=>x.PanelSkeleton,LF:()=>n.default,LH:()=>f.default,Mu:()=>x.StatCardSkeleton,Nf:()=>i.default,Qv:()=>o.CardSkeleton,YW:()=>k.YW,gw:()=>h.default,jK:()=>u.default,nh:()=>g.default,pV:()=>k.pV,rq:()=>s.default,uR:()=>r.default,uo:()=>l.ConfirmModal,vE:()=>b.default,vj:()=>p.default,wI:()=>v.default,wn:()=>k.wn,zY:()=>k.zY}),a(58913);var l=a(3537),o=a(58350);a(30872),a(33526),a(42535),a(1279);var n=a(92802),s=a(25908),r=a(58729),d=a(24873),i=a(5258),u=a(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{2809:(e,t,a)=>{Promise.resolve().then(a.bind(a,24324))},15764:(e,t,a)=>{"use strict";a.d(t,{CK:()=>d.default,G9:()=>c.default,Iz:()=>j.default,KX:()=>x.PanelSkeleton,LF:()=>n.default,LH:()=>f.default,Mu:()=>x.StatCardSkeleton,Nf:()=>i.default,Qv:()=>o.CardSkeleton,YW:()=>k.YW,gw:()=>h.default,jK:()=>u.default,nh:()=>g.default,pV:()=>k.pV,rq:()=>s.default,uR:()=>r.default,uo:()=>l.ConfirmModal,vE:()=>b.default,vj:()=>p.default,wI:()=>v.default,wn:()=>k.wn,zY:()=>k.zY}),a(58913);var l=a(3537),o=a(58350);a(30872),a(33526),a(42535),a(1279);var n=a(92802),s=a(25908),r=a(58729),d=a(24873),i=a(5258),u=a(80599);a(949),a(56776),a(53599),a(88336),a(69561);var c=a(37753),f=a(23444),b=a(93624),p=a(86920),v=a(65461);a(14580);var h=a(14670),j=a(70296);a(57779),a(22205);var x=a(43276),g=a(75862),k=a(92412)},24324:(e,t,a)=>{"use strict";a.d(t,{default:()=>d});var l=a(29798),o=a(15814),n=a(15764),s=a(90046),r=a(56590);function d({machineId:e}){let[t,a]=(0,o.useState)(!0),[i,u]=(0,o.useState)({});if((0,o.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await fetch("/api/cli-tools/all-statuses");t.ok&&e&&u(await t.json())}catch(e){console.log("Error fetching tool statuses:",e)}finally{e&&a(!1)}})(),()=>{e=!1}},[]),t)return(0,l.jsxs)(n.YW,{children:[(0,l.jsx)(n.zY,{title:"CLI Tools",description:"Connect coding assistants to 10Router — point each tool at your local endpoint.",backHref:"/dashboard/providers",backLabel:"Providers"}),(0,l.jsxs)(n.pV,{children:[(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{})]})]});let c=Object.entries(s.d);return(0,l.jsxs)(n.YW,{children:[(0,l.jsx)(n.zY,{title:"CLI Tools",description:"Connect coding assistants to 10Router — point each tool at your local endpoint.",backHref:"/dashboard/providers",backLabel:"Providers"}),(0,l.jsx)(n.pV,{children:c.map(([e,t])=>(0,l.jsx)(r.A,{toolId:e,tool:t,status:i[e]},e))})]})}},56590:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var l=a(29798),o=a(53784),n=a(22205),s=a(738);let r={ok:"bg-green-500",warn:"bg-amber-500",info:"bg-blue-500",muted:"bg-muted-foreground/50"};function d({toolId:e,tool:t,status:a}){let i=t?.configType==="guide"?{label:"Guide",tone:"info"}:a?a.container&&null==a.installed?{label:"Manual setup",tone:"info"}:a.installed?a.has10Router?{label:"Connected",tone:"ok"}:{label:"Not configured",tone:"warn"}:{label:"Not installed",tone:"muted"}:{label:"Unknown",tone:"muted"};return(0,l.jsx)(n.default,{href:`/dashboard/cli-tools/${e}`,title:t.name,iconBg:t.color?`${t.color}15`:void 0,icon:(0,l.jsx)(s.A,{src:t.image,alt:t.name,size:30,className:"max-h-[30px] max-w-[30px] rounded-lg object-contain",fallbackText:t.name.slice(0,2).toUpperCase(),fallbackColor:t.color}),children:(0,l.jsxs)(o.E,{variant:"default",children:[(0,l.jsx)("span",{className:`size-1.5 rounded-full ${r[i.tone]}`}),i.label]})})}},92412:(e,t,a)=>{"use strict";a.d(t,{YW:()=>l.Page,pV:()=>l.CardGrid,wn:()=>l.Section,zY:()=>l.PageHeader}),a(16675),a(72778);var l=a(29575)}},e=>{e.O(0,[6766,5166,7552,9980,1471,5778,4484,3577,5862,5113,1699,1722,159,4489,1278,1830,6770,427,9966,7358],()=>e(e.s=2809)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{15764:(e,s,t)=>{"use strict";t.d(s,{CK:()=>i.default,G9:()=>m.default,Iz:()=>p.default,KX:()=>g.PanelSkeleton,LF:()=>a.default,LH:()=>x.default,Mu:()=>g.StatCardSkeleton,Nf:()=>d.default,Qv:()=>l.CardSkeleton,YW:()=>v.YW,gw:()=>f.default,jK:()=>c.default,nh:()=>b.default,pV:()=>v.pV,rq:()=>o.default,uR:()=>n.default,uo:()=>r.ConfirmModal,vE:()=>u.default,vj:()=>h.default,wI:()=>j.default,wn:()=>v.wn,zY:()=>v.zY}),t(58913);var r=t(3537),l=t(58350);t(30872),t(33526),t(42535),t(1279);var a=t(92802),o=t(25908),n=t(58729),i=t(24873),d=t(5258),c=t(59553);t(949),t(56776),t(53599),t(88336),t(69561);var m=t(37753),x=t(23444),u=t(93624),h=t(86920),j=t(65461);t(14580);var f=t(14670),p=t(70296);t(57779),t(22205);var g=t(43276),b=t(75862),v=t(92412)},29982:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>A});var r=t(29798),l=t(15814),a=t(31872),o=t(59732),n=t(7155),i=t(70684),d=t(75669),c=t(18055),m=t(77345),x=t(1352),u=t(49787),h=t(45111),j=t(36395),f=t(10205),p=t(15054),g=t(6403),b=t(63587),v=t(76260),y=t(3308),k=t(75877),N=t(50860),w=t(1280),C=t(26339),S=t(15764),$=t(63523),z=t(90619);let E=/^[a-zA-Z0-9_.\-]+$/;function A(){let[e,s]=(0,l.useState)([]),[t,a]=(0,l.useState)(!0),[o,n]=(0,l.useState)(!1),[i,m]=(0,l.useState)(null),[x,h]=(0,l.useState)([]),[p,g]=(0,l.useState)({}),{getCaps:b}=(0,z.y)(),[v,y]=(0,l.useState)(null),{copied:k,copy:N}=(0,$.C)(),w=async()=>{try{let[e,t,r]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/settings")]),l=await e.json(),a=await t.json(),o=r.ok?await r.json():{};e.ok&&s((l.combos||[]).filter(e=>!e.kind||"llm"===e.kind)),t.ok&&h(a.connections||[]),g(o.comboStrategies||{})}catch(e){console.log("Error fetching data:",e)}finally{a(!1)}};(0,l.useEffect)(()=>{w()},[]);let C=async e=>{try{let s=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(s.ok)await w(),n(!1);else{let e=await s.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},E=async(e,s)=>{try{let t=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(t.ok)await w(),m(null);else{let e=await t.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},A=async(e,s)=>{try{let t={...p},r={...t[e]||{},...s};r.fallbackStrategy&&"fallback"!==r.fallbackStrategy?t[e]=r:delete t[e],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:t})}),g(t)}catch(e){console.log("Error updating combo strategy:",e)}};return t?(0,r.jsxs)(S.YW,{children:[(0,r.jsx)(S.KX,{}),(0,r.jsx)(S.KX,{})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(S.YW,{children:[(0,r.jsx)(S.zY,{title:"Combos",description:"Group models under one name, then pick a strategy per combo:",actions:(0,r.jsxs)(c.$,{onClick:()=>n(!0),className:"w-full whitespace-nowrap sm:w-auto",children:[(0,r.jsx)(j.A,{}),"Create Combo"]})}),(0,r.jsx)(S.wn,{children:(0,r.jsx)("div",{className:"min-w-0",children:(0,r.jsxs)("ul",{className:"text-sm text-muted-foreground flex flex-col gap-1",children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium text-foreground",children:"Fallback"})," — tries models in order (next on failure)"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium text-foreground",children:"Round Robin"})," — rotates models across requests to spread load"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium text-foreground",children:"Fusion"})," — queries all models in parallel, then a judge synthesizes one answer. Best quality, but costs the most: every request bills all panel models + the judge (N+1 calls)"]})]})})}),(0,r.jsx)(S.wn,{children:0===e.length?(0,r.jsx)(d.Zp,{children:(0,r.jsxs)("div",{className:"py-12 text-center",children:[(0,r.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,r.jsx)(f.A,{className:"size-8"})}),(0,r.jsx)("p",{className:"text-foreground font-medium mb-1",children:"No combos yet"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Create model combos with fallback support"}),(0,r.jsxs)(c.$,{onClick:()=>n(!0),className:"w-full sm:w-auto",children:[(0,r.jsx)(j.A,{}),"Create Combo"]})]})}):(0,r.jsx)("div",{className:"flex flex-col gap-4",children:e.map(t=>(0,r.jsx)(_,{combo:t,getCaps:b,activeProviders:x,copied:k,onCopy:N,onEdit:()=>m(t),onDelete:()=>{var r;return r=t.id,void y({title:"Delete Combo",message:"Delete this combo?",onConfirm:async()=>{y(null);try{(await fetch(`/api/combos/${r}`,{method:"DELETE"})).ok&&s(e.filter(e=>e.id!==r))}catch(e){console.log("Error deleting combo:",e)}}})},strategy:p[t.name]||{},onSetStrategy:e=>A(t.name,e)},t.id))})})]}),o&&(0,r.jsx)(F,{isOpen:o,onClose:()=>n(!1),onSave:C,activeProviders:x},"create"),i&&(0,r.jsx)(F,{isOpen:!!i,combo:i,onClose:()=>m(null),onSave:e=>E(i.id,e),activeProviders:x},i.id),v&&(0,r.jsx)(u.lG,{open:!0,onOpenChange:e=>{e||y(null)},children:(0,r.jsxs)(u.Cf,{className:"max-w-sm",children:[(0,r.jsx)(u.c7,{children:(0,r.jsx)(u.L3,{children:v.title})}),(0,r.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:v.message}),(0,r.jsxs)(u.Es,{children:[(0,r.jsx)(c.$,{variant:"ghost",onClick:()=>y(null),children:"Cancel"}),(0,r.jsx)(c.$,{variant:"destructive",onClick:v.onConfirm,children:v.confirmText||"Confirm"})]})]})})]})}let M=[{value:"fallback",label:"Fallback — try in order"},{value:"round-robin",label:"Round Robin — rotate"},{value:"fusion",label:"Fusion — panel + judge"}];function _({combo:e,getCaps:s,activeProviders:t=[],copied:a,onCopy:o,onEdit:n,onDelete:i,strategy:m={},onSetStrategy:u}){let[j,N]=(0,l.useState)(!1),w=m.fallbackStrategy||"fallback",C=m.judgeModel||"";return(0,r.jsxs)(d.Zp,{size:"sm",className:"group",children:[(0,r.jsx)(d.Wu,{className:"min-w-0",children:(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,r.jsx)(f.A,{className:"size-4 text-primary"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("code",{className:"block truncate font-mono text-sm font-medium",children:e.name}),(0,r.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===e.models.length?(0,r.jsx)("span",{className:"text-xs text-muted-foreground italic",children:"No models"}):e.models.slice(0,3).map((e,t)=>(0,r.jsxs)("code",{className:"inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-muted-foreground dark:bg-white/5",children:[(0,r.jsx)("span",{children:e}),(0,r.jsx)(S.nh,{caps:s?.(e)})]},t)),e.models.length>3&&(0,r.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["+",e.models.length-3," more"]})]}),"fusion"===w&&(0,r.jsxs)("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,r.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Judge"}),(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsxs)("button",{onClick:()=>N(!0),className:"inline-flex max-w-full items-center gap-1 rounded border border-dashed border-primary/40 px-1.5 py-0.5 font-mono text-[11px] text-primary hover:border-primary hover:bg-primary/5 transition-colors",children:[(0,r.jsx)(p.A,{className:"size-3.5"}),(0,r.jsx)("span",{className:"truncate",children:C||`Auto — ${e.models[0]||"first model"}`})]})}),(0,r.jsx)(x.ZI,{children:"Pick the model that fuses panel answers"})]}),C&&(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)("button",{onClick:()=>u({judgeModel:""}),className:"p-0.5 rounded text-muted-foreground hover:text-red-500 hover:bg-red-500/10 transition-colors",children:(0,r.jsx)(g.A,{className:"size-3.5"})})}),(0,r.jsx)(x.ZI,{children:"Reset judge to Auto"})]})]})]})]}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,r.jsx)("div",{className:"w-full sm:w-[200px]",children:(0,r.jsxs)(h.l6,{value:w,onValueChange:e=>u({fallbackStrategy:e}),children:[(0,r.jsx)(h.bq,{className:"py-1.5 text-xs",children:(0,r.jsx)(h.yv,{})}),(0,r.jsx)(h.gC,{children:M.map(e=>(0,r.jsx)(h.eb,{value:e.value,children:e.label},e.value))})]})}),(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-1 sm:flex",children:[(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)(c.$,{variant:"ghost",size:"icon-sm",onClick:s=>{s.stopPropagation(),o(e.name,`combo-${e.id}`)},"aria-label":"Copy combo name",children:a===`combo-${e.id}`?(0,r.jsx)(b.A,{}):(0,r.jsx)(v.A,{})})}),(0,r.jsx)(x.ZI,{children:"Copy combo name"})]}),(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)(c.$,{variant:"ghost",size:"icon-sm",onClick:n,"aria-label":"Edit",children:(0,r.jsx)(y.A,{})})}),(0,r.jsx)(x.ZI,{children:"Edit"})]}),(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)(c.$,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Delete",className:"text-red-500 hover:bg-red-500/10 hover:text-red-500",children:(0,r.jsx)(k.A,{})})}),(0,r.jsx)(x.ZI,{children:"Delete"})]})]})]})]})}),j&&(0,r.jsx)(S.rq,{isOpen:j,onClose:()=>N(!1),onSelect:e=>{u({judgeModel:e?.value||""}),N(!1)},activeProviders:t,title:"Select Judge Model",addedModelValues:C?[C]:[],closeOnSelect:!0})]})}function P({id:e,index:s,model:t,isFirst:a,isLast:i,onEdit:d,onMoveUp:c,onMoveDown:m,onRemove:u}){let{attributes:h,listeners:j,setNodeRef:f,transform:p,isDragging:b}=(0,o.gl)({id:e}),v={transform:n.Ks.Transform.toString(p),opacity:b?.4:1,zIndex:b?999:void 0},[y,k]=(0,l.useState)(!1),[S,$]=(0,l.useState)(t),z=()=>{let e=S.trim();e&&e!==t?d(e):$(t),k(!1)};return(0,r.jsxs)("div",{ref:f,style:v,className:`group flex min-w-0 items-center gap-1.5 rounded-md px-2 py-1 bg-black/[0.02] hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04] transition-colors ${b?"shadow-md ring-1 ring-primary/30":""}`,children:[(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)("button",{...h,...j,type:"button",className:"cursor-grab touch-none p-0.5 rounded text-muted-foreground hover:text-primary active:cursor-grabbing shrink-0",children:(0,r.jsx)(N.A,{className:"size-4"})})}),(0,r.jsx)(x.ZI,{children:"Drag to reorder"})]}),(0,r.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground w-3 text-center shrink-0",children:s+1}),y?(0,r.jsx)("input",{autoFocus:!0,value:S,onChange:e=>$(e.target.value),onBlur:z,onKeyDown:e=>{"Enter"===e.key&&z(),"Escape"===e.key&&($(t),k(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-foreground outline-none dark:bg-black/20"}):(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)("div",{className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-foreground hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>k(!0),children:t})}),(0,r.jsx)(x.ZI,{children:"Click to edit"})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)("button",{onClick:c,disabled:a,className:`p-0.5 rounded ${a?"text-muted-foreground/20 cursor-not-allowed":"text-muted-foreground hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,children:(0,r.jsx)(w.A,{className:"size-3"})})}),(0,r.jsx)(x.ZI,{children:"Move up"})]}),(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)("button",{onClick:m,disabled:i,className:`p-0.5 rounded ${i?"text-muted-foreground/20 cursor-not-allowed":"text-muted-foreground hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,children:(0,r.jsx)(C.A,{className:"size-3"})})}),(0,r.jsx)(x.ZI,{children:"Move down"})]})]}),(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)("button",{onClick:u,className:"p-0.5 hover:bg-red-500/10 rounded text-muted-foreground hover:text-red-500 transition-all",children:(0,r.jsx)(g.A,{className:"size-3"})})}),(0,r.jsx)(x.ZI,{children:"Remove"})]})]})}function F({isOpen:e,combo:s,onClose:t,onSave:n,activeProviders:d,kindFilter:x=null}){let[h,p]=(0,l.useState)(s?.name||""),[g,b]=(0,l.useState)(s?.models||[]),[v,y]=(0,l.useState)(!1),[k,N]=(0,l.useState)(!1),[w,C]=(0,l.useState)(""),[$,z]=(0,l.useState)({}),A=(0,a.FR)((0,a.MS)(a.AN,{activationConstraint:{distance:5}}),(0,a.MS)(a.uN,{coordinateGetter:o.JR})),M=g.map((e,s)=>({uid:`item-${s}`,model:e})),_=async()=>{try{let e=await fetch("/api/models/alias");if(!e.ok)return;let s=await e.json();z(s.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}};(0,l.useEffect)(()=>{e&&_()},[e]);let O=e=>e.trim()?E.test(e)?(C(""),!0):(C("Only letters, numbers, -, _ and . allowed"),!1):(C("Name is required"),!1),I=async()=>{O(h)&&(N(!0),await n({name:h.trim(),models:g}),N(!1))},Z=!!s;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.lG,{open:e,onOpenChange:e=>{e||t()},children:(0,r.jsxs)(u.Cf,{className:"max-w-md",children:[(0,r.jsx)(u.c7,{children:(0,r.jsx)(u.L3,{children:Z?"Edit Combo":"Create Combo"})}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Combo Name"}),(0,r.jsx)(m.p,{value:h,onChange:e=>{let s=e.target.value;p(s),s?O(s):C("")},placeholder:"my-combo","aria-invalid":!!w,className:w?"ring-1 ring-red-500 border-red-500/40":""}),w&&(0,r.jsx)("p",{className:"mt-1 text-xs text-red-500",children:w}),(0,r.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:"Only letters, numbers, -, _ and . allowed"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===g.length?(0,r.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,r.jsx)(f.A,{className:"mb-1 mx-auto size-6 text-muted-foreground"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"No models added yet"})]}):(0,r.jsx)(a.Mp,{sensors:A,collisionDetection:a.fp,onDragEnd:e=>{let{active:s,over:t}=e;if(t&&s.id!==t.id){let e=M.findIndex(e=>e.uid===s.id),r=M.findIndex(e=>e.uid===t.id);-1!==e&&-1!==r&&b(s=>(0,o.be)(s,e,r))}},modifiers:[i.FN,i.gj],children:(0,r.jsx)(o.gB,{items:M.map(e=>e.uid),strategy:o._G,children:(0,r.jsx)("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:M.map(({uid:e,model:s},t)=>(0,r.jsx)(P,{id:e,index:t,model:s,isFirst:0===t,isLast:t===M.length-1,onEdit:e=>{let s=[...g];s[t]=e,b(s)},onMoveUp:()=>(e=>{if(0===e)return;let s=[...g];[s[e-1],s[e]]=[s[e],s[e-1]],b(s)})(t),onMoveDown:()=>(e=>{if(e===g.length-1)return;let s=[...g];[s[e],s[e+1]]=[s[e+1],s[e]],b(s)})(t),onRemove:()=>{b(g.filter((e,s)=>s!==t))}},e))})})}),(0,r.jsxs)("button",{onClick:()=>y(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[(0,r.jsx)(j.A,{className:"size-4"}),"Add Model"]})]})]}),(0,r.jsx)(u.Es,{children:(0,r.jsx)("div",{className:"flex w-full flex-col gap-2 pt-1 sm:flex-row",children:(0,r.jsx)(c.$,{onClick:I,size:"sm",className:"flex-1",disabled:!h.trim()||!!w||k,children:k?"Saving...":Z?"Save":"Create"})})})]})}),v&&(0,r.jsx)(S.rq,{isOpen:v,onClose:()=>y(!1),onSelect:e=>{g.includes(e.value)||b([...g,e.value])},onDeselect:e=>{b(g.filter(s=>s!==e.value))},activeProviders:d,modelAliases:$,title:"Add Model to Combo",kindFilter:x,addedModelValues:g,closeOnSelect:!1})]})}},67053:(e,s,t)=>{Promise.resolve().then(t.bind(t,29982))},92412:(e,s,t)=>{"use strict";t.d(s,{YW:()=>r.Page,pV:()=>r.CardGrid,wn:()=>r.Section,zY:()=>r.PageHeader}),t(16675),t(72778);var r=t(29575)},99656:(e,s,t)=>{"use strict";t.d(s,{PM:()=>r.PM,Sj:()=>r.Sj,Vy:()=>r.Vy,fF:()=>r.fF,sl:()=>r.sl,vL:()=>r.vL,y$:()=>r.y$,zM:()=>r.zM});var r=t(31872)}},e=>{e.O(0,[6766,5166,7552,9980,1471,5778,4484,3577,5862,5113,1699,7276,1722,1078,159,4489,1278,1830,3973,427,9966,7358],()=>e(e.s=67053)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{15764:(e,s,t)=>{"use strict";t.d(s,{CK:()=>i.default,G9:()=>m.default,Iz:()=>p.default,KX:()=>g.PanelSkeleton,LF:()=>a.default,LH:()=>x.default,Mu:()=>g.StatCardSkeleton,Nf:()=>d.default,Qv:()=>l.CardSkeleton,YW:()=>v.YW,gw:()=>f.default,jK:()=>c.default,nh:()=>b.default,pV:()=>v.pV,rq:()=>o.default,uR:()=>n.default,uo:()=>r.ConfirmModal,vE:()=>u.default,vj:()=>h.default,wI:()=>j.default,wn:()=>v.wn,zY:()=>v.zY}),t(58913);var r=t(3537),l=t(58350);t(30872),t(33526),t(42535),t(1279);var a=t(92802),o=t(25908),n=t(58729),i=t(24873),d=t(5258),c=t(80599);t(949),t(56776),t(53599),t(88336),t(69561);var m=t(37753),x=t(23444),u=t(93624),h=t(86920),j=t(65461);t(14580);var f=t(14670),p=t(70296);t(57779),t(22205);var g=t(43276),b=t(75862),v=t(92412)},29982:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>A});var r=t(29798),l=t(15814),a=t(31872),o=t(59732),n=t(7155),i=t(70684),d=t(75669),c=t(18055),m=t(77345),x=t(1352),u=t(49787),h=t(45111),j=t(36395),f=t(10205),p=t(15054),g=t(6403),b=t(63587),v=t(76260),y=t(3308),k=t(75877),N=t(50860),w=t(1280),C=t(26339),S=t(15764),$=t(63523),z=t(90619);let E=/^[a-zA-Z0-9_.\-]+$/;function A(){let[e,s]=(0,l.useState)([]),[t,a]=(0,l.useState)(!0),[o,n]=(0,l.useState)(!1),[i,m]=(0,l.useState)(null),[x,h]=(0,l.useState)([]),[p,g]=(0,l.useState)({}),{getCaps:b}=(0,z.y)(),[v,y]=(0,l.useState)(null),{copied:k,copy:N}=(0,$.C)(),w=async()=>{try{let[e,t,r]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/settings")]),l=await e.json(),a=await t.json(),o=r.ok?await r.json():{};e.ok&&s((l.combos||[]).filter(e=>!e.kind||"llm"===e.kind)),t.ok&&h(a.connections||[]),g(o.comboStrategies||{})}catch(e){console.log("Error fetching data:",e)}finally{a(!1)}};(0,l.useEffect)(()=>{w()},[]);let C=async e=>{try{let s=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(s.ok)await w(),n(!1);else{let e=await s.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},E=async(e,s)=>{try{let t=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(t.ok)await w(),m(null);else{let e=await t.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},A=async(e,s)=>{try{let t={...p},r={...t[e]||{},...s};r.fallbackStrategy&&"fallback"!==r.fallbackStrategy?t[e]=r:delete t[e],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:t})}),g(t)}catch(e){console.log("Error updating combo strategy:",e)}};return t?(0,r.jsxs)(S.YW,{children:[(0,r.jsx)(S.KX,{}),(0,r.jsx)(S.KX,{})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(S.YW,{children:[(0,r.jsx)(S.zY,{title:"Combos",description:"Group models under one name, then pick a strategy per combo:",actions:(0,r.jsxs)(c.$,{onClick:()=>n(!0),className:"w-full whitespace-nowrap sm:w-auto",children:[(0,r.jsx)(j.A,{}),"Create Combo"]})}),(0,r.jsx)(S.wn,{children:(0,r.jsx)("div",{className:"min-w-0",children:(0,r.jsxs)("ul",{className:"text-sm text-muted-foreground flex flex-col gap-1",children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium text-foreground",children:"Fallback"})," — tries models in order (next on failure)"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium text-foreground",children:"Round Robin"})," — rotates models across requests to spread load"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{className:"font-medium text-foreground",children:"Fusion"})," — queries all models in parallel, then a judge synthesizes one answer. Best quality, but costs the most: every request bills all panel models + the judge (N+1 calls)"]})]})})}),(0,r.jsx)(S.wn,{children:0===e.length?(0,r.jsx)(d.Zp,{children:(0,r.jsxs)("div",{className:"py-12 text-center",children:[(0,r.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,r.jsx)(f.A,{className:"size-8"})}),(0,r.jsx)("p",{className:"text-foreground font-medium mb-1",children:"No combos yet"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Create model combos with fallback support"}),(0,r.jsxs)(c.$,{onClick:()=>n(!0),className:"w-full sm:w-auto",children:[(0,r.jsx)(j.A,{}),"Create Combo"]})]})}):(0,r.jsx)("div",{className:"flex flex-col gap-4",children:e.map(t=>(0,r.jsx)(_,{combo:t,getCaps:b,activeProviders:x,copied:k,onCopy:N,onEdit:()=>m(t),onDelete:()=>{var r;return r=t.id,void y({title:"Delete Combo",message:"Delete this combo?",onConfirm:async()=>{y(null);try{(await fetch(`/api/combos/${r}`,{method:"DELETE"})).ok&&s(e.filter(e=>e.id!==r))}catch(e){console.log("Error deleting combo:",e)}}})},strategy:p[t.name]||{},onSetStrategy:e=>A(t.name,e)},t.id))})})]}),o&&(0,r.jsx)(F,{isOpen:o,onClose:()=>n(!1),onSave:C,activeProviders:x},"create"),i&&(0,r.jsx)(F,{isOpen:!!i,combo:i,onClose:()=>m(null),onSave:e=>E(i.id,e),activeProviders:x},i.id),v&&(0,r.jsx)(u.lG,{open:!0,onOpenChange:e=>{e||y(null)},children:(0,r.jsxs)(u.Cf,{className:"max-w-sm",children:[(0,r.jsx)(u.c7,{children:(0,r.jsx)(u.L3,{children:v.title})}),(0,r.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:v.message}),(0,r.jsxs)(u.Es,{children:[(0,r.jsx)(c.$,{variant:"ghost",onClick:()=>y(null),children:"Cancel"}),(0,r.jsx)(c.$,{variant:"destructive",onClick:v.onConfirm,children:v.confirmText||"Confirm"})]})]})})]})}let M=[{value:"fallback",label:"Fallback — try in order"},{value:"round-robin",label:"Round Robin — rotate"},{value:"fusion",label:"Fusion — panel + judge"}];function _({combo:e,getCaps:s,activeProviders:t=[],copied:a,onCopy:o,onEdit:n,onDelete:i,strategy:m={},onSetStrategy:u}){let[j,N]=(0,l.useState)(!1),w=m.fallbackStrategy||"fallback",C=m.judgeModel||"";return(0,r.jsxs)(d.Zp,{size:"sm",className:"group",children:[(0,r.jsx)(d.Wu,{className:"min-w-0",children:(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,r.jsx)(f.A,{className:"size-4 text-primary"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("code",{className:"block truncate font-mono text-sm font-medium",children:e.name}),(0,r.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===e.models.length?(0,r.jsx)("span",{className:"text-xs text-muted-foreground italic",children:"No models"}):e.models.slice(0,3).map((e,t)=>(0,r.jsxs)("code",{className:"inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-muted-foreground dark:bg-white/5",children:[(0,r.jsx)("span",{children:e}),(0,r.jsx)(S.nh,{caps:s?.(e)})]},t)),e.models.length>3&&(0,r.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["+",e.models.length-3," more"]})]}),"fusion"===w&&(0,r.jsxs)("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,r.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Judge"}),(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsxs)("button",{onClick:()=>N(!0),className:"inline-flex max-w-full items-center gap-1 rounded border border-dashed border-primary/40 px-1.5 py-0.5 font-mono text-[11px] text-primary hover:border-primary hover:bg-primary/5 transition-colors",children:[(0,r.jsx)(p.A,{className:"size-3.5"}),(0,r.jsx)("span",{className:"truncate",children:C||`Auto — ${e.models[0]||"first model"}`})]})}),(0,r.jsx)(x.ZI,{children:"Pick the model that fuses panel answers"})]}),C&&(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)("button",{onClick:()=>u({judgeModel:""}),className:"p-0.5 rounded text-muted-foreground hover:text-red-500 hover:bg-red-500/10 transition-colors",children:(0,r.jsx)(g.A,{className:"size-3.5"})})}),(0,r.jsx)(x.ZI,{children:"Reset judge to Auto"})]})]})]})]}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,r.jsx)("div",{className:"w-full sm:w-[200px]",children:(0,r.jsxs)(h.l6,{value:w,onValueChange:e=>u({fallbackStrategy:e}),children:[(0,r.jsx)(h.bq,{className:"py-1.5 text-xs",children:(0,r.jsx)(h.yv,{})}),(0,r.jsx)(h.gC,{children:M.map(e=>(0,r.jsx)(h.eb,{value:e.value,children:e.label},e.value))})]})}),(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-1 sm:flex",children:[(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)(c.$,{variant:"ghost",size:"icon-sm",onClick:s=>{s.stopPropagation(),o(e.name,`combo-${e.id}`)},"aria-label":"Copy combo name",children:a===`combo-${e.id}`?(0,r.jsx)(b.A,{}):(0,r.jsx)(v.A,{})})}),(0,r.jsx)(x.ZI,{children:"Copy combo name"})]}),(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)(c.$,{variant:"ghost",size:"icon-sm",onClick:n,"aria-label":"Edit",children:(0,r.jsx)(y.A,{})})}),(0,r.jsx)(x.ZI,{children:"Edit"})]}),(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)(c.$,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Delete",className:"text-red-500 hover:bg-red-500/10 hover:text-red-500",children:(0,r.jsx)(k.A,{})})}),(0,r.jsx)(x.ZI,{children:"Delete"})]})]})]})]})}),j&&(0,r.jsx)(S.rq,{isOpen:j,onClose:()=>N(!1),onSelect:e=>{u({judgeModel:e?.value||""}),N(!1)},activeProviders:t,title:"Select Judge Model",addedModelValues:C?[C]:[],closeOnSelect:!0})]})}function P({id:e,index:s,model:t,isFirst:a,isLast:i,onEdit:d,onMoveUp:c,onMoveDown:m,onRemove:u}){let{attributes:h,listeners:j,setNodeRef:f,transform:p,isDragging:b}=(0,o.gl)({id:e}),v={transform:n.Ks.Transform.toString(p),opacity:b?.4:1,zIndex:b?999:void 0},[y,k]=(0,l.useState)(!1),[S,$]=(0,l.useState)(t),z=()=>{let e=S.trim();e&&e!==t?d(e):$(t),k(!1)};return(0,r.jsxs)("div",{ref:f,style:v,className:`group flex min-w-0 items-center gap-1.5 rounded-md px-2 py-1 bg-black/[0.02] hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04] transition-colors ${b?"shadow-md ring-1 ring-primary/30":""}`,children:[(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)("button",{...h,...j,type:"button",className:"cursor-grab touch-none p-0.5 rounded text-muted-foreground hover:text-primary active:cursor-grabbing shrink-0",children:(0,r.jsx)(N.A,{className:"size-4"})})}),(0,r.jsx)(x.ZI,{children:"Drag to reorder"})]}),(0,r.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground w-3 text-center shrink-0",children:s+1}),y?(0,r.jsx)("input",{autoFocus:!0,value:S,onChange:e=>$(e.target.value),onBlur:z,onKeyDown:e=>{"Enter"===e.key&&z(),"Escape"===e.key&&($(t),k(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-foreground outline-none dark:bg-black/20"}):(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)("div",{className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-foreground hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>k(!0),children:t})}),(0,r.jsx)(x.ZI,{children:"Click to edit"})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)("button",{onClick:c,disabled:a,className:`p-0.5 rounded ${a?"text-muted-foreground/20 cursor-not-allowed":"text-muted-foreground hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,children:(0,r.jsx)(w.A,{className:"size-3"})})}),(0,r.jsx)(x.ZI,{children:"Move up"})]}),(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)("button",{onClick:m,disabled:i,className:`p-0.5 rounded ${i?"text-muted-foreground/20 cursor-not-allowed":"text-muted-foreground hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,children:(0,r.jsx)(C.A,{className:"size-3"})})}),(0,r.jsx)(x.ZI,{children:"Move down"})]})]}),(0,r.jsxs)(x.m_,{children:[(0,r.jsx)(x.k$,{asChild:!0,children:(0,r.jsx)("button",{onClick:u,className:"p-0.5 hover:bg-red-500/10 rounded text-muted-foreground hover:text-red-500 transition-all",children:(0,r.jsx)(g.A,{className:"size-3"})})}),(0,r.jsx)(x.ZI,{children:"Remove"})]})]})}function F({isOpen:e,combo:s,onClose:t,onSave:n,activeProviders:d,kindFilter:x=null}){let[h,p]=(0,l.useState)(s?.name||""),[g,b]=(0,l.useState)(s?.models||[]),[v,y]=(0,l.useState)(!1),[k,N]=(0,l.useState)(!1),[w,C]=(0,l.useState)(""),[$,z]=(0,l.useState)({}),A=(0,a.FR)((0,a.MS)(a.AN,{activationConstraint:{distance:5}}),(0,a.MS)(a.uN,{coordinateGetter:o.JR})),M=g.map((e,s)=>({uid:`item-${s}`,model:e})),_=async()=>{try{let e=await fetch("/api/models/alias");if(!e.ok)return;let s=await e.json();z(s.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}};(0,l.useEffect)(()=>{e&&_()},[e]);let O=e=>e.trim()?E.test(e)?(C(""),!0):(C("Only letters, numbers, -, _ and . allowed"),!1):(C("Name is required"),!1),I=async()=>{O(h)&&(N(!0),await n({name:h.trim(),models:g}),N(!1))},Z=!!s;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.lG,{open:e,onOpenChange:e=>{e||t()},children:(0,r.jsxs)(u.Cf,{className:"max-w-md",children:[(0,r.jsx)(u.c7,{children:(0,r.jsx)(u.L3,{children:Z?"Edit Combo":"Create Combo"})}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Combo Name"}),(0,r.jsx)(m.p,{value:h,onChange:e=>{let s=e.target.value;p(s),s?O(s):C("")},placeholder:"my-combo","aria-invalid":!!w,className:w?"ring-1 ring-red-500 border-red-500/40":""}),w&&(0,r.jsx)("p",{className:"mt-1 text-xs text-red-500",children:w}),(0,r.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:"Only letters, numbers, -, _ and . allowed"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===g.length?(0,r.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,r.jsx)(f.A,{className:"mb-1 mx-auto size-6 text-muted-foreground"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"No models added yet"})]}):(0,r.jsx)(a.Mp,{sensors:A,collisionDetection:a.fp,onDragEnd:e=>{let{active:s,over:t}=e;if(t&&s.id!==t.id){let e=M.findIndex(e=>e.uid===s.id),r=M.findIndex(e=>e.uid===t.id);-1!==e&&-1!==r&&b(s=>(0,o.be)(s,e,r))}},modifiers:[i.FN,i.gj],children:(0,r.jsx)(o.gB,{items:M.map(e=>e.uid),strategy:o._G,children:(0,r.jsx)("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:M.map(({uid:e,model:s},t)=>(0,r.jsx)(P,{id:e,index:t,model:s,isFirst:0===t,isLast:t===M.length-1,onEdit:e=>{let s=[...g];s[t]=e,b(s)},onMoveUp:()=>(e=>{if(0===e)return;let s=[...g];[s[e-1],s[e]]=[s[e],s[e-1]],b(s)})(t),onMoveDown:()=>(e=>{if(e===g.length-1)return;let s=[...g];[s[e],s[e+1]]=[s[e+1],s[e]],b(s)})(t),onRemove:()=>{b(g.filter((e,s)=>s!==t))}},e))})})}),(0,r.jsxs)("button",{onClick:()=>y(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[(0,r.jsx)(j.A,{className:"size-4"}),"Add Model"]})]})]}),(0,r.jsx)(u.Es,{children:(0,r.jsx)("div",{className:"flex w-full flex-col gap-2 pt-1 sm:flex-row",children:(0,r.jsx)(c.$,{onClick:I,size:"sm",className:"flex-1",disabled:!h.trim()||!!w||k,children:k?"Saving...":Z?"Save":"Create"})})})]})}),v&&(0,r.jsx)(S.rq,{isOpen:v,onClose:()=>y(!1),onSelect:e=>{g.includes(e.value)||b([...g,e.value])},onDeselect:e=>{b(g.filter(s=>s!==e.value))},activeProviders:d,modelAliases:$,title:"Add Model to Combo",kindFilter:x,addedModelValues:g,closeOnSelect:!1})]})}},67053:(e,s,t)=>{Promise.resolve().then(t.bind(t,29982))},92412:(e,s,t)=>{"use strict";t.d(s,{YW:()=>r.Page,pV:()=>r.CardGrid,wn:()=>r.Section,zY:()=>r.PageHeader}),t(16675),t(72778);var r=t(29575)},99656:(e,s,t)=>{"use strict";t.d(s,{PM:()=>r.PM,Sj:()=>r.Sj,Vy:()=>r.Vy,fF:()=>r.fF,sl:()=>r.sl,vL:()=>r.vL,y$:()=>r.y$,zM:()=>r.zM});var r=t(31872)}},e=>{e.O(0,[6766,5166,7552,9980,1471,5778,4484,3577,5862,5113,1699,1722,1078,159,4489,1278,1830,6770,427,9966,7358],()=>e(e.s=67053)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{1352:(e,t,r)=>{"use strict";r.d(t,{Bc:()=>i,ZI:()=>l,k$:()=>d,m_:()=>o});var a=r(29798);r(15814);var s=r(5471),n=r(44484);function i({delayDuration:e=0,...t}){return(0,a.jsx)(n.Kq,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function o({...e}){return(0,a.jsx)(n.bL,{"data-slot":"tooltip",...e})}function d({...e}){return(0,a.jsx)(n.l9,{"data-slot":"tooltip-trigger",...e})}function l({className:e,sideOffset:t=0,children:r,...i}){return(0,a.jsx)(n.ZL,{children:(0,a.jsxs)(n.UC,{"data-slot":"tooltip-content",sideOffset:t,className:(0,s.cn)("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...i,children:[r,(0,a.jsx)(n.i3,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}},4836:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var a=r(15814);let s=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var i=r(28145);let o=(0,a.forwardRef)(({color:e,size:t,width:r,height:o,strokeWidth:d,absoluteStrokeWidth:l,nonScalingStroke:c,className:u="",children:g,iconNode:p=[],icon:h={node:p,aliases:[],size:24},...m},f)=>{let{size:x=24,strokeWidth:v=2,absoluteStrokeWidth:b=!1,nonScalingStroke:k=!1,color:y="currentColor",className:w=""}=(0,i.T)()??{},j=!!g||(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(m),[N,z,A=[]]=function(e,t={}){return function(e,t={}){let r=t.attributeNames??{},a=e=>r[e]??e,i=e.size??e.width??n.width,o=e.size??e.height??n.height,d=e.aliases?.filter(e=>"string"==typeof e&&""!==e.trim()).map(e=>`lucide-${e}`)??[],l=[...e.name?[`lucide-${e.name}`]:[],...d],c=t.className?.split(" ").filter(Boolean)??[],u=!1===t.includeDefaultClasses?s(...c):s("lucide",...l,...c),g=t.absoluteStrokeWidth?Number(t.strokeWidth??n["stroke-width"])*Number(e.size??e.width??n.width)/Number(t.size??t.width??n.width):t.strokeWidth??n["stroke-width"];return["svg",{...Object.entries(n).reduce((e,[t,r])=>(e[a(t)]=r,e),{}),..."color"in t&&t.color&&{[a("stroke")]:t.color},..."size"in t&&null!=t.size&&{[a("width")]:t.size,[a("height")]:t.size},..."width"in t&&null!=t.width&&{[a("width")]:t.width},..."height"in t&&null!=t.height&&{[a("height")]:t.height},[a("stroke-width")]:g,...u&&{[a("class")]:u},[a("viewBox")]:`0 0 ${i} ${o}`,...!1===t.hasA11yProp?{[a("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(e=>{let[r,s,n]=e,i=t.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...s}:s;return n?[r,i,n]:[r,i]})]}(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(h,{color:e??y,width:r??t??x,height:o??t??x,strokeWidth:d??v,absoluteStrokeWidth:l??b,nonScalingStroke:c??k,className:s(w,u),hasA11yProp:j,attributes:m});return(0,a.createElement)(N,{ref:f,...z},[...A.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(g)?g:[g]])})},13189:(e,t,r)=>{"use strict";r.d(t,{default:()=>D});var a=r(29798),s=r(15814),n=r(75669),i=r(18055),o=r(53784),d=r(77345),l=r(1352),c=r(45111),u=r(74719),g=r(66685),p=r(24477),h=r(26339),m=r(75877),f=r(51660);let x={USAGE:"usage",STREAM:"stream","STREAM USAGE":"usage",COMBO:"combo",FUSION:"combo",TOKEN:"token",RTK:"rtk",HEADROOM:"rtk",REQUEST:"request",PROXY:"proxy",AUTH:"auth",AG_QUOTA:"auth",DB:"db",TUNNEL:"tunnel",PROJECTID:"other"},v={debug:"debug",info:"info",log:"info",warn:"warn",error:"error"},b={debug:0,info:1,warn:2,error:3};function k(e,t){return b[t]>b[e]?t:e}function y(e,t){let r=v[e]??"info",a="other";if(/\[DBG:[^\]]+\]/.test(t)||t.includes("\uD83D\uDC1B"))return{level:"debug",category:"debug"};let s=t.match(/^\[\d{1,2}:\d{2}(:\d{2})?\]\s+(DEBUG|INFO|WARN|ERROR)\b/);if(s){let e=s[2].toLowerCase();b[e]>b[r]&&(r=e)}let n=t.match(/^\[\d{1,2}:\d{2}(:\d{2})?\]\s+\[[0-9a-f]{4}\]\s+([A-Z]+)\b/);if(n){let e=n[2];"REQ"===e?a="request":"DONE"===e?a="done":"SAVERS"===e?a="rtk":"REFRESH"===e?a="token":"BLOCKED"===e||"ABORT"===e?a="stream":"ERROR"===e&&(r=k(r,"error"),"other"===a&&(a="request"))}if("other"===a&&/^\[\d{1,2}:\d{2}(:\d{2})?\]\s+\[(http|stream|usage)\]/i.test(t)){let e=t.match(/^\[\d{1,2}:\d{2}(:\d{2})?\]\s+\[(http|stream|usage)\]/i)[2].toLowerCase();a="http"===e?"request":e}let i=t.match(/\[([A-Z][A-Z _-]*)\]/g);if(i)for(let e of i){let t=e.slice(1,-1).trim();if(x[t]){a=x[t];break}if("DBG"===t||t.startsWith("DBG:"))return{level:"debug",category:"debug"}}return t.includes("✗")||t.includes("❌")?(r=k(r,"error"),"other"===a&&(a="request")):t.includes("\uD83D\uDCCA")?t.includes("DONE")?a="done":"other"===a&&(a="usage"):t.includes("⚠️")?r=k(r,"warn"):t.includes("\uD83C\uDF0A")?"other"===a&&(a="stream"):t.includes("\uD83D\uDD11")||t.includes("TOKEN REFRESHED")?"other"===a&&(a="token"):t.includes("ℹ️")||t.includes("\uD83D\uDD0D")?t.includes("\uD83D\uDD0D")&&(r=k(r,"debug")):t.includes("\uD83D\uDCE5")&&"other"===a&&(a="request"),"other"===a&&/\b(POST|GET|PUT|DELETE|PATCH)\b/.test(t)&&(a="request"),/\bERROR \d{3}\b/.test(t)||/\bFAILED\b/.test(t)||/\bBLOCKED\b/.test(t)?r=k(r,"error"):/\b(falling back|fallback|unavailable|skipped|retry)\b/i.test(t)&&(r=k(r,"warn")),"other"===a&&(t.includes("[RTK]")||t.includes("HEADROOM")||t.includes("PXPIPE")?a="rtk":t.includes("[ProjectId]")?a="other":t.includes("[ProxyFetch]")?a="proxy":t.includes("[Tunnel]")?a="tunnel":t.includes("[DB]")?a="db":t.includes("[RequestDetail]")?a="request":t.includes("[STREAM]")?a="stream":t.includes("[TOKEN]")?a="token":t.includes("[COMBO]")||t.includes("[FUSION]")?a="combo":t.includes("[CHAT]")&&(a="request")),{level:r,category:a}}function w(e,t="log"){if("string"==typeof e){let{level:r,category:a}=y(t,e);return{ts:Date.now(),level:r,category:a,text:e}}if(e&&"object"==typeof e&&"string"==typeof e.text){if("number"==typeof e.ts&&e.level&&e.category)return e;let{level:r,category:a}=y(t,e.text);return{ts:"number"==typeof e.ts?e.ts:Date.now(),level:e.level??r,category:e.category??a,text:e.text}}let r=String(e??""),{level:a,category:s}=y(t,r);return{ts:Date.now(),level:a,category:s,text:r}}let j={debug:"secondary",info:"default",warn:"secondary",error:"destructive"},N={debug:"bg-muted text-muted-foreground",info:"bg-sky-500/15 text-sky-700 dark:text-sky-300",warn:"bg-amber-500/15 text-amber-700 dark:text-amber-300",error:""},z={debug:"DEBUG",info:"INFO",warn:"WARN",error:"ERROR"},A=["debug","info","warn","error"],E={all:"All categories",request:"Request",done:"Done",usage:"Usage",combo:"Combo",token:"Token",rtk:"RTK",stream:"Stream",debug:"Debug",auth:"Auth",proxy:"Proxy",db:"DB",tunnel:"Tunnel",other:"Other"},C=["request","done","usage","combo","token","rtk","stream","debug","auth","proxy","db","tunnel","other"],R=/^\[\d{1,2}:\d{2}(:\d{2})?(\s?[AP]M)?\]\s*/,O=/\b(IN|OUT) \d[\d,]*( \(CACHE [^)]*\))?|\b\d[\d,]*ms\b|\b[A-Za-z_][\w.-]*=[^\s·|,]+/g;function S({text:e,isError:t}){let[r,n]=(0,s.useMemo)(()=>{let t;return -1===(t=e.indexOf("\n"))?[e,null]:[e.slice(0,t),e.slice(t+1)]},[e]),i=(0,s.useMemo)(()=>(function(e){let t=[],r=0;for(let a of e.matchAll(O)){let s=a[0],n=a.index??0;if(n>r&&t.push({kind:"plain",text:e.slice(r,n)}),/^(IN|OUT) /.test(s))t.push({kind:"tokens",text:s});else if(/ms$/.test(s))t.push({kind:"duration",text:s});else{let e=s.indexOf("=");t.push({kind:"kv",key:s.slice(0,e+1),value:s.slice(e+1)})}r=n+s.length}return r<e.length&&t.push({kind:"plain",text:e.slice(r)}),0===t.length&&t.push({kind:"plain",text:e}),t})(r.replace(R,"")),[r]);return(0,a.jsxs)("span",{className:"break-words",children:[i.map((e,t)=>"duration"===e.kind?(0,a.jsx)("span",{className:"font-semibold text-amber-700",children:e.text},t):"tokens"===e.kind?(0,a.jsx)("span",{className:"font-semibold text-emerald-700",children:e.text},t):"kv"===e.kind?(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:e.key}),(0,a.jsx)("span",{className:"font-medium text-sky-700",children:e.value})]},t):(0,a.jsx)("span",{children:e.text},t)),n&&(0,a.jsxs)("details",{className:"mt-1",children:[(0,a.jsx)("summary",{className:`cursor-pointer text-[11px] font-medium ${t?"text-red-600":"text-muted-foreground"} hover:underline`,children:"Stack trace"}),(0,a.jsx)("pre",{className:"mt-1 max-h-40 overflow-auto rounded bg-muted p-2 text-[11px] whitespace-pre-wrap text-muted-foreground",children:n})]})]})}function T({entry:e}){let t="error"===e.level,r="warn"===e.level,s="done"===e.category;return(0,a.jsxs)("div",{className:`flex items-start gap-2 px-3 py-1.5 leading-relaxed ${t?"border-l-2 border-red-500 bg-red-500/5":r?"border-l-2 border-amber-500 bg-amber-500/5":s?"border-l-2 border-green-500 bg-green-500/5":"border-l-2 border-transparent hover:bg-muted/50"}`,children:[(0,a.jsx)("span",{className:"shrink-0 pt-0.5 text-[11px] text-muted-foreground tabular-nums",children:new Date(e.ts).toLocaleTimeString("en-US",{hour12:!1})}),(0,a.jsx)(o.E,{variant:j[e.level],className:`shrink-0 ${N[e.level]}`,children:z[e.level]}),(0,a.jsx)("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-semibold text-muted-foreground uppercase",children:E[e.category]}),(0,a.jsx)("span",{className:"min-w-0 flex-1 text-foreground",children:(0,a.jsx)(S,{text:e.text,isError:t})})]})}function _(e){return e.map(e=>w(e))}function D(){let[e,t]=(0,s.useState)([]),[r,x]=(0,s.useState)(!1),[v,b]=(0,s.useState)(!1),[k,y]=(0,s.useState)(!0),[N,R]=(0,s.useState)(""),[O,S]=(0,s.useState)(new Set(A)),[D,L]=(0,s.useState)("all"),M=(0,s.useRef)(null),U=(0,s.useRef)(v);(0,s.useEffect)(()=>{U.current=v},[v]);let B=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};(0,s.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>x(!0),e.onmessage=e=>{if(U.current)return;let r=JSON.parse(e.data);if("init"===r.type)t(_(r.logs).slice(-f.UY.maxLines));else if("line"===r.type){let e=w(r.line);t(t=>{let r=[...t,e];return r.length>f.UY.maxLines?r.slice(-f.UY.maxLines):r})}else if("lines"===r.type){let e=_(r.lines);t(t=>{let r=[...t,...e];return r.length>f.UY.maxLines?r.slice(-f.UY.maxLines):r})}else"clear"===r.type&&t([])},e.onerror=()=>x(!1),()=>e.close()},[]),(0,s.useEffect)(()=>{k&&M.current&&(M.current.scrollTop=M.current.scrollHeight)},[e,k]);let $=(0,s.useMemo)(()=>{let t=N.trim().toLowerCase();return e.filter(e=>!!O.has(e.level)&&("all"===D||e.category===D)&&(!t||!!e.text.toLowerCase().includes(t)))},[e,O,D,N]),q=(0,s.useMemo)(()=>e.filter(e=>"error"===e.level).length,[e]),P=(0,s.useMemo)(()=>e.filter(e=>"warn"===e.level).length,[e]);return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsx)(n.ZB,{className:"sr-only",children:"Console logs"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)(l.m_,{children:[(0,a.jsx)(l.k$,{asChild:!0,children:(0,a.jsx)("span",{className:r?"size-2 rounded-full bg-green-500":"size-2 rounded-full bg-red-500"})}),(0,a.jsx)(l.ZI,{children:r?"Connected":"Disconnected"})]}),(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:[$.length,"/",e.length," lines",q>0&&(0,a.jsxs)("span",{className:"font-semibold text-red-600",children:[" \xb7 ",q," errors"]}),P>0&&(0,a.jsxs)("span",{className:"font-semibold text-yellow-600",children:[" \xb7 ",P," warnings"]})]}),(0,a.jsxs)("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(u.A,{className:"pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground"}),(0,a.jsx)(d.p,{value:N,onChange:e=>R(e.target.value),placeholder:"Search logs…",className:"h-7 w-44 pl-8 text-xs"})]}),(0,a.jsx)("div",{className:"flex items-center gap-1",children:A.map(e=>(0,a.jsxs)(l.m_,{children:[(0,a.jsx)(l.k$,{asChild:!0,children:(0,a.jsx)("button",{type:"button",onClick:()=>{S(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},className:`cursor-pointer transition-opacity ${O.has(e)?"opacity-100":"opacity-30 grayscale"}`,children:(0,a.jsx)(o.E,{variant:j[e],children:z[e]})})}),(0,a.jsx)(l.ZI,{children:`Toggle ${z[e]}`})]},e))}),(0,a.jsxs)(c.l6,{value:D,onValueChange:e=>L(e),children:[(0,a.jsx)(c.bq,{className:"h-7 w-32 text-xs",children:(0,a.jsx)(c.yv,{})}),(0,a.jsxs)(c.gC,{children:[(0,a.jsx)(c.eb,{value:"all",children:E.all}),C.map(e=>(0,a.jsx)(c.eb,{value:e,children:E[e]},e))]})]}),(0,a.jsxs)(i.$,{size:"sm",variant:"outline",onClick:()=>b(e=>!e),children:[v?(0,a.jsx)(g.A,{}):(0,a.jsx)(p.A,{}),v?"Resume":"Pause"]}),(0,a.jsxs)(l.m_,{children:[(0,a.jsx)(l.k$,{asChild:!0,children:(0,a.jsxs)(i.$,{size:"sm",variant:k?"secondary":"outline",onClick:()=>y(e=>!e),children:[(0,a.jsx)(h.A,{}),"Follow"]})}),(0,a.jsx)(l.ZI,{children:"Auto-scroll to newest"})]}),(0,a.jsxs)(i.$,{size:"sm",variant:"outline",onClick:B,children:[(0,a.jsx)(m.A,{}),"Clear"]})]})]})]}),(0,a.jsx)(n.Wu,{className:"pt-0",children:(0,a.jsx)("div",{ref:M,className:"h-[calc(100vh-220px)] overflow-y-auto rounded-b-lg border border-border bg-card p-2 font-mono text-xs",children:0===e.length?(0,a.jsx)("span",{className:"text-muted-foreground",children:"No console logs yet."}):0===$.length?(0,a.jsx)("span",{className:"text-muted-foreground",children:"No logs match the current filters."}):(0,a.jsx)("div",{className:"divide-y divide-border/50",children:$.map((e,t)=>(0,a.jsx)(T,{entry:e},t))})})})]})}},15298:(e,t,r)=>{Promise.resolve().then(r.bind(r,13189))},18055:(e,t,r)=>{"use strict";r.d(t,{$:()=>d});var a=r(29798);r(15814);var s=r(54366),n=r(5471),i=r(80954);let o=(0,s.F)("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",lg:"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-9","icon-xs":"size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function d({className:e,variant:t="default",size:r="default",asChild:s=!1,...l}){let c=s?i.bL:"button";return(0,a.jsx)(c,{"data-slot":"button","data-variant":t,"data-size":r,className:(0,n.cn)(o({variant:t,size:r,className:e})),...l})}},24477:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};s.node;let n=(0,a.A)(s)},26339:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};s.node;let n=(0,a.A)(s)},28145:(e,t,r)=>{"use strict";r.d(t,{T:()=>i,a:()=>n});var a=r(15814);let s=(0,a.createContext)({});function n({children:e,size:t,color:r,strokeWidth:i,absoluteStrokeWidth:o,nonScalingStroke:d,className:l}){let c=(0,a.useMemo)(()=>({size:t,color:r,strokeWidth:i,absoluteStrokeWidth:o,nonScalingStroke:d,className:l}),[t,r,i,o,d,l]);return(0,a.createElement)(s.Provider,{value:c},e)}let i=()=>(0,a.useContext)(s)},28830:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};s.node;let n=(0,a.A)(s)},45111:(e,t,r)=>{"use strict";r.d(t,{bq:()=>u,eb:()=>p,gC:()=>g,l6:()=>l,yv:()=>c});var a=r(29798);r(15814);var s=r(5471),n=r(95862),i=r(58765),o=r(63587),d=r(28830);function l({...e}){return(0,a.jsx)(n.bL,{"data-slot":"select",...e})}function c({...e}){return(0,a.jsx)(n.WT,{"data-slot":"select-value",...e})}function u({className:e,size:t="default",children:r,...o}){return(0,a.jsxs)(n.l9,{"data-slot":"select-trigger","data-size":t,className:(0,s.cn)("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-background py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[r,(0,a.jsx)(n.In,{asChild:!0,children:(0,a.jsx)(i.A,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function g({className:e,children:t,position:r="popper",align:i="center",...o}){return(0,a.jsx)(n.ZL,{children:(0,a.jsxs)(n.UC,{"data-slot":"select-content","data-align-trigger":"item-aligned"===r,className:(0,s.cn)("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,align:i,...o,children:[(0,a.jsx)(h,{}),(0,a.jsx)(n.LM,{"data-position":r,className:(0,s.cn)("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)","popper"===r&&""),children:t}),(0,a.jsx)(m,{})]})})}function p({className:e,children:t,...r}){return(0,a.jsxs)(n.q7,{"data-slot":"select-item",className:(0,s.cn)("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[(0,a.jsx)("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:(0,a.jsx)(n.VF,{children:(0,a.jsx)(o.A,{className:"pointer-events-none"})})}),(0,a.jsx)(n.p4,{children:t})]})}function h({className:e,...t}){return(0,a.jsx)(n.PP,{"data-slot":"select-scroll-up-button",className:(0,s.cn)("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:(0,a.jsx)(d.A,{})})}function m({className:e,...t}){return(0,a.jsx)(n.wn,{"data-slot":"select-scroll-down-button",className:(0,s.cn)("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:(0,a.jsx)(i.A,{})})}},50009:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(15814),s=r(4836);function n(e,t=[],r=[]){let i,o="string"==typeof e?function(e,t,r=[]){if(null==t)throw Error("[lucide]: iconNode is required when icon name is used");return{name:e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),size:24,node:t,...r.length>0?{aliases:r}:{}}}(e,t,r):e,d=(0,a.forwardRef)(({className:e,...t},r)=>(0,a.createElement)(s.A,{ref:r,icon:o,className:e,...t}));return o.name&&(d.displayName=(i=(e=>{let t="",r=!1;for(let a of e){if("-"===a||"_"===a||a<=" "){r=t.length>0;continue}0===t.length?t+=a.toLowerCase():t+=r?a.toUpperCase():a,r=!1}return t})(o.name)).charAt(0).toUpperCase()+i.slice(1)),d}},51660:(e,t,r)=>{"use strict";r.d(t,{Q2:()=>a.Q2,fg:()=>a.fg,vQ:()=>s,_$:()=>i,MA:()=>a.MA,UY:()=>d,Nu:()=>n,zN:()=>a.zN,B2:()=>o});var a=r(13794);r(80159);let s={name:"10Router Proxy",description:"AI Infrastructure Management",version:"0.1.8"},n={changelogUrl:"/api/changelog"},i=20128,o={storageKey:"theme",defaultTheme:"light"},d={maxLines:500,pollIntervalMs:1e3}},53784:(e,t,r)=>{"use strict";r.d(t,{E:()=>d});var a=r(29798);r(15814);var s=r(54366),n=r(5471),i=r(80954);let o=(0,s.F)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function d({className:e,variant:t="default",asChild:r=!1,...s}){let l=r?i.bL:"span";return(0,a.jsx)(l,{"data-slot":"badge","data-variant":t,className:(0,n.cn)(o({variant:t}),e),...s})}},58765:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};s.node;let n=(0,a.A)(s)},63587:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};s.node;let n=(0,a.A)(s)},66685:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};s.node;let n=(0,a.A)(s)},74719:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};s.node;let n=(0,a.A)(s)},75669:(e,t,r)=>{"use strict";r.d(t,{BT:()=>d,Wu:()=>c,X9:()=>l,ZB:()=>o,Zp:()=>n,aR:()=>i});var a=r(29798);r(15814);var s=r(5471);function n({className:e,size:t="default",...r}){return(0,a.jsx)("div",{"data-slot":"card","data-size":t,className:(0,s.cn)("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...r})}function i({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t})}function o({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",e),...t})}function d({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-description",className:(0,s.cn)("text-sm text-muted-foreground",e),...t})}function l({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-action",className:(0,s.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function c({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("flex flex-col gap-3 px-(--card-spacing)",e),...t})}},75877:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};s.node;let n=(0,a.A)(s)},77345:(e,t,r)=>{"use strict";r.d(t,{p:()=>n});var a=r(29798);r(15814);var s=r(5471);function n({className:e,type:t,...r}){return(0,a.jsx)("input",{type:t,"data-slot":"input",className:(0,s.cn)("h-9 w-full min-w-0 rounded-md border border-input bg-background px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...r})}}},e=>{e.O(0,[5166,7552,9980,5778,4484,3577,5862,159,427,9966,7358],()=>e(e.s=15298)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{1352:(e,t,r)=>{"use strict";r.d(t,{Bc:()=>i,ZI:()=>l,k$:()=>d,m_:()=>o});var a=r(29798);r(15814);var s=r(5471),n=r(44484);function i({delayDuration:e=0,...t}){return(0,a.jsx)(n.Kq,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function o({...e}){return(0,a.jsx)(n.bL,{"data-slot":"tooltip",...e})}function d({...e}){return(0,a.jsx)(n.l9,{"data-slot":"tooltip-trigger",...e})}function l({className:e,sideOffset:t=0,children:r,...i}){return(0,a.jsx)(n.ZL,{children:(0,a.jsxs)(n.UC,{"data-slot":"tooltip-content",sideOffset:t,className:(0,s.cn)("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...i,children:[r,(0,a.jsx)(n.i3,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}},4836:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var a=r(15814);let s=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var i=r(28145);let o=(0,a.forwardRef)(({color:e,size:t,width:r,height:o,strokeWidth:d,absoluteStrokeWidth:l,nonScalingStroke:c,className:u="",children:g,iconNode:p=[],icon:h={node:p,aliases:[],size:24},...m},f)=>{let{size:x=24,strokeWidth:v=2,absoluteStrokeWidth:b=!1,nonScalingStroke:k=!1,color:y="currentColor",className:w=""}=(0,i.T)()??{},j=!!g||(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(m),[N,z,A=[]]=function(e,t={}){return function(e,t={}){let r=t.attributeNames??{},a=e=>r[e]??e,i=e.size??e.width??n.width,o=e.size??e.height??n.height,d=e.aliases?.filter(e=>"string"==typeof e&&""!==e.trim()).map(e=>`lucide-${e}`)??[],l=[...e.name?[`lucide-${e.name}`]:[],...d],c=t.className?.split(" ").filter(Boolean)??[],u=!1===t.includeDefaultClasses?s(...c):s("lucide",...l,...c),g=t.absoluteStrokeWidth?Number(t.strokeWidth??n["stroke-width"])*Number(e.size??e.width??n.width)/Number(t.size??t.width??n.width):t.strokeWidth??n["stroke-width"];return["svg",{...Object.entries(n).reduce((e,[t,r])=>(e[a(t)]=r,e),{}),..."color"in t&&t.color&&{[a("stroke")]:t.color},..."size"in t&&null!=t.size&&{[a("width")]:t.size,[a("height")]:t.size},..."width"in t&&null!=t.width&&{[a("width")]:t.width},..."height"in t&&null!=t.height&&{[a("height")]:t.height},[a("stroke-width")]:g,...u&&{[a("class")]:u},[a("viewBox")]:`0 0 ${i} ${o}`,...!1===t.hasA11yProp?{[a("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(e=>{let[r,s,n]=e,i=t.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...s}:s;return n?[r,i,n]:[r,i]})]}(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(h,{color:e??y,width:r??t??x,height:o??t??x,strokeWidth:d??v,absoluteStrokeWidth:l??b,nonScalingStroke:c??k,className:s(w,u),hasA11yProp:j,attributes:m});return(0,a.createElement)(N,{ref:f,...z},[...A.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(g)?g:[g]])})},13189:(e,t,r)=>{"use strict";r.d(t,{default:()=>D});var a=r(29798),s=r(15814),n=r(75669),i=r(18055),o=r(53784),d=r(77345),l=r(1352),c=r(45111),u=r(74719),g=r(66685),p=r(24477),h=r(26339),m=r(75877),f=r(51660);let x={USAGE:"usage",STREAM:"stream","STREAM USAGE":"usage",COMBO:"combo",FUSION:"combo",TOKEN:"token",RTK:"rtk",HEADROOM:"rtk",REQUEST:"request",PROXY:"proxy",AUTH:"auth",AG_QUOTA:"auth",DB:"db",TUNNEL:"tunnel",PROJECTID:"other"},v={debug:"debug",info:"info",log:"info",warn:"warn",error:"error"},b={debug:0,info:1,warn:2,error:3};function k(e,t){return b[t]>b[e]?t:e}function y(e,t){let r=v[e]??"info",a="other";if(/\[DBG:[^\]]+\]/.test(t)||t.includes("\uD83D\uDC1B"))return{level:"debug",category:"debug"};let s=t.match(/^\[\d{1,2}:\d{2}(:\d{2})?\]\s+(DEBUG|INFO|WARN|ERROR)\b/);if(s){let e=s[2].toLowerCase();b[e]>b[r]&&(r=e)}let n=t.match(/^\[\d{1,2}:\d{2}(:\d{2})?\]\s+\[[0-9a-f]{4}\]\s+([A-Z]+)\b/);if(n){let e=n[2];"REQ"===e?a="request":"DONE"===e?a="done":"SAVERS"===e?a="rtk":"REFRESH"===e?a="token":"BLOCKED"===e||"ABORT"===e?a="stream":"ERROR"===e&&(r=k(r,"error"),"other"===a&&(a="request"))}if("other"===a&&/^\[\d{1,2}:\d{2}(:\d{2})?\]\s+\[(http|stream|usage)\]/i.test(t)){let e=t.match(/^\[\d{1,2}:\d{2}(:\d{2})?\]\s+\[(http|stream|usage)\]/i)[2].toLowerCase();a="http"===e?"request":e}let i=t.match(/\[([A-Z][A-Z _-]*)\]/g);if(i)for(let e of i){let t=e.slice(1,-1).trim();if(x[t]){a=x[t];break}if("DBG"===t||t.startsWith("DBG:"))return{level:"debug",category:"debug"}}return t.includes("✗")||t.includes("❌")?(r=k(r,"error"),"other"===a&&(a="request")):t.includes("\uD83D\uDCCA")?t.includes("DONE")?a="done":"other"===a&&(a="usage"):t.includes("⚠️")?r=k(r,"warn"):t.includes("\uD83C\uDF0A")?"other"===a&&(a="stream"):t.includes("\uD83D\uDD11")||t.includes("TOKEN REFRESHED")?"other"===a&&(a="token"):t.includes("ℹ️")||t.includes("\uD83D\uDD0D")?t.includes("\uD83D\uDD0D")&&(r=k(r,"debug")):t.includes("\uD83D\uDCE5")&&"other"===a&&(a="request"),"other"===a&&/\b(POST|GET|PUT|DELETE|PATCH)\b/.test(t)&&(a="request"),/\bERROR \d{3}\b/.test(t)||/\bFAILED\b/.test(t)||/\bBLOCKED\b/.test(t)?r=k(r,"error"):/\b(falling back|fallback|unavailable|skipped|retry)\b/i.test(t)&&(r=k(r,"warn")),"other"===a&&(t.includes("[RTK]")||t.includes("HEADROOM")||t.includes("PXPIPE")?a="rtk":t.includes("[ProjectId]")?a="other":t.includes("[ProxyFetch]")?a="proxy":t.includes("[Tunnel]")?a="tunnel":t.includes("[DB]")?a="db":t.includes("[RequestDetail]")?a="request":t.includes("[STREAM]")?a="stream":t.includes("[TOKEN]")?a="token":t.includes("[COMBO]")||t.includes("[FUSION]")?a="combo":t.includes("[CHAT]")&&(a="request")),{level:r,category:a}}function w(e,t="log"){if("string"==typeof e){let{level:r,category:a}=y(t,e);return{ts:Date.now(),level:r,category:a,text:e}}if(e&&"object"==typeof e&&"string"==typeof e.text){if("number"==typeof e.ts&&e.level&&e.category)return e;let{level:r,category:a}=y(t,e.text);return{ts:"number"==typeof e.ts?e.ts:Date.now(),level:e.level??r,category:e.category??a,text:e.text}}let r=String(e??""),{level:a,category:s}=y(t,r);return{ts:Date.now(),level:a,category:s,text:r}}let j={debug:"secondary",info:"default",warn:"secondary",error:"destructive"},N={debug:"bg-muted text-muted-foreground",info:"bg-sky-500/15 text-sky-700 dark:text-sky-300",warn:"bg-amber-500/15 text-amber-700 dark:text-amber-300",error:""},z={debug:"DEBUG",info:"INFO",warn:"WARN",error:"ERROR"},A=["debug","info","warn","error"],E={all:"All categories",request:"Request",done:"Done",usage:"Usage",combo:"Combo",token:"Token",rtk:"RTK",stream:"Stream",debug:"Debug",auth:"Auth",proxy:"Proxy",db:"DB",tunnel:"Tunnel",other:"Other"},C=["request","done","usage","combo","token","rtk","stream","debug","auth","proxy","db","tunnel","other"],R=/^\[\d{1,2}:\d{2}(:\d{2})?(\s?[AP]M)?\]\s*/,O=/\b(IN|OUT) \d[\d,]*( \(CACHE [^)]*\))?|\b\d[\d,]*ms\b|\b[A-Za-z_][\w.-]*=[^\s·|,]+/g;function S({text:e,isError:t}){let[r,n]=(0,s.useMemo)(()=>{let t;return -1===(t=e.indexOf("\n"))?[e,null]:[e.slice(0,t),e.slice(t+1)]},[e]),i=(0,s.useMemo)(()=>(function(e){let t=[],r=0;for(let a of e.matchAll(O)){let s=a[0],n=a.index??0;if(n>r&&t.push({kind:"plain",text:e.slice(r,n)}),/^(IN|OUT) /.test(s))t.push({kind:"tokens",text:s});else if(/ms$/.test(s))t.push({kind:"duration",text:s});else{let e=s.indexOf("=");t.push({kind:"kv",key:s.slice(0,e+1),value:s.slice(e+1)})}r=n+s.length}return r<e.length&&t.push({kind:"plain",text:e.slice(r)}),0===t.length&&t.push({kind:"plain",text:e}),t})(r.replace(R,"")),[r]);return(0,a.jsxs)("span",{className:"break-words",children:[i.map((e,t)=>"duration"===e.kind?(0,a.jsx)("span",{className:"font-semibold text-amber-700",children:e.text},t):"tokens"===e.kind?(0,a.jsx)("span",{className:"font-semibold text-emerald-700",children:e.text},t):"kv"===e.kind?(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:e.key}),(0,a.jsx)("span",{className:"font-medium text-sky-700",children:e.value})]},t):(0,a.jsx)("span",{children:e.text},t)),n&&(0,a.jsxs)("details",{className:"mt-1",children:[(0,a.jsx)("summary",{className:`cursor-pointer text-[11px] font-medium ${t?"text-red-600":"text-muted-foreground"} hover:underline`,children:"Stack trace"}),(0,a.jsx)("pre",{className:"mt-1 max-h-40 overflow-auto rounded bg-muted p-2 text-[11px] whitespace-pre-wrap text-muted-foreground",children:n})]})]})}function T({entry:e}){let t="error"===e.level,r="warn"===e.level,s="done"===e.category;return(0,a.jsxs)("div",{className:`flex items-start gap-2 px-3 py-1.5 leading-relaxed ${t?"border-l-2 border-red-500 bg-red-500/5":r?"border-l-2 border-amber-500 bg-amber-500/5":s?"border-l-2 border-green-500 bg-green-500/5":"border-l-2 border-transparent hover:bg-muted/50"}`,children:[(0,a.jsx)("span",{className:"shrink-0 pt-0.5 text-[11px] text-muted-foreground tabular-nums",children:new Date(e.ts).toLocaleTimeString("en-US",{hour12:!1})}),(0,a.jsx)(o.E,{variant:j[e.level],className:`shrink-0 ${N[e.level]}`,children:z[e.level]}),(0,a.jsx)("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-semibold text-muted-foreground uppercase",children:E[e.category]}),(0,a.jsx)("span",{className:"min-w-0 flex-1 text-foreground",children:(0,a.jsx)(S,{text:e.text,isError:t})})]})}function _(e){return e.map(e=>w(e))}function D(){let[e,t]=(0,s.useState)([]),[r,x]=(0,s.useState)(!1),[v,b]=(0,s.useState)(!1),[k,y]=(0,s.useState)(!0),[N,R]=(0,s.useState)(""),[O,S]=(0,s.useState)(new Set(A)),[D,L]=(0,s.useState)("all"),M=(0,s.useRef)(null),U=(0,s.useRef)(v);(0,s.useEffect)(()=>{U.current=v},[v]);let B=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};(0,s.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>x(!0),e.onmessage=e=>{if(U.current)return;let r=JSON.parse(e.data);if("init"===r.type)t(_(r.logs).slice(-f.UY.maxLines));else if("line"===r.type){let e=w(r.line);t(t=>{let r=[...t,e];return r.length>f.UY.maxLines?r.slice(-f.UY.maxLines):r})}else if("lines"===r.type){let e=_(r.lines);t(t=>{let r=[...t,...e];return r.length>f.UY.maxLines?r.slice(-f.UY.maxLines):r})}else"clear"===r.type&&t([])},e.onerror=()=>x(!1),()=>e.close()},[]),(0,s.useEffect)(()=>{k&&M.current&&(M.current.scrollTop=M.current.scrollHeight)},[e,k]);let $=(0,s.useMemo)(()=>{let t=N.trim().toLowerCase();return e.filter(e=>!!O.has(e.level)&&("all"===D||e.category===D)&&(!t||!!e.text.toLowerCase().includes(t)))},[e,O,D,N]),q=(0,s.useMemo)(()=>e.filter(e=>"error"===e.level).length,[e]),P=(0,s.useMemo)(()=>e.filter(e=>"warn"===e.level).length,[e]);return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)(n.aR,{children:[(0,a.jsx)(n.ZB,{className:"sr-only",children:"Console logs"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)(l.m_,{children:[(0,a.jsx)(l.k$,{asChild:!0,children:(0,a.jsx)("span",{className:r?"size-2 rounded-full bg-green-500":"size-2 rounded-full bg-red-500"})}),(0,a.jsx)(l.ZI,{children:r?"Connected":"Disconnected"})]}),(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:[$.length,"/",e.length," lines",q>0&&(0,a.jsxs)("span",{className:"font-semibold text-red-600",children:[" \xb7 ",q," errors"]}),P>0&&(0,a.jsxs)("span",{className:"font-semibold text-yellow-600",children:[" \xb7 ",P," warnings"]})]}),(0,a.jsxs)("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(u.A,{className:"pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground"}),(0,a.jsx)(d.p,{value:N,onChange:e=>R(e.target.value),placeholder:"Search logs…",className:"h-7 w-44 pl-8 text-xs"})]}),(0,a.jsx)("div",{className:"flex items-center gap-1",children:A.map(e=>(0,a.jsxs)(l.m_,{children:[(0,a.jsx)(l.k$,{asChild:!0,children:(0,a.jsx)("button",{type:"button",onClick:()=>{S(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},className:`cursor-pointer transition-opacity ${O.has(e)?"opacity-100":"opacity-30 grayscale"}`,children:(0,a.jsx)(o.E,{variant:j[e],children:z[e]})})}),(0,a.jsx)(l.ZI,{children:`Toggle ${z[e]}`})]},e))}),(0,a.jsxs)(c.l6,{value:D,onValueChange:e=>L(e),children:[(0,a.jsx)(c.bq,{className:"h-7 w-32 text-xs",children:(0,a.jsx)(c.yv,{})}),(0,a.jsxs)(c.gC,{children:[(0,a.jsx)(c.eb,{value:"all",children:E.all}),C.map(e=>(0,a.jsx)(c.eb,{value:e,children:E[e]},e))]})]}),(0,a.jsxs)(i.$,{size:"sm",variant:"outline",onClick:()=>b(e=>!e),children:[v?(0,a.jsx)(g.A,{}):(0,a.jsx)(p.A,{}),v?"Resume":"Pause"]}),(0,a.jsxs)(l.m_,{children:[(0,a.jsx)(l.k$,{asChild:!0,children:(0,a.jsxs)(i.$,{size:"sm",variant:k?"secondary":"outline",onClick:()=>y(e=>!e),children:[(0,a.jsx)(h.A,{}),"Follow"]})}),(0,a.jsx)(l.ZI,{children:"Auto-scroll to newest"})]}),(0,a.jsxs)(i.$,{size:"sm",variant:"outline",onClick:B,children:[(0,a.jsx)(m.A,{}),"Clear"]})]})]})]}),(0,a.jsx)(n.Wu,{className:"pt-0",children:(0,a.jsx)("div",{ref:M,className:"h-[calc(100vh-220px)] overflow-y-auto rounded-b-lg border border-border bg-card p-2 font-mono text-xs",children:0===e.length?(0,a.jsx)("span",{className:"text-muted-foreground",children:"No console logs yet."}):0===$.length?(0,a.jsx)("span",{className:"text-muted-foreground",children:"No logs match the current filters."}):(0,a.jsx)("div",{className:"divide-y divide-border/50",children:$.map((e,t)=>(0,a.jsx)(T,{entry:e},t))})})})]})}},15298:(e,t,r)=>{Promise.resolve().then(r.bind(r,13189))},18055:(e,t,r)=>{"use strict";r.d(t,{$:()=>d});var a=r(29798);r(15814);var s=r(54366),n=r(5471),i=r(80954);let o=(0,s.F)("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",lg:"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-9","icon-xs":"size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function d({className:e,variant:t="default",size:r="default",asChild:s=!1,...l}){let c=s?i.bL:"button";return(0,a.jsx)(c,{"data-slot":"button","data-variant":t,"data-size":r,className:(0,n.cn)(o({variant:t,size:r,className:e})),...l})}},24477:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};s.node;let n=(0,a.A)(s)},26339:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};s.node;let n=(0,a.A)(s)},28145:(e,t,r)=>{"use strict";r.d(t,{T:()=>i,a:()=>n});var a=r(15814);let s=(0,a.createContext)({});function n({children:e,size:t,color:r,strokeWidth:i,absoluteStrokeWidth:o,nonScalingStroke:d,className:l}){let c=(0,a.useMemo)(()=>({size:t,color:r,strokeWidth:i,absoluteStrokeWidth:o,nonScalingStroke:d,className:l}),[t,r,i,o,d,l]);return(0,a.createElement)(s.Provider,{value:c},e)}let i=()=>(0,a.useContext)(s)},28830:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};s.node;let n=(0,a.A)(s)},45111:(e,t,r)=>{"use strict";r.d(t,{bq:()=>u,eb:()=>p,gC:()=>g,l6:()=>l,yv:()=>c});var a=r(29798);r(15814);var s=r(5471),n=r(95862),i=r(58765),o=r(63587),d=r(28830);function l({...e}){return(0,a.jsx)(n.bL,{"data-slot":"select",...e})}function c({...e}){return(0,a.jsx)(n.WT,{"data-slot":"select-value",...e})}function u({className:e,size:t="default",children:r,...o}){return(0,a.jsxs)(n.l9,{"data-slot":"select-trigger","data-size":t,className:(0,s.cn)("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-background py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[r,(0,a.jsx)(n.In,{asChild:!0,children:(0,a.jsx)(i.A,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function g({className:e,children:t,position:r="popper",align:i="center",...o}){return(0,a.jsx)(n.ZL,{children:(0,a.jsxs)(n.UC,{"data-slot":"select-content","data-align-trigger":"item-aligned"===r,className:(0,s.cn)("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,align:i,...o,children:[(0,a.jsx)(h,{}),(0,a.jsx)(n.LM,{"data-position":r,className:(0,s.cn)("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)","popper"===r&&""),children:t}),(0,a.jsx)(m,{})]})})}function p({className:e,children:t,...r}){return(0,a.jsxs)(n.q7,{"data-slot":"select-item",className:(0,s.cn)("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[(0,a.jsx)("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:(0,a.jsx)(n.VF,{children:(0,a.jsx)(o.A,{className:"pointer-events-none"})})}),(0,a.jsx)(n.p4,{children:t})]})}function h({className:e,...t}){return(0,a.jsx)(n.PP,{"data-slot":"select-scroll-up-button",className:(0,s.cn)("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:(0,a.jsx)(d.A,{})})}function m({className:e,...t}){return(0,a.jsx)(n.wn,{"data-slot":"select-scroll-down-button",className:(0,s.cn)("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:(0,a.jsx)(i.A,{})})}},50009:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(15814),s=r(4836);function n(e,t=[],r=[]){let i,o="string"==typeof e?function(e,t,r=[]){if(null==t)throw Error("[lucide]: iconNode is required when icon name is used");return{name:e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),size:24,node:t,...r.length>0?{aliases:r}:{}}}(e,t,r):e,d=(0,a.forwardRef)(({className:e,...t},r)=>(0,a.createElement)(s.A,{ref:r,icon:o,className:e,...t}));return o.name&&(d.displayName=(i=(e=>{let t="",r=!1;for(let a of e){if("-"===a||"_"===a||a<=" "){r=t.length>0;continue}0===t.length?t+=a.toLowerCase():t+=r?a.toUpperCase():a,r=!1}return t})(o.name)).charAt(0).toUpperCase()+i.slice(1)),d}},51660:(e,t,r)=>{"use strict";r.d(t,{Q2:()=>a.Q2,fg:()=>a.fg,vQ:()=>s,_$:()=>i,MA:()=>a.MA,UY:()=>d,Nu:()=>n,zN:()=>a.zN,B2:()=>o});var a=r(13794);r(80159);let s={name:"10Router Proxy",description:"AI Infrastructure Management",version:"0.1.9"},n={changelogUrl:"/api/changelog"},i=20128,o={storageKey:"theme",defaultTheme:"light"},d={maxLines:500,pollIntervalMs:1e3}},53784:(e,t,r)=>{"use strict";r.d(t,{E:()=>d});var a=r(29798);r(15814);var s=r(54366),n=r(5471),i=r(80954);let o=(0,s.F)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function d({className:e,variant:t="default",asChild:r=!1,...s}){let l=r?i.bL:"span";return(0,a.jsx)(l,{"data-slot":"badge","data-variant":t,className:(0,n.cn)(o({variant:t}),e),...s})}},58765:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};s.node;let n=(0,a.A)(s)},63587:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};s.node;let n=(0,a.A)(s)},66685:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};s.node;let n=(0,a.A)(s)},74719:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};s.node;let n=(0,a.A)(s)},75669:(e,t,r)=>{"use strict";r.d(t,{BT:()=>d,Wu:()=>c,X9:()=>l,ZB:()=>o,Zp:()=>n,aR:()=>i});var a=r(29798);r(15814);var s=r(5471);function n({className:e,size:t="default",...r}){return(0,a.jsx)("div",{"data-slot":"card","data-size":t,className:(0,s.cn)("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...r})}function i({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t})}function o({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",e),...t})}function d({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-description",className:(0,s.cn)("text-sm text-muted-foreground",e),...t})}function l({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-action",className:(0,s.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function c({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("flex flex-col gap-3 px-(--card-spacing)",e),...t})}},75877:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var a=r(50009);let s={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};s.node;let n=(0,a.A)(s)},77345:(e,t,r)=>{"use strict";r.d(t,{p:()=>n});var a=r(29798);r(15814);var s=r(5471);function n({className:e,type:t,...r}){return(0,a.jsx)("input",{type:t,"data-slot":"input",className:(0,s.cn)("h-9 w-full min-w-0 rounded-md border border-input bg-background px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...r})}}},e=>{e.O(0,[5166,7552,9980,5778,4484,3577,5862,159,427,9966,7358],()=>e(e.s=15298)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099],{},_=>{_.O(0,[6766,5166,7552,9980,1471,5778,4484,3577,5862,5113,1699,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099],{},_=>{_.O(0,[6766,5166,7552,9980,1471,5778,4484,3577,5862,5113,1699,1722,159,4489,1278,1830,6770,2836,427,9966,7358],()=>_(_.s=92836)),_N_E=_.O()}]);
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
"is_urgent": { "type": "noul", "noul": 0.99 }
|
|
8
8
|
},
|
|
9
9
|
"usage": { "input_tokens": 312, "output_tokens": 48 }
|
|
10
|
-
}`})]})]})]})})]})}}},e=>{e.O(0,[6766,5166,7552,9980,1471,5778,4484,3577,5862,5113,1699,
|
|
10
|
+
}`})]})]})]})})]})}}},e=>{e.O(0,[6766,5166,7552,9980,1471,5778,4484,3577,5862,5113,1699,1722,159,4489,1278,1830,6770,9369,427,9966,7358],()=>e(e.s=24715)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{},_=>{_.O(0,[6766,5166,7552,9980,1471,5778,4484,3577,5862,5113,1699,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{},_=>{_.O(0,[6766,5166,7552,9980,1471,5778,4484,3577,5862,5113,1699,1722,159,4489,1278,1830,6770,2836,427,9966,7358],()=>_(_.s=92836)),_N_E=_.O()}]);
|