@hilbras/omnihilbras 2.9.6 → 2.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +22 -22
- package/app/.next-cli-build/build-manifest.json +3 -3
- package/app/.next-cli-build/prerender-manifest.json +17 -17
- package/app/.next-cli-build/react-loadable-manifest.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/api/models/chat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +22 -22
- package/app/.next-cli-build/server/chunks/2617.js +1 -1
- package/app/.next-cli-build/server/chunks/412.js +1 -1
- package/app/.next-cli-build/server/chunks/436.js +1 -1
- package/app/.next-cli-build/server/chunks/7431.js +3 -3
- package/app/.next-cli-build/server/chunks/820.js +1 -1
- package/app/.next-cli-build/server/chunks/8287.js +1 -1
- package/app/.next-cli-build/server/chunks/8525.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/static/chunks/{2723-7d202e913c52264d.js → 2723-6c3362ddd04a22cd.js} +1 -1
- package/app/.next-cli-build/static/chunks/{5497-df32bda6e3c66c2a.js → 5497-e2c10e10b7e013fc.js} +1 -1
- package/app/.next-cli-build/static/chunks/7958-888ab0e64e06ab2f.js +5 -0
- package/app/.next-cli-build/static/chunks/{webpack-2a9ce2c5b55aa5a4.js → webpack-a09b596b791957cc.js} +1 -1
- package/app/.next-cli-build/static/css/747780fc07d59019.css +1 -0
- package/app/node_modules/node-forge/LICENSE +331 -0
- package/app/node_modules/node-forge/README.md +2071 -0
- package/app/node_modules/node-forge/dist/forge.all.min.js +2 -0
- package/app/node_modules/node-forge/dist/forge.all.min.js.map +1 -0
- package/app/node_modules/node-forge/dist/forge.min.js +2 -0
- package/app/node_modules/node-forge/dist/forge.min.js.map +1 -0
- package/app/node_modules/node-forge/dist/prime.worker.min.js +2 -0
- package/app/node_modules/node-forge/dist/prime.worker.min.js.map +1 -0
- package/app/node_modules/node-forge/flash/swf/SocketPool.swf +0 -0
- package/app/node_modules/node-forge/lib/aes.js +1091 -0
- package/app/node_modules/node-forge/lib/aesCipherSuites.js +282 -0
- package/app/node_modules/node-forge/lib/asn1-validator.js +91 -0
- package/app/node_modules/node-forge/lib/asn1.js +1520 -0
- package/app/node_modules/node-forge/lib/baseN.js +186 -0
- package/app/node_modules/node-forge/lib/cipher.js +230 -0
- package/app/node_modules/node-forge/lib/cipherModes.js +999 -0
- package/app/node_modules/node-forge/lib/des.js +496 -0
- package/app/node_modules/node-forge/lib/ed25519.js +1091 -0
- package/app/node_modules/node-forge/lib/forge.js +13 -0
- package/app/node_modules/node-forge/lib/form.js +149 -0
- package/app/node_modules/node-forge/lib/hmac.js +146 -0
- package/app/node_modules/node-forge/lib/http.js +1346 -0
- package/app/node_modules/node-forge/lib/index.all.js +16 -0
- package/app/node_modules/node-forge/lib/index.js +33 -0
- package/app/node_modules/node-forge/lib/jsbn.js +1294 -0
- package/app/node_modules/node-forge/lib/kem.js +168 -0
- package/app/node_modules/node-forge/lib/log.js +319 -0
- package/app/node_modules/node-forge/lib/md.all.js +13 -0
- package/app/node_modules/node-forge/lib/md.js +11 -0
- package/app/node_modules/node-forge/lib/md5.js +289 -0
- package/app/node_modules/node-forge/lib/mgf.js +12 -0
- package/app/node_modules/node-forge/lib/mgf1.js +57 -0
- package/app/node_modules/node-forge/lib/oids.js +180 -0
- package/app/node_modules/node-forge/lib/pbe.js +1023 -0
- package/app/node_modules/node-forge/lib/pbkdf2.js +211 -0
- package/app/node_modules/node-forge/lib/pem.js +237 -0
- package/app/node_modules/node-forge/lib/pkcs1.js +276 -0
- package/app/node_modules/node-forge/lib/pkcs12.js +1078 -0
- package/app/node_modules/node-forge/lib/pkcs7.js +1260 -0
- package/app/node_modules/node-forge/lib/pkcs7asn1.js +410 -0
- package/app/node_modules/node-forge/lib/pki.js +102 -0
- package/app/node_modules/node-forge/lib/prime.js +297 -0
- package/app/node_modules/node-forge/lib/prime.worker.js +168 -0
- package/app/node_modules/node-forge/lib/prng.js +419 -0
- package/app/node_modules/node-forge/lib/pss.js +241 -0
- package/app/node_modules/node-forge/lib/random.js +191 -0
- package/app/node_modules/node-forge/lib/rc2.js +410 -0
- package/app/node_modules/node-forge/lib/rsa.js +1968 -0
- package/app/node_modules/node-forge/lib/sha1.js +319 -0
- package/app/node_modules/node-forge/lib/sha256.js +327 -0
- package/app/node_modules/node-forge/lib/sha512.js +561 -0
- package/app/node_modules/node-forge/lib/socket.js +287 -0
- package/app/node_modules/node-forge/lib/ssh.js +236 -0
- package/app/node_modules/node-forge/lib/tls.js +4282 -0
- package/app/node_modules/node-forge/lib/tlssocket.js +249 -0
- package/app/node_modules/node-forge/lib/util.js +2652 -0
- package/app/node_modules/node-forge/lib/x509.js +3251 -0
- package/app/node_modules/node-forge/lib/xhr.js +738 -0
- package/app/node_modules/node-forge/package.json +123 -0
- package/app/package.json +1 -1
- package/hooks/postinstall.js +22 -0
- package/package.json +3 -2
- package/app/.next-cli-build/static/chunks/7958-316473a002b2e084.js +0 -5
- package/app/.next-cli-build/static/css/73729572c2967c28.css +0 -1
- /package/app/.next-cli-build/static/{50L_O0gZpitHt-drH8zm8 → cZhiw78jUWQGJMmSZolvp}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{50L_O0gZpitHt-drH8zm8 → cZhiw78jUWQGJMmSZolvp}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=436,exports.ids=[436],exports.modules={35024:(a,b,c)=>{c.d(b,{Ak:()=>e,Yg:()=>h,sr:()=>d.sr,xq:()=>d.xq});var d=c(26070);function e(a){return(a?.providerSpecificData?.baseUrl?.trim()||"http://localhost:11434").replace(/\/$/,"")}let f=d.xq["xiaomi-tokenplan"]?.regions||{},g=d.xq["xiaomi-tokenplan"]?.defaultRegion;function h(a){return f[a?.providerSpecificData?.region]||f[g]}},39006:a=>{a.exports={rE:"2.9.
|
|
1
|
+
"use strict";exports.id=436,exports.ids=[436],exports.modules={35024:(a,b,c)=>{c.d(b,{Ak:()=>e,Yg:()=>h,sr:()=>d.sr,xq:()=>d.xq});var d=c(26070);function e(a){return(a?.providerSpecificData?.baseUrl?.trim()||"http://localhost:11434").replace(/\/$/,"")}let f=d.xq["xiaomi-tokenplan"]?.regions||{},g=d.xq["xiaomi-tokenplan"]?.defaultRegion;function h(a){return f[a?.providerSpecificData?.region]||f[g]}},39006:a=>{a.exports={rE:"2.9.8"}},39609:(a,b,c)=>{c.r(b),c.d(b,{default:()=>u,proxyAwareFetch:()=>s});var d=c(27910),e=c(41004);let f=globalThis.fetch,g=new Map,h=new Map,i=new Set(["SELF_SIGNED_CERT_IN_CHAIN","DEPTH_ZERO_SELF_SIGNED_CERT","UNABLE_TO_VERIFY_LEAF_SIGNATURE","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","CERT_HAS_EXPIRED","ERR_TLS_CERT_ALTNAME_INVALID"]),j=["cloudcode-pa.googleapis.com","daily-cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","api2.cursor.sh"],k=["8.8.8.8","8.8.4.4"];function l(a){return null==a?"":String(a).trim()}async function m(a){let b=h.get(a);if(b&&Date.now()<b.expiry)return b.ip;try{let b=await Promise.resolve().then(c.t.bind(c,14985,23)),{promisify:d}=await Promise.resolve().then(c.t.bind(c,28354,23)),f=new b.Resolver;f.setServers(k);let g=d(f.resolve4.bind(f)),i=await g(a);return h.set(a,{ip:i[0],expiry:Date.now()+e.v1.dnsCacheTtlMs}),i[0]}catch(b){return console.warn(`[ProxyFetch] DNS resolve failed for ${a}:`,b.message),null}}function n(a,b){let c,d=l(b);if(!d)return!1;try{c=new URL(a).hostname.toLowerCase()}catch{return!1}return d.split(",").map(a=>a.trim().toLowerCase()).filter(Boolean).some(a=>"*"===a||(a.startsWith(".")?c.endsWith(a)||c===a.slice(1):c===a||c.endsWith(`.${a}`)))}function o(a){let b=l(a);if(!b)return null;try{return new URL(b),b}catch{return`http://${b}`}}async function p(a,b=!1){let d=o(a);if(!d&&!b)return null;let f=`${d||"direct"}::${b?"insecure":"secure"}`;if(!g.has(f)){g.size>=e.v1.proxyDispatchersMaxSize&&g.delete(g.keys().next().value);let{Agent:a,ProxyAgent:h}=await c.e(7774).then(c.t.bind(c,47774,19)),i=b?{rejectUnauthorized:!1}:void 0,j=d?new h({uri:d,...b?{requestTls:i}:{}}):new a({connect:i});g.set(f,j)}return g.get(f)}async function q(a,b,c){try{let d=c?await p(c):void 0;return await f(a,d?{...b,dispatcher:d}:b)}catch(e){let d;if(d=e?.cause?.code||e?.code,i.has(d)&&("true"===process.env.ALLOW_INSECURE_TLS||"1"===process.env.ALLOW_INSECURE_TLS)){if(b.body&&"function"==typeof b.body.getReader&&b.body.locked)throw e;console.warn(`[ProxyFetch] TLS cert verification failed (${e.cause?.code||e.code}), retrying with insecure TLS: ${a}`),console.warn("[ProxyFetch] INSECURE TLS fallback is active (ALLOW_INSECURE_TLS=true) — traffic is exposed to MITM");let d=await p(c,!0);return await f(a,{...b,dispatcher:d})}throw e}}async function r(a,b,e){let f=await Promise.resolve().then(c.t.bind(c,55591,23)),g=await Promise.resolve().then(c.t.bind(c,91645,23)),h=f.default??f,i=g.default??g;return new Promise((c,f)=>{let g=new i.Socket;if(g.connect(443,b,()=>{let b={socket:g,servername:a.hostname,path:a.pathname+a.search,method:e.method||"POST",headers:{...e.headers,Host:a.hostname}},i=h.request(b,a=>{let b={ok:a.statusCode>=200&&a.statusCode<300,status:a.statusCode,statusText:a.statusMessage,headers:new Map(Object.entries(a.headers)),body:d.Readable.toWeb(a),text:async()=>{let b=[];for await(let c of a)b.push(c);return Buffer.concat(b).toString()},json:async()=>JSON.parse(await b.text())};c(b)});i.on("error",f),e.body&&i.write("string"==typeof e.body?e.body:JSON.stringify(e.body)),i.end()}),g.on("error",f),e.signal){let a=!1,b=()=>{a||(a=!0,g.destroy(),f(new DOMException("The operation was aborted","AbortError")))};e.signal.aborted?b():(e.signal.addEventListener("abort",b,{once:!0}),g.once("close",()=>e.signal.removeEventListener("abort",b)))}})}async function s(a,b={},c=null){let d="string"==typeof a?a:a.toString(),e=l(c?.vercelRelayUrl);if(e){let a=new URL(d),c={...b.headers instanceof Headers?Object.fromEntries(b.headers.entries()):{...b.headers||{}},"x-relay-target":`${a.protocol}//${a.host}`,"x-relay-path":`${a.pathname}${a.search}`};return f(e,{...b,headers:c})}let g=function(a,b){if(b?.enabled!==!0&&b?.connectionProxyEnabled!==!0)return null;let c=l(b?.url??b?.connectionProxyUrl);if(!c)return null;let d=l(b?.noProxy??b?.connectionNoProxy);return d&&n(a,d)?null:o(c)}(d,c),h=g?null:o(function(a){let b;if(n(a,process.env.NO_PROXY||process.env.no_proxy))return null;try{b=new URL(a).protocol}catch{return null}return"https:"===b?process.env.HTTPS_PROXY||process.env.https_proxy||process.env.ALL_PROXY||process.env.all_proxy:process.env.HTTP_PROXY||process.env.http_proxy||process.env.ALL_PROXY||process.env.all_proxy}(d)),i=g||h;if(function(a){try{let b=new URL(a).hostname;return j.some(a=>b.includes(a))}catch{return!1}}(d)){if(i)try{return await q(a,b,i)}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);console.warn(`[ProxyFetch] Proxy failed, falling back to direct bypass: ${a.message}`)}try{let a=new URL(d),c=await m(a.hostname);if(c)return await r(a,c,b)}catch(a){console.warn(`[ProxyFetch] MITM bypass failed: ${a.message}`)}}if(i)try{return await q(a,b,i)}catch(d){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${d.message}`);return console.warn(`[ProxyFetch] Proxy failed, falling back to direct: ${d.message}`),q(a,b,null)}let k=c?.proxyPoolId||c?.enabled===!0||c?.connectionProxyEnabled===!0||!!l(c?.url??c?.connectionProxyUrl);if(c?.strictProxy===!0&&k)throw Error("[ProxyFetch] Proxy required but none resolved (strictProxy=true)");return q(a,b,null)}async function t(a,b={}){return s(a,b,null)}globalThis.fetch!==t&&(globalThis.fetch=t);let u=t},75924:(a,b,c)=>{let d;c.d(b,{Ch:()=>k,Cn:()=>p,Co:()=>z,Ic:()=>w,J5:()=>t,K:()=>u,NA:()=>C,Ok:()=>h,QH:()=>q,Wu:()=>B,buildKimiHeaders:()=>D,dw:()=>s,go:()=>j,iO:()=>A,j5:()=>x,nZ:()=>v,sX:()=>l,uR:()=>r,x0:()=>n,zv:()=>y});var e=c(21820),f=c(35024),g=c(74129);let h={hostname:"inference-api.nousresearch.com",chatCompletionsPath:"/v1/chat/completions",tags:["product=omnihilbras","client=omnihilbras","user=omnihilbras"]},i=f.xq["gemini-cli"]?.cliVersion,j=f.xq["gemini-cli"]?.apiClient,k=f.xq.codex?.cliVersion;function l(a="unknown"){let b;return`GeminiCLI/${i}/${a||"unknown"} (${(0,e.platform)()}; ${"ia32"===(b=(0,e.arch)())?"x86":b}; terminal)`}let m=f.xq.github?.copilot||{},n={VSCODE_VERSION:m.vscodeVersion,COPILOT_CHAT_VERSION:m.chatVersion,USER_AGENT:m.userAgent,API_VERSION:m.apiVersion};function o(){let a=(0,e.platform)(),b=(0,e.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let p={ideType:9,platform:o(),pluginType:2},q="_ide",r="_ide",s=new Set(["Task","TaskOutput","TaskStop","TaskCreate","TaskGet","TaskUpdate","TaskList","Bash","Glob","Grep","Read","Edit","Write","NotebookEdit","WebFetch","WebSearch","AskUserQuestion","Skill","EnterPlanMode","ExitPlanMode"]),t=new Set(["browser_subagent","command_status","find_by_name","generate_image","grep_search","list_dir","list_resources","multi_replace_file_content","notify_user","read_resource","read_terminal","read_url_content","replace_file_content","run_command","search_web","send_command_input","task_boundary","view_content_chunk","view_file","write_to_file"]),u={"User-Agent":g.Of},v={"gemini-cli":{loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},antigravity:{loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"}},w={"Content-Type":"application/json","User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1","Client-Metadata":JSON.stringify({ideType:9,platform:o(),pluginType:2})},x={"Content-Type":"application/json","User-Agent":g.Of},y={ideType:9,platform:o(),pluginType:2},z="You are Claude Code, Anthropic's official CLI for Claude.",A=[{from:"You are a Claude agent, built on Anthropic's Claude Agent SDK.",to:""},{from:/You are Hermes(?: Agent)?(?:,\s*(?:an intelligent AI assistant|an AI assistant|an AI agent))?(?:,?\s*(?:built|created)\s+by\s+Nous Research)?\./gi,to:"You are an AI assistant."},{from:/^x-anthropic-billing-header:[^\n]*(?:\r?\n)*/gim,to:""},{from:/opencode/gi,to:a=>"OpenCode"===a?"Antigravity":"OPENCODE"===a?"ANTIGRAVITY":"antigravity"}],B=Object.fromEntries(Object.entries(f.sr).filter(([,a])=>a.refreshLeadMs).map(([a,b])=>[a,b.refreshLeadMs])),C={google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:f.sr.codex?.tokenUrl,auth:f.sr.codex?.authorizeUrl},anthropic:{token:f.sr.claude?.tokenUrl,auth:"https://api.anthropic.com/v1/oauth/authorize"},iflow:{token:f.sr.iflow?.tokenUrl,auth:f.sr.iflow?.authorizeUrl},github:{token:f.sr.github?.tokenUrl,auth:f.sr.github?.authorizeUrl,deviceCode:f.sr.github?.deviceCodeUrl}};function D(a){let b=(0,e.platform)(),f=(0,e.arch)(),g=`${b} ${f}`;"darwin"===b?g=`macOS ${f}`:"win32"===b?g=`Windows ${f}`:"linux"===b&&(g=`Linux ${f}`);let h="unknown";try{h=(0,e.hostname)()||"unknown"}catch{h="unknown"}let i="string"==typeof a&&a.trim()?a.trim():`kimi-${Date.now()}`;return{"X-Msh-Platform":"omnihilbras","X-Msh-Version":function(){if(d)return d;try{d=c(39006).rE||"0.0.0"}catch{d=process.env.npm_package_version||"0.0.0"}return d}(),"X-Msh-Device-Name":h,"X-Msh-Device-Model":g,"X-Msh-Device-Id":i}}}};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
exports.id=7431,exports.ids=[7431],exports.modules={34910:(a,b,c)=>{"use strict";c.d(b,{default:()=>u});var d=c(48249),e=c(67484),f=c(50412),g=c(67424),h=c(67960),i=c(91937);function j({label:a,url:b,copyId:c,copied:e,onCopy:g}){return(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center bg-surface-2 text-text-muted",children:a}),(0,d.jsx)(f.pd,{value:b,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>g(b,c),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e===c?"check":"content_copy"})})]})}function k({status:a,className:b=""}){return(0,d.jsx)("div",{className:`p-2 rounded text-sm ${b} ${"success"===a.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===a.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:a.message.split(/(https?:\/\/[^\s]+)/g).map((a,b)=>/^https?:\/\//.test(a)?(0,d.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:a},b):a)})}function l({text:a}){return(0,d.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,d.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:a})]})}function m({message:a,action:b}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"text-xs flex-1",children:a}),b&&(0,d.jsx)("a",{href:b.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:b.href.startsWith("#")?a=>{a.preventDefault(),document.getElementById(b.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:b.label})]})}var n=c(49885),o=c.n(n);function p({apiKey:a,onChange:b,onRequestRestrict:c}){let g=a.access||{restricted:!1,allow:[]},[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)([]),[l,m]=(0,e.useState)({}),n=async()=>{i(!0);try{let[a,b]=await Promise.all([fetch("/api/providers"),fetch("/api/models/alias")]);a.ok&&k((await a.json()).connections||[]),b.ok&&m((await b.json()).aliases||{})}catch(a){console.log("Error loading picker data:",a)}},o=a=>b({restricted:!0,allow:a}),q=a=>o(g.allow.filter(b=>b!==a));return(0,d.jsxs)("div",{className:"mt-2","data-testid":"key-access",children:[(0,d.jsx)(f.lM,{size:"sm",checked:g.restricted,label:"Restrict access",onChange:a=>a?c():b({restricted:!1,allow:g.allow})}),g.restricted&&(0,d.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[0===g.allow.length&&(0,d.jsx)("span",{className:"text-xs text-orange-500",children:"No combos or models allowed — this key can call nothing."}),g.allow.map(a=>(0,d.jsxs)("span",{className:"flex items-center gap-1 rounded-xl border border-primary/30 bg-primary/10 px-2 py-0.5 font-mono text-xs text-text-main",children:[a,(0,d.jsx)("button",{onClick:()=>q(a),className:"rounded text-text-muted hover:text-red-500",title:`Remove ${a}`,"aria-label":`Remove ${a}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"12px"},children:"close"})})]},a)),(0,d.jsxs)("button",{onClick:n,className:"flex items-center gap-0.5 rounded-xl border border-dashed border-black/10 px-2 py-0.5 text-xs font-medium text-primary hover:border-primary/50 dark:border-white/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"14px"},children:"add"}),"Add combo or model"]})]}),h&&(0,d.jsx)(f.rq,{isOpen:h,onClose:()=>i(!1),onSelect:a=>{let b=a?.value;b&&!g.allow.some(a=>a.toLowerCase()===b.toLowerCase())&&o([...g.allow,b])},onDeselect:a=>q(g.allow.find(b=>b.toLowerCase()===String(a?.value).toLowerCase())),activeProviders:j,modelAliases:l,title:`Allowed for "${a.name}"`,addedModelValues:g.allow,closeOnSelect:!1})]})}function q(a,b){if(""===a||null==a)return b??0;let c=Number(a);return Number.isFinite(c)?c:0}function r({apiKey:a}){let b=(0,i.A)(a=>a.settings),c=b?.rateLimit||{},f=c.keyOverrides?.[a.id]||null,[g,h]=(0,e.useState)(!1),j=f?`Rate limit: ${q(f.requestsPerMinute,c.requestsPerMinute)}/min, ${q(f.tokensPerMinute,c.tokensPerMinute)} tokens/min`:"Rate limit: global";return(0,d.jsxs)("div",{className:"mt-2","data-testid":"key-rate-limit",children:[(0,d.jsx)("button",{type:"button",onClick:()=>h(a=>!a),className:"text-xs font-medium text-primary hover:underline",children:j}),g&&(0,d.jsx)(t,{apiKey:a},`${a.id}:${f?.requestsPerMinute}:${f?.tokensPerMinute}:${c.requestsPerMinute}:${c.tokensPerMinute}`),g&&(0,d.jsx)(s,{apiKeyId:a.id})]})}function s({apiKeyId:a}){let[b,c]=(0,e.useState)(null);if(!b)return null;let f=Object.values(b.rejections||{}).reduce((a,b)=>a+(Number(b)||0),0);return(0,d.jsxs)("p",{className:"mt-1 text-xs text-text-muted","data-testid":"key-rate-limit-usage",children:["Last minute: ",b.requestsPerMinute," requests, ",b.tokensPerMinute," tokens",f>0?`, ${f} refused`:""]})}function t({apiKey:a}){let b=(0,i.A)(a=>a.settings),c=(0,i.A)(a=>a.patchSettings),g=b?.rateLimit||{},h=g.keyOverrides?.[a.id]||null,[j,k]=(0,e.useState)(String(h?.requestsPerMinute??g.requestsPerMinute??"")),[l,m]=(0,e.useState)(String(h?.tokensPerMinute??g.tokensPerMinute??"")),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(""),r=async a=>{o(!0),q("");try{await c({rateLimit:{...g,keyOverrides:a}})||q(i.A.getState().error||"The limit was not saved — the server refused the change.")}finally{o(!1)}};return(0,d.jsxs)("div",{className:"mt-2 flex flex-col gap-2 rounded-xl border border-black/[0.05] dark:border-white/[0.06] p-3",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,d.jsx)(f.pd,{type:"number",min:"0",label:"Requests / minute",value:j,onChange:a=>k(a.target.value),className:"flex-1"}),(0,d.jsx)(f.pd,{type:"number",min:"0",label:"Tokens / minute",value:l,onChange:a=>m(a.target.value),className:"flex-1"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"0 means unlimited for this key. Leave empty to use the global ceiling."}),p&&(0,d.jsx)("p",{className:"text-xs text-red-500","data-testid":"key-rate-limit-error",children:p}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(f.$n,{size:"sm",onClick:()=>{let b={...g.keyOverrides||{}};b[a.id]={requestsPerMinute:""===j.trim()?"":Number(j)||0,tokensPerMinute:""===l.trim()?"":Number(l)||0},r(b)},disabled:n,children:"Save"}),h&&(0,d.jsx)(f.$n,{size:"sm",variant:"ghost",onClick:()=>{let b={...g.keyOverrides||{}};delete b[a.id],r(b)},disabled:n,children:"Use global"})]})]})}function u(){let[a,b]=(0,e.useState)([]),[c,n]=(0,e.useState)(!0),[o,q]=(0,e.useState)(""),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!0),[I,J]=(0,e.useState)(!0),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)(!0),[O,P]=(0,e.useState)(!1),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(""),[U,V]=(0,e.useState)(""),[W,X]=(0,e.useState)(!1),[Y,Z]=(0,e.useState)(""),[$,_]=(0,e.useState)(null),[aa,ab]=(0,e.useState)(!1),[ac,ad]=(0,e.useState)(!1),[ae,af]=(0,e.useState)(!1),[ag,ah]=(0,e.useState)(!1),[ai,aj]=(0,e.useState)(""),[ak,al]=(0,e.useState)(!1),[am,an]=(0,e.useState)(""),[ao,ap]=(0,e.useState)(null),[aq,ar]=(0,e.useState)(""),[as,at]=(0,e.useState)(""),[au,av]=(0,e.useState)(null),[aw,ax]=(0,e.useState)(!1),[ay,az]=(0,e.useState)([]),[aA,aB]=(0,e.useState)(""),[aC,aD]=(0,e.useState)(!1),[aE,aF]=(0,e.useState)(!1),[aG,aH]=(0,e.useState)(!1),aI=(0,e.useRef)(null),aJ=(0,e.useRef)(!0),aK=(0,e.useRef)(null);(0,e.useRef)(0),(0,e.useRef)(0),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1);let[aL,aM]=(0,e.useState)(!1),[aN,aO]=(0,e.useState)(!1),[aP,aQ]=(0,e.useState)(!1),{copied:aR,copy:aS}=(0,g.C)(),aT=!G||!I,aU=G?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,e.useCallback)((a,b,c,d,e,f)=>{b.current?(c.current=0,d(!0),e.current||(e.current=!0,f(!0))):(c.current+=1,c.current>=h.t6&&d(!1))},[]);let aV=async a=>{try{await i.A.getState().patchSettings({tunnelDashboardAccess:a})&&L(a)}catch(a){console.log("Error updating tunnelDashboardAccess:",a)}},aW=async a=>{try{await i.A.getState().patchSettings({requireApiKey:a})&&F(a)}catch(a){console.log("Error updating requireApiKey:",a)}},aX=async()=>{try{let a=async()=>{let a=await fetch("/api/keys");if(!a.ok)throw Error(`Failed to load the API keys (HTTP ${a.status})`);return(await a.json()).keys||[]},c=await a();if(0===c.length){let b=!1;try{b=(await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"Default Key"})})).ok}catch{}b&&(c=await a())}b(c),q("")}catch(a){console.log("Error fetching data:",a),q(a.message||"Failed to load the API keys.")}finally{n(!1)}},aY=async(...a)=>{if(!aJ.current)return!1;X(!0),Z("Waiting for tunnel ready...");let b=a.filter(Boolean).map(a=>`${a}/api/health`),c=new AbortController,{signal:d}=c,e=Date.now();for(;Date.now()-e<h.Cp&&aJ.current&&(await new Promise(a=>setTimeout(a,h.Hx)),aJ.current);){if(await Promise.any(b.map(async a=>{if((await fetch(a,{mode:"cors",cache:"no-store",signal:d})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return P(!0),X(!1),Z(""),!0;if((Date.now()-e)%1e4<h.Hx)try{let a=await fetch("/api/tunnel/status",{signal:d});if(a.ok){let b=await a.json();if(!b.tunnel?.enabled)return _({type:"error",message:"Tunnel process stopped unexpectedly."}),X(!1),Z(""),!1}}catch{}}return c.abort(),!!aJ.current&&(_({type:"error",message:"Tunnel created but not reachable. Please try again."}),X(!1),Z(""),!1)},aZ=async()=>{ab(!1),X(!0),_(null),Z("Creating tunnel...");let a=!0;(async()=>{let b=new AbortController;for(aK.current=b;a;){if(!aJ.current){a=!1;break}try{let c=await fetch("/api/tunnel/status",{signal:b.signal});if(c.ok){let b=await c.json();b.download?.downloading?Z(`Downloading cloudflared... ${b.download.progress}%`):a&&Z("Creating tunnel...")}}catch{}if(!a||!aJ.current)break;await new Promise(a=>setTimeout(a,1e3))}aK.current===b&&(aK.current=null)})();try{let b=await fetch("/api/tunnel/enable",{method:"POST"});a=!1;let c=await b.json();if(!b.ok)return void _({type:"error",message:c.error||"Failed to enable tunnel"});let d=c.tunnelUrl;if(!d)return void _({type:"error",message:"No tunnel URL returned"});T(d),V(c.publicUrl||""),await aY(c.publicUrl,d)}catch(a){_({type:"error",message:a.message})}finally{a=!1,X(!1),Z("")}},a$=async()=>{X(!0),_(null);try{let a=await fetch("/api/tunnel/disable",{method:"POST"}),b=await a.json();a.ok?(P(!1),T(""),ad(!1),_({type:"success",message:"Tunnel disabled"})):_({type:"error",message:b.error||"Failed to disable tunnel"})}catch(a){_({type:"error",message:a.message})}finally{X(!1)}},a_=async()=>{av(null);try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok){let b=await a.json();return av(b.installed),b}}catch{}return av(!1),{installed:!1}},a0=async()=>{ax(!0),ap(null),az([]);try{let a=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:aA})});aB("");let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(d=f.pop()||"",f)){let b=a.split("\n"),c="progress",d=null;for(let a of b)if(a.startsWith("event: ")&&(c=a.slice(7).trim()),a.startsWith("data: "))try{d=JSON.parse(a.slice(6))}catch{}if(d)if("progress"===c)az(a=>[...a.slice(-50),d.message]);else if("done"===c){av(!0),ax(!1),aF(!1),a4();return}else"error"===c&&ap({type:"error",message:d.error||"Install failed"})}}}catch(a){ap({type:"error",message:a.message})}finally{ax(!1)}},a1=async a=>{if(!aJ.current)return!1;an("Waiting for Tailscale ready...");let b=`${a}/api/health`,c=new AbortController,{signal:d}=c,e=Date.now();for(;Date.now()-e<h.Cp&&aJ.current&&(await new Promise(a=>setTimeout(a,h.Hx)),aJ.current);)try{let a=await fetch(b,{mode:"no-cors",cache:"no-store",signal:d});if(a.ok||"opaque"===a.type)return!0}catch{}return c.abort(),!1},a2=(a,b)=>{ar(a),at(b)},a3=()=>{ar(""),at("")},a4=async()=>{aF(!1),aD(!0),al(!0),ap(null),an("Connecting..."),a3();try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aj(b.tunnelUrl||"");let a=await a1(b.tunnelUrl);af(!0),ap(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.needsLogin&&b.authUrl){a2(b.authUrl,"Open Login Page"),an('Login required — click "Open Login Page" to continue');for(let a=0;a<40;a++){if(await new Promise(a=>setTimeout(a,3e3)),!aJ.current)return;try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok&&(await a.json()).loggedIn){a3(),an("Starting funnel...");let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aj(b.tunnelUrl||"");let a=await a1(b.tunnelUrl);af(!0),ap(a?null:{type:"warning",message:"Connected but not reachable yet."})}else b.funnelNotEnabled&&b.enableUrl?await a5(b.enableUrl):ap({type:"error",message:b.error||"Failed to start funnel"});return}}catch{}}a3(),ap({type:"error",message:"Login timed out. Please try again."});return}if(b.funnelNotEnabled&&b.enableUrl)return void await a5(b.enableUrl);ap({type:"error",message:b.error||"Failed to connect"})}catch(a){ap({type:"error",message:a.message})}finally{al(!1),aD(!1),an(""),a3()}},a5=async a=>{a2(a,"Open Funnel Settings"),an('Click "Open Funnel Settings" to enable Funnel...');for(let a=0;a<40;a++){if(await new Promise(a=>setTimeout(a,3e3)),!aJ.current)return;try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){a3(),aj(b.tunnelUrl||"");let a=await a1(b.tunnelUrl);af(!0),ap(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.funnelNotEnabled)continue;if(b.error){a3(),ap({type:"error",message:b.error});return}}catch{}}a3(),ap({type:"error",message:"Timed out waiting for Funnel to be enabled."})},a6=async()=>{al(!0),ap(null);try{let a=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),b=await a.json();a.ok?(af(!1),aj(""),aH(!1),ap({type:"success",message:"Tailscale disabled"})):ap({type:"error",message:b.error||"Failed to disable Tailscale"})}catch(a){ap({type:"error",message:a.message})}finally{al(!1)}},a7=async()=>{ap(null),az([]);let a=await a_();a?.installed&&a?.hasCachedPassword?a4():aF(!0)},a8=async()=>{if(y.trim()){v("");try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:y})}),b=await a.json().catch(()=>({}));if(!a.ok)return void v(b.error||"Failed to create the key.");B(b.key),await aX(),z(""),x(!1)}catch(a){console.log("Error creating key:",a),v(a.message||"Failed to create the key.")}}},a9=async c=>{D({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{D(null);try{(await fetch(`/api/keys/${c}`,{method:"DELETE"})).ok&&b(a.filter(a=>a.id!==c))}catch(a){console.log("Error deleting key:",a)}}})},ba=async(a,c)=>{t("");try{let d=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:c})});if(d.ok)b(b=>b.map(b=>b.id===a?{...b,isActive:c}:b));else{let a=await d.json().catch(()=>({}));t(a.error||"Failed to update the key.")}}catch(a){console.log("Error toggling key:",a),t(a.message||"Failed to update the key.")}},bb=async(a,c)=>{t("");try{let d=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({access:c})}),e=await d.json().catch(()=>({}));d.ok&&e.key?b(b=>b.map(b=>b.id===a?{...b,access:e.key.access}:b)):t(e.error||"Failed to update the key access.")}catch(a){console.log("Error updating key access:",a),t(a.message||"Failed to update the key access.")}},[bc,bd]=(0,e.useState)("/v1");return c?(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(f.Qv,{}),(0,d.jsx)(f.Qv,{})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsxs)(f.Zp,{children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)(j,{label:"Local",url:bc,copyId:"local_url",copied:aR,onCopy:aS}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${O?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),O&&!W&&Q?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.pd,{value:`${U||S}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>aS(`${U||S}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===aR?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>ad(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!O||W||Q?W?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),Y||"Creating tunnel..."]}),(0,d.jsx)("button",{onClick:()=>{aK.current?.abort(),aK.current=null,X(!1),Z("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):$?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),$.message]}),(0,d.jsx)(f.$n,{size:"sm",icon:"cloud_upload",onClick:()=>ab(!0),children:"Enable"})]}):M?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,d.jsx)("button",{onClick:()=>N(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,d.jsx)(f.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{aT?_({type:"error",message:`Security required: ${aU}`}):E?ab(!0):_({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aL?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,d.jsx)("button",{onClick:()=>ad(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${ae?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),ae&&!ak&&ag?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.pd,{value:`${ai}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>aS(`${ai}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===aR?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>aH(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!ae||ak||ag?ak||aC?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),am||"Connecting..."]}),aq&&(0,d.jsx)(f.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(aq,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:as||"Open"}),(0,d.jsx)("button",{onClick:()=>{al(!1),aD(!1),an(""),a3()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):ao?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),ao.message]}),(0,d.jsx)(f.$n,{size:"sm",icon:"vpn_lock",onClick:a7,children:"Enable"})]}):(0,d.jsx)(f.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{aT?ap({type:"error",message:`Security required: ${aU}`}):a7()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aN?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,d.jsx)("button",{onClick:()=>aH(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),aT&&!O&&!ae&&(0,d.jsx)("div",{className:"mt-4",children:(0,d.jsx)(m,{message:aU,action:{label:"Open settings",href:"/dashboard/profile"}})}),(O||ae)&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!E&&(0,d.jsx)(m,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!G||!I)&&(0,d.jsx)(m,{message:G?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:G?"Change password":"Enable",href:"/dashboard/profile"}})]}),(O||ae)&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,d.jsx)(f.lM,{checked:K,onChange:()=>aV(!K)}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,d.jsx)(l,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,d.jsxs)(f.Zp,{id:"require-api-key",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,d.jsx)(f.$n,{icon:"add",onClick:()=>{v(""),x(!0)},children:"Create Key"})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,d.jsx)(f.lM,{checked:E,onChange:()=>aW(!E)})]}),aP&&!E&&(0,d.jsx)("div",{className:"mb-4 -mt-2",children:(0,d.jsx)(m,{message:"Endpoint is exposed without an API key."})}),o||s?(0,d.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-red-300 dark:border-red-800 bg-red-500/5 px-3 py-2 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),o||s]}):null,0===a.length?(0,d.jsxs)("div",{className:"text-center py-12",children:[(0,d.jsx)("div",{className:`inline-flex items-center justify-center w-16 h-16 rounded-full mb-4 ${o?"bg-red-500/10 text-red-500":"bg-primary/10 text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:o?"error":"vpn_key"})}),(0,d.jsx)("p",{className:"text-text-main font-medium mb-1",children:o?"Could not load the API keys":"No API keys yet"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:o||"Create your first API key to get started"}),!o&&(0,d.jsx)(f.$n,{icon:"add",onClick:()=>{v(""),x(!0)},children:"Create Key"})]}):(0,d.jsx)("div",{className:"flex flex-col",children:a.map(a=>(0,d.jsxs)("div",{className:`group flex items-start justify-between gap-3 py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.name}),(0,d.jsx)("div",{className:"flex items-center gap-2 mt-1 min-w-0 flex-wrap",children:(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono break-all min-w-0",children:a.key})}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(a.createdAt).toLocaleDateString()]}),!1===a.isActive&&(0,d.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"}),(0,d.jsx)(p,{apiKey:a,onChange:b=>bb(a.id,b),onRequestRestrict:()=>D({title:"Restrict API Key",message:`Restrict API key "${a.name}"?
|
|
1
|
+
exports.id=7431,exports.ids=[7431],exports.modules={27329:(a,b,c)=>{"use strict";c.d(b,{default:()=>S});var d=c(48249),e=c(67484),f=c(50412),g=c(67424),h=c(84483);let i={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};i.node;let j=(0,h.A)(i);var k=c(20878);let l={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};l.node;let m=(0,h.A)(l),n={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};n.node;let o=(0,h.A)(n),p={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};p.node;let q=(0,h.A)(p),r={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};r.node;let s=(0,h.A)(r),t={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};t.node;let u=(0,h.A)(t);var v=c(16664);let w={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};w.node;let x=(0,h.A)(w),y={name:"cloud",size:24,node:[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]};y.node;let z=(0,h.A)(y),A={name:"shield-check",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]};A.node;let B=(0,h.A)(A),C={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};C.node;let D=(0,h.A)(C);var E=c(67960),F=c(91937);function G({status:a,className:b=""}){return(0,d.jsx)("div",{className:`p-2 rounded text-sm ${b} ${"success"===a.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===a.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:a.message.split(/(https?:\/\/[^\s]+)/g).map((a,b)=>/^https?:\/\//.test(a)?(0,d.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:a},b):a)})}function H({text:a}){return(0,d.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,d.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:a})]})}function I({message:a,action:b}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"text-xs flex-1",children:a}),b&&(0,d.jsx)("a",{href:b.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:b.href.startsWith("#")?a=>{a.preventDefault(),document.getElementById(b.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:b.label})]})}var J=c(49885),K=c.n(J);function L({apiKey:a,onChange:b,onRequestRestrict:c}){let g=a.access||{restricted:!1,allow:[]},[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)([]),[l,m]=(0,e.useState)({}),n=async()=>{i(!0);try{let[a,b]=await Promise.all([fetch("/api/providers"),fetch("/api/models/alias")]);a.ok&&k((await a.json()).connections||[]),b.ok&&m((await b.json()).aliases||{})}catch(a){console.log("Error loading picker data:",a)}},o=a=>b({restricted:!0,allow:a}),p=a=>o(g.allow.filter(b=>b!==a));return(0,d.jsxs)("div",{className:"mt-2","data-testid":"key-access",children:[(0,d.jsx)(f.lM,{size:"sm",checked:g.restricted,label:"Restrict access",onChange:a=>a?c():b({restricted:!1,allow:g.allow})}),g.restricted&&(0,d.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[0===g.allow.length&&(0,d.jsx)("span",{className:"text-xs text-orange-500",children:"No combos or models allowed — this key can call nothing."}),g.allow.map(a=>(0,d.jsxs)("span",{className:"flex items-center gap-1 rounded-xl border border-primary/30 bg-primary/10 px-2 py-0.5 font-mono text-xs text-text-main",children:[a,(0,d.jsx)("button",{onClick:()=>p(a),className:"rounded text-text-muted hover:text-red-500",title:`Remove ${a}`,"aria-label":`Remove ${a}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"12px"},children:"close"})})]},a)),(0,d.jsxs)("button",{onClick:n,className:"flex items-center gap-0.5 rounded-xl border border-dashed border-black/10 px-2 py-0.5 text-xs font-medium text-primary hover:border-primary/50 dark:border-white/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"14px"},children:"add"}),"Add combo or model"]})]}),h&&(0,d.jsx)(f.rq,{isOpen:h,onClose:()=>i(!1),onSelect:a=>{let b=a?.value;b&&!g.allow.some(a=>a.toLowerCase()===b.toLowerCase())&&o([...g.allow,b])},onDeselect:a=>p(g.allow.find(b=>b.toLowerCase()===String(a?.value).toLowerCase())),activeProviders:j,modelAliases:l,title:`Allowed for "${a.name}"`,addedModelValues:g.allow,closeOnSelect:!1})]})}function M(a,b){if(""===a||null==a)return b??0;let c=Number(a);return Number.isFinite(c)?c:0}function N({apiKey:a}){let b=(0,F.A)(a=>a.settings),c=b?.rateLimit||{},f=c.keyOverrides?.[a.id]||null,[g,h]=(0,e.useState)(!1),i=f?`Rate limit: ${M(f.requestsPerMinute,c.requestsPerMinute)}/min, ${M(f.tokensPerMinute,c.tokensPerMinute)} tokens/min`:"Rate limit: global";return(0,d.jsxs)("div",{className:"mt-2","data-testid":"key-rate-limit",children:[(0,d.jsx)("button",{type:"button",onClick:()=>h(a=>!a),className:"text-xs font-medium text-primary hover:underline",children:i}),g&&(0,d.jsx)(P,{apiKey:a},`${a.id}:${f?.requestsPerMinute}:${f?.tokensPerMinute}:${c.requestsPerMinute}:${c.tokensPerMinute}`),g&&(0,d.jsx)(O,{apiKeyId:a.id})]})}function O({apiKeyId:a}){let[b,c]=(0,e.useState)(null);if(!b)return null;let f=Object.values(b.rejections||{}).reduce((a,b)=>a+(Number(b)||0),0);return(0,d.jsxs)("p",{className:"mt-1 text-xs text-text-muted","data-testid":"key-rate-limit-usage",children:["Last minute: ",b.requestsPerMinute," requests, ",b.tokensPerMinute," tokens",f>0?`, ${f} refused`:""]})}function P({apiKey:a}){let b=(0,F.A)(a=>a.settings),c=(0,F.A)(a=>a.patchSettings),g=b?.rateLimit||{},h=g.keyOverrides?.[a.id]||null,[i,j]=(0,e.useState)(String(h?.requestsPerMinute??g.requestsPerMinute??"")),[k,l]=(0,e.useState)(String(h?.tokensPerMinute??g.tokensPerMinute??"")),[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(""),q=async a=>{n(!0),p("");try{await c({rateLimit:{...g,keyOverrides:a}})||p(F.A.getState().error||"The limit was not saved — the server refused the change.")}finally{n(!1)}};return(0,d.jsxs)("div",{className:"mt-2 flex flex-col gap-2 rounded-xl border border-black/[0.05] dark:border-white/[0.06] p-3",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,d.jsx)(f.pd,{type:"number",min:"0",label:"Requests / minute",value:i,onChange:a=>j(a.target.value),className:"flex-1"}),(0,d.jsx)(f.pd,{type:"number",min:"0",label:"Tokens / minute",value:k,onChange:a=>l(a.target.value),className:"flex-1"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"0 means unlimited for this key. Leave empty to use the global ceiling."}),o&&(0,d.jsx)("p",{className:"text-xs text-red-500","data-testid":"key-rate-limit-error",children:o}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(f.$n,{size:"sm",onClick:()=>{let b={...g.keyOverrides||{}};b[a.id]={requestsPerMinute:""===i.trim()?"":Number(i)||0,tokensPerMinute:""===k.trim()?"":Number(k)||0},q(b)},disabled:m,children:"Save"}),h&&(0,d.jsx)(f.$n,{size:"sm",variant:"ghost",onClick:()=>{let b={...g.keyOverrides||{}};delete b[a.id],q(b)},disabled:m,children:"Use global"})]})]})}function Q({value:a,label:b}){let{copied:c,copy:e}=(0,g.C)();return(0,d.jsx)("button",{type:"button",onClick:()=>e(a,b),"aria-label":c===b?`${b} copied`:`Copy ${b}`,className:"muted grid h-7 w-7 shrink-0 place-items-center rounded-lg hover:bg-surface-2 hover:text-gold-text",children:c===b?(0,d.jsx)(j,{className:"h-3.5 w-3.5 text-success","aria-hidden":"true"}):(0,d.jsx)(k.A,{className:"h-3.5 w-3.5","aria-hidden":"true"})})}function R({label:a,value:b,copyId:c,copied:e,onCopy:f}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-bg-soft/60 px-3 py-2",children:[(0,d.jsx)("span",{className:"mono-label shrink-0",children:a}),(0,d.jsx)("code",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-text-main",children:b}),(0,d.jsx)(Q,{value:b,label:c})]})}function S(){let[a,b]=(0,e.useState)([]),[c,h]=(0,e.useState)(!0),[i,j]=(0,e.useState)(""),[k,l]=(0,e.useState)(""),[n,p]=(0,e.useState)(""),[r,t]=(0,e.useState)(!1),[w,y]=(0,e.useState)(""),[A,C]=(0,e.useState)(null),[J,K]=(0,e.useState)(null),[M,O]=(0,e.useState)(!1),[P,S]=(0,e.useState)(!0),[T,U]=(0,e.useState)(!0),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(!0),[Z,$]=(0,e.useState)(!1),[_,aa]=(0,e.useState)(!1),[ab,ac]=(0,e.useState)(""),[ad,ae]=(0,e.useState)(""),[af,ag]=(0,e.useState)(!1),[ah,ai]=(0,e.useState)(""),[aj,ak]=(0,e.useState)(null),[al,am]=(0,e.useState)(!1),[an,ao]=(0,e.useState)(!1),[ap,aq]=(0,e.useState)(!1),[ar,as]=(0,e.useState)(!1),[at,au]=(0,e.useState)(""),[av,aw]=(0,e.useState)(!1),[ax,ay]=(0,e.useState)(""),[az,aA]=(0,e.useState)(null),[aB,aC]=(0,e.useState)(""),[aD,aE]=(0,e.useState)(""),[aF,aG]=(0,e.useState)(null),[aH,aI]=(0,e.useState)(!1),[aJ,aK]=(0,e.useState)([]),[aL,aM]=(0,e.useState)(""),[aN,aO]=(0,e.useState)(!1),[aP,aQ]=(0,e.useState)(!1),[aR,aS]=(0,e.useState)(!1),aT=(0,e.useRef)(null),aU=(0,e.useRef)(!0),aV=(0,e.useRef)(null),aW=(0,e.useRef)(0),aX=(0,e.useRef)(0),aY=(0,e.useRef)(!1),aZ=(0,e.useRef)(!1),a$=(0,e.useRef)(!1),a_=(0,e.useRef)(!1),[a0,a1]=(0,e.useState)(!1),[a2,a3]=(0,e.useState)(!1),[a4,a5]=(0,e.useState)(!1),{copied:a6,copy:a7}=(0,g.C)(),a8=!P||!T,a9=P?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.',ba=(0,e.useCallback)((a,b,c,d,e,f)=>{b.current?(c.current=0,d(!0),e.current||(e.current=!0,f(!0))):(c.current+=1,c.current>=E.t6&&d(!1))},[]),bb=async()=>{Y(!0);try{let[a,b]=await Promise.all([F.A.getState().fetchSettings(),fetch("/api/tunnel/status",{cache:"no-store"})]);if(a&&(O(a.requireApiKey||!1),S(!1!==a.requireLogin),U(a.hasPassword||!1),W(a.tunnelDashboardAccess||!1)),b.ok){let a=await b.json(),c=a.tunnel?.settingsEnabled??a.tunnel?.enabled??!1,d=a.tunnel?.tunnelUrl||"";ac(d),ae(a.tunnel?.publicUrl||""),$(c),ba(null,aY,aW,aa,a$,a1);let e=a.tailscale?.settingsEnabled??a.tailscale?.enabled??!1,f=a.tailscale?.tunnelUrl||"";au(f),aq(e),ba(null,aZ,aX,as,a_,a3)}}catch(a){console.log("Error loading settings:",a)}finally{Y(!1)}},bc=async a=>{try{await F.A.getState().patchSettings({tunnelDashboardAccess:a})&&W(a)}catch(a){console.log("Error updating tunnelDashboardAccess:",a)}},bd=async a=>{try{await F.A.getState().patchSettings({requireApiKey:a})&&O(a)}catch(a){console.log("Error updating requireApiKey:",a)}},be=async()=>{try{let a=async()=>{let a=await fetch("/api/keys");if(!a.ok)throw Error(`Failed to load the API keys (HTTP ${a.status})`);return(await a.json()).keys||[]},c=await a();if(0===c.length){let b=!1;try{b=(await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"Default Key"})})).ok}catch{}b&&(c=await a())}b(c),j("")}catch(a){console.log("Error fetching data:",a),j(a.message||"Failed to load the API keys.")}finally{h(!1)}},bf=async(...a)=>{if(!aU.current)return!1;ag(!0),ai("Waiting for tunnel ready...");let b=a.filter(Boolean).map(a=>`${a}/api/health`),c=new AbortController,{signal:d}=c,e=Date.now();for(;Date.now()-e<E.Cp&&aU.current&&(await new Promise(a=>setTimeout(a,E.Hx)),aU.current);){if(await Promise.any(b.map(async a=>{if((await fetch(a,{mode:"cors",cache:"no-store",signal:d})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return $(!0),ag(!1),ai(""),!0;if((Date.now()-e)%1e4<E.Hx)try{let a=await fetch("/api/tunnel/status",{signal:d});if(a.ok){let b=await a.json();if(!b.tunnel?.enabled)return ak({type:"error",message:"Tunnel process stopped unexpectedly."}),ag(!1),ai(""),!1}}catch{}}return c.abort(),!!aU.current&&(ak({type:"error",message:"Tunnel created but not reachable. Please try again."}),ag(!1),ai(""),!1)},bg=async()=>{am(!1),ag(!0),ak(null),ai("Creating tunnel...");let a=!0;(async()=>{let b=new AbortController;for(aV.current=b;a;){if(!aU.current){a=!1;break}try{let c=await fetch("/api/tunnel/status",{signal:b.signal});if(c.ok){let b=await c.json();b.download?.downloading?ai(`Downloading cloudflared... ${b.download.progress}%`):a&&ai("Creating tunnel...")}}catch{}if(!a||!aU.current)break;await new Promise(a=>setTimeout(a,1e3))}aV.current===b&&(aV.current=null)})();try{let b=await fetch("/api/tunnel/enable",{method:"POST"});a=!1;let c=await b.json();if(!b.ok)return void ak({type:"error",message:c.error||"Failed to enable tunnel"});let d=c.tunnelUrl;if(!d)return void ak({type:"error",message:"No tunnel URL returned"});ac(d),ae(c.publicUrl||""),await bf(c.publicUrl,d)}catch(a){ak({type:"error",message:a.message})}finally{a=!1,ag(!1),ai("")}},bh=async()=>{ag(!0),ak(null);try{let a=await fetch("/api/tunnel/disable",{method:"POST"}),b=await a.json();a.ok?($(!1),ac(""),ao(!1),ak({type:"success",message:"Tunnel disabled"})):ak({type:"error",message:b.error||"Failed to disable tunnel"})}catch(a){ak({type:"error",message:a.message})}finally{ag(!1)}},bi=async()=>{aG(null);try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok){let b=await a.json();return aG(b.installed),b}}catch{}return aG(!1),{installed:!1}},bj=async()=>{aI(!0),aA(null),aK([]);try{let a=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:aL})});aM("");let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(d=f.pop()||"",f)){let b=a.split("\n"),c="progress",d=null;for(let a of b)if(a.startsWith("event: ")&&(c=a.slice(7).trim()),a.startsWith("data: "))try{d=JSON.parse(a.slice(6))}catch{}if(d)if("progress"===c)aK(a=>[...a.slice(-50),d.message]);else if("done"===c){aG(!0),aI(!1),aQ(!1),bn();return}else"error"===c&&aA({type:"error",message:d.error||"Install failed"})}}}catch(a){aA({type:"error",message:a.message})}finally{aI(!1)}},bk=async a=>{if(!aU.current)return!1;ay("Waiting for Tailscale ready...");let b=`${a}/api/health`,c=new AbortController,{signal:d}=c,e=Date.now();for(;Date.now()-e<E.Cp&&aU.current&&(await new Promise(a=>setTimeout(a,E.Hx)),aU.current);)try{let a=await fetch(b,{mode:"no-cors",cache:"no-store",signal:d});if(a.ok||"opaque"===a.type)return!0}catch{}return c.abort(),!1},bl=(a,b)=>{aC(a),aE(b)},bm=()=>{aC(""),aE("")},bn=async()=>{aQ(!1),aO(!0),aw(!0),aA(null),ay("Connecting..."),bm();try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){au(b.tunnelUrl||"");let a=await bk(b.tunnelUrl);aq(!0),aA(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.needsLogin&&b.authUrl){bl(b.authUrl,"Open Login Page"),ay('Login required — click "Open Login Page" to continue');for(let a=0;a<40;a++){if(await new Promise(a=>setTimeout(a,3e3)),!aU.current)return;try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok&&(await a.json()).loggedIn){bm(),ay("Starting funnel...");let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){au(b.tunnelUrl||"");let a=await bk(b.tunnelUrl);aq(!0),aA(a?null:{type:"warning",message:"Connected but not reachable yet."})}else b.funnelNotEnabled&&b.enableUrl?await bo(b.enableUrl):aA({type:"error",message:b.error||"Failed to start funnel"});return}}catch{}}bm(),aA({type:"error",message:"Login timed out. Please try again."});return}if(b.funnelNotEnabled&&b.enableUrl)return void await bo(b.enableUrl);aA({type:"error",message:b.error||"Failed to connect"})}catch(a){aA({type:"error",message:a.message})}finally{aw(!1),aO(!1),ay(""),bm()}},bo=async a=>{bl(a,"Open Funnel Settings"),ay('Click "Open Funnel Settings" to enable Funnel...');for(let a=0;a<40;a++){if(await new Promise(a=>setTimeout(a,3e3)),!aU.current)return;try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){bm(),au(b.tunnelUrl||"");let a=await bk(b.tunnelUrl);aq(!0),aA(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.funnelNotEnabled)continue;if(b.error){bm(),aA({type:"error",message:b.error});return}}catch{}}bm(),aA({type:"error",message:"Timed out waiting for Funnel to be enabled."})},bp=async()=>{aw(!0),aA(null);try{let a=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),b=await a.json();a.ok?(aq(!1),au(""),aS(!1),aA({type:"success",message:"Tailscale disabled"})):aA({type:"error",message:b.error||"Failed to disable Tailscale"})}catch(a){aA({type:"error",message:a.message})}finally{aw(!1)}},bq=async()=>{aA(null),aK([]);let a=await bi();a?.installed&&a?.hasCachedPassword?bn():aQ(!0)},br=async()=>{if(w.trim()){p("");try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:w})}),b=await a.json().catch(()=>({}));if(!a.ok)return void p(b.error||"Failed to create the key.");C(b.key),await be(),y(""),t(!1)}catch(a){console.log("Error creating key:",a),p(a.message||"Failed to create the key.")}}},bs=async c=>{K({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{K(null);try{(await fetch(`/api/keys/${c}`,{method:"DELETE"})).ok&&b(a.filter(a=>a.id!==c))}catch(a){console.log("Error deleting key:",a)}}})},bt=async(a,c)=>{l("");try{let d=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:c})});if(d.ok)b(b=>b.map(b=>b.id===a?{...b,isActive:c}:b));else{let a=await d.json().catch(()=>({}));l(a.error||"Failed to update the key.")}}catch(a){console.log("Error toggling key:",a),l(a.message||"Failed to update the key.")}},bu=async(a,c)=>{l("");try{let d=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({access:c})}),e=await d.json().catch(()=>({}));d.ok&&e.key?b(b=>b.map(b=>b.id===a?{...b,access:e.key.access}:b)):l(e.error||"Failed to update the key access.")}catch(a){console.log("Error updating key access:",a),l(a.message||"Failed to update the key access.")}},[bv,bw]=(0,e.useState)("/v1");if(c)return(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(f.Qv,{}),(0,d.jsx)(f.Qv,{})]});let bx=a.filter(a=>!1!==a.isActive).length,by=()=>{a8?aA({type:"error",message:`Security required: ${a9}`}):bq()};return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"mb-6 flex flex-col justify-between gap-5 sm:mb-8 sm:flex-row sm:items-end",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("span",{className:"eyebrow",children:[(0,d.jsx)("span",{className:"eyebrow-dot","aria-hidden":"true"}),"Access control"]}),(0,d.jsx)("h2",{className:"mt-4 text-2xl font-semibold tracking-[-0.035em] sm:text-3xl",children:"Endpoint & API keys."}),(0,d.jsx)("p",{className:"muted mt-2 max-w-xl text-sm leading-relaxed",children:"One endpoint for every tool that talks to this gateway. Keys are shown once, then only a hash is kept on disk."})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>{be(),bb()},children:[(0,d.jsx)(m,{className:`h-3.5 w-3.5 ${c?"animate-spin":""}`,"aria-hidden":"true"}),"Refresh"]}),(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:()=>{p(""),t(!0)},children:[(0,d.jsx)(o,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Create key"]})]})]}),(0,d.jsxs)("div",{className:"grid gap-5 xl:grid-cols-[minmax(0,1.6fr)_minmax(0,1fr)]",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,d.jsxs)(f.Zp,{id:"require-api-key",className:"overflow-hidden !p-0",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 border-b border-line p-4 sm:flex-row sm:items-center sm:justify-between sm:p-5",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("h2",{className:"flex items-center gap-2 text-sm font-semibold",children:[(0,d.jsx)(q,{className:"h-4 w-4 text-gold-text","aria-hidden":"true"}),"API keys"]}),(0,d.jsx)("p",{className:"muted mt-1 text-xs",children:c?"Loading keys…":`${bx} active of ${a.length} ${1===a.length?"key":"keys"}`})]}),(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>{p(""),t(!0)},children:[(0,d.jsx)(o,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"New key"]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between border-b border-line px-4 py-3 sm:px-5",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Require API key"}),(0,d.jsx)("p",{className:"muted text-xs",children:"Requests without a valid key will be rejected"})]}),(0,d.jsx)(f.lM,{checked:M,onChange:()=>bd(!M)})]}),a4&&!M&&(0,d.jsx)("div",{className:"px-4 pt-3 sm:px-5",children:(0,d.jsx)(I,{message:"Endpoint is exposed without an API key."})}),i||k?(0,d.jsx)("div",{className:"flex items-center gap-2 p-4 sm:p-5",children:(0,d.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-danger/30 bg-danger/10 px-3 py-2 text-sm text-danger",children:[(0,d.jsx)(s,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),i||k]})}):null,0===a.length?(0,d.jsxs)("div",{className:"px-5 py-12 text-center",children:[(0,d.jsx)("span",{className:"mx-auto grid h-14 w-14 place-items-center rounded-2xl border border-gold/25 bg-gold-soft text-gold-text",children:(0,d.jsx)(q,{className:"h-6 w-6","aria-hidden":"true"})}),(0,d.jsx)("p",{className:"mt-4 text-sm font-semibold",children:"No API keys yet"}),(0,d.jsx)("p",{className:"muted mt-1 text-xs",children:"Create your first key so CLI tools and IDE extensions can call the gateway."}),(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",className:"mt-4",onClick:()=>{p(""),t(!0)},children:[(0,d.jsx)(o,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Create key"]})]}):(0,d.jsx)("ul",{className:"divide-y divide-line",children:a.map(a=>(0,d.jsx)("li",{className:`p-4 sm:p-5 ${!1===a.isActive?"opacity-70":""}`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("p",{className:"text-sm font-semibold",children:a.name}),(0,d.jsx)("span",{className:`rounded-full border px-2 py-0.5 font-mono text-[9px] uppercase tracking-wide ${!1!==a.isActive?"border-success/25 bg-success/10 text-success":"border-line-strong bg-surface-2 text-muted"}`,children:!1!==a.isActive?"active":"paused"})]}),(0,d.jsxs)("div",{className:"mt-1.5 flex items-center gap-1.5 min-w-0",children:[(0,d.jsx)("code",{className:"break-all font-mono text-[11px] text-muted",children:a.key}),(0,d.jsx)(Q,{value:a.key,label:`key_${a.id}`})]}),(0,d.jsxs)("p",{className:"muted mt-1.5 text-[11px]",children:["Created ",new Date(a.createdAt).toLocaleDateString()]}),(0,d.jsx)(L,{apiKey:a,onChange:b=>bu(a.id,b),onRequestRestrict:()=>K({title:"Restrict API Key",message:`Restrict API key "${a.name}"?
|
|
2
2
|
|
|
3
|
-
It will only be able to call the combos and models you add. Until you add one, it can call nothing.`,onConfirm:async()=>{
|
|
3
|
+
It will only be able to call the combos and models you add. Until you add one, it can call nothing.`,onConfirm:async()=>{K(null),bu(a.id,{restricted:!0,allow:a.access?.allow||[]})}})}),(0,d.jsx)(N,{apiKey:a})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,d.jsx)(f.lM,{size:"sm",checked:!1!==a.isActive,onChange:b=>{!1===a.isActive||b?bt(a.id,b):K({title:"Pause API Key",message:`Pause API key "${a.name}"?
|
|
4
4
|
|
|
5
|
-
This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{D(null),ba(a.id,b)}}):ba(a.id,b)},title:a.isActive?"Pause key":"Resume key"}),(0,d.jsx)("button",{onClick:()=>a9(a.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},a.id))})]}),(0,d.jsx)(f.aF,{isOpen:w,title:"Create API Key",onClose:()=>{x(!1),z(""),v("")},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(f.pd,{label:"Key Name",value:y,onChange:a=>z(a.target.value),placeholder:"Production Key"}),u&&(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:u}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(f.$n,{onClick:a8,fullWidth:!0,disabled:!y.trim(),children:"Create"}),(0,d.jsx)(f.$n,{onClick:()=>{x(!1),z("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(f.aF,{isOpen:!!A,title:"API Key Created",onClose:()=>B(null),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,d.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(f.pd,{value:A||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)(f.$n,{variant:"secondary",icon:"created_key"===aR?"check":"content_copy",onClick:()=>aS(A,"created_key"),children:"created_key"===aR?"Copied!":"Copy"})]}),(0,d.jsx)(f.$n,{onClick:()=>B(null),fullWidth:!0,children:"Done"})]})}),(0,d.jsx)(f.aF,{isOpen:aa,title:"Enable Tunnel",onClose:()=>ab(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local OmniHilbras to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-3",children:h.oX.map(a=>(0,d.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:a.icon}),(0,d.jsx)("p",{className:"text-xs font-semibold",children:a.title}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.desc})]},a.title))}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(f.$n,{onClick:aZ,fullWidth:!0,children:"Start Tunnel"}),(0,d.jsx)(f.$n,{onClick:()=>ab(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(f.aF,{isOpen:ac,title:"Disable Tunnel",onClose:()=>!W&&ad(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(f.$n,{onClick:a$,fullWidth:!0,disabled:W,variant:"danger",children:W?"Disabling...":"Disable"}),(0,d.jsx)(f.$n,{onClick:()=>ad(!1),variant:"ghost",fullWidth:!0,disabled:W,children:"Cancel"})]})]})}),(0,d.jsx)(f.aF,{isOpen:aE,title:"Tailscale Funnel",onClose:()=>{aw||(aF(!1),aB(""),ap(null))},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[null===au&&(0,d.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===au&&!aw&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(f.$n,{onClick:a0,fullWidth:!0,children:"Install Tailscale"}),(0,d.jsx)(f.$n,{onClick:()=>aF(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),aw&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),ay.length>0&&(0,d.jsx)("div",{ref:aI,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:ay.map((a,b)=>(0,d.jsx)("div",{children:a},b))})]}),!0===au&&!aw&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(f.$n,{onClick:()=>a4(),fullWidth:!0,children:"Connect"}),(0,d.jsx)(f.$n,{onClick:()=>aF(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ao&&(0,d.jsx)(k,{status:ao})]})}),(0,d.jsx)(f.aF,{isOpen:aG,title:"Disable Tailscale",onClose:()=>!ak&&aH(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(f.$n,{onClick:a6,fullWidth:!0,disabled:ak,variant:"danger",children:ak?"Disabling...":"Disable"}),(0,d.jsx)(f.$n,{onClick:()=>aH(!1),variant:"ghost",fullWidth:!0,disabled:ak,children:"Cancel"})]})]})}),(0,d.jsx)(f.uo,{isOpen:!!C,onClose:()=>D(null),onConfirm:C?.onConfirm,title:C?.title||"Confirm",message:C?.message,variant:"danger"})]})}p.propTypes={apiKey:o().shape({id:o().string.isRequired,name:o().string,access:o().shape({restricted:o().bool,allow:o().arrayOf(o().string)})}).isRequired,onChange:o().func.isRequired,onRequestRestrict:o().func.isRequired},r.propTypes={apiKey:o().shape({id:o().string.isRequired,name:o().string}).isRequired},t.propTypes={apiKey:o().shape({id:o().string.isRequired,name:o().string}).isRequired}},51747:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js","default")},67960:(a,b,c)=>{"use strict";c.d(b,{Cp:()=>g,Hx:()=>f,Iv:()=>m,N9:()=>l,Nv:()=>o,RL:()=>k,YR:()=>i,ev:()=>n,fl:()=>h,hT:()=>d,oX:()=>e,t6:()=>j});let d=["zh-CN","zh-TW"],e=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],f=2e3,g=3e5,h=5e3,i=3e4,j=5,k=1e4,l=6e4,m=5e3,n=[{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}],o=[{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"}]},75138:(a,b,c)=>{Promise.resolve().then(c.bind(c,51747))},93290:(a,b,c)=>{Promise.resolve().then(c.bind(c,34910))}};
|
|
5
|
+
This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{K(null),bt(a.id,b)}})},title:!1!==a.isActive?"Pause key":"Resume key"}),(0,d.jsx)("button",{type:"button",onClick:()=>bs(a.id),"aria-label":`Delete ${a.name}`,className:"muted grid h-8 w-8 place-items-center rounded-lg hover:bg-danger/10 hover:text-danger",children:(0,d.jsx)(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})},a.id))})]}),(0,d.jsxs)(f.Zp,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,d.jsx)(v.A,{className:"h-4 w-4 text-gold-text","aria-hidden":"true"}),(0,d.jsx)("h2",{className:"text-sm font-semibold",children:"Endpoints"})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)(R,{label:"Local",value:bv,copyId:"local_url",copied:a6,onCopy:a7}),(0,d.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-bg-soft/60 px-3 py-2",children:[(0,d.jsx)("span",{className:`mono-label shrink-0 min-w-[88px] text-center rounded px-1.5 py-0.5 ${Z?"bg-gold-soft text-gold-text":""}`,children:"Tunnel"}),Z&&!af&&_?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("code",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-text-main",children:`${ad||ab}/v1`}),(0,d.jsx)(Q,{value:`${ad||ab}/v1`,label:"tunnel_url"}),(0,d.jsx)("button",{type:"button",onClick:()=>ao(!0),className:"muted grid h-7 w-7 place-items-center rounded-lg hover:bg-danger/10 hover:text-danger",title:"Disable Tunnel",children:(0,d.jsx)(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]}):!Z||af||_?af?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"flex flex-1 items-center gap-2 text-xs text-text-muted",children:[(0,d.jsx)(x,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}),ah||"Creating tunnel…"]}),(0,d.jsx)("button",{type:"button",onClick:()=>{aV.current?.abort(),aV.current=null,ag(!1),ai("")},className:"muted grid h-7 w-7 place-items-center rounded-lg hover:bg-danger/10 hover:text-danger",title:"Stop",children:(0,d.jsx)(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]}):aj?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"flex flex-1 items-center gap-2 text-xs text-danger",children:[(0,d.jsx)(s,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),aj.message]}),(0,d.jsxs)(f.$n,{size:"sm",variant:"secondary",onClick:()=>am(!0),children:[(0,d.jsx)(z,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Enable"]})]}):X?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"flex flex-1 items-center gap-2 text-xs text-text-muted",children:[(0,d.jsx)(x,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}),"Checking…"]}),(0,d.jsx)("button",{type:"button",onClick:()=>Y(!1),className:"muted grid h-7 w-7 place-items-center rounded-lg hover:bg-danger/10 hover:text-danger",title:"Stop",children:(0,d.jsx)(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]}):(0,d.jsxs)(f.$n,{size:"sm",variant:"secondary",className:"ml-auto",onClick:()=>{a8?ak({type:"error",message:`Security required: ${a9}`}):M?am(!0):ak({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:[(0,d.jsx)(z,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Enable"]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"flex flex-1 items-center gap-2 text-xs text-warning",children:[(0,d.jsx)(x,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}),a0?"Tunnel reconnecting…":"Tunnel checking…"]}),(0,d.jsx)("button",{type:"button",onClick:()=>ao(!0),className:"muted grid h-7 w-7 place-items-center rounded-lg hover:bg-danger/10 hover:text-danger",title:"Disable Tunnel",children:(0,d.jsx)(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-bg-soft/60 px-3 py-2",children:[(0,d.jsx)("span",{className:`mono-label shrink-0 min-w-[88px] text-center rounded px-1.5 py-0.5 ${ap?"bg-gold-soft text-gold-text":""}`,children:"Tailscale"}),ap&&!av&&ar?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("code",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-text-main",children:`${at}/v1`}),(0,d.jsx)(Q,{value:`${at}/v1`,label:"ts_url"}),(0,d.jsx)("button",{type:"button",onClick:()=>aS(!0),className:"muted grid h-7 w-7 place-items-center rounded-lg hover:bg-danger/10 hover:text-danger",title:"Disable Tailscale",children:(0,d.jsx)(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]}):!ap||av||ar?av||aN?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"flex flex-1 items-center gap-2 text-xs text-text-muted",children:[(0,d.jsx)(x,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}),ax||"Connecting…"]}),aB&&(0,d.jsx)(f.$n,{size:"sm",variant:"secondary",onClick:()=>window.open(aB,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:aD||"Open"}),(0,d.jsx)("button",{type:"button",onClick:()=>{aw(!1),aO(!1),ay(""),bm()},className:"muted grid h-7 w-7 place-items-center rounded-lg hover:bg-danger/10 hover:text-danger",title:"Stop",children:(0,d.jsx)(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]}):az?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"flex flex-1 items-center gap-2 text-xs text-danger",children:[(0,d.jsx)(s,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),az.message]}),(0,d.jsxs)(f.$n,{size:"sm",variant:"secondary",onClick:by,children:[(0,d.jsx)(v.A,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Enable"]})]}):(0,d.jsxs)(f.$n,{size:"sm",variant:"secondary",className:"ml-auto",onClick:by,children:[(0,d.jsx)(v.A,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Enable"]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"flex flex-1 items-center gap-2 text-xs text-warning",children:[(0,d.jsx)(x,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}),a2?"Tailscale reconnecting…":"Tailscale checking…"]}),(0,d.jsx)("button",{type:"button",onClick:()=>aS(!0),className:"muted grid h-7 w-7 place-items-center rounded-lg hover:bg-danger/10 hover:text-danger",title:"Disable Tailscale",children:(0,d.jsx)(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}),a8&&!Z&&!ap||Z||ap?(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[a8&&!Z&&!ap&&(0,d.jsx)(I,{message:a9,action:{label:"Open settings",href:"/dashboard/profile"}}),(Z||ap)&&!M&&(0,d.jsx)(I,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(Z||ap)&&(!P||!T)&&(0,d.jsx)(I,{message:P?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:P?"Change password":"Enable",href:"/dashboard/profile"}})]}):null,(Z||ap)&&(0,d.jsxs)("div",{className:"mt-4 flex items-center gap-3 border-t border-line pt-4",children:[(0,d.jsx)(f.lM,{checked:V,onChange:()=>bc(!V)}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Allow dashboard access via tunnel"}),(0,d.jsx)(H,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]})]}),(0,d.jsxs)("div",{className:"space-y-5",children:[(0,d.jsxs)(f.Zp,{children:[(0,d.jsx)("h2",{className:"text-sm font-semibold",children:"Require API key"}),(0,d.jsxs)("div",{className:"mt-3 flex items-start justify-between gap-4",children:[(0,d.jsx)("p",{className:"muted text-xs leading-relaxed",children:"When enforcement is on, clients must send a valid key. The dashboard stays exempt so it can keep testing models."}),(0,d.jsx)(f.lM,{checked:M,onChange:()=>bd(!M)})]}),M&&0===a.length&&!c&&(0,d.jsxs)("p",{className:"mt-3 flex items-start gap-2 rounded-lg border border-danger/25 bg-danger/10 px-3 py-2 text-[11px] text-danger",children:[(0,d.jsx)(s,{className:"mt-0.5 h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),"Enforcement is on and no keys exist, so every client is rejected."]}),M&&a.length>0&&(0,d.jsxs)("p",{className:"mt-3 flex items-start gap-2 rounded-lg border border-gold/25 bg-gold-soft px-3 py-2 text-[11px] text-gold-text",children:[(0,d.jsx)(B,{className:"mt-0.5 h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),0===bx?"All keys are paused, so no client can authenticate.":"Clients authenticate with a bearer token on every request."]})]}),(0,d.jsxs)(f.Zp,{children:[(0,d.jsxs)("h2",{className:"flex items-center gap-2 text-sm font-semibold",children:[(0,d.jsx)(D,{className:"h-4 w-4 text-gold-text","aria-hidden":"true"}),"Client setup"]}),(0,d.jsx)("p",{className:"muted mt-1 text-xs",children:"Point any OpenAI-compatible client at the local gateway."}),(0,d.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,d.jsx)(R,{label:"Base URL",value:`${bv}`,copyId:"client_base",copied:a6,onCopy:a7}),(0,d.jsx)(R,{label:"Header",value:"Authorization: Bearer <key>",copyId:"client_header"}),(0,d.jsx)(R,{label:"Also accepted",value:"x-api-key: <key>",copyId:"client_xkey"})]}),(0,d.jsx)("p",{className:"muted mt-3 text-[11px] leading-relaxed",children:"Keys are never accepted in the query string, and a paused or deleted key stops working immediately."})]})]})]}),(0,d.jsxs)("div",{className:"mt-5 flex flex-col items-start justify-between gap-3 rounded-xl border border-gold/20 bg-gold-soft/45 px-4 py-3.5 sm:flex-row sm:items-center sm:px-5",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)(B,{className:"mt-0.5 h-4 w-4 shrink-0 text-gold-text","aria-hidden":"true"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs font-semibold",children:"Secrets are hashed, not stored."}),(0,d.jsx)("p",{className:"muted mt-1 text-[11px]",children:"OmniHilbras keeps a SHA-256 hash per key on disk and shows the secret exactly once."})]})]}),(0,d.jsx)("span",{className:"font-mono text-[10px] text-gold-text",children:"local mode \xb7 0600"})]}),(0,d.jsx)(f.aF,{isOpen:r,title:"Create API Key",onClose:()=>{t(!1),y(""),p("")},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(f.pd,{label:"Key Name",value:w,onChange:a=>y(a.target.value),placeholder:"Production Key"}),n&&(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:n}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(f.$n,{onClick:br,fullWidth:!0,disabled:!w.trim(),children:"Create"}),(0,d.jsx)(f.$n,{onClick:()=>{t(!1),y("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(f.aF,{isOpen:!!A,title:"API Key Created",onClose:()=>C(null),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,d.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(f.pd,{value:A||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)(f.$n,{variant:"secondary",icon:"created_key"===a6?"check":"content_copy",onClick:()=>a7(A,"created_key"),children:"created_key"===a6?"Copied!":"Copy"})]}),(0,d.jsx)(f.$n,{onClick:()=>C(null),fullWidth:!0,children:"Done"})]})}),(0,d.jsx)(f.aF,{isOpen:al,title:"Enable Tunnel",onClose:()=>am(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local OmniHilbras to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-3",children:E.oX.map(a=>(0,d.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:a.icon}),(0,d.jsx)("p",{className:"text-xs font-semibold",children:a.title}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.desc})]},a.title))}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(f.$n,{onClick:bg,fullWidth:!0,children:"Start Tunnel"}),(0,d.jsx)(f.$n,{onClick:()=>am(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(f.aF,{isOpen:an,title:"Disable Tunnel",onClose:()=>!af&&ao(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(f.$n,{onClick:bh,fullWidth:!0,disabled:af,variant:"danger",children:af?"Disabling...":"Disable"}),(0,d.jsx)(f.$n,{onClick:()=>ao(!1),variant:"ghost",fullWidth:!0,disabled:af,children:"Cancel"})]})]})}),(0,d.jsx)(f.aF,{isOpen:aP,title:"Tailscale Funnel",onClose:()=>{aH||(aQ(!1),aM(""),aA(null))},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[null===aF&&(0,d.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===aF&&!aH&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(f.$n,{onClick:bj,fullWidth:!0,children:"Install Tailscale"}),(0,d.jsx)(f.$n,{onClick:()=>aQ(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),aH&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),aJ.length>0&&(0,d.jsx)("div",{ref:aT,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:aJ.map((a,b)=>(0,d.jsx)("div",{children:a},b))})]}),!0===aF&&!aH&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(f.$n,{onClick:()=>bn(),fullWidth:!0,children:"Connect"}),(0,d.jsx)(f.$n,{onClick:()=>aQ(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),az&&(0,d.jsx)(G,{status:az})]})}),(0,d.jsx)(f.aF,{isOpen:aR,title:"Disable Tailscale",onClose:()=>!av&&aS(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(f.$n,{onClick:bp,fullWidth:!0,disabled:av,variant:"danger",children:av?"Disabling...":"Disable"}),(0,d.jsx)(f.$n,{onClick:()=>aS(!1),variant:"ghost",fullWidth:!0,disabled:av,children:"Cancel"})]})]})}),(0,d.jsx)(f.uo,{isOpen:!!J,onClose:()=>K(null),onConfirm:J?.onConfirm,title:J?.title||"Confirm",message:J?.message,variant:"danger"})]})}L.propTypes={apiKey:K().shape({id:K().string.isRequired,name:K().string,access:K().shape({restricted:K().bool,allow:K().arrayOf(K().string)})}).isRequired,onChange:K().func.isRequired,onRequestRestrict:K().func.isRequired},N.propTypes={apiKey:K().shape({id:K().string.isRequired,name:K().string}).isRequired},P.propTypes={apiKey:K().shape({id:K().string.isRequired,name:K().string}).isRequired}},51747:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js","default")},67960:(a,b,c)=>{"use strict";c.d(b,{Cp:()=>g,Hx:()=>f,Iv:()=>m,N9:()=>l,Nv:()=>o,RL:()=>k,YR:()=>i,ev:()=>n,fl:()=>h,hT:()=>d,oX:()=>e,t6:()=>j});let d=["zh-CN","zh-TW"],e=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],f=2e3,g=3e5,h=5e3,i=3e4,j=5,k=1e4,l=6e4,m=5e3,n=[{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}],o=[{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"}]},75138:(a,b,c)=>{Promise.resolve().then(c.bind(c,51747))},93290:(a,b,c)=>{Promise.resolve().then(c.bind(c,27329))}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=820,exports.ids=[820],exports.modules={3662:(a,b,c)=>{c.d(b,{EQ:()=>f,LY:()=>d,O:()=>e,fh:()=>h,t2:()=>i,wf:()=>g});let d={400:{type:"invalid_request_error",code:"bad_request"},401:{type:"authentication_error",code:"invalid_api_key"},402:{type:"billing_error",code:"payment_required"},403:{type:"permission_error",code:"insufficient_quota"},404:{type:"invalid_request_error",code:"model_not_found"},406:{type:"invalid_request_error",code:"model_not_supported"},429:{type:"rate_limit_error",code:"rate_limit_exceeded"},500:{type:"server_error",code:"internal_server_error"},502:{type:"server_error",code:"bad_gateway"},503:{type:"server_error",code:"service_unavailable"},504:{type:"server_error",code:"gateway_timeout"}},e={400:"Bad request",401:"Invalid API key provided",402:"Payment required",403:"You exceeded your current quota",404:"Model not found",406:"Model not supported",429:"Rate limit exceeded",500:"Internal server error",502:"Bad gateway - upstream provider error",503:"Service temporarily unavailable",504:"Gateway timeout"},f={base:2e3,max:3e5,maxLevel:15},g=3e4,h=18e5,i=[{provider:"codex",text:"model is not supported when using codex with a chatgpt account",cooldownMs:18e5},{text:"no credentials",cooldownMs:12e4},{text:"request not allowed",cooldownMs:5e3},{text:"improperly formed request",cooldownMs:12e4},{text:"rate limit",backoff:!0},{text:"too many requests",backoff:!0},{text:"quota exceeded",backoff:!0},{text:"insufficient_quota",backoff:!0},{text:"insufficient quota",backoff:!0},{text:"exceeded your current quota",backoff:!0},{text:"exceeded your quota",backoff:!0},{text:"credit balance",cooldownMs:12e4},{text:"insufficient credit",cooldownMs:12e4},{text:"insufficient balance",cooldownMs:12e4},{text:"insufficient_balance",cooldownMs:12e4},{text:"billing",cooldownMs:12e4},{text:"capacity",backoff:!0},{text:"overloaded",backoff:!0},{status:401,cooldownMs:12e4},{status:402,cooldownMs:12e4},{status:403,cooldownMs:12e4},{status:404,cooldownMs:12e4},{status:429,backoff:!0}]},21719:(a,b,c)=>{c.d(b,{g:()=>m,l:()=>l});var d=c(79646),e=c(33873),f=c.n(e),g=c(29021),h=c.n(g),i=c(21820),j=c.n(i),k=c(30869);async function l(){!function(){try{let a=f().join("win32"===process.platform?f().join(process.env.APPDATA||"","omnihilbras"):f().join(j().homedir(),".omnihilbras"),"mitm",".mitm.pid");if(!h().existsSync(a))return;let b=parseInt(h().readFileSync(a,"utf8").trim(),10);if(!b)return;if("win32"===process.platform)try{(0,d.execSync)(`taskkill /F /T /PID ${b}`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{try{(0,d.execSync)(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${b} -Force"`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{}}else{try{process.kill(b,"SIGTERM")}catch{}try{process.kill(b,"SIGKILL")}catch{}}try{h().unlinkSync(a)}catch{}}catch{}}();let a=function(){let a=[];if("win32"===process.platform){try{(0,d.execSync)('powershell -NonInteractive -WindowStyle Hidden -Command "Get-WmiObject Win32_Process -Filter \'Name=\\"node.exe\\"\' | Select-Object ProcessId,CommandLine | ConvertTo-Csv -NoTypeInformation"',{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").slice(1).filter(a=>a.trim()).forEach(b=>{let c=b.toLowerCase();if(c.includes("node")&&c.includes("omnihilbras")&&(c.includes("cli.js")||c.includes("\\bin\\app\\")||c.includes("/bin/app/"))||c.includes("next-server")){let c=b.match(/^"(\d+)"/);c&&c[1]&&c[1]!==process.pid.toString()&&a.push(c[1])}})}catch{}for(let b of["cloudflared","tray_windows_release"])try{let c=`powershell -NonInteractive -WindowStyle Hidden -Command "Get-Process ${b} -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Id"`;(0,d.execSync)(c,{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").forEach(b=>{let c=b.trim();c&&!isNaN(c)&&a.push(c)})}catch{}}else try{(0,d.execSync)("ps aux 2>/dev/null",{encoding:"utf8",timeout:5e3}).split("\n").forEach(b=>{let c=b.toLowerCase();if(c.includes("node")&&c.includes("omnihilbras")&&(c.includes("cli.js")||c.includes("/bin/app/"))||c.includes("next-server")||c.includes("cloudflared")||c.includes("tray_darwin")||c.includes("tray_linux")){let c=b.trim().split(/\s+/)[1];c&&!isNaN(c)&&c!==process.pid.toString()&&a.push(c)}})}catch{}return a}(),b=process.platform;a.forEach(a=>{try{"win32"===b?(0,d.execSync)(`taskkill /F /PID ${a} 2>nul`,{stdio:"ignore",shell:!0,windowsHide:!0,timeout:3e3}):(0,d.execSync)(`kill -9 ${a} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{}}),a.length>0&&await new Promise(a=>setTimeout(a,1500))}function m(a=k.h0.npmPackageName){let b=function(a){try{if(!a||!h().existsSync(a))return a;let b=f().join(process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?f().join(process.env.APPDATA||f().join(j().homedir(),"AppData","Roaming"),"omnihilbras"):f().join(j().homedir(),".omnihilbras"),"runtime","updater"),c=f().join(b,"updater.js");if(h().existsSync(c))try{if(h().statSync(a).size===h().statSync(c).size)return c}catch{}return h().mkdirSync(b,{recursive:!0}),h().copyFileSync(a,c),c}catch{return a}}(function(){if(process.env.UPDATER_SCRIPT_PATH&&h().existsSync(process.env.UPDATER_SCRIPT_PATH))return process.env.UPDATER_SCRIPT_PATH;let a=f().join(process.cwd(),"src","lib","updater","updater.js");if(h().existsSync(a))return a;let b=f().join(process.cwd(),"..","src","lib","updater","updater.js");return h().existsSync(b)?b:a}()),c="1"===process.env.TRAY_MODE,e={cmd:"win32"===process.platform?"npx.cmd":"npx",args:[k.h0.npmPackageName]},g=c?[...e.args,"--tray","--skip-update"]:[...e.args,"--skip-update"];(0,d.spawn)(process.execPath,[b],{detached:!0,stdio:"ignore",windowsHide:!0,env:{...process.env,UPDATER_PKG_NAME:a,UPDATER_PORT:String(k.h0.statusPort),UPDATER_TAIL_LINES:String(k.h0.statusLogTailLines),UPDATER_RETRIES:String(k.h0.installRetries),UPDATER_RETRY_DELAY_MS:String(k.h0.installRetryDelayMs),UPDATER_LINGER_MS:String(k.h0.lingerAfterDoneMs),UPDATER_WAIT_MIN_MS:String(k.h0.waitForExitMinMs),UPDATER_WAIT_MAX_MS:String(k.h0.waitForExitMaxMs),UPDATER_WAIT_CHECK_MS:String(k.h0.waitForExitCheckMs),UPDATER_APP_PORT:String(k.h0.appPort),UPDATER_RELAUNCH:"1",UPDATER_RELAUNCH_CMD:e.cmd,UPDATER_RELAUNCH_ARGS:JSON.stringify(g)}}).unref(),setTimeout(()=>process.exit(0),k.h0.exitDelayMs)}},30869:(a,b,c)=>{c.d(b,{UY:()=>h,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g,oc:()=>i});var d=c(39006),e=c(40615),f=c(81329);d.rE;let g={npmPackageName:"@hilbras/omnihilbras",installCmd:"npm i -g @hilbras/omnihilbras",installCmdLatest:"npm i -g @hilbras/omnihilbras@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:20128},h={maxLines:200,pollIntervalMs:1e3},i={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.6-terra",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}}},39006:a=>{a.exports={rE:"2.9.
|
|
1
|
+
"use strict";exports.id=820,exports.ids=[820],exports.modules={3662:(a,b,c)=>{c.d(b,{EQ:()=>f,LY:()=>d,O:()=>e,fh:()=>h,t2:()=>i,wf:()=>g});let d={400:{type:"invalid_request_error",code:"bad_request"},401:{type:"authentication_error",code:"invalid_api_key"},402:{type:"billing_error",code:"payment_required"},403:{type:"permission_error",code:"insufficient_quota"},404:{type:"invalid_request_error",code:"model_not_found"},406:{type:"invalid_request_error",code:"model_not_supported"},429:{type:"rate_limit_error",code:"rate_limit_exceeded"},500:{type:"server_error",code:"internal_server_error"},502:{type:"server_error",code:"bad_gateway"},503:{type:"server_error",code:"service_unavailable"},504:{type:"server_error",code:"gateway_timeout"}},e={400:"Bad request",401:"Invalid API key provided",402:"Payment required",403:"You exceeded your current quota",404:"Model not found",406:"Model not supported",429:"Rate limit exceeded",500:"Internal server error",502:"Bad gateway - upstream provider error",503:"Service temporarily unavailable",504:"Gateway timeout"},f={base:2e3,max:3e5,maxLevel:15},g=3e4,h=18e5,i=[{provider:"codex",text:"model is not supported when using codex with a chatgpt account",cooldownMs:18e5},{text:"no credentials",cooldownMs:12e4},{text:"request not allowed",cooldownMs:5e3},{text:"improperly formed request",cooldownMs:12e4},{text:"rate limit",backoff:!0},{text:"too many requests",backoff:!0},{text:"quota exceeded",backoff:!0},{text:"insufficient_quota",backoff:!0},{text:"insufficient quota",backoff:!0},{text:"exceeded your current quota",backoff:!0},{text:"exceeded your quota",backoff:!0},{text:"credit balance",cooldownMs:12e4},{text:"insufficient credit",cooldownMs:12e4},{text:"insufficient balance",cooldownMs:12e4},{text:"insufficient_balance",cooldownMs:12e4},{text:"billing",cooldownMs:12e4},{text:"capacity",backoff:!0},{text:"overloaded",backoff:!0},{status:401,cooldownMs:12e4},{status:402,cooldownMs:12e4},{status:403,cooldownMs:12e4},{status:404,cooldownMs:12e4},{status:429,backoff:!0}]},21719:(a,b,c)=>{c.d(b,{g:()=>m,l:()=>l});var d=c(79646),e=c(33873),f=c.n(e),g=c(29021),h=c.n(g),i=c(21820),j=c.n(i),k=c(30869);async function l(){!function(){try{let a=f().join("win32"===process.platform?f().join(process.env.APPDATA||"","omnihilbras"):f().join(j().homedir(),".omnihilbras"),"mitm",".mitm.pid");if(!h().existsSync(a))return;let b=parseInt(h().readFileSync(a,"utf8").trim(),10);if(!b)return;if("win32"===process.platform)try{(0,d.execSync)(`taskkill /F /T /PID ${b}`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{try{(0,d.execSync)(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${b} -Force"`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{}}else{try{process.kill(b,"SIGTERM")}catch{}try{process.kill(b,"SIGKILL")}catch{}}try{h().unlinkSync(a)}catch{}}catch{}}();let a=function(){let a=[];if("win32"===process.platform){try{(0,d.execSync)('powershell -NonInteractive -WindowStyle Hidden -Command "Get-WmiObject Win32_Process -Filter \'Name=\\"node.exe\\"\' | Select-Object ProcessId,CommandLine | ConvertTo-Csv -NoTypeInformation"',{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").slice(1).filter(a=>a.trim()).forEach(b=>{let c=b.toLowerCase();if(c.includes("node")&&c.includes("omnihilbras")&&(c.includes("cli.js")||c.includes("\\bin\\app\\")||c.includes("/bin/app/"))||c.includes("next-server")){let c=b.match(/^"(\d+)"/);c&&c[1]&&c[1]!==process.pid.toString()&&a.push(c[1])}})}catch{}for(let b of["cloudflared","tray_windows_release"])try{let c=`powershell -NonInteractive -WindowStyle Hidden -Command "Get-Process ${b} -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Id"`;(0,d.execSync)(c,{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").forEach(b=>{let c=b.trim();c&&!isNaN(c)&&a.push(c)})}catch{}}else try{(0,d.execSync)("ps aux 2>/dev/null",{encoding:"utf8",timeout:5e3}).split("\n").forEach(b=>{let c=b.toLowerCase();if(c.includes("node")&&c.includes("omnihilbras")&&(c.includes("cli.js")||c.includes("/bin/app/"))||c.includes("next-server")||c.includes("cloudflared")||c.includes("tray_darwin")||c.includes("tray_linux")){let c=b.trim().split(/\s+/)[1];c&&!isNaN(c)&&c!==process.pid.toString()&&a.push(c)}})}catch{}return a}(),b=process.platform;a.forEach(a=>{try{"win32"===b?(0,d.execSync)(`taskkill /F /PID ${a} 2>nul`,{stdio:"ignore",shell:!0,windowsHide:!0,timeout:3e3}):(0,d.execSync)(`kill -9 ${a} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{}}),a.length>0&&await new Promise(a=>setTimeout(a,1500))}function m(a=k.h0.npmPackageName){let b=function(a){try{if(!a||!h().existsSync(a))return a;let b=f().join(process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?f().join(process.env.APPDATA||f().join(j().homedir(),"AppData","Roaming"),"omnihilbras"):f().join(j().homedir(),".omnihilbras"),"runtime","updater"),c=f().join(b,"updater.js");if(h().existsSync(c))try{if(h().statSync(a).size===h().statSync(c).size)return c}catch{}return h().mkdirSync(b,{recursive:!0}),h().copyFileSync(a,c),c}catch{return a}}(function(){if(process.env.UPDATER_SCRIPT_PATH&&h().existsSync(process.env.UPDATER_SCRIPT_PATH))return process.env.UPDATER_SCRIPT_PATH;let a=f().join(process.cwd(),"src","lib","updater","updater.js");if(h().existsSync(a))return a;let b=f().join(process.cwd(),"..","src","lib","updater","updater.js");return h().existsSync(b)?b:a}()),c="1"===process.env.TRAY_MODE,e={cmd:"win32"===process.platform?"npx.cmd":"npx",args:[k.h0.npmPackageName]},g=c?[...e.args,"--tray","--skip-update"]:[...e.args,"--skip-update"];(0,d.spawn)(process.execPath,[b],{detached:!0,stdio:"ignore",windowsHide:!0,env:{...process.env,UPDATER_PKG_NAME:a,UPDATER_PORT:String(k.h0.statusPort),UPDATER_TAIL_LINES:String(k.h0.statusLogTailLines),UPDATER_RETRIES:String(k.h0.installRetries),UPDATER_RETRY_DELAY_MS:String(k.h0.installRetryDelayMs),UPDATER_LINGER_MS:String(k.h0.lingerAfterDoneMs),UPDATER_WAIT_MIN_MS:String(k.h0.waitForExitMinMs),UPDATER_WAIT_MAX_MS:String(k.h0.waitForExitMaxMs),UPDATER_WAIT_CHECK_MS:String(k.h0.waitForExitCheckMs),UPDATER_APP_PORT:String(k.h0.appPort),UPDATER_RELAUNCH:"1",UPDATER_RELAUNCH_CMD:e.cmd,UPDATER_RELAUNCH_ARGS:JSON.stringify(g)}}).unref(),setTimeout(()=>process.exit(0),k.h0.exitDelayMs)}},30869:(a,b,c)=>{c.d(b,{UY:()=>h,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g,oc:()=>i});var d=c(39006),e=c(40615),f=c(81329);d.rE;let g={npmPackageName:"@hilbras/omnihilbras",installCmd:"npm i -g @hilbras/omnihilbras",installCmdLatest:"npm i -g @hilbras/omnihilbras@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:20128},h={maxLines:200,pollIntervalMs:1e3},i={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.6-terra",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}}},39006:a=>{a.exports={rE:"2.9.8"}},41004:(a,b,c)=>{c.d(b,{C8:()=>s,DR:()=>r,Ey:()=>k,IK:()=>m,Kv:()=>j,Ps:()=>g,SA:()=>p,Uc:()=>n,Z1:()=>i,ZL:()=>t,cI:()=>q,eo:()=>o,gx:()=>d,jk:()=>u,pH:()=>l,v1:()=>e,xM:()=>h}),c(3662);let d={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},e={sessionTtlMs:72e5,sessionCleanupIntervalMs:18e5,dnsCacheTtlMs:3e5,proxyDispatchersMaxSize:20};function f(a,b){let c=process.env[a];if(null==c||""===c)return b;let d=parseInt(c,10);return Number.isFinite(d)&&d>0?d:b}let g=process.env.SEARXNG_URL?.trim()||"http://localhost:8888/search",h=f("STREAM_STALL_TIMEOUT_MS",36e4),i=f("STREAM_FIRST_CHUNK_TIMEOUT_MS",2e5),j=f("UPSTREAM_MAX_BODY_BYTES",0x2000000),k=f("UPSTREAM_TOTAL_TIMEOUT_MS",18e5),l=f("FETCH_CONNECT_TIMEOUT_MS",6e4),m=f("GEMINI_NATIVE_TTS_FETCH_TIMEOUT_MS",45e3),n=64e3,o=32e3,p="x-omnihilbras-token-saver",q={429:{attempts:0,delayMs:0},502:{attempts:3,delayMs:3e3},503:{attempts:3,delayMs:2e3},504:{attempts:2,delayMs:3e3}};function r(a){return null==a?{attempts:0,delayMs:2e3}:"number"==typeof a?{attempts:a,delayMs:2e3}:{attempts:a.attempts||0,delayMs:null!=a.delayMs?a.delayMs:2e3}}let s=["Please write a 5-10 word title for the following conversation:"],t={candidates:[{flavor:"openai-billing",path:"/dashboard/billing/subscription"},{flavor:"openai-billing",path:"/dashboard/billing/usage"},{flavor:"new-api",path:"/api/user/self"}],usageWindowDays:30,unsupportedTtlMs:f("AGGREGATOR_UNSUPPORTED_TTL_MS",6e5),newApiQuotaPerUnit:5e5,fetchTimeoutMs:1e4},u={supabaseUrl:process.env.AGGREGATOR_WALLET_SUPABASE_URL,anonKey:process.env.AGGREGATOR_WALLET_ANON_KEY,authBaseUrl:process.env.AGGREGATOR_WALLET_AUTH_BASE_URL,walletTable:"wallets",walletColumns:["balance_paid","balance_trial","balance_bonus","balance_bonus_locked"],lockedColumn:"balance_bonus_locked"}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=8287,exports.ids=[8287],exports.modules={3662:(a,b,c)=>{c.d(b,{EQ:()=>f,LY:()=>d,O:()=>e,fh:()=>h,t2:()=>i,wf:()=>g});let d={400:{type:"invalid_request_error",code:"bad_request"},401:{type:"authentication_error",code:"invalid_api_key"},402:{type:"billing_error",code:"payment_required"},403:{type:"permission_error",code:"insufficient_quota"},404:{type:"invalid_request_error",code:"model_not_found"},406:{type:"invalid_request_error",code:"model_not_supported"},429:{type:"rate_limit_error",code:"rate_limit_exceeded"},500:{type:"server_error",code:"internal_server_error"},502:{type:"server_error",code:"bad_gateway"},503:{type:"server_error",code:"service_unavailable"},504:{type:"server_error",code:"gateway_timeout"}},e={400:"Bad request",401:"Invalid API key provided",402:"Payment required",403:"You exceeded your current quota",404:"Model not found",406:"Model not supported",429:"Rate limit exceeded",500:"Internal server error",502:"Bad gateway - upstream provider error",503:"Service temporarily unavailable",504:"Gateway timeout"},f={base:2e3,max:3e5,maxLevel:15},g=3e4,h=18e5,i=[{provider:"codex",text:"model is not supported when using codex with a chatgpt account",cooldownMs:18e5},{text:"no credentials",cooldownMs:12e4},{text:"request not allowed",cooldownMs:5e3},{text:"improperly formed request",cooldownMs:12e4},{text:"rate limit",backoff:!0},{text:"too many requests",backoff:!0},{text:"quota exceeded",backoff:!0},{text:"insufficient_quota",backoff:!0},{text:"insufficient quota",backoff:!0},{text:"exceeded your current quota",backoff:!0},{text:"exceeded your quota",backoff:!0},{text:"credit balance",cooldownMs:12e4},{text:"insufficient credit",cooldownMs:12e4},{text:"insufficient balance",cooldownMs:12e4},{text:"insufficient_balance",cooldownMs:12e4},{text:"billing",cooldownMs:12e4},{text:"capacity",backoff:!0},{text:"overloaded",backoff:!0},{status:401,cooldownMs:12e4},{status:402,cooldownMs:12e4},{status:403,cooldownMs:12e4},{status:404,cooldownMs:12e4},{status:429,backoff:!0}]},21350:(a,b,c)=>{c.r(b),c.d(b,{DELETE:()=>R,GET:()=>P,POST:()=>Q});var d=c(49796),e=c(23211),f=c(79748),g=c.n(f),h=c(33873),i=c.n(h),j=c(21820),k=c.n(j),l=c(55511),m=c.n(l),n=c(28286),o=c(30869),p=c(54603),q=c(79984),r=c(24424);let s=o.h0.appPort,t=`http://localhost:${s}/api/mcp/`,u=null,v=async()=>(u||(u=await (0,p.X)("9r-cli-auth")),u),w=async a=>{let b=await v();for(let c of a)"string"==typeof c?.url&&c.url.startsWith(t)&&(c.headers={...c.headers||{},"x-9r-cli-token":b});return a},x="gateway",y={coworkEgressAllowedHosts:["*"],disabledBuiltinTools:[],isLocalDevMcpEnabled:!0,isDesktopExtensionEnabled:!0,isDesktopExtensionDirectoryEnabled:!0,isDesktopExtensionSignatureRequired:!1,isClaudeCodeForDesktopEnabled:!0,disableEssentialTelemetry:!0,disableNonessentialTelemetry:!0,disableNonessentialServices:!0},z=()=>{if("darwin"===k().platform()){let a=i().join(k().homedir(),"Library","Application Support");return[i().join(a,"Claude-3p"),i().join(a,"Claude")]}if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return[i().join(a,"Claude-3p"),i().join(b,"Claude-3p"),i().join(a,"Claude"),i().join(b,"Claude")]}return[i().join(k().homedir(),".config","Claude-3p"),i().join(k().homedir(),".config","Claude")]},A=async()=>{let a=z();for(let b of a)try{return await g().access(i().join(b,"configLibrary")),b}catch{}return a[0]},B=()=>z()[0],C=async()=>i().join(await A(),"configLibrary"),D=()=>i().join(B(),"configLibrary"),E=async()=>i().join(await C(),"_meta.json"),F=()=>{if("darwin"===k().platform())return i().join(k().homedir(),"Library","Application Support","Claude");if("win32"===k().platform()){let a=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return i().join(a,"Claude")}return i().join(k().homedir(),".config","Claude")},G=()=>i().join(F(),"claude_desktop_config.json"),H=async()=>{try{let a=(await g().readFile(G(),"utf-8")).replace(/,(\s*[}\]])/g,"$1");return JSON.parse(a)||{}}catch(a){return{}}},I=async a=>{await g().mkdir(F(),{recursive:!0}),await g().writeFile(G(),JSON.stringify(a,null,2))},J=async()=>{let a=await H();return"3p"!==a.deploymentMode&&(a.deploymentMode="3p",await I(a),!0)},K=async()=>{let a=await H();if(!a.mcpServers||"object"!=typeof a.mcpServers)return;let b=new Set(n.LOCAL_STDIO_PLUGINS.map(a=>a.name));for(let c of Object.keys(a.mcpServers))b.has(c)&&delete a.mcpServers[c];0===Object.keys(a.mcpServers).length&&delete a.mcpServers,await I(a)},L=async()=>{for(let a of[...z(),...(()=>{if("darwin"===k().platform())return["/Applications/Claude.app",i().join(k().homedir(),"Applications","Claude.app")];if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.ProgramFiles||"C:\\Program Files";return[i().join(a,"AnthropicClaude"),i().join(b,"Claude"),i().join(b,"AnthropicClaude")]}return[]})()])try{return await g().access(a),!0}catch{}return!1},M=async a=>{try{let b=(await g().readFile(a,"utf-8")).replace(/,(\s*[}\]])/g,"$1");return JSON.parse(b)}catch(a){return null}},N=async()=>{let a=i().join(D(),"_meta.json"),b=await M(a);if(!b||!b.appliedId){let c=await M(await E());if(c?.appliedId)b=c;else{let a=m().randomUUID();b={appliedId:a,entries:[{id:a,name:"Default"}]}}await g().mkdir(D(),{recursive:!0}),await g().writeFile(a,JSON.stringify(b,null,2))}return b};async function O(a){let b=i().join(B(),"config.json"),c={};try{c=JSON.parse(await g().readFile(b,"utf-8"))||{}}catch(a){if("ENOENT"!==a.code)return{error:a.code}}let d={};for(let b of a)b?.name&&(d[b.name]=!0);return c.operonSkipMcpApprovals=d,await g().mkdir(B(),{recursive:!0}),await g().writeFile(b,JSON.stringify(c,null,2)),{written:Object.keys(d).length}}async function P(){try{if(!await L())return e.NextResponse.json({installed:!1,config:null,message:"Claude Desktop (Cowork mode) not detected"});let a=await M(await E()),b=a?.appliedId||null,c=await C(),d=b?i().join(c,`${b}.json`):null,f=d?await M(d):null,g=f?.inferenceGatewayBaseUrl||null,h=Array.isArray(f?.inferenceModels)?f.inferenceModels.map(a=>"string"==typeof a?a:a?.name).filter(Boolean):[],j=Array.isArray(f?.managedMcpServers)?f.managedMcpServers:[],k=!!(f?.inferenceProvider===x&&g),l=new Set(n.LOCAL_STDIO_PLUGINS.map(a=>a.name)),m=j.filter(a=>l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>a.name),o=j.filter(a=>a.custom||!l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>({name:a.name,url:a.url,transport:a.transport,custom:!0}));return e.NextResponse.json({installed:!0,config:f,hasOmniHilbras:k,configPath:d,cowork:{appliedId:b,baseUrl:g,models:h,provider:f?.inferenceProvider||null,plugins:j.filter(a=>!a.custom&&!(l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/"))).map(a=>{let b=a.toolPolicy?Object.keys(a.toolPolicy):[],c=`${a.name}-`,d=new Set;for(let a of b){let b=a;for(;b.startsWith(c);)b=b.slice(c.length);d.add(b)}let e=n.DEFAULT_PLUGINS.find(b=>b.name===a.name),f=e&&Array.isArray(e.toolNames)?e.toolNames:Array.from(d);return{name:a.name,url:a.url,transport:a.transport,oauth:!!a.oauth,toolNames:f}}),localPlugins:m,customPlugins:o},defaultPlugins:n.DEFAULT_PLUGINS,localStdioPlugins:n.LOCAL_STDIO_PLUGINS})}catch(a){return console.log("Error reading cowork settings:",a),e.NextResponse.json({error:"Failed to read cowork settings"},{status:500})}}async function Q(a){try{let{baseUrl:b,apiKey:c,models:d,plugins:f,localPlugins:h,customPlugins:j}=await a.json();if(!b||!c)return e.NextResponse.json({error:"baseUrl and apiKey are required"},{status:400});let k=await (0,q.k)(c),l=Array.isArray(d)?d.filter(a=>"string"==typeof a&&a.trim()):[];if(0===l.length)return e.NextResponse.json({error:"At least one model is required"},{status:400});let m=Array.isArray(f)?f:n.DEFAULT_PLUGINS,o=Array.isArray(h)?h:[],p=(Array.isArray(j)?j:[]).filter(a=>a?.url),r=await w((a=>{let b=Array.isArray(a)?a:[],c=[];for(let a of b){let b=n.LOCAL_STDIO_PLUGINS.find(b=>b.name===a);if(!b)continue;let d={name:b.name,url:`http://localhost:${s}/api/mcp/${b.name}/sse`,transport:"sse"};if(Array.isArray(b.toolNames)&&b.toolNames.length>0){let a=`${b.name}-`,c={};for(let d of b.toolNames)c[d]="allow",c[`${a}${d}`]="allow";d.toolPolicy=c}c.push(d)}return c})(o)),t=await w((a=>{if(!Array.isArray(a))return[];let b=[];for(let c of a)c?.name&&c?.url&&b.push({name:c.name,url:c.url,transport:c.transport||"sse",custom:!0});return b})(p)),u=[...(0,n.buildManagedMcpServers)(m),...r,...t],v=await J(),z=await N(),A=i().join(D(),`${z.appliedId}.json`),B={...y,inferenceProvider:x,inferenceGatewayBaseUrl:b,inferenceGatewayApiKey:k,inferenceModels:l.map(a=>({name:a}))};u.length>0&&(B.managedMcpServers=u),await g().writeFile(A,JSON.stringify(B,null,2));let C=null;try{C=await O(u)}catch(a){C={error:a.message}}try{await K()}catch{}return e.NextResponse.json({success:!0,bootstrapped:v,message:v?"Cowork enabled (3p mode set). Quit & reopen Claude Desktop.":"Cowork settings applied. Quit & reopen Claude Desktop.",configPath:A,skipApprovals:C,localMcp:{applied:o,via:"3p-sse-bridge"}})}catch(a){return console.log("Error applying cowork settings:",a),e.NextResponse.json({error:"Failed to apply cowork settings"},{status:500})}}async function R(){try{let a=await M(await E());if(!a?.appliedId)return e.NextResponse.json({success:!0,message:"No active config to reset"});let b=i().join(await C(),`${a.appliedId}.json`);try{await g().writeFile(b,JSON.stringify({},null,2))}catch(a){if("ENOENT"!==a.code)throw a}try{await O([])}catch{}try{await K()}catch{}return e.NextResponse.json({success:!0,message:"Cowork config reset"})}catch(a){return console.log("Error resetting cowork settings:",a),e.NextResponse.json({error:"Failed to reset cowork settings"},{status:500})}}(0,r.D)([P,Q,R]),(0,d.A)(P,"004517dbe1838f5a142508ce2343035e366226246f",null),(0,d.A)(Q,"404652f62c85465237991833b74ebad72e2be49a93",null),(0,d.A)(R,"00c6499241c3d6c187c751dfe5593380d3198660a7",null)},28286:a=>{a.exports={DEFAULT_PLUGINS:[{name:"exa",title:"Exa",description:"Real-time web search and code documentation",url:"https://mcp.exa.ai/mcp",transport:"http",oauth:!1,toolNames:["web_search_exa","web_fetch_exa"]},{name:"tavily",title:"Tavily",description:"Real-time web search optimized for LLM agents",url:"https://mcp.tavily.com/mcp",transport:"http",oauth:!0,toolNames:["tavily_search","tavily_extract","tavily_crawl","tavily_map"]}],LOCAL_STDIO_PLUGINS:[{name:"browsermcp",title:"Browser MCP",description:"Control your running Chrome (requires Chrome extension)",extensionUrl:"https://chromewebstore.google.com/detail/browser-mcp-automate-your/bjfgambnhccakkhmkepdoekmckoijdlc",command:"npx",args:["-y","@browsermcp/mcp@latest"],toolNames:["browser_navigate","browser_snapshot","browser_click","browser_type","browser_screenshot","browser_get_console_logs","browser_wait","browser_press_key","browser_go_back","browser_go_forward"]}],buildManagedMcpServers:function(a){let b=Array.isArray(a)?a:[],c=[],d=new Set;for(let a of b){if(!a?.name||!a?.url||d.has(a.name))continue;d.add(a.name);let b={name:a.name,url:a.url,transport:a.transport||(/\/sse(\b|\/)/i.test(a.url)?"sse":"http")};if(a.oauth&&(b.oauth=!0),Array.isArray(a.toolNames)&&a.toolNames.length>0){let c=`${a.name}-`,d=new Set;for(let b of a.toolNames){if("string"!=typeof b||!b)continue;let a=b;for(;a.startsWith(c);)a=a.slice(c.length);d.add(a)}let e={};for(let a of d)e[a]="allow",e[`${c}${a}`]="allow";b.toolPolicy=e}c.push(b)}return c}}},30869:(a,b,c)=>{c.d(b,{UY:()=>h,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g,oc:()=>i});var d=c(39006),e=c(40615),f=c(81329);d.rE;let g={npmPackageName:"@hilbras/omnihilbras",installCmd:"npm i -g @hilbras/omnihilbras",installCmdLatest:"npm i -g @hilbras/omnihilbras@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:20128},h={maxLines:200,pollIntervalMs:1e3},i={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.6-terra",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}}},39006:a=>{a.exports={rE:"2.9.6"}},41004:(a,b,c)=>{c.d(b,{C8:()=>s,DR:()=>r,Ey:()=>k,IK:()=>m,Kv:()=>j,Ps:()=>g,SA:()=>p,Uc:()=>n,Z1:()=>i,ZL:()=>t,cI:()=>q,eo:()=>o,gx:()=>d,jk:()=>u,pH:()=>l,v1:()=>e,xM:()=>h}),c(3662);let d={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},e={sessionTtlMs:72e5,sessionCleanupIntervalMs:18e5,dnsCacheTtlMs:3e5,proxyDispatchersMaxSize:20};function f(a,b){let c=process.env[a];if(null==c||""===c)return b;let d=parseInt(c,10);return Number.isFinite(d)&&d>0?d:b}let g=process.env.SEARXNG_URL?.trim()||"http://localhost:8888/search",h=f("STREAM_STALL_TIMEOUT_MS",36e4),i=f("STREAM_FIRST_CHUNK_TIMEOUT_MS",2e5),j=f("UPSTREAM_MAX_BODY_BYTES",0x2000000),k=f("UPSTREAM_TOTAL_TIMEOUT_MS",18e5),l=f("FETCH_CONNECT_TIMEOUT_MS",6e4),m=f("GEMINI_NATIVE_TTS_FETCH_TIMEOUT_MS",45e3),n=64e3,o=32e3,p="x-omnihilbras-token-saver",q={429:{attempts:0,delayMs:0},502:{attempts:3,delayMs:3e3},503:{attempts:3,delayMs:2e3},504:{attempts:2,delayMs:3e3}};function r(a){return null==a?{attempts:0,delayMs:2e3}:"number"==typeof a?{attempts:a,delayMs:2e3}:{attempts:a.attempts||0,delayMs:null!=a.delayMs?a.delayMs:2e3}}let s=["Please write a 5-10 word title for the following conversation:"],t={candidates:[{flavor:"openai-billing",path:"/dashboard/billing/subscription"},{flavor:"openai-billing",path:"/dashboard/billing/usage"},{flavor:"new-api",path:"/api/user/self"}],usageWindowDays:30,unsupportedTtlMs:f("AGGREGATOR_UNSUPPORTED_TTL_MS",6e5),newApiQuotaPerUnit:5e5,fetchTimeoutMs:1e4},u={supabaseUrl:process.env.AGGREGATOR_WALLET_SUPABASE_URL,anonKey:process.env.AGGREGATOR_WALLET_ANON_KEY,authBaseUrl:process.env.AGGREGATOR_WALLET_AUTH_BASE_URL,walletTable:"wallets",walletColumns:["balance_paid","balance_trial","balance_bonus","balance_bonus_locked"],lockedColumn:"balance_bonus_locked"}},54603:(a,b,c)=>{c.d(b,{X:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);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,mode:448}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{f().chmodSync(m,448)}catch{}try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0,mode:448}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},79984:(a,b,c)=>{c.d(b,{k:()=>g});var d=c(47765),e=c(3506);async function f(a){if(a.includes("***"))return!0;try{return(await (0,d.PX)()).some(b=>b.key&&b.key===a)}catch{return!1}}async function g(a){let b=(a||"").trim();return b&&"sk_omnihilbras"!==b&&!await f(b)?b:(0,e.v)()}}};
|
|
1
|
+
"use strict";exports.id=8287,exports.ids=[8287],exports.modules={3662:(a,b,c)=>{c.d(b,{EQ:()=>f,LY:()=>d,O:()=>e,fh:()=>h,t2:()=>i,wf:()=>g});let d={400:{type:"invalid_request_error",code:"bad_request"},401:{type:"authentication_error",code:"invalid_api_key"},402:{type:"billing_error",code:"payment_required"},403:{type:"permission_error",code:"insufficient_quota"},404:{type:"invalid_request_error",code:"model_not_found"},406:{type:"invalid_request_error",code:"model_not_supported"},429:{type:"rate_limit_error",code:"rate_limit_exceeded"},500:{type:"server_error",code:"internal_server_error"},502:{type:"server_error",code:"bad_gateway"},503:{type:"server_error",code:"service_unavailable"},504:{type:"server_error",code:"gateway_timeout"}},e={400:"Bad request",401:"Invalid API key provided",402:"Payment required",403:"You exceeded your current quota",404:"Model not found",406:"Model not supported",429:"Rate limit exceeded",500:"Internal server error",502:"Bad gateway - upstream provider error",503:"Service temporarily unavailable",504:"Gateway timeout"},f={base:2e3,max:3e5,maxLevel:15},g=3e4,h=18e5,i=[{provider:"codex",text:"model is not supported when using codex with a chatgpt account",cooldownMs:18e5},{text:"no credentials",cooldownMs:12e4},{text:"request not allowed",cooldownMs:5e3},{text:"improperly formed request",cooldownMs:12e4},{text:"rate limit",backoff:!0},{text:"too many requests",backoff:!0},{text:"quota exceeded",backoff:!0},{text:"insufficient_quota",backoff:!0},{text:"insufficient quota",backoff:!0},{text:"exceeded your current quota",backoff:!0},{text:"exceeded your quota",backoff:!0},{text:"credit balance",cooldownMs:12e4},{text:"insufficient credit",cooldownMs:12e4},{text:"insufficient balance",cooldownMs:12e4},{text:"insufficient_balance",cooldownMs:12e4},{text:"billing",cooldownMs:12e4},{text:"capacity",backoff:!0},{text:"overloaded",backoff:!0},{status:401,cooldownMs:12e4},{status:402,cooldownMs:12e4},{status:403,cooldownMs:12e4},{status:404,cooldownMs:12e4},{status:429,backoff:!0}]},21350:(a,b,c)=>{c.r(b),c.d(b,{DELETE:()=>R,GET:()=>P,POST:()=>Q});var d=c(49796),e=c(23211),f=c(79748),g=c.n(f),h=c(33873),i=c.n(h),j=c(21820),k=c.n(j),l=c(55511),m=c.n(l),n=c(28286),o=c(30869),p=c(54603),q=c(79984),r=c(24424);let s=o.h0.appPort,t=`http://localhost:${s}/api/mcp/`,u=null,v=async()=>(u||(u=await (0,p.X)("9r-cli-auth")),u),w=async a=>{let b=await v();for(let c of a)"string"==typeof c?.url&&c.url.startsWith(t)&&(c.headers={...c.headers||{},"x-9r-cli-token":b});return a},x="gateway",y={coworkEgressAllowedHosts:["*"],disabledBuiltinTools:[],isLocalDevMcpEnabled:!0,isDesktopExtensionEnabled:!0,isDesktopExtensionDirectoryEnabled:!0,isDesktopExtensionSignatureRequired:!1,isClaudeCodeForDesktopEnabled:!0,disableEssentialTelemetry:!0,disableNonessentialTelemetry:!0,disableNonessentialServices:!0},z=()=>{if("darwin"===k().platform()){let a=i().join(k().homedir(),"Library","Application Support");return[i().join(a,"Claude-3p"),i().join(a,"Claude")]}if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return[i().join(a,"Claude-3p"),i().join(b,"Claude-3p"),i().join(a,"Claude"),i().join(b,"Claude")]}return[i().join(k().homedir(),".config","Claude-3p"),i().join(k().homedir(),".config","Claude")]},A=async()=>{let a=z();for(let b of a)try{return await g().access(i().join(b,"configLibrary")),b}catch{}return a[0]},B=()=>z()[0],C=async()=>i().join(await A(),"configLibrary"),D=()=>i().join(B(),"configLibrary"),E=async()=>i().join(await C(),"_meta.json"),F=()=>{if("darwin"===k().platform())return i().join(k().homedir(),"Library","Application Support","Claude");if("win32"===k().platform()){let a=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return i().join(a,"Claude")}return i().join(k().homedir(),".config","Claude")},G=()=>i().join(F(),"claude_desktop_config.json"),H=async()=>{try{let a=(await g().readFile(G(),"utf-8")).replace(/,(\s*[}\]])/g,"$1");return JSON.parse(a)||{}}catch(a){return{}}},I=async a=>{await g().mkdir(F(),{recursive:!0}),await g().writeFile(G(),JSON.stringify(a,null,2))},J=async()=>{let a=await H();return"3p"!==a.deploymentMode&&(a.deploymentMode="3p",await I(a),!0)},K=async()=>{let a=await H();if(!a.mcpServers||"object"!=typeof a.mcpServers)return;let b=new Set(n.LOCAL_STDIO_PLUGINS.map(a=>a.name));for(let c of Object.keys(a.mcpServers))b.has(c)&&delete a.mcpServers[c];0===Object.keys(a.mcpServers).length&&delete a.mcpServers,await I(a)},L=async()=>{for(let a of[...z(),...(()=>{if("darwin"===k().platform())return["/Applications/Claude.app",i().join(k().homedir(),"Applications","Claude.app")];if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.ProgramFiles||"C:\\Program Files";return[i().join(a,"AnthropicClaude"),i().join(b,"Claude"),i().join(b,"AnthropicClaude")]}return[]})()])try{return await g().access(a),!0}catch{}return!1},M=async a=>{try{let b=(await g().readFile(a,"utf-8")).replace(/,(\s*[}\]])/g,"$1");return JSON.parse(b)}catch(a){return null}},N=async()=>{let a=i().join(D(),"_meta.json"),b=await M(a);if(!b||!b.appliedId){let c=await M(await E());if(c?.appliedId)b=c;else{let a=m().randomUUID();b={appliedId:a,entries:[{id:a,name:"Default"}]}}await g().mkdir(D(),{recursive:!0}),await g().writeFile(a,JSON.stringify(b,null,2))}return b};async function O(a){let b=i().join(B(),"config.json"),c={};try{c=JSON.parse(await g().readFile(b,"utf-8"))||{}}catch(a){if("ENOENT"!==a.code)return{error:a.code}}let d={};for(let b of a)b?.name&&(d[b.name]=!0);return c.operonSkipMcpApprovals=d,await g().mkdir(B(),{recursive:!0}),await g().writeFile(b,JSON.stringify(c,null,2)),{written:Object.keys(d).length}}async function P(){try{if(!await L())return e.NextResponse.json({installed:!1,config:null,message:"Claude Desktop (Cowork mode) not detected"});let a=await M(await E()),b=a?.appliedId||null,c=await C(),d=b?i().join(c,`${b}.json`):null,f=d?await M(d):null,g=f?.inferenceGatewayBaseUrl||null,h=Array.isArray(f?.inferenceModels)?f.inferenceModels.map(a=>"string"==typeof a?a:a?.name).filter(Boolean):[],j=Array.isArray(f?.managedMcpServers)?f.managedMcpServers:[],k=!!(f?.inferenceProvider===x&&g),l=new Set(n.LOCAL_STDIO_PLUGINS.map(a=>a.name)),m=j.filter(a=>l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>a.name),o=j.filter(a=>a.custom||!l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>({name:a.name,url:a.url,transport:a.transport,custom:!0}));return e.NextResponse.json({installed:!0,config:f,hasOmniHilbras:k,configPath:d,cowork:{appliedId:b,baseUrl:g,models:h,provider:f?.inferenceProvider||null,plugins:j.filter(a=>!a.custom&&!(l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/"))).map(a=>{let b=a.toolPolicy?Object.keys(a.toolPolicy):[],c=`${a.name}-`,d=new Set;for(let a of b){let b=a;for(;b.startsWith(c);)b=b.slice(c.length);d.add(b)}let e=n.DEFAULT_PLUGINS.find(b=>b.name===a.name),f=e&&Array.isArray(e.toolNames)?e.toolNames:Array.from(d);return{name:a.name,url:a.url,transport:a.transport,oauth:!!a.oauth,toolNames:f}}),localPlugins:m,customPlugins:o},defaultPlugins:n.DEFAULT_PLUGINS,localStdioPlugins:n.LOCAL_STDIO_PLUGINS})}catch(a){return console.log("Error reading cowork settings:",a),e.NextResponse.json({error:"Failed to read cowork settings"},{status:500})}}async function Q(a){try{let{baseUrl:b,apiKey:c,models:d,plugins:f,localPlugins:h,customPlugins:j}=await a.json();if(!b||!c)return e.NextResponse.json({error:"baseUrl and apiKey are required"},{status:400});let k=await (0,q.k)(c),l=Array.isArray(d)?d.filter(a=>"string"==typeof a&&a.trim()):[];if(0===l.length)return e.NextResponse.json({error:"At least one model is required"},{status:400});let m=Array.isArray(f)?f:n.DEFAULT_PLUGINS,o=Array.isArray(h)?h:[],p=(Array.isArray(j)?j:[]).filter(a=>a?.url),r=await w((a=>{let b=Array.isArray(a)?a:[],c=[];for(let a of b){let b=n.LOCAL_STDIO_PLUGINS.find(b=>b.name===a);if(!b)continue;let d={name:b.name,url:`http://localhost:${s}/api/mcp/${b.name}/sse`,transport:"sse"};if(Array.isArray(b.toolNames)&&b.toolNames.length>0){let a=`${b.name}-`,c={};for(let d of b.toolNames)c[d]="allow",c[`${a}${d}`]="allow";d.toolPolicy=c}c.push(d)}return c})(o)),t=await w((a=>{if(!Array.isArray(a))return[];let b=[];for(let c of a)c?.name&&c?.url&&b.push({name:c.name,url:c.url,transport:c.transport||"sse",custom:!0});return b})(p)),u=[...(0,n.buildManagedMcpServers)(m),...r,...t],v=await J(),z=await N(),A=i().join(D(),`${z.appliedId}.json`),B={...y,inferenceProvider:x,inferenceGatewayBaseUrl:b,inferenceGatewayApiKey:k,inferenceModels:l.map(a=>({name:a}))};u.length>0&&(B.managedMcpServers=u),await g().writeFile(A,JSON.stringify(B,null,2));let C=null;try{C=await O(u)}catch(a){C={error:a.message}}try{await K()}catch{}return e.NextResponse.json({success:!0,bootstrapped:v,message:v?"Cowork enabled (3p mode set). Quit & reopen Claude Desktop.":"Cowork settings applied. Quit & reopen Claude Desktop.",configPath:A,skipApprovals:C,localMcp:{applied:o,via:"3p-sse-bridge"}})}catch(a){return console.log("Error applying cowork settings:",a),e.NextResponse.json({error:"Failed to apply cowork settings"},{status:500})}}async function R(){try{let a=await M(await E());if(!a?.appliedId)return e.NextResponse.json({success:!0,message:"No active config to reset"});let b=i().join(await C(),`${a.appliedId}.json`);try{await g().writeFile(b,JSON.stringify({},null,2))}catch(a){if("ENOENT"!==a.code)throw a}try{await O([])}catch{}try{await K()}catch{}return e.NextResponse.json({success:!0,message:"Cowork config reset"})}catch(a){return console.log("Error resetting cowork settings:",a),e.NextResponse.json({error:"Failed to reset cowork settings"},{status:500})}}(0,r.D)([P,Q,R]),(0,d.A)(P,"004517dbe1838f5a142508ce2343035e366226246f",null),(0,d.A)(Q,"404652f62c85465237991833b74ebad72e2be49a93",null),(0,d.A)(R,"00c6499241c3d6c187c751dfe5593380d3198660a7",null)},28286:a=>{a.exports={DEFAULT_PLUGINS:[{name:"exa",title:"Exa",description:"Real-time web search and code documentation",url:"https://mcp.exa.ai/mcp",transport:"http",oauth:!1,toolNames:["web_search_exa","web_fetch_exa"]},{name:"tavily",title:"Tavily",description:"Real-time web search optimized for LLM agents",url:"https://mcp.tavily.com/mcp",transport:"http",oauth:!0,toolNames:["tavily_search","tavily_extract","tavily_crawl","tavily_map"]}],LOCAL_STDIO_PLUGINS:[{name:"browsermcp",title:"Browser MCP",description:"Control your running Chrome (requires Chrome extension)",extensionUrl:"https://chromewebstore.google.com/detail/browser-mcp-automate-your/bjfgambnhccakkhmkepdoekmckoijdlc",command:"npx",args:["-y","@browsermcp/mcp@latest"],toolNames:["browser_navigate","browser_snapshot","browser_click","browser_type","browser_screenshot","browser_get_console_logs","browser_wait","browser_press_key","browser_go_back","browser_go_forward"]}],buildManagedMcpServers:function(a){let b=Array.isArray(a)?a:[],c=[],d=new Set;for(let a of b){if(!a?.name||!a?.url||d.has(a.name))continue;d.add(a.name);let b={name:a.name,url:a.url,transport:a.transport||(/\/sse(\b|\/)/i.test(a.url)?"sse":"http")};if(a.oauth&&(b.oauth=!0),Array.isArray(a.toolNames)&&a.toolNames.length>0){let c=`${a.name}-`,d=new Set;for(let b of a.toolNames){if("string"!=typeof b||!b)continue;let a=b;for(;a.startsWith(c);)a=a.slice(c.length);d.add(a)}let e={};for(let a of d)e[a]="allow",e[`${c}${a}`]="allow";b.toolPolicy=e}c.push(b)}return c}}},30869:(a,b,c)=>{c.d(b,{UY:()=>h,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g,oc:()=>i});var d=c(39006),e=c(40615),f=c(81329);d.rE;let g={npmPackageName:"@hilbras/omnihilbras",installCmd:"npm i -g @hilbras/omnihilbras",installCmdLatest:"npm i -g @hilbras/omnihilbras@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:20128},h={maxLines:200,pollIntervalMs:1e3},i={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.6-terra",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}}},39006:a=>{a.exports={rE:"2.9.8"}},41004:(a,b,c)=>{c.d(b,{C8:()=>s,DR:()=>r,Ey:()=>k,IK:()=>m,Kv:()=>j,Ps:()=>g,SA:()=>p,Uc:()=>n,Z1:()=>i,ZL:()=>t,cI:()=>q,eo:()=>o,gx:()=>d,jk:()=>u,pH:()=>l,v1:()=>e,xM:()=>h}),c(3662);let d={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},e={sessionTtlMs:72e5,sessionCleanupIntervalMs:18e5,dnsCacheTtlMs:3e5,proxyDispatchersMaxSize:20};function f(a,b){let c=process.env[a];if(null==c||""===c)return b;let d=parseInt(c,10);return Number.isFinite(d)&&d>0?d:b}let g=process.env.SEARXNG_URL?.trim()||"http://localhost:8888/search",h=f("STREAM_STALL_TIMEOUT_MS",36e4),i=f("STREAM_FIRST_CHUNK_TIMEOUT_MS",2e5),j=f("UPSTREAM_MAX_BODY_BYTES",0x2000000),k=f("UPSTREAM_TOTAL_TIMEOUT_MS",18e5),l=f("FETCH_CONNECT_TIMEOUT_MS",6e4),m=f("GEMINI_NATIVE_TTS_FETCH_TIMEOUT_MS",45e3),n=64e3,o=32e3,p="x-omnihilbras-token-saver",q={429:{attempts:0,delayMs:0},502:{attempts:3,delayMs:3e3},503:{attempts:3,delayMs:2e3},504:{attempts:2,delayMs:3e3}};function r(a){return null==a?{attempts:0,delayMs:2e3}:"number"==typeof a?{attempts:a,delayMs:2e3}:{attempts:a.attempts||0,delayMs:null!=a.delayMs?a.delayMs:2e3}}let s=["Please write a 5-10 word title for the following conversation:"],t={candidates:[{flavor:"openai-billing",path:"/dashboard/billing/subscription"},{flavor:"openai-billing",path:"/dashboard/billing/usage"},{flavor:"new-api",path:"/api/user/self"}],usageWindowDays:30,unsupportedTtlMs:f("AGGREGATOR_UNSUPPORTED_TTL_MS",6e5),newApiQuotaPerUnit:5e5,fetchTimeoutMs:1e4},u={supabaseUrl:process.env.AGGREGATOR_WALLET_SUPABASE_URL,anonKey:process.env.AGGREGATOR_WALLET_ANON_KEY,authBaseUrl:process.env.AGGREGATOR_WALLET_AUTH_BASE_URL,walletTable:"wallets",walletColumns:["balance_paid","balance_trial","balance_bonus","balance_bonus_locked"],lockedColumn:"balance_bonus_locked"}},54603:(a,b,c)=>{c.d(b,{X:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);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,mode:448}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{f().chmodSync(m,448)}catch{}try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0,mode:448}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},79984:(a,b,c)=>{c.d(b,{k:()=>g});var d=c(47765),e=c(3506);async function f(a){if(a.includes("***"))return!0;try{return(await (0,d.PX)()).some(b=>b.key&&b.key===a)}catch{return!1}}async function g(a){let b=(a||"").trim();return b&&"sk_omnihilbras"!==b&&!await f(b)?b:(0,e.v)()}}};
|