@qitqode/qitqode-android-arm64 0.1.30 → 0.1.31

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 (416) hide show
  1. package/bundle/{chunk-37n34pzd.js → chunk-01my2y0c.js} +1 -1
  2. package/bundle/chunk-04n2ycg5.js +800 -0
  3. package/bundle/{chunk-6qy1ghrx.js → chunk-05mce0j3.js} +1 -1
  4. package/bundle/{chunk-g1dwbvkg.js → chunk-0bbs01f0.js} +1 -1
  5. package/bundle/{chunk-j6emx6jn.js → chunk-0dt0bxz6.js} +2 -2
  6. package/bundle/{chunk-mskwkcgj.js → chunk-0mx2psfc.js} +1 -1
  7. package/bundle/chunk-0p27fvfr.js +2 -0
  8. package/bundle/chunk-0qs1vx97.js +2 -0
  9. package/bundle/{chunk-f45tp3e3.js → chunk-0v0vqbn5.js} +1 -1
  10. package/bundle/chunk-0w0ctb90.js +2 -0
  11. package/bundle/{chunk-8qkhddq3.js → chunk-0yt5njh7.js} +2 -2
  12. package/bundle/{chunk-be216spx.js → chunk-10bjs581.js} +2 -2
  13. package/bundle/{chunk-bpbptx89.js → chunk-11x3t2tt.js} +1 -1
  14. package/bundle/{chunk-bss414qz.js → chunk-12vef2pr.js} +1 -1
  15. package/bundle/{chunk-jm1ptn8n.js → chunk-15hw2z9t.js} +1 -1
  16. package/bundle/chunk-1f7ajq8s.js +2 -0
  17. package/bundle/chunk-1fswr17z.js +2 -0
  18. package/bundle/{chunk-srh4xvsj.js → chunk-1gx18dm5.js} +1 -1
  19. package/bundle/chunk-1rhhhm88.js +2 -0
  20. package/bundle/{chunk-b0syck9r.js → chunk-1sgahe1s.js} +1 -1
  21. package/bundle/{chunk-26nfphsg.js → chunk-1vb79bw1.js} +1 -1
  22. package/bundle/chunk-1wbjh23g.js +2 -0
  23. package/bundle/chunk-20f83ca0.js +2 -0
  24. package/bundle/{chunk-371r2111.js → chunk-24jg9d61.js} +1 -1
  25. package/bundle/{chunk-1sgby720.js → chunk-2hc5z7b5.js} +1 -1
  26. package/bundle/{chunk-yq3m8190.js → chunk-2maqde7w.js} +2 -2
  27. package/bundle/{chunk-b8tw709r.js → chunk-2vn41ecx.js} +1 -1
  28. package/bundle/{chunk-w87a3mzm.js → chunk-2zq4k837.js} +1 -1
  29. package/bundle/chunk-31mnd3ph.js +3 -0
  30. package/bundle/{chunk-1bhvt33f.js → chunk-31qrzrwy.js} +1 -1
  31. package/bundle/{chunk-d5bxan80.js → chunk-326p5b10.js} +2 -2
  32. package/bundle/{chunk-0df4kede.js → chunk-33e9y2aw.js} +1 -1
  33. package/bundle/{chunk-zcm2jdr5.js → chunk-35xk4g91.js} +1 -1
  34. package/bundle/{chunk-5fz8tph5.js → chunk-3632wgg1.js} +1 -1
  35. package/bundle/{chunk-1ngtxja9.js → chunk-3bxg5bta.js} +1 -1
  36. package/bundle/{chunk-mgk9sh16.js → chunk-3c6p8tm3.js} +1 -1
  37. package/bundle/chunk-3h9rq2wq.js +2 -0
  38. package/bundle/{chunk-fqw4y7x0.js → chunk-3ytjm3az.js} +2 -2
  39. package/bundle/{chunk-2jmxt3fb.js → chunk-40efytmk.js} +1 -1
  40. package/bundle/chunk-42p59wm4.js +2 -0
  41. package/bundle/{chunk-wfs4pcwa.js → chunk-44a82dg0.js} +4 -4
  42. package/bundle/chunk-4512pvca.js +2 -0
  43. package/bundle/chunk-456bmaww.js +2 -0
  44. package/bundle/{chunk-c5e6sk9c.js → chunk-48ge2ryx.js} +1 -1
  45. package/bundle/chunk-48pajrnt.js +2 -0
  46. package/bundle/{chunk-12bssxd4.js → chunk-4cnwn1rh.js} +2 -2
  47. package/bundle/chunk-4d87mhwn.js +3 -0
  48. package/bundle/chunk-4fy9c54h.js +2 -0
  49. package/bundle/{chunk-hwbyqezq.js → chunk-4gkk28xk.js} +2 -2
  50. package/bundle/{chunk-4tbwha3m.js → chunk-4jtxtkj7.js} +2 -2
  51. package/bundle/{chunk-b3rpzkcb.js → chunk-50sv6y2e.js} +1 -1
  52. package/bundle/chunk-50tb3g5x.js +2 -0
  53. package/bundle/chunk-52bam8g7.js +2 -0
  54. package/bundle/{chunk-6fp8a9ek.js → chunk-53bqcctj.js} +1 -1
  55. package/bundle/chunk-53w4zqps.js +2 -0
  56. package/bundle/chunk-59y8q9m5.js +2 -0
  57. package/bundle/chunk-5eq1fft9.js +3 -0
  58. package/bundle/{chunk-a1pw9r6f.js → chunk-5hw6xa49.js} +2 -2
  59. package/bundle/{chunk-qrey2gwb.js → chunk-5q4harvc.js} +2 -2
  60. package/bundle/chunk-5tray1fw.js +3 -0
  61. package/bundle/{chunk-svvgv1s0.js → chunk-5v0xjs3x.js} +1 -1
  62. package/bundle/{chunk-my6sz5d6.js → chunk-60v5jvgt.js} +1 -1
  63. package/bundle/chunk-64ezpbwt.js +2 -0
  64. package/bundle/{chunk-2y90ad1v.js → chunk-68yw2hk9.js} +1 -1
  65. package/bundle/{chunk-5fgx6fa4.js → chunk-69nzndk7.js} +1 -1
  66. package/bundle/chunk-6bpe215q.js +2 -0
  67. package/bundle/chunk-6bphjajd.js +2 -0
  68. package/bundle/{chunk-chmrvbbj.js → chunk-6d5rrre9.js} +1 -1
  69. package/bundle/{chunk-g3dhsmbt.js → chunk-6hpgb8h4.js} +3 -3
  70. package/bundle/{chunk-drs1gv2b.js → chunk-6kp07m7p.js} +1 -1
  71. package/bundle/{chunk-wy46mbwt.js → chunk-6phh70sp.js} +1 -1
  72. package/bundle/chunk-6t1ehq36.js +2 -0
  73. package/bundle/{chunk-v2zp22r3.js → chunk-70ck4v3t.js} +1 -1
  74. package/bundle/{chunk-2tnarng3.js → chunk-71sjjjr8.js} +1 -1
  75. package/bundle/{chunk-ds69qc8b.js → chunk-71xz70r9.js} +1 -1
  76. package/bundle/{chunk-2dzk5txw.js → chunk-73e409hd.js} +1 -1
  77. package/bundle/{chunk-g7rjtehn.js → chunk-78ymd20x.js} +1 -1
  78. package/bundle/{chunk-szr0f7k2.js → chunk-7avcnwv8.js} +1 -1
  79. package/bundle/{chunk-z8v2tsz2.js → chunk-7hm0c2yg.js} +1 -1
  80. package/bundle/chunk-7mke41x0.js +2 -0
  81. package/bundle/chunk-7pfj4x1a.js +2 -0
  82. package/bundle/chunk-7ry9cvby.js +2 -0
  83. package/bundle/chunk-7wczs9mx.js +2 -0
  84. package/bundle/{chunk-aztre27e.js → chunk-7xm75w1e.js} +1 -1
  85. package/bundle/{chunk-s3yna2wm.js → chunk-7z5jh4ra.js} +1 -1
  86. package/bundle/{chunk-vj62pc0h.js → chunk-81qwdg5s.js} +1 -1
  87. package/bundle/{chunk-mrw279k3.js → chunk-83gqkmth.js} +1 -1
  88. package/bundle/chunk-873skv7w.js +2 -0
  89. package/bundle/{chunk-6hv59ere.js → chunk-8hytwgwf.js} +1 -1
  90. package/bundle/{chunk-wz0zcddf.js → chunk-8n20thvd.js} +2 -2
  91. package/bundle/{chunk-s07j8hfy.js → chunk-8qswepp2.js} +1 -1
  92. package/bundle/chunk-8v96pmqn.js +2 -0
  93. package/bundle/chunk-8y2scz6z.js +2 -0
  94. package/bundle/{chunk-wpajh5s5.js → chunk-8ymffyep.js} +1 -1
  95. package/bundle/chunk-8zx7vnx6.js +2 -0
  96. package/bundle/{chunk-qhc90p4a.js → chunk-93p131d5.js} +1 -1
  97. package/bundle/chunk-94a76f8w.js +2 -0
  98. package/bundle/{chunk-ppfjf7qx.js → chunk-9emq67vc.js} +1 -1
  99. package/bundle/{chunk-bvkq0a5q.js → chunk-9f1z9xce.js} +1 -1
  100. package/bundle/chunk-9mjz6e27.js +2 -0
  101. package/bundle/chunk-9ng7jjp7.js +2 -0
  102. package/bundle/chunk-9tpgnjy8.js +2 -0
  103. package/bundle/{chunk-0fmbz83g.js → chunk-9x5232dw.js} +1 -1
  104. package/bundle/{chunk-mk6cddvd.js → chunk-a1wdeapb.js} +1 -1
  105. package/bundle/{chunk-qjn86fc0.js → chunk-a7amey9s.js} +1 -1
  106. package/bundle/chunk-a7ym9f0v.js +2 -0
  107. package/bundle/chunk-a8f2xvy3.js +2 -0
  108. package/bundle/chunk-a99cvwta.js +2 -0
  109. package/bundle/chunk-abd1cfpg.js +2 -0
  110. package/bundle/{chunk-89v6dgpp.js → chunk-ag8kz1e7.js} +2 -2
  111. package/bundle/chunk-anwnwfjf.js +2 -0
  112. package/bundle/chunk-avys5mnz.js +2 -0
  113. package/bundle/chunk-axvjd10y.js +2 -0
  114. package/bundle/{chunk-m612agnk.js → chunk-ay8emwym.js} +1 -1
  115. package/bundle/chunk-b4pphqab.js +2 -0
  116. package/bundle/chunk-b6087ak4.js +2 -0
  117. package/bundle/{chunk-msegx0t7.js → chunk-b8gjz6bk.js} +1 -1
  118. package/bundle/chunk-bgw4fvg2.js +2 -0
  119. package/bundle/{chunk-gf0pdgjs.js → chunk-bh53dz71.js} +1 -1
  120. package/bundle/chunk-bn0h9dny.js +10 -0
  121. package/bundle/chunk-brkqxbjy.js +2 -0
  122. package/bundle/{chunk-09kba1hg.js → chunk-c11d28qn.js} +2 -2
  123. package/bundle/{chunk-ejjea8hh.js → chunk-c14s0kxq.js} +1 -1
  124. package/bundle/{chunk-sn4nez18.js → chunk-c1bdzxbx.js} +2 -2
  125. package/bundle/{chunk-ezja6njs.js → chunk-c1vnp55z.js} +1 -1
  126. package/bundle/chunk-c26qxt5g.js +2 -0
  127. package/bundle/chunk-c6zscb38.js +2 -0
  128. package/bundle/{chunk-pekm54ce.js → chunk-cfgvm15x.js} +1 -1
  129. package/bundle/{chunk-v4xcysh0.js → chunk-chpr8ekb.js} +1 -1
  130. package/bundle/chunk-cjww2jmv.js +3 -0
  131. package/bundle/{chunk-m67tcnk4.js → chunk-ck2gfaba.js} +1 -1
  132. package/bundle/chunk-cmbh77cs.js +7 -0
  133. package/bundle/{chunk-k8ss3135.js → chunk-cnmq5xtq.js} +218 -218
  134. package/bundle/{chunk-9j1qqdr2.js → chunk-cphrgyp6.js} +1 -1
  135. package/bundle/chunk-csz0dgyp.js +2 -0
  136. package/bundle/{chunk-eb9mytjq.js → chunk-ctaze2hn.js} +1 -1
  137. package/bundle/{chunk-5qam3c8r.js → chunk-cxnfy6qk.js} +1 -1
  138. package/bundle/{chunk-cafzcmrg.js → chunk-d07p6fpk.js} +2 -2
  139. package/bundle/{chunk-whcg14sc.js → chunk-d65qs4d0.js} +1 -1
  140. package/bundle/{chunk-dcvatax2.js → chunk-d68fzyw7.js} +2 -2
  141. package/bundle/{chunk-4qqkqrn9.js → chunk-d6ry9418.js} +2 -2
  142. package/bundle/{chunk-ztc3gm8y.js → chunk-dactgryw.js} +1 -1
  143. package/bundle/chunk-dafmkrhn.js +2 -0
  144. package/bundle/{chunk-dfnv7vkn.js → chunk-db405hjg.js} +1 -1
  145. package/bundle/chunk-dgprdym0.js +2 -0
  146. package/bundle/{chunk-7yrhe3xq.js → chunk-dnwefyhv.js} +1 -1
  147. package/bundle/{chunk-n26yf3he.js → chunk-drvkj3xg.js} +1 -1
  148. package/bundle/chunk-dryzt12j.js +2 -0
  149. package/bundle/chunk-dsamees2.js +2 -0
  150. package/bundle/{chunk-xpc2zgj7.js → chunk-dxpj0cxh.js} +2 -2
  151. package/bundle/{chunk-yjtdgcq5.js → chunk-dynv30gm.js} +1 -1
  152. package/bundle/chunk-dyqpxx3b.js +2 -0
  153. package/bundle/{chunk-2rs39vj2.js → chunk-e01wnqvc.js} +1 -1
  154. package/bundle/{chunk-2vepzgek.js → chunk-e10py6yr.js} +1 -1
  155. package/bundle/{chunk-qv2s39dv.js → chunk-e7ny0b3x.js} +1 -1
  156. package/bundle/{chunk-fjgyrsbw.js → chunk-eh7e49k4.js} +1 -1
  157. package/bundle/{chunk-42f7p0hq.js → chunk-ehhas0ew.js} +2 -2
  158. package/bundle/{chunk-n8h6x2en.js → chunk-ejrhvy38.js} +1 -1
  159. package/bundle/{chunk-dq9kpj4a.js → chunk-enpzvmtc.js} +1 -1
  160. package/bundle/chunk-excnptfy.js +2 -0
  161. package/bundle/chunk-ez8vkgfz.js +2 -0
  162. package/bundle/chunk-f2btnww9.js +2 -0
  163. package/bundle/chunk-f8eter69.js +5 -0
  164. package/bundle/{chunk-2km50rd3.js → chunk-fgg9txzb.js} +1 -1
  165. package/bundle/chunk-fjq3a347.js +2 -0
  166. package/bundle/{chunk-b9za12y1.js → chunk-fn9h4ync.js} +1 -1
  167. package/bundle/{chunk-ddnpx1yx.js → chunk-fq0x3esz.js} +5 -5
  168. package/bundle/{chunk-ngchsw2g.js → chunk-fvzwbjh8.js} +1 -1
  169. package/bundle/chunk-fxdtq2ed.js +2 -0
  170. package/bundle/{chunk-07g7cybt.js → chunk-fyqjm5fv.js} +1 -1
  171. package/bundle/{chunk-nzehfpxp.js → chunk-g10d6x57.js} +1 -1
  172. package/bundle/{chunk-zyhdxggp.js → chunk-g5rabwre.js} +2 -2
  173. package/bundle/{chunk-kfsb2stm.js → chunk-g7ccdh7r.js} +1 -1
  174. package/bundle/{chunk-3g1yz39h.js → chunk-g9cjsfvg.js} +1 -1
  175. package/bundle/{chunk-phxrg7aw.js → chunk-gagtmjmp.js} +2 -2
  176. package/bundle/{chunk-yp0a8q29.js → chunk-gb00fh4z.js} +3 -3
  177. package/bundle/{chunk-hw1dmx28.js → chunk-gbpvs0fx.js} +1 -1
  178. package/bundle/{chunk-zv6pjtz1.js → chunk-gbrnn2dk.js} +1 -1
  179. package/bundle/chunk-gcw4rn10.js +2 -0
  180. package/bundle/{chunk-j8efst22.js → chunk-gj0wt0cy.js} +1 -1
  181. package/bundle/{chunk-2q96x1t5.js → chunk-gsar6xda.js} +1 -1
  182. package/bundle/{chunk-xs3xtz6x.js → chunk-gt31468k.js} +1 -1
  183. package/bundle/{chunk-ecn8gbtz.js → chunk-gwp17r03.js} +1 -1
  184. package/bundle/chunk-gwzw92jt.js +2 -0
  185. package/bundle/{chunk-2bn4b42t.js → chunk-h2afsbm1.js} +1 -1
  186. package/bundle/{chunk-tj78jsp9.js → chunk-h4j5xzc8.js} +1 -1
  187. package/bundle/{chunk-b3dqcbsc.js → chunk-hbbsbyyq.js} +1 -1
  188. package/bundle/chunk-hnctaq8s.js +3 -0
  189. package/bundle/{chunk-vn7nkrqb.js → chunk-hnzegjgv.js} +1 -1
  190. package/bundle/chunk-hp7tssgv.js +2 -0
  191. package/bundle/chunk-ht0hbdmx.js +2 -0
  192. package/bundle/{chunk-j9pcnkkq.js → chunk-ht5w06x7.js} +2 -2
  193. package/bundle/{chunk-a1p2f16h.js → chunk-htz93dsd.js} +2 -2
  194. package/bundle/{chunk-q6ztpfcs.js → chunk-jbx3s7nw.js} +2 -2
  195. package/bundle/chunk-jcjbr3q7.js +2 -0
  196. package/bundle/{chunk-h9pvnp5c.js → chunk-jef04wyf.js} +1 -1
  197. package/bundle/{chunk-ct48575c.js → chunk-jh0bw59r.js} +1 -1
  198. package/bundle/{chunk-knpt9n8f.js → chunk-jrqb0jwy.js} +1 -1
  199. package/bundle/{chunk-1dwcga8g.js → chunk-js1n8tgv.js} +1 -1
  200. package/bundle/chunk-jxswwvr3.js +2 -0
  201. package/bundle/{chunk-1rp1cvmc.js → chunk-kf167jw7.js} +1 -1
  202. package/bundle/{chunk-wsy0m70r.js → chunk-kfxv5rfg.js} +1 -1
  203. package/bundle/{chunk-btz9jvec.js → chunk-kj20f048.js} +1 -1
  204. package/bundle/{chunk-j5kb0y1m.js → chunk-kq6b222y.js} +1 -1
  205. package/bundle/{chunk-1t9jne14.js → chunk-ktzq4ha1.js} +1 -1
  206. package/bundle/chunk-m5m448mg.js +3 -0
  207. package/bundle/chunk-mcg24gkb.js +5 -0
  208. package/bundle/chunk-mh0j6dzy.js +2 -0
  209. package/bundle/{chunk-1qshjfzm.js → chunk-mk1bfzg5.js} +1 -1
  210. package/bundle/chunk-mxzceza9.js +2 -0
  211. package/bundle/{chunk-t12xrrfr.js → chunk-mzs2pjyc.js} +2 -2
  212. package/bundle/chunk-n0dy98h2.js +2 -0
  213. package/bundle/{chunk-m02zt1a3.js → chunk-n9xns8by.js} +2 -2
  214. package/bundle/chunk-ngm6pqyt.js +2 -0
  215. package/bundle/chunk-ngtavamt.js +2 -0
  216. package/bundle/chunk-nkhc32s3.js +2 -0
  217. package/bundle/chunk-npse2xrd.js +2 -0
  218. package/bundle/{chunk-4p5e5tsz.js → chunk-nsk8dkwp.js} +1 -1
  219. package/bundle/{chunk-k7gq9bra.js → chunk-nv3eyyaj.js} +1 -1
  220. package/bundle/{chunk-ab6cabxh.js → chunk-p18axz0m.js} +1 -1
  221. package/bundle/{chunk-jje0srjq.js → chunk-p62gb4wj.js} +1 -1
  222. package/bundle/chunk-p6e4vqy7.js +2 -0
  223. package/bundle/{chunk-m1h5a4vg.js → chunk-p9qfbr02.js} +1 -1
  224. package/bundle/{chunk-yn6sbycg.js → chunk-pctt1qv8.js} +2 -2
  225. package/bundle/{chunk-ggqst87g.js → chunk-pe29yy6s.js} +1 -1
  226. package/bundle/chunk-pf9g671w.js +2 -0
  227. package/bundle/chunk-phv9kdq6.js +3 -0
  228. package/bundle/{chunk-3n1324bt.js → chunk-pp2eqkse.js} +1 -1
  229. package/bundle/{chunk-x067eetw.js → chunk-pp6vhqrr.js} +1 -1
  230. package/bundle/chunk-ppjnqexm.js +2 -0
  231. package/bundle/chunk-pqkjhn8h.js +2 -0
  232. package/bundle/{chunk-hxz2rdjq.js → chunk-pxvk3syj.js} +1 -1
  233. package/bundle/{chunk-b8bytvka.js → chunk-qbc36nbb.js} +2 -2
  234. package/bundle/{chunk-89q1y7tc.js → chunk-qc8rsn4v.js} +1 -1
  235. package/bundle/chunk-qd8w2gkd.js +2 -0
  236. package/bundle/{chunk-q1v2pytx.js → chunk-qrsveve6.js} +1 -1
  237. package/bundle/chunk-qvnb3j71.js +3 -0
  238. package/bundle/{chunk-2gerf08b.js → chunk-r4ndwym0.js} +2 -2
  239. package/bundle/chunk-r78czx4d.js +8 -0
  240. package/bundle/{chunk-7ppd2phw.js → chunk-rbk8seme.js} +1 -1
  241. package/bundle/{chunk-gj3hzx3d.js → chunk-redjxn13.js} +2 -2
  242. package/bundle/chunk-rf12t4n5.js +2 -0
  243. package/bundle/{chunk-04tw0r4s.js → chunk-rg0mrprz.js} +1 -1
  244. package/bundle/{chunk-cdhmc0t0.js → chunk-rjd8gbs5.js} +1 -1
  245. package/bundle/chunk-rpgne7xh.js +2 -0
  246. package/bundle/chunk-rvgj1vky.js +2 -0
  247. package/bundle/{chunk-c01z3cvg.js → chunk-rvkrgkeq.js} +1 -1
  248. package/bundle/{chunk-2ahqhh4z.js → chunk-rzhdkkpz.js} +1 -1
  249. package/bundle/{chunk-5v4py9p2.js → chunk-s9ntkjz3.js} +1 -1
  250. package/bundle/{chunk-kqn9h2gk.js → chunk-skqbaadf.js} +1 -1
  251. package/bundle/chunk-ss2jvqrg.js +2 -0
  252. package/bundle/{chunk-ydp0q1hk.js → chunk-ss2ms1r3.js} +1 -1
  253. package/bundle/chunk-ssajqv72.js +2 -0
  254. package/bundle/{chunk-1fbeendk.js → chunk-t56r99hp.js} +1 -1
  255. package/bundle/{chunk-xc5044tm.js → chunk-t8m74g39.js} +1 -1
  256. package/bundle/{chunk-s6bar2f9.js → chunk-t9mz17gb.js} +2 -2
  257. package/bundle/chunk-takew94z.js +9 -0
  258. package/bundle/{chunk-cvdxgsq1.js → chunk-tq0239xp.js} +1 -1
  259. package/bundle/{chunk-whxjkz9a.js → chunk-tqj69nh6.js} +2 -2
  260. package/bundle/{chunk-hj5y7fvk.js → chunk-tt30dybd.js} +1 -1
  261. package/bundle/{chunk-5a5t01ka.js → chunk-tvdmnee6.js} +1 -1
  262. package/bundle/chunk-tvwwq4b3.js +2 -0
  263. package/bundle/{chunk-dhjp0zx2.js → chunk-v1xjc3s8.js} +1 -1
  264. package/bundle/chunk-v2n26eg4.js +2 -0
  265. package/bundle/chunk-vb286b31.js +2 -0
  266. package/bundle/chunk-vbeb74ny.js +11 -0
  267. package/bundle/chunk-vcw00k0n.js +3 -0
  268. package/bundle/{chunk-7jbz3dgt.js → chunk-vhe0tth1.js} +1 -1
  269. package/bundle/{chunk-yfkvjphe.js → chunk-vvxmwyrw.js} +1 -1
  270. package/bundle/{chunk-p68rwmhc.js → chunk-vxyy2dp3.js} +2 -2
  271. package/bundle/{chunk-y2v09y71.js → chunk-vywnd5sf.js} +1 -1
  272. package/bundle/{chunk-0jgsp4c2.js → chunk-w18xs2h5.js} +1 -1
  273. package/bundle/{chunk-d6r4xwtg.js → chunk-wfb608qf.js} +3 -3
  274. package/bundle/chunk-x24y7qyd.js +2 -0
  275. package/bundle/{chunk-tr8sf0dk.js → chunk-x3y2xzhn.js} +1 -1
  276. package/bundle/{chunk-27yxgy03.js → chunk-x4sp99g6.js} +1 -1
  277. package/bundle/{chunk-3nwve06r.js → chunk-x562b0xk.js} +1 -1
  278. package/bundle/{chunk-61c62e5s.js → chunk-x7k5yeey.js} +1 -1
  279. package/bundle/{chunk-fkgv2hqd.js → chunk-x9rbv6p6.js} +1 -1
  280. package/bundle/{chunk-wnqwb6fd.js → chunk-xcmgkc57.js} +1 -1
  281. package/bundle/{chunk-gm85xefs.js → chunk-xm7wascx.js} +1 -1
  282. package/bundle/{chunk-6nbzdb0r.js → chunk-xthkjax9.js} +1 -1
  283. package/bundle/{chunk-scnz207s.js → chunk-xvwvd4kq.js} +2 -2
  284. package/bundle/{chunk-zb0me4kk.js → chunk-xzrb857v.js} +1 -1
  285. package/bundle/chunk-y2d0w09y.js +2 -0
  286. package/bundle/{chunk-3nyqh1d6.js → chunk-y3b4k38p.js} +1 -1
  287. package/bundle/{chunk-vg2fmyje.js → chunk-y9q0hb7b.js} +2 -2
  288. package/bundle/chunk-yb79f79m.js +2 -0
  289. package/bundle/{chunk-fnbpap62.js → chunk-yek0sk2q.js} +1 -1
  290. package/bundle/{chunk-3bmzjznz.js → chunk-yhbcbjfk.js} +1 -1
  291. package/bundle/{chunk-sermjas1.js → chunk-yjf3kyej.js} +1 -1
  292. package/bundle/chunk-yjnyzpmt.js +2 -0
  293. package/bundle/{chunk-0a0vat1h.js → chunk-yp5bypsp.js} +2 -2
  294. package/bundle/{chunk-h0rpmne5.js → chunk-yp8wyzzm.js} +1 -1
  295. package/bundle/chunk-yqbcnsa1.js +2 -0
  296. package/bundle/{chunk-4xh1qm90.js → chunk-yv0xrnn9.js} +1 -1
  297. package/bundle/chunk-z3mra3nm.js +2 -0
  298. package/bundle/{chunk-yy526n9c.js → chunk-z6pwkwdr.js} +1 -1
  299. package/bundle/{chunk-snm5q21k.js → chunk-zs8kqdsf.js} +2 -2
  300. package/bundle/{chunk-y062spw2.js → chunk-zscer8rc.js} +1 -1
  301. package/bundle/{chunk-qjjch1zt.js → chunk-zw815d68.js} +2 -2
  302. package/bundle/chunk-zy9w1vkc.js +2 -0
  303. package/bundle/index.js +3 -3
  304. package/bundle/parser.worker.js +2 -2
  305. package/bundle/worker.js +1 -1
  306. package/package.json +1 -1
  307. package/bundle/chunk-07ws99b1.js +0 -2
  308. package/bundle/chunk-09c4ngag.js +0 -2
  309. package/bundle/chunk-0ch32p4c.js +0 -3
  310. package/bundle/chunk-0jgst767.js +0 -2
  311. package/bundle/chunk-0psrr9vp.js +0 -2
  312. package/bundle/chunk-1j73cnvz.js +0 -2
  313. package/bundle/chunk-1yddn03z.js +0 -2
  314. package/bundle/chunk-27dgtm8r.js +0 -2
  315. package/bundle/chunk-2ec6ps8r.js +0 -5
  316. package/bundle/chunk-38g8yzw0.js +0 -2
  317. package/bundle/chunk-3bkd0ar3.js +0 -2
  318. package/bundle/chunk-3f4zht9e.js +0 -2
  319. package/bundle/chunk-3pxnp6jb.js +0 -2
  320. package/bundle/chunk-3szwfy7w.js +0 -3
  321. package/bundle/chunk-426dt7be.js +0 -2
  322. package/bundle/chunk-4amgp4yd.js +0 -3
  323. package/bundle/chunk-4pjm21a5.js +0 -2
  324. package/bundle/chunk-4sz3jbc5.js +0 -2
  325. package/bundle/chunk-58x5seqn.js +0 -2
  326. package/bundle/chunk-5xe6x2rt.js +0 -2
  327. package/bundle/chunk-618tmyx9.js +0 -2
  328. package/bundle/chunk-6d9wsjxm.js +0 -2
  329. package/bundle/chunk-730a2d1k.js +0 -2
  330. package/bundle/chunk-76wrw0cs.js +0 -2
  331. package/bundle/chunk-7bd0x9vf.js +0 -2
  332. package/bundle/chunk-7czkntef.js +0 -2
  333. package/bundle/chunk-7ex57nyh.js +0 -2
  334. package/bundle/chunk-7gpczxbh.js +0 -2
  335. package/bundle/chunk-7j0bgeh2.js +0 -2
  336. package/bundle/chunk-7py443fe.js +0 -2
  337. package/bundle/chunk-90q5sae0.js +0 -2
  338. package/bundle/chunk-9amwe0ed.js +0 -2
  339. package/bundle/chunk-9grvepmd.js +0 -2
  340. package/bundle/chunk-9hrh15p2.js +0 -2
  341. package/bundle/chunk-a0v55ywn.js +0 -8
  342. package/bundle/chunk-a2qz9m10.js +0 -2
  343. package/bundle/chunk-av6ezvxm.js +0 -2
  344. package/bundle/chunk-beksar7w.js +0 -2
  345. package/bundle/chunk-bg66rqrx.js +0 -2
  346. package/bundle/chunk-bn15mzd7.js +0 -2
  347. package/bundle/chunk-bt6yw07v.js +0 -2
  348. package/bundle/chunk-cy9s1ma5.js +0 -2
  349. package/bundle/chunk-d0nkvp57.js +0 -2
  350. package/bundle/chunk-dvk2wwjj.js +0 -2
  351. package/bundle/chunk-dxe29jj6.js +0 -2
  352. package/bundle/chunk-e0jy9qxd.js +0 -2
  353. package/bundle/chunk-eercqt72.js +0 -2
  354. package/bundle/chunk-efxd6b2k.js +0 -2
  355. package/bundle/chunk-eneawsj8.js +0 -2
  356. package/bundle/chunk-f72pppr7.js +0 -2
  357. package/bundle/chunk-feyphhxd.js +0 -2
  358. package/bundle/chunk-fnnch1e9.js +0 -2
  359. package/bundle/chunk-ft93f33g.js +0 -3
  360. package/bundle/chunk-gk34kh8p.js +0 -2
  361. package/bundle/chunk-gn50xqbd.js +0 -2
  362. package/bundle/chunk-h6rv626m.js +0 -2
  363. package/bundle/chunk-h7s2w1e2.js +0 -2
  364. package/bundle/chunk-hmv2cdnz.js +0 -2
  365. package/bundle/chunk-ht81ensf.js +0 -2
  366. package/bundle/chunk-hxpgs78j.js +0 -5
  367. package/bundle/chunk-j59ktwny.js +0 -2
  368. package/bundle/chunk-jmz2mq3t.js +0 -2
  369. package/bundle/chunk-jvqbvgjy.js +0 -11
  370. package/bundle/chunk-k309zez0.js +0 -3
  371. package/bundle/chunk-k3fn3yed.js +0 -2
  372. package/bundle/chunk-kpw6nghv.js +0 -2
  373. package/bundle/chunk-m5ghbt5y.js +0 -2
  374. package/bundle/chunk-mj4bepvj.js +0 -2
  375. package/bundle/chunk-mn41f9qv.js +0 -2
  376. package/bundle/chunk-mqjf9sbm.js +0 -2
  377. package/bundle/chunk-n5gwrrbb.js +0 -2
  378. package/bundle/chunk-nfjhem1c.js +0 -2
  379. package/bundle/chunk-ngytjdg2.js +0 -3
  380. package/bundle/chunk-nj4d554m.js +0 -11
  381. package/bundle/chunk-nrc3bj9p.js +0 -2
  382. package/bundle/chunk-nt4e3em9.js +0 -3
  383. package/bundle/chunk-nxyyn2ra.js +0 -2
  384. package/bundle/chunk-p5tceb4k.js +0 -2
  385. package/bundle/chunk-pvpy9kq1.js +0 -800
  386. package/bundle/chunk-qjgm3e2p.js +0 -2
  387. package/bundle/chunk-qt80mhdn.js +0 -2
  388. package/bundle/chunk-qtw5nrr4.js +0 -2
  389. package/bundle/chunk-rc9ex3vt.js +0 -2
  390. package/bundle/chunk-s9672vvv.js +0 -2
  391. package/bundle/chunk-sbyey0qb.js +0 -2
  392. package/bundle/chunk-shpq6es1.js +0 -3
  393. package/bundle/chunk-sj5v361q.js +0 -2
  394. package/bundle/chunk-ta3k9syc.js +0 -2
  395. package/bundle/chunk-tk5afan4.js +0 -2
  396. package/bundle/chunk-tpndnprb.js +0 -2
  397. package/bundle/chunk-v965rsr8.js +0 -3
  398. package/bundle/chunk-vcmrrt8b.js +0 -3
  399. package/bundle/chunk-vcrn3v70.js +0 -2
  400. package/bundle/chunk-vwxfgea7.js +0 -2
  401. package/bundle/chunk-w0kgcz1t.js +0 -2
  402. package/bundle/chunk-wgpsmxqx.js +0 -7
  403. package/bundle/chunk-wksczmes.js +0 -2
  404. package/bundle/chunk-wsxta33r.js +0 -2
  405. package/bundle/chunk-xck0sq3k.js +0 -2
  406. package/bundle/chunk-xjyhtm8r.js +0 -2
  407. package/bundle/chunk-xm08fc2q.js +0 -3
  408. package/bundle/chunk-ygc5qegv.js +0 -2
  409. package/bundle/chunk-yjqmzm51.js +0 -2
  410. package/bundle/chunk-yzc53n88.js +0 -2
  411. package/bundle/chunk-yzjc15vp.js +0 -9
  412. package/bundle/chunk-z7y9pdj7.js +0 -2
  413. package/bundle/chunk-z8g819cz.js +0 -2
  414. package/bundle/chunk-z8r65yw3.js +0 -2
  415. package/bundle/chunk-zt1nbwmm.js +0 -2
  416. package/bundle/chunk-zz36xg2n.js +0 -2
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Cd as W$}from"./chunk-5v4py9p2.js";import{Ed as j$}from"./chunk-07g7cybt.js";import{Rd as A$}from"./chunk-yajd975f.js";import{Of as J$}from"./chunk-ezja6njs.js";import{ag as Z$}from"./chunk-yn6sbycg.js";import"./chunk-bpbptx89.js";import"./chunk-2y90ad1v.js";import"./chunk-yzjc15vp.js";import"./chunk-4amgp4yd.js";import"./chunk-nfg7nt13.js";import"./chunk-scnz207s.js";import"./chunk-b8bytvka.js";import{hh as MD}from"./chunk-ddnpx1yx.js";import{Vh as hD}from"./chunk-wfs4pcwa.js";import"./chunk-p68rwmhc.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-a1pw9r6f.js";import"./chunk-d5bxan80.js";import{ql as _$,rl as U,sk as sD,tl as G$,yk as k,zk as P}from"./chunk-pvpy9kq1.js";import"./chunk-wpajh5s5.js";import"./chunk-2ec6ps8r.js";import"./chunk-gj3hzx3d.js";import"./chunk-nj4d554m.js";import"./chunk-2gerf08b.js";import"./chunk-fqw4y7x0.js";import"./chunk-a1p2f16h.js";import"./chunk-nt4e3em9.js";import{Lp as X$,Op as Y$}from"./chunk-a0v55ywn.js";import"./chunk-v965rsr8.js";import"./chunk-1sgby720.js";import"./chunk-dcvatax2.js";import"./chunk-4tbwha3m.js";import"./chunk-m612agnk.js";import"./chunk-yq3m8190.js";import{yr as f$}from"./chunk-btz9jvec.js";import"./chunk-cqtkxwd8.js";import"./chunk-fkgv2hqd.js";import"./chunk-zyhdxggp.js";import"./chunk-q6ztpfcs.js";import"./chunk-jm1ptn8n.js";import"./chunk-c5e6sk9c.js";import"./chunk-m02zt1a3.js";import"./chunk-vg2fmyje.js";import"./chunk-sn4nez18.js";import"./chunk-42f7p0hq.js";import"./chunk-4qqkqrn9.js";import"./chunk-j6emx6jn.js";import"./chunk-be216spx.js";import"./chunk-12bssxd4.js";import"./chunk-z8r65yw3.js";import{ku as w$,tt as Q$,yu as H}from"./chunk-3szwfy7w.js";import{Su as kD}from"./chunk-whxjkz9a.js";import"./chunk-89v6dgpp.js";import"./chunk-k309zez0.js";import{qv as D}from"./chunk-09kba1hg.js";import"./chunk-t12xrrfr.js";import"./chunk-phxrg7aw.js";import"./chunk-snm5q21k.js";import"./chunk-xpc2zgj7.js";import"./chunk-qjjch1zt.js";import{bQ as ow}from"./chunk-aztre27e.js";var O={authenticate:"authenticate",initialize:"initialize",session_cancel:"session/cancel",session_close:"session/close",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_resume:"session/resume",session_set_config_option:"session/set_config_option",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},F={fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"};var K$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),terminal:D.boolean().optional().default(!1)}),B$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),label:D.string().nullish(),name:D.string(),optional:D.boolean().optional().default(!1),secret:D.boolean().optional().default(!0)}),O$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),description:D.string().nullish(),id:D.string(),name:D.string()}),N$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),description:D.string().nullish(),id:D.string(),link:D.string().nullish(),name:D.string(),vars:D.array(B$)}),F$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),args:D.array(D.string()).optional(),description:D.string().nullish(),env:D.record(D.string(),D.string()).optional(),id:D.string(),name:D.string()}),L$=D.union([N$.and(D.object({type:D.literal("env_var")})),F$.and(D.object({type:D.literal("terminal")})),O$]),n=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),methodId:D.string()}),x$=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),V$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),blob:D.string(),mimeType:D.string().nullish(),uri:D.string()}),H$=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),P$=D.object({amount:D.number(),currency:D.string()}),k$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),terminalId:D.string()}),T$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),newText:D.string(),oldText:D.string().nullish(),path:D.string()}),vD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),name:D.string(),value:D.string()}),U$=D.union([D.literal(-32700),D.literal(-32600),D.literal(-32601),D.literal(-32602),D.literal(-32603),D.literal(-32800),D.literal(-32000),D.literal(-32002),D.number().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),ID=D.object({code:U$,data:D.unknown().optional(),message:D.string()}),qD=D.unknown(),SD=D.unknown(),RD=D.unknown(),b$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),readTextFile:D.boolean().optional().default(!1),writeTextFile:D.boolean().optional().default(!1)}),h$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),auth:K$.optional().default({terminal:!1}),fs:b$.optional().default({readTextFile:!1,writeTextFile:!1}),terminal:D.boolean().optional().default(!1)}),cD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),name:D.string(),value:D.string()}),uD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),name:D.string(),title:D.string().nullish(),version:D.string()}),M$=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),t=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),cursor:D.string().nullish(),cwd:D.string().nullish()}),C$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),http:D.boolean().optional().default(!1),sse:D.boolean().optional().default(!1)}),E$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),headers:D.array(cD),name:D.string(),url:D.string()}),v$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),headers:D.array(cD),name:D.string(),url:D.string()}),I$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),args:D.array(D.string()),command:D.string(),env:D.array(vD),name:D.string()}),I=D.union([E$.and(D.object({type:D.literal("http")})),v$.and(D.object({type:D.literal("sse")})),I$]),o=D.string(),q$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),description:D.string().nullish(),modelId:o,name:D.string()}),r=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),cwd:D.string(),mcpServers:D.array(I)}),gD=D.string(),S$=D.union([D.literal("allow_once"),D.literal("allow_always"),D.literal("reject_once"),D.literal("reject_always")]),R$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),kind:S$,name:D.string(),optionId:gD}),c$=D.union([D.literal("high"),D.literal("medium"),D.literal("low")]),u$=D.union([D.literal("pending"),D.literal("in_progress"),D.literal("completed")]),g$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),content:D.string(),priority:c$,status:u$}),l$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),entries:D.array(g$)}),d$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),audio:D.boolean().optional().default(!1),embeddedContext:D.boolean().optional().default(!1),image:D.boolean().optional().default(!1)}),lD=D.number().int().gte(0).lte(65535),z=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),clientCapabilities:h$.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:uD.nullish(),protocolVersion:lD}),i$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),content:D.string()}),m$=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),T=D.union([D.number(),D.string()]).nullable(),sw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),requestId:T}),p$=D.enum(["assistant","user"]),E=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),audience:D.array(p$).nullish(),lastModified:D.string().nullish(),priority:D.number().nullish()}),n$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),annotations:E.nullish(),data:D.string(),mimeType:D.string()}),t$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),annotations:E.nullish(),data:D.string(),mimeType:D.string(),uri:D.string().nullish()}),o$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),annotations:E.nullish(),description:D.string().nullish(),mimeType:D.string().nullish(),name:D.string(),size:D.number().nullish(),title:D.string().nullish(),uri:D.string()}),r$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),optionId:gD}),z$=D.union([D.object({outcome:D.literal("cancelled")}),r$.and(D.object({outcome:D.literal("selected")}))]),a$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),outcome:z$}),s$=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),e$=D.object({currentValue:D.boolean()}),Dw=D.string(),dD=D.string(),$w=D.union([D.literal("mode"),D.literal("model"),D.literal("thought_level"),D.string()]),a=D.string(),iD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),description:D.string().nullish(),name:D.string(),value:a}),ww=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),group:Dw,name:D.string(),options:D.array(iD)}),Qw=D.union([D.array(iD),D.array(ww)]),fw=D.object({currentValue:a,options:Qw}),M=D.intersection(D.union([fw.and(D.object({type:D.literal("select")})),e$.and(D.object({type:D.literal("boolean")}))]),D.object({_meta:D.record(D.string(),D.unknown()).nullish(),category:$w.nullish(),description:D.string().nullish(),id:dD,name:D.string()})),_w=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),configOptions:D.array(M)}),Gw=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),N=D.string(),s=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),sessionId:N}),ew=D.object({method:D.string(),params:D.union([s,qD]).nullish()}),e=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),sessionId:N}),DD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),args:D.array(D.string()).optional(),command:D.string(),cwd:D.string().nullish(),env:D.array(vD).optional(),outputByteLimit:D.number().nullish(),sessionId:N}),$D=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),cwd:D.string(),mcpServers:D.array(I).optional(),sessionId:N}),wD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),sessionId:N,terminalId:D.string()}),QD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),cwd:D.string(),mcpServers:D.array(I),sessionId:N}),fD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),limit:D.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:D.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:D.string(),sessionId:N}),_D=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),sessionId:N,terminalId:D.string()}),GD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),cwd:D.string(),mcpServers:D.array(I).optional(),sessionId:N}),Jw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),cwd:D.string(),sessionId:N,title:D.string().nullish(),updatedAt:D.string().nullish()}),Xw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),nextCursor:D.string().nullish(),sessions:D.array(Jw)}),Yw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),title:D.string().nullish(),updatedAt:D.string().nullish()}),Zw=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),q=D.string(),jw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),currentModeId:q}),Aw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),description:D.string().nullish(),id:q,name:D.string()}),S=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),availableModes:D.array(Aw),currentModeId:q}),R=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),availableModels:D.array(q$),currentModelId:o}),Ww=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),configOptions:D.array(M).nullish(),models:R.nullish(),modes:S.nullish(),sessionId:N}),yw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),configOptions:D.array(M).nullish(),models:R.nullish(),modes:S.nullish()}),Kw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),configOptions:D.array(M).nullish(),models:R.nullish(),modes:S.nullish(),sessionId:N}),Bw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),configOptions:D.array(M).nullish(),models:R.nullish(),modes:S.nullish()}),Ow=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),Nw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),close:s$.nullish(),fork:Gw.nullish(),list:Zw.nullish(),resume:Ow.nullish()}),Fw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),loadSession:D.boolean().optional().default(!1),mcpCapabilities:C$.optional().default({http:!1,sse:!1}),promptCapabilities:d$.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:Nw.optional().default({})}),Lw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),agentCapabilities:Fw.optional().default({loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:uD.nullish(),authMethods:D.array(L$).optional().default([]),protocolVersion:lD}),JD=D.intersection(D.union([D.object({type:D.literal("boolean"),value:D.boolean()}),D.object({value:a})]),D.object({_meta:D.record(D.string(),D.unknown()).nullish(),configId:dD,sessionId:N})),xw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),configOptions:D.array(M)}),XD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),modeId:q,sessionId:N}),Vw=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),YD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),modelId:o,sessionId:N}),Hw=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),Pw=D.union([D.literal("end_turn"),D.literal("max_tokens"),D.literal("max_turn_requests"),D.literal("refusal"),D.literal("cancelled")]),kw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),terminalId:D.string()}),Tw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),exitCode:D.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:D.string().nullish()}),ZD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),sessionId:N,terminalId:D.string()}),Uw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),exitStatus:Tw.nullish(),output:D.string(),truncated:D.boolean()}),bw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),annotations:E.nullish(),text:D.string()}),hw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),mimeType:D.string().nullish(),text:D.string(),uri:D.string()}),Mw=D.union([hw,V$]),Cw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),annotations:E.nullish(),resource:Mw}),jD=D.union([bw.and(D.object({type:D.literal("text")})),t$.and(D.object({type:D.literal("image")})),n$.and(D.object({type:D.literal("audio")})),o$.and(D.object({type:D.literal("resource_link")})),Cw.and(D.object({type:D.literal("resource")}))]),Ew=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),content:jD}),p=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),content:jD,messageId:D.string().nullish()}),AD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),messageId:D.string().nullish(),prompt:D.array(jD),sessionId:N}),DQ=D.object({id:T,method:D.string(),params:D.union([z,n,r,QD,t,$D,GD,e,XD,JD,AD,YD,SD]).nullish()}),mD=D.union([Ew.and(D.object({type:D.literal("content")})),T$.and(D.object({type:D.literal("diff")})),kw.and(D.object({type:D.literal("terminal")}))]),pD=D.string(),nD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),line:D.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:D.string()}),tD=D.union([D.literal("pending"),D.literal("in_progress"),D.literal("completed"),D.literal("failed")]),oD=D.union([D.literal("read"),D.literal("edit"),D.literal("delete"),D.literal("move"),D.literal("search"),D.literal("execute"),D.literal("think"),D.literal("fetch"),D.literal("switch_mode"),D.literal("other")]),vw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),content:D.array(mD).optional(),kind:oD.optional(),locations:D.array(nD).optional(),rawInput:D.unknown().optional(),rawOutput:D.unknown().optional(),status:tD.optional(),title:D.string(),toolCallId:pD}),rD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),content:D.array(mD).nullish(),kind:oD.nullish(),locations:D.array(nD).nullish(),rawInput:D.unknown().optional(),rawOutput:D.unknown().optional(),status:tD.nullish(),title:D.string().nullish(),toolCallId:pD}),WD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),options:D.array(R$),sessionId:N,toolCall:rD}),Iw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),hint:D.string()}),qw=Iw,Sw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),description:D.string(),input:qw.nullish(),name:D.string()}),Rw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),availableCommands:D.array(Sw)}),cw=D.object({cachedReadTokens:D.number().nullish(),cachedWriteTokens:D.number().nullish(),inputTokens:D.number(),outputTokens:D.number(),thoughtTokens:D.number().nullish(),totalTokens:D.number()}),uw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),stopReason:Pw,usage:cw.nullish(),userMessageId:D.string().nullish()}),$Q=D.union([D.object({id:T,result:D.union([Lw,x$,Kw,yw,Xw,Ww,Bw,H$,Vw,xw,uw,Hw,RD])}),D.object({error:ID,id:T})]),gw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),cost:P$.nullish(),size:D.number(),used:D.number()}),lw=D.union([p.and(D.object({sessionUpdate:D.literal("user_message_chunk")})),p.and(D.object({sessionUpdate:D.literal("agent_message_chunk")})),p.and(D.object({sessionUpdate:D.literal("agent_thought_chunk")})),vw.and(D.object({sessionUpdate:D.literal("tool_call")})),rD.and(D.object({sessionUpdate:D.literal("tool_call_update")})),l$.and(D.object({sessionUpdate:D.literal("plan")})),Rw.and(D.object({sessionUpdate:D.literal("available_commands_update")})),jw.and(D.object({sessionUpdate:D.literal("current_mode_update")})),_w.and(D.object({sessionUpdate:D.literal("config_option_update")})),Yw.and(D.object({sessionUpdate:D.literal("session_info_update")})),gw.and(D.object({sessionUpdate:D.literal("usage_update")}))]),yD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),sessionId:N,update:lw}),wQ=D.object({method:D.string(),params:D.union([yD,qD]).nullish()}),KD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),sessionId:N,terminalId:D.string()}),dw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),exitCode:D.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:D.string().nullish()}),BD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),content:D.string(),path:D.string(),sessionId:N}),QQ=D.object({id:T,method:D.string(),params:D.union([BD,fD,WD,DD,ZD,_D,KD,wD,SD]).nullish()}),iw=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),fQ=D.union([D.object({id:T,result:D.union([iw,i$,a$,k$,Uw,m$,dw,M$,RD])}),D.object({error:ID,id:T})]);function zD($,Q){let w=new TextEncoder,f=new TextDecoder,X=new ReadableStream({async start(_){let J="",j=Q.getReader();try{while(!0){let{value:B,done:Y}=await j.read();if(Y)break;if(!B)continue;J+=f.decode(B,{stream:!0});let Z=J.split(`
2
+ import{Cd as W$}from"./chunk-s9ntkjz3.js";import{Ed as j$}from"./chunk-fyqjm5fv.js";import{Rd as A$}from"./chunk-yajd975f.js";import{Of as J$}from"./chunk-c1vnp55z.js";import{ag as Z$}from"./chunk-pctt1qv8.js";import"./chunk-11x3t2tt.js";import"./chunk-68yw2hk9.js";import"./chunk-takew94z.js";import"./chunk-cjww2jmv.js";import"./chunk-nfg7nt13.js";import"./chunk-xvwvd4kq.js";import"./chunk-qbc36nbb.js";import{gh as MD}from"./chunk-fq0x3esz.js";import{Uh as hD}from"./chunk-44a82dg0.js";import"./chunk-vxyy2dp3.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-5hw6xa49.js";import"./chunk-326p5b10.js";import{ql as _$,rl as U,sk as sD,tl as G$,yk as k,zk as P}from"./chunk-04n2ycg5.js";import"./chunk-8ymffyep.js";import"./chunk-mcg24gkb.js";import"./chunk-redjxn13.js";import"./chunk-bn0h9dny.js";import"./chunk-r4ndwym0.js";import"./chunk-3ytjm3az.js";import"./chunk-htz93dsd.js";import"./chunk-vcw00k0n.js";import{no as X$,qo as Y$}from"./chunk-r78czx4d.js";import"./chunk-2hc5z7b5.js";import"./chunk-d68fzyw7.js";import"./chunk-4jtxtkj7.js";import"./chunk-ay8emwym.js";import"./chunk-2maqde7w.js";import{_p as f$}from"./chunk-kj20f048.js";import"./chunk-cqtkxwd8.js";import"./chunk-x9rbv6p6.js";import"./chunk-g5rabwre.js";import"./chunk-jbx3s7nw.js";import"./chunk-15hw2z9t.js";import"./chunk-48ge2ryx.js";import"./chunk-n9xns8by.js";import"./chunk-y9q0hb7b.js";import"./chunk-c1bdzxbx.js";import"./chunk-ehhas0ew.js";import"./chunk-d6ry9418.js";import"./chunk-0dt0bxz6.js";import"./chunk-10bjs581.js";import"./chunk-4cnwn1rh.js";import"./chunk-gcw4rn10.js";import{Ms as w$,Vr as Q$,_s as H}from"./chunk-m5m448mg.js";import{st as kD}from"./chunk-tqj69nh6.js";import"./chunk-ag8kz1e7.js";import"./chunk-5tray1fw.js";import{St as D}from"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-gagtmjmp.js";import"./chunk-zs8kqdsf.js";import"./chunk-dxpj0cxh.js";import"./chunk-zw815d68.js";import{DO as ow}from"./chunk-7xm75w1e.js";var O={authenticate:"authenticate",initialize:"initialize",session_cancel:"session/cancel",session_close:"session/close",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_resume:"session/resume",session_set_config_option:"session/set_config_option",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},F={fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"};var K$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),terminal:D.boolean().optional().default(!1)}),B$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),label:D.string().nullish(),name:D.string(),optional:D.boolean().optional().default(!1),secret:D.boolean().optional().default(!0)}),O$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),description:D.string().nullish(),id:D.string(),name:D.string()}),N$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),description:D.string().nullish(),id:D.string(),link:D.string().nullish(),name:D.string(),vars:D.array(B$)}),F$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),args:D.array(D.string()).optional(),description:D.string().nullish(),env:D.record(D.string(),D.string()).optional(),id:D.string(),name:D.string()}),L$=D.union([N$.and(D.object({type:D.literal("env_var")})),F$.and(D.object({type:D.literal("terminal")})),O$]),n=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),methodId:D.string()}),x$=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),V$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),blob:D.string(),mimeType:D.string().nullish(),uri:D.string()}),H$=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),P$=D.object({amount:D.number(),currency:D.string()}),k$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),terminalId:D.string()}),T$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),newText:D.string(),oldText:D.string().nullish(),path:D.string()}),vD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),name:D.string(),value:D.string()}),U$=D.union([D.literal(-32700),D.literal(-32600),D.literal(-32601),D.literal(-32602),D.literal(-32603),D.literal(-32800),D.literal(-32000),D.literal(-32002),D.number().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),ID=D.object({code:U$,data:D.unknown().optional(),message:D.string()}),qD=D.unknown(),SD=D.unknown(),RD=D.unknown(),b$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),readTextFile:D.boolean().optional().default(!1),writeTextFile:D.boolean().optional().default(!1)}),h$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),auth:K$.optional().default({terminal:!1}),fs:b$.optional().default({readTextFile:!1,writeTextFile:!1}),terminal:D.boolean().optional().default(!1)}),cD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),name:D.string(),value:D.string()}),uD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),name:D.string(),title:D.string().nullish(),version:D.string()}),M$=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),t=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),cursor:D.string().nullish(),cwd:D.string().nullish()}),C$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),http:D.boolean().optional().default(!1),sse:D.boolean().optional().default(!1)}),E$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),headers:D.array(cD),name:D.string(),url:D.string()}),v$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),headers:D.array(cD),name:D.string(),url:D.string()}),I$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),args:D.array(D.string()),command:D.string(),env:D.array(vD),name:D.string()}),I=D.union([E$.and(D.object({type:D.literal("http")})),v$.and(D.object({type:D.literal("sse")})),I$]),o=D.string(),q$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),description:D.string().nullish(),modelId:o,name:D.string()}),r=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),cwd:D.string(),mcpServers:D.array(I)}),gD=D.string(),S$=D.union([D.literal("allow_once"),D.literal("allow_always"),D.literal("reject_once"),D.literal("reject_always")]),R$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),kind:S$,name:D.string(),optionId:gD}),c$=D.union([D.literal("high"),D.literal("medium"),D.literal("low")]),u$=D.union([D.literal("pending"),D.literal("in_progress"),D.literal("completed")]),g$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),content:D.string(),priority:c$,status:u$}),l$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),entries:D.array(g$)}),d$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),audio:D.boolean().optional().default(!1),embeddedContext:D.boolean().optional().default(!1),image:D.boolean().optional().default(!1)}),lD=D.number().int().gte(0).lte(65535),z=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),clientCapabilities:h$.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:uD.nullish(),protocolVersion:lD}),i$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),content:D.string()}),m$=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),T=D.union([D.number(),D.string()]).nullable(),sw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),requestId:T}),p$=D.enum(["assistant","user"]),E=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),audience:D.array(p$).nullish(),lastModified:D.string().nullish(),priority:D.number().nullish()}),n$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),annotations:E.nullish(),data:D.string(),mimeType:D.string()}),t$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),annotations:E.nullish(),data:D.string(),mimeType:D.string(),uri:D.string().nullish()}),o$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),annotations:E.nullish(),description:D.string().nullish(),mimeType:D.string().nullish(),name:D.string(),size:D.number().nullish(),title:D.string().nullish(),uri:D.string()}),r$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),optionId:gD}),z$=D.union([D.object({outcome:D.literal("cancelled")}),r$.and(D.object({outcome:D.literal("selected")}))]),a$=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),outcome:z$}),s$=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),e$=D.object({currentValue:D.boolean()}),Dw=D.string(),dD=D.string(),$w=D.union([D.literal("mode"),D.literal("model"),D.literal("thought_level"),D.string()]),a=D.string(),iD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),description:D.string().nullish(),name:D.string(),value:a}),ww=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),group:Dw,name:D.string(),options:D.array(iD)}),Qw=D.union([D.array(iD),D.array(ww)]),fw=D.object({currentValue:a,options:Qw}),M=D.intersection(D.union([fw.and(D.object({type:D.literal("select")})),e$.and(D.object({type:D.literal("boolean")}))]),D.object({_meta:D.record(D.string(),D.unknown()).nullish(),category:$w.nullish(),description:D.string().nullish(),id:dD,name:D.string()})),_w=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),configOptions:D.array(M)}),Gw=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),N=D.string(),s=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),sessionId:N}),ew=D.object({method:D.string(),params:D.union([s,qD]).nullish()}),e=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),sessionId:N}),DD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),args:D.array(D.string()).optional(),command:D.string(),cwd:D.string().nullish(),env:D.array(vD).optional(),outputByteLimit:D.number().nullish(),sessionId:N}),$D=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),cwd:D.string(),mcpServers:D.array(I).optional(),sessionId:N}),wD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),sessionId:N,terminalId:D.string()}),QD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),cwd:D.string(),mcpServers:D.array(I),sessionId:N}),fD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),limit:D.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:D.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:D.string(),sessionId:N}),_D=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),sessionId:N,terminalId:D.string()}),GD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),cwd:D.string(),mcpServers:D.array(I).optional(),sessionId:N}),Jw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),cwd:D.string(),sessionId:N,title:D.string().nullish(),updatedAt:D.string().nullish()}),Xw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),nextCursor:D.string().nullish(),sessions:D.array(Jw)}),Yw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),title:D.string().nullish(),updatedAt:D.string().nullish()}),Zw=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),q=D.string(),jw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),currentModeId:q}),Aw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),description:D.string().nullish(),id:q,name:D.string()}),S=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),availableModes:D.array(Aw),currentModeId:q}),R=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),availableModels:D.array(q$),currentModelId:o}),Ww=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),configOptions:D.array(M).nullish(),models:R.nullish(),modes:S.nullish(),sessionId:N}),yw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),configOptions:D.array(M).nullish(),models:R.nullish(),modes:S.nullish()}),Kw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),configOptions:D.array(M).nullish(),models:R.nullish(),modes:S.nullish(),sessionId:N}),Bw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),configOptions:D.array(M).nullish(),models:R.nullish(),modes:S.nullish()}),Ow=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),Nw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),close:s$.nullish(),fork:Gw.nullish(),list:Zw.nullish(),resume:Ow.nullish()}),Fw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),loadSession:D.boolean().optional().default(!1),mcpCapabilities:C$.optional().default({http:!1,sse:!1}),promptCapabilities:d$.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:Nw.optional().default({})}),Lw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),agentCapabilities:Fw.optional().default({loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:uD.nullish(),authMethods:D.array(L$).optional().default([]),protocolVersion:lD}),JD=D.intersection(D.union([D.object({type:D.literal("boolean"),value:D.boolean()}),D.object({value:a})]),D.object({_meta:D.record(D.string(),D.unknown()).nullish(),configId:dD,sessionId:N})),xw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),configOptions:D.array(M)}),XD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),modeId:q,sessionId:N}),Vw=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),YD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),modelId:o,sessionId:N}),Hw=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),Pw=D.union([D.literal("end_turn"),D.literal("max_tokens"),D.literal("max_turn_requests"),D.literal("refusal"),D.literal("cancelled")]),kw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),terminalId:D.string()}),Tw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),exitCode:D.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:D.string().nullish()}),ZD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),sessionId:N,terminalId:D.string()}),Uw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),exitStatus:Tw.nullish(),output:D.string(),truncated:D.boolean()}),bw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),annotations:E.nullish(),text:D.string()}),hw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),mimeType:D.string().nullish(),text:D.string(),uri:D.string()}),Mw=D.union([hw,V$]),Cw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),annotations:E.nullish(),resource:Mw}),jD=D.union([bw.and(D.object({type:D.literal("text")})),t$.and(D.object({type:D.literal("image")})),n$.and(D.object({type:D.literal("audio")})),o$.and(D.object({type:D.literal("resource_link")})),Cw.and(D.object({type:D.literal("resource")}))]),Ew=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),content:jD}),p=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),content:jD,messageId:D.string().nullish()}),AD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),messageId:D.string().nullish(),prompt:D.array(jD),sessionId:N}),DQ=D.object({id:T,method:D.string(),params:D.union([z,n,r,QD,t,$D,GD,e,XD,JD,AD,YD,SD]).nullish()}),mD=D.union([Ew.and(D.object({type:D.literal("content")})),T$.and(D.object({type:D.literal("diff")})),kw.and(D.object({type:D.literal("terminal")}))]),pD=D.string(),nD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),line:D.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:D.string()}),tD=D.union([D.literal("pending"),D.literal("in_progress"),D.literal("completed"),D.literal("failed")]),oD=D.union([D.literal("read"),D.literal("edit"),D.literal("delete"),D.literal("move"),D.literal("search"),D.literal("execute"),D.literal("think"),D.literal("fetch"),D.literal("switch_mode"),D.literal("other")]),vw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),content:D.array(mD).optional(),kind:oD.optional(),locations:D.array(nD).optional(),rawInput:D.unknown().optional(),rawOutput:D.unknown().optional(),status:tD.optional(),title:D.string(),toolCallId:pD}),rD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),content:D.array(mD).nullish(),kind:oD.nullish(),locations:D.array(nD).nullish(),rawInput:D.unknown().optional(),rawOutput:D.unknown().optional(),status:tD.nullish(),title:D.string().nullish(),toolCallId:pD}),WD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),options:D.array(R$),sessionId:N,toolCall:rD}),Iw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),hint:D.string()}),qw=Iw,Sw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),description:D.string(),input:qw.nullish(),name:D.string()}),Rw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),availableCommands:D.array(Sw)}),cw=D.object({cachedReadTokens:D.number().nullish(),cachedWriteTokens:D.number().nullish(),inputTokens:D.number(),outputTokens:D.number(),thoughtTokens:D.number().nullish(),totalTokens:D.number()}),uw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),stopReason:Pw,usage:cw.nullish(),userMessageId:D.string().nullish()}),$Q=D.union([D.object({id:T,result:D.union([Lw,x$,Kw,yw,Xw,Ww,Bw,H$,Vw,xw,uw,Hw,RD])}),D.object({error:ID,id:T})]),gw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),cost:P$.nullish(),size:D.number(),used:D.number()}),lw=D.union([p.and(D.object({sessionUpdate:D.literal("user_message_chunk")})),p.and(D.object({sessionUpdate:D.literal("agent_message_chunk")})),p.and(D.object({sessionUpdate:D.literal("agent_thought_chunk")})),vw.and(D.object({sessionUpdate:D.literal("tool_call")})),rD.and(D.object({sessionUpdate:D.literal("tool_call_update")})),l$.and(D.object({sessionUpdate:D.literal("plan")})),Rw.and(D.object({sessionUpdate:D.literal("available_commands_update")})),jw.and(D.object({sessionUpdate:D.literal("current_mode_update")})),_w.and(D.object({sessionUpdate:D.literal("config_option_update")})),Yw.and(D.object({sessionUpdate:D.literal("session_info_update")})),gw.and(D.object({sessionUpdate:D.literal("usage_update")}))]),yD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),sessionId:N,update:lw}),wQ=D.object({method:D.string(),params:D.union([yD,qD]).nullish()}),KD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),sessionId:N,terminalId:D.string()}),dw=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),exitCode:D.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:D.string().nullish()}),BD=D.object({_meta:D.record(D.string(),D.unknown()).nullish(),content:D.string(),path:D.string(),sessionId:N}),QQ=D.object({id:T,method:D.string(),params:D.union([BD,fD,WD,DD,ZD,_D,KD,wD,SD]).nullish()}),iw=D.object({_meta:D.record(D.string(),D.unknown()).nullish()}),fQ=D.union([D.object({id:T,result:D.union([iw,i$,a$,k$,Uw,m$,dw,M$,RD])}),D.object({error:ID,id:T})]);function zD($,Q){let w=new TextEncoder,f=new TextDecoder,X=new ReadableStream({async start(_){let J="",j=Q.getReader();try{while(!0){let{value:B,done:Y}=await j.read();if(Y)break;if(!B)continue;J+=f.decode(B,{stream:!0});let Z=J.split(`
3
3
  `);J=Z.pop()||"";for(let A of Z){let y=A.trim();if(y)try{let W=JSON.parse(y);_.enqueue(W)}catch(W){console.error("Failed to parse JSON message:",y,W)}}}}finally{j.releaseLock(),_.close()}}}),G=new WritableStream({async write(_){let J=JSON.stringify(_)+`
4
4
  `,j=$.getWriter();try{await j.write(w.encode(J))}finally{j.releaseLock()}}});return{readable:X,writable:G}}class OD{#D;constructor($,Q){let w=$(this),f=async(G,_)=>{switch(G){case O.initialize:{let J=z.parse(_);return w.initialize(J)}case O.session_new:{let J=r.parse(_);return w.newSession(J)}case O.session_load:{if(!w.loadSession)throw K.methodNotFound(G);let J=QD.parse(_);return w.loadSession(J)}case O.session_list:{if(!w.listSessions)throw K.methodNotFound(G);let J=t.parse(_);return w.listSessions(J)}case O.session_fork:{if(!w.unstable_forkSession)throw K.methodNotFound(G);let J=$D.parse(_);return w.unstable_forkSession(J)}case O.session_resume:{if(!w.unstable_resumeSession)throw K.methodNotFound(G);let J=GD.parse(_);return w.unstable_resumeSession(J)}case O.session_close:{if(!w.unstable_closeSession)throw K.methodNotFound(G);let J=e.parse(_);return w.unstable_closeSession(J)}case O.session_set_mode:{if(!w.setSessionMode)throw K.methodNotFound(G);let J=XD.parse(_);return await w.setSessionMode(J)??{}}case O.authenticate:{let J=n.parse(_);return await w.authenticate(J)??{}}case O.session_prompt:{let J=AD.parse(_);return w.prompt(J)}case O.session_set_model:{if(!w.unstable_setSessionModel)throw K.methodNotFound(G);let J=YD.parse(_);return await w.unstable_setSessionModel(J)??{}}case O.session_set_config_option:{if(!w.setSessionConfigOption)throw K.methodNotFound(G);let J=JD.parse(_);return w.setSessionConfigOption(J)}default:if(w.extMethod)return w.extMethod(G,_);throw K.methodNotFound(G)}},X=async(G,_)=>{switch(G){case O.session_cancel:{let J=s.parse(_);return w.cancel(J)}default:if(w.extNotification)return w.extNotification(G,_);throw K.methodNotFound(G)}};this.#D=new ND(f,X,Q)}async sessionUpdate($){return await this.#D.sendNotification(F.session_update,$)}async requestPermission($){return await this.#D.sendRequest(F.session_request_permission,$)}async readTextFile($){return await this.#D.sendRequest(F.fs_read_text_file,$)}async writeTextFile($){return await this.#D.sendRequest(F.fs_write_text_file,$)??{}}async createTerminal($){let Q=await this.#D.sendRequest(F.terminal_create,$);return new aD(Q.terminalId,$.sessionId,this.#D)}async extMethod($,Q){return await this.#D.sendRequest($,Q)}async extNotification($,Q){return await this.#D.sendNotification($,Q)}get signal(){return this.#D.signal}get closed(){return this.#D.closed}}class aD{id;#D;#$;constructor($,Q,w){this.id=$,this.#D=Q,this.#$=w}async currentOutput(){return await this.#$.sendRequest(F.terminal_output,{sessionId:this.#D,terminalId:this.id})}async waitForExit(){return await this.#$.sendRequest(F.terminal_wait_for_exit,{sessionId:this.#D,terminalId:this.id})}async kill(){return await this.#$.sendRequest(F.terminal_kill,{sessionId:this.#D,terminalId:this.id})??{}}async release(){return await this.#$.sendRequest(F.terminal_release,{sessionId:this.#D,terminalId:this.id})??{}}async[Symbol.asyncDispose](){await this.release()}}class pw{#D;constructor($,Q){let w=$(this),f=async(G,_)=>{switch(G){case F.fs_write_text_file:{let J=BD.parse(_);return w.writeTextFile?.(J)}case F.fs_read_text_file:{let J=fD.parse(_);return w.readTextFile?.(J)}case F.session_request_permission:{let J=WD.parse(_);return w.requestPermission(J)}case F.terminal_create:{let J=DD.parse(_);return w.createTerminal?.(J)}case F.terminal_output:{let J=ZD.parse(_);return w.terminalOutput?.(J)}case F.terminal_release:{let J=_D.parse(_);return await w.releaseTerminal?.(J)??{}}case F.terminal_wait_for_exit:{let J=KD.parse(_);return w.waitForTerminalExit?.(J)}case F.terminal_kill:{let J=wD.parse(_);return await w.killTerminal?.(J)??{}}default:if(w.extMethod)return w.extMethod(G,_);throw K.methodNotFound(G)}},X=async(G,_)=>{switch(G){case F.session_update:{let J=yD.parse(_);return w.sessionUpdate(J)}default:if(w.extNotification)return w.extNotification(G,_);throw K.methodNotFound(G)}};this.#D=new ND(f,X,Q)}async initialize($){return await this.#D.sendRequest(O.initialize,$)}async newSession($){return await this.#D.sendRequest(O.session_new,$)}async loadSession($){return await this.#D.sendRequest(O.session_load,$)??{}}async unstable_forkSession($){return await this.#D.sendRequest(O.session_fork,$)}async listSessions($){return await this.#D.sendRequest(O.session_list,$)}async unstable_resumeSession($){return await this.#D.sendRequest(O.session_resume,$)}async unstable_closeSession($){return await this.#D.sendRequest(O.session_close,$)}async setSessionMode($){return await this.#D.sendRequest(O.session_set_mode,$)??{}}async unstable_setSessionModel($){return await this.#D.sendRequest(O.session_set_model,$)??{}}async setSessionConfigOption($){return await this.#D.sendRequest(O.session_set_config_option,$)}async authenticate($){return await this.#D.sendRequest(O.authenticate,$)??{}}async prompt($){return await this.#D.sendRequest(O.session_prompt,$)}async cancel($){return await this.#D.sendNotification(O.session_cancel,$)}async extMethod($,Q){return await this.#D.sendRequest($,Q)}async extNotification($,Q){return await this.#D.sendNotification($,Q)}get signal(){return this.#D.signal}get closed(){return this.#D.closed}}class ND{#D=new Map;#$=0;#G;#J;#Q;#f=Promise.resolve();#_=new AbortController;#X;constructor($,Q,w){this.#G=$,this.#J=Q,this.#Q=w,this.#X=new Promise((f)=>{this.#_.signal.addEventListener("abort",()=>f())}),this.#Y()}get signal(){return this.#_.signal}get closed(){return this.#X}async#Y(){let $=this.#Q.readable.getReader();try{while(!0){let{value:Q,done:w}=await $.read();if(w)break;if(!Q)continue;try{this.#Z(Q)}catch(f){if(console.error("Unexpected error during message processing:",Q,f),"id"in Q&&Q.id!==void 0)this.#w({jsonrpc:"2.0",id:Q.id,error:{code:-32700,message:"Parse error"}})}}}finally{$.releaseLock(),this.#_.abort()}}async#Z($){if("method"in $&&"id"in $){let Q=await this.#j($.method,$.params);if("error"in Q)console.error("Error handling request",$,Q.error);await this.#w({jsonrpc:"2.0",id:$.id,...Q})}else if("method"in $){let Q=await this.#A($.method,$.params);if("error"in Q)console.error("Error handling notification",$,Q.error)}else if("id"in $)this.#W($);else console.error("Invalid message",{message:$})}async#j($,Q){try{return{result:await this.#G($,Q)??null}}catch(w){if(w instanceof K)return w.toResult();if(w instanceof D.ZodError)return K.invalidParams(w.format()).toResult();let f;if(w instanceof Error)f=w.message;else if(typeof w==="object"&&w!=null&&"message"in w&&typeof w.message==="string")f=w.message;try{return K.internalError(f?JSON.parse(f):{}).toResult()}catch{return K.internalError({details:f}).toResult()}}}async#A($,Q){try{return await this.#J($,Q),{result:null}}catch(w){if(w instanceof K)return w.toResult();if(w instanceof D.ZodError)return K.invalidParams(w.format()).toResult();let f;if(w instanceof Error)f=w.message;else if(typeof w==="object"&&w!=null&&"message"in w&&typeof w.message==="string")f=w.message;try{return K.internalError(f?JSON.parse(f):{}).toResult()}catch{return K.internalError({details:f}).toResult()}}}#W($){let Q=this.#D.get($.id);if(Q){if("result"in $)Q.resolve($.result);else if("error"in $)Q.reject($.error);this.#D.delete($.id)}else console.error("Got response to unknown request",$.id)}async sendRequest($,Q){let w=this.#$++,f=new Promise((X,G)=>{this.#D.set(w,{resolve:X,reject:G})});return await this.#w({jsonrpc:"2.0",id:w,method:$,params:Q}),f}async sendNotification($,Q){await this.#w({jsonrpc:"2.0",method:$,params:Q})}async#w($){return this.#f=this.#f.then(async()=>{let Q=this.#Q.writable.getWriter();try{await Q.write($)}finally{Q.releaseLock()}}).catch((Q)=>{console.error("ACP write error:",Q)}),this.#f}}class K extends Error{code;data;constructor($,Q,w){super(Q);this.code=$,this.name="RequestError",this.data=w}static parseError($,Q){return new K(-32700,`Parse error${Q?`: ${Q}`:""}`,$)}static invalidRequest($,Q){return new K(-32600,`Invalid request${Q?`: ${Q}`:""}`,$)}static methodNotFound($){return new K(-32601,`"Method not found": ${$}`,{method:$})}static invalidParams($,Q){return new K(-32602,`Invalid params${Q?`: ${Q}`:""}`,$)}static internalError($,Q){return new K(-32603,`Internal error${Q?`: ${Q}`:""}`,$)}static authRequired($,Q){return new K(-32000,`Authentication required${Q?`: ${Q}`:""}`,$)}static resourceNotFound($){return new K(-32002,`Resource not found${$?`: ${$}`:""}`,$&&{uri:$})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}}var v={};ow(v,{init:()=>zw,Agent:()=>CD,ACP:()=>v});var FD=H.create({service:"acp-session-manager"});class LD{sessions=new Map;sdk;constructor($){this.sdk=$}tryGet($){return this.sessions.get($)}async create($,Q,w){let X=(await this.sdk.session.create({directory:$},{throwOnError:!0}).then((J)=>J.data)).id,_={id:X,cwd:$,mcpServers:Q,createdAt:new Date,model:w};return FD.info("creating_session",{state:_}),this.sessions.set(X,_),_}async load($,Q,w,f){let X=await this.sdk.session.get({sessionID:$,directory:Q},{throwOnError:!0}).then((J)=>J.data),G=f,_={id:$,cwd:Q,mcpServers:w,createdAt:new Date(X.time.created),model:G};return FD.info("loading_session",{state:_}),this.sessions.set($,_),_}get($){let Q=this.sessions.get($);if(!Q)throw FD.error("session not found",{sessionId:$}),K.invalidParams(JSON.stringify({error:`Session not found: ${$}`}));return Q}getModel($){return this.get($).model}setModel($,Q){let w=this.get($);return w.model=Q,this.sessions.set($,w),w}getVariant($){return this.get($).variant}setVariant($,Q){let w=this.get($);return w.variant=Q,this.sessions.set($,w),w}setMode($,Q){let w=this.get($);return w.modeId=Q,this.sessions.set($,w),w}}import{pathToFileURL as c}from"url";var nw=H.create({service:"acp-message-translator"}),tw="default";function b($){switch($.toLocaleLowerCase()){case"bash":return"execute";case"webfetch":return"fetch";case"edit":case"patch":case"write":return"edit";case"grep":case"glob":case"context7_resolve_library_id":case"context7_get_library_docs":return"search";case"read":return"read";default:return"other"}}function u($,Q){switch($.toLocaleLowerCase()){case"read":case"edit":case"write":return Q.filePath?[{path:Q.filePath}]:[];case"glob":case"grep":return Q.path?[{path:Q.path}]:[];case"bash":return[];default:return[]}}function g($){try{if($.startsWith("file://")){let Q=$.slice(7),w=Q.split("/").pop()||Q;return{type:"file",url:$,filename:w,mime:"text/plain"}}if($.startsWith("zed://")){let w=new URL($).searchParams.get("path");if(w){let f=w.split("/").pop()||w;return{type:"file",url:c(w).href,filename:f,mime:"text/plain"}}}return{type:"text",text:$}}catch{return{type:"text",text:$}}}function eD($,Q){let w=sD($,Q);if(w===!1){nw.error("Failed to apply unified diff (context mismatch)");return}return w}function xD($){if($.tool!=="bash")return;if(!("metadata"in $.state)||!$.state.metadata||typeof $.state.metadata!=="object")return;let Q=$.state.metadata.output;if(typeof Q!=="string")return;return Q}function l($){return[...$].sort((Q,w)=>{let f=Q.name.toLowerCase(),X=w.name.toLowerCase();if(f<X)return-1;if(f>X)return 1;return 0})}function VD($,Q){let w=$.find((X)=>X.id===Q.providerID);if(!w)return[];let f=w.models[Q.modelID];if(!f?.variants)return[];return Object.keys(f.variants)}function D$($,Q={}){let w=Q.includeVariants??!1;return $.flatMap((f)=>{let X=Object.values(f.models);return U.sort(X).flatMap((_)=>{let J={modelId:`${f.id}/${_.id}`,name:`${f.name}/${_.name}`};if(!w||!_.variants)return[J];let B=Object.keys(_.variants).filter((Y)=>Y!==tw).map((Y)=>({modelId:`${f.id}/${_.id}/${Y}`,name:`${f.name}/${_.name} (${Y})`}));return[J,...B]})})}function d($,Q,w,f){let X=`${$.providerID}/${$.modelID}`;if(!f||!Q||!w.includes(Q))return X;return`${X}/${Q}`}function HD($){return{opencode:{modelId:`${$.model.providerID}/${$.model.modelID}`,variant:$.variant??null,availableVariants:$.availableVariants}}}function PD($,Q){let w=U.parseModel($),f=Q.find((G)=>G.id===w.providerID);if(!f)return{model:w,variant:void 0};if(f.models[w.modelID])return{model:w,variant:void 0};let X=w.modelID.split("/");if(X.length>1){let G=X[X.length-1],_=X.slice(0,-1).join("/"),J=f.models[_];if(J?.variants&&G in J.variants)return{model:{providerID:w.providerID,modelID:P.make(_)},variant:G}}return{model:w,variant:void 0}}function i($){let Q=[{id:"model",name:"Model",category:"model",type:"select",currentValue:$.currentModelId,options:$.availableModels.map((w)=>({value:w.modelId,name:w.name}))}];if($.modes)Q.push({id:"mode",name:"Session Mode",category:"mode",type:"select",currentValue:$.modes.currentModeId,options:$.modes.availableModes.map((w)=>({value:w.id,name:w.name,...w.description?{description:w.description}:{}}))});return Q}var $$=H.create({service:"acp-permissions"});class TD{connection;sdk;sessionManager;permissionQueues=new Map;permissionOptions=[{optionId:"once",kind:"allow_once",name:"Allow once"},{optionId:"always",kind:"allow_always",name:"Always allow"},{optionId:"reject",kind:"reject_once",name:"Reject"}];constructor($,Q,w){this.connection=$;this.sdk=Q;this.sessionManager=w}handle($){let Q=this.sessionManager.tryGet($.sessionID);if(!Q)return;let f=(this.permissionQueues.get($.sessionID)??Promise.resolve()).then(async()=>{let X=Q.cwd,G=await this.connection.requestPermission({sessionId:$.sessionID,toolCall:{toolCallId:$.tool?.callID??$.id,status:"pending",title:$.permission,rawInput:$.metadata,kind:b($.permission),locations:u($.permission,$.metadata??{})},options:this.permissionOptions}).catch(async(_)=>{$$.error("failed to request permission from ACP",{error:_,permissionID:$.id,sessionID:$.sessionID}),await this.sdk.permission.reply({requestID:$.id,reply:"reject",directory:X});return});if(!G)return;if(G.outcome.outcome!=="selected"){await this.sdk.permission.reply({requestID:$.id,reply:"reject",directory:X});return}if(G.outcome.optionId!=="reject"&&$.permission=="edit"){let _=$.metadata||{},J=typeof _.filepath==="string"?_.filepath:"",j=typeof _.diff==="string"?_.diff:"",B=await kD.exists(J)?await kD.readText(J):"",Y=eD(B,j);if(Y)this.connection.writeTextFile({sessionId:Q.id,path:J,content:Y})}await this.sdk.permission.reply({requestID:$.id,reply:G.outcome.optionId,directory:X})}).catch((X)=>{$$.error("failed to handle permission",{error:X,permissionID:$.id})}).finally(()=>{if(this.permissionQueues.get($.sessionID)===f)this.permissionQueues.delete($.sessionID)});this.permissionQueues.set($.sessionID,f)}}var L=H.create({service:"acp-event-bridge"});class UD{connection;sdk;sessionManager;eventAbort=new AbortController;eventStarted=!1;bashSnapshots=new Map;toolStarts=new Set;permissionHandler;constructor($,Q,w){this.connection=$;this.sdk=Q;this.sessionManager=w;this.permissionHandler=new TD($,Q,w)}start(){if(this.eventStarted)return;this.eventStarted=!0,this.runEventSubscription().catch(($)=>{if(this.eventAbort.signal.aborted)return;L.error("event subscription failed",{error:$})})}stop(){this.eventAbort.abort()}async runEventSubscription(){while(!0){if(this.eventAbort.signal.aborted)return;let $=await this.sdk.global.event({signal:this.eventAbort.signal,sseMaxRetryAttempts:0});for await(let Q of $.stream){if(this.eventAbort.signal.aborted)return;let w=Q?.payload;if(!w)continue;await this.handleEvent(w).catch((f)=>{L.error("failed to handle event",{error:f,type:w.type})})}if(this.eventAbort.signal.aborted)return;await new Promise((Q)=>{let w=()=>{clearTimeout(f),this.eventAbort.signal.removeEventListener("abort",w),Q()},f=setTimeout(w,1000);if(this.eventAbort.signal.addEventListener("abort",w,{once:!0}),this.eventAbort.signal.aborted)w()})}}async handleEvent($){switch($.type){case"permission.asked":{this.permissionHandler.handle($.properties);return}case"message.part.updated":{L.info("message part updated",{event:$.properties});let w=$.properties.part,f=this.sessionManager.tryGet(w.sessionID);if(!f)return;let X=f.id;if(w.type==="tool")switch(await this.toolStart(X,w),w.state.status){case"pending":this.bashSnapshots.delete(w.callID);return;case"running":{let G=xD(w),_=[];if(G){let J=w$.fast(G);if(w.tool==="bash"){if(this.bashSnapshots.get(w.callID)===J){await this.sendToolInProgress(X,w,w.state,[]);return}this.bashSnapshots.set(w.callID,J)}_.push({type:"content",content:{type:"text",text:G}})}await this.sendToolInProgress(X,w,w.state,_);return}case"completed":await this.sendToolCompleted(X,w,w.state);return;case"error":await this.sendToolError(X,w,w.state);return}if(w.type!=="text"&&w.type!=="file")return;return}case"message.part.delta":{let Q=$.properties,w=this.sessionManager.tryGet(Q.sessionID);if(!w)return;let f=w.id,X=await this.sdk.session.message({sessionID:Q.sessionID,messageID:Q.messageID,directory:w.cwd},{throwOnError:!0}).then((_)=>_.data).catch((_)=>{L.error("unexpected error when fetching message",{error:_});return});if(!X||X.info.role!=="assistant")return;let G=X.parts.find((_)=>_.id===Q.partID);if(!G)return;if(G.type==="text"&&Q.field==="text"&&G.ignored!==!0){await this.connection.sessionUpdate({sessionId:f,update:{sessionUpdate:"agent_message_chunk",messageId:Q.messageID,content:{type:"text",text:Q.delta}}}).catch((_)=>{L.error("failed to send text delta to ACP",{error:_})});return}if(G.type==="reasoning"&&Q.field==="text")await this.connection.sessionUpdate({sessionId:f,update:{sessionUpdate:"agent_thought_chunk",messageId:Q.messageID,content:{type:"text",text:Q.delta}}}).catch((_)=>{L.error("failed to send reasoning delta to ACP",{error:_})});return}}}async sendToolInProgress($,Q,w,f){await this.connection.sessionUpdate({sessionId:$,update:{sessionUpdate:"tool_call_update",toolCallId:Q.callID,status:"in_progress",kind:b(Q.tool),title:Q.tool,locations:u(Q.tool,w.input),rawInput:w.input,...f.length>0&&{content:f}}}).catch((X)=>{L.error("failed to send tool in_progress to ACP",{error:X})})}async sendToolCompleted($,Q,w){this.toolStarts.delete(Q.callID),this.bashSnapshots.delete(Q.callID);let f=b(Q.tool),X=[{type:"content",content:{type:"text",text:w.output}}];if(f==="edit"){let G=w.input,_=typeof G.filePath==="string"?G.filePath:"",J=typeof G.oldString==="string"?G.oldString:"",j=typeof G.newString==="string"?G.newString:typeof G.content==="string"?G.content:"";X.push({type:"diff",path:_,oldText:J,newText:j})}await this.connection.sessionUpdate({sessionId:$,update:{sessionUpdate:"tool_call_update",toolCallId:Q.callID,status:"completed",kind:f,content:X,title:w.title,rawInput:w.input,rawOutput:{output:w.output,metadata:w.metadata}}}).catch((G)=>{L.error("failed to send tool completed to ACP",{error:G})})}async sendToolError($,Q,w){this.toolStarts.delete(Q.callID),this.bashSnapshots.delete(Q.callID),await this.connection.sessionUpdate({sessionId:$,update:{sessionUpdate:"tool_call_update",toolCallId:Q.callID,status:"failed",kind:b(Q.tool),title:Q.tool,rawInput:w.input,content:[{type:"content",content:{type:"text",text:w.error}}],rawOutput:{error:w.error,metadata:w.metadata}}}).catch((f)=>{L.error("failed to send tool error to ACP",{error:f})})}async toolStart($,Q){if(this.toolStarts.has(Q.callID))return;this.toolStarts.add(Q.callID),await this.connection.sessionUpdate({sessionId:$,update:{sessionUpdate:"tool_call",toolCallId:Q.callID,title:Q.tool,kind:b(Q.tool),status:"pending",locations:[],rawInput:{}}}).catch((w)=>{L.error("failed to send tool pending to ACP",{error:w})})}async processMessage($){if(L.debug("process message",$),$.info.role!=="assistant"&&$.info.role!=="user")return;let Q=$.info.sessionID;for(let w of $.parts)if(w.type==="tool")switch(await this.toolStart(Q,w),w.state.status){case"pending":this.bashSnapshots.delete(w.callID);break;case"running":{let f=xD(w),X=[];if(f)X.push({type:"content",content:{type:"text",text:f}});await this.sendToolInProgress(Q,w,w.state,X);break}case"completed":await this.sendToolCompleted(Q,w,w.state);break;case"error":await this.sendToolError(Q,w,w.state);break}else if(w.type==="text"){if(w.text){let f=w.synthetic?["assistant"]:w.ignored?["user"]:void 0;await this.connection.sessionUpdate({sessionId:Q,update:{sessionUpdate:$.info.role==="user"?"user_message_chunk":"agent_message_chunk",messageId:$.info.id,content:{type:"text",text:w.text,...f&&{annotations:{audience:f}}}}}).catch((X)=>{L.error("failed to send text to ACP",{error:X})})}}else if(w.type==="file"){let f=w.url,X=w.filename??"file",G=w.mime||"application/octet-stream",_=$.info.role==="user"?"user_message_chunk":"agent_message_chunk";if(f.startsWith("file://"))await this.connection.sessionUpdate({sessionId:Q,update:{sessionUpdate:_,messageId:$.info.id,content:{type:"resource_link",uri:f,name:X,mimeType:G}}}).catch((J)=>{L.error("failed to send resource_link to ACP",{error:J})});else if(f.startsWith("data:")){let J=f.match(/^data:([^;]+);base64,(.*)$/),j=J?.[1],B=J?.[2]??"",Y=j||G;if(Y.startsWith("image/"))await this.connection.sessionUpdate({sessionId:Q,update:{sessionUpdate:_,messageId:$.info.id,content:{type:"image",mimeType:Y,data:B,uri:c(X).href}}}).catch((Z)=>{L.error("failed to send image to ACP",{error:Z})});else{let Z=Y.startsWith("text/")||Y==="application/json",A=c(X).href,y=Z?{uri:A,mimeType:Y,text:Buffer.from(B,"base64").toString("utf-8")}:{uri:A,mimeType:Y,blob:B};await this.connection.sessionUpdate({sessionId:Q,update:{sessionUpdate:_,messageId:$.info.id,content:{type:"resource",resource:y}}}).catch((W)=>{L.error("failed to send resource to ACP",{error:W})})}}}else if(w.type==="reasoning"){if(w.text)await this.connection.sessionUpdate({sessionId:Q,update:{sessionUpdate:"agent_thought_chunk",messageId:$.info.id,content:{type:"text",text:w.text}}}).catch((f)=>{L.error("failed to send reasoning to ACP",{error:f})})}}}var V=H.create({service:"acp-agent"});async function rw($,Q,w,f){return(await $.config.providers({directory:f}).then((J)=>J.data?.providers??[]).catch((J)=>{return V.error("failed to get providers for context limit",{error:J}),[]})).find((J)=>J.id===Q)?.models[w]?.limit.context??null}async function bD($,Q,w,f){let X=await Q.session.messages({sessionID:w,directory:f,agent_id:"main"},{throwOnError:!0}).then((Z)=>Z.data).catch((Z)=>{V.error("failed to fetch messages for usage update",{error:Z});return});if(!X)return;let G=X.filter((Z)=>Z.info.role==="assistant"),_=G[G.length-1];if(!_)return;let J=_.info;if(!J.providerID||!J.modelID)return;let j=await rw(Q,k.make(J.providerID),P.make(J.modelID),f);if(!j)return;let B=J.tokens.input+(J.tokens.cache?.read??0),Y=G.reduce((Z,A)=>Z+A.info.cost,0);await $.sessionUpdate({sessionId:w,update:{sessionUpdate:"usage_update",used:B,size:j,cost:{amount:Y,currency:"USD"}}}).catch((Z)=>{V.error("failed to send usage update",{error:Z})})}async function zw({sdk:$}){return{create:(Q,w)=>{return new CD(Q,w)}}}class CD{connection;config;sdk;sessionManager;eventBridge;constructor($,Q){this.connection=$,this.config=Q,this.sdk=Q.sdk,this.sessionManager=new LD(this.sdk),this.eventBridge=new UD($,this.sdk,this.sessionManager),this.eventBridge.start()}async initialize($){V.info("initialize",{protocolVersion:$.protocolVersion});let Q={description:"Run `qitqode auth login` in the terminal",name:"Login with qitqode",id:"qitqode-login"};if($.clientCapabilities?._meta?.["terminal-auth"]===!0)Q._meta={"terminal-auth":{command:"qitqode",args:["auth","login"],label:"QitQode Login"}};return{protocolVersion:1,agentCapabilities:{loadSession:!0,mcpCapabilities:{http:!0,sse:!0},promptCapabilities:{embeddedContext:!0,image:!0},sessionCapabilities:{fork:{},list:{},resume:{}}},authMethods:[Q],agentInfo:{name:"QitQode",version:Q$}}}async authenticate($){throw Error("Authentication not implemented")}rethrowSessionError($){let Q=G$.fromError($,{providerID:k.make(this.config.defaultModel?.providerID??"unknown")});if(f$.isInstance(Q))throw K.authRequired();throw $}fetchSessionMessages($,Q){return this.sdk.session.messages({sessionID:$,directory:Q,agent_id:"main"},{throwOnError:!0}).then((w)=>w.data).catch((w)=>{V.error("unexpected error when fetching message",{error:w});return})}loadSessionProviders($){return this.sdk.config.providers({directory:$},{throwOnError:!0}).then((Q)=>Q.data.providers)}async newSession($){let Q=$.cwd;try{let w=await h(this.config,Q),X=(await this.sessionManager.create($.cwd,$.mcpServers,w)).id;V.info("creating_session",{sessionId:X,mcpServers:$.mcpServers.length});let G=await this.loadSessionMode({cwd:Q,mcpServers:$.mcpServers,sessionId:X});return{sessionId:X,configOptions:G.configOptions,models:G.models,modes:G.modes,_meta:G._meta}}catch(w){this.rethrowSessionError(w)}}async loadSession($){let{cwd:Q,sessionId:w}=$;try{let f=await h(this.config,Q);await this.sessionManager.load(w,$.cwd,$.mcpServers,f),V.info("load_session",{sessionId:w,mcpServers:$.mcpServers.length});let X=await this.loadSessionMode({cwd:Q,mcpServers:$.mcpServers,sessionId:w}),G=await this.fetchSessionMessages(w,Q),_=G?.findLast((J)=>J.info.role==="user")?.info;if(_?.role==="user"){if(X.models.currentModelId=`${_.model.providerID}/${_.model.modelID}`,this.sessionManager.setModel(w,{providerID:k.make(_.model.providerID),modelID:P.make(_.model.modelID)}),X.modes?.availableModes.some((J)=>J.id===_.agent))X.modes.currentModeId=_.agent,this.sessionManager.setMode(w,_.agent);X.configOptions=i({currentModelId:X.models.currentModelId,availableModels:X.models.availableModels,modes:X.modes})}return await this.replayMessagesAndSendUsage(G,w,Q),X}catch(f){this.rethrowSessionError(f)}}async listSessions($){try{let w=await this.sdk.session.list({directory:$.cwd??void 0,roots:!0},{throwOnError:!0}).then((Z)=>Z.data??[]),f=$.cursor?Number($.cursor):void 0,X=w.toSorted((Z,A)=>A.time.updated-Z.time.updated),G=f?X.filter((Z)=>Z.time.updated<f):X,_=G.slice(0,100),J=_.map((Z)=>({sessionId:Z.id,cwd:Z.directory,title:Z.title,updatedAt:new Date(Z.time.updated).toISOString()})),j=_[_.length-1],B=G.length>100&&j?String(j.time.updated):void 0,Y={sessions:J};if(B)Y.nextCursor=B;return Y}catch(Q){this.rethrowSessionError(Q)}}async unstable_forkSession($){let Q=$.cwd,w=$.mcpServers??[];try{let f=await h(this.config,Q),X=await this.sdk.session.fork({sessionID:$.sessionId,directory:Q},{throwOnError:!0}).then((j)=>j.data);if(!X)throw Error("Fork session returned no data");let G=X.id;await this.sessionManager.load(G,Q,w,f),V.info("fork_session",{sessionId:G,mcpServers:w.length});let _=await this.loadSessionMode({cwd:Q,mcpServers:w,sessionId:G}),J=await this.fetchSessionMessages(G,Q);return await this.replayMessagesAndSendUsage(J,G,Q),_}catch(f){this.rethrowSessionError(f)}}async unstable_resumeSession($){let{cwd:Q,sessionId:w}=$,f=$.mcpServers??[];try{let X=await h(this.config,Q);await this.sessionManager.load(w,Q,f,X),V.info("resume_session",{sessionId:w,mcpServers:f.length});let G=await this.loadSessionMode({cwd:Q,mcpServers:f,sessionId:w});return await bD(this.connection,this.sdk,w,Q),G}catch(X){this.rethrowSessionError(X)}}async loadAvailableModes($){return(await this.config.sdk.app.agents({directory:$},{throwOnError:!0}).then((w)=>w.data)).filter((w)=>w.mode!=="subagent"&&!w.hidden).map((w)=>({id:w.name,name:w.name,description:w.description}))}async resolveModeState($,Q){let w=await this.loadAvailableModes($),f=this.sessionManager.get(Q).modeId||await(async()=>{if(!w.length)return;let X=await MD.runPromise(hD.Service.use((_)=>_.defaultAgent())),G=w.find((_)=>_.name===X)?.id??w[0].id;return this.sessionManager.setMode(Q,G),G})();return{availableModes:w,currentModeId:f}}async replayMessagesAndSendUsage($,Q,w){for(let f of $??[])V.debug("replay message",f),await this.eventBridge.processMessage(f);await bD(this.connection,this.sdk,Q,w)}async resolveModelsAndModes($){let Q=VD($.entries,$.model);$.onVariants?.(Q);let w=D$($.entries,{includeVariants:!0}),f=await this.resolveModeState($.directory,$.sessionId),X=f.currentModeId?{availableModes:f.availableModes,currentModeId:f.currentModeId}:void 0;return{availableVariants:Q,availableModels:w,modes:X}}async loadSessionMode($){let Q=$.cwd,w=await h(this.config,Q),f=$.sessionId,X=await this.sdk.config.providers({directory:Q}).then((W)=>W.data.providers),G=l(X),_=this.sessionManager.getVariant(f),{availableVariants:J,availableModels:j,modes:B}=await this.resolveModelsAndModes({entries:G,model:w,directory:Q,sessionId:f,onVariants:(W)=>{if(_&&!W.includes(_))this.sessionManager.setVariant(f,void 0)}}),Z=(await this.config.sdk.command.list({directory:Q},{throwOnError:!0}).then((W)=>W.data)).map((W)=>({name:W.name,description:W.description??""}));if(!new Set(Z.map((W)=>W.name)).has("compact"))Z.push({name:"compact",description:"summarize the session to reduce context"});let y={};for(let W of $.mcpServers)if("type"in W)y[W.name]={url:W.url,headers:W.headers.reduce((x,{name:C,value:m})=>{return x[C]=m,x},{}),type:"remote"};else y[W.name]={type:"local",command:[W.command,...W.args],environment:W.env.reduce((x,{name:C,value:m})=>{return x[C]=m,x},{})};return await Promise.all(Object.entries(y).map(async([W,x])=>{await this.sdk.mcp.add({directory:Q,name:W,config:x},{throwOnError:!0}).catch((C)=>{V.error("failed to add mcp server",{name:W,error:C})})})),setTimeout(()=>{this.connection.sessionUpdate({sessionId:f,update:{sessionUpdate:"available_commands_update",availableCommands:Z}})},0),{sessionId:f,models:{currentModelId:d(w,_,J,!0),availableModels:j},modes:B,configOptions:i({currentModelId:d(w,_,J,!0),availableModels:j,modes:B}),_meta:HD({model:w,variant:this.sessionManager.getVariant(f),availableVariants:J})}}async unstable_setSessionModel($){let Q=this.sessionManager.get($.sessionId),w=await this.loadSessionProviders(Q.cwd),f=PD($.modelId,w);this.sessionManager.setModel(Q.id,f.model),this.sessionManager.setVariant(Q.id,f.variant);let X=l(w),G=VD(X,f.model);return{_meta:HD({model:f.model,variant:f.variant,availableVariants:G})}}async setSessionMode($){let Q=this.sessionManager.get($.sessionId);if(!(await this.loadAvailableModes(Q.cwd)).some((f)=>f.id===$.modeId))throw Error(`Agent not found: ${$.modeId}`);this.sessionManager.setMode($.sessionId,$.modeId)}async setSessionConfigOption($){let Q=this.sessionManager.get($.sessionId),w=await this.loadSessionProviders(Q.cwd),f=l(w);if($.configId==="model"){if(typeof $.value!=="string")throw K.invalidParams("model value must be a string");let Y=PD($.value,w);this.sessionManager.setModel(Q.id,Y.model),this.sessionManager.setVariant(Q.id,Y.variant)}else if($.configId==="mode"){if(typeof $.value!=="string")throw K.invalidParams("mode value must be a string");if(!(await this.loadAvailableModes(Q.cwd)).some((Z)=>Z.id===$.value))throw K.invalidParams(JSON.stringify({error:`Mode not found: ${$.value}`}));this.sessionManager.setMode(Q.id,$.value)}else throw K.invalidParams(JSON.stringify({error:`Unknown config option: ${$.configId}`}));let X=this.sessionManager.get(Q.id),G=X.model??await h(this.config,Q.cwd),{availableVariants:_,availableModels:J,modes:j}=await this.resolveModelsAndModes({entries:f,model:G,directory:Q.cwd,sessionId:Q.id}),B=d(G,X.variant,_,!0);return{configOptions:i({currentModelId:B,availableModels:J,modes:j})}}async prompt($){let Q=$.sessionId,w=this.sessionManager.get(Q),f=w.cwd,X=w.model,G=X??await h(this.config,f);if(!X)this.sessionManager.setModel(w.id,G);let _=w.modeId??await MD.runPromise(hD.Service.use((A)=>A.defaultAgent())),J=[];for(let A of $.prompt)switch(A.type){case"text":{let y=A.annotations?.audience,W=y?.length===1&&y[0]==="assistant",x=y?.length===1&&y[0]==="user";J.push({type:"text",text:A.text,...W&&{synthetic:!0},...x&&{ignored:!0}});break}case"image":{let y=g(A.uri??""),W=y.type==="file"?y.filename:"image";if(A.data)J.push({type:"file",url:`data:${A.mimeType};base64,${A.data}`,filename:W,mime:A.mimeType});else if(A.uri&&A.uri.startsWith("http:"))J.push({type:"file",url:A.uri,filename:W,mime:A.mimeType});break}case"resource_link":{let y=g(A.uri);if(A.name&&y.type==="file")y.filename=A.name;J.push(y);break}case"resource":{let y=A.resource;if("text"in y&&y.text)J.push({type:"text",text:y.text});else if("blob"in y&&y.blob&&y.mimeType){let W=g(y.uri??""),x=W.type==="file"?W.filename:"file";J.push({type:"file",url:`data:${y.mimeType};base64,${y.blob}`,filename:x,mime:y.mimeType})}break}default:break}V.info("parts",{parts:J});let j=(()=>{let A=J.filter((x)=>x.type==="text").map((x)=>x.text).join("").trim();if(!A.startsWith("/"))return;let[y,...W]=A.slice(1).split(/\s+/);return{name:y,args:W.join(" ").trim()}})(),B=(A)=>({totalTokens:A.tokens.input+A.tokens.output+A.tokens.reasoning+(A.tokens.cache?.read??0)+(A.tokens.cache?.write??0),inputTokens:A.tokens.input,outputTokens:A.tokens.output,thoughtTokens:A.tokens.reasoning||void 0,cachedReadTokens:A.tokens.cache?.read||void 0,cachedWriteTokens:A.tokens.cache?.write||void 0}),Y,Z=!1;if(!j)Z=!0,Y=(await this.sdk.session.prompt({sessionID:Q,model:{providerID:G.providerID,modelID:G.modelID},variant:this.sessionManager.getVariant(Q),parts:J,agent:_,directory:f})).data?.info;else{let A=await this.config.sdk.command.list({directory:f},{throwOnError:!0}).then((y)=>y.data.find((W)=>W.name===j.name));if(A)Z=!0,Y=(await this.sdk.session.command({sessionID:Q,command:A.name,arguments:j.args,model:G.providerID+"/"+G.modelID,agent:_,directory:f})).data?.info;else switch(j.name){case"compact":await this.config.sdk.session.summarize({sessionID:Q,directory:f,providerID:G.providerID,modelID:G.modelID},{throwOnError:!0});break}}return await bD(this.connection,this.sdk,Q,f),{stopReason:"end_turn",...Z?{usage:Y?B(Y):void 0}:{},_meta:{}}}async cancel($){let Q=this.sessionManager.get($.sessionId);await this.config.sdk.session.abort({sessionID:$.sessionId,directory:Q.cwd},{throwOnError:!0})}}async function h($,Q){let{sdk:w,defaultModel:f}=$;if(f)return f;let X=Q??process.cwd(),G=await w.config.get({directory:X},{throwOnError:!0}).then((Y)=>{let Z=Y.data;if(!Z||!Z.model)return;return U.parseModel(Z.model)}).catch((Y)=>{V.error("failed to load user config for default model",{error:Y});return}),_=await w.config.providers({directory:X},{throwOnError:!0}).then((Y)=>Y.data?.providers??[]).catch((Y)=>{return V.error("failed to list providers for default model",{error:Y}),[]});if(G&&_.length){let Y=_.find((Z)=>Z.id===G.providerID);if(Y&&Y.models[G.modelID])return G}if(G&&!_.length)return G;let J=_.find((Y)=>Y.id==="opencode");if(J){if(J.models["big-pickle"])return{providerID:k.opencode,modelID:P.make("big-pickle")};let[Y]=U.sort(Object.values(J.models));if(Y)return{providerID:k.make(Y.providerID),modelID:P.make(Y.id)}}for(let Y of["default","fast","economical","power"]){let Z=_$[Y];if(!Z)continue;if(_.find((y)=>y.id===Z.providerID)?.models[Z.modelID])return{providerID:k.make(Z.providerID),modelID:P.make(Z.modelID)}}let j=_.flatMap((Y)=>Object.values(Y.models)),[B]=U.sort(j);if(B)return{providerID:k.make(B.providerID),modelID:P.make(B.id)};if(G)return G;return{providerID:k.opencode,modelID:P.make("big-pickle")}}var ED=H.create({service:"acp-command"}),sQ=A$({command:"acp",describe:"start ACP (Agent Client Protocol) server",builder:($)=>{return J$($).option("cwd",{describe:"working directory",type:"string",default:process.cwd()})},handler:async($)=>{if(process.env.QITQODE_CLIENT="acp",process.env.QITQODE_KEY)ED.info("Using QITQODE_KEY for authentication.");else if(!await Y$())ED.warn("No QitQode credential found. AI features will not work until you sign in (`qitqode auth login`) or set QITQODE_KEY.");await j$(process.cwd(),async()=>{let Q=await W$($),w=await Z$.listen(Q),f=X$({baseUrl:`http://${w.hostname}:${w.port}`}),X=new WritableStream({write(j){return new Promise((B,Y)=>{process.stdout.write(j,(Z)=>{if(Z)Y(Z);else B()})})}}),G=new ReadableStream({start(j){process.stdin.on("data",(B)=>{j.enqueue(new Uint8Array(B))}),process.stdin.on("end",()=>j.close()),process.stdin.on("error",(B)=>j.error(B))}}),_=zD(X,G),J=await v.init({sdk:f});new OD((j)=>{return J.create(j,{sdk:f})},_),ED.info("setup connection"),process.stdin.resume(),await new Promise((j,B)=>{process.stdin.on("end",j),process.stdin.on("error",B)})})}});export{sQ as AcpCommand};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-aztre27e.js";var Jm=Object.defineProperty,Om=(e)=>{throw TypeError(e)},dh=(e,_,o)=>(_ in e)?Jm(e,_,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[_]=o,Lm=(e,_)=>{for(var o in _)Jm(e,o,{get:_[o],enumerable:!0})},zo=(e,_,o)=>dh(e,typeof _!="symbol"?_+"":_,o),mh=(e,_,o)=>_.has(e)||Om("Cannot "+o),fh=(e,_,o)=>_.has(e)?Om("Cannot add the same private member more than once"):_ instanceof WeakSet?_.add(e):_.set(e,o),ye=(e,_,o)=>(mh(e,_,"access private method"),o),Rm={};Lm(Rm,{parsers:()=>qm});var qm={};Lm(qm,{typescript:()=>T4});var hh=()=>()=>{},Fp=hh,yh=(e,_,o,c)=>{if(!(e&&_==null))return _.replaceAll?_.replaceAll(o,c):o.global?_.replace(o,c):_.split(o).join(c)},Na=yh,gh="5.8",At=[],bh=new Map;function Ho(e){return e!==void 0?e.length:0}function O_(e,_){if(e!==void 0)for(let o=0;o<e.length;o++){let c=_(e[o],o);if(c)return c}}function vh(e,_){if(e!==void 0)for(let o=0;o<e.length;o++){let c=_(e[o],o);if(c!==void 0)return c}}function xd(e,_,o){let c=[];q.assertEqual(e.length,_.length);for(let h=0;h<e.length;h++)c.push(o(e[h],_[h],h));return c}function jp(e,_){if(e!==void 0){for(let o=0;o<e.length;o++)if(!_(e[o],o))return!1}return!0}function Um(e,_,o){if(e!==void 0)for(let c=o??0;c<e.length;c++){let h=e[c];if(_(h,c))return h}}function Gu(e,_,o){if(e===void 0)return-1;for(let c=o??0;c<e.length;c++)if(_(e[c],c))return c;return-1}function xh(e,_,o=Op){if(e!==void 0){for(let c=0;c<e.length;c++)if(o(e[c],_))return!0}return!1}function Xn(e,_){if(e!==void 0){let o=e.length,c=0;for(;c<o&&_(e[c]);)c++;if(c<o){let h=e.slice(0,c);for(c++;c<o;){let v=e[c];_(v)&&h.push(v),c++}return h}}return e}function cp(e,_){let o;if(e!==void 0){o=[];for(let c=0;c<e.length;c++)o.push(_(e[c],c))}return o}function Bm(e){let _=[];for(let o=0;o<e.length;o++){let c=e[o];c&&($n(c)?D_(_,c):_.push(c))}return _}function zm(e,_){let o;if(e!==void 0)for(let c=0;c<e.length;c++){let h=_(e[c],c);h&&($n(h)?o=D_(o,h):o=C_(o,h))}return o??At}function wh(e,_){let o;if(e!==void 0)for(let c=0;c<e.length;c++){let h=e[c],v=_(h,c);(o||h!==v||$n(v))&&(o||(o=e.slice(0,c)),$n(v)?D_(o,v):o.push(v))}return o??e}function Th(e,_){let o=[];if(e!==void 0)for(let c=0;c<e.length;c++){let h=_(e[c],c);h!==void 0&&o.push(h)}return o}function Zt(e,_){if(e!==void 0)if(_!==void 0){for(let o=0;o<e.length;o++)if(_(e[o]))return!0}else return e.length>0;return!1}function Mp(e,_){return _===void 0||_.length===0?e:e===void 0||e.length===0?_:[...e,..._]}function Sh(e,_,o=Op){if(e===void 0||_===void 0)return e===_;if(e.length!==_.length)return!1;for(let c=0;c<e.length;c++)if(!o(e[c],_[c],c))return!1;return!0}function C_(e,_){return _===void 0?e:e===void 0?[_]:(e.push(_),e)}function up(e,_){return _<0?e.length+_:_}function D_(e,_,o,c){if(_===void 0||_.length===0)return e;if(e===void 0)return _.slice(o,c);o=o===void 0?0:up(_,o),c=c===void 0?_.length:up(_,c);for(let h=o;h<c&&h<_.length;h++)_[h]!==void 0&&e.push(_[h]);return e}function kh(e,_,o){return xh(e,_,o)?!1:(e.push(_),!0)}function Ch(e,_,o){return e!==void 0?(kh(e,_,o),e):[_]}function Ah(e,_){return e.length===0?At:e.slice().sort(_)}var S4=Array.prototype.at?(e,_)=>e==null?void 0:e.at(_):(e,_)=>{if(e!==void 0&&(_=up(e,_),_<e.length))return e[_]};function Jp(e){return e===void 0||e.length===0?void 0:e[0]}function ja(e){return e===void 0||e.length===0?void 0:e[e.length-1]}function Dh(e){return q.assert(e.length!==0),e[e.length-1]}function Eh(e){return e!==void 0&&e.length===1?e[0]:void 0}function Ph(e,_,o,c,h){return Nh(e,o(_),o,c,h)}function Nh(e,_,o,c,h){if(!Zt(e))return-1;let v=h??0,A=e.length-1;for(;v<=A;){let E=v+(A-v>>1),s=o(e[E],E);switch(c(s,_)){case-1:v=E+1;break;case 0:return E;case 1:A=E-1;break}}return~v}function Ih(e,_,o,c,h){if(e&&e.length>0){let v=e.length;if(v>0){let A=c===void 0||c<0?0:c,E=h===void 0||A+h>v-1?v-1:A+h,s;for(arguments.length<=2?(s=e[A],A++):s=o;A<=E;)s=_(s,e[A],A),A++;return s}}return o}var Km=Object.prototype.hasOwnProperty;function Dn(e,_){return Km.call(e,_)}function Fh(e){let _=[];for(let o in e)Km.call(e,o)&&_.push(o);return _}function jh(){let e=new Map;return e.add=Mh,e.remove=Jh,e}function Mh(e,_){let o=this.get(e);return o!==void 0?o.push(_):this.set(e,o=[_]),o}function Jh(e,_){let o=this.get(e);o!==void 0&&(Vh(o,_),o.length||this.delete(e))}function $n(e){return Array.isArray(e)}function $u(e){return $n(e)?e:[e]}function Oh(e,_){return e!==void 0&&_(e)?e:void 0}function Cn(e,_){return e!==void 0&&_(e)?e:q.fail(`Invalid cast. The supplied value ${e} did not pass the test '${q.getFunctionName(_)}'.`)}function qa(e){}function Lh(){return!0}function gt(e){return e}function wd(e){let _;return()=>(e&&(_=e(),e=void 0),_)}function H_(e){let _=new Map;return(o)=>{let c=`${typeof o}:${o}`,h=_.get(c);return h===void 0&&!_.has(c)&&(h=e(o),_.set(c,h)),h}}function Op(e,_){return e===_}function Lp(e,_){return e===_||e!==void 0&&_!==void 0&&e.toUpperCase()===_.toUpperCase()}function Rh(e,_){return Op(e,_)}function qh(e,_){return e===_?0:e===void 0?-1:_===void 0?1:e<_?-1:1}function Vm(e,_){return qh(e,_)}function Uh(e,_,o){for(let c=0;c<e.length;c++)_=Math.max(_,o(e[c]));return _}function Qo(e,_,o){let c=Math.max(2,Math.floor(e.length*0.34)),h=Math.floor(e.length*0.4)+1,v;for(let A of _){let E=o(A);if(E!==void 0&&Math.abs(E.length-e.length)<=c){if(E===e||E.length<3&&E.toLowerCase()!==e.toLowerCase())continue;let s=Bh(e,E,h-0.1);if(s===void 0)continue;q.assert(s<h),h=s,v=A}}return v}function Bh(e,_,o){let c=Array(_.length+1),h=Array(_.length+1),v=o+0.01;for(let E=0;E<=_.length;E++)c[E]=E;for(let E=1;E<=e.length;E++){let s=e.charCodeAt(E-1),V=Math.ceil(E>o?E-o:1),d=Math.floor(_.length>o+E?o+E:_.length);h[0]=E;let T=E;for(let S=1;S<V;S++)h[S]=v;for(let S=V;S<=d;S++){let F=e[E-1].toLowerCase()===_[S-1].toLowerCase()?c[S-1]+0.1:c[S-1]+2,te=s===_.charCodeAt(S-1)?c[S-1]:Math.min(c[S]+1,h[S-1]+1,F);h[S]=te,T=Math.min(T,te)}for(let S=d+1;S<=_.length;S++)h[S]=v;if(T>o)return;let b=c;c=h,h=b}let A=c[_.length];return A>o?void 0:A}function zh(e,_,o){let c=e.length-_.length;return c>=0&&(o?Lp(e.slice(c),_):e.indexOf(_,c)===c)}function Kh(e,_){e[_]=e[e.length-1],e.pop()}function Vh(e,_){return Wh(e,(o)=>o===_)}function Wh(e,_){for(let o=0;o<e.length;o++)if(_(e[o]))return Kh(e,o),!0;return!1}function _c(e,_,o){return o?Lp(e.slice(0,_.length),_):e.lastIndexOf(_,0)===0}function pp(e){return e===void 0?void 0:[e]}var q;((e)=>{let _=0;e.currentLogLevel=2,e.isDebugging=!1;function o(J){return e.currentLogLevel<=J}e.shouldLog=o;function c(J,oe){e.loggingHost&&o(J)&&e.loggingHost.log(J,oe)}function h(J){c(3,J)}e.log=h,((J)=>{function oe(Ye){c(1,Ye)}J.error=oe;function pe(Ye){c(2,Ye)}J.warn=pe;function ke(Ye){c(3,Ye)}J.log=ke;function Qe(Ye){c(4,Ye)}J.trace=Qe})(h=e.log||(e.log={}));let v={};function A(){return _}e.getAssertionLevel=A;function E(J){let oe=_;if(_=J,J>oe)for(let pe of Fh(v)){let ke=v[pe];ke!==void 0&&e[pe]!==ke.assertion&&J>=ke.level&&(e[pe]=ke,v[pe]=void 0)}}e.setAssertionLevel=E;function s(J){return _>=J}e.shouldAssert=s;function V(J,oe){return s(J)?!0:(v[oe]={level:J,assertion:e[oe]},e[oe]=qa,!1)}function d(J,oe){debugger;let pe=Error(J?`Debug Failure. ${J}`:"Debug Failure.");throw Error.captureStackTrace&&Error.captureStackTrace(pe,oe||d),pe}e.fail=d;function T(J,oe,pe){return d(`${oe||"Unexpected node."}\r
2
+ import"./chunk-7xm75w1e.js";var Jm=Object.defineProperty,Om=(e)=>{throw TypeError(e)},dh=(e,_,o)=>(_ in e)?Jm(e,_,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[_]=o,Lm=(e,_)=>{for(var o in _)Jm(e,o,{get:_[o],enumerable:!0})},zo=(e,_,o)=>dh(e,typeof _!="symbol"?_+"":_,o),mh=(e,_,o)=>_.has(e)||Om("Cannot "+o),fh=(e,_,o)=>_.has(e)?Om("Cannot add the same private member more than once"):_ instanceof WeakSet?_.add(e):_.set(e,o),ye=(e,_,o)=>(mh(e,_,"access private method"),o),Rm={};Lm(Rm,{parsers:()=>qm});var qm={};Lm(qm,{typescript:()=>T4});var hh=()=>()=>{},Fp=hh,yh=(e,_,o,c)=>{if(!(e&&_==null))return _.replaceAll?_.replaceAll(o,c):o.global?_.replace(o,c):_.split(o).join(c)},Na=yh,gh="5.8",At=[],bh=new Map;function Ho(e){return e!==void 0?e.length:0}function O_(e,_){if(e!==void 0)for(let o=0;o<e.length;o++){let c=_(e[o],o);if(c)return c}}function vh(e,_){if(e!==void 0)for(let o=0;o<e.length;o++){let c=_(e[o],o);if(c!==void 0)return c}}function xd(e,_,o){let c=[];q.assertEqual(e.length,_.length);for(let h=0;h<e.length;h++)c.push(o(e[h],_[h],h));return c}function jp(e,_){if(e!==void 0){for(let o=0;o<e.length;o++)if(!_(e[o],o))return!1}return!0}function Um(e,_,o){if(e!==void 0)for(let c=o??0;c<e.length;c++){let h=e[c];if(_(h,c))return h}}function Gu(e,_,o){if(e===void 0)return-1;for(let c=o??0;c<e.length;c++)if(_(e[c],c))return c;return-1}function xh(e,_,o=Op){if(e!==void 0){for(let c=0;c<e.length;c++)if(o(e[c],_))return!0}return!1}function Xn(e,_){if(e!==void 0){let o=e.length,c=0;for(;c<o&&_(e[c]);)c++;if(c<o){let h=e.slice(0,c);for(c++;c<o;){let v=e[c];_(v)&&h.push(v),c++}return h}}return e}function cp(e,_){let o;if(e!==void 0){o=[];for(let c=0;c<e.length;c++)o.push(_(e[c],c))}return o}function Bm(e){let _=[];for(let o=0;o<e.length;o++){let c=e[o];c&&($n(c)?D_(_,c):_.push(c))}return _}function zm(e,_){let o;if(e!==void 0)for(let c=0;c<e.length;c++){let h=_(e[c],c);h&&($n(h)?o=D_(o,h):o=C_(o,h))}return o??At}function wh(e,_){let o;if(e!==void 0)for(let c=0;c<e.length;c++){let h=e[c],v=_(h,c);(o||h!==v||$n(v))&&(o||(o=e.slice(0,c)),$n(v)?D_(o,v):o.push(v))}return o??e}function Th(e,_){let o=[];if(e!==void 0)for(let c=0;c<e.length;c++){let h=_(e[c],c);h!==void 0&&o.push(h)}return o}function Zt(e,_){if(e!==void 0)if(_!==void 0){for(let o=0;o<e.length;o++)if(_(e[o]))return!0}else return e.length>0;return!1}function Mp(e,_){return _===void 0||_.length===0?e:e===void 0||e.length===0?_:[...e,..._]}function Sh(e,_,o=Op){if(e===void 0||_===void 0)return e===_;if(e.length!==_.length)return!1;for(let c=0;c<e.length;c++)if(!o(e[c],_[c],c))return!1;return!0}function C_(e,_){return _===void 0?e:e===void 0?[_]:(e.push(_),e)}function up(e,_){return _<0?e.length+_:_}function D_(e,_,o,c){if(_===void 0||_.length===0)return e;if(e===void 0)return _.slice(o,c);o=o===void 0?0:up(_,o),c=c===void 0?_.length:up(_,c);for(let h=o;h<c&&h<_.length;h++)_[h]!==void 0&&e.push(_[h]);return e}function kh(e,_,o){return xh(e,_,o)?!1:(e.push(_),!0)}function Ch(e,_,o){return e!==void 0?(kh(e,_,o),e):[_]}function Ah(e,_){return e.length===0?At:e.slice().sort(_)}var S4=Array.prototype.at?(e,_)=>e==null?void 0:e.at(_):(e,_)=>{if(e!==void 0&&(_=up(e,_),_<e.length))return e[_]};function Jp(e){return e===void 0||e.length===0?void 0:e[0]}function ja(e){return e===void 0||e.length===0?void 0:e[e.length-1]}function Dh(e){return q.assert(e.length!==0),e[e.length-1]}function Eh(e){return e!==void 0&&e.length===1?e[0]:void 0}function Ph(e,_,o,c,h){return Nh(e,o(_),o,c,h)}function Nh(e,_,o,c,h){if(!Zt(e))return-1;let v=h??0,A=e.length-1;for(;v<=A;){let E=v+(A-v>>1),s=o(e[E],E);switch(c(s,_)){case-1:v=E+1;break;case 0:return E;case 1:A=E-1;break}}return~v}function Ih(e,_,o,c,h){if(e&&e.length>0){let v=e.length;if(v>0){let A=c===void 0||c<0?0:c,E=h===void 0||A+h>v-1?v-1:A+h,s;for(arguments.length<=2?(s=e[A],A++):s=o;A<=E;)s=_(s,e[A],A),A++;return s}}return o}var Km=Object.prototype.hasOwnProperty;function Dn(e,_){return Km.call(e,_)}function Fh(e){let _=[];for(let o in e)Km.call(e,o)&&_.push(o);return _}function jh(){let e=new Map;return e.add=Mh,e.remove=Jh,e}function Mh(e,_){let o=this.get(e);return o!==void 0?o.push(_):this.set(e,o=[_]),o}function Jh(e,_){let o=this.get(e);o!==void 0&&(Vh(o,_),o.length||this.delete(e))}function $n(e){return Array.isArray(e)}function $u(e){return $n(e)?e:[e]}function Oh(e,_){return e!==void 0&&_(e)?e:void 0}function Cn(e,_){return e!==void 0&&_(e)?e:q.fail(`Invalid cast. The supplied value ${e} did not pass the test '${q.getFunctionName(_)}'.`)}function qa(e){}function Lh(){return!0}function gt(e){return e}function wd(e){let _;return()=>(e&&(_=e(),e=void 0),_)}function H_(e){let _=new Map;return(o)=>{let c=`${typeof o}:${o}`,h=_.get(c);return h===void 0&&!_.has(c)&&(h=e(o),_.set(c,h)),h}}function Op(e,_){return e===_}function Lp(e,_){return e===_||e!==void 0&&_!==void 0&&e.toUpperCase()===_.toUpperCase()}function Rh(e,_){return Op(e,_)}function qh(e,_){return e===_?0:e===void 0?-1:_===void 0?1:e<_?-1:1}function Vm(e,_){return qh(e,_)}function Uh(e,_,o){for(let c=0;c<e.length;c++)_=Math.max(_,o(e[c]));return _}function Qo(e,_,o){let c=Math.max(2,Math.floor(e.length*0.34)),h=Math.floor(e.length*0.4)+1,v;for(let A of _){let E=o(A);if(E!==void 0&&Math.abs(E.length-e.length)<=c){if(E===e||E.length<3&&E.toLowerCase()!==e.toLowerCase())continue;let s=Bh(e,E,h-0.1);if(s===void 0)continue;q.assert(s<h),h=s,v=A}}return v}function Bh(e,_,o){let c=Array(_.length+1),h=Array(_.length+1),v=o+0.01;for(let E=0;E<=_.length;E++)c[E]=E;for(let E=1;E<=e.length;E++){let s=e.charCodeAt(E-1),V=Math.ceil(E>o?E-o:1),d=Math.floor(_.length>o+E?o+E:_.length);h[0]=E;let T=E;for(let S=1;S<V;S++)h[S]=v;for(let S=V;S<=d;S++){let F=e[E-1].toLowerCase()===_[S-1].toLowerCase()?c[S-1]+0.1:c[S-1]+2,te=s===_.charCodeAt(S-1)?c[S-1]:Math.min(c[S]+1,h[S-1]+1,F);h[S]=te,T=Math.min(T,te)}for(let S=d+1;S<=_.length;S++)h[S]=v;if(T>o)return;let b=c;c=h,h=b}let A=c[_.length];return A>o?void 0:A}function zh(e,_,o){let c=e.length-_.length;return c>=0&&(o?Lp(e.slice(c),_):e.indexOf(_,c)===c)}function Kh(e,_){e[_]=e[e.length-1],e.pop()}function Vh(e,_){return Wh(e,(o)=>o===_)}function Wh(e,_){for(let o=0;o<e.length;o++)if(_(e[o]))return Kh(e,o),!0;return!1}function _c(e,_,o){return o?Lp(e.slice(0,_.length),_):e.lastIndexOf(_,0)===0}function pp(e){return e===void 0?void 0:[e]}var q;((e)=>{let _=0;e.currentLogLevel=2,e.isDebugging=!1;function o(J){return e.currentLogLevel<=J}e.shouldLog=o;function c(J,oe){e.loggingHost&&o(J)&&e.loggingHost.log(J,oe)}function h(J){c(3,J)}e.log=h,((J)=>{function oe(Ye){c(1,Ye)}J.error=oe;function pe(Ye){c(2,Ye)}J.warn=pe;function ke(Ye){c(3,Ye)}J.log=ke;function Qe(Ye){c(4,Ye)}J.trace=Qe})(h=e.log||(e.log={}));let v={};function A(){return _}e.getAssertionLevel=A;function E(J){let oe=_;if(_=J,J>oe)for(let pe of Fh(v)){let ke=v[pe];ke!==void 0&&e[pe]!==ke.assertion&&J>=ke.level&&(e[pe]=ke,v[pe]=void 0)}}e.setAssertionLevel=E;function s(J){return _>=J}e.shouldAssert=s;function V(J,oe){return s(J)?!0:(v[oe]={level:J,assertion:e[oe]},e[oe]=qa,!1)}function d(J,oe){debugger;let pe=Error(J?`Debug Failure. ${J}`:"Debug Failure.");throw Error.captureStackTrace&&Error.captureStackTrace(pe,oe||d),pe}e.fail=d;function T(J,oe,pe){return d(`${oe||"Unexpected node."}\r
3
3
  Node ${jt(J.kind)} was unexpected.`,pe||T)}e.failBadSyntaxKind=T;function b(J,oe,pe,ke){J||(oe=oe?`False expression: ${oe}`:"False expression.",pe&&(oe+=`\r
4
4
  Verbose Debug Information: `+(typeof pe=="string"?pe:pe())),d(oe,ke||b))}e.assert=b;function S(J,oe,pe,ke,Qe){if(J!==oe){let Ye=pe?ke?`${pe} ${ke}`:pe:"";d(`Expected ${J} === ${oe}. ${Ye}`,Qe||S)}}e.assertEqual=S;function F(J,oe,pe,ke){J>=oe&&d(`Expected ${J} < ${oe}. ${pe||""}`,ke||F)}e.assertLessThan=F;function te(J,oe,pe){J>oe&&d(`Expected ${J} <= ${oe}`,pe||te)}e.assertLessThanOrEqual=te;function ve(J,oe,pe){J<oe&&d(`Expected ${J} >= ${oe}`,pe||ve)}e.assertGreaterThanOrEqual=ve;function fe(J,oe,pe){J==null&&d(oe,pe||fe)}e.assertIsDefined=fe;function me(J,oe,pe){return fe(J,oe,pe||me),J}e.checkDefined=me;function j(J,oe,pe){for(let ke of J)fe(ke,oe,pe||j)}e.assertEachIsDefined=j;function ne(J,oe,pe){return j(J,oe,pe||ne),J}e.checkEachDefined=ne;function je(J,oe="Illegal value:",pe){let ke=typeof J=="object"&&Dn(J,"kind")&&Dn(J,"pos")?"SyntaxKind: "+jt(J.kind):JSON.stringify(J);return d(`${oe} ${ke}`,pe||je)}e.assertNever=je;function K(J,oe,pe,ke){V(1,"assertEachNode")&&b(oe===void 0||jp(J,oe),pe||"Unexpected node.",()=>`Node array did not pass test '${y_(oe)}'.`,ke||K)}e.assertEachNode=K;function se(J,oe,pe,ke){V(1,"assertNode")&&b(J!==void 0&&(oe===void 0||oe(J)),pe||"Unexpected node.",()=>`Node ${jt(J==null?void 0:J.kind)} did not pass test '${y_(oe)}'.`,ke||se)}e.assertNode=se;function G(J,oe,pe,ke){V(1,"assertNotNode")&&b(J===void 0||oe===void 0||!oe(J),pe||"Unexpected node.",()=>`Node ${jt(J.kind)} should not have passed test '${y_(oe)}'.`,ke||G)}e.assertNotNode=G;function mt(J,oe,pe,ke){V(1,"assertOptionalNode")&&b(oe===void 0||J===void 0||oe(J),pe||"Unexpected node.",()=>`Node ${jt(J==null?void 0:J.kind)} did not pass test '${y_(oe)}'.`,ke||mt)}e.assertOptionalNode=mt;function en(J,oe,pe,ke){V(1,"assertOptionalToken")&&b(oe===void 0||J===void 0||J.kind===oe,pe||"Unexpected node.",()=>`Node ${jt(J==null?void 0:J.kind)} was not a '${jt(oe)}' token.`,ke||en)}e.assertOptionalToken=en;function h_(J,oe,pe){V(1,"assertMissingNode")&&b(J===void 0,oe||"Unexpected node.",()=>`Node ${jt(J.kind)} was unexpected'.`,pe||h_)}e.assertMissingNode=h_;function tn(J){}e.type=tn;function y_(J){if(typeof J!="function")return"";if(Dn(J,"name"))return J.name;{let oe=Function.prototype.toString.call(J),pe=/^function\s+([\w$]+)\s*\(/.exec(oe);return pe?pe[1]:""}}e.getFunctionName=y_;function P_(J){return`{ name: ${si(J.escapedName)}; flags: ${st(J.flags)}; declarations: ${cp(J.declarations,(oe)=>jt(oe.kind))} }`}e.formatSymbol=P_;function We(J=0,oe,pe){let ke=Pn(oe);if(J===0)return ke.length>0&&ke[0][0]===0?ke[0][1]:"0";if(pe){let Qe=[],Ye=J;for(let[at,Et]of ke){if(at>J)break;at!==0&&at&J&&(Qe.push(Et),Ye&=~at)}if(Ye===0)return Qe.join("|")}else for(let[Qe,Ye]of ke)if(Qe===J)return Ye;return J.toString()}e.formatEnum=We;let _n=new Map;function Pn(J){let oe=_n.get(J);if(oe)return oe;let pe=[];for(let Qe in J){let Ye=J[Qe];typeof Ye=="number"&&pe.push([Ye,Qe])}let ke=Ah(pe,(Qe,Ye)=>Vm(Qe[0],Ye[0]));return _n.set(J,ke),ke}function jt(J){return We(J,Fe,!1)}e.formatSyntaxKind=jt;function L_(J){return We(J,ef,!1)}e.formatSnippetKind=L_;function N_(J){return We(J,Wn,!1)}e.formatScriptKind=N_;function Mt(J){return We(J,Y_,!0)}e.formatNodeFlags=Mt;function bt(J){return We(J,$m,!0)}e.formatNodeCheckFlags=bt;function He(J){return We(J,Wm,!0)}e.formatModifierFlags=He;function R_(J){return We(J,Zm,!0)}e.formatTransformFlags=R_;function Xt(J){return We(J,tf,!0)}e.formatEmitFlags=Xt;function st(J){return We(J,Gm,!0)}e.formatSymbolFlags=st;function rt(J){return We(J,o_,!0)}e.formatTypeFlags=rt;function Rt(J){return We(J,Qm,!0)}e.formatSignatureFlags=Rt;function Jt(J){return We(J,Hm,!0)}e.formatObjectFlags=Jt;function lt(J){return We(J,dp,!0)}e.formatFlowFlags=lt;function nn(J){return We(J,Xm,!0)}e.formatRelationComparisonResult=nn;function ft(J){return We(J,CheckMode,!0)}e.formatCheckMode=ft;function g_(J){return We(J,SignatureCheckMode,!0)}e.formatSignatureCheckMode=g_;function yt(J){return We(J,TypeFacts,!0)}e.formatTypeFacts=yt;let i_=!1,_t;function qt(J){"__debugFlowFlags"in J||Object.defineProperties(J,{__tsDebuggerDisplay:{value(){let oe=this.flags&2?"FlowStart":this.flags&4?"FlowBranchLabel":this.flags&8?"FlowLoopLabel":this.flags&16?"FlowAssignment":this.flags&32?"FlowTrueCondition":this.flags&64?"FlowFalseCondition":this.flags&128?"FlowSwitchClause":this.flags&256?"FlowArrayMutation":this.flags&512?"FlowCall":this.flags&1024?"FlowReduceLabel":this.flags&1?"FlowUnreachable":"UnknownFlow",pe=this.flags&-2048;return`${oe}${pe?` (${lt(pe)})`:""}`}},__debugFlowFlags:{get(){return We(this.flags,dp,!0)}},__debugToString:{value(){return hn(this)}}})}function t_(J){return i_&&(typeof Object.setPrototypeOf=="function"?(_t||(_t=Object.create(Object.prototype),qt(_t)),Object.setPrototypeOf(J,_t)):qt(J)),J}e.attachFlowNodeDebugInfo=t_;let rn;function dn(J){"__tsDebuggerDisplay"in J||Object.defineProperties(J,{__tsDebuggerDisplay:{value(oe){return oe=String(oe).replace(/(?:,[\s\w]+:[^,]+)+\]$/,"]"),`NodeArray ${oe}`}}})}function mn(J){i_&&(typeof Object.setPrototypeOf=="function"?(rn||(rn=Object.create(Array.prototype),dn(rn)),Object.setPrototypeOf(J,rn)):dn(J))}e.attachNodeArrayDebugInfo=mn;function q_(){if(i_)return;let J=new WeakMap,oe=new WeakMap;Object.defineProperties(Ct.getSymbolConstructor().prototype,{__tsDebuggerDisplay:{value(){let ke=this.flags&33554432?"TransientSymbol":"Symbol",Qe=this.flags&-33554433;return`${ke} '${hp(this)}'${Qe?` (${st(Qe)})`:""}`}},__debugFlags:{get(){return st(this.flags)}}}),Object.defineProperties(Ct.getTypeConstructor().prototype,{__tsDebuggerDisplay:{value(){let ke=this.flags&67359327?`IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName?` (${this.debugIntrinsicName})`:""}`:this.flags&98304?"NullableType":this.flags&384?`LiteralType ${JSON.stringify(this.value)}`:this.flags&2048?`LiteralType ${this.value.negative?"-":""}${this.value.base10Value}n`:this.flags&8192?"UniqueESSymbolType":this.flags&32?"EnumType":this.flags&1048576?"UnionType":this.flags&2097152?"IntersectionType":this.flags&4194304?"IndexType":this.flags&8388608?"IndexedAccessType":this.flags&16777216?"ConditionalType":this.flags&33554432?"SubstitutionType":this.flags&262144?"TypeParameter":this.flags&524288?this.objectFlags&3?"InterfaceType":this.objectFlags&4?"TypeReference":this.objectFlags&8?"TupleType":this.objectFlags&16?"AnonymousType":this.objectFlags&32?"MappedType":this.objectFlags&1024?"ReverseMappedType":this.objectFlags&256?"EvolvingArrayType":"ObjectType":"Type",Qe=this.flags&524288?this.objectFlags&-1344:0;return`${ke}${this.symbol?` '${hp(this.symbol)}'`:""}${Qe?` (${Jt(Qe)})`:""}`}},__debugFlags:{get(){return rt(this.flags)}},__debugObjectFlags:{get(){return this.flags&524288?Jt(this.objectFlags):""}},__debugTypeToString:{value(){let ke=J.get(this);return ke===void 0&&(ke=this.checker.typeToString(this),J.set(this,ke)),ke}}}),Object.defineProperties(Ct.getSignatureConstructor().prototype,{__debugFlags:{get(){return Rt(this.flags)}},__debugSignatureToString:{value(){var ke;return(ke=this.checker)==null?void 0:ke.signatureToString(this)}}});let pe=[Ct.getNodeConstructor(),Ct.getIdentifierConstructor(),Ct.getTokenConstructor(),Ct.getSourceFileConstructor()];for(let ke of pe)Dn(ke.prototype,"__debugKind")||Object.defineProperties(ke.prototype,{__tsDebuggerDisplay:{value(){return`${Fa(this)?"GeneratedIdentifier":tt(this)?`Identifier '${E_(this)}'`:Xr(this)?`PrivateIdentifier '${E_(this)}'`:Ra(this)?`StringLiteral ${JSON.stringify(this.text.length<10?this.text:this.text.slice(10)+"...")}`:Ba(this)?`NumericLiteral ${this.text}`:og(this)?`BigIntLiteral ${this.text}n`:Qf(this)?"TypeParameterDeclaration":sc(this)?"ParameterDeclaration":Yf(this)?"ConstructorDeclaration":Tp(this)?"GetAccessorDeclaration":cc(this)?"SetAccessorDeclaration":mg(this)?"CallSignatureDeclaration":fg(this)?"ConstructSignatureDeclaration":Zf(this)?"IndexSignatureDeclaration":hg(this)?"TypePredicateNode":e1(this)?"TypeReferenceNode":t1(this)?"FunctionTypeNode":_1(this)?"ConstructorTypeNode":yg(this)?"TypeQueryNode":gg(this)?"TypeLiteralNode":bg(this)?"ArrayTypeNode":vg(this)?"TupleTypeNode":wg(this)?"OptionalTypeNode":Tg(this)?"RestTypeNode":Sg(this)?"UnionTypeNode":kg(this)?"IntersectionTypeNode":Cg(this)?"ConditionalTypeNode":Ag(this)?"InferTypeNode":Dg(this)?"ParenthesizedTypeNode":Eg(this)?"ThisTypeNode":Pg(this)?"TypeOperatorNode":Ng(this)?"IndexedAccessTypeNode":Ig(this)?"MappedTypeNode":Fg(this)?"LiteralTypeNode":xg(this)?"NamedTupleMember":jg(this)?"ImportTypeNode":jt(this.kind)}${this.flags?` (${Mt(this.flags)})`:""}`}},__debugKind:{get(){return jt(this.kind)}},__debugNodeFlags:{get(){return Mt(this.flags)}},__debugModifierFlags:{get(){return He(h2(this))}},__debugTransformFlags:{get(){return R_(this.transformFlags)}},__debugIsParseTreeNode:{get(){return ac(this)}},__debugEmitFlags:{get(){return Xt(La(this))}},__debugGetText:{value(Qe){if(Aa(this))return"";let Ye=oe.get(this);if(Ye===void 0){let at=N0(this),Et=at&&fr(at);Ye=Et?Od(Et,at,Qe):"",oe.set(this,Ye)}return Ye}}});i_=!0}e.enableDebugInfo=q_;function U_(J){let oe=J&7,pe=oe===0?"in out":oe===3?"[bivariant]":oe===2?"in":oe===1?"out":oe===4?"[independent]":"";return J&8?pe+=" (unmeasurable)":J&16&&(pe+=" (unreliable)"),pe}e.formatVariance=U_;class fn{__debugToString(){var J;switch(this.kind){case 3:return((J=this.debugInfo)==null?void 0:J.call(this))||"(function mapper)";case 0:return`${this.source.__debugTypeToString()} -> ${this.target.__debugTypeToString()}`;case 1:return xd(this.sources,this.targets||cp(this.sources,()=>"any"),(oe,pe)=>`${oe.__debugTypeToString()} -> ${typeof pe=="string"?pe:pe.__debugTypeToString()}`).join(", ");case 2:return xd(this.sources,this.targets,(oe,pe)=>`${oe.__debugTypeToString()} -> ${pe().__debugTypeToString()}`).join(", ");case 5:case 4:return`m1: ${this.mapper1.__debugToString().split(`
5
5
  `).join(`
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-aztre27e.js";var{create:tr,defineProperty:Pe,getOwnPropertyDescriptor:rr,getOwnPropertyNames:nr,getPrototypeOf:ir}=Object,or=Object.prototype.hasOwnProperty,vt=(u)=>{throw TypeError(u)},N=(u,e)=>()=>(e||u((e={exports:{}}).exports,e),e.exports),xt=(u,e)=>{for(var t in e)Pe(u,t,{get:e[t],enumerable:!0})},ar=(u,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of nr(e))!or.call(u,r)&&r!==t&&Pe(u,r,{get:()=>e[r],enumerable:!(n=rr(e,r))||n.enumerable});return u},Uu=(u,e,t)=>(t=u!=null?tr(ir(u)):{},ar(e||!u||!u.__esModule?Pe(t,"default",{value:u,enumerable:!0}):t,u)),Bt=(u,e,t)=>e.has(u)||vt("Cannot "+t),ku=(u,e,t)=>(Bt(u,e,"read from private field"),t?t.call(u):e.get(u)),sr=(u,e,t)=>e.has(u)?vt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(u):e.set(u,t),Dr=(u,e,t,n)=>(Bt(u,e,"write to private field"),n?n.call(u,t):e.set(u,t),t),je=N((u,e)=>{e.exports=t;function t(n){return String(n).replace(/\s+/g," ")}}),lr=N((u,e)=>{e.exports=p;var t=9,n=10,r=32,i=33,a=58,o=91,s=92,l=93,D=94,c=96,f=4,h=1024;function p(d){var C=this.Parser,g=this.Compiler;E(C)&&v(C,d),A(g)&&F(g)}function E(d){return!!(d&&d.prototype&&d.prototype.blockTokenizers)}function A(d){return!!(d&&d.prototype&&d.prototype.visitors)}function v(d,C){for(var g=C||{},y=d.prototype,w=y.blockTokenizers,T=y.inlineTokenizers,b=y.blockMethods,k=y.inlineMethods,L=w.definition,I=T.reference,x=[],S=-1,M=b.length,z;++S<M;)z=b[S],!(z==="newline"||z==="indentedCode"||z==="paragraph"||z==="footnoteDefinition")&&x.push([z]);x.push(["footnoteDefinition"]),g.inlineNotes&&(B(k,"reference","inlineNote"),T.inlineNote=J),B(b,"definition","footnoteDefinition"),B(k,"reference","footnoteCall"),w.definition=O,w.footnoteDefinition=V,T.footnoteCall=q,T.reference=j,y.interruptFootnoteDefinition=x,j.locator=I.locator,q.locator=$,J.locator=U;function V(R,P,G){for(var W=this,Y=W.interruptFootnoteDefinition,K=W.offset,eu=P.length+1,H=0,Q=[],lu,Du,uu,_,X,pu,yu,hu,Fu,nu,du,tu,Z;H<eu&&(_=P.charCodeAt(H),!(_!==t&&_!==r));)H++;if(P.charCodeAt(H++)===o&&P.charCodeAt(H++)===D){for(Du=H;H<eu;){if(_=P.charCodeAt(H),_!==_||_===n||_===t||_===r)return;if(_===l){uu=H,H++;break}H++}if(!(uu===void 0||Du===uu||P.charCodeAt(H++)!==a)){if(G)return!0;for(lu=P.slice(Du,uu),X=R.now(),Fu=0,nu=0,du=H,tu=[];H<eu;){if(_=P.charCodeAt(H),_!==_||_===n)Z={start:Fu,contentStart:du||H,contentEnd:H,end:H},tu.push(Z),_===n&&(Fu=H+1,nu=0,du=void 0,Z.end=Fu);else if(nu!==void 0)if(_===r||_===t)nu+=_===r?1:f-nu%f,nu>f&&(nu=void 0,du=H);else{if(nu<f&&Z&&(Z.contentStart===Z.contentEnd||m(Y,w,W,[R,P.slice(H,h),!0])))break;nu=void 0,du=H}H++}for(H=-1,eu=tu.length;eu>0&&(Z=tu[eu-1],Z.contentStart===Z.contentEnd);)eu--;for(pu=R(P.slice(0,Z.contentEnd));++H<eu;)Z=tu[H],K[X.line+H]=(K[X.line+H]||0)+(Z.contentStart-Z.start),Q.push(P.slice(Z.contentStart,Z.end));return yu=W.enterBlock(),hu=W.tokenizeBlock(Q.join(""),X),yu(),pu({type:"footnoteDefinition",identifier:lu.toLowerCase(),label:lu,children:hu})}}}function q(R,P,G){var W=P.length+1,Y=0,K,eu,H,Q;if(P.charCodeAt(Y++)===o&&P.charCodeAt(Y++)===D){for(eu=Y;Y<W;){if(Q=P.charCodeAt(Y),Q!==Q||Q===n||Q===t||Q===r)return;if(Q===l){H=Y,Y++;break}Y++}if(!(H===void 0||eu===H))return G?!0:(K=P.slice(eu,H),R(P.slice(0,Y))({type:"footnoteReference",identifier:K.toLowerCase(),label:K}))}}function J(R,P,G){var W=this,Y=P.length+1,K=0,eu=0,H,Q,lu,Du,uu,_,X;if(P.charCodeAt(K++)===D&&P.charCodeAt(K++)===o){for(lu=K;K<Y;){if(Q=P.charCodeAt(K),Q!==Q)return;if(_===void 0)if(Q===s)K+=2;else if(Q===o)eu++,K++;else if(Q===l)if(eu===0){Du=K,K++;break}else eu--,K++;else if(Q===c){for(uu=K,_=1;P.charCodeAt(uu+_)===c;)_++;K+=_}else K++;else if(Q===c){for(uu=K,X=1;P.charCodeAt(uu+X)===c;)X++;K+=X,_===X&&(_=void 0),X=void 0}else K++}if(Du!==void 0)return G?!0:(H=R.now(),H.column+=2,H.offset+=2,R(P.slice(0,K))({type:"footnote",children:W.tokenizeInline(P.slice(lu,Du),H)}))}}function j(R,P,G){var W=0;if(P.charCodeAt(W)===i&&W++,P.charCodeAt(W)===o&&P.charCodeAt(W+1)!==D)return I.call(this,R,P,G)}function O(R,P,G){for(var W=0,Y=P.charCodeAt(W);Y===r||Y===t;)Y=P.charCodeAt(++W);if(Y===o&&P.charCodeAt(W+1)!==D)return L.call(this,R,P,G)}function $(R,P){return R.indexOf("[",P)}function U(R,P){return R.indexOf("^[",P)}}function F(d){var C=d.prototype.visitors,g=" ";C.footnote=y,C.footnoteReference=w,C.footnoteDefinition=T;function y(b){return"^["+this.all(b).join("")+"]"}function w(b){return"[^"+(b.label||b.identifier)+"]"}function T(b){for(var k=this.all(b).join(`
2
+ import"./chunk-7xm75w1e.js";var{create:tr,defineProperty:Pe,getOwnPropertyDescriptor:rr,getOwnPropertyNames:nr,getPrototypeOf:ir}=Object,or=Object.prototype.hasOwnProperty,vt=(u)=>{throw TypeError(u)},N=(u,e)=>()=>(e||u((e={exports:{}}).exports,e),e.exports),xt=(u,e)=>{for(var t in e)Pe(u,t,{get:e[t],enumerable:!0})},ar=(u,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of nr(e))!or.call(u,r)&&r!==t&&Pe(u,r,{get:()=>e[r],enumerable:!(n=rr(e,r))||n.enumerable});return u},Uu=(u,e,t)=>(t=u!=null?tr(ir(u)):{},ar(e||!u||!u.__esModule?Pe(t,"default",{value:u,enumerable:!0}):t,u)),Bt=(u,e,t)=>e.has(u)||vt("Cannot "+t),ku=(u,e,t)=>(Bt(u,e,"read from private field"),t?t.call(u):e.get(u)),sr=(u,e,t)=>e.has(u)?vt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(u):e.set(u,t),Dr=(u,e,t,n)=>(Bt(u,e,"write to private field"),n?n.call(u,t):e.set(u,t),t),je=N((u,e)=>{e.exports=t;function t(n){return String(n).replace(/\s+/g," ")}}),lr=N((u,e)=>{e.exports=p;var t=9,n=10,r=32,i=33,a=58,o=91,s=92,l=93,D=94,c=96,f=4,h=1024;function p(d){var C=this.Parser,g=this.Compiler;E(C)&&v(C,d),A(g)&&F(g)}function E(d){return!!(d&&d.prototype&&d.prototype.blockTokenizers)}function A(d){return!!(d&&d.prototype&&d.prototype.visitors)}function v(d,C){for(var g=C||{},y=d.prototype,w=y.blockTokenizers,T=y.inlineTokenizers,b=y.blockMethods,k=y.inlineMethods,L=w.definition,I=T.reference,x=[],S=-1,M=b.length,z;++S<M;)z=b[S],!(z==="newline"||z==="indentedCode"||z==="paragraph"||z==="footnoteDefinition")&&x.push([z]);x.push(["footnoteDefinition"]),g.inlineNotes&&(B(k,"reference","inlineNote"),T.inlineNote=J),B(b,"definition","footnoteDefinition"),B(k,"reference","footnoteCall"),w.definition=O,w.footnoteDefinition=V,T.footnoteCall=q,T.reference=j,y.interruptFootnoteDefinition=x,j.locator=I.locator,q.locator=$,J.locator=U;function V(R,P,G){for(var W=this,Y=W.interruptFootnoteDefinition,K=W.offset,eu=P.length+1,H=0,Q=[],lu,Du,uu,_,X,pu,yu,hu,Fu,nu,du,tu,Z;H<eu&&(_=P.charCodeAt(H),!(_!==t&&_!==r));)H++;if(P.charCodeAt(H++)===o&&P.charCodeAt(H++)===D){for(Du=H;H<eu;){if(_=P.charCodeAt(H),_!==_||_===n||_===t||_===r)return;if(_===l){uu=H,H++;break}H++}if(!(uu===void 0||Du===uu||P.charCodeAt(H++)!==a)){if(G)return!0;for(lu=P.slice(Du,uu),X=R.now(),Fu=0,nu=0,du=H,tu=[];H<eu;){if(_=P.charCodeAt(H),_!==_||_===n)Z={start:Fu,contentStart:du||H,contentEnd:H,end:H},tu.push(Z),_===n&&(Fu=H+1,nu=0,du=void 0,Z.end=Fu);else if(nu!==void 0)if(_===r||_===t)nu+=_===r?1:f-nu%f,nu>f&&(nu=void 0,du=H);else{if(nu<f&&Z&&(Z.contentStart===Z.contentEnd||m(Y,w,W,[R,P.slice(H,h),!0])))break;nu=void 0,du=H}H++}for(H=-1,eu=tu.length;eu>0&&(Z=tu[eu-1],Z.contentStart===Z.contentEnd);)eu--;for(pu=R(P.slice(0,Z.contentEnd));++H<eu;)Z=tu[H],K[X.line+H]=(K[X.line+H]||0)+(Z.contentStart-Z.start),Q.push(P.slice(Z.contentStart,Z.end));return yu=W.enterBlock(),hu=W.tokenizeBlock(Q.join(""),X),yu(),pu({type:"footnoteDefinition",identifier:lu.toLowerCase(),label:lu,children:hu})}}}function q(R,P,G){var W=P.length+1,Y=0,K,eu,H,Q;if(P.charCodeAt(Y++)===o&&P.charCodeAt(Y++)===D){for(eu=Y;Y<W;){if(Q=P.charCodeAt(Y),Q!==Q||Q===n||Q===t||Q===r)return;if(Q===l){H=Y,Y++;break}Y++}if(!(H===void 0||eu===H))return G?!0:(K=P.slice(eu,H),R(P.slice(0,Y))({type:"footnoteReference",identifier:K.toLowerCase(),label:K}))}}function J(R,P,G){var W=this,Y=P.length+1,K=0,eu=0,H,Q,lu,Du,uu,_,X;if(P.charCodeAt(K++)===D&&P.charCodeAt(K++)===o){for(lu=K;K<Y;){if(Q=P.charCodeAt(K),Q!==Q)return;if(_===void 0)if(Q===s)K+=2;else if(Q===o)eu++,K++;else if(Q===l)if(eu===0){Du=K,K++;break}else eu--,K++;else if(Q===c){for(uu=K,_=1;P.charCodeAt(uu+_)===c;)_++;K+=_}else K++;else if(Q===c){for(uu=K,X=1;P.charCodeAt(uu+X)===c;)X++;K+=X,_===X&&(_=void 0),X=void 0}else K++}if(Du!==void 0)return G?!0:(H=R.now(),H.column+=2,H.offset+=2,R(P.slice(0,K))({type:"footnote",children:W.tokenizeInline(P.slice(lu,Du),H)}))}}function j(R,P,G){var W=0;if(P.charCodeAt(W)===i&&W++,P.charCodeAt(W)===o&&P.charCodeAt(W+1)!==D)return I.call(this,R,P,G)}function O(R,P,G){for(var W=0,Y=P.charCodeAt(W);Y===r||Y===t;)Y=P.charCodeAt(++W);if(Y===o&&P.charCodeAt(W+1)!==D)return L.call(this,R,P,G)}function $(R,P){return R.indexOf("[",P)}function U(R,P){return R.indexOf("^[",P)}}function F(d){var C=d.prototype.visitors,g=" ";C.footnote=y,C.footnoteReference=w,C.footnoteDefinition=T;function y(b){return"^["+this.all(b).join("")+"]"}function w(b){return"[^"+(b.label||b.identifier)+"]"}function T(b){for(var k=this.all(b).join(`
3
3
 
4
4
  `).split(`
5
5
  `),L=0,I=k.length,x;++L<I;)x=k[L],x!==""&&(k[L]=g+x);return"[^"+(b.label||b.identifier)+"]: "+k.join(`
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$d as a}from"./chunk-js1n8tgv.js";import"./chunk-70ck4v3t.js";import"./chunk-ht5w06x7.js";import"./chunk-enpzvmtc.js";import"./chunk-tq0239xp.js";import"./chunk-7xm75w1e.js";export{a as fromHttp};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-7xm75w1e.js";var a="./highlights-x6tmsnaa.scm";export{a as default};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ig as t}from"./chunk-xvwvd4kq.js";import{FO as o}from"./chunk-7xm75w1e.js";async function e(){try{let{toJSONSchema:r}=await import("./chunk-yjf3kyej.js");return r}catch{throw new t("sury")}}export{e as default};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ud as a,vd as b}from"./chunk-eh7e49k4.js";import"./chunk-2hc5z7b5.js";import"./chunk-tqj69nh6.js";import"./chunk-ag8kz1e7.js";import"./chunk-gagtmjmp.js";import"./chunk-zs8kqdsf.js";import"./chunk-7xm75w1e.js";export{a as read,b as copy};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{aQ as I,dQ as Z}from"./chunk-aztre27e.js";var x=I((r0,u)=>{u.exports=v;v.sync=K0;var N=Z("fs");function T0(q,L){var $=L.pathExt!==void 0?L.pathExt:process.env.PATHEXT;if(!$)return!0;if($=$.split(";"),$.indexOf("")!==-1)return!0;for(var G=0;G<$.length;G++){var H=$[G].toLowerCase();if(H&&q.substr(-H.length).toLowerCase()===H)return!0}return!1}function R(q,L,$){if(!q.isSymbolicLink()&&!q.isFile())return!1;return T0(L,$)}function v(q,L,$){N.stat(q,function(G,H){$(G,G?!1:R(H,q,L))})}function K0(q,L){return R(N.statSync(q),q,L)}});var g=I((o0,E)=>{E.exports=b;b.sync=f0;var C=Z("fs");function b(q,L,$){C.stat(q,function(G,H){$(G,G?!1:w(H,L))})}function f0(q,L){return w(C.statSync(q),L)}function w(q,L){return q.isFile()&&A0(q,L)}function A0(q,L){var{mode:$,uid:G,gid:H}=q,X=L.uid!==void 0?L.uid:process.getuid&&process.getuid(),k=L.gid!==void 0?L.gid:process.getgid&&process.getgid(),J=parseInt("100",8),Y=parseInt("010",8),B=parseInt("001",8),V=J|Y,Q=$&B||$&Y&&H===k||$&J&&G===X||$&V&&X===0;return Q}});var h=I((s0,c)=>{var p0=Z("fs"),K;if(process.platform==="win32"||global.TESTING_WINDOWS)K=x();else K=g();c.exports=A;A.sync=D0;function A(q,L,$){if(typeof L==="function")$=L,L={};if(!$){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(G,H){A(q,L||{},function(X,k){if(X)H(X);else G(k)})})}K(q,L||{},function(G,H){if(G){if(G.code==="EACCES"||L&&L.ignoreErrors)G=null,H=!1}$(G,H)})}function D0(q,L){try{return K.sync(q,L||{})}catch($){if(L&&L.ignoreErrors||$.code==="EACCES")return!1;else throw $}}});var r=I((a0,d)=>{var _=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",l=Z("path"),F0=_?";":":",m=h(),n=(q)=>Object.assign(Error(`not found: ${q}`),{code:"ENOENT"}),i=(q,L)=>{let $=L.colon||F0,G=q.match(/\//)||_&&q.match(/\\/)?[""]:[..._?[process.cwd()]:[],...(L.path||process.env.PATH||"").split($)],H=_?L.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",X=_?H.split($):[""];if(_){if(q.indexOf(".")!==-1&&X[0]!=="")X.unshift("")}return{pathEnv:G,pathExt:X,pathExtExe:H}},t=(q,L,$)=>{if(typeof L==="function")$=L,L={};if(!L)L={};let{pathEnv:G,pathExt:H,pathExtExe:X}=i(q,L),k=[],J=(B)=>new Promise((V,Q)=>{if(B===G.length)return L.all&&k.length?V(k):Q(n(q));let U=G[B],T=/^".*"$/.test(U)?U.slice(1,-1):U,z=l.join(T,q),f=!T&&/^\.[\\\/]/.test(q)?q.slice(0,2)+z:z;V(Y(f,B,0))}),Y=(B,V,Q)=>new Promise((U,T)=>{if(Q===H.length)return U(J(V+1));let z=H[Q];m(B+z,{pathExt:X},(f,M0)=>{if(!f&&M0)if(L.all)k.push(B+z);else return U(B+z);return U(Y(B,V,Q+1))})});return $?J(0).then((B)=>$(null,B),$):J(0)},O0=(q,L)=>{L=L||{};let{pathEnv:$,pathExt:G,pathExtExe:H}=i(q,L),X=[];for(let k=0;k<$.length;k++){let J=$[k],Y=/^".*"$/.test(J)?J.slice(1,-1):J,B=l.join(Y,q),V=!Y&&/^\.[\\\/]/.test(q)?q.slice(0,2)+B:B;for(let Q=0;Q<G.length;Q++){let U=V+G[Q];try{if(m.sync(U,{pathExt:H}))if(L.all)X.push(U);else return U}catch(T){}}}if(L.all&&X.length)return X;if(L.nothrow)return null;throw n(q)};d.exports=t;t.sync=O0});var p=I((e0,D)=>{var o=(q={})=>{let L=q.env||process.env;if((q.platform||process.platform)!=="win32")return"PATH";return Object.keys(L).reverse().find((G)=>G.toUpperCase()==="PATH")||"Path"};D.exports=o;D.exports.default=o});var q0=I((qq,e)=>{var s=Z("path"),P0=r(),S0=p();function a(q,L){let $=q.options.env||process.env,G=process.cwd(),H=q.options.cwd!=null,X=H&&process.chdir!==void 0&&!process.chdir.disabled;if(X)try{process.chdir(q.options.cwd)}catch(J){}let k;try{k=P0.sync(q.command,{path:$[S0({env:$})],pathExt:L?s.delimiter:void 0})}catch(J){}finally{if(X)process.chdir(G)}if(k)k=s.resolve(H?q.options.cwd:"",k);return k}function j0(q){return a(q)||a(q,!0)}e.exports=j0});var L0=I((N0,O)=>{var F=/([()\][%!^"`<>&|;, *?])/g;function W0(q){return q=q.replace(F,"^$1"),q}function y0(q,L){if(q=`${q}`,q=q.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),q=q.replace(/(?=(\\+?)?)\1$/,"$1$1"),q=`"${q}"`,q=q.replace(F,"^$1"),L)q=q.replace(F,"^$1");return q}N0.command=W0;N0.argument=y0});var G0=I((Lq,$0)=>{$0.exports=/^#!(.*)/});var X0=I(($q,H0)=>{var u0=G0();H0.exports=(q="")=>{let L=q.match(u0);if(!L)return null;let[$,G]=L[0].replace(/#! ?/,"").split(" "),H=$.split("/").pop();if(H==="env")return G;return G?`${H} ${G}`:H}});var B0=I((Gq,k0)=>{var P=Z("fs"),x0=X0();function C0(q){let $=Buffer.alloc(150),G;try{G=P.openSync(q,"r"),P.readSync(G,$,0,150,0),P.closeSync(G)}catch(H){}return x0($.toString())}k0.exports=C0});var U0=I((Hq,Q0)=>{var b0=Z("path"),I0=q0(),J0=L0(),w0=B0(),E0=process.platform==="win32",g0=/\.(?:com|exe)$/i,c0=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function h0(q){q.file=I0(q);let L=q.file&&w0(q.file);if(L)return q.args.unshift(q.file),q.command=L,I0(q);return q.file}function l0(q){if(!E0)return q;let L=h0(q),$=!g0.test(L);if(q.options.forceShell||$){let G=c0.test(L);q.command=b0.normalize(q.command),q.command=J0.command(q.command),q.args=q.args.map((X)=>J0.argument(X,G));let H=[q.command].concat(q.args).join(" ");q.args=["/d","/s","/c",`"${H}"`],q.command=process.env.comspec||"cmd.exe",q.options.windowsVerbatimArguments=!0}return q}function m0(q,L,$){if(L&&!Array.isArray(L))$=L,L=null;L=L?L.slice(0):[],$=Object.assign({},$);let G={command:q,args:L,options:$,file:void 0,original:{command:q,args:L}};return $.shell?G:l0(G)}Q0.exports=m0});var Z0=I((Xq,Y0)=>{var S=process.platform==="win32";function j(q,L){return Object.assign(Error(`${L} ${q.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${L} ${q.command}`,path:q.command,spawnargs:q.args})}function n0(q,L){if(!S)return;let $=q.emit;q.emit=function(G,H){if(G==="exit"){let X=V0(H,L);if(X)return $.call(q,"error",X)}return $.apply(q,arguments)}}function V0(q,L){if(S&&q===1&&!L.file)return j(L.original,"spawn");return null}function i0(q,L){if(S&&q===1&&!L.file)return j(L.original,"spawnSync");return null}Y0.exports={hookChildProcess:n0,verifyENOENT:V0,verifyENOENTSync:i0,notFoundError:j}});var d0=I((kq,M)=>{var z0=Z("child_process"),W=U0(),y=Z0();function _0(q,L,$){let G=W(q,L,$),H=z0.spawn(G.command,G.args,G.options);return y.hookChildProcess(H,G),H}function t0(q,L,$){let G=W(q,L,$),H=z0.spawnSync(G.command,G.args,G.options);return H.error=H.error||y.verifyENOENTSync(H.status,G),H}M.exports=_0;M.exports.spawn=_0;M.exports.sync=t0;M.exports._parse=W;M.exports._enoent=y});
3
- export{d0 as Tu};
2
+ import{CO as I,FO as Z}from"./chunk-7xm75w1e.js";var x=I((r0,u)=>{u.exports=v;v.sync=K0;var N=Z("fs");function T0(q,L){var $=L.pathExt!==void 0?L.pathExt:process.env.PATHEXT;if(!$)return!0;if($=$.split(";"),$.indexOf("")!==-1)return!0;for(var G=0;G<$.length;G++){var H=$[G].toLowerCase();if(H&&q.substr(-H.length).toLowerCase()===H)return!0}return!1}function R(q,L,$){if(!q.isSymbolicLink()&&!q.isFile())return!1;return T0(L,$)}function v(q,L,$){N.stat(q,function(G,H){$(G,G?!1:R(H,q,L))})}function K0(q,L){return R(N.statSync(q),q,L)}});var g=I((o0,E)=>{E.exports=b;b.sync=f0;var C=Z("fs");function b(q,L,$){C.stat(q,function(G,H){$(G,G?!1:w(H,L))})}function f0(q,L){return w(C.statSync(q),L)}function w(q,L){return q.isFile()&&A0(q,L)}function A0(q,L){var{mode:$,uid:G,gid:H}=q,X=L.uid!==void 0?L.uid:process.getuid&&process.getuid(),k=L.gid!==void 0?L.gid:process.getgid&&process.getgid(),J=parseInt("100",8),Y=parseInt("010",8),B=parseInt("001",8),V=J|Y,Q=$&B||$&Y&&H===k||$&J&&G===X||$&V&&X===0;return Q}});var h=I((s0,c)=>{var p0=Z("fs"),K;if(process.platform==="win32"||global.TESTING_WINDOWS)K=x();else K=g();c.exports=A;A.sync=D0;function A(q,L,$){if(typeof L==="function")$=L,L={};if(!$){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(G,H){A(q,L||{},function(X,k){if(X)H(X);else G(k)})})}K(q,L||{},function(G,H){if(G){if(G.code==="EACCES"||L&&L.ignoreErrors)G=null,H=!1}$(G,H)})}function D0(q,L){try{return K.sync(q,L||{})}catch($){if(L&&L.ignoreErrors||$.code==="EACCES")return!1;else throw $}}});var r=I((a0,d)=>{var _=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",l=Z("path"),F0=_?";":":",m=h(),n=(q)=>Object.assign(Error(`not found: ${q}`),{code:"ENOENT"}),i=(q,L)=>{let $=L.colon||F0,G=q.match(/\//)||_&&q.match(/\\/)?[""]:[..._?[process.cwd()]:[],...(L.path||process.env.PATH||"").split($)],H=_?L.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",X=_?H.split($):[""];if(_){if(q.indexOf(".")!==-1&&X[0]!=="")X.unshift("")}return{pathEnv:G,pathExt:X,pathExtExe:H}},t=(q,L,$)=>{if(typeof L==="function")$=L,L={};if(!L)L={};let{pathEnv:G,pathExt:H,pathExtExe:X}=i(q,L),k=[],J=(B)=>new Promise((V,Q)=>{if(B===G.length)return L.all&&k.length?V(k):Q(n(q));let U=G[B],T=/^".*"$/.test(U)?U.slice(1,-1):U,z=l.join(T,q),f=!T&&/^\.[\\\/]/.test(q)?q.slice(0,2)+z:z;V(Y(f,B,0))}),Y=(B,V,Q)=>new Promise((U,T)=>{if(Q===H.length)return U(J(V+1));let z=H[Q];m(B+z,{pathExt:X},(f,M0)=>{if(!f&&M0)if(L.all)k.push(B+z);else return U(B+z);return U(Y(B,V,Q+1))})});return $?J(0).then((B)=>$(null,B),$):J(0)},O0=(q,L)=>{L=L||{};let{pathEnv:$,pathExt:G,pathExtExe:H}=i(q,L),X=[];for(let k=0;k<$.length;k++){let J=$[k],Y=/^".*"$/.test(J)?J.slice(1,-1):J,B=l.join(Y,q),V=!Y&&/^\.[\\\/]/.test(q)?q.slice(0,2)+B:B;for(let Q=0;Q<G.length;Q++){let U=V+G[Q];try{if(m.sync(U,{pathExt:H}))if(L.all)X.push(U);else return U}catch(T){}}}if(L.all&&X.length)return X;if(L.nothrow)return null;throw n(q)};d.exports=t;t.sync=O0});var p=I((e0,D)=>{var o=(q={})=>{let L=q.env||process.env;if((q.platform||process.platform)!=="win32")return"PATH";return Object.keys(L).reverse().find((G)=>G.toUpperCase()==="PATH")||"Path"};D.exports=o;D.exports.default=o});var q0=I((qq,e)=>{var s=Z("path"),P0=r(),S0=p();function a(q,L){let $=q.options.env||process.env,G=process.cwd(),H=q.options.cwd!=null,X=H&&process.chdir!==void 0&&!process.chdir.disabled;if(X)try{process.chdir(q.options.cwd)}catch(J){}let k;try{k=P0.sync(q.command,{path:$[S0({env:$})],pathExt:L?s.delimiter:void 0})}catch(J){}finally{if(X)process.chdir(G)}if(k)k=s.resolve(H?q.options.cwd:"",k);return k}function j0(q){return a(q)||a(q,!0)}e.exports=j0});var L0=I((N0,O)=>{var F=/([()\][%!^"`<>&|;, *?])/g;function W0(q){return q=q.replace(F,"^$1"),q}function y0(q,L){if(q=`${q}`,q=q.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),q=q.replace(/(?=(\\+?)?)\1$/,"$1$1"),q=`"${q}"`,q=q.replace(F,"^$1"),L)q=q.replace(F,"^$1");return q}N0.command=W0;N0.argument=y0});var G0=I((Lq,$0)=>{$0.exports=/^#!(.*)/});var X0=I(($q,H0)=>{var u0=G0();H0.exports=(q="")=>{let L=q.match(u0);if(!L)return null;let[$,G]=L[0].replace(/#! ?/,"").split(" "),H=$.split("/").pop();if(H==="env")return G;return G?`${H} ${G}`:H}});var B0=I((Gq,k0)=>{var P=Z("fs"),x0=X0();function C0(q){let $=Buffer.alloc(150),G;try{G=P.openSync(q,"r"),P.readSync(G,$,0,150,0),P.closeSync(G)}catch(H){}return x0($.toString())}k0.exports=C0});var U0=I((Hq,Q0)=>{var b0=Z("path"),I0=q0(),J0=L0(),w0=B0(),E0=process.platform==="win32",g0=/\.(?:com|exe)$/i,c0=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function h0(q){q.file=I0(q);let L=q.file&&w0(q.file);if(L)return q.args.unshift(q.file),q.command=L,I0(q);return q.file}function l0(q){if(!E0)return q;let L=h0(q),$=!g0.test(L);if(q.options.forceShell||$){let G=c0.test(L);q.command=b0.normalize(q.command),q.command=J0.command(q.command),q.args=q.args.map((X)=>J0.argument(X,G));let H=[q.command].concat(q.args).join(" ");q.args=["/d","/s","/c",`"${H}"`],q.command=process.env.comspec||"cmd.exe",q.options.windowsVerbatimArguments=!0}return q}function m0(q,L,$){if(L&&!Array.isArray(L))$=L,L=null;L=L?L.slice(0):[],$=Object.assign({},$);let G={command:q,args:L,options:$,file:void 0,original:{command:q,args:L}};return $.shell?G:l0(G)}Q0.exports=m0});var Z0=I((Xq,Y0)=>{var S=process.platform==="win32";function j(q,L){return Object.assign(Error(`${L} ${q.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${L} ${q.command}`,path:q.command,spawnargs:q.args})}function n0(q,L){if(!S)return;let $=q.emit;q.emit=function(G,H){if(G==="exit"){let X=V0(H,L);if(X)return $.call(q,"error",X)}return $.apply(q,arguments)}}function V0(q,L){if(S&&q===1&&!L.file)return j(L.original,"spawn");return null}function i0(q,L){if(S&&q===1&&!L.file)return j(L.original,"spawnSync");return null}Y0.exports={hookChildProcess:n0,verifyENOENT:V0,verifyENOENTSync:i0,notFoundError:j}});var d0=I((kq,M)=>{var z0=Z("child_process"),W=U0(),y=Z0();function _0(q,L,$){let G=W(q,L,$),H=z0.spawn(G.command,G.args,G.options);return y.hookChildProcess(H,G),H}function t0(q,L,$){let G=W(q,L,$),H=z0.spawnSync(G.command,G.args,G.options);return H.error=H.error||y.verifyENOENTSync(H.status,G),H}M.exports=_0;M.exports.spawn=_0;M.exports.sync=t0;M.exports._parse=W;M.exports._enoent=y});
3
+ export{d0 as tt};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Id as q,Jd as K,Kd as D,Nd as L,Od as N}from"./chunk-p62gb4wj.js";import"./chunk-x4sp99g6.js";import{Vf as B}from"./chunk-rbk8seme.js";import{gh as G}from"./chunk-fq0x3esz.js";import"./chunk-44a82dg0.js";import"./chunk-vxyy2dp3.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-5hw6xa49.js";import"./chunk-326p5b10.js";import"./chunk-04n2ycg5.js";import{Fl as C}from"./chunk-8ymffyep.js";import"./chunk-mcg24gkb.js";import"./chunk-redjxn13.js";import"./chunk-bn0h9dny.js";import"./chunk-r4ndwym0.js";import"./chunk-3ytjm3az.js";import"./chunk-htz93dsd.js";import"./chunk-vcw00k0n.js";import"./chunk-r78czx4d.js";import"./chunk-2hc5z7b5.js";import"./chunk-d68fzyw7.js";import"./chunk-4jtxtkj7.js";import"./chunk-ay8emwym.js";import"./chunk-2maqde7w.js";import"./chunk-kj20f048.js";import"./chunk-cqtkxwd8.js";import"./chunk-x9rbv6p6.js";import"./chunk-g5rabwre.js";import"./chunk-jbx3s7nw.js";import"./chunk-15hw2z9t.js";import"./chunk-48ge2ryx.js";import"./chunk-n9xns8by.js";import"./chunk-y9q0hb7b.js";import"./chunk-c1bdzxbx.js";import"./chunk-ehhas0ew.js";import"./chunk-d6ry9418.js";import"./chunk-0dt0bxz6.js";import"./chunk-10bjs581.js";import"./chunk-4cnwn1rh.js";import"./chunk-gcw4rn10.js";import{Vr as J}from"./chunk-m5m448mg.js";import"./chunk-tqj69nh6.js";import"./chunk-ag8kz1e7.js";import"./chunk-5tray1fw.js";import"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-gagtmjmp.js";import"./chunk-zs8kqdsf.js";import"./chunk-dxpj0cxh.js";import"./chunk-zw815d68.js";import"./chunk-7xm75w1e.js";var X={command:"upgrade [target]",describe:"upgrade qitqode to the latest or a specific version",builder:(z)=>{return z.positional("target",{describe:"version to upgrade to, for ex '0.1.48' or 'v0.1.48'",type:"string"}).option("method",{alias:"m",describe:"installation method to use",type:"string",choices:["curl","npm","pnpm","bun","brew","choco","scoop"]})},handler:async(z)=>{B.empty(),B.println(B.logo(" ")),B.empty(),K("Upgrade");let O=await G.runPromise(C.Service.use((j)=>j.method())),E=z.method??O;if(E==="unknown"){if(q.error(`qitqode is installed to ${process.execPath} and may be managed by a package manager`),!await N({message:"Install anyways?",options:[{label:"Yes",value:!0},{label:"No",value:!1}],initialValue:!1})){D("Done");return}}q.info("Using method: "+E);let F=z.target?z.target.replace(/^v/,""):await G.runPromise(C.Service.use((j)=>j.latest()));if(J===F){q.warn(`qitqode upgrade skipped: ${F} is already installed`),D("Done");return}q.info(`From ${J} \u2192 ${F}`);let H=L();H.start("Upgrading...");let x=await G.runPromise(C.Service.use((j)=>j.upgrade(E,F))).catch((j)=>j);if(x){if(H.stop("Upgrade failed",1),x instanceof C.UpgradeFailedError)if(E==="choco"&&x.stderr.includes("not running from an elevated command shell"))q.error("Please run the terminal as Administrator and try again");else q.error(x.stderr);else if(x instanceof Error)q.error(x.message);D("Done");return}H.stop("Upgrade complete"),D("Done")}};export{X as UpgradeCommand};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{lq as a}from"./chunk-g5rabwre.js";import"./chunk-7xm75w1e.js";export default a();
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-7xm75w1e.js";var L="./libopentui-430t0qv0.dylib";export{L as default};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  class M extends Error{name="BackendCallError";status;fn;constructor(j,x,I){super(`backend function call failed (${j}): ${x}${I?` ${I}`:""}`);this.status=j,this.fn=x}}class N extends Error{name="BackendAuthError";status;constructor(j,x){super(`backend authentication rejected (${j})${x?`: ${x}`:""}`);this.status=j}}function Q(j){if(!j)return!1;try{let x=JSON.parse(j);if(x&&x.code==="ERR_GATEWAY_REQUIRED")return!0}catch{}return j.includes("ERR_GATEWAY_REQUIRED")}function S(j){let x=j.fetch??fetch,I=j.baseUrl.replace(/\/+$/,"");async function z(D,P={}){let L=new Headers(j.headers);L.set("content-type","application/json");let H=await x(`${I}/${D}`,{method:"POST",headers:L,body:JSON.stringify(P)});if(!H.ok){let K=await H.text().catch(()=>"");if((H.status===401||H.status===403)&&!Q(K))throw new N(H.status,K||void 0);throw new M(H.status,D,K||void 0)}let J=await H.json();if(!J.success)throw Error(`backend function call returned failure: ${D} \u2014 ${J.error??"unknown error"}`);return J.data}return{promptNames:()=>z("promptNames"),prompt:(D)=>z("prompt",{name:D}),tiers:()=>z("tiers"),workflowSummaries:()=>z("workflowSummaries"),workflowSpec:(D)=>z("workflowSpec",{name:D}),workflowSpecs:()=>z("workflowSpecs"),bashArity:()=>z("bashArity"),toolManifest:()=>z("toolManifest"),toolDescription:(D)=>z("toolDescription",{id:D})}}
3
- export{M as lq,N as mq,Q as nq,S as oq};
3
+ export{M as No,N as Oo,Q as Po,S as Qo};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{se as a}from"./chunk-tvdmnee6.js";import"./chunk-ht5w06x7.js";import"./chunk-enpzvmtc.js";import"./chunk-tq0239xp.js";import"./chunk-7xm75w1e.js";export{a as fromProcess};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{if as a}from"./chunk-8n20thvd.js";import"./chunk-7xm75w1e.js";export default a();
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Dq as wQ,Fq as QQ,Kq as JV,Mq as FQ,Oq as KV,Pq as SV,Rq as PV,Sq as D,Vq as F,Wq as t,Yq as BV,_q as qQ,ar as VQ,br as WQ,cr as xQ,fr as EV,gr as a,ir as UV,jr as BQ,kr as $Q,lr as AV,or as xV,pq as l,qq as zV,uq as UQ,wq as JQ,yq as GV}from"./chunk-yq3m8190.js";import{Br as jV,Dr as YQ,rr as ZV,vr as $V,wr as AQ}from"./chunk-btz9jvec.js";import"./chunk-cqtkxwd8.js";import"./chunk-fkgv2hqd.js";import{qv as Q}from"./chunk-09kba1hg.js";import"./chunk-t12xrrfr.js";import"./chunk-aztre27e.js";var HQ=Q.object({error:Q.object({message:Q.string(),type:Q.string().nullish(),param:Q.any().nullish(),code:Q.union([Q.string(),Q.number()]).nullish()})}),zQ=UV({errorSchema:HQ,errorToMessage:(V)=>V.error.message});function LV(V){let Y=V.startsWith("o3")||V.startsWith("o4-mini")||V.startsWith("gpt-5")&&!V.startsWith("gpt-5-chat"),J=V.startsWith("gpt-4")||V.startsWith("gpt-5")&&!V.startsWith("gpt-5-nano")&&!V.startsWith("gpt-5-chat")&&!V.startsWith("gpt-5.4-nano")||V.startsWith("o3")||V.startsWith("o4-mini"),G=V.startsWith("o1")||V.startsWith("o3")||V.startsWith("o4-mini")||V.startsWith("gpt-5")&&!V.startsWith("gpt-5-chat"),j=V.startsWith("gpt-5.1")||V.startsWith("gpt-5.2")||V.startsWith("gpt-5.3")||V.startsWith("gpt-5.4");return{supportsFlexProcessing:Y,supportsPriorityProcessing:J,isReasoningModel:G,systemMessageMode:G?"developer":"system",supportsNonReasoningParameters:j}}function cQ(V){var Y,J,G,j,E,P;if(V==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let $=(Y=V.prompt_tokens)!=null?Y:0,A=(J=V.completion_tokens)!=null?J:0,O=(j=(G=V.prompt_tokens_details)==null?void 0:G.cached_tokens)!=null?j:0,K=(P=(E=V.completion_tokens_details)==null?void 0:E.reasoning_tokens)!=null?P:0;return{inputTokens:{total:$,noCache:$-O,cacheRead:O,cacheWrite:void 0},outputTokens:{total:A,text:A-K,reasoning:K},raw:V}}function HV(V){return JSON.stringify(V===void 0?{}:V)}function MV({prompt:V,systemMessageMode:Y="system"}){var J;let G=[],j=[];for(let{role:E,content:P}of V)switch(E){case"system":{switch(Y){case"system":{G.push({role:"system",content:P});break}case"developer":{G.push({role:"developer",content:P});break}case"remove":{j.push({type:"other",message:"system messages are removed for this model"});break}default:throw Error(`Unsupported system message mode: ${Y}`)}break}case"user":{if(P.length===1&&P[0].type==="text"){G.push({role:"user",content:P[0].text});break}G.push({role:"user",content:P.map(($,A)=>{var O,K,Z;switch($.type){case"text":return{type:"text",text:$.text};case"file":if($.mediaType.startsWith("image/")){let q=$.mediaType==="image/*"?"image/jpeg":$.mediaType;return{type:"image_url",image_url:{url:$.data instanceof URL?$.data.toString():`data:${q};base64,${JQ($.data)}`,detail:(K=(O=$.providerOptions)==null?void 0:O.openai)==null?void 0:K.imageDetail}}}else if($.mediaType.startsWith("audio/")){if($.data instanceof URL)throw new YQ({functionality:"audio file parts with URLs"});switch($.mediaType){case"audio/wav":return{type:"input_audio",input_audio:{data:JQ($.data),format:"wav"}};case"audio/mp3":case"audio/mpeg":return{type:"input_audio",input_audio:{data:JQ($.data),format:"mp3"}};default:throw new YQ({functionality:`audio content parts with media type ${$.mediaType}`})}}else if($.mediaType==="application/pdf"){if($.data instanceof URL)throw new YQ({functionality:"PDF file parts with URLs"});return{type:"file",file:typeof $.data==="string"&&$.data.startsWith("file-")?{file_id:$.data}:{filename:(Z=$.filename)!=null?Z:`part-${A}.pdf`,file_data:`data:application/pdf;base64,${JQ($.data)}`}}}else throw new YQ({functionality:`file part media type ${$.mediaType}`})}})});break}case"assistant":{let $="",A=[];for(let O of P)switch(O.type){case"text":{$+=O.text;break}case"tool-call":{A.push({id:O.toolCallId,type:"function",function:{name:O.toolName,arguments:HV(O.input)}});break}}G.push({role:"assistant",content:$,tool_calls:A.length>0?A:void 0});break}case"tool":{for(let $ of P){if($.type==="tool-approval-response")continue;let A=$.output,O;switch(A.type){case"text":case"error-text":O=A.value;break;case"execution-denied":O=(J=A.reason)!=null?J:"Tool execution denied.";break;case"content":case"json":case"error-json":O=JSON.stringify(A.value);break}G.push({role:"tool",tool_call_id:$.toolCallId,content:O})}break}default:throw Error(`Unsupported role: ${E}`)}return{messages:G,warnings:j}}function LQ({id:V,model:Y,created:J}){return{id:V!=null?V:void 0,modelId:Y!=null?Y:void 0,timestamp:J?new Date(J*1000):void 0}}function vQ(V){switch(V){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var bV=D(()=>F(Q.object({id:Q.string().nullish(),created:Q.number().nullish(),model:Q.string().nullish(),choices:Q.array(Q.object({message:Q.object({role:Q.literal("assistant").nullish(),content:Q.string().nullish(),tool_calls:Q.array(Q.object({id:Q.string().nullish(),type:Q.literal("function"),function:Q.object({name:Q.string(),arguments:Q.string()})})).nullish(),annotations:Q.array(Q.object({type:Q.literal("url_citation"),url_citation:Q.object({start_index:Q.number(),end_index:Q.number(),url:Q.string(),title:Q.string()})})).nullish()}),index:Q.number(),logprobs:Q.object({content:Q.array(Q.object({token:Q.string(),logprob:Q.number(),top_logprobs:Q.array(Q.object({token:Q.string(),logprob:Q.number()}))})).nullish()}).nullish(),finish_reason:Q.string().nullish()})),usage:Q.object({prompt_tokens:Q.number().nullish(),completion_tokens:Q.number().nullish(),total_tokens:Q.number().nullish(),prompt_tokens_details:Q.object({cached_tokens:Q.number().nullish()}).nullish(),completion_tokens_details:Q.object({reasoning_tokens:Q.number().nullish(),accepted_prediction_tokens:Q.number().nullish(),rejected_prediction_tokens:Q.number().nullish()}).nullish()}).nullish()}))),yV=D(()=>F(Q.union([Q.object({id:Q.string().nullish(),created:Q.number().nullish(),model:Q.string().nullish(),choices:Q.array(Q.object({delta:Q.object({role:Q.enum(["assistant"]).nullish(),content:Q.string().nullish(),tool_calls:Q.array(Q.object({index:Q.number(),id:Q.string().nullish(),type:Q.literal("function").nullish(),function:Q.object({name:Q.string().nullish(),arguments:Q.string().nullish()})})).nullish(),annotations:Q.array(Q.object({type:Q.literal("url_citation"),url_citation:Q.object({start_index:Q.number(),end_index:Q.number(),url:Q.string(),title:Q.string()})})).nullish()}).nullish(),logprobs:Q.object({content:Q.array(Q.object({token:Q.string(),logprob:Q.number(),top_logprobs:Q.array(Q.object({token:Q.string(),logprob:Q.number()}))})).nullish()}).nullish(),finish_reason:Q.string().nullish(),index:Q.number()})),usage:Q.object({prompt_tokens:Q.number().nullish(),completion_tokens:Q.number().nullish(),total_tokens:Q.number().nullish(),prompt_tokens_details:Q.object({cached_tokens:Q.number().nullish()}).nullish(),completion_tokens_details:Q.object({reasoning_tokens:Q.number().nullish(),accepted_prediction_tokens:Q.number().nullish(),rejected_prediction_tokens:Q.number().nullish()}).nullish()}).nullish()}),HQ]))),RV=D(()=>F(Q.object({logitBias:Q.record(Q.coerce.number(),Q.number()).optional(),logprobs:Q.union([Q.boolean(),Q.number()]).optional(),parallelToolCalls:Q.boolean().optional(),user:Q.string().optional(),reasoningEffort:Q.enum(["none","minimal","low","medium","high","xhigh"]).optional(),maxCompletionTokens:Q.number().optional(),store:Q.boolean().optional(),metadata:Q.record(Q.string().max(64),Q.string().max(512)).optional(),prediction:Q.record(Q.string(),Q.any()).optional(),serviceTier:Q.enum(["auto","flex","priority","default"]).optional(),strictJsonSchema:Q.boolean().optional(),textVerbosity:Q.enum(["low","medium","high"]).optional(),promptCacheKey:Q.string().optional(),promptCacheRetention:Q.enum(["in_memory","24h"]).optional(),safetyIdentifier:Q.string().optional(),systemMessageMode:Q.enum(["system","developer","remove"]).optional(),forceReasoning:Q.boolean().optional()})));function kV({tools:V,toolChoice:Y}){V=(V==null?void 0:V.length)?V:void 0;let J=[];if(V==null)return{tools:void 0,toolChoice:void 0,toolWarnings:J};let G=[];for(let E of V)switch(E.type){case"function":G.push({type:"function",function:{name:E.name,description:E.description,parameters:E.inputSchema,...E.strict!=null?{strict:E.strict}:{}}});break;default:J.push({type:"unsupported",feature:`tool type: ${E.type}`});break}if(Y==null)return{tools:G,toolChoice:void 0,toolWarnings:J};let j=Y.type;switch(j){case"auto":case"none":case"required":return{tools:G,toolChoice:j,toolWarnings:J};case"tool":return{tools:G,toolChoice:{type:"function",function:{name:Y.toolName}},toolWarnings:J};default:throw new YQ({functionality:`tool choice type: ${j}`})}}var gV=class{constructor(V,Y){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=V,this.config=Y}get provider(){return this.config.provider}async getArgs({prompt:V,maxOutputTokens:Y,temperature:J,topP:G,topK:j,frequencyPenalty:E,presencePenalty:P,stopSequences:$,responseFormat:A,seed:O,tools:K,toolChoice:Z,providerOptions:q}){var x,f,y,w,M;let g=[],b=(x=await VQ({provider:"openai",providerOptions:q,schema:RV}))!=null?x:{},n=LV(this.modelId),i=(f=b.forceReasoning)!=null?f:n.isReasoningModel;if(j!=null)g.push({type:"unsupported",feature:"topK"});let{messages:p,warnings:m}=MV({prompt:V,systemMessageMode:(y=b.systemMessageMode)!=null?y:i?"developer":n.systemMessageMode});g.push(...m);let s=(w=b.strictJsonSchema)!=null?w:!0,X={model:this.modelId,logit_bias:b.logitBias,logprobs:b.logprobs===!0||typeof b.logprobs==="number"?!0:void 0,top_logprobs:typeof b.logprobs==="number"?b.logprobs:typeof b.logprobs==="boolean"?b.logprobs?0:void 0:void 0,user:b.user,parallel_tool_calls:b.parallelToolCalls,max_tokens:Y,temperature:J,top_p:G,frequency_penalty:E,presence_penalty:P,response_format:(A==null?void 0:A.type)==="json"?A.schema!=null?{type:"json_schema",json_schema:{schema:A.schema,strict:s,name:(M=A.name)!=null?M:"response",description:A.description}}:{type:"json_object"}:void 0,stop:$,seed:O,verbosity:b.textVerbosity,max_completion_tokens:b.maxCompletionTokens,store:b.store,metadata:b.metadata,prediction:b.prediction,reasoning_effort:b.reasoningEffort,service_tier:b.serviceTier,prompt_cache_key:b.promptCacheKey,prompt_cache_retention:b.promptCacheRetention,safety_identifier:b.safetyIdentifier,messages:p};if(i){if(b.reasoningEffort!=="none"||!n.supportsNonReasoningParameters){if(X.temperature!=null)X.temperature=void 0,g.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"});if(X.top_p!=null)X.top_p=void 0,g.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"});if(X.logprobs!=null)X.logprobs=void 0,g.push({type:"other",message:"logprobs is not supported for reasoning models"})}if(X.frequency_penalty!=null)X.frequency_penalty=void 0,g.push({type:"unsupported",feature:"frequencyPenalty",details:"frequencyPenalty is not supported for reasoning models"});if(X.presence_penalty!=null)X.presence_penalty=void 0,g.push({type:"unsupported",feature:"presencePenalty",details:"presencePenalty is not supported for reasoning models"});if(X.logit_bias!=null)X.logit_bias=void 0,g.push({type:"other",message:"logitBias is not supported for reasoning models"});if(X.top_logprobs!=null)X.top_logprobs=void 0,g.push({type:"other",message:"topLogprobs is not supported for reasoning models"});if(X.max_tokens!=null){if(X.max_completion_tokens==null)X.max_completion_tokens=X.max_tokens;X.max_tokens=void 0}}else if(this.modelId.startsWith("gpt-4o-search-preview")||this.modelId.startsWith("gpt-4o-mini-search-preview")){if(X.temperature!=null)X.temperature=void 0,g.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for the search preview models and has been removed."})}if(b.serviceTier==="flex"&&!n.supportsFlexProcessing)g.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),X.service_tier=void 0;if(b.serviceTier==="priority"&&!n.supportsPriorityProcessing)g.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),X.service_tier=void 0;let{tools:u,toolChoice:I,toolWarnings:H}=kV({tools:K,toolChoice:Z});return{args:{...X,tools:u,tool_choice:I},warnings:[...g,...H]}}async doGenerate(V){var Y,J,G,j,E,P,$;let{args:A,warnings:O}=await this.getArgs(V),{responseHeaders:K,value:Z,rawValue:q}=await WQ({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:l(this.config.headers(),V.headers),body:A,failedResponseHandler:zQ,successfulResponseHandler:$Q(bV),abortSignal:V.abortSignal,fetch:this.config.fetch}),x=Z.choices[0],f=[],y=x.message.content;if(y!=null&&y.length>0)f.push({type:"text",text:y});for(let b of(Y=x.message.tool_calls)!=null?Y:[])f.push({type:"tool-call",toolCallId:(J=b.id)!=null?J:QQ(),toolName:b.function.name,input:b.function.arguments});for(let b of(G=x.message.annotations)!=null?G:[])f.push({type:"source",sourceType:"url",id:QQ(),url:b.url_citation.url,title:b.url_citation.title});let w=(j=Z.usage)==null?void 0:j.completion_tokens_details,M=(E=Z.usage)==null?void 0:E.prompt_tokens_details,g={openai:{}};if((w==null?void 0:w.accepted_prediction_tokens)!=null)g.openai.acceptedPredictionTokens=w==null?void 0:w.accepted_prediction_tokens;if((w==null?void 0:w.rejected_prediction_tokens)!=null)g.openai.rejectedPredictionTokens=w==null?void 0:w.rejected_prediction_tokens;if(((P=x.logprobs)==null?void 0:P.content)!=null)g.openai.logprobs=x.logprobs.content;return{content:f,finishReason:{unified:vQ(x.finish_reason),raw:($=x.finish_reason)!=null?$:void 0},usage:cQ(Z.usage),request:{body:A},response:{...LQ(Z),headers:K,body:q},warnings:O,providerMetadata:g}}async doStream(V){let{args:Y,warnings:J}=await this.getArgs(V),G={...Y,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:j,value:E}=await WQ({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:l(this.config.headers(),V.headers),body:G,failedResponseHandler:zQ,successfulResponseHandler:BQ(yV),abortSignal:V.abortSignal,fetch:this.config.fetch}),P=[],$={unified:"other",raw:void 0},A=void 0,O=!1,K=!1,Z={openai:{}};return{stream:E.pipeThrough(new TransformStream({start(q){q.enqueue({type:"stream-start",warnings:J})},transform(q,x){var f,y,w,M,g,b,n,i,p,m,s,X,u,I,H,d,e;if(V.includeRawChunks)x.enqueue({type:"raw",rawValue:q.rawValue});if(!q.success){$={unified:"error",raw:void 0},x.enqueue({type:"error",error:q.error});return}let C=q.value;if("error"in C){$={unified:"error",raw:void 0},x.enqueue({type:"error",error:C.error});return}if(!O){let z=LQ(C);if(Object.values(z).some(Boolean))O=!0,x.enqueue({type:"response-metadata",...LQ(C)})}if(C.usage!=null){if(A=C.usage,((f=C.usage.completion_tokens_details)==null?void 0:f.accepted_prediction_tokens)!=null)Z.openai.acceptedPredictionTokens=(y=C.usage.completion_tokens_details)==null?void 0:y.accepted_prediction_tokens;if(((w=C.usage.completion_tokens_details)==null?void 0:w.rejected_prediction_tokens)!=null)Z.openai.rejectedPredictionTokens=(M=C.usage.completion_tokens_details)==null?void 0:M.rejected_prediction_tokens}let k=C.choices[0];if((k==null?void 0:k.finish_reason)!=null)$={unified:vQ(k.finish_reason),raw:k.finish_reason};if(((g=k==null?void 0:k.logprobs)==null?void 0:g.content)!=null)Z.openai.logprobs=k.logprobs.content;if((k==null?void 0:k.delta)==null)return;let L=k.delta;if(L.content!=null){if(!K)x.enqueue({type:"text-start",id:"0"}),K=!0;x.enqueue({type:"text-delta",id:"0",delta:L.content})}if(L.tool_calls!=null)for(let z of L.tool_calls){let T=z.index;if(P[T]==null){if(z.type!=null&&z.type!=="function")throw new AQ({data:z,message:"Expected 'function' type."});if(z.id==null)throw new AQ({data:z,message:"Expected 'id' to be a string."});if(((b=z.function)==null?void 0:b.name)==null)throw new AQ({data:z,message:"Expected 'function.name' to be a string."});x.enqueue({type:"tool-input-start",id:z.id,toolName:z.function.name}),P[T]={id:z.id,type:"function",function:{name:z.function.name,arguments:(n=z.function.arguments)!=null?n:""},hasFinished:!1};let B=P[T];if(((i=B.function)==null?void 0:i.name)!=null&&((p=B.function)==null?void 0:p.arguments)!=null){if(B.function.arguments.length>0)x.enqueue({type:"tool-input-delta",id:B.id,delta:B.function.arguments});if(qQ(B.function.arguments))x.enqueue({type:"tool-input-end",id:B.id}),x.enqueue({type:"tool-call",toolCallId:(m=B.id)!=null?m:QQ(),toolName:B.function.name,input:B.function.arguments}),B.hasFinished=!0}continue}let N=P[T];if(N.hasFinished)continue;if(((s=z.function)==null?void 0:s.arguments)!=null)N.function.arguments+=(u=(X=z.function)==null?void 0:X.arguments)!=null?u:"";if(x.enqueue({type:"tool-input-delta",id:N.id,delta:(I=z.function.arguments)!=null?I:""}),((H=N.function)==null?void 0:H.name)!=null&&((d=N.function)==null?void 0:d.arguments)!=null&&qQ(N.function.arguments))x.enqueue({type:"tool-input-end",id:N.id}),x.enqueue({type:"tool-call",toolCallId:(e=N.id)!=null?e:QQ(),toolName:N.function.name,input:N.function.arguments}),N.hasFinished=!0}if(L.annotations!=null)for(let z of L.annotations)x.enqueue({type:"source",sourceType:"url",id:QQ(),url:z.url_citation.url,title:z.url_citation.title})},flush(q){if(K)q.enqueue({type:"text-end",id:"0"});q.enqueue({type:"finish",finishReason:$,usage:cQ(A),...Z!=null?{providerMetadata:Z}:{}})}})),request:{body:G},response:{headers:j}}}};function nQ(V){var Y,J,G,j;if(V==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let E=(Y=V.prompt_tokens)!=null?Y:0,P=(J=V.completion_tokens)!=null?J:0;return{inputTokens:{total:(G=V.prompt_tokens)!=null?G:void 0,noCache:E,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:(j=V.completion_tokens)!=null?j:void 0,text:P,reasoning:void 0},raw:V}}function CV({prompt:V,user:Y="user",assistant:J="assistant"}){let G="";if(V[0].role==="system")G+=`${V[0].content}
2
+ import{Ap as qQ,Cp as VQ,Dp as WQ,Ep as xQ,Hp as EV,Ip as a,Kp as UV,Lp as BQ,Mp as $Q,Np as AV,Qp as xV,Ro as l,So as zV,Wo as UQ,Yo as JQ,_o as GV,dp as wQ,fp as QQ,kp as JV,mp as FQ,op as KV,pp as SV,rp as PV,sp as D,vp as F,wp as t,yp as BV}from"./chunk-2maqde7w.js";import{Tp as ZV,Xp as $V,Yp as AQ,bq as jV,dq as YQ}from"./chunk-kj20f048.js";import"./chunk-cqtkxwd8.js";import"./chunk-x9rbv6p6.js";import{St as Q}from"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-7xm75w1e.js";var HQ=Q.object({error:Q.object({message:Q.string(),type:Q.string().nullish(),param:Q.any().nullish(),code:Q.union([Q.string(),Q.number()]).nullish()})}),zQ=UV({errorSchema:HQ,errorToMessage:(V)=>V.error.message});function LV(V){let Y=V.startsWith("o3")||V.startsWith("o4-mini")||V.startsWith("gpt-5")&&!V.startsWith("gpt-5-chat"),J=V.startsWith("gpt-4")||V.startsWith("gpt-5")&&!V.startsWith("gpt-5-nano")&&!V.startsWith("gpt-5-chat")&&!V.startsWith("gpt-5.4-nano")||V.startsWith("o3")||V.startsWith("o4-mini"),G=V.startsWith("o1")||V.startsWith("o3")||V.startsWith("o4-mini")||V.startsWith("gpt-5")&&!V.startsWith("gpt-5-chat"),j=V.startsWith("gpt-5.1")||V.startsWith("gpt-5.2")||V.startsWith("gpt-5.3")||V.startsWith("gpt-5.4");return{supportsFlexProcessing:Y,supportsPriorityProcessing:J,isReasoningModel:G,systemMessageMode:G?"developer":"system",supportsNonReasoningParameters:j}}function cQ(V){var Y,J,G,j,E,P;if(V==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let $=(Y=V.prompt_tokens)!=null?Y:0,A=(J=V.completion_tokens)!=null?J:0,O=(j=(G=V.prompt_tokens_details)==null?void 0:G.cached_tokens)!=null?j:0,K=(P=(E=V.completion_tokens_details)==null?void 0:E.reasoning_tokens)!=null?P:0;return{inputTokens:{total:$,noCache:$-O,cacheRead:O,cacheWrite:void 0},outputTokens:{total:A,text:A-K,reasoning:K},raw:V}}function HV(V){return JSON.stringify(V===void 0?{}:V)}function MV({prompt:V,systemMessageMode:Y="system"}){var J;let G=[],j=[];for(let{role:E,content:P}of V)switch(E){case"system":{switch(Y){case"system":{G.push({role:"system",content:P});break}case"developer":{G.push({role:"developer",content:P});break}case"remove":{j.push({type:"other",message:"system messages are removed for this model"});break}default:throw Error(`Unsupported system message mode: ${Y}`)}break}case"user":{if(P.length===1&&P[0].type==="text"){G.push({role:"user",content:P[0].text});break}G.push({role:"user",content:P.map(($,A)=>{var O,K,Z;switch($.type){case"text":return{type:"text",text:$.text};case"file":if($.mediaType.startsWith("image/")){let q=$.mediaType==="image/*"?"image/jpeg":$.mediaType;return{type:"image_url",image_url:{url:$.data instanceof URL?$.data.toString():`data:${q};base64,${JQ($.data)}`,detail:(K=(O=$.providerOptions)==null?void 0:O.openai)==null?void 0:K.imageDetail}}}else if($.mediaType.startsWith("audio/")){if($.data instanceof URL)throw new YQ({functionality:"audio file parts with URLs"});switch($.mediaType){case"audio/wav":return{type:"input_audio",input_audio:{data:JQ($.data),format:"wav"}};case"audio/mp3":case"audio/mpeg":return{type:"input_audio",input_audio:{data:JQ($.data),format:"mp3"}};default:throw new YQ({functionality:`audio content parts with media type ${$.mediaType}`})}}else if($.mediaType==="application/pdf"){if($.data instanceof URL)throw new YQ({functionality:"PDF file parts with URLs"});return{type:"file",file:typeof $.data==="string"&&$.data.startsWith("file-")?{file_id:$.data}:{filename:(Z=$.filename)!=null?Z:`part-${A}.pdf`,file_data:`data:application/pdf;base64,${JQ($.data)}`}}}else throw new YQ({functionality:`file part media type ${$.mediaType}`})}})});break}case"assistant":{let $="",A=[];for(let O of P)switch(O.type){case"text":{$+=O.text;break}case"tool-call":{A.push({id:O.toolCallId,type:"function",function:{name:O.toolName,arguments:HV(O.input)}});break}}G.push({role:"assistant",content:$,tool_calls:A.length>0?A:void 0});break}case"tool":{for(let $ of P){if($.type==="tool-approval-response")continue;let A=$.output,O;switch(A.type){case"text":case"error-text":O=A.value;break;case"execution-denied":O=(J=A.reason)!=null?J:"Tool execution denied.";break;case"content":case"json":case"error-json":O=JSON.stringify(A.value);break}G.push({role:"tool",tool_call_id:$.toolCallId,content:O})}break}default:throw Error(`Unsupported role: ${E}`)}return{messages:G,warnings:j}}function LQ({id:V,model:Y,created:J}){return{id:V!=null?V:void 0,modelId:Y!=null?Y:void 0,timestamp:J?new Date(J*1000):void 0}}function vQ(V){switch(V){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var bV=D(()=>F(Q.object({id:Q.string().nullish(),created:Q.number().nullish(),model:Q.string().nullish(),choices:Q.array(Q.object({message:Q.object({role:Q.literal("assistant").nullish(),content:Q.string().nullish(),tool_calls:Q.array(Q.object({id:Q.string().nullish(),type:Q.literal("function"),function:Q.object({name:Q.string(),arguments:Q.string()})})).nullish(),annotations:Q.array(Q.object({type:Q.literal("url_citation"),url_citation:Q.object({start_index:Q.number(),end_index:Q.number(),url:Q.string(),title:Q.string()})})).nullish()}),index:Q.number(),logprobs:Q.object({content:Q.array(Q.object({token:Q.string(),logprob:Q.number(),top_logprobs:Q.array(Q.object({token:Q.string(),logprob:Q.number()}))})).nullish()}).nullish(),finish_reason:Q.string().nullish()})),usage:Q.object({prompt_tokens:Q.number().nullish(),completion_tokens:Q.number().nullish(),total_tokens:Q.number().nullish(),prompt_tokens_details:Q.object({cached_tokens:Q.number().nullish()}).nullish(),completion_tokens_details:Q.object({reasoning_tokens:Q.number().nullish(),accepted_prediction_tokens:Q.number().nullish(),rejected_prediction_tokens:Q.number().nullish()}).nullish()}).nullish()}))),yV=D(()=>F(Q.union([Q.object({id:Q.string().nullish(),created:Q.number().nullish(),model:Q.string().nullish(),choices:Q.array(Q.object({delta:Q.object({role:Q.enum(["assistant"]).nullish(),content:Q.string().nullish(),tool_calls:Q.array(Q.object({index:Q.number(),id:Q.string().nullish(),type:Q.literal("function").nullish(),function:Q.object({name:Q.string().nullish(),arguments:Q.string().nullish()})})).nullish(),annotations:Q.array(Q.object({type:Q.literal("url_citation"),url_citation:Q.object({start_index:Q.number(),end_index:Q.number(),url:Q.string(),title:Q.string()})})).nullish()}).nullish(),logprobs:Q.object({content:Q.array(Q.object({token:Q.string(),logprob:Q.number(),top_logprobs:Q.array(Q.object({token:Q.string(),logprob:Q.number()}))})).nullish()}).nullish(),finish_reason:Q.string().nullish(),index:Q.number()})),usage:Q.object({prompt_tokens:Q.number().nullish(),completion_tokens:Q.number().nullish(),total_tokens:Q.number().nullish(),prompt_tokens_details:Q.object({cached_tokens:Q.number().nullish()}).nullish(),completion_tokens_details:Q.object({reasoning_tokens:Q.number().nullish(),accepted_prediction_tokens:Q.number().nullish(),rejected_prediction_tokens:Q.number().nullish()}).nullish()}).nullish()}),HQ]))),RV=D(()=>F(Q.object({logitBias:Q.record(Q.coerce.number(),Q.number()).optional(),logprobs:Q.union([Q.boolean(),Q.number()]).optional(),parallelToolCalls:Q.boolean().optional(),user:Q.string().optional(),reasoningEffort:Q.enum(["none","minimal","low","medium","high","xhigh"]).optional(),maxCompletionTokens:Q.number().optional(),store:Q.boolean().optional(),metadata:Q.record(Q.string().max(64),Q.string().max(512)).optional(),prediction:Q.record(Q.string(),Q.any()).optional(),serviceTier:Q.enum(["auto","flex","priority","default"]).optional(),strictJsonSchema:Q.boolean().optional(),textVerbosity:Q.enum(["low","medium","high"]).optional(),promptCacheKey:Q.string().optional(),promptCacheRetention:Q.enum(["in_memory","24h"]).optional(),safetyIdentifier:Q.string().optional(),systemMessageMode:Q.enum(["system","developer","remove"]).optional(),forceReasoning:Q.boolean().optional()})));function kV({tools:V,toolChoice:Y}){V=(V==null?void 0:V.length)?V:void 0;let J=[];if(V==null)return{tools:void 0,toolChoice:void 0,toolWarnings:J};let G=[];for(let E of V)switch(E.type){case"function":G.push({type:"function",function:{name:E.name,description:E.description,parameters:E.inputSchema,...E.strict!=null?{strict:E.strict}:{}}});break;default:J.push({type:"unsupported",feature:`tool type: ${E.type}`});break}if(Y==null)return{tools:G,toolChoice:void 0,toolWarnings:J};let j=Y.type;switch(j){case"auto":case"none":case"required":return{tools:G,toolChoice:j,toolWarnings:J};case"tool":return{tools:G,toolChoice:{type:"function",function:{name:Y.toolName}},toolWarnings:J};default:throw new YQ({functionality:`tool choice type: ${j}`})}}var gV=class{constructor(V,Y){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=V,this.config=Y}get provider(){return this.config.provider}async getArgs({prompt:V,maxOutputTokens:Y,temperature:J,topP:G,topK:j,frequencyPenalty:E,presencePenalty:P,stopSequences:$,responseFormat:A,seed:O,tools:K,toolChoice:Z,providerOptions:q}){var x,f,y,w,M;let g=[],b=(x=await VQ({provider:"openai",providerOptions:q,schema:RV}))!=null?x:{},n=LV(this.modelId),i=(f=b.forceReasoning)!=null?f:n.isReasoningModel;if(j!=null)g.push({type:"unsupported",feature:"topK"});let{messages:p,warnings:m}=MV({prompt:V,systemMessageMode:(y=b.systemMessageMode)!=null?y:i?"developer":n.systemMessageMode});g.push(...m);let s=(w=b.strictJsonSchema)!=null?w:!0,X={model:this.modelId,logit_bias:b.logitBias,logprobs:b.logprobs===!0||typeof b.logprobs==="number"?!0:void 0,top_logprobs:typeof b.logprobs==="number"?b.logprobs:typeof b.logprobs==="boolean"?b.logprobs?0:void 0:void 0,user:b.user,parallel_tool_calls:b.parallelToolCalls,max_tokens:Y,temperature:J,top_p:G,frequency_penalty:E,presence_penalty:P,response_format:(A==null?void 0:A.type)==="json"?A.schema!=null?{type:"json_schema",json_schema:{schema:A.schema,strict:s,name:(M=A.name)!=null?M:"response",description:A.description}}:{type:"json_object"}:void 0,stop:$,seed:O,verbosity:b.textVerbosity,max_completion_tokens:b.maxCompletionTokens,store:b.store,metadata:b.metadata,prediction:b.prediction,reasoning_effort:b.reasoningEffort,service_tier:b.serviceTier,prompt_cache_key:b.promptCacheKey,prompt_cache_retention:b.promptCacheRetention,safety_identifier:b.safetyIdentifier,messages:p};if(i){if(b.reasoningEffort!=="none"||!n.supportsNonReasoningParameters){if(X.temperature!=null)X.temperature=void 0,g.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"});if(X.top_p!=null)X.top_p=void 0,g.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"});if(X.logprobs!=null)X.logprobs=void 0,g.push({type:"other",message:"logprobs is not supported for reasoning models"})}if(X.frequency_penalty!=null)X.frequency_penalty=void 0,g.push({type:"unsupported",feature:"frequencyPenalty",details:"frequencyPenalty is not supported for reasoning models"});if(X.presence_penalty!=null)X.presence_penalty=void 0,g.push({type:"unsupported",feature:"presencePenalty",details:"presencePenalty is not supported for reasoning models"});if(X.logit_bias!=null)X.logit_bias=void 0,g.push({type:"other",message:"logitBias is not supported for reasoning models"});if(X.top_logprobs!=null)X.top_logprobs=void 0,g.push({type:"other",message:"topLogprobs is not supported for reasoning models"});if(X.max_tokens!=null){if(X.max_completion_tokens==null)X.max_completion_tokens=X.max_tokens;X.max_tokens=void 0}}else if(this.modelId.startsWith("gpt-4o-search-preview")||this.modelId.startsWith("gpt-4o-mini-search-preview")){if(X.temperature!=null)X.temperature=void 0,g.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for the search preview models and has been removed."})}if(b.serviceTier==="flex"&&!n.supportsFlexProcessing)g.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),X.service_tier=void 0;if(b.serviceTier==="priority"&&!n.supportsPriorityProcessing)g.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),X.service_tier=void 0;let{tools:u,toolChoice:I,toolWarnings:H}=kV({tools:K,toolChoice:Z});return{args:{...X,tools:u,tool_choice:I},warnings:[...g,...H]}}async doGenerate(V){var Y,J,G,j,E,P,$;let{args:A,warnings:O}=await this.getArgs(V),{responseHeaders:K,value:Z,rawValue:q}=await WQ({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:l(this.config.headers(),V.headers),body:A,failedResponseHandler:zQ,successfulResponseHandler:$Q(bV),abortSignal:V.abortSignal,fetch:this.config.fetch}),x=Z.choices[0],f=[],y=x.message.content;if(y!=null&&y.length>0)f.push({type:"text",text:y});for(let b of(Y=x.message.tool_calls)!=null?Y:[])f.push({type:"tool-call",toolCallId:(J=b.id)!=null?J:QQ(),toolName:b.function.name,input:b.function.arguments});for(let b of(G=x.message.annotations)!=null?G:[])f.push({type:"source",sourceType:"url",id:QQ(),url:b.url_citation.url,title:b.url_citation.title});let w=(j=Z.usage)==null?void 0:j.completion_tokens_details,M=(E=Z.usage)==null?void 0:E.prompt_tokens_details,g={openai:{}};if((w==null?void 0:w.accepted_prediction_tokens)!=null)g.openai.acceptedPredictionTokens=w==null?void 0:w.accepted_prediction_tokens;if((w==null?void 0:w.rejected_prediction_tokens)!=null)g.openai.rejectedPredictionTokens=w==null?void 0:w.rejected_prediction_tokens;if(((P=x.logprobs)==null?void 0:P.content)!=null)g.openai.logprobs=x.logprobs.content;return{content:f,finishReason:{unified:vQ(x.finish_reason),raw:($=x.finish_reason)!=null?$:void 0},usage:cQ(Z.usage),request:{body:A},response:{...LQ(Z),headers:K,body:q},warnings:O,providerMetadata:g}}async doStream(V){let{args:Y,warnings:J}=await this.getArgs(V),G={...Y,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:j,value:E}=await WQ({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:l(this.config.headers(),V.headers),body:G,failedResponseHandler:zQ,successfulResponseHandler:BQ(yV),abortSignal:V.abortSignal,fetch:this.config.fetch}),P=[],$={unified:"other",raw:void 0},A=void 0,O=!1,K=!1,Z={openai:{}};return{stream:E.pipeThrough(new TransformStream({start(q){q.enqueue({type:"stream-start",warnings:J})},transform(q,x){var f,y,w,M,g,b,n,i,p,m,s,X,u,I,H,d,e;if(V.includeRawChunks)x.enqueue({type:"raw",rawValue:q.rawValue});if(!q.success){$={unified:"error",raw:void 0},x.enqueue({type:"error",error:q.error});return}let C=q.value;if("error"in C){$={unified:"error",raw:void 0},x.enqueue({type:"error",error:C.error});return}if(!O){let z=LQ(C);if(Object.values(z).some(Boolean))O=!0,x.enqueue({type:"response-metadata",...LQ(C)})}if(C.usage!=null){if(A=C.usage,((f=C.usage.completion_tokens_details)==null?void 0:f.accepted_prediction_tokens)!=null)Z.openai.acceptedPredictionTokens=(y=C.usage.completion_tokens_details)==null?void 0:y.accepted_prediction_tokens;if(((w=C.usage.completion_tokens_details)==null?void 0:w.rejected_prediction_tokens)!=null)Z.openai.rejectedPredictionTokens=(M=C.usage.completion_tokens_details)==null?void 0:M.rejected_prediction_tokens}let k=C.choices[0];if((k==null?void 0:k.finish_reason)!=null)$={unified:vQ(k.finish_reason),raw:k.finish_reason};if(((g=k==null?void 0:k.logprobs)==null?void 0:g.content)!=null)Z.openai.logprobs=k.logprobs.content;if((k==null?void 0:k.delta)==null)return;let L=k.delta;if(L.content!=null){if(!K)x.enqueue({type:"text-start",id:"0"}),K=!0;x.enqueue({type:"text-delta",id:"0",delta:L.content})}if(L.tool_calls!=null)for(let z of L.tool_calls){let T=z.index;if(P[T]==null){if(z.type!=null&&z.type!=="function")throw new AQ({data:z,message:"Expected 'function' type."});if(z.id==null)throw new AQ({data:z,message:"Expected 'id' to be a string."});if(((b=z.function)==null?void 0:b.name)==null)throw new AQ({data:z,message:"Expected 'function.name' to be a string."});x.enqueue({type:"tool-input-start",id:z.id,toolName:z.function.name}),P[T]={id:z.id,type:"function",function:{name:z.function.name,arguments:(n=z.function.arguments)!=null?n:""},hasFinished:!1};let B=P[T];if(((i=B.function)==null?void 0:i.name)!=null&&((p=B.function)==null?void 0:p.arguments)!=null){if(B.function.arguments.length>0)x.enqueue({type:"tool-input-delta",id:B.id,delta:B.function.arguments});if(qQ(B.function.arguments))x.enqueue({type:"tool-input-end",id:B.id}),x.enqueue({type:"tool-call",toolCallId:(m=B.id)!=null?m:QQ(),toolName:B.function.name,input:B.function.arguments}),B.hasFinished=!0}continue}let N=P[T];if(N.hasFinished)continue;if(((s=z.function)==null?void 0:s.arguments)!=null)N.function.arguments+=(u=(X=z.function)==null?void 0:X.arguments)!=null?u:"";if(x.enqueue({type:"tool-input-delta",id:N.id,delta:(I=z.function.arguments)!=null?I:""}),((H=N.function)==null?void 0:H.name)!=null&&((d=N.function)==null?void 0:d.arguments)!=null&&qQ(N.function.arguments))x.enqueue({type:"tool-input-end",id:N.id}),x.enqueue({type:"tool-call",toolCallId:(e=N.id)!=null?e:QQ(),toolName:N.function.name,input:N.function.arguments}),N.hasFinished=!0}if(L.annotations!=null)for(let z of L.annotations)x.enqueue({type:"source",sourceType:"url",id:QQ(),url:z.url_citation.url,title:z.url_citation.title})},flush(q){if(K)q.enqueue({type:"text-end",id:"0"});q.enqueue({type:"finish",finishReason:$,usage:cQ(A),...Z!=null?{providerMetadata:Z}:{}})}})),request:{body:G},response:{headers:j}}}};function nQ(V){var Y,J,G,j;if(V==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let E=(Y=V.prompt_tokens)!=null?Y:0,P=(J=V.completion_tokens)!=null?J:0;return{inputTokens:{total:(G=V.prompt_tokens)!=null?G:void 0,noCache:E,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:(j=V.completion_tokens)!=null?j:void 0,text:P,reasoning:void 0},raw:V}}function CV({prompt:V,user:Y="user",assistant:J="assistant"}){let G="";if(V[0].role==="system")G+=`${V[0].content}
3
3
 
4
4
  `,V=V.slice(1);for(let{role:j,content:E}of V)switch(j){case"system":throw new $V({message:"Unexpected system message in prompt: ${content}",prompt:V});case"user":{let P=E.map(($)=>{switch($.type){case"text":return $.text}}).filter(Boolean).join("");G+=`${Y}:
5
5
  ${P}
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Gl as a,Hl as b,Il as c,Jl as d,Kl as e,Ll as f,Ml as g,Nl as h,Ol as i}from"./chunk-8ymffyep.js";import"./chunk-redjxn13.js";import"./chunk-htz93dsd.js";import"./chunk-2hc5z7b5.js";import"./chunk-d6ry9418.js";import"./chunk-m5m448mg.js";import"./chunk-tqj69nh6.js";import"./chunk-ag8kz1e7.js";import"./chunk-5tray1fw.js";import"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-gagtmjmp.js";import"./chunk-zs8kqdsf.js";import"./chunk-7xm75w1e.js";export{i as stopRefresh,h as startRefresh,g as refresh,d as readModelCatalogResponse,f as get,c as Provider,b as Model,a as MODEL_CATALOG_MAX_BYTES,e as Data};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{rf as u}from"./chunk-qhc90p4a.js";import{aQ as Q,dQ as Kq}from"./chunk-aztre27e.js";var D=Q((iq,j)=>{var{defineProperty:X,getOwnPropertyDescriptor:r,getOwnPropertyNames:o}=Object,a=Object.prototype.hasOwnProperty,t=(q,z)=>X(q,"name",{value:z,configurable:!0}),qq=(q,z)=>{for(var G in z)X(q,G,{get:z[G],enumerable:!0})},zq=(q,z,G,K)=>{if(z&&typeof z==="object"||typeof z==="function"){for(let I of o(z))if(!a.call(q,I)&&I!==G)X(q,I,{get:()=>z[I],enumerable:!(K=r(z,I))||K.enumerable})}return q},Gq=(q)=>zq(X({},"__esModule",{value:!0}),q),J={};qq(J,{isArrayBuffer:()=>Iq});j.exports=Gq(J);var Iq=t((q)=>typeof ArrayBuffer==="function"&&q instanceof ArrayBuffer||Object.prototype.toString.call(q)==="[object ArrayBuffer]","isArrayBuffer")});var O=Q((dq,R)=>{var{defineProperty:Y,getOwnPropertyDescriptor:Qq,getOwnPropertyNames:Vq}=Object,Wq=Object.prototype.hasOwnProperty,E=(q,z)=>Y(q,"name",{value:z,configurable:!0}),Xq=(q,z)=>{for(var G in z)Y(q,G,{get:z[G],enumerable:!0})},Yq=(q,z,G,K)=>{if(z&&typeof z==="object"||typeof z==="function"){for(let I of Vq(z))if(!Wq.call(q,I)&&I!==G)Y(q,I,{get:()=>z[I],enumerable:!(K=Qq(z,I))||K.enumerable})}return q},Zq=(q)=>Yq(Y({},"__esModule",{value:!0}),q),L={};Xq(L,{fromArrayBuffer:()=>Nq,fromString:()=>Fq});R.exports=Zq(L);var $q=D(),$=Kq("buffer"),Nq=E((q,z=0,G=q.byteLength-z)=>{if(!(0,$q.isArrayBuffer)(q))throw TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof q} (${q})`);return $.Buffer.from(q,z,G)},"fromArrayBuffer"),Fq=E((q,z)=>{if(typeof q!=="string")throw TypeError(`The "input" argument must be of type string. Received type ${typeof q} (${q})`);return z?$.Buffer.from(q,z):$.Buffer.from(q)},"fromString")});var A=Q((mq,h)=>{var{defineProperty:Z,getOwnPropertyDescriptor:Hq,getOwnPropertyNames:Bq}=Object,Jq=Object.prototype.hasOwnProperty,N=(q,z)=>Z(q,"name",{value:z,configurable:!0}),jq=(q,z)=>{for(var G in z)Z(q,G,{get:z[G],enumerable:!0})},Dq=(q,z,G,K)=>{if(z&&typeof z==="object"||typeof z==="function"){for(let I of Bq(z))if(!Jq.call(q,I)&&I!==G)Z(q,I,{get:()=>z[I],enumerable:!(K=Hq(z,I))||K.enumerable})}return q},Eq=(q)=>Dq(Z({},"__esModule",{value:!0}),q),v={};jq(v,{fromUtf8:()=>S,toUint8Array:()=>Lq,toUtf8:()=>Rq});h.exports=Eq(v);var M=O(),S=N((q)=>{let z=(0,M.fromString)(q,"utf8");return new Uint8Array(z.buffer,z.byteOffset,z.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),Lq=N((q)=>{if(typeof q==="string")return S(q);if(ArrayBuffer.isView(q))return new Uint8Array(q.buffer,q.byteOffset,q.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(q)},"toUint8Array"),Rq=N((q)=>{if(typeof q==="string")return q;if(typeof q!=="object"||typeof q.byteOffset!=="number"||typeof q.byteLength!=="number")throw Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return(0,M.fromArrayBuffer)(q.buffer,q.byteOffset,q.byteLength).toString("utf8")},"toUtf8")});var w=Q((C)=>{Object.defineProperty(C,"__esModule",{value:!0});C.convertToBuffer=void 0;var Oq=A(),vq=typeof Buffer<"u"&&Buffer.from?function(q){return Buffer.from(q,"utf8")}:Oq.fromUtf8;function Mq(q){if(q instanceof Uint8Array)return q;if(typeof q==="string")return vq(q);if(ArrayBuffer.isView(q))return new Uint8Array(q.buffer,q.byteOffset,q.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(q)}C.convertToBuffer=Mq});var U=Q((P)=>{Object.defineProperty(P,"__esModule",{value:!0});P.isEmptyData=void 0;function Sq(q){if(typeof q==="string")return q.length===0;return q.byteLength===0}P.isEmptyData=Sq});var y=Q((b)=>{Object.defineProperty(b,"__esModule",{value:!0});b.numToUint8=void 0;function hq(q){return new Uint8Array([(q&4278190080)>>24,(q&16711680)>>16,(q&65280)>>8,q&255])}b.numToUint8=hq});var l=Q((x)=>{Object.defineProperty(x,"__esModule",{value:!0});x.uint32ArrayFrom=void 0;function Aq(q){if(!Uint32Array.from){var z=new Uint32Array(q.length),G=0;while(G<q.length)z[G]=q[G],G+=1;return z}return Uint32Array.from(q)}x.uint32ArrayFrom=Aq});var F=Q((V)=>{Object.defineProperty(V,"__esModule",{value:!0});V.uint32ArrayFrom=V.numToUint8=V.isEmptyData=V.convertToBuffer=void 0;var Cq=w();Object.defineProperty(V,"convertToBuffer",{enumerable:!0,get:function(){return Cq.convertToBuffer}});var Tq=U();Object.defineProperty(V,"isEmptyData",{enumerable:!0,get:function(){return Tq.isEmptyData}});var wq=y();Object.defineProperty(V,"numToUint8",{enumerable:!0,get:function(){return wq.numToUint8}});var Pq=l();Object.defineProperty(V,"uint32ArrayFrom",{enumerable:!0,get:function(){return Pq.uint32ArrayFrom}})});var m=Q((i)=>{Object.defineProperty(i,"__esModule",{value:!0});i.AwsCrc32=void 0;var s=u(),H=F(),f=n(),Uq=function(){function q(){this.crc32=new f.Crc32}return q.prototype.update=function(z){if((0,H.isEmptyData)(z))return;this.crc32.update((0,H.convertToBuffer)(z))},q.prototype.digest=function(){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(z){return[2,(0,H.numToUint8)(this.crc32.digest())]})})},q.prototype.reset=function(){this.crc32=new f.Crc32},q}();i.AwsCrc32=Uq});var n=Q((B)=>{Object.defineProperty(B,"__esModule",{value:!0});B.AwsCrc32=B.Crc32=B.crc32=void 0;var bq=u(),gq=F();function yq(q){return new p().update(q).digest()}B.crc32=yq;var p=function(){function q(){this.checksum=4294967295}return q.prototype.update=function(z){var G,K;try{for(var I=bq.__values(z),W=I.next();!W.done;W=I.next()){var _=W.value;this.checksum=this.checksum>>>8^cq[(this.checksum^_)&255]}}catch(e){G={error:e}}finally{try{if(W&&!W.done&&(K=I.return))K.call(I)}finally{if(G)throw G.error}}return this},q.prototype.digest=function(){return(this.checksum^4294967295)>>>0},q}();B.Crc32=p;var xq=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],cq=(0,gq.uint32ArrayFrom)(xq),lq=m();Object.defineProperty(B,"AwsCrc32",{enumerable:!0,get:function(){return lq.AwsCrc32}})});
2
+ import{rf as u}from"./chunk-93p131d5.js";import{CO as Q,FO as Kq}from"./chunk-7xm75w1e.js";var D=Q((iq,j)=>{var{defineProperty:X,getOwnPropertyDescriptor:r,getOwnPropertyNames:o}=Object,a=Object.prototype.hasOwnProperty,t=(q,z)=>X(q,"name",{value:z,configurable:!0}),qq=(q,z)=>{for(var G in z)X(q,G,{get:z[G],enumerable:!0})},zq=(q,z,G,K)=>{if(z&&typeof z==="object"||typeof z==="function"){for(let I of o(z))if(!a.call(q,I)&&I!==G)X(q,I,{get:()=>z[I],enumerable:!(K=r(z,I))||K.enumerable})}return q},Gq=(q)=>zq(X({},"__esModule",{value:!0}),q),J={};qq(J,{isArrayBuffer:()=>Iq});j.exports=Gq(J);var Iq=t((q)=>typeof ArrayBuffer==="function"&&q instanceof ArrayBuffer||Object.prototype.toString.call(q)==="[object ArrayBuffer]","isArrayBuffer")});var O=Q((dq,R)=>{var{defineProperty:Y,getOwnPropertyDescriptor:Qq,getOwnPropertyNames:Vq}=Object,Wq=Object.prototype.hasOwnProperty,E=(q,z)=>Y(q,"name",{value:z,configurable:!0}),Xq=(q,z)=>{for(var G in z)Y(q,G,{get:z[G],enumerable:!0})},Yq=(q,z,G,K)=>{if(z&&typeof z==="object"||typeof z==="function"){for(let I of Vq(z))if(!Wq.call(q,I)&&I!==G)Y(q,I,{get:()=>z[I],enumerable:!(K=Qq(z,I))||K.enumerable})}return q},Zq=(q)=>Yq(Y({},"__esModule",{value:!0}),q),L={};Xq(L,{fromArrayBuffer:()=>Nq,fromString:()=>Fq});R.exports=Zq(L);var $q=D(),$=Kq("buffer"),Nq=E((q,z=0,G=q.byteLength-z)=>{if(!(0,$q.isArrayBuffer)(q))throw TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof q} (${q})`);return $.Buffer.from(q,z,G)},"fromArrayBuffer"),Fq=E((q,z)=>{if(typeof q!=="string")throw TypeError(`The "input" argument must be of type string. Received type ${typeof q} (${q})`);return z?$.Buffer.from(q,z):$.Buffer.from(q)},"fromString")});var A=Q((mq,h)=>{var{defineProperty:Z,getOwnPropertyDescriptor:Hq,getOwnPropertyNames:Bq}=Object,Jq=Object.prototype.hasOwnProperty,N=(q,z)=>Z(q,"name",{value:z,configurable:!0}),jq=(q,z)=>{for(var G in z)Z(q,G,{get:z[G],enumerable:!0})},Dq=(q,z,G,K)=>{if(z&&typeof z==="object"||typeof z==="function"){for(let I of Bq(z))if(!Jq.call(q,I)&&I!==G)Z(q,I,{get:()=>z[I],enumerable:!(K=Hq(z,I))||K.enumerable})}return q},Eq=(q)=>Dq(Z({},"__esModule",{value:!0}),q),v={};jq(v,{fromUtf8:()=>S,toUint8Array:()=>Lq,toUtf8:()=>Rq});h.exports=Eq(v);var M=O(),S=N((q)=>{let z=(0,M.fromString)(q,"utf8");return new Uint8Array(z.buffer,z.byteOffset,z.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),Lq=N((q)=>{if(typeof q==="string")return S(q);if(ArrayBuffer.isView(q))return new Uint8Array(q.buffer,q.byteOffset,q.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(q)},"toUint8Array"),Rq=N((q)=>{if(typeof q==="string")return q;if(typeof q!=="object"||typeof q.byteOffset!=="number"||typeof q.byteLength!=="number")throw Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return(0,M.fromArrayBuffer)(q.buffer,q.byteOffset,q.byteLength).toString("utf8")},"toUtf8")});var w=Q((C)=>{Object.defineProperty(C,"__esModule",{value:!0});C.convertToBuffer=void 0;var Oq=A(),vq=typeof Buffer<"u"&&Buffer.from?function(q){return Buffer.from(q,"utf8")}:Oq.fromUtf8;function Mq(q){if(q instanceof Uint8Array)return q;if(typeof q==="string")return vq(q);if(ArrayBuffer.isView(q))return new Uint8Array(q.buffer,q.byteOffset,q.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(q)}C.convertToBuffer=Mq});var U=Q((P)=>{Object.defineProperty(P,"__esModule",{value:!0});P.isEmptyData=void 0;function Sq(q){if(typeof q==="string")return q.length===0;return q.byteLength===0}P.isEmptyData=Sq});var y=Q((b)=>{Object.defineProperty(b,"__esModule",{value:!0});b.numToUint8=void 0;function hq(q){return new Uint8Array([(q&4278190080)>>24,(q&16711680)>>16,(q&65280)>>8,q&255])}b.numToUint8=hq});var l=Q((x)=>{Object.defineProperty(x,"__esModule",{value:!0});x.uint32ArrayFrom=void 0;function Aq(q){if(!Uint32Array.from){var z=new Uint32Array(q.length),G=0;while(G<q.length)z[G]=q[G],G+=1;return z}return Uint32Array.from(q)}x.uint32ArrayFrom=Aq});var F=Q((V)=>{Object.defineProperty(V,"__esModule",{value:!0});V.uint32ArrayFrom=V.numToUint8=V.isEmptyData=V.convertToBuffer=void 0;var Cq=w();Object.defineProperty(V,"convertToBuffer",{enumerable:!0,get:function(){return Cq.convertToBuffer}});var Tq=U();Object.defineProperty(V,"isEmptyData",{enumerable:!0,get:function(){return Tq.isEmptyData}});var wq=y();Object.defineProperty(V,"numToUint8",{enumerable:!0,get:function(){return wq.numToUint8}});var Pq=l();Object.defineProperty(V,"uint32ArrayFrom",{enumerable:!0,get:function(){return Pq.uint32ArrayFrom}})});var m=Q((i)=>{Object.defineProperty(i,"__esModule",{value:!0});i.AwsCrc32=void 0;var s=u(),H=F(),f=n(),Uq=function(){function q(){this.crc32=new f.Crc32}return q.prototype.update=function(z){if((0,H.isEmptyData)(z))return;this.crc32.update((0,H.convertToBuffer)(z))},q.prototype.digest=function(){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(z){return[2,(0,H.numToUint8)(this.crc32.digest())]})})},q.prototype.reset=function(){this.crc32=new f.Crc32},q}();i.AwsCrc32=Uq});var n=Q((B)=>{Object.defineProperty(B,"__esModule",{value:!0});B.AwsCrc32=B.Crc32=B.crc32=void 0;var bq=u(),gq=F();function yq(q){return new p().update(q).digest()}B.crc32=yq;var p=function(){function q(){this.checksum=4294967295}return q.prototype.update=function(z){var G,K;try{for(var I=bq.__values(z),W=I.next();!W.done;W=I.next()){var _=W.value;this.checksum=this.checksum>>>8^cq[(this.checksum^_)&255]}}catch(e){G={error:e}}finally{try{if(W&&!W.done&&(K=I.return))K.call(I)}finally{if(G)throw G.error}}return this},q.prototype.digest=function(){return(this.checksum^4294967295)>>>0},q}();B.Crc32=p;var xq=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],cq=(0,gq.uint32ArrayFrom)(xq),lq=m();Object.defineProperty(B,"AwsCrc32",{enumerable:!0,get:function(){return lq.AwsCrc32}})});
3
3
  export{n as qf};