@cortexkit/opencode-openai-auth 1.16.0 → 1.17.0

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.
Files changed (36) hide show
  1. package/dist/bin.js +2 -2
  2. package/dist/{index-ryj7dj32.js → index-0mhdyzax.js} +26 -26
  3. package/dist/{index-29mjazwp.js → index-1m3vv9rh.js} +2 -2
  4. package/dist/index-3dv16qvb.js +101 -0
  5. package/dist/{index-t4dwp124.js → index-6ts9w66n.js} +1 -1
  6. package/dist/{index-2r3vgg9c.js → index-99c2fepe.js} +2 -2
  7. package/dist/{index-7rh2vrrx.js → index-d7bsrp0m.js} +1 -1
  8. package/dist/{index-cwsxvbag.js → index-dqxk628t.js} +2 -2
  9. package/dist/{index-9q49makj.js → index-fxqghceg.js} +1 -1
  10. package/dist/{index-78q36xet.js → index-k2f9vrcr.js} +1 -1
  11. package/dist/{index-dyc6v3ba.js → index-rm4zt5dv.js} +20 -20
  12. package/dist/{index-qtkf7nzb.js → index-v9p38mg5.js} +2 -2
  13. package/dist/{index-mrt0rqtz.js → index-vmcmpezd.js} +1 -1
  14. package/dist/{index-chp9keaz.js → index-xx2z6bs3.js} +2 -2
  15. package/dist/{index-ea3ykjex.js → index-ydtpn6ma.js} +2 -2
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/rpc/port-file.js +1 -1
  19. package/dist/rpc/protocol.js +1 -1
  20. package/dist/rpc/rpc-client.js +1 -1
  21. package/dist/rpc/rpc-dir.js +1 -1
  22. package/dist/sidebar-state.js +1 -1
  23. package/dist/{token-19s0jcbk.js → token-r3vbz9pw.js} +1 -1
  24. package/dist/token-util-vks3kgse.js +1 -0
  25. package/dist/tui-preferences.js +1 -1
  26. package/dist/v2/server.d.ts +1 -1
  27. package/dist/v2/server.js +2 -2
  28. package/package.json +2 -2
  29. package/src/tui-compiled/raw/shared/0f77ebc3c914c9c6-custody.js +147 -2
  30. package/src/tui-compiled/raw/shared/352d228be2832bd4-hub.js +47 -1
  31. package/src/tui-compiled/raw/shared/e8d3c8da776ef9cd-index.js +1 -1
  32. package/src/tui-compiled/runtime/shared/0f77ebc3c914c9c6-custody.js +147 -2
  33. package/src/tui-compiled/runtime/shared/352d228be2832bd4-hub.js +47 -1
  34. package/src/tui-compiled/runtime/shared/e8d3c8da776ef9cd-index.js +1 -1
  35. package/dist/index-4tpqkbv9.js +0 -101
  36. package/dist/token-util-3pv487zf.js +0 -1
@@ -1,2 +1,2 @@
1
- import{Ig as K,Lg as T,Ng as A,Og as y,Qg as m,Sg as h}from"./index-chp9keaz.js";import{appendFileSync as r,chmodSync as i,existsSync as L,renameSync as F,statSync as e}from"node:fs";import{open as C0}from"node:fs/promises";import{dirname as G0,resolve as H0}from"node:path";var s=/^(authorization|x-api-key|cookie|set-cookie|refresh|access|token)$/i,o=/\b(Bearer\s+[\w.-]+|sk-[\w-]+|eyJ[\w.-]+)\b|ckh_[A-Za-z0-9_-]{20,}/g;function t(C){return C instanceof Error||Object.prototype.toString.call(C)==="[object Error]"}function q(C={}){let H=[o,...C.extraValuePatterns??[]].map((G)=>new RegExp(G.source,G.flags.includes("g")?G.flags:`${G.flags}g`));function $(G){let J=G.toLowerCase().replace(/[-_]/g,"");return s.test(G)||J.includes("apikey")||J.endsWith("secret")||J.endsWith("password")||J.endsWith("token")&&!J.endsWith("tokens")||!!C.extraSecretKeys?.(J)}function U(G){let J=G,Q=[["name",G.name],["message",G.message],["stack",G.stack]];for(let V of["code","status","cause"])if(J[V]!==void 0)Q.push([V,J[V]]);let N=new Set(Q.map(([V])=>V));for(let V of Object.entries(G))if(!N.has(V[0]))Q.push(V);return Q}function B(G,J,Q,N=0){if(typeof G==="string")return H.reduce((V,X)=>V.replace(X,"***REDACTED***"),G);if(!G||typeof G!=="object")return G;if(Q.has(G))return"[Circular]";Q.add(G);try{if(Array.isArray(G))return G.map((Y)=>B(Y,J,Q,N));let V=t(G);if(V&&N>=8)return"[Truncated]";let X=V?N+1:N;return Object.fromEntries((V?U(G):Object.entries(G)).map(([Y,O])=>[Y,J&&$(Y)?"***REDACTED***":B(O,J,Q,X)]))}finally{Q.delete(G)}}return{redact:(G)=>B(G,!0,new WeakSet),redactStrings:(G)=>B(G,!1,new WeakSet)}}var E=q(),n=E.redact,l=E.redactStrings;var R={error:0,warn:1,info:2,debug:3,trace:4},w=5242880,p=3;function P(C){try{i(C,384)}catch{}}function I0(C){try{if(!(L(C)&&e(C).size>=w))return;for(let $=p-1;$>=1;$--)if(L(`${C}.${$}`)){let U=`${C}.${$+1}`;F(`${C}.${$}`,U),P(U)}let H=`${C}.1`;F(C,H),P(H)}catch{}}async function M(C){let{file:H,handle:$}=C;if(C.file=void 0,C.handle=void 0,H&&$)await T(H,"log-close",()=>$.close())}async function g(C,H){await y(G0(H));try{await A(H,"file",!0)}catch($){if($.code!=="ENOENT")throw $;try{await m(H,"")}catch(U){if(U.code!=="EEXIST")throw U;await A(H,"file",!0)}}return C.handle=await T(H,"log-open",()=>C0(H,"a")),C.file=H,C.handle}async function J0(C,H,$){H=H0(H);try{if(C.file!==H)await M(C);let U=C.handle??await g(C,H);if((await T(H,"log-stat",()=>U.stat())).size>=w){await M(C);for(let G=p-1;G>=0;G--){let J=G===0?H:`${H}.${G}`,Q=`${H}.${G+1}`;try{await A(J,"file",!0)}catch(N){if(N.code==="ENOENT")continue;throw N}try{await A(Q,"file",!0)}catch(N){if(N.code!=="ENOENT")throw N}await h(J,Q),await A(Q,"file")}U=await g(C,H)}await T(H,"log-append",()=>U.appendFile($,"utf8"))}catch(U){throw await M(C).catch(()=>{}),U}}function Q0(C){try{return` ${JSON.stringify(C)}`}catch{return" [unserializable]"}}function Z0(C){let H,$,U,B=q(),G,J=[],Q,N=Promise.resolve(),V,X={};function Y(I){let Z=N.then(I);return N=Z.catch((j)=>{V=j}),Z}function O(I){if(K&&I.file!==H)Y(()=>M(X)).catch(()=>{});H=I.file,$=I.level,B=q(I),G=I.captureSink}function k(I){if(I===void 0||I in R)U=I}function v(){if(H===void 0)return;return(typeof H==="function"?H():H)||void 0}function c(){if(U)return U;let I=typeof $==="function"?$():$;if(I&&I in R)return I;return"info"}function D(I=!0){if(Q)clearTimeout(Q),Q=void 0;if(!J.length){if(K)return Y(async()=>{if(I)await M(X);if(V)throw V});return}let Z;try{Z=v()}catch{if(J=[],K&&I)return Y(()=>M(X));return}let j=J.join("");if(J=[],!Z){if(K&&I)return Y(()=>M(X));return}if(K)return Y(async()=>{try{await J0(X,Z,j)}finally{if(I)await M(X)}});try{if(I0(Z),L(Z))P(Z);r(Z,j,{encoding:"utf8",mode:384})}catch{}}function f(){if(!Q)Q=setTimeout(()=>{Q=void 0;let I=D(!1);if(I instanceof Promise)I.catch(()=>{})},500)}function z(I,Z,j,W){if(H===void 0&&G===void 0)return;try{if(R[Z]>R[c()])return;let b=B.redactStrings(j),x;try{x=B.redact(W)}catch{x="[unserializable]"}let a=`[${new Date().toISOString()}] ${Z.toUpperCase()} [${I}] ${b}`+(W===void 0?"":Q0(x))+`
2
- `;try{G?.({channel:I,level:Z,message:b,data:x})}catch{}if(H===void 0)return;if(J.push(a),J.length>=50){let S=D(!1);if(S instanceof Promise)S.catch(()=>{})}else f()}catch{}}function u(I){return{error:(Z,j)=>z(I,"error",Z,j),warn:(Z,j)=>z(I,"warn",Z,j),info:(Z,j)=>z(I,"info",Z,j),debug:(Z,j)=>z(I,"debug",Z,j),trace:(Z,j)=>z(I,"trace",Z,j)}}function d(){if(K)Y(()=>M(X)).catch(()=>{});if(V=void 0,J=[],Q)clearTimeout(Q),Q=void 0;H=void 0,$=void 0,U=void 0,B=q(),G=void 0}if(C)O(C);return{configure:O,createLogger:u,setLogLevel:k,flushLogs:D,reset:d}}var _=Z0();function $0(C){_.configure(C);let{configure:H,createLogger:$,setLogLevel:U,flushLogs:B}=_;return{configure:H,createLogger:$,setLogLevel:U,flushLogs:B}}function U0(C){_.setLogLevel(C)}function V0(){return _.flushLogs()}function j0(C){return _.createLogger(C)}export{q as Cg,n as Dg,$0 as Eg,U0 as Fg,V0 as Gg,j0 as Hg};
1
+ import{Kg as K,Ng as T,Pg as A,Qg as y,Sg as m,Ug as h}from"./index-xx2z6bs3.js";import{appendFileSync as r,chmodSync as i,existsSync as L,renameSync as F,statSync as e}from"node:fs";import{open as C0}from"node:fs/promises";import{dirname as G0,resolve as H0}from"node:path";var s=/^(authorization|x-api-key|cookie|set-cookie|refresh|access|token)$/i,o=/\b(Bearer\s+[\w.-]+|sk-[\w-]+|eyJ[\w.-]+)\b|ckh_[A-Za-z0-9_-]{20,}/g;function t(C){return C instanceof Error||Object.prototype.toString.call(C)==="[object Error]"}function q(C={}){let H=[o,...C.extraValuePatterns??[]].map((G)=>new RegExp(G.source,G.flags.includes("g")?G.flags:`${G.flags}g`));function $(G){let J=G.toLowerCase().replace(/[-_]/g,"");return s.test(G)||J.includes("apikey")||J.endsWith("secret")||J.endsWith("password")||J.endsWith("token")&&!J.endsWith("tokens")||!!C.extraSecretKeys?.(J)}function U(G){let J=G,Q=[["name",G.name],["message",G.message],["stack",G.stack]];for(let V of["code","status","cause"])if(J[V]!==void 0)Q.push([V,J[V]]);let N=new Set(Q.map(([V])=>V));for(let V of Object.entries(G))if(!N.has(V[0]))Q.push(V);return Q}function B(G,J,Q,N=0){if(typeof G==="string")return H.reduce((V,X)=>V.replace(X,"***REDACTED***"),G);if(!G||typeof G!=="object")return G;if(Q.has(G))return"[Circular]";Q.add(G);try{if(Array.isArray(G))return G.map((Y)=>B(Y,J,Q,N));let V=t(G);if(V&&N>=8)return"[Truncated]";let X=V?N+1:N;return Object.fromEntries((V?U(G):Object.entries(G)).map(([Y,O])=>[Y,J&&$(Y)?"***REDACTED***":B(O,J,Q,X)]))}finally{Q.delete(G)}}return{redact:(G)=>B(G,!0,new WeakSet),redactStrings:(G)=>B(G,!1,new WeakSet)}}var E=q(),n=E.redact,l=E.redactStrings;var R={error:0,warn:1,info:2,debug:3,trace:4},w=5242880,p=3;function P(C){try{i(C,384)}catch{}}function I0(C){try{if(!(L(C)&&e(C).size>=w))return;for(let $=p-1;$>=1;$--)if(L(`${C}.${$}`)){let U=`${C}.${$+1}`;F(`${C}.${$}`,U),P(U)}let H=`${C}.1`;F(C,H),P(H)}catch{}}async function M(C){let{file:H,handle:$}=C;if(C.file=void 0,C.handle=void 0,H&&$)await T(H,"log-close",()=>$.close())}async function g(C,H){await y(G0(H));try{await A(H,"file",!0)}catch($){if($.code!=="ENOENT")throw $;try{await m(H,"")}catch(U){if(U.code!=="EEXIST")throw U;await A(H,"file",!0)}}return C.handle=await T(H,"log-open",()=>C0(H,"a")),C.file=H,C.handle}async function J0(C,H,$){H=H0(H);try{if(C.file!==H)await M(C);let U=C.handle??await g(C,H);if((await T(H,"log-stat",()=>U.stat())).size>=w){await M(C);for(let G=p-1;G>=0;G--){let J=G===0?H:`${H}.${G}`,Q=`${H}.${G+1}`;try{await A(J,"file",!0)}catch(N){if(N.code==="ENOENT")continue;throw N}try{await A(Q,"file",!0)}catch(N){if(N.code!=="ENOENT")throw N}await h(J,Q),await A(Q,"file")}U=await g(C,H)}await T(H,"log-append",()=>U.appendFile($,"utf8"))}catch(U){throw await M(C).catch(()=>{}),U}}function Q0(C){try{return` ${JSON.stringify(C)}`}catch{return" [unserializable]"}}function Z0(C){let H,$,U,B=q(),G,J=[],Q,N=Promise.resolve(),V,X={};function Y(I){let Z=N.then(I);return N=Z.catch((j)=>{V=j}),Z}function O(I){if(K&&I.file!==H)Y(()=>M(X)).catch(()=>{});H=I.file,$=I.level,B=q(I),G=I.captureSink}function k(I){if(I===void 0||I in R)U=I}function v(){if(H===void 0)return;return(typeof H==="function"?H():H)||void 0}function c(){if(U)return U;let I=typeof $==="function"?$():$;if(I&&I in R)return I;return"info"}function D(I=!0){if(Q)clearTimeout(Q),Q=void 0;if(!J.length){if(K)return Y(async()=>{if(I)await M(X);if(V)throw V});return}let Z;try{Z=v()}catch{if(J=[],K&&I)return Y(()=>M(X));return}let j=J.join("");if(J=[],!Z){if(K&&I)return Y(()=>M(X));return}if(K)return Y(async()=>{try{await J0(X,Z,j)}finally{if(I)await M(X)}});try{if(I0(Z),L(Z))P(Z);r(Z,j,{encoding:"utf8",mode:384})}catch{}}function f(){if(!Q)Q=setTimeout(()=>{Q=void 0;let I=D(!1);if(I instanceof Promise)I.catch(()=>{})},500)}function z(I,Z,j,W){if(H===void 0&&G===void 0)return;try{if(R[Z]>R[c()])return;let b=B.redactStrings(j),x;try{x=B.redact(W)}catch{x="[unserializable]"}let a=`[${new Date().toISOString()}] ${Z.toUpperCase()} [${I}] ${b}`+(W===void 0?"":Q0(x))+`
2
+ `;try{G?.({channel:I,level:Z,message:b,data:x})}catch{}if(H===void 0)return;if(J.push(a),J.length>=50){let S=D(!1);if(S instanceof Promise)S.catch(()=>{})}else f()}catch{}}function u(I){return{error:(Z,j)=>z(I,"error",Z,j),warn:(Z,j)=>z(I,"warn",Z,j),info:(Z,j)=>z(I,"info",Z,j),debug:(Z,j)=>z(I,"debug",Z,j),trace:(Z,j)=>z(I,"trace",Z,j)}}function d(){if(K)Y(()=>M(X)).catch(()=>{});if(V=void 0,J=[],Q)clearTimeout(Q),Q=void 0;H=void 0,$=void 0,U=void 0,B=q(),G=void 0}if(C)O(C);return{configure:O,createLogger:u,setLogLevel:k,flushLogs:D,reset:d}}var _=Z0();function $0(C){_.configure(C);let{configure:H,createLogger:$,setLogLevel:U,flushLogs:B}=_;return{configure:H,createLogger:$,setLogLevel:U,flushLogs:B}}function U0(C){_.setLogLevel(C)}function V0(){return _.flushLogs()}function j0(C){return _.createLogger(C)}export{q as Eg,n as Fg,$0 as Gg,U0 as Hg,V0 as Ig,j0 as Jg};