@amir83nasr/10router 0.1.14 → 0.1.15
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 +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
- 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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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 +2 -2
- 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/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/client/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/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/cli-tools.html +1 -1
- package/.next/server/app/dashboard/cli-tools.rsc +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +6 -6
- package/.next/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
- 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 +5 -5
- package/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
- 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 +5 -5
- 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 +8 -8
- package/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/dashboard.segments/_full.segment.rsc +8 -8
- 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/1011.js +1 -1
- package/.next/server/chunks/1194.js +1 -1
- package/.next/server/chunks/1289.js +1 -1
- package/.next/server/chunks/1633.js +1 -1
- package/.next/server/chunks/2282.js +7 -7
- 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/6056.js +1 -1
- package/.next/server/chunks/6343.js +6 -6
- package/.next/server/chunks/9429.js +1 -1
- package/.next/server/middleware-build-manifest.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-1bef1ffb32ea7f41.js → 1278-5800a984ad8ad005.js} +1 -1
- package/.next/static/chunks/{1660-25564899e7912146.js → 1660-7f2e79bde5eff607.js} +1 -1
- package/.next/static/chunks/{1699-49be310981e2759e.js → 1699-13ee6864a8a31a96.js} +2 -2
- 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/{9150-32b4247b1af5e206.js → 9150-8316559e1687b4a8.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-c913b130003c1672.js → page-dd70f2cee9c910a9.js} +3 -3
- package/CHANGELOG.md +11 -0
- package/open-sse/handlers/chatCore/claudeMessageBody.js +357 -0
- package/open-sse/handlers/chatCore/nonStreamingHandler.js +36 -110
- package/open-sse/handlers/chatCore/sseToJsonHandler.js +147 -4
- package/open-sse/handlers/chatCore.js +48 -12
- package/open-sse/translator/concerns/classifier.js +70 -0
- package/open-sse/translator/concerns/thinkingUnified.js +18 -6
- package/open-sse/translator/request/claude-to-openai.js +20 -0
- package/open-sse/translator/request/openai-to-claude.js +11 -0
- package/package.json +1 -1
- package/src/app/(dashboard)/dashboard/cli-tools/components/cards/ClaudeToolCard.tsx +12 -0
- package/src/app/api/cli-tools/claude-settings/route.js +10 -0
- package/src/shared/constants/cliTools.js +8 -0
- /package/.next/static/{wBARQPScPhD6SLn7WQvI9 → 8QVpvFFKxoB53L449Kgan}/_buildManifest.js +0 -0
- /package/.next/static/{wBARQPScPhD6SLn7WQvI9 → 8QVpvFFKxoB53L449Kgan}/_ssgManifest.js +0 -0
package/.next/BUILD_ID
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
8QVpvFFKxoB53L449Kgan
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
"/manifest.webmanifest/route": "/manifest.webmanifest",
|
|
102
102
|
"/api/combos/route": "/api/combos",
|
|
103
103
|
"/api/headroom/extras/route": "/api/headroom/extras",
|
|
104
|
-
"/api/headroom/proxy/[...path]/route": "/api/headroom/proxy/[...path]",
|
|
105
104
|
"/api/headroom/restart/route": "/api/headroom/restart",
|
|
105
|
+
"/api/headroom/proxy/[...path]/route": "/api/headroom/proxy/[...path]",
|
|
106
106
|
"/api/headroom/start/route": "/api/headroom/start",
|
|
107
107
|
"/api/headroom/status/route": "/api/headroom/status",
|
|
108
108
|
"/api/headroom/stop/route": "/api/headroom/stop",
|
|
@@ -119,11 +119,11 @@
|
|
|
119
119
|
"/api/providers/suggested-models/route": "/api/providers/suggested-models",
|
|
120
120
|
"/api/providers/[id]/models/route": "/api/providers/[id]/models",
|
|
121
121
|
"/api/providers/route": "/api/providers",
|
|
122
|
-
"/api/proxy-pools/[id]/test/route": "/api/proxy-pools/[id]/test",
|
|
123
122
|
"/api/proxy-pools/[id]/route": "/api/proxy-pools/[id]",
|
|
123
|
+
"/api/proxy-pools/[id]/test/route": "/api/proxy-pools/[id]/test",
|
|
124
124
|
"/api/proxy-pools/cloudflare-deploy/route": "/api/proxy-pools/cloudflare-deploy",
|
|
125
|
-
"/api/proxy-pools/deno-deploy/route": "/api/proxy-pools/deno-deploy",
|
|
126
125
|
"/api/proxy-pools/route": "/api/proxy-pools",
|
|
126
|
+
"/api/proxy-pools/deno-deploy/route": "/api/proxy-pools/deno-deploy",
|
|
127
127
|
"/api/pxpipe/health/route": "/api/pxpipe/health",
|
|
128
128
|
"/api/proxy-pools/vercel-deploy/route": "/api/proxy-pools/vercel-deploy",
|
|
129
129
|
"/api/pxpipe/install/route": "/api/pxpipe/install",
|
|
@@ -162,8 +162,8 @@
|
|
|
162
162
|
"/(dashboard)/dashboard/token-saver/page": "/dashboard/token-saver",
|
|
163
163
|
"/(dashboard)/dashboard/usage/page": "/dashboard/usage",
|
|
164
164
|
"/(dashboard)/dashboard/console-log/page": "/dashboard/console-log",
|
|
165
|
-
"/(dashboard)/dashboard/providers/page": "/dashboard/providers",
|
|
166
165
|
"/(dashboard)/dashboard/profile/page": "/dashboard/profile",
|
|
167
|
-
"/(dashboard)/dashboard/providers/
|
|
168
|
-
"/(dashboard)/dashboard/proxy-pools/page": "/dashboard/proxy-pools"
|
|
166
|
+
"/(dashboard)/dashboard/providers/page": "/dashboard/providers",
|
|
167
|
+
"/(dashboard)/dashboard/proxy-pools/page": "/dashboard/proxy-pools",
|
|
168
|
+
"/(dashboard)/dashboard/providers/[id]/page": "/dashboard/providers/[id]"
|
|
169
169
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
],
|
|
5
5
|
"devFiles": [],
|
|
6
6
|
"lowPriorityFiles": [
|
|
7
|
-
"static/
|
|
8
|
-
"static/
|
|
7
|
+
"static/8QVpvFFKxoB53L449Kgan/_buildManifest.js",
|
|
8
|
+
"static/8QVpvFFKxoB53L449Kgan/_ssgManifest.js"
|
|
9
9
|
],
|
|
10
10
|
"rootMainFiles": [
|
|
11
11
|
"static/chunks/webpack-cb89101193742e2b.js",
|
|
@@ -598,8 +598,8 @@
|
|
|
598
598
|
"dynamicRoutes": {},
|
|
599
599
|
"notFoundRoutes": [],
|
|
600
600
|
"preview": {
|
|
601
|
-
"previewModeId": "
|
|
602
|
-
"previewModeSigningKey": "
|
|
603
|
-
"previewModeEncryptionKey": "
|
|
601
|
+
"previewModeId": "40723682cd102525dc3dac7c35616387",
|
|
602
|
+
"previewModeSigningKey": "e19d7a379ee90c3158afe7164461148598e5231ecd2383457171abda2b46233d",
|
|
603
|
+
"previewModeEncryptionKey": "895d40e5c6bd16b8cbe1aea082f6a79d4e9c99955117d3ace3ec0af69e4bd767"
|
|
604
604
|
}
|
|
605
605
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var a={};a.id=3554,a.ids=[3554],a.modules={643:a=>{"use strict";a.exports=require("node:perf_hooks")},1437:(a,b,c)=>{"use strict";var d=c(47633);c.o(d,"notFound")&&c.d(b,{notFound:function(){return d.notFound}}),c.o(d,"redirect")&&c.d(b,{redirect:function(){return d.redirect}})},1568:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>i});var d=c(25966),e=c(1437),f=c(41270),g=c(92592),h=c(78685);async function i({params:a}){let{toolId:b}=await a;f.d[b]||(0,e.notFound)();let c=await (0,g.D)();return(0,d.jsx)(h.default,{toolId:b,machineId:c})}},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},7066:a=>{"use strict";a.exports=require("node:tty")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11543:(a,b,c)=>{"use strict";function d(){throw Object.defineProperty(Error("`unauthorized()` is experimental and only allowed to be used when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E411",enumerable:!1,configurable:!0})}Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"unauthorized",{enumerable:!0,get:function(){return d}}),c(41081).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},14985:a=>{"use strict";a.exports=require("dns")},16162:(a,b,c)=>{Promise.resolve().then(c.bind(c,28840))},16698:a=>{"use strict";a.exports=require("node:async_hooks")},18142:(a,b,c)=>{"use strict";c.d(b,{YW:()=>d.Page,pV:()=>d.CardGrid,wn:()=>d.Section,zY:()=>d.PageHeader}),c(73865),c(55204);var d=c(19509)},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20482:(a,b,c)=>{"use strict";c.d(b,{CK:()=>i.default,G9:()=>l.default,Iz:()=>r.default,KX:()=>s.PanelSkeleton,LF:()=>f.default,LH:()=>m.default,Mu:()=>s.StatCardSkeleton,Nf:()=>j.default,Qv:()=>e.CardSkeleton,YW:()=>u.YW,gw:()=>q.default,jK:()=>k.default,nh:()=>t.default,pV:()=>u.pV,rq:()=>g.default,uR:()=>h.default,uo:()=>d.ConfirmModal,vE:()=>n.default,vj:()=>o.default,wI:()=>p.default,wn:()=>u.wn,zY:()=>u.zY}),c(28907);var d=c(87121),e=c(53546);c(62648),c(77562),c(79517),c(66453);var f=c(71e3),g=c(16582),h=c(94725),i=c(98279),j=c(22354),k=c(23165);c(49451),c(82466),c(70047),c(32328),c(92249);var l=c(85405),m=c(91236),n=c(89630),o=c(87556),p=c(46009);c(54928);var q=c(5409),r=c(12710);c(92393),c(51);var s=c(11442),t=c(9656),u=c(18142)},21704:(a,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"ReadonlyURLSearchParams",{enumerable:!0,get:function(){return d}});class c extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams"),Object.defineProperty(this,"__NEXT_ERROR_CODE",{value:"E1174",enumerable:!1,configurable:!0})}}class d extends URLSearchParams{append(){throw new c}delete(){throw new c}set(){throw new c}sort(){throw new c}}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},28840:(a,b,c)=>{"use strict";c.d(b,{default:()=>aa});var d=c(86240),e=c(28907),f=c(70433),g=c(4459),h=c.n(g),i=c(20482),j=c(63265),k=c(92968),l=c(54204),m=c(95137),n=c(4271),o=c(83777),p=c(31952),q=c(36447),r=c(63998),s=c(62871),t=c(99902),u=c(81501);function v({storageKey:a,changeEvent:b,itemField:c,normalize:d=a=>a,defaultName:e=a=>a}){let f=()=>[],g=a=>{};return{read:f,subscribe:a=>()=>{},upsert:(a,b)=>{let h=d(a);if(!h)return null;let i=f(),j=i.find(a=>d(a[c])===h);if(j&&!b)return j.name;let k=(b||e(h)).trim();return k?(g([...i.filter(a=>a.name!==k&&d(a[c])!==h),{name:k,[c]:h}].sort((a,b)=>a.name.localeCompare(b.name))),k):null},remove:a=>g(f().filter(b=>b.name!==a))}}let w=a=>(a||"").replace(/\/+$/,""),x=v({storageKey:"10router.cliToolEndpointPresets",changeEvent:"10router:endpoint-presets-changed",itemField:"baseUrl",normalize:w,defaultName:a=>{try{return new URL(a).host}catch{return a}}}),y=v({storageKey:"10router.cliToolApiKeyPresets",changeEvent:"10router:api-key-presets-changed",itemField:"key"});x.read,x.subscribe;let z=x.upsert,A=x.remove;y.read,y.subscribe;let B=y.upsert,C=y.remove;function D(a,{tunnelPublicUrl:b,tailscaleUrl:c,cloudUrl:d}={}){let e=w(a);return!e||[`http://127.0.0.1:${t._$}`,b,c,d].filter(Boolean).flatMap(a=>[w(a),`${w(a)}/v1`]).includes(e)?null:z(e)}let E="__custom__",F="__save__";function G({value:a,onChange:b,requiresExternalUrl:c=!1,tunnelEnabled:g=!1,tunnelPublicUrl:h="",tailscaleEnabled:i=!1,tailscaleUrl:j="",cloudEnabled:k=!1,cloudUrl:l="",withV1:m=!0,currentUrl:n=""}){let[q,r]=(0,f.useState)([]),[s,v]=(0,f.useState)(!1),[w,x]=(0,f.useState)(""),[y,B]=(0,f.useState)("");(0,f.useRef)(!1);let C=(0,f.useRef)(""),D=(0,f.useMemo)(()=>(({requiresExternalUrl:a,tunnelEnabled:b,tunnelPublicUrl:c,tailscaleEnabled:d,tailscaleUrl:e,cloudEnabled:f,cloudUrl:g,savedPresets:h,withV1:i})=>{let j=[],k=a=>{let b;return i?(b=(a||"").replace(/\/+$/,""))?/\/v1$/.test(b)?b:`${b}/v1`:"":(a||"").replace(/\/+$/,"")};if(!a){let a=k(`http://127.0.0.1:${t._$}`);j.push({value:"local",label:a,url:a})}if(b&&c){let a=k(c);j.push({value:"tunnel",label:a,url:a})}if(d&&e){let a=k(e);j.push({value:"tailscale",label:a,url:a})}if(f&&g){let a=k(g);j.push({value:"cloud",label:a,url:a})}return h.forEach(a=>{j.push({value:`saved:${a.name}`,label:a.baseUrl,url:a.baseUrl,saved:!0})}),j.push({value:E,label:"Custom URL...",url:""}),j})({requiresExternalUrl:c,tunnelEnabled:g,tunnelPublicUrl:h,tailscaleEnabled:i,tailscaleUrl:j,cloudEnabled:k,cloudUrl:l,savedPresets:q,withV1:m}),[c,g,h,i,j,k,l,q,m]),H=w.startsWith("saved:"),I=w===E,J=I&&(y||"").trim().length>0;return(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(o.l6,{value:w,onValueChange:c=>{if(c===F){let b=(a||"").trim();if(!b)return;let c=b;try{c=new URL(b).host}catch{}let d=window.prompt("Save endpoint as:",c),e=d?.trim()?z(b,d.trim()):null;e&&x(`saved:${e}`);return}if(x(c),c===E){B(""),b("");return}let d=D.find(a=>a.value===c);d&&b(d.url)},children:[(0,d.jsx)(o.bq,{className:"flex-1 min-w-0 text-xs",children:(0,d.jsx)(o.yv,{placeholder:"Select endpoint"})}),(0,d.jsxs)(o.gC,{children:[D.map(a=>(0,d.jsx)(o.eb,{value:a.value,title:a.label,children:a.label},a.value)),J&&(0,d.jsx)(o.eb,{value:F,children:"+ Save current as..."})]})]}),H&&(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("button",{type:"button",onClick:()=>{if(!w.startsWith("saved:"))return;A(w.slice(6)),B("");let a=D.find(a=>a.value!==E&&a.value!==w);a?(x(a.value),b(a.url)):(x(E),b(""))},className:"p-1 text-muted-foreground hover:text-red-500 rounded transition-colors shrink-0",children:(0,d.jsx)(e.default,{name:"delete",className:"text-[14px]"})})}),(0,d.jsx)(p.ZI,{children:"Delete saved endpoint"})]})]}),I&&(0,d.jsx)(u.p,{type:"text",value:y,onChange:a=>{let c=a.target.value;C.current=c,B(c),b(c)},placeholder:m?"https://example.com/v1":"https://example.com",className:"h-9 text-xs"})]})}let H="__custom__",I="__save_key__";function J({value:a,onChange:b,apiKeys:c=[],cloudEnabled:g=!1,className:h=""}){let[i,j]=(0,f.useState)([]),[k,l]=(0,f.useState)(!1),[m,n]=(0,f.useState)(""),q=(0,f.useMemo)(()=>[...c.map(a=>({value:a.key,label:a.key})),...i.map(a=>({value:`saved:${a.name}`,label:a.key,url:a.key,saved:!0})),{value:H,label:"Custom...",url:""}],[c,i]),r=a?q.find(b=>b.value===a||b.url===a):null,s=r?r.value:k||a?H:q[0]?.value??H,t=k?m:a||"",v="string"==typeof s&&s.startsWith("saved:"),w=s===H,x=w&&(a||"").trim().length>0&&!c.some(b=>b.key===a);return 0!==c.length||0!==i.length||k||a?(0,d.jsxs)("div",{className:`flex flex-col gap-1.5 ${h}`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(o.l6,{value:s,onValueChange:c=>{if(c===I)return void B((a||"").trim());if(c===H){l(!0),n(""),b("");return}l(!1),n("");let d=q.find(a=>a.value===c);d&&b(d.url??d.value)},children:[(0,d.jsx)(o.bq,{className:"flex-1 min-w-0 text-xs",children:(0,d.jsx)(o.yv,{placeholder:"Select key"})}),(0,d.jsxs)(o.gC,{children:[q.map(a=>(0,d.jsx)(o.eb,{value:a.value,title:a.label,children:a.label},a.value)),x&&(0,d.jsx)(o.eb,{value:I,children:"+ Save current as..."})]})]}),v&&(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("button",{type:"button",onClick:()=>{if(!v)return;C(s.slice(6)),l(!1),n("");let a=q.find(a=>a.value!==H&&a.value!==s);b(a?a.url??a.value:"")},className:"p-1 text-muted-foreground hover:text-red-500 rounded transition-colors shrink-0",children:(0,d.jsx)(e.default,{name:"delete",className:"text-[14px]"})})}),(0,d.jsx)(p.ZI,{children:"Delete saved key"})]})]}),w&&(0,d.jsx)(u.p,{type:"text",value:t,onChange:a=>{let c=a.target.value;l(!0),n(c),b(c)},placeholder:"sk-...",className:"h-9 text-xs"})]}):(0,d.jsx)("span",{className:`min-w-0 rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5 ${h}`,children:g?"No API keys - Create one in Keys page":"sk_10router (default)"})}let K=a=>(a||"").replace(/\/+$/,"");function L(a,b={}){if(!a)return!1;let c=K(a),{tunnelPublicUrl:d,tailscaleUrl:e,cloudUrl:f}=b;return!!(/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(c)||d&&c.startsWith(K(d))||e&&c.startsWith(K(e))||f&&c.startsWith(K(f)))}let M=/\[1m\]$/i,N=process.env.NEXT_PUBLIC_CLOUD_URL,O=[{label:"Default",value:""},{label:"200K",value:"198000"},{label:"300K",value:"298000"},{label:"500K",value:"498000"},{label:"700K",value:"698000"}];function P({tool:a,isExpanded:b,onToggle:c,activeProviders:g,modelMappings:h,onModelMappingChange:k,baseUrl:l,hasActiveProviders:m,apiKeys:t,cloudEnabled:u,initialStatus:v,tunnelEnabled:w,tunnelPublicUrl:x,tailscaleEnabled:y,tailscaleUrl:z}){let A,B,C,[E,F]=(0,f.useState)(v||null),[H,I]=(0,f.useState)(!1),[K,Q]=(0,f.useState)(!1),[R,S]=(0,f.useState)(!1),[T,U]=(0,f.useState)(null),[V,W]=(0,f.useState)(!1),[X,Y]=(0,f.useState)(!1),[Z,$]=(0,f.useState)(null),[_,aa]=(0,f.useState)(""),[ab,ac]=(0,f.useState)({}),[ad,ae]=(0,f.useState)(!1),[af,ag]=(0,f.useState)(""),[ah,ai]=(0,f.useState)(!1),[aj,ak]=(0,f.useState)(!1),[al,am]=(0,f.useState)(""),[an,ao]=(0,f.useState)(!1);(0,f.useRef)(!1);let ap=E?.settings?.env?.ANTHROPIC_BASE_URL||"",aq=(()=>{if(!E?.installed)return null;let a=E.settings?.env?.ANTHROPIC_BASE_URL;return a?L(a,{tunnelPublicUrl:x,tailscaleUrl:z,cloudUrl:u?N:null})?"configured":"other":"not_configured"})(),ar=async a=>{let b=!0===a;ai(b),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:b})}).catch(()=>{})},as=()=>{let a=af||l;return a.endsWith("/v1")?a:`${a}/v1`},at=async()=>{Q(!0),U(null);try{let b={ANTHROPIC_BASE_URL:as()},c=_?.trim()||(t?.length>0?t[0].key:null)||(u?null:"sk_10router");c&&(b.ANTHROPIC_AUTH_TOKEN=c),a.defaultModels.forEach(a=>{let c=h[a.alias];c&&a.envKey&&(b[a.envKey]=c)}),al&&(b.CLAUDE_CODE_AUTO_COMPACT_WINDOW=al),a.envVars?.todoTools&&(b[a.envVars.todoTools]="1");let d=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:b,exaMcpEnabled:aj,autoCompactWindow:al})}),e=await d.json();d.ok?(D(as(),{tunnelPublicUrl:x,tailscaleUrl:z}),U({type:"success",text:"Settings applied successfully!"}),F(a=>({...a,hasBackup:!0,settings:{...a?.settings,env:b},exaMcpEnabled:aj}))):U({type:"error",text:e.error||"Failed to apply settings"})}catch(a){U({type:"error",text:a.message})}finally{Q(!1)}},au=async()=>{S(!0),U(null);try{let b=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),c=await b.json();b.ok?(U({type:"success",text:"Settings reset successfully!"}),a.defaultModels.forEach(a=>k(a.alias,a.defaultValue||"")),aa(""),ak(!1),am(""),ao(!1)):U({type:"error",text:c.error||"Failed to reset settings"})}catch(a){U({type:"error",text:a.message})}finally{S(!1)}};return(0,d.jsx)(n.Zp,{size:"sm",className:"overflow-hidden",children:(0,d.jsxs)(n.Wu,{children:[(0,d.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(s.default,{src:"/providers/claude.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"},loading:"lazy",decoding:"async"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===aq&&(0,d.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"===aq&&(0,d.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"===aq&&(0,d.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,d.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.description})]})]})}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[H&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,d.jsx)(e.default,{name:"progress_activity",className:"animate-spin"}),(0,d.jsx)("span",{children:"Checking Claude CLI..."})]}),!H&&E&&!E.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)(e.default,{name:"warning",className:"text-yellow-500"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:E.container?"10Router runs in a container":"Claude CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:E.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,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(j.$,{variant:"secondary",size:"sm",onClick:()=>ae(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)(e.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,d.jsxs)(j.$,{variant:"outline",size:"sm",onClick:()=>W(!V),children:[(0,d.jsx)(e.default,{name:V?"expand_less":"help",className:"text-[18px] mr-1"}),V?"Hide":"How to Install"]})]})]}),V&&(0,d.jsxs)("div",{className:"p-4 bg-card border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-muted-foreground mb-1",children:"macOS / Linux / Windows:"}),(0,d.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,d.jsxs)("p",{className:"text-muted-foreground",children:["After installation, run"," ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!H&&E?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)(G,{value:af||((A=af||l).endsWith("/v1")?A:`${A}/v1`),onChange:ag,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:w,tunnelPublicUrl:x,tailscaleEnabled:y,tailscaleUrl:z,currentUrl:ap})]}),E?.settings?.env?.ANTHROPIC_BASE_URL&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,d.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:E.settings.env.ANTHROPIC_BASE_URL})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)(J,{value:_,onChange:aa,apiKeys:t,cloudEnabled:u})]}),a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:a.name}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:h[a.alias]||"",onChange:b=>k(a.alias,b.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"}),h[a.alias]&&(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("button",{onClick:()=>k(a.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,d.jsx)(e.default,{name:"close",className:"text-[14px]"})})}),(0,d.jsx)(p.ZI,{children:"Clear"})]})]}),(0,d.jsx)("button",{onClick:()=>{$(a.alias),Y(!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"})]},a.alias)),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Auto-compact"}),(0,d.jsxs)(o.l6,{value:al||"__default__",onValueChange:a=>am("__default__"===a?"":a),children:[(0,d.jsx)(o.bq,{className:"w-full text-xs",children:(0,d.jsx)(o.yv,{})}),(0,d.jsx)(o.gC,{children:O.map(a=>(0,d.jsx)(o.eb,{value:a.value||"__default__",children:a.label},a.label))})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"1M context"}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,d.jsx)(r.S,{checked:an,onCheckedChange:b=>{var c;ao(c=!0===b),a.defaultModels.forEach(a=>{let b=h[a.alias];b&&k(a.alias,((a,b)=>{let{model:c}=function(a){if("string"!=typeof a)return{model:a,contextMarker:null};let b=a.trim(),c=b.match(M);return c?{model:b.slice(0,-c[0].length),contextMarker:c[0].slice(1,-1).toLowerCase()}:{model:a,contextMarker:null}}(a);return b?`${c}[1m]`:c})(b,c))})}}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"Append [1m] to the model name"}),(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("span",{className:"relative inline-flex",children:(0,d.jsx)(e.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,d.jsx)(p.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,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Filter naming"}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,d.jsx)(r.S,{checked:ah,onCheckedChange:ar}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"Filter naming requests"}),(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("span",{className:"relative inline-flex",children:(0,d.jsx)(e.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,d.jsx)(p.ZI,{side:"top",children:"Intercepts Claude Code's topic-naming requests and returns a fake response locally, saving API tokens."})]})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Web Search"}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,d.jsx)(r.S,{checked:aj,onCheckedChange:a=>ak(!0===a)}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"Exa MCP"}),(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("span",{className:"relative inline-flex",children:(0,d.jsx)(e.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,d.jsx)(p.ZI,{side:"top",children:"Injects Exa MCP into ~/.claude.json so non-Claude models gain web search. Restart Claude Code after Apply."})]})]})]})]}),T&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===T.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)(e.default,{name:"success"===T.type?"check_circle":"error",className:"text-[14px]"}),(0,d.jsx)("span",{children:T.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(j.$,{size:"sm",onClick:at,disabled:K,children:[K&&(0,d.jsx)(q.A,{className:"size-4 animate-spin"}),(0,d.jsx)(e.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,d.jsxs)(j.$,{variant:"outline",size:"sm",onClick:au,disabled:!E?.has10Router||R,children:[R&&(0,d.jsx)(q.A,{className:"size-4 animate-spin"}),(0,d.jsx)(e.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,d.jsxs)(j.$,{variant:"ghost",size:"sm",onClick:()=>ae(!0),children:[(0,d.jsx)(e.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),X&&(0,d.jsx)(i.rq,{isOpen:X,onClose:()=>Y(!1),onSelect:a=>{Z&&k(Z,a.value)},selectedModel:Z?h[Z]:null,activeProviders:g,modelAliases:ab,title:`Select model for ${Z}`}),(0,d.jsx)(i.uR,{isOpen:ad,onClose:()=>ae(!1),title:"Claude CLI - Manual Configuration",configs:(B=_&&_.trim()?_:u?"<API_KEY_FROM_DASHBOARD>":"sk_10router",C={ANTHROPIC_BASE_URL:as(),ANTHROPIC_AUTH_TOKEN:B},a.defaultModels.forEach(a=>{let b=h[a.alias];b&&a.envKey&&(C[a.envKey]=b)}),al&&(C.CLAUDE_CODE_AUTO_COMPACT_WINDOW=al),a.envVars?.todoTools&&(C[a.envVars.todoTools]="1"),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:C},null,2)}])})]})})}function Q({tool:a,isExpanded:b,onToggle:c,baseUrl:g,apiKeys:h,activeProviders:k,cloudEnabled:l,initialStatus:m,tunnelEnabled:o,tunnelPublicUrl:r,tailscaleEnabled:t,tailscaleUrl:u}){let v,w,x,[y,z]=(0,f.useState)(m||null),[A,B]=(0,f.useState)(!1),[C,E]=(0,f.useState)(!1),[F,H]=(0,f.useState)(!1),[I,K]=(0,f.useState)(null),[M,N]=(0,f.useState)(!1),[O,P]=(0,f.useState)(""),[R,S]=(0,f.useState)([]),[T,U]=(0,f.useState)(""),[V,W]=(0,f.useState)(!1),[X,Y]=(0,f.useState)(!1),[Z,$]=(0,f.useState)({}),[_,aa]=(0,f.useState)(!1),[ab,ac]=(0,f.useState)(""),ad=(v=y?.config?.match(/base_url\s*=\s*"([^"]+)"/))?v[1]:"",ae=y?.installed?y.config?L(ad,{tunnelPublicUrl:r,tailscaleUrl:u})?"configured":"other":"not_configured":null,af=()=>{let a=ab||`${g}/v1`;return a.endsWith("/v1")?a:`${a}/v1`},ag=async()=>{B(!0);try{let a=await fetch("/api/cli-tools/codex-settings"),b=await a.json();z(b)}catch(a){z({installed:!1,error:a.message})}finally{B(!1)}},ah=async()=>{E(!0),K(null);try{let a=O&&O.trim()||l?O:"sk_10router",b=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:af(),apiKey:a,models:R,subagentModel:T})}),c=await b.json();b.ok?(D(af(),{tunnelPublicUrl:r,tailscaleUrl:u}),K({type:"success",text:"Applied — models appear in codex /model. Account default kept; use codex --profile 10router-<model> for 10Router routing."}),ag()):K({type:"error",text:c.error||"Failed to apply settings"})}catch(a){K({type:"error",text:a.message})}finally{E(!1)}},ai=async()=>{H(!0),K(null);try{let a=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),b=await a.json();a.ok?(K({type:"success",text:"Settings reset successfully!"}),S([]),U(""),ag()):K({type:"error",text:b.error||"Failed to reset settings"})}catch(a){K({type:"error",text:a.message})}finally{H(!1)}};return(0,d.jsx)(n.Zp,{size:"sm",className:"overflow-hidden",children:(0,d.jsxs)(n.Wu,{children:[(0,d.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(s.default,{src:"/providers/codex.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"},loading:"lazy",decoding:"async"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===ae&&(0,d.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"===ae&&(0,d.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"===ae&&(0,d.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,d.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.description})]})]})}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[A&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,d.jsx)(e.default,{name:"progress_activity",className:"animate-spin"}),(0,d.jsx)("span",{children:"Checking Codex CLI..."})]}),!A&&y&&!y.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)(e.default,{name:"warning",className:"text-yellow-500"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:y.container?"10Router runs in a container":"Codex CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:y.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,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(j.$,{variant:"secondary",size:"sm",onClick:()=>aa(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)(e.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,d.jsxs)(j.$,{variant:"outline",size:"sm",onClick:()=>N(!M),children:[(0,d.jsx)(e.default,{name:M?"expand_less":"help",className:"text-[18px] mr-1"}),M?"Hide":"How to Install"]})]})]}),M&&(0,d.jsxs)("div",{className:"p-4 bg-card border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-muted-foreground mb-1",children:"macOS / Linux / Windows:"}),(0,d.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,d.jsxs)("p",{className:"text-muted-foreground",children:["After installation, run"," ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," to verify."]}),(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:(0,d.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Codex reads custom providers from"," ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/config.toml"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!A&&y?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[y?.rootHijacked&&(0,d.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,d.jsx)(e.default,{name:"warning",className:"text-[14px] shrink-0 mt-0.5"}),(0,d.jsx)("span",{children:"Old settings overrode your default Codex model. Apply to restore your ChatGPT account default — added models become profiles."})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)(G,{value:ab||ab||`${g}/v1`,onChange:ac,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:o,tunnelPublicUrl:r,tailscaleEnabled:t,tailscaleUrl:u,currentUrl:ad})]}),y?.config&&(ad?(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,d.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:ad})]}):null),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)(J,{value:O,onChange:P,apiKeys:h,cloudEnabled:l})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Models"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,d.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===R.length?(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"No models added"}):R.map(a=>(0,d.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:[a,(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("button",{onClick:()=>S(R.filter(b=>b!==a)),className:"ml-0.5 hover:text-red-500",children:(0,d.jsx)(e.default,{name:"close",className:"text-[12px]"})})}),(0,d.jsx)(p.ZI,{children:"Remove"})]})]},a))}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("button",{onClick:()=>W(!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,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Launch:"," ",(0,d.jsx)("code",{className:"rounded bg-black/5 px-1 dark:bg-white/5",children:"codex --profile 10router-<model>"})]})]})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Subagent Model"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:T,onChange:a=>U(a.target.value),placeholder:R[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"}),T&&(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("button",{onClick:()=>U(""),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,d.jsx)(e.default,{name:"close",className:"text-[14px]"})})}),(0,d.jsx)(p.ZI,{children:"Clear (will use main model)"})]})]}),(0,d.jsx)("button",{onClick:()=>Y(!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"})]})]}),I&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===I.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)(e.default,{name:"success"===I.type?"check_circle":"error",className:"text-[14px]"}),(0,d.jsx)("span",{children:I.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(j.$,{size:"sm",onClick:ah,disabled:!O&&l&&h.length>0||0===R.length||C,children:[C&&(0,d.jsx)(q.A,{className:"size-4 animate-spin"}),(0,d.jsx)(e.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,d.jsxs)(j.$,{variant:"outline",size:"sm",onClick:ai,disabled:F,children:[F&&(0,d.jsx)(q.A,{className:"size-4 animate-spin"}),(0,d.jsx)(e.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,d.jsxs)(j.$,{variant:"ghost",size:"sm",onClick:()=>aa(!0),children:[(0,d.jsx)(e.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),V&&(0,d.jsx)(i.rq,{isOpen:V,onClose:()=>W(!1),onSelect:a=>{R.includes(a.value)||S([...R,a.value])},onDeselect:a=>{S(R.filter(b=>b!==a.value))},selectedModel:null,addedModelValues:R,closeOnSelect:!1,title:"Add Models for Codex",activeProviders:k,modelAliases:Z}),X&&(0,d.jsx)(i.rq,{isOpen:X,onClose:()=>Y(!1),onSelect:a=>{U(a.value),Y(!1)},selectedModel:T,activeProviders:k,modelAliases:Z,title:"Select Subagent Model for Codex"}),(0,d.jsx)(i.uR,{isOpen:_,onClose:()=>aa(!1),title:"Codex CLI - Manual Configuration",configs:(w=O&&O.trim()?O:l?"<API_KEY_FROM_DASHBOARD>":"sk_10router",x=[{filename:"~/.codex/config.toml",content:`# 10Router Configuration for Codex CLI
|
|
1
|
+
(()=>{var a={};a.id=3554,a.ids=[3554],a.modules={643:a=>{"use strict";a.exports=require("node:perf_hooks")},1437:(a,b,c)=>{"use strict";var d=c(47633);c.o(d,"notFound")&&c.d(b,{notFound:function(){return d.notFound}}),c.o(d,"redirect")&&c.d(b,{redirect:function(){return d.redirect}})},1568:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>i});var d=c(25966),e=c(1437),f=c(41270),g=c(92592),h=c(78685);async function i({params:a}){let{toolId:b}=await a;f.d[b]||(0,e.notFound)();let c=await (0,g.D)();return(0,d.jsx)(h.default,{toolId:b,machineId:c})}},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},7066:a=>{"use strict";a.exports=require("node:tty")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11543:(a,b,c)=>{"use strict";function d(){throw Object.defineProperty(Error("`unauthorized()` is experimental and only allowed to be used when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E411",enumerable:!1,configurable:!0})}Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"unauthorized",{enumerable:!0,get:function(){return d}}),c(41081).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},14985:a=>{"use strict";a.exports=require("dns")},16162:(a,b,c)=>{Promise.resolve().then(c.bind(c,28840))},16698:a=>{"use strict";a.exports=require("node:async_hooks")},18142:(a,b,c)=>{"use strict";c.d(b,{YW:()=>d.Page,pV:()=>d.CardGrid,wn:()=>d.Section,zY:()=>d.PageHeader}),c(73865),c(55204);var d=c(19509)},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20482:(a,b,c)=>{"use strict";c.d(b,{CK:()=>i.default,G9:()=>l.default,Iz:()=>r.default,KX:()=>s.PanelSkeleton,LF:()=>f.default,LH:()=>m.default,Mu:()=>s.StatCardSkeleton,Nf:()=>j.default,Qv:()=>e.CardSkeleton,YW:()=>u.YW,gw:()=>q.default,jK:()=>k.default,nh:()=>t.default,pV:()=>u.pV,rq:()=>g.default,uR:()=>h.default,uo:()=>d.ConfirmModal,vE:()=>n.default,vj:()=>o.default,wI:()=>p.default,wn:()=>u.wn,zY:()=>u.zY}),c(28907);var d=c(87121),e=c(53546);c(62648),c(77562),c(79517),c(66453);var f=c(71e3),g=c(16582),h=c(94725),i=c(98279),j=c(22354),k=c(23165);c(49451),c(82466),c(70047),c(32328),c(92249);var l=c(85405),m=c(91236),n=c(89630),o=c(87556),p=c(46009);c(54928);var q=c(5409),r=c(12710);c(92393),c(51);var s=c(11442),t=c(9656),u=c(18142)},21704:(a,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"ReadonlyURLSearchParams",{enumerable:!0,get:function(){return d}});class c extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams"),Object.defineProperty(this,"__NEXT_ERROR_CODE",{value:"E1174",enumerable:!1,configurable:!0})}}class d extends URLSearchParams{append(){throw new c}delete(){throw new c}set(){throw new c}sort(){throw new c}}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},28840:(a,b,c)=>{"use strict";c.d(b,{default:()=>aa});var d=c(86240),e=c(28907),f=c(70433),g=c(4459),h=c.n(g),i=c(20482),j=c(63265),k=c(92968),l=c(54204),m=c(95137),n=c(4271),o=c(83777),p=c(31952),q=c(36447),r=c(63998),s=c(62871),t=c(99902),u=c(81501);function v({storageKey:a,changeEvent:b,itemField:c,normalize:d=a=>a,defaultName:e=a=>a}){let f=()=>[],g=a=>{};return{read:f,subscribe:a=>()=>{},upsert:(a,b)=>{let h=d(a);if(!h)return null;let i=f(),j=i.find(a=>d(a[c])===h);if(j&&!b)return j.name;let k=(b||e(h)).trim();return k?(g([...i.filter(a=>a.name!==k&&d(a[c])!==h),{name:k,[c]:h}].sort((a,b)=>a.name.localeCompare(b.name))),k):null},remove:a=>g(f().filter(b=>b.name!==a))}}let w=a=>(a||"").replace(/\/+$/,""),x=v({storageKey:"10router.cliToolEndpointPresets",changeEvent:"10router:endpoint-presets-changed",itemField:"baseUrl",normalize:w,defaultName:a=>{try{return new URL(a).host}catch{return a}}}),y=v({storageKey:"10router.cliToolApiKeyPresets",changeEvent:"10router:api-key-presets-changed",itemField:"key"});x.read,x.subscribe;let z=x.upsert,A=x.remove;y.read,y.subscribe;let B=y.upsert,C=y.remove;function D(a,{tunnelPublicUrl:b,tailscaleUrl:c,cloudUrl:d}={}){let e=w(a);return!e||[`http://127.0.0.1:${t._$}`,b,c,d].filter(Boolean).flatMap(a=>[w(a),`${w(a)}/v1`]).includes(e)?null:z(e)}let E="__custom__",F="__save__";function G({value:a,onChange:b,requiresExternalUrl:c=!1,tunnelEnabled:g=!1,tunnelPublicUrl:h="",tailscaleEnabled:i=!1,tailscaleUrl:j="",cloudEnabled:k=!1,cloudUrl:l="",withV1:m=!0,currentUrl:n=""}){let[q,r]=(0,f.useState)([]),[s,v]=(0,f.useState)(!1),[w,x]=(0,f.useState)(""),[y,B]=(0,f.useState)("");(0,f.useRef)(!1);let C=(0,f.useRef)(""),D=(0,f.useMemo)(()=>(({requiresExternalUrl:a,tunnelEnabled:b,tunnelPublicUrl:c,tailscaleEnabled:d,tailscaleUrl:e,cloudEnabled:f,cloudUrl:g,savedPresets:h,withV1:i})=>{let j=[],k=a=>{let b;return i?(b=(a||"").replace(/\/+$/,""))?/\/v1$/.test(b)?b:`${b}/v1`:"":(a||"").replace(/\/+$/,"")};if(!a){let a=k(`http://127.0.0.1:${t._$}`);j.push({value:"local",label:a,url:a})}if(b&&c){let a=k(c);j.push({value:"tunnel",label:a,url:a})}if(d&&e){let a=k(e);j.push({value:"tailscale",label:a,url:a})}if(f&&g){let a=k(g);j.push({value:"cloud",label:a,url:a})}return h.forEach(a=>{j.push({value:`saved:${a.name}`,label:a.baseUrl,url:a.baseUrl,saved:!0})}),j.push({value:E,label:"Custom URL...",url:""}),j})({requiresExternalUrl:c,tunnelEnabled:g,tunnelPublicUrl:h,tailscaleEnabled:i,tailscaleUrl:j,cloudEnabled:k,cloudUrl:l,savedPresets:q,withV1:m}),[c,g,h,i,j,k,l,q,m]),H=w.startsWith("saved:"),I=w===E,J=I&&(y||"").trim().length>0;return(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(o.l6,{value:w,onValueChange:c=>{if(c===F){let b=(a||"").trim();if(!b)return;let c=b;try{c=new URL(b).host}catch{}let d=window.prompt("Save endpoint as:",c),e=d?.trim()?z(b,d.trim()):null;e&&x(`saved:${e}`);return}if(x(c),c===E){B(""),b("");return}let d=D.find(a=>a.value===c);d&&b(d.url)},children:[(0,d.jsx)(o.bq,{className:"flex-1 min-w-0 text-xs",children:(0,d.jsx)(o.yv,{placeholder:"Select endpoint"})}),(0,d.jsxs)(o.gC,{children:[D.map(a=>(0,d.jsx)(o.eb,{value:a.value,title:a.label,children:a.label},a.value)),J&&(0,d.jsx)(o.eb,{value:F,children:"+ Save current as..."})]})]}),H&&(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("button",{type:"button",onClick:()=>{if(!w.startsWith("saved:"))return;A(w.slice(6)),B("");let a=D.find(a=>a.value!==E&&a.value!==w);a?(x(a.value),b(a.url)):(x(E),b(""))},className:"p-1 text-muted-foreground hover:text-red-500 rounded transition-colors shrink-0",children:(0,d.jsx)(e.default,{name:"delete",className:"text-[14px]"})})}),(0,d.jsx)(p.ZI,{children:"Delete saved endpoint"})]})]}),I&&(0,d.jsx)(u.p,{type:"text",value:y,onChange:a=>{let c=a.target.value;C.current=c,B(c),b(c)},placeholder:m?"https://example.com/v1":"https://example.com",className:"h-9 text-xs"})]})}let H="__custom__",I="__save_key__";function J({value:a,onChange:b,apiKeys:c=[],cloudEnabled:g=!1,className:h=""}){let[i,j]=(0,f.useState)([]),[k,l]=(0,f.useState)(!1),[m,n]=(0,f.useState)(""),q=(0,f.useMemo)(()=>[...c.map(a=>({value:a.key,label:a.key})),...i.map(a=>({value:`saved:${a.name}`,label:a.key,url:a.key,saved:!0})),{value:H,label:"Custom...",url:""}],[c,i]),r=a?q.find(b=>b.value===a||b.url===a):null,s=r?r.value:k||a?H:q[0]?.value??H,t=k?m:a||"",v="string"==typeof s&&s.startsWith("saved:"),w=s===H,x=w&&(a||"").trim().length>0&&!c.some(b=>b.key===a);return 0!==c.length||0!==i.length||k||a?(0,d.jsxs)("div",{className:`flex flex-col gap-1.5 ${h}`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(o.l6,{value:s,onValueChange:c=>{if(c===I)return void B((a||"").trim());if(c===H){l(!0),n(""),b("");return}l(!1),n("");let d=q.find(a=>a.value===c);d&&b(d.url??d.value)},children:[(0,d.jsx)(o.bq,{className:"flex-1 min-w-0 text-xs",children:(0,d.jsx)(o.yv,{placeholder:"Select key"})}),(0,d.jsxs)(o.gC,{children:[q.map(a=>(0,d.jsx)(o.eb,{value:a.value,title:a.label,children:a.label},a.value)),x&&(0,d.jsx)(o.eb,{value:I,children:"+ Save current as..."})]})]}),v&&(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("button",{type:"button",onClick:()=>{if(!v)return;C(s.slice(6)),l(!1),n("");let a=q.find(a=>a.value!==H&&a.value!==s);b(a?a.url??a.value:"")},className:"p-1 text-muted-foreground hover:text-red-500 rounded transition-colors shrink-0",children:(0,d.jsx)(e.default,{name:"delete",className:"text-[14px]"})})}),(0,d.jsx)(p.ZI,{children:"Delete saved key"})]})]}),w&&(0,d.jsx)(u.p,{type:"text",value:t,onChange:a=>{let c=a.target.value;l(!0),n(c),b(c)},placeholder:"sk-...",className:"h-9 text-xs"})]}):(0,d.jsx)("span",{className:`min-w-0 rounded bg-card/40 px-2 py-2 text-xs text-muted-foreground sm:py-1.5 ${h}`,children:g?"No API keys - Create one in Keys page":"sk_10router (default)"})}let K=a=>(a||"").replace(/\/+$/,"");function L(a,b={}){if(!a)return!1;let c=K(a),{tunnelPublicUrl:d,tailscaleUrl:e,cloudUrl:f}=b;return!!(/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(c)||d&&c.startsWith(K(d))||e&&c.startsWith(K(e))||f&&c.startsWith(K(f)))}let M=/\[1m\]$/i,N=process.env.NEXT_PUBLIC_CLOUD_URL,O=[{label:"Default",value:""},{label:"200K",value:"198000"},{label:"300K",value:"298000"},{label:"500K",value:"498000"},{label:"700K",value:"698000"}];function P({tool:a,isExpanded:b,onToggle:c,activeProviders:g,modelMappings:h,onModelMappingChange:k,baseUrl:l,hasActiveProviders:m,apiKeys:t,cloudEnabled:u,initialStatus:v,tunnelEnabled:w,tunnelPublicUrl:x,tailscaleEnabled:y,tailscaleUrl:z}){let A,B,C,[E,F]=(0,f.useState)(v||null),[H,I]=(0,f.useState)(!1),[K,Q]=(0,f.useState)(!1),[R,S]=(0,f.useState)(!1),[T,U]=(0,f.useState)(null),[V,W]=(0,f.useState)(!1),[X,Y]=(0,f.useState)(!1),[Z,$]=(0,f.useState)(null),[_,aa]=(0,f.useState)(""),[ab,ac]=(0,f.useState)({}),[ad,ae]=(0,f.useState)(!1),[af,ag]=(0,f.useState)(""),[ah,ai]=(0,f.useState)(!1),[aj,ak]=(0,f.useState)(!1),[al,am]=(0,f.useState)(""),[an,ao]=(0,f.useState)(!1);(0,f.useRef)(!1);let ap=E?.settings?.env?.ANTHROPIC_BASE_URL||"",aq=(()=>{if(!E?.installed)return null;let a=E.settings?.env?.ANTHROPIC_BASE_URL;return a?L(a,{tunnelPublicUrl:x,tailscaleUrl:z,cloudUrl:u?N:null})?"configured":"other":"not_configured"})(),ar=async a=>{let b=!0===a;ai(b),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:b})}).catch(()=>{})},as=()=>{let a=af||l;return a.endsWith("/v1")?a:`${a}/v1`},at=async()=>{Q(!0),U(null);try{let b={ANTHROPIC_BASE_URL:as()},c=_?.trim()||(t?.length>0?t[0].key:null)||(u?null:"sk_10router");c&&(b.ANTHROPIC_AUTH_TOKEN=c),a.defaultModels.forEach(a=>{let c=h[a.alias];c&&a.envKey&&(b[a.envKey]=c)}),al&&(b.CLAUDE_CODE_AUTO_COMPACT_WINDOW=al),a.envVars?.todoTools&&(b[a.envVars.todoTools]="1"),a.envVars?.autoModeServer&&(b[a.envVars.autoModeServer]="0");let d=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:b,exaMcpEnabled:aj,autoCompactWindow:al})}),e=await d.json();d.ok?(D(as(),{tunnelPublicUrl:x,tailscaleUrl:z}),U({type:"success",text:"Settings applied successfully!"}),F(a=>({...a,hasBackup:!0,settings:{...a?.settings,env:b},exaMcpEnabled:aj}))):U({type:"error",text:e.error||"Failed to apply settings"})}catch(a){U({type:"error",text:a.message})}finally{Q(!1)}},au=async()=>{S(!0),U(null);try{let b=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),c=await b.json();b.ok?(U({type:"success",text:"Settings reset successfully!"}),a.defaultModels.forEach(a=>k(a.alias,a.defaultValue||"")),aa(""),ak(!1),am(""),ao(!1)):U({type:"error",text:c.error||"Failed to reset settings"})}catch(a){U({type:"error",text:a.message})}finally{S(!1)}};return(0,d.jsx)(n.Zp,{size:"sm",className:"overflow-hidden",children:(0,d.jsxs)(n.Wu,{children:[(0,d.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(s.default,{src:"/providers/claude.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"},loading:"lazy",decoding:"async"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===aq&&(0,d.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"===aq&&(0,d.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"===aq&&(0,d.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,d.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.description})]})]})}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[H&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,d.jsx)(e.default,{name:"progress_activity",className:"animate-spin"}),(0,d.jsx)("span",{children:"Checking Claude CLI..."})]}),!H&&E&&!E.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)(e.default,{name:"warning",className:"text-yellow-500"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:E.container?"10Router runs in a container":"Claude CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:E.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,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(j.$,{variant:"secondary",size:"sm",onClick:()=>ae(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)(e.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,d.jsxs)(j.$,{variant:"outline",size:"sm",onClick:()=>W(!V),children:[(0,d.jsx)(e.default,{name:V?"expand_less":"help",className:"text-[18px] mr-1"}),V?"Hide":"How to Install"]})]})]}),V&&(0,d.jsxs)("div",{className:"p-4 bg-card border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-muted-foreground mb-1",children:"macOS / Linux / Windows:"}),(0,d.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,d.jsxs)("p",{className:"text-muted-foreground",children:["After installation, run"," ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!H&&E?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)(G,{value:af||((A=af||l).endsWith("/v1")?A:`${A}/v1`),onChange:ag,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:w,tunnelPublicUrl:x,tailscaleEnabled:y,tailscaleUrl:z,currentUrl:ap})]}),E?.settings?.env?.ANTHROPIC_BASE_URL&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,d.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:E.settings.env.ANTHROPIC_BASE_URL})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)(J,{value:_,onChange:aa,apiKeys:t,cloudEnabled:u})]}),a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:a.name}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:h[a.alias]||"",onChange:b=>k(a.alias,b.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"}),h[a.alias]&&(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("button",{onClick:()=>k(a.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,d.jsx)(e.default,{name:"close",className:"text-[14px]"})})}),(0,d.jsx)(p.ZI,{children:"Clear"})]})]}),(0,d.jsx)("button",{onClick:()=>{$(a.alias),Y(!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"})]},a.alias)),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Auto-compact"}),(0,d.jsxs)(o.l6,{value:al||"__default__",onValueChange:a=>am("__default__"===a?"":a),children:[(0,d.jsx)(o.bq,{className:"w-full text-xs",children:(0,d.jsx)(o.yv,{})}),(0,d.jsx)(o.gC,{children:O.map(a=>(0,d.jsx)(o.eb,{value:a.value||"__default__",children:a.label},a.label))})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"1M context"}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,d.jsx)(r.S,{checked:an,onCheckedChange:b=>{var c;ao(c=!0===b),a.defaultModels.forEach(a=>{let b=h[a.alias];b&&k(a.alias,((a,b)=>{let{model:c}=function(a){if("string"!=typeof a)return{model:a,contextMarker:null};let b=a.trim(),c=b.match(M);return c?{model:b.slice(0,-c[0].length),contextMarker:c[0].slice(1,-1).toLowerCase()}:{model:a,contextMarker:null}}(a);return b?`${c}[1m]`:c})(b,c))})}}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"Append [1m] to the model name"}),(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("span",{className:"relative inline-flex",children:(0,d.jsx)(e.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,d.jsx)(p.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,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Filter naming"}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,d.jsx)(r.S,{checked:ah,onCheckedChange:ar}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"Filter naming requests"}),(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("span",{className:"relative inline-flex",children:(0,d.jsx)(e.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,d.jsx)(p.ZI,{side:"top",children:"Intercepts Claude Code's topic-naming requests and returns a fake response locally, saving API tokens."})]})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Web Search"}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,d.jsx)(r.S,{checked:aj,onCheckedChange:a=>ak(!0===a)}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"Exa MCP"}),(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("span",{className:"relative inline-flex",children:(0,d.jsx)(e.default,{name:"info",className:"text-muted-foreground text-[14px] cursor-help"})})}),(0,d.jsx)(p.ZI,{side:"top",children:"Injects Exa MCP into ~/.claude.json so non-Claude models gain web search. Restart Claude Code after Apply."})]})]})]})]}),T&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===T.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)(e.default,{name:"success"===T.type?"check_circle":"error",className:"text-[14px]"}),(0,d.jsx)("span",{children:T.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(j.$,{size:"sm",onClick:at,disabled:K,children:[K&&(0,d.jsx)(q.A,{className:"size-4 animate-spin"}),(0,d.jsx)(e.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,d.jsxs)(j.$,{variant:"outline",size:"sm",onClick:au,disabled:!E?.has10Router||R,children:[R&&(0,d.jsx)(q.A,{className:"size-4 animate-spin"}),(0,d.jsx)(e.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,d.jsxs)(j.$,{variant:"ghost",size:"sm",onClick:()=>ae(!0),children:[(0,d.jsx)(e.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),X&&(0,d.jsx)(i.rq,{isOpen:X,onClose:()=>Y(!1),onSelect:a=>{Z&&k(Z,a.value)},selectedModel:Z?h[Z]:null,activeProviders:g,modelAliases:ab,title:`Select model for ${Z}`}),(0,d.jsx)(i.uR,{isOpen:ad,onClose:()=>ae(!1),title:"Claude CLI - Manual Configuration",configs:(B=_&&_.trim()?_:u?"<API_KEY_FROM_DASHBOARD>":"sk_10router",C={ANTHROPIC_BASE_URL:as(),ANTHROPIC_AUTH_TOKEN:B},a.defaultModels.forEach(a=>{let b=h[a.alias];b&&a.envKey&&(C[a.envKey]=b)}),al&&(C.CLAUDE_CODE_AUTO_COMPACT_WINDOW=al),a.envVars?.todoTools&&(C[a.envVars.todoTools]="1"),a.envVars?.autoModeServer&&(C[a.envVars.autoModeServer]="0"),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:C},null,2)}])})]})})}function Q({tool:a,isExpanded:b,onToggle:c,baseUrl:g,apiKeys:h,activeProviders:k,cloudEnabled:l,initialStatus:m,tunnelEnabled:o,tunnelPublicUrl:r,tailscaleEnabled:t,tailscaleUrl:u}){let v,w,x,[y,z]=(0,f.useState)(m||null),[A,B]=(0,f.useState)(!1),[C,E]=(0,f.useState)(!1),[F,H]=(0,f.useState)(!1),[I,K]=(0,f.useState)(null),[M,N]=(0,f.useState)(!1),[O,P]=(0,f.useState)(""),[R,S]=(0,f.useState)([]),[T,U]=(0,f.useState)(""),[V,W]=(0,f.useState)(!1),[X,Y]=(0,f.useState)(!1),[Z,$]=(0,f.useState)({}),[_,aa]=(0,f.useState)(!1),[ab,ac]=(0,f.useState)(""),ad=(v=y?.config?.match(/base_url\s*=\s*"([^"]+)"/))?v[1]:"",ae=y?.installed?y.config?L(ad,{tunnelPublicUrl:r,tailscaleUrl:u})?"configured":"other":"not_configured":null,af=()=>{let a=ab||`${g}/v1`;return a.endsWith("/v1")?a:`${a}/v1`},ag=async()=>{B(!0);try{let a=await fetch("/api/cli-tools/codex-settings"),b=await a.json();z(b)}catch(a){z({installed:!1,error:a.message})}finally{B(!1)}},ah=async()=>{E(!0),K(null);try{let a=O&&O.trim()||l?O:"sk_10router",b=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:af(),apiKey:a,models:R,subagentModel:T})}),c=await b.json();b.ok?(D(af(),{tunnelPublicUrl:r,tailscaleUrl:u}),K({type:"success",text:"Applied — models appear in codex /model. Account default kept; use codex --profile 10router-<model> for 10Router routing."}),ag()):K({type:"error",text:c.error||"Failed to apply settings"})}catch(a){K({type:"error",text:a.message})}finally{E(!1)}},ai=async()=>{H(!0),K(null);try{let a=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),b=await a.json();a.ok?(K({type:"success",text:"Settings reset successfully!"}),S([]),U(""),ag()):K({type:"error",text:b.error||"Failed to reset settings"})}catch(a){K({type:"error",text:a.message})}finally{H(!1)}};return(0,d.jsx)(n.Zp,{size:"sm",className:"overflow-hidden",children:(0,d.jsxs)(n.Wu,{children:[(0,d.jsx)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(s.default,{src:"/providers/codex.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"},loading:"lazy",decoding:"async"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===ae&&(0,d.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"===ae&&(0,d.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"===ae&&(0,d.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,d.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.description})]})]})}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[A&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,d.jsx)(e.default,{name:"progress_activity",className:"animate-spin"}),(0,d.jsx)("span",{children:"Checking Codex CLI..."})]}),!A&&y&&!y.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)(e.default,{name:"warning",className:"text-yellow-500"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:y.container?"10Router runs in a container":"Codex CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:y.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,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(j.$,{variant:"secondary",size:"sm",onClick:()=>aa(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)(e.default,{name:"content_copy",className:"text-[18px] mr-1"}),"Manual Config"]}),(0,d.jsxs)(j.$,{variant:"outline",size:"sm",onClick:()=>N(!M),children:[(0,d.jsx)(e.default,{name:M?"expand_less":"help",className:"text-[18px] mr-1"}),M?"Hide":"How to Install"]})]})]}),M&&(0,d.jsxs)("div",{className:"p-4 bg-card border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-muted-foreground mb-1",children:"macOS / Linux / Windows:"}),(0,d.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,d.jsxs)("p",{className:"text-muted-foreground",children:["After installation, run"," ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," to verify."]}),(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:(0,d.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Codex reads custom providers from"," ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/config.toml"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!A&&y?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[y?.rootHijacked&&(0,d.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,d.jsx)(e.default,{name:"warning",className:"text-[14px] shrink-0 mt-0.5"}),(0,d.jsx)("span",{children:"Old settings overrode your default Codex model. Apply to restore your ChatGPT account default — added models become profiles."})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)(G,{value:ab||ab||`${g}/v1`,onChange:ac,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:o,tunnelPublicUrl:r,tailscaleEnabled:t,tailscaleUrl:u,currentUrl:ad})]}),y?.config&&(ad?(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Current"}),(0,d.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:ad})]}):null),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)(J,{value:O,onChange:P,apiKeys:h,cloudEnabled:l})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"pt-1 text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Models"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,d.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===R.length?(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"No models added"}):R.map(a=>(0,d.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:[a,(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("button",{onClick:()=>S(R.filter(b=>b!==a)),className:"ml-0.5 hover:text-red-500",children:(0,d.jsx)(e.default,{name:"close",className:"text-[12px]"})})}),(0,d.jsx)(p.ZI,{children:"Remove"})]})]},a))}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("button",{onClick:()=>W(!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,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Launch:"," ",(0,d.jsx)("code",{className:"rounded bg-black/5 px-1 dark:bg-white/5",children:"codex --profile 10router-<model>"})]})]})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground sm:text-right sm:text-sm",children:"Subagent Model"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:T,onChange:a=>U(a.target.value),placeholder:R[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"}),T&&(0,d.jsxs)(p.m_,{children:[(0,d.jsx)(p.k$,{asChild:!0,children:(0,d.jsx)("button",{onClick:()=>U(""),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,d.jsx)(e.default,{name:"close",className:"text-[14px]"})})}),(0,d.jsx)(p.ZI,{children:"Clear (will use main model)"})]})]}),(0,d.jsx)("button",{onClick:()=>Y(!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"})]})]}),I&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===I.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)(e.default,{name:"success"===I.type?"check_circle":"error",className:"text-[14px]"}),(0,d.jsx)("span",{children:I.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(j.$,{size:"sm",onClick:ah,disabled:!O&&l&&h.length>0||0===R.length||C,children:[C&&(0,d.jsx)(q.A,{className:"size-4 animate-spin"}),(0,d.jsx)(e.default,{name:"save",className:"text-[14px] mr-1"}),"Apply"]}),(0,d.jsxs)(j.$,{variant:"outline",size:"sm",onClick:ai,disabled:F,children:[F&&(0,d.jsx)(q.A,{className:"size-4 animate-spin"}),(0,d.jsx)(e.default,{name:"restore",className:"text-[14px] mr-1"}),"Reset"]}),(0,d.jsxs)(j.$,{variant:"ghost",size:"sm",onClick:()=>aa(!0),children:[(0,d.jsx)(e.default,{name:"content_copy",className:"text-[14px] mr-1"}),"Manual Config"]})]})]})]}),V&&(0,d.jsx)(i.rq,{isOpen:V,onClose:()=>W(!1),onSelect:a=>{R.includes(a.value)||S([...R,a.value])},onDeselect:a=>{S(R.filter(b=>b!==a.value))},selectedModel:null,addedModelValues:R,closeOnSelect:!1,title:"Add Models for Codex",activeProviders:k,modelAliases:Z}),X&&(0,d.jsx)(i.rq,{isOpen:X,onClose:()=>Y(!1),onSelect:a=>{U(a.value),Y(!1)},selectedModel:T,activeProviders:k,modelAliases:Z,title:"Select Subagent Model for Codex"}),(0,d.jsx)(i.uR,{isOpen:_,onClose:()=>aa(!1),title:"Codex CLI - Manual Configuration",configs:(w=O&&O.trim()?O:l?"<API_KEY_FROM_DASHBOARD>":"sk_10router",x=[{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 @@ ${x}
|
|
|
37
37
|
config:
|
|
38
38
|
provider: 10router
|
|
39
39
|
model: ${S||Q[0]||"provider/model-id"}
|
|
40
|
-
`},{filename:"~/.dsh/.credentials.yaml (add ref)",content:`refs: { TEN_ROUTER_API_KEY: ${w} }`}])})]})})}c(77736);let _=process.env.NEXT_PUBLIC_CLOUD_URL;function aa({toolId:a,machineId:b}){let c=l.d[a],[g,n]=(0,f.useState)([]),[o,p]=(0,f.useState)(!0),[q,r]=(0,f.useState)({}),[s,t]=(0,f.useState)(!1),[u,v]=(0,f.useState)(!1),[w,x]=(0,f.useState)(""),[y,z]=(0,f.useState)(!1),[A,B]=(0,f.useState)(""),[C,D]=(0,f.useState)([]),E=()=>g.filter(a=>!1!==a.isActive),F=(0,f.useCallback)((a,b,c)=>{r(d=>d[a]?.[b]===c?d:{...d,[a]:{...d[a],[b]:c}})},[]);return c?(0,d.jsxs)(i.YW,{children:[(0,d.jsxs)("div",{children:[(0,d.jsx)(j.$,{variant:"outline",size:"sm",asChild:!0,className:"mb-4 self-start",children:(0,d.jsxs)(h(),{href:"/dashboard/cli-tools",children:[(0,d.jsx)(e.default,{name:"arrow_back",className:"text-lg"}),"CLI Tools"]})}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[(0,d.jsx)("div",{className:"size-12 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${c.color}15`},children:(0,d.jsx)(k.A,{src:c.image,alt:c.name,size:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",fallbackText:c.name.slice(0,2).toUpperCase(),fallbackColor:c.color})}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h1",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:c.name}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:c.description})]})]})]}),o?(0,d.jsx)(i.KX,{}):(()=>{let b,e,f,g=(b=E(),e=[],f=new Set,b.forEach(a=>{let b=m.Xg[a.provider]||a.provider,c=(0,m.KC)(a.provider);if(c.forEach(c=>{let d=`${b}/${c.id}`;f.has(d)||(f.add(d),e.push({value:d,label:`${b}/${c.id}`,provider:a.provider,alias:b,connectionName:a.name,modelId:c.id}))}),0===c.length){let c=a.providerSpecificData?.prefix||b,d=[];a.defaultModel&&d.push({id:a.defaultModel,name:a.defaultModel}),(a.providerSpecificData?.customModels||[]).forEach(a=>{a?.id&&!d.some(b=>b.id===a.id)&&d.push({id:a.id,name:a.name||a.id})}),0===d.length&&"active"===a.testStatus&&d.push({id:"model-id",name:`${c}/model-id`}),d.forEach(b=>{let d=`${c}/${b.id}`;f.has(d)||(f.add(d),e.push({value:d,label:`${c}/${b.id}`,provider:a.provider,alias:c,connectionName:a.name,modelId:b.id}))})}}),e).length>0,h={tool:c,isExpanded:!0,onToggle:()=>{},baseUrl:u&&w?w:s&&_?_:"http://localhost:20128",apiKeys:C,tunnelEnabled:u,tunnelPublicUrl:w,tailscaleEnabled:y,tailscaleUrl:A};switch(a){case"claude":return(0,d.jsx)(P,{...h,activeProviders:E(),modelMappings:q[a]||{},onModelMappingChange:(b,c)=>F(a,b,c),hasActiveProviders:g,cloudEnabled:s});case"codex":return(0,d.jsx)(Q,{...h,activeProviders:E(),cloudEnabled:s});case"opencode":return(0,d.jsx)(U,{...h,activeProviders:E(),cloudEnabled:s});case"cowork":return(0,d.jsx)(X,{...h,activeProviders:E(),hasActiveProviders:g,cloudEnabled:s,cloudUrl:_,tunnelEnabled:u,tunnelPublicUrl:w,tailscaleEnabled:y,tailscaleUrl:A});case"dsh":return(0,d.jsx)($,{...h,activeProviders:E(),cloudEnabled:s});default:return(0,d.jsx)(T,{toolId:a,...h,activeProviders:E(),cloudEnabled:s,tunnelEnabled:u})}})()]}):(0,d.jsxs)(i.YW,{children:[(0,d.jsx)(j.$,{variant:"outline",size:"sm",asChild:!0,className:"self-start",children:(0,d.jsxs)(h(),{href:"/dashboard/cli-tools",children:[(0,d.jsx)(e.default,{name:"arrow_back",className:"text-lg"}),"CLI Tools"]})}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Tool not found or disabled."})]})}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},32467:a=>{"use strict";a.exports=require("node:http2")},33873:a=>{"use strict";a.exports=require("path")},34589:a=>{"use strict";a.exports=require("node:assert")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41270:(a,b,c)=>{"use strict";c.d(b,{d:()=>d});let d={claude:{id:"claude",name:"Claude Code",image:"/providers/claude.png",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",fableModel:"ANTHROPIC_DEFAULT_FABLE_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL",todoTools:"CLAUDE_CODE_ENABLE_TODO_TOOLS"},modelAliases:["default","sonnet","opus","fable","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"fable",name:"Claude Fable",alias:"fable",envKey:"ANTHROPIC_DEFAULT_FABLE_MODEL",defaultValue:"cc/claude-fable-5"},{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-5"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-5"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},codex:{id:"codex",name:"OpenAI Codex CLI / App",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",color:"#E87040",description:"OpenCode AI Terminal Assistant",configType:"custom"},cowork:{id:"cowork",name:"Claude Cowork",image:"/providers/claude.png",color:"#D97757",description:"Claude Desktop Cowork (third-party inference)",configType:"custom"},dsh:{id:"dsh",name:"DSH - DeepSeek Harness",image:"/providers/deepseek.png",color:"#4D6BFE",description:"DeepSeek Harness (dsh web) provider",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresExternalUrl:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor routes requests through its own server, so local endpoint is not supported. Please enable Tunnel or Cloud Endpoint in Settings."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]}}},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},47633:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d={ReadonlyURLSearchParams:function(){return f.ReadonlyURLSearchParams},RedirectType:function(){return m},forbidden:function(){return i.forbidden},notFound:function(){return h.notFound},permanentRedirect:function(){return g.permanentRedirect},redirect:function(){return g.redirect},unauthorized:function(){return j.unauthorized},unstable_isUnrecognizedActionError:function(){return l},unstable_rethrow:function(){return k.unstable_rethrow}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(21704),g=c(96186),h=c(78688),i=c(53713),j=c(11543),k=c(71332);function l(){throw Object.defineProperty(Error("`unstable_isUnrecognizedActionError` can only be used on the client."),"__NEXT_ERROR_CODE",{value:"E776",enumerable:!1,configurable:!0})}let m={push:"push",replace:"replace"};("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},48161:a=>{"use strict";a.exports=require("node:os")},49836:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d={actionAsyncStorage:function(){return f.actionAsyncStorage},workAsyncStorage:function(){return g.workAsyncStorage},workUnitAsyncStorage:function(){return h.workUnitAsyncStorage}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(19121),g=c(29294),h=c(63033);("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},53713:(a,b,c)=>{"use strict";function d(){throw Object.defineProperty(Error("`forbidden()` is experimental and only allowed to be enabled when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E488",enumerable:!1,configurable:!0})}Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"forbidden",{enumerable:!0,get:function(){return d}}),c(41081).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71332:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"unstable_rethrow",{enumerable:!0,get:function(){return function a(b){if((0,g.isNextRouterError)(b)||(0,f.isBailoutToCSRError)(b)||(0,i.isDynamicServerError)(b)||(0,h.isDynamicPostpone)(b)||(0,e.isPostpone)(b)||(0,d.isHangingPromiseRejectionError)(b)||(0,h.isPrerenderInterruptedError)(b))throw b;b instanceof Error&&"cause"in b&&a(b.cause)}}});let d=c(75523),e=c(49472),f=c(98389),g=c(65385),h=c(21206),i=c(92540);("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},71553:a=>{"use strict";a.exports=require("node:dns/promises")},71622:a=>{"use strict";a.exports=import("open")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},75919:a=>{"use strict";a.exports=require("node:worker_threads")},75994:(a,b,c)=>{Promise.resolve().then(c.bind(c,78685))},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77598:a=>{"use strict";a.exports=require("node:crypto")},77736:(a,b,c)=>{"use strict";c.d(b,{A:()=>i});var d=c(86240),e=c(29184),f=c(51),g=c(92968);let h={ok:"bg-green-500",warn:"bg-amber-500",info:"bg-blue-500",muted:"bg-muted-foreground/50"};function i({toolId:a,tool:b,status:c}){let j=b?.configType==="guide"?{label:"Guide",tone:"info"}:c?c.container&&null==c.installed?{label:"Manual setup",tone:"info"}:c.installed?c.has10Router?{label:"Connected",tone:"ok"}:{label:"Not configured",tone:"warn"}:{label:"Not installed",tone:"muted"}:{label:"Unknown",tone:"muted"};return(0,d.jsx)(f.default,{href:`/dashboard/cli-tools/${a}`,title:b.name,iconBg:b.color?`${b.color}15`:void 0,icon:(0,d.jsx)(g.A,{src:b.image,alt:b.name,size:30,className:"max-h-[30px] max-w-[30px] rounded-lg object-contain",fallbackText:b.name.slice(0,2).toUpperCase(),fallbackColor:b.color}),children:(0,d.jsxs)(e.E,{variant:"default",children:[(0,d.jsx)("span",{className:`size-1.5 rounded-full ${h[j.tone]}`}),j.label]})})}},78474:a=>{"use strict";a.exports=require("node:events")},78685:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(35062).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/cli-tools/[toolId]/ToolDetailClient.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/cli-tools/[toolId]/ToolDetailClient.tsx","default")},78688:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"notFound",{enumerable:!0,get:function(){return f}});let d=c(41081),e=`${d.HTTP_ERROR_FALLBACK_ERROR_CODE};404`;function f(){let a=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E1041",enumerable:!1,configurable:!0});throw a.digest=e,a}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},79551:a=>{"use strict";a.exports=require("url")},79646:a=>{"use strict";a.exports=require("child_process")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},87997:a=>{"use strict";a.exports=require("node:timers")},90808:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>x,handler:()=>z,routeModule:()=>y});var d=c(26720),e=c(29966),f=c(36243),g=c(70310),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,79452))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,2808,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,8329,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,41580,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,11089))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,2808,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,8329,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,41580,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),u=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),v={children:["",{children:["(dashboard)",{children:["dashboard",{children:["cli-tools",{children:["[toolId]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,1568))),"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/cli-tools/[toolId]/page.tsx"]}]},{"global-error":[u,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[s,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/home/runner/work/10Router/10Router/src/app/(dashboard)/layout.tsx"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/home/runner/work/10Router/10Router/src/app/layout.tsx"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,w=(0,e.H)({tree:v,page:"/(dashboard)/dashboard/cli-tools/[toolId]/page",pathname:"/dashboard/cli-tools/[toolId]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),x=w.__next_app__,y=w.routeModule,z=w.handler},91645:a=>{"use strict";a.exports=require("net")},92592:(a,b,c)=>{"use strict";c.d(b,{D:()=>e});var d=c(94621);async function e(){return await (0,d.Xj)()}},94621:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(78356),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(51336);let l=h().join(k.n,"machine-id"),m=h().join(k.n,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.n,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="10r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},94735:a=>{"use strict";a.exports=require("events")},96186:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d={getRedirectError:function(){return i},getRedirectStatusCodeFromError:function(){return n},getRedirectTypeFromError:function(){return m},getURLFromRedirectError:function(){return l},permanentRedirect:function(){return k},redirect:function(){return j}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(28191),g=c(13489),h=c(49836);function i(a,b,c=f.RedirectStatusCode.TemporaryRedirect){let d=Object.defineProperty(Error(g.REDIRECT_ERROR_CODE),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return d.digest=`${g.REDIRECT_ERROR_CODE};${b};${a};${c};`,d}function j(a,b){throw i(a,b??=h.actionAsyncStorage?.getStore()?.isAction?"push":"replace",f.RedirectStatusCode.TemporaryRedirect)}function k(a,b="replace"){throw i(a,b,f.RedirectStatusCode.PermanentRedirect)}function l(a){return(0,g.isRedirectError)(a)?a.digest.split(";").slice(2,-2).join(";"):null}function m(a){if(!(0,g.isRedirectError)(a))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return a.digest.split(";",2)[1]}function n(a){if(!(0,g.isRedirectError)(a))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return Number(a.digest.split(";").at(-2))}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[1316,1238,7963,8569,7257,6009,9817,7535,7816,7156,2339,6461,4301,1289,9018,2801],()=>b(b.s=90808));module.exports=c})();
|
|
40
|
+
`},{filename:"~/.dsh/.credentials.yaml (add ref)",content:`refs: { TEN_ROUTER_API_KEY: ${w} }`}])})]})})}c(77736);let _=process.env.NEXT_PUBLIC_CLOUD_URL;function aa({toolId:a,machineId:b}){let c=l.d[a],[g,n]=(0,f.useState)([]),[o,p]=(0,f.useState)(!0),[q,r]=(0,f.useState)({}),[s,t]=(0,f.useState)(!1),[u,v]=(0,f.useState)(!1),[w,x]=(0,f.useState)(""),[y,z]=(0,f.useState)(!1),[A,B]=(0,f.useState)(""),[C,D]=(0,f.useState)([]),E=()=>g.filter(a=>!1!==a.isActive),F=(0,f.useCallback)((a,b,c)=>{r(d=>d[a]?.[b]===c?d:{...d,[a]:{...d[a],[b]:c}})},[]);return c?(0,d.jsxs)(i.YW,{children:[(0,d.jsxs)("div",{children:[(0,d.jsx)(j.$,{variant:"outline",size:"sm",asChild:!0,className:"mb-4 self-start",children:(0,d.jsxs)(h(),{href:"/dashboard/cli-tools",children:[(0,d.jsx)(e.default,{name:"arrow_back",className:"text-lg"}),"CLI Tools"]})}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[(0,d.jsx)("div",{className:"size-12 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${c.color}15`},children:(0,d.jsx)(k.A,{src:c.image,alt:c.name,size:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",fallbackText:c.name.slice(0,2).toUpperCase(),fallbackColor:c.color})}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h1",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:c.name}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:c.description})]})]})]}),o?(0,d.jsx)(i.KX,{}):(()=>{let b,e,f,g=(b=E(),e=[],f=new Set,b.forEach(a=>{let b=m.Xg[a.provider]||a.provider,c=(0,m.KC)(a.provider);if(c.forEach(c=>{let d=`${b}/${c.id}`;f.has(d)||(f.add(d),e.push({value:d,label:`${b}/${c.id}`,provider:a.provider,alias:b,connectionName:a.name,modelId:c.id}))}),0===c.length){let c=a.providerSpecificData?.prefix||b,d=[];a.defaultModel&&d.push({id:a.defaultModel,name:a.defaultModel}),(a.providerSpecificData?.customModels||[]).forEach(a=>{a?.id&&!d.some(b=>b.id===a.id)&&d.push({id:a.id,name:a.name||a.id})}),0===d.length&&"active"===a.testStatus&&d.push({id:"model-id",name:`${c}/model-id`}),d.forEach(b=>{let d=`${c}/${b.id}`;f.has(d)||(f.add(d),e.push({value:d,label:`${c}/${b.id}`,provider:a.provider,alias:c,connectionName:a.name,modelId:b.id}))})}}),e).length>0,h={tool:c,isExpanded:!0,onToggle:()=>{},baseUrl:u&&w?w:s&&_?_:"http://localhost:20128",apiKeys:C,tunnelEnabled:u,tunnelPublicUrl:w,tailscaleEnabled:y,tailscaleUrl:A};switch(a){case"claude":return(0,d.jsx)(P,{...h,activeProviders:E(),modelMappings:q[a]||{},onModelMappingChange:(b,c)=>F(a,b,c),hasActiveProviders:g,cloudEnabled:s});case"codex":return(0,d.jsx)(Q,{...h,activeProviders:E(),cloudEnabled:s});case"opencode":return(0,d.jsx)(U,{...h,activeProviders:E(),cloudEnabled:s});case"cowork":return(0,d.jsx)(X,{...h,activeProviders:E(),hasActiveProviders:g,cloudEnabled:s,cloudUrl:_,tunnelEnabled:u,tunnelPublicUrl:w,tailscaleEnabled:y,tailscaleUrl:A});case"dsh":return(0,d.jsx)($,{...h,activeProviders:E(),cloudEnabled:s});default:return(0,d.jsx)(T,{toolId:a,...h,activeProviders:E(),cloudEnabled:s,tunnelEnabled:u})}})()]}):(0,d.jsxs)(i.YW,{children:[(0,d.jsx)(j.$,{variant:"outline",size:"sm",asChild:!0,className:"self-start",children:(0,d.jsxs)(h(),{href:"/dashboard/cli-tools",children:[(0,d.jsx)(e.default,{name:"arrow_back",className:"text-lg"}),"CLI Tools"]})}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Tool not found or disabled."})]})}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},32467:a=>{"use strict";a.exports=require("node:http2")},33873:a=>{"use strict";a.exports=require("path")},34589:a=>{"use strict";a.exports=require("node:assert")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41270:(a,b,c)=>{"use strict";c.d(b,{d:()=>d});let d={claude:{id:"claude",name:"Claude Code",image:"/providers/claude.png",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",fableModel:"ANTHROPIC_DEFAULT_FABLE_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL",todoTools:"CLAUDE_CODE_ENABLE_TODO_TOOLS",autoModeServer:"CLAUDE_CODE_AUTO_MODE_SERVER"},modelAliases:["default","sonnet","opus","fable","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"fable",name:"Claude Fable",alias:"fable",envKey:"ANTHROPIC_DEFAULT_FABLE_MODEL",defaultValue:"cc/claude-fable-5"},{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-5"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-5"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},codex:{id:"codex",name:"OpenAI Codex CLI / App",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",color:"#E87040",description:"OpenCode AI Terminal Assistant",configType:"custom"},cowork:{id:"cowork",name:"Claude Cowork",image:"/providers/claude.png",color:"#D97757",description:"Claude Desktop Cowork (third-party inference)",configType:"custom"},dsh:{id:"dsh",name:"DSH - DeepSeek Harness",image:"/providers/deepseek.png",color:"#4D6BFE",description:"DeepSeek Harness (dsh web) provider",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresExternalUrl:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor routes requests through its own server, so local endpoint is not supported. Please enable Tunnel or Cloud Endpoint in Settings."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]}}},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},47633:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d={ReadonlyURLSearchParams:function(){return f.ReadonlyURLSearchParams},RedirectType:function(){return m},forbidden:function(){return i.forbidden},notFound:function(){return h.notFound},permanentRedirect:function(){return g.permanentRedirect},redirect:function(){return g.redirect},unauthorized:function(){return j.unauthorized},unstable_isUnrecognizedActionError:function(){return l},unstable_rethrow:function(){return k.unstable_rethrow}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(21704),g=c(96186),h=c(78688),i=c(53713),j=c(11543),k=c(71332);function l(){throw Object.defineProperty(Error("`unstable_isUnrecognizedActionError` can only be used on the client."),"__NEXT_ERROR_CODE",{value:"E776",enumerable:!1,configurable:!0})}let m={push:"push",replace:"replace"};("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},48161:a=>{"use strict";a.exports=require("node:os")},49836:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d={actionAsyncStorage:function(){return f.actionAsyncStorage},workAsyncStorage:function(){return g.workAsyncStorage},workUnitAsyncStorage:function(){return h.workUnitAsyncStorage}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(19121),g=c(29294),h=c(63033);("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},53713:(a,b,c)=>{"use strict";function d(){throw Object.defineProperty(Error("`forbidden()` is experimental and only allowed to be enabled when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E488",enumerable:!1,configurable:!0})}Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"forbidden",{enumerable:!0,get:function(){return d}}),c(41081).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71332:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"unstable_rethrow",{enumerable:!0,get:function(){return function a(b){if((0,g.isNextRouterError)(b)||(0,f.isBailoutToCSRError)(b)||(0,i.isDynamicServerError)(b)||(0,h.isDynamicPostpone)(b)||(0,e.isPostpone)(b)||(0,d.isHangingPromiseRejectionError)(b)||(0,h.isPrerenderInterruptedError)(b))throw b;b instanceof Error&&"cause"in b&&a(b.cause)}}});let d=c(75523),e=c(49472),f=c(98389),g=c(65385),h=c(21206),i=c(92540);("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},71553:a=>{"use strict";a.exports=require("node:dns/promises")},71622:a=>{"use strict";a.exports=import("open")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},75919:a=>{"use strict";a.exports=require("node:worker_threads")},75994:(a,b,c)=>{Promise.resolve().then(c.bind(c,78685))},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77598:a=>{"use strict";a.exports=require("node:crypto")},77736:(a,b,c)=>{"use strict";c.d(b,{A:()=>i});var d=c(86240),e=c(29184),f=c(51),g=c(92968);let h={ok:"bg-green-500",warn:"bg-amber-500",info:"bg-blue-500",muted:"bg-muted-foreground/50"};function i({toolId:a,tool:b,status:c}){let j=b?.configType==="guide"?{label:"Guide",tone:"info"}:c?c.container&&null==c.installed?{label:"Manual setup",tone:"info"}:c.installed?c.has10Router?{label:"Connected",tone:"ok"}:{label:"Not configured",tone:"warn"}:{label:"Not installed",tone:"muted"}:{label:"Unknown",tone:"muted"};return(0,d.jsx)(f.default,{href:`/dashboard/cli-tools/${a}`,title:b.name,iconBg:b.color?`${b.color}15`:void 0,icon:(0,d.jsx)(g.A,{src:b.image,alt:b.name,size:30,className:"max-h-[30px] max-w-[30px] rounded-lg object-contain",fallbackText:b.name.slice(0,2).toUpperCase(),fallbackColor:b.color}),children:(0,d.jsxs)(e.E,{variant:"default",children:[(0,d.jsx)("span",{className:`size-1.5 rounded-full ${h[j.tone]}`}),j.label]})})}},78474:a=>{"use strict";a.exports=require("node:events")},78685:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(35062).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/cli-tools/[toolId]/ToolDetailClient.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/cli-tools/[toolId]/ToolDetailClient.tsx","default")},78688:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"notFound",{enumerable:!0,get:function(){return f}});let d=c(41081),e=`${d.HTTP_ERROR_FALLBACK_ERROR_CODE};404`;function f(){let a=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E1041",enumerable:!1,configurable:!0});throw a.digest=e,a}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},79551:a=>{"use strict";a.exports=require("url")},79646:a=>{"use strict";a.exports=require("child_process")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},87997:a=>{"use strict";a.exports=require("node:timers")},90808:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>x,handler:()=>z,routeModule:()=>y});var d=c(26720),e=c(29966),f=c(36243),g=c(70310),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,79452))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,2808,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,8329,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,41580,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,11089))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,2808,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,8329,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,41580,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),u=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),v={children:["",{children:["(dashboard)",{children:["dashboard",{children:["cli-tools",{children:["[toolId]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,1568))),"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/cli-tools/[toolId]/page.tsx"]}]},{"global-error":[u,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[s,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/home/runner/work/10Router/10Router/src/app/(dashboard)/layout.tsx"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/home/runner/work/10Router/10Router/src/app/layout.tsx"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,w=(0,e.H)({tree:v,page:"/(dashboard)/dashboard/cli-tools/[toolId]/page",pathname:"/dashboard/cli-tools/[toolId]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),x=w.__next_app__,y=w.routeModule,z=w.handler},91645:a=>{"use strict";a.exports=require("net")},92592:(a,b,c)=>{"use strict";c.d(b,{D:()=>e});var d=c(94621);async function e(){return await (0,d.Xj)()}},94621:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(78356),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(51336);let l=h().join(k.n,"machine-id"),m=h().join(k.n,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.n,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="10r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},94735:a=>{"use strict";a.exports=require("events")},96186:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d={getRedirectError:function(){return i},getRedirectStatusCodeFromError:function(){return n},getRedirectTypeFromError:function(){return m},getURLFromRedirectError:function(){return l},permanentRedirect:function(){return k},redirect:function(){return j}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(28191),g=c(13489),h=c(49836);function i(a,b,c=f.RedirectStatusCode.TemporaryRedirect){let d=Object.defineProperty(Error(g.REDIRECT_ERROR_CODE),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return d.digest=`${g.REDIRECT_ERROR_CODE};${b};${a};${c};`,d}function j(a,b){throw i(a,b??=h.actionAsyncStorage?.getStore()?.isAction?"push":"replace",f.RedirectStatusCode.TemporaryRedirect)}function k(a,b="replace"){throw i(a,b,f.RedirectStatusCode.PermanentRedirect)}function l(a){return(0,g.isRedirectError)(a)?a.digest.split(";").slice(2,-2).join(";"):null}function m(a){if(!(0,g.isRedirectError)(a))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return a.digest.split(";",2)[1]}function n(a){if(!(0,g.isRedirectError)(a))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return Number(a.digest.split(";").at(-2))}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[1316,1238,7963,8569,7257,6009,9817,7535,7816,7156,2339,6461,4301,1289,9018,2801],()=>b(b.s=90808));module.exports=c})();
|