dispach 0.2.0 → 0.2.2

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 (226) hide show
  1. package/README.md +144 -49
  2. package/dist/APEv2Parser-etzjd528.js +5 -0
  3. package/dist/{FlacParser-6jwner07.js.map → APEv2Parser-etzjd528.js.map} +1 -1
  4. package/dist/{AiffParser-n65syezh.js → AiffParser-y21k3fak.js} +3 -3
  5. package/dist/{AiffParser-n65syezh.js.map → AiffParser-y21k3fak.js.map} +1 -1
  6. package/dist/App-4w3qkcs4.js +11 -0
  7. package/dist/{App-pmqmzsb3.js.map → App-4w3qkcs4.js.map} +1 -1
  8. package/dist/{AsfParser-da1fqvxz.js → AsfParser-wd98k2h4.js} +3 -3
  9. package/dist/{AsfParser-da1fqvxz.js.map → AsfParser-wd98k2h4.js.map} +1 -1
  10. package/dist/{ConfigEditor-4nqbeejh.js → ConfigEditor-vk7vxaa6.js} +3 -3
  11. package/dist/{ConfigEditor-4nqbeejh.js.map → ConfigEditor-vk7vxaa6.js.map} +1 -1
  12. package/dist/{DsdiffParser-gk95sj7t.js → DsdiffParser-cbfaj500.js} +3 -3
  13. package/dist/{DsdiffParser-gk95sj7t.js.map → DsdiffParser-cbfaj500.js.map} +1 -1
  14. package/dist/{DsfParser-b0enevjw.js → DsfParser-tybrja4x.js} +3 -3
  15. package/dist/{DsfParser-b0enevjw.js.map → DsfParser-tybrja4x.js.map} +1 -1
  16. package/dist/FlacParser-7t7da7qy.js +5 -0
  17. package/dist/{APEv2Parser-jdp5yp24.js.map → FlacParser-7t7da7qy.js.map} +1 -1
  18. package/dist/{KeyProbe-rspsxpsr.js → KeyProbe-5anphmb7.js} +3 -3
  19. package/dist/{KeyProbe-rspsxpsr.js.map → KeyProbe-5anphmb7.js.map} +1 -1
  20. package/dist/{MP4Parser-ph7rv2fn.js → MP4Parser-gc94h1n9.js} +3 -3
  21. package/dist/{MP4Parser-ph7rv2fn.js.map → MP4Parser-gc94h1n9.js.map} +1 -1
  22. package/dist/{MatroskaParser-fjk1mpct.js → MatroskaParser-cy2k4fac.js} +3 -3
  23. package/dist/{MatroskaParser-fjk1mpct.js.map → MatroskaParser-cy2k4fac.js.map} +1 -1
  24. package/dist/{MpegParser-vp7cj8ts.js → MpegParser-c460fwf0.js} +3 -3
  25. package/dist/{MpegParser-vp7cj8ts.js.map → MpegParser-c460fwf0.js.map} +1 -1
  26. package/dist/{MusepackParser-v22gft1f.js → MusepackParser-8mq2eabg.js} +3 -3
  27. package/dist/{MusepackParser-v22gft1f.js.map → MusepackParser-8mq2eabg.js.map} +1 -1
  28. package/dist/OggParser-7dnc6apg.js +5 -0
  29. package/dist/{OggParser-as1m8xsa.js.map → OggParser-7dnc6apg.js.map} +1 -1
  30. package/dist/Picker-j7txnm7w.js +5 -0
  31. package/dist/{Picker-jkmd5xnx.js.map → Picker-j7txnm7w.js.map} +1 -1
  32. package/dist/SessionPicker-hpv2ncsb.js +5 -0
  33. package/dist/{SessionPicker-3712ke3k.js.map → SessionPicker-hpv2ncsb.js.map} +3 -3
  34. package/dist/SkillBrowser-qc542n71.js +5 -0
  35. package/dist/{SkillBrowser-qhsyszt4.js.map → SkillBrowser-qc542n71.js.map} +1 -1
  36. package/dist/{WavPackParser-b4qqavzg.js → WavPackParser-kt7cds9c.js} +3 -3
  37. package/dist/{WavPackParser-b4qqavzg.js.map → WavPackParser-kt7cds9c.js.map} +1 -1
  38. package/dist/{WaveParser-fqs1h38f.js → WaveParser-g47ja0vy.js} +3 -3
  39. package/dist/{WaveParser-fqs1h38f.js.map → WaveParser-g47ja0vy.js.map} +1 -1
  40. package/dist/WizardApp-q4p979d1.js +5 -0
  41. package/dist/{WizardApp-qrq36nv8.js.map → WizardApp-q4p979d1.js.map} +3 -3
  42. package/dist/{channels-gf31stv7.js → channels-4t89qpdt.js} +18 -18
  43. package/dist/{channels-gf31stv7.js.map → channels-4t89qpdt.js.map} +1 -1
  44. package/dist/client.d.ts +242 -1
  45. package/dist/client.js +11 -11
  46. package/dist/client.js.map +5 -5
  47. package/dist/config-35r6n1gh.js +24 -0
  48. package/dist/{config-z2cd0c5f.js.map → config-35r6n1gh.js.map} +1 -1
  49. package/dist/credential-dpdgg4j6.js +19 -0
  50. package/dist/{credential-h0wmsjsw.js.map → credential-dpdgg4j6.js.map} +1 -1
  51. package/dist/{index-3s2q0m64.js → index-0444sh6x.js} +4 -4
  52. package/dist/{index-3s2q0m64.js.map → index-0444sh6x.js.map} +1 -1
  53. package/dist/{index-v271gbaz.js → index-095hrkyr.js} +6 -6
  54. package/dist/{index-v271gbaz.js.map → index-095hrkyr.js.map} +1 -1
  55. package/dist/index-1x8mzvz7.js +6 -0
  56. package/dist/{index-rhv6gqpt.js.map → index-1x8mzvz7.js.map} +1 -1
  57. package/dist/index-2bsardvh.js +5 -0
  58. package/dist/{index-tny7c703.js.map → index-2bsardvh.js.map} +2 -2
  59. package/dist/{index-9m6b14b4.js → index-2zjh5zd5.js} +4 -4
  60. package/dist/{index-9m6b14b4.js.map → index-2zjh5zd5.js.map} +1 -1
  61. package/dist/{index-t6xnecdx.js → index-323jvr1g.js} +4 -4
  62. package/dist/{index-t6xnecdx.js.map → index-323jvr1g.js.map} +1 -1
  63. package/dist/{index-gace5ac7.js → index-3826kf9t.js} +5 -5
  64. package/dist/{index-gace5ac7.js.map → index-3826kf9t.js.map} +1 -1
  65. package/dist/index-38gs9anh.js +9 -0
  66. package/dist/{index-b7qc21s7.js.map → index-38gs9anh.js.map} +1 -1
  67. package/dist/index-3c5jt6by.js +5 -0
  68. package/dist/{index-3mvenfbg.js.map → index-3c5jt6by.js.map} +2 -2
  69. package/dist/{index-k2q76dhw.js → index-3vzf253k.js} +7 -7
  70. package/dist/{index-k2q76dhw.js.map → index-3vzf253k.js.map} +1 -1
  71. package/dist/{index-t5d8ey5t.js → index-42e29zs4.js} +4 -4
  72. package/dist/{index-t5d8ey5t.js.map → index-42e29zs4.js.map} +1 -1
  73. package/dist/{index-v7mz396x.js → index-4fj1k64j.js} +4 -4
  74. package/dist/{index-v7mz396x.js.map → index-4fj1k64j.js.map} +1 -1
  75. package/dist/{index-gqbny9gy.js → index-51x0n5z0.js} +6 -6
  76. package/dist/{index-gqbny9gy.js.map → index-51x0n5z0.js.map} +1 -1
  77. package/dist/index-664xcamy.js +110 -0
  78. package/dist/index-664xcamy.js.map +13 -0
  79. package/dist/index-7mn8ack9.js +6 -0
  80. package/dist/{index-qe3ybzh6.js.map → index-7mn8ack9.js.map} +2 -2
  81. package/dist/index-8edck2pr.js +6 -0
  82. package/dist/{index-kktaw552.js.map → index-8edck2pr.js.map} +1 -1
  83. package/dist/index-8h6kewy1.js +9 -0
  84. package/dist/{index-s4a28ctb.js.map → index-8h6kewy1.js.map} +1 -1
  85. package/dist/index-8tmv33mr.js +6 -0
  86. package/dist/{index-v6taf4vn.js.map → index-8tmv33mr.js.map} +1 -1
  87. package/dist/index-9914wh1d.js +6 -0
  88. package/dist/index-9914wh1d.js.map +10 -0
  89. package/dist/{index-y6r1k2yd.js → index-a2eh8dnk.js} +7 -7
  90. package/dist/{index-y6r1k2yd.js.map → index-a2eh8dnk.js.map} +1 -1
  91. package/dist/{index-81vj1bxe.js → index-bqdkm3de.js} +4 -4
  92. package/dist/{index-81vj1bxe.js.map → index-bqdkm3de.js.map} +1 -1
  93. package/dist/{index-rfa0ztab.js → index-dzy19wtf.js} +4 -4
  94. package/dist/{index-rfa0ztab.js.map → index-dzy19wtf.js.map} +1 -1
  95. package/dist/{index-c2qjdz4q.js → index-eqqd4k4f.js} +9 -9
  96. package/dist/{index-c2qjdz4q.js.map → index-eqqd4k4f.js.map} +1 -1
  97. package/dist/{index-g1d06ct5.js → index-ew997be5.js} +7 -7
  98. package/dist/{index-g1d06ct5.js.map → index-ew997be5.js.map} +1 -1
  99. package/dist/{index-0v2gw4mk.js → index-fa9wvpyw.js} +3 -3
  100. package/dist/{index-0v2gw4mk.js.map → index-fa9wvpyw.js.map} +1 -1
  101. package/dist/{index-rvq7t636.js → index-fbsrhcga.js} +4 -4
  102. package/dist/{index-rvq7t636.js.map → index-fbsrhcga.js.map} +1 -1
  103. package/dist/index-fcsg95m5.js +11 -0
  104. package/dist/{index-5nprb9px.js.map → index-fcsg95m5.js.map} +1 -1
  105. package/dist/{index-dgrwpzz9.js → index-gbkma7ds.js} +4 -4
  106. package/dist/{index-dgrwpzz9.js.map → index-gbkma7ds.js.map} +1 -1
  107. package/dist/{index-0m0x1454.js → index-gq1npngp.js} +4 -4
  108. package/dist/{index-0m0x1454.js.map → index-gq1npngp.js.map} +1 -1
  109. package/dist/index-haypwvzd.js +308 -0
  110. package/dist/index-haypwvzd.js.map +21 -0
  111. package/dist/{index-g8n8rhtr.js → index-jc4kmfwa.js} +4 -4
  112. package/dist/{index-g8n8rhtr.js.map → index-jc4kmfwa.js.map} +1 -1
  113. package/dist/index-kjqksgch.js +429 -0
  114. package/dist/index-kjqksgch.js.map +12 -0
  115. package/dist/{index-es4bgkbh.js → index-m6fqx0ch.js} +7 -7
  116. package/dist/{index-es4bgkbh.js.map → index-m6fqx0ch.js.map} +1 -1
  117. package/dist/{index-60jxyzbe.js → index-ma6p7bt4.js} +4 -4
  118. package/dist/{index-60jxyzbe.js.map → index-ma6p7bt4.js.map} +1 -1
  119. package/dist/index-nvc24414.js +6 -0
  120. package/dist/{index-2yj11ykt.js.map → index-nvc24414.js.map} +1 -1
  121. package/dist/index-nxhqf597.js +6 -0
  122. package/dist/{index-m5rmhcez.js.map → index-nxhqf597.js.map} +1 -1
  123. package/dist/{index-jmnjcw61.js → index-p1zy871m.js} +4 -4
  124. package/dist/{index-jmnjcw61.js.map → index-p1zy871m.js.map} +1 -1
  125. package/dist/{index-2pzgta33.js → index-p6ya59m6.js} +5 -5
  126. package/dist/{index-2pzgta33.js.map → index-p6ya59m6.js.map} +1 -1
  127. package/dist/{index-6c4p19m1.js → index-pszmnhgq.js} +2 -2
  128. package/dist/index-qg9bn980.js +1213 -0
  129. package/dist/{index-1h9pqnec.js.map → index-qg9bn980.js.map} +28 -25
  130. package/dist/index-qgsdgbk8.js +5 -0
  131. package/dist/{index-ak304afj.js.map → index-qgsdgbk8.js.map} +2 -2
  132. package/dist/index-r4ax3x4d.js +74 -0
  133. package/dist/index-r4ax3x4d.js.map +13 -0
  134. package/dist/{index-m01mb74d.js → index-snz49ndn.js} +4 -4
  135. package/dist/{index-m01mb74d.js.map → index-snz49ndn.js.map} +1 -1
  136. package/dist/index-twn9bfm2.js +8 -0
  137. package/dist/{index-dwxmy0kx.js.map → index-twn9bfm2.js.map} +2 -2
  138. package/dist/{index-0p9p6fvc.js → index-wc4entme.js} +10 -10
  139. package/dist/{index-0p9p6fvc.js.map → index-wc4entme.js.map} +3 -3
  140. package/dist/{index-wxmqyv4c.js → index-ynsvkqgb.js} +4 -4
  141. package/dist/{index-wxmqyv4c.js.map → index-ynsvkqgb.js.map} +1 -1
  142. package/dist/index-ytxbw8py.js +63 -0
  143. package/dist/{index-fcqy46mh.js.map → index-ytxbw8py.js.map} +2 -2
  144. package/dist/index-yw3fby4n.js +6 -0
  145. package/dist/{index-dh2g58s1.js.map → index-yw3fby4n.js.map} +2 -2
  146. package/dist/{index-ccpq4k6r.js → index-z157at3s.js} +28 -28
  147. package/dist/{index-ccpq4k6r.js.map → index-z157at3s.js.map} +1 -1
  148. package/dist/{index-s78sq9g1.js → index-zce9gy22.js} +64 -64
  149. package/dist/{index-s78sq9g1.js.map → index-zce9gy22.js.map} +1 -1
  150. package/dist/{index-jv7egrh2.js → index-zw6wyas6.js} +4 -4
  151. package/dist/{index-jv7egrh2.js.map → index-zw6wyas6.js.map} +1 -1
  152. package/dist/index.js +308 -292
  153. package/dist/index.js.map +15 -12
  154. package/dist/init.d.ts.map +1 -1
  155. package/dist/lib/agent-template.d.ts +5 -0
  156. package/dist/lib/agent-template.d.ts.map +1 -1
  157. package/dist/lib/commands.d.ts.map +1 -1
  158. package/dist/lib/init-flow.d.ts +7 -30
  159. package/dist/lib/init-flow.d.ts.map +1 -1
  160. package/dist/lib/owner.d.ts +49 -0
  161. package/dist/lib/owner.d.ts.map +1 -0
  162. package/dist/lib/presets.d.ts +44 -0
  163. package/dist/lib/presets.d.ts.map +1 -0
  164. package/dist/lib/provision.d.ts +8 -1
  165. package/dist/lib/provision.d.ts.map +1 -1
  166. package/dist/lib/relay-client.d.ts +17 -0
  167. package/dist/lib/relay-client.d.ts.map +1 -0
  168. package/dist/lib/schema.d.ts +2 -0
  169. package/dist/lib/schema.d.ts.map +1 -1
  170. package/dist/lib/sessions-view.d.ts +2 -0
  171. package/dist/lib/sessions-view.d.ts.map +1 -1
  172. package/dist/lib/source.d.ts +17 -0
  173. package/dist/lib/source.d.ts.map +1 -1
  174. package/dist/lib/wizard.d.ts.map +1 -1
  175. package/dist/owner.d.ts +16 -0
  176. package/dist/owner.d.ts.map +1 -0
  177. package/dist/run.d.ts.map +1 -1
  178. package/dist/serve.d.ts.map +1 -1
  179. package/dist/transcript.d.ts.map +1 -1
  180. package/dist/web-zph4h3p9.js +14 -0
  181. package/dist/{web-stkkwyka.js.map → web-zph4h3p9.js.map} +1 -1
  182. package/dist/wire.d.ts +31 -0
  183. package/dist/wire.js +2 -2
  184. package/dist/wire.js.map +4 -4
  185. package/dist/wrapper-f662ny3r.js +5 -0
  186. package/dist/{wrapper-bwxbqa53.js.map → wrapper-f662ny3r.js.map} +1 -1
  187. package/package.json +5 -2
  188. package/dist/APEv2Parser-jdp5yp24.js +0 -5
  189. package/dist/App-pmqmzsb3.js +0 -11
  190. package/dist/FlacParser-6jwner07.js +0 -5
  191. package/dist/OggParser-as1m8xsa.js +0 -5
  192. package/dist/Picker-jkmd5xnx.js +0 -5
  193. package/dist/SessionPicker-3712ke3k.js +0 -5
  194. package/dist/SkillBrowser-qhsyszt4.js +0 -5
  195. package/dist/WizardApp-qrq36nv8.js +0 -5
  196. package/dist/config-z2cd0c5f.js +0 -24
  197. package/dist/credential-h0wmsjsw.js +0 -19
  198. package/dist/index-026q0y3a.js +0 -6
  199. package/dist/index-026q0y3a.js.map +0 -10
  200. package/dist/index-1h9pqnec.js +0 -1194
  201. package/dist/index-1wxw30j1.js +0 -74
  202. package/dist/index-1wxw30j1.js.map +0 -13
  203. package/dist/index-2yj11ykt.js +0 -6
  204. package/dist/index-358nsn9t.js +0 -65
  205. package/dist/index-358nsn9t.js.map +0 -21
  206. package/dist/index-3mvenfbg.js +0 -5
  207. package/dist/index-5nprb9px.js +0 -11
  208. package/dist/index-ak304afj.js +0 -5
  209. package/dist/index-b7qc21s7.js +0 -9
  210. package/dist/index-dh2g58s1.js +0 -6
  211. package/dist/index-dwxmy0kx.js +0 -8
  212. package/dist/index-fcqy46mh.js +0 -63
  213. package/dist/index-kktaw552.js +0 -6
  214. package/dist/index-m5rmhcez.js +0 -6
  215. package/dist/index-qe3ybzh6.js +0 -6
  216. package/dist/index-rhv6gqpt.js +0 -6
  217. package/dist/index-s4a28ctb.js +0 -9
  218. package/dist/index-tny7c703.js +0 -5
  219. package/dist/index-v6taf4vn.js +0 -6
  220. package/dist/index-y605a1rj.js +0 -429
  221. package/dist/index-y605a1rj.js.map +0 -11
  222. package/dist/index-z88f35vs.js +0 -96
  223. package/dist/index-z88f35vs.js.map +0 -13
  224. package/dist/web-stkkwyka.js +0 -14
  225. package/dist/wrapper-bwxbqa53.js +0 -5
  226. /package/dist/{index-6c4p19m1.js.map → index-pszmnhgq.js.map} +0 -0
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{t,F,V,Z,ne,k}from"./index-qg9bn980.js";import{q,G,fn,Zt,Ae}from"./index-twn9bfm2.js";import{dirname as l}from"node:path";async function gs(e,o,n){let r=[];if(e.length===0)for(let i of Ae(o)){if(i.problem!==void 0||i.id===void 0)continue;r.push({agentId:i.id,manifestPath:i.manifestPath})}else for(let i of e){let s=F(i);r.push({agentId:s.id??"",manifestPath:i})}let a=await f(async(i)=>new Map((await i.agentState.list()).filter((s)=>!s.enabled).map((s)=>[s.agentId,s.reason])),n);return r.map((i)=>{let s=a?.get(i.agentId),d=a?.has(i.agentId)===!0;return{...i,enabled:!d,...s===void 0?{}:{reason:s}}})}async function f(e,o){let n;try{return n=await ne.open({path:o??G()}),await e(n)}catch{return}finally{await n?.close()}}async function rr(e,o,n,r){await f(async(a)=>{if(o)await a.agentState.enable(e);else await a.agentState.disable(e,new Date().toISOString(),n===void 0?void 0:n)},r)}async function ir(e,o){return await f(async(n)=>{let r=await n.agentState.get(e);if(r===void 0)return{enabled:!0};return{enabled:r.enabled,...r.reason===void 0?{}:{reason:r.reason}}},o)}async function qe(e,o){return await f(async(n)=>{let r=await n.leases.get(e);if(r===void 0)return;if(r.pid===process.pid||!Z(r.pid))return;return r},o)}async function Ve(e){return[...(await xt(e)).filter((n)=>n.baseUrl!==void 0)].sort((n,r)=>n.agentId.localeCompare(r.agentId))[0]}var Ut="~host";async function cs(e,o){let n={agentId:Ut,pid:process.pid,now:new Date().toISOString(),...o},r=await e.claim(n);if(r.ok)return!0;if(r.held.pid!==process.pid&&Z(r.held.pid))return!1;return(await e.claim({...n,stealFrom:r.held.runtimeId})).ok}async function xt(e){return await f(async(o)=>(await o.leases.all()).filter((n)=>n.pid!==process.pid&&Z(n.pid)),e)??[]}function me(e){return e===void 0||e===""?"":F(e).id??""}function RA(e){let o=k([e]),n=process.env[`${t.envPrefix}API_TOKEN`],r=e!==""&&Zt(l(e),o)?fn(q(o)):void 0;try{let a=V(e,{env:o}),i=a.manifest.server.tokenEnv,s=o[i];if(s!==void 0&&s!=="")return s;if(r!==void 0)return r;let d=a.env[i];return d===void 0||d===""?n:d}catch{return r??(n===""?void 0:n)}}async function ut(e,o,n,r){let a=e.baseUrl;if(a===void 0)return{ok:!1,status:0,detail:"this host serves no HTTP"};let i=r===void 0?void 0:RA(r);try{let s=await fetch(`${a}${o}`,{method:"POST",headers:{"content-type":"application/json",...i===void 0?{}:{authorization:`Bearer ${i}`}},body:JSON.stringify(n),signal:AbortSignal.timeout(c)});if(s.ok){let u=await s.json().catch(()=>{return});return{ok:!0,status:s.status,...u===void 0?{}:{body:u}}}let d=await s.json().catch(()=>{return});return{ok:!1,status:s.status,...d?.error?.message===void 0?{}:{detail:d.error.message},...d?.error?.hint===void 0?{}:{hint:d.error.hint}}}catch(s){return{ok:!1,status:0,detail:s instanceof Error?s.message:String(s)}}}async function ln(e,o,n,r){let a=e.baseUrl;if(a===void 0)return{ok:!1,status:0,detail:"this host serves no HTTP"};let i=r===void 0?void 0:RA(r);try{let s=await fetch(`${a}${n}`,{method:o,headers:i===void 0?{}:{authorization:`Bearer ${i}`},signal:AbortSignal.timeout(c)}),d=await s.json().catch(()=>{return});if(s.ok)return{ok:!0,status:s.status,...d===void 0?{}:{body:d}};let u=d;return{ok:!1,status:s.status,...u?.error?.message===void 0?{}:{detail:u.error.message},...u?.error?.hint===void 0?{}:{hint:u.error.hint}}}catch(s){return{ok:!1,status:0,detail:s instanceof Error?s.message:String(s)}}}var c=1e4;function eo(e,o){for(let n of Ae(o))if(n.id===e)return n.manifestPath;return}
3
+ export{gs,rr,ir,qe,Ve,Ut,cs,xt,me,RA,ut,ln,eo};
4
+
5
+ //# debugId=2F0F611CF26079E064756E2164756E21
6
+ //# sourceMappingURL=index-7mn8ack9.js.map
@@ -4,7 +4,7 @@
4
4
  "sourcesContent": [
5
5
  "/**\n * Reaching a running host, and reading the durable on/off switch.\n *\n * Shared by `serve`, `stop` and `start`, because all three ask the same two questions and a second\n * answer to either is a disagreement waiting to happen: *which agents is this sandbox supposed to\n * run*, and *where is the process already running them*.\n *\n * **Why an HTTP request rather than a signal.** Since one process hosts several agents, stopping\n * one by signalling the lease holder takes every other agent in that process down with it. A signal\n * also cannot name an agent. So `stop` posts to the host, which disposes exactly one — and the\n * address comes off the lease row rather than from a manifest, because `--port` overrides the file,\n * `--port 0` picks one at random and a container republishes it. Guessing 7420 is how a second host\n * on 7421 becomes invisible to the one command that must never miss it.\n *\n * **The fallback is the old behaviour, not an error.** A lease with no address is a `run` REPL or an\n * embedded runtime — real states, serving no HTTP — and those are still stopped by signalling the\n * process, which is what `stop` did for every lease before any of this existed.\n */\n\nimport { dirname } from \"node:path\"\nimport {\n BRAND,\n type LeaseRecord,\n type LeaseStore,\n loadManifest,\n processAlive,\n readManifestHeader,\n SqliteStore,\n} from \"@dispach/core\"\nimport { ambientEnv } from \"#lib/ambient\"\nimport { agentsDir, insideSandbox, listAgents, readHostToken, storePath } from \"#lib/sandbox\"\n\n/** An agent the sandbox holds, with the durable switch resolved. */\nexport interface HostableAgent {\n readonly agentId: string\n readonly manifestPath: string\n readonly enabled: boolean\n /** Why it was switched off, when somebody said. */\n readonly reason?: string\n}\n\n/**\n * The manifests a bare `serve` should host, and the ones it should not.\n *\n * A listing rather than a filter, because the caller has to *report* what it is skipping: an agent\n * missing from a banner with no line explaining it is the \"I set this up and it is not running\"\n * failure the switch exists to make explicable.\n *\n * Broken entries are dropped here rather than surfaced, and that is the one thing this hides: a\n * directory whose header will not parse has no id, so there is nothing to look the state up by and\n * nothing to serve. the agents listing is what shows those, and it shows them already.\n */\nexport async function hostableAgents(\n paths: readonly string[],\n env: Readonly<Record<string, string | undefined>>,\n store?: string,\n): Promise<readonly HostableAgent[]> {\n const found: { agentId: string; manifestPath: string }[] = []\n\n if (paths.length === 0) {\n // The bare form: whatever the sandbox holds. This is what the service unit runs, and it is\n // why `agent_state` exists — \"every agent here\" needs an answer to \"except which\".\n for (const agent of listAgents(env)) {\n if (agent.problem !== undefined || agent.id === undefined) continue\n found.push({ agentId: agent.id, manifestPath: agent.manifestPath })\n }\n } else {\n for (const manifestPath of paths) {\n // The header, not a full load: reading a manifest to learn its id must not depend on\n // the agent's credentials being present, which is the whole reason\n // `readManifestHeader` exists and why the picker is built on it.\n const header = readManifestHeader(manifestPath)\n found.push({ agentId: header.id ?? \"\", manifestPath })\n }\n }\n\n const disabled = await withStore(\n async (db) =>\n new Map(\n (await db.agentState.list())\n .filter((row) => !row.enabled)\n .map((row) => [row.agentId, row.reason]),\n ),\n store,\n )\n\n return found.map((entry) => {\n const reason = disabled?.get(entry.agentId)\n const off = disabled?.has(entry.agentId) === true\n return {\n ...entry,\n enabled: !off,\n ...(reason === undefined ? {} : { reason }),\n }\n })\n}\n\n/**\n * Open the store, ask one question, close it.\n *\n * Deliberately a second, short-lived connection rather than the one `Runtime.create` opens: the\n * answer is needed *before* the runtime exists, because it decides which agents the runtime is\n * asked for. Handing the runtime a caller-owned store would work and would move shutdown ownership\n * into the command, which is a larger change than one sequential read deserves — the migrations are\n * already applied, so this costs a couple of milliseconds.\n *\n * `undefined` on any failure, and the callers treat that as \"nothing is disabled\". A missing store\n * is the ordinary first-run state, and a `serve` that refused to start because it could not read an\n * on/off table would be a worse failure than the one it was guarding against.\n *\n * **The path is threaded rather than defaulted at each call site**, because `serve` honours\n * `--store` and these helpers did not — so a host serving out of one database would have read its\n * on/off switch from another. Invisible in normal use, where both resolve to the sandbox, and\n * wrong in exactly the configuration the tests use.\n */\nasync function withStore<T>(\n work: (store: SqliteStore) => Promise<T>,\n path?: string,\n): Promise<T | undefined> {\n let store: SqliteStore | undefined\n try {\n store = await SqliteStore.open({ path: path ?? storePath() })\n return await work(store)\n } catch {\n return undefined\n } finally {\n await store?.close()\n }\n}\n\n/** The durable switch, written from a command rather than through a host. */\nexport async function writeAgentState(\n agentId: string,\n enabled: boolean,\n reason?: string,\n store?: string,\n): Promise<void> {\n await withStore(async (db) => {\n if (enabled) await db.agentState.enable(agentId)\n else\n await db.agentState.disable(\n agentId,\n new Date().toISOString(),\n reason === undefined ? undefined : reason,\n )\n }, store)\n}\n\n/** Whether this agent is switched off, and why. */\nexport async function agentStateOf(\n agentId: string,\n store?: string,\n): Promise<{ enabled: boolean; reason?: string } | undefined> {\n return await withStore(async (db) => {\n const row = await db.agentState.get(agentId)\n if (row === undefined) return { enabled: true }\n return { enabled: row.enabled, ...(row.reason === undefined ? {} : { reason: row.reason }) }\n }, store)\n}\n\n/**\n * The live process serving this agent, if there is one.\n *\n * Liveness is re-checked here rather than trusted from the row, for the recorded reason: a boot\n * that fails *after* claiming leaves a lease seconds old with no process under it, and anything\n * reading a lease to decide what to do has to probe rather than believe the heartbeat.\n */\nexport async function liveHostOf(\n agentId: string,\n store?: string,\n): Promise<LeaseRecord | undefined> {\n return await withStore(async (db) => {\n const lease = await db.leases.get(agentId)\n if (lease === undefined) return undefined\n if (lease.pid === process.pid || !processAlive(lease.pid)) return undefined\n return lease\n }, store)\n}\n\n/**\n * Any live host with an HTTP address, for `start`.\n *\n * **Not `liveHostOf(agentId)`, and that is the whole reason this exists.** A stopped agent has no\n * lease — `dispose` released it — so looking for \"the host holding this agent\" finds nothing and\n * `start` would report that nothing was running while a host sat there ready to adopt it. Found by\n * running the pair in order rather than by reading either one.\n *\n * With several hosts this asks the first by agent id. Nondeterministic and harmless: any host can\n * serve any agent in the sandbox, and one that cannot look the manifest up answers `501` rather\n * than failing quietly.\n */\nexport async function anyLiveHost(store?: string): Promise<LeaseRecord | undefined> {\n const hosts = (await liveHosts(store)).filter((lease) => lease.baseUrl !== undefined)\n return [...hosts].sort((a, b) => a.agentId.localeCompare(b.agentId))[0]\n}\n\n/** Every live lease, for the commands that report on the whole sandbox. */\n/**\n * The lease a host holds while it serves no agent (QA 0.2.0).\n *\n * Every command finds a host through the lease table, and a lease was only ever an agent's — so a\n * `serve` hosting nothing was up, bound and invisible: `status` said nothing was running and `init`\n * went looking for a host to start. `~` because no agent id may begin with one, so this can never\n * be mistaken for an agent's row.\n */\nexport const HOST_LEASE = \"~host\"\n\n/** Take `HOST_LEASE`, over a row whose process is gone. False when another live host holds it. */\nexport async function claimHostLease(\n leases: LeaseStore,\n input: { readonly runtimeId: string; readonly mode: LeaseRecord[\"mode\"] },\n): Promise<boolean> {\n const claim = { agentId: HOST_LEASE, pid: process.pid, now: new Date().toISOString(), ...input }\n const first = await leases.claim(claim)\n if (first.ok) return true\n // Our own pid on somebody else's row is a container's previous life: every runtime is pid 1.\n if (first.held.pid !== process.pid && processAlive(first.held.pid)) return false\n return (await leases.claim({ ...claim, stealFrom: first.held.runtimeId })).ok\n}\n\nexport async function liveHosts(store?: string): Promise<readonly LeaseRecord[]> {\n return (\n (await withStore(\n async (db) =>\n (\n await db.leases.all()\n ).filter((lease) => lease.pid !== process.pid && processAlive(lease.pid)),\n store,\n )) ?? []\n )\n}\n\n/**\n * The agent id a manifest declares, without loading it.\n *\n * `readManifestHeader` rather than `loadManifest` for the reason `lib/sandbox.ts` already records:\n * loading checks that the key variables are set, so a *lookup* built on it fails exactly when the\n * agent is misconfigured — which is when you most need to name it. Here that would mean `run` and\n * `web` refusing to find a host for an agent whose `.env` is incomplete.\n */\nexport function agentIdFor(manifestPath: string | undefined): string {\n return manifestPath === undefined || manifestPath === \"\"\n ? \"\"\n : (readManifestHeader(manifestPath).id ?? \"\")\n}\n\n/**\n * The credential a running host will want, best effort: an export first, then — for a sandbox\n * agent — the sandbox's own (`readHostToken`, the one `serve` uses there), then the agent's `.env`.\n *\n * When the load fails it falls back to the process environment under the brand's default variable,\n * because the common reason for a failed load is a missing *model* key and refusing to stop an\n * agent over that would be absurd. A wrong or absent token is not silent: the request comes back\n * `401` and the caller says which variable to set.\n */\nexport function hostToken(manifestPath: string): string | undefined {\n const env = ambientEnv([manifestPath])\n const fallback = process.env[`${BRAND.envPrefix}API_TOKEN`]\n const shared =\n manifestPath !== \"\" && insideSandbox(dirname(manifestPath), env)\n ? readHostToken(agentsDir(env))\n : undefined\n try {\n const loaded = loadManifest(manifestPath, { env })\n const tokenEnv = loaded.manifest.server.tokenEnv\n const exported = env[tokenEnv]\n if (exported !== undefined && exported !== \"\") return exported\n if (shared !== undefined) return shared\n const configured = loaded.env[tokenEnv]\n return configured === undefined || configured === \"\" ? fallback : configured\n } catch {\n return shared ?? (fallback === \"\" ? undefined : fallback)\n }\n}\n\nexport interface HostReply {\n readonly ok: boolean\n readonly status: number\n /** The server's own `error.message`, when it sent one. */\n readonly detail?: string\n /**\n * The parsed success body, for the callers that need one.\n *\n * `stop` and `start` only ever asked whether it worked, so this was discarded. Minting a\n * credential is the first caller that needs what came back — the secret is printed **once** and\n * exists nowhere else, so throwing the body away would make the command useless.\n */\n readonly body?: unknown\n /** The server's `error.hint`, which is the half a person acts on. */\n readonly hint?: string\n}\n\n/**\n * POST to a running host, with a bounded wait.\n *\n * Bounded because the alternative is a stop command that hangs on a wedged host, and the whole\n * brief for `stop` is that a person reaching for it is not in a position to go investigating. A\n * timeout falls through to the process-level stop, which is the thing that works on a host that has\n * stopped answering.\n */\nexport async function postToHost(\n lease: LeaseRecord,\n path: string,\n body: Readonly<Record<string, unknown>>,\n manifestPath?: string,\n): Promise<HostReply> {\n const base = lease.baseUrl\n if (base === undefined) return { ok: false, status: 0, detail: \"this host serves no HTTP\" }\n const token = manifestPath === undefined ? undefined : hostToken(manifestPath)\n\n try {\n const response = await fetch(`${base}${path}`, {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n ...(token === undefined ? {} : { authorization: `Bearer ${token}` }),\n },\n body: JSON.stringify(body),\n signal: AbortSignal.timeout(HOST_TIMEOUT_MS),\n })\n if (response.ok) {\n const body: unknown = await response.json().catch(() => undefined)\n return {\n ok: true,\n status: response.status,\n ...(body === undefined ? {} : { body }),\n }\n }\n const parsed = (await response.json().catch(() => undefined)) as\n | { error?: { message?: string; hint?: string } }\n | undefined\n return {\n ok: false,\n status: response.status,\n ...(parsed?.error?.message === undefined ? {} : { detail: parsed.error.message }),\n ...(parsed?.error?.hint === undefined ? {} : { hint: parsed.error.hint }),\n }\n } catch (error) {\n return {\n ok: false,\n status: 0,\n detail: error instanceof Error ? error.message : String(error),\n }\n }\n}\n\n/**\n * Any method against a running host, with the same bound and the same error shape.\n *\n * `postToHost` is this with `POST` and a body; both exist because a `GET` with a `content-type` and\n * an empty body is a request some proxies mangle, and because the one-method version read better at\n * the four call sites that had it. This is what `credential list` and `credential revoke` need.\n */\nexport async function callHost(\n lease: LeaseRecord,\n method: string,\n path: string,\n manifestPath?: string,\n): Promise<HostReply> {\n const base = lease.baseUrl\n if (base === undefined) return { ok: false, status: 0, detail: \"this host serves no HTTP\" }\n const token = manifestPath === undefined ? undefined : hostToken(manifestPath)\n try {\n const response = await fetch(`${base}${path}`, {\n method,\n headers: token === undefined ? {} : { authorization: `Bearer ${token}` },\n signal: AbortSignal.timeout(HOST_TIMEOUT_MS),\n })\n const body: unknown = await response.json().catch(() => undefined)\n if (response.ok) {\n return { ok: true, status: response.status, ...(body === undefined ? {} : { body }) }\n }\n const parsed = body as { error?: { message?: string; hint?: string } } | undefined\n return {\n ok: false,\n status: response.status,\n ...(parsed?.error?.message === undefined ? {} : { detail: parsed.error.message }),\n ...(parsed?.error?.hint === undefined ? {} : { hint: parsed.error.hint }),\n }\n } catch (error) {\n return {\n ok: false,\n status: 0,\n detail: error instanceof Error ? error.message : String(error),\n }\n }\n}\n\n/** Long enough for a dispose that waits on a channel to stop, short enough not to read as a hang. */\nconst HOST_TIMEOUT_MS = 10_000\n\n/** The sandbox manifest declaring this id, for the host's `resolveAgent` lookup. */\nexport function manifestForId(\n agentId: string,\n env?: Readonly<Record<string, string | undefined>>,\n): string | undefined {\n for (const agent of listAgents(env)) {\n if (agent.id === agentId) return agent.manifestPath\n }\n return undefined\n}\n\n/** The directory an agent's manifest sits in, for messages that name a `.env`. */\nexport function agentDirOf(manifestPath: string): string {\n return dirname(manifestPath)\n}\n"
6
6
  ],
7
- "mappings": ";6FAmBA,kBAAS,kBAiCF,eAAe,EAAc,CAChC,EACA,EACA,EACiC,CACjC,IAAM,EAAqD,CAAC,EAE5D,GAAI,EAAM,SAAW,EAGjB,QAAW,KAAS,GAAW,CAAG,EAAG,CACjC,GAAI,EAAM,UAAY,QAAa,EAAM,KAAO,OAAW,SAC3D,EAAM,KAAK,CAAE,QAAS,EAAM,GAAI,aAAc,EAAM,YAAa,CAAC,EAExE,KACE,QAAW,KAAgB,EAAO,CAI9B,IAAM,EAAS,EAAmB,CAAY,EAC9C,EAAM,KAAK,CAAE,QAAS,EAAO,IAAM,GAAI,cA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ClB,QAAW,KAAS,GAAW,CAAG,EAC9B,GAAI,EAAM,KAAO,EAAS,OAAO,EAAM,aAE3C",
8
+ "debugId": "2F0F611CF26079E064756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{i,b}from"./index-dzy19wtf.js";import{vn}from"./index-3826kf9t.js";import{Box as f,Text as n}from"ink";import{jsx as d,jsxs as l}from"react/jsx-runtime";function Tn({label:u,editor:p,placeholder:e,error:r,secret:a,columns:o,maxRows:t}){return l(f,{flexDirection:"column",children:[d(n,{children:u}),d(vn,{editor:p,gutter:b.prompt,...e===void 0?{}:{placeholder:e},...a===!0?{secret:!0}:{},...o===void 0?{}:{columns:o},...t===void 0?{}:{maxRows:t}}),r===void 0?null:l(n,{color:i.error,children:[b.error,r]})]})}
3
+ export{Tn};
4
+
5
+ //# debugId=807F1ECCA8E3832564756E2164756E21
6
+ //# sourceMappingURL=index-8edck2pr.js.map
@@ -5,6 +5,6 @@
5
5
  "/**\n * A labelled text input for wizard questions: label, caret, LineCursor, optional error line.\n *\n * The editing itself lives upstream — the screen root routes keys through `keyToIntent` into\n * `applyIntent` and hands the resulting `EditorState` down — so every editing nicety the chat\n * input has (^A/^E, ^W, code-point cursor) works here without a second implementation.\n */\n\nimport { Box, Text } from \"ink\"\nimport { LineCursor } from \"#components/LineCursor\"\nimport { GLYPH, THEME } from \"#lib/theme\"\nimport type { EditorState } from \"#lib/types\"\n\nexport interface TextFieldProps {\n readonly label: string\n readonly editor: EditorState\n /** The question's default, shown dim when the buffer is empty; enter accepts it. */\n readonly placeholder?: string\n /** A validation failure, rendered beneath in the error colour. Cleared upstream on edit. */\n readonly error?: string\n /** Mask the value as it is typed. Passed straight through to the cursor. */\n readonly secret?: boolean\n /**\n * Columns available for the value. **Not optional in practice.**\n *\n * `LineCursor`'s own docstring says it: omitted, nothing wraps and a line wider than whatever draws\n * this is truncated by Ink at a width nobody chose. This component never passed it, and in the\n * settings editor — which draws the field into an unbordered column — a value longer than the\n * terminal was clipped at the right edge with the caret *past* the clip. You could not see what you\n * were typing, and `tools.pinned` is 92 characters in a generated manifest, so it was the first long\n * value anybody opened.\n *\n * **The wizard was not affected, and checking that mattered**: its bordered frame gives the `<Text>`\n * a bounded width, so Ink wrapped it anyway. Measured, after the assumption that it must be broken\n * too — the guard that would have \"proved\" it passed with the fix reverted. It is passed there now\n * regardless, because whoever owns a bounded window should wrap the text itself rather than leave it\n * to whatever happens to enclose it, and because `maxRows` genuinely bounds the height.\n */\n readonly columns?: number\n /** Rows the value may take before the view scrolls to follow the cursor. */\n readonly maxRows?: number\n}\n\nexport function TextField({\n label,\n editor,\n placeholder,\n error,\n secret,\n columns,\n maxRows,\n}: TextFieldProps) {\n return (\n <Box flexDirection=\"column\">\n <Text>{label}</Text>\n {/*\n * The prompt glyph is the cursor's `gutter` rather than a sibling `<Text>`. Two reasons, and\n * the second is not optional: it keeps a wrapped or multi-line value in one column, and\n * `LineCursor` renders a `<Box>`, which inside a `<Text>` produces an empty frame — no error,\n * nothing on screen. A frame test caught that; nothing else would have.\n */}\n <LineCursor\n editor={editor}\n gutter={GLYPH.prompt}\n {...(placeholder === undefined ? {} : { placeholder })}\n {...(secret === true ? { secret: true } : {})}\n {...(columns === undefined ? {} : { columns })}\n {...(maxRows === undefined ? {} : { maxRows })}\n />\n {error === undefined ? null : (\n <Text color={THEME.error}>\n {GLYPH.error}\n {error}\n </Text>\n )}\n </Box>\n )\n}\n"
6
6
  ],
7
7
  "mappings": ";yEAQA,cAAS,UAAK,8DAmCP,SAAS,EAAS,EACrB,QACA,SACA,cACA,QACA,SACA,UACA,WACe,CACf,OACI,EAAC,EAAD,CAAK,cAAc,SAAnB,SAsBE,CArBE,EAAC,EAAD,UAAO,EAAQ,EAOf,EAAC,GAAD,CACI,OAAQ,EACR,OAAQ,EAAM,UACT,IAAgB,OAAY,CAAC,EAAI,CAAE,aAAY,KAC/C,IAAW,GAAO,CAAE,OAAQ,EAAK,EAAI,CAAC,KACtC,IAAY,OAAY,CAAC,EAAI,CAAE,SAAQ,KACvC,IAAY,OAAY,CAAC,EAAI,CAAE,SAAQ,EAChD,EACC,IAAU,OAAY,KACnB,EAAC,EAAD,CAAM,MAAO,EAAM,MAAnB,SAGE,CAFG,EAAM,MACN,GACH,GAER",
8
- "debugId": "6F15C5BD5EA1B14064756E2164756E21",
8
+ "debugId": "807F1ECCA8E3832564756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import{A,Ne,lA,IA}from"./index-qg9bn980.js";import{Gt,on}from"./index-gq1npngp.js";import{$n,Xn,Je}from"./index-fcsg95m5.js";import{u,v,Q,y}from"./index-3vzf253k.js";import{readFileSync as c}from"node:fs";function WA(n){if(n===void 0||n===null)return"(not set)";if(typeof n==="string")return n===""?'""':n;if(typeof n==="boolean"||typeof n==="number")return String(n);return JSON.stringify(n)}function h(n){return n.split(/[.[]/)[0]??n}function Li(n,e){let t=[`${e}`,""],i=new Map;for(let r of n){let a=h(r.setting.path);i.set(a,[...i.get(a)??[],r])}let o=!0;for(let[r,a]of i){t.push(v(r,o)),o=!1;for(let s of a){let l=s.setting.agentListed?"":" · yours only",g=s.setting.via===void 0?"":` · set with \`${s.setting.via}\``,p=s.setting.confirm===void 0?"":" · asks first";t.push(u([{label:s.setting.path,value:WA(s.value)}]),y(`${s.setting.means}${l}${g}${p}`,4))}}return t.push("","A change takes effect the next time the agent starts. `yours only` marks a field the agent is","refused: what it may do is its to ask for, where it writes and who may reach it are yours."),t.join(`
3
+ `)}function Pi(n,e){return[u([{label:n.path,value:WA(e)}]),y(n.means,4),...n.toAgent===void 0?[]:[y(`to the agent: ${n.toAgent}`,4)]].join(`
4
+ `)}function Gi(n,e){if(n.confirm===void 0)return;if(n.path==="tools.untrusted.onMutate"&&String(e).toLowerCase()!=="allow")return;return n.confirm}function Fi(n){let e=[u([{label:"set",value:`${n.path} = ${WA(n.after)}`},{label:"was",value:n.before===void 0?"(not set)":WA(n.before)},{label:"file",value:n.file}])];if(n.reflowed)e.push("",Q("the block could not be edited in place, so the file was re-serialised — it is valid, and comments may have moved"));if(n.running!==void 0)e.push("",Q(`this agent is running (pid ${n.running.pid}, ${n.running.mode}) and holds its settings for its lifetime — the change applies after ${n.restartHint}`));for(let t of n.pending)e.push(Q(`${t.name} is not set — ${t.why}`)),e.push(Q(`fill it in with \`config env <agent> ${t.name}\``));return e.join(`
5
+ `)}function Ui(){return IA.filter((n)=>n.via===void 0&&!/[[<]/.test(n.path)).map((n)=>n.path)}function zA(n){if(typeof n!=="object"||n===null)return[];let e=n,t=[],i=(s,l)=>{if(typeof s==="string"&&s!=="")t.push({name:s,why:l})},o=d(e.model);for(let s of["main","selector","compactor"]){let l=d(o?.[s]);i(l?.apiKeyEnv,"the manifest will not load until it is set")}if(Array.isArray(e.channels))for(let s of e.channels){let l=d(s);if(l===void 0||l.enabled===!1)continue;i(l.tokenEnv,`the ${String(l.id??l.type??"channel")} channel is read at boot, so the agent will not start until it is set`)}let r=d(e.server);if(r?.enabled===!0)i(r.tokenEnv,"the HTTP API would accept unauthenticated requests. This does not stop the agent starting");let a=d(d(e.tools)?.providers);for(let[s,l]of Object.entries(a??{}))i(d(l)?.apiKeyEnv,`the ${s} provider's tools will not work until it is set`);return t}function d(n){if(typeof n!=="object"||n===null||Array.isArray(n))return;return n}function qo(n,e){return n.filter((t)=>e[t.name]===void 0||e[t.name]==="")}function f(n,e){let t=[],i=new Map;for(let o of n){if(o.setting.via!==void 0||/[[<]/.test(o.setting.path))continue;let r=o.setting.path.split(".")[0]??o.setting.path;i.set(r,[...i.get(r)??[],o])}for(let[o,r]of i){t.push({kind:"heading",label:o});for(let a of r)t.push({kind:"setting",setting:a.setting,value:a.value})}if(e.channels.length>0){t.push({kind:"heading",label:"who may reach it"});for(let o of e.channels)t.push({kind:"allow",channelId:o.id,channelType:o.type,handles:o.allowFrom})}if(e.secrets.length>0){t.push({kind:"heading",label:"secrets — written to the .env, never shown"});for(let o of e.secrets)t.push({kind:"secret",name:o.name,why:o.why,present:e.present(o.name)})}return t}function Vo(n){let e=c(n,"utf8");return IA.map((t)=>{if(t.path==="channels[].allowFrom"){let i=Ne(e,["channels"]);if(!Array.isArray(i))return{setting:t,value:void 0};let o={};for(let r of i){if(typeof r!=="object"||r===null)continue;let a=r;if(typeof a.id!=="string")continue;o[a.id]=a.allowFrom??[]}return{setting:t,value:Object.keys(o).length===0?void 0:o}}if(t.path==="tools.providers.<id>.writeRoots"){let i=Ne(e,["tools","providers"]);if(typeof i!=="object"||i===null||Array.isArray(i))return{setting:t,value:void 0};let o={};for(let[r,a]of Object.entries(i)){if(typeof a!=="object"||a===null)continue;let s=a.writeRoots;if(s!==void 0)o[r]=s}return{setting:t,value:Object.keys(o).length===0?void 0:o}}return{setting:t,value:Ne(e,t.path.split("."))}})}function BA(n){let e=c(n,"utf8"),t=lA(e),i=Gt(n),o=Ne(e,["channels"]);return f(Vo(n),{channels:(Array.isArray(o)?o:[]).filter((r)=>typeof r==="object"&&r!==null&&!Array.isArray(r)).map((r)=>({id:String(r.id??""),type:String(r.type??""),allowFrom:Array.isArray(r.allowFrom)?r.allowFrom.map(String):[]})).filter((r)=>r.id!==""),secrets:zA(t),present:(r)=>on(i,r)})}async function Nn(n,e,t){switch(e.kind){case"setting":{if(t.trim()==="")throw new A({code:"cli_config_value_missing",message:`No value given for ${e.setting.path}.`,hint:'A bare word, a number, a list as ["a", "b"], or a map as {k: v}.',field:"value"});return(await $n(n,e.setting.path,t)).note}case"allow":{let i=t.trim()===""?[]:t.trim().split(/\s+/);return(await Xn(n,e.channelId,i)).note}case"secret":return Je(n,e.name,t).note;case"heading":return""}}
6
+ export{WA,Li,Pi,Gi,Fi,Ui,zA,qo,Vo,BA,Nn};
7
+
8
+ //# debugId=387917C94418F90664756E2164756E21
9
+ //# sourceMappingURL=index-8h6kewy1.js.map
@@ -6,6 +6,6 @@
6
6
  "/**\n * What `config` prints, and what a person has to confirm. Pure, so both are asserted as strings.\n *\n * The policy lives here rather than in the command for the same reason `remove-plan.ts` does: this\n * surface can disable the write gate and open a bind address to the network, and \"which edits need a\n * confirmation\" is exactly the thing that must be checkable without performing one.\n *\n * ## Why the person's policy is not the agent's\n *\n * Decision 11.29: *enabling a capability answers \"what may I do\"; a write root, an allowlist and a\n * bind address answer \"who and where\", and those are the person's by definition.* The agent's floor\n * exists because an agent that could widen its own inbound gate could be **talked into** widening it\n * by the very message it is reading — `config_set` sits in `policy.allow` on a real manifest, so the\n * write gate would not stop that. A person typing at a terminal is not that threat, and refusing them\n * is what left the fields reserved for them with the worst ergonomics in the system.\n *\n * So nothing here is floored. Two edits are confirmed, both from decision 4.50, and only those two:\n * a confirmation that fires on `limits.maxSteps` is one nobody reads by the time it fires on the\n * write gate.\n */\n\nimport { SETTINGS, type Setting } from \"@dispach/core\"\nimport type { EditorRow } from \"#lib/config-editor\"\nimport { bullet, indent, keyValue, section } from \"#lib/render\"\n\n/** A setting with whatever the manifest currently has in it. */\nexport interface SettingValue {\n readonly setting: Setting\n /** Plain JS, or `undefined` when the field is absent from the file. */\n readonly value: unknown\n}\n\n/**\n * How a value appears in a listing.\n *\n * Lists and maps as JSON rather than flattened YAML, which is the lesson from `config_read`: collapsing\n * a block's newlines rendered `[type: telegram id: tg tokenEnv: …]`, one run-on string where the reader\n * needed fields. A sequence of maps went through `String(entry)` and wrote `[object Object]` — the same\n * defect, three times, in three renderers.\n */\nexport function showValue(value: unknown): string {\n if (value === undefined || value === null) return \"(not set)\"\n if (typeof value === \"string\") return value === \"\" ? '\"\"' : value\n if (typeof value === \"boolean\" || typeof value === \"number\") return String(value)\n return JSON.stringify(value)\n}\n\n/** The top-level key a path belongs under, for grouping. */\nfunction group(path: string): string {\n return path.split(/[.[]/)[0] ?? path\n}\n\n/**\n * The whole catalogue, grouped by the block it lives in, each row carrying who owns it.\n *\n * Grouped by manifest block rather than by owner, because the question a reader arrives with is \"what\n * can I change about tools\" far more often than \"what is mine versus the agent's\" — and the ownership\n * still shows on every row that is not the default.\n */\nexport function renderSettings(rows: readonly SettingValue[], file: string): string {\n const out: string[] = [`${file}`, \"\"]\n\n // Collected by block rather than emitted in catalogue order. Printing a heading whenever the block\n // *changes* looks equivalent and is not: the person-only rows sit at the end of the catalogue, so a\n // real listing came out with `server` and `tools` as two sections each, reading as though there\n // were two of them. Grouping here rather than reordering the catalogue keeps the render correct\n // whatever order the rows arrive in, which is the property worth having.\n const blocks = new Map<string, SettingValue[]>()\n for (const row of rows) {\n const block = group(row.setting.path)\n blocks.set(block, [...(blocks.get(block) ?? []), row])\n }\n\n let first = true\n for (const [block, members] of blocks) {\n out.push(section(block, first))\n first = false\n for (const row of members) {\n const owner = row.setting.agentListed ? \"\" : \" · yours only\"\n const via = row.setting.via === undefined ? \"\" : ` · set with \\`${row.setting.via}\\``\n const guard = row.setting.confirm === undefined ? \"\" : \" · asks first\"\n out.push(\n keyValue([{ label: row.setting.path, value: showValue(row.value) }]),\n indent(`${row.setting.means}${owner}${via}${guard}`, 4),\n )\n }\n }\n out.push(\n \"\",\n \"A change takes effect the next time the agent starts. `yours only` marks a field the agent is\",\n \"refused: what it may do is its to ask for, where it writes and who may reach it are yours.\",\n )\n return out.join(\"\\n\")\n}\n\n/** One field, for `config get`. */\nexport function renderOne(setting: Setting, value: unknown): string {\n return [\n keyValue([{ label: setting.path, value: showValue(value) }]),\n indent(setting.means, 4),\n ...(setting.toAgent === undefined ? [] : [indent(`to the agent: ${setting.toAgent}`, 4)]),\n ].join(\"\\n\")\n}\n\n/**\n * What a confirmation says before a guard-weakening edit, or `undefined` when none is needed.\n *\n * The value matters, not only the path: `onMutate: confirm` tightens the gate and `allow` removes it,\n * and asking about both would teach people to agree to the one that matters. Same asymmetry the agent's\n * floor has, where `confirm` is settable and `allow` is refused.\n */\nexport function confirmationFor(setting: Setting, value: unknown): string | undefined {\n if (setting.confirm === undefined) return undefined\n if (setting.path === \"tools.untrusted.onMutate\" && String(value).toLowerCase() !== \"allow\") {\n return undefined\n }\n return setting.confirm\n}\n\n/**\n * The report after a successful set.\n *\n * `reflowed` is surfaced rather than swallowed: the file is correct and its comments have moved, which\n * is a surprise better heard from the command than found later in a diff.\n */\nexport function renderChange(input: {\n readonly path: string\n readonly before: unknown\n readonly after: unknown\n readonly file: string\n readonly reflowed: boolean\n /** A live process holding this agent, if there is one. */\n readonly running?: { readonly pid: number; readonly mode: string }\n /**\n * Env variables this edit has *newly* made load-bearing and that are not set.\n *\n * Newly, not \"all of them\": a note about tokens printed on every `limits.maxSteps` change is a note\n * nobody reads by the time it matters — the same reasoning that makes `config_set` report a pending\n * secret only for a write that could have introduced one. What is already missing is `config list`'s\n * to report, because that is the command whose job is the overview.\n */\n readonly pending: readonly EnvNeed[]\n readonly restartHint: string\n}): string {\n const out: string[] = [\n keyValue([\n { label: \"set\", value: `${input.path} = ${showValue(input.after)}` },\n {\n label: \"was\",\n value: input.before === undefined ? \"(not set)\" : showValue(input.before),\n },\n { label: \"file\", value: input.file },\n ]),\n ]\n if (input.reflowed) {\n out.push(\n \"\",\n bullet(\n \"the block could not be edited in place, so the file was re-serialised — it is valid, and comments may have moved\",\n ),\n )\n }\n if (input.running !== undefined) {\n // Never a refusal. Fixing a misconfiguration while it is running and broken is the main use of\n // this command, so the state it would refuse in is the state somebody is trying to get out of.\n out.push(\n \"\",\n bullet(\n `this agent is running (pid ${input.running.pid}, ${input.running.mode}) and holds its settings for its lifetime — the change applies after ${input.restartHint}`,\n ),\n )\n }\n for (const need of input.pending) {\n out.push(bullet(`${need.name} is not set — ${need.why}`))\n out.push(bullet(`fill it in with \\`config env <agent> ${need.name}\\``))\n }\n return out.join(\"\\n\")\n}\n\n/** Every setting with a real dotted path, in catalogue order. `config set`'s accepted list. */\nexport function settablePaths(): readonly string[] {\n return SETTINGS.filter((entry) => entry.via === undefined && !/[[<]/.test(entry.path)).map(\n (entry) => entry.path,\n )\n}\n\n/** An env variable this manifest depends on, and what actually happens without it. */\nexport interface EnvNeed {\n readonly name: string\n /** The real consequence, which differs per source and is not interchangeable. */\n readonly why: string\n}\n\n/**\n * The env variables a manifest depends on, each with the consequence of it being unset.\n *\n * One message for all of them was wrong, and a live run showed it: the API token variable reported as\n * \"read at boot — the agent will refuse to start until it is filled in\", printed for an agent with\n * `server.enabled: false` that starts perfectly well. Three sources, three different outcomes:\n *\n * - `model.<role>.apiKeyEnv` — a **load failure**. `validateApiKeyEnv` refuses the manifest outright.\n * - an enabled channel's `tokenEnv` — a **boot failure**, because the factory reads it inside\n * `Runtime.create`. A channel with `enabled: false` is never constructed, so it needs nothing.\n * - `server.tokenEnv` — **no failure at all**. The API serves unauthenticated and the banner says so,\n * which is worth telling somebody and is not the same sentence as \"will not start\".\n * - a provider's `apiKeyEnv` — that provider's tools do not work; the agent runs.\n *\n * A disabled block contributes nothing. Claiming a dependency that does not exist is worse than\n * claiming none, because it is the kind of warning that teaches people to ignore this line.\n */\nexport function envNeeds(document: unknown): readonly EnvNeed[] {\n if (typeof document !== \"object\" || document === null) return []\n const doc = document as Record<string, unknown>\n const needs: EnvNeed[] = []\n const add = (name: unknown, why: string) => {\n if (typeof name === \"string\" && name !== \"\") needs.push({ name, why })\n }\n\n const model = asRecord(doc.model)\n for (const role of [\"main\", \"selector\", \"compactor\"]) {\n const config = asRecord(model?.[role])\n add(config?.apiKeyEnv, \"the manifest will not load until it is set\")\n }\n\n if (Array.isArray(doc.channels)) {\n for (const entry of doc.channels) {\n const channel = asRecord(entry)\n if (channel === undefined || channel.enabled === false) continue\n add(\n channel.tokenEnv,\n `the ${String(channel.id ?? channel.type ?? \"channel\")} channel is read at boot, so the agent will not start until it is set`,\n )\n }\n }\n\n const server = asRecord(doc.server)\n if (server?.enabled === true) {\n add(\n server.tokenEnv,\n \"the HTTP API would accept unauthenticated requests. This does not stop the agent starting\",\n )\n }\n\n const providers = asRecord(asRecord(doc.tools)?.providers)\n for (const [id, config] of Object.entries(providers ?? {})) {\n add(asRecord(config)?.apiKeyEnv, `the ${id} provider's tools will not work until it is set`)\n }\n\n return needs\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | undefined {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined\n return value as Record<string, unknown>\n}\n\n/** Those of `needs` the environment does not supply. */\nexport function unmet(\n needs: readonly EnvNeed[],\n env: Readonly<Record<string, string | undefined>>,\n): readonly EnvNeed[] {\n return needs.filter((need) => env[need.name] === undefined || env[need.name] === \"\")\n}\n\n/**\n * The editor's rows for a manifest: every setting, one `allowFrom` per channel, and every secret.\n *\n * Here rather than in the component because it is the whole shape of the surface and it is pure — what\n * appears, in what order, under which heading — and because both hosts build it the same way.\n *\n * The two catalogue rows that are not dotted paths are *replaced* by their expansions rather than shown\n * beside them: `channels[].allowFrom` becomes one row per declared channel, and\n * `tools.providers.<id>.writeRoots` is left as a listing-only row, because writing it means naming a\n * provider and the editor has no way to ask which. A row nobody can act on would be the dead end this\n * surface exists to remove, so it is not offered at all — `config list` still shows it.\n */\nexport function editorRows(\n settings: readonly SettingValue[],\n input: {\n readonly channels: readonly {\n readonly id: string\n readonly type: string\n readonly allowFrom: readonly string[]\n }[]\n readonly secrets: readonly EnvNeed[]\n readonly present: (name: string) => boolean\n },\n): readonly EditorRow[] {\n const out: EditorRow[] = []\n\n // Collected by block, not emitted when the block *changes* — the same distinction `renderSettings`\n // records above, which this renderer had never been given. The two are not equivalent: the\n // person-only rows sit at the end of the catalogue, so `server.host` and `server.tokenEnv` were\n // already a second `server` section here, and inserting any row between `server.port` and them\n // made it visible. `schedules` was that row. Grouping keeps the render correct whatever order the\n // catalogue arrives in, which is the property worth having and the reason not to fix it by\n // reordering the table.\n const blocks = new Map<string, SettingValue[]>()\n for (const row of settings) {\n if (row.setting.via !== undefined || /[[<]/.test(row.setting.path)) continue\n const key = row.setting.path.split(\".\")[0] ?? row.setting.path\n blocks.set(key, [...(blocks.get(key) ?? []), row])\n }\n for (const [label, members] of blocks) {\n out.push({ kind: \"heading\", label })\n for (const row of members) {\n out.push({ kind: \"setting\", setting: row.setting, value: row.value })\n }\n }\n\n if (input.channels.length > 0) {\n out.push({ kind: \"heading\", label: \"who may reach it\" })\n for (const channel of input.channels) {\n out.push({\n kind: \"allow\",\n channelId: channel.id,\n channelType: channel.type,\n handles: channel.allowFrom,\n })\n }\n }\n\n if (input.secrets.length > 0) {\n out.push({ kind: \"heading\", label: \"secrets — written to the .env, never shown\" })\n for (const need of input.secrets) {\n out.push({\n kind: \"secret\",\n name: need.name,\n why: need.why,\n present: input.present(need.name),\n })\n }\n }\n\n return out\n}\n"
7
7
  ],
8
8
  "mappings": ";sKAUA,uBAAS,gBC8BF,SAAS,EAAS,CAAC,EAAwB,CAC9C,GAAI,IAAU,QAAa,IAAU,KAAM,MAAO,YAClD,GAAI,OAAO,IAAU,SAAU,OAAO,IAAU,GAAK,KAAO,EAC5D,GAAI,OAAO,IAAU,WAAa,OAAO,IAAU,SAAU,OAAO,OAAO,CAAK,EAChF,OAAO,KAAK,UAAU,CAAK,EAI/B,SAAS,CAAK,CAAC,EAAsB,CACjC,OAAO,EAAK,MAAM,MAAM,EAAE,IAAM,EAU7B,SAAS,EAAc,CAAC,EAA+B,EAAsB,CAChF,IAAM,EAAgB,CAAC,GAAG,IAAQ,EAAE,EAO9B,EAAS,IAAI,IACnB,QAAW,KAAO,EAAM,CACpB,IAAM,EAAQ,EAAM,EAAI,QAAQ,IAAI,EACpC,EAAO,IAAI,EAAO,CAAC,GAAI,EAAO,IAAI,CAAK,GAAK,CAAC,EAAI,CAAG,CAAC,EAGzD,IAAI,EAAQ,GACZ,QAAY,EAAO,KAAY,EAAQ,CACnC,EAAI,KAAK,EAAQ,EAAO,CAAK,CAAC,EAC9B,EAAQ,GACR,QAAW,KAAO,EAAS,CACvB,IAAM,EAAQ,EAAI,QAAQ,YAAc,GAAK,iBACvC,EAAM,EAAI,QAAQ,MAAQ,OAAY,GAAK,kBAAkB,EAAI,QAAQ,QACzE,EAAQ,EAAI,QAAQ,UAAY,OAAY,GAAK,iBACvD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C,MAAM,QAAQ,CAAK,CAC3E,EACC,IAAI,CAAC,KAAW,CACb,GAAI,OAAO,EAAM,IAAM,EAAE,EACzB,KAAM,OAAO,EAAM,MAAQ,EAAE,EAC7B,UAAW,MAAM,QAAQ,EAAM,SAAS,EAAI,EAAM,UAAU,IAAI,MAAM,EAAI,CAAC,CAC/E,EAAE,EACD,OAAO,CAAC,IAAU,EAAM,KAAO,EAAE,EACtC,QAAS,GAAS,CAAQ,EAG1B,QAAS,CAAC,IAAiB,GAAM,EAAK,CAAI,CAC9C,CAAC,EAWE,eAAe,EAAc,CAChC,EACA,EACA,EACe,CACf,OAAQ,EAAI,MACR,IAAK,UAAW,CACZ,GAAI,EAAI,KAAK,IAAM,GACf,MAAM,IAAI,EAAa,CACnB,KAAM,2BACN,QAAS,sBAAsB,EAAI,QAAQ,QAC3C,KAAM,mEACN,MAAO,OACX,CAAC,EAEL,OAAQ,MAAM,GAAS,EAAc,EAAI,QAAQ,KAAM,CAAG,GAAG,IACjE,CACA,IAAK,QAAS,CACV,IAAM,EAAU,EAAI,KAAK,IAAM,GAAK,CAAC,EAAI,EAAI,KAAK,EAAE,MAAM,KAAK,EAC/D,OAAQ,MAAM,GAAW,EAAc,EAAI,UAAW,CAAO,GAAG,IACpE,CACA,IAAK,SACD,OAAO,GAAY,EAAc,EAAI,KAAM,CAAG,EAAE,KACpD,IAAK,UACD,MAAO",
9
- "debugId": "73ABEE8C2BCCA4AB64756E2164756E21",
9
+ "debugId": "387917C94418F90664756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ var la="\x1B[?25h",ko="\x1B[0m",Ia="\x1B[2m",Rt="\x1B[?1049h",da="\x1B[?1049l",ua="\x1B[<u",be=80,vo=24,Lo=12,Po="› ",Go=40,Fo=140,EA=8,CA=40,pA=8,Ea=200,mi=100,Uo=10,Ca=4,pa=6,xo=3,fa=2000,Ho=50,ha=1,o=0,d=1,Ba=143;var ya=3,Qa=23,ma=8,Sa=400,Tr=1,Sn=12,wa=300,Da=2000;
3
+ export{la,ko,Ia,Rt,da,ua,be,vo,Lo,Po,Go,Fo,EA,CA,pA,Ea,mi,Uo,Ca,pa,xo,fa,Ho,ha,o,d,Ba,ya,Qa,ma,Sa,Tr,Sn,wa,Da};
4
+
5
+ //# debugId=8F491A0F8C675FA164756E2164756E21
6
+ //# sourceMappingURL=index-8tmv33mr.js.map
@@ -5,6 +5,6 @@
5
5
  "/**\n * Every constant the CLI uses, in one place.\n *\n * The rule is the one termheat follows: no magic number inline. A width, a limit, or a control\n * sequence buried in a component is invisible to anyone tuning behaviour later, and two copies of\n * the same number drift.\n */\n\n// ─── terminal ────────────────────────────────────────────────────────────────────────────\n\nexport const SHOW_CURSOR = \"\\u001B[?25h\"\nexport const RESET_STYLE = \"\\u001B[0m\"\n/**\n * Faint text, for the one thing written outside Ink that is not the point of the output.\n *\n * SGR 2 rather than a grey foreground: a fixed colour is wrong on half the terminals in existence,\n * and dim is the terminal's own opinion about what recedes on the theme in use. It persists across a\n * newline, so a multi-line note opens it once and resets once — and the reset lands before the final\n * newline, or the shell prompt that follows inherits it.\n */\nexport const DIM_STYLE = \"\\u001B[2m\"\n\n/**\n * The alternate screen buffer — a second, empty screen the terminal swaps in, discards on the way\n * out, and never adds to the scrollback.\n *\n * `1049` rather than the older `47`: it saves the cursor position and clears the new buffer in one\n * sequence, which is what lands the shell prompt back where it was rather than wherever the app left\n * the cursor.\n *\n * The order on the way out is easy to get backwards. A style reset applies to whichever buffer is\n * *current*, so it has to be written before the swap away — reset afterwards and any colour the app\n * left on lands on the shell's screen instead of the one being discarded. `restoreTerminal` does them\n * in that order and says so there too.\n */\nexport const ENTER_ALT_SCREEN = \"\\u001B[?1049h\"\nexport const LEAVE_ALT_SCREEN = \"\\u001B[?1049l\"\n\n/**\n * Pop the kitty keyboard protocol: `CSI < u`, the counterpart to the `CSI > flags u` Ink pushes.\n *\n * Here rather than in `lib/keyboard.ts` so the dependency runs one way — `lib/exit.ts` needs the\n * sequence and `lib/keyboard.ts` needs `markEnhancedKeys`, and only one of those two can import the\n * other. Terminal-mode sequences already live in this module, which makes this the side that moves.\n */\nexport const DISABLE_ENHANCED_KEYS = \"\\u001B[<u\"\n\n/**\n * Fallback width. A pty can genuinely report `columns === 0` — measured, under `script -q`, which\n * is how this repo drives a real TTY in a test harness. Any layout maths that divides by the\n * terminal width has to survive that.\n */\nexport const FALLBACK_COLUMNS = 80\nexport const FALLBACK_ROWS = 24\n\n/**\n * Rows the live pane may occupy before it starts showing only its tail.\n *\n * Ink erases and redraws its whole dynamic tree every frame, so an unbounded live region means\n * redrawing hundreds of lines per token. Finished messages move into `<Static>`, which is written\n * once and never touched again; this cap is what keeps the *unfinished* one cheap.\n */\nexport const LIVE_PANE_MAX_ROWS = 12\n\nexport const PROMPT = \"› \"\n\n/**\n * The width a screen is laid out for, clamped at both ends.\n *\n * The floor is where the row layout drops its description column rather than wrapping — below it\n * nothing sensible is possible, and a wrapped row is what made the first skills list unreadable. The\n * ceiling stops a 300-column window putting a description a screen away from the name it belongs to.\n *\n * Here rather than in the one command that first needed them, because every screen now shares a frame\n * and two screens clamping differently is the drift `render.ts` was written to end.\n */\nexport const MIN_SCREEN_COLUMNS = 40\nexport const MAX_SCREEN_COLUMNS = 140\n\n/** Rows a scrolling list may occupy, before and after the frame takes its share. */\nexport const MIN_SCREEN_ROWS = 8\nexport const MAX_SCREEN_ROWS = 40\n/** Header, footer, margins and the counter — what the frame costs a list. */\nexport const SCREEN_CHROME_ROWS = 8\n\n// ─── commands and input ──────────────────────────────────────────────────────────────────\n\n// The command words themselves live in `session-commands.ts`, beside the summary that documents\n// each one and the dispatch that honours it. Three bare string constants here is how the help text\n// and the parser came to disagree in the first place.\n\n/** Lines of input history kept for the up/down arrows. */\nexport const HISTORY_LIMIT = 200\n\n/**\n * Undo points kept for the input buffer.\n *\n * Bounded because a snapshot holds a whole copy of the text, and a long composing session with a\n * pasted document in it would otherwise keep every intermediate version alive for the life of the\n * process. A run of typing is one point, not one per keystroke, so this is deeper than it looks.\n */\nexport const UNDO_LIMIT = 100\n\n/**\n * Rows the input box may grow to before it scrolls internally.\n *\n * The same reasoning as `LIVE_PANE_MAX_ROWS`: the input is in Ink's dynamic region, which is erased and\n * redrawn every frame, so an unbounded box means redrawing a pasted document on every keystroke. It\n * also stops a long paste pushing the conversation off the screen.\n */\nexport const MAX_INPUT_ROWS = 10\n\n/**\n * Rows of a reasoning block shown before it folds to a count.\n *\n * Reasoning is secondary and routinely the longest item in a conversation — a real turn produced a\n * twenty-three-row block for a one-sentence answer, which filled a thirty-row terminal on its own and made\n * the reply itself something you had to scroll to find. Four rows is enough to see what it was thinking\n * about; `⌥r` shows the rest.\n *\n * Folding is a *view* decision, applied when items become rows. The whole text is always in the item, so\n * expanding needs no re-derivation and nothing is lost.\n */\nexport const REASONING_FOLD_ROWS = 4\n\n/** Matches `^R` shows at once. Enough to recognise one, few enough to leave the prompt on screen. */\nexport const SEARCH_ROWS = 6\n\n/**\n * Rows a single-value field may wrap to before it scrolls to follow the caret.\n *\n * Smaller than `MAX_INPUT_ROWS`, because a *value* is not a message: a wizard answer and a manifest\n * setting are one line of intent that happens to be long. Three is enough for the longest thing a\n * generated manifest holds — `tools.pinned` at 92 characters is two rows on an 80-column terminal — and\n * few enough that the field never pushes the rest of the screen around.\n *\n * There was no bound at all before, because the field passed no width: in the settings editor a long\n * value was clipped at the terminal's edge with the caret past the clip, and you could not see what you\n * were typing. The wizard escaped it — a bordered box bounds its text whatever the field passes.\n */\nexport const FIELD_ROWS = 3\n\n/**\n * Transcript items kept before the oldest are dropped.\n *\n * Load-bearing rather than prudent, and it was missing for three phases. While the conversation lived\n * in `<Static>` a finished item was written once and cost nothing afterwards; the alternate screen took\n * that away, so every item is now re-derived and re-wrapped on every frame — an unbounded buffer means\n * unbounded work per keystroke, and the case that reaches it is an agent looping tool calls overnight\n * rather than anybody typing.\n *\n * Counted in **items**, not rows, because the row count depends on the terminal width and the reducer\n * that owns the buffer is pure and has none. That does not contradict the scroll layer's rule that the\n * unit is a row: that rule is about addressing an *offset*, where paging by item steps over a forty-row\n * reply in one keystroke.\n *\n * Deliberately far past any session a person reads end to end — roughly four hundred turns — so the cap\n * is a backstop nobody meets rather than a limit that shapes ordinary use. Eviction is also gated on the\n * reader following the tail; see `TRIM` in `transcript.ts` for why that gate is not optional.\n */\nexport const MAX_TRANSCRIPT_ITEMS = 2000\n\n// ─── defaults ────────────────────────────────────────────────────────────────────────────\n\nexport const DEFAULT_ROW_LIMIT = 50\nexport const MIN_ROW_LIMIT = 1\n\n// ─── exit codes ──────────────────────────────────────────────────────────────────────────\n\nexport const EXIT_OK = 0\nexport const EXIT_FAILURE = 1\n/** 128 + SIGTERM, the shell convention. */\nexport const EXIT_SIGTERM = 143\n\n/** Rows a pane over the conversation may use — a command's output, or a hosted view. */\nexport const PANE_ROWS = 16\n\n/**\n * The fewest rows a scrolling body is ever given.\n *\n * A floor rather than a target. At eight terminal rows the chrome alone — header, composer, status —\n * accounts for most of the screen, and the alternative to a floor is a body of zero rows: a session\n * that shows the prompt and no conversation at all, which reads as a broken renderer rather than as a\n * window somebody should make taller.\n */\nexport const MIN_BODY_ROWS = 3\n\n/**\n * Rows a list may take while landing — before anything has been sent.\n *\n * Deliberately larger than `SEARCH_ROWS`, which is tuned for a live conversation where every row of list is a\n * row of conversation hidden. There is no conversation yet on the landing screen and its whole job is\n * discovery: showing six of fifteen commands behind a `… 9 below` is the wrong trade on the screen somebody\n * opens before they know what the commands are. The brand mark gives up a tier to pay for it, which the tier\n * ladder already knows how to do.\n *\n * **This tracks the size of the in-session command table**, so a phase that adds a command has to raise it —\n * which is why `commands.test.ts` asserts the relationship rather than leaving it to whoever notices the\n * `… 1 below`. It is not derived from `COMMANDS` directly because `commands.ts` reads this module, and the\n * cycle would cost more than the assertion does.\n */\nexport const LANDING_LIST_ROWS = 23\n\n/**\n * Rows of conversation the landing screen keeps, whatever the brand mark would like.\n *\n * The banner is written into the transcript, so a wordmark that squeezed it to nothing would hide the boot\n * notes and every load warning behind a picture — which is the trimmed-catalogue failure with better\n * typography: true of what is on screen, false of what is the case.\n *\n * Eight rather than four, measured against a real banner: four left the window showing the *tail* of it, so\n * the first thing on screen was the second half of a wrapped store path. The banner runs six to eight rows\n * depending on how many load warnings there are.\n */\nexport const MIN_LANDING_TRANSCRIPT = 8\n\n/**\n * How long after a press a second one still counts as a double-click.\n *\n * A terminal reports three presses and never a \"double click\", so the grouping is ours to infer — from time\n * *and* position, because two clicks 300 ms apart on different words are two clicks. 400 ms is the common\n * platform default; longer makes a deliberate second selection turn into a word-select, shorter makes a\n * real double-click fail on a slow hand.\n */\nexport const MULTI_CLICK_MS = 400\n\n/** The blank row between the brand mark and the one-line header under it. */\nexport const BRAND_GAP_ROWS = 1\n\n/** Conversations the session picker shows at once. The list scrolls inside this. */\nexport const SESSION_PICKER_ROWS = 12\n\n/**\n * How often `daemon logs --follow` checks a service log for new bytes.\n *\n * Polled rather than watched: `fs.watch` on macOS reports another process's appends unreliably, and a\n * follower that misses the line somebody is waiting for is worse than one that arrives a third of a\n * second late — the reason to watch a log live is not trusting what you have been told. Ctrl-C wakes the\n * pending sleep rather than waiting it out, so this interval never delays a stop.\n */\nexport const LOG_POLL_MS = 300\n\n/**\n * How long a ^C at an idle prompt stays armed.\n *\n * The chord is doubled rather than immediate because a single ^C means \"cancel the turn\" everywhere\n * else in this session, and the two are one keystroke apart. Long enough to be a deliberate second\n * press, short enough that an armed prompt left alone goes back to being safe.\n */\nexport const EXIT_ARM_MS = 2000\n"
6
6
  ],
7
7
  "mappings": ";AAUO,IAAM,GAAc,YACd,GAAc,UASd,GAAY,UAeZ,GAAmB,cACnB,GAAmB,cASnB,GAAwB,UAOxB,GAAmB,GACnB,GAAgB,GAShB,GAAqB,GAErB,GAAS,KAYT,GAAqB,GACrB,GAAqB,IAGrB,GAAkB,EAClB,GAAkB,GAElB,GAAqB,EASrB,GAAgB,IAShB,GAAa,IASb,GAAiB,GAajB,GAAsB,EAGtB,GAAc,EAcd,GAAa,EAoBb,GAAuB,KAIvB,GAAoB,GACpB,GAAgB,EAIhB,EAAU,EACV,EAAe,EAEf,GAAe,IAarB,IAAM,GAAgB,EAgBhB,GAAoB,GAapB,GAAyB,EAUzB,GAAiB,IAGjB,GAAiB,EAGjB,GAAsB,GAUtB,GAAc,IASd,GAAc",
8
- "debugId": "BD6C01B66CCF614164756E2164756E21",
8
+ "debugId": "8F491A0F8C675FA164756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{t}from"./index-qg9bn980.js";import{ze}from"./index-kjqksgch.js";import{Ho,ha}from"./index-8tmv33mr.js";var gn=[{name:"plain",kind:"boolean",help:"force plain text — no interactive rendering, no colour"},{name:"help",short:"h",kind:"boolean",help:"show this help and exit"},{name:"version",short:"v",kind:"boolean",help:"print the version and exit"},{name:"no-bootstrap",kind:"boolean",help:"never start a background server on this run"}],n={name:"manifest",required:!0,help:"path to an agent.yaml, or the name of a sandbox agent"},a={name:"store",kind:"string",placeholder:"path",help:"session database",defaultHelp:`~/${t.stateDir}/store.db`},d={name:"session",kind:"string",placeholder:"key",help:"session key",bare:""},e={name:"json",kind:"boolean",help:"machine-readable output"},rt=[{name:"init",inSession:"hidden",needsServer:!1,summary:"create a new agent: manifest, workspace, and env files",args:[],unexpectedArgHint:"init takes no positional argument. To name the agent, --name <name>; to place it somewhere other than the sandbox, --dir <path>.",flags:[{name:"user",kind:"string",placeholder:"name",help:"your name"},{name:"name",kind:"string",placeholder:"name",help:"the agent's name"},{name:"purpose",kind:"string",placeholder:"text",help:"one line: what the agent is for"},{name:"preset",kind:"string",placeholder:"id",help:`model endpoint: ${ze.map((s)=>s.id).join(" | ")}`,defaultHelp:"openai"},{name:"model",kind:"string",placeholder:"id",help:"model id"},{name:"base-url",kind:"string",placeholder:"url",help:"endpoint base URL"},{name:"region",kind:"string",placeholder:"aws-region",help:"AWS region, with --preset bedrock (credentials come from the AWS chain)"},{name:"api-key-env",kind:"string",placeholder:"VAR",help:"env var that will hold the key; omitted for ollama",defaultHelp:"MODEL_API_KEY"},{name:"system",kind:"string",placeholder:"level",help:"what it may touch on this machine: none | read | write | full",defaultHelp:"none"},{name:"web",kind:"string",placeholder:"level",help:"internet access: none | fetch | search",defaultHelp:"none"},{name:"web-backend",kind:"string",placeholder:"id",help:"search backend when --web search: tavily | brave | exa",defaultHelp:"tavily"},{name:"composio",kind:"string",placeholder:"level",help:"your other apps via Composio: none | connected",defaultHelp:"none"},{name:"telegram",kind:"string",placeholder:"level",help:"reachable on Telegram: none | connected",defaultHelp:"none"},{name:"telegram-allow",kind:"string",placeholder:"@handle",help:"who may message it — empty permits nobody, which is the safe default"},{name:"whatsapp",kind:"string",placeholder:"level",help:"reachable on WhatsApp: none | connected — unofficial, bundled with the binary",defaultHelp:"none"},{name:"whatsapp-number",kind:"string",placeholder:"digits",help:"the account's own number to pair with (pairWith) — digits with no +; empty pairs by QR"},{name:"server",kind:"string",placeholder:"level",help:"serve the HTTP API: none | local",defaultHelp:"local"},{name:"schedules",kind:"string",placeholder:"what",help:"run something on a schedule: none | daily | hourly",defaultHelp:"none"},{name:"skills",kind:"string",placeholder:"level",help:'none | starter, or words to search the catalogues for — --skills "pdf tables"',defaultHelp:"starter"},{name:"daemon",kind:"string",placeholder:"level",help:"keep it running in the background: none | service",defaultHelp:"none"},{name:"dir",kind:"string",placeholder:"path",help:"write the agent here instead of the sandbox",defaultHelp:`~/${t.stateDir}/agents/<agent-name-slug>`},{name:"yes",kind:"boolean",help:"take every default; never ask, even at a terminal"},{name:"measure-window",kind:"boolean",help:"ask the endpoint for the model's window and write it (the wizard always asks)"}]},{name:"run",inSession:"hidden",needsServer:!0,summary:"start an interactive session — bare `run` picks from the sandbox",args:[{...n,required:!1,help:"path or sandbox agent name (omit to pick from the sandbox)"}],flags:[{...d,defaultHelp:"a new one each run; bare --session picks from the list"},{name:"continue",short:"c",kind:"boolean",help:"pick up the most recent conversation with this agent"},{name:"input",kind:"string",placeholder:"text",help:"run one turn, print the reply, exit"},a,{name:"ephemeral",kind:"boolean",help:"keep this session in memory only; nothing is written"},{name:"quiet",kind:"boolean",help:"suppress the banner and per-turn stats"},{name:"no-enhanced-keys",kind:"boolean",help:"do not negotiate the kitty keyboard protocol (cmd chords stop arriving)"},{name:"no-reasoning",kind:"boolean",help:"hide the thinking a reasoning model streams (shown by default)"},{name:"show-reasoning",kind:"boolean",help:"no-op: reasoning is shown by default when the model has any"}]},{name:"schedules",inSession:"view",needsServer:!0,summary:"list schedules, when they next fire, and how the last run went",args:[n],flags:[{name:"id",kind:"string",placeholder:"schedule",help:"show one schedule in full instead of the list"},{name:"enable",kind:"string",placeholder:"schedule",help:"switch an API-created schedule on; a manifest one is enabled in agent.yaml"},{name:"disable",kind:"string",placeholder:"schedule",help:"switch an API-created schedule off; a manifest one is disabled in agent.yaml"},{name:"recipients",kind:"boolean",help:"list the addresses this agent can deliver to — what deliver.to takes"},a,e]},{name:"sessions",inSession:"view",needsServer:!1,summary:"list stored sessions, or inspect one",args:[n],flags:[{...d,help:"show one session instead of the list"},{name:"turns",kind:"boolean",help:"show turn records instead of messages"},{name:"clear",kind:"boolean",help:"delete the named session's history; memory files are untouched"},{name:"limit",kind:"number",placeholder:"n",help:"rows to show",defaultHelp:String(Ho),min:ha,integer:!0},a,e]},{name:"memory",inSession:"view",needsServer:!1,summary:"search what the agent remembers, or rebuild the index from the files",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"search",help:"rank the corpus against a query, exactly as a turn would"},{value:"rebuild",help:"forget the index and re-read every file — for an edit that kept the mtime"}]},{...n,required:!0},{name:"query",required:!1,help:"the words to search for (search only); quote a phrase"}],flags:[a,{name:"limit",kind:"number",placeholder:"n",help:"passages to show",defaultHelp:"10",min:1,integer:!0},{name:"all",kind:"boolean",help:"show passages below the manifest's threshold too, marked"},e]},{name:"config",inSession:"view",needsServer:!1,summary:"read and change an agent's settings, and fill in its secrets",args:[{name:"action",required:!1,help:"what to do (default: edit)",choices:[{value:"edit",help:"the full-screen editor — also what bare `config <agent>` opens"},{value:"list",help:"every setting, its current value, and who may set it"},{value:"get",help:"one setting"},{value:"set",help:"change one setting"},{value:"env",help:"put a secret in the .env beside the manifest, prompted and not echoed"},{value:"allow",help:"add or remove a handle a channel accepts messages from"}]},{...n,required:!1},{name:"name",required:!1,help:"the setting's dotted path, an env variable name, or a handle"},{name:"value",required:!1,help:"the new value (set only)"}],flags:[a,{name:"channel",kind:"string",placeholder:"id",help:"which channel to allow on, when there is more than one"},{name:"remove",kind:"boolean",help:"take the handle off instead of adding it (allow only)"},{name:"yes",kind:"boolean",help:"skip the confirmation on an edit that weakens a check"}]},{name:"owner",inSession:"hidden",needsServer:!1,summary:"show who owns this machine's agents, or make an existing agent yours",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"show",help:"print the owner id init minted for this sandbox"},{value:"adopt",help:"make an agent yours: assign it, recognise you on its channels, one conversation everywhere"}]},{...n,required:!1}],flags:[a,e]},{name:"validate",inSession:"output",needsServer:!1,summary:"load and validate a manifest, then exit",args:[n],flags:[e]},{name:"workspace",inSession:"output",needsServer:!1,summary:"check the workspace files against the authoring rules",args:[n],flags:[{name:"strict",kind:"boolean",help:"exit non-zero when any authoring warning is reported"},e]},{name:"soul",inSession:"output",needsServer:!1,summary:"scaffold a hand-edited compact identity from a long-form document",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"distill",help:"scaffold a compact identity beside the source"}]},{name:"file",required:!0,help:"path to the long-form identity document"}],flags:[{name:"out",kind:"string",placeholder:"path",help:"where to write the scaffold",defaultHelp:"<file>.compact.md beside the source"}]},{name:"skills",inSession:"view",needsServer:!1,summary:"browse the catalogue and install — or list, scaffold, check one agent's skills",args:[{name:"action",required:!1,help:"what to do — omit to browse the catalogue and tick what you want",choices:[{value:"list",help:"every skill, its size, and whether it ships scripts"},{value:"show",help:"one skill in full, including what the model never sees"},{value:"new",help:"scaffold a skill, turning skills on for this agent if they are not"},{value:"install",help:"install one by name — anthropic/pdf — or copy from a local path (see `sources`)"},{value:"remove",help:"delete a skill's directory and everything in it"},{value:"validate",help:"authoring warnings — never a refusal"}]},{...n,required:!1,help:"path or sandbox agent name (not used when browsing)"},{name:"name",required:!1,help:"the skill for show, new and remove — for install, <source>/<skill> or a local path"}],flags:[{name:"strict",kind:"boolean",help:"exit non-zero when any authoring warning is reported"},e]},{name:"sources",inSession:"view",needsServer:!1,summary:"the repositories skills come from: list, add, search",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"list",help:"every source, and whether it has been fetched"},{value:"add",help:"add a repository — a URL, or a name and a URL"},{value:"remove",help:"stop searching a source; built-ins included"},{value:"update",help:"re-fetch every source, or the ones named"},{value:"search",help:"find a skill across every source; fetches on first use"}]},{name:"rest",required:!1,variadic:!0,help:"a name and URL for add, a name for remove or update, words for search"}],flags:[{name:"path",kind:"string",placeholder:"dir",help:"subdirectory holding the skills (add)",defaultHelp:"the whole repository"},{name:"ref",kind:"string",placeholder:"branch",help:"branch or tag to track (add)",defaultHelp:"the remote's default branch"},e]},{name:"channels",inSession:"output",needsServer:!1,summary:"what an agent is reachable on: connect, disconnect, set a credential, unpair",args:[{name:"action",required:!1,help:"what to do — omit for the listing",choices:[{value:"list",help:"every channel, whether it is on, and whether its credential is filled in"},{value:"connect",help:"switch a channel on; it starts at the agent's next start"},{value:"disconnect",help:"switch it off — a disabled channel is never constructed"},{value:"credential",help:"set the channel's token in the .env, prompted and not echoed"},{value:"pair",help:"connect it the way that channel needs — a code for WhatsApp, a token for Telegram"},{value:"unpair",help:"forget a scanned pairing, so the next start offers a new code"}]},{...n,required:!1,help:"path or sandbox agent name"},{name:"channel",required:!1,help:"which channel — its id, not its type. Optional when the agent has exactly one"}],flags:[e]},{name:"plugins",inSession:"output",needsServer:!1,summary:"install a plugin, list what an agent loaded, or remove one",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"list",help:"what this agent loaded, from where, and what it asked for"},{value:"add",help:"fetch a plugin from git and name it in this agent"},{value:"remove",help:"drop the entry, and the directory when no agent needs it"}]},n,{name:"rest",required:!1,variadic:!0,help:"a repository for add — owner/repo, a clone URL, or a page URL — or a name for remove"}],flags:[{name:"ref",kind:"string",placeholder:"tag",help:"branch, tag or commit to fetch (add) — the only thing that pins the code",defaultHelp:"the remote's default branch"},{name:"name",kind:"string",placeholder:"name",help:"install under this name (add), which is what the `plugins:` entry will say",defaultHelp:"the repository or subdirectory name"},e]},{name:"agents",inSession:"output",needsServer:!1,summary:"the agents in the sandbox, and whether anything is serving them",args:[{...n,required:!1,variadic:!0,help:"paths or sandbox names to describe in full — bare, lists the sandbox"}],flags:[a,e]},{name:"restart",inSession:"hidden",needsServer:!1,summary:"reload one agent on the running host, or restart the whole service",args:[{...n,required:!1,help:"path or sandbox agent name — bare, restarts the background service"}],flags:[a,e]},{name:"status",inSession:"output",needsServer:!1,summary:"the service, the hosts, every agent and its channels — one screen",args:[],flags:[a,e]},{name:"logs",inSession:"hidden",needsServer:!1,summary:"the server's stderr tail — the same as `daemon logs`",args:[{...n,required:!1,help:"path or sandbox agent name — bare, the server's own log"}],flags:[{name:"lines",kind:"number",placeholder:"n",integer:!0,min:1,help:"how much of the log to show",defaultHelp:"40"},{name:"follow",short:"f",kind:"boolean",help:"keep printing new lines until interrupted"},{name:"truncate",kind:"boolean",help:"empty the log first, in place"},a,e]},{name:"tools",inSession:"output",needsServer:!1,summary:"show the resolved tool catalogue, or fetch a remote provider's schemas into the cache",args:[n],flags:[{name:"warm",kind:"boolean",help:"fetch every pinned slug from the provider and write the resolution cache"},e]},{name:"serve",inSession:"hidden",needsServer:!1,summary:"run the HTTP API and connect the agents' channels",args:[{...n,required:!1,variadic:!0,help:"paths to an agent.yaml, or sandbox agent names (omit for every enabled agent)"}],flags:[{name:"port",kind:"number",placeholder:"n",help:"port to bind",defaultHelp:"server.port, or 7420"},{name:"host",kind:"string",placeholder:"addr",help:"address to bind — a non-loopback host requires an API token",defaultHelp:"server.host, or 127.0.0.1"},{name:"claim",kind:"boolean",help:"print a one-time claim even when a key already exists"},a,e]},{name:"credential",inSession:"hidden",needsServer:!0,summary:"mint, list and revoke operator credentials, optionally scoped",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"create",help:"mint one and print the secret, once"},{value:"list",help:"every credential, live and revoked, with its scope"},{value:"revoke",help:"kill one permanently"}]},{name:"keyId",required:!1,help:"which credential, for revoke (`credential list` prints the ids)"}],flags:[{name:"label",kind:"string",placeholder:"text",help:"how it is shown in a listing — required for create"},{name:"agents",kind:"string",placeholder:"a,b",help:"narrow it to these agents",defaultHelp:"every agent"},{name:"sessions",kind:"string",placeholder:"prefix",help:"narrow it to session keys starting with this",defaultHelp:"every session"},{name:"can",kind:"string",placeholder:"list",help:"narrow it to these capabilities: read | chat | write | admin",defaultHelp:"all of them"},{name:"expires",kind:"string",placeholder:"dur",help:"how long it lives: 30s, 15m, 2h, 7d, or seconds",defaultHelp:"never"},a,e]},{name:"keys",inSession:"hidden",needsServer:!1,summary:"press a chord and see the bytes, Ink's reading of them, and the intent",args:[],flags:[{name:"no-enhanced-keys",kind:"boolean",help:"do not negotiate the kitty keyboard protocol"}]},{name:"terminal-setup",inSession:"hidden",needsServer:!1,summary:"teach this terminal to send shift+enter as a new line",args:[],flags:[{name:"dry-run",kind:"boolean",help:"print the change and write nothing"},{name:"yes",kind:"boolean",help:"write it without asking"},e]},{name:"remove",inSession:"hidden",needsServer:!1,summary:"delete a sandbox agent: its directory, sessions, memory, logs and service",args:[{name:"agent",required:!1,help:"sandbox agent name (a path is refused — remove only manages agents `init` made)"}],flags:[{name:"dry-run",kind:"boolean",help:"show exactly what would go; delete nothing"},{name:"files-only",kind:"boolean",help:"delete the directory and keep the sessions, memory and logs"},{name:"prune",kind:"boolean",help:"delete sessions, memory and logs that no sandbox agent claims any more"},{name:"all",kind:"boolean",help:"remove every agent in the sandbox"},{name:"yes",kind:"boolean",help:"skip the typed confirmation (required to delete anything non-interactively)"},a,e]},{name:"stop",inSession:"hidden",needsServer:!1,summary:"stop one agent for good, or everything — named, it stays stopped across restarts",args:[{name:"agent",required:!1,help:"path or sandbox agent name (omit to stop the whole host)"}],flags:[{name:"dry-run",kind:"boolean",help:"list what would be stopped; stop nothing"},{name:"reason",kind:"string",help:"why — recorded, and shown wherever the agent is reported as off"},a,e]},{name:"start",inSession:"hidden",needsServer:!0,summary:"switch an agent back on, and have a running host adopt it now",args:[n],flags:[a,e]},{name:"model",inSession:"output",needsServer:!1,summary:"ask the endpoint what it can actually do — window, output cap, prompt caching",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"probe",help:"measure every configured role against its own endpoint"}]},{name:"agent",required:!0,help:"path or sandbox agent name"}],flags:[{name:"window",kind:"boolean",help:"search for the window by growing a prompt until it is refused — costs real tokens, and prints the estimate first"},{name:"price",kind:"number",placeholder:"usd",help:"dollars per million input tokens, if you want --window's estimate in money"},{name:"write",kind:"boolean",help:"record a measured ceiling in the manifest; a floor is refused, because a floor is not a window"},{name:"yes",kind:"boolean",help:"answer the --window spend prompt; nothing else is affected"},{name:"json",kind:"boolean",help:"machine-readable findings"}]},{name:"web",inSession:"output",needsServer:!0,summary:"open the browser view of a running agent",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"run",help:"start a server if needed, then open the page"},{value:"open",help:"open the page of a server already running"},{value:"url",help:"print the address and open nothing — the form a pipe reads"}]},{name:"agent",required:!1,help:"path or sandbox agent name (omit to open the page itself)"}],flags:[{name:"no-open",kind:"boolean",help:"print the URL instead of opening it"},a,e]},{name:"daemon",inSession:"output",needsServer:!1,summary:"keep an agent serving in the background — starts at login, restarts on crash",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"install",help:"check it will boot, write the service, load it, and watch it start"},{value:"uninstall",help:"unload it and remove the service definition"},{value:"start",help:"load it again after a stop"},{value:"stop",help:"unload it, and keep it stopped across a login"},{value:"restart",help:"what you run after editing agent.yaml or .env"},{value:"status",help:"running? how many restarts? why did it stop? — bare, reports every agent"},{value:"logs",help:"the tail of stderr; --lines, --follow, --truncate"}]},{name:"agent",required:!1,help:"path or sandbox agent name (omit only for status)"}],flags:[{name:"lines",kind:"number",placeholder:"n",integer:!0,min:1,help:"how much of the log to show",defaultHelp:"40"},{name:"follow",short:"f",kind:"boolean",help:"keep printing as the service writes — both streams; ctrl-C stops (logs)"},{name:"truncate",kind:"boolean",help:"empty the log files (logs)"},{name:"dry-run",kind:"boolean",help:"print the service definition and the checks; write nothing"},a,e]}];function TA(s){return rt.find((o)=>o.name===s)}function cn(s){return[...s.flags,...gn]}function ss(s,o){return rt.filter((r)=>r.name!==o&&r.flags.some((l)=>l.name===s)).map((r)=>r.name)}function as(s,o){let r=(o??"").trim();if(r==="")return{action:void 0,ref:void 0};return(TA(s)?.args??[]).find((i)=>i.name==="action")?.choices?.map((i)=>i.value)?.includes(r)===!0?{action:r,ref:void 0}:{action:void 0,ref:r}}
3
+ export{gn,rt,TA,cn,ss,as};
4
+
5
+ //# debugId=57DDBC4A325EEA2B64756E2164756E21
6
+ //# sourceMappingURL=index-9914wh1d.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/lib/commands.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * The command table — data only, no rendering and no parsing.\n *\n * One source of truth for three consumers: `args.ts` parses against it, `help.ts` renders from it,\n * and error messages look flags up in it to say which command *does* accept a flag. Before this\n * existed the usage text was a hand-maintained string with no link to the parser, and it had\n * already drifted — `agents` accepted flags it never documented.\n *\n * Nothing here contains the product name. Command names come from `BRAND.slug`, so a rename stays\n * the one-commit operation hard rule 3 requires.\n */\n\nimport { BRAND } from \"@dispach/core\"\nimport { DEFAULT_ROW_LIMIT, MIN_ROW_LIMIT } from \"#lib/const\"\nimport { PRESETS } from \"#lib/init-flow\"\nimport type { ArgSpec, CommandSpec, FlagSpec } from \"#lib/schema\"\n\n/** Accepted by every command, so the render mode is answered the same way everywhere. */\nexport const GLOBAL_FLAGS: readonly FlagSpec[] = [\n {\n name: \"plain\",\n kind: \"boolean\",\n help: \"force plain text — no interactive rendering, no colour\",\n },\n { name: \"help\", short: \"h\", kind: \"boolean\", help: \"show this help and exit\" },\n { name: \"version\", short: \"v\", kind: \"boolean\", help: \"print the version and exit\" },\n {\n // Global rather than per command, because the first-run bootstrap is checked before any\n // `case` block runs — and because somebody who does not want it does not want it once.\n // `<PREFIX>NO_BOOTSTRAP` is the same switch for a script that cannot add a flag.\n name: \"no-bootstrap\",\n kind: \"boolean\",\n help: \"never start a background server on this run\",\n },\n]\n\nconst MANIFEST: ArgSpec = {\n name: \"manifest\",\n required: true,\n help: \"path to an agent.yaml, or the name of a sandbox agent\",\n}\n\nconst STORE: FlagSpec = {\n name: \"store\",\n kind: \"string\",\n placeholder: \"path\",\n help: \"session database\",\n defaultHelp: `~/${BRAND.stateDir}/store.db`,\n}\n\nconst SESSION: FlagSpec = {\n name: \"session\",\n kind: \"string\",\n placeholder: \"key\",\n help: \"session key\",\n // Written on its own, it means \"ask me which one\" — the interactive twin of `--continue`. Safe as a\n // bare form because a session key cannot start with a dash, which is the condition `FlagSpec.bare`\n // documents; `run` opens the picker and every other command reports that it needs a key.\n bare: \"\",\n}\n\nconst JSON_FLAG: FlagSpec = { name: \"json\", kind: \"boolean\", help: \"machine-readable output\" }\n\nexport const COMMANDS: readonly CommandSpec[] = [\n {\n // Interactive at a terminal; every question also has a flag so scripts and CI can run it.\n // It never asks for the API key itself — a prompt invites shoulder-surfing and a flag\n // writes the secret into shell history — so the generated .env has an empty line to fill.\n name: \"init\",\n\n inSession: \"hidden\",\n // Not the bootstrap's: `init` asks whether to keep a server running, and a bootstrap that\n // installed one before the question was asked made the answer decorative. `init` starts\n // the host itself, after the files exist, when the answer is `service`.\n needsServer: false,\n summary: \"create a new agent: manifest, workspace, and env files\",\n // No positional. It used to be the target *directory*, which read as the agent's name and\n // was not — `init milo` silently wrote ./milo into whatever checkout you were standing in,\n // and an agent outside the sandbox has no bare name, so every later command needed a path.\n args: [],\n unexpectedArgHint:\n \"init takes no positional argument. To name the agent, --name <name>; to place it somewhere other than the sandbox, --dir <path>.\",\n flags: [\n { name: \"user\", kind: \"string\", placeholder: \"name\", help: \"your name\" },\n { name: \"name\", kind: \"string\", placeholder: \"name\", help: \"the agent's name\" },\n {\n name: \"purpose\",\n kind: \"string\",\n placeholder: \"text\",\n help: \"one line: what the agent is for\",\n },\n {\n name: \"preset\",\n kind: \"string\",\n placeholder: \"id\",\n // Derived, not written down. This list said \"openai | anthropic | deepseek |\n // ollama | custom\" while `PRESETS` had grown to nine — a hand-kept copy beside a\n // real table, which is the drift this repo keeps paying for and which `--help`\n // exists to be the authority on.\n help: `model endpoint: ${PRESETS.map((preset) => preset.id).join(\" | \")}`,\n defaultHelp: \"openai\",\n },\n { name: \"model\", kind: \"string\", placeholder: \"id\", help: \"model id\" },\n { name: \"base-url\", kind: \"string\", placeholder: \"url\", help: \"endpoint base URL\" },\n {\n name: \"region\",\n kind: \"string\",\n placeholder: \"aws-region\",\n help: \"AWS region, with --preset bedrock (credentials come from the AWS chain)\",\n },\n {\n name: \"api-key-env\",\n kind: \"string\",\n placeholder: \"VAR\",\n help: \"env var that will hold the key; omitted for ollama\",\n defaultHelp: \"MODEL_API_KEY\",\n },\n {\n name: \"system\",\n kind: \"string\",\n placeholder: \"level\",\n help: \"what it may touch on this machine: none | read | write | full\",\n defaultHelp: \"none\",\n },\n {\n name: \"web\",\n kind: \"string\",\n placeholder: \"level\",\n help: \"internet access: none | fetch | search\",\n defaultHelp: \"none\",\n },\n {\n name: \"web-backend\",\n kind: \"string\",\n placeholder: \"id\",\n help: \"search backend when --web search: tavily | brave | exa\",\n defaultHelp: \"tavily\",\n },\n {\n name: \"composio\",\n kind: \"string\",\n placeholder: \"level\",\n help: \"your other apps via Composio: none | connected\",\n defaultHelp: \"none\",\n },\n {\n name: \"telegram\",\n kind: \"string\",\n placeholder: \"level\",\n help: \"reachable on Telegram: none | connected\",\n defaultHelp: \"none\",\n },\n {\n name: \"telegram-allow\",\n kind: \"string\",\n placeholder: \"@handle\",\n help: \"who may message it — empty permits nobody, which is the safe default\",\n },\n {\n name: \"whatsapp\",\n kind: \"string\",\n placeholder: \"level\",\n help: \"reachable on WhatsApp: none | connected — unofficial, bundled with the binary\",\n defaultHelp: \"none\",\n },\n {\n // A number, not a secret: unlike a bot token there is nothing here worth keeping out\n // of shell history, so this one gets a flag and `--telegram-allow`'s twin does not\n // need explaining twice.\n name: \"whatsapp-number\",\n kind: \"string\",\n placeholder: \"digits\",\n help: \"the account's own number to pair with (pairWith) — digits with no +; empty pairs by QR\",\n },\n {\n name: \"server\",\n kind: \"string\",\n placeholder: \"level\",\n // No wizard step since 0.1.2 — flag-only, like `--schedules`. An always-on server is\n // the product, so `local` is the default and `none` is the deliberate opt-out.\n help: \"serve the HTTP API: none | local\",\n defaultHelp: \"local\",\n },\n {\n name: \"schedules\",\n kind: \"string\",\n placeholder: \"what\",\n help: \"run something on a schedule: none | daily | hourly\",\n defaultHelp: \"none\",\n },\n {\n name: \"skills\",\n kind: \"string\",\n placeholder: \"level\",\n // A phrase as well as a level, because the interesting answer is \"find me one\". The\n // default stays `starter` so a scripted run reaches no network.\n help: 'none | starter, or words to search the catalogues for — --skills \"pdf tables\"',\n defaultHelp: \"starter\",\n },\n {\n name: \"daemon\",\n kind: \"string\",\n placeholder: \"level\",\n help: \"keep it running in the background: none | service\",\n defaultHelp: \"none\",\n },\n {\n name: \"dir\",\n kind: \"string\",\n placeholder: \"path\",\n help: \"write the agent here instead of the sandbox\",\n defaultHelp: `~/${BRAND.stateDir}/agents/<agent-name-slug>`,\n },\n {\n name: \"yes\",\n kind: \"boolean\",\n help: \"take every default; never ask, even at a terminal\",\n },\n {\n name: \"measure-window\",\n kind: \"boolean\",\n help: \"ask the endpoint for the model's window and write it (the wizard always asks)\",\n },\n ],\n },\n {\n name: \"run\",\n\n inSession: \"hidden\",\n needsServer: true,\n summary: \"start an interactive session — bare `run` picks from the sandbox\",\n args: [\n {\n ...MANIFEST,\n required: false,\n help: \"path or sandbox agent name (omit to pick from the sandbox)\",\n },\n ],\n flags: [\n { ...SESSION, defaultHelp: \"a new one each run; bare --session picks from the list\" },\n {\n name: \"continue\",\n short: \"c\",\n kind: \"boolean\",\n help: \"pick up the most recent conversation with this agent\",\n },\n {\n name: \"input\",\n kind: \"string\",\n placeholder: \"text\",\n help: \"run one turn, print the reply, exit\",\n },\n STORE,\n {\n name: \"ephemeral\",\n kind: \"boolean\",\n help: \"keep this session in memory only; nothing is written\",\n },\n { name: \"quiet\", kind: \"boolean\", help: \"suppress the banner and per-turn stats\" },\n {\n // The same override `keys` carries, on the command that actually holds a session. The env\n // form works everywhere; a flag exists because the case this covers is \"try it without,\n // once\" and reaching for a variable to answer a one-off question is friction.\n name: \"no-enhanced-keys\",\n kind: \"boolean\",\n help: \"do not negotiate the kitty keyboard protocol (cmd chords stop arriving)\",\n },\n {\n name: \"no-reasoning\",\n kind: \"boolean\",\n help: \"hide the thinking a reasoning model streams (shown by default)\",\n },\n {\n // Kept so existing scripts keep working. Reasoning is on by default now, so this\n // asks for what already happens — harmless, and cheaper than breaking a flag people\n // have in their shell history.\n name: \"show-reasoning\",\n kind: \"boolean\",\n help: \"no-op: reasoning is shown by default when the model has any\",\n },\n ],\n },\n {\n // Reading, enabling and disabling — but never *writing* a schedule.\n //\n // Creating one from the CLI would be a third writer beside the manifest and the API, each\n // with its own idea of what a valid expression is; the manifest is where a schedule belongs,\n // because it is the thing that survives a rebuild and shows up in a diff. What the CLI adds\n // is the two questions a file cannot answer: when does this actually fire next, and did the\n // last run work.\n name: \"schedules\",\n\n // A view: a list somebody reads and then acts on, like `sessions`.\n inSession: \"view\",\n needsServer: true,\n summary: \"list schedules, when they next fire, and how the last run went\",\n args: [MANIFEST],\n flags: [\n {\n name: \"id\",\n kind: \"string\",\n placeholder: \"schedule\",\n help: \"show one schedule in full instead of the list\",\n },\n {\n name: \"enable\",\n kind: \"string\",\n placeholder: \"schedule\",\n help: \"switch an API-created schedule on; a manifest one is enabled in agent.yaml\",\n },\n {\n name: \"disable\",\n kind: \"string\",\n placeholder: \"schedule\",\n help: \"switch an API-created schedule off; a manifest one is disabled in agent.yaml\",\n },\n {\n name: \"recipients\",\n kind: \"boolean\",\n // The question a manifest cannot answer and this command is already holding the\n // store to answer: what do I put in `deliver.to`. A handle is the form a person\n // knows and the form that fails.\n help: \"list the addresses this agent can deliver to — what deliver.to takes\",\n },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n name: \"sessions\",\n\n // A view rather than an output pane: the list is a *choice*, and reading it read-only was the one\n // thing you could already do by exiting and passing `--session`. Enter switches.\n inSession: \"view\",\n needsServer: false,\n summary: \"list stored sessions, or inspect one\",\n args: [MANIFEST],\n flags: [\n { ...SESSION, help: \"show one session instead of the list\" },\n { name: \"turns\", kind: \"boolean\", help: \"show turn records instead of messages\" },\n {\n name: \"clear\",\n kind: \"boolean\",\n help: \"delete the named session's history; memory files are untouched\",\n },\n {\n name: \"limit\",\n kind: \"number\",\n placeholder: \"n\",\n help: \"rows to show\",\n defaultHelp: String(DEFAULT_ROW_LIMIT),\n min: MIN_ROW_LIMIT,\n integer: true,\n },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n // Two questions, and they are asked of the *index* rather than of the files. `search` is what\n // makes a ranking explicable — it prints the lexical score beside the boosted one, so \"retrieved\n // because it is about your question\" and \"retrieved because it is recent\" are distinguishable\n // without reading the code. `rebuild` exists because staleness detection is mtime plus size, and\n // an edit that preserves both is a real blind spot rather than a hypothetical one.\n name: \"memory\",\n\n // A view: the result is a list somebody reads and then wants to act on. Read-only for now —\n // deleting a memory means editing the file, which is the point of files being canonical.\n inSession: \"view\",\n needsServer: false,\n summary: \"search what the agent remembers, or rebuild the index from the files\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n {\n value: \"search\",\n help: \"rank the corpus against a query, exactly as a turn would\",\n },\n {\n value: \"rebuild\",\n help: \"forget the index and re-read every file — for an edit that kept the mtime\",\n },\n ],\n },\n { ...MANIFEST, required: true },\n {\n name: \"query\",\n required: false,\n help: \"the words to search for (search only); quote a phrase\",\n },\n ],\n flags: [\n STORE,\n {\n name: \"limit\",\n kind: \"number\",\n placeholder: \"n\",\n help: \"passages to show\",\n defaultHelp: \"10\",\n min: 1,\n integer: true,\n },\n {\n // The manifest's `memory.threshold` is what a *turn* applies. A search is a person\n // asking what is in there, and a floor that hid the near-misses would make the command\n // useless for the question it exists to answer — \"why did it not recall that?\"\n name: \"all\",\n kind: \"boolean\",\n help: \"show passages below the manifest's threshold too, marked\",\n },\n JSON_FLAG,\n ],\n },\n {\n // A person's editor for the manifest. `config_read`/`config_set` are the *agent's*, and they\n // are deliberately floored on the fields decision 11.29 reserves for a person — which left\n // those fields with no editor at all until this existed.\n //\n // `view`, because bare `/config` opens the editor — a surface somebody navigates — while every\n // other action is a listing or a one-line report and falls through to an output pane. That\n // fallthrough is the existing contract for a view: \"a view named in the table with nothing built\n // yet falls back to its own output\".\n name: \"config\",\n\n inSession: \"view\",\n needsServer: false,\n summary: \"read and change an agent's settings, and fill in its secrets\",\n args: [\n {\n name: \"action\",\n // Optional, because `config <agent>` with no action opens the editor. `readAction`\n // decides which of the two the first positional is; the six action words win.\n required: false,\n help: \"what to do (default: edit)\",\n choices: [\n {\n value: \"edit\",\n help: \"the full-screen editor — also what bare `config <agent>` opens\",\n },\n { value: \"list\", help: \"every setting, its current value, and who may set it\" },\n { value: \"get\", help: \"one setting\" },\n { value: \"set\", help: \"change one setting\" },\n {\n value: \"env\",\n help: \"put a secret in the .env beside the manifest, prompted and not echoed\",\n },\n {\n value: \"allow\",\n help: \"add or remove a handle a channel accepts messages from\",\n },\n ],\n },\n // Not required: `config <agent>` puts the agent in positional 0, and `readAction` moves it.\n // Declaring it required would fail on arity before that ever ran.\n { ...MANIFEST, required: false },\n {\n name: \"name\",\n required: false,\n help: \"the setting's dotted path, an env variable name, or a handle\",\n },\n { name: \"value\", required: false, help: \"the new value (set only)\" },\n ],\n flags: [\n STORE,\n {\n name: \"channel\",\n kind: \"string\",\n placeholder: \"id\",\n help: \"which channel to allow on, when there is more than one\",\n },\n {\n name: \"remove\",\n kind: \"boolean\",\n help: \"take the handle off instead of adding it (allow only)\",\n },\n {\n // Only reaches the two edits that stop a check running. Everything else applies\n // without asking, so this is not the flag people learn to type by reflex.\n name: \"yes\",\n kind: \"boolean\",\n help: \"skip the confirmation on an edit that weakens a check\",\n },\n ],\n },\n {\n // Who owns the agents on this machine (decisions 15.7, 15.14). `init` makes you the owner of\n // what it creates; `adopt` does it for an agent that already existed. `hidden` for the reason\n // `stop` is: adopting reloads the agent, which would be the one a session is attached to.\n name: \"owner\",\n\n inSession: \"hidden\",\n needsServer: false,\n summary: \"show who owns this machine's agents, or make an existing agent yours\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n { value: \"show\", help: \"print the owner id init minted for this sandbox\" },\n {\n value: \"adopt\",\n help: \"make an agent yours: assign it, recognise you on its channels, one conversation everywhere\",\n },\n ],\n },\n { ...MANIFEST, required: false },\n ],\n flags: [STORE, JSON_FLAG],\n },\n {\n name: \"validate\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"load and validate a manifest, then exit\",\n args: [MANIFEST],\n flags: [JSON_FLAG],\n },\n {\n // Distinct from `validate`, which asks whether the manifest loads. This asks whether the\n // *writing* is any good — the authoring rules of 07-SPEC-WORKSPACE.md, which are judgements\n // rather than facts and are therefore warnings that never fail the command.\n name: \"workspace\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"check the workspace files against the authoring rules\",\n args: [MANIFEST],\n flags: [\n {\n name: \"strict\",\n kind: \"boolean\",\n help: \"exit non-zero when any authoring warning is reported\",\n },\n JSON_FLAG,\n ],\n },\n {\n // A scaffold, never a summary: headings and <rules> blocks survive verbatim, prose becomes\n // placeholders a person fills. Automatic distillation of an identity document drops exactly\n // the parts that produce voice, which is why this is a command and not something load does.\n name: \"soul\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"scaffold a hand-edited compact identity from a long-form document\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n { value: \"distill\", help: \"scaffold a compact identity beside the source\" },\n ],\n },\n { name: \"file\", required: true, help: \"path to the long-form identity document\" },\n ],\n flags: [\n {\n name: \"out\",\n kind: \"string\",\n placeholder: \"path\",\n help: \"where to write the scaffold\",\n defaultHelp: \"<file>.compact.md beside the source\",\n },\n ],\n },\n {\n // Three questions rather than one. `validate` warns and exits 0 like `workspace` does, because\n // everything it reports is a judgement — a skill that does not load has already failed by then.\n name: \"skills\",\n\n inSession: \"view\",\n needsServer: false,\n summary: \"browse the catalogue and install — or list, scaffold, check one agent's skills\",\n args: [\n {\n name: \"action\",\n // Optional, so bare `skills` is the browse screen. That is the entry point somebody who\n // wants a skill actually has: every other form needs an agent, a query or a slug they\n // have not seen yet.\n required: false,\n help: \"what to do — omit to browse the catalogue and tick what you want\",\n choices: [\n { value: \"list\", help: \"every skill, its size, and whether it ships scripts\" },\n {\n value: \"show\",\n help: \"one skill in full, including what the model never sees\",\n },\n {\n value: \"new\",\n help: \"scaffold a skill, turning skills on for this agent if they are not\",\n },\n {\n value: \"install\",\n help: \"install one by name — anthropic/pdf — or copy from a local path (see `sources`)\",\n },\n { value: \"remove\", help: \"delete a skill's directory and everything in it\" },\n { value: \"validate\", help: \"authoring warnings — never a refusal\" },\n ],\n },\n {\n ...MANIFEST,\n required: false,\n help: \"path or sandbox agent name (not used when browsing)\",\n },\n {\n name: \"name\",\n required: false,\n help: \"the skill for show, new and remove — for install, <source>/<skill> or a local path\",\n },\n ],\n flags: [\n {\n name: \"strict\",\n kind: \"boolean\",\n help: \"exit non-zero when any authoring warning is reported\",\n },\n JSON_FLAG,\n ],\n },\n {\n // Machine-level, so it takes no manifest — the split from `skills` that keeps every positional\n // here meaning one thing. A source is a place the person trusts; a skill is one agent's.\n name: \"sources\",\n\n inSession: \"view\",\n needsServer: false,\n summary: \"the repositories skills come from: list, add, search\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n { value: \"list\", help: \"every source, and whether it has been fetched\" },\n { value: \"add\", help: \"add a repository — a URL, or a name and a URL\" },\n { value: \"remove\", help: \"stop searching a source; built-ins included\" },\n { value: \"update\", help: \"re-fetch every source, or the ones named\" },\n {\n value: \"search\",\n help: \"find a skill across every source; fetches on first use\",\n },\n ],\n },\n {\n name: \"rest\",\n required: false,\n variadic: true,\n help: \"a name and URL for add, a name for remove or update, words for search\",\n },\n ],\n flags: [\n {\n name: \"path\",\n kind: \"string\",\n placeholder: \"dir\",\n help: \"subdirectory holding the skills (add)\",\n defaultHelp: \"the whole repository\",\n },\n {\n name: \"ref\",\n kind: \"string\",\n placeholder: \"branch\",\n help: \"branch or tag to track (add)\",\n defaultHelp: \"the remote's default branch\",\n },\n JSON_FLAG,\n ],\n },\n {\n // Action first, manifest second, like `config`, `memory` and `plugins`. The action is\n // *optional* here because bare `channels <agent>` is the question people actually have —\n // \"what is this reachable on, and is it set up\" — and making them type `list` for it would\n // be ceremony. That is `skills`'s shape rather than `plugins`'s, and the difference is real:\n // `plugins` has no useful bare form, since a plugin is named in one place.\n name: \"channels\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"what an agent is reachable on: connect, disconnect, set a credential, unpair\",\n args: [\n {\n name: \"action\",\n required: false,\n help: \"what to do — omit for the listing\",\n choices: [\n {\n value: \"list\",\n help: \"every channel, whether it is on, and whether its credential is filled in\",\n },\n {\n value: \"connect\",\n help: \"switch a channel on; it starts at the agent's next start\",\n },\n {\n value: \"disconnect\",\n help: \"switch it off — a disabled channel is never constructed\",\n },\n {\n value: \"credential\",\n help: \"set the channel's token in the .env, prompted and not echoed\",\n },\n {\n value: \"pair\",\n help: \"connect it the way that channel needs — a code for WhatsApp, a token for Telegram\",\n },\n {\n value: \"unpair\",\n help: \"forget a scanned pairing, so the next start offers a new code\",\n },\n ],\n },\n { ...MANIFEST, required: false, help: \"path or sandbox agent name\" },\n {\n name: \"channel\",\n required: false,\n help: \"which channel — its id, not its type. Optional when the agent has exactly one\",\n },\n ],\n flags: [JSON_FLAG],\n },\n {\n // Action first, manifest second — the shape `config` and `memory` already use. `plugins <agent>`\n // was the whole command until there was something to install, and a bare positional cannot stay\n // the agent once `add` and `remove` exist: an agent may legitimately be named `add`.\n name: \"plugins\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"install a plugin, list what an agent loaded, or remove one\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n {\n value: \"list\",\n help: \"what this agent loaded, from where, and what it asked for\",\n },\n { value: \"add\", help: \"fetch a plugin from git and name it in this agent\" },\n {\n value: \"remove\",\n help: \"drop the entry, and the directory when no agent needs it\",\n },\n ],\n },\n MANIFEST,\n {\n name: \"rest\",\n required: false,\n variadic: true,\n help: \"a repository for add — owner/repo, a clone URL, or a page URL — or a name for remove\",\n },\n ],\n flags: [\n {\n name: \"ref\",\n kind: \"string\",\n placeholder: \"tag\",\n help: \"branch, tag or commit to fetch (add) — the only thing that pins the code\",\n defaultHelp: \"the remote's default branch\",\n },\n {\n name: \"name\",\n kind: \"string\",\n placeholder: \"name\",\n help: \"install under this name (add), which is what the `plugins:` entry will say\",\n defaultHelp: \"the repository or subdirectory name\",\n },\n JSON_FLAG,\n ],\n },\n {\n name: \"agents\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"the agents in the sandbox, and whether anything is serving them\",\n args: [\n {\n ...MANIFEST,\n required: false,\n variadic: true,\n help: \"paths or sandbox names to describe in full — bare, lists the sandbox\",\n },\n ],\n flags: [STORE, JSON_FLAG],\n },\n {\n // `daemon restart` restarts the *service* — every agent it hosts. This reloads one agent in\n // place, which is what a person wants after pairing a channel or editing agent.yaml, and it\n // was reachable only as `/restart` inside a session or as `POST /v1/agents/:id/reload`.\n name: \"restart\",\n\n inSession: \"hidden\",\n needsServer: false,\n summary: \"reload one agent on the running host, or restart the whole service\",\n args: [\n {\n ...MANIFEST,\n required: false,\n help: \"path or sandbox agent name — bare, restarts the background service\",\n },\n ],\n flags: [STORE, JSON_FLAG],\n },\n {\n // One screen for the question people actually have — \"is it running and is it working?\" —\n // which `daemon status`, `agents` and `/status` each answered a third of.\n name: \"status\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"the service, the hosts, every agent and its channels — one screen\",\n args: [],\n flags: [STORE, JSON_FLAG],\n },\n {\n name: \"logs\",\n\n // Hidden from the session palette, where `/daemon logs` already is: two rows for one log\n // would spend a landing row on a duplicate.\n inSession: \"hidden\",\n needsServer: false,\n summary: \"the server's stderr tail — the same as `daemon logs`\",\n args: [\n {\n ...MANIFEST,\n required: false,\n help: \"path or sandbox agent name — bare, the server's own log\",\n },\n ],\n flags: [\n {\n name: \"lines\",\n kind: \"number\",\n placeholder: \"n\",\n integer: true,\n min: 1,\n help: \"how much of the log to show\",\n defaultHelp: \"40\",\n },\n {\n name: \"follow\",\n short: \"f\",\n kind: \"boolean\",\n help: \"keep printing new lines until interrupted\",\n },\n { name: \"truncate\", kind: \"boolean\", help: \"empty the log first, in place\" },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n // The one command whose whole purpose is to make a network call, which is why it is a command\n // rather than something boot does: boot resolves a remote catalogue from disk so that nothing\n // touches the network before readiness, and an empty cache would otherwise deadlock — the load\n // fails on unresolved slugs, so the post-readiness refresh that would have filled it never runs.\n name: \"tools\",\n\n inSession: \"output\",\n needsServer: false,\n summary:\n \"show the resolved tool catalogue, or fetch a remote provider's schemas into the cache\",\n args: [MANIFEST],\n flags: [\n {\n name: \"warm\",\n kind: \"boolean\",\n help: \"fetch every pinned slug from the provider and write the resolution cache\",\n },\n JSON_FLAG,\n ],\n },\n {\n // The only command that opens a listening socket, and the only one that starts channels.\n // `run` builds the same runtime without them: a REPL that quietly began answering Telegram\n // while you typed at it would be a surprise.\n name: \"serve\",\n\n inSession: \"hidden\",\n needsServer: false,\n summary: \"run the HTTP API and connect the agents' channels\",\n // Variadic since 16.2a. One process hosts N agents — decision 8.5 has said so since the\n // beginning, and only this line pinned the product to one. The bind is process-level, so a\n // second manifest declaring a *different* `server.port`, `host` or `tokenEnv` is refused\n // rather than silently ignored.\n //\n // **Optional since 16.3**, which is what makes the product always-on: naming nothing hosts\n // the sandbox's enabled agents, so a host does not have to be told which agents to serve —\n // and one that did could never serve an agent provisioned after it started. Naming\n // manifests is the container's shape, where the agent arrives on a mount.\n args: [\n {\n ...MANIFEST,\n required: false,\n variadic: true,\n help: \"paths to an agent.yaml, or sandbox agent names (omit for every enabled agent)\",\n },\n ],\n flags: [\n {\n name: \"port\",\n kind: \"number\",\n placeholder: \"n\",\n help: \"port to bind\",\n defaultHelp: \"server.port, or 7420\",\n },\n {\n name: \"host\",\n kind: \"string\",\n placeholder: \"addr\",\n help: \"address to bind — a non-loopback host requires an API token\",\n defaultHelp: \"server.host, or 127.0.0.1\",\n },\n {\n // The escape from a lockout, and the reason it needs to exist: a claim is printed\n // only while no operator key is live, so an operator who loses the only key on a\n // server with no configured token has no route back in. A person able to run\n // `serve` on that machine already holds the store file, so the flag confers nothing\n // they could not get with sqlite3 — it just makes the recovery nameable.\n name: \"claim\",\n kind: \"boolean\",\n help: \"print a one-time claim even when a key already exists\",\n },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n /**\n * Operator credentials, from a terminal.\n *\n * **Not `keys`**, which is taken by the keyboard diagnostic below — two unrelated meanings\n * under one verb costs somebody a confused minute every time they reach for either. `token`\n * loses to `server.tokenEnv`, a different credential this command can neither mint nor\n * revoke. `credential` is the word the spec and the store already use.\n *\n * `needsServer` is **true**: a credential belongs to a server rather than to a file, and\n * this is an HTTP client. Writing the store directly would bypass the label rule, the scope\n * validation and the refusal of a scope naming an agent that does not exist — the two\n * surfaces would then disagree about what a valid credential is.\n */\n name: \"credential\",\n // Minting a credential from inside a chat would print a secret into a transcript that is\n // then stored, indexed and retrievable. The one place it must not appear.\n inSession: \"hidden\",\n needsServer: true,\n summary: \"mint, list and revoke operator credentials, optionally scoped\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n { value: \"create\", help: \"mint one and print the secret, once\" },\n { value: \"list\", help: \"every credential, live and revoked, with its scope\" },\n { value: \"revoke\", help: \"kill one permanently\" },\n ],\n },\n {\n name: \"keyId\",\n required: false,\n help: \"which credential, for revoke (`credential list` prints the ids)\",\n },\n ],\n flags: [\n {\n name: \"label\",\n kind: \"string\",\n placeholder: \"text\",\n help: \"how it is shown in a listing — required for create\",\n },\n {\n name: \"agents\",\n kind: \"string\",\n placeholder: \"a,b\",\n help: \"narrow it to these agents\",\n defaultHelp: \"every agent\",\n },\n {\n name: \"sessions\",\n kind: \"string\",\n placeholder: \"prefix\",\n help: \"narrow it to session keys starting with this\",\n defaultHelp: \"every session\",\n },\n {\n name: \"can\",\n kind: \"string\",\n placeholder: \"list\",\n help: \"narrow it to these capabilities: read | chat | write | admin\",\n defaultHelp: \"all of them\",\n },\n {\n name: \"expires\",\n kind: \"string\",\n placeholder: \"dur\",\n help: \"how long it lives: 30s, 15m, 2h, 7d, or seconds\",\n defaultHelp: \"never\",\n },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n // The instrument, not a setting. `terminal-setup` below changes a terminal's configuration; this\n // one only reports what the current terminal already does, which is the question that has to be\n // answered first and could not be until now.\n name: \"keys\",\n inSession: \"hidden\",\n needsServer: false,\n summary: \"press a chord and see the bytes, Ink's reading of them, and the intent\",\n args: [],\n flags: [\n {\n name: \"no-enhanced-keys\",\n kind: \"boolean\",\n help: \"do not negotiate the kitty keyboard protocol\",\n },\n ],\n },\n {\n // The only command that edits a file outside the workspace, which is why it prints the change\n // first and asks. ⌥⏎ needs none of it — this is for people who want shift+⏎ as well.\n name: \"terminal-setup\",\n\n inSession: \"hidden\",\n needsServer: false,\n summary: \"teach this terminal to send shift+enter as a new line\",\n args: [],\n flags: [\n { name: \"dry-run\", kind: \"boolean\", help: \"print the change and write nothing\" },\n { name: \"yes\", kind: \"boolean\", help: \"write it without asking\" },\n JSON_FLAG,\n ],\n },\n {\n // The switch that turns everything off. Separate from `daemon stop`, which needs you to\n // know the agent: this one finds the services *and* a `serve` left in a forgotten tab.\n // The mirror of `init`: it created a directory, a manifest and a workspace, and everything since\n // has scattered into a shared store keyed by manifest id, a log pair, and possibly a LaunchAgent.\n // `hidden` for the same reason `stop` is — removing the agent you are talking to is worse than\n // stopping it.\n name: \"remove\",\n\n inSession: \"hidden\",\n needsServer: false,\n summary: \"delete a sandbox agent: its directory, sessions, memory, logs and service\",\n args: [\n {\n name: \"agent\",\n required: false,\n help: \"sandbox agent name (a path is refused — remove only manages agents `init` made)\",\n },\n ],\n flags: [\n {\n name: \"dry-run\",\n kind: \"boolean\",\n help: \"show exactly what would go; delete nothing\",\n },\n {\n name: \"files-only\",\n kind: \"boolean\",\n help: \"delete the directory and keep the sessions, memory and logs\",\n },\n {\n name: \"prune\",\n kind: \"boolean\",\n help: \"delete sessions, memory and logs that no sandbox agent claims any more\",\n },\n { name: \"all\", kind: \"boolean\", help: \"remove every agent in the sandbox\" },\n {\n name: \"yes\",\n kind: \"boolean\",\n help: \"skip the typed confirmation (required to delete anything non-interactively)\",\n },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n name: \"stop\",\n\n inSession: \"hidden\",\n needsServer: false,\n summary: \"stop one agent for good, or everything — named, it stays stopped across restarts\",\n args: [\n {\n name: \"agent\",\n required: false,\n help: \"path or sandbox agent name (omit to stop the whole host)\",\n },\n ],\n flags: [\n {\n name: \"dry-run\",\n kind: \"boolean\",\n help: \"list what would be stopped; stop nothing\",\n },\n {\n name: \"reason\",\n kind: \"string\",\n help: \"why — recorded, and shown wherever the agent is reported as off\",\n },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n // The other half of `stop <agent>`. Not `daemon start`, which starts a *process*: this\n // decides what a running process holds, which since 16.2a is a different question.\n name: \"start\",\n\n inSession: \"hidden\",\n needsServer: true,\n summary: \"switch an agent back on, and have a running host adopt it now\",\n args: [MANIFEST],\n flags: [STORE, JSON_FLAG],\n },\n {\n // `serve` stays up only as long as its terminal, which makes an agent configured for a\n // channel answer only while a window is open. This installs it as a supervised service.\n //\n name: \"model\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"ask the endpoint what it can actually do — window, output cap, prompt caching\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n {\n value: \"probe\",\n help: \"measure every configured role against its own endpoint\",\n },\n ],\n },\n { name: \"agent\", required: true, help: \"path or sandbox agent name\" },\n ],\n flags: [\n {\n name: \"window\",\n kind: \"boolean\",\n help: \"search for the window by growing a prompt until it is refused — costs real tokens, and prints the estimate first\",\n },\n {\n name: \"price\",\n kind: \"number\",\n placeholder: \"usd\",\n help: \"dollars per million input tokens, if you want --window's estimate in money\",\n },\n {\n name: \"write\",\n kind: \"boolean\",\n help: \"record a measured ceiling in the manifest; a floor is refused, because a floor is not a window\",\n },\n {\n name: \"yes\",\n kind: \"boolean\",\n help: \"answer the --window spend prompt; nothing else is affected\",\n },\n { name: \"json\", kind: \"boolean\", help: \"machine-readable findings\" },\n ],\n },\n {\n name: \"web\",\n\n // A pane runs a command as a child and shows its output, which is right here: the effect is\n // a browser window, and one line saying where it went is all a session needs to report.\n inSession: \"output\",\n // `run` needs a host to point a browser at, and the first-run bootstrap is what makes\n // \"install, then open the page\" one step. `open` and `url` are read-only and say so when\n // nothing is running, rather than starting something on a machine that did not ask for it.\n needsServer: true,\n summary: \"open the browser view of a running agent\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n { value: \"run\", help: \"start a server if needed, then open the page\" },\n { value: \"open\", help: \"open the page of a server already running\" },\n {\n value: \"url\",\n help: \"print the address and open nothing — the form a pipe reads\",\n },\n ],\n },\n {\n name: \"agent\",\n // Optional: a bare `web open` points at the page, which lists what the host has.\n // Naming an agent is what puts `?agent=` in the URL for the page to read.\n required: false,\n help: \"path or sandbox agent name (omit to open the page itself)\",\n },\n ],\n flags: [\n {\n name: \"no-open\",\n kind: \"boolean\",\n help: \"print the URL instead of opening it\",\n },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n // Second action-as-positional command after `soul` — and the reason `ArgSpec.choices`\n // exists, since seven verbs hidden inside a prose help string is a set nothing can check.\n name: \"daemon\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"keep an agent serving in the background — starts at login, restarts on crash\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n {\n value: \"install\",\n help: \"check it will boot, write the service, load it, and watch it start\",\n },\n { value: \"uninstall\", help: \"unload it and remove the service definition\" },\n { value: \"start\", help: \"load it again after a stop\" },\n { value: \"stop\", help: \"unload it, and keep it stopped across a login\" },\n { value: \"restart\", help: \"what you run after editing agent.yaml or .env\" },\n {\n value: \"status\",\n help: \"running? how many restarts? why did it stop? — bare, reports every agent\",\n },\n {\n value: \"logs\",\n help: \"the tail of stderr; --lines, --follow, --truncate\",\n },\n ],\n },\n {\n name: \"agent\",\n // Optional so a bare `daemon status` can answer \"is anything running?\" — the\n // question people actually have, and one that should not require naming an agent.\n required: false,\n help: \"path or sandbox agent name (omit only for status)\",\n },\n ],\n flags: [\n {\n name: \"lines\",\n kind: \"number\",\n placeholder: \"n\",\n integer: true,\n min: 1,\n help: \"how much of the log to show\",\n defaultHelp: \"40\",\n },\n {\n name: \"follow\",\n short: \"f\",\n kind: \"boolean\",\n help: \"keep printing as the service writes — both streams; ctrl-C stops (logs)\",\n },\n { name: \"truncate\", kind: \"boolean\", help: \"empty the log files (logs)\" },\n {\n name: \"dry-run\",\n kind: \"boolean\",\n help: \"print the service definition and the checks; write nothing\",\n },\n // The server preflight reads the lease table to report agents another process holds,\n // so this command has a store to point at like the others do.\n STORE,\n JSON_FLAG,\n ],\n },\n]\n\nexport function findCommand(name: string): CommandSpec | undefined {\n return COMMANDS.find((command) => command.name === name)\n}\n\n/** Every flag a command accepts: its own plus the global ones. */\nexport function flagsFor(command: CommandSpec): readonly FlagSpec[] {\n return [...command.flags, ...GLOBAL_FLAGS]\n}\n\n/**\n * Commands other than `exclude` that declare `flag`.\n *\n * Turns \"unknown flag --json\" — true but useless, since `--json` plainly exists — into a message\n * that names where it does work.\n */\nexport function commandsAccepting(flag: string, exclude: string): readonly string[] {\n return COMMANDS.filter(\n (command) => command.name !== exclude && command.flags.some((f) => f.name === flag),\n ).map((command) => command.name)\n}\n\n/**\n * Split \"an action word, or an agent\" for a command whose action is optional.\n *\n * `channels <agent>` and `channels list <agent>` are both meant, so the first positional is one or\n * the other and only its *value* says which. The action words win, exactly as a slash command\n * resolves and as `config`'s own reader does — the difference being that this one reads the\n * **command's spec** for the words rather than holding a second copy of them, so an action added to\n * the table is covered with nothing to remember.\n */\nexport function actionOrRef(\n command: string,\n first: string | undefined,\n): { readonly action: string | undefined; readonly ref: string | undefined } {\n const given = (first ?? \"\").trim()\n if (given === \"\") return { action: undefined, ref: undefined }\n const actions = (findCommand(command)?.args ?? [])\n .find((arg) => arg.name === \"action\")\n ?.choices?.map((choice) => choice.value)\n return actions?.includes(given) === true\n ? { action: given, ref: undefined }\n : { action: undefined, ref: given }\n}\n"
6
+ ],
7
+ "mappings": ";8GAkBO,IAAM,GAAoC,CAC7C,CACI,KAAM,QACN,KAAM,UACN,KAAM,wDACV,EACA,CAAE,KAAM,OAAQ,MAAO,IAAK,KAAM,UAAW,KAAM,yBAA0B,EAC7E,CAAE,KAAM,UAAW,MAAO,IAAK,KAAM,UAAW,KAAM,4BAA6B,EACnF,CAII,KAAM,eACN,KAAM,UACN,KAAM,6CACV,CACJ,EAEM,EAAoB,CACtB,KAAM,WACN,SAAU,GACV,KAAM,uDACV,EAEM,EAAkB,CACpB,KAAM,QACN,KAAM,SACN,YAAa,OACb,KAAM,mBACN,YAAa,KAAK,EAAM,mBAC5B,EAEM,EAAoB,CACtB,KAAM,UACN,KAAM,SACN,YAAa,MACb,KAAM,cAIN,KAAM,EACV,EAEM,EAAsB,CAAE,KAAM,OAAQ,KAAM,UAAW,KAAM,yBAA0B,EAEhF,GAAmC,CAC5C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KAAM,YACN,KAAM,SACN,YAAa,OACb,KAAM,qDACN,YAAa,MACjB,EACA,CACI,KAAM,SACN,KAAM,SACN,YAAa,QAGb,KAAM,gFACN,YAAa,SACjB,EACA,CACI,KAAM,SACN,KAAM,SACN,YAAa,QACb,KAAM,oDACN,YAAa,MACjB,EACA,CACI,KAAM,MACN,KAAM,SACN,YAAa,OACb,KAAM,8CACN,YAAa,KAAK,EAAM,mCAC5B,EACA,CACI,KAAM,MACN,KAAM,UACN,KAAM,mDACV,EACA,CACI,KAAM,iBACN,KAAM,UACN,KAAM,+EACV,CACJ,CACJ,EACA,CACI,KAAM,MAEN,UAAW,SACX,YAAa,GACb,QAAS,mEACT,KAAM,CACF,IACO,EACH,SAAU,GACV,KAAM,4DACV,CACJ,EACA,MAAO,CACH,IAAK,EAAS,YAAa,wDAAyD,EACpF,CACI,KAAM,WACN,MAAO,IACP,KAAM,UACN,KAAM,sDACV,EACA,CACI,KAAM,QACN,KAAM,SACN,YAAa,OACb,KAAM,qCACV,EACA,EACA,CACI,KAAM,YACN,KAAM,UACN,KAAM,sDACV,EACA,CAAE,KAAM,QAAS,KAAM,UAAW,KAAM,wCAAyC,EACjF,CAII,KAAM,mBACN,KAAM,UACN,KAAM,yEACV,EACA,CACI,KAAM,eACN,KAAM,UACN,KAAM,gEACV,EACA,CAII,KAAM,iBACN,KAAM,UACN,KAAM,6DACV,CACJ,CACJ,EACA,CAQI,KAAM,YAGN,UAAW,OACX,YAAa,GACb,QAAS,iEACT,KAAM,CAAC,CAAQ,EACf,MAAO,CACH,CACI,KAAM,KACN,KAAM,SACN,YAAa,WACb,KAAM,+CACV,EACA,CACI,KAAM,SACN,KAAM,SACN,YAAa,WACb,KAAM,4EACV,EACA,CACI,KAAM,UACN,KAAM,SACN,YAAa,WACb,KAAM,8EACV,EACA,CACI,KAAM,aACN,KAAM,UAIN,KAAM,sEACV,EACA,EACA,CACJ,CACJ,EACA,CACI,KAAM,WAIN,UAAW,OACX,YAAa,GACb,QAA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KAAM,OACN,KAAM,UACN,KAAM,0EACV,EACA,CACJ,CACJ,EACA,CAII,KAAM,QAEN,UAAW,SACX,YAAa,GACb,QAAS,oDAUT,KAAM,CACF,IACO,EACH,SAAU,GACV,SAAU,GACV,KAAM,+EACV,CACJ,EACA,MAAO,CACH,CACI,KAAM,OACN,KAAM,SACN,YAAa,IACb,KAAM,eACN,YAAa,sBACjB,EACA,CACI,KAAM,OACN,KAAM,SACN,YAAa,OACb,KAAM,8DACN,YAAa,2BACjB,EACA,CAMI,KAAM,QACN,KAAM,UACN,KAAM,uDACV,EACA,EACA,CACJ,CACJ,EACA,CAcI,KAAM,aAGN,UAAW,SACX,YAAa,GACb,QAAS,gEACT,KAAM,CACF,CACI,KAAM,SACN,SAAU,GACV,KAAM,aACN,QAAS,CACL,CAAE,MAAO,SAAU,KAAM,qCAAsC,EAC/D,CAAE,MAAO,OAAQ,KAAM,oDAAqD,EAC5E,CAAE,MAAO,SAAU,KAAM,sBAAuB,CACpD,CACJ,EACA,CACI,KAAM,QACN,SAAU,GACV,KAAM,iEACV,CACJ,EACA,MAAO,CACH,CACI,KAAM,QACN,KAAM,SACN,YAAa,OACb,KAAM,oDACV,EACA,CACI,KAAM,SACN,KAAM,SACN,YAAa,MACb,KAAM,4BACN,YAAa,aACjB,EACA,CACI,KAAM,WACN,KAAM,SACN,YAAa,SACb,KAAM,+CACN,YAAa,eACjB,EACA,CACI,KAAM,MACN,KAAM,SACN,YAAa,OACb,KAAM,+DACN,YAAa,aACjB,EACA,CACI,KAAM,UACN,KAAM,SACN,YAAa,MACb,KAAM,kDACN,YAAa,OACjB,EACA,EACA,CACJ,CACJ,EACA,CAII,KAAM,OACN,UAAW,SACX,YAAa,GACb,QAAS,yEACT,KAAM,CAAC,EACP,MAAO,CACH,CACI,KAAM,mBACN,KAAM,UACN,KAAM,8CACV,CACJ,CACJ,EACA,CAGI,KAAM,iBAEN,UAAW,SACX,YAAa,GACb,QAAS,wDACT,KAAM,CAAC,EACP,MAAO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