@robota-sdk/agent-cli 3.0.0-beta.83 → 3.0.0-beta.85

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 (46) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/README.md +229 -1180
  3. package/dist/node/bin.js +22 -22
  4. package/dist/node/bounded-output-Bgx2Cgkx-28em7iHq.js +2 -0
  5. package/dist/node/bounded-output-Bgx2Cgkx-28em7iHq.js.map +1 -0
  6. package/dist/node/bounded-output-Bgx2Cgkx-C4ucXwLR.js +2 -0
  7. package/dist/node/cli-core-DjVnz1-_.js +2891 -0
  8. package/dist/node/command-executor-d6DdfUTD-3KEnsTnN.js +2 -0
  9. package/dist/node/command-executor-d6DdfUTD-DhFSDHvb.js +2 -0
  10. package/dist/node/{command-executor-DV-H2oD6-OKy8pwYH.js.map → command-executor-d6DdfUTD-DhFSDHvb.js.map} +1 -1
  11. package/dist/node/headless.js +2 -2
  12. package/dist/node/{http-executor-cWzI2svn-TG_TMYKh.js → http-executor-ADn4locH-D-8crzF8.js} +2 -2
  13. package/dist/node/{http-executor-cWzI2svn-TG_TMYKh.js.map → http-executor-ADn4locH-D-8crzF8.js.map} +1 -1
  14. package/dist/node/{http-executor-cWzI2svn-Ype0naht.js → http-executor-ADn4locH-uz5KV6N-.js} +1 -1
  15. package/dist/node/index.d.ts +263 -100
  16. package/dist/node/index.d.ts.map +1 -1
  17. package/dist/node/index.js +388 -346
  18. package/dist/node/index.js.map +1 -1
  19. package/dist/node/node-B48couEE.js +14 -0
  20. package/dist/node/node-B48couEE.js.map +1 -0
  21. package/dist/node/node-CgLYctGm.js +67 -0
  22. package/dist/node/node-CgLYctGm.js.map +1 -0
  23. package/dist/node/{node-B8BhZ3NW.js → node-CpH9vRQt.js} +1 -1
  24. package/dist/node/node-DAOCaE6N.js +67 -0
  25. package/dist/node/node-DlLm_kxn.js +14 -0
  26. package/dist/node/{verdict-decoder-Dk_w2NG9-Bka7Cldj.js → verdict-decoder-Dz_rjoIZ-DA8BKB83.js} +2 -2
  27. package/dist/node/{verdict-decoder-Dk_w2NG9-Bka7Cldj.js.map → verdict-decoder-Dz_rjoIZ-DA8BKB83.js.map} +1 -1
  28. package/dist/node/{verdict-decoder-Dk_w2NG9-BKWMtxp8.js → verdict-decoder-Dz_rjoIZ-qM0jJVsB.js} +1 -1
  29. package/dist/web/assets/index-DSLs7oij.js +309 -0
  30. package/dist/web/assets/index-OqCBtMJ2.css +1 -0
  31. package/dist/web/index.html +2 -2
  32. package/package.json +37 -36
  33. package/dist/node/bounded-output-DpjpS98g-DFgAppgl.js +0 -2
  34. package/dist/node/bounded-output-DpjpS98g-DFgAppgl.js.map +0 -1
  35. package/dist/node/bounded-output-DpjpS98g-DoRuRGhV.js +0 -2
  36. package/dist/node/cli-core-CfQhvbx3.js +0 -2850
  37. package/dist/node/command-executor-DV-H2oD6-BfKoGoFw.js +0 -2
  38. package/dist/node/command-executor-DV-H2oD6-OKy8pwYH.js +0 -2
  39. package/dist/node/node-CC5tfdMu.js +0 -67
  40. package/dist/node/node-CC5tfdMu.js.map +0 -1
  41. package/dist/node/node-CsbnL0Yf.js +0 -67
  42. package/dist/node/node-DtKU0MUr.js +0 -14
  43. package/dist/node/node-DtKU0MUr.js.map +0 -1
  44. package/dist/node/node-j7KM8r3b.js +0 -14
  45. package/dist/web/assets/index-DbAewVPM.js +0 -244
  46. package/dist/web/assets/index-DzQQd7ql.css +0 -1
@@ -0,0 +1,2 @@
1
+ ;(function(){var v=parseInt(process.versions.node.split('.')[0],10);if(v<22){process.stderr.write('\n✗ Node.js 22+ is required (current: '+process.version+')\n\nUpgrade:\n nvm: nvm install 22 && nvm use 22\n Volta: volta install node@22\n Download: https://nodejs.org/en/download\n\n');process.exit(1);}})();
2
+ import{n as e}from"./rolldown-runtime-rs7quPpn.js";import{r as t,s as n,w as r}from"./bounded-output-Bgx2Cgkx-C4ucXwLR.js";import{t as i}from"./rolldown-runtime-DK3Fl9T5-BeX3Bzvn.js";import{spawn as a}from"node:child_process";var o=e({n:()=>s,t:()=>d}),s=i({CommandExecutor:()=>d});const c=1e6;function l(e,n){let r=t({maxBytes:c}),i=t({maxBytes:c,retain:`tail`});return e.stdout?.on(`data`,e=>r.append(e)),e.stderr?.on(`data`,e=>i.append(e)),e.stdin?.on(`error`,()=>{}),e.stdin?.write(n),e.stdin?.end(),{stdoutOutput:r,stderrOutput:i}}function u(e,t,n,r){if(e===0)return{outcome:`allow`,source:`command`,stdout:n};if(e===2)return{outcome:`deny`,source:`command`,reason:r.trim()||`Blocked by hook`};let i=r.trim()?`: ${r.trim()}`:``;return{outcome:`error`,source:`command`,kind:`nonzero-exit`,reason:e===null?`Hook terminated by signal ${t??`unknown`}${i}`:`Hook exited ${e}${i}`}}var d=class{shellExecutable;type=`command`;constructor(e){this.shellExecutable=e}execute(e,t,i){let o=e.timeout??600,s=o*1e3,c=JSON.stringify(t);return new Promise(d=>{let f=!1,p=r({executable:this.shellExecutable}),m=a(p.command,p.commandArgs(e.command),{cwd:t.cwd,env:n(process.env,i,t.env)}),{stdoutOutput:h,stderrOutput:g}=l(m,c),_=setTimeout(()=>{f||(f=!0,m.kill(`SIGTERM`),d({outcome:`error`,source:`command`,kind:`timeout`,reason:`Hook timed out after ${o}s`}))},s);m.on(`close`,(e,t)=>{f||(f=!0,clearTimeout(_),d(u(e,t,h.toString(),g.toString())))}),m.on(`error`,e=>{f||(f=!0,clearTimeout(_),d({outcome:`error`,source:`command`,kind:`spawn-failure`,reason:e.message}))})})}};export{d as n,o as t};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./rolldown-runtime-C9xYM0wc.js";import{r as t,s as n,w as r}from"./bounded-output-Bgx2Cgkx-28em7iHq.js";import{t as i}from"./rolldown-runtime-DK3Fl9T5-DK3Fl9T5.js";import{spawn as a}from"node:child_process";var o=e({n:()=>s,t:()=>d}),s=i({CommandExecutor:()=>d});const c=1e6;function l(e,n){let r=t({maxBytes:c}),i=t({maxBytes:c,retain:`tail`});return e.stdout?.on(`data`,e=>r.append(e)),e.stderr?.on(`data`,e=>i.append(e)),e.stdin?.on(`error`,()=>{}),e.stdin?.write(n),e.stdin?.end(),{stdoutOutput:r,stderrOutput:i}}function u(e,t,n,r){if(e===0)return{outcome:`allow`,source:`command`,stdout:n};if(e===2)return{outcome:`deny`,source:`command`,reason:r.trim()||`Blocked by hook`};let i=r.trim()?`: ${r.trim()}`:``;return{outcome:`error`,source:`command`,kind:`nonzero-exit`,reason:e===null?`Hook terminated by signal ${t??`unknown`}${i}`:`Hook exited ${e}${i}`}}var d=class{shellExecutable;type=`command`;constructor(e){this.shellExecutable=e}execute(e,t,i){let o=e.timeout??600,s=o*1e3,c=JSON.stringify(t);return new Promise(d=>{let f=!1,p=r({executable:this.shellExecutable}),m=a(p.command,p.commandArgs(e.command),{cwd:t.cwd,env:n(process.env,i,t.env)}),{stdoutOutput:h,stderrOutput:g}=l(m,c),_=setTimeout(()=>{f||(f=!0,m.kill(`SIGTERM`),d({outcome:`error`,source:`command`,kind:`timeout`,reason:`Hook timed out after ${o}s`}))},s);m.on(`close`,(e,t)=>{f||(f=!0,clearTimeout(_),d(u(e,t,h.toString(),g.toString())))}),m.on(`error`,e=>{f||(f=!0,clearTimeout(_),d({outcome:`error`,source:`command`,kind:`spawn-failure`,reason:e.message}))})})}};export{d as n,o as t};
2
+ //# sourceMappingURL=command-executor-d6DdfUTD-DhFSDHvb.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-executor-DV-H2oD6-OKy8pwYH.js","names":["e","r","t","i","n"],"sources":["../../../agent-core/dist/node/command-executor-DV-H2oD6.js"],"sourcesContent":["import{t as e}from\"./rolldown-runtime-DK3Fl9T5.js\";import{f as t,s as n,t as r}from\"./bounded-output-DpjpS98g.js\";import{spawn as i}from\"node:child_process\";var a=e({CommandExecutor:()=>l});const o=1e6;function s(e,t){let n=r({maxBytes:o}),i=r({maxBytes:o,retain:`tail`});return e.stdout?.on(`data`,e=>n.append(e)),e.stderr?.on(`data`,e=>i.append(e)),e.stdin?.on(`error`,()=>{}),e.stdin?.write(t),e.stdin?.end(),{stdoutOutput:n,stderrOutput:i}}function c(e,t,n,r){if(e===0)return{outcome:`allow`,source:`command`,stdout:n};if(e===2)return{outcome:`deny`,source:`command`,reason:r.trim()||`Blocked by hook`};let i=r.trim()?`: ${r.trim()}`:``;return{outcome:`error`,source:`command`,kind:`nonzero-exit`,reason:e===null?`Hook terminated by signal ${t??`unknown`}${i}`:`Hook exited ${e}${i}`}}var l=class{shellExecutable;type=`command`;constructor(e){this.shellExecutable=e}execute(e,r,a){let o=e.timeout??600,l=o*1e3,u=JSON.stringify(r);return new Promise(d=>{let f=!1,p=t({executable:this.shellExecutable}),m=i(p.command,p.commandArgs(e.command),{cwd:r.cwd,env:n(process.env,a,r.env)}),{stdoutOutput:h,stderrOutput:g}=s(m,u),_=setTimeout(()=>{f||(f=!0,m.kill(`SIGTERM`),d({outcome:`error`,source:`command`,kind:`timeout`,reason:`Hook timed out after ${o}s`}))},l);m.on(`close`,(e,t)=>{f||(f=!0,clearTimeout(_),d(c(e,t,h.toString(),g.toString())))}),m.on(`error`,e=>{f||(f=!0,clearTimeout(_),d({outcome:`error`,source:`command`,kind:`spawn-failure`,reason:e.message}))})})}};export{a as n,l as t};\n//# sourceMappingURL=command-executor-DV-H2oD6.js.map"],"mappings":"wPAAiK,EAAEA,EAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,SAAS,EAAE,EAAE,EAAE,CAAC,IAAI,EAAEC,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,EAAEA,EAAE,CAAC,SAAS,EAAE,OAAO,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,EAAE,OAAO,GAAG,YAAY,CAAC,CAAC,EAAE,EAAE,OAAO,MAAM,CAAC,EAAE,EAAE,OAAO,IAAI,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,QAAQ,QAAQ,OAAO,UAAU,OAAO,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,CAAC,QAAQ,OAAO,OAAO,UAAU,OAAO,EAAE,KAAK,GAAG,iBAAiB,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,GAAG,MAAM,CAAC,QAAQ,QAAQ,OAAO,UAAU,KAAK,eAAe,OAAO,IAAI,KAAK,6BAA6B,GAAG,YAAY,IAAI,eAAe,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,gBAAgB,KAAK,UAAU,YAAY,EAAE,CAAC,KAAK,gBAAgB,CAAC,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,SAAS,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,UAAU,CAAC,EAAE,OAAO,IAAI,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,EAAEC,EAAE,CAAC,WAAW,KAAK,eAAe,CAAC,EAAE,EAAEC,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,IAAIC,EAAE,QAAQ,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,aAAa,EAAE,aAAa,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,KAAK,SAAS,EAAE,EAAE,CAAC,QAAQ,QAAQ,OAAO,UAAU,KAAK,UAAU,OAAO,wBAAwB,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,aAAa,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,aAAa,CAAC,EAAE,EAAE,CAAC,QAAQ,QAAQ,OAAO,UAAU,KAAK,gBAAgB,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"command-executor-d6DdfUTD-DhFSDHvb.js","names":["e","r","t","i","n"],"sources":["../../../agent-core/dist/node/command-executor-d6DdfUTD.js"],"sourcesContent":["import{t as e}from\"./rolldown-runtime-DK3Fl9T5.js\";import{f as t,s as n,t as r}from\"./bounded-output-Bgx2Cgkx.js\";import{spawn as i}from\"node:child_process\";var a=e({CommandExecutor:()=>l});const o=1e6;function s(e,t){let n=r({maxBytes:o}),i=r({maxBytes:o,retain:`tail`});return e.stdout?.on(`data`,e=>n.append(e)),e.stderr?.on(`data`,e=>i.append(e)),e.stdin?.on(`error`,()=>{}),e.stdin?.write(t),e.stdin?.end(),{stdoutOutput:n,stderrOutput:i}}function c(e,t,n,r){if(e===0)return{outcome:`allow`,source:`command`,stdout:n};if(e===2)return{outcome:`deny`,source:`command`,reason:r.trim()||`Blocked by hook`};let i=r.trim()?`: ${r.trim()}`:``;return{outcome:`error`,source:`command`,kind:`nonzero-exit`,reason:e===null?`Hook terminated by signal ${t??`unknown`}${i}`:`Hook exited ${e}${i}`}}var l=class{shellExecutable;type=`command`;constructor(e){this.shellExecutable=e}execute(e,r,a){let o=e.timeout??600,l=o*1e3,u=JSON.stringify(r);return new Promise(d=>{let f=!1,p=t({executable:this.shellExecutable}),m=i(p.command,p.commandArgs(e.command),{cwd:r.cwd,env:n(process.env,a,r.env)}),{stdoutOutput:h,stderrOutput:g}=s(m,u),_=setTimeout(()=>{f||(f=!0,m.kill(`SIGTERM`),d({outcome:`error`,source:`command`,kind:`timeout`,reason:`Hook timed out after ${o}s`}))},l);m.on(`close`,(e,t)=>{f||(f=!0,clearTimeout(_),d(c(e,t,h.toString(),g.toString())))}),m.on(`error`,e=>{f||(f=!0,clearTimeout(_),d({outcome:`error`,source:`command`,kind:`spawn-failure`,reason:e.message}))})})}};export{a as n,l as t};\n//# sourceMappingURL=command-executor-d6DdfUTD.js.map"],"mappings":"6PAAiK,EAAEA,EAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,SAAS,EAAE,EAAE,EAAE,CAAC,IAAI,EAAEC,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,EAAEA,EAAE,CAAC,SAAS,EAAE,OAAO,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,EAAE,OAAO,GAAG,YAAY,CAAC,CAAC,EAAE,EAAE,OAAO,MAAM,CAAC,EAAE,EAAE,OAAO,IAAI,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,QAAQ,QAAQ,OAAO,UAAU,OAAO,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,CAAC,QAAQ,OAAO,OAAO,UAAU,OAAO,EAAE,KAAK,GAAG,iBAAiB,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,GAAG,MAAM,CAAC,QAAQ,QAAQ,OAAO,UAAU,KAAK,eAAe,OAAO,IAAI,KAAK,6BAA6B,GAAG,YAAY,IAAI,eAAe,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,gBAAgB,KAAK,UAAU,YAAY,EAAE,CAAC,KAAK,gBAAgB,CAAC,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,SAAS,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,UAAU,CAAC,EAAE,OAAO,IAAI,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,EAAEC,EAAE,CAAC,WAAW,KAAK,eAAe,CAAC,EAAE,EAAEC,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,IAAIC,EAAE,QAAQ,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,aAAa,EAAE,aAAa,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,KAAK,SAAS,EAAE,EAAE,CAAC,QAAQ,QAAQ,OAAO,UAAU,KAAK,UAAU,OAAO,wBAAwB,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,aAAa,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,aAAa,CAAC,EAAE,EAAE,CAAC,QAAQ,QAAQ,OAAO,UAAU,KAAK,gBAAgB,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  ;(function(){var v=parseInt(process.versions.node.split('.')[0],10);if(v<22){process.stderr.write('\n✗ Node.js 22+ is required (current: '+process.version+')\n\nUpgrade:\n nvm: nvm install 22 && nvm use 22\n Volta: volta install node@22\n Download: https://nodejs.org/en/download\n\n');process.exit(1);}})();
3
- import{M as e,N as t,d as n,o as r,s as i,t as a,u as o}from"./cli-core-CfQhvbx3.js";if(t(),n(process.argv))o(r());else try{let t=i();!t.serve||t.printMode||t.goal!==void 0||t.positional.length>0||t.reset||t.configure||t.configureProvider!==void 0||t.checkUpdate||t.help||t.version?(process.stderr.write(`This headless runtime accepts only --serve.
4
- `),process.exitCode=2):a({},e).catch(e=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}\n`),process.exitCode=1})}catch(e){process.stderr.write(`${e instanceof Error?e.message:String(e)}\n`),process.exitCode=2}export{};
3
+ import{F as e,P as t,c as n,d as r,f as i,o as a,s as o,t as s}from"./cli-core-DjVnz1-_.js";if(e(),r(o(process.argv)))i(a());else try{let e=n();!e.serve||e.printMode||e.goal!==void 0||e.positional.length>0||e.reset||e.configure||e.configureProvider!==void 0||e.checkUpdate||e.help||e.version?(process.stderr.write(`This headless runtime accepts only --serve.
4
+ `),process.exitCode=2):s({},t).catch(e=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}\n`),process.exitCode=1})}catch(e){process.stderr.write(`${e instanceof Error?e.message:String(e)}\n`),process.exitCode=2}export{};
@@ -1,2 +1,2 @@
1
- import{n as e}from"./rolldown-runtime-C9xYM0wc.js";import{r as t}from"./verdict-decoder-Dk_w2NG9-Bka7Cldj.js";import{t as n}from"./rolldown-runtime-DK3Fl9T5-DK3Fl9T5.js";var r=e({n:()=>i,t:()=>o}),i=n({HttpExecutor:()=>o});function a(e){return e.replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g,(e,t)=>{let n=process.env[t];return n===void 0?e:n})}var o=class{type=`http`;async execute(e,n){let r=(e.timeout??10)*1e3,i={"Content-Type":`application/json`};if(e.headers)for(let[t,n]of Object.entries(e.headers))i[t]=a(n);try{let a=await fetch(e.url,{method:`POST`,headers:i,body:JSON.stringify(n),signal:AbortSignal.timeout(r)});return a.ok?t(await a.text(),`http`,n.hook_event_name):{outcome:`error`,source:`http`,kind:`http-status`,reason:`HTTP ${a.status} ${a.statusText}`}}catch(e){return s(e)}}};function s(e){return{outcome:`error`,source:`http`,kind:e instanceof Error&&e.name===`TimeoutError`?`timeout`:`transport-failure`,reason:e instanceof Error?e.message:String(e)}}export{o as n,r as t};
2
- //# sourceMappingURL=http-executor-cWzI2svn-TG_TMYKh.js.map
1
+ import{n as e}from"./rolldown-runtime-C9xYM0wc.js";import{r as t}from"./verdict-decoder-Dz_rjoIZ-DA8BKB83.js";import{t as n}from"./rolldown-runtime-DK3Fl9T5-DK3Fl9T5.js";var r=e({n:()=>i,t:()=>o}),i=n({HttpExecutor:()=>o});function a(e){return e.replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g,(e,t)=>{let n=process.env[t];return n===void 0?e:n})}var o=class{type=`http`;async execute(e,n){let r=(e.timeout??10)*1e3,i={"Content-Type":`application/json`};if(e.headers)for(let[t,n]of Object.entries(e.headers))i[t]=a(n);try{let a=await fetch(e.url,{method:`POST`,headers:i,body:JSON.stringify(n),signal:AbortSignal.timeout(r)});return a.ok?t(await a.text(),`http`,n.hook_event_name):{outcome:`error`,source:`http`,kind:`http-status`,reason:`HTTP ${a.status} ${a.statusText}`}}catch(e){return s(e)}}};function s(e){return{outcome:`error`,source:`http`,kind:e instanceof Error&&e.name===`TimeoutError`?`timeout`:`transport-failure`,reason:e instanceof Error?e.message:String(e)}}export{o as n,r as t};
2
+ //# sourceMappingURL=http-executor-ADn4locH-D-8crzF8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-executor-cWzI2svn-TG_TMYKh.js","names":["e","t"],"sources":["../../../agent-core/dist/node/http-executor-cWzI2svn.js"],"sourcesContent":["import{t as e}from\"./rolldown-runtime-DK3Fl9T5.js\";import{t}from\"./verdict-decoder-Dk_w2NG9.js\";var n=e({HttpExecutor:()=>i});function r(e){return e.replace(/\\$([A-Za-z_][A-Za-z0-9_]*)/g,(e,t)=>{let n=process.env[t];return n===void 0?e:n})}var i=class{type=`http`;async execute(e,n){let i=(e.timeout??10)*1e3,o={\"Content-Type\":`application/json`};if(e.headers)for(let[t,n]of Object.entries(e.headers))o[t]=r(n);try{let r=await fetch(e.url,{method:`POST`,headers:o,body:JSON.stringify(n),signal:AbortSignal.timeout(i)});return r.ok?t(await r.text(),`http`,n.hook_event_name):{outcome:`error`,source:`http`,kind:`http-status`,reason:`HTTP ${r.status} ${r.statusText}`}}catch(e){return a(e)}}};function a(e){return{outcome:`error`,source:`http`,kind:e instanceof Error&&e.name===`TimeoutError`?`timeout`:`transport-failure`,reason:e instanceof Error?e.message:String(e)}}export{n,i as t};\n//# sourceMappingURL=http-executor-cWzI2svn.js.map"],"mappings":"qMAAoG,EAAEA,EAAE,CAAC,iBAAiB,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE,QAAQ,+BAA+B,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,IAAI,GAAG,OAAO,IAAI,IAAK,GAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,OAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,SAAS,IAAI,IAAI,EAAE,CAAC,eAAe,kBAAkB,EAAE,GAAG,EAAE,QAAQ,IAAI,GAAG,CAAC,EAAE,KAAK,OAAO,QAAQ,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,MAAM,EAAE,IAAI,CAAC,OAAO,OAAO,QAAQ,EAAE,KAAK,KAAK,UAAU,CAAC,EAAE,OAAO,YAAY,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAGC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,QAAQ,QAAQ,OAAO,OAAO,KAAK,cAAc,OAAO,QAAQ,EAAE,OAAO,GAAG,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,QAAQ,OAAO,OAAO,KAAK,aAAa,OAAO,EAAE,OAAO,eAAe,UAAU,oBAAoB,OAAO,aAAa,MAAM,EAAE,QAAQ,OAAO,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"http-executor-ADn4locH-D-8crzF8.js","names":["e","t"],"sources":["../../../agent-core/dist/node/http-executor-ADn4locH.js"],"sourcesContent":["import{t as e}from\"./rolldown-runtime-DK3Fl9T5.js\";import{t}from\"./verdict-decoder-Dz_rjoIZ.js\";var n=e({HttpExecutor:()=>i});function r(e){return e.replace(/\\$([A-Za-z_][A-Za-z0-9_]*)/g,(e,t)=>{let n=process.env[t];return n===void 0?e:n})}var i=class{type=`http`;async execute(e,n){let i=(e.timeout??10)*1e3,o={\"Content-Type\":`application/json`};if(e.headers)for(let[t,n]of Object.entries(e.headers))o[t]=r(n);try{let r=await fetch(e.url,{method:`POST`,headers:o,body:JSON.stringify(n),signal:AbortSignal.timeout(i)});return r.ok?t(await r.text(),`http`,n.hook_event_name):{outcome:`error`,source:`http`,kind:`http-status`,reason:`HTTP ${r.status} ${r.statusText}`}}catch(e){return a(e)}}};function a(e){return{outcome:`error`,source:`http`,kind:e instanceof Error&&e.name===`TimeoutError`?`timeout`:`transport-failure`,reason:e instanceof Error?e.message:String(e)}}export{n,i as t};\n//# sourceMappingURL=http-executor-ADn4locH.js.map"],"mappings":"qMAAoG,EAAEA,EAAE,CAAC,iBAAiB,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE,QAAQ,+BAA+B,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,IAAI,GAAG,OAAO,IAAI,IAAK,GAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,OAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,SAAS,IAAI,IAAI,EAAE,CAAC,eAAe,kBAAkB,EAAE,GAAG,EAAE,QAAQ,IAAI,GAAG,CAAC,EAAE,KAAK,OAAO,QAAQ,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,MAAM,EAAE,IAAI,CAAC,OAAO,OAAO,QAAQ,EAAE,KAAK,KAAK,UAAU,CAAC,EAAE,OAAO,YAAY,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAGC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,QAAQ,QAAQ,OAAO,OAAO,KAAK,cAAc,OAAO,QAAQ,EAAE,OAAO,GAAG,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,QAAQ,OAAO,OAAO,KAAK,aAAa,OAAO,EAAE,OAAO,eAAe,UAAU,oBAAoB,OAAO,aAAa,MAAM,EAAE,QAAQ,OAAO,CAAC,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
1
  ;(function(){var v=parseInt(process.versions.node.split('.')[0],10);if(v<22){process.stderr.write('\n✗ Node.js 22+ is required (current: '+process.version+')\n\nUpgrade:\n nvm: nvm install 22 && nvm use 22\n Volta: volta install node@22\n Download: https://nodejs.org/en/download\n\n');process.exit(1);}})();
2
- import{n as e}from"./rolldown-runtime-rs7quPpn.js";import{r as t}from"./verdict-decoder-Dk_w2NG9-BKWMtxp8.js";import{t as n}from"./rolldown-runtime-DK3Fl9T5-BeX3Bzvn.js";var r=e({n:()=>i,t:()=>o}),i=n({HttpExecutor:()=>o});function a(e){return e.replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g,(e,t)=>{let n=process.env[t];return n===void 0?e:n})}var o=class{type=`http`;async execute(e,n){let r=(e.timeout??10)*1e3,i={"Content-Type":`application/json`};if(e.headers)for(let[t,n]of Object.entries(e.headers))i[t]=a(n);try{let a=await fetch(e.url,{method:`POST`,headers:i,body:JSON.stringify(n),signal:AbortSignal.timeout(r)});return a.ok?t(await a.text(),`http`,n.hook_event_name):{outcome:`error`,source:`http`,kind:`http-status`,reason:`HTTP ${a.status} ${a.statusText}`}}catch(e){return s(e)}}};function s(e){return{outcome:`error`,source:`http`,kind:e instanceof Error&&e.name===`TimeoutError`?`timeout`:`transport-failure`,reason:e instanceof Error?e.message:String(e)}}export{o as n,r as t};
2
+ import{n as e}from"./rolldown-runtime-rs7quPpn.js";import{r as t}from"./verdict-decoder-Dz_rjoIZ-qM0jJVsB.js";import{t as n}from"./rolldown-runtime-DK3Fl9T5-BeX3Bzvn.js";var r=e({n:()=>i,t:()=>o}),i=n({HttpExecutor:()=>o});function a(e){return e.replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g,(e,t)=>{let n=process.env[t];return n===void 0?e:n})}var o=class{type=`http`;async execute(e,n){let r=(e.timeout??10)*1e3,i={"Content-Type":`application/json`};if(e.headers)for(let[t,n]of Object.entries(e.headers))i[t]=a(n);try{let a=await fetch(e.url,{method:`POST`,headers:i,body:JSON.stringify(n),signal:AbortSignal.timeout(r)});return a.ok?t(await a.text(),`http`,n.hook_event_name):{outcome:`error`,source:`http`,kind:`http-status`,reason:`HTTP ${a.status} ${a.statusText}`}}catch(e){return s(e)}}};function s(e){return{outcome:`error`,source:`http`,kind:e instanceof Error&&e.name===`TimeoutError`?`timeout`:`transport-failure`,reason:e instanceof Error?e.message:String(e)}}export{o as n,r as t};
@@ -3,7 +3,7 @@ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/
3
3
  import "@modelcontextprotocol/sdk/shared/auth.js";
4
4
  import "@modelcontextprotocol/sdk/types.js";
5
5
  import "@modelcontextprotocol/sdk/shared/transport.js";
6
- //#region ../agent-core/dist/node/types-gNrckgFE.d.ts
6
+ //#region ../agent-core/dist/node/types-Ge2XB-y-.d.ts
7
7
  //#region src/interfaces/universal-value.d.ts
8
8
  /**
9
9
  * Universal value type axis (recursive, JSON-like + Date).
@@ -91,7 +91,7 @@ interface IOutboundTraceContext {
91
91
  /** Claude Code compatible session end reasons. */
92
92
  type TSessionEndReason = 'clear' | 'resume' | 'logout' | 'prompt_input_exit' | 'bypass_permissions_disabled' | 'other';
93
93
  //#endregion
94
- //#region ../agent-core/dist/node/index-D4iJ5IsN.d.ts
94
+ //#region ../agent-core/dist/node/index-DQrmrFn9.d.ts
95
95
  /**
96
96
  * Context data type - for execution contexts
97
97
  */
@@ -105,81 +105,37 @@ type TLoggerData = Record<string, TUniversalValue | Date | Error>;
105
105
  */
106
106
  type TToolParameters = Record<string, TUniversalValue>;
107
107
  //#endregion
108
- //#region src/interfaces/interaction.d.ts
109
- /**
110
- * UI-agnostic "ask the user" contract (CMD-004).
111
- *
112
- * The SSOT for the interaction action lives in agent-core so every interaction *source* can reach it:
113
- * command execution (`ICommandHostContext`, agent-framework) AND tool execution
114
- * (`IToolExecutionContext`, agent-core, for model-issued questions — CMD-005). These are pure types
115
- * with no runtime dependency, so the contract crosses a serialization/transport boundary unchanged
116
- * (no function-valued fields).
117
- *
118
- * A single shape covers every interaction kind, parameterised by fields rather than split into
119
- * variants:
120
- * - confirm → two options, `maxSelect` 1
121
- * - single → options, `maxSelect` 1
122
- * - multi → options, `maxSelect` > 1
123
- * - free text → no options, `allowFreeText` true
124
- * - secret → free text with `masked` true
125
- */
126
- /** One predefined option the user can choose. */
127
- interface IActionOption {
128
- value: string;
129
- label: string;
130
- description?: string;
108
+ //#region src/interfaces/tool-continuation.d.ts
109
+ /** Core-owned identity, independent of a provider's reusable tool-call identifier. */
110
+ interface IToolActionIdentity {
111
+ executionId: string;
112
+ actionId: string;
113
+ parentCallId: string;
114
+ toolCallId: string;
115
+ toolName: string;
131
116
  }
132
- /** Pre-selected option values and/or prefilled free text for an action request. */
133
- interface IActionDefault {
134
- values?: readonly string[];
135
- text?: string;
117
+ interface IToolContinuationPrompt {
118
+ kind: string;
119
+ data: TToolParameters;
136
120
  }
137
- /** One request for the user to answer. See the module doc for how the fields encode each kind. */
138
- interface IActionRequest {
139
- /** Correlation key; the ask port resolves a given id exactly once (idempotent, first-answer wins). */
140
- id: string;
141
- title: string;
142
- description?: string;
143
- /** Predefined options. Empty/omitted ⇒ pure free-text entry. */
144
- options?: readonly IActionOption[];
145
- /** Minimum selections required (default 1). */
146
- minSelect?: number;
147
- /** Maximum selections allowed (default 1 ⇒ single; > 1 ⇒ multi). */
148
- maxSelect?: number;
149
- /** Allow a typed custom answer in addition to / instead of the options. */
150
- allowFreeText?: boolean;
151
- /** Free-text entry is masked (secret entry such as an API key); the renderer hides input. */
152
- masked?: boolean;
153
- /** Allow submitting empty free text. */
154
- allowEmpty?: boolean;
155
- /** Placeholder shown in the free-text field. */
156
- placeholder?: string;
157
- /** Maximum options shown before scrolling (renderer hint). */
158
- maxVisible?: number;
159
- /** Pre-selected option values and/or prefilled free text. */
160
- default?: IActionDefault;
121
+ interface IToolWaitRequest extends IToolActionIdentity, IToolContinuationPrompt {
122
+ requestId: string;
161
123
  }
162
- /**
163
- * The user's answer to an {@link IActionRequest}. `answer` carries the selected option values and/or
164
- * the typed text; `cancelled` means the user dismissed the request, or no interactive renderer was
165
- * available to answer it.
166
- */
167
- type TActionResponse = {
168
- type: 'answer';
169
- values: readonly string[];
170
- text?: string;
171
- } | {
172
- type: 'cancelled';
173
- };
174
- /**
175
- * The injected "ask the user" port — a single seam reachable by every interaction source (command
176
- * execution now; tool execution for model-issued questions later) and rendered per-environment by each
177
- * transport. The concurrency model (broadcast to attached interactive channels, first answer wins,
178
- * later answers for an already-resolved `id` ignored) is owned by the port implementation, not the
179
- * contract.
180
- */
181
- interface IUserInteraction {
182
- ask(request: IActionRequest): Promise<TActionResponse>;
124
+ interface IToolWaitResponse {
125
+ requestId: string;
126
+ responseId: string;
127
+ response: TToolParameters;
128
+ }
129
+ interface IToolWaitState {
130
+ request: IToolWaitRequest;
131
+ response?: IToolWaitResponse;
132
+ }
133
+ /** Available before effect admission. The runtime owns interpretation and authorization. */
134
+ interface IToolContinuation {
135
+ readonly action: IToolActionIdentity;
136
+ readonly waits: readonly IToolWaitState[];
137
+ /** Return a saved response or persist a request and suspend this execution. */
138
+ request(prompt: IToolContinuationPrompt): Promise<TToolParameters>;
183
139
  }
184
140
  /**
185
141
  * Message metadata used across conversation history and provider adapters.
@@ -361,8 +317,6 @@ interface IModelRef {
361
317
  provider: string;
362
318
  model: string;
363
319
  }
364
- //#endregion
365
- //#region src/utils/provider-failure.d.ts
366
320
  /** Why a provider call failed, as far as switching models is concerned. */
367
321
  type TProviderFailureReason = 'overloaded' | 'service-unavailable' | 'server-error' | 'model-unavailable' | 'authentication' | 'billing' | 'rate-limit' | 'invalid-request' | 'network' | 'aborted' | 'unknown';
368
322
  //#endregion
@@ -804,24 +758,6 @@ interface IAIProvider {
804
758
  */
805
759
  close?(): Promise<void>;
806
760
  }
807
- /**
808
- * The catalog a search tool loads through — the port `IToolExecutionContext.deferredTools` carries.
809
- *
810
- * Narrow on purpose: a tool that can list and load must not be able to register, remove or execute.
811
- */
812
- interface IDeferredToolCatalog {
813
- /**
814
- * Deferred tools not yet loaded — the population a search can still discover. Empty while
815
- * deferral is not engaged, because nothing is withheld then.
816
- */
817
- listDeferredTools(): IToolSchema[];
818
- /**
819
- * Mark the named deferred tools loaded for the rest of the session and return their schemas. A
820
- * resident name is returned as it is (it was never withheld); an unknown name throws, naming the
821
- * entry, and then nothing is loaded — the check runs over every name before the first load.
822
- */
823
- loadDeferredTools(names: readonly string[]): IToolSchema[];
824
- }
825
761
  //#endregion
826
762
  //#region src/event-service/interfaces.d.ts
827
763
  /**
@@ -896,7 +832,104 @@ interface IEventService {
896
832
  unsubscribe(listener: TEventListener): void;
897
833
  }
898
834
  //#endregion
835
+ //#region src/interfaces/interaction.d.ts
836
+ /**
837
+ * UI-agnostic "ask the user" contract (CMD-004).
838
+ *
839
+ * The SSOT for the interaction action lives in agent-core so every interaction *source* can reach it:
840
+ * command execution (`ICommandHostContext`, agent-framework) AND tool execution
841
+ * (`IToolExecutionContext`, agent-core, for model-issued questions — CMD-005). These are pure types
842
+ * with no runtime dependency, so the contract crosses a serialization/transport boundary unchanged
843
+ * (no function-valued fields).
844
+ *
845
+ * A single shape covers every interaction kind, parameterised by fields rather than split into
846
+ * variants:
847
+ * - confirm → two options, `maxSelect` 1
848
+ * - single → options, `maxSelect` 1
849
+ * - multi → options, `maxSelect` > 1
850
+ * - free text → no options, `allowFreeText` true
851
+ * - secret → free text with `masked` true
852
+ */
853
+ /** One predefined option the user can choose. */
854
+ interface IActionOption {
855
+ value: string;
856
+ label: string;
857
+ description?: string;
858
+ }
859
+ /** Pre-selected option values and/or prefilled free text for an action request. */
860
+ interface IActionDefault {
861
+ values?: readonly string[];
862
+ text?: string;
863
+ }
864
+ /** One request for the user to answer. See the module doc for how the fields encode each kind. */
865
+ interface IActionRequest {
866
+ /** Correlation key; the ask port resolves a given id exactly once (idempotent, first-answer wins). */
867
+ id: string;
868
+ title: string;
869
+ description?: string;
870
+ /** Predefined options. Empty/omitted ⇒ pure free-text entry. */
871
+ options?: readonly IActionOption[];
872
+ /** Minimum selections required (default 1). */
873
+ minSelect?: number;
874
+ /** Maximum selections allowed (default 1 ⇒ single; > 1 ⇒ multi). */
875
+ maxSelect?: number;
876
+ /** Allow a typed custom answer in addition to / instead of the options. */
877
+ allowFreeText?: boolean;
878
+ /** Free-text entry is masked (secret entry such as an API key); the renderer hides input. */
879
+ masked?: boolean;
880
+ /** Allow submitting empty free text. */
881
+ allowEmpty?: boolean;
882
+ /** Placeholder shown in the free-text field. */
883
+ placeholder?: string;
884
+ /** Maximum options shown before scrolling (renderer hint). */
885
+ maxVisible?: number;
886
+ /** Pre-selected option values and/or prefilled free text. */
887
+ default?: IActionDefault;
888
+ }
889
+ /**
890
+ * The user's answer to an {@link IActionRequest}. `answer` carries the selected option values and/or
891
+ * the typed text; `cancelled` means the user dismissed the request, or no interactive renderer was
892
+ * available to answer it.
893
+ */
894
+ type TActionResponse = {
895
+ type: 'answer';
896
+ values: readonly string[];
897
+ text?: string;
898
+ } | {
899
+ type: 'cancelled';
900
+ };
901
+ /**
902
+ * The injected "ask the user" port — a single seam reachable by every interaction source (command
903
+ * execution now; tool execution for model-issued questions later) and rendered per-environment by each
904
+ * transport. The concurrency model (broadcast to attached interactive channels, first answer wins,
905
+ * later answers for an already-resolved `id` ignored) is owned by the port implementation, not the
906
+ * contract.
907
+ */
908
+ interface IUserInteraction {
909
+ ask(request: IActionRequest): Promise<TActionResponse>;
910
+ }
911
+ /**
912
+ * The catalog a search tool loads through — the port `IToolExecutionContext.deferredTools` carries.
913
+ *
914
+ * Narrow on purpose: a tool that can list and load must not be able to register, remove or execute.
915
+ */
916
+ interface IDeferredToolCatalog {
917
+ /**
918
+ * Deferred tools not yet loaded — the population a search can still discover. Empty while
919
+ * deferral is not engaged, because nothing is withheld then.
920
+ */
921
+ listDeferredTools(): IToolSchema[];
922
+ /**
923
+ * Mark the named deferred tools loaded for the rest of the session and return their schemas. A
924
+ * resident name is returned as it is (it was never withheld); an unknown name throws, naming the
925
+ * entry, and then nothing is loaded — the check runs over every name before the first load.
926
+ */
927
+ loadDeferredTools(names: readonly string[]): IToolSchema[];
928
+ }
929
+ //#endregion
899
930
  //#region src/interfaces/tool.d.ts
931
+ /** Awaited host admission for effective parameters, immediately before a tool body. */
932
+ type TToolEffectAdmission<TParameters = TToolParameters> = (parameters: TParameters) => Promise<void>;
900
933
  type TToolContextExtensionValue = TUniversalValue | Date | Error | TLoggerData | TContextData | TToolParameters | TToolMetadata;
901
934
  /**
902
935
  * Tool metadata structure - specific type definition
@@ -926,6 +959,10 @@ interface IToolResult {
926
959
  interface IToolExecutionContext {
927
960
  toolName: string;
928
961
  parameters: TToolParameters;
962
+ /** Runtime-owned barrier, consumed after permission and before entering the tool. */
963
+ beforeToolEffect?: TToolEffectAdmission;
964
+ /** Journaled pre-effect request/response port for admission-aware runtime wrappers. */
965
+ continuation?: IToolContinuation;
929
966
  /**
930
967
  * Run-scoped cancellation signal (CORE-018). Long-running tools MUST honor it: terminate
931
968
  * the underlying work (kill the child process, abort the network request) and return an
@@ -1046,6 +1083,11 @@ interface IParameterValidationResult {
1046
1083
  interface IToolContract<TParameters = TToolParameters, TResult = IToolResult> {
1047
1084
  readonly schema: IToolSchema;
1048
1085
  execute(parameters: TParameters, context: IToolExecutionContext): Promise<TResult>;
1086
+ /**
1087
+ * Wrappers await admission exactly once with final canonical arguments after preconditions and before
1088
+ * the body. Denial returns without admission. Admission failures propagate unchanged.
1089
+ */
1090
+ executeWithAdmission?(parameters: TParameters, context: IToolExecutionContext, admit: TToolEffectAdmission<TParameters>): Promise<TResult>;
1049
1091
  validate(parameters: TParameters): boolean;
1050
1092
  validateParameters(parameters: TParameters): IParameterValidationResult;
1051
1093
  getDescription(): string;
@@ -1196,7 +1238,7 @@ interface IProviderDefinition {
1196
1238
  * LLM nodes' single `COST_PER_TOKEN_USD` scalar. The correct long-term home is the per-model
1197
1239
  * {@link IProviderModelCatalogEntry.costPerInputToken}/`costPerOutputToken`; this flat scalar is a
1198
1240
  * fidelity-preserving interim used only while model catalogs are `status:'unavailable'` (no per-model
1199
- * entries to attach cost to). Consumed by the collapsed `llm-text` node's `maxCostUsd` estimation. Absent
1241
+ * entries to attach cost to). Consumed by the collapsed `llm-text` node's cost estimate. Absent
1200
1242
  * means cost is unknown for this provider and estimators must degrade explicitly.
1201
1243
  */
1202
1244
  costPerTokenUsd?: number;
@@ -1317,6 +1359,17 @@ interface ICapabilityDescriptor {
1317
1359
  * re-exports it. A transport-origin command runs as a local one by default; an optional policy may restrict (REMOTE-006).
1318
1360
  */
1319
1361
  type TCommandInvocationSource = 'user' | 'model' | 'remote';
1362
+ /**
1363
+ * Whether a `'remote'`-sourced invocation is provably on this machine. The loopback-bound WS carrier
1364
+ * (the desktop app and a locally served browser page) is `'local'`; the device-mesh/WebRTC carrier
1365
+ * proves no locality ("a browser device proves no locality, so it is treated as another machine" —
1366
+ * the same rule `ConnectionAuthority` already applies to pairing), so it is always `'remote'`. Absent
1367
+ * (an in-process caller, an older host, or a test double) defaults to `'local'` — the allow-by-default
1368
+ * posture the rest of the command layer already uses. A command that runs code from outside the
1369
+ * session (installing a plugin) reads this to refuse a remote device even though `'remote'`-sourced
1370
+ * commands otherwise run like a local one (REMOTE-006).
1371
+ */
1372
+ type TCommandSurfaceLocality = 'local' | 'remote';
1320
1373
  /**
1321
1374
  * Who runs a command. `'runtime'`: the process that owns the session runs it, whichever surface
1322
1375
  * sent it. `'client'`: the surface the user is typing into runs it itself, because what it does
@@ -1351,6 +1404,11 @@ interface ICommand {
1351
1404
  execute?: (args: string) => void | Promise<void>;
1352
1405
  /** Full SKILL.md content (only for skill commands) */
1353
1406
  skillContent?: string;
1407
+ /**
1408
+ * The absolute directory the skill's file is in, when its source can name one. `${CLAUDE_SKILL_DIR}`
1409
+ * in the skill's content expands to it, so the skill can point at files it ships beside SKILL.md.
1410
+ */
1411
+ skillDirectory?: string;
1354
1412
  /** Hint for the expected argument (Claude Code frontmatter) */
1355
1413
  argumentHint?: string;
1356
1414
  /** When true, models cannot invoke this skill autonomously */
@@ -1607,6 +1665,26 @@ interface IBackgroundTaskError {
1607
1665
  * TYPE-003: alias of the `agent-core` usage-triple SSOT (`ITokenUsage`) — derived, not re-declared.
1608
1666
  */
1609
1667
  type IBackgroundTaskUsage = ITokenUsage;
1668
+ /**
1669
+ * Issue #3288 §1: why a tool call inside a task was refused — the same distinction the session-layer
1670
+ * enforcer already records for its own denials (`hasApprover ? 'user' : 'no-approver'`), named here for
1671
+ * a task's result rather than a live session's denial log: `'no-approver'` when no approver was
1672
+ * attached at all (print mode, a truly headless run); `'denied-by-person'` when one was attached and
1673
+ * answered no; `'approver-error'` when it threw or rejected instead of answering — a broken approver
1674
+ * still fails the call closed rather than hanging it; `'cancelled'` when the task ended (finished,
1675
+ * failed, or was stopped) before an attached approver's answer arrived — a `false` produced by that
1676
+ * cutoff is not the same fact as a person's own denial, so it is never counted as one.
1677
+ */
1678
+ type TBackgroundTaskPermissionDenialReason = 'denied-by-person' | 'no-approver' | 'approver-error' | 'cancelled';
1679
+ /**
1680
+ * How many of a task's tool calls were refused, and why. Additive: a caller only reads this when at
1681
+ * least one call was refused, so a task with none carries no new field — the result of a task that
1682
+ * finished exactly as it always did is unchanged.
1683
+ */
1684
+ interface IBackgroundTaskDeniedToolCalls {
1685
+ readonly total: number;
1686
+ readonly byReason: Readonly<Record<TBackgroundTaskPermissionDenialReason, number>>;
1687
+ }
1610
1688
  interface IBaseBackgroundTaskResult {
1611
1689
  taskId: string;
1612
1690
  output: string;
@@ -1616,6 +1694,8 @@ interface IAgentBackgroundTaskResult extends IBaseBackgroundTaskResult {
1616
1694
  kind: 'agent';
1617
1695
  /** ANALYTICS-001 (Phase 2): total token usage of an agent task, attributed to it in the parent log. */
1618
1696
  usage?: IBackgroundTaskUsage;
1697
+ /** Issue #3288 §1: present only when the task had at least one tool call refused. */
1698
+ deniedToolCalls?: IBackgroundTaskDeniedToolCalls;
1619
1699
  }
1620
1700
  interface IProcessBackgroundTaskResult extends IBaseBackgroundTaskResult {
1621
1701
  kind: 'process';
@@ -1861,7 +1941,7 @@ interface ISubagentJobState extends Pick<IBackgroundTaskState<'agent'>, 'id' | '
1861
1941
  error?: string;
1862
1942
  }
1863
1943
  //#endregion
1864
- //#region ../agent-interface-session/dist/node/session-contracts-Cv9Jeiyw.d.ts
1944
+ //#region ../agent-interface-session/dist/node/session-contracts-C4R5bYiU.d.ts
1865
1945
  //#endregion
1866
1946
  //#region src/session-loop-contracts.d.ts
1867
1947
  /** A self-paced loop's durable lifecycle, independent of its disposable wake timer. */
@@ -2105,7 +2185,7 @@ interface ISessionReplayValidationResult {
2105
2185
  */
2106
2186
  type TWorkspaceRelation = 'same-worktree' | 'same-repo' | 'different-repo' | 'unknown';
2107
2187
  //#endregion
2108
- //#region ../agent-framework/dist/node/createInteractiveRuntime-DSLwJcwG.d.ts
2188
+ //#region ../agent-framework/dist/node/createInteractiveRuntime-BhC0t5ec.d.ts
2109
2189
  //#region src/effort/effort-resolution.d.ts
2110
2190
  type TEffortSelection = TModelEffort | 'auto';
2111
2191
  type TEffortSource = 'command' | 'flag' | 'environment' | 'settings' | 'preset' | 'model-default';
@@ -2300,10 +2380,25 @@ interface ISessionUsageRecord {
2300
2380
  //#region src/command-api/agent-job-roles.d.ts
2301
2381
  /** Starting, steering and ending subagent jobs. */
2302
2382
  interface IAgentJobDispatch {
2383
+ /**
2384
+ * #3282 §4: the agent switcher's roster — `definedIn` is a plain-words location (a discovered
2385
+ * file's path, or "Built-in") a person picking an agent can read.
2386
+ */
2303
2387
  listAgentDefinitions(): Array<{
2304
2388
  name: string;
2305
2389
  description: string;
2390
+ definedIn: string;
2306
2391
  }>;
2392
+ /**
2393
+ * #3282 §4: the agent type `/agent <name>` (no prompt) currently selects — the agent switcher
2394
+ * shows it checked. Never throws; a host without the agent runtime just has the fallback default.
2395
+ */
2396
+ getDefaultAgentType(): string;
2397
+ /**
2398
+ * #3282 §4: `/agent <name>` (bare, no prompt) sets this — the agent type used as the default
2399
+ * `agentType` whenever one is not otherwise named. Throws if the agent runtime is unavailable.
2400
+ */
2401
+ setDefaultAgentType(agentType: string): void;
2307
2402
  listAgentJobs(): ISubagentJobState[];
2308
2403
  spawnAgentJob(input: {
2309
2404
  agentType: string;
@@ -2379,7 +2474,7 @@ interface IAgentJobMonitors {
2379
2474
  interface IAgentJobLogs {
2380
2475
  readBackgroundTaskLog(taskId: string, cursor?: IBackgroundTaskLogCursor): Promise<IBackgroundTaskLogPage>;
2381
2476
  }
2382
- /** Aggregate: all 15 members remain source-compatible. Declare a role port instead of this. */
2477
+ /** Aggregate of the five role interfaces above, kept source-compatible. Declare a role port instead of this. */
2383
2478
  interface IAgentJobHostContext extends IAgentJobDispatch, IAgentJobGroups, IAgentJobSchedules, IAgentJobMonitors, IAgentJobLogs {}
2384
2479
  //#endregion
2385
2480
  //#region src/command-api/preset/preset-application-types.d.ts
@@ -2563,9 +2658,22 @@ interface IPermissionRuleLayer {
2563
2658
  readonly deny: readonly string[];
2564
2659
  readonly ask: readonly string[];
2565
2660
  }
2661
+ /** One rule to remove from the settings layer it was declared in (#3282 §4a). */
2662
+ interface IPermissionRuleRemoval {
2663
+ /** The `scope` of the {@link IPermissionRuleLayer} the rule was read from. */
2664
+ readonly scope: string;
2665
+ readonly kind: 'allow' | 'deny' | 'ask';
2666
+ readonly pattern: string;
2667
+ }
2566
2668
  /** Where each configured permission rule comes from, read fresh on every call. */
2567
2669
  interface ICommandPermissionRulesAdapter {
2568
2670
  readLayers(): readonly IPermissionRuleLayer[];
2671
+ /**
2672
+ * #3282 §4a: remove one declared rule from its settings layer. Optional — a host with no write
2673
+ * target for any layer (read-only rule discovery) makes rule removal fail EXPLICITLY wherever it
2674
+ * is offered, never a silent no-op. Returns `false` when no writable layer matched the removal.
2675
+ */
2676
+ removeRule?(removal: IPermissionRuleRemoval): boolean;
2569
2677
  }
2570
2678
  /** How shell commands are confined: not at all, confined without prompts, or confined and asked. */
2571
2679
  type TSandboxCommandMode = 'off' | 'auto-allow' | 'regular';
@@ -2661,6 +2769,15 @@ interface ICommandMCPActivationSummary {
2661
2769
  readonly provenanceId: string;
2662
2770
  readonly definitionFingerprint: string;
2663
2771
  readonly securityIdentity: string;
2772
+ /**
2773
+ * #3282 §4 part b-2: this process's live connection outcome for an `allowed` server — absent for
2774
+ * one that is not `allowed`, or has not been attempted yet. `'failed'`'s reason is
2775
+ * {@link connectionFailureReason}; a connected server's tool names are {@link toolNames}.
2776
+ */
2777
+ readonly connection?: 'connected' | 'failed';
2778
+ readonly connectionFailureReason?: string;
2779
+ /** The names of the tools this server currently contributes; empty when not connected. */
2780
+ readonly toolNames?: readonly string[];
2664
2781
  }
2665
2782
  /**
2666
2783
  * A definition-source-level problem — issue #2794: a configuration root that is not an object, no
@@ -2781,6 +2898,33 @@ interface ICommandMCPActivationAdapter {
2781
2898
  * a name it already had. Called once per sign-in that returned tools.
2782
2899
  */
2783
2900
  oauthToolsAdded?(serverId: string, added: readonly string[]): void;
2901
+ /**
2902
+ * #3282 §4 part b-2: `/mcp reload` and the Settings screen's "Reload servers" button. Retries
2903
+ * every allowed server that is not currently connected; a server already connected is left
2904
+ * running. Never rejects: a server that still cannot connect keeps its `list()` failure reason.
2905
+ * Absent: the host offers no reload (the button/command then say so).
2906
+ */
2907
+ reload?(): Promise<{
2908
+ readonly tools: readonly IToolWithEventService[];
2909
+ readonly connectedServerIds: readonly string[];
2910
+ readonly failedServerIds: readonly string[];
2911
+ /**
2912
+ * Identifies this call's staged tool provenance for `reloadToolsAdded`; absent when there is
2913
+ * nothing to acknowledge (no server newly connected). Two `reload()` calls outstanding at once
2914
+ * — `/mcp reload` runs inline, unblocked by the mid-turn gate, and an `update-settings` write
2915
+ * is fire-and-forget, so this is reachable, not hypothetical — join the same connection pass
2916
+ * and get the same token back; a fresh call started only after the last one's token was
2917
+ * acknowledged gets a new one.
2918
+ */
2919
+ readonly reloadToken?: string;
2920
+ }>;
2921
+ /**
2922
+ * Which of `reload`'s tools the session actually took, keyed to the `reloadToken` it returned;
2923
+ * any other was left out for a name it already had. `token` not matching the currently staged
2924
+ * reload — already committed, or superseded by a later call — makes this a no-op, so a late or
2925
+ * duplicate acknowledgement can never clear or corrupt a different reload's provenance.
2926
+ */
2927
+ reloadToolsAdded?(token: string, added: readonly string[]): void;
2784
2928
  }
2785
2929
  /**
2786
2930
  * PEER-004 (#1863): a live session this one can address, as the operator sees it.
@@ -3219,6 +3363,17 @@ interface ICommandHostUserInteraction {
3219
3363
  */
3220
3364
  getUserInteraction(): IUserInteraction | undefined;
3221
3365
  }
3366
+ /**
3367
+ * Whether THIS session is running with no provider configured yet (issue #3282 §3 setup mode).
3368
+ *
3369
+ * Exists for exactly one command (`/provider add`, deciding hot-swap vs. restart) — never inferred
3370
+ * from settings, because an ordinary session started from an env-default provider also has none
3371
+ * persisted. The member is optional so a host with no concept of setup mode costs nothing and is
3372
+ * correctly read as "not in it" (`?.() === true`), never mistaken for a required capability.
3373
+ */
3374
+ interface ICommandHostSetupState {
3375
+ isSetupRequired?(): boolean;
3376
+ }
3222
3377
  /** Re-applying preset-owned configuration to the live session. */
3223
3378
  interface ICommandHostPresetApplication {
3224
3379
  /** Apply an additive response style to the live system prompt. */
@@ -3257,6 +3412,12 @@ interface ICommandHostContextReferences {
3257
3412
  interface ICommandHostWorkspace {
3258
3413
  getCwd(): string;
3259
3414
  getCommandInvocationSource(): TCommandInvocationSource;
3415
+ /**
3416
+ * #3282 §4 part b-2: whether THIS invocation is provably on this machine. Optional so an older or
3417
+ * narrower host still satisfies this interface; a caller that needs it treats a missing method the
3418
+ * same as `'local'` (allow-by-default, matching the rest of the command layer).
3419
+ */
3420
+ getCommandSurfaceLocality?(): TCommandSurfaceLocality;
3260
3421
  }
3261
3422
  /** What commands and skills this host can dispatch. */
3262
3423
  interface ICommandHostCatalog {
@@ -3338,8 +3499,8 @@ interface ICommandHostTerminalHandoff {
3338
3499
  interface ICommandHostAdapterAccess {
3339
3500
  getCommandHostAdapters?(): ICommandHostAdapters;
3340
3501
  }
3341
- /** Aggregate: all 47 members remain source-compatible. Declare a role port instead of this. */
3342
- interface ICommandHostContext extends ICommandHostSessionAccess, ICommandHostAgentJobs, ICommandHostUserInteraction, ICommandHostPresetApplication, ICommandHostContextWindow, ICommandHostContextReferences, ICommandHostWorkspace, ICommandHostCatalog, ICommandHostCheckpoints, ICommandHostMemory, ICommandHostBackgroundTasks, ICommandHostGoal, ICommandHostPlan, ICommandHostTerminalHandoff, ICommandHostAdapterAccess {}
3502
+ /** Aggregate: all 48 members remain source-compatible. Declare a role port instead of this. */
3503
+ interface ICommandHostContext extends ICommandHostSessionAccess, ICommandHostAgentJobs, ICommandHostUserInteraction, ICommandHostSetupState, ICommandHostPresetApplication, ICommandHostContextWindow, ICommandHostContextReferences, ICommandHostWorkspace, ICommandHostCatalog, ICommandHostCheckpoints, ICommandHostMemory, ICommandHostBackgroundTasks, ICommandHostGoal, ICommandHostPlan, ICommandHostTerminalHandoff, ICommandHostAdapterAccess {}
3343
3504
  //#endregion
3344
3505
  //#region src/command-api/contracts.d.ts
3345
3506
  type TSystemCommandLifecycle = 'inline' | 'blocking' | 'background';
@@ -3468,6 +3629,8 @@ interface IMCPActivationAuditEvent {
3468
3629
  interface IMCPActivationApprovalStore {
3469
3630
  list(): readonly IMCPActivationApprovalRecord[];
3470
3631
  put(record: IMCPActivationApprovalRecord): void;
3632
+ /** Durable stores can commit a decision and its audit receipt in one transaction. */
3633
+ putWithAudit?(record: IMCPActivationApprovalRecord, event: IMCPActivationAuditEvent): void;
3471
3634
  listAudit(): readonly IMCPActivationAuditEvent[];
3472
3635
  appendAudit(event: IMCPActivationAuditEvent): void;
3473
3636
  }