@cortexkit/opencode-openai-auth 1.20.2 → 1.20.3
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/dist/bin.js +2 -2
- package/dist/{codex-request-Dvj28zFK.d.ts → codex-request-D0oxrTkl.d.ts} +19 -1
- package/dist/{index-0mf78d7s.js → index-66eejhpe.js} +1 -1
- package/dist/{index-38xyx9nd.js → index-6a1t612m.js} +1 -1
- package/dist/{index-a1zh72v8.js → index-8ap9gr0h.js} +1 -1
- package/dist/{index-ah9yt0zm.js → index-a7eep73q.js} +1 -1
- package/dist/{index-8ge0as5s.js → index-ahbghz6c.js} +1 -1
- package/dist/{index-xcsz00nr.js → index-eb631m0m.js} +1 -1
- package/dist/{index-jky7c65x.js → index-gxa94644.js} +1 -1
- package/dist/index-kakqxnt5.js +101 -0
- package/dist/{index-z4tfv40j.js → index-t66h86ed.js} +1 -1
- package/dist/{index-rbc7cfbv.js → index-vjb3rsqh.js} +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/rpc/port-file.js +1 -1
- package/dist/rpc/protocol.js +1 -1
- package/dist/rpc/rpc-client.js +1 -1
- package/dist/sidebar-state.js +1 -1
- package/dist/tui-preferences.js +1 -1
- package/dist/v2/server.d.ts +1 -1
- package/dist/v2/server.js +4 -4
- package/package.json +2 -2
- package/src/tui-compiled/raw/shared/0f77ebc3c914c9c6-custody.js +145 -8
- package/src/tui-compiled/raw/shared/169b2b4bf30909bc-consumer.js +32 -0
- package/src/tui-compiled/raw/shared/352d228be2832bd4-hub.js +10 -0
- package/src/tui-compiled/raw/shared/c97089ed4243981c-host.js +8 -0
- package/src/tui-compiled/runtime/shared/0f77ebc3c914c9c6-custody.js +145 -8
- package/src/tui-compiled/runtime/shared/169b2b4bf30909bc-consumer.js +32 -0
- package/src/tui-compiled/runtime/shared/352d228be2832bd4-hub.js +10 -0
- package/src/tui-compiled/runtime/shared/c97089ed4243981c-host.js +8 -0
- package/dist/index-x3q449sn.js +0 -101
- /package/dist/{index-c4h4t3wg.js → index-tn1ve0gx.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Pg as w0}from"./index-
|
|
1
|
+
import{Pg as w0}from"./index-eb631m0m.js";import{$g as K0,Qg as X,Rg as R,Sg as B0,Tg as g0,Vg as w,Wg as N0,Xg as P,Yg as U0,Zg as m0}from"./index-tn1ve0gx.js";import{randomUUID as o}from"node:crypto";import{link as $z,lstat as u,mkdir as E0,open as Q0,readdir as Jz,readFile as b0,rename as y0,rm as c,stat as t,unlink as _z}from"node:fs/promises";import{basename as Hz,dirname as G0,join as V0}from"node:path";import{resolve as R0}from"node:path";class i extends Error{path;code="ENOENT";constructor(z,B){super(`Lock record disappeared: ${z}`,{cause:B});this.path=z}}function m(z,B){return z instanceof R&&z.reason==="io-error"&&z.win32Code===5&&(z.stage==="read"||z.stage==="verify")&&B.some((G)=>R0(G)===z.path)}function p(z,B,G){return z instanceof R&&z.reason==="io-error"&&z.win32Code===5&&z.stage===G&&B.some((Z)=>R0(Z)===z.path)}async function L(z,B){try{return await B()}catch(G){if(!m(G,[z]))throw G;try{return await B()}catch(Z){if(Z.code==="ENOENT")throw new i(z,G);throw G}}}import{join as Qz,resolve as Yz}from"node:path";function H0(z,B){return`${z}.${B}.lock`}class O0 extends Error{details;constructor(z){super(`Timed out acquiring ${z.name} lock for ${z.target}`);this.name="LockContentionError",this.details=z}}class a extends Error{details;constructor(z){super(`Lost ${z.name} lock for ${z.target}`);this.name="LockOwnershipError",this.details=z}}function Zz(z,B,G){let Z=Yz(H0(B,G)),J=[Z,Qz(Z,"owner.json")];return(B0(z)||m(z,J))&&(z.stage==="read"||z.stage==="verify")&&J.includes(z.path)||X&&(p(z,[Z],"create")||p(z,[`${Z}.evicting`],"directory-create"))}async function sz(z,B,G){let Z=performance.now(),J;for(;;){B.signal?.throwIfAborted();let H;try{H=await L0({path:z,name:B.name,ttlMs:B.ttlMs,renew:B.renew??!1,...B.onStep?{onStep:B.onStep}:{},...B.onRenewalTimer?{onRenewalTimer:B.onRenewalTimer}:{}}),J=void 0}catch(N){if(!Zz(N,z,B.name))throw N;H=null,J??=N}if(H)try{return B.signal?.throwIfAborted(),await G(H)}finally{await H.release(B.signal)}let V=B.timeoutMs-(performance.now()-Z);if(V<=0){if(J)throw J;throw new O0({target:z,name:B.name,timeoutMs:B.timeoutMs})}await new Promise((N)=>setTimeout(N,Math.min(25,Math.ceil(V))))}}var d;async function Xz(z,B){let G=`${z}.${o()}.tmp`,Z;try{Z=await Q0(G,"wx",384);try{if(d?.beforeWrite)await d.beforeWrite(G);await Z.writeFile(B,"utf8")}finally{await Z.close()}try{if(d?.beforeLink)await d.beforeLink(G,z);await $z(G,z)}catch(J){let H=J.code;if(H!=="EPERM"&&H!=="ENOTSUP"&&H!=="EOPNOTSUPP"&&H!=="EXDEV")throw J;await v0(z,B)}}finally{if(Z)await c(G,{force:!0}).catch(()=>{})}}async function v0(z,B){let G=await Q0(z,"wx",384),Z;try{Z=await G.stat()}catch{Z=void 0}try{if(d?.beforeWrite)await d.beforeWrite(z);await G.writeFile(B,"utf8")}catch(J){try{let H=await u(z).catch(()=>{return});if(Z&&H&&H.dev===Z.dev&&H.ino===Z.ino)await c(z,{force:!0}).catch(()=>{})}catch{}throw J}finally{await G.close()}}var h0=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,Nz=600000,Uz=256,Vz=4096,f0=new Set,k0=new Set,Wz;function qz(z,B){let G=`${B}.`,Z=".tmp";if(!z.startsWith(G)||!z.endsWith(".tmp"))return!1;return h0.test(z.slice(G.length,-4))}function p0(z,B){return z.dev===B.dev&&z.ino===B.ino&&z.size===B.size&&z.mtimeMs===B.mtimeMs&&z.birthtimeMs===B.birthtimeMs}async function P0(z){let B=await u(z);if(!B.isFile()||B.isSymbolicLink())return;if(B.size>Vz)return;let G=await Q0(z,"r"),Z;try{if(!p0(B,await G.stat()))return;Z=await G.readFile("utf8")}finally{await G.close()}let J;try{J=JSON.parse(Z)}catch{return}if(!J||typeof J!=="object"||Array.isArray(J))return;let H=Object.keys(J).sort();if(H.length!==2||H[0]!=="expiresAt"||H[1]!=="ownerId")return;let{ownerId:V,expiresAt:N}=J;if(typeof V!=="string"||!h0.test(V))return;if(typeof N!=="number"||!Number.isFinite(N))return;return{identity:B,expiresAt:N}}async function xz(z,B,G){let Z=G0(z),J=Hz(z),H=Wz,N=(await(H?.readdir??Jz)(Z)).filter((O)=>qz(O,J)).slice(0,Uz),W=Math.max(Number.isFinite(B)?B:0,Nz);for(let O of N){let E=V0(Z,O);try{if(G()-(await u(E)).mtimeMs<W)continue;let f=await P0(E);if(!f||!(f.expiresAt<G()-W))continue;if(H?.beforeUnlink)await H.beforeUnlink(E);let S=await P0(E);if(!S||!p0(f.identity,S.identity)||!(S.expiresAt<G()-W))continue;await(H?.unlink??_z)(E)}catch{}}}function Dz(z,B,G){if(f0.has(z))return;f0.add(z);let Z=Promise.resolve().then(()=>xz(z,B,G)).catch(()=>{});k0.add(Z),Z.finally(()=>k0.delete(Z))}var jz=globalThis.setTimeout.bind(globalThis),Iz=globalThis.clearTimeout.bind(globalThis);function Az(z){let B=z?.code;return B==="ENOENT"||!X&&(B==="EINVAL"||B==="ENOTDIR")}var u0;function X0(z,B){if(z.dev!==B.dev||z.ino!==B.ino)return!1;if(z.ino===0&&z.birthtimeMs!==B.birthtimeMs)return!1;return!0}var Fz=1000;function L0(z){return Sz({...z,now:Date.now})}async function Sz(z){let B=H0(z.path,z.name),G=V0(B,"owner.json"),Z=o(),J=z.now??Date.now,H=null,V=!1,N=!1,W,O,E=new Promise((K)=>{O=K});function f(K){try{let Q=z.onRenewalTimer?.(K);if(Q&&(typeof Q==="object"||typeof Q==="function")&&"then"in Q&&typeof Q.then==="function")Promise.resolve(Q).catch(()=>{})}catch{}}function S(){if(!H)return;Iz(H),H=null,f("cancelled")}function j(K,Q){if(W||V)return;W=Object.freeze({reason:K,expectedOwnerId:Z,...typeof Q?.ownerId==="string"?{observedOwnerId:Q.ownerId}:{},...typeof Q?.expiresAt==="number"?{observedExpiresAt:Q.expiresAt}:{}}),S(),O(W)}let b,y=null,U=`${B}.evicting`,q=V0(U,"owner.json"),l=o(),g=5000,s=8;function v(K){return X&&(p(K,[B],"create")||p(K,[U],"directory-create"))}async function I(){if(X)try{return JSON.parse(await L(B,()=>P(B,!0)))}catch(K){if(K.code!=="EISDIR"&&K.reason!=="wrong-kind")throw K;return await L(B,()=>w(B,"directory",!0)),JSON.parse(await L(G,()=>P(G,!0)))}try{return JSON.parse(await b0(B,"utf8"))}catch(K){if(K.code!=="EISDIR")throw K;return JSON.parse(await b0(G,"utf8"))}}async function r(){if(X){let $=await I(),_=Number($?.expiresAt)-J();await K0(B,`${JSON.stringify({ownerId:Z,expiresAt:J()+z.ttlMs})}
|
|
2
2
|
`,{deadline:performance.now()+Math.max(0,_),beforeRename:async()=>{let D=await I();if(D?.ownerId!==Z||!(Number(D?.expiresAt)>J())||!await M())throw new a({target:z.path,name:z.name})}});return}let K=`${B}.${o()}.tmp`,Q,Y=!1;try{Q=await Q0(K,"wx",384),Y=!0,await Q.writeFile(`${JSON.stringify({ownerId:Z,expiresAt:J()+z.ttlMs})}
|
|
3
3
|
`,"utf8"),await Q.chmod(384),await Q.close(),Q=void 0;let $=await I();if($?.ownerId!==Z||!(Number($?.expiresAt)>J())||!await M())throw new a({target:z.path,name:z.name});await y0(K,B),Y=!1}finally{if(await Q?.close().catch(()=>{}),Y)await c(K,{force:!0}).catch(()=>{})}}async function h(){let K=`${JSON.stringify({ownerId:Z,expiresAt:J()+z.ttlMs})}
|
|
4
4
|
`;if(X)await U0(B,K);else await Xz(B,K)}async function A(K){let Q=K.code;if(Q!=="EEXIST"&&Q!=="EISDIR")return!1;if(X){if(z.onStep)await z.onStep("lease-contention-read-ready");try{if(Q==="EISDIR")await L(B,()=>w(B,"directory",!0)),await L(G,()=>P(G,!0));else await I()}catch(Y){if(Y.code!=="ENOENT")throw Y}}return!0}async function F(){if(X)await N0(G0(B));try{return await h(),!0}catch(K){let Q=K.code;if(await A(K))return!1;if(Q==="ENOENT"){if(X)await N0(G0(B));else await E0(G0(B),{recursive:!0});try{return await h(),!0}catch(Y){if(await A(Y))return!1;throw Y}}throw K}}async function C(){await new Promise((K)=>setTimeout(K,Math.floor(Math.random()*4)))}async function T(K=!0){if(K&&z.onStep)await z.onStep("lock-read-ready");let Q;try{Q=await I()}catch($){if($ instanceof i)return{status:"missing"};if(X&&$.code!=="ENOENT")throw $}let Y=Number(Q?.expiresAt);if(Number.isFinite(Y)&&Y>J())return{status:"live"};if(typeof Q?.ownerId==="string"&&Number.isFinite(Y))return{status:"stale",identity:{kind:"owner",ownerId:Q.ownerId,expiresAt:Y}};try{let $=await t(B),_=Number.isFinite(Y)?Y:$.mtimeMs+z.ttlMs;if(_>J())return{status:"live"};return{status:"stale",identity:{kind:"stat",dev:$.dev,ino:$.ino,mtimeMs:$.mtimeMs,expiresAt:_}}}catch($){if($.code==="ENOENT"){if(z.onStep)await z.onStep("lock-missing");return{status:"missing"}}throw $}}function D0(K,Q){if(Q.status!=="stale")return!1;let Y=Q.identity;if(K.kind==="owner"&&Y.kind==="owner")return K.ownerId===Y.ownerId&&K.expiresAt===Y.expiresAt;return K.kind==="stat"&&Y.kind==="stat"&&K.dev===Y.dev&&K.ino===Y.ino&&K.mtimeMs===Y.mtimeMs&&K.expiresAt===Y.expiresAt}async function M(){try{return JSON.parse(await L(q,()=>P(q,X)))?.ownerId===l}catch(K){if(X&&K.code!=="ENOENT")throw K;return!1}}async function $0(K){if(X)await g0(K,"remove",()=>c(K,{recursive:!0,force:!0}));else await c(K,{recursive:!0,force:!0}).catch(()=>{})}function e(K,Q){if(!X||!(K instanceof R)||K.stage!=="remove"||K.path!==Q)return!1;return B0(K)||K.win32Code===void 0&&K.reason===void 0&&(K.code==="EBUSY"||K.code==="EPERM")}async function J0(K,Q,Y=performance.now()+g+1000){let $,_=5;while(await Q()){try{await $0(K);return}catch(x){if(!e(x,K))throw x;$??=x}let D=Y-performance.now();if(D<=0)throw $;if(await new Promise((x)=>setTimeout(x,Math.min(_,D))),performance.now()>=Y)throw $;_=Math.min(_*2,50)}}async function _0(K){let Q;await J0(U,async()=>{if(!X)return M();let Y=await u(U).catch(($)=>{if($.code!=="ENOENT")throw $;return});if(!Y||Q&&!X0(Q,Y))return!1;if(await M())return Q=Y,!0;if(!Q)return!1;try{return await t(q),!1}catch($){if($.code!=="ENOENT")throw $;return!0}},K)}async function Kz(K,Q){if(!K)return!1;let Y=!1;try{await J0(U,async()=>{Y=!1;let $=await u(U).catch(()=>{return});if(!$||!X0(K,$))return!1;Y=!0;try{return await t(q),!1}catch(_){return _.code==="ENOENT"}},Q)}catch{}return Y}async function j0(K){if(X)await m0(U);else await E0(U);let Q;try{let Y=await u(U);Q={dev:Y.dev,ino:Y.ino,birthtimeMs:Y.birthtimeMs}}catch{Q=void 0}try{await u0?.beforeOwnerWrite?.(U,q);let Y=await u0?.failOwnerWrite?.(U,q);if(Y!==void 0)throw Y;let $=`${JSON.stringify({ownerId:l,createdAt:J()})}
|