@cortexkit/opencode-openai-auth 1.0.4 → 1.1.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.
- package/dist/bin.js +9 -8
- package/dist/{pool-lifecycle-DqKq8Eej.d.ts → codex-request-BXDXToyt.d.ts} +158 -27
- package/dist/index-0yh85bwb.js +69 -0
- package/dist/{index-jye6vccc.js → index-4c8yw54k.js} +2 -2
- package/dist/{index-k4eacw7x.js → index-7c6sxtd6.js} +2 -2
- package/dist/index-7eb3dw37.js +90 -0
- package/dist/index-8re8rprk.js +2 -0
- package/dist/{index-bgq9d21h.js → index-csky2xpg.js} +1 -1
- package/dist/index-edbdscy7.js +65 -0
- package/dist/{index-45qgkb0m.js → index-f2fmb596.js} +1 -1
- package/dist/{index-envpbt0k.js → index-j8v2xwq6.js} +1 -1
- package/dist/{index-egrty6tz.js → index-k6cydkgt.js} +2 -2
- package/dist/{index-dryydk6b.js → index-m5qmvr6c.js} +2 -2
- package/dist/index-msx2m78k.js +8 -0
- package/dist/{index-yeyp8t0k.js → index-zpm95mt5.js} +1 -1
- package/dist/index.d.ts +15 -7
- package/dist/index.js +1 -1
- package/dist/{map-CCbSZIhT.d.ts → map-Buq-GW7l.d.ts} +1 -1
- package/dist/{protocol-CSIDDBDf.d.ts → model-YRg7Uowo.d.ts} +67 -25
- package/dist/{port-file-CZ9MIdy2.d.ts → port-file-CxEpgSHY.d.ts} +1 -1
- package/dist/protocol-CDV1Pc6h.d.ts +29 -0
- package/dist/rpc/port-file.d.ts +1 -1
- package/dist/rpc/port-file.js +1 -1
- package/dist/rpc/protocol.d.ts +1 -1
- package/dist/rpc/protocol.js +1 -1
- package/dist/rpc/rpc-client.d.ts +3 -3
- package/dist/rpc/rpc-client.js +1 -1
- package/dist/rpc/rpc-dir.js +1 -1
- package/dist/{sidebar-state-BCxFpH68.d.ts → sidebar-state-DjTWUbmf.d.ts} +15 -9
- package/dist/sidebar-state.d.ts +1 -1
- package/dist/sidebar-state.js +1 -1
- package/dist/{token-vykm9bxh.js → token-rz4t3ay6.js} +1 -1
- package/dist/token-util-tpy2c7h6.js +1 -0
- package/dist/tui-preferences.js +1 -1
- package/dist/tui.d.ts +20 -2
- package/dist/v2/server.d.ts +73 -1
- package/dist/v2/server.js +3 -3
- package/package.json +2 -2
- package/src/tui-compiled/raw/shared/0332701351b3eeec-format.js +78 -42
- package/src/tui-compiled/raw/shared/0f77ebc3c914c9c6-custody.js +354 -0
- package/src/tui-compiled/raw/shared/134b008900698fe0-backoff.js +92 -0
- package/src/tui-compiled/raw/shared/169b2b4bf30909bc-consumer.js +393 -0
- package/src/tui-compiled/raw/shared/2577ec69f9973ae9-quota-normalize.js +154 -0
- package/src/tui-compiled/raw/shared/2dce6e9613993329-quota-manager.js +473 -0
- package/src/tui-compiled/raw/shared/30f5bc480f31f51c-roster.js +566 -0
- package/src/tui-compiled/raw/shared/43fc9e6b994519c7-refresh-lock.js +0 -1
- package/src/tui-compiled/raw/shared/4593a4d71edf69fd-tombstone.js +25 -0
- package/src/tui-compiled/raw/shared/4d05c2d7a531aece-oauth.js +500 -0
- package/src/tui-compiled/raw/shared/6371b24a0573d79e-any-signal.js +42 -0
- package/src/tui-compiled/raw/shared/7c140680fc81be92-interlock.js +29 -0
- package/src/tui-compiled/raw/shared/85512cc5263ba259-provider.js +87 -0
- package/src/tui-compiled/raw/shared/abd062d633e29fd2-pool-routing.js +192 -0
- package/src/tui-compiled/raw/shared/b9588ad4725c1d10-enrollment.js +806 -0
- package/src/tui-compiled/raw/shared/bfbdd0f9aae56b47-pool-quota.js +85 -0
- package/src/tui-compiled/raw/shared/c852a15cfe489d12-pool.js +0 -1
- package/src/tui-compiled/raw/shared/ca0fccaba1d87af4-errors.js +8 -0
- package/src/tui-compiled/raw/shared/d0f0b6be200311af-insula.js +152 -0
- package/src/tui-compiled/raw/shared/d5a8f1061ee2f114-index.js +1 -1
- package/src/tui-compiled/raw/shared/d9d2892a4c371301-host-slot.js +72 -0
- package/src/tui-compiled/raw/shared/dbc61cd405941828-accounts.js +1470 -0
- package/src/tui-compiled/raw/shared/e8cd4929507508d8-refresh-file-lock.js +26 -12
- package/src/tui-compiled/raw/shared/e8d3c8da776ef9cd-index.js +24 -0
- package/src/tui-compiled/raw/sidebar-state.js +41 -14
- package/src/tui-compiled/raw/tui/command-dialogs.tsx +3 -34
- package/src/tui-compiled/raw/tui/section-text.js +21 -0
- package/src/tui-compiled/raw/tui/v2-dialog.js +137 -0
- package/src/tui-compiled/raw/tui/v2.tsx +133 -0
- package/src/tui-compiled/raw/tui.tsx +146 -40
- package/src/tui-compiled/runtime/shared/0332701351b3eeec-format.js +78 -42
- package/src/tui-compiled/runtime/shared/0f77ebc3c914c9c6-custody.js +354 -0
- package/src/tui-compiled/runtime/shared/134b008900698fe0-backoff.js +92 -0
- package/src/tui-compiled/runtime/shared/169b2b4bf30909bc-consumer.js +393 -0
- package/src/tui-compiled/runtime/shared/2577ec69f9973ae9-quota-normalize.js +154 -0
- package/src/tui-compiled/runtime/shared/2dce6e9613993329-quota-manager.js +473 -0
- package/src/tui-compiled/runtime/shared/30f5bc480f31f51c-roster.js +566 -0
- package/src/tui-compiled/runtime/shared/43fc9e6b994519c7-refresh-lock.js +0 -1
- package/src/tui-compiled/runtime/shared/4593a4d71edf69fd-tombstone.js +25 -0
- package/src/tui-compiled/runtime/shared/4d05c2d7a531aece-oauth.js +500 -0
- package/src/tui-compiled/runtime/shared/6371b24a0573d79e-any-signal.js +42 -0
- package/src/tui-compiled/runtime/shared/7c140680fc81be92-interlock.js +29 -0
- package/src/tui-compiled/runtime/shared/85512cc5263ba259-provider.js +87 -0
- package/src/tui-compiled/runtime/shared/abd062d633e29fd2-pool-routing.js +192 -0
- package/src/tui-compiled/runtime/shared/b9588ad4725c1d10-enrollment.js +806 -0
- package/src/tui-compiled/runtime/shared/bfbdd0f9aae56b47-pool-quota.js +85 -0
- package/src/tui-compiled/runtime/shared/c852a15cfe489d12-pool.js +0 -1
- package/src/tui-compiled/runtime/shared/ca0fccaba1d87af4-errors.js +8 -0
- package/src/tui-compiled/runtime/shared/d0f0b6be200311af-insula.js +152 -0
- package/src/tui-compiled/runtime/shared/d5a8f1061ee2f114-index.js +1 -1
- package/src/tui-compiled/runtime/shared/d9d2892a4c371301-host-slot.js +72 -0
- package/src/tui-compiled/runtime/shared/dbc61cd405941828-accounts.js +1470 -0
- package/src/tui-compiled/runtime/shared/e8cd4929507508d8-refresh-file-lock.js +26 -12
- package/src/tui-compiled/runtime/shared/e8d3c8da776ef9cd-index.js +24 -0
- package/src/tui-compiled/runtime/sidebar-state.js +41 -14
- package/src/tui-compiled/runtime/tui/command-dialogs.js +3 -15
- package/src/tui-compiled/runtime/tui/section-text.js +21 -0
- package/src/tui-compiled/runtime/tui/v2-dialog.js +137 -0
- package/src/tui-compiled/runtime/tui/v2.js +95 -0
- package/src/tui-compiled/runtime/tui.js +255 -163
- package/dist/index-2hch7e8n.js +0 -8
- package/dist/index-5dg931q0.js +0 -65
- package/dist/index-99esnzg0.js +0 -157
- package/dist/index-9reyazwh.js +0 -2
- package/dist/index-yf6arn5w.js +0 -2
- package/dist/token-util-gmn5yaqc.js +0 -1
package/dist/index-2hch7e8n.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{be as G,ce as q,de as V0,fe as U,ge as h,he as S,ie as v,je as _0,le as b}from"./index-dryydk6b.js";import{randomUUID as I}from"node:crypto";import{mkdir as G0,open as x0,readFile as H0,rename as Q0,rm as L,stat as Y0,writeFile as Z0}from"node:fs/promises";import{dirname as P,join as J0}from"node:path";function N0($,W){return`${$}.${W}.lock`}class W0 extends Error{details;constructor($){super(`Timed out acquiring ${$.name} lock for ${$.target}`);this.name="LockContentionError",this.details=$}}class R extends Error{details;constructor($){super(`Lost ${$.name} lock for ${$.target}`);this.name="LockOwnershipError",this.details=$}}async function O0($,W,Q){let Y=performance.now();for(;;){let Z=await K0({path:$,name:W.name,ttlMs:W.ttlMs,renew:W.renew??!1,...W.onStep?{onStep:W.onStep}:{},...W.onRenewalTimer?{onRenewalTimer:W.onRenewalTimer}:{}});if(Z)try{return await Q(Z)}finally{await Z.release()}let J=W.timeoutMs-(performance.now()-Y);if(J<=0)throw new W0({target:$,name:W.name,timeoutMs:W.timeoutMs});await new Promise((_)=>setTimeout(_,Math.min(25,Math.ceil(J))))}}var g0=globalThis.setTimeout.bind(globalThis),D0=globalThis.clearTimeout.bind(globalThis);function q0($){let W=$?.code;return W==="ENOENT"||!G&&(W==="EINVAL"||W==="ENOTDIR")}async function K0($){let W=N0($.path,$.name),Q=J0(W,"owner.json"),Y=I(),Z=$.now??Date.now,J=null,_=!1,g=!1,B,l,X0=new Promise((z)=>{l=z});function p(z){try{let K=$.onRenewalTimer?.(z);if(K&&(typeof K==="object"||typeof K==="function")&&"then"in K&&typeof K.then==="function")Promise.resolve(K).catch(()=>{})}catch{}}function d(){if(!J)return;D0(J),J=null,p("cancelled")}function C(z,K){if(B||_)return;B=Object.freeze({reason:z,expectedOwnerId:Y,...typeof K?.ownerId==="string"?{observedOwnerId:K.ownerId}:{},...typeof K?.expiresAt==="number"?{observedExpiresAt:K.expiresAt}:{}}),d(),l(B)}let E,f=null,x=`${W}.evicting`,M=J0(x,"owner.json"),a=I(),j0=5000,y=8;async function j(){if(G)try{return JSON.parse(await S(W,!0))}catch(z){if(z.code!=="EISDIR"&&z.reason!=="wrong-kind")throw z;return await U(W,"directory",!0),JSON.parse(await S(Q,!0))}try{return JSON.parse(await H0(W,"utf8"))}catch(z){if(z.code!=="EISDIR")throw z;return JSON.parse(await H0(Q,"utf8"))}}async function C0(){if(G){let H=await j(),V=Number(H?.expiresAt)-Z();await b(W,`${JSON.stringify({ownerId:Y,expiresAt:Z()+$.ttlMs})}
|
|
2
|
-
`,{deadline:performance.now()+Math.max(0,V),beforeRename:async()=>{let A=await j();if(A?.ownerId!==Y||!(Number(A?.expiresAt)>Z())||!await X())throw new R({target:$.path,name:$.name})}});return}let z=`${W}.${I()}.tmp`,K,N=!1;try{K=await x0(z,"wx",384),N=!0,await K.writeFile(`${JSON.stringify({ownerId:Y,expiresAt:Z()+$.ttlMs})}
|
|
3
|
-
`,"utf8"),await K.chmod(384),await K.close(),K=void 0;let H=await j();if(H?.ownerId!==Y||!(Number(H?.expiresAt)>Z())||!await X())throw new R({target:$.path,name:$.name});await Q0(z,W),N=!1}finally{if(await K?.close().catch(()=>{}),N)await L(z,{force:!0}).catch(()=>{})}}async function s(){let z=`${JSON.stringify({ownerId:Y,expiresAt:Z()+$.ttlMs})}
|
|
4
|
-
`;if(G)await v(W,z);else await Z0(W,z,{encoding:"utf8",mode:384,flag:"wx"})}async function n(z){let K=z.code;if(K==="EEXIST"){if(G)await j();return!0}if(K==="EISDIR"){if(G)await U(W,"directory",!0),await S(Q,!0);return!0}return!1}async function k(){if(G)await h(P(W));try{return await s(),!0}catch(z){let K=z.code;if(await n(z))return!1;if(K==="ENOENT"){if(G)await h(P(W));else await G0(P(W),{recursive:!0});try{return await s(),!0}catch(N){if(await n(N))return!1;throw N}}throw z}}async function O(){await new Promise((z)=>setTimeout(z,Math.floor(Math.random()*4)))}async function m(z=!0){if(z&&$.onStep)await $.onStep("lock-read-ready");let K;try{K=await j()}catch(H){if(G&&H.code!=="ENOENT")throw H}let N=Number(K?.expiresAt);if(Number.isFinite(N)&&N>Z())return{status:"live"};if(typeof K?.ownerId==="string"&&Number.isFinite(N))return{status:"stale",identity:{kind:"owner",ownerId:K.ownerId,expiresAt:N}};try{let H=await Y0(W),V=Number.isFinite(N)?N:H.mtimeMs+$.ttlMs;if(V>Z())return{status:"live"};return{status:"stale",identity:{kind:"stat",dev:H.dev,ino:H.ino,mtimeMs:H.mtimeMs,expiresAt:V}}}catch(H){if(H.code==="ENOENT"){if($.onStep)await $.onStep("lock-missing");return{status:"missing"}}throw H}}function i(z,K){if(K.status!=="stale")return!1;let N=K.identity;if(z.kind==="owner"&&N.kind==="owner")return z.ownerId===N.ownerId&&z.expiresAt===N.expiresAt;return z.kind==="stat"&&N.kind==="stat"&&z.dev===N.dev&&z.ino===N.ino&&z.mtimeMs===N.mtimeMs&&z.expiresAt===N.expiresAt}async function X(){try{return JSON.parse(await S(M,G))?.ownerId===a}catch(z){if(G&&z.code!=="ENOENT")throw z;return!1}}async function T(z){if(G)await V0(z,"remove",()=>L(z,{recursive:!0,force:!0}));else await L(z,{recursive:!0,force:!0}).catch(()=>{})}async function u(){if(await X())await T(x)}async function t(){if(G)await _0(x);else await G0(x);try{let z=`${JSON.stringify({ownerId:a,createdAt:Z()})}
|
|
5
|
-
`;if(G)await v(M,z);else await Z0(M,z,{encoding:"utf8",mode:384,flag:"wx"})}catch(z){if(q0(z))return!1;throw await u(),z}if($.onStep)await $.onStep("eviction-marker-acquired");return!0}async function r(){let z;try{z=await Y0(x)}catch(N){if(N.code==="ENOENT")return"missing";throw N}if(G)await U(x,"directory",!0);if(z.mtimeMs+j0>Z())return"fresh";if($.onStep)await $.onStep("stale-marker-stat");let K=`${x}.${I()}`;try{await Q0(x,K)}catch(N){if(N.code==="ENOENT")return"missing";throw N}if($.onStep)await $.onStep("stale-marker-claimed");return await T(K),"recovered"}async function o(z){try{if(!await t())return!1}catch(K){if(K.code==="EEXIST"){if(G){await U(x,"directory",!0);try{await S(M,!0)}catch(N){if(N.code!=="ENOENT")throw N}}return!1}throw K}try{await z()}finally{await u()}return!0}async function e(){for(let z=0;z<y;z++){if($.onStep)await $.onStep("relinquish-read");let K;try{K=await j()}catch(N){if(G)throw N;return}if(K?.ownerId!==Y)return;try{await L(W,{recursive:!0,force:!0});return}catch(N){if(G)throw N;await O()}}}function $0(){if(!$.renew||_||B)return;let z=$.renewIntervalMs??Math.max(1000,Math.floor($.ttlMs/3));if(J=g0(()=>{J=null;let K=(async()=>{let N=!_;try{if(!await o(async()=>{let V=await j(),A=Z();if(_||B){N=!1;return}if(V?.ownerId!==Y){C("taken-over",V),N=!1;return}if(!(Number(V?.expiresAt)>A)){C("expired",V),N=!1;return}if($.onStep)await $.onStep("renewal-owner-confirmed");if(_||B){N=!1;return}if(!await X())return;if($.onStep)await $.onStep("renewal-write-fenced");if(_||B){N=!1;return}if(!await X())return;if($.onStep)await $.onStep("renewal-write-ready");if(_||B){N=!1;return}if(await C0(),$.onStep)await $.onStep("renewal-write-finished");if(!await X()){C("marker-lost"),N=!1,await e();return}})&&$.onStep)await $.onStep("renewal-marker-unavailable")}catch(H){if(G&&H instanceof q)E=H,C("renewal-failed"),N=!1;try{let V=await j();if(V?.ownerId!==Y)C("taken-over",V);else if(!(Number(V?.expiresAt)>Z()))C("expired",V)}catch{C("renewal-failed")}}finally{if($.onStep)try{await $.onStep("renewal-finished")}catch{}if(N&&!_&&!B)$0()}})();f=K,K.finally(()=>{if(f===K)f=null})},z),"unref"in J)J.unref();p("scheduled")}function z0(){try{let z=$.onContended?.();if(z&&(typeof z==="object"||typeof z==="function")&&"then"in z&&typeof z.then==="function")Promise.resolve(z).catch(()=>{})}catch{}return null}let D=await k();if(!D)for(let z=0;z<y;z++){if(D=await k(),D)break;let K=await m();if(K.status==="live")return z0();if(K.status==="missing")continue;if($.onStep)await $.onStep("stale-lock-observed");try{if(!await t()){await O();continue}}catch(N){if(N.code!=="EEXIST")throw N;if(await r()==="fresh")return null;await O();continue}try{let N=await m();if(N.status==="live")return z0();if(!i(K.identity,N))continue;if(!await X())return null;if($.onStep)await $.onStep("stale-lock-confirmed");if(!await X())return null;let H=await m(!1);if(!i(K.identity,H))continue;if(await T(W),!await X())return null;if($.onStep)await $.onStep("stale-lock-removed");if(D=await k(),!D)return null;if($.onStep)await $.onStep("stale-lock-recreated");if(!await X())return await e(),D=!1,null;break}finally{await u()}}if(!D)return null;return $0(),{ownerId:Y,whenLost:()=>X0,hasLost:()=>B!==void 0,assertOwned:async()=>{if(E)throw E;let z;try{let K=await j();if(z=K,!_&&!B&&K?.ownerId===Y&&Number(K?.expiresAt)>Z())return;C(K?.ownerId!==Y?"taken-over":"expired",K)}catch(K){if(C("unreadable"),G&&K instanceof q)throw K}throw new R({target:$.path,name:$.name,expectedOwnerId:Y,...typeof z?.ownerId==="string"?{observedOwnerId:z.ownerId}:{},...typeof z?.expiresAt==="number"?{observedExpiresAt:z.expiresAt}:{}})},release:async()=>{if(G&&g)return;_=!0,d(),await f;for(let z=0;z<y;z++){try{let K=!1;if(await o(async()=>{let H;try{H=await j()}catch(V){if(G&&V.code==="ENOENT"){K=!0;return}throw V}if(H?.ownerId!==Y){K=!0;return}if($.onStep)await $.onStep("release-owner-confirmed");if(!await X())return;await T(W),K=!0})){if(G&&!K)throw new q(W,"release-not-confirmed",{code:"EIO"});g=K;return}await r()}catch(K){if(G)throw K;return}await O()}if(G)throw new q(W,"release-not-confirmed",{code:"ETIMEDOUT"})}}}import{randomUUID as B0}from"node:crypto";import{mkdir as U0,open as F,rename as S0,rm as R0}from"node:fs/promises";import{dirname as w}from"node:path";class c extends Error{constructor($){super("file or directory sync failed",{cause:$});this.name="AtomicSyncError"}}async function P0($,W,Q={}){await f0($,W,Q)}async function f0($,W,Q,Y){if(G)return b($,Q.serialize?Q.serialize(W):`${JSON.stringify(W,null,2)}
|
|
6
|
-
`,{beforeRename:Q.beforeRename,stagePath:`${$}.${(Q.stageName??B0)()}.tmp`,onRenamed:Y,durable:Q.durable,durability:Q.durability,onOutcome:Q.onOutcome});await U0(w($),{recursive:!0});let Z=`${$}.${(Q.stageName??B0)()}.tmp`,J,_=!1;try{if(J=await F(Z,"wx",384),_=!0,await J.writeFile(Q.serialize?Q.serialize(W):`${JSON.stringify(W,null,2)}
|
|
7
|
-
`,"utf8"),await J.chmod(384),Q.durable)try{await J.sync()}catch(g){throw new c(g)}if(await J.close(),J=void 0,await Q.beforeRename?.(),await S0(Z,$),_=!1,Y?.(),Q.durable){let g=await F(w($),"r");try{await g.sync()}catch(B){throw new c(B)}finally{await g.close()}}}finally{if(await J?.close().catch(()=>{}),_)await R0(Z,{force:!0}).catch(()=>{})}}async function h0($){if(G){await U($,"file");let Y=new q($,"directory-sync-unsupported",{code:"ENOTSUP"});throw Y.published=!0,Y}let W=await F($,"r");try{await W.sync()}finally{await W.close()}let Q=await F(w($),"r");try{await Q.sync()}finally{await Q.close()}}var w0=Object.freeze({sidebar:Object.freeze({name:"sidebar-write",ttlMs:1e4,timeoutMs:15000,renew:!0}),preferences:Object.freeze({name:"preferences",ttlMs:1e4,timeoutMs:2000,renew:!0})});
|
|
8
|
-
export{c as xd,P0 as yd,f0 as zd,h0 as Ad,K0 as Bd,W0 as Cd,R as Dd,O0 as Ed,w0 as Fd};
|