@cortexkit/opencode-openai-auth 1.20.2 → 1.21.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 (50) hide show
  1. package/dist/bin.js +2 -2
  2. package/dist/{codex-request-Dvj28zFK.d.ts → codex-request-NjUd_A0U.d.ts} +19 -3
  3. package/dist/{index-z4tfv40j.js → index-14m8qtpx.js} +2 -2
  4. package/dist/{index-jky7c65x.js → index-1arphj0y.js} +2 -2
  5. package/dist/{index-qtaqp1bf.js → index-4vgtvqfc.js} +1 -1
  6. package/dist/{index-8ge0as5s.js → index-4xa80px1.js} +2 -2
  7. package/dist/index-60v2qzqm.js +75 -0
  8. package/dist/{index-xcsz00nr.js → index-8kg9h2zj.js} +2 -2
  9. package/dist/{index-0mf78d7s.js → index-cqmzvf2k.js} +1 -1
  10. package/dist/index-ewbggf3b.js +101 -0
  11. package/dist/{index-c4h4t3wg.js → index-h41zc747.js} +2 -2
  12. package/dist/index-ksfxd8p5.js +64 -0
  13. package/dist/{index-dsytdx0r.js → index-qx3zz6dw.js} +1 -1
  14. package/dist/{index-t15pb3n2.js → index-rvphtptz.js} +1 -1
  15. package/dist/{index-38xyx9nd.js → index-vhn0n16s.js} +1 -1
  16. package/dist/{index-a1zh72v8.js → index-zd0hham5.js} +2 -2
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/openai-auth.schema.json +22 -0
  20. package/dist/rpc/port-file.js +1 -1
  21. package/dist/rpc/protocol.js +1 -1
  22. package/dist/rpc/rpc-client.js +1 -1
  23. package/dist/rpc/rpc-dir.js +1 -1
  24. package/dist/sidebar-state.js +1 -1
  25. package/dist/{token-y8xp4cbz.js → token-01hgthyy.js} +1 -1
  26. package/dist/token-util-29yt43da.js +1 -0
  27. package/dist/tui-preferences.js +1 -1
  28. package/dist/v2/server.d.ts +1 -1
  29. package/dist/v2/server.js +4 -4
  30. package/package.json +4 -4
  31. package/src/tui-compiled/raw/shared/0f77ebc3c914c9c6-custody.js +145 -8
  32. package/src/tui-compiled/raw/shared/169b2b4bf30909bc-consumer.js +32 -0
  33. package/src/tui-compiled/raw/shared/29d709188b920a92-client-options.js +18 -0
  34. package/src/tui-compiled/raw/shared/352d228be2832bd4-hub.js +10 -0
  35. package/src/tui-compiled/raw/shared/b9588ad4725c1d10-enrollment.js +2 -1
  36. package/src/tui-compiled/raw/shared/c97089ed4243981c-host.js +8 -0
  37. package/src/tui-compiled/raw/shared/d0f0b6be200311af-insula.js +4 -5
  38. package/src/tui-compiled/raw/shared/e8d3c8da776ef9cd-index.js +3 -2
  39. package/src/tui-compiled/runtime/shared/0f77ebc3c914c9c6-custody.js +145 -8
  40. package/src/tui-compiled/runtime/shared/169b2b4bf30909bc-consumer.js +32 -0
  41. package/src/tui-compiled/runtime/shared/29d709188b920a92-client-options.js +18 -0
  42. package/src/tui-compiled/runtime/shared/352d228be2832bd4-hub.js +10 -0
  43. package/src/tui-compiled/runtime/shared/b9588ad4725c1d10-enrollment.js +2 -1
  44. package/src/tui-compiled/runtime/shared/c97089ed4243981c-host.js +8 -0
  45. package/src/tui-compiled/runtime/shared/d0f0b6be200311af-insula.js +4 -5
  46. package/src/tui-compiled/runtime/shared/e8d3c8da776ef9cd-index.js +3 -2
  47. package/dist/index-ah9yt0zm.js +0 -64
  48. package/dist/index-rbc7cfbv.js +0 -75
  49. package/dist/index-x3q449sn.js +0 -101
  50. package/dist/token-util-qgycqbjw.js +0 -1
@@ -1,2 +1,2 @@
1
- import{eh as Z,gh as W}from"./index-t15pb3n2.js";var R=Z(($G,E)=>{var{defineProperty:N,getOwnPropertyDescriptor:Kz,getOwnPropertyNames:Qz}=Object,Wz=Object.prototype.hasOwnProperty,Xz=(z,G)=>{for(var H in G)N(z,H,{get:G[H],enumerable:!0})},Yz=(z,G,H,Q)=>{if(G&&typeof G==="object"||typeof G==="function"){for(let K of Qz(G))if(!Wz.call(z,K)&&K!==H)N(z,K,{get:()=>G[K],enumerable:!(Q=Kz(G,K))||Q.enumerable})}return z},Zz=(z)=>Yz(N({},"__esModule",{value:!0}),z),O={};Xz(O,{VercelOidcTokenError:()=>S});E.exports=Zz(O);class S extends Error{constructor(z,G){super(z);this.name="VercelOidcTokenError",this.cause=G}toString(){if(this.cause)return`${this.name}: ${this.message}: ${this.cause}`;return`${this.name}: ${this.message}`}}});var P=Z((qG,y)=>{var{create:$z,defineProperty:L,getOwnPropertyDescriptor:qz,getOwnPropertyNames:vz,getPrototypeOf:Bz}=Object,Fz=Object.prototype.hasOwnProperty,Uz=(z,G)=>{for(var H in G)L(z,H,{get:G[H],enumerable:!0})},C=(z,G,H,Q)=>{if(G&&typeof G==="object"||typeof G==="function"){for(let K of vz(G))if(!Fz.call(z,K)&&K!==H)L(z,K,{get:()=>G[K],enumerable:!(Q=qz(G,K))||Q.enumerable})}return z},I=(z,G,H)=>(H=z!=null?$z(Bz(z)):{},C(G||!z||!z.__esModule?L(H,"default",{value:z,enumerable:!0}):H,z)),Lz=(z)=>C(L({},"__esModule",{value:!0}),z),x={};Uz(x,{findRootDir:()=>Jz,getUserDataDir:()=>Nz});y.exports=Lz(x);var B=I(W("path")),bz=I(W("fs")),A=I(W("os")),Vz=R();function Jz(){try{let z=process.cwd();while(z!==B.default.dirname(z)){let G=B.default.join(z,".vercel");if(bz.default.existsSync(G))return z;z=B.default.dirname(z)}}catch(z){throw new Vz.VercelOidcTokenError("Token refresh only supported in node server environments")}return null}function Nz(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(A.default.platform()){case"darwin":return B.default.join(A.default.homedir(),"Library/Application Support");case"linux":return B.default.join(A.default.homedir(),".local/share");case"win32":if(process.env.LOCALAPPDATA)return process.env.LOCALAPPDATA;return null;default:return null}}});var i=Z((vG,c)=>{var{create:Rz,defineProperty:b,getOwnPropertyDescriptor:Az,getOwnPropertyNames:Iz,getPrototypeOf:Dz}=Object,wz=Object.prototype.hasOwnProperty,Tz=(z,G)=>{for(var H in G)b(z,H,{get:G[H],enumerable:!0})},u=(z,G,H,Q)=>{if(G&&typeof G==="object"||typeof G==="function"){for(let K of Iz(G))if(!wz.call(z,K)&&K!==H)b(z,K,{get:()=>G[K],enumerable:!(Q=Az(G,K))||Q.enumerable})}return z},l=(z,G,H)=>(H=z!=null?Rz(Dz(z)):{},u(G||!z||!z.__esModule?b(H,"default",{value:z,enumerable:!0}):H,z)),jz=(z)=>u(b({},"__esModule",{value:!0}),z),g={};Tz(g,{isValidAccessToken:()=>Ez,readAuthConfig:()=>Oz,writeAuthConfig:()=>Sz});c.exports=jz(g);var F=l(W("fs")),h=l(W("path")),Mz=f();function k(){let z=(0,Mz.getVercelDataDir)();if(!z)throw Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);return h.join(z,"auth.json")}function Oz(){try{let z=k();if(!F.existsSync(z))return null;let G=F.readFileSync(z,"utf8");if(!G)return null;return JSON.parse(G)}catch(z){return null}}function Sz(z){let G=k(),H=h.dirname(G);if(!F.existsSync(H))F.mkdirSync(H,{mode:504,recursive:!0});F.writeFileSync(G,JSON.stringify(z,null,2),{mode:384})}function Ez(z,G=0){if(!z.token)return!1;if(typeof z.expiresAt!=="number")return!0;let H=Math.floor(Date.now()/1000),Q=G/1000;return z.expiresAt>=H+Q}});var a=Z((BG,s)=>{var{defineProperty:T,getOwnPropertyDescriptor:Cz,getOwnPropertyNames:xz}=Object,yz=Object.prototype.hasOwnProperty,Pz=(z,G)=>{for(var H in G)T(z,H,{get:G[H],enumerable:!0})},uz=(z,G,H,Q)=>{if(G&&typeof G==="object"||typeof G==="function"){for(let K of xz(G))if(!yz.call(z,K)&&K!==H)T(z,K,{get:()=>G[K],enumerable:!(Q=Cz(G,K))||Q.enumerable})}return z},lz=(z)=>uz(T({},"__esModule",{value:!0}),z),d={};Pz(d,{processTokenResponse:()=>iz,refreshTokenRequest:()=>cz});s.exports=lz(d);var D=W("os"),gz="https://vercel.com",hz="cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp",p=`@vercel/oidc node-${process.version} ${(0,D.platform)()} (${(0,D.arch)()}) ${(0,D.hostname)()}`,w=null;async function kz(){if(w)return w;let z=`${gz}/.well-known/openid-configuration`,G=await fetch(z,{headers:{"user-agent":p}});if(!G.ok)throw Error("Failed to discover OAuth endpoints");let H=await G.json();if(!H||typeof H.token_endpoint!=="string")throw Error("Invalid OAuth discovery response");let Q=H.token_endpoint;return w=Q,Q}async function cz(z){let G=await kz();return await fetch(G,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":p},body:new URLSearchParams({client_id:hz,grant_type:"refresh_token",...z})})}async function iz(z){let G=await z.json();if(!z.ok){let H=typeof G==="object"&&G&&"error"in G?String(G.error):"Token refresh failed";return[Error(H)]}if(typeof G!=="object"||G===null)return[Error("Invalid token response")];if(typeof G.access_token!=="string")return[Error("Missing access_token in response")];if(G.token_type!=="Bearer")return[Error("Invalid token_type in response")];if(typeof G.expires_in!=="number")return[Error("Missing expires_in in response")];return[null,G]}});var t=Z((FG,r)=>{var{defineProperty:j,getOwnPropertyDescriptor:fz,getOwnPropertyNames:dz}=Object,pz=Object.prototype.hasOwnProperty,sz=(z,G)=>{for(var H in G)j(z,H,{get:G[H],enumerable:!0})},az=(z,G,H,Q)=>{if(G&&typeof G==="object"||typeof G==="function"){for(let K of dz(G))if(!pz.call(z,K)&&K!==H)j(z,K,{get:()=>G[K],enumerable:!(Q=fz(G,K))||Q.enumerable})}return z},_z=(z)=>az(j({},"__esModule",{value:!0}),z),_={};sz(_,{AccessTokenMissingError:()=>m,RefreshAccessTokenFailedError:()=>n});r.exports=_z(_);class m extends Error{constructor(){super("No authentication found. Please log in with the Vercel CLI (vercel login).");this.name="AccessTokenMissingError"}}class n extends Error{constructor(z){super("Failed to refresh authentication token.",{cause:z});this.name="RefreshAccessTokenFailedError"}}});var f=Z((UG,Hz)=>{var{create:mz,defineProperty:V,getOwnPropertyDescriptor:nz,getOwnPropertyNames:rz,getPrototypeOf:tz}=Object,ez=Object.prototype.hasOwnProperty,oz=(z,G)=>{for(var H in G)V(z,H,{get:G[H],enumerable:!0})},o=(z,G,H,Q)=>{if(G&&typeof G==="object"||typeof G==="function"){for(let K of rz(G))if(!ez.call(z,K)&&K!==H)V(z,K,{get:()=>G[K],enumerable:!(Q=nz(G,K))||Q.enumerable})}return z},zz=(z,G,H)=>(H=z!=null?mz(tz(z)):{},o(G||!z||!z.__esModule?V(H,"default",{value:z,enumerable:!0}):H,z)),zG=(z)=>o(V({},"__esModule",{value:!0}),z),Gz={};oz(Gz,{assertVercelOidcTokenResponse:()=>M,findProjectInfo:()=>QG,getTokenPayload:()=>YG,getVercelDataDir:()=>GG,getVercelOidcToken:()=>KG,getVercelToken:()=>HG,isExpired:()=>ZG,loadToken:()=>XG,saveToken:()=>WG});Hz.exports=zG(Gz);var U=zz(W("path")),X=zz(W("fs")),v=R(),J=P(),$=i(),e=a(),q=t();function GG(){let G=(0,J.getUserDataDir)();if(!G)return null;return U.join(G,"com.vercel.cli")}async function HG(z){let G=(0,$.readAuthConfig)();if(!G?.token)throw new q.AccessTokenMissingError;if((0,$.isValidAccessToken)(G,z?.expirationBufferMs))return G.token;if(!G.refreshToken)throw(0,$.writeAuthConfig)({}),new q.RefreshAccessTokenFailedError("No refresh token available");try{let H=await(0,e.refreshTokenRequest)({refresh_token:G.refreshToken}),[Q,K]=await(0,e.processTokenResponse)(H);if(Q||!K)throw(0,$.writeAuthConfig)({}),new q.RefreshAccessTokenFailedError(Q);let Y={token:K.access_token,expiresAt:Math.floor(Date.now()/1000)+K.expires_in};if(K.refresh_token)Y.refreshToken=K.refresh_token;return(0,$.writeAuthConfig)(Y),Y.token}catch(H){if((0,$.writeAuthConfig)({}),H instanceof q.AccessTokenMissingError||H instanceof q.RefreshAccessTokenFailedError)throw H;throw new q.RefreshAccessTokenFailedError(H)}}async function KG(z,G,H){let Q=`https://api.vercel.com/v1/projects/${G}/token?source=vercel-oidc-refresh${H?`&teamId=${H}`:""}`,K=await fetch(Q,{method:"POST",headers:{Authorization:`Bearer ${z}`}});if(!K.ok)throw new v.VercelOidcTokenError(`Failed to refresh OIDC token: ${K.statusText}`);let Y=await K.json();return M(Y),Y}function M(z){if(!z||typeof z!=="object")throw TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again");if(!("token"in z)||typeof z.token!=="string")throw TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again")}function QG(){let z=(0,J.findRootDir)();if(!z)throw new v.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");let G=U.join(z,".vercel","project.json");if(!X.existsSync(G))throw new v.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");let H=JSON.parse(X.readFileSync(G,"utf8"));if(typeof H.projectId!=="string"&&typeof H.orgId!=="string")throw TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");return{projectId:H.projectId,teamId:H.orgId}}function WG(z,G){let H=(0,J.getUserDataDir)();if(!H)throw new v.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let Q=U.join(H,"com.vercel.token",`${G}.json`),K=JSON.stringify(z);X.mkdirSync(U.dirname(Q),{mode:504,recursive:!0}),X.writeFileSync(Q,K),X.chmodSync(Q,432);return}function XG(z){let G=(0,J.getUserDataDir)();if(!G)throw new v.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let H=U.join(G,"com.vercel.token",`${z}.json`);if(!X.existsSync(H))return null;let Q=JSON.parse(X.readFileSync(H,"utf8"));return M(Q),Q}function YG(z){let G=z.split(".");if(G.length!==3)throw new v.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again");let H=G[1].replace(/-/g,"+").replace(/_/g,"/"),Q=H.padEnd(H.length+(4-H.length%4)%4,"=");return JSON.parse(Buffer.from(Q,"base64").toString("utf8"))}function ZG(z,G=0){return z.exp*1000<Date.now()+G}});
1
+ import{gh as Z,ih as W}from"./index-rvphtptz.js";var R=Z(($G,E)=>{var{defineProperty:N,getOwnPropertyDescriptor:Kz,getOwnPropertyNames:Qz}=Object,Wz=Object.prototype.hasOwnProperty,Xz=(z,G)=>{for(var H in G)N(z,H,{get:G[H],enumerable:!0})},Yz=(z,G,H,Q)=>{if(G&&typeof G==="object"||typeof G==="function"){for(let K of Qz(G))if(!Wz.call(z,K)&&K!==H)N(z,K,{get:()=>G[K],enumerable:!(Q=Kz(G,K))||Q.enumerable})}return z},Zz=(z)=>Yz(N({},"__esModule",{value:!0}),z),O={};Xz(O,{VercelOidcTokenError:()=>S});E.exports=Zz(O);class S extends Error{constructor(z,G){super(z);this.name="VercelOidcTokenError",this.cause=G}toString(){if(this.cause)return`${this.name}: ${this.message}: ${this.cause}`;return`${this.name}: ${this.message}`}}});var P=Z((qG,y)=>{var{create:$z,defineProperty:L,getOwnPropertyDescriptor:qz,getOwnPropertyNames:vz,getPrototypeOf:Bz}=Object,Fz=Object.prototype.hasOwnProperty,Uz=(z,G)=>{for(var H in G)L(z,H,{get:G[H],enumerable:!0})},C=(z,G,H,Q)=>{if(G&&typeof G==="object"||typeof G==="function"){for(let K of vz(G))if(!Fz.call(z,K)&&K!==H)L(z,K,{get:()=>G[K],enumerable:!(Q=qz(G,K))||Q.enumerable})}return z},I=(z,G,H)=>(H=z!=null?$z(Bz(z)):{},C(G||!z||!z.__esModule?L(H,"default",{value:z,enumerable:!0}):H,z)),Lz=(z)=>C(L({},"__esModule",{value:!0}),z),x={};Uz(x,{findRootDir:()=>Jz,getUserDataDir:()=>Nz});y.exports=Lz(x);var B=I(W("path")),bz=I(W("fs")),A=I(W("os")),Vz=R();function Jz(){try{let z=process.cwd();while(z!==B.default.dirname(z)){let G=B.default.join(z,".vercel");if(bz.default.existsSync(G))return z;z=B.default.dirname(z)}}catch(z){throw new Vz.VercelOidcTokenError("Token refresh only supported in node server environments")}return null}function Nz(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(A.default.platform()){case"darwin":return B.default.join(A.default.homedir(),"Library/Application Support");case"linux":return B.default.join(A.default.homedir(),".local/share");case"win32":if(process.env.LOCALAPPDATA)return process.env.LOCALAPPDATA;return null;default:return null}}});var i=Z((vG,c)=>{var{create:Rz,defineProperty:b,getOwnPropertyDescriptor:Az,getOwnPropertyNames:Iz,getPrototypeOf:Dz}=Object,wz=Object.prototype.hasOwnProperty,Tz=(z,G)=>{for(var H in G)b(z,H,{get:G[H],enumerable:!0})},u=(z,G,H,Q)=>{if(G&&typeof G==="object"||typeof G==="function"){for(let K of Iz(G))if(!wz.call(z,K)&&K!==H)b(z,K,{get:()=>G[K],enumerable:!(Q=Az(G,K))||Q.enumerable})}return z},l=(z,G,H)=>(H=z!=null?Rz(Dz(z)):{},u(G||!z||!z.__esModule?b(H,"default",{value:z,enumerable:!0}):H,z)),jz=(z)=>u(b({},"__esModule",{value:!0}),z),g={};Tz(g,{isValidAccessToken:()=>Ez,readAuthConfig:()=>Oz,writeAuthConfig:()=>Sz});c.exports=jz(g);var F=l(W("fs")),h=l(W("path")),Mz=f();function k(){let z=(0,Mz.getVercelDataDir)();if(!z)throw Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);return h.join(z,"auth.json")}function Oz(){try{let z=k();if(!F.existsSync(z))return null;let G=F.readFileSync(z,"utf8");if(!G)return null;return JSON.parse(G)}catch(z){return null}}function Sz(z){let G=k(),H=h.dirname(G);if(!F.existsSync(H))F.mkdirSync(H,{mode:504,recursive:!0});F.writeFileSync(G,JSON.stringify(z,null,2),{mode:384})}function Ez(z,G=0){if(!z.token)return!1;if(typeof z.expiresAt!=="number")return!0;let H=Math.floor(Date.now()/1000),Q=G/1000;return z.expiresAt>=H+Q}});var a=Z((BG,s)=>{var{defineProperty:T,getOwnPropertyDescriptor:Cz,getOwnPropertyNames:xz}=Object,yz=Object.prototype.hasOwnProperty,Pz=(z,G)=>{for(var H in G)T(z,H,{get:G[H],enumerable:!0})},uz=(z,G,H,Q)=>{if(G&&typeof G==="object"||typeof G==="function"){for(let K of xz(G))if(!yz.call(z,K)&&K!==H)T(z,K,{get:()=>G[K],enumerable:!(Q=Cz(G,K))||Q.enumerable})}return z},lz=(z)=>uz(T({},"__esModule",{value:!0}),z),d={};Pz(d,{processTokenResponse:()=>iz,refreshTokenRequest:()=>cz});s.exports=lz(d);var D=W("os"),gz="https://vercel.com",hz="cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp",p=`@vercel/oidc node-${process.version} ${(0,D.platform)()} (${(0,D.arch)()}) ${(0,D.hostname)()}`,w=null;async function kz(){if(w)return w;let z=`${gz}/.well-known/openid-configuration`,G=await fetch(z,{headers:{"user-agent":p}});if(!G.ok)throw Error("Failed to discover OAuth endpoints");let H=await G.json();if(!H||typeof H.token_endpoint!=="string")throw Error("Invalid OAuth discovery response");let Q=H.token_endpoint;return w=Q,Q}async function cz(z){let G=await kz();return await fetch(G,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":p},body:new URLSearchParams({client_id:hz,grant_type:"refresh_token",...z})})}async function iz(z){let G=await z.json();if(!z.ok){let H=typeof G==="object"&&G&&"error"in G?String(G.error):"Token refresh failed";return[Error(H)]}if(typeof G!=="object"||G===null)return[Error("Invalid token response")];if(typeof G.access_token!=="string")return[Error("Missing access_token in response")];if(G.token_type!=="Bearer")return[Error("Invalid token_type in response")];if(typeof G.expires_in!=="number")return[Error("Missing expires_in in response")];return[null,G]}});var t=Z((FG,r)=>{var{defineProperty:j,getOwnPropertyDescriptor:fz,getOwnPropertyNames:dz}=Object,pz=Object.prototype.hasOwnProperty,sz=(z,G)=>{for(var H in G)j(z,H,{get:G[H],enumerable:!0})},az=(z,G,H,Q)=>{if(G&&typeof G==="object"||typeof G==="function"){for(let K of dz(G))if(!pz.call(z,K)&&K!==H)j(z,K,{get:()=>G[K],enumerable:!(Q=fz(G,K))||Q.enumerable})}return z},_z=(z)=>az(j({},"__esModule",{value:!0}),z),_={};sz(_,{AccessTokenMissingError:()=>m,RefreshAccessTokenFailedError:()=>n});r.exports=_z(_);class m extends Error{constructor(){super("No authentication found. Please log in with the Vercel CLI (vercel login).");this.name="AccessTokenMissingError"}}class n extends Error{constructor(z){super("Failed to refresh authentication token.",{cause:z});this.name="RefreshAccessTokenFailedError"}}});var f=Z((UG,Hz)=>{var{create:mz,defineProperty:V,getOwnPropertyDescriptor:nz,getOwnPropertyNames:rz,getPrototypeOf:tz}=Object,ez=Object.prototype.hasOwnProperty,oz=(z,G)=>{for(var H in G)V(z,H,{get:G[H],enumerable:!0})},o=(z,G,H,Q)=>{if(G&&typeof G==="object"||typeof G==="function"){for(let K of rz(G))if(!ez.call(z,K)&&K!==H)V(z,K,{get:()=>G[K],enumerable:!(Q=nz(G,K))||Q.enumerable})}return z},zz=(z,G,H)=>(H=z!=null?mz(tz(z)):{},o(G||!z||!z.__esModule?V(H,"default",{value:z,enumerable:!0}):H,z)),zG=(z)=>o(V({},"__esModule",{value:!0}),z),Gz={};oz(Gz,{assertVercelOidcTokenResponse:()=>M,findProjectInfo:()=>QG,getTokenPayload:()=>YG,getVercelDataDir:()=>GG,getVercelOidcToken:()=>KG,getVercelToken:()=>HG,isExpired:()=>ZG,loadToken:()=>XG,saveToken:()=>WG});Hz.exports=zG(Gz);var U=zz(W("path")),X=zz(W("fs")),v=R(),J=P(),$=i(),e=a(),q=t();function GG(){let G=(0,J.getUserDataDir)();if(!G)return null;return U.join(G,"com.vercel.cli")}async function HG(z){let G=(0,$.readAuthConfig)();if(!G?.token)throw new q.AccessTokenMissingError;if((0,$.isValidAccessToken)(G,z?.expirationBufferMs))return G.token;if(!G.refreshToken)throw(0,$.writeAuthConfig)({}),new q.RefreshAccessTokenFailedError("No refresh token available");try{let H=await(0,e.refreshTokenRequest)({refresh_token:G.refreshToken}),[Q,K]=await(0,e.processTokenResponse)(H);if(Q||!K)throw(0,$.writeAuthConfig)({}),new q.RefreshAccessTokenFailedError(Q);let Y={token:K.access_token,expiresAt:Math.floor(Date.now()/1000)+K.expires_in};if(K.refresh_token)Y.refreshToken=K.refresh_token;return(0,$.writeAuthConfig)(Y),Y.token}catch(H){if((0,$.writeAuthConfig)({}),H instanceof q.AccessTokenMissingError||H instanceof q.RefreshAccessTokenFailedError)throw H;throw new q.RefreshAccessTokenFailedError(H)}}async function KG(z,G,H){let Q=`https://api.vercel.com/v1/projects/${G}/token?source=vercel-oidc-refresh${H?`&teamId=${H}`:""}`,K=await fetch(Q,{method:"POST",headers:{Authorization:`Bearer ${z}`}});if(!K.ok)throw new v.VercelOidcTokenError(`Failed to refresh OIDC token: ${K.statusText}`);let Y=await K.json();return M(Y),Y}function M(z){if(!z||typeof z!=="object")throw TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again");if(!("token"in z)||typeof z.token!=="string")throw TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again")}function QG(){let z=(0,J.findRootDir)();if(!z)throw new v.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");let G=U.join(z,".vercel","project.json");if(!X.existsSync(G))throw new v.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");let H=JSON.parse(X.readFileSync(G,"utf8"));if(typeof H.projectId!=="string"&&typeof H.orgId!=="string")throw TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");return{projectId:H.projectId,teamId:H.orgId}}function WG(z,G){let H=(0,J.getUserDataDir)();if(!H)throw new v.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let Q=U.join(H,"com.vercel.token",`${G}.json`),K=JSON.stringify(z);X.mkdirSync(U.dirname(Q),{mode:504,recursive:!0}),X.writeFileSync(Q,K),X.chmodSync(Q,432);return}function XG(z){let G=(0,J.getUserDataDir)();if(!G)throw new v.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let H=U.join(G,"com.vercel.token",`${z}.json`);if(!X.existsSync(H))return null;let Q=JSON.parse(X.readFileSync(H,"utf8"));return M(Q),Q}function YG(z){let G=z.split(".");if(G.length!==3)throw new v.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again");let H=G[1].replace(/-/g,"+").replace(/_/g,"/"),Q=H.padEnd(H.length+(4-H.length%4)%4,"=");return JSON.parse(Buffer.from(Q,"base64").toString("utf8"))}function ZG(z,G=0){return z.exp*1000<Date.now()+G}});
2
2
  export{R as a,f as b};
@@ -1,2 +1,2 @@
1
1
  import{createRequire as n}from"node:module";var k=Object.defineProperty;var q=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports);var l=(b)=>b;function m(b,a){this[b]=l.bind(null,a)}var r=(b,a)=>{for(var c in a)k(b,c,{get:a[c],enumerable:!0,configurable:!0,set:m.bind(a,c)})};var t=n(import.meta.url),o=Symbol.dispose||Symbol.for("Symbol.dispose"),p=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),u=(b,a,c)=>{if(a!=null){if(typeof a!=="object"&&typeof a!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var e;if(c)e=a[p];if(e===void 0)e=a[o];if(typeof e!=="function")throw TypeError("Object not disposable");b.push([c,e,a])}else if(c)b.push([c]);return a},v=(b,a,c)=>{var e=typeof SuppressedError==="function"?SuppressedError:function(d,i,f,g){return g=Error(f),g.name="SuppressedError",g.error=d,g.suppressed=i,g},j=(d)=>a=c?new e(d,a,"An error was suppressed during disposal"):(c=!0,d),h=(d)=>{while(d=b.pop())try{var i=d[1]&&d[1].call(d[2]);if(d[0])return Promise.resolve(i).then(h,(f)=>(j(f),h()))}catch(f){j(f)}if(c)throw a};return h()};
2
- export{q as eh,r as fh,t as gh,u as hh,v as ih};
2
+ export{q as gh,r as hh,t as ih,u as jh,v as kh};
@@ -1,3 +1,3 @@
1
- import{uc as X,wc as V}from"./index-rbc7cfbv.js";import{randomUUID as Z}from"node:crypto";import{chmod as $,mkdir as G,readFile as H,rename as L,rm as T,stat as f,writeFile as g}from"node:fs/promises";import{dirname as k,resolve as w}from"node:path";var x="(no OpenCode 1 logins on this machine)";function C(b=process.env){return X(b)}async function Q(b){let z;try{z=await H(b,"utf8")}catch(q){if(q.code==="ENOENT")return;throw q}let j=JSON.parse(z);if(!j||typeof j!=="object"||Array.isArray(j))throw Error(`${b} does not hold a JSON object`);return j}function R(b){return b===void 0?void 0:JSON.stringify(b)}async function D(b){try{return(await f(b)).mode&511}catch(z){if(z.code==="ENOENT")return;throw z}}function _(b=C()){let z=new Map;return{path:w(b),async get(j){let q=(await Q(b))?.[j.path.id];return z.set(j.path.id,R(q)),q},async set(j){let q=j.path.id,W=await D(b),J=await Q(b)??{};if(!z.has(q)||z.get(q)!==R(J[q]))throw new V;J[q]=j.body,await G(k(b),{recursive:!0});let B=`${b}.${Z()}.tmp`;try{await g(B,`${JSON.stringify(J,null,2)}
1
+ import{wc as X,yc as V}from"./index-60v2qzqm.js";import{randomUUID as Z}from"node:crypto";import{chmod as $,mkdir as G,readFile as H,rename as L,rm as T,stat as f,writeFile as g}from"node:fs/promises";import{dirname as k,resolve as w}from"node:path";var x="(no OpenCode 1 logins on this machine)";function C(b=process.env){return X(b)}async function Q(b){let z;try{z=await H(b,"utf8")}catch(q){if(q.code==="ENOENT")return;throw q}let j=JSON.parse(z);if(!j||typeof j!=="object"||Array.isArray(j))throw Error(`${b} does not hold a JSON object`);return j}function R(b){return b===void 0?void 0:JSON.stringify(b)}async function D(b){try{return(await f(b)).mode&511}catch(z){if(z.code==="ENOENT")return;throw z}}function _(b=C()){let z=new Map;return{path:w(b),async get(j){let q=(await Q(b))?.[j.path.id];return z.set(j.path.id,R(q)),q},async set(j){let q=j.path.id,W=await D(b),J=await Q(b)??{};if(!z.has(q)||z.get(q)!==R(J[q]))throw new V;J[q]=j.body,await G(k(b),{recursive:!0});let B=`${b}.${Z()}.tmp`;try{await g(B,`${JSON.stringify(J,null,2)}
2
2
  `,{mode:W??384}),await $(B,W??384),await L(B,b)}catch(Y){throw await T(B,{force:!0}).catch(()=>{}),Y}return z.set(q,R(j.body)),!0},async all(){let j=await Q(b);if(!j||Object.keys(j).length===0)return{[x]:!0};return j}}}
3
3
  export{_ as c};
@@ -1,4 +1,4 @@
1
- import{$g as c,Qg as _,Rg as U,Vg as g,Wg as p,Xg as E}from"./index-c4h4t3wg.js";import{createHash as Oz,randomUUID as y}from"node:crypto";import{chmod as zz,mkdir as Gz,open as Jz,readdir as F,rename as Kz,rmdir as Nz,stat as T,unlink as I}from"node:fs/promises";import{uptime as Qz}from"node:os";import{join as A,resolve as b}from"node:path";function S(z){return(z.now??Date.now)()-(z.uptime??Qz)()*1000-300000}function x(z,J,Q){let X=z.startedAt===void 0?J?.mtimeMs:z.startedAt;return typeof X==="number"&&Number.isFinite(X)&&X<Q}async function Vz(z,J,Q,X){if(!Q)return;await X?.(z);try{let K=await E(z),G=await T(z);if(K===J&&G.dev===Q.dev&&G.ino===Q.ino&&G.mtimeMs===Q.mtimeMs&&G.size===Q.size)await I(z).catch(()=>{})}catch(K){if(K instanceof U&&K.code!=="ENOENT")throw K}}function a(z){return typeof z==="number"&&Number.isSafeInteger(z)&&z>0}function k(z){if(!a(z))return!1;try{return process.kill(z,0),!0}catch(J){return J.code==="EPERM"}}function Ez(z){return(J)=>Wz(J,z)}function Wz(z,J){if(/^[0-9a-f]{16}$/.test(z))return!0;return z.startsWith(J)&&/^[0-9a-f]{16}$/.test(z.slice(J.length))}function Xz(z){let J=/^port-(\d+)\.json$/.exec(z);return J?Number(J[1]):void 0}function s(z,J){if(z===null||typeof z!=="object"||Array.isArray(z))return!1;let{pid:Q,port:X,token:K}=z;return a(Q)&&Xz(J)===Q&&typeof X==="number"&&Number.isInteger(X)&&X>=1&&X<=65535&&typeof K==="string"&&K.length>0}async function l(z,J){J?.debug("rpc corrupt port file",{pid:process.pid,portFile:z}),await I(z).catch(()=>{})}async function Lz(z,J,Q={}){let X=async()=>{let K=A(z,`port-${J.pid}.json`);if(_)return await p(z,Q.secureDir??!1),await Q.beforeWrite?.(),await c(K,JSON.stringify({...J,startedAt:Date.now()}),{stagePath:`${K}.${(Q.stageName??y)()}.tmp`}),K;if(await Gz(z,{recursive:!0,mode:Q.secureDir?448:void 0}),Q.secureDir)await zz(z,448);await Q.beforeWrite?.();let G={...J,startedAt:Date.now()},Y=`${K}.${(Q.stageName??y)()}.tmp`,V,N=!1;try{V=await Jz(Y,"wx",384),N=!0,await V.writeFile(JSON.stringify(G),"utf8"),await V.chmod(384),await V.close(),V=void 0,await Kz(Y,K),N=!1}finally{if(await V?.close().catch(()=>{}),N)await I(Y).catch(()=>{})}return K};for(let K=1;;K+=1)try{return await X()}catch(G){if(G.code!=="ENOENT"||K===5)throw G;await new Promise((Y)=>setTimeout(Y,25))}}async function Iz(z,J,Q,X,K={}){let G=S(K),Y;try{Y=await F(z,{withFileTypes:!0})}catch(N){if(N.code==="ENOENT")return;throw N}let V=b(J);for(let N of Y){if(!N.isDirectory()||!Q(N.name))continue;let W=A(z,N.name);if(!await Yz(W,X,K,G))continue;if(b(W)!==V)await Nz(W).catch(()=>{})}}async function Yz(z,J,Q={},X=S(Q)){let K;try{K=await F(z)}catch(G){if(G.code==="ENOENT")return!1;throw G}for(let G of K){if(!G.startsWith("port-")||!G.endsWith(".json"))continue;let Y=A(z,G),V=await T(Y).catch(()=>{return}),N;try{N=await E(Y)}catch($){if($ instanceof U&&$.code!=="ENOENT")throw $;continue}if(N===void 0)continue;let W;try{W=JSON.parse(N)}catch{await l(Y,J);continue}if(!s(W,G)){await l(Y,J);continue}let Z=W;if(!k(Z.pid))await I(Y).catch(()=>{});else if(x(Z,V,X))await Vz(Y,N,V,Q.beforeRemove)}return!0}async function d(z,J,Q={}){let X=S(Q);if(!k(J.pid))return null;let K=A(b(z),`port-${J.pid}.json`);try{if(_)await g(K,"file");let G=await T(K);if(x(J,G,X))return null;return`${K}:${G.dev}:${G.ino}:${G.mtimeMs}:${G.size}`}catch(G){if(G instanceof U&&G.code!=="ENOENT")throw G;return null}}async function n(z,J,Q={}){let X=S(Q),K;try{if(_)await g(z,"directory");K=await F(z)}catch(W){if(W instanceof U&&W.code!=="ENOENT")throw W;return null}let G=[];for(let W of K){if(!W.startsWith("port-")||!W.endsWith(".json"))continue;try{let Z=JSON.parse(await E(A(z,W)));if(s(Z,W))if(k(Z.pid)){let $=Z.startedAt===void 0?await T(A(z,W)).catch(()=>{return}):void 0;if(!x(Z,$,X))G.push(Z)}else await I(A(z,W)).catch(()=>{})}catch(Z){if(Z instanceof U&&Z.code!=="ENOENT")throw Z}}if(G.length===0)return null;let Y=J!==void 0&&J>=1?G.filter((W)=>W.pid===J):[];if(Q.exactPid===!0&&Y.length===0)return null;let V=Y.length>0?Y:G,N=(W)=>typeof W.startedAt==="number"&&Number.isFinite(W.startedAt)?W.startedAt:-1/0;return V.sort((W,Z)=>N(Z)-N(W))[0]??null}import{open as Zz}from"node:fs/promises";import{connect as $z}from"node:net";import{join as Hz,resolve as t}from"node:path";var e=2000,q=new Map,B=new Map;async function qz(z,J){let Q=Hz(t(z),`port-${J.pid}.json`);if(_){let K=JSON.parse(await E(Q));if(K.pid!==J.pid||K.port!==J.port||K.token!==J.token)return null;return null}let X;try{X=await Zz(Q,"r");let K=await X.stat(),G=JSON.parse(await X.readFile("utf8"));if(G.pid!==J.pid||G.port!==J.port||G.token!==J.token)return null;return`${Q}:${K.dev}:${K.ino}:${K.mtimeMs}:${K.size}`}catch{return null}finally{await X?.close().catch(()=>{})}}async function i(z,J,Q,X){let K=q.get(z);if(!_&&K&&await d(J,K.entry)===K.identity)return K;q.delete(z);let G=B.get(z);if(G)return G;let Y=(async()=>{let V=await(X.discover??n)(J,Q,X);if(!V)return null;let N=await qz(J,V);if(!N)return{entry:V,identity:""};let W={entry:V,identity:N};return q.set(z,W),W})();B.set(z,Y);try{return await Y}finally{if(B.get(z)===Y)B.delete(z)}}async function o(z,J,Q,X=e){return new Promise((K)=>{let G,Y=!1,V=!1,N=(Z,$=!1)=>{if(Y)return;Y=!0,clearTimeout(W),G?.destroy(),K({value:Z,stale:$})},W=setTimeout(()=>N(null),X);try{let Z=JSON.stringify(Q);G=$z({host:"127.0.0.1",port:z.port}),G.on("connect",()=>{V=!0,G?.write(`POST /rpc/${J} HTTP/1.0\r
1
+ import{Sg as _,Tg as U,Xg as g,Yg as p,Zg as E,bh as c}from"./index-h41zc747.js";import{createHash as Oz,randomUUID as y}from"node:crypto";import{chmod as zz,mkdir as Gz,open as Jz,readdir as F,rename as Kz,rmdir as Nz,stat as T,unlink as I}from"node:fs/promises";import{uptime as Qz}from"node:os";import{join as A,resolve as b}from"node:path";function S(z){return(z.now??Date.now)()-(z.uptime??Qz)()*1000-300000}function x(z,J,Q){let X=z.startedAt===void 0?J?.mtimeMs:z.startedAt;return typeof X==="number"&&Number.isFinite(X)&&X<Q}async function Vz(z,J,Q,X){if(!Q)return;await X?.(z);try{let K=await E(z),G=await T(z);if(K===J&&G.dev===Q.dev&&G.ino===Q.ino&&G.mtimeMs===Q.mtimeMs&&G.size===Q.size)await I(z).catch(()=>{})}catch(K){if(K instanceof U&&K.code!=="ENOENT")throw K}}function a(z){return typeof z==="number"&&Number.isSafeInteger(z)&&z>0}function k(z){if(!a(z))return!1;try{return process.kill(z,0),!0}catch(J){return J.code==="EPERM"}}function Ez(z){return(J)=>Wz(J,z)}function Wz(z,J){if(/^[0-9a-f]{16}$/.test(z))return!0;return z.startsWith(J)&&/^[0-9a-f]{16}$/.test(z.slice(J.length))}function Xz(z){let J=/^port-(\d+)\.json$/.exec(z);return J?Number(J[1]):void 0}function s(z,J){if(z===null||typeof z!=="object"||Array.isArray(z))return!1;let{pid:Q,port:X,token:K}=z;return a(Q)&&Xz(J)===Q&&typeof X==="number"&&Number.isInteger(X)&&X>=1&&X<=65535&&typeof K==="string"&&K.length>0}async function l(z,J){J?.debug("rpc corrupt port file",{pid:process.pid,portFile:z}),await I(z).catch(()=>{})}async function Lz(z,J,Q={}){let X=async()=>{let K=A(z,`port-${J.pid}.json`);if(_)return await p(z,Q.secureDir??!1),await Q.beforeWrite?.(),await c(K,JSON.stringify({...J,startedAt:Date.now()}),{stagePath:`${K}.${(Q.stageName??y)()}.tmp`}),K;if(await Gz(z,{recursive:!0,mode:Q.secureDir?448:void 0}),Q.secureDir)await zz(z,448);await Q.beforeWrite?.();let G={...J,startedAt:Date.now()},Y=`${K}.${(Q.stageName??y)()}.tmp`,V,N=!1;try{V=await Jz(Y,"wx",384),N=!0,await V.writeFile(JSON.stringify(G),"utf8"),await V.chmod(384),await V.close(),V=void 0,await Kz(Y,K),N=!1}finally{if(await V?.close().catch(()=>{}),N)await I(Y).catch(()=>{})}return K};for(let K=1;;K+=1)try{return await X()}catch(G){if(G.code!=="ENOENT"||K===5)throw G;await new Promise((Y)=>setTimeout(Y,25))}}async function Iz(z,J,Q,X,K={}){let G=S(K),Y;try{Y=await F(z,{withFileTypes:!0})}catch(N){if(N.code==="ENOENT")return;throw N}let V=b(J);for(let N of Y){if(!N.isDirectory()||!Q(N.name))continue;let W=A(z,N.name);if(!await Yz(W,X,K,G))continue;if(b(W)!==V)await Nz(W).catch(()=>{})}}async function Yz(z,J,Q={},X=S(Q)){let K;try{K=await F(z)}catch(G){if(G.code==="ENOENT")return!1;throw G}for(let G of K){if(!G.startsWith("port-")||!G.endsWith(".json"))continue;let Y=A(z,G),V=await T(Y).catch(()=>{return}),N;try{N=await E(Y)}catch($){if($ instanceof U&&$.code!=="ENOENT")throw $;continue}if(N===void 0)continue;let W;try{W=JSON.parse(N)}catch{await l(Y,J);continue}if(!s(W,G)){await l(Y,J);continue}let Z=W;if(!k(Z.pid))await I(Y).catch(()=>{});else if(x(Z,V,X))await Vz(Y,N,V,Q.beforeRemove)}return!0}async function d(z,J,Q={}){let X=S(Q);if(!k(J.pid))return null;let K=A(b(z),`port-${J.pid}.json`);try{if(_)await g(K,"file");let G=await T(K);if(x(J,G,X))return null;return`${K}:${G.dev}:${G.ino}:${G.mtimeMs}:${G.size}`}catch(G){if(G instanceof U&&G.code!=="ENOENT")throw G;return null}}async function n(z,J,Q={}){let X=S(Q),K;try{if(_)await g(z,"directory");K=await F(z)}catch(W){if(W instanceof U&&W.code!=="ENOENT")throw W;return null}let G=[];for(let W of K){if(!W.startsWith("port-")||!W.endsWith(".json"))continue;try{let Z=JSON.parse(await E(A(z,W)));if(s(Z,W))if(k(Z.pid)){let $=Z.startedAt===void 0?await T(A(z,W)).catch(()=>{return}):void 0;if(!x(Z,$,X))G.push(Z)}else await I(A(z,W)).catch(()=>{})}catch(Z){if(Z instanceof U&&Z.code!=="ENOENT")throw Z}}if(G.length===0)return null;let Y=J!==void 0&&J>=1?G.filter((W)=>W.pid===J):[];if(Q.exactPid===!0&&Y.length===0)return null;let V=Y.length>0?Y:G,N=(W)=>typeof W.startedAt==="number"&&Number.isFinite(W.startedAt)?W.startedAt:-1/0;return V.sort((W,Z)=>N(Z)-N(W))[0]??null}import{open as Zz}from"node:fs/promises";import{connect as $z}from"node:net";import{join as Hz,resolve as t}from"node:path";var e=2000,q=new Map,B=new Map;async function qz(z,J){let Q=Hz(t(z),`port-${J.pid}.json`);if(_){let K=JSON.parse(await E(Q));if(K.pid!==J.pid||K.port!==J.port||K.token!==J.token)return null;return null}let X;try{X=await Zz(Q,"r");let K=await X.stat(),G=JSON.parse(await X.readFile("utf8"));if(G.pid!==J.pid||G.port!==J.port||G.token!==J.token)return null;return`${Q}:${K.dev}:${K.ino}:${K.mtimeMs}:${K.size}`}catch{return null}finally{await X?.close().catch(()=>{})}}async function i(z,J,Q,X){let K=q.get(z);if(!_&&K&&await d(J,K.entry)===K.identity)return K;q.delete(z);let G=B.get(z);if(G)return G;let Y=(async()=>{let V=await(X.discover??n)(J,Q,X);if(!V)return null;let N=await qz(J,V);if(!N)return{entry:V,identity:""};let W={entry:V,identity:N};return q.set(z,W),W})();B.set(z,Y);try{return await Y}finally{if(B.get(z)===Y)B.delete(z)}}async function o(z,J,Q,X=e){return new Promise((K)=>{let G,Y=!1,V=!1,N=(Z,$=!1)=>{if(Y)return;Y=!0,clearTimeout(W),G?.destroy(),K({value:Z,stale:$})},W=setTimeout(()=>N(null),X);try{let Z=JSON.stringify(Q);G=$z({host:"127.0.0.1",port:z.port}),G.on("connect",()=>{V=!0,G?.write(`POST /rpc/${J} HTTP/1.0\r
2
2
  Host: 127.0.0.1:${z.port}\r
3
3
  Connection: close\r
4
4
  Content-Type: application/json\r
@@ -9,4 +9,4 @@ Authorization: Bearer ${z.token}\r
9
9
  \r
10
10
  `);if(j>=0)C=j+4;if((C??R.length)>16384)return N(null);if(C!==void 0){let u=R.subarray(0,j).toString("latin1").split(`\r
11
11
  `),v=/^HTTP\/1\.[01] (\d{3})(?: |$)/.exec(u[0]??"");if(!v)return N(null);let w=Number(v[1]);if(w<200||w>=300)return N(null,[401,403,404,410].includes(w));for(let D of u.slice(1)){let f=D.indexOf(":"),h=D.slice(0,f).toLowerCase(),m=D.slice(f+1).trim();if(h==="transfer-encoding")return N(null);if(h==="content-length"){if(H!==void 0||!/^\d+$/.test(m))return N(null);if(H=Number(m),!Number.isSafeInteger(H)||H>8388608)return N(null)}}R=Buffer.alloc(0)}}let M=O-(C??O);if(M>8388608)return N(null);if(H!==void 0){if(M>H)return N(null);if(M===H)P()}}),G.on("end",()=>{if(H!==void 0&&O-(C??0)!==H)return N(null);P()}),G.on("error",()=>N(null,!V)),G.on("close",()=>N(null))}catch{N(null,!V)}})}async function r(z,J,Q,X,K,G,Y=e){let V=JSON.stringify([t(z),J??null,Q.exactPid===!0]),N=await i(V,z,J,Q);if(X(N?.entry??null),!N)return null;let W=Date.now()+Y,Z=await o(N.entry,K,G,Y);if(!Z.stale)return Z.value;if(q.get(V)===N)q.delete(V);let $=await i(V,z,J,Q);if(!$||Date.now()>=W)return null;if($.entry.port===N.entry.port&&$.entry.pid===N.entry.pid&&$.entry.token===N.entry.token){if(q.get(V)===$)q.delete(V);return null}let O=await o($.entry,K,G,W-Date.now());if(O.stale&&q.get(V)===$)q.delete(V);return O.value}function Dz(z,J,Q,X={}){let K={exactPid:X.exactPid,discover:X.discover},G=!1,Y=(V)=>{if(G)return;Q?.(V),G=!0};return{async pending(V,N,W){return(await r(z,J,K,Y,"pending-notifications",{lastReceivedId:V,sessionId:N},W))?.messages??[]},async apply(V,N){return await r(z,J,K,Y,"apply",{...V},N)??{text:"apply failed",knobs:{}}}}}
12
- export{Ez as vg,Lz as wg,Iz as xg,Yz as yg,n as zg,e as Ag,Dz as Bg};
12
+ export{Ez as xg,Lz as yg,Iz as zg,Yz as Ag,n as Bg,e as Cg,Dz as Dg};
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as loadAccounts, _ as parseJwtClaims, a as RESPONSES_LITE_MODELS, b as OAuthAccount, g as extractAccountIdFromClaims, h as TokenResponse, l as ResetTargetIdentity, m as IdTokenClaims, n as CODEX_VERSION, o as RuntimeLayoutOptions, s as PoolLifecycleDeps, t as CODEX_USER_AGENT, u as OpenAiVault, v as AccountStorage, w as QuotaManager, x as OAuthQuotaSnapshot, y as FallbackAccount } from "./codex-request-Dvj28zFK.js";
1
+ import { S as loadAccounts, _ as parseJwtClaims, a as RESPONSES_LITE_MODELS, b as OAuthAccount, g as extractAccountIdFromClaims, h as TokenResponse, l as ResetTargetIdentity, m as IdTokenClaims, n as CODEX_VERSION, o as RuntimeLayoutOptions, s as PoolLifecycleDeps, t as CODEX_USER_AGENT, u as OpenAiVault, v as AccountStorage, w as QuotaManager, x as OAuthQuotaSnapshot, y as FallbackAccount } from "./codex-request-NjUd_A0U.js";
2
2
  import { S as SidebarState, y as SidebarMachineState } from "./sidebar-state-CrRiE9hw.js";
3
3
  import { Hooks, Plugin, PluginInput } from "@opencode-ai/plugin";
4
4
  type TimerHandle = ReturnType<typeof setInterval>;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{$ as t,S as m,T as n,U as o,V as p,W as q,Z as r,_ as s,aa as u,ba as v,fa as w,ga as x,ha as y,ia as z,ja as A,ka as B,la as C,m as c,ma as D,n as d,na as E,o as e,oa as F,pa as G,r as f,s as g,t as h,u as i,v as j,w as k,x as l}from"./index-ah9yt0zm.js";import"./index-rbc7cfbv.js";import"./index-8ge0as5s.js";import{Ae as a,Be as b}from"./index-x3q449sn.js";import"./index-z4tfv40j.js";import"./index-jky7c65x.js";import"./index-a1zh72v8.js";import"./index-0mf78d7s.js";import"./index-xcsz00nr.js";import"./index-c4h4t3wg.js";import"./index-qtaqp1bf.js";import"./index-t15pb3n2.js";export{g as rewriteResponsesLiteBody,v as resolveSidebarSessionId,o as poolResetTarget,a as parseJwtClaims,s as mergePushedQuotaMetadata,x as getMainRefreshLockName,r as findCachekeepFallbackAccount,b as extractAccountIdFromClaims,G as default,p as createResetTargetResolver,l as codexOAuthModelVariantSource,j as codexOAuthModelListed,k as codexOAuthModelLimit,u as buildSidebarState,t as buildSidebarMachineState,q as buildResetRedemptionDeps,B as __resetBootQuotaSeedForTest,C as __menuContextForTest,A as __bootQuotaSeedPromiseForTest,n as ResetTargetResolutionError,c as RESPONSES_LITE_MODELS,D as POOL_MIGRATION_ENABLED,F as OpenAIAuthPlugin,f as MID_CONVERSATION_EFFORT_MODELS,y as MAIN_REFRESH_LOCK_TTL_MS,z as MAIN_REFRESH_LEASE_TTL_MS,w as EMPTY_BEARER_MESSAGE,i as DISALLOWED_MODELS,E as CodexAuthPlugin,d as CODEX_VERSION,e as CODEX_USER_AGENT,m as AuthPersistError,h as ALLOWED_MODELS};
1
+ import{$ as t,S as m,T as n,U as o,V as p,W as q,Z as r,_ as s,aa as u,ba as v,fa as w,ga as x,ha as y,ia as z,ja as A,ka as B,la as C,m as c,ma as D,n as d,na as E,o as e,oa as F,pa as G,r as f,s as g,t as h,u as i,v as j,w as k,x as l}from"./index-ksfxd8p5.js";import"./index-60v2qzqm.js";import"./index-4xa80px1.js";import{Ce as a,De as b}from"./index-ewbggf3b.js";import"./index-14m8qtpx.js";import"./index-1arphj0y.js";import"./index-zd0hham5.js";import"./index-cqmzvf2k.js";import"./index-8kg9h2zj.js";import"./index-h41zc747.js";import"./index-4vgtvqfc.js";import"./index-rvphtptz.js";export{g as rewriteResponsesLiteBody,v as resolveSidebarSessionId,o as poolResetTarget,a as parseJwtClaims,s as mergePushedQuotaMetadata,x as getMainRefreshLockName,r as findCachekeepFallbackAccount,b as extractAccountIdFromClaims,G as default,p as createResetTargetResolver,l as codexOAuthModelVariantSource,j as codexOAuthModelListed,k as codexOAuthModelLimit,u as buildSidebarState,t as buildSidebarMachineState,q as buildResetRedemptionDeps,B as __resetBootQuotaSeedForTest,C as __menuContextForTest,A as __bootQuotaSeedPromiseForTest,n as ResetTargetResolutionError,c as RESPONSES_LITE_MODELS,D as POOL_MIGRATION_ENABLED,F as OpenAIAuthPlugin,f as MID_CONVERSATION_EFFORT_MODELS,y as MAIN_REFRESH_LOCK_TTL_MS,z as MAIN_REFRESH_LEASE_TTL_MS,w as EMPTY_BEARER_MESSAGE,i as DISALLOWED_MODELS,E as CodexAuthPlugin,d as CODEX_VERSION,e as CODEX_USER_AGENT,m as AuthPersistError,h as ALLOWED_MODELS};
@@ -68,6 +68,28 @@
68
68
  }
69
69
  ]
70
70
  },
71
+ "wait_for_reset": {
72
+ "anyOf": [
73
+ {
74
+ "type": "boolean"
75
+ },
76
+ {
77
+ "type": "object",
78
+ "properties": {
79
+ "default": {
80
+ "type": "boolean"
81
+ },
82
+ "opencode": {
83
+ "type": "boolean"
84
+ },
85
+ "pi": {
86
+ "type": "boolean"
87
+ }
88
+ },
89
+ "additionalProperties": false
90
+ }
91
+ ]
92
+ },
71
93
  "fallback_on": {
72
94
  "anyOf": [
73
95
  {
@@ -1 +1 @@
1
- import{tg as b,ug as c}from"../index-jky7c65x.js";import{zg as a}from"../index-a1zh72v8.js";import"../index-c4h4t3wg.js";import"../index-qtaqp1bf.js";import"../index-t15pb3n2.js";export{b as writePortFile,c as isOpenaiRpcStateDir,a as discoverPortFile};
1
+ import{vg as b,wg as c}from"../index-1arphj0y.js";import{Bg as a}from"../index-zd0hham5.js";import"../index-h41zc747.js";import"../index-4vgtvqfc.js";import"../index-rvphtptz.js";export{b as writePortFile,c as isOpenaiRpcStateDir,a as discoverPortFile};
@@ -1 +1 @@
1
- import{Ig as b}from"../index-0mf78d7s.js";import"../index-xcsz00nr.js";import"../index-c4h4t3wg.js";import"../index-t15pb3n2.js";export{b as isNotifyPayload};
1
+ import{Kg as b}from"../index-cqmzvf2k.js";import"../index-8kg9h2zj.js";import"../index-h41zc747.js";import"../index-rvphtptz.js";export{b as isNotifyPayload};
@@ -1 +1 @@
1
- import{Ag as F,Bg as f}from"../index-a1zh72v8.js";import"../index-c4h4t3wg.js";import"../index-t15pb3n2.js";function y(r,s,v){return f(r,s,v)}export{y as createRpcClient,F as DEFAULT_RPC_TIMEOUT_MS};
1
+ import{Cg as F,Dg as f}from"../index-zd0hham5.js";import"../index-h41zc747.js";import"../index-rvphtptz.js";function y(r,s,v){return f(r,s,v)}export{y as createRpcClient,F as DEFAULT_RPC_TIMEOUT_MS};
@@ -1 +1 @@
1
- import{ah as a,bh as b,ch as c,dh as d}from"../index-qtaqp1bf.js";import"../index-t15pb3n2.js";export{a as tmpdir,d as resolveRpcDir,c as getRpcDir,b as RPC_DIRECTORY_PREFIX};
1
+ import{ch as a,dh as b,eh as c,fh as d}from"../index-4vgtvqfc.js";import"../index-rvphtptz.js";export{a as tmpdir,d as resolveRpcDir,c as getRpcDir,b as RPC_DIRECTORY_PREFIX};
@@ -1 +1 @@
1
- import{$c as q,Ad as R,Bd as S,Cd as T,Lc as a,Mc as b,Nc as c,Oc as d,Pc as e,Qc as f,Rc as g,Sc as h,Tc as i,Uc as j,Vc as k,Wc as l,Xc as m,Yc as n,Zc as o,_c as p,ad as r,bd as s,cd as t,dd as u,ed as v,fd as w,gd as x,hd as y,id as z,jd as A,kd as B,ld as C,md as D,nd as E,od as F,pd as G,qd as H,rd as I,sd as J,td as K,ud as L,vd as M,wd as N,xd as O,yd as P,zd as Q}from"./index-8ge0as5s.js";import"./index-x3q449sn.js";import"./index-z4tfv40j.js";import"./index-0mf78d7s.js";import"./index-xcsz00nr.js";import"./index-c4h4t3wg.js";import"./index-t15pb3n2.js";export{y as upsertSidebarActiveRouting,p as spendControlExhaustedResetAt,O as sidebarQuotaProjection,I as settleWithinBudget,w as setSidebarState,x as setSidebarMachineState,z as setSidebarLegacyRouting,e as setLegacySidebarStateFileForTest,C as resolveSidebarStickyAssignment,s as resolveSessionStickyAccount,t as resolveSessionSidebarRouting,N as resolveActiveAccount,A as removeSidebarActiveRouting,K as rememberStickyPin,v as pruneStickyAssignments,u as pruneActiveRouting,D as planSidebarStickyAssignmentFromSnapshot,B as planSidebarStickyAssignment,E as persistSidebarStickyAssignment,k as normalizeSidebarState,o as isUsableRoutingEntry,r as isQuotaExhausted,h as hashSidebarSessionId,i as getSidebarStateFile,l as getSidebarState,d as getPresentQuotaWindows,P as getCollapsedQuotaSummary,Q as getCollapsedAccountLines,c as formatWindowLabel,S as fitCollapsedLabel,q as exhaustedQuotaResetAt,G as drainSidebarWrites,R as displayWidth,J as createSidebarStateCache,M as createSidebarBookkeepingQueue,T as computeQuotaPacing,F as clearSidebarStickyAssignment,L as applyStickyPinOverlay,b as accountServesOnCredits,a as accountCreditsText,g as STICKY_ASSIGNMENT_MAX_ENTRIES,f as STICKY_ASSIGNMENT_MAX_AGE_MS,H as HOT_PATH_READ_BUDGET_MS,j as DEFAULT_SIDEBAR_STATE,n as ACTIVE_ROUTING_MAX_ENTRIES,m as ACTIVE_ROUTING_MAX_AGE_MS};
1
+ import{$c as o,Ad as P,Bd as Q,Cd as R,Dd as S,Ed as T,Nc as a,Oc as b,Pc as c,Qc as d,Rc as e,Sc as f,Tc as g,Uc as h,Vc as i,Wc as j,Xc as k,Yc as l,Zc as m,_c as n,ad as p,bd as q,cd as r,dd as s,ed as t,fd as u,gd as v,hd as w,id as x,jd as y,kd as z,ld as A,md as B,nd as C,od as D,pd as E,qd as F,rd as G,sd as H,td as I,ud as J,vd as K,wd as L,xd as M,yd as N,zd as O}from"./index-4xa80px1.js";import"./index-ewbggf3b.js";import"./index-14m8qtpx.js";import"./index-cqmzvf2k.js";import"./index-8kg9h2zj.js";import"./index-h41zc747.js";import"./index-rvphtptz.js";export{y as upsertSidebarActiveRouting,p as spendControlExhaustedResetAt,O as sidebarQuotaProjection,I as settleWithinBudget,w as setSidebarState,x as setSidebarMachineState,z as setSidebarLegacyRouting,e as setLegacySidebarStateFileForTest,C as resolveSidebarStickyAssignment,s as resolveSessionStickyAccount,t as resolveSessionSidebarRouting,N as resolveActiveAccount,A as removeSidebarActiveRouting,K as rememberStickyPin,v as pruneStickyAssignments,u as pruneActiveRouting,D as planSidebarStickyAssignmentFromSnapshot,B as planSidebarStickyAssignment,E as persistSidebarStickyAssignment,k as normalizeSidebarState,o as isUsableRoutingEntry,r as isQuotaExhausted,h as hashSidebarSessionId,i as getSidebarStateFile,l as getSidebarState,d as getPresentQuotaWindows,P as getCollapsedQuotaSummary,Q as getCollapsedAccountLines,c as formatWindowLabel,S as fitCollapsedLabel,q as exhaustedQuotaResetAt,G as drainSidebarWrites,R as displayWidth,J as createSidebarStateCache,M as createSidebarBookkeepingQueue,T as computeQuotaPacing,F as clearSidebarStickyAssignment,L as applyStickyPinOverlay,b as accountServesOnCredits,a as accountCreditsText,g as STICKY_ASSIGNMENT_MAX_ENTRIES,f as STICKY_ASSIGNMENT_MAX_AGE_MS,H as HOT_PATH_READ_BUDGET_MS,j as DEFAULT_SIDEBAR_STATE,n as ACTIVE_ROUTING_MAX_ENTRIES,m as ACTIVE_ROUTING_MAX_AGE_MS};
@@ -1 +1 @@
1
- import{a as U,b as V}from"./index-dsytdx0r.js";import{eh as R}from"./index-t15pb3n2.js";var E=R((M,Q)=>{var{defineProperty:H,getOwnPropertyDescriptor:W,getOwnPropertyNames:X}=Object,Y=Object.prototype.hasOwnProperty,Z=(z,q)=>{for(var B in q)H(z,B,{get:q[B],enumerable:!0})},$=(z,q,B,F)=>{if(q&&typeof q==="object"||typeof q==="function"){for(let v of X(q))if(!Y.call(z,v)&&v!==B)H(z,v,{get:()=>q[v],enumerable:!(F=W(q,v))||F.enumerable})}return z},A=(z)=>$(H({},"__esModule",{value:!0}),z),L={};Z(L,{refreshToken:()=>D});Q.exports=A(L);var K=U(),G=V();async function D(z){let q=z?.project,B=z?.team;if(!q&&!B){let v=(0,G.findProjectInfo)();q=v.projectId,B=v.teamId}else if(!q||!B){let v=(0,G.findProjectInfo)();q=q??v.projectId,B=B??v.teamId}if(!q)throw new K.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`");let F=(0,G.loadToken)(q);if(!F||(0,G.isExpired)((0,G.getTokenPayload)(F.token),z?.expirationBufferMs)){let v=await(0,G.getVercelToken)({expirationBufferMs:z?.expirationBufferMs});if(F=await(0,G.getVercelOidcToken)(v,q,B),!F)throw new K.VercelOidcTokenError("Failed to refresh OIDC token");(0,G.saveToken)(F,q)}process.env.VERCEL_OIDC_TOKEN=F.token;return}});export default E();
1
+ import{a as U,b as V}from"./index-qx3zz6dw.js";import{gh as R}from"./index-rvphtptz.js";var E=R((M,Q)=>{var{defineProperty:H,getOwnPropertyDescriptor:W,getOwnPropertyNames:X}=Object,Y=Object.prototype.hasOwnProperty,Z=(z,q)=>{for(var B in q)H(z,B,{get:q[B],enumerable:!0})},$=(z,q,B,F)=>{if(q&&typeof q==="object"||typeof q==="function"){for(let v of X(q))if(!Y.call(z,v)&&v!==B)H(z,v,{get:()=>q[v],enumerable:!(F=W(q,v))||F.enumerable})}return z},A=(z)=>$(H({},"__esModule",{value:!0}),z),L={};Z(L,{refreshToken:()=>D});Q.exports=A(L);var K=U(),G=V();async function D(z){let q=z?.project,B=z?.team;if(!q&&!B){let v=(0,G.findProjectInfo)();q=v.projectId,B=v.teamId}else if(!q||!B){let v=(0,G.findProjectInfo)();q=q??v.projectId,B=B??v.teamId}if(!q)throw new K.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`");let F=(0,G.loadToken)(q);if(!F||(0,G.isExpired)((0,G.getTokenPayload)(F.token),z?.expirationBufferMs)){let v=await(0,G.getVercelToken)({expirationBufferMs:z?.expirationBufferMs});if(F=await(0,G.getVercelOidcToken)(v,q,B),!F)throw new K.VercelOidcTokenError("Failed to refresh OIDC token");(0,G.saveToken)(F,q)}process.env.VERCEL_OIDC_TOKEN=F.token;return}});export default E();
@@ -0,0 +1 @@
1
+ import{b as a}from"./index-qx3zz6dw.js";import"./index-rvphtptz.js";export default a();
@@ -1,4 +1,4 @@
1
- import{ag as _,ig as R,kg as I,lg as x}from"./index-z4tfv40j.js";import"./index-xcsz00nr.js";import{Qg as N,Rg as L,Xg as j}from"./index-c4h4t3wg.js";import"./index-t15pb3n2.js";import{mkdir as T,writeFile as h}from"node:fs/promises";import{homedir as y}from"node:os";import{dirname as f,join as C}from"node:path";import{applyEdits as g,modify as k,parse as b}from"jsonc-parser";function E(z){return z!==null&&typeof z==="object"&&!Array.isArray(z)}async function S(z){try{let q=[],H=b(await j(z,N),q,{allowTrailingComma:!0});return q.length===0&&E(H)?H:{}}catch(q){if(q instanceof L&&q.code!=="ENOENT")throw q;return{}}}var w=`// Shared preferences for TUI plugins.
1
+ import{cg as _,kg as R,mg as I,ng as x}from"./index-14m8qtpx.js";import"./index-8kg9h2zj.js";import{Sg as N,Tg as L,Zg as j}from"./index-h41zc747.js";import"./index-rvphtptz.js";import{mkdir as T,writeFile as h}from"node:fs/promises";import{homedir as y}from"node:os";import{dirname as f,join as C}from"node:path";import{applyEdits as g,modify as k,parse as b}from"jsonc-parser";function E(z){return z!==null&&typeof z==="object"&&!Array.isArray(z)}async function S(z){try{let q=[],H=b(await j(z,N),q,{allowTrailingComma:!0});return q.length===0&&E(H)?H:{}}catch(q){if(q instanceof L&&q.code!=="ENOENT")throw q;return{}}}var w=`// Shared preferences for TUI plugins.
2
2
  // Plugins update individual keys in place and preserve comments.
3
3
  {}
4
4
  `;function A(z){let{file:q,pluginKey:H,beforeCommit:Q}=z,X={...I.preferences,timeoutMs:z.timeoutMs??I.preferences.timeoutMs},$=Promise.resolve();async function V(J,D){await R(q,X,async(U)=>{let B;try{B=await j(q,N)}catch(M){if(M.code!=="ENOENT")throw M;B=""}if(B.trim()==="")B=w;let W=g(B,k(B,[H,...J],D,{formattingOptions:{insertSpaces:!0,tabSize:2}}));await _(q,W,{serialize:(M)=>String(M),beforeRename:async()=>{await Q?.(),await U.assertOwned()}})})}return{queueTuiPreferenceUpdate(J,D){let U=[...J],B=structuredClone(D),W=$.then(()=>V(U,B));return $=W.catch(()=>{}),W}}}var p="OPENCODE_TUI_PREFERENCES_FILE",c="tui-preferences.jsonc";function K(){let z=process.env[p];if(z)return z;let q=process.env.OPENCODE_CONFIG_DIR||C(process.env.XDG_CONFIG_HOME||C(y(),".config"),"opencode");return C(q,c)}function Y(z){return typeof z==="object"&&z!==null&&!Array.isArray(z)}function Jq(){return S(K())}var v="openai-auth",d=160,m={forceToTop:!1,order:d,startCollapsed:!1,rememberCollapsed:!0,collapsed:null,pollMs:1500,refreshDebounceMs:200,header:{label:"OPENAI",showVersion:!0},sections:{quota:!0,fallbackAccounts:!0,routing:!0,health:!0,pacing:!0},appearance:{barWidth:10,barFilledChar:"█",barEmptyChar:"░",warnThreshold:50,errorThreshold:80}};function Z(z,q){return typeof z==="boolean"?z:q}function G(z,q,H,Q){if(typeof z!=="number"||!Number.isFinite(z))return q;return Math.min(Math.max(Math.round(z),H),Q)}function u(z,q,H){if(typeof z!=="string"||z.length===0)return q;return z.slice(0,H)}function P(z,q){if(typeof z!=="string")return q;return[...z][0]??q}function Yq(z){let q=z[v];if(!Y(q))return structuredClone(m);let H=m,Q=Y(q.header)?q.header:{},X=Y(q.sections)?q.sections:{},$=Y(q.appearance)?q.appearance:{},V=G($.warnThreshold,H.appearance.warnThreshold,0,99),J=Math.max(G($.errorThreshold,H.appearance.errorThreshold,0,100),Math.min(V+1,100));return{forceToTop:Z(q.forceToTop,H.forceToTop),order:G(q.order,H.order,-1e4,1e4),startCollapsed:Z(q.startCollapsed,H.startCollapsed),rememberCollapsed:Z(q.rememberCollapsed,H.rememberCollapsed),collapsed:typeof q.collapsed==="boolean"?q.collapsed:null,pollMs:G(q.pollMs,H.pollMs,500,30000),refreshDebounceMs:G(q.refreshDebounceMs,H.refreshDebounceMs,50,5000),header:{label:u(Q.label,H.header.label,20),showVersion:Z(Q.showVersion,H.header.showVersion)},sections:{quota:Z(X.quota,H.sections.quota),fallbackAccounts:Z(X.fallbackAccounts,H.sections.fallbackAccounts),routing:Z(X.routing,H.sections.routing),health:Z(X.health,H.sections.health),pacing:Z(X.pacing,H.sections.pacing)},appearance:{barWidth:G($.barWidth,H.appearance.barWidth,4,40),barFilledChar:P($.barFilledChar,H.appearance.barFilledChar),barEmptyChar:P($.barEmptyChar,H.appearance.barEmptyChar),warnThreshold:V,errorThreshold:J}}}var s=-1e5;function Vq(z,q,H){let Q=z[q];if(!Y(Q))return H;if(Q.forceToTop===!0)return s+Object.keys(z).indexOf(q);return G(Q.order,H,-1e4,1e4)}var n=`// Shared preferences for opencode TUI plugins.
@@ -1,4 +1,4 @@
1
- import { C as AccountPaths, c as HostSlotAdapter, d as OpenAiVaultOptions, f as BeginAccountLoginOptions, i as CodexSessionMetadata, o as RuntimeLayoutOptions, p as BeginAccountLoginResult, r as CodexRequestRuntime, s as PoolLifecycleDeps } from "../codex-request-Dvj28zFK.js";
1
+ import { C as AccountPaths, c as HostSlotAdapter, d as OpenAiVaultOptions, f as BeginAccountLoginOptions, i as CodexSessionMetadata, o as RuntimeLayoutOptions, p as BeginAccountLoginResult, r as CodexRequestRuntime, s as PoolLifecycleDeps } from "../codex-request-NjUd_A0U.js";
2
2
  import { i as OpenDialogPayload, n as ApplyResult } from "../protocol-BZZtDn5h.js";
3
3
  import { Plugin } from "@opencode/plugin";
4
4
  import "@opencode/plugin/promise/integration";