@netlify/agent-runner-cli 1.49.2-alpha → 1.49.4-alpha

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-local.js CHANGED
@@ -15,7 +15,7 @@ ${q.trim()}
15
15
  web_search = true`):p+=`
16
16
  [tools]
17
17
  web_search = true
18
- `,await pe.writeFile(v,p,"utf-8"),M.log("Updated Codex config with web_search enabled"))}catch(m){throw M.warn("Failed to setup Codex config and credentials",{error:m.message}),new Error(`Codex setup failed: ${m.message}`)}let N=[J(z.cwd(),"codex"),"exec","--yolo","--json","--config","web_search=true",...s?["--model",s]:[],a].filter(Boolean);M.log(`Running ${h} ${N.join(" ")}`);let R=t.utils.run(h,N,{all:!0,env:{...z.env}}),S=Sr.createInterface({input:R.all});return S.on("error",m=>{M.error("Readline interface error",{error:m.message,stack:m.stack})}),S.on("line",m=>{M.log("Received line from Codex:",m);let p=null;try{p=JSON.parse(m)}catch{M.log("Could not parse line",m);return}let f=[],_=!1;if(p?.duration_ms&&(E=p.duration_ms,_=!0),p?.type==="local_shell_call")c[p.call_id]=p;else if(p?.type==="local_shell_call_output"){let d=br(c[p.call_id],p);d&&(d.id=g,g+=1,l.push(d),y.push(d),f.push(d),_=!0)}else p?.type==="message"&&p.role==="assistant"?T=p.content.map(d=>d.text).join(`
18
+ `,await pe.writeFile(v,p,"utf-8"),M.log("Updated Codex config with web_search enabled"))}catch(m){throw M.warn("Failed to setup Codex config and credentials",{error:m.message}),new Error(`Codex setup failed: ${m.message}`)}let N=[J(z.cwd(),"codex"),"exec","--yolo","--json","--config","web_search=true",...s?["--model",s]:[],a].filter(Boolean);M.log(`Running ${h} ${N.join(" ")}`);let R=t.utils.run(h,N,{all:!0,env:{...z.env}});R.stdin?.end();let S=Sr.createInterface({input:R.all});return S.on("error",m=>{M.error("Readline interface error",{error:m.message,stack:m.stack})}),S.on("line",m=>{M.log("Received line from Codex:",m);let p=null;try{p=JSON.parse(m)}catch{M.log("Could not parse line",m);return}let f=[],_=!1;if(p?.duration_ms&&(E=p.duration_ms,_=!0),p?.type==="local_shell_call")c[p.call_id]=p;else if(p?.type==="local_shell_call_output"){let d=br(c[p.call_id],p);d&&(d.id=g,g+=1,l.push(d),y.push(d),f.push(d),_=!0)}else p?.type==="message"&&p.role==="assistant"?T=p.content.map(d=>d.text).join(`
19
19
  `):p?.type==="message"&&p.role==="system"&&(I=p.content.map(d=>d.text).join(`
20
20
  `));_&&(r?.({steps:y,duration:E}),o?.({steps:f,duration:E}))}),await R.catch(m=>{let p=Ar({catchError:m,runCmd:R,error:I,result:T,runnerName:"Codex"});I=p.error,T=p.result}),S.close(),!T&&!I&&R.exitCode===0&&(I="Codex process completed successfully but produced no output",M.error("Codex process exited with code 0 but no result or error was captured")),{steps:l,duration:E,result:await ne({initialResult:T,agentName:St,hasError:!!I}),error:oe({error:I,agentName:St}),isRetryableError:ie(I)}}var Nt=async()=>{let e=ve.join(At.homedir(),".codex");await pe.rm(e,{recursive:!0,force:!0})},Nr=new Set(["bash","-lc"]),br=(e,t)=>{if(!e||!t||e.call_id!==t.call_id)return null;let r=e.action?.command?.filter(i=>!Nr.has(i)),o=r?`Running \`${r.join(" ")}\``:void 0,n;try{n=JSON.parse(t.output).output?.trim(),n&&(n=`\`\`\`
21
21
  ${n.trim()}
package/dist/bin.js CHANGED
@@ -15,7 +15,7 @@ ${H.trim()}
15
15
  web_search = true`):p+=`
16
16
  [tools]
17
17
  web_search = true
18
- `,await de.writeFile(x,p,"utf-8"),U.log("Updated Codex config with web_search enabled"))}catch(m){throw U.warn("Failed to setup Codex config and credentials",{error:m.message}),new Error(`Codex setup failed: ${m.message}`)}let S=[ee(V.cwd(),"codex"),"exec","--yolo","--json","--config","web_search=true",...i?["--model",i]:[],a].filter(Boolean);U.log(`Running ${h} ${S.join(" ")}`);let N=t.utils.run(h,S,{all:!0,env:{...V.env}}),v=br.createInterface({input:N.all});return v.on("error",m=>{U.error("Readline interface error",{error:m.message,stack:m.stack})}),v.on("line",m=>{U.log("Received line from Codex:",m);let p=null;try{p=JSON.parse(m)}catch{U.log("Could not parse line",m);return}let f=[],w=!1;if(p?.duration_ms&&(_=p.duration_ms,w=!0),p?.type==="local_shell_call")c[p.call_id]=p;else if(p?.type==="local_shell_call_output"){let d=Lr(c[p.call_id],p);d&&(d.id=g,g+=1,l.push(d),E.push(d),f.push(d),w=!0)}else p?.type==="message"&&p.role==="assistant"?I=p.content.map(d=>d.text).join(`
18
+ `,await de.writeFile(x,p,"utf-8"),U.log("Updated Codex config with web_search enabled"))}catch(m){throw U.warn("Failed to setup Codex config and credentials",{error:m.message}),new Error(`Codex setup failed: ${m.message}`)}let S=[ee(V.cwd(),"codex"),"exec","--yolo","--json","--config","web_search=true",...i?["--model",i]:[],a].filter(Boolean);U.log(`Running ${h} ${S.join(" ")}`);let N=t.utils.run(h,S,{all:!0,env:{...V.env}});N.stdin?.end();let v=br.createInterface({input:N.all});return v.on("error",m=>{U.error("Readline interface error",{error:m.message,stack:m.stack})}),v.on("line",m=>{U.log("Received line from Codex:",m);let p=null;try{p=JSON.parse(m)}catch{U.log("Could not parse line",m);return}let f=[],w=!1;if(p?.duration_ms&&(_=p.duration_ms,w=!0),p?.type==="local_shell_call")c[p.call_id]=p;else if(p?.type==="local_shell_call_output"){let d=Lr(c[p.call_id],p);d&&(d.id=g,g+=1,l.push(d),E.push(d),f.push(d),w=!0)}else p?.type==="message"&&p.role==="assistant"?I=p.content.map(d=>d.text).join(`
19
19
  `):p?.type==="message"&&p.role==="system"&&(T=p.content.map(d=>d.text).join(`
20
20
  `));w&&(r?.({steps:E,duration:_}),o?.({steps:f,duration:_}))}),await N.catch(m=>{let p=Pr({catchError:m,runCmd:N,error:T,result:I,runnerName:"Codex"});T=p.error,I=p.result}),v.close(),!I&&!T&&N.exitCode===0&&(T="Codex process completed successfully but produced no output",U.error("Codex process exited with code 0 but no result or error was captured")),{steps:l,duration:_,result:await re({initialResult:I,agentName:bt,hasError:!!T}),error:ne({error:T,agentName:bt}),isRetryableError:oe(T)}}var Ot=async()=>{let e=Ie.join(Pt.homedir(),".codex");await de.rm(e,{recursive:!0,force:!0})},Or=new Set(["bash","-lc"]),Lr=(e,t)=>{if(!e||!t||e.call_id!==t.call_id)return null;let r=e.action?.command?.filter(s=>!Or.has(s)),o=r?`Running \`${r.join(" ")}\``:void 0,n;try{n=JSON.parse(t.output).output?.trim(),n&&(n=`\`\`\`
21
21
  ${n.trim()}
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ ${B.trim()}
14
14
  web_search = true`):p+=`
15
15
  [tools]
16
16
  web_search = true
17
- `,await ue.writeFile(R,p,"utf-8"),k.log("Updated Codex config with web_search enabled"))}catch(g){throw k.warn("Failed to setup Codex config and credentials",{error:g.message}),new Error(`Codex setup failed: ${g.message}`)}let N=[Z(W.cwd(),"codex"),"exec","--yolo","--json","--config","web_search=true",...i?["--model",i]:[],a].filter(Boolean);k.log(`Running ${h} ${N.join(" ")}`);let v=t.utils.run(h,N,{all:!0,env:{...W.env}}),S=hr.createInterface({input:v.all});return S.on("error",g=>{k.error("Readline interface error",{error:g.message,stack:g.stack})}),S.on("line",g=>{k.log("Received line from Codex:",g);let p=null;try{p=JSON.parse(g)}catch{k.log("Could not parse line",g);return}let f=[],_=!1;if(p?.duration_ms&&(E=p.duration_ms,_=!0),p?.type==="local_shell_call")c[p.call_id]=p;else if(p?.type==="local_shell_call_output"){let d=_r(c[p.call_id],p);d&&(d.id=m,m+=1,l.push(d),y.push(d),f.push(d),_=!0)}else p?.type==="message"&&p.role==="assistant"?I=p.content.map(d=>d.text).join(`
17
+ `,await ue.writeFile(R,p,"utf-8"),k.log("Updated Codex config with web_search enabled"))}catch(g){throw k.warn("Failed to setup Codex config and credentials",{error:g.message}),new Error(`Codex setup failed: ${g.message}`)}let N=[Z(W.cwd(),"codex"),"exec","--yolo","--json","--config","web_search=true",...i?["--model",i]:[],a].filter(Boolean);k.log(`Running ${h} ${N.join(" ")}`);let v=t.utils.run(h,N,{all:!0,env:{...W.env}});v.stdin?.end();let S=hr.createInterface({input:v.all});return S.on("error",g=>{k.error("Readline interface error",{error:g.message,stack:g.stack})}),S.on("line",g=>{k.log("Received line from Codex:",g);let p=null;try{p=JSON.parse(g)}catch{k.log("Could not parse line",g);return}let f=[],_=!1;if(p?.duration_ms&&(E=p.duration_ms,_=!0),p?.type==="local_shell_call")c[p.call_id]=p;else if(p?.type==="local_shell_call_output"){let d=_r(c[p.call_id],p);d&&(d.id=m,m+=1,l.push(d),y.push(d),f.push(d),_=!0)}else p?.type==="message"&&p.role==="assistant"?I=p.content.map(d=>d.text).join(`
18
18
  `):p?.type==="message"&&p.role==="system"&&(w=p.content.map(d=>d.text).join(`
19
19
  `));_&&(r?.({steps:y,duration:E}),o?.({steps:f,duration:E}))}),await v.catch(g=>{let p=yr({catchError:g,runCmd:v,error:w,result:I,runnerName:"Codex"});w=p.error,I=p.result}),S.close(),!I&&!w&&v.exitCode===0&&(w="Codex process completed successfully but produced no output",k.error("Codex process exited with code 0 but no result or error was captured")),{steps:l,duration:E,result:await ee({initialResult:I,agentName:wt,hasError:!!w}),error:te({error:w,agentName:wt}),isRetryableError:re(w)}}var It=async()=>{let e=_e.join(Tt.homedir(),".codex");await ue.rm(e,{recursive:!0,force:!0})},Er=new Set(["bash","-lc"]),_r=(e,t)=>{if(!e||!t||e.call_id!==t.call_id)return null;let r=e.action?.command?.filter(s=>!Er.has(s)),o=r?`Running \`${r.join(" ")}\``:void 0,n;try{n=JSON.parse(t.output).output?.trim(),n&&(n=`\`\`\`
20
20
  ${n.trim()}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@netlify/agent-runner-cli",
3
3
  "type": "module",
4
- "version": "1.49.2-alpha",
4
+ "version": "1.49.4-alpha",
5
5
  "description": "CLI tool for running Netlify agents",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",