@amir83nasr/10router 0.1.16 → 0.1.18
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 +5 -5
- 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 +1 -1
- package/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/[id]/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(dashboard)/dashboard/proxy-pools/page.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.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.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.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.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.js +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +5 -5
- package/.next/server/app/_not-found.segments/_full.segment.rsc +5 -5
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/cli-tools/all-statuses/route.js +1 -1
- package/.next/server/app/api/cli-tools/claude-settings/route.js +1 -1
- package/.next/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
- package/.next/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
- package/.next/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- package/.next/server/app/api/cli-tools/dsh-settings/route.js +1 -1
- package/.next/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/.next/server/app/api/oauth/codex/bulk-import/route.js +1 -1
- package/.next/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/.next/server/app/api/providers/[id]/models/route.js +1 -1
- package/.next/server/app/api/providers/[id]/test/route.js +1 -1
- package/.next/server/app/api/providers/client/route.js +1 -1
- package/.next/server/app/api/providers/route.js +1 -1
- package/.next/server/app/api/providers/test-batch/route.js +1 -1
- package/.next/server/app/api/providers/validate/route.js +1 -1
- package/.next/server/app/api/settings/route.js +1 -1
- package/.next/server/app/api/translator/console-logs/route.js +1 -1
- package/.next/server/app/api/translator/console-logs/stream/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/disable/route.js +1 -1
- package/.next/server/app/api/tunnel/enable/route.js +1 -1
- package/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
- package/.next/server/app/api/tunnel/tailscale-enable/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/v1/api/chat/route.js +1 -1
- package/.next/server/app/api/v1/audio/speech/route.js +1 -1
- package/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/.next/server/app/api/v1/chat/completions/route.js +1 -1
- package/.next/server/app/api/v1/embeddings/route.js +1 -1
- package/.next/server/app/api/v1/images/generations/route.js +1 -1
- package/.next/server/app/api/v1/messages/route.js +1 -1
- package/.next/server/app/api/v1/models/[...model]/route.js +1 -1
- package/.next/server/app/api/v1/models/route.js +1 -1
- package/.next/server/app/api/v1/responses/compact/route.js +1 -1
- package/.next/server/app/api/v1/responses/route.js +1 -1
- package/.next/server/app/api/v1/route.js +1 -1
- package/.next/server/app/api/v1/search/route.js +1 -1
- package/.next/server/app/api/v1/systemone/route.js +1 -1
- package/.next/server/app/api/v1/videos/[id]/route.js +1 -1
- package/.next/server/app/api/v1/videos/edits/route.js +1 -1
- package/.next/server/app/api/v1/videos/extensions/route.js +1 -1
- package/.next/server/app/api/v1/videos/generations/route.js +1 -1
- package/.next/server/app/api/v1/web/fetch/route.js +1 -1
- package/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/callback/page.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 +5 -5
- package/.next/server/app/callback.segments/_full.segment.rsc +5 -5
- package/.next/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +5 -5
- 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.js +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.js +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 +5 -5
- package/.next/server/app/landing.segments/_full.segment.rsc +5 -5
- package/.next/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/login/page.js +1 -1
- 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.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +5 -5
- package/.next/server/chunks/1003.js +1 -1
- package/.next/server/chunks/1649.js +1 -1
- package/.next/server/chunks/1751.js +1 -1
- package/.next/server/chunks/2143.js +1 -1
- package/.next/server/chunks/2151.js +1 -1
- package/.next/server/chunks/2282.js +3 -3
- package/.next/server/chunks/2531.js +1 -1
- package/.next/server/chunks/2801.js +1 -1
- package/.next/server/chunks/3671.js +1 -1
- package/.next/server/chunks/6343.js +3 -3
- package/.next/server/chunks/6617.js +1 -1
- package/.next/server/chunks/7591.js +1 -1
- package/.next/server/chunks/7904.js +1 -1
- 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/1660-084df607ff4f889d.js +1 -0
- package/.next/static/chunks/{6770-e2921b2ce695ed57.js → 6770-9e948c92e87956c4.js} +1 -1
- package/CHANGELOG.md +11 -0
- package/open-sse/config/opencodeGo.js +3 -2
- package/open-sse/executors/opencode-go.js +7 -0
- package/open-sse/executors/opencode.js +20 -0
- package/open-sse/handlers/chatCore.js +7 -14
- package/open-sse/providers/capabilities.js +30 -0
- package/open-sse/providers/models/helpers.js +14 -0
- package/open-sse/providers/registry/opencode-go.js +116 -31
- package/open-sse/services/lazyRuntime.js +110 -0
- package/open-sse/services/opencodeTlsClient.js +91 -0
- package/open-sse/services/provider.js +27 -0
- package/open-sse/utils/writableDataDir.js +32 -0
- package/package.json +1 -1
- package/.next/static/chunks/1660-c4c1cfa3cb7c9b2e.js +0 -1
- /package/.next/static/{EsP8l_VAPRRfBiiJPJqQe → PyHCF87rmgiD0pV5fDUOP}/_buildManifest.js +0 -0
- /package/.next/static/{EsP8l_VAPRRfBiiJPJqQe → PyHCF87rmgiD0pV5fDUOP}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=9839,a.ids=[9839],a.modules={643:a=>{"use strict";a.exports=require("node:perf_hooks")},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")},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},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")},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},42895:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>w,handler:()=>y,routeModule:()=>x});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={children:["",{children:["(dashboard)",{children:["dashboard",{children:["token-saver",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,97903))),"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/token-saver/page.tsx"]}]},{"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,v=(0,e.H)({tree:u,page:"/(dashboard)/dashboard/token-saver/page",pathname:"/dashboard/token-saver",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),w=v.__next_app__,x=v.routeModule,y=v.handler},45940:(a,b,c)=>{Promise.resolve().then(c.bind(c,88197))},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")},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},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")},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")},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")},78474:a=>{"use strict";a.exports=require("node:events")},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")},85181:(a,b,c)=>{"use strict";c.d(b,{default:()=>t});var d=c(86240),e=c(70433),f=c(69512),g=c(4271),h=c(63265),i=c(81501),j=c(70369),k=c(63998),l=c(31952),m=c(67209),n=c(57145);c(27720);let o=["zh-CN","zh-TW"],p=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],q=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}];function r({title:a,titleLink:b,titleLinkLabel:c,desc:e,children:f}){return(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 py-4",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:"font-medium",children:[a," ",b&&(0,d.jsxs)("a",{href:b,target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:["(",c,")"]})]}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:e})]}),(0,d.jsx)("div",{className:"flex shrink-0 items-center gap-3",children:f})]})}function s({levels:a,value:b,onPick:c}){return(0,d.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,d.jsx)("div",{className:"flex items-center gap-1.5",children:a.map(a=>(0,d.jsxs)(l.m_,{children:[(0,d.jsx)(l.k$,{asChild:!0,children:(0,d.jsx)(h.$,{size:"sm",variant:b===a.id?"default":"ghost",onClick:()=>c(a.id),children:a.label})}),a.desc?(0,d.jsx)(l.ZI,{children:a.desc}):null]},a.id))}),(0,d.jsx)("p",{className:"text-xs text-primary",children:a.find(a=>a.id===b)?.desc})]})}function t(){let[a,b]=(0,e.useState)(!0),[c,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)("http://localhost:8787"),[w,x]=(0,e.useState)(3e3),[y,z]=(0,e.useState)({installed:!1,running:!1,python:null,loading:!0}),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),[I,J]=(0,e.useState)([]),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)(""),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(""),[S,T]=(0,e.useState)(null),[U,V]=(0,e.useState)(!1),[W,X]=(0,e.useState)(!0),[Y,Z]=(0,e.useState)(!1),$=(0,e.useRef)(null),[_,aa]=(0,e.useState)(!1),[ab,ac]=(0,e.useState)("full"),[ad,ae]=(0,e.useState)(!1),[af,ag]=(0,e.useState)("full"),[ah,ai]=(0,e.useState)(!1),[aj,ak]=(0,e.useState)(25e3),[al,am]=(0,e.useState)({installed:!1,installing:!1,running:!1,version:null,loading:!0}),[an,ao]=(0,e.useState)(null),[ap,aq]=(0,e.useState)(!1),[ar,as]=(0,e.useState)(!1),[at,au]=(0,e.useState)(""),[av,aw]=(0,e.useState)("en"),{copied:ax,copy:ay}=(0,n.C)(),az=o.includes(av)?p:p.filter(a=>!a.wenyan),aA=async a=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch(a){console.log("Error updating setting:",a)}},aB=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:a})})).ok&&b(a)}catch(a){console.log("Error updating rtkEnabled:",a)}},aC=async()=>{let a=u.trim()||"http://localhost:8787";v(a),await aA({headroomUrl:a}),aD()},aD=(0,e.useCallback)(async()=>{z(a=>({...a,loading:!0}));try{let a=await fetch("/api/headroom/status",{headers:{"Cache-Control":"no-store"}}),b=await a.json();if(z({...b,loading:!1}),!b?.installed){H({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),J([]);return}try{let a=await fetch("/api/headroom/extras",{headers:{"Cache-Control":"no-store"}});if(!a.ok)throw Error("extras status failed");let b=await a.json();H(a=>({...a,version:b.version??null,extras:b.extras||{code:!1,ml:!1},available:b.available||["code","ml"],loading:!1})),J([])}catch{H({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),J([])}}catch{z({installed:!1,running:!1,python:null,loading:!1}),H({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),J([])}},[]),aE=(0,e.useCallback)(async()=>{F(""),D(!0);try{let a=await fetch("/api/headroom/start",{method:"POST"}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Failed to start proxy");await aD()}catch(a){F(a.message)}finally{D(!1)}},[aD]),aF=(0,e.useCallback)(async()=>{D(!0);try{await fetch("/api/headroom/stop",{method:"POST"}),await aD()}finally{D(!1)}},[aD]),aG=(0,e.useCallback)(()=>{R(""),$.current&&clearInterval($.current);let a=async()=>{try{let a=await fetch("/api/headroom/extras?log=1",{headers:{"Cache-Control":"no-store"}}),b=await a.json().catch(()=>({}));"string"==typeof b.log&&R(b.log)}catch{}};a(),$.current=setInterval(a,1500)},[]),aH=(0,e.useCallback)(()=>{$.current&&(clearInterval($.current),$.current=null)},[]),aI=(0,e.useCallback)(async()=>{if(0!==I.length){L(!0),N(""),aG();try{let a=await fetch("/api/headroom/extras",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:I})}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Install failed");H(a=>({...a,version:b.version??a.version,extras:b.extras||a.extras})),J([])}catch(a){N(a.message)}finally{aH(),L(!1)}}},[I,aG,aH]),aJ=(0,e.useCallback)(async a=>{P(a),N(""),aG();try{let b=await fetch("/api/headroom/extras",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:[a]})}),c=await b.json().catch(()=>({}));if(!b.ok)throw Error(c.error||"Remove failed");H(a=>({...a,version:c.version??a.version,extras:c.extras||a.extras}))}catch(a){N(a.message)}finally{aH(),P(null)}},[aG,aH]),aK=(0,e.useCallback)(()=>{if(0!==I.length){if(I.includes("ml"))return void T({title:"Install [ml]",message:"[ml] downloads ~1 GB (torch + huggingface-hub). Continue?",confirmText:"Install",variant:"default",onConfirm:aI});aI()}},[I,aI]),aL=(0,e.useCallback)(a=>{T({title:`Remove [${a}]`,message:`Remove [${a}] and its packages?`,confirmText:"Remove",variant:"destructive",onConfirm:()=>aJ(a)})},[aJ]),aM=(0,e.useCallback)(async(a,b)=>{if(N(""),"code"===a&&V(b),"ml"===a&&X(b),await aA({["code"===a?"headroomCodeAware":"headroomKompress"]:b}),y.running){Z(!0);try{let a=await fetch("/api/headroom/restart",{method:"POST"}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Restart failed");await aD()}catch(a){N(a.message)}finally{Z(!1)}}},[y.running,aD]),aN=(0,e.useCallback)(async()=>{am(a=>({...a,loading:!0}));try{let a=await fetch("/api/pxpipe/status",{headers:{"Cache-Control":"no-store"}}),b=await a.json();am({...b,loading:!1}),"number"==typeof b.minChars&&ak(b.minChars)}catch{am({installed:!1,installing:!1,running:!1,version:null,loading:!1})}},[]),aO=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/pxpipe/health",{method:"POST"});ao(await a.json())}catch(a){ao({healthy:!1,checks:[],error:a.message})}},[]),aP=(0,e.useCallback)(async a=>{au(""),as(!0);try{let b=await fetch(`/api/pxpipe/${a}`,{method:"POST"}),c=await b.json().catch(()=>({}));if(!b.ok)throw Error(c.error||`PXPIPE ${a} failed`);await aN(),await aO()}catch(a){au(a.message)}finally{as(!1)}},[aN,aO]),aQ=!!y.running,aR=y.loading?"Checking…":aQ?"Running":!1===y.localUrl||y.installed?!1!==y.localUrl?"Stopped":"External":"Not installed",aS=!1!==y.localUrl,aT=!!y.canStart,aU=aS&&!!y.managedPid,aV=an?.healthy===!0,aW=al.loading?"Checking…":al.installing?"Installing…":al.installed?aV?"Healthy":al.running?"Running":"Stopped":"Not installed";return(0,d.jsxs)("div",{className:"space-y-6 p-6",children:[(0,d.jsxs)(g.Zp,{children:[(0,d.jsx)(g.aR,{children:(0,d.jsxs)(g.ZB,{className:"flex items-center gap-2 text-lg",children:[(0,d.jsx)(f.A,{className:"text-primary"}),"Token Saver"]})}),(0,d.jsxs)(g.Wu,{children:[(0,d.jsx)(r,{title:"Compress tool output",titleLink:"https://github.com/rtk-ai/rtk",titleLinkLabel:"RTK",desc:"git/grep/ls/tree/logs → 60-90% fewer input tokens",children:(0,d.jsx)(j.d,{checked:a,onCheckedChange:()=>aB(!a)})}),(0,d.jsxs)("div",{className:"border-t border-border",children:[(0,d.jsxs)(r,{title:"Compress context",titleLink:"https://github.com/chopratejas/headroom",titleLinkLabel:"Headroom",desc:"Compress prompts via /v1/compress before routing to the model",children:[(0,d.jsx)("span",{className:`rounded px-2 py-0.5 text-xs ${aQ?"bg-emerald-500/15 text-emerald-600":"bg-amber-500/15 text-amber-600"}`,children:aR}),(0,d.jsx)(h.$,{type:"button",variant:"link",size:"sm",onClick:()=>B(!0),className:"h-auto px-0 text-xs",children:aQ?"Manage":"Setup"}),(0,d.jsx)(j.d,{checked:c,onCheckedChange:()=>{var a;let b;return a=!c,void(v(b=u.trim()||"http://localhost:8787"),t(a),aA({headroomEnabled:a,headroomUrl:b}))}})]}),y.installed&&(0,d.jsxs)("div",{className:"mb-3 ml-1 border-l-2 border-border pb-4 pl-3",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Compression extras",G.version?` \xb7 v${G.version}`:"",":"]}),G.available.map(a=>{let b=!!G.extras[a],c=I.includes(a),e="code"===a?"tree-sitter AST compression for code responses":"Kompress-v2 HF model for prose/agentic traces (~+1GB)";if(b){let b="code"===a?U:W;return(0,d.jsxs)(l.m_,{children:[(0,d.jsx)(l.k$,{asChild:!0,children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5 rounded border border-emerald-500/40 bg-emerald-500/5 px-2 py-1 text-xs text-foreground",children:[(0,d.jsx)(j.d,{checked:b,disabled:Y,onCheckedChange:()=>aM(a,!b),size:"sm"}),(0,d.jsxs)("span",{className:"font-medium",children:["[",a,"]"]}),(0,d.jsx)(h.$,{type:"button",variant:"link",size:"sm",onClick:()=>aL(a),disabled:O===a,className:"h-auto px-0 text-xs text-destructive",children:O===a?"Uninstalling…":"Uninstall"})]})}),(0,d.jsx)(l.ZI,{children:e})]},a)}return(0,d.jsxs)(l.m_,{children:[(0,d.jsx)(l.k$,{asChild:!0,children:(0,d.jsxs)("label",{className:`flex cursor-pointer items-center gap-1.5 rounded border px-2 py-1 text-xs transition-colors ${c?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:bg-muted"}`,children:[(0,d.jsx)(k.S,{className:"size-3 [&_svg]:size-2",checked:c,onCheckedChange:()=>{J(b=>b.includes(a)?b.filter(b=>b!==a):[...b,a])}}),(0,d.jsxs)("span",{className:"font-medium",children:["[",a,"]"]}),(0,d.jsx)("span",{className:"opacity-70",children:"not installed"})]})}),(0,d.jsx)(l.ZI,{children:e})]},a)}),I.length>0&&(0,d.jsx)(h.$,{size:"sm",onClick:aK,disabled:K,children:K?"Installing…":`Install [proxy,${I.join(",")}]`})]}),M&&(0,d.jsx)("p",{className:"mt-1 text-xs text-destructive",children:M}),Y&&(0,d.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Restarting proxy…"}),(K||O)&&Q&&(0,d.jsx)("pre",{className:"mt-2 max-h-32 overflow-auto rounded bg-muted p-2 text-[10px] leading-tight whitespace-pre-wrap text-muted-foreground",children:Q}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:["Installing adds the package; use ",(0,d.jsx)("code",{children:"on"}),"/",(0,d.jsx)("code",{children:"off"})," to activate it (restarts the proxy). Default install is ",(0,d.jsx)("code",{children:"[proxy]"})," only (SmartCrusher for JSON). Adding ",(0,d.jsx)("code",{children:"[code]"})," enables AST compression (Python/JS/TS/Go/Rust/Java/C/C++/Perl). Adding ",(0,d.jsx)("code",{children:"[ml]"})," enables the Kompress-v2 HF model for prose/agentic traces but adds ~1 GB (torch + huggingface-hub)."]})]})]}),(0,d.jsx)("div",{className:"border-t border-border",children:(0,d.jsxs)(r,{title:"Compress LLM output",titleLink:"https://github.com/JuliusBrussee/caveman",titleLinkLabel:"Caveman",desc:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)",children:[_&&(0,d.jsx)(s,{levels:az,value:ab,onPick:a=>{ac(a),aA({cavemanLevel:a})}}),(0,d.jsx)(j.d,{checked:_,onCheckedChange:()=>{var a;aa(a=!_),aA({cavemanEnabled:a})}})]})}),(0,d.jsx)("div",{className:"border-t border-border",children:(0,d.jsxs)(r,{title:"Lazy senior dev",titleLink:"https://github.com/DietrichGebert/ponytail",titleLinkLabel:"Ponytail",desc:"Bias the model toward minimal code: YAGNI, reuse stdlib, deletion over addition",children:[ad&&(0,d.jsx)(s,{levels:q,value:af,onPick:a=>{ag(a),aA({ponytailLevel:a})}}),(0,d.jsx)(j.d,{checked:ad,onCheckedChange:()=>{var a;ae(a=!ad),aA({ponytailEnabled:a})}})]})}),!1]})]}),(0,d.jsx)(m.lG,{open:A,onOpenChange:B,children:(0,d.jsxs)(m.Cf,{className:"max-w-md",children:[(0,d.jsx)(m.c7,{children:(0,d.jsx)(m.L3,{children:aQ?"Headroom":"Setup Headroom"})}),(0,d.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,d.jsx)("span",{children:"Status"}),(0,d.jsx)("span",{className:aQ?"text-emerald-600":"text-amber-600",children:aR})]}),aQ&&(0,d.jsx)("a",{href:"/api/headroom/proxy/dashboard",target:"_blank",rel:"noreferrer",className:"w-full rounded border border-border px-4 py-2 text-center text-sm hover:bg-muted",children:"Open Headroom Dashboard"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Proxy URL"}),(0,d.jsx)(i.p,{value:u,onChange:a=>v(a.target.value),onBlur:aC,placeholder:"http://localhost:8787",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Use a local proxy for Start/Stop, or an external Docker sidecar like http://headroom:8787."})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Timeout (ms)"}),(0,d.jsx)(i.p,{value:String(w),onChange:a=>x(a.target.value),onBlur:()=>{let a=Math.round(Number(w)),b=Number.isFinite(a)&&a>0?a:3e3;x(b),aA({headroomTimeoutMs:b})},placeholder:"3000",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Request timeout in milliseconds. Defaults to 3000 ms."})]}),aU?(0,d.jsx)(h.$,{onClick:aF,variant:"ghost",className:"w-full",disabled:C,children:C?"Stopping…":"Stop Headroom"}):aQ?(0,d.jsx)("p",{className:"text-sm text-emerald-600",children:"Headroom proxy is reachable. You can enable the token saver."}):aT?(0,d.jsx)(h.$,{onClick:aE,className:"w-full",disabled:C,children:C?"Starting…":"Start Headroom"}):aS?y.python?(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Install then click Start:"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("pre",{className:"flex-1 overflow-x-auto rounded bg-black/5 p-2 font-mono text-xs dark:bg-white/5",children:'pip install "headroom-ai[proxy]"'}),(0,d.jsx)(h.$,{size:"sm",variant:"ghost",onClick:()=>ay('pip install "headroom-ai[proxy]"'),children:ax?"Copied":"Copy"})]})]}):(0,d.jsx)("p",{className:"text-sm text-amber-600",children:"Python ≥ 3.10 required for local managed mode. Install Python first, or use an external proxy URL."}):(0,d.jsx)("p",{className:"text-sm text-amber-600",children:"Start Headroom separately at the configured URL, then recheck."}),E&&(0,d.jsx)("p",{className:"text-sm text-amber-600",children:E})]}),(0,d.jsxs)(m.Es,{children:[(0,d.jsx)(h.$,{onClick:()=>aD(),variant:"ghost",className:"w-full",children:"Recheck"}),(0,d.jsx)(h.$,{onClick:()=>B(!1),className:"w-full",children:"Done"})]})]})}),(0,d.jsx)(m.lG,{open:ap,onOpenChange:aq,children:(0,d.jsxs)(m.Cf,{className:"max-w-md",children:[(0,d.jsx)(m.c7,{children:(0,d.jsx)(m.L3,{children:al.installed?"PXPIPE":"Setup PXPIPE"})}),(0,d.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Compress prompts using multimodal encoding. Runs in-process — no extra server or environment variables required."}),(0,d.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,d.jsx)("span",{children:"Status"}),(0,d.jsxs)("span",{className:aV||al.running?"text-emerald-600":"text-amber-600",children:[aW,al.version?` \xb7 v${al.version}`:""]})]}),(an?.checks?.length??0)>0&&(0,d.jsxs)("div",{className:"flex flex-col gap-1 rounded border border-border p-3",children:[(0,d.jsx)("p",{className:"mb-1 text-sm font-medium",children:"Health check"}),an.checks.map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,d.jsxs)("span",{className:a.ok?"text-emerald-600":"text-amber-600",children:[a.ok?"●":"○"," ",a.label]}),a.detail&&(0,d.jsx)("span",{className:"max-w-[50%] truncate font-mono text-muted-foreground",children:a.detail})]},a.id)),an.error&&(0,d.jsx)("p",{className:"mt-1 text-xs text-amber-600",children:an.error})]}),al.installed?(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[al.running?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.$,{onClick:()=>aP("restart"),variant:"ghost",disabled:ar,children:"Restart"}),(0,d.jsx)(h.$,{onClick:()=>aP("stop"),variant:"ghost",disabled:ar,children:"Stop"})]}):(0,d.jsx)(h.$,{onClick:()=>aP("start"),disabled:ar,children:ar?"Starting…":"Start"}),(0,d.jsx)(h.$,{onClick:()=>aP("install"),variant:"ghost",disabled:ar,children:"Repair"}),(0,d.jsx)("a",{href:"/dashboard/pxpipe#logs",className:"col-span-2 rounded border border-border px-4 py-2 text-center text-sm hover:bg-muted",children:"Open Logs"})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("p",{className:"text-sm text-amber-600",children:"PXPIPE is not installed."}),(0,d.jsx)(h.$,{onClick:()=>aP("install"),className:"w-full",disabled:ar||al.installing,children:ar||al.installing?"Installing…":"Install"}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Installs the npm package ",(0,d.jsx)("code",{className:"font-mono",children:"pxpipe-proxy"})," into the 10Router data directory. May take a few minutes."]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Minimum prompt size (chars)"}),(0,d.jsx)(i.p,{value:String(aj),onChange:a=>ak(a.target.value),onBlur:()=>{let a=Math.max(0,Number(aj)||25e3);ak(a),aA({pxpipeMinChars:a})},placeholder:"25000",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Requests smaller than this bypass PXPIPE and are sent as-is."})]}),at&&(0,d.jsx)("p",{className:"text-sm text-amber-600",children:at})]}),(0,d.jsxs)(m.Es,{children:[(0,d.jsx)(h.$,{onClick:()=>aN().then(aO),variant:"ghost",className:"w-full",children:"Recheck"}),(0,d.jsx)(h.$,{onClick:()=>aq(!1),className:"w-full",children:"Done"})]})]})}),(0,d.jsx)(m.lG,{open:!!S,onOpenChange:a=>!a&&T(null),children:(0,d.jsxs)(m.Cf,{className:"max-w-sm",children:[(0,d.jsx)(m.c7,{children:(0,d.jsx)(m.L3,{children:S?.title??"Confirm"})}),(0,d.jsx)("div",{className:"p-4",children:(0,d.jsx)(m.rr,{children:S?.message})}),(0,d.jsxs)(m.Es,{children:[(0,d.jsx)(m.HM,{asChild:!0,children:(0,d.jsx)(h.$,{variant:"ghost",children:"Cancel"})}),(0,d.jsx)(h.$,{variant:S?.variant==="destructive"?"destructive":"default",onClick:()=>{let a=S?.onConfirm;T(null),a?.()},children:S?.confirmText??"Confirm"})]})]})})]})}},87997:a=>{"use strict";a.exports=require("node:timers")},88197:(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/token-saver/TokenSaverClient.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/token-saver/TokenSaverClient.tsx","default")},91645:a=>{"use strict";a.exports=require("net")},94735:a=>{"use strict";a.exports=require("events")},97903:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(25966),e=c(88197);function f(){return(0,d.jsx)(e.default,{})}},98676:(a,b,c)=>{Promise.resolve().then(c.bind(c,85181))}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[1316,1238,7963,8569,7257,6009,9817,7535,1751,7156,2339,6461,4301,1649,9018,2801],()=>b(b.s=42895));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=9839,a.ids=[9839],a.modules={643:a=>{"use strict";a.exports=require("node:perf_hooks")},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")},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},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")},31421:a=>{"use strict";a.exports=require("node:child_process")},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")},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},42895:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>w,handler:()=>y,routeModule:()=>x});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={children:["",{children:["(dashboard)",{children:["dashboard",{children:["token-saver",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,97903))),"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/token-saver/page.tsx"]}]},{"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,v=(0,e.H)({tree:u,page:"/(dashboard)/dashboard/token-saver/page",pathname:"/dashboard/token-saver",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),w=v.__next_app__,x=v.routeModule,y=v.handler},45940:(a,b,c)=>{Promise.resolve().then(c.bind(c,88197))},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")},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},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")},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")},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")},78474:a=>{"use strict";a.exports=require("node:events")},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")},85181:(a,b,c)=>{"use strict";c.d(b,{default:()=>t});var d=c(86240),e=c(70433),f=c(69512),g=c(4271),h=c(63265),i=c(81501),j=c(70369),k=c(63998),l=c(31952),m=c(67209),n=c(57145);c(27720);let o=["zh-CN","zh-TW"],p=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],q=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}];function r({title:a,titleLink:b,titleLinkLabel:c,desc:e,children:f}){return(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 py-4",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:"font-medium",children:[a," ",b&&(0,d.jsxs)("a",{href:b,target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:["(",c,")"]})]}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:e})]}),(0,d.jsx)("div",{className:"flex shrink-0 items-center gap-3",children:f})]})}function s({levels:a,value:b,onPick:c}){return(0,d.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,d.jsx)("div",{className:"flex items-center gap-1.5",children:a.map(a=>(0,d.jsxs)(l.m_,{children:[(0,d.jsx)(l.k$,{asChild:!0,children:(0,d.jsx)(h.$,{size:"sm",variant:b===a.id?"default":"ghost",onClick:()=>c(a.id),children:a.label})}),a.desc?(0,d.jsx)(l.ZI,{children:a.desc}):null]},a.id))}),(0,d.jsx)("p",{className:"text-xs text-primary",children:a.find(a=>a.id===b)?.desc})]})}function t(){let[a,b]=(0,e.useState)(!0),[c,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)("http://localhost:8787"),[w,x]=(0,e.useState)(3e3),[y,z]=(0,e.useState)({installed:!1,running:!1,python:null,loading:!0}),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),[I,J]=(0,e.useState)([]),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)(""),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(""),[S,T]=(0,e.useState)(null),[U,V]=(0,e.useState)(!1),[W,X]=(0,e.useState)(!0),[Y,Z]=(0,e.useState)(!1),$=(0,e.useRef)(null),[_,aa]=(0,e.useState)(!1),[ab,ac]=(0,e.useState)("full"),[ad,ae]=(0,e.useState)(!1),[af,ag]=(0,e.useState)("full"),[ah,ai]=(0,e.useState)(!1),[aj,ak]=(0,e.useState)(25e3),[al,am]=(0,e.useState)({installed:!1,installing:!1,running:!1,version:null,loading:!0}),[an,ao]=(0,e.useState)(null),[ap,aq]=(0,e.useState)(!1),[ar,as]=(0,e.useState)(!1),[at,au]=(0,e.useState)(""),[av,aw]=(0,e.useState)("en"),{copied:ax,copy:ay}=(0,n.C)(),az=o.includes(av)?p:p.filter(a=>!a.wenyan),aA=async a=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch(a){console.log("Error updating setting:",a)}},aB=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:a})})).ok&&b(a)}catch(a){console.log("Error updating rtkEnabled:",a)}},aC=async()=>{let a=u.trim()||"http://localhost:8787";v(a),await aA({headroomUrl:a}),aD()},aD=(0,e.useCallback)(async()=>{z(a=>({...a,loading:!0}));try{let a=await fetch("/api/headroom/status",{headers:{"Cache-Control":"no-store"}}),b=await a.json();if(z({...b,loading:!1}),!b?.installed){H({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),J([]);return}try{let a=await fetch("/api/headroom/extras",{headers:{"Cache-Control":"no-store"}});if(!a.ok)throw Error("extras status failed");let b=await a.json();H(a=>({...a,version:b.version??null,extras:b.extras||{code:!1,ml:!1},available:b.available||["code","ml"],loading:!1})),J([])}catch{H({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),J([])}}catch{z({installed:!1,running:!1,python:null,loading:!1}),H({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),J([])}},[]),aE=(0,e.useCallback)(async()=>{F(""),D(!0);try{let a=await fetch("/api/headroom/start",{method:"POST"}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Failed to start proxy");await aD()}catch(a){F(a.message)}finally{D(!1)}},[aD]),aF=(0,e.useCallback)(async()=>{D(!0);try{await fetch("/api/headroom/stop",{method:"POST"}),await aD()}finally{D(!1)}},[aD]),aG=(0,e.useCallback)(()=>{R(""),$.current&&clearInterval($.current);let a=async()=>{try{let a=await fetch("/api/headroom/extras?log=1",{headers:{"Cache-Control":"no-store"}}),b=await a.json().catch(()=>({}));"string"==typeof b.log&&R(b.log)}catch{}};a(),$.current=setInterval(a,1500)},[]),aH=(0,e.useCallback)(()=>{$.current&&(clearInterval($.current),$.current=null)},[]),aI=(0,e.useCallback)(async()=>{if(0!==I.length){L(!0),N(""),aG();try{let a=await fetch("/api/headroom/extras",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:I})}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Install failed");H(a=>({...a,version:b.version??a.version,extras:b.extras||a.extras})),J([])}catch(a){N(a.message)}finally{aH(),L(!1)}}},[I,aG,aH]),aJ=(0,e.useCallback)(async a=>{P(a),N(""),aG();try{let b=await fetch("/api/headroom/extras",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:[a]})}),c=await b.json().catch(()=>({}));if(!b.ok)throw Error(c.error||"Remove failed");H(a=>({...a,version:c.version??a.version,extras:c.extras||a.extras}))}catch(a){N(a.message)}finally{aH(),P(null)}},[aG,aH]),aK=(0,e.useCallback)(()=>{if(0!==I.length){if(I.includes("ml"))return void T({title:"Install [ml]",message:"[ml] downloads ~1 GB (torch + huggingface-hub). Continue?",confirmText:"Install",variant:"default",onConfirm:aI});aI()}},[I,aI]),aL=(0,e.useCallback)(a=>{T({title:`Remove [${a}]`,message:`Remove [${a}] and its packages?`,confirmText:"Remove",variant:"destructive",onConfirm:()=>aJ(a)})},[aJ]),aM=(0,e.useCallback)(async(a,b)=>{if(N(""),"code"===a&&V(b),"ml"===a&&X(b),await aA({["code"===a?"headroomCodeAware":"headroomKompress"]:b}),y.running){Z(!0);try{let a=await fetch("/api/headroom/restart",{method:"POST"}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Restart failed");await aD()}catch(a){N(a.message)}finally{Z(!1)}}},[y.running,aD]),aN=(0,e.useCallback)(async()=>{am(a=>({...a,loading:!0}));try{let a=await fetch("/api/pxpipe/status",{headers:{"Cache-Control":"no-store"}}),b=await a.json();am({...b,loading:!1}),"number"==typeof b.minChars&&ak(b.minChars)}catch{am({installed:!1,installing:!1,running:!1,version:null,loading:!1})}},[]),aO=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/pxpipe/health",{method:"POST"});ao(await a.json())}catch(a){ao({healthy:!1,checks:[],error:a.message})}},[]),aP=(0,e.useCallback)(async a=>{au(""),as(!0);try{let b=await fetch(`/api/pxpipe/${a}`,{method:"POST"}),c=await b.json().catch(()=>({}));if(!b.ok)throw Error(c.error||`PXPIPE ${a} failed`);await aN(),await aO()}catch(a){au(a.message)}finally{as(!1)}},[aN,aO]),aQ=!!y.running,aR=y.loading?"Checking…":aQ?"Running":!1===y.localUrl||y.installed?!1!==y.localUrl?"Stopped":"External":"Not installed",aS=!1!==y.localUrl,aT=!!y.canStart,aU=aS&&!!y.managedPid,aV=an?.healthy===!0,aW=al.loading?"Checking…":al.installing?"Installing…":al.installed?aV?"Healthy":al.running?"Running":"Stopped":"Not installed";return(0,d.jsxs)("div",{className:"space-y-6 p-6",children:[(0,d.jsxs)(g.Zp,{children:[(0,d.jsx)(g.aR,{children:(0,d.jsxs)(g.ZB,{className:"flex items-center gap-2 text-lg",children:[(0,d.jsx)(f.A,{className:"text-primary"}),"Token Saver"]})}),(0,d.jsxs)(g.Wu,{children:[(0,d.jsx)(r,{title:"Compress tool output",titleLink:"https://github.com/rtk-ai/rtk",titleLinkLabel:"RTK",desc:"git/grep/ls/tree/logs → 60-90% fewer input tokens",children:(0,d.jsx)(j.d,{checked:a,onCheckedChange:()=>aB(!a)})}),(0,d.jsxs)("div",{className:"border-t border-border",children:[(0,d.jsxs)(r,{title:"Compress context",titleLink:"https://github.com/chopratejas/headroom",titleLinkLabel:"Headroom",desc:"Compress prompts via /v1/compress before routing to the model",children:[(0,d.jsx)("span",{className:`rounded px-2 py-0.5 text-xs ${aQ?"bg-emerald-500/15 text-emerald-600":"bg-amber-500/15 text-amber-600"}`,children:aR}),(0,d.jsx)(h.$,{type:"button",variant:"link",size:"sm",onClick:()=>B(!0),className:"h-auto px-0 text-xs",children:aQ?"Manage":"Setup"}),(0,d.jsx)(j.d,{checked:c,onCheckedChange:()=>{var a;let b;return a=!c,void(v(b=u.trim()||"http://localhost:8787"),t(a),aA({headroomEnabled:a,headroomUrl:b}))}})]}),y.installed&&(0,d.jsxs)("div",{className:"mb-3 ml-1 border-l-2 border-border pb-4 pl-3",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Compression extras",G.version?` \xb7 v${G.version}`:"",":"]}),G.available.map(a=>{let b=!!G.extras[a],c=I.includes(a),e="code"===a?"tree-sitter AST compression for code responses":"Kompress-v2 HF model for prose/agentic traces (~+1GB)";if(b){let b="code"===a?U:W;return(0,d.jsxs)(l.m_,{children:[(0,d.jsx)(l.k$,{asChild:!0,children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5 rounded border border-emerald-500/40 bg-emerald-500/5 px-2 py-1 text-xs text-foreground",children:[(0,d.jsx)(j.d,{checked:b,disabled:Y,onCheckedChange:()=>aM(a,!b),size:"sm"}),(0,d.jsxs)("span",{className:"font-medium",children:["[",a,"]"]}),(0,d.jsx)(h.$,{type:"button",variant:"link",size:"sm",onClick:()=>aL(a),disabled:O===a,className:"h-auto px-0 text-xs text-destructive",children:O===a?"Uninstalling…":"Uninstall"})]})}),(0,d.jsx)(l.ZI,{children:e})]},a)}return(0,d.jsxs)(l.m_,{children:[(0,d.jsx)(l.k$,{asChild:!0,children:(0,d.jsxs)("label",{className:`flex cursor-pointer items-center gap-1.5 rounded border px-2 py-1 text-xs transition-colors ${c?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:bg-muted"}`,children:[(0,d.jsx)(k.S,{className:"size-3 [&_svg]:size-2",checked:c,onCheckedChange:()=>{J(b=>b.includes(a)?b.filter(b=>b!==a):[...b,a])}}),(0,d.jsxs)("span",{className:"font-medium",children:["[",a,"]"]}),(0,d.jsx)("span",{className:"opacity-70",children:"not installed"})]})}),(0,d.jsx)(l.ZI,{children:e})]},a)}),I.length>0&&(0,d.jsx)(h.$,{size:"sm",onClick:aK,disabled:K,children:K?"Installing…":`Install [proxy,${I.join(",")}]`})]}),M&&(0,d.jsx)("p",{className:"mt-1 text-xs text-destructive",children:M}),Y&&(0,d.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Restarting proxy…"}),(K||O)&&Q&&(0,d.jsx)("pre",{className:"mt-2 max-h-32 overflow-auto rounded bg-muted p-2 text-[10px] leading-tight whitespace-pre-wrap text-muted-foreground",children:Q}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:["Installing adds the package; use ",(0,d.jsx)("code",{children:"on"}),"/",(0,d.jsx)("code",{children:"off"})," to activate it (restarts the proxy). Default install is ",(0,d.jsx)("code",{children:"[proxy]"})," only (SmartCrusher for JSON). Adding ",(0,d.jsx)("code",{children:"[code]"})," enables AST compression (Python/JS/TS/Go/Rust/Java/C/C++/Perl). Adding ",(0,d.jsx)("code",{children:"[ml]"})," enables the Kompress-v2 HF model for prose/agentic traces but adds ~1 GB (torch + huggingface-hub)."]})]})]}),(0,d.jsx)("div",{className:"border-t border-border",children:(0,d.jsxs)(r,{title:"Compress LLM output",titleLink:"https://github.com/JuliusBrussee/caveman",titleLinkLabel:"Caveman",desc:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)",children:[_&&(0,d.jsx)(s,{levels:az,value:ab,onPick:a=>{ac(a),aA({cavemanLevel:a})}}),(0,d.jsx)(j.d,{checked:_,onCheckedChange:()=>{var a;aa(a=!_),aA({cavemanEnabled:a})}})]})}),(0,d.jsx)("div",{className:"border-t border-border",children:(0,d.jsxs)(r,{title:"Lazy senior dev",titleLink:"https://github.com/DietrichGebert/ponytail",titleLinkLabel:"Ponytail",desc:"Bias the model toward minimal code: YAGNI, reuse stdlib, deletion over addition",children:[ad&&(0,d.jsx)(s,{levels:q,value:af,onPick:a=>{ag(a),aA({ponytailLevel:a})}}),(0,d.jsx)(j.d,{checked:ad,onCheckedChange:()=>{var a;ae(a=!ad),aA({ponytailEnabled:a})}})]})}),!1]})]}),(0,d.jsx)(m.lG,{open:A,onOpenChange:B,children:(0,d.jsxs)(m.Cf,{className:"max-w-md",children:[(0,d.jsx)(m.c7,{children:(0,d.jsx)(m.L3,{children:aQ?"Headroom":"Setup Headroom"})}),(0,d.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,d.jsx)("span",{children:"Status"}),(0,d.jsx)("span",{className:aQ?"text-emerald-600":"text-amber-600",children:aR})]}),aQ&&(0,d.jsx)("a",{href:"/api/headroom/proxy/dashboard",target:"_blank",rel:"noreferrer",className:"w-full rounded border border-border px-4 py-2 text-center text-sm hover:bg-muted",children:"Open Headroom Dashboard"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Proxy URL"}),(0,d.jsx)(i.p,{value:u,onChange:a=>v(a.target.value),onBlur:aC,placeholder:"http://localhost:8787",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Use a local proxy for Start/Stop, or an external Docker sidecar like http://headroom:8787."})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Timeout (ms)"}),(0,d.jsx)(i.p,{value:String(w),onChange:a=>x(a.target.value),onBlur:()=>{let a=Math.round(Number(w)),b=Number.isFinite(a)&&a>0?a:3e3;x(b),aA({headroomTimeoutMs:b})},placeholder:"3000",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Request timeout in milliseconds. Defaults to 3000 ms."})]}),aU?(0,d.jsx)(h.$,{onClick:aF,variant:"ghost",className:"w-full",disabled:C,children:C?"Stopping…":"Stop Headroom"}):aQ?(0,d.jsx)("p",{className:"text-sm text-emerald-600",children:"Headroom proxy is reachable. You can enable the token saver."}):aT?(0,d.jsx)(h.$,{onClick:aE,className:"w-full",disabled:C,children:C?"Starting…":"Start Headroom"}):aS?y.python?(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Install then click Start:"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("pre",{className:"flex-1 overflow-x-auto rounded bg-black/5 p-2 font-mono text-xs dark:bg-white/5",children:'pip install "headroom-ai[proxy]"'}),(0,d.jsx)(h.$,{size:"sm",variant:"ghost",onClick:()=>ay('pip install "headroom-ai[proxy]"'),children:ax?"Copied":"Copy"})]})]}):(0,d.jsx)("p",{className:"text-sm text-amber-600",children:"Python ≥ 3.10 required for local managed mode. Install Python first, or use an external proxy URL."}):(0,d.jsx)("p",{className:"text-sm text-amber-600",children:"Start Headroom separately at the configured URL, then recheck."}),E&&(0,d.jsx)("p",{className:"text-sm text-amber-600",children:E})]}),(0,d.jsxs)(m.Es,{children:[(0,d.jsx)(h.$,{onClick:()=>aD(),variant:"ghost",className:"w-full",children:"Recheck"}),(0,d.jsx)(h.$,{onClick:()=>B(!1),className:"w-full",children:"Done"})]})]})}),(0,d.jsx)(m.lG,{open:ap,onOpenChange:aq,children:(0,d.jsxs)(m.Cf,{className:"max-w-md",children:[(0,d.jsx)(m.c7,{children:(0,d.jsx)(m.L3,{children:al.installed?"PXPIPE":"Setup PXPIPE"})}),(0,d.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Compress prompts using multimodal encoding. Runs in-process — no extra server or environment variables required."}),(0,d.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,d.jsx)("span",{children:"Status"}),(0,d.jsxs)("span",{className:aV||al.running?"text-emerald-600":"text-amber-600",children:[aW,al.version?` \xb7 v${al.version}`:""]})]}),(an?.checks?.length??0)>0&&(0,d.jsxs)("div",{className:"flex flex-col gap-1 rounded border border-border p-3",children:[(0,d.jsx)("p",{className:"mb-1 text-sm font-medium",children:"Health check"}),an.checks.map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,d.jsxs)("span",{className:a.ok?"text-emerald-600":"text-amber-600",children:[a.ok?"●":"○"," ",a.label]}),a.detail&&(0,d.jsx)("span",{className:"max-w-[50%] truncate font-mono text-muted-foreground",children:a.detail})]},a.id)),an.error&&(0,d.jsx)("p",{className:"mt-1 text-xs text-amber-600",children:an.error})]}),al.installed?(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[al.running?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.$,{onClick:()=>aP("restart"),variant:"ghost",disabled:ar,children:"Restart"}),(0,d.jsx)(h.$,{onClick:()=>aP("stop"),variant:"ghost",disabled:ar,children:"Stop"})]}):(0,d.jsx)(h.$,{onClick:()=>aP("start"),disabled:ar,children:ar?"Starting…":"Start"}),(0,d.jsx)(h.$,{onClick:()=>aP("install"),variant:"ghost",disabled:ar,children:"Repair"}),(0,d.jsx)("a",{href:"/dashboard/pxpipe#logs",className:"col-span-2 rounded border border-border px-4 py-2 text-center text-sm hover:bg-muted",children:"Open Logs"})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("p",{className:"text-sm text-amber-600",children:"PXPIPE is not installed."}),(0,d.jsx)(h.$,{onClick:()=>aP("install"),className:"w-full",disabled:ar||al.installing,children:ar||al.installing?"Installing…":"Install"}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Installs the npm package ",(0,d.jsx)("code",{className:"font-mono",children:"pxpipe-proxy"})," into the 10Router data directory. May take a few minutes."]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Minimum prompt size (chars)"}),(0,d.jsx)(i.p,{value:String(aj),onChange:a=>ak(a.target.value),onBlur:()=>{let a=Math.max(0,Number(aj)||25e3);ak(a),aA({pxpipeMinChars:a})},placeholder:"25000",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Requests smaller than this bypass PXPIPE and are sent as-is."})]}),at&&(0,d.jsx)("p",{className:"text-sm text-amber-600",children:at})]}),(0,d.jsxs)(m.Es,{children:[(0,d.jsx)(h.$,{onClick:()=>aN().then(aO),variant:"ghost",className:"w-full",children:"Recheck"}),(0,d.jsx)(h.$,{onClick:()=>aq(!1),className:"w-full",children:"Done"})]})]})}),(0,d.jsx)(m.lG,{open:!!S,onOpenChange:a=>!a&&T(null),children:(0,d.jsxs)(m.Cf,{className:"max-w-sm",children:[(0,d.jsx)(m.c7,{children:(0,d.jsx)(m.L3,{children:S?.title??"Confirm"})}),(0,d.jsx)("div",{className:"p-4",children:(0,d.jsx)(m.rr,{children:S?.message})}),(0,d.jsxs)(m.Es,{children:[(0,d.jsx)(m.HM,{asChild:!0,children:(0,d.jsx)(h.$,{variant:"ghost",children:"Cancel"})}),(0,d.jsx)(h.$,{variant:S?.variant==="destructive"?"destructive":"default",onClick:()=>{let a=S?.onConfirm;T(null),a?.()},children:S?.confirmText??"Confirm"})]})]})})]})}},87997:a=>{"use strict";a.exports=require("node:timers")},88197:(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/token-saver/TokenSaverClient.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/token-saver/TokenSaverClient.tsx","default")},91645:a=>{"use strict";a.exports=require("net")},94735:a=>{"use strict";a.exports=require("events")},97903:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(25966),e=c(88197);function f(){return(0,d.jsx)(e.default,{})}},98676:(a,b,c)=>{Promise.resolve().then(c.bind(c,85181))}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[1316,1238,7963,8569,7257,6009,9817,7535,1751,7156,2339,6461,4301,1649,9018,2801],()=>b(b.s=42895));module.exports=c})();
|