@openai/codex 0.10.0 → 0.12.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/README.md CHANGED
@@ -95,6 +95,12 @@ codex login
95
95
 
96
96
  If you complete the process successfully, you should have a `~/.codex/auth.json` file that contains the credentials that Codex will use.
97
97
 
98
+ To verify whether you are currently logged in, run:
99
+
100
+ ```
101
+ codex login status
102
+ ```
103
+
98
104
  If you encounter problems with the login flow, please comment on <https://github.com/openai/codex/issues/1243>.
99
105
 
100
106
  <details>
Binary file
Binary file
Binary file
Binary file
Binary file
package/bin/codex.js CHANGED
@@ -83,6 +83,7 @@ if (wantsNative && process.platform !== 'win32') {
83
83
 
84
84
  const child = spawn(binaryPath, process.argv.slice(2), {
85
85
  stdio: "inherit",
86
+ env: { ...process.env, CODEX_MANAGED_BY_NPM: "1" },
86
87
  });
87
88
 
88
89
  child.on("error", (err) => {
package/dist/cli.js CHANGED
@@ -568,7 +568,11 @@ ${g.join(" ")}
568
568
  (sysctl-name "kern.version")
569
569
  (sysctl-name "sysctl.proc_cputype")
570
570
  (sysctl-name-prefix "hw.perflevel")
571
- )`.trim();ul();var pce=Re(VD(),1);import g6 from"fs";import DHe from"os";import wHe from"path";var xHe=1e4;function RHe(e){return e.length===1&&e[0]!==void 0?(0,pce.parse)(e[0]).some(r=>typeof r=="object"&&"op"in r):!1}function dce({cmd:e,workdir:t,timeoutInMillis:r,additionalWritableRoots:n},a,i,o){let s={timeout:r||xHe,...RHe(e)?{shell:!0}:{},...t?{cwd:t}:{}};switch(a){case"none":return vE(e,s,i,o);case"macos.seatbelt":{let u=[process.cwd(),DHe.tmpdir(),...n];return uce(e,s,u,i,o)}case"linux.landlock":return cce(e,s,n,i,o)}}function fce(e,t=void 0){let r=e.replace(/('|")?<<('|")EOF('|")/,"").replace(/\*\*\* End Patch\nEOF('|")?/,"*** End Patch").trim();r.endsWith(Iu)||(r+=`
571
+ )
572
+
573
+ ; Added on top of Chrome profile
574
+ ; Needed for python multiprocessing on MacOS for the SemLock
575
+ (allow ipc-posix-sem)`.trim();ul();var pce=Re(VD(),1);import g6 from"fs";import DHe from"os";import wHe from"path";var xHe=1e4;function RHe(e){return e.length===1&&e[0]!==void 0?(0,pce.parse)(e[0]).some(r=>typeof r=="object"&&"op"in r):!1}function dce({cmd:e,workdir:t,timeoutInMillis:r,additionalWritableRoots:n},a,i,o){let s={timeout:r||xHe,...RHe(e)?{shell:!0}:{},...t?{cwd:t}:{}};switch(a){case"none":return vE(e,s,i,o);case"macos.seatbelt":{let u=[process.cwd(),DHe.tmpdir(),...n];return uce(e,s,u,i,o)}case"linux.landlock":return cce(e,s,n,i,o)}}function fce(e,t=void 0){let r=e.replace(/('|")?<<('|")EOF('|")/,"").replace(/\*\*\* End Patch\nEOF('|")?/,"*** End Patch").trim();r.endsWith(Iu)||(r+=`
572
576
  `+Iu),zt(`Applying patch: \`\`\`${r}\`\`\`
573
577
 
574
578
  `);try{return{stdout:uB(r,a=>g6.readFileSync(TS(a,t),"utf8"),(a,i)=>{let o=TS(a,t),s=wHe.dirname(o);s!=="."&&g6.mkdirSync(s,{recursive:!0}),g6.writeFileSync(o,i,"utf8")},a=>g6.unlinkSync(TS(a,t))),stderr:"",exitCode:0}}catch(n){return{stdout:"",stderr:String(n.message??n),exitCode:1}}}ul();import hB from"fs/promises";var gce=new Set;function hce(e){let[t,r,n]=e;return n?.startsWith("apply_patch")?"apply_patch":t==="bash"&&r==="-lc"?(n??"").split(/\s+/)[0]||"bash":n?n.split(/\s+/)[0]:JSON.stringify(e)}async function _B(e,t,r,n,a,i){let{cmd:o,workdir:s}=e,u=hce(o);if(gce.has(u))return gB(e,void 0,!1,n,t,i).then(mB);let p=ace(o,s,r,[process.cwd()]),g;switch(p.type){case"ask-user":{let b=await mce(e,p.applyPatch,a);if(b!=null)return b;g=!1;break}case"auto-approve":{g=p.runInSandbox;break}case"reject":return{outputText:"aborted",metadata:{error:"command rejected",reason:"Command rejected by auto-approval system."}}}let{applyPatch:_}=p,E=await gB(e,_,g,n,t,i);if(i?.aborted)return{outputText:"",metadata:{}};if(E.exitCode!==0&&g&&t.fullAutoErrorMode&&t.fullAutoErrorMode==="ask-user"){let b=await mce(e,p.applyPatch,a);if(b!=null)return b;{let S=await gB(e,_,!1,n,t,i);return mB(S)}}else return mB(E)}function mB(e){let{stdout:t,stderr:r,exitCode:n,durationMs:a}=e;return{outputText:t||r,metadata:{exit_code:n,duration_seconds:Math.round(a/100)/10}}}async function gB(e,t,r,n,a,i){let{workdir:o}=e;if(o)try{await hB.access(o)}catch{zt(`EXEC workdir=${o} not found, use process.cwd() instead`),o=process.cwd()}if(t!=null)zt("EXEC running apply_patch command");else if(XN()){let{cmd:b,timeoutInMillis:S}=e,C=S!=null?Math.round(S/1e3).toString():"undefined";zt(`EXEC running \`${Lp(b)}\` in workdir=${o} with timeout=${C}s`)}let s=Date.now(),u=t!=null?fce(t.patch,o):await dce({...e,additionalWritableRoots:n},await OHe(r),a,i),p=Date.now()-s,{stdout:g,stderr:_,exitCode:E}=u;return XN()&&zt(`EXEC exit=${E} time=${p}ms: