@cortexkit/opencode-openai-auth 1.19.1 → 1.20.1

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 (40) hide show
  1. package/dist/bin.js +8 -8
  2. package/dist/{codex-request-Bj3F3fFg.d.ts → codex-request-Dvj28zFK.d.ts} +9 -2
  3. package/dist/{index-1ttg64ny.js → index-09rjj0qc.js} +2 -2
  4. package/dist/{index-3wr1ebxp.js → index-3yf405db.js} +2 -2
  5. package/dist/index-62e0dx41.js +101 -0
  6. package/dist/{index-62xhtkv8.js → index-h7veb7th.js} +1 -1
  7. package/dist/index-hybc4q33.js +2 -0
  8. package/dist/{index-663p60em.js → index-j5fk9tyk.js} +1 -1
  9. package/dist/index-mfvnmkrh.js +64 -0
  10. package/dist/{index-hsrx1pkq.js → index-q3j22pg7.js} +2 -2
  11. package/dist/{index-mbxq1g4n.js → index-qfer1qeq.js} +1 -1
  12. package/dist/{index-kgzevj7y.js → index-rrmycmen.js} +1 -1
  13. package/dist/index-tv6zrkss.js +75 -0
  14. package/dist/{index-977gx5br.js → index-vyc1q51y.js} +2 -2
  15. package/dist/{index-nrkvrvpw.js → index-x9h58tf9.js} +2 -2
  16. package/dist/{index-r6k6hh93.js → index-y9k6nshb.js} +1 -1
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/rpc/port-file.js +1 -1
  20. package/dist/rpc/protocol.js +1 -1
  21. package/dist/rpc/rpc-client.js +1 -1
  22. package/dist/rpc/rpc-dir.js +1 -1
  23. package/dist/sidebar-state.js +1 -1
  24. package/dist/{token-y3kre94n.js → token-t7hstws6.js} +1 -1
  25. package/dist/token-util-33bcnrmj.js +1 -0
  26. package/dist/tui-preferences.js +1 -1
  27. package/dist/v2/server.d.ts +1 -1
  28. package/dist/v2/server.js +3 -3
  29. package/package.json +2 -2
  30. package/src/tui-compiled/raw/shared/0f77ebc3c914c9c6-custody.js +31 -14
  31. package/src/tui-compiled/raw/shared/375d9cca2def037d-private-files.js +8 -3
  32. package/src/tui-compiled/raw/shared/458b934e92490331-mutate.js +34 -13
  33. package/src/tui-compiled/runtime/shared/0f77ebc3c914c9c6-custody.js +31 -14
  34. package/src/tui-compiled/runtime/shared/375d9cca2def037d-private-files.js +8 -3
  35. package/src/tui-compiled/runtime/shared/458b934e92490331-mutate.js +34 -13
  36. package/dist/index-34r6y4jf.js +0 -64
  37. package/dist/index-8km6f9bq.js +0 -2
  38. package/dist/index-ckkhe4r4.js +0 -76
  39. package/dist/index-jk0zyyny.js +0 -101
  40. package/dist/token-util-kwahm03g.js +0 -1
@@ -1,4 +1,4 @@
1
- import{Ng as _,Og as U,Sg as g,Tg as p,Ug as E,Yg as c}from"./index-8km6f9bq.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{Og as _,Pg as U,Tg as g,Ug as p,Vg as E,Zg as c}from"./index-hybc4q33.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 sg,Lz as tg,Iz as ug,Yz as vg,n as wg,e as xg,Dz as yg};
12
+ export{Ez as tg,Lz as ug,Iz as vg,Yz as wg,n as xg,e as yg,Dz as zg};
@@ -1,3 +1,3 @@
1
- import{rc as X,tc as V}from"./index-ckkhe4r4.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{sc as X,uc as V}from"./index-tv6zrkss.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 +1 @@
1
- import{Hg as G,Jg as H}from"./index-1ttg64ny.js";function Q(x){return x==="chatgptaccountid"||x==="email"||x==="orgname"||x==="organizationname"}var S=G({extraSecretKeys:Q}),I=S.redact,N=S.redactStrings;function O(x){H({...x,extraSecretKeys:Q})}function C(x){if(x instanceof Error)return x.message;if(typeof x==="string")return x;try{return JSON.stringify(x)}catch{return String(x)}}function v(x){return"notify"in x}import{basename as X,dirname as Y,join as Z}from"node:path";var $="openai-auth.json",b="openai-auth-state.json";function p(x){return X(x)===$?Z(Y(x),b):`${x}.state.json`}import{spawn as j}from"node:child_process";function z(x,J=process.platform,q=j){try{if(J==="win32"){let U=`Start-Process '${x.replaceAll("'","''")}'`,V=Buffer.from(U,"utf16le").toString("base64"),T=q("powershell.exe",["-NoProfile","-NonInteractive","-WindowStyle","Hidden","-EncodedCommand",V],{stdio:"ignore",windowsHide:!0});return T.on("error",()=>{}),T.unref(),T.pid!==void 0}let u=q(J==="darwin"?"open":"xdg-open",[x],{stdio:"ignore"});return u.on("error",()=>{}),u.unref(),u.pid!==void 0}catch{return!1}}export{N as zg,O as Ag,$ as Bg,b as Cg,p as Dg,C as Eg,v as Fg,z as Gg};
1
+ import{Ig as G,Kg as H}from"./index-09rjj0qc.js";function Q(x){return x==="chatgptaccountid"||x==="email"||x==="orgname"||x==="organizationname"}var S=G({extraSecretKeys:Q}),I=S.redact,N=S.redactStrings;function O(x){H({...x,extraSecretKeys:Q})}function C(x){if(x instanceof Error)return x.message;if(typeof x==="string")return x;try{return JSON.stringify(x)}catch{return String(x)}}function v(x){return"notify"in x}import{basename as X,dirname as Y,join as Z}from"node:path";var $="openai-auth.json",b="openai-auth-state.json";function p(x){return X(x)===$?Z(Y(x),b):`${x}.state.json`}import{spawn as j}from"node:child_process";function z(x,J=process.platform,q=j){try{if(J==="win32"){let U=`Start-Process '${x.replaceAll("'","''")}'`,V=Buffer.from(U,"utf16le").toString("base64"),T=q("powershell.exe",["-NoProfile","-NonInteractive","-WindowStyle","Hidden","-EncodedCommand",V],{stdio:"ignore",windowsHide:!0});return T.on("error",()=>{}),T.unref(),T.pid!==void 0}let u=q(J==="darwin"?"open":"xdg-open",[x],{stdio:"ignore"});return u.on("error",()=>{}),u.unref(),u.pid!==void 0}catch{return!1}}export{N as Ag,O as Bg,$ as Cg,b as Dg,p as Eg,C as Fg,v as Gg,z as Hg};