dispach 0.2.2 → 0.2.4

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 (225) hide show
  1. package/README.md +34 -27
  2. package/dist/APEv2Parser-x13n424p.js +5 -0
  3. package/dist/{FlacParser-7t7da7qy.js.map → APEv2Parser-x13n424p.js.map} +1 -1
  4. package/dist/{AiffParser-y21k3fak.js → AiffParser-ns1y9f0g.js} +3 -3
  5. package/dist/{AiffParser-y21k3fak.js.map → AiffParser-ns1y9f0g.js.map} +1 -1
  6. package/dist/App-wkpkwgjt.js +11 -0
  7. package/dist/{App-4w3qkcs4.js.map → App-wkpkwgjt.js.map} +3 -3
  8. package/dist/AsfParser-bae2a1yf.js +5 -0
  9. package/dist/{AsfParser-wd98k2h4.js.map → AsfParser-bae2a1yf.js.map} +1 -1
  10. package/dist/ConfigEditor-hy9jtas3.js +6 -0
  11. package/dist/{ConfigEditor-vk7vxaa6.js.map → ConfigEditor-hy9jtas3.js.map} +1 -1
  12. package/dist/DsdiffParser-s0zvxnfa.js +5 -0
  13. package/dist/{DsdiffParser-cbfaj500.js.map → DsdiffParser-s0zvxnfa.js.map} +1 -1
  14. package/dist/{DsfParser-tybrja4x.js → DsfParser-90mvzt4v.js} +3 -3
  15. package/dist/{DsfParser-tybrja4x.js.map → DsfParser-90mvzt4v.js.map} +1 -1
  16. package/dist/FlacParser-8xprykrh.js +5 -0
  17. package/dist/{APEv2Parser-etzjd528.js.map → FlacParser-8xprykrh.js.map} +1 -1
  18. package/dist/{KeyProbe-5anphmb7.js → KeyProbe-fk5krzks.js} +3 -3
  19. package/dist/{KeyProbe-5anphmb7.js.map → KeyProbe-fk5krzks.js.map} +1 -1
  20. package/dist/MP4Parser-nmvbkq21.js +5 -0
  21. package/dist/{MP4Parser-gc94h1n9.js.map → MP4Parser-nmvbkq21.js.map} +2 -2
  22. package/dist/{MatroskaParser-cy2k4fac.js → MatroskaParser-tsmz2qfq.js} +3 -3
  23. package/dist/{MatroskaParser-cy2k4fac.js.map → MatroskaParser-tsmz2qfq.js.map} +1 -1
  24. package/dist/{MpegParser-c460fwf0.js → MpegParser-y5fjpaz9.js} +3 -3
  25. package/dist/{MpegParser-c460fwf0.js.map → MpegParser-y5fjpaz9.js.map} +1 -1
  26. package/dist/MusepackParser-544q0byg.js +5 -0
  27. package/dist/{MusepackParser-8mq2eabg.js.map → MusepackParser-544q0byg.js.map} +2 -2
  28. package/dist/OggParser-v77rbjnt.js +5 -0
  29. package/dist/{OggParser-7dnc6apg.js.map → OggParser-v77rbjnt.js.map} +1 -1
  30. package/dist/Picker-32m79nmp.js +5 -0
  31. package/dist/{Picker-j7txnm7w.js.map → Picker-32m79nmp.js.map} +1 -1
  32. package/dist/SessionPicker-9p06npt5.js +5 -0
  33. package/dist/{SessionPicker-hpv2ncsb.js.map → SessionPicker-9p06npt5.js.map} +1 -1
  34. package/dist/SkillBrowser-ezdx3xsh.js +5 -0
  35. package/dist/{SkillBrowser-qc542n71.js.map → SkillBrowser-ezdx3xsh.js.map} +1 -1
  36. package/dist/WavPackParser-k623m0hk.js +5 -0
  37. package/dist/{WavPackParser-kt7cds9c.js.map → WavPackParser-k623m0hk.js.map} +1 -1
  38. package/dist/WaveParser-nj4p1vx8.js +5 -0
  39. package/dist/{WaveParser-g47ja0vy.js.map → WaveParser-nj4p1vx8.js.map} +1 -1
  40. package/dist/WizardApp-p350qspw.js +5 -0
  41. package/dist/{WizardApp-q4p979d1.js.map → WizardApp-p350qspw.js.map} +1 -1
  42. package/dist/channels-a9zx9yba.js +31 -0
  43. package/dist/{channels-4t89qpdt.js.map → channels-a9zx9yba.js.map} +1 -1
  44. package/dist/client.d.ts +43 -0
  45. package/dist/client.js +9 -9
  46. package/dist/client.js.map +5 -5
  47. package/dist/components/App.d.ts.map +1 -1
  48. package/dist/config-3mz4zwsf.js +24 -0
  49. package/dist/{config-35r6n1gh.js.map → config-3mz4zwsf.js.map} +2 -2
  50. package/dist/credential-ja7zmd4c.js +19 -0
  51. package/dist/{credential-dpdgg4j6.js.map → credential-ja7zmd4c.js.map} +1 -1
  52. package/dist/index-039ew35r.js +6 -0
  53. package/dist/index-039ew35r.js.map +10 -0
  54. package/dist/index-0dvs3a06.js +6 -0
  55. package/dist/{index-jc4kmfwa.js.map → index-0dvs3a06.js.map} +1 -1
  56. package/dist/{index-pszmnhgq.js → index-1cagdzqe.js} +9 -9
  57. package/dist/{index-pszmnhgq.js.map → index-1cagdzqe.js.map} +1 -1
  58. package/dist/index-2fw9e5gg.js +6 -0
  59. package/dist/{index-0444sh6x.js.map → index-2fw9e5gg.js.map} +1 -1
  60. package/dist/{index-a2eh8dnk.js → index-2td5h856.js} +12 -12
  61. package/dist/{index-a2eh8dnk.js.map → index-2td5h856.js.map} +1 -1
  62. package/dist/{index-m6fqx0ch.js → index-446exxcb.js} +7 -7
  63. package/dist/{index-m6fqx0ch.js.map → index-446exxcb.js.map} +1 -1
  64. package/dist/{index-snz49ndn.js → index-4fajxhdv.js} +4 -4
  65. package/dist/{index-snz49ndn.js.map → index-4fajxhdv.js.map} +1 -1
  66. package/dist/index-4j65jp20.js +9 -0
  67. package/dist/{index-38gs9anh.js.map → index-4j65jp20.js.map} +1 -1
  68. package/dist/index-5gn74n56.js +10 -0
  69. package/dist/{index-ew997be5.js.map → index-5gn74n56.js.map} +2 -2
  70. package/dist/index-5zpfz4kb.js +9 -0
  71. package/dist/{index-8h6kewy1.js.map → index-5zpfz4kb.js.map} +1 -1
  72. package/dist/index-60h4knj6.js +126 -0
  73. package/dist/{index-zce9gy22.js.map → index-60h4knj6.js.map} +2 -2
  74. package/dist/index-635wcsh1.js +5 -0
  75. package/dist/{index-2bsardvh.js.map → index-635wcsh1.js.map} +1 -1
  76. package/dist/index-67sfck4d.js +110 -0
  77. package/dist/index-67sfck4d.js.map +13 -0
  78. package/dist/index-7p8d1gf0.js +63 -0
  79. package/dist/{index-ytxbw8py.js.map → index-7p8d1gf0.js.map} +1 -1
  80. package/dist/index-7zgjkbb0.js +5 -0
  81. package/dist/{index-qgsdgbk8.js.map → index-7zgjkbb0.js.map} +1 -1
  82. package/dist/{index-zw6wyas6.js → index-86rb86nr.js} +4 -4
  83. package/dist/{index-zw6wyas6.js.map → index-86rb86nr.js.map} +1 -1
  84. package/dist/{index-fbsrhcga.js → index-8jejze0z.js} +4 -4
  85. package/dist/{index-fbsrhcga.js.map → index-8jejze0z.js.map} +1 -1
  86. package/dist/index-8k8y7edx.js +7 -0
  87. package/dist/{index-3826kf9t.js.map → index-8k8y7edx.js.map} +1 -1
  88. package/dist/index-8mkatm20.js +6 -0
  89. package/dist/{index-42e29zs4.js.map → index-8mkatm20.js.map} +1 -1
  90. package/dist/{index-3vzf253k.js → index-9k6qa50r.js} +7 -7
  91. package/dist/{index-3vzf253k.js.map → index-9k6qa50r.js.map} +1 -1
  92. package/dist/{index-yw3fby4n.js → index-a1axc952.js} +4 -4
  93. package/dist/{index-yw3fby4n.js.map → index-a1axc952.js.map} +1 -1
  94. package/dist/index-ayhdn87b.js +6 -0
  95. package/dist/{index-dzy19wtf.js.map → index-ayhdn87b.js.map} +1 -1
  96. package/dist/index-b8bfzbfe.js +6 -0
  97. package/dist/{index-7mn8ack9.js.map → index-b8bfzbfe.js.map} +2 -2
  98. package/dist/index-brh25jhq.js +6 -0
  99. package/dist/{index-fa9wvpyw.js.map → index-brh25jhq.js.map} +2 -2
  100. package/dist/index-c6qrcweh.js +6 -0
  101. package/dist/{index-nxhqf597.js.map → index-c6qrcweh.js.map} +1 -1
  102. package/dist/index-cb45233h.js +6 -0
  103. package/dist/{index-nvc24414.js.map → index-cb45233h.js.map} +1 -1
  104. package/dist/{index-51x0n5z0.js → index-dcy14zdn.js} +5 -5
  105. package/dist/{index-51x0n5z0.js.map → index-dcy14zdn.js.map} +1 -1
  106. package/dist/index-f6r3h2yh.js +8 -0
  107. package/dist/{index-twn9bfm2.js.map → index-f6r3h2yh.js.map} +1 -1
  108. package/dist/index-gezqawvw.js +11 -0
  109. package/dist/{index-fcsg95m5.js.map → index-gezqawvw.js.map} +1 -1
  110. package/dist/index-h787rq0h.js +12 -0
  111. package/dist/{index-wc4entme.js.map → index-h787rq0h.js.map} +3 -3
  112. package/dist/index-hd5nkwd7.js +74 -0
  113. package/dist/index-hd5nkwd7.js.map +13 -0
  114. package/dist/index-k6wq0j4q.js +6 -0
  115. package/dist/{index-gq1npngp.js.map → index-k6wq0j4q.js.map} +1 -1
  116. package/dist/index-kz01jz58.js +6 -0
  117. package/dist/{index-323jvr1g.js.map → index-kz01jz58.js.map} +1 -1
  118. package/dist/{index-kjqksgch.js → index-mgef1n4e.js} +10 -10
  119. package/dist/{index-kjqksgch.js.map → index-mgef1n4e.js.map} +1 -1
  120. package/dist/{index-haypwvzd.js → index-n197qdw1.js} +188 -188
  121. package/dist/{index-haypwvzd.js.map → index-n197qdw1.js.map} +3 -3
  122. package/dist/index-nndwx2wp.js +153 -0
  123. package/dist/{index-z157at3s.js.map → index-nndwx2wp.js.map} +2 -2
  124. package/dist/index-pz92ksp8.js +5 -0
  125. package/dist/{index-3c5jt6by.js.map → index-pz92ksp8.js.map} +1 -1
  126. package/dist/index-qj4adnfe.js +14 -0
  127. package/dist/{index-eqqd4k4f.js.map → index-qj4adnfe.js.map} +2 -2
  128. package/dist/index-r83jpct7.js +6 -0
  129. package/dist/{index-gbkma7ds.js.map → index-r83jpct7.js.map} +2 -2
  130. package/dist/{index-2zjh5zd5.js → index-rqfwd7j5.js} +4 -4
  131. package/dist/{index-2zjh5zd5.js.map → index-rqfwd7j5.js.map} +1 -1
  132. package/dist/index-s0f0s6n5.js +6 -0
  133. package/dist/{index-p1zy871m.js.map → index-s0f0s6n5.js.map} +1 -1
  134. package/dist/index-s0t15ndj.js +6 -0
  135. package/dist/{index-8edck2pr.js.map → index-s0t15ndj.js.map} +1 -1
  136. package/dist/index-tc054tcb.js +6 -0
  137. package/dist/{index-8tmv33mr.js.map → index-tc054tcb.js.map} +1 -1
  138. package/dist/{index-095hrkyr.js → index-ts8a1sdn.js} +6 -6
  139. package/dist/{index-095hrkyr.js.map → index-ts8a1sdn.js.map} +1 -1
  140. package/dist/index-tv52jhac.js +1252 -0
  141. package/dist/{index-qg9bn980.js.map → index-tv52jhac.js.map} +15 -14
  142. package/dist/index-x9nn57kk.js +6 -0
  143. package/dist/{index-1x8mzvz7.js.map → index-x9nn57kk.js.map} +1 -1
  144. package/dist/{index-ynsvkqgb.js → index-xyh98x7p.js} +4 -4
  145. package/dist/{index-ynsvkqgb.js.map → index-xyh98x7p.js.map} +1 -1
  146. package/dist/{index-ma6p7bt4.js → index-yy4v9kca.js} +4 -4
  147. package/dist/{index-ma6p7bt4.js.map → index-yy4v9kca.js.map} +1 -1
  148. package/dist/{index-bqdkm3de.js → index-yz0fcxky.js} +4 -4
  149. package/dist/{index-bqdkm3de.js.map → index-yz0fcxky.js.map} +1 -1
  150. package/dist/{index-p6ya59m6.js → index-z4adxmzm.js} +5 -5
  151. package/dist/{index-p6ya59m6.js.map → index-z4adxmzm.js.map} +1 -1
  152. package/dist/{index-4fj1k64j.js → index-zzpgsbn3.js} +4 -4
  153. package/dist/{index-4fj1k64j.js.map → index-zzpgsbn3.js.map} +1 -1
  154. package/dist/index.js +343 -343
  155. package/dist/index.js.map +7 -7
  156. package/dist/lib/source.d.ts +8 -0
  157. package/dist/lib/source.d.ts.map +1 -1
  158. package/dist/lib/types.d.ts +8 -2
  159. package/dist/lib/types.d.ts.map +1 -1
  160. package/dist/run.d.ts.map +1 -1
  161. package/dist/transcript.d.ts.map +1 -1
  162. package/dist/web-7mdrcb8a.js +14 -0
  163. package/dist/{web-zph4h3p9.js.map → web-7mdrcb8a.js.map} +1 -1
  164. package/dist/wire.d.ts +19 -0
  165. package/dist/wire.js +5 -5
  166. package/dist/wire.js.map +4 -4
  167. package/dist/wrapper-4hdmdwft.js +5 -0
  168. package/dist/{wrapper-f662ny3r.js.map → wrapper-4hdmdwft.js.map} +1 -1
  169. package/package.json +1 -1
  170. package/dist/APEv2Parser-etzjd528.js +0 -5
  171. package/dist/App-4w3qkcs4.js +0 -11
  172. package/dist/AsfParser-wd98k2h4.js +0 -5
  173. package/dist/ConfigEditor-vk7vxaa6.js +0 -6
  174. package/dist/DsdiffParser-cbfaj500.js +0 -5
  175. package/dist/FlacParser-7t7da7qy.js +0 -5
  176. package/dist/MP4Parser-gc94h1n9.js +0 -5
  177. package/dist/MusepackParser-8mq2eabg.js +0 -5
  178. package/dist/OggParser-7dnc6apg.js +0 -5
  179. package/dist/Picker-j7txnm7w.js +0 -5
  180. package/dist/SessionPicker-hpv2ncsb.js +0 -5
  181. package/dist/SkillBrowser-qc542n71.js +0 -5
  182. package/dist/WavPackParser-kt7cds9c.js +0 -5
  183. package/dist/WaveParser-g47ja0vy.js +0 -5
  184. package/dist/WizardApp-q4p979d1.js +0 -5
  185. package/dist/channels-4t89qpdt.js +0 -31
  186. package/dist/config-35r6n1gh.js +0 -24
  187. package/dist/credential-dpdgg4j6.js +0 -19
  188. package/dist/index-0444sh6x.js +0 -6
  189. package/dist/index-1x8mzvz7.js +0 -6
  190. package/dist/index-2bsardvh.js +0 -5
  191. package/dist/index-323jvr1g.js +0 -6
  192. package/dist/index-3826kf9t.js +0 -7
  193. package/dist/index-38gs9anh.js +0 -9
  194. package/dist/index-3c5jt6by.js +0 -5
  195. package/dist/index-42e29zs4.js +0 -6
  196. package/dist/index-664xcamy.js +0 -110
  197. package/dist/index-664xcamy.js.map +0 -13
  198. package/dist/index-7mn8ack9.js +0 -6
  199. package/dist/index-8edck2pr.js +0 -6
  200. package/dist/index-8h6kewy1.js +0 -9
  201. package/dist/index-8tmv33mr.js +0 -6
  202. package/dist/index-9914wh1d.js +0 -6
  203. package/dist/index-9914wh1d.js.map +0 -10
  204. package/dist/index-dzy19wtf.js +0 -6
  205. package/dist/index-eqqd4k4f.js +0 -14
  206. package/dist/index-ew997be5.js +0 -10
  207. package/dist/index-fa9wvpyw.js +0 -6
  208. package/dist/index-fcsg95m5.js +0 -11
  209. package/dist/index-gbkma7ds.js +0 -6
  210. package/dist/index-gq1npngp.js +0 -6
  211. package/dist/index-jc4kmfwa.js +0 -6
  212. package/dist/index-nvc24414.js +0 -6
  213. package/dist/index-nxhqf597.js +0 -6
  214. package/dist/index-p1zy871m.js +0 -6
  215. package/dist/index-qg9bn980.js +0 -1213
  216. package/dist/index-qgsdgbk8.js +0 -5
  217. package/dist/index-r4ax3x4d.js +0 -74
  218. package/dist/index-r4ax3x4d.js.map +0 -13
  219. package/dist/index-twn9bfm2.js +0 -8
  220. package/dist/index-wc4entme.js +0 -12
  221. package/dist/index-ytxbw8py.js +0 -63
  222. package/dist/index-z157at3s.js +0 -153
  223. package/dist/index-zce9gy22.js +0 -126
  224. package/dist/web-zph4h3p9.js +0 -14
  225. package/dist/wrapper-f662ny3r.js +0 -5
@@ -1,6 +0,0 @@
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
@@ -1,6 +0,0 @@
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
@@ -1,9 +0,0 @@
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
@@ -1,6 +0,0 @@
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
@@ -1,6 +0,0 @@
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
@@ -1,10 +0,0 @@
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,CAII,KAAM,OAEN,UAAW,SAIX,YAAa,GACb,QAAS,yDAIT,KAAM,CAAC,EACP,kBACI,mIACJ,MAAO,CACH,CAAE,KAAM,OAAQ,KAAM,SAAU,YAAa,OAAQ,KAAM,WAAY,EACvE,CAAE,KAAM,OAAQ,KAAM,SAAU,YAAa,OAAQ,KAAM,kBAAmB,EAC9E,CACI,KAAM,UACN,KAAM,SACN,YAAa,OACb,KAAM,iCACV,EACA,CACI,KAAM,SACN,KAAM,SACN,YAAa,KAKb,KAAM,mBAAmB,GAAQ,IAAI,CAAC,IAAW,EAAO,EAAE,EAAE,KAAK,KAAK,IACtE,YAAa,QACjB,EACA,CAAE,KAAM,QAAS,KAAM,SAAU,YAAa,KAAM,KAAM,UAAW,EACrE,CAAE,KAAM,WAAY,KAAM,SAAU,YAAa,MAAO,KAAM,mBAAoB,EAClF,CACI,KAAM,SACN,KAAM,SACN,YAAa,aACb,KAAM,yEACV,EACA,CACI,KAAM,cACN,KAAM,SACN,YAAa,MACb,KAAM,qDACN,YAAa,eACjB,EACA,CACI,KAAM,SACN,KAAM,SACN,YAAa,QACb,KAAM,gEACN,YAAa,MACjB,EACA,CACI,KAAM,MACN,KAAM,SACN,YAAa,QACb,KAAM,yCACN,YAAa,MACjB,EACA,CACI,KAAM,cACN,KAAM,SACN,YAAa,KACb,KAAM,yDACN,YAAa,QACjB,EACA,CACI,KAAM,WACN,KAAM,SACN,YAAa,QACb,KAAM,iDACN,YAAa,MACjB,EACA,CACI,KAAM,WACN,KAAM,SACN,YAAa,QACb,KAAM,0CACN,YAAa,MACjB,EACA,CACI,KAAM,iBACN,KAAM,SACN,YAAa,UACb,KAAM,sEACV,EACA,CACI,KAAM,WACN,KAAM,SACN,YAAa,QACb,KAAM,gFACN,YAAa,MACjB,EACA,CAII,KAAM,kBACN,KAAM,SACN,YAAa,SACb,KAAM,wFACV,EACA,CACI,KAAM,SACN,KAAM,SACN,YAAa,QAGb,KAAM,mCACN,YAAa,OACjB,EACA,CACI,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,K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",
8
- "debugId": "57DDBC4A325EEA2B64756E2164756E21",
9
- "names": []
10
- }
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- var oa="\x1B[?1000h\x1B[?1002h\x1B[?1006h",ra="\x1B[?1006l\x1B[?1002l\x1B[?1000l";var d=/(?:^|\u001B)\[<(\d+);(\d+);(\d+)([Mm])/g,u=/(?:^|\u001B)\[M[\s\S]{3}/g;function ia(t){if(!t.includes("[<")&&!t.includes("[M"))return;let r=0,o=!1,s,a,c=!1;for(let e of t.matchAll(d)){o=!0;let n=Number(e[1]);if(n===64){r-=3;continue}if(n===65){r+=3;continue}s={column:Math.max(0,Number(e[2])-1),row:Math.max(0,Number(e[3])-1)},a=e[4]==="m"?"release":(n&32)!==0?"drag":"press",c=(n&4)!==0}for(let e of t.matchAll(u)){o=!0;let n=(e[0].codePointAt(e[0].length-3)??32)-32;if(n===64)r-=3;else if(n===65)r+=3}if(!o)return;return{rows:r,...s===void 0?{}:{at:s},...a===void 0?{}:{kind:a},...c?{shift:c}:{}}}var i={accent:"magenta",muted:"gray",success:"green",warning:"yellow",error:"red",info:"blue",emphasis:"cyan",selection:"blue",border:"gray",borderActive:"magenta",brand:"magenta"},sa={idle:i.success,thinking:i.warning,streaming:i.accent,working:i.info,cancelling:i.emphasis},aa={user:i.accent,assistant:void 0,reasoning:i.muted,note:i.muted,error:i.error,tool:i.info,banner:void 0},ga={user:"› ",assistant:"",reasoning:" ",note:"· ",error:"✖ ",tool:" · ",banner:""},b={prompt:"› ",pointer:"❯ ",bullet:"· ",error:"✖ ",dot:"● ",check:"✓ ",ellipsis:"…",create:"+ ",checked:"◉ ",unchecked:"◯ "},Qi=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],ca=80,$e="round";
3
- export{oa,ra,ia,i,sa,aa,ga,b,Qi,ca,$e};
4
-
5
- //# debugId=7A5355469AAB7D8E64756E2164756E21
6
- //# sourceMappingURL=index-dzy19wtf.js.map
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env node
2
- import{B,Si,Me,wi,Di,ba,N,X,C,f,m,a,g,Te,re,l,jo,Ce,Mi,Dn,bn,Jo,fe,Na,vr,Lr,Lt,Ma}from"./index-ew997be5.js";import{I,e}from"./index-323jvr1g.js";var Je=e(function(He){/*!
3
- * content-type
4
- * Copyright(c) 2015 Douglas Christopher Wilson
5
- * MIT Licensed
6
- */Object.defineProperty(He,"__esModule",{value:!0});He.format=pi;He.parse=ui;var si=/^[\u0009\u0020-\u007e\u0080-\u00ff]*$/,Ze=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,ci=/[\\"]/g,mi=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,qe=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function pi(t){let{type:i,parameters:r}=t;if(!i||!mi.test(i))throw TypeError(`Invalid type: ${i}`);let n=i;if(r)for(let o of Object.keys(r)){if(!Ze.test(o))throw TypeError(`Invalid parameter name: ${o}`);n+=`; ${o}=${hi(r[o])}`}return n}function ui(t,i){let r=i?.comma===!0?di:65536,n=t.length,o=oe(t,i?.start??0,n),s=o;o=ne(t,o,n,r);let u=se(t,s,o),c=t.slice(s,u).toLowerCase();if(i?.parameters===!1)return{type:c,index:o,parameters:new qe};return xi(t,c,o,n,r)}var Ye=32,Ve=9,Ke=59,li=61,je=34,fi=92,di=44;function xi(t,i,r,n,o){let s=new qe;e:while(r<n){if(t.charCodeAt(r)===o)break;r=oe(t,r+1,n);let u=r;while(r<n){let c=t.charCodeAt(r);if(c===o)break e;if(c===Ke)continue e;if(c===li){let d=se(t,u,r),x=t.slice(u,d).toLowerCase();if(r=oe(t,r+1,n),r<n&&t.charCodeAt(r)===je){r++;let k="";while(r<n){let G=t.charCodeAt(r++);if(G===je){if(r=ne(t,r,n,o),s[x]===void 0)s[x]=k;break}if(G===fi&&r<n){k+=t[r++];continue}k+=String.fromCharCode(G)}continue e}let h=r;if(r=ne(t,r,n,o),s[x]===void 0){let k=se(t,h,r);s[x]=t.slice(h,k)}continue e}r++}}return{type:i,index:r,parameters:s}}function ne(t,i,r,n){while(i<r){let o=t.charCodeAt(i);if(o===Ke||o===n)break;i++}return i}function oe(t,i,r){while(i<r){let n=t.charCodeAt(i);if(n!==Ye&&n!==Ve)break;i++}return i}function se(t,i,r){while(r>i){let n=t.charCodeAt(r-1);if(n!==Ye&&n!==Ve)break;r--}return r}function hi(t){if(Ze.test(t))return t;if(si.test(t))return`"${t.replace(ci,"\\$&")}"`;throw TypeError(`Invalid parameter value: ${t}`)}});var St=I(N(),1);var Ie=I(N(),1);var M={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},J={get(t){return{signature:a.get(t,0),compressedSize:a.get(t,8),uncompressedSize:a.get(t,12)}},len:16},ke={get(t){let i=f.get(t,6);return{signature:a.get(t,0),minVersion:f.get(t,4),dataDescriptor:!!(i&8),compressedMethod:f.get(t,8),compressedSize:a.get(t,18),uncompressedSize:a.get(t,22),filenameLength:f.get(t,26),extraFieldLength:f.get(t,28),filename:null}},len:30},be={get(t){return{signature:a.get(t,0),nrOfThisDisk:f.get(t,4),nrOfThisDiskWithTheStart:f.get(t,6),nrOfEntriesOnThisDisk:f.get(t,8),nrOfEntriesOfSize:f.get(t,10),sizeOfCd:a.get(t,12),offsetOfStartOfCd:a.get(t,16),zipFileCommentLength:f.get(t,20)}},len:22},Se={get(t){let i=f.get(t,8);return{signature:a.get(t,0),minVersion:f.get(t,6),dataDescriptor:!!(i&8),compressedMethod:f.get(t,10),compressedSize:a.get(t,20),uncompressedSize:a.get(t,24),filenameLength:f.get(t,28),extraFieldLength:f.get(t,30),fileCommentLength:f.get(t,32),relativeOffsetOfLocalHeader:a.get(t,42),filename:null}},len:46};function we(t){let i=new Uint8Array(a.len);return a.put(i,0,t),i}var w=Ie.default("tokenizer:inflate"),Q=262144,It=we(M.DataDescriptor),W=we(M.EndOfCentralDirectory);class R{constructor(t){this.tokenizer=t,this.syncBuffer=new Uint8Array(Q)}async isZip(){return await this.peekSignature()===M.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(a)}async findEndOfCentralDirectoryLocator(){let t=this.tokenizer,i=Math.min(16384,t.fileInfo.size),r=this.syncBuffer.subarray(0,i);await this.tokenizer.readBuffer(r,{position:t.fileInfo.size-i});for(let n=r.length-4;n>=0;n--)if(r[n]===W[0]&&r[n+1]===W[1]&&r[n+2]===W[2]&&r[n+3]===W[3])return t.fileInfo.size-i+n;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){w("Cannot reading central-directory without random-read support");return}w("Reading central-directory...");let t=this.tokenizer.position,i=await this.findEndOfCentralDirectoryLocator();if(i>0){w("Central-directory 32-bit signature found");let r=await this.tokenizer.readToken(be,i),n=[];this.tokenizer.setPosition(r.offsetOfStartOfCd);for(let o=0;o<r.nrOfEntriesOfSize;++o){let s=await this.tokenizer.readToken(Se);if(s.signature!==M.CentralFileHeader)throw Error("Expected Central-File-Header signature");s.filename=await this.tokenizer.readToken(new l(s.filenameLength,"utf-8")),await this.tokenizer.ignore(s.extraFieldLength),await this.tokenizer.ignore(s.fileCommentLength),n.push(s),w(`Add central-directory file-entry: n=${o+1}/${n.length}: filename=${n[o].filename}`)}return this.tokenizer.setPosition(t),n}this.tokenizer.setPosition(t)}async unzip(t){let i=await this.readCentralDirectory();if(i)return this.iterateOverCentralDirectory(i,t);let r=!1;do{let n=await this.readLocalFileHeader();if(!n)break;let o=t(n);r=!!o.stop;let s;if(await this.tokenizer.ignore(n.extraFieldLength),n.dataDescriptor&&n.compressedSize===0){let u=[],c=Q;w("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let d=-1;while(d<0&&c===Q){c=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),d=wt(this.syncBuffer.subarray(0,c),It);let x=d>=0?d:c;if(o.handler){let h=new Uint8Array(x);await this.tokenizer.readBuffer(h),u.push(h)}else await this.tokenizer.ignore(x)}if(w(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),o.handler)await this.inflate(n,At(u),o.handler)}else if(o.handler)w(`Reading compressed-file-data: ${n.compressedSize} bytes`),s=new Uint8Array(n.compressedSize),await this.tokenizer.readBuffer(s),await this.inflate(n,s,o.handler);else w(`Ignoring compressed-file-data: ${n.compressedSize} bytes`),await this.tokenizer.ignore(n.compressedSize);if(w(`Reading data-descriptor at pos=${this.tokenizer.position}`),n.dataDescriptor){if((await this.tokenizer.readToken(J)).signature!==134695760)throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-J.len}`)}}while(!r)}async iterateOverCentralDirectory(t,i){for(let r of t){let n=i(r);if(n.handler){this.tokenizer.setPosition(r.relativeOffsetOfLocalHeader);let o=await this.readLocalFileHeader();if(o){await this.tokenizer.ignore(o.extraFieldLength);let s=new Uint8Array(r.compressedSize);await this.tokenizer.readBuffer(s),await this.inflate(o,s,n.handler)}}if(n.stop)break}}async inflate(t,i,r){if(t.compressedMethod===0)return r(i);if(t.compressedMethod!==8)throw Error(`Unsupported ZIP compression method: ${t.compressedMethod}`);w(`Decompress filename=${t.filename}, compressed-size=${i.length}`);let n=await R.decompressDeflateRaw(i);return r(n)}static async decompressDeflateRaw(t){let i=new ReadableStream({start(o){o.enqueue(t),o.close()}}),r=new DecompressionStream("deflate-raw"),n=i.pipeThrough(r);try{let s=await new Response(n).arrayBuffer();return new Uint8Array(s)}catch(o){let s=o instanceof Error?`Failed to deflate ZIP entry: ${o.message}`:"Unknown decompression error in ZIP entry";throw TypeError(s)}}async readLocalFileHeader(){let t=await this.tokenizer.peekToken(a);if(t===M.LocalFileHeader){let i=await this.tokenizer.readToken(ke);return i.filename=await this.tokenizer.readToken(new l(i.filenameLength,"utf-8")),i}if(t===M.CentralFileHeader)return!1;if(t===3759263696)throw Error("Encrypted ZIP");throw Error("Unexpected signature")}}function wt(t,i){let r=t.length,n=i.length;if(n>r)return-1;for(let o=0;o<=r-n;o++){let s=!0;for(let u=0;u<n;u++)if(t[o+u]!==i[u]){s=!1;break}if(s)return o}return-1}function At(t){let i=t.reduce((o,s)=>o+s.length,0),r=new Uint8Array(i),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}class j{constructor(t){this.tokenizer=t}inflate(){let t=this.tokenizer;return new ReadableStream({async pull(i){let r=new Uint8Array(1024),n=await t.readBuffer(r,{mayBeLess:!0});if(n===0){i.close();return}i.enqueue(r.subarray(0,n))}}).pipeThrough(new DecompressionStream("gzip"))}}function Ae(t,i){if(i==="utf-16le"){let r=[];for(let n=0;n<t.length;n++){let o=t.charCodeAt(n);r.push(o&255,o>>8&255)}return r}if(i==="utf-16be"){let r=[];for(let n=0;n<t.length;n++){let o=t.charCodeAt(n);r.push(o>>8&255,o&255)}return r}return[...t].map((r)=>r.charCodeAt(0))}function ve(t,i=0){let r=Number.parseInt(new l(6).get(t,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(r))return!1;let n=256;for(let o=i;o<i+148;o++)n+=t[o];for(let o=i+156;o<i+512;o++)n+=t[o];return r===n}var Ee={get:(t,i)=>t[i+3]&127|t[i+2]<<7|t[i+1]<<14|t[i]<<21,len:4};var _e=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"],Re=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"];var P=4100,vt=P-2,v=1048576,De=1024,Et=2147483647,b=16777216,q=v,Be=v,_t=b,Mt=1,Le=100,ee=b,Pe=64,Oe=q,Ct=256,Rt=512,Dt=b,Bt=512,Pt=512,Fe=256,ze=q,Ne=q,Ot=q,Ue=b,Ft=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),zt=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],Nt=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]);class _ extends Error{}function Ut(t){let i=t?.streamReader;if(i?.constructor?.name!=="WebStreamByobReader")return t;let{reader:r}=i,n=async()=>{await r.cancel(),r.releaseLock()};return i.close=n,i.abort=async()=>{i.interrupted=!0,await n()},t}function ie(t,i,r){if(!Number.isFinite(t)||t<0||t>i)throw new _(`${r} has invalid size ${t} (maximum ${i} bytes)`);return t}async function E(t,i,{maximumLength:r=b,reason:n="skip"}={}){let o=ie(i,r,n);await t.ignore(o)}async function te(t,i,r,{maximumLength:n=i.length,reason:o="read"}={}){let s=r?.length??i.length,u=ie(s,n,o);return t.readBuffer(i,{...r,length:u})}async function Xt(t,{maximumLength:i=v}={}){let o=new ReadableStream({start(x){x.enqueue(t),x.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),s=[],u=0;try{for(;;){let{done:x,value:h}=await o.read();if(x)break;if(u+=h.length,u>i)throw await o.cancel(),Error(`ZIP entry decompressed data exceeds ${i} bytes`);s.push(h)}}finally{o.releaseLock()}let c=new Uint8Array(u),d=0;for(let x of s)c.set(x,d),d+=x.length;return c}var $e=134695760,Z=16,Gt=Z-1;function Wt(t,i){if(t.length<Z)return-1;let r=t.length-Z;for(let n=0;n<=r;n++)if(a.get(t,n)===$e&&a.get(t,n+8)===i+n)return n;return-1}function $t(t){return(t.codePointAt(0)&32)!==0}function jt(t,i){let r=new Uint8Array(i),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}async function Zt(t,{shouldBuffer:i,maximumLength:r=v}={}){let{syncBuffer:n}=t,{length:o}=n,s=[],u=0;for(;;){let c=await t.tokenizer.peekBuffer(n,{mayBeLess:!0}),d=Wt(n.subarray(0,c),u),x=d>=0?0:c===o?Math.min(Gt,c-1):0,h=d>=0?d:c-x;if(h===0)break;if(u+=h,u>r)throw Error(`ZIP entry compressed data exceeds ${r} bytes`);if(i){let k=new Uint8Array(h);await t.tokenizer.readBuffer(k),s.push(k)}else await t.tokenizer.ignore(h);if(d>=0)break}if(!y(t.tokenizer))t.knownSizeDescriptorScannedBytes+=u;if(!i)return;return jt(s,u)}function qt(t,i){if(y(t.tokenizer))return Math.max(0,b-(t.tokenizer.position-i));return Math.max(0,v-t.knownSizeDescriptorScannedBytes)}async function Yt(t,i,{shouldBuffer:r,maximumDescriptorLength:n=v}={}){if(i.dataDescriptor&&i.compressedSize===0)return Zt(t,{shouldBuffer:r,maximumLength:n});if(!r){await E(t.tokenizer,i.compressedSize,{maximumLength:y(t.tokenizer)?v:t.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let o=ei(t.tokenizer);if(!Number.isFinite(i.compressedSize)||i.compressedSize<0||i.compressedSize>o)throw Error(`ZIP entry compressed data exceeds ${o} bytes`);let s=new Uint8Array(i.compressedSize);return await t.tokenizer.readBuffer(s),s}R.prototype.inflate=async function(t,i,r){if(t.compressedMethod===0)return r(i);if(t.compressedMethod!==8)throw Error(`Unsupported ZIP compression method: ${t.compressedMethod}`);let n=await Xt(i,{maximumLength:v});return r(n)};R.prototype.unzip=async function(t){let i=!1,r=0,n=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(O(this.tokenizer,n,b))throw new _(`ZIP stream probing exceeds ${b} bytes`);let o=await this.readLocalFileHeader();if(!o)break;if(r++,r>De)throw Error(`ZIP entry count exceeds ${De}`);let s=t(o);i=Boolean(s.stop),await this.tokenizer.ignore(o.extraFieldLength);let u=await Yt(this,o,{shouldBuffer:Boolean(s.handler),maximumDescriptorLength:Math.min(v,qt(this,n))});if(s.handler)await this.inflate(o,u,s.handler);if(o.dataDescriptor){let c=new Uint8Array(Z);if(await this.tokenizer.readBuffer(c),a.get(c,0)!==$e)throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-c.length}`)}if(O(this.tokenizer,n,b))throw new _(`ZIP stream probing exceeds ${b} bytes`)}while(!i)};function Vt(t,i){let r=t.getReader(),n=0,o=!1,s=!1,u=async(c)=>{if(o||s)return;s=!0,await r.cancel(c)};return new ReadableStream({async pull(c){if(n>=i){c.close(),await u();return}let{done:d,value:x}=await r.read();if(d||!x){o=!0,c.close();return}let h=i-n;if(x.length>h){c.enqueue(x.subarray(0,h)),n+=h,c.close(),await u();return}c.enqueue(x),n+=x.length},async cancel(c){await u(c)}})}async function F(t,i){return new ae(i).fromBuffer(t)}function Xe(t){switch(t=t.toLowerCase(),t){case"application/epub+zip":return{ext:"epub",mime:t};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:t};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:t};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:t};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:t};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:t};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:t};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:t};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:t};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:t};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:t};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:t};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:t};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:t};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:t};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:t};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function A(t,i,r){r={offset:0,...r};for(let[n,o]of i.entries())if(r.mask){if(o!==(r.mask[n]&t[n+r.offset]))return!1}else if(o!==t[n+r.offset])return!1;return!0}function Kt(t){if(!Number.isFinite(t))return P;return Math.max(1,Math.trunc(t))}function Ht(t,i,r){if(r===void 0)return t.read(i);return r.throwIfAborted(),new Promise((n,o)=>{let s=()=>{r.removeEventListener("abort",u)},u=()=>{let c=r.reason;s(),(async()=>{try{await t.cancel(c)}catch{}})(),o(c)};r.addEventListener("abort",u,{once:!0}),(async()=>{try{let c=await t.read(i);s(),n(c)}catch(c){s(),o(c)}})()})}function Jt(t){if(!Number.isFinite(t))return 0;return Math.max(0,Math.min(vt,Math.trunc(t)))}function Qt(t){if(!Number.isFinite(t))return Number.MAX_SAFE_INTEGER;return Math.max(0,t)}function y(t){let i=t.fileInfo.size;return!Number.isFinite(i)||i===Number.MAX_SAFE_INTEGER}function O(t,i,r){return y(t)&&t.position-i>r}function ei(t){let i=t.fileInfo.size,r=Number.isFinite(i)?Math.max(0,i-t.position):Number.MAX_SAFE_INTEGER;return Math.min(r,Et)}function ti(t){if(t instanceof B)return!0;if(t instanceof _)return!0;if(!(t instanceof Error))return!1;if(Ft.has(t.message))return!0;if(Nt.has(t.code))return!0;for(let i of zt)if(t.message.startsWith(i))return!0;return!1}function Ge(t,i=v){let r=[t.compressedSize,t.uncompressedSize];for(let n of r)if(!Number.isFinite(n)||n<0||n>i)return!1;return!0}function ii(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function ri(t,i){if(i.startsWith("word/"))t.hasWordDirectory=!0;if(i.startsWith("ppt/"))t.hasPresentationDirectory=!0;if(i.startsWith("xl/"))t.hasSpreadsheetDirectory=!0;if(i.startsWith("3D/")&&i.endsWith(".model"))t.hasThreeDimensionalModelEntry=!0}function We(t){if(!t.hasContentTypesEntry||t.hasUnparseableContentTypes||t.isParsingContentTypes||t.hasParsedContentTypesEntry)return;if(t.hasWordDirectory)return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(t.hasPresentationDirectory)return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(t.hasSpreadsheetDirectory)return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(t.hasThreeDimensionalModelEntry)return{ext:"3mf",mime:"model/3mf"}}function ai(t){let i=t.indexOf('.main+xml"');if(i===-1){if(t.includes('ContentType="application/vnd.ms-package.3dmanufacturing-3dmodel+xml"'))return"application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return}let r=t.slice(0,i),n=r.lastIndexOf('"');return r.slice(n+1)}class ae{constructor(t){let i=Jt(t?.mpegOffsetTolerance);this.options={...t,mpegOffsetTolerance:i},this.detectors=[...this.options.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(t){return Ut(Si(t,this.getTokenizerOptions()))}async parseTokenizer(t,i=0){this.detectionReentryCount=i;let r=t.position;for(let n of this.detectors){let o;try{o=await n.detect(t)}catch(s){if(s instanceof B)return;if(s instanceof _)return;throw s}if(o)return o;if(r!==t.position)return}}async fromTokenizer(t){try{return await this.parseTokenizer(t)}finally{await t.close()}}async fromBuffer(t){if(!(t instanceof Uint8Array||t instanceof ArrayBuffer))throw TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``);let i=t instanceof Uint8Array?t:new Uint8Array(t);if(!(i?.length>1))return;return this.fromTokenizer(Me(i,this.getTokenizerOptions()))}async fromBlob(t){this.options.signal?.throwIfAborted();let i=wi(t,this.getTokenizerOptions());return this.fromTokenizer(i)}async fromStream(t){this.options.signal?.throwIfAborted();let i=this.createTokenizerFromWebStream(t);return this.fromTokenizer(i)}async toDetectionStream(t,i){let r=Kt(i?.sampleSize??P),n,o,s=t.getReader({mode:"byob"});try{let{value:d,done:x}=await Ht(s,new Uint8Array(r),this.options.signal);if(o=d,!x&&d)try{n=await this.fromBuffer(d.subarray(0,r))}catch(h){if(!(h instanceof B))throw h;n=void 0}o=d}finally{s.releaseLock()}let u=new TransformStream({async start(d){d.enqueue(o)},transform(d,x){x.enqueue(d)}}),c=t.pipeThrough(u);return c.fileType=n,c}async detectGzip(t){if(this.gzipProbeDepth>=Mt)return{ext:"gz",mime:"application/gzip"};let i=new j(t),r=Vt(i.inflate(),_t),n=y(t),o,s,u,c;if(n){let d=new AbortController;o=setTimeout(()=>{d.abort(new DOMException(`Operation timed out after ${Le} ms`,"TimeoutError"))},Le),s=this.options.signal===void 0?d.signal:AbortSignal.any([this.options.signal,d.signal]),u=new ae({...this.options,signal:s}),u.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{c=await(u??this).fromStream(r)}catch(d){if(d?.name==="AbortError"&&s?.reason?.name!=="TimeoutError")throw d}finally{if(clearTimeout(o),!n)this.gzipProbeDepth--}if(c?.ext==="tar")return{ext:"tar.gz",mime:"application/gzip"};return{ext:"gz",mime:"application/gzip"}}check(t,i){return A(this.buffer,t,i)}checkString(t,i){return this.check(Ae(t,i?.encoding),i)}detectConfident=async(t)=>{if(this.buffer=new Uint8Array(P),t.fileInfo.size===void 0)t.fileInfo.size=Number.MAX_SAFE_INTEGER;if(this.tokenizer=t,y(t)){if(await t.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8]))return this.detectGzip(t)}if(await t.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33])){if(await t.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14}))return{ext:"eps",mime:"application/eps"};return{ext:"ps",mime:"application/postscript"}}if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191])){if(this.detectionReentryCount>=Fe)return;return this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(t)}if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return this.detectGzip(t);if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await E(t,6,{maximumLength:6,reason:"ID3 header prefix"});let i=await t.readToken(Ee),r=y(t);if(!Number.isFinite(i)||i<0||r&&(i>ee||t.position+i>ee))return;if(t.position+i>t.fileInfo.size){if(r)return;return{ext:"mp3",mime:"audio/mpeg"}}try{await E(t,i,{maximumLength:r?ee:t.fileInfo.size,reason:"ID3 payload"})}catch(n){if(n instanceof B)return;throw n}if(this.detectionReentryCount>=Fe)return;return this.detectionReentryCount++,this.parseTokenizer(t,this.detectionReentryCount)}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255])){if(this.check([247],{offset:3}))return{ext:"jls",mime:"image/jls"};return{ext:"jpg",mime:"image/jpeg"}}if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let i,r=ii();try{await new R(t).unzip((n)=>{ri(r,n.filename);let o=n.filename==="[Content_Types].xml",s=We(r);if(!o&&s)return i=s,{stop:!0};switch(n.filename){case"META-INF/mozilla.rsa":return i={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return i={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":if(!Ge(n,Be))return{};return{async handler(u){let c=new TextDecoder("utf-8").decode(u).trim();i=Xe(c)},stop:!0};case"[Content_Types].xml":{if(r.hasContentTypesEntry=!0,!Ge(n,Be))return r.hasUnparseableContentTypes=!0,{};return r.isParsingContentTypes=!0,{async handler(u){let c=new TextDecoder("utf-8").decode(u),d=ai(c);if(d)i=Xe(d);r.hasParsedContentTypesEntry=!0,r.isParsingContentTypes=!1},stop:!0}}default:if(/classes\d*\.dex/.test(n.filename))return i={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0};return{}}})}catch(n){if(!ti(n))throw n;if(r.isParsingContentTypes)r.isParsingContentTypes=!1,r.hasUnparseableContentTypes=!0}return i??We(r)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await t.ignore(28);let i=new Uint8Array(8);if(await t.readBuffer(i),A(i,[79,112,117,115,72,101,97,100]))return{ext:"opus",mime:"audio/ogg; codecs=opus"};if(A(i,[128,116,104,101,111,114,97]))return{ext:"ogv",mime:"video/ogg"};if(A(i,[1,118,105,100,101,111,0]))return{ext:"ogm",mime:"video/ogg"};if(A(i,[127,70,76,65,67]))return{ext:"oga",mime:"audio/ogg"};if(A(i,[83,112,101,101,120,32,32]))return{ext:"spx",mime:"audio/ogg"};if(A(i,[1,118,111,114,98,105,115]))return{ext:"ogg",mime:"audio/ogg"};return{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let i=await this.readTiffHeader(!1);if(i)return i}if(this.check([77,77])){let i=await this.readTiffHeader(!0);if(i)return i}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function i(){let c=await t.peekNumber(C),d=128,x=0;while((c&d)===0&&d!==0)++x,d>>=1;let h=new Uint8Array(x+1);return await te(t,h,void 0,{maximumLength:h.length,reason:"EBML field"}),h}async function r(){let c=await i(),d=await i();d[0]^=128>>d.length-1;let x=Math.min(6,d.length),h=new DataView(c.buffer),k=new DataView(d.buffer,d.length-x,x);return{id:jo(h),len:jo(k)}}async function n(c){let d=0;while(c>0){if(d++,d>Ct)return;if(O(t,s,b))return;let x=t.position,h=await r();if(h.id===17026){if(h.len>Pe)return;let k=ie(h.len,Pe,"EBML DocType");return(await t.readToken(new l(k))).replaceAll(/\00.*$/g,"")}if(y(t)&&(!Number.isFinite(h.len)||h.len<0||h.len>Oe))return;if(await E(t,h.len,{maximumLength:y(t)?Oe:t.fileInfo.size,reason:"EBML payload"}),--c,t.position<=x)return}}let o=await r(),s=t.position;switch(await n(o.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190])){let i=g.get(this.buffer,4),r=m.get(this.buffer,6);if(i>0&&i<=30)return{ext:"macho",mime:"application/x-mach-binary"};if(r>30)return{ext:"class",mime:"application/java-vm"}}if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){let i=new l(4,"latin1").get(this.buffer,2);if(i.match("^d*")&&i>=1000&&i<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>")){if(await t.ignore(8),await t.readToken(new l(13,"ascii"))==="debian-binary")return{ext:"deb",mime:"application/x-deb"};return{ext:"ar",mime:"application/x-unix-archive"}}if(this.checkString("WEBVTT")&&[`
7
- `,"\r","\t"," ","\x00"].some((i)=>this.checkString(i,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){let i={ext:"png",mime:"image/png"},r={ext:"apng",mime:"image/apng"};await t.ignore(8);async function n(){return{length:await t.readToken(Te),type:await t.readToken(new l(4,"latin1"))}}let o=y(t),s=t.position,u=0,c=!1;do{if(u++,u>Rt)break;if(O(t,s,Dt))break;let d=t.position,x=await n();if(x.length<0)return;if(x.type==="IHDR"){if(x.length!==13)return;c=!0}switch(x.type){case"IDAT":return i;case"acTL":return r;default:if(!c&&x.type!=="CgBI")return;if(o&&x.length>ze)return c&&$t(x.type)?i:void 0;try{await E(t,x.length+4,{maximumLength:o?ze+4:t.fileInfo.size,reason:"PNG chunk payload"})}catch(h){if(!o&&(h instanceof _||h instanceof B))return i;throw h}}if(t.position<=d)break}while(t.position+8<t.fileInfo.size);return i}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/vnd.apache.arrow.file"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.checkString("ftyp",{offset:4})&&(this.buffer[8]&96)!==0){let i=new l(4,"latin1").get(this.buffer,8).replace("\x00"," ").trim();switch(i){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:if(i.startsWith("3g")){if(i.startsWith("3g2"))return{ext:"3g2",mime:"video/3gpp2"};return{ext:"3gp",mime:"video/3gpp"}}return{ext:"mp4",mime:"video/mp4"}}}if(this.checkString(`REGEDIT4\r
8
- `))return{ext:"reg",mime:"application/x-ms-regedit"};if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){let i=!1;try{async function r(){let u=new Uint8Array(16);return await te(t,u,void 0,{maximumLength:u.length,reason:"ASF header GUID"}),{id:u,size:Number(await t.readToken(re))}}await E(t,30,{maximumLength:30,reason:"ASF header prelude"});let n=y(t),o=t.position,s=0;while(t.position+24<t.fileInfo.size){if(s++,s>Bt)break;if(O(t,o,b))break;let u=t.position,c=await r(),d=c.size-24;if(!Number.isFinite(d)||d<0){i=!0;break}if(A(c.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let x=new Uint8Array(16);if(d-=await te(t,x,void 0,{maximumLength:x.length,reason:"ASF stream type GUID"}),A(x,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(A(x,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}if(n&&d>Ne){i=!0;break}if(await E(t,d,{maximumLength:n?Ne:t.fileInfo.size,reason:"ASF header payload"}),t.position<=u){i=!0;break}}}catch(r){if(r instanceof B||r instanceof _){if(y(t))i=!0}else throw r}if(i)return;return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await t.ignore(20),await t.readToken(new l(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255])){if(this.checkString("<?xml ",{offset:2,encoding:"utf-16be"}))return{ext:"xml",mime:"application/xml"};return}if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await t.peekBuffer(this.buffer,{length:Math.min(256,t.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){let i=new DataView(this.buffer.buffer).getUint32(12,!0);if(i>12&&this.buffer.length>=i+16)try{let r=new TextDecoder().decode(this.buffer.subarray(16,i+16));if(JSON.parse(r).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \x00"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:"jmp",mime:"application/x-jmp-data"};if(await t.peekBuffer(this.buffer,{length:Math.min(512,t.fileInfo.size),mayBeLess:!0}),this.checkString("ustar",{offset:257})&&(this.checkString("\x00",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&ve(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254])){if(this.checkString("<?xml ",{offset:2,encoding:"utf-16le"}))return{ext:"xml",mime:"application/xml"};if(this.check([255,14],{offset:2})&&this.checkString("SketchUp Model",{offset:4,encoding:"utf-16le"}))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(this.checkString(`Windows Registry Editor Version 5.00\r
9
- `,{offset:2,encoding:"utf-16le"}))return{ext:"reg",mime:"application/x-ms-regedit"};return}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}};detectImprecise=async(t)=>{this.buffer=new Uint8Array(P);let i=Qt(t.fileInfo.size);if(await t.peekBuffer(this.buffer,{length:Math.min(8,i),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await t.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,i),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let r=0;r<=this.options.mpegOffsetTolerance;++r){let n=this.scanMpeg(r);if(n)return n}};async readTiffTag(t){let i=await this.tokenizer.readToken(t?m:f);switch(await this.tokenizer.ignore(10),i){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(t){let i=await this.tokenizer.readToken(t?m:f);if(i>Pt)return;if(y(this.tokenizer)&&2+i*12>Ue)return;for(let r=0;r<i;++r){let n=await this.readTiffTag(t);if(n)return n}}async readTiffHeader(t){let i={ext:"tif",mime:"image/tiff"},r=(t?m:f).get(this.buffer,2),n=(t?g:a).get(this.buffer,4);if(r===42){if(n>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n>=8){let u=(t?m:f).get(this.buffer,8),c=(t?m:f).get(this.buffer,10);if(u===28&&c===254||u===31&&c===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(y(this.tokenizer)&&n>Ot)return i;let o=y(this.tokenizer)?Ue:this.tokenizer.fileInfo.size;try{await E(this.tokenizer,n,{maximumLength:o,reason:"TIFF IFD offset"})}catch(u){if(u instanceof B)return;throw u}let s;try{s=await this.readTiffIFD(t)}catch(u){if(u instanceof B)return;throw u}return s??i}if(r===43)return i}scanMpeg(t){if(this.check([255,224],{offset:t,mask:[255,224]})){if(this.check([16],{offset:t+1,mask:[22]})){if(this.check([8],{offset:t+1,mask:[8]}))return{ext:"aac",mime:"audio/aac"};return{ext:"aac",mime:"audio/aac"}}if(this.check([2],{offset:t+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:t+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:t+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}}var ni=new Set(_e),oi=new Set(Re);var gt=I(Je(),1);var yi=/^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}\/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/;function Qe(t){if(!yi.test(t))throw TypeError(`Invalid media type: ${t}`);let i=t.indexOf("/"),r=t.slice(0,i).toLowerCase(),n=t.slice(i+1).toLowerCase(),o,s=n.lastIndexOf("+");if(s!==-1)o=n.slice(s+1),n=n.slice(0,s);return{type:r,subtype:n,suffix:o}}var Tt=I(N(),1);var rt=I(N(),1);var p={multiple:!1},Y={year:p,track:p,disk:p,title:p,artist:p,artists:{multiple:!0,unique:!0},albumartist:p,albumartists:{multiple:!0,unique:!0},album:p,date:p,originaldate:p,originalyear:p,releasedate:p,comment:{multiple:!0,unique:!1},genre:{multiple:!0,unique:!0},picture:{multiple:!0,unique:!0},composer:{multiple:!0,unique:!0},lyrics:{multiple:!0,unique:!1},albumsort:{multiple:!1,unique:!0},titlesort:{multiple:!1,unique:!0},work:{multiple:!1,unique:!0},artistsort:{multiple:!1,unique:!0},albumartistsort:{multiple:!1,unique:!0},composersort:{multiple:!1,unique:!0},lyricist:{multiple:!0,unique:!0},writer:{multiple:!0,unique:!0},conductor:{multiple:!0,unique:!0},remixer:{multiple:!0,unique:!0},arranger:{multiple:!0,unique:!0},engineer:{multiple:!0,unique:!0},producer:{multiple:!0,unique:!0},technician:{multiple:!0,unique:!0},djmixer:{multiple:!0,unique:!0},mixer:{multiple:!0,unique:!0},label:{multiple:!0,unique:!0},grouping:p,subtitle:{multiple:!0},discsubtitle:p,totaltracks:p,totaldiscs:p,compilation:p,rating:{multiple:!0},bpm:p,mood:p,media:p,catalognumber:{multiple:!0,unique:!0},tvShow:p,tvShowSort:p,tvSeason:p,tvEpisode:p,tvEpisodeId:p,tvNetwork:p,podcast:p,podcasturl:p,releasestatus:p,releasetype:{multiple:!0},releasecountry:p,script:p,language:p,copyright:p,license:p,encodedby:p,encodersettings:p,gapless:p,barcode:p,isrc:{multiple:!0},asin:p,musicbrainz_recordingid:p,musicbrainz_trackid:p,musicbrainz_albumid:p,musicbrainz_artistid:{multiple:!0},musicbrainz_albumartistid:{multiple:!0},musicbrainz_releasegroupid:p,musicbrainz_workid:p,musicbrainz_trmid:p,musicbrainz_discid:p,acoustid_id:p,acoustid_fingerprint:p,musicip_puid:p,musicip_fingerprint:p,website:p,"performer:instrument":{multiple:!0,unique:!0},averageLevel:p,peakLevel:p,notes:{multiple:!0,unique:!1},key:p,originalalbum:p,originalartist:p,discogs_artist_id:{multiple:!0,unique:!0},discogs_release_id:p,discogs_label_id:p,discogs_master_release_id:p,discogs_votes:p,discogs_rating:p,replaygain_track_peak:p,replaygain_track_gain:p,replaygain_album_peak:p,replaygain_album_gain:p,replaygain_track_minmax:p,replaygain_album_minmax:p,replaygain_undo:p,description:{multiple:!0},longDescription:p,category:{multiple:!0},hdVideo:p,keywords:{multiple:!0},movement:p,movementIndex:p,movementTotal:p,podcastId:p,showMovement:p,stik:p,playCounter:p};function et(t){return Y[t]&&!Y[t].multiple}function tt(t){return!Y[t].multiple||Y[t].unique||!1}class T{static toIntOrNull(t){let i=Number.parseInt(t,10);return Number.isNaN(i)?null:i}static normalizeTrack(t){let i=t.toString().split("/");return{no:Number.parseInt(i[0],10)||null,of:Number.parseInt(i[1],10)||null}}constructor(t,i){this.tagTypes=t,this.tagMap=i}mapGenericTag(t,i){t={id:t.id,value:t.value},this.postMap(t,i);let r=this.getCommonName(t.id);return r?{id:r,value:t.value}:null}getCommonName(t){return this.tagMap[t]}postMap(t,i){return}}T.maxRatingScore=1;var ki={title:"title",artist:"artist",album:"album",year:"year",comment:"comment",track:"track",genre:"genre"};class ce extends T{constructor(){super(["ID3v1"],ki)}}class S extends T{constructor(t,i){let r={};for(let n of Object.keys(i))r[n.toUpperCase()]=i[n];super(t,r)}getCommonName(t){return this.tagMap[t.toUpperCase()]}}var bi={TIT2:"title",TPE1:"artist","TXXX:Artists":"artists",TPE2:"albumartist",TALB:"album",TDRV:"date",TORY:"originalyear",TPOS:"disk",TCON:"genre",APIC:"picture",TCOM:"composer",USLT:"lyrics",TSOA:"albumsort",TSOT:"titlesort",TOAL:"originalalbum",TSOP:"artistsort",TSO2:"albumartistsort",TSOC:"composersort",TEXT:"lyricist","TXXX:Writer":"writer",TPE3:"conductor",TPE4:"remixer","IPLS:arranger":"arranger","IPLS:engineer":"engineer","IPLS:producer":"producer","IPLS:DJ-mix":"djmixer","IPLS:mix":"mixer",TPUB:"label",TIT1:"grouping",TIT3:"subtitle",TRCK:"track",TCMP:"compilation",POPM:"rating",TBPM:"bpm",TMED:"media","TXXX:CATALOGNUMBER":"catalognumber","TXXX:MusicBrainz Album Status":"releasestatus","TXXX:MusicBrainz Album Type":"releasetype","TXXX:MusicBrainz Album Release Country":"releasecountry","TXXX:RELEASECOUNTRY":"releasecountry","TXXX:SCRIPT":"script",TLAN:"language",TCOP:"copyright",WCOP:"license",TENC:"encodedby",TSSE:"encodersettings","TXXX:BARCODE":"barcode","TXXX:ISRC":"isrc",TSRC:"isrc","TXXX:ASIN":"asin","TXXX:originalyear":"originalyear","UFID:http://musicbrainz.org":"musicbrainz_recordingid","TXXX:MusicBrainz Release Track Id":"musicbrainz_trackid","TXXX:MusicBrainz Album Id":"musicbrainz_albumid","TXXX:MusicBrainz Artist Id":"musicbrainz_artistid","TXXX:MusicBrainz Album Artist Id":"musicbrainz_albumartistid","TXXX:MusicBrainz Release Group Id":"musicbrainz_releasegroupid","TXXX:MusicBrainz Work Id":"musicbrainz_workid","TXXX:MusicBrainz TRM Id":"musicbrainz_trmid","TXXX:MusicBrainz Disc Id":"musicbrainz_discid","TXXX:ACOUSTID_ID":"acoustid_id","TXXX:Acoustid Id":"acoustid_id","TXXX:Acoustid Fingerprint":"acoustid_fingerprint","TXXX:MusicIP PUID":"musicip_puid","TXXX:MusicMagic Fingerprint":"musicip_fingerprint",WOAR:"website",TDRC:"date",TYER:"year",TDOR:"originaldate","TIPL:arranger":"arranger","TIPL:engineer":"engineer","TIPL:producer":"producer","TIPL:DJ-mix":"djmixer","TIPL:mix":"mixer",TMOO:"mood",SYLT:"lyrics",TSST:"discsubtitle",TKEY:"key",COMM:"comment",TOPE:"originalartist","PRIV:AverageLevel":"averageLevel","PRIV:PeakLevel":"peakLevel","TXXX:DISCOGS_ARTIST_ID":"discogs_artist_id","TXXX:DISCOGS_ARTISTS":"artists","TXXX:DISCOGS_ARTIST_NAME":"artists","TXXX:DISCOGS_ALBUM_ARTISTS":"albumartist","TXXX:DISCOGS_CATALOG":"catalognumber","TXXX:DISCOGS_COUNTRY":"releasecountry","TXXX:DISCOGS_DATE":"originaldate","TXXX:DISCOGS_LABEL":"label","TXXX:DISCOGS_LABEL_ID":"discogs_label_id","TXXX:DISCOGS_MASTER_RELEASE_ID":"discogs_master_release_id","TXXX:DISCOGS_RATING":"discogs_rating","TXXX:DISCOGS_RELEASED":"date","TXXX:DISCOGS_RELEASE_ID":"discogs_release_id","TXXX:DISCOGS_VOTES":"discogs_votes","TXXX:CATALOGID":"catalognumber","TXXX:STYLE":"genre","TXXX:REPLAYGAIN_TRACK_PEAK":"replaygain_track_peak","TXXX:REPLAYGAIN_TRACK_GAIN":"replaygain_track_gain","TXXX:REPLAYGAIN_ALBUM_PEAK":"replaygain_album_peak","TXXX:REPLAYGAIN_ALBUM_GAIN":"replaygain_album_gain","TXXX:MP3GAIN_MINMAX":"replaygain_track_minmax","TXXX:MP3GAIN_ALBUM_MINMAX":"replaygain_album_minmax","TXXX:MP3GAIN_UNDO":"replaygain_undo",MVNM:"movement",MVIN:"movementIndex",PCST:"podcast",TCAT:"category",TDES:"description",TDRL:"releasedate",TGID:"podcastId",TKWD:"keywords",WFED:"podcasturl",GRP1:"grouping",PCNT:"playCounter"};class V extends S{static toRating(t){return{source:t.email,rating:t.rating>0?(t.rating-1)/254*T.maxRatingScore:void 0}}constructor(){super(["ID3v2.3","ID3v2.4"],bi)}postMap(t,i){switch(t.id){case"UFID":{let r=t.value;if(r.owner_identifier==="http://musicbrainz.org")t.id+=`:${r.owner_identifier}`,t.value=fe(r.identifier,"latin1")}break;case"PRIV":{let r=t.value;switch(r.owner_identifier){case"AverageLevel":case"PeakValue":if(t.id+=`:${r.owner_identifier}`,t.value=r.data.length===4?a.get(r.data,0):null,t.value===null)i.addWarning("Failed to parse PRIV:PeakValue");break;default:i.addWarning(`Unknown PRIV owner-identifier: ${r.data}`)}}break;case"POPM":t.value=V.toRating(t.value);break;default:break}}}var Ii={Title:"title",Author:"artist","WM/AlbumArtist":"albumartist","WM/AlbumTitle":"album","WM/Year":"date","WM/OriginalReleaseTime":"originaldate","WM/OriginalReleaseYear":"originalyear",Description:"comment","WM/TrackNumber":"track","WM/PartOfSet":"disk","WM/Genre":"genre","WM/Composer":"composer","WM/Lyrics":"lyrics","WM/AlbumSortOrder":"albumsort","WM/TitleSortOrder":"titlesort","WM/ArtistSortOrder":"artistsort","WM/AlbumArtistSortOrder":"albumartistsort","WM/ComposerSortOrder":"composersort","WM/Writer":"lyricist","WM/Conductor":"conductor","WM/ModifiedBy":"remixer","WM/Engineer":"engineer","WM/Producer":"producer","WM/DJMixer":"djmixer","WM/Mixer":"mixer","WM/Publisher":"label","WM/ContentGroupDescription":"grouping","WM/SubTitle":"subtitle","WM/SetSubTitle":"discsubtitle","WM/IsCompilation":"compilation","WM/SharedUserRating":"rating","WM/BeatsPerMinute":"bpm","WM/Mood":"mood","WM/Media":"media","WM/CatalogNo":"catalognumber","MusicBrainz/Album Status":"releasestatus","MusicBrainz/Album Type":"releasetype","MusicBrainz/Album Release Country":"releasecountry","WM/Script":"script","WM/Language":"language",Copyright:"copyright",LICENSE:"license","WM/EncodedBy":"encodedby","WM/EncodingSettings":"encodersettings","WM/Barcode":"barcode","WM/ISRC":"isrc","MusicBrainz/Track Id":"musicbrainz_recordingid","MusicBrainz/Release Track Id":"musicbrainz_trackid","MusicBrainz/Album Id":"musicbrainz_albumid","MusicBrainz/Artist Id":"musicbrainz_artistid","MusicBrainz/Album Artist Id":"musicbrainz_albumartistid","MusicBrainz/Release Group Id":"musicbrainz_releasegroupid","MusicBrainz/Work Id":"musicbrainz_workid","MusicBrainz/TRM Id":"musicbrainz_trmid","MusicBrainz/Disc Id":"musicbrainz_discid","Acoustid/Id":"acoustid_id","Acoustid/Fingerprint":"acoustid_fingerprint","MusicIP/PUID":"musicip_puid","WM/ARTISTS":"artists","WM/InitialKey":"key",ASIN:"asin","WM/Work":"work","WM/AuthorURL":"website","WM/Picture":"picture"};class K extends T{static toRating(t){return{rating:Number.parseFloat(t+1)/5}}constructor(){super(["asf"],Ii)}postMap(t){switch(t.id){case"WM/SharedUserRating":{let i=t.id.split(":");t.value=K.toRating(t.value),t.id=i[0];break}}}}var Ai={TT2:"title",TP1:"artist",TP2:"albumartist",TAL:"album",TYE:"year",COM:"comment",TRK:"track",TPA:"disk",TCO:"genre",PIC:"picture",TCM:"composer",TOR:"originaldate",TOT:"originalalbum",TXT:"lyricist",TP3:"conductor",TPB:"label",TT1:"grouping",TT3:"subtitle",TLA:"language",TCR:"copyright",WCP:"license",TEN:"encodedby",TSS:"encodersettings",WAR:"website",PCS:"podcast",TCP:"compilation",TDR:"date",TS2:"albumartistsort",TSA:"albumsort",TSC:"composersort",TSP:"artistsort",TST:"titlesort",WFD:"podcasturl",TBP:"bpm",GP1:"grouping"};class me extends S{constructor(){super(["ID3v2.2"],Ai)}}var vi={Title:"title",Artist:"artist",Artists:"artists","Album Artist":"albumartist",Album:"album",Year:"date",Originalyear:"originalyear",Originaldate:"originaldate",Releasedate:"releasedate",Comment:"comment",Track:"track",Disc:"disk",DISCNUMBER:"disk",Genre:"genre","Cover Art (Front)":"picture","Cover Art (Back)":"picture",Composer:"composer",Lyrics:"lyrics",ALBUMSORT:"albumsort",TITLESORT:"titlesort",WORK:"work",ARTISTSORT:"artistsort",ALBUMARTISTSORT:"albumartistsort",COMPOSERSORT:"composersort",Lyricist:"lyricist",Writer:"writer",Conductor:"conductor",MixArtist:"remixer",Arranger:"arranger",Engineer:"engineer",Producer:"producer",DJMixer:"djmixer",Mixer:"mixer",Label:"label",Grouping:"grouping",Subtitle:"subtitle",DiscSubtitle:"discsubtitle",Compilation:"compilation",BPM:"bpm",Mood:"mood",Media:"media",CatalogNumber:"catalognumber",MUSICBRAINZ_ALBUMSTATUS:"releasestatus",MUSICBRAINZ_ALBUMTYPE:"releasetype",RELEASECOUNTRY:"releasecountry",Script:"script",Language:"language",Copyright:"copyright",LICENSE:"license",EncodedBy:"encodedby",EncoderSettings:"encodersettings",Barcode:"barcode",ISRC:"isrc",ASIN:"asin",musicbrainz_trackid:"musicbrainz_recordingid",musicbrainz_releasetrackid:"musicbrainz_trackid",MUSICBRAINZ_ALBUMID:"musicbrainz_albumid",MUSICBRAINZ_ARTISTID:"musicbrainz_artistid",MUSICBRAINZ_ALBUMARTISTID:"musicbrainz_albumartistid",MUSICBRAINZ_RELEASEGROUPID:"musicbrainz_releasegroupid",MUSICBRAINZ_WORKID:"musicbrainz_workid",MUSICBRAINZ_TRMID:"musicbrainz_trmid",MUSICBRAINZ_DISCID:"musicbrainz_discid",Acoustid_Id:"acoustid_id",ACOUSTID_FINGERPRINT:"acoustid_fingerprint",MUSICIP_PUID:"musicip_puid",Weblink:"website",REPLAYGAIN_TRACK_GAIN:"replaygain_track_gain",REPLAYGAIN_TRACK_PEAK:"replaygain_track_peak",MP3GAIN_MINMAX:"replaygain_track_minmax",MP3GAIN_UNDO:"replaygain_undo"};class pe extends S{constructor(){super(["APEv2"],vi)}}var Ei={"©nam":"title","©ART":"artist",aART:"albumartist","----:com.apple.iTunes:Band":"albumartist","©alb":"album","©day":"date","©cmt":"comment","©com":"comment",trkn:"track",disk:"disk","©gen":"genre",covr:"picture","©wrt":"composer","©lyr":"lyrics",soal:"albumsort",sonm:"titlesort",soar:"artistsort",soaa:"albumartistsort",soco:"composersort","----:com.apple.iTunes:LYRICIST":"lyricist","----:com.apple.iTunes:CONDUCTOR":"conductor","----:com.apple.iTunes:REMIXER":"remixer","----:com.apple.iTunes:ENGINEER":"engineer","----:com.apple.iTunes:PRODUCER":"producer","----:com.apple.iTunes:DJMIXER":"djmixer","----:com.apple.iTunes:MIXER":"mixer","----:com.apple.iTunes:LABEL":"label","©grp":"grouping","----:com.apple.iTunes:SUBTITLE":"subtitle","----:com.apple.iTunes:DISCSUBTITLE":"discsubtitle",cpil:"compilation",tmpo:"bpm","----:com.apple.iTunes:MOOD":"mood","----:com.apple.iTunes:MEDIA":"media","----:com.apple.iTunes:CATALOGNUMBER":"catalognumber",tvsh:"tvShow",tvsn:"tvSeason",tves:"tvEpisode",sosn:"tvShowSort",tven:"tvEpisodeId",tvnn:"tvNetwork",pcst:"podcast",purl:"podcasturl","----:com.apple.iTunes:MusicBrainz Album Status":"releasestatus","----:com.apple.iTunes:MusicBrainz Album Type":"releasetype","----:com.apple.iTunes:MusicBrainz Album Release Country":"releasecountry","----:com.apple.iTunes:SCRIPT":"script","----:com.apple.iTunes:LANGUAGE":"language",cprt:"copyright","©cpy":"copyright","----:com.apple.iTunes:LICENSE":"license","©too":"encodedby",pgap:"gapless","----:com.apple.iTunes:BARCODE":"barcode","----:com.apple.iTunes:ISRC":"isrc","----:com.apple.iTunes:ASIN":"asin","----:com.apple.iTunes:NOTES":"comment","----:com.apple.iTunes:MusicBrainz Track Id":"musicbrainz_recordingid","----:com.apple.iTunes:MusicBrainz Release Track Id":"musicbrainz_trackid","----:com.apple.iTunes:MusicBrainz Album Id":"musicbrainz_albumid","----:com.apple.iTunes:MusicBrainz Artist Id":"musicbrainz_artistid","----:com.apple.iTunes:MusicBrainz Album Artist Id":"musicbrainz_albumartistid","----:com.apple.iTunes:MusicBrainz Release Group Id":"musicbrainz_releasegroupid","----:com.apple.iTunes:MusicBrainz Work Id":"musicbrainz_workid","----:com.apple.iTunes:MusicBrainz TRM Id":"musicbrainz_trmid","----:com.apple.iTunes:MusicBrainz Disc Id":"musicbrainz_discid","----:com.apple.iTunes:Acoustid Id":"acoustid_id","----:com.apple.iTunes:Acoustid Fingerprint":"acoustid_fingerprint","----:com.apple.iTunes:MusicIP PUID":"musicip_puid","----:com.apple.iTunes:fingerprint":"musicip_fingerprint","----:com.apple.iTunes:replaygain_track_gain":"replaygain_track_gain","----:com.apple.iTunes:replaygain_track_peak":"replaygain_track_peak","----:com.apple.iTunes:replaygain_album_gain":"replaygain_album_gain","----:com.apple.iTunes:replaygain_album_peak":"replaygain_album_peak","----:com.apple.iTunes:replaygain_track_minmax":"replaygain_track_minmax","----:com.apple.iTunes:replaygain_album_minmax":"replaygain_album_minmax","----:com.apple.iTunes:replaygain_undo":"replaygain_undo",gnre:"genre","----:com.apple.iTunes:ALBUMARTISTSORT":"albumartistsort","----:com.apple.iTunes:ARTISTS":"artists","----:com.apple.iTunes:ORIGINALDATE":"originaldate","----:com.apple.iTunes:ORIGINALYEAR":"originalyear","----:com.apple.iTunes:RELEASEDATE":"releasedate",desc:"description",ldes:"longDescription","©mvn":"movement","©mvi":"movementIndex","©mvc":"movementTotal","©wrk":"work",catg:"category",egid:"podcastId",hdvd:"hdVideo",keyw:"keywords",shwm:"showMovement",stik:"stik",rate:"rating"},_i="iTunes";class H extends S{constructor(){super([_i],Ei)}postMap(t,i){switch(t.id){case"rate":t.value={source:void 0,rating:Number.parseFloat(t.value)/100};break}}}var Ci={TITLE:"title",ARTIST:"artist",ARTISTS:"artists",ALBUMARTIST:"albumartist","ALBUM ARTIST":"albumartist",ALBUM:"album",DATE:"date",ORIGINALDATE:"originaldate",ORIGINALYEAR:"originalyear",RELEASEDATE:"releasedate",COMMENT:"comment",TRACKNUMBER:"track",DISCNUMBER:"disk",GENRE:"genre",METADATA_BLOCK_PICTURE:"picture",COMPOSER:"composer",LYRICS:"lyrics",ALBUMSORT:"albumsort",TITLESORT:"titlesort",WORK:"work",ARTISTSORT:"artistsort",ALBUMARTISTSORT:"albumartistsort",COMPOSERSORT:"composersort",LYRICIST:"lyricist",WRITER:"writer",CONDUCTOR:"conductor",REMIXER:"remixer",ARRANGER:"arranger",ENGINEER:"engineer",PRODUCER:"producer",DJMIXER:"djmixer",MIXER:"mixer",LABEL:"label",GROUPING:"grouping",SUBTITLE:"subtitle",DISCSUBTITLE:"discsubtitle",TRACKTOTAL:"totaltracks",DISCTOTAL:"totaldiscs",COMPILATION:"compilation",RATING:"rating",BPM:"bpm",KEY:"key",MOOD:"mood",MEDIA:"media",CATALOGNUMBER:"catalognumber",RELEASESTATUS:"releasestatus",RELEASETYPE:"releasetype",RELEASECOUNTRY:"releasecountry",SCRIPT:"script",LANGUAGE:"language",COPYRIGHT:"copyright",LICENSE:"license",ENCODEDBY:"encodedby",ENCODERSETTINGS:"encodersettings",BARCODE:"barcode",ISRC:"isrc",ASIN:"asin",MUSICBRAINZ_TRACKID:"musicbrainz_recordingid",MUSICBRAINZ_RELEASETRACKID:"musicbrainz_trackid",MUSICBRAINZ_ALBUMID:"musicbrainz_albumid",MUSICBRAINZ_ARTISTID:"musicbrainz_artistid",MUSICBRAINZ_ALBUMARTISTID:"musicbrainz_albumartistid",MUSICBRAINZ_RELEASEGROUPID:"musicbrainz_releasegroupid",MUSICBRAINZ_WORKID:"musicbrainz_workid",MUSICBRAINZ_TRMID:"musicbrainz_trmid",MUSICBRAINZ_DISCID:"musicbrainz_discid",ACOUSTID_ID:"acoustid_id",ACOUSTID_ID_FINGERPRINT:"acoustid_fingerprint",MUSICIP_PUID:"musicip_puid",WEBSITE:"website",NOTES:"notes",TOTALTRACKS:"totaltracks",TOTALDISCS:"totaldiscs",DISCOGS_ARTIST_ID:"discogs_artist_id",DISCOGS_ARTISTS:"artists",DISCOGS_ARTIST_NAME:"artists",DISCOGS_ALBUM_ARTISTS:"albumartist",DISCOGS_CATALOG:"catalognumber",DISCOGS_COUNTRY:"releasecountry",DISCOGS_DATE:"originaldate",DISCOGS_LABEL:"label",DISCOGS_LABEL_ID:"discogs_label_id",DISCOGS_MASTER_RELEASE_ID:"discogs_master_release_id",DISCOGS_RATING:"discogs_rating",DISCOGS_RELEASED:"date",DISCOGS_RELEASE_ID:"discogs_release_id",DISCOGS_VOTES:"discogs_votes",CATALOGID:"catalognumber",STYLE:"genre",REPLAYGAIN_TRACK_GAIN:"replaygain_track_gain",REPLAYGAIN_TRACK_PEAK:"replaygain_track_peak",REPLAYGAIN_ALBUM_GAIN:"replaygain_album_gain",REPLAYGAIN_ALBUM_PEAK:"replaygain_album_peak",REPLAYGAIN_MINMAX:"replaygain_track_minmax",REPLAYGAIN_ALBUM_MINMAX:"replaygain_album_minmax",REPLAYGAIN_UNDO:"replaygain_undo"};class z extends T{static toRating(t,i,r){return{source:t?t.toLowerCase():void 0,rating:Number.parseFloat(i)/r*T.maxRatingScore}}constructor(){super(["vorbis"],Ci)}postMap(t){if(t.id==="RATING")t.value=z.toRating(void 0,t.value,100);else if(t.id.indexOf("RATING:")===0){let i=t.id.split(":");t.value=z.toRating(i[1],t.value,1),t.id=i[0]}}}var Ri={IART:"artist",ICRD:"date",INAM:"title",TITL:"title",IPRD:"album",ITRK:"track",IPRT:"track",COMM:"comment",ICMT:"comment",ICNT:"releasecountry",GNRE:"genre",IWRI:"writer",RATE:"rating",YEAR:"year",ISFT:"encodedby",CODE:"encodedby",TURL:"website",IGNR:"genre",IENG:"engineer",ITCH:"technician",IMED:"media",IRPD:"album"};class ue extends T{constructor(){super(["exif"],Ri)}}var Bi={"segment:title":"title","album:ARTIST":"albumartist","album:ARTISTSORT":"albumartistsort","album:TITLE":"album","album:DATE_RECORDED":"originaldate","album:DATE_RELEASED":"releasedate","album:PART_NUMBER":"disk","album:TOTAL_PARTS":"totaltracks","track:ARTIST":"artist","track:ARTISTSORT":"artistsort","track:TITLE":"title","track:PART_NUMBER":"track","track:MUSICBRAINZ_TRACKID":"musicbrainz_recordingid","track:MUSICBRAINZ_ALBUMID":"musicbrainz_albumid","track:MUSICBRAINZ_ARTISTID":"musicbrainz_artistid","track:PUBLISHER":"label","track:GENRE":"genre","track:ENCODER":"encodedby","track:ENCODER_OPTIONS":"encodersettings","edition:TOTAL_PARTS":"totaldiscs",picture:"picture"};class le extends S{constructor(){super(["matroska"],Bi)}}var Li={NAME:"title",AUTH:"artist","(c) ":"copyright",ANNO:"comment"};class de extends T{constructor(){super(["AIFF"],Li)}}class xe{constructor(){this.tagMappers={},[new ce,new me,new V,new H,new H,new z,new pe,new K,new ue,new le,new de].forEach((t)=>{this.registerTagMapper(t)})}mapTag(t,i,r){if(this.tagMappers[t])return this.tagMappers[t].mapGenericTag(i,r);throw new Jo(`No generic tag mapper defined for tag-format: ${t}`)}registerTagMapper(t){for(let i of t.tagTypes)this.tagMappers[i]=t}}var he=/\[(\d{2}):(\d{2})\.(\d{2,3})]/;function it(t){if(he.test(t))return Oi(t);return Pi(t)}function Pi(t){return{contentType:vr.lyrics,timeStampFormat:Lr.notSynchronized,text:t.trim(),syncText:[]}}function Oi(t){let i=t.split(`
10
- `),r=[];for(let n of i){let o=n.match(he);if(o){let s=Number.parseInt(o[1],10),u=Number.parseInt(o[2],10),c=o[3].length===3?Number.parseInt(o[3],10):Number.parseInt(o[3],10)*10,d=(s*60+u)*1000+c,x=n.replace(he,"").trim();r.push({timestamp:d,text:x})}}return{contentType:vr.lyrics,timeStampFormat:Lr.milliseconds,text:r.map((n)=>n.text).join(`
11
- `),syncText:r}}var D=rt.default("music-metadata:collector"),Fi=["matroska","APEv2","vorbis","ID3v2.4","ID3v2.3","ID3v2.2","exif","asf","iTunes","AIFF","ID3v1"];class ge{constructor(t){this.format={tagTypes:[],trackInfo:[]},this.native={},this.common={track:{no:null,of:null},disk:{no:null,of:null},movementIndex:{no:null,of:null}},this.quality={warnings:[]},this.commonOrigin={},this.originPriority={},this.tagMapper=new xe,this.opts=t;let i=1;for(let r of Fi)this.originPriority[r]=i++;this.originPriority.artificial=500,this.originPriority.id3v1=600}hasAny(){return Object.keys(this.native).length>0}addStreamInfo(t){D(`streamInfo: type=${t.type?Mi[t.type]:"?"}, codec=${t.codecName}`),this.format.trackInfo.push(t)}setFormat(t,i){if(D(`format: ${t} = ${i}`),this.format[t]=i,this.opts?.observer)this.opts.observer({metadata:this,tag:{type:"format",id:t,value:i}})}setAudioOnly(){this.setFormat("hasAudio",!0),this.setFormat("hasVideo",!1)}async addTag(t,i,r){if(D(`tag ${t}.${i} = ${r}`),!this.native[t])this.format.tagTypes.push(t),this.native[t]=[];this.native[t].push({id:i,value:r}),await this.toCommon(t,i,r)}addWarning(t){this.quality.warnings.push({message:t})}async postMap(t,i){switch(i.id){case"artist":return this.handleSingularArtistTag(t,i,"artist","artists");case"albumartist":return this.handleSingularArtistTag(t,i,"albumartist","albumartists");case"artists":return this.handlePluralArtistTag(t,i,"artist","artists");case"albumartists":return this.handlePluralArtistTag(t,i,"albumartist","albumartists");case"picture":return this.postFixPicture(i.value).then((r)=>{if(r!==null)i.value=r,this.setGenericTag(t,i)});case"totaltracks":this.common.track.of=T.toIntOrNull(i.value);return;case"totaldiscs":this.common.disk.of=T.toIntOrNull(i.value);return;case"movementTotal":this.common.movementIndex.of=T.toIntOrNull(i.value);return;case"track":case"disk":case"movementIndex":{let r=this.common[i.id].of;this.common[i.id]=T.normalizeTrack(i.value),this.common[i.id].of=r!=null?r:this.common[i.id].of;return}case"bpm":case"year":case"originalyear":i.value=Number.parseInt(i.value,10);break;case"date":{let r=Number.parseInt(i.value.substr(0,4),10);if(!Number.isNaN(r))this.common.year=r;break}case"discogs_label_id":case"discogs_release_id":case"discogs_master_release_id":case"discogs_artist_id":case"discogs_votes":i.value=typeof i.value==="string"?Number.parseInt(i.value,10):i.value;break;case"replaygain_track_gain":case"replaygain_track_peak":case"replaygain_album_gain":case"replaygain_album_peak":i.value=Na(i.value);break;case"replaygain_track_minmax":i.value=i.value.split(",").map((r)=>Number.parseInt(r,10));break;case"replaygain_undo":{let r=i.value.split(",").map((n)=>Number.parseInt(n,10));i.value={leftChannel:r[0],rightChannel:r[1]};break}case"gapless":case"compilation":case"podcast":case"showMovement":i.value=i.value==="1"||i.value===1;break;case"isrc":{let r=this.common[i.id];if(r&&r.indexOf(i.value)!==-1)return;break}case"comment":if(typeof i.value==="string")i.value={text:i.value};if(i.value.descriptor==="iTunPGAP")this.setGenericTag(t,{id:"gapless",value:i.value.text==="1"});break;case"lyrics":if(typeof i.value==="string")i.value=it(i.value);break;default:}if(i.value!==null)this.setGenericTag(t,i)}toCommonMetadata(){return{format:this.format,native:this.native,quality:this.quality,common:this.common}}handleSingularArtistTag(t,i,r,n){if(this.commonOrigin[r]===this.originPriority[t])return this.postMap("artificial",{id:n,value:i.value});if(!this.common[n])this.setGenericTag("artificial",{id:n,value:i.value});this.setGenericTag(t,i)}handlePluralArtistTag(t,i,r,n){if(!this.common[r]||this.commonOrigin[r]===this.originPriority.artificial){if(!this.common[n]||this.common[n].indexOf(i.value)===-1){let o=(this.common[n]||[]).concat([i.value]),s=zi(o);this.setGenericTag("artificial",{id:r,value:s})}}this.setGenericTag(t,i)}async postFixPicture(t){if(t.data&&t.data.length>0){if(!t.format){let i=await F(Uint8Array.from(t.data));if(i)t.format=i.mime;else return null}switch(t.format=t.format.toLocaleLowerCase(),t.format){case"image/jpg":t.format="image/jpeg"}return t}return this.addWarning("Empty picture tag found"),null}async toCommon(t,i,r){let n={id:i,value:r},o=this.tagMapper.mapTag(t,n,this);if(o)await this.postMap(t,o)}setGenericTag(t,i){D(`common.${i.id} = ${i.value}`);let r=this.commonOrigin[i.id]||1000,n=this.originPriority[t];if(et(i.id))if(n<=r)this.common[i.id]=i.value,this.commonOrigin[i.id]=n;else return D(`Ignore native tag (singleton): ${t}.${i.id} = ${i.value}`);else if(n===r)if(!tt(i.id)||this.common[i.id].indexOf(i.value)===-1)this.common[i.id].push(i.value);else D(`Ignore duplicate value: ${t}.${i.id} = ${i.value}`);else if(n<r)this.common[i.id]=[i.value],this.commonOrigin[i.id]=n;else return D(`Ignore native tag (list): ${t}.${i.id} = ${i.value}`);if(this.opts?.observer)this.opts.observer({metadata:this,tag:{type:"common",id:i.id,value:i.value}})}}function zi(t){if(t.length>2)return`${t.slice(0,t.length-1).join(", ")} & ${t[t.length-1]}`;return t.join(" & ")}var at={parserType:"mpeg",extensions:[".mp2",".mp3",".m2a",".aac","aacp"],mimeTypes:["audio/mpeg","audio/mp3","audio/aacs","audio/aacp"],async load(){return(await import("./MpegParser-c460fwf0.js")).MpegParser}};var nt={parserType:"apev2",extensions:[".ape"],mimeTypes:["audio/ape","audio/monkeys-audio"],async load(){return(await import("./APEv2Parser-etzjd528.js")).APEv2Parser}};var ot={parserType:"asf",extensions:[".asf",".wma",".wmv"],mimeTypes:["audio/ms-wma","video/ms-wmv","audio/ms-asf","video/ms-asf","application/vnd.ms-asf"],async load(){return(await import("./AsfParser-wd98k2h4.js")).AsfParser}};var st={parserType:"dsdiff",extensions:[".dff"],mimeTypes:["audio/dsf","audio/dsd"],async load(){return(await import("./DsdiffParser-cbfaj500.js")).DsdiffParser}};var ct={parserType:"aiff",extensions:[".aif","aiff","aifc"],mimeTypes:["audio/aiff","audio/aif","audio/aifc","application/aiff"],async load(){return(await import("./AiffParser-y21k3fak.js")).AIFFParser}};var mt={parserType:"dsf",extensions:[".dsf"],mimeTypes:["audio/dsf"],async load(){return(await import("./DsfParser-tybrja4x.js")).DsfParser}};var pt={parserType:"flac",extensions:[".flac"],mimeTypes:["audio/flac"],async load(){return(await import("./FlacParser-7t7da7qy.js")).FlacParser}};var ut={parserType:"matroska",extensions:[".mka",".mkv",".mk3d",".mks","webm"],mimeTypes:["audio/matroska","video/matroska","audio/webm","video/webm"],async load(){return(await import("./MatroskaParser-cy2k4fac.js")).MatroskaParser}};var lt={parserType:"mp4",extensions:[".mp4",".m4a",".m4b",".m4pa","m4v","m4r","3gp",".mov",".movie",".qt"],mimeTypes:["audio/mp4","audio/m4a","video/m4v","video/mp4","video/quicktime"],async load(){return(await import("./MP4Parser-gc94h1n9.js")).MP4Parser}};var ft={parserType:"musepack",extensions:[".mpc"],mimeTypes:["audio/musepack"],async load(){return(await import("./MusepackParser-8mq2eabg.js")).MusepackParser}};var dt={parserType:"ogg",extensions:[".ogg",".ogv",".oga",".ogm",".ogx",".opus",".spx"],mimeTypes:["audio/ogg","audio/opus","audio/speex","video/ogg"],async load(){return(await import("./OggParser-7dnc6apg.js")).OggParser}};var xt={parserType:"wavpack",extensions:[".wv",".wvp"],mimeTypes:["audio/wavpack"],async load(){return(await import("./WavPackParser-kt7cds9c.js")).WavPackParser}};var ht={parserType:"riff",extensions:[".wav","wave",".bwf"],mimeTypes:["audio/vnd.wave","audio/wav","audio/wave"],async load(){return(await import("./WaveParser-g47ja0vy.js")).WaveParser}};var L=Tt.default("music-metadata:parser:factory");function Ni(t){let i=gt.default.parse(t),r=Qe(i.type);return{type:r.type,subtype:r.subtype,suffix:r.suffix,parameters:i.parameters}}class U{constructor(){this.parsers=[],[pt,at,nt,lt,ut,ht,dt,ot,ct,xt,ft,mt,st].forEach((t)=>{this.registerParser(t)})}registerParser(t){this.parsers.push(t)}async parse(t,i,r){if(t.supportsRandomAccess())L("tokenizer supports random-access, scanning for appending headers"),await yt(t,r);else L("tokenizer does not support random-access, cannot scan for appending headers");if(!i){let u=new Uint8Array(4100);if(t.fileInfo.mimeType)i=this.findLoaderForContentType(t.fileInfo.mimeType);if(!i&&t.fileInfo.path)i=this.findLoaderForExtension(t.fileInfo.path);if(!i){L("Guess parser on content..."),await t.peekBuffer(u,{mayBeLess:!0});let c=await F(u,{mpegOffsetTolerance:10});if(!c||!c.mime)throw new Dn("Failed to determine audio format");if(L(`Guessed file type is mime=${c.mime}, extension=${c.ext}`),i=this.findLoaderForContentType(c.mime),!i)throw new bn(`Guessed MIME-type not supported: ${c.mime}`)}}L(`Loading ${i.parserType} parser...`);let n=new ge(r),s=new(await i.load())(n,t,r??{});if(L(`Parser ${i.parserType} loaded`),await s.parse(),n.format.trackInfo){if(n.format.hasAudio===void 0)n.setFormat("hasAudio",!!n.format.trackInfo.find((u)=>u.type===Ce.audio));if(n.format.hasVideo===void 0)n.setFormat("hasVideo",!!n.format.trackInfo.find((u)=>u.type===Ce.video))}return n.toCommonMetadata()}findLoaderForExtension(t){if(!t)return;let i=Ui(t).toLocaleLowerCase()||t;return this.parsers.find((r)=>r.extensions.indexOf(i)!==-1)}findLoaderForContentType(t){let i;if(!t)return;try{i=Ni(t)}catch(n){L(`Invalid HTTP Content-Type header value: ${t}`);return}let r=i.subtype.indexOf("x-")===0?i.subtype.substring(2):i.subtype;return this.parsers.find((n)=>n.mimeTypes.find((o)=>o.indexOf(`${i.type}/${r}`)!==-1))}getSupportedMimeTypes(){let t=new Set;return this.parsers.forEach((i)=>{i.mimeTypes.forEach((r)=>{t.add(r),t.add(r.replace("/","/x-"))})}),Array.from(t)}}function Ui(t){let i=t.lastIndexOf(".");return i===-1?"":t.substring(i)}var Xi="LYRICS200";async function kt(t){let i=t.fileInfo.size;if(i>=143){let r=new Uint8Array(15),n=t.position;await t.readBuffer(r,{position:i-143}),t.setPosition(n);let o=X(r,"latin1");if(o.substring(6)===Xi)return Number.parseInt(o.substring(0,6),10)+15}return 0}async function tn(t,i,r={}){let n=Me(t,{fileInfo:typeof i==="string"?{mimeType:i}:i});return ye(n,r)}function ye(t,i){return new U().parse(t,void 0,i)}async function yt(t,i={}){let r=t.fileInfo.size;if(await Ma(t)){r-=128;let n=await kt(t);r-=n}i.apeHeader=await Lt.findApeFooterOffset(t,r)}var bt=St.default("music-metadata:parser");async function mn(t,i,r={}){let n=await Di(t,{fileInfo:typeof i==="string"?{mimeType:i}:i});try{return await ye(n,r)}finally{await n.close()}}async function pn(t,i={}){bt(`parseFile: ${t}`);let r=await ba(t),n=new U;try{let o=n.findLoaderForExtension(t);if(!o)bt("Parser could not be determined by file extension");try{return await n.parse(r,o,i)}catch(s){if(s instanceof Dn||s instanceof bn)s.message+=`: ${t}`;throw s}}finally{await r.close()}}export{tn as parseBuffer,pn as parseFile,mn as parseStream};
12
-
13
- //# debugId=81C015F0F66E714A64756E2164756E21
14
- //# sourceMappingURL=index-eqqd4k4f.js.map