@qitqode/qitqode-android-arm64 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (427) hide show
  1. package/bun +2 -2
  2. package/bundle/{chunk-2hv2c8d5.js → chunk-0428v6mw.js} +1 -1
  3. package/bundle/{chunk-0f3ft9dh.js → chunk-05ck7acg.js} +1 -1
  4. package/bundle/{chunk-xmjntwjc.js → chunk-09geev0j.js} +2 -2
  5. package/bundle/{chunk-j5ymkhry.js → chunk-0cnwsf8p.js} +1 -1
  6. package/bundle/chunk-0ppnq3a4.js +2 -0
  7. package/bundle/{chunk-6kf4vw2g.js → chunk-0qd3567w.js} +1 -1
  8. package/bundle/{chunk-jw114bbt.js → chunk-0smnwqk6.js} +2 -2
  9. package/bundle/chunk-0te0vcdn.js +2 -0
  10. package/bundle/{chunk-q4fn41ex.js → chunk-0xrb12s8.js} +2 -2
  11. package/bundle/chunk-11h06z17.js +2 -0
  12. package/bundle/{chunk-vyh300ac.js → chunk-1rtx2zsc.js} +2 -2
  13. package/bundle/{chunk-3jms025t.js → chunk-1t0c86bz.js} +1 -1
  14. package/bundle/{chunk-6dfjtzqb.js → chunk-21rq4592.js} +2 -2
  15. package/bundle/{chunk-y3dfk6n5.js → chunk-24rkf2gk.js} +1 -1
  16. package/bundle/{chunk-rdwma0de.js → chunk-24ygjbpf.js} +2 -2
  17. package/bundle/{chunk-q46pzk9z.js → chunk-25ganjcn.js} +2 -2
  18. package/bundle/chunk-28yv4fqe.js +2 -0
  19. package/bundle/{chunk-3tmq81kq.js → chunk-2drzgtv3.js} +2 -2
  20. package/bundle/{chunk-xd3xc1vv.js → chunk-2md6sx8d.js} +1 -1
  21. package/bundle/chunk-2mm37s1w.js +2 -0
  22. package/bundle/chunk-2prf30p3.js +2 -0
  23. package/bundle/{chunk-v9rg0a8g.js → chunk-313zqzc1.js} +1 -1
  24. package/bundle/{chunk-zfd70p01.js → chunk-32j0q58h.js} +1 -1
  25. package/bundle/chunk-34a52hyr.js +2 -0
  26. package/bundle/{chunk-86jsqc7d.js → chunk-39z96pc6.js} +3 -3
  27. package/bundle/chunk-3hcr2bzt.js +2 -0
  28. package/bundle/{chunk-e6wp96vm.js → chunk-3jf3jhrs.js} +1 -1
  29. package/bundle/{chunk-4sxg9cgr.js → chunk-3kpse7zy.js} +1 -1
  30. package/bundle/chunk-3n3gb3vd.js +2 -0
  31. package/bundle/chunk-3sq60y9f.js +2 -0
  32. package/bundle/{chunk-2qwmrp16.js → chunk-3vvd7j14.js} +1 -1
  33. package/bundle/{chunk-h10wjk96.js → chunk-3zrr4n6k.js} +2 -2
  34. package/bundle/{chunk-rcyzqa3g.js → chunk-450fef7h.js} +2 -2
  35. package/bundle/{chunk-kxjrrdj0.js → chunk-45a4n21f.js} +1 -1
  36. package/bundle/{chunk-xny5ecn0.js → chunk-47k5jy1p.js} +2 -2
  37. package/bundle/{chunk-0gab4v98.js → chunk-48r70n4s.js} +1 -1
  38. package/bundle/chunk-49mbnqvc.js +2 -0
  39. package/bundle/{chunk-t9zbp2qw.js → chunk-4agaj51z.js} +1 -1
  40. package/bundle/chunk-4fr6kae9.js +2 -0
  41. package/bundle/chunk-4v2pzx22.js +2 -0
  42. package/bundle/chunk-516w1nc4.js +2 -0
  43. package/bundle/chunk-535nm66j.js +2 -0
  44. package/bundle/{chunk-1p6jjrea.js → chunk-55fcmswd.js} +2 -2
  45. package/bundle/{chunk-n7kqdqkh.js → chunk-55ykn8nz.js} +4 -4
  46. package/bundle/chunk-58dpxf8r.js +2 -0
  47. package/bundle/chunk-58w8c6c2.js +2 -0
  48. package/bundle/{chunk-as845ya4.js → chunk-5c2438af.js} +1 -1
  49. package/bundle/chunk-5kpxpm8e.js +2 -0
  50. package/bundle/chunk-5nm5s0h2.js +2 -0
  51. package/bundle/{chunk-07s30fpb.js → chunk-5nrc5rhh.js} +1 -1
  52. package/bundle/{chunk-jwph7tpc.js → chunk-5pwv2p3s.js} +1 -1
  53. package/bundle/{chunk-q5abwn50.js → chunk-5pzs51sp.js} +1 -1
  54. package/bundle/{chunk-r0s28gnb.js → chunk-5tky3csh.js} +1 -1
  55. package/bundle/{chunk-yajd975f.js → chunk-5w76kdjr.js} +1 -1
  56. package/bundle/{chunk-wcqfr8vr.js → chunk-5ysbwr4x.js} +1 -1
  57. package/bundle/{chunk-85xh72hk.js → chunk-5zkj5xv9.js} +2 -2
  58. package/bundle/chunk-620dpezx.js +5 -0
  59. package/bundle/{chunk-fgn83bs7.js → chunk-65bmsp2t.js} +1 -1
  60. package/bundle/{chunk-9jrxrjzt.js → chunk-68v3b6ns.js} +2 -2
  61. package/bundle/{chunk-7ntw4rrn.js → chunk-6ar91jvd.js} +1 -1
  62. package/bundle/{chunk-bbbh69ys.js → chunk-6evh2ke8.js} +1 -1
  63. package/bundle/{chunk-9bm9z52r.js → chunk-6fc3gw3e.js} +1 -1
  64. package/bundle/chunk-6gpf2bjs.js +2 -0
  65. package/bundle/{chunk-a2dz9nqh.js → chunk-6m9jb0s9.js} +2 -2
  66. package/bundle/{chunk-e374shb8.js → chunk-6pe60dsw.js} +2 -2
  67. package/bundle/{chunk-yvjke593.js → chunk-6scf311w.js} +1 -1
  68. package/bundle/{chunk-epa576pa.js → chunk-6v5867cy.js} +3 -3
  69. package/bundle/{chunk-5wwd40t3.js → chunk-70q8qcb2.js} +1 -1
  70. package/bundle/{chunk-pfkm3j8g.js → chunk-73r8bjjz.js} +2 -2
  71. package/bundle/{chunk-hs3vfhar.js → chunk-7bcm7gg1.js} +1 -1
  72. package/bundle/chunk-7bgzcpdw.js +2 -0
  73. package/bundle/{chunk-ezfzb8qc.js → chunk-7g66qc1v.js} +2 -2
  74. package/bundle/{chunk-fd7fmvyw.js → chunk-7hvf9dgx.js} +1 -1
  75. package/bundle/{chunk-7zc04q43.js → chunk-7j4qne3q.js} +2 -2
  76. package/bundle/chunk-7kjvcbwa.js +2 -0
  77. package/bundle/{chunk-6j339s7a.js → chunk-7mppvhv9.js} +2 -2
  78. package/bundle/{chunk-7z884mz2.js → chunk-7msfwk15.js} +2 -2
  79. package/bundle/{chunk-kmwy6c9g.js → chunk-7vmx8bg9.js} +2 -2
  80. package/bundle/{chunk-7njz51r4.js → chunk-7x6yrtzn.js} +1 -1
  81. package/bundle/{chunk-yhsnmpzv.js → chunk-7zx1ve4w.js} +1 -1
  82. package/bundle/{chunk-skv9ww0s.js → chunk-804vmbcd.js} +1 -1
  83. package/bundle/chunk-8jma2btf.js +2 -0
  84. package/bundle/{chunk-543pt030.js → chunk-8q38721t.js} +2 -2
  85. package/bundle/{chunk-kdcnder5.js → chunk-8wwdrwf2.js} +1 -1
  86. package/bundle/{chunk-4fk46ngj.js → chunk-920z7g7j.js} +1 -1
  87. package/bundle/chunk-93e0w75z.js +2 -0
  88. package/bundle/{chunk-pzefsndd.js → chunk-953pqp3w.js} +1 -1
  89. package/bundle/chunk-97gp818s.js +2 -0
  90. package/bundle/chunk-9epf2zbh.js +2 -0
  91. package/bundle/{chunk-4hd3v58j.js → chunk-9hz56z6a.js} +1 -1
  92. package/bundle/chunk-9pmmf4k1.js +2 -0
  93. package/bundle/chunk-9y03z65a.js +2 -0
  94. package/bundle/{chunk-rk2bk4s7.js → chunk-9zm6r55d.js} +2 -2
  95. package/bundle/{chunk-t1475j9f.js → chunk-a3edstpn.js} +1 -1
  96. package/bundle/{chunk-8d6e4jg7.js → chunk-ab4dq1bn.js} +2 -2
  97. package/bundle/{chunk-w7em72p8.js → chunk-ac7482n2.js} +2 -2
  98. package/bundle/chunk-agv04nt7.js +2 -0
  99. package/bundle/{chunk-sjreby6e.js → chunk-aj1sgq1d.js} +1 -1
  100. package/bundle/chunk-ak8e1nrf.js +2 -0
  101. package/bundle/{chunk-cbmwhvxw.js → chunk-at22twxx.js} +2 -2
  102. package/bundle/{chunk-frsd6e1h.js → chunk-avefgbjg.js} +2 -2
  103. package/bundle/chunk-b034nf8g.js +2 -0
  104. package/bundle/chunk-b2p54yka.js +2 -0
  105. package/bundle/{chunk-z2h1gxyx.js → chunk-bbng1cea.js} +1 -1
  106. package/bundle/{chunk-5az84brc.js → chunk-bd21p9zz.js} +2 -2
  107. package/bundle/chunk-be7smmar.js +2 -0
  108. package/bundle/chunk-bghqsh7r.js +2 -0
  109. package/bundle/{chunk-y4e7e42x.js → chunk-bne5w117.js} +4 -4
  110. package/bundle/{chunk-j3jqk62r.js → chunk-bqn6bqws.js} +1 -1
  111. package/bundle/chunk-bryx5cx9.js +2 -0
  112. package/bundle/{chunk-tge53d52.js → chunk-bwbqkfv0.js} +1 -1
  113. package/bundle/chunk-c13rrw41.js +2 -0
  114. package/bundle/chunk-c2kkv619.js +2 -0
  115. package/bundle/{chunk-64c8q9zg.js → chunk-c36p881g.js} +3 -3
  116. package/bundle/chunk-c5xj1y5v.js +2 -0
  117. package/bundle/{chunk-91z7azf7.js → chunk-cdja76vj.js} +1 -1
  118. package/bundle/{chunk-7ab3yw9j.js → chunk-ckb1y6gv.js} +2 -2
  119. package/bundle/chunk-ckpm4dvv.js +2 -0
  120. package/bundle/{chunk-732yr6qq.js → chunk-cmb62jkt.js} +2 -2
  121. package/bundle/chunk-ct8twng1.js +2 -0
  122. package/bundle/{chunk-s77qktcn.js → chunk-cx78hhbx.js} +2 -2
  123. package/bundle/{chunk-1q1cddy4.js → chunk-cz5vta94.js} +1 -1
  124. package/bundle/{chunk-fpm2vgz6.js → chunk-d0x5pbkm.js} +1 -1
  125. package/bundle/chunk-d38y7bvh.js +2 -0
  126. package/bundle/chunk-d5qgc18n.js +2 -0
  127. package/bundle/chunk-d6hxsfm6.js +2 -0
  128. package/bundle/{chunk-29zm623f.js → chunk-d6jhs818.js} +2 -2
  129. package/bundle/chunk-descb9jz.js +2 -0
  130. package/bundle/{chunk-ssdw9zre.js → chunk-dj1jen1p.js} +1 -1
  131. package/bundle/{chunk-mswx4k75.js → chunk-dnnkq5y4.js} +2 -2
  132. package/bundle/{chunk-6pcmv8vs.js → chunk-dnsh1v42.js} +2 -2
  133. package/bundle/chunk-dvr2b9r1.js +2 -0
  134. package/bundle/chunk-dwhjgd8j.js +2 -0
  135. package/bundle/{chunk-s0ty36qg.js → chunk-dxdggn90.js} +1 -1
  136. package/bundle/chunk-dypdyrmy.js +2 -0
  137. package/bundle/{chunk-w30b563s.js → chunk-e8p92vz4.js} +2 -2
  138. package/bundle/chunk-ea5fktnn.js +2 -0
  139. package/bundle/{chunk-t1jgx17a.js → chunk-eg3syjtv.js} +2 -2
  140. package/bundle/{chunk-2a9rzgk6.js → chunk-ehb4hd9c.js} +1 -1
  141. package/bundle/{chunk-9jsgs71h.js → chunk-ejqzcdcx.js} +1 -1
  142. package/bundle/{chunk-5t0w9ecw.js → chunk-et3804wr.js} +1 -1
  143. package/bundle/{chunk-yd8bzhv6.js → chunk-ezrqhqkp.js} +1 -1
  144. package/bundle/chunk-f0t7rryn.js +3 -0
  145. package/bundle/{chunk-p635phfw.js → chunk-f31yvp20.js} +1 -1
  146. package/bundle/chunk-f4mf6tpp.js +2 -0
  147. package/bundle/chunk-f97k17t8.js +2 -0
  148. package/bundle/{chunk-yx1h0b5v.js → chunk-faee8zgc.js} +1 -1
  149. package/bundle/{chunk-p9mj4zyk.js → chunk-ff548b0j.js} +2 -2
  150. package/bundle/{chunk-bgng3rdj.js → chunk-fhqfqd5v.js} +2 -2
  151. package/bundle/{chunk-zek5c15t.js → chunk-fjbv3jht.js} +1 -1
  152. package/bundle/{chunk-hq9bgnqb.js → chunk-g22e4gw7.js} +1 -1
  153. package/bundle/chunk-g26tersc.js +2 -0
  154. package/bundle/{chunk-s0ptrw0z.js → chunk-g3wvtyw3.js} +1 -1
  155. package/bundle/{chunk-x4pdpka8.js → chunk-g42krp0z.js} +1 -1
  156. package/bundle/chunk-g4ehhdzp.js +2 -0
  157. package/bundle/{chunk-a9y27zd2.js → chunk-gbkz04ke.js} +1 -1
  158. package/bundle/chunk-gd6qpdjw.js +2 -0
  159. package/bundle/chunk-gehn9fd9.js +2 -0
  160. package/bundle/{chunk-0zxwjsvz.js → chunk-ggxzf22k.js} +1 -1
  161. package/bundle/{chunk-45fyv9f1.js → chunk-grnjm8ev.js} +2 -2
  162. package/bundle/{chunk-kzvvvj79.js → chunk-gszvgz76.js} +2 -2
  163. package/bundle/{chunk-g3kd4957.js → chunk-gy21fw82.js} +2 -2
  164. package/bundle/{chunk-cbf1y12x.js → chunk-h62chdmw.js} +1 -1
  165. package/bundle/{chunk-c1g8n10t.js → chunk-ha1w0xzh.js} +1 -1
  166. package/bundle/{chunk-rpfhgncs.js → chunk-has2rz35.js} +1 -1
  167. package/bundle/{chunk-6f8qqbac.js → chunk-hg4039nz.js} +166 -205
  168. package/bundle/chunk-hhax4mxw.js +2 -0
  169. package/bundle/{chunk-087tnr8a.js → chunk-hwrrrbqd.js} +1 -1
  170. package/bundle/chunk-hz3h6e19.js +2 -0
  171. package/bundle/{chunk-yd2emszh.js → chunk-j0bwa5dk.js} +2 -2
  172. package/bundle/{chunk-9b4aqcde.js → chunk-j164q40b.js} +2 -2
  173. package/bundle/{chunk-et5dnymk.js → chunk-j4ad3mde.js} +2 -2
  174. package/bundle/{chunk-qhnpq5gb.js → chunk-j8fcfhr2.js} +2 -2
  175. package/bundle/chunk-j8nkz81m.js +7 -0
  176. package/bundle/{chunk-9ea1n338.js → chunk-j9h1sp4g.js} +2 -2
  177. package/bundle/{chunk-zcp0wx4j.js → chunk-jdx3jshm.js} +2 -2
  178. package/bundle/chunk-jebss7x8.js +2 -0
  179. package/bundle/{chunk-yrfq22a5.js → chunk-jg1ccs3j.js} +1 -1
  180. package/bundle/chunk-jqekpprn.js +3 -0
  181. package/bundle/{chunk-d307vb2d.js → chunk-jqk3v8d6.js} +1 -1
  182. package/bundle/chunk-jvkzdap1.js +2 -0
  183. package/bundle/{chunk-pp9neaaz.js → chunk-jww55nk9.js} +1 -1
  184. package/bundle/{chunk-fvy24yhq.js → chunk-k1nh5sd2.js} +1 -1
  185. package/bundle/chunk-k2g8346v.js +3 -0
  186. package/bundle/chunk-k2vsezeb.js +2 -0
  187. package/bundle/{chunk-wfggztm4.js → chunk-k4gsktts.js} +1 -1
  188. package/bundle/{chunk-qaz100ht.js → chunk-k5q9px67.js} +1 -1
  189. package/bundle/{chunk-mrn44msr.js → chunk-k6y2vw0d.js} +2 -2
  190. package/bundle/chunk-kg8fcv91.js +2 -0
  191. package/bundle/chunk-kgptyf7n.js +3 -0
  192. package/bundle/{chunk-b50t4jc5.js → chunk-khzzmyk2.js} +1 -1
  193. package/bundle/chunk-kjjjrjnb.js +2 -0
  194. package/bundle/{chunk-dbztxdea.js → chunk-kp6gh35c.js} +2 -2
  195. package/bundle/{chunk-g7k6ecb2.js → chunk-kqhczjf6.js} +1 -1
  196. package/bundle/{chunk-jvjq554f.js → chunk-ksme3gj1.js} +1 -1
  197. package/bundle/chunk-m5cfmhwh.js +2 -0
  198. package/bundle/{chunk-4v61ysex.js → chunk-m5dm7a1t.js} +1 -1
  199. package/bundle/{chunk-yr35q7q1.js → chunk-m7ganre7.js} +1 -1
  200. package/bundle/chunk-m7qxxbns.js +2 -0
  201. package/bundle/{chunk-y287zwkr.js → chunk-mh19kwzw.js} +1 -1
  202. package/bundle/{chunk-7my2231h.js → chunk-mhhtf0v3.js} +1 -1
  203. package/bundle/{chunk-grw4gg9j.js → chunk-mjjaezwq.js} +2 -2
  204. package/bundle/{chunk-03mbn7nj.js → chunk-mmjgf680.js} +2 -2
  205. package/bundle/{chunk-jv4th87b.js → chunk-mn9end71.js} +1 -1
  206. package/bundle/{chunk-3h49k2ck.js → chunk-n23d0q00.js} +1 -1
  207. package/bundle/{chunk-mpe8zxc0.js → chunk-n78f8hfk.js} +1 -1
  208. package/bundle/chunk-n8wg5h5p.js +2 -0
  209. package/bundle/{chunk-gr4bctqj.js → chunk-nj1ntakd.js} +2 -2
  210. package/bundle/{chunk-wdaf713t.js → chunk-nrat6ncm.js} +1 -1
  211. package/bundle/{chunk-rm5ntsvn.js → chunk-nty5z2cj.js} +1 -1
  212. package/bundle/{chunk-rp8asmq7.js → chunk-p169ee92.js} +1 -1
  213. package/bundle/{chunk-fbm6qczy.js → chunk-p4027t94.js} +1 -1
  214. package/bundle/{chunk-94qhpkfx.js → chunk-p54bzjtv.js} +1 -1
  215. package/bundle/{chunk-cp39f96a.js → chunk-p5be5ddp.js} +1 -1
  216. package/bundle/{chunk-ngvp6zc2.js → chunk-p6crzjtf.js} +2 -2
  217. package/bundle/chunk-p6hcj3kv.js +2 -0
  218. package/bundle/{chunk-p4ewy9xh.js → chunk-pb30kkbs.js} +6 -6
  219. package/bundle/chunk-pdjafjry.js +3 -0
  220. package/bundle/chunk-pexmns0j.js +2 -0
  221. package/bundle/{chunk-my3cswnp.js → chunk-ph8hn1wt.js} +2 -2
  222. package/bundle/chunk-pkn85169.js +2 -0
  223. package/bundle/{chunk-99148b1k.js → chunk-pmg53fdd.js} +1 -1
  224. package/bundle/{chunk-wf4x5cjc.js → chunk-pr7z5dj8.js} +1 -1
  225. package/bundle/chunk-pt603np4.js +2 -0
  226. package/bundle/{chunk-4mvg7jt1.js → chunk-ptqk1j2r.js} +1 -1
  227. package/bundle/{chunk-a92hh67a.js → chunk-pxm4qvqk.js} +2 -2
  228. package/bundle/{chunk-3qfpw8f6.js → chunk-qey1efpx.js} +1 -1
  229. package/bundle/chunk-qk5bfcv8.js +2 -0
  230. package/bundle/{chunk-9s785py4.js → chunk-qk9x8j8d.js} +1 -1
  231. package/bundle/chunk-qnaw8k98.js +2 -0
  232. package/bundle/{chunk-ks1cs80p.js → chunk-qnvsqnz5.js} +2 -2
  233. package/bundle/{chunk-bcx2vkv4.js → chunk-qp1n7kwe.js} +1 -1
  234. package/bundle/chunk-qr06byhp.js +2 -0
  235. package/bundle/{chunk-gtjn3yc4.js → chunk-qxcyz5hc.js} +2 -2
  236. package/bundle/{chunk-tj3rem3q.js → chunk-r5zy4za0.js} +2 -2
  237. package/bundle/chunk-r6p0bd2w.js +8251 -0
  238. package/bundle/chunk-r7sq3maz.js +2 -0
  239. package/bundle/{chunk-f83wv08n.js → chunk-r9w0thdk.js} +1 -1
  240. package/bundle/chunk-rmgs9nmj.js +2 -0
  241. package/bundle/{chunk-p887g1xj.js → chunk-rn83r0js.js} +1 -1
  242. package/bundle/{chunk-n90eh3e7.js → chunk-rrv0n73b.js} +1 -1
  243. package/bundle/chunk-rv08wm9j.js +2 -0
  244. package/bundle/chunk-rytavefg.js +2 -0
  245. package/bundle/{chunk-yz0pwv2m.js → chunk-s4vx9x1v.js} +1 -1
  246. package/bundle/{chunk-x2cavpa9.js → chunk-sfw5qddj.js} +1 -1
  247. package/bundle/chunk-sh9vjnsh.js +2 -0
  248. package/bundle/{chunk-6avjq7my.js → chunk-smznrv7k.js} +1 -1
  249. package/bundle/{chunk-vtw0wwch.js → chunk-snqa3zsm.js} +3 -3
  250. package/bundle/chunk-st0c5wwc.js +2 -0
  251. package/bundle/{chunk-vqss3e48.js → chunk-t0761rhq.js} +2 -2
  252. package/bundle/{chunk-vqpfpmha.js → chunk-t239rvej.js} +2 -2
  253. package/bundle/{chunk-5js6a6gf.js → chunk-t2n7vgsq.js} +1 -1
  254. package/bundle/chunk-t6yzrmww.js +2 -0
  255. package/bundle/{chunk-bggybm9k.js → chunk-t8c4cs6z.js} +1 -1
  256. package/bundle/chunk-teb3k2sf.js +2 -0
  257. package/bundle/{chunk-ve3np791.js → chunk-tg226j37.js} +1 -1
  258. package/bundle/chunk-thrfabyv.js +35 -0
  259. package/bundle/{chunk-73fz0cf4.js → chunk-tkrwcjkr.js} +2 -2
  260. package/bundle/{chunk-v5z6sx6j.js → chunk-tm34qp8j.js} +1 -1
  261. package/bundle/chunk-tr6rdr6h.js +4 -0
  262. package/bundle/chunk-ts798jvf.js +2 -0
  263. package/bundle/{chunk-a550vst5.js → chunk-twp3mjj0.js} +9 -9
  264. package/bundle/chunk-tx5aj02v.js +2 -0
  265. package/bundle/chunk-v1t51rrq.js +2 -0
  266. package/bundle/{chunk-vk88jj60.js → chunk-v3arcn10.js} +1 -1
  267. package/bundle/{chunk-e586sjb0.js → chunk-vcygx6hs.js} +2 -2
  268. package/bundle/{chunk-86yk21g4.js → chunk-venprxdp.js} +1 -1
  269. package/bundle/{chunk-ywkvq7zb.js → chunk-vf492zs6.js} +1 -1
  270. package/bundle/chunk-vh9ptqn0.js +2 -0
  271. package/bundle/{chunk-w79jzf8w.js → chunk-vnrjk2be.js} +1 -1
  272. package/bundle/{chunk-8q5ns61h.js → chunk-vshycswk.js} +1 -1
  273. package/bundle/{chunk-8e6gx3gg.js → chunk-vsz4s6zt.js} +1 -1
  274. package/bundle/{chunk-vhe92p7a.js → chunk-vygkwwjd.js} +2 -2
  275. package/bundle/{chunk-9rxyq6f9.js → chunk-w46g7kdq.js} +2 -2
  276. package/bundle/{chunk-q128vfc6.js → chunk-w4brava0.js} +1 -1
  277. package/bundle/{chunk-drwqag0f.js → chunk-w4synhfg.js} +1 -1
  278. package/bundle/chunk-w72rctxz.js +2 -0
  279. package/bundle/{chunk-h2bmss2m.js → chunk-w88ve2pm.js} +1 -1
  280. package/bundle/{chunk-mxhb5adq.js → chunk-w9gzfsy7.js} +2 -2
  281. package/bundle/chunk-wbw9zv3h.js +2 -0
  282. package/bundle/{chunk-1sfcxdbw.js → chunk-wkg3c643.js} +2 -2
  283. package/bundle/{chunk-2bgqy6z7.js → chunk-wwdpw27v.js} +1 -1
  284. package/bundle/{chunk-km1n4ttr.js → chunk-wy3a4cab.js} +1 -1
  285. package/bundle/{chunk-tczbhj0e.js → chunk-wyj8cpx5.js} +1 -1
  286. package/bundle/{chunk-3888asr7.js → chunk-x65xbskr.js} +1 -1
  287. package/bundle/chunk-x6mw98c2.js +2 -0
  288. package/bundle/chunk-x749e61j.js +2 -0
  289. package/bundle/{chunk-8rh0femq.js → chunk-xdd3553a.js} +1 -1
  290. package/bundle/{chunk-2jpmxt4v.js → chunk-xdteq9bd.js} +1 -1
  291. package/bundle/{chunk-9y15zjxa.js → chunk-xe69cnsk.js} +1 -1
  292. package/bundle/chunk-xpjhe9gz.js +2 -0
  293. package/bundle/{chunk-8v6x712g.js → chunk-xv5z1bj6.js} +2 -2
  294. package/bundle/{chunk-bk3z400e.js → chunk-y0527cg0.js} +1 -1
  295. package/bundle/{chunk-hrw5rmj1.js → chunk-y29ejqg2.js} +1 -1
  296. package/bundle/{chunk-42r7z6sq.js → chunk-y67kaj0b.js} +1 -1
  297. package/bundle/chunk-y6p57wgh.js +2 -0
  298. package/bundle/chunk-y6xs8v17.js +2 -0
  299. package/bundle/{chunk-zdzxsyxs.js → chunk-y7hgevfv.js} +2 -2
  300. package/bundle/{chunk-k1gddnkm.js → chunk-ybane1en.js} +1 -1
  301. package/bundle/{chunk-k6cbfrzc.js → chunk-yhj01dz9.js} +2 -2
  302. package/bundle/chunk-ym09zrxe.js +3 -0
  303. package/bundle/{chunk-2xqqkf86.js → chunk-ypdt9mmr.js} +2 -2
  304. package/bundle/chunk-ytetprwr.js +2 -0
  305. package/bundle/{chunk-vm1ek7yf.js → chunk-yz25607t.js} +1 -1
  306. package/bundle/{chunk-ypcc3cnb.js → chunk-z1932c3f.js} +1 -1
  307. package/bundle/chunk-z3xsfpc6.js +2 -0
  308. package/bundle/{chunk-6ypafpg8.js → chunk-z6sbjvtv.js} +1 -1
  309. package/bundle/{chunk-ta7mfkms.js → chunk-zc0cdvcv.js} +2 -2
  310. package/bundle/chunk-zn5pw733.js +2 -0
  311. package/bundle/chunk-ztn9e8g1.js +2 -0
  312. package/bundle/{chunk-ywdtp534.js → chunk-ztyy3ga3.js} +2 -2
  313. package/bundle/chunk-zxwvnmea.js +2 -0
  314. package/bundle/chunk-zzznad30.js +2 -0
  315. package/bundle/index.js +18 -18
  316. package/bundle/parser.worker.js +2 -2
  317. package/bundle/qffi-compat.so +0 -0
  318. package/bundle/qffi.node +0 -0
  319. package/bundle/worker.js +1 -1
  320. package/package.json +1 -1
  321. package/bundle/chunk-0cdtq1r3.js +0 -2
  322. package/bundle/chunk-0ych0f5w.js +0 -2
  323. package/bundle/chunk-0yjdatm6.js +0 -3
  324. package/bundle/chunk-0ykeedfm.js +0 -2
  325. package/bundle/chunk-22hr3ndh.js +0 -2
  326. package/bundle/chunk-23tyxyyj.js +0 -2
  327. package/bundle/chunk-2517cev8.js +0 -2
  328. package/bundle/chunk-28g1ndpx.js +0 -2
  329. package/bundle/chunk-2avxtbv3.js +0 -2
  330. package/bundle/chunk-2faah8w1.js +0 -2
  331. package/bundle/chunk-2qk0k2eb.js +0 -2
  332. package/bundle/chunk-3c3xzz0g.js +0 -3
  333. package/bundle/chunk-42wdfks8.js +0 -2
  334. package/bundle/chunk-44y6dffe.js +0 -2
  335. package/bundle/chunk-4f19vqxf.js +0 -2
  336. package/bundle/chunk-4m3k1atq.js +0 -2
  337. package/bundle/chunk-4n2ytddp.js +0 -2
  338. package/bundle/chunk-4yg42p6y.js +0 -2
  339. package/bundle/chunk-4zx3ze68.js +0 -2
  340. package/bundle/chunk-637sjdzq.js +0 -2
  341. package/bundle/chunk-6h8f89tt.js +0 -2
  342. package/bundle/chunk-6sjj203r.js +0 -2
  343. package/bundle/chunk-79aka9xe.js +0 -2
  344. package/bundle/chunk-7nqdhe7x.js +0 -2
  345. package/bundle/chunk-7q003wdd.js +0 -4
  346. package/bundle/chunk-7x88b2n2.js +0 -2
  347. package/bundle/chunk-8apeexas.js +0 -3
  348. package/bundle/chunk-8mthftwc.js +0 -2
  349. package/bundle/chunk-8wdara3b.js +0 -2
  350. package/bundle/chunk-8xhzpnph.js +0 -2
  351. package/bundle/chunk-96sqbyvf.js +0 -2
  352. package/bundle/chunk-9akz8w0d.js +0 -2
  353. package/bundle/chunk-9etpppyv.js +0 -3
  354. package/bundle/chunk-9pnpmtb2.js +0 -2
  355. package/bundle/chunk-a5pbvp1f.js +0 -7
  356. package/bundle/chunk-a7p0x4sw.js +0 -2
  357. package/bundle/chunk-ae0a496j.js +0 -2
  358. package/bundle/chunk-aq1j9y18.js +0 -2
  359. package/bundle/chunk-aq8nz9hp.js +0 -2
  360. package/bundle/chunk-b4zy78be.js +0 -2
  361. package/bundle/chunk-basjzwqp.js +0 -2
  362. package/bundle/chunk-bhetpmgq.js +0 -3
  363. package/bundle/chunk-bm7xpjh6.js +0 -2
  364. package/bundle/chunk-c1bw1q75.js +0 -2
  365. package/bundle/chunk-c2k556rk.js +0 -2
  366. package/bundle/chunk-c47vp7ne.js +0 -2
  367. package/bundle/chunk-cbhgf058.js +0 -2
  368. package/bundle/chunk-d41mg7at.js +0 -2
  369. package/bundle/chunk-d50kpss6.js +0 -2
  370. package/bundle/chunk-day0rb5p.js +0 -2
  371. package/bundle/chunk-dp7cww4v.js +0 -2
  372. package/bundle/chunk-dy31mchw.js +0 -3
  373. package/bundle/chunk-e5rda9mx.js +0 -2
  374. package/bundle/chunk-e999xtfj.js +0 -2
  375. package/bundle/chunk-ehfxypks.js +0 -7610
  376. package/bundle/chunk-eyr0vf92.js +0 -2
  377. package/bundle/chunk-gbmmbhy4.js +0 -2
  378. package/bundle/chunk-gp877cq5.js +0 -2
  379. package/bundle/chunk-h4f582d6.js +0 -2
  380. package/bundle/chunk-h57c6ne3.js +0 -2
  381. package/bundle/chunk-hk8vvc10.js +0 -2
  382. package/bundle/chunk-hnrqhcgq.js +0 -2
  383. package/bundle/chunk-hwavzxdm.js +0 -2
  384. package/bundle/chunk-hwnc2sa5.js +0 -2
  385. package/bundle/chunk-hy86wfad.js +0 -2
  386. package/bundle/chunk-j17421hz.js +0 -2
  387. package/bundle/chunk-j2gvpa15.js +0 -2
  388. package/bundle/chunk-j7n8khk7.js +0 -2
  389. package/bundle/chunk-jkh98wby.js +0 -2
  390. package/bundle/chunk-k5a652s4.js +0 -2
  391. package/bundle/chunk-k6w32q2p.js +0 -2
  392. package/bundle/chunk-kghwk0yh.js +0 -2
  393. package/bundle/chunk-kh8de8re.js +0 -2
  394. package/bundle/chunk-mce8aa9y.js +0 -2
  395. package/bundle/chunk-me1ja46g.js +0 -2
  396. package/bundle/chunk-mgadsp7r.js +0 -2
  397. package/bundle/chunk-n0k0pp4k.js +0 -2
  398. package/bundle/chunk-n393nnh5.js +0 -2
  399. package/bundle/chunk-n5vyed7w.js +0 -2
  400. package/bundle/chunk-pasm65wq.js +0 -2
  401. package/bundle/chunk-phpmxjf8.js +0 -2
  402. package/bundle/chunk-q2q3dmg3.js +0 -2
  403. package/bundle/chunk-qvzvxsjw.js +0 -2
  404. package/bundle/chunk-racrb1b3.js +0 -2
  405. package/bundle/chunk-s0c0t6qr.js +0 -5
  406. package/bundle/chunk-sghy9s7m.js +0 -2
  407. package/bundle/chunk-skpkjnyy.js +0 -2
  408. package/bundle/chunk-skxhg212.js +0 -2
  409. package/bundle/chunk-snt4kwab.js +0 -2
  410. package/bundle/chunk-sq47t8f1.js +0 -2
  411. package/bundle/chunk-sqhgnvvs.js +0 -2
  412. package/bundle/chunk-t114r59h.js +0 -2
  413. package/bundle/chunk-t1f56k0j.js +0 -2
  414. package/bundle/chunk-t69jx6fz.js +0 -2
  415. package/bundle/chunk-tsb3jsx4.js +0 -2
  416. package/bundle/chunk-ttpbpzbh.js +0 -2
  417. package/bundle/chunk-v667egp5.js +0 -2
  418. package/bundle/chunk-vrv67tt0.js +0 -2
  419. package/bundle/chunk-wcx7hc2p.js +0 -635
  420. package/bundle/chunk-wv8qx8sa.js +0 -2
  421. package/bundle/chunk-xxrtr6sd.js +0 -2
  422. package/bundle/chunk-y2ptjam9.js +0 -3
  423. package/bundle/chunk-y6h35v4a.js +0 -2
  424. package/bundle/chunk-y72p79v2.js +0 -2
  425. package/bundle/chunk-y8eggnrr.js +0 -2
  426. package/bundle/chunk-y9q0f9qz.js +0 -2
  427. package/bundle/chunk-yck5h49c.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{_n as z2}from"./chunk-rk2bk4s7.js";import{Wq as i0,Yq as s0}from"./chunk-8v6x712g.js";import{ms as Q2}from"./chunk-gr4bctqj.js";import{rs as E0}from"./chunk-73fz0cf4.js";import{zs as x0}from"./chunk-xmjntwjc.js";import{Vs as t}from"./chunk-tj3rem3q.js";import{et as e}from"./chunk-7q003wdd.js";import{Bt as o,Dt as j0,ot as $2,ut as f,yt as S,zt as a0}from"./chunk-cbmwhvxw.js";import{Et as p}from"./chunk-9etpppyv.js";import{gz as d0}from"./chunk-1p6jjrea.js";import{EB as L,SB as V0,WE as g,hA as o0,kH as K0,kO as w,pF as c,wK as Z2,xH as J}from"./chunk-ks1cs80p.js";import{LO as W0,NO as e0,PO as L2}from"./chunk-f83wv08n.js";function z0(Z,Q=!1){let z=Z.length,$=0,X="",Y=0,U=16,G=0,W=0,I=0,H=0,q=0;function R(j,_){let V=0,B=0;while(V<j||!_){let M=Z.charCodeAt($);if(M>=48&&M<=57)B=B*16+M-48;else if(M>=65&&M<=70)B=B*16+M-65+10;else if(M>=97&&M<=102)B=B*16+M-97+10;else break;$++,V++}if(V<j)B=-1;return B}function N(j){$=j,X="",Y=0,U=16,q=0}function A(){let j=$;if(Z.charCodeAt($)===48)$++;else{$++;while($<Z.length&&s(Z.charCodeAt($)))$++}if($<Z.length&&Z.charCodeAt($)===46)if($++,$<Z.length&&s(Z.charCodeAt($))){$++;while($<Z.length&&s(Z.charCodeAt($)))$++}else return q=3,Z.substring(j,$);let _=$;if($<Z.length&&(Z.charCodeAt($)===69||Z.charCodeAt($)===101)){if($++,$<Z.length&&Z.charCodeAt($)===43||Z.charCodeAt($)===45)$++;if($<Z.length&&s(Z.charCodeAt($))){$++;while($<Z.length&&s(Z.charCodeAt($)))$++;_=$}else q=3}return Z.substring(j,_)}function O(){let j="",_=$;while(!0){if($>=z){j+=Z.substring(_,$),q=2;break}let V=Z.charCodeAt($);if(V===34){j+=Z.substring(_,$),$++;break}if(V===92){if(j+=Z.substring(_,$),$++,$>=z){q=2;break}switch(Z.charCodeAt($++)){case 34:j+='"';break;case 92:j+="\\";break;case 47:j+="/";break;case 98:j+="\b";break;case 102:j+="\f";break;case 110:j+=`
2
+ import{Jn as z2}from"./chunk-9zm6r55d.js";import{Fq as i0,Hq as s0}from"./chunk-xv5z1bj6.js";import{Xr as Q2}from"./chunk-nj1ntakd.js";import{as as E0}from"./chunk-tkrwcjkr.js";import{is as x0}from"./chunk-09geev0j.js";import{Es as t}from"./chunk-r5zy4za0.js";import{Ns as e}from"./chunk-tr6rdr6h.js";import{Xs as $2,bt as f,ft as S,gt as a0,it as o,kt as j0}from"./chunk-at22twxx.js";import{lt as p}from"./chunk-kgptyf7n.js";import{Py as d0}from"./chunk-55fcmswd.js";import{DE as g,Qz as o0,TG as K0,TN as w,YE as c,dK as Z2,eH as J,lB as L,zB as V0}from"./chunk-qnvsqnz5.js";import{sO as W0,uO as e0,wO as L2}from"./chunk-r9w0thdk.js";function z0(Z,Q=!1){let z=Z.length,$=0,X="",Y=0,U=16,G=0,W=0,I=0,H=0,q=0;function R(j,_){let V=0,B=0;while(V<j||!_){let M=Z.charCodeAt($);if(M>=48&&M<=57)B=B*16+M-48;else if(M>=65&&M<=70)B=B*16+M-65+10;else if(M>=97&&M<=102)B=B*16+M-97+10;else break;$++,V++}if(V<j)B=-1;return B}function N(j){$=j,X="",Y=0,U=16,q=0}function A(){let j=$;if(Z.charCodeAt($)===48)$++;else{$++;while($<Z.length&&s(Z.charCodeAt($)))$++}if($<Z.length&&Z.charCodeAt($)===46)if($++,$<Z.length&&s(Z.charCodeAt($))){$++;while($<Z.length&&s(Z.charCodeAt($)))$++}else return q=3,Z.substring(j,$);let _=$;if($<Z.length&&(Z.charCodeAt($)===69||Z.charCodeAt($)===101)){if($++,$<Z.length&&Z.charCodeAt($)===43||Z.charCodeAt($)===45)$++;if($<Z.length&&s(Z.charCodeAt($))){$++;while($<Z.length&&s(Z.charCodeAt($)))$++;_=$}else q=3}return Z.substring(j,_)}function O(){let j="",_=$;while(!0){if($>=z){j+=Z.substring(_,$),q=2;break}let V=Z.charCodeAt($);if(V===34){j+=Z.substring(_,$),$++;break}if(V===92){if(j+=Z.substring(_,$),$++,$>=z){q=2;break}switch(Z.charCodeAt($++)){case 34:j+='"';break;case 92:j+="\\";break;case 47:j+="/";break;case 98:j+="\b";break;case 102:j+="\f";break;case 110:j+=`
3
3
  `;break;case 114:j+="\r";break;case 116:j+="\t";break;case 117:let M=R(4,!0);if(M>=0)j+=String.fromCharCode(M);else q=4;break;default:q=5}_=$;continue}if(V>=0&&V<=31)if(Q0(V)){j+=Z.substring(_,$),q=2;break}else q=6;$++}return j}function K(){if(X="",q=0,Y=$,W=G,H=I,$>=z)return Y=z,U=17;let j=Z.charCodeAt($);if(b0(j)){do $++,X+=String.fromCharCode(j),j=Z.charCodeAt($);while(b0(j));return U=15}if(Q0(j)){if($++,X+=String.fromCharCode(j),j===13&&Z.charCodeAt($)===10)$++,X+=`
4
4
  `;return G++,I=$,U=14}switch(j){case 123:return $++,U=1;case 125:return $++,U=2;case 91:return $++,U=3;case 93:return $++,U=4;case 58:return $++,U=6;case 44:return $++,U=5;case 34:return $++,X=O(),U=10;case 47:let _=$-1;if(Z.charCodeAt($+1)===47){$+=2;while($<z){if(Q0(Z.charCodeAt($)))break;$++}return X=Z.substring(_,$),U=12}if(Z.charCodeAt($+1)===42){$+=2;let V=z-1,B=!1;while($<V){let M=Z.charCodeAt($);if(M===42&&Z.charCodeAt($+1)===47){$+=2,B=!0;break}if($++,Q0(M)){if(M===13&&Z.charCodeAt($)===10)$++;G++,I=$}}if(!B)$++,q=1;return X=Z.substring(_,$),U=13}return X+=String.fromCharCode(j),$++,U=16;case 45:if(X+=String.fromCharCode(j),$++,$===z||!s(Z.charCodeAt($)))return U=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return X+=A(),U=11;default:while($<z&&y(j))$++,j=Z.charCodeAt($);if(Y!==$){switch(X=Z.substring(Y,$),X){case"true":return U=8;case"false":return U=9;case"null":return U=7}return U=16}return X+=String.fromCharCode(j),$++,U=16}}function y(j){if(b0(j)||Q0(j))return!1;switch(j){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let j;do j=K();while(j>=12&&j<=15);return j}return{setPosition:N,getPosition:()=>$,scan:Q?v:K,getToken:()=>U,getTokenValue:()=>X,getTokenOffset:()=>Y,getTokenLength:()=>$-Y,getTokenStartLine:()=>W,getTokenStartCharacter:()=>Y-H,getTokenError:()=>q}}function b0(Z){return Z===32||Z===9}function Q0(Z){return Z===10||Z===13}function s(Z){return Z>=48&&Z<=57}var u0;(function(Z){Z[Z.lineFeed=10]="lineFeed",Z[Z.carriageReturn=13]="carriageReturn",Z[Z.space=32]="space",Z[Z._0=48]="_0",Z[Z._1=49]="_1",Z[Z._2=50]="_2",Z[Z._3=51]="_3",Z[Z._4=52]="_4",Z[Z._5=53]="_5",Z[Z._6=54]="_6",Z[Z._7=55]="_7",Z[Z._8=56]="_8",Z[Z._9=57]="_9",Z[Z.a=97]="a",Z[Z.b=98]="b",Z[Z.c=99]="c",Z[Z.d=100]="d",Z[Z.e=101]="e",Z[Z.f=102]="f",Z[Z.g=103]="g",Z[Z.h=104]="h",Z[Z.i=105]="i",Z[Z.j=106]="j",Z[Z.k=107]="k",Z[Z.l=108]="l",Z[Z.m=109]="m",Z[Z.n=110]="n",Z[Z.o=111]="o",Z[Z.p=112]="p",Z[Z.q=113]="q",Z[Z.r=114]="r",Z[Z.s=115]="s",Z[Z.t=116]="t",Z[Z.u=117]="u",Z[Z.v=118]="v",Z[Z.w=119]="w",Z[Z.x=120]="x",Z[Z.y=121]="y",Z[Z.z=122]="z",Z[Z.A=65]="A",Z[Z.B=66]="B",Z[Z.C=67]="C",Z[Z.D=68]="D",Z[Z.E=69]="E",Z[Z.F=70]="F",Z[Z.G=71]="G",Z[Z.H=72]="H",Z[Z.I=73]="I",Z[Z.J=74]="J",Z[Z.K=75]="K",Z[Z.L=76]="L",Z[Z.M=77]="M",Z[Z.N=78]="N",Z[Z.O=79]="O",Z[Z.P=80]="P",Z[Z.Q=81]="Q",Z[Z.R=82]="R",Z[Z.S=83]="S",Z[Z.T=84]="T",Z[Z.U=85]="U",Z[Z.V=86]="V",Z[Z.W=87]="W",Z[Z.X=88]="X",Z[Z.Y=89]="Y",Z[Z.Z=90]="Z",Z[Z.asterisk=42]="asterisk",Z[Z.backslash=92]="backslash",Z[Z.closeBrace=125]="closeBrace",Z[Z.closeBracket=93]="closeBracket",Z[Z.colon=58]="colon",Z[Z.comma=44]="comma",Z[Z.dot=46]="dot",Z[Z.doubleQuote=34]="doubleQuote",Z[Z.minus=45]="minus",Z[Z.openBrace=123]="openBrace",Z[Z.openBracket=91]="openBracket",Z[Z.plus=43]="plus",Z[Z.slash=47]="slash",Z[Z.formFeed=12]="formFeed",Z[Z.tab=9]="tab"})(u0||(u0={}));var x=Array(20).fill(0).map((Z,Q)=>{return" ".repeat(Q)});var L0={" ":{"\n":Array(200).fill(0).map((Z,Q)=>{return`
5
5
  `+" ".repeat(Q)}),"\r":Array(200).fill(0).map((Z,Q)=>{return"\r"+" ".repeat(Q)}),"\r\n":Array(200).fill(0).map((Z,Q)=>{return`\r
@@ -13,5 +13,5 @@ import{_n as z2}from"./chunk-rk2bk4s7.js";import{Wq as i0,Yq as s0}from"./chunk-
13
13
  `)return`
14
14
  `}return Z&&Z.eol||`
15
15
  `}function X0(Z,Q){return`\r
16
- `.indexOf(Z.charAt(Q))!==-1}var Y0;(function(Z){Z.DEFAULT={allowTrailingComma:!1}})(Y0||(Y0={}));function l0(Z,Q=[],z=Y0.DEFAULT){let $=null,X=[],Y=[];function U(W){if(Array.isArray(X))X.push(W);else if($!==null)X[$]=W}return P0(Z,{onObjectBegin:()=>{let W={};U(W),Y.push(X),X=W,$=null},onObjectProperty:(W)=>{$=W},onObjectEnd:()=>{X=Y.pop()},onArrayBegin:()=>{let W=[];U(W),Y.push(X),X=W,$=null},onArrayEnd:()=>{X=Y.pop()},onLiteralValue:U,onError:(W,I,H)=>{Q.push({error:W,offset:I,length:H})}},z),X[0]}function y0(Z,Q=[],z=Y0.DEFAULT){let $={type:"array",offset:-1,length:-1,children:[],parent:void 0};function X(W){if($.type==="property")$.length=W-$.offset,$=$.parent}function Y(W){return $.children.push(W),W}P0(Z,{onObjectBegin:(W)=>{$=Y({type:"object",offset:W,length:-1,parent:$,children:[]})},onObjectProperty:(W,I,H)=>{$=Y({type:"property",offset:I,length:-1,parent:$,children:[]}),$.children.push({type:"string",value:W,offset:I,length:H,parent:$})},onObjectEnd:(W,I)=>{X(W+I),$.length=W+I-$.offset,$=$.parent,X(W+I)},onArrayBegin:(W,I)=>{$=Y({type:"array",offset:W,length:-1,parent:$,children:[]})},onArrayEnd:(W,I)=>{$.length=W+I-$.offset,$=$.parent,X(W+I)},onLiteralValue:(W,I,H)=>{Y({type:F2(W),offset:I,length:H,parent:$,value:W}),X(I+H)},onSeparator:(W,I,H)=>{if($.type==="property"){if(W===":")$.colonOffset=I;else if(W===",")X(I)}},onError:(W,I,H)=>{Q.push({error:W,offset:I,length:H})}},z);let G=$.children[0];if(G)delete G.parent;return G}function I0(Z,Q){if(!Z)return;let z=Z;for(let $ of Q)if(typeof $==="string"){if(z.type!=="object"||!Array.isArray(z.children))return;let X=!1;for(let Y of z.children)if(Array.isArray(Y.children)&&Y.children[0].value===$&&Y.children.length===2){z=Y.children[1],X=!0;break}if(!X)return}else{let X=$;if(z.type!=="array"||X<0||!Array.isArray(z.children)||X>=z.children.length)return;z=z.children[X]}return z}function P0(Z,Q,z=Y0.DEFAULT){let $=z0(Z,!1),X=[],Y=0;function U(F){return F?()=>Y===0&&F($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter()):()=>!0}function G(F){return F?(b)=>Y===0&&F(b,$.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter()):()=>!0}function W(F){return F?(b)=>Y===0&&F(b,$.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter(),()=>X.slice()):()=>!0}function I(F){return F?()=>{if(Y>0)Y++;else if(F($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter(),()=>X.slice())===!1)Y=1}:()=>!0}function H(F){return F?()=>{if(Y>0)Y--;if(Y===0)F($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter())}:()=>!0}let q=I(Q.onObjectBegin),R=W(Q.onObjectProperty),N=H(Q.onObjectEnd),A=I(Q.onArrayBegin),O=H(Q.onArrayEnd),K=W(Q.onLiteralValue),y=G(Q.onSeparator),v=U(Q.onComment),j=G(Q.onError),_=z&&z.disallowComments,V=z&&z.allowTrailingComma;function B(){while(!0){let F=$.scan();switch($.getTokenError()){case 4:M(14);break;case 5:M(15);break;case 3:M(13);break;case 1:if(!_)M(11);break;case 2:M(12);break;case 6:M(16);break}switch(F){case 12:case 13:if(_)M(10);else v();break;case 16:M(1);break;case 15:case 14:break;default:return F}}}function M(F,b=[],U0=[]){if(j(F),b.length+U0.length>0){let i=$.getToken();while(i!==17){if(b.indexOf(i)!==-1){B();break}else if(U0.indexOf(i)!==-1)break;i=B()}}}function m(F){let b=$.getTokenValue();if(F)K(b);else R(b),X.push(b);return B(),!0}function l(){switch($.getToken()){case 11:let F=$.getTokenValue(),b=Number(F);if(isNaN(b))M(2),b=0;K(b);break;case 7:K(null);break;case 8:K(!0);break;case 9:K(!1);break;default:return!1}return B(),!0}function d(){if($.getToken()!==10)return M(3,[],[2,5]),!1;if(m(!1),$.getToken()===6){if(y(":"),B(),!Z0())M(4,[],[2,5])}else M(5,[],[2,5]);return X.pop(),!0}function M0(){q(),B();let F=!1;while($.getToken()!==2&&$.getToken()!==17){if($.getToken()===5){if(!F)M(4,[],[]);if(y(","),B(),$.getToken()===2&&V)break}else if(F)M(6,[],[]);if(!d())M(4,[],[2,5]);F=!0}if(N(),$.getToken()!==2)M(7,[2],[]);else B();return!0}function w0(){A(),B();let F=!0,b=!1;while($.getToken()!==4&&$.getToken()!==17){if($.getToken()===5){if(!b)M(4,[],[]);if(y(","),B(),$.getToken()===4&&V)break}else if(b)M(6,[],[]);if(F)X.push(0),F=!1;else X[X.length-1]++;if(!Z0())M(4,[],[4,5]);b=!0}if(O(),!F)X.pop();if($.getToken()!==4)M(8,[4],[]);else B();return!0}function Z0(){switch($.getToken()){case 3:return w0();case 1:return M0();case 10:return m(!0);default:return l()}}if(B(),$.getToken()===17){if(z.allowEmptyContent)return!0;return M(4,[],[]),!1}if(!Z0())return M(4,[],[]),!1;if($.getToken()!==17)M(9,[],[]);return!0}function F2(Z){switch(typeof Z){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(!Z)return"null";else if(Array.isArray(Z))return"array";return"object"}default:return"null"}}function h0(Z,Q,z,$){let X=Q.slice(),U=y0(Z,[]),G=void 0,W=void 0;while(X.length>0)if(W=X.pop(),G=I0(U,X),G===void 0&&z!==void 0)if(typeof W==="string")z={[W]:z};else z=[z];else break;if(!G){if(z===void 0)throw Error("Can not delete in empty document");return C(Z,{offset:U?U.offset:0,length:U?U.length:0,content:JSON.stringify(z)},$)}else if(G.type==="object"&&typeof W==="string"&&Array.isArray(G.children)){let I=I0(G,[W]);if(I!==void 0)if(z===void 0){if(!I.parent)throw Error("Malformed AST");let H=G.children.indexOf(I.parent),q,R=I.parent.offset+I.parent.length;if(H>0){let N=G.children[H-1];q=N.offset+N.length}else if(q=G.offset+1,G.children.length>1)R=G.children[1].offset;return C(Z,{offset:q,length:R-q,content:""},$)}else return C(Z,{offset:I.offset,length:I.length,content:JSON.stringify(z)},$);else{if(z===void 0)return[];let H=`${JSON.stringify(W)}: ${JSON.stringify(z)}`,q=$.getInsertionIndex?$.getInsertionIndex(G.children.map((N)=>N.children[0].value)):G.children.length,R;if(q>0){let N=G.children[q-1];R={offset:N.offset+N.length,length:0,content:","+H}}else if(G.children.length===0)R={offset:G.offset+1,length:0,content:H};else R={offset:G.offset+1,length:0,content:H+","};return C(Z,R,$)}}else if(G.type==="array"&&typeof W==="number"&&Array.isArray(G.children)){let I=W;if(I===-1){let H=`${JSON.stringify(z)}`,q;if(G.children.length===0)q={offset:G.offset+1,length:0,content:H};else{let R=G.children[G.children.length-1];q={offset:R.offset+R.length,length:0,content:","+H}}return C(Z,q,$)}else if(z===void 0&&G.children.length>=0){let H=W,q=G.children[H],R;if(G.children.length===1)R={offset:G.offset+1,length:G.length-2,content:""};else if(G.children.length-1===H){let N=G.children[H-1],A=N.offset+N.length,O=G.offset+G.length;R={offset:A,length:O-2-A,content:""}}else R={offset:q.offset,length:G.children[H+1].offset-q.offset,content:""};return C(Z,R,$)}else if(z!==void 0){let H,q=`${JSON.stringify(z)}`;if(!$.isArrayInsertion&&G.children.length>W){let R=G.children[W];H={offset:R.offset,length:R.length,content:q}}else if(G.children.length===0||W===0)H={offset:G.offset+1,length:0,content:G.children.length===0?q:q+","};else{let R=W>G.children.length?G.children.length:W,N=G.children[R-1];H={offset:N.offset+N.length,length:0,content:","+q}}return C(Z,H,$)}else throw Error(`Can not ${z===void 0?"remove":$.isArrayInsertion?"insert":"modify"} Array index ${I} as length is not sufficient`)}else throw Error(`Can not add ${typeof W!=="number"?"index":"property"} to parent of type ${G.type}`)}function C(Z,Q,z){if(!z.formattingOptions)return[Q];let $=R0(Z,Q),X=Q.offset,Y=Q.offset+Q.content.length;if(Q.length===0||Q.content.length===0){while(X>0&&!X0($,X-1))X--;while(Y<$.length&&!X0($,Y))Y++}let U=T0($,{offset:X,length:Y-X},{...z.formattingOptions,keepLines:!1});for(let W=U.length-1;W>=0;W--){let I=U[W];$=R0($,I),X=Math.min(X,I.offset),Y=Math.max(Y,I.offset+I.length),Y+=I.content.length-I.length}let G=Z.length-($.length-Y)-X;return[{offset:X,length:G,content:$.substring(X,Y)}]}function R0(Z,Q){return Z.substring(0,Q.offset)+Q.content+Z.substring(Q.offset+Q.length)}var p0;(function(Z){Z[Z.None=0]="None",Z[Z.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",Z[Z.UnexpectedEndOfString=2]="UnexpectedEndOfString",Z[Z.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",Z[Z.InvalidUnicode=4]="InvalidUnicode",Z[Z.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",Z[Z.InvalidCharacter=6]="InvalidCharacter"})(p0||(p0={}));var C0;(function(Z){Z[Z.OpenBraceToken=1]="OpenBraceToken",Z[Z.CloseBraceToken=2]="CloseBraceToken",Z[Z.OpenBracketToken=3]="OpenBracketToken",Z[Z.CloseBracketToken=4]="CloseBracketToken",Z[Z.CommaToken=5]="CommaToken",Z[Z.ColonToken=6]="ColonToken",Z[Z.NullKeyword=7]="NullKeyword",Z[Z.TrueKeyword=8]="TrueKeyword",Z[Z.FalseKeyword=9]="FalseKeyword",Z[Z.StringLiteral=10]="StringLiteral",Z[Z.NumericLiteral=11]="NumericLiteral",Z[Z.LineCommentTrivia=12]="LineCommentTrivia",Z[Z.BlockCommentTrivia=13]="BlockCommentTrivia",Z[Z.LineBreakTrivia=14]="LineBreakTrivia",Z[Z.Trivia=15]="Trivia",Z[Z.Unknown=16]="Unknown",Z[Z.EOF=17]="EOF"})(C0||(C0={}));var JZ=l0;var c0;(function(Z){Z[Z.InvalidSymbol=1]="InvalidSymbol",Z[Z.InvalidNumberFormat=2]="InvalidNumberFormat",Z[Z.PropertyNameExpected=3]="PropertyNameExpected",Z[Z.ValueExpected=4]="ValueExpected",Z[Z.ColonExpected=5]="ColonExpected",Z[Z.CommaExpected=6]="CommaExpected",Z[Z.CloseBraceExpected=7]="CloseBraceExpected",Z[Z.CloseBracketExpected=8]="CloseBracketExpected",Z[Z.EndOfFileExpected=9]="EndOfFileExpected",Z[Z.InvalidCommentToken=10]="InvalidCommentToken",Z[Z.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",Z[Z.UnexpectedEndOfString=12]="UnexpectedEndOfString",Z[Z.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",Z[Z.InvalidUnicode=14]="InvalidUnicode",Z[Z.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",Z[Z.InvalidCharacter=16]="InvalidCharacter"})(c0||(c0={}));function WZ(Z){switch(Z){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function GZ(Z,Q,z,$){return h0(Z,Q,z,$)}function jZ(Z,Q){let z=Q.slice(0).sort((X,Y)=>{let U=X.offset-Y.offset;if(U===0)return X.length-Y.length;return U}),$=Z.length;for(let X=z.length-1;X>=0;X--){let Y=z[X];if(Y.offset+Y.length<=$)Z=R0(Z,Y);else throw Error("Overlapping edit");$=Y.offset}return Z}function n0(Z,Q){let z,$=()=>z??=d0.make(g.provideMerge(Q,i0.layer),{memoMap:s0});return{runSync:(X)=>$().runSync(Z.use(X)),runPromiseExit:(X,Y)=>$().runPromiseExit(Z.use(X),Y),runPromise:(X,Y)=>$().runPromise(Z.use(X),Y),runFork:(X)=>$().runFork(Z.use(X)),runCallback:(X)=>$().runCallback(Z.use(X))}}var G0={};e0(G0,{which:()=>S2,sanitize:()=>Y2,outdated:()=>P2,layer:()=>H2,install:()=>T2,defaultLayer:()=>J2,add:()=>y2,Service:()=>J0,Npm:()=>G0,InstallFailedError:()=>D0});var X2=W0(Q2(),1),S0=W0(z2(),1);import k from"path";import B0 from"path";import O2 from"os";import{randomUUID as b2}from"crypto";var A0;((H0)=>{class Z extends w.TaggedErrorClass()("LockTimeoutError",{key:w.String}){}H0.LockTimeoutError=Z;class Q extends w.TaggedErrorClass()("LockCompromisedError",{detail:w.String}){}H0.LockCompromisedError=Q;class z extends w.TaggedErrorClass()("ReleaseError",{detail:w.String,cause:w.optional(w.Defect)}){get message(){return this.detail}}class $ extends w.TaggedErrorClass()("NotAcquired",{}){}let X=60000,Y=300000,U=100,G=2000,W=Math.max(100,Math.floor(X/3)),I=c.exponential(U,1.7).pipe(c.either(c.spaced(G)),c.jittered,c.while((j)=>j.elapsed<Y)),H=w.fromJsonString(w.Struct({token:w.String,pid:w.Number,hostname:w.String,createdAt:w.String})),q=w.decodeUnknownSync(H),R=w.encodeSync(H);class N extends V0.Service()("EffectFlock"){}H0.Service=N;function A(){return performance.timeOrigin+performance.now()}let O=(j)=>L.getOrElse(j.mtime,()=>new Date(0)).getTime(),K=(j)=>j.reason._tag==="NotFound"||j.reason._tag==="Unknown";H0.layer=g.effect(N,J.gen(function*(){let j=yield*o.Service,_=yield*f.Service,V=B0.join(j.state,"locks"),B=O2.hostname(),M=new Set,m=(D)=>_.stat(D).pipe(J.catchIf(K,()=>J.void),J.orDie),l=(D)=>_.remove(D,{recursive:!0}).pipe(J.ignore),d=(D)=>_.makeDirectory(D,{mode:448}).pipe(J.as(!0),J.catchIf((T)=>T.reason._tag==="AlreadyExists",()=>J.succeed(!1)),J.orDie),M0=(D,T,E,P)=>_.writeFileString(D,T,{flag:"wx"}).pipe(J.catch(()=>J.gen(function*(){return yield*l(E),yield*new Q({detail:P})}))),w0=J.fnUntraced(function*(D){let T=yield*m(D);if(T&&A()-O(T)>X)yield*l(D);return!1}),Z0=J.fnUntraced(function*(D){if(M.has(D))return;yield*_.makeDirectory(D,{recursive:!0}).pipe(J.orDie),M.add(D)}),F=J.fnUntraced(function*(D,T,E){let P=A(),h=yield*m(T);if(h)return P-O(h)>X;let $0=yield*m(E);if($0)return P-O($0)>X;let q0=yield*m(D);if(!q0)return!1;return P-O(q0)>X}),b=(D,T)=>J.gen(function*(){let E=b2(),P=B0.join(D,"meta.json"),h=B0.join(D,"heartbeat");if(!(yield*d(D))){if(!(yield*F(D,h,P)))return yield*new $;let O0=D+".breaker";if(!(yield*_.makeDirectory(O0,{mode:448}).pipe(J.as(!0),J.catchIf((V2)=>V2.reason._tag==="AlreadyExists",()=>w0(O0)),J.catchIf(K,()=>J.succeed(!1)),J.orDie)))return yield*new $;if(!(yield*J.gen(function*(){if(!(yield*F(D,h,P)))return!1;return yield*l(D),yield*d(D)}).pipe(J.ensuring(l(O0)))))return yield*new $}yield*M0(h,"",D,"heartbeat already existed");let q0=R({token:E,pid:process.pid,hostname:B,createdAt:new Date().toISOString()});return yield*M0(P,q0,D,"meta.json already existed"),{token:E,metaPath:P,heartbeatPath:h,lockDir:D}}).pipe(J.withSpan("EffectFlock.tryAcquire",{attributes:{key:T}})),U0=(D,T)=>b(D,T).pipe(J.retry({while:(E)=>E._tag==="NotAcquired",schedule:I}),J.catchTag("NotAcquired",()=>J.fail(new Z({key:T})))),i=(D)=>J.gen(function*(){let T=yield*_.readFileString(D.metaPath).pipe(J.catch((P)=>{if(K(P))return J.die(new z({detail:"metadata missing"}));return J.die(P)}));if((yield*J.try({try:()=>q(T),catch:(P)=>new z({detail:"metadata invalid",cause:P})}).pipe(J.orDie)).token!==D.token)return yield*J.die(new z({detail:"token mismatch"}));yield*l(D.lockDir)}),k0=J.fn("EffectFlock.acquire")(function*(D,T){let E=T??V;yield*Z0(E);let P=B0.join(E,a0.fast(D)+".lock"),h=yield*J.acquireRelease(U0(P,D),($0)=>i($0));yield*_.utimes(h.heartbeatPath,new Date,new Date).pipe(J.ignore,J.repeat(c.spaced(W)),J.forkScoped)}),B2=o0.dual((D)=>J.isEffect(D[0]),(D,T,E)=>J.scoped(J.gen(function*(){return yield*k0(T,E),yield*D})));return N.of({acquire:k0,withLock:B2})})),H0.defaultLayer=H0.layer.pipe(g.provide(f.defaultLayer),g.provide(o.layer))})(A0||={});class D0 extends w.TaggedErrorClass()("NpmInstallFailedError",{add:w.Array(w.String).pipe(w.optional),dir:w.String,cause:w.optional(w.Defect)}){}class J0 extends V0.Service()("@qitqode/Npm"){}var r0=process.platform==="win32"?new Set(["<",">",":",'"',"|","?","*"]):void 0;function Y2(Z){if(!r0)return Z;return Array.from(Z,(Q)=>r0.has(Q)||Q.charCodeAt(0)<32?"_":Q).join("")}var t0=(Z,Q)=>{let z;try{let $=typeof Bun<"u"?import.meta.resolve(Z,Q):import.meta.resolve(Q);z=L.some($)}catch{z=L.none()}return{directory:Q,entrypoint:z}},H2=g.effect(J0,J.gen(function*(){let Z=yield*f.Service,Q=yield*o.Service,z=yield*Z2.FileSystem,$=yield*A0.Service,X=(H)=>k.join(Q.cache,"packages",Y2(H)),Y=(H)=>J.gen(function*(){yield*$.acquire(`npm-install:${H.dir}`);let{Arborist:q}=yield*J.promise(()=>import("./chunk-p4ewy9xh.js").then((m)=>W0(m.default,1))),R=new q({path:H.dir,binLinks:!0,progress:!1,savePrefix:"",ignoreScripts:!0});return yield*J.tryPromise({try:()=>R.reify({add:H?.add||[],save:!0,saveType:"prod"}),catch:(N)=>new D0({cause:N,add:H?.add,dir:H.dir})})}).pipe(J.withSpan("Npm.reify",{attributes:H})),U=J.fn("Npm.outdated")(function*(H,q){let R=yield*J.tryPromise({try:()=>fetch(`https://registry.npmjs.org/${H}`),catch:()=>{return}}).pipe(J.orElseSucceed(()=>{return}));if(!R||!R.ok)return!1;let A=(yield*J.tryPromise({try:()=>R.json(),catch:()=>{return}}).pipe(J.orElseSucceed(()=>{return})))?.["dist-tags"]?.latest;if(!A)return!1;if(/[\s^~*xX<>|=]/.test(q))return!S0.default.satisfies(A,q);return S0.default.lt(q,A)}),G=J.fn("Npm.add")(function*(H){let q=X(H),R=(()=>{try{return X2.default(H).name??H}catch{return H}})();if(yield*Z.existsSafe(q))return t0(R,k.join(q,"node_modules",R));let A=(yield*Y({dir:q,add:[H]})).edgesOut.values().next().value?.to;if(!A)return yield*new D0({add:[H],dir:q});return t0(A.name,A.path)},J.scoped),W=J.fn("Npm.install")(function*(H,q){if(!(yield*Z.access(H,{writable:!0}).pipe(J.as(!0),J.orElseSucceed(()=>!1))))return;let N=q?.add.map((A)=>[A.name,A.version].filter(Boolean).join("@"))??[];if(yield*J.gen(function*(){if(!(yield*Z.existsSafe(k.join(H,"node_modules"))))return yield*Y({add:N,dir:H}),!0;return!1}).pipe(J.withSpan("Npm.checkNodeModules")))return;yield*J.gen(function*(){let A=yield*Z.readJson(k.join(H,"package.json")).pipe(J.orElseSucceed(()=>({}))),O=yield*Z.readJson(k.join(H,"package-lock.json")).pipe(J.orElseSucceed(()=>({}))),K=A,y=O,v=new Set([...Object.keys(K?.dependencies||{}),...Object.keys(K?.devDependencies||{}),...Object.keys(K?.peerDependencies||{}),...Object.keys(K?.optionalDependencies||{}),...(q?.add||[]).map((V)=>V.name)]),j=y?.packages?.[""]||{},_=new Set([...Object.keys(j?.dependencies||{}),...Object.keys(j?.devDependencies||{}),...Object.keys(j?.peerDependencies||{}),...Object.keys(j?.optionalDependencies||{})]);for(let V of v)if(!_.has(V)){yield*Y({dir:H,add:N});return}}).pipe(J.withSpan("Npm.checkDirty"));return},J.scoped),I=J.fn("Npm.which")(function*(H){let q=X(H),R=k.join(q,"node_modules",".bin"),N=J.fnUntraced(function*(){let A=yield*z.readDirectory(R).pipe(J.catch(()=>J.succeed([])));if(A.length===0)return L.none();if(A.length===1)return L.some(A[0]);let O=yield*Z.readJson(k.join(q,"node_modules",H,"package.json")).pipe(J.option);if(L.isSome(O)){let K=O.value;if(K?.bin){let y=H.startsWith("@")?H.split("/")[1]:H,v=K.bin;if(typeof v==="string")return L.some(y);let j=Object.keys(v);if(j.length===1)return L.some(j[0]);return v[y]?L.some(y):L.some(j[0])}}return L.some(A[0])});return yield*J.gen(function*(){let A=yield*N();if(L.isSome(A))return L.some(k.join(R,A.value));yield*z.remove(k.join(q,"package-lock.json")).pipe(J.orElseSucceed(()=>{})),yield*G(H);let O=yield*N();if(L.isNone(O))return L.none();return L.some(k.join(R,O.value))}).pipe(J.scoped,J.orElseSucceed(()=>L.none()))});return J0.of({add:G,install:W,outdated:U,which:I})})),J2=H2.pipe(g.provide(A0.layer),g.provide(f.layer),g.provide(o.layer),g.provide($2.layer)),{runPromise:_0}=n0(J0,J2);async function T2(...Z){return _0((Q)=>Q.install(...Z))}async function y2(...Z){let Q=await _0((z)=>z.add(...Z));return{directory:Q.directory,entrypoint:L.getOrUndefined(Q.entrypoint)}}async function P2(...Z){return _0((Q)=>Q.outdated(...Z))}async function S2(...Z){let Q=await _0((z)=>z.which(...Z));return L.getOrUndefined(Q)}var G2=W0(Q2(),1),N0=W0(z2(),1);import u from"path";import{fileURLToPath as F0,pathToFileURL as a}from"url";var m2=["opencode-openai-codex-auth","opencode-copilot-auth"];function gZ(Z){return m2.some((Q)=>Z.includes(Q))}function j2(Z){try{return G2.default(Z)}catch{}}function kZ(Z){let Q=j2(Z);if(Q?.type==="alias"&&!Q.name){let z=Q.subSpec;if(z?.name){let $=!z.rawSpec||z.rawSpec==="*"?"latest":z.rawSpec;return{pkg:z.name,version:$}}}if(!Q?.name)return{pkg:Z,version:""};if(Q.raw===Q.name)return{pkg:Q.name,version:"latest"};return{pkg:Q.name,version:Q.rawSpec}}var E2=["index.ts","index.tsx","index.js","index.mjs","index.cjs"];function M2(Z){if(I2(Z))return"file";return"npm"}function v2(Z,Q){if(Z.startsWith("file://"))return F0(Z);if(u.isAbsolute(Z))return Z;return u.resolve(Q,Z)}function U2(Z){return u.isAbsolute(Z)||/^[A-Za-z]:[\\/]/.test(Z)}function x2(Z){if(typeof Z==="string")return Z;if(!t(Z))return;for(let Q of["import","default"]){let z=Z[Q];if(typeof z==="string")return z}return}function g2(Z){let Q=Z.json.main;if(typeof Q!=="string")return;let z=Q.trim();if(!z)return;return z}function q2(Z,Q,z,$){let X=v2(Q,$.dir),Y=S.resolve($.dir),U=S.resolve(X);if(!S.contains(Y,U))throw Error(`Plugin ${Z} resolved ${z} entry outside plugin directory`);return U}function W2(Z,Q,z,$){return a(q2(Z,Q,z,$)).href}function k2(Z,Q,z){let $=z.json.exports;if(t($)){let Y=x2($[`./${Q}`]);if(Y)return W2(Z,Y,Q,z)}if(Q!=="server")return;let X=g2(z);if(!X)return;return W2(Z,X,Q,z)}function u2(Z){if(Z.startsWith("file://"))return F0(Z);if(u.isAbsolute(Z))return Z}async function m0(Z){for(let Q of E2){let z=u.join(Z,Q);if(await S.exists(z))return z}}async function f2(Z){let Q=u2(Z);if(!Q)return;if(!(await S.statAsync(Q))?.isDirectory())return;return Q}async function l2(Z,Q,z,$){let X=M2(Z),Y=$??(X==="npm"?await r(Q):await r(Q).catch(()=>{return}));if(!Y)return Q;let U=k2(Z,z,Y);if(U)return U;let G=await f2(Q);if(z==="tui"){if(X==="file"&&G){let W=await m0(G);if(W)return a(W).href}if(X==="npm")return;if(G)return;return Q}if(G&&t(Y.json.exports)){if(X==="file"){let W=await m0(G);if(W)return a(W).href}return}return Q}function I2(Z){return Z.startsWith("file://")||Z.startsWith(".")||U2(Z)}async function h2(Z){let Q=Z.startsWith("file://")?F0(Z):Z,z=u.isAbsolute(Q)||/^[A-Za-z]:[\\/]/.test(Q)?Q:u.resolve(Q);if(!(await S.statAsync(z))?.isDirectory()){if(Z.startsWith("file://"))return Z;return a(z).href}if(await S.exists(u.join(z,"package.json")))return a(z).href;let X=await m0(z);if(X)return a(X).href;throw Error(`Plugin directory ${z} is missing package.json or index file`)}async function uZ(Z,Q,z){if(!N0.default.valid(Q)||N0.default.major(Q)===0)return;let $=z??await r(Z).catch(()=>{return});if(!$)return;let X=$.json.engines;if(!t(X))return;let Y=X.qitqode??X.opencode;if(typeof Y!=="string")return;if(!N0.default.satisfies(Q,Y))throw Error(`Plugin requires qitqode ${Y} but running ${Q}`)}async function fZ(Z){if(I2(Z))return h2(Z);let Q=j2(Z),z=Q?.name&&Q.raw===Q.name?`${Q.name}@latest`:Z;return(await G0.add(z)).directory}async function r(Z){let Q=Z.startsWith("file://")?F0(Z):Z,$=(await S.statAsync(Q))?.isDirectory()?Q:u.dirname(Q),X=u.join($,"package.json"),Y=await S.readJson(X);return{dir:$,pkg:X,json:Y}}async function lZ(Z,Q,z){let $=M2(Z),X=$==="npm"?await r(Q):await r(Q).catch(()=>{return}),Y=await l2(Z,Q,z,X);return{spec:Z,source:$,target:Q,pkg:X,entry:Y}}function hZ(Z,Q){let z=Q.json["oc-themes"];if(z===void 0)return[];if(!Array.isArray(z))throw TypeError(`Plugin ${Z} has invalid oc-themes field`);let $=z.map((X)=>{if(typeof X!=="string")throw TypeError(`Plugin ${Z} has invalid oc-themes entry`);let Y=X.trim();if(!Y)throw TypeError(`Plugin ${Z} has empty oc-themes entry`);if(Y.startsWith("file://")||U2(Y))throw TypeError(`Plugin ${Z} oc-themes entry must be relative: ${X}`);return q2(Z,Y,"oc-themes",Q)});return Array.from(new Set($))}function pZ(Z,Q){if(Z===void 0)return;if(typeof Z!=="string")throw TypeError(`Plugin ${Q} has invalid id type ${typeof Z}`);let z=Z.trim();if(!z)throw TypeError(`Plugin ${Q} has an empty id`);return z}function CZ(Z,Q,z,$="strict"){let X=Z.default;if(!t(X)){if($==="detect")return;throw TypeError(`Plugin ${Q} must default export an object with ${z}()`)}if($==="detect"&&!("id"in X)&&!("server"in X)&&!("tui"in X))return;let Y="server"in X?X.server:void 0,U="tui"in X?X.tui:void 0;if(Y!==void 0&&typeof Y!=="function")throw TypeError(`Plugin ${Q} has invalid server export`);if(U!==void 0&&typeof U!=="function")throw TypeError(`Plugin ${Q} has invalid tui export`);if(Y!==void 0&&U!==void 0)throw TypeError(`Plugin ${Q} must default export either server() or tui(), not both`);if(z==="server"&&Y===void 0)throw TypeError(`Plugin ${Q} must default export an object with server()`);if(z==="tui"&&U===void 0)throw TypeError(`Plugin ${Q} must default export an object with tui()`);return X}async function cZ(Z,Q,z,$,X){if(Z==="file"){if($)return $;throw TypeError(`Path plugin ${Q} must export id`)}if($)return $;let Y=X??await r(z);if(typeof Y.json.name!=="string"||!Y.json.name.trim())throw TypeError(`Plugin package ${Y.pkg} is missing name`);return Y.json.name.trim()}var g0={};e0(g0,{readFile:()=>s2,files:()=>C2,fileInDirectory:()=>i2,directories:()=>c2,claudeCommandDirectories:()=>d2,ConfigPaths:()=>g0});import v0 from"path";var R2=E0.create("ConfigJsonError",p.object({path:p.string(),message:p.string().optional()})),nZ=E0.create("ConfigInvalidError",p.object({path:p.string(),issues:p.custom().optional(),message:p.string().optional()}));var C2=K0("ConfigPaths.projectFiles")(function*(Z,Q,z){return(yield*(yield*f.Service).up({targets:[`${Z}.jsonc`,`${Z}.json`],start:Q,stop:z})).toReversed()}),c2=K0("ConfigPaths.directories")(function*(Z,Q){let z=yield*f.Service;return x0([j0.Path.config,...!e.QITQODE_DISABLE_PROJECT_CONFIG?yield*z.up({targets:[".qitqode"],start:Z,stop:Q}):[],...yield*z.up({targets:[".qitqode"],start:j0.Path.home,stop:j0.Path.home}),...e.QITQODE_CONFIG_DIR?[e.QITQODE_CONFIG_DIR]:[]])}),d2=K0("ConfigPaths.claudeCommandDirectories")(function*(Z,Q){if(e.QITQODE_DISABLE_CLAUDE_CODE_COMMANDS)return[];let z=yield*f.Service;return x0([v0.join(j0.Path.home,".claude"),...!e.QITQODE_DISABLE_PROJECT_CONFIG?yield*z.up({targets:[".claude"],start:Z,stop:Q}):[]])});function i2(Z,Q){return[v0.join(Z,`${Q}.json`),v0.join(Z,`${Q}.jsonc`)]}async function s2(Z){return S.readText(Z).catch((Q)=>{if(Q.code==="ENOENT")return;throw new R2({path:Z},{cause:Q})})}
17
- export{A0 as zn,JZ as An,WZ as Bn,GZ as Cn,jZ as Dn,R2 as En,nZ as Fn,n0 as Gn,G0 as Hn,gZ as In,kZ as Jn,M2 as Kn,I2 as Ln,h2 as Mn,uZ as Nn,fZ as On,r as Pn,lZ as Qn,hZ as Rn,pZ as Sn,CZ as Tn,cZ as Un,C2 as Vn,c2 as Wn,i2 as Xn,s2 as Yn,g0 as Zn};
16
+ `.indexOf(Z.charAt(Q))!==-1}var Y0;(function(Z){Z.DEFAULT={allowTrailingComma:!1}})(Y0||(Y0={}));function l0(Z,Q=[],z=Y0.DEFAULT){let $=null,X=[],Y=[];function U(W){if(Array.isArray(X))X.push(W);else if($!==null)X[$]=W}return P0(Z,{onObjectBegin:()=>{let W={};U(W),Y.push(X),X=W,$=null},onObjectProperty:(W)=>{$=W},onObjectEnd:()=>{X=Y.pop()},onArrayBegin:()=>{let W=[];U(W),Y.push(X),X=W,$=null},onArrayEnd:()=>{X=Y.pop()},onLiteralValue:U,onError:(W,I,H)=>{Q.push({error:W,offset:I,length:H})}},z),X[0]}function y0(Z,Q=[],z=Y0.DEFAULT){let $={type:"array",offset:-1,length:-1,children:[],parent:void 0};function X(W){if($.type==="property")$.length=W-$.offset,$=$.parent}function Y(W){return $.children.push(W),W}P0(Z,{onObjectBegin:(W)=>{$=Y({type:"object",offset:W,length:-1,parent:$,children:[]})},onObjectProperty:(W,I,H)=>{$=Y({type:"property",offset:I,length:-1,parent:$,children:[]}),$.children.push({type:"string",value:W,offset:I,length:H,parent:$})},onObjectEnd:(W,I)=>{X(W+I),$.length=W+I-$.offset,$=$.parent,X(W+I)},onArrayBegin:(W,I)=>{$=Y({type:"array",offset:W,length:-1,parent:$,children:[]})},onArrayEnd:(W,I)=>{$.length=W+I-$.offset,$=$.parent,X(W+I)},onLiteralValue:(W,I,H)=>{Y({type:F2(W),offset:I,length:H,parent:$,value:W}),X(I+H)},onSeparator:(W,I,H)=>{if($.type==="property"){if(W===":")$.colonOffset=I;else if(W===",")X(I)}},onError:(W,I,H)=>{Q.push({error:W,offset:I,length:H})}},z);let G=$.children[0];if(G)delete G.parent;return G}function I0(Z,Q){if(!Z)return;let z=Z;for(let $ of Q)if(typeof $==="string"){if(z.type!=="object"||!Array.isArray(z.children))return;let X=!1;for(let Y of z.children)if(Array.isArray(Y.children)&&Y.children[0].value===$&&Y.children.length===2){z=Y.children[1],X=!0;break}if(!X)return}else{let X=$;if(z.type!=="array"||X<0||!Array.isArray(z.children)||X>=z.children.length)return;z=z.children[X]}return z}function P0(Z,Q,z=Y0.DEFAULT){let $=z0(Z,!1),X=[],Y=0;function U(F){return F?()=>Y===0&&F($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter()):()=>!0}function G(F){return F?(b)=>Y===0&&F(b,$.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter()):()=>!0}function W(F){return F?(b)=>Y===0&&F(b,$.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter(),()=>X.slice()):()=>!0}function I(F){return F?()=>{if(Y>0)Y++;else if(F($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter(),()=>X.slice())===!1)Y=1}:()=>!0}function H(F){return F?()=>{if(Y>0)Y--;if(Y===0)F($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter())}:()=>!0}let q=I(Q.onObjectBegin),R=W(Q.onObjectProperty),N=H(Q.onObjectEnd),A=I(Q.onArrayBegin),O=H(Q.onArrayEnd),K=W(Q.onLiteralValue),y=G(Q.onSeparator),v=U(Q.onComment),j=G(Q.onError),_=z&&z.disallowComments,V=z&&z.allowTrailingComma;function B(){while(!0){let F=$.scan();switch($.getTokenError()){case 4:M(14);break;case 5:M(15);break;case 3:M(13);break;case 1:if(!_)M(11);break;case 2:M(12);break;case 6:M(16);break}switch(F){case 12:case 13:if(_)M(10);else v();break;case 16:M(1);break;case 15:case 14:break;default:return F}}}function M(F,b=[],U0=[]){if(j(F),b.length+U0.length>0){let i=$.getToken();while(i!==17){if(b.indexOf(i)!==-1){B();break}else if(U0.indexOf(i)!==-1)break;i=B()}}}function m(F){let b=$.getTokenValue();if(F)K(b);else R(b),X.push(b);return B(),!0}function l(){switch($.getToken()){case 11:let F=$.getTokenValue(),b=Number(F);if(isNaN(b))M(2),b=0;K(b);break;case 7:K(null);break;case 8:K(!0);break;case 9:K(!1);break;default:return!1}return B(),!0}function d(){if($.getToken()!==10)return M(3,[],[2,5]),!1;if(m(!1),$.getToken()===6){if(y(":"),B(),!Z0())M(4,[],[2,5])}else M(5,[],[2,5]);return X.pop(),!0}function M0(){q(),B();let F=!1;while($.getToken()!==2&&$.getToken()!==17){if($.getToken()===5){if(!F)M(4,[],[]);if(y(","),B(),$.getToken()===2&&V)break}else if(F)M(6,[],[]);if(!d())M(4,[],[2,5]);F=!0}if(N(),$.getToken()!==2)M(7,[2],[]);else B();return!0}function w0(){A(),B();let F=!0,b=!1;while($.getToken()!==4&&$.getToken()!==17){if($.getToken()===5){if(!b)M(4,[],[]);if(y(","),B(),$.getToken()===4&&V)break}else if(b)M(6,[],[]);if(F)X.push(0),F=!1;else X[X.length-1]++;if(!Z0())M(4,[],[4,5]);b=!0}if(O(),!F)X.pop();if($.getToken()!==4)M(8,[4],[]);else B();return!0}function Z0(){switch($.getToken()){case 3:return w0();case 1:return M0();case 10:return m(!0);default:return l()}}if(B(),$.getToken()===17){if(z.allowEmptyContent)return!0;return M(4,[],[]),!1}if(!Z0())return M(4,[],[]),!1;if($.getToken()!==17)M(9,[],[]);return!0}function F2(Z){switch(typeof Z){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(!Z)return"null";else if(Array.isArray(Z))return"array";return"object"}default:return"null"}}function h0(Z,Q,z,$){let X=Q.slice(),U=y0(Z,[]),G=void 0,W=void 0;while(X.length>0)if(W=X.pop(),G=I0(U,X),G===void 0&&z!==void 0)if(typeof W==="string")z={[W]:z};else z=[z];else break;if(!G){if(z===void 0)throw Error("Can not delete in empty document");return C(Z,{offset:U?U.offset:0,length:U?U.length:0,content:JSON.stringify(z)},$)}else if(G.type==="object"&&typeof W==="string"&&Array.isArray(G.children)){let I=I0(G,[W]);if(I!==void 0)if(z===void 0){if(!I.parent)throw Error("Malformed AST");let H=G.children.indexOf(I.parent),q,R=I.parent.offset+I.parent.length;if(H>0){let N=G.children[H-1];q=N.offset+N.length}else if(q=G.offset+1,G.children.length>1)R=G.children[1].offset;return C(Z,{offset:q,length:R-q,content:""},$)}else return C(Z,{offset:I.offset,length:I.length,content:JSON.stringify(z)},$);else{if(z===void 0)return[];let H=`${JSON.stringify(W)}: ${JSON.stringify(z)}`,q=$.getInsertionIndex?$.getInsertionIndex(G.children.map((N)=>N.children[0].value)):G.children.length,R;if(q>0){let N=G.children[q-1];R={offset:N.offset+N.length,length:0,content:","+H}}else if(G.children.length===0)R={offset:G.offset+1,length:0,content:H};else R={offset:G.offset+1,length:0,content:H+","};return C(Z,R,$)}}else if(G.type==="array"&&typeof W==="number"&&Array.isArray(G.children)){let I=W;if(I===-1){let H=`${JSON.stringify(z)}`,q;if(G.children.length===0)q={offset:G.offset+1,length:0,content:H};else{let R=G.children[G.children.length-1];q={offset:R.offset+R.length,length:0,content:","+H}}return C(Z,q,$)}else if(z===void 0&&G.children.length>=0){let H=W,q=G.children[H],R;if(G.children.length===1)R={offset:G.offset+1,length:G.length-2,content:""};else if(G.children.length-1===H){let N=G.children[H-1],A=N.offset+N.length,O=G.offset+G.length;R={offset:A,length:O-2-A,content:""}}else R={offset:q.offset,length:G.children[H+1].offset-q.offset,content:""};return C(Z,R,$)}else if(z!==void 0){let H,q=`${JSON.stringify(z)}`;if(!$.isArrayInsertion&&G.children.length>W){let R=G.children[W];H={offset:R.offset,length:R.length,content:q}}else if(G.children.length===0||W===0)H={offset:G.offset+1,length:0,content:G.children.length===0?q:q+","};else{let R=W>G.children.length?G.children.length:W,N=G.children[R-1];H={offset:N.offset+N.length,length:0,content:","+q}}return C(Z,H,$)}else throw Error(`Can not ${z===void 0?"remove":$.isArrayInsertion?"insert":"modify"} Array index ${I} as length is not sufficient`)}else throw Error(`Can not add ${typeof W!=="number"?"index":"property"} to parent of type ${G.type}`)}function C(Z,Q,z){if(!z.formattingOptions)return[Q];let $=R0(Z,Q),X=Q.offset,Y=Q.offset+Q.content.length;if(Q.length===0||Q.content.length===0){while(X>0&&!X0($,X-1))X--;while(Y<$.length&&!X0($,Y))Y++}let U=T0($,{offset:X,length:Y-X},{...z.formattingOptions,keepLines:!1});for(let W=U.length-1;W>=0;W--){let I=U[W];$=R0($,I),X=Math.min(X,I.offset),Y=Math.max(Y,I.offset+I.length),Y+=I.content.length-I.length}let G=Z.length-($.length-Y)-X;return[{offset:X,length:G,content:$.substring(X,Y)}]}function R0(Z,Q){return Z.substring(0,Q.offset)+Q.content+Z.substring(Q.offset+Q.length)}var p0;(function(Z){Z[Z.None=0]="None",Z[Z.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",Z[Z.UnexpectedEndOfString=2]="UnexpectedEndOfString",Z[Z.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",Z[Z.InvalidUnicode=4]="InvalidUnicode",Z[Z.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",Z[Z.InvalidCharacter=6]="InvalidCharacter"})(p0||(p0={}));var C0;(function(Z){Z[Z.OpenBraceToken=1]="OpenBraceToken",Z[Z.CloseBraceToken=2]="CloseBraceToken",Z[Z.OpenBracketToken=3]="OpenBracketToken",Z[Z.CloseBracketToken=4]="CloseBracketToken",Z[Z.CommaToken=5]="CommaToken",Z[Z.ColonToken=6]="ColonToken",Z[Z.NullKeyword=7]="NullKeyword",Z[Z.TrueKeyword=8]="TrueKeyword",Z[Z.FalseKeyword=9]="FalseKeyword",Z[Z.StringLiteral=10]="StringLiteral",Z[Z.NumericLiteral=11]="NumericLiteral",Z[Z.LineCommentTrivia=12]="LineCommentTrivia",Z[Z.BlockCommentTrivia=13]="BlockCommentTrivia",Z[Z.LineBreakTrivia=14]="LineBreakTrivia",Z[Z.Trivia=15]="Trivia",Z[Z.Unknown=16]="Unknown",Z[Z.EOF=17]="EOF"})(C0||(C0={}));var JZ=l0;var c0;(function(Z){Z[Z.InvalidSymbol=1]="InvalidSymbol",Z[Z.InvalidNumberFormat=2]="InvalidNumberFormat",Z[Z.PropertyNameExpected=3]="PropertyNameExpected",Z[Z.ValueExpected=4]="ValueExpected",Z[Z.ColonExpected=5]="ColonExpected",Z[Z.CommaExpected=6]="CommaExpected",Z[Z.CloseBraceExpected=7]="CloseBraceExpected",Z[Z.CloseBracketExpected=8]="CloseBracketExpected",Z[Z.EndOfFileExpected=9]="EndOfFileExpected",Z[Z.InvalidCommentToken=10]="InvalidCommentToken",Z[Z.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",Z[Z.UnexpectedEndOfString=12]="UnexpectedEndOfString",Z[Z.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",Z[Z.InvalidUnicode=14]="InvalidUnicode",Z[Z.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",Z[Z.InvalidCharacter=16]="InvalidCharacter"})(c0||(c0={}));function WZ(Z){switch(Z){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function GZ(Z,Q,z,$){return h0(Z,Q,z,$)}function jZ(Z,Q){let z=Q.slice(0).sort((X,Y)=>{let U=X.offset-Y.offset;if(U===0)return X.length-Y.length;return U}),$=Z.length;for(let X=z.length-1;X>=0;X--){let Y=z[X];if(Y.offset+Y.length<=$)Z=R0(Z,Y);else throw Error("Overlapping edit");$=Y.offset}return Z}function n0(Z,Q){let z,$=()=>z??=d0.make(g.provideMerge(Q,i0.layer),{memoMap:s0});return{runSync:(X)=>$().runSync(Z.use(X)),runPromiseExit:(X,Y)=>$().runPromiseExit(Z.use(X),Y),runPromise:(X,Y)=>$().runPromise(Z.use(X),Y),runFork:(X)=>$().runFork(Z.use(X)),runCallback:(X)=>$().runCallback(Z.use(X))}}var G0={};e0(G0,{which:()=>S2,sanitize:()=>Y2,outdated:()=>P2,layer:()=>H2,install:()=>T2,defaultLayer:()=>J2,add:()=>y2,Service:()=>J0,Npm:()=>G0,InstallFailedError:()=>D0});var X2=W0(Q2(),1),S0=W0(z2(),1);import k from"path";import B0 from"path";import O2 from"os";import{randomUUID as b2}from"crypto";var A0;((H0)=>{class Z extends w.TaggedErrorClass()("LockTimeoutError",{key:w.String}){}H0.LockTimeoutError=Z;class Q extends w.TaggedErrorClass()("LockCompromisedError",{detail:w.String}){}H0.LockCompromisedError=Q;class z extends w.TaggedErrorClass()("ReleaseError",{detail:w.String,cause:w.optional(w.Defect)}){get message(){return this.detail}}class $ extends w.TaggedErrorClass()("NotAcquired",{}){}let X=60000,Y=300000,U=100,G=2000,W=Math.max(100,Math.floor(X/3)),I=c.exponential(U,1.7).pipe(c.either(c.spaced(G)),c.jittered,c.while((j)=>j.elapsed<Y)),H=w.fromJsonString(w.Struct({token:w.String,pid:w.Number,hostname:w.String,createdAt:w.String})),q=w.decodeUnknownSync(H),R=w.encodeSync(H);class N extends V0.Service()("EffectFlock"){}H0.Service=N;function A(){return performance.timeOrigin+performance.now()}let O=(j)=>L.getOrElse(j.mtime,()=>new Date(0)).getTime(),K=(j)=>j.reason._tag==="NotFound"||j.reason._tag==="Unknown";H0.layer=g.effect(N,J.gen(function*(){let j=yield*o.Service,_=yield*f.Service,V=B0.join(j.state,"locks"),B=O2.hostname(),M=new Set,m=(D)=>_.stat(D).pipe(J.catchIf(K,()=>J.void),J.orDie),l=(D)=>_.remove(D,{recursive:!0}).pipe(J.ignore),d=(D)=>_.makeDirectory(D,{mode:448}).pipe(J.as(!0),J.catchIf((T)=>T.reason._tag==="AlreadyExists",()=>J.succeed(!1)),J.orDie),M0=(D,T,E,P)=>_.writeFileString(D,T,{flag:"wx"}).pipe(J.catch(()=>J.gen(function*(){return yield*l(E),yield*new Q({detail:P})}))),w0=J.fnUntraced(function*(D){let T=yield*m(D);if(T&&A()-O(T)>X)yield*l(D);return!1}),Z0=J.fnUntraced(function*(D){if(M.has(D))return;yield*_.makeDirectory(D,{recursive:!0}).pipe(J.orDie),M.add(D)}),F=J.fnUntraced(function*(D,T,E){let P=A(),h=yield*m(T);if(h)return P-O(h)>X;let $0=yield*m(E);if($0)return P-O($0)>X;let q0=yield*m(D);if(!q0)return!1;return P-O(q0)>X}),b=(D,T)=>J.gen(function*(){let E=b2(),P=B0.join(D,"meta.json"),h=B0.join(D,"heartbeat");if(!(yield*d(D))){if(!(yield*F(D,h,P)))return yield*new $;let O0=D+".breaker";if(!(yield*_.makeDirectory(O0,{mode:448}).pipe(J.as(!0),J.catchIf((V2)=>V2.reason._tag==="AlreadyExists",()=>w0(O0)),J.catchIf(K,()=>J.succeed(!1)),J.orDie)))return yield*new $;if(!(yield*J.gen(function*(){if(!(yield*F(D,h,P)))return!1;return yield*l(D),yield*d(D)}).pipe(J.ensuring(l(O0)))))return yield*new $}yield*M0(h,"",D,"heartbeat already existed");let q0=R({token:E,pid:process.pid,hostname:B,createdAt:new Date().toISOString()});return yield*M0(P,q0,D,"meta.json already existed"),{token:E,metaPath:P,heartbeatPath:h,lockDir:D}}).pipe(J.withSpan("EffectFlock.tryAcquire",{attributes:{key:T}})),U0=(D,T)=>b(D,T).pipe(J.retry({while:(E)=>E._tag==="NotAcquired",schedule:I}),J.catchTag("NotAcquired",()=>J.fail(new Z({key:T})))),i=(D)=>J.gen(function*(){let T=yield*_.readFileString(D.metaPath).pipe(J.catch((P)=>{if(K(P))return J.die(new z({detail:"metadata missing"}));return J.die(P)}));if((yield*J.try({try:()=>q(T),catch:(P)=>new z({detail:"metadata invalid",cause:P})}).pipe(J.orDie)).token!==D.token)return yield*J.die(new z({detail:"token mismatch"}));yield*l(D.lockDir)}),k0=J.fn("EffectFlock.acquire")(function*(D,T){let E=T??V;yield*Z0(E);let P=B0.join(E,a0.fast(D)+".lock"),h=yield*J.acquireRelease(U0(P,D),($0)=>i($0));yield*_.utimes(h.heartbeatPath,new Date,new Date).pipe(J.ignore,J.repeat(c.spaced(W)),J.forkScoped)}),B2=o0.dual((D)=>J.isEffect(D[0]),(D,T,E)=>J.scoped(J.gen(function*(){return yield*k0(T,E),yield*D})));return N.of({acquire:k0,withLock:B2})})),H0.defaultLayer=H0.layer.pipe(g.provide(f.defaultLayer),g.provide(o.layer))})(A0||={});class D0 extends w.TaggedErrorClass()("NpmInstallFailedError",{add:w.Array(w.String).pipe(w.optional),dir:w.String,cause:w.optional(w.Defect)}){}class J0 extends V0.Service()("@qitqode/Npm"){}var r0=process.platform==="win32"?new Set(["<",">",":",'"',"|","?","*"]):void 0;function Y2(Z){if(!r0)return Z;return Array.from(Z,(Q)=>r0.has(Q)||Q.charCodeAt(0)<32?"_":Q).join("")}var t0=(Z,Q)=>{let z;try{let $=typeof Bun<"u"?import.meta.resolve(Z,Q):import.meta.resolve(Q);z=L.some($)}catch{z=L.none()}return{directory:Q,entrypoint:z}},H2=g.effect(J0,J.gen(function*(){let Z=yield*f.Service,Q=yield*o.Service,z=yield*Z2.FileSystem,$=yield*A0.Service,X=(H)=>k.join(Q.cache,"packages",Y2(H)),Y=(H)=>J.gen(function*(){yield*$.acquire(`npm-install:${H.dir}`);let{Arborist:q}=yield*J.promise(()=>import("./chunk-pb30kkbs.js").then((m)=>W0(m.default,1))),R=new q({path:H.dir,binLinks:!0,progress:!1,savePrefix:"",ignoreScripts:!0});return yield*J.tryPromise({try:()=>R.reify({add:H?.add||[],save:!0,saveType:"prod"}),catch:(N)=>new D0({cause:N,add:H?.add,dir:H.dir})})}).pipe(J.withSpan("Npm.reify",{attributes:H})),U=J.fn("Npm.outdated")(function*(H,q){let R=yield*J.tryPromise({try:()=>fetch(`https://registry.npmjs.org/${H}`),catch:()=>{return}}).pipe(J.orElseSucceed(()=>{return}));if(!R||!R.ok)return!1;let A=(yield*J.tryPromise({try:()=>R.json(),catch:()=>{return}}).pipe(J.orElseSucceed(()=>{return})))?.["dist-tags"]?.latest;if(!A)return!1;if(/[\s^~*xX<>|=]/.test(q))return!S0.default.satisfies(A,q);return S0.default.lt(q,A)}),G=J.fn("Npm.add")(function*(H){let q=X(H),R=(()=>{try{return X2.default(H).name??H}catch{return H}})();if(yield*Z.existsSafe(q))return t0(R,k.join(q,"node_modules",R));let A=(yield*Y({dir:q,add:[H]})).edgesOut.values().next().value?.to;if(!A)return yield*new D0({add:[H],dir:q});return t0(A.name,A.path)},J.scoped),W=J.fn("Npm.install")(function*(H,q){if(!(yield*Z.access(H,{writable:!0}).pipe(J.as(!0),J.orElseSucceed(()=>!1))))return;let N=q?.add.map((A)=>[A.name,A.version].filter(Boolean).join("@"))??[];if(yield*J.gen(function*(){if(!(yield*Z.existsSafe(k.join(H,"node_modules"))))return yield*Y({add:N,dir:H}),!0;return!1}).pipe(J.withSpan("Npm.checkNodeModules")))return;yield*J.gen(function*(){let A=yield*Z.readJson(k.join(H,"package.json")).pipe(J.orElseSucceed(()=>({}))),O=yield*Z.readJson(k.join(H,"package-lock.json")).pipe(J.orElseSucceed(()=>({}))),K=A,y=O,v=new Set([...Object.keys(K?.dependencies||{}),...Object.keys(K?.devDependencies||{}),...Object.keys(K?.peerDependencies||{}),...Object.keys(K?.optionalDependencies||{}),...(q?.add||[]).map((V)=>V.name)]),j=y?.packages?.[""]||{},_=new Set([...Object.keys(j?.dependencies||{}),...Object.keys(j?.devDependencies||{}),...Object.keys(j?.peerDependencies||{}),...Object.keys(j?.optionalDependencies||{})]);for(let V of v)if(!_.has(V)){yield*Y({dir:H,add:N});return}}).pipe(J.withSpan("Npm.checkDirty"));return},J.scoped),I=J.fn("Npm.which")(function*(H){let q=X(H),R=k.join(q,"node_modules",".bin"),N=J.fnUntraced(function*(){let A=yield*z.readDirectory(R).pipe(J.catch(()=>J.succeed([])));if(A.length===0)return L.none();if(A.length===1)return L.some(A[0]);let O=yield*Z.readJson(k.join(q,"node_modules",H,"package.json")).pipe(J.option);if(L.isSome(O)){let K=O.value;if(K?.bin){let y=H.startsWith("@")?H.split("/")[1]:H,v=K.bin;if(typeof v==="string")return L.some(y);let j=Object.keys(v);if(j.length===1)return L.some(j[0]);return v[y]?L.some(y):L.some(j[0])}}return L.some(A[0])});return yield*J.gen(function*(){let A=yield*N();if(L.isSome(A))return L.some(k.join(R,A.value));yield*z.remove(k.join(q,"package-lock.json")).pipe(J.orElseSucceed(()=>{})),yield*G(H);let O=yield*N();if(L.isNone(O))return L.none();return L.some(k.join(R,O.value))}).pipe(J.scoped,J.orElseSucceed(()=>L.none()))});return J0.of({add:G,install:W,outdated:U,which:I})})),J2=H2.pipe(g.provide(A0.layer),g.provide(f.layer),g.provide(o.layer),g.provide($2.layer)),{runPromise:_0}=n0(J0,J2);async function T2(...Z){return _0((Q)=>Q.install(...Z))}async function y2(...Z){let Q=await _0((z)=>z.add(...Z));return{directory:Q.directory,entrypoint:L.getOrUndefined(Q.entrypoint)}}async function P2(...Z){return _0((Q)=>Q.outdated(...Z))}async function S2(...Z){let Q=await _0((z)=>z.which(...Z));return L.getOrUndefined(Q)}var G2=W0(Q2(),1),N0=W0(z2(),1);import u from"path";import{fileURLToPath as F0,pathToFileURL as a}from"url";var m2=["opencode-openai-codex-auth","opencode-copilot-auth"];function gZ(Z){return m2.some((Q)=>Z.includes(Q))}function j2(Z){try{return G2.default(Z)}catch{}}function kZ(Z){let Q=j2(Z);if(Q?.type==="alias"&&!Q.name){let z=Q.subSpec;if(z?.name){let $=!z.rawSpec||z.rawSpec==="*"?"latest":z.rawSpec;return{pkg:z.name,version:$}}}if(!Q?.name)return{pkg:Z,version:""};if(Q.raw===Q.name)return{pkg:Q.name,version:"latest"};return{pkg:Q.name,version:Q.rawSpec}}var E2=["index.ts","index.tsx","index.js","index.mjs","index.cjs"];function M2(Z){if(I2(Z))return"file";return"npm"}function v2(Z,Q){if(Z.startsWith("file://"))return F0(Z);if(u.isAbsolute(Z))return Z;return u.resolve(Q,Z)}function U2(Z){return u.isAbsolute(Z)||/^[A-Za-z]:[\\/]/.test(Z)}function x2(Z){if(typeof Z==="string")return Z;if(!t(Z))return;for(let Q of["import","default"]){let z=Z[Q];if(typeof z==="string")return z}return}function g2(Z){let Q=Z.json.main;if(typeof Q!=="string")return;let z=Q.trim();if(!z)return;return z}function q2(Z,Q,z,$){let X=v2(Q,$.dir),Y=S.resolve($.dir),U=S.resolve(X);if(!S.contains(Y,U))throw Error(`Plugin ${Z} resolved ${z} entry outside plugin directory`);return U}function W2(Z,Q,z,$){return a(q2(Z,Q,z,$)).href}function k2(Z,Q,z){let $=z.json.exports;if(t($)){let Y=x2($[`./${Q}`]);if(Y)return W2(Z,Y,Q,z)}if(Q!=="server")return;let X=g2(z);if(!X)return;return W2(Z,X,Q,z)}function u2(Z){if(Z.startsWith("file://"))return F0(Z);if(u.isAbsolute(Z))return Z}async function m0(Z){for(let Q of E2){let z=u.join(Z,Q);if(await S.exists(z))return z}}async function f2(Z){let Q=u2(Z);if(!Q)return;if(!(await S.statAsync(Q))?.isDirectory())return;return Q}async function l2(Z,Q,z,$){let X=M2(Z),Y=$??(X==="npm"?await r(Q):await r(Q).catch(()=>{return}));if(!Y)return Q;let U=k2(Z,z,Y);if(U)return U;let G=await f2(Q);if(z==="tui"){if(X==="file"&&G){let W=await m0(G);if(W)return a(W).href}if(X==="npm")return;if(G)return;return Q}if(G&&t(Y.json.exports)){if(X==="file"){let W=await m0(G);if(W)return a(W).href}return}return Q}function I2(Z){return Z.startsWith("file://")||Z.startsWith(".")||U2(Z)}async function h2(Z){let Q=Z.startsWith("file://")?F0(Z):Z,z=u.isAbsolute(Q)||/^[A-Za-z]:[\\/]/.test(Q)?Q:u.resolve(Q);if(!(await S.statAsync(z))?.isDirectory()){if(Z.startsWith("file://"))return Z;return a(z).href}if(await S.exists(u.join(z,"package.json")))return a(z).href;let X=await m0(z);if(X)return a(X).href;throw Error(`Plugin directory ${z} is missing package.json or index file`)}async function uZ(Z,Q,z){if(!N0.default.valid(Q)||N0.default.major(Q)===0)return;let $=z??await r(Z).catch(()=>{return});if(!$)return;let X=$.json.engines;if(!t(X))return;let Y=X.qitqode??X.opencode;if(typeof Y!=="string")return;if(!N0.default.satisfies(Q,Y))throw Error(`Plugin requires qitqode ${Y} but running ${Q}`)}async function fZ(Z){if(I2(Z))return h2(Z);let Q=j2(Z),z=Q?.name&&Q.raw===Q.name?`${Q.name}@latest`:Z;return(await G0.add(z)).directory}async function r(Z){let Q=Z.startsWith("file://")?F0(Z):Z,$=(await S.statAsync(Q))?.isDirectory()?Q:u.dirname(Q),X=u.join($,"package.json"),Y=await S.readJson(X);return{dir:$,pkg:X,json:Y}}async function lZ(Z,Q,z){let $=M2(Z),X=$==="npm"?await r(Q):await r(Q).catch(()=>{return}),Y=await l2(Z,Q,z,X);return{spec:Z,source:$,target:Q,pkg:X,entry:Y}}function hZ(Z,Q){let z=Q.json["oc-themes"];if(z===void 0)return[];if(!Array.isArray(z))throw TypeError(`Plugin ${Z} has invalid oc-themes field`);let $=z.map((X)=>{if(typeof X!=="string")throw TypeError(`Plugin ${Z} has invalid oc-themes entry`);let Y=X.trim();if(!Y)throw TypeError(`Plugin ${Z} has empty oc-themes entry`);if(Y.startsWith("file://")||U2(Y))throw TypeError(`Plugin ${Z} oc-themes entry must be relative: ${X}`);return q2(Z,Y,"oc-themes",Q)});return Array.from(new Set($))}function pZ(Z,Q){if(Z===void 0)return;if(typeof Z!=="string")throw TypeError(`Plugin ${Q} has invalid id type ${typeof Z}`);let z=Z.trim();if(!z)throw TypeError(`Plugin ${Q} has an empty id`);return z}function CZ(Z,Q,z,$="strict"){let X=Z.default;if(!t(X)){if($==="detect")return;throw TypeError(`Plugin ${Q} must default export an object with ${z}()`)}if($==="detect"&&!("id"in X)&&!("server"in X)&&!("tui"in X))return;let Y="server"in X?X.server:void 0,U="tui"in X?X.tui:void 0;if(Y!==void 0&&typeof Y!=="function")throw TypeError(`Plugin ${Q} has invalid server export`);if(U!==void 0&&typeof U!=="function")throw TypeError(`Plugin ${Q} has invalid tui export`);if(Y!==void 0&&U!==void 0)throw TypeError(`Plugin ${Q} must default export either server() or tui(), not both`);if(z==="server"&&Y===void 0)throw TypeError(`Plugin ${Q} must default export an object with server()`);if(z==="tui"&&U===void 0)throw TypeError(`Plugin ${Q} must default export an object with tui()`);return X}async function cZ(Z,Q,z,$,X){if(Z==="file"){if($)return $;throw TypeError(`Path plugin ${Q} must export id`)}if($)return $;let Y=X??await r(z);if(typeof Y.json.name!=="string"||!Y.json.name.trim())throw TypeError(`Plugin package ${Y.pkg} is missing name`);return Y.json.name.trim()}var g0={};e0(g0,{readFile:()=>s2,files:()=>C2,fileInDirectory:()=>i2,directories:()=>c2,claudeCommandDirectories:()=>d2,ConfigPaths:()=>g0});import v0 from"path";var R2=E0.create("ConfigJsonError",p.object({path:p.string(),message:p.string().optional()})),nZ=E0.create("ConfigInvalidError",p.object({path:p.string(),issues:p.custom().optional(),message:p.string().optional()}));var C2=K0("ConfigPaths.projectFiles")(function*(Z,Q,z){return(yield*(yield*f.Service).up({targets:[`${Z}.jsonc`,`${Z}.json`],start:Q,stop:z})).toReversed()}),c2=K0("ConfigPaths.directories")(function*(Z,Q){let z=yield*f.Service;return x0([j0.Path.config,...!e.QITQODE_DISABLE_PROJECT_CONFIG?yield*z.up({targets:[".qitqode"],start:Z,stop:Q}):[],...yield*z.up({targets:[".qitqode"],start:j0.Path.home,stop:j0.Path.home}),...e.QITQODE_CONFIG_DIR?[e.QITQODE_CONFIG_DIR]:[]])}),d2=K0("ConfigPaths.claudeCommandDirectories")(function*(Z,Q){if(e.QITQODE_DISABLE_CLAUDE_CODE_COMMANDS)return[];let z=yield*f.Service;return x0([v0.join(j0.Path.home,".claude"),...!e.QITQODE_DISABLE_PROJECT_CONFIG?yield*z.up({targets:[".claude"],start:Z,stop:Q}):[]])});function i2(Z,Q){return[v0.join(Z,`${Q}.json`),v0.join(Z,`${Q}.jsonc`)]}async function s2(Z){return S.readText(Z).catch((Q)=>{if(Q.code==="ENOENT")return;throw new R2({path:Z},{cause:Q})})}
17
+ export{A0 as in,JZ as jn,WZ as kn,GZ as ln,jZ as mn,R2 as nn,nZ as on,n0 as pn,G0 as qn,gZ as rn,kZ as sn,M2 as tn,I2 as un,h2 as vn,uZ as wn,fZ as xn,r as yn,lZ as zn,hZ as An,pZ as Bn,CZ as Cn,cZ as Dn,C2 as En,c2 as Fn,i2 as Gn,s2 as Hn,g0 as In};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Os as a,Ps as b,Qs as c,Rs as d,Ss as e,Ts as f,Us as g,Vs as h}from"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-r9w0thdk.js";export{g as redactValue,e as init,f as flush,d as file,b as enabled,h as create,a as Level,c as Default};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{$e as b,Ge as T,Ie as VG,Ke as c,Oe as h,Ze as l,_e as R,df as f,ef as i,ff as v}from"./chunk-6j339s7a.js";import{cq as KG,dq as s,iq as BG,kq as S}from"./chunk-4mvg7jt1.js";import{au as G}from"./chunk-9ea1n338.js";var EG=G.object({error:G.object({message:G.string(),type:G.string().nullish(),param:G.any().nullish(),code:G.union([G.string(),G.number()]).nullish()})}),n={errorSchema:EG,errorToMessage:(Q)=>Q.error.message};function $G(Q){var Y,Z,$,U,z,j;if(Q==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 K=(Y=Q.prompt_tokens)!=null?Y:0,W=(Z=Q.completion_tokens)!=null?Z:0,X=(U=($=Q.prompt_tokens_details)==null?void 0:$.cached_tokens)!=null?U:0,J=(j=(z=Q.completion_tokens_details)==null?void 0:z.reasoning_tokens)!=null?j:0;return{inputTokens:{total:K,noCache:K-X,cacheRead:X,cacheWrite:void 0},outputTokens:{total:W,text:W-J,reasoning:J},raw:Q}}function C(Q){var Y,Z;return(Z=(Y=Q==null?void 0:Q.providerOptions)==null?void 0:Y.openaiCompatible)!=null?Z:{}}function HG(Q){switch(Q){case"audio/wav":return"wav";case"audio/mp3":case"audio/mpeg":return"mp3";default:return null}}function AG(Q){var Y,Z,$;let U=[];for(let{role:z,content:j,...K}of Q){let W=C({...K});switch(z){case"system":{U.push({role:"system",content:j,...W});break}case"user":{if(j.length===1&&j[0].type==="text"){U.push({role:"user",content:j[0].text,...C(j[0])});break}U.push({role:"user",content:j.map((X)=>{var J;let B=C(X);switch(X.type){case"text":return{type:"text",text:X.text,...B};case"file":{if(X.mediaType.startsWith("image/")){let L=X.mediaType==="image/*"?"image/jpeg":X.mediaType;return{type:"image_url",image_url:{url:X.data instanceof URL?X.data.toString():`data:${L};base64,${c(X.data)}`},...B}}if(X.mediaType.startsWith("audio/")){if(X.data instanceof URL)throw new S({functionality:"audio file parts with URLs"});let L=HG(X.mediaType);if(L===null)throw new S({functionality:`audio media type ${X.mediaType}`});return{type:"input_audio",input_audio:{data:c(X.data),format:L},...B}}if(X.mediaType==="application/pdf"){if(X.data instanceof URL)throw new S({functionality:"PDF file parts with URLs"});return{type:"file",file:{filename:(J=X.filename)!=null?J:"document.pdf",file_data:`data:application/pdf;base64,${c(X.data)}`},...B}}if(X.mediaType.startsWith("text/"))return{type:"text",text:X.data instanceof URL?X.data.toString():typeof X.data==="string"?new TextDecoder().decode(VG(X.data)):new TextDecoder().decode(X.data),...B};throw new S({functionality:`file part media type ${X.mediaType}`})}}}),...W});break}case"assistant":{let X="",J="",B=[];for(let L of j){let N=C(L);switch(L.type){case"text":{X+=L.text;break}case"reasoning":{J+=L.text;break}case"tool-call":{let H=(Z=(Y=L.providerOptions)==null?void 0:Y.google)==null?void 0:Z.thoughtSignature;B.push({id:L.toolCallId,type:"function",function:{name:L.toolName,arguments:JSON.stringify(L.input)},...N,...H?{extra_content:{google:{thought_signature:String(H)}}}:{}});break}}}U.push({role:"assistant",content:X,...J.length>0?{reasoning_content:J}:{},tool_calls:B.length>0?B:void 0,...W});break}case"tool":{for(let X of j){if(X.type==="tool-approval-response")continue;let J=X.output,B;switch(J.type){case"text":case"error-text":B=J.value;break;case"execution-denied":B=($=J.reason)!=null?$:"Tool execution denied.";break;case"content":case"json":case"error-json":B=JSON.stringify(J.value);break}let L=C(X);U.push({role:"tool",tool_call_id:X.toolCallId,content:B,...L})}break}default:throw Error(`Unsupported role: ${z}`)}}return U}function JG({id:Q,model:Y,created:Z}){return{id:Q!=null?Q:void 0,modelId:Y!=null?Y:void 0,timestamp:Z!=null?new Date(Z*1000):void 0}}function UG(Q){switch(Q){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 d=G.object({user:G.string().optional(),reasoningEffort:G.string().optional(),textVerbosity:G.string().optional(),strictJsonSchema:G.boolean().optional()});function PG({tools:Q,toolChoice:Y}){Q=(Q==null?void 0:Q.length)?Q:void 0;let Z=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:Z};let $=[];for(let z of Q)if(z.type==="provider")Z.push({type:"unsupported",feature:`provider-defined tool ${z.id}`});else $.push({type:"function",function:{name:z.name,description:z.description,parameters:z.inputSchema,...z.strict!=null?{strict:z.strict}:{}}});if(Y==null)return{tools:$,toolChoice:void 0,toolWarnings:Z};let U=Y.type;switch(U){case"auto":case"none":case"required":return{tools:$,toolChoice:U,toolWarnings:Z};case"tool":return{tools:$,toolChoice:{type:"function",function:{name:Y.toolName}},toolWarnings:Z};default:throw new S({functionality:`tool choice type: ${U}`})}}var CG=class{constructor(Q,Y){this.specificationVersion="v3";var Z,$;this.modelId=Q,this.config=Y;let U=(Z=Y.errorStructure)!=null?Z:n;this.chunkSchema=DG(U.errorSchema),this.failedResponseHandler=f(U),this.supportsStructuredOutputs=($=Y.supportsStructuredOutputs)!=null?$:!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var Q,Y,Z;return(Z=(Y=(Q=this.config).supportedUrls)==null?void 0:Y.call(Q))!=null?Z:{}}transformRequestBody(Q){var Y,Z,$;return($=(Z=(Y=this.config).transformRequestBody)==null?void 0:Z.call(Y,Q))!=null?$:Q}async getArgs({prompt:Q,maxOutputTokens:Y,temperature:Z,topP:$,topK:U,frequencyPenalty:z,presencePenalty:j,providerOptions:K,stopSequences:W,responseFormat:X,seed:J,toolChoice:B,tools:L}){var N,H,E,V,q;let A=[],I=await R({provider:"openai-compatible",providerOptions:K,schema:d});if(I!=null)A.push({type:"other",message:"The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead."});let D=Object.assign(I!=null?I:{},(N=await R({provider:"openaiCompatible",providerOptions:K,schema:d}))!=null?N:{},(H=await R({provider:this.providerOptionsName,providerOptions:K,schema:d}))!=null?H:{}),P=(E=D==null?void 0:D.strictJsonSchema)!=null?E:!0;if(U!=null)A.push({type:"unsupported",feature:"topK"});if((X==null?void 0:X.type)==="json"&&X.schema!=null&&!this.supportsStructuredOutputs)A.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:w,toolChoice:y,toolWarnings:u}=PG({tools:L,toolChoice:B});return{args:{model:this.modelId,user:D.user,max_tokens:Y,temperature:Z,top_p:$,frequency_penalty:z,presence_penalty:j,response_format:(X==null?void 0:X.type)==="json"?this.supportsStructuredOutputs===!0&&X.schema!=null?{type:"json_schema",json_schema:{schema:X.schema,strict:P,name:(V=X.name)!=null?V:"response",description:X.description}}:{type:"json_object"}:void 0,stop:W,seed:J,...Object.fromEntries(Object.entries((q=K==null?void 0:K[this.providerOptionsName])!=null?q:{}).filter(([g])=>!Object.keys(d.shape).includes(g))),reasoning_effort:D.reasoningEffort,verbosity:D.textVerbosity,messages:AG(Q),tools:w,tool_choice:y},warnings:[...A,...u]}}async doGenerate(Q){var Y,Z,$,U,z,j,K,W;let{args:X,warnings:J}=await this.getArgs({...Q}),B=this.transformRequestBody(X),L=JSON.stringify(B),{responseHeaders:N,value:H,rawValue:E}=await b({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:B,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:v(qG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),V=H.choices[0],q=[],A=V.message.content;if(A!=null&&A.length>0)q.push({type:"text",text:A});let I=(Y=V.message.reasoning_content)!=null?Y:V.message.reasoning;if(I!=null&&I.length>0)q.push({type:"reasoning",text:I});if(V.message.tool_calls!=null)for(let w of V.message.tool_calls){let y=($=(Z=w.extra_content)==null?void 0:Z.google)==null?void 0:$.thought_signature;q.push({type:"tool-call",toolCallId:(U=w.id)!=null?U:h(),toolName:w.function.name,input:w.function.arguments,...y?{providerMetadata:{[this.providerOptionsName]:{thoughtSignature:y}}}:{}})}let D={[this.providerOptionsName]:{},...await((j=(z=this.config.metadataExtractor)==null?void 0:z.extractMetadata)==null?void 0:j.call(z,{parsedBody:E}))},P=(K=H.usage)==null?void 0:K.completion_tokens_details;if((P==null?void 0:P.accepted_prediction_tokens)!=null)D[this.providerOptionsName].acceptedPredictionTokens=P==null?void 0:P.accepted_prediction_tokens;if((P==null?void 0:P.rejected_prediction_tokens)!=null)D[this.providerOptionsName].rejectedPredictionTokens=P==null?void 0:P.rejected_prediction_tokens;return{content:q,finishReason:{unified:UG(V.finish_reason),raw:(W=V.finish_reason)!=null?W:void 0},usage:$G(H.usage),providerMetadata:D,request:{body:L},response:{...JG(H),headers:N,body:E},warnings:J}}async doStream(Q){var Y;let{args:Z,warnings:$}=await this.getArgs({...Q}),U=this.transformRequestBody({...Z,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0}),z=(Y=this.config.metadataExtractor)==null?void 0:Y.createStreamExtractor(),{responseHeaders:j,value:K}=await b({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:U,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:i(this.chunkSchema),abortSignal:Q.abortSignal,fetch:this.config.fetch}),W=[],X={unified:"other",raw:void 0},J=void 0,B=!0,L=this.providerOptionsName,N=!1,H=!1;return{stream:K.pipeThrough(new TransformStream({start(E){E.enqueue({type:"stream-start",warnings:$})},transform(E,V){var q,A,I,D,P,w,y,u,g,a,r,t,e,o,GG,QG,XG,YG;if(Q.includeRawChunks)V.enqueue({type:"raw",rawValue:E.rawValue});if(!E.success){X={unified:"error",raw:void 0},V.enqueue({type:"error",error:E.error});return}if(z==null||z.processChunk(E.rawValue),"error"in E.value){X={unified:"error",raw:void 0},V.enqueue({type:"error",error:E.value.error.message});return}let _=E.value;if(B)B=!1,V.enqueue({type:"response-metadata",...JG(_)});if(_.usage!=null)J=_.usage;let O=_.choices[0];if((O==null?void 0:O.finish_reason)!=null)X={unified:UG(O.finish_reason),raw:(q=O.finish_reason)!=null?q:void 0};if((O==null?void 0:O.delta)==null)return;let k=O.delta,ZG=(A=k.reasoning_content)!=null?A:k.reasoning;if(ZG){if(!N)V.enqueue({type:"reasoning-start",id:"reasoning-0"}),N=!0;V.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:ZG})}if(k.content){if(N)V.enqueue({type:"reasoning-end",id:"reasoning-0"}),N=!1;if(!H)V.enqueue({type:"text-start",id:"txt-0"}),H=!0;V.enqueue({type:"text-delta",id:"txt-0",delta:k.content})}if(k.tool_calls!=null){if(N)V.enqueue({type:"reasoning-end",id:"reasoning-0"}),N=!1;for(let x of k.tool_calls){let m=(I=x.index)!=null?I:W.length;if(W[m]==null){if(x.id==null)throw new s({data:x,message:"Expected 'id' to be a string."});if(((D=x.function)==null?void 0:D.name)==null)throw new s({data:x,message:"Expected 'function.name' to be a string."});V.enqueue({type:"tool-input-start",id:x.id,toolName:x.function.name}),W[m]={id:x.id,type:"function",function:{name:x.function.name,arguments:(P=x.function.arguments)!=null?P:""},hasFinished:!1,thoughtSignature:(u=(y=(w=x.extra_content)==null?void 0:w.google)==null?void 0:y.thought_signature)!=null?u:void 0};let M=W[m];if(((g=M.function)==null?void 0:g.name)!=null&&((a=M.function)==null?void 0:a.arguments)!=null){if(M.function.arguments.length>0)V.enqueue({type:"tool-input-delta",id:M.id,delta:M.function.arguments});if(l(M.function.arguments))V.enqueue({type:"tool-input-end",id:M.id}),V.enqueue({type:"tool-call",toolCallId:(r=M.id)!=null?r:h(),toolName:M.function.name,input:M.function.arguments,...M.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:M.thoughtSignature}}}:{}}),M.hasFinished=!0}continue}let F=W[m];if(F.hasFinished)continue;if(((t=x.function)==null?void 0:t.arguments)!=null)F.function.arguments+=(o=(e=x.function)==null?void 0:e.arguments)!=null?o:"";if(V.enqueue({type:"tool-input-delta",id:F.id,delta:(GG=x.function.arguments)!=null?GG:""}),((QG=F.function)==null?void 0:QG.name)!=null&&((XG=F.function)==null?void 0:XG.arguments)!=null&&l(F.function.arguments))V.enqueue({type:"tool-input-end",id:F.id}),V.enqueue({type:"tool-call",toolCallId:(YG=F.id)!=null?YG:h(),toolName:F.function.name,input:F.function.arguments,...F.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:F.thoughtSignature}}}:{}}),F.hasFinished=!0}}},flush(E){var V,q,A,I,D;if(N)E.enqueue({type:"reasoning-end",id:"reasoning-0"});if(H)E.enqueue({type:"text-end",id:"txt-0"});for(let w of W.filter((y)=>!y.hasFinished))E.enqueue({type:"tool-input-end",id:w.id}),E.enqueue({type:"tool-call",toolCallId:(V=w.id)!=null?V:h(),toolName:w.function.name,input:w.function.arguments,...w.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:w.thoughtSignature}}}:{}});let P={[L]:{},...z==null?void 0:z.buildMetadata()};if(((q=J==null?void 0:J.completion_tokens_details)==null?void 0:q.accepted_prediction_tokens)!=null)P[L].acceptedPredictionTokens=(A=J==null?void 0:J.completion_tokens_details)==null?void 0:A.accepted_prediction_tokens;if(((I=J==null?void 0:J.completion_tokens_details)==null?void 0:I.rejected_prediction_tokens)!=null)P[L].rejectedPredictionTokens=(D=J==null?void 0:J.completion_tokens_details)==null?void 0:D.rejected_prediction_tokens;E.enqueue({type:"finish",finishReason:X,usage:$G(J),providerMetadata:P})}})),request:{body:U},response:{headers:j}}}},WG=G.looseObject({prompt_tokens:G.number().nullish(),completion_tokens:G.number().nullish(),total_tokens:G.number().nullish(),prompt_tokens_details:G.object({cached_tokens:G.number().nullish()}).nullish(),completion_tokens_details:G.object({reasoning_tokens:G.number().nullish(),accepted_prediction_tokens:G.number().nullish(),rejected_prediction_tokens:G.number().nullish()}).nullish()}).nullish(),qG=G.looseObject({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({message:G.object({role:G.literal("assistant").nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),reasoning:G.string().nullish(),tool_calls:G.array(G.object({id:G.string().nullish(),function:G.object({name:G.string(),arguments:G.string()}),extra_content:G.object({google:G.object({thought_signature:G.string().nullish()}).nullish()}).nullish()})).nullish()}),finish_reason:G.string().nullish()})),usage:WG}),wG=G.looseObject({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({delta:G.object({role:G.enum(["assistant"]).nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),reasoning:G.string().nullish(),tool_calls:G.array(G.object({index:G.number().nullish(),id:G.string().nullish(),function:G.object({name:G.string().nullish(),arguments:G.string().nullish()}),extra_content:G.object({google:G.object({thought_signature:G.string().nullish()}).nullish()}).nullish()})).nullish()}).nullish(),finish_reason:G.string().nullish()})),usage:WG}),DG=(Q)=>G.union([wG,Q]);function jG(Q){var Y,Z;if(Q==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=Q.prompt_tokens)!=null?Y:0,U=(Z=Q.completion_tokens)!=null?Z:0;return{inputTokens:{total:$,noCache:$,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:U,text:U,reasoning:void 0},raw:Q}}function xG({prompt:Q,user:Y="user",assistant:Z="assistant"}){let $="";if(Q[0].role==="system")$+=`${Q[0].content}
2
+ import{Re as T,Te as VG,Ve as c,Ze as h,if as l,jf as R,kf as b,of as f,pf as i,qf as v}from"./chunk-7mppvhv9.js";import{Np as KG,Op as s,Tp as BG,Vp as S}from"./chunk-ptqk1j2r.js";import{Jt as G}from"./chunk-j9h1sp4g.js";var EG=G.object({error:G.object({message:G.string(),type:G.string().nullish(),param:G.any().nullish(),code:G.union([G.string(),G.number()]).nullish()})}),n={errorSchema:EG,errorToMessage:(Q)=>Q.error.message};function $G(Q){var Y,Z,$,U,z,j;if(Q==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 K=(Y=Q.prompt_tokens)!=null?Y:0,W=(Z=Q.completion_tokens)!=null?Z:0,X=(U=($=Q.prompt_tokens_details)==null?void 0:$.cached_tokens)!=null?U:0,J=(j=(z=Q.completion_tokens_details)==null?void 0:z.reasoning_tokens)!=null?j:0;return{inputTokens:{total:K,noCache:K-X,cacheRead:X,cacheWrite:void 0},outputTokens:{total:W,text:W-J,reasoning:J},raw:Q}}function C(Q){var Y,Z;return(Z=(Y=Q==null?void 0:Q.providerOptions)==null?void 0:Y.openaiCompatible)!=null?Z:{}}function HG(Q){switch(Q){case"audio/wav":return"wav";case"audio/mp3":case"audio/mpeg":return"mp3";default:return null}}function AG(Q){var Y,Z,$;let U=[];for(let{role:z,content:j,...K}of Q){let W=C({...K});switch(z){case"system":{U.push({role:"system",content:j,...W});break}case"user":{if(j.length===1&&j[0].type==="text"){U.push({role:"user",content:j[0].text,...C(j[0])});break}U.push({role:"user",content:j.map((X)=>{var J;let B=C(X);switch(X.type){case"text":return{type:"text",text:X.text,...B};case"file":{if(X.mediaType.startsWith("image/")){let L=X.mediaType==="image/*"?"image/jpeg":X.mediaType;return{type:"image_url",image_url:{url:X.data instanceof URL?X.data.toString():`data:${L};base64,${c(X.data)}`},...B}}if(X.mediaType.startsWith("audio/")){if(X.data instanceof URL)throw new S({functionality:"audio file parts with URLs"});let L=HG(X.mediaType);if(L===null)throw new S({functionality:`audio media type ${X.mediaType}`});return{type:"input_audio",input_audio:{data:c(X.data),format:L},...B}}if(X.mediaType==="application/pdf"){if(X.data instanceof URL)throw new S({functionality:"PDF file parts with URLs"});return{type:"file",file:{filename:(J=X.filename)!=null?J:"document.pdf",file_data:`data:application/pdf;base64,${c(X.data)}`},...B}}if(X.mediaType.startsWith("text/"))return{type:"text",text:X.data instanceof URL?X.data.toString():typeof X.data==="string"?new TextDecoder().decode(VG(X.data)):new TextDecoder().decode(X.data),...B};throw new S({functionality:`file part media type ${X.mediaType}`})}}}),...W});break}case"assistant":{let X="",J="",B=[];for(let L of j){let N=C(L);switch(L.type){case"text":{X+=L.text;break}case"reasoning":{J+=L.text;break}case"tool-call":{let H=(Z=(Y=L.providerOptions)==null?void 0:Y.google)==null?void 0:Z.thoughtSignature;B.push({id:L.toolCallId,type:"function",function:{name:L.toolName,arguments:JSON.stringify(L.input)},...N,...H?{extra_content:{google:{thought_signature:String(H)}}}:{}});break}}}U.push({role:"assistant",content:X,...J.length>0?{reasoning_content:J}:{},tool_calls:B.length>0?B:void 0,...W});break}case"tool":{for(let X of j){if(X.type==="tool-approval-response")continue;let J=X.output,B;switch(J.type){case"text":case"error-text":B=J.value;break;case"execution-denied":B=($=J.reason)!=null?$:"Tool execution denied.";break;case"content":case"json":case"error-json":B=JSON.stringify(J.value);break}let L=C(X);U.push({role:"tool",tool_call_id:X.toolCallId,content:B,...L})}break}default:throw Error(`Unsupported role: ${z}`)}}return U}function JG({id:Q,model:Y,created:Z}){return{id:Q!=null?Q:void 0,modelId:Y!=null?Y:void 0,timestamp:Z!=null?new Date(Z*1000):void 0}}function UG(Q){switch(Q){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 d=G.object({user:G.string().optional(),reasoningEffort:G.string().optional(),textVerbosity:G.string().optional(),strictJsonSchema:G.boolean().optional()});function PG({tools:Q,toolChoice:Y}){Q=(Q==null?void 0:Q.length)?Q:void 0;let Z=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:Z};let $=[];for(let z of Q)if(z.type==="provider")Z.push({type:"unsupported",feature:`provider-defined tool ${z.id}`});else $.push({type:"function",function:{name:z.name,description:z.description,parameters:z.inputSchema,...z.strict!=null?{strict:z.strict}:{}}});if(Y==null)return{tools:$,toolChoice:void 0,toolWarnings:Z};let U=Y.type;switch(U){case"auto":case"none":case"required":return{tools:$,toolChoice:U,toolWarnings:Z};case"tool":return{tools:$,toolChoice:{type:"function",function:{name:Y.toolName}},toolWarnings:Z};default:throw new S({functionality:`tool choice type: ${U}`})}}var CG=class{constructor(Q,Y){this.specificationVersion="v3";var Z,$;this.modelId=Q,this.config=Y;let U=(Z=Y.errorStructure)!=null?Z:n;this.chunkSchema=DG(U.errorSchema),this.failedResponseHandler=f(U),this.supportsStructuredOutputs=($=Y.supportsStructuredOutputs)!=null?$:!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var Q,Y,Z;return(Z=(Y=(Q=this.config).supportedUrls)==null?void 0:Y.call(Q))!=null?Z:{}}transformRequestBody(Q){var Y,Z,$;return($=(Z=(Y=this.config).transformRequestBody)==null?void 0:Z.call(Y,Q))!=null?$:Q}async getArgs({prompt:Q,maxOutputTokens:Y,temperature:Z,topP:$,topK:U,frequencyPenalty:z,presencePenalty:j,providerOptions:K,stopSequences:W,responseFormat:X,seed:J,toolChoice:B,tools:L}){var N,H,E,V,q;let A=[],I=await R({provider:"openai-compatible",providerOptions:K,schema:d});if(I!=null)A.push({type:"other",message:"The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead."});let D=Object.assign(I!=null?I:{},(N=await R({provider:"openaiCompatible",providerOptions:K,schema:d}))!=null?N:{},(H=await R({provider:this.providerOptionsName,providerOptions:K,schema:d}))!=null?H:{}),P=(E=D==null?void 0:D.strictJsonSchema)!=null?E:!0;if(U!=null)A.push({type:"unsupported",feature:"topK"});if((X==null?void 0:X.type)==="json"&&X.schema!=null&&!this.supportsStructuredOutputs)A.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:w,toolChoice:y,toolWarnings:u}=PG({tools:L,toolChoice:B});return{args:{model:this.modelId,user:D.user,max_tokens:Y,temperature:Z,top_p:$,frequency_penalty:z,presence_penalty:j,response_format:(X==null?void 0:X.type)==="json"?this.supportsStructuredOutputs===!0&&X.schema!=null?{type:"json_schema",json_schema:{schema:X.schema,strict:P,name:(V=X.name)!=null?V:"response",description:X.description}}:{type:"json_object"}:void 0,stop:W,seed:J,...Object.fromEntries(Object.entries((q=K==null?void 0:K[this.providerOptionsName])!=null?q:{}).filter(([g])=>!Object.keys(d.shape).includes(g))),reasoning_effort:D.reasoningEffort,verbosity:D.textVerbosity,messages:AG(Q),tools:w,tool_choice:y},warnings:[...A,...u]}}async doGenerate(Q){var Y,Z,$,U,z,j,K,W;let{args:X,warnings:J}=await this.getArgs({...Q}),B=this.transformRequestBody(X),L=JSON.stringify(B),{responseHeaders:N,value:H,rawValue:E}=await b({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:B,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:v(qG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),V=H.choices[0],q=[],A=V.message.content;if(A!=null&&A.length>0)q.push({type:"text",text:A});let I=(Y=V.message.reasoning_content)!=null?Y:V.message.reasoning;if(I!=null&&I.length>0)q.push({type:"reasoning",text:I});if(V.message.tool_calls!=null)for(let w of V.message.tool_calls){let y=($=(Z=w.extra_content)==null?void 0:Z.google)==null?void 0:$.thought_signature;q.push({type:"tool-call",toolCallId:(U=w.id)!=null?U:h(),toolName:w.function.name,input:w.function.arguments,...y?{providerMetadata:{[this.providerOptionsName]:{thoughtSignature:y}}}:{}})}let D={[this.providerOptionsName]:{},...await((j=(z=this.config.metadataExtractor)==null?void 0:z.extractMetadata)==null?void 0:j.call(z,{parsedBody:E}))},P=(K=H.usage)==null?void 0:K.completion_tokens_details;if((P==null?void 0:P.accepted_prediction_tokens)!=null)D[this.providerOptionsName].acceptedPredictionTokens=P==null?void 0:P.accepted_prediction_tokens;if((P==null?void 0:P.rejected_prediction_tokens)!=null)D[this.providerOptionsName].rejectedPredictionTokens=P==null?void 0:P.rejected_prediction_tokens;return{content:q,finishReason:{unified:UG(V.finish_reason),raw:(W=V.finish_reason)!=null?W:void 0},usage:$G(H.usage),providerMetadata:D,request:{body:L},response:{...JG(H),headers:N,body:E},warnings:J}}async doStream(Q){var Y;let{args:Z,warnings:$}=await this.getArgs({...Q}),U=this.transformRequestBody({...Z,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0}),z=(Y=this.config.metadataExtractor)==null?void 0:Y.createStreamExtractor(),{responseHeaders:j,value:K}=await b({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:U,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:i(this.chunkSchema),abortSignal:Q.abortSignal,fetch:this.config.fetch}),W=[],X={unified:"other",raw:void 0},J=void 0,B=!0,L=this.providerOptionsName,N=!1,H=!1;return{stream:K.pipeThrough(new TransformStream({start(E){E.enqueue({type:"stream-start",warnings:$})},transform(E,V){var q,A,I,D,P,w,y,u,g,a,r,t,e,o,GG,QG,XG,YG;if(Q.includeRawChunks)V.enqueue({type:"raw",rawValue:E.rawValue});if(!E.success){X={unified:"error",raw:void 0},V.enqueue({type:"error",error:E.error});return}if(z==null||z.processChunk(E.rawValue),"error"in E.value){X={unified:"error",raw:void 0},V.enqueue({type:"error",error:E.value.error.message});return}let _=E.value;if(B)B=!1,V.enqueue({type:"response-metadata",...JG(_)});if(_.usage!=null)J=_.usage;let O=_.choices[0];if((O==null?void 0:O.finish_reason)!=null)X={unified:UG(O.finish_reason),raw:(q=O.finish_reason)!=null?q:void 0};if((O==null?void 0:O.delta)==null)return;let k=O.delta,ZG=(A=k.reasoning_content)!=null?A:k.reasoning;if(ZG){if(!N)V.enqueue({type:"reasoning-start",id:"reasoning-0"}),N=!0;V.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:ZG})}if(k.content){if(N)V.enqueue({type:"reasoning-end",id:"reasoning-0"}),N=!1;if(!H)V.enqueue({type:"text-start",id:"txt-0"}),H=!0;V.enqueue({type:"text-delta",id:"txt-0",delta:k.content})}if(k.tool_calls!=null){if(N)V.enqueue({type:"reasoning-end",id:"reasoning-0"}),N=!1;for(let x of k.tool_calls){let m=(I=x.index)!=null?I:W.length;if(W[m]==null){if(x.id==null)throw new s({data:x,message:"Expected 'id' to be a string."});if(((D=x.function)==null?void 0:D.name)==null)throw new s({data:x,message:"Expected 'function.name' to be a string."});V.enqueue({type:"tool-input-start",id:x.id,toolName:x.function.name}),W[m]={id:x.id,type:"function",function:{name:x.function.name,arguments:(P=x.function.arguments)!=null?P:""},hasFinished:!1,thoughtSignature:(u=(y=(w=x.extra_content)==null?void 0:w.google)==null?void 0:y.thought_signature)!=null?u:void 0};let M=W[m];if(((g=M.function)==null?void 0:g.name)!=null&&((a=M.function)==null?void 0:a.arguments)!=null){if(M.function.arguments.length>0)V.enqueue({type:"tool-input-delta",id:M.id,delta:M.function.arguments});if(l(M.function.arguments))V.enqueue({type:"tool-input-end",id:M.id}),V.enqueue({type:"tool-call",toolCallId:(r=M.id)!=null?r:h(),toolName:M.function.name,input:M.function.arguments,...M.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:M.thoughtSignature}}}:{}}),M.hasFinished=!0}continue}let F=W[m];if(F.hasFinished)continue;if(((t=x.function)==null?void 0:t.arguments)!=null)F.function.arguments+=(o=(e=x.function)==null?void 0:e.arguments)!=null?o:"";if(V.enqueue({type:"tool-input-delta",id:F.id,delta:(GG=x.function.arguments)!=null?GG:""}),((QG=F.function)==null?void 0:QG.name)!=null&&((XG=F.function)==null?void 0:XG.arguments)!=null&&l(F.function.arguments))V.enqueue({type:"tool-input-end",id:F.id}),V.enqueue({type:"tool-call",toolCallId:(YG=F.id)!=null?YG:h(),toolName:F.function.name,input:F.function.arguments,...F.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:F.thoughtSignature}}}:{}}),F.hasFinished=!0}}},flush(E){var V,q,A,I,D;if(N)E.enqueue({type:"reasoning-end",id:"reasoning-0"});if(H)E.enqueue({type:"text-end",id:"txt-0"});for(let w of W.filter((y)=>!y.hasFinished))E.enqueue({type:"tool-input-end",id:w.id}),E.enqueue({type:"tool-call",toolCallId:(V=w.id)!=null?V:h(),toolName:w.function.name,input:w.function.arguments,...w.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:w.thoughtSignature}}}:{}});let P={[L]:{},...z==null?void 0:z.buildMetadata()};if(((q=J==null?void 0:J.completion_tokens_details)==null?void 0:q.accepted_prediction_tokens)!=null)P[L].acceptedPredictionTokens=(A=J==null?void 0:J.completion_tokens_details)==null?void 0:A.accepted_prediction_tokens;if(((I=J==null?void 0:J.completion_tokens_details)==null?void 0:I.rejected_prediction_tokens)!=null)P[L].rejectedPredictionTokens=(D=J==null?void 0:J.completion_tokens_details)==null?void 0:D.rejected_prediction_tokens;E.enqueue({type:"finish",finishReason:X,usage:$G(J),providerMetadata:P})}})),request:{body:U},response:{headers:j}}}},WG=G.looseObject({prompt_tokens:G.number().nullish(),completion_tokens:G.number().nullish(),total_tokens:G.number().nullish(),prompt_tokens_details:G.object({cached_tokens:G.number().nullish()}).nullish(),completion_tokens_details:G.object({reasoning_tokens:G.number().nullish(),accepted_prediction_tokens:G.number().nullish(),rejected_prediction_tokens:G.number().nullish()}).nullish()}).nullish(),qG=G.looseObject({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({message:G.object({role:G.literal("assistant").nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),reasoning:G.string().nullish(),tool_calls:G.array(G.object({id:G.string().nullish(),function:G.object({name:G.string(),arguments:G.string()}),extra_content:G.object({google:G.object({thought_signature:G.string().nullish()}).nullish()}).nullish()})).nullish()}),finish_reason:G.string().nullish()})),usage:WG}),wG=G.looseObject({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({delta:G.object({role:G.enum(["assistant"]).nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),reasoning:G.string().nullish(),tool_calls:G.array(G.object({index:G.number().nullish(),id:G.string().nullish(),function:G.object({name:G.string().nullish(),arguments:G.string().nullish()}),extra_content:G.object({google:G.object({thought_signature:G.string().nullish()}).nullish()}).nullish()})).nullish()}).nullish(),finish_reason:G.string().nullish()})),usage:WG}),DG=(Q)=>G.union([wG,Q]);function jG(Q){var Y,Z;if(Q==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=Q.prompt_tokens)!=null?Y:0,U=(Z=Q.completion_tokens)!=null?Z:0;return{inputTokens:{total:$,noCache:$,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:U,text:U,reasoning:void 0},raw:Q}}function xG({prompt:Q,user:Y="user",assistant:Z="assistant"}){let $="";if(Q[0].role==="system")$+=`${Q[0].content}
3
3
 
4
4
  `,Q=Q.slice(1);for(let{role:U,content:z}of Q)switch(U){case"system":throw new KG({message:"Unexpected system message in prompt: ${content}",prompt:Q});case"user":{let j=z.map((K)=>{switch(K.type){case"text":return K.text}}).filter(Boolean).join("");$+=`${Y}:
5
5
  ${j}
@@ -10,4 +10,4 @@ ${j}
10
10
  `;break}case"tool":throw new S({functionality:"tool messages"});default:throw Error(`Unsupported role: ${U}`)}return $+=`${Z}:
11
11
  `,{prompt:$,stopSequences:[`
12
12
  ${Y}:`]}}function LG({id:Q,model:Y,created:Z}){return{id:Q!=null?Q:void 0,modelId:Y!=null?Y:void 0,timestamp:Z!=null?new Date(Z*1000):void 0}}function zG(Q){switch(Q){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 IG=G.object({echo:G.boolean().optional(),logitBias:G.record(G.string(),G.number()).optional(),suffix:G.string().optional(),user:G.string().optional()}),mG=class{constructor(Q,Y){this.specificationVersion="v3";var Z;this.modelId=Q,this.config=Y;let $=(Z=Y.errorStructure)!=null?Z:n;this.chunkSchema=MG($.errorSchema),this.failedResponseHandler=f($)}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var Q,Y,Z;return(Z=(Y=(Q=this.config).supportedUrls)==null?void 0:Y.call(Q))!=null?Z:{}}async getArgs({prompt:Q,maxOutputTokens:Y,temperature:Z,topP:$,topK:U,frequencyPenalty:z,presencePenalty:j,stopSequences:K,responseFormat:W,seed:X,providerOptions:J,tools:B,toolChoice:L}){var N;let H=[],E=(N=await R({provider:this.providerOptionsName,providerOptions:J,schema:IG}))!=null?N:{};if(U!=null)H.push({type:"unsupported",feature:"topK"});if(B==null?void 0:B.length)H.push({type:"unsupported",feature:"tools"});if(L!=null)H.push({type:"unsupported",feature:"toolChoice"});if(W!=null&&W.type!=="text")H.push({type:"unsupported",feature:"responseFormat",details:"JSON response format is not supported."});let{prompt:V,stopSequences:q}=xG({prompt:Q}),A=[...q!=null?q:[],...K!=null?K:[]];return{args:{model:this.modelId,echo:E.echo,logit_bias:E.logitBias,suffix:E.suffix,user:E.user,max_tokens:Y,temperature:Z,top_p:$,frequency_penalty:z,presence_penalty:j,seed:X,...J==null?void 0:J[this.providerOptionsName],prompt:V,stop:A.length>0?A:void 0},warnings:H}}async doGenerate(Q){let{args:Y,warnings:Z}=await this.getArgs(Q),{responseHeaders:$,value:U,rawValue:z}=await b({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:Y,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:v(FG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),j=U.choices[0],K=[];if(j.text!=null&&j.text.length>0)K.push({type:"text",text:j.text});return{content:K,usage:jG(U.usage),finishReason:{unified:zG(j.finish_reason),raw:j.finish_reason},request:{body:Y},response:{...LG(U),headers:$,body:z},warnings:Z}}async doStream(Q){let{args:Y,warnings:Z}=await this.getArgs(Q),$={...Y,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},{responseHeaders:U,value:z}=await b({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:$,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:i(this.chunkSchema),abortSignal:Q.abortSignal,fetch:this.config.fetch}),j={unified:"other",raw:void 0},K=void 0,W=!0;return{stream:z.pipeThrough(new TransformStream({start(X){X.enqueue({type:"stream-start",warnings:Z})},transform(X,J){var B;if(Q.includeRawChunks)J.enqueue({type:"raw",rawValue:X.rawValue});if(!X.success){j={unified:"error",raw:void 0},J.enqueue({type:"error",error:X.error});return}let L=X.value;if("error"in L){j={unified:"error",raw:void 0},J.enqueue({type:"error",error:L.error});return}if(W)W=!1,J.enqueue({type:"response-metadata",...LG(L)}),J.enqueue({type:"text-start",id:"0"});if(L.usage!=null)K=L.usage;let N=L.choices[0];if((N==null?void 0:N.finish_reason)!=null)j={unified:zG(N.finish_reason),raw:(B=N.finish_reason)!=null?B:void 0};if((N==null?void 0:N.text)!=null)J.enqueue({type:"text-delta",id:"0",delta:N.text})},flush(X){if(!W)X.enqueue({type:"text-end",id:"0"});X.enqueue({type:"finish",finishReason:j,usage:jG(K)})}})),request:{body:$},response:{headers:U}}}},NG=G.object({prompt_tokens:G.number(),completion_tokens:G.number(),total_tokens:G.number()}),FG=G.object({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({text:G.string(),finish_reason:G.string()})),usage:NG.nullish()}),MG=(Q)=>G.union([G.object({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({text:G.string(),finish_reason:G.string().nullish(),index:G.number()})),usage:NG.nullish()}),Q]),p=G.object({dimensions:G.number().optional(),user:G.string().optional()}),sG=class{constructor(Q,Y){this.specificationVersion="v3",this.modelId=Q,this.config=Y}get provider(){return this.config.provider}get maxEmbeddingsPerCall(){var Q;return(Q=this.config.maxEmbeddingsPerCall)!=null?Q:2048}get supportsParallelCalls(){var Q;return(Q=this.config.supportsParallelCalls)!=null?Q:!0}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}async doEmbed({values:Q,headers:Y,abortSignal:Z,providerOptions:$}){var U,z,j;let K=[],W=await R({provider:"openai-compatible",providerOptions:$,schema:p});if(W!=null)K.push({type:"other",message:"The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead."});let X=Object.assign(W!=null?W:{},(U=await R({provider:"openaiCompatible",providerOptions:$,schema:p}))!=null?U:{},(z=await R({provider:this.providerOptionsName,providerOptions:$,schema:p}))!=null?z:{});if(Q.length>this.maxEmbeddingsPerCall)throw new BG({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:Q});let{responseHeaders:J,value:B,rawValue:L}=await b({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:T(this.config.headers(),Y),body:{model:this.modelId,input:Q,encoding_format:"float",dimensions:X.dimensions,user:X.user},failedResponseHandler:f((j=this.config.errorStructure)!=null?j:n),successfulResponseHandler:v(SG),abortSignal:Z,fetch:this.config.fetch});return{warnings:K,embeddings:B.data.map((N)=>N.embedding),usage:B.usage?{tokens:B.usage.prompt_tokens}:void 0,providerMetadata:B.providerMetadata,response:{headers:J,body:L}}}},SG=G.object({data:G.array(G.object({embedding:G.array(G.number())})),usage:G.object({prompt_tokens:G.number()}).nullish(),providerMetadata:G.record(G.string(),G.record(G.string(),G.any())).optional()});var nG=G.object({data:G.array(G.object({b64_json:G.string()}))});
13
- export{CG as De,mG as Ee,sG as Fe};
13
+ export{CG as Oe,mG as Pe,sG as Qe};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{wq as f,xq as H}from"./chunk-vm1ek7yf.js";import D from"process";import{Buffer as b}from"buffer";import A from"path";import{fileURLToPath as s}from"url";import SS from"util";import y from"child_process";import z,{constants as u}from"fs/promises";function v(S,$,q){let J=(G)=>Object.defineProperty(S,$,{value:G,enumerable:!0,writable:!0});return Object.defineProperty(S,$,{configurable:!0,enumerable:!0,get(){let G=q();return J(G),G},set(G){J(G)}}),S}import{promisify as i}from"util";import T from"process";import{execFile as n}from"child_process";import{promisify as w}from"util";import h from"process";import{execFile as g}from"child_process";var l=w(g);async function X(){if(h.platform!=="darwin")throw Error("macOS only");let{stdout:S}=await l("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),q=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(S)?.groups.id??"com.apple.Safari";if(q==="com.apple.safari")return"com.apple.Safari";return q}import c from"process";import{promisify as m}from"util";import{execFile as d,execFileSync as kS}from"child_process";var a=m(d);async function W(S,{humanReadableOutput:$=!0,signal:q}={}){if(c.platform!=="darwin")throw Error("macOS only");let J=$?[]:["-ss"],G={};if(q)G.signal=q;let{stdout:Q}=await a("osascript",["-e",S,J],G);return Q.trim()}async function E(S){return W(`tell application "Finder" to set app_path to application file id "${S}" as string
2
+ import{fq as f,gq as H}from"./chunk-yz25607t.js";import D from"process";import{Buffer as b}from"buffer";import A from"path";import{fileURLToPath as s}from"url";import SS from"util";import y from"child_process";import z,{constants as u}from"fs/promises";function v(S,$,q){let J=(G)=>Object.defineProperty(S,$,{value:G,enumerable:!0,writable:!0});return Object.defineProperty(S,$,{configurable:!0,enumerable:!0,get(){let G=q();return J(G),G},set(G){J(G)}}),S}import{promisify as i}from"util";import T from"process";import{execFile as n}from"child_process";import{promisify as w}from"util";import h from"process";import{execFile as g}from"child_process";var l=w(g);async function X(){if(h.platform!=="darwin")throw Error("macOS only");let{stdout:S}=await l("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),q=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(S)?.groups.id??"com.apple.Safari";if(q==="com.apple.safari")return"com.apple.Safari";return q}import c from"process";import{promisify as m}from"util";import{execFile as d,execFileSync as kS}from"child_process";var a=m(d);async function W(S,{humanReadableOutput:$=!0,signal:q}={}){if(c.platform!=="darwin")throw Error("macOS only");let J=$?[]:["-ss"],G={};if(q)G.signal=q;let{stdout:Q}=await a("osascript",["-e",S,J],G);return Q.trim()}async function E(S){return W(`tell application "Finder" to set app_path to application file id "${S}" as string
3
3
  tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as t}from"util";import{execFile as r}from"child_process";var p=t(r),N={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},MS=new Map(Object.entries(N));class _ extends Error{}async function M(S=p){let{stdout:$}=await S("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),q=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec($);if(!q)throw new _(`Cannot find Windows browser in stdout: ${JSON.stringify($)}`);let{id:J}=q.groups,G=J.lastIndexOf("."),Q=J.lastIndexOf("-"),Y=G===-1?void 0:J.slice(0,G),K=Q===-1?void 0:J.slice(0,Q);return N[J]??N[Y]??N[K]??{name:J,id:J}}var e=i(n),o=(S)=>S.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,($)=>$.toUpperCase());async function j(){if(T.platform==="darwin"){let S=await X();return{name:await E(S),id:S}}if(T.platform==="linux"){let{stdout:S}=await e("xdg-mime",["query","default","x-scheme-handler/http"]),$=S.trim();return{name:o($.replace(/.desktop$/,"").replace("-"," ")),id:$}}if(T.platform==="win32")return M();throw Error("Only macOS, Linux, and Windows are supported")}var $S=SS.promisify(y.execFile),L=A.dirname(s(import.meta.url)),F=A.join(L,"xdg-open"),{platform:R,arch:I}=D,qS=(()=>{let $;return async function(){if($)return $;let q="/etc/wsl.conf",J=!1;try{await z.access(q,u.F_OK),J=!0}catch{}if(!J)return"/mnt/";let G=await z.readFile(q,{encoding:"utf8"}),Q=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(G);if(!Q)return"/mnt/";return $=Q.groups.mountPoint.trim(),$=$.endsWith("/")?$:`${$}/`,$}})(),P=async()=>{return`${await qS()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`};async function GS(){let S=await P(),$='(Get-ItemProperty -Path "HKCU:\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice").ProgId',q=b.from('(Get-ItemProperty -Path "HKCU:\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice").ProgId',"utf16le").toString("base64"),{stdout:J}=await $S(S,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",q],{encoding:"utf8"}),G=J.trim(),Q={ChromeHTML:"com.google.chrome",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return Q[G]?{id:Q[G]}:{}}var x=async(S,$)=>{let q;for(let J of S)try{return await $(J)}catch(G){q=G}throw q},U=async(S)=>{if(S={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...S},Array.isArray(S.app))return x(S.app,(K)=>U({...S,app:K}));let{name:$,arguments:q=[]}=S.app??{};if(q=[...q],Array.isArray($))return x($,(K)=>U({...S,app:{name:K,arguments:q}}));if($==="browser"||$==="browserPrivate"){let K={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},V={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},Z=H?await GS():await j();if(Z.id in K){let C=K[Z.id];if($==="browserPrivate")q.push(V[C]);return U({...S,app:{name:k[C],arguments:q}})}throw Error(`${Z.name} is not supported as a default browser`)}let J,G=[],Q={};if(R==="darwin"){if(J="open",S.wait)G.push("--wait-apps");if(S.background)G.push("--background");if(S.newInstance)G.push("--new");if($)G.push("-a",$)}else if(R==="win32"||H&&!f()&&!$){if(J=H?await P():`${D.env.SYSTEMROOT||D.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,G.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),!H)Q.windowsVerbatimArguments=!0;let K=["Start"];if(S.wait)K.push("-Wait");if($){if(K.push(`"\`"${$}\`""`),S.target)q.push(S.target)}else if(S.target)K.push(`"${S.target}"`);if(q.length>0)q=q.map((V)=>`"\`"${V}\`""`),K.push("-ArgumentList",q.join(","));S.target=b.from(K.join(" "),"utf16le").toString("base64")}else{if($)J=$;else{let K=!L||L==="/",V=!1;try{await z.access(F,u.X_OK),V=!0}catch{}J=D.versions.electron??(R==="android"||K||!V)?"xdg-open":F}if(q.length>0)G.push(...q);if(!S.wait)Q.stdio="ignore",Q.detached=!0}if(R==="darwin"&&q.length>0)G.push("--args",...q);if(S.target)G.push(S.target);let Y=y.spawn(J,G,Q);if(S.wait)return new Promise((K,V)=>{Y.once("error",V),Y.once("close",(Z)=>{if(!S.allowNonzeroExitCode&&Z>0){V(Error(`Exited with code ${Z}`));return}K(Y)})});return Y.unref(),Y},JS=(S,$)=>{if(typeof S!=="string")throw TypeError("Expected a `target`");return U({...$,target:S})},hS=(S,$)=>{if(typeof S!=="string"&&!Array.isArray(S))throw TypeError("Expected a valid `name`");let{arguments:q=[]}=$??{};if(q!==void 0&&q!==null&&!Array.isArray(q))throw TypeError("Expected `appArguments` as Array type");return U({...$,app:{name:S,arguments:q}})};function B(S){if(typeof S==="string"||Array.isArray(S))return S;let{[I]:$}=S;if(!$)throw Error(`${I} is not supported`);return $}function O({[R]:S},{wsl:$}){if($&&H)return B($);if(!S)throw Error(`${R} is not supported`);return B(S)}var k={};v(k,"chrome",()=>O({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));v(k,"firefox",()=>O({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));v(k,"edge",()=>O({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));v(k,"browser",()=>"browser");v(k,"browserPrivate",()=>"browserPrivate");var lS=JS;
4
- export{hS as tq,k as uq,lS as vq};
4
+ export{hS as cq,k as dq,lS as eq};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Uf as X}from"./chunk-t1jgx17a.js";import{sg as M,wg as x}from"./chunk-543pt030.js";import{Oj as B}from"./chunk-a550vst5.js";import{Bo as C,Io as N,Jo as V,Mo as L,xo as G}from"./chunk-8d6e4jg7.js";import{xH as z}from"./chunk-ks1cs80p.js";var Z="forgewise";function A(j){if(!j||j.type!=="api")return"skip";if(j.method==="api-key")return"skip";if(M(j.expiresAt))return"skip";return"probe"}function F(j){if(j===null)return"skipped";if(!j)return"revoked";return"valid"}function U(j){if(!j||j.type!=="api")return{kind:"skip"};if(j.method==="api-key")return{kind:"skip"};if(!M(j.expiresAt))return{kind:"skip"};if(j.refreshToken)return{kind:"refresh-token",refreshToken:j.refreshToken};return{kind:"browser"}}function T(j){if(j==="invalid_grant")return{kind:"revoked"};if(j===null)return{kind:"transient"};return{kind:"persist",credential:L(j,{rotateRefreshToken:!0})}}var b=1e4;function P(j){if(!j)return;if(j.type!=="api")return{type:j.type,expiresAt:0};return{type:j.type,method:j.metadata?.method,expiresAt:Number(j.metadata?.expires_at??0),refreshToken:j.metadata?.refresh_token}}function w(){if(process.platform==="linux")return Boolean(process.env.DISPLAY||process.env.WAYLAND_DISPLAY);return process.platform==="win32"||process.platform==="darwin"}var K=()=>z.gen(function*(){let j=yield*B.Service,D=yield*z.orElseSucceed(j.get(Z),()=>{return});if(A(P(D))==="skip")return"skipped";if(!D||D.type!=="api")return"skipped";let J=yield*z.orElseSucceed(z.tryPromise({try:()=>C(),catch:()=>{return}}).pipe(z.map((Q)=>Q.issuer)),()=>{return});if(!J)return"skipped";let $=yield*z.promise(()=>N(J,D.key)),H=F($);if(H==="revoked")yield*z.orElseSucceed(j.remove(Z),()=>{return});return H}).pipe(z.withSpan("forgewise.validateStoredToken")),W=()=>z.gen(function*(){let j=yield*B.Service,D=yield*z.orElseSucceed(j.get(Z),()=>{return}),J=U(P(D));if(J.kind==="skip")return"skipped";if(J.kind==="refresh-token"){let _=yield*z.promise(()=>V(J.refreshToken).catch(()=>null)),q=T(_);if(q.kind==="revoked")return yield*z.orElseSucceed(j.remove(Z),()=>{return}),"failed";if(q.kind==="persist")return(yield*j.set(Z,q.credential).pipe(z.map(()=>!0),z.catch(()=>z.succeed(!1))))?"ok":"failed"}if(!w())return"skipped";let $=new AbortController,H=setTimeout(()=>$.abort(),b),Q=yield*z.promise(()=>x({signal:$.signal}).catch(()=>null).finally(()=>clearTimeout(H)));if(!Q)return"failed";let Y=L(Q,{rotateRefreshToken:!1});return(yield*j.set(Z,Y).pipe(z.map(()=>!0),z.catch(()=>z.succeed(!1))))?"ok":"failed"}).pipe(z.withSpan("forgewise.refreshIfNeeded"));var E=()=>z.gen(function*(){if((yield*z.promise(()=>G()))?.method!=="sso")return"ok";if((yield*K())==="revoked")return yield*z.sync(()=>X.println(X.Style.TEXT_DANGER+"Your session was revoked (signed out from another device or by an admin action). Run `qitqode auth login` to sign in again."+X.Style.TEXT_NORMAL)),"revoked";if((yield*W())==="failed")yield*z.sync(()=>X.println(X.Style.TEXT_DIM+"(Session refresh failed \u2014 run `qitqode auth login` to re-authenticate)"+X.Style.TEXT_NORMAL));return"ok"});
2
+ import{dg as X}from"./chunk-eg3syjtv.js";import{Dg as M,Hg as x}from"./chunk-8q38721t.js";import{xj as B}from"./chunk-twp3mjj0.js";import{go as G,ko as C,ro as N,so as V,vo as L}from"./chunk-ab4dq1bn.js";import{eH as z}from"./chunk-qnvsqnz5.js";var Z="forgewise";function A(j){if(!j||j.type!=="api")return"skip";if(j.method==="api-key")return"skip";if(M(j.expiresAt))return"skip";return"probe"}function F(j){if(j===null)return"skipped";if(!j)return"revoked";return"valid"}function U(j){if(!j||j.type!=="api")return{kind:"skip"};if(j.method==="api-key")return{kind:"skip"};if(!M(j.expiresAt))return{kind:"skip"};if(j.refreshToken)return{kind:"refresh-token",refreshToken:j.refreshToken};return{kind:"browser"}}function T(j){if(j==="invalid_grant")return{kind:"revoked"};if(j===null)return{kind:"transient"};return{kind:"persist",credential:L(j,{rotateRefreshToken:!0})}}var b=1e4;function P(j){if(!j)return;if(j.type!=="api")return{type:j.type,expiresAt:0};return{type:j.type,method:j.metadata?.method,expiresAt:Number(j.metadata?.expires_at??0),refreshToken:j.metadata?.refresh_token}}function w(){if(process.platform==="linux")return Boolean(process.env.DISPLAY||process.env.WAYLAND_DISPLAY);return process.platform==="win32"||process.platform==="darwin"}var K=()=>z.gen(function*(){let j=yield*B.Service,D=yield*z.orElseSucceed(j.get(Z),()=>{return});if(A(P(D))==="skip")return"skipped";if(!D||D.type!=="api")return"skipped";let J=yield*z.orElseSucceed(z.tryPromise({try:()=>C(),catch:()=>{return}}).pipe(z.map((Q)=>Q.issuer)),()=>{return});if(!J)return"skipped";let $=yield*z.promise(()=>N(J,D.key)),H=F($);if(H==="revoked")yield*z.orElseSucceed(j.remove(Z),()=>{return});return H}).pipe(z.withSpan("forgewise.validateStoredToken")),W=()=>z.gen(function*(){let j=yield*B.Service,D=yield*z.orElseSucceed(j.get(Z),()=>{return}),J=U(P(D));if(J.kind==="skip")return"skipped";if(J.kind==="refresh-token"){let _=yield*z.promise(()=>V(J.refreshToken).catch(()=>null)),q=T(_);if(q.kind==="revoked")return yield*z.orElseSucceed(j.remove(Z),()=>{return}),"failed";if(q.kind==="persist")return(yield*j.set(Z,q.credential).pipe(z.map(()=>!0),z.catch(()=>z.succeed(!1))))?"ok":"failed"}if(!w())return"skipped";let $=new AbortController,H=setTimeout(()=>$.abort(),b),Q=yield*z.promise(()=>x({signal:$.signal}).catch(()=>null).finally(()=>clearTimeout(H)));if(!Q)return"failed";let Y=L(Q,{rotateRefreshToken:!1});return(yield*j.set(Z,Y).pipe(z.map(()=>!0),z.catch(()=>z.succeed(!1))))?"ok":"failed"}).pipe(z.withSpan("forgewise.refreshIfNeeded"));var E=()=>z.gen(function*(){if((yield*z.promise(()=>G()))?.method!=="sso")return"ok";if((yield*K())==="revoked")return yield*z.sync(()=>X.println(X.Style.TEXT_DANGER+"Your session was revoked (signed out from another device or by an admin action). Run `qitqode auth login` to sign in again."+X.Style.TEXT_NORMAL)),"revoked";if((yield*W())==="failed")yield*z.sync(()=>X.println(X.Style.TEXT_DIM+"(Session refresh failed \u2014 run `qitqode auth login` to re-authenticate)"+X.Style.TEXT_NORMAL));return"ok"});
3
3
  export{E as h};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Qd as m,Td as P,Ud as R,Vd as k,Wd as O,Yd as q,Zd as $,_d as I}from"./chunk-ff548b0j.js";import"./chunk-zc0cdvcv.js";import{ae as h}from"./chunk-5w76kdjr.js";import{dg as r}from"./chunk-eg3syjtv.js";import{Bh as L,qh as E}from"./chunk-r6p0bd2w.js";import"./chunk-w46g7kdq.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-6m9jb0s9.js";import"./chunk-vygkwwjd.js";import{Ej as N,Tk as x}from"./chunk-twp3mjj0.js";import"./chunk-6pe60dsw.js";import{Nl as i}from"./chunk-jdx3jshm.js";import"./chunk-6v5867cy.js";import"./chunk-mh19kwzw.js";import"./chunk-7j4qne3q.js";import"./chunk-snqa3zsm.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import"./chunk-ab4dq1bn.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-wkg3c643.js";import"./chunk-fhqfqd5v.js";import"./chunk-cx78hhbx.js";import"./chunk-xv5z1bj6.js";import"./chunk-73r8bjjz.js";import"./chunk-w88ve2pm.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import"./chunk-tkrwcjkr.js";import"./chunk-ztn9e8g1.js";import"./chunk-09geev0j.js";import"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import{ft as C,kt as j}from"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-pxm4qvqk.js";import"./chunk-j8fcfhr2.js";import{sO as F}from"./chunk-r9w0thdk.js";import u from"path";import U from"fs/promises";var T=F(N(),1);import{EOL as S}from"os";var c=["bash","read","write","edit","glob","grep","webfetch","actor","task"],B=h({command:"create",describe:"create a new agent",builder:(o)=>o.option("path",{type:"string",describe:"directory path to generate the agent file"}).option("description",{type:"string",describe:"what the agent should do"}).option("mode",{type:"string",describe:"agent mode",choices:["all","primary","subagent"]}).option("tools",{type:"string",describe:`comma-separated list of tools to enable (default: all). Available: "${c.join(", ")}"`}).option("model",{type:"string",alias:["m"],describe:"model to use in the format of provider/model"}),async handler(o){await i.provide({directory:process.cwd(),async fn(){let{path:l,description:t,mode:s,tools:p}=o,d=l&&t&&s&&p!==void 0;if(!d)r.empty(),R("Create agent");let D=i.project,g;if(l)g=u.join(l,"agent");else{let e="global";if(D.vcs==="git"){let n=await $({message:"Location",options:[{label:"Current project",value:"project",hint:i.worktree},{label:"Global",value:"global",hint:j.Path.config}]});if(m(n))throw new r.CancelledError;e=n}g=u.join(e==="global"?j.Path.config:u.join(i.worktree,".qitqode"),"agent")}let b;if(t)b=t;else{let e=await I({message:"Description",placeholder:"What should this agent do?",validate:(n)=>n&&n.length>0?void 0:"Required"});if(m(e))throw new r.CancelledError;b=e}let w=q();w.start("Generating agent configuration...");let G=o.model?x.parseModel(o.model):void 0,f=await L.runPromise(E.Service.use((e)=>e.generate({description:b,model:G}))).catch((e)=>{if(w.stop(`LLM failed to generate agent: ${e.message}`,1),d)process.exit(1);throw new r.CancelledError});w.stop(`Agent ${f.identifier} generated`);let y;if(p!==void 0)y=p?p.split(",").map((e)=>e.trim()):c;else{let e=await O({message:"Select tools to enable (Space to toggle)",options:c.map((n)=>({label:n,value:n})),initialValues:c});if(m(e))throw new r.CancelledError;y=e}let v;if(s)v=s;else{let e=await $({message:"Agent mode",options:[{label:"All",value:"all",hint:"Can function in both primary and subagent roles"},{label:"Primary",value:"primary",hint:"Acts as a primary/main agent"},{label:"Subagent",value:"subagent",hint:"Can be used as a subagent by other agents"}],initialValue:"all"});if(m(e))throw new r.CancelledError;v=e}let A={};for(let e of c)if(!y.includes(e))A[e]=!1;let M={description:f.whenToUse,mode:v};if(Object.keys(A).length>0)M.tools=A;let V=T.default.stringify(f.systemPrompt,M),a=u.join(g,`${f.identifier}.md`);if(await U.mkdir(g,{recursive:!0}),await C.exists(a)){if(d)console.error(`Error: Agent file already exists: ${a}`),process.exit(1);throw P.error(`Agent file already exists: ${a}`),new r.CancelledError}if(await C.write(a,V),d)console.log(a);else P.success(`Agent created: ${a}`),k("Done")}})}}),J=h({command:"list",describe:"list all available agents",async handler(){await i.provide({directory:process.cwd(),async fn(){let l=(await L.runPromise(E.Service.use((t)=>t.list()))).sort((t,s)=>{if(t.native!==s.native)return t.native?-1:1;return t.name.localeCompare(s.name)});for(let t of l)process.stdout.write(`${t.name} (${t.mode})`+S),process.stdout.write(` ${JSON.stringify(t.permission,null,2)}`+S)}})}}),ne=h({command:"agent",describe:"manage agents",builder:(o)=>o.command(B).command(J).demandCommand(),async handler(){}});export{ne as AgentCommand};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-f83wv08n.js";var{create:Zr,defineProperty:xt,getOwnPropertyDescriptor:Xr,getOwnPropertyNames:Yr,getPrototypeOf:es}=Object,ts=Object.prototype.hasOwnProperty,A=(e,s)=>()=>(s||e((s={exports:{}}).exports,s),s.exports),Xt=(e,s)=>{for(var n in s)xt(e,n,{get:s[n],enumerable:!0})},rs=(e,s,n,o)=>{if(s&&typeof s=="object"||typeof s=="function")for(let c of Yr(s))!ts.call(e,c)&&c!==n&&xt(e,c,{get:()=>s[c],enumerable:!(o=Xr(s,c))||o.enumerable});return e},xe=(e,s,n)=>(n=e!=null?Zr(es(e)):{},rs(s||!e||!e.__esModule?xt(n,"default",{value:e,enumerable:!0}):n,e)),ss=A((e,s)=>{var n=String,o=function(){return{isColorSupported:!1,reset:n,bold:n,dim:n,italic:n,underline:n,inverse:n,hidden:n,strikethrough:n,black:n,red:n,green:n,yellow:n,blue:n,magenta:n,cyan:n,white:n,gray:n,bgBlack:n,bgRed:n,bgGreen:n,bgYellow:n,bgBlue:n,bgMagenta:n,bgCyan:n,bgWhite:n,blackBright:n,redBright:n,greenBright:n,yellowBright:n,blueBright:n,magentaBright:n,cyanBright:n,whiteBright:n,bgBlackBright:n,bgRedBright:n,bgGreenBright:n,bgYellowBright:n,bgBlueBright:n,bgMagentaBright:n,bgCyanBright:n,bgWhiteBright:n}};s.exports=o(),s.exports.createColors=o}),Yt=A(()=>{}),kt=A((e,s)=>{var n=ss(),o=Yt(),c=class i extends Error{constructor(h,p,m,u,r,t){super(h),this.name="CssSyntaxError",this.reason=h,r&&(this.file=r),u&&(this.source=u),t&&(this.plugin=t),typeof p<"u"&&typeof m<"u"&&(typeof p=="number"?(this.line=p,this.column=m):(this.line=p.line,this.column=p.column,this.endLine=m.line,this.endColumn=m.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,i)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(h){if(!this.source)return"";let p=this.source;h==null&&(h=n.isColorSupported);let m=(l)=>l,u=(l)=>l,r=(l)=>l;if(h){let{bold:l,gray:w,red:y}=n.createColors(!0);u=(v)=>l(y(v)),m=(v)=>w(v),o&&(r=(v)=>o(v))}let t=p.split(/\r?\n/),f=Math.max(this.line-3,0),a=Math.min(this.line+2,t.length),d=String(a).length;return t.slice(f,a).map((l,w)=>{let y=f+1+w,v=" "+(" "+y).slice(-d)+" | ";if(y===this.line){if(l.length>160){let x=20,b=Math.max(0,this.column-x),T=Math.max(this.column+x,this.endColumn+x),O=l.slice(b,T),k=m(v.replace(/\d/g," "))+l.slice(0,Math.min(this.column-1,x-1)).replace(/[^\t]/g," ");return u(">")+m(v)+r(O)+`
2
+ import"./chunk-r9w0thdk.js";var{create:Zr,defineProperty:xt,getOwnPropertyDescriptor:Xr,getOwnPropertyNames:Yr,getPrototypeOf:es}=Object,ts=Object.prototype.hasOwnProperty,A=(e,s)=>()=>(s||e((s={exports:{}}).exports,s),s.exports),Xt=(e,s)=>{for(var n in s)xt(e,n,{get:s[n],enumerable:!0})},rs=(e,s,n,o)=>{if(s&&typeof s=="object"||typeof s=="function")for(let c of Yr(s))!ts.call(e,c)&&c!==n&&xt(e,c,{get:()=>s[c],enumerable:!(o=Xr(s,c))||o.enumerable});return e},xe=(e,s,n)=>(n=e!=null?Zr(es(e)):{},rs(s||!e||!e.__esModule?xt(n,"default",{value:e,enumerable:!0}):n,e)),ss=A((e,s)=>{var n=String,o=function(){return{isColorSupported:!1,reset:n,bold:n,dim:n,italic:n,underline:n,inverse:n,hidden:n,strikethrough:n,black:n,red:n,green:n,yellow:n,blue:n,magenta:n,cyan:n,white:n,gray:n,bgBlack:n,bgRed:n,bgGreen:n,bgYellow:n,bgBlue:n,bgMagenta:n,bgCyan:n,bgWhite:n,blackBright:n,redBright:n,greenBright:n,yellowBright:n,blueBright:n,magentaBright:n,cyanBright:n,whiteBright:n,bgBlackBright:n,bgRedBright:n,bgGreenBright:n,bgYellowBright:n,bgBlueBright:n,bgMagentaBright:n,bgCyanBright:n,bgWhiteBright:n}};s.exports=o(),s.exports.createColors=o}),Yt=A(()=>{}),kt=A((e,s)=>{var n=ss(),o=Yt(),c=class i extends Error{constructor(h,p,m,u,r,t){super(h),this.name="CssSyntaxError",this.reason=h,r&&(this.file=r),u&&(this.source=u),t&&(this.plugin=t),typeof p<"u"&&typeof m<"u"&&(typeof p=="number"?(this.line=p,this.column=m):(this.line=p.line,this.column=p.column,this.endLine=m.line,this.endColumn=m.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,i)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(h){if(!this.source)return"";let p=this.source;h==null&&(h=n.isColorSupported);let m=(l)=>l,u=(l)=>l,r=(l)=>l;if(h){let{bold:l,gray:w,red:y}=n.createColors(!0);u=(v)=>l(y(v)),m=(v)=>w(v),o&&(r=(v)=>o(v))}let t=p.split(/\r?\n/),f=Math.max(this.line-3,0),a=Math.min(this.line+2,t.length),d=String(a).length;return t.slice(f,a).map((l,w)=>{let y=f+1+w,v=" "+(" "+y).slice(-d)+" | ";if(y===this.line){if(l.length>160){let x=20,b=Math.max(0,this.column-x),T=Math.max(this.column+x,this.endColumn+x),O=l.slice(b,T),k=m(v.replace(/\d/g," "))+l.slice(0,Math.min(this.column-1,x-1)).replace(/[^\t]/g," ");return u(">")+m(v)+r(O)+`
3
3
  `+k+u("^")}let g=m(v.replace(/\d/g," "))+l.slice(0,this.column-1).replace(/[^\t]/g," ");return u(">")+m(v)+r(l)+`
4
4
  `+g+u("^")}return" "+m(v)+r(l)}).join(`
5
5
  `)}toString(){let h=this.showSourceCode();return h&&(h=`
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{wO as t}from"./chunk-r9w0thdk.js";var e=await import("./chunk-agv04nt7.js",{with:{type:"file"}}),a=e.default;export{a as default};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{JO as D}from"./chunk-g3kd4957.js";import{KO as C}from"./chunk-qhnpq5gb.js";import{MO as z,PO as B}from"./chunk-f83wv08n.js";var H=z((v)=>{Object.defineProperty(v,"__esModule",{value:!0});v.getMachineId=void 0;var E=B("fs"),F=D(),q=C();async function G(){try{return(await E.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(k){q.diag.debug(`error reading machine id: ${k}`)}try{return(await(0,F.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(k){q.diag.debug(`error reading machine id: ${k}`)}return}v.getMachineId=G});export default H();
2
+ import{qO as D}from"./chunk-gy21fw82.js";import{rO as C}from"./chunk-j8fcfhr2.js";import{tO as z,wO as B}from"./chunk-r9w0thdk.js";var H=z((v)=>{Object.defineProperty(v,"__esModule",{value:!0});v.getMachineId=void 0;var E=B("fs"),F=D(),q=C();async function G(){try{return(await E.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(k){q.diag.debug(`error reading machine id: ${k}`)}try{return(await(0,F.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(k){q.diag.debug(`error reading machine id: ${k}`)}return}v.getMachineId=G});export default H();
@@ -0,0 +1,35 @@
1
+ // @bun
2
+ import{Bh as F}from"./chunk-r6p0bd2w.js";import{cl as Y}from"./chunk-twp3mjj0.js";import{Er as y}from"./chunk-w88ve2pm.js";import{cs as W}from"./chunk-ztn9e8g1.js";import{ft as K}from"./chunk-at22twxx.js";import{eH as x}from"./chunk-qnvsqnz5.js";import{EOL as A}from"os";import B from"path";var z=W.tiers().map((b)=>({label:b.label,providerID:b.providerID,modelID:b.modelID})),$=Object.fromEntries(W.tiers().map((b)=>[`${b.providerID}/${b.modelID}`,b.label]));function w(b){return new Map((b??[]).map((q)=>[q.id,q]))}function j(b,q,C){return(b instanceof Map?b.get(q):Array.isArray(b)?b.find((Q)=>Q.id===q):void 0)?.models[C]}function H(b,q,C){let J=`${q}/${C}`;if($[J])return $[J];return j(b,q,C)?.name??C}function f(b,q){let C=W.tiers().find((J)=>J.providerID===b&&J.modelID===q);return C?W.TIER_RATINGS[C.id]:void 0}async function c(b){return F.runPromise(Y.Service.use((q)=>x.gen(function*(){let C=yield*q.get(b),J=yield*q.messages({sessionID:C.id,agentID:"*"});return{info:C,messages:J}})))}function m(){let b=Y.list({limit:1}).next();return b.done?void 0:b.value}function n(b,q){return`session-${b.slice(0,8)}.${q==="markdown"?"md":"json"}`}function h(b,q){return B.resolve(b,q)}async function o(b,q,C){let J=h(b,q);return await K.write(J,C),J}function G(b,q,C){return C.trim()?`[redacted:${b}:${q}]`:C}function U(b,q,C){if(!C)return C;return Object.keys(C).length?{redacted:`${b}:${q}`}:C}function X(b,q){return{...q,value:G("file-text",b,q.value)}}function N(b,q){return q?.map((C,J)=>({...C,file:G(`${b}-file`,String(J),C.file),patch:G(`${b}-patch`,String(J),C.patch)}))}function E(b){if(!b.source)return b.source;if(b.source.type==="symbol")return{...b.source,path:G("file-path",b.id,b.source.path),name:G("file-symbol",b.id,b.source.name),text:X(b.id,b.source.text)};if(b.source.type==="resource")return{...b.source,clientName:G("file-client",b.id,b.source.clientName),uri:G("file-uri",b.id,b.source.uri),text:X(b.id,b.source.text)};return{...b.source,path:G("file-path",b.id,b.source.path),text:X(b.id,b.source.text)}}function O(b){return{...b,url:G("file-url",b.id,b.url),filename:b.filename===void 0?void 0:G("file-name",b.id,b.filename),source:E(b)}}function L(b){switch(b.type){case"text":return{...b,text:G("text",b.id,b.text),metadata:U("text-metadata",b.id,b.metadata)};case"reasoning":return{...b,text:G("reasoning",b.id,b.text),metadata:U("reasoning-metadata",b.id,b.metadata)};case"file":return O(b);case"subtask":return{...b,prompt:G("subtask-prompt",b.id,b.prompt),description:G("subtask-description",b.id,b.description),command:b.command===void 0?void 0:G("subtask-command",b.id,b.command)};case"tool":return{...b,metadata:U("tool-metadata",b.id,b.metadata),state:b.state.status==="pending"?{...b.state,input:U("tool-input",b.id,b.state.input)??b.state.input,raw:G("tool-raw",b.id,b.state.raw)}:b.state.status==="running"?{...b.state,input:U("tool-input",b.id,b.state.input)??b.state.input,title:b.state.title===void 0?void 0:G("tool-title",b.id,b.state.title),metadata:U("tool-state-metadata",b.id,b.state.metadata)}:b.state.status==="completed"?{...b.state,input:U("tool-input",b.id,b.state.input)??b.state.input,output:G("tool-output",b.id,b.state.output),title:G("tool-title",b.id,b.state.title),metadata:U("tool-state-metadata",b.id,b.state.metadata)??b.state.metadata,attachments:b.state.attachments?.map(O)}:{...b.state,input:U("tool-input",b.id,b.state.input)??b.state.input,error:G("tool-error",b.id,b.state.error),metadata:U("tool-state-metadata",b.id,b.state.metadata)}};case"patch":return{...b,hash:G("patch",b.id,b.hash),files:b.files.map((q,C)=>G("patch-file",`${b.id}-${C}`,q))};case"snapshot":return{...b,snapshot:G("snapshot",b.id,b.snapshot)};case"step-start":case"step-finish":return{...b,snapshot:b.snapshot===void 0?void 0:G("snapshot",b.id,b.snapshot)};case"agent":return{...b,source:!b.source?b.source:{...b.source,value:G("agent-source",b.id,b.source.value)}};default:return b}}function d(b){return{info:{...b.info,title:G("session-title",b.info.id,b.info.title),directory:G("session-directory",b.info.id,b.info.directory),summary:!b.info.summary?b.info.summary:{...b.info.summary,diffs:N("session-diff",b.info.summary.diffs)},revert:!b.info.revert?b.info.revert:{...b.info.revert,snapshot:b.info.revert.snapshot===void 0?void 0:G("revert-snapshot",b.info.id,b.info.revert.snapshot),diff:b.info.revert.diff===void 0?void 0:G("revert-diff",b.info.id,b.info.revert.diff)}},messages:b.messages.map((q)=>({info:q.info.role==="user"?{...q.info,system:q.info.system===void 0?void 0:G("system",q.info.id,q.info.system),summary:!q.info.summary?q.info.summary:{...q.info.summary,title:q.info.summary.title===void 0?void 0:G("summary-title",q.info.id,q.info.summary.title),body:q.info.summary.body===void 0?void 0:G("summary-body",q.info.id,q.info.summary.body),diffs:N("message-diff",q.info.summary.diffs)}}:{...q.info,path:{cwd:G("cwd",q.info.id,q.info.path.cwd),root:G("root",q.info.id,q.info.path.root)}},parts:q.parts.map(L)}))}}function i(b,q,C){let J=w(C.providers),Q=`# ${b.title}
3
+
4
+ `;Q+=`**Session ID:** ${b.id}
5
+ `,Q+=`**Created:** ${new Date(b.time.created).toLocaleString()}
6
+ `,Q+=`**Updated:** ${new Date(b.time.updated).toLocaleString()}
7
+
8
+ `,Q+=`---
9
+
10
+ `;for(let V of q)Q+=R(V.info,V.parts,C,J),Q+=`---
11
+
12
+ `;return Q}function R(b,q,C,J){let Q=b.role==="user"?`## User
13
+
14
+ `:S(b,C.assistantMetadata,J??C.providers);for(let V of q)Q+=P(V,C);return Q}function S(b,q,C){if(!q)return`## Assistant
15
+
16
+ `;let J=b.time.completed&&b.time.created?((b.time.completed-b.time.created)/1000).toFixed(1)+"s":"",Q=H(C,b.providerID,b.modelID);return`## Assistant (${y.titlecase(b.agent)} \xB7 ${Q}${J?` \xB7 ${J}`:""})
17
+
18
+ `}function P(b,q){if(b.type==="text"&&!b.synthetic)return`${b.text}
19
+
20
+ `;if(b.type==="reasoning")return q.thinking?`_Thinking:_
21
+
22
+ ${b.text}
23
+
24
+ `:"";if(b.type!=="tool")return"";let C=(Q,V="")=>{let M=Math.max(0,...Array.from(Q.matchAll(/`+/g),(_)=>_[0].length)),Z="`".repeat(Math.max(3,M+1));return`${Z}${V}
25
+ ${Q}
26
+ ${Z}
27
+ `},J=`**Tool: ${b.tool}**
28
+ `;if(q.toolDetails&&b.state.input)J+=`
29
+ **Input:**
30
+ ${C(JSON.stringify(b.state.input,null,2),"json")}`;if(q.toolDetails&&b.state.status==="completed"&&b.state.output)J+=`
31
+ **Output:**
32
+ ${C(b.state.output)}`;if(q.toolDetails&&b.state.status==="error"&&b.state.error)J+=`
33
+ **Error:**
34
+ ${C(b.state.error)}`;return J+A}
35
+ export{z as I,$ as J,w as K,H as L,f as M,c as N,m as O,n as P,o as Q,d as R,i as S};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Et as e}from"./chunk-9etpppyv.js";class r extends Error{static hasName(t,n){return typeof t==="object"&&t!==null&&"name"in t&&t.name===n}static create(t,n){let s=e.object({name:e.literal(t),data:n}).meta({ref:t}),o=class extends r{data;static Schema=s;name=t;constructor(a,c){super(t,c);this.data=a;this.name=t}static isInstance(a){return typeof a==="object"&&"name"in a&&a.name===t}schema(){return s}toObject(){return{name:t,data:this.data}}};return Object.defineProperty(o,"name",{value:t}),o}static Unknown=r.create("UnknownError",e.object({message:e.string(),diagnostic:e.object({errorID:e.string(),errorName:e.string(),logFile:e.string()}).optional()}))}
3
- export{r as rs};
2
+ import{lt as e}from"./chunk-kgptyf7n.js";class r extends Error{static hasName(t,n){return typeof t==="object"&&t!==null&&"name"in t&&t.name===n}static create(t,n){let s=e.object({name:e.literal(t),data:n}).meta({ref:t}),o=class extends r{data;static Schema=s;name=t;constructor(a,c){super(t,c);this.data=a;this.name=t}static isInstance(a){return typeof a==="object"&&"name"in a&&a.name===t}schema(){return s}toObject(){return{name:t,data:this.data}}};return Object.defineProperty(o,"name",{value:t}),o}static Unknown=r.create("UnknownError",e.object({message:e.string(),diagnostic:e.object({errorID:e.string(),errorName:e.string(),logFile:e.string()}).optional()}))}
3
+ export{r as as};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-f83wv08n.js";var ve=Object.defineProperty,W=(e,t)=>{for(var n in t)ve(e,n,{get:t[n],enumerable:!0})},Z={};W(Z,{languages:()=>lt,options:()=>pt,parsers:()=>ue,printers:()=>zt});var Ie=(e,t,n,r)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},K=Ie,ye="indent",Ae="group",Oe="if-break",q="line",xe="break-parent",ee=()=>{},w=ee,te=ee;function I(e){return w(e),{type:ye,contents:e}}function y(e,t={}){return w(e),te(t.expandedStates,!0),{type:Ae,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function O(e,t="",n={}){return w(e),t!==""&&w(t),{type:Oe,breakContents:e,flatContents:t,groupId:n.groupId}}var De={type:xe},ge={type:q,hard:!0},C={type:q},p={type:q,soft:!0},h=[ge,De];function E(e,t){w(e),te(t);let n=[];for(let r=0;r<t.length;r++)r!==0&&n.push(e),n.push(t[r]);return n}function V(e){return(t,n,r)=>{let i=!!(r!=null&&r.backwards);if(n===!1)return!1;let{length:s}=t,o=n;for(;o>=0&&o<s;){let c=t.charAt(o);if(e instanceof RegExp){if(!e.test(c))return o}else if(!e.includes(c))return o;i?o--:o++}return o===-1||o===s?o:!1}}var Ht=V(/\s/u),ne=V(" \t"),_e=V(",; \t"),ke=V(/[^\n\r]/u);function Se(e,t,n){let r=!!(n!=null&&n.backwards);if(t===!1)return!1;let i=e.charAt(t);if(r){if(e.charAt(t-1)==="\r"&&i===`
2
+ import"./chunk-r9w0thdk.js";var ve=Object.defineProperty,W=(e,t)=>{for(var n in t)ve(e,n,{get:t[n],enumerable:!0})},Z={};W(Z,{languages:()=>lt,options:()=>pt,parsers:()=>ue,printers:()=>zt});var Ie=(e,t,n,r)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},K=Ie,ye="indent",Ae="group",Oe="if-break",q="line",xe="break-parent",ee=()=>{},w=ee,te=ee;function I(e){return w(e),{type:ye,contents:e}}function y(e,t={}){return w(e),te(t.expandedStates,!0),{type:Ae,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function O(e,t="",n={}){return w(e),t!==""&&w(t),{type:Oe,breakContents:e,flatContents:t,groupId:n.groupId}}var De={type:xe},ge={type:q,hard:!0},C={type:q},p={type:q,soft:!0},h=[ge,De];function E(e,t){w(e),te(t);let n=[];for(let r=0;r<t.length;r++)r!==0&&n.push(e),n.push(t[r]);return n}function V(e){return(t,n,r)=>{let i=!!(r!=null&&r.backwards);if(n===!1)return!1;let{length:s}=t,o=n;for(;o>=0&&o<s;){let c=t.charAt(o);if(e instanceof RegExp){if(!e.test(c))return o}else if(!e.includes(c))return o;i?o--:o++}return o===-1||o===s?o:!1}}var Ht=V(/\s/u),ne=V(" \t"),_e=V(",; \t"),ke=V(/[^\n\r]/u);function Se(e,t,n){let r=!!(n!=null&&n.backwards);if(t===!1)return!1;let i=e.charAt(t);if(r){if(e.charAt(t-1)==="\r"&&i===`
3
3
  `)return t-2;if(i===`
4
4
  `||i==="\r"||i==="\u2028"||i==="\u2029")return t-1}else{if(i==="\r"&&e.charAt(t+1)===`
5
5
  `)return t+2;if(i===`
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{kt as O}from"./chunk-at22twxx.js";import{lt as p}from"./chunk-kgptyf7n.js";import{cO as X}from"./chunk-qnvsqnz5.js";import{uO as l}from"./chunk-r9w0thdk.js";var Gq={};l(Gq,{redactValue:()=>D,init:()=>$q,flush:()=>Yq,file:()=>Jq,enabled:()=>qq,create:()=>I,Level:()=>r,Default:()=>Hq});import U from"path";import K from"fs/promises";import{createWriteStream as g}from"fs";var Vq=new URL("https://qortex.forgewise.tech/api/v1/qortex/streamTier").origin,f="https://qortex.forgewise.tech/api/v1/qortex/streamTier".replace(/\/streamTier$/,""),Mq={name:"QitQode",family:"qlex",npm:"@qitqode/qlex-provider",limit:{context:200000,output:16384},capabilities:{temperature:!0,reasoning:!1,attachment:!0,toolcall:!0,input:{text:!0,audio:!1,image:!0,video:!1,pdf:!1},output:{text:!0,audio:!1,image:!1,video:!1,pdf:!1},interleaved:!1},release_date:"2025-07-06"};function M(q){return q.replace(/provider\s+'[^']*'\s*(?:stream\s+)?(?:failed|error)?\s*:?\s*/gi,"").replace(/\b(?:anthropic|openai|google|vertex\s*ai|bedrock|azure|x\.?ai|mistral|deepseek|cohere|groq|together(?:\.ai)?|openrouter|fireworks|perplexity|meta)\b/gi,"").replace(/\b(?:gpt|claude|gemini|grok|llama|qwen|sonnet|opus|haiku|o[0-9])[-\w.]*/gi,"").replace(/\s+/g," ").replace(/^[\s:;,.\-]+/,"").replace(/[\s.]+$/,"").trim()}var Q="The model's reply was cut off before it finished.";function _(q){if(q?.continued===!0)return`${Q} The text that arrived was kept and QitQode asked the model to carry on from it. Send the message again only if the continuation missed what you needed.`;if(q?.textKept===!1)return`${Q} None of it arrived, so there was nothing to keep and nothing to carry on from. This is usually a temporary upstream fault \u2014 send the message again.`;if(q?.textKept===!0)return`${Q} The text that arrived was kept, but the rest could not be recovered automatically. Send the message again if you need the missing part.`;return`${Q} Any text that arrived was kept, but the rest could not be recovered automatically. Send the message again if you need the missing part.`}var Nq={notLoggedIn:"Not logged in to QitQode. Run `qitqode auth login` to sign in with your Forgewise account.",rateLimit:"Rate limit exceeded. Please wait a moment before sending more requests.",insufficientBalance:(q)=>{let H=q?M(q):"";return`Insufficient qredits${H?`: ${H}`:""}. Add qredits at qitqode.com to continue.`},invalidCredentials:(q)=>{let H=q?M(q):"";return`Your QitQode sign-in has ended${H?` (${H})`:""}. Renewing it automatically didn't work, so signing in again is the only step left.`},accountNotLinked:(q)=>{let H=q?M(q):"";return`This credential isn't linked to a QitQode account${H?` (${H})`:""}, so there is no wallet to read. Sign in with your Forgewise account, or use a key issued to that account.`},gatewayUnavailable:(q)=>{let H=q?M(q):"";return`The QitQode model gateway is unavailable${H?` (${H})`:""}. Your sign-in is still valid \u2014 the model backend isn't reachable through its trusted gateway yet. This is a server-side configuration issue, not a login problem.`},streamFailed:(q)=>{let H=q?M(q):"";return`The QitQode model stream failed${H?`: ${H}`:""}.`},streamCutOff:(q)=>_(q),streamFailedAfterRetries:(q)=>_(q),outputBudgetExhausted:()=>"The model ran out of output room before it could finish. QitQode will retry once with more headroom when the tier allows it.",emptyOutput:()=>"The model used its output budget without producing visible text. QitQode did not receive an answer and no charge is implied.",requestRejected:(q,H)=>{let $=q?M(q):"",W=H?M(H):"";return`QitQode built an invalid request and the server rejected it${W?` (field: ${W})`:""}${$?`: ${$}`:""}. This is a problem with the request QitQode sent \u2014 not your sign-in, and not a gateway outage. Sending the same thing again will fail the same way.`},requestNotSent:(q)=>{let H=q?M(q):"";return`QitQode did not send this request${H?`: ${H}`:""}. Nothing was sent and no qredits were spent. This is a problem inside QitQode \u2014 not your sign-in, and not a gateway outage.`},requestTooLargeRecovering:(q)=>{let H=q?M(q):"";return`This request was too large to send${H?` (${H})`:""}, so QitQode removed some earlier conversation detail and is trying once more. Your sign-in is fine and the service is reachable.`},requestTooLargeIrreducible:(q)=>{let H=q?M(q):"";return`This request is too large for the service to accept${H?` (${H})`:""}, and QitQode couldn't make it smaller without losing your current request. Try removing large pasted text or attachments from your message, or start a new session. This isn't a sign-in problem or a service outage.`},requestTooLargeAfterReduction:(q)=>{let H=q?M(q):"";return`This request was still too large for the service after QitQode removed earlier conversation detail${H?` (${H})`:""}, so it stopped rather than retrying again. Start a new session, or send a shorter message with fewer attachments. This isn't a sign-in problem or a service outage.`},insufficientBalanceFallback:"Insufficient qredits.",insufficientBalanceCliSuffix:" Visit qitqode.com to add qredits.",invalidCredentialsFallback:"Your QitQode sign-in has ended and couldn't be renewed automatically. Sign in again.",apiKeyPrompt:"Paste your Qortex API key:",apiKeyPlaceholder:"qortex-...",loginMenuForgewise:"Sign in with Forgewise account",loginMenuApiKey:"Paste a Qortex API key",waitingForgewise:"\u23F3 Waiting for Forgewise sign-in in your browser\u2026"};function J(q){let H=process.env[q]?.toLowerCase();return H==="true"||H==="1"}function S(q){let H=process.env[q]?.toLowerCase();return H==="false"||H==="0"}function N(q){let H=process.env[q];if(!H)return;let $=Number(H);return Number.isInteger($)&&$>0?$:void 0}var R=J("QITQODE_EXPERIMENTAL"),k=J("QITQODE_DISABLE_CLAUDE_CODE"),C=J("QITQODE_DISABLE_EXTERNAL_SKILLS"),i=C||k||J("QITQODE_DISABLE_CLAUDE_CODE_SKILLS"),s=process.env.QITQODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT,c={OTEL_EXPORTER_OTLP_ENDPOINT:process.env.OTEL_EXPORTER_OTLP_ENDPOINT,OTEL_EXPORTER_OTLP_HEADERS:process.env.OTEL_EXPORTER_OTLP_HEADERS,QITQODE_AUTO_SHARE:J("QITQODE_AUTO_SHARE"),QITQODE_AUTO_HEAP_SNAPSHOT:J("QITQODE_AUTO_HEAP_SNAPSHOT"),QITQODE_GIT_BASH_PATH:process.env.QITQODE_GIT_BASH_PATH,QITQODE_CONFIG:process.env.QITQODE_CONFIG,QITQODE_CONFIG_CONTENT:process.env.QITQODE_CONFIG_CONTENT,get QITQODE_BACKEND_URL(){return process.env.QITQODE_BACKEND_URL??f},get QITQODE_QLEX_MAX_REQUEST_BYTES(){return N("QITQODE_QLEX_MAX_REQUEST_BYTES")},QITQODE_DISABLE_AUTOUPDATE:J("QITQODE_DISABLE_AUTOUPDATE"),QITQODE_DISABLE_LOG_ROTATION:J("QITQODE_DISABLE_LOG_ROTATION"),QITQODE_ALWAYS_NOTIFY_UPDATE:J("QITQODE_ALWAYS_NOTIFY_UPDATE"),QITQODE_DISABLE_PRUNE:J("QITQODE_DISABLE_PRUNE"),QITQODE_DISABLE_TERMINAL_TITLE:J("QITQODE_DISABLE_TERMINAL_TITLE"),QITQODE_SHOW_TTFD:J("QITQODE_SHOW_TTFD"),QITQODE_PERMISSION:process.env.QITQODE_PERMISSION,QITQODE_DISABLE_DEFAULT_PLUGINS:J("QITQODE_DISABLE_DEFAULT_PLUGINS"),QITQODE_DISABLE_LSP_DOWNLOAD:!0,QITQODE_ENABLE_EXPERIMENTAL_MODELS:J("QITQODE_ENABLE_EXPERIMENTAL_MODELS"),QITQODE_DISABLE_AUTOCOMPACT:J("QITQODE_DISABLE_AUTOCOMPACT"),QITQODE_DISABLE_MODELS_FETCH:J("QITQODE_DISABLE_MODELS_FETCH"),QITQODE_DISABLE_MOUSE:J("QITQODE_DISABLE_MOUSE"),QITQODE_OUTPUT_LENGTH_CONTINUATION_LIMIT:N("QITQODE_OUTPUT_LENGTH_CONTINUATION_LIMIT")??3,QITQODE_INVALID_OUTPUT_CONTINUATION_LIMIT:N("QITQODE_INVALID_OUTPUT_CONTINUATION_LIMIT")??2,QITQODE_TEXT_NGRAM_N:N("QITQODE_TEXT_NGRAM_N")??6,QITQODE_TEXT_REPEAT_THRESHOLD:N("QITQODE_TEXT_REPEAT_THRESHOLD")??3,QITQODE_TEXT_WINDOW_TOKENS:N("QITQODE_TEXT_WINDOW_TOKENS")??500,QITQODE_MAX_PROMPT_IMAGES:N("QITQODE_MAX_PROMPT_IMAGES")??4,QITQODE_MAX_PROMPT_IMAGE_SIZE:N("QITQODE_MAX_PROMPT_IMAGE_SIZE")??393216,QITQODE_DISABLE_PROVIDER_ENV:J("QITQODE_DISABLE_PROVIDER_ENV"),QITQODE_DISABLE_CLAUDE_CODE:k,get QITQODE_DISABLE_CLAUDE_CODE_MCP(){return k||J("QITQODE_DISABLE_CLAUDE_CODE_MCP")},QITQODE_DISABLE_CLAUDE_CODE_PROMPT:k||J("QITQODE_DISABLE_CLAUDE_CODE_PROMPT"),QITQODE_DISABLE_CLAUDE_CODE_COMMANDS:J("QITQODE_DISABLE_CLAUDE_CODE_COMMANDS"),QITQODE_DISABLE_CLAUDE_CODE_SKILLS:i,QITQODE_DISABLE_EXTERNAL_SKILLS:C,QITQODE_DISABLE_CODEX_SKILLS:C||J("QITQODE_DISABLE_CODEX_SKILLS"),QITQODE_DISABLE_OPENCODE_SKILLS:C||J("QITQODE_DISABLE_OPENCODE_SKILLS"),QITQODE_FAKE_VCS:process.env.QITQODE_FAKE_VCS,QITQODE_DISABLE_GIT:J("QITQODE_DISABLE_GIT"),get QITQODE_SERVER_PASSWORD(){return process.env.QITQODE_SERVER_PASSWORD},get QITQODE_SERVER_USERNAME(){return process.env.QITQODE_SERVER_USERNAME},QITQODE_ENABLE_QUESTION_TOOL:J("QITQODE_ENABLE_QUESTION_TOOL"),QITQODE_EXPERIMENTAL:R,QITQODE_EXPERIMENTAL_FILEWATCHER:X.boolean("QITQODE_EXPERIMENTAL_FILEWATCHER").pipe(X.withDefault(!1)),QITQODE_EXPERIMENTAL_DISABLE_FILEWATCHER:X.boolean("QITQODE_EXPERIMENTAL_DISABLE_FILEWATCHER").pipe(X.withDefault(!1)),QITQODE_EXPERIMENTAL_ICON_DISCOVERY:R||J("QITQODE_EXPERIMENTAL_ICON_DISCOVERY"),QITQODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT:s===void 0?process.platform==="win32":J("QITQODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT"),QITQODE_ENABLE_EXA:J("QITQODE_ENABLE_EXA")||R||J("QITQODE_EXPERIMENTAL_EXA"),QITQODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS:N("QITQODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS"),QITQODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX:N("QITQODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX"),QITQODE_EXPERIMENTAL_OXFMT:R||J("QITQODE_EXPERIMENTAL_OXFMT"),QITQODE_EXPERIMENTAL_LSP_TY:J("QITQODE_EXPERIMENTAL_LSP_TY"),QITQODE_EXPERIMENTAL_LSP_TOOL:R||J("QITQODE_EXPERIMENTAL_LSP_TOOL"),QITQODE_EXPERIMENTAL_WORKFLOW_TOOL:!S("QITQODE_EXPERIMENTAL_WORKFLOW_TOOL"),QITQODE_EXPERIMENTAL_MARKDOWN:!S("QITQODE_EXPERIMENTAL_MARKDOWN"),QITQODE_MODELS_URL:process.env.QITQODE_MODELS_URL,QITQODE_MODELS_PATH:process.env.QITQODE_MODELS_PATH,QITQODE_DB:process.env.QITQODE_DB,QITQODE_DISABLE_CHANNEL_DB:!S("QITQODE_DISABLE_CHANNEL_DB"),QITQODE_SKIP_MIGRATIONS:J("QITQODE_SKIP_MIGRATIONS"),QITQODE_STRICT_CONFIG_DEPS:J("QITQODE_STRICT_CONFIG_DEPS"),QITQODE_WORKSPACE_ID:process.env.QITQODE_WORKSPACE_ID,QITQODE_EXPERIMENTAL_HTTPAPI:J("QITQODE_EXPERIMENTAL_HTTPAPI"),QITQODE_EXPERIMENTAL_WORKSPACES:R||J("QITQODE_EXPERIMENTAL_WORKSPACES"),get QITQODE_DISABLE_COMPOSE_SKILLS(){return J("QITQODE_DISABLE_COMPOSE_SKILLS")},get QITQODE_DISABLE_BUILTIN_SKILLS(){return J("QITQODE_DISABLE_BUILTIN_SKILLS")},get QITQODE_DISABLE_PROJECT_CONFIG(){return J("QITQODE_DISABLE_PROJECT_CONFIG")},get QITQODE_TUI_CONFIG(){return process.env.QITQODE_TUI_CONFIG},get QITQODE_CONFIG_DIR(){return process.env.QITQODE_CONFIG_DIR},get QITQODE_HOME(){return process.env.QITQODE_HOME},get QITQODE_PURE(){return J("QITQODE_PURE")},get QITQODE_PLUGIN_META_FILE(){return process.env.QITQODE_PLUGIN_META_FILE},get QITQODE_CLIENT(){return process.env.QITQODE_CLIENT??"cli"}};var r=p.enum(["DEBUG","INFO","WARN","ERROR"]).meta({ref:"LogLevel",description:"Log level"}),v={DEBUG:0,INFO:1,WARN:2,ERROR:3},t=10,a=52428800,e=209715200,d="INFO";function F(q){return v[q]>=v[d]}function qq(q){return F(q)}var E=new Map,Hq=I({service:"default"}),G="";function Jq(){return G}var z,T=0,m=!0,w=(q)=>{return process.stderr.write(q),q.length};function y(){return new Date().toISOString().split(".")[0].replace(/:/g,"")}async function $q(q){if(q.level)d=q.level;if(m=q.rotate??!c.QITQODE_DISABLE_LOG_ROTATION,n(O.Path.log),q.print)return;if(G=U.join(O.Path.log,q.dev?"dev.log":y()+".log"),q.dev){let H=await K.stat(G).catch(()=>null);if(H&&H.size>0)await K.rename(G,`${G}.${y()}`).catch(()=>{})}else await K.truncate(G).catch(()=>{});z=g(G,{flags:"a"}),T=0,w=(H)=>{return h=h.then(async()=>{if(T+=Buffer.byteLength(H),m&&T>=a)T=Buffer.byteLength(H),await jq();await new Promise(($)=>{if(!z){$();return}z.write(H,()=>$())})}).catch(()=>{}),H.length}}var h=Promise.resolve();async function Yq(){await h}async function jq(){let q=z,H=`${G}.${y()}`;for(let $=2;await K.stat(H).then(()=>!0,()=>!1);$++)H=`${G}.${y()}.${$}`;if(await K.rename(G,H).catch(()=>{}),z=g(G,{flags:"a"}),q)q.end();n(O.Path.log)}async function n(q){let H=await K.readdir(q).catch(()=>[]),W=(await Promise.all(H.filter((Y)=>Y.includes(".log")&&U.join(q,Y)!==G).map(async(Y)=>{let Z=await K.stat(U.join(q,Y)).catch(()=>null);return Z?.isFile()?{name:Y,size:Z.size}:null}))).flatMap((Y)=>Y?[Y]:[]).sort((Y,Z)=>Y.name<Z.name?-1:Y.name>Z.name?1:0),j=W.reduce((Y,Z)=>Y+Z.size,0),P=W.length,B=W.filter((Y)=>{if(P<=t&&j<=e)return!1;return j-=Y.size,P-=1,!0});await Promise.all(B.map((Y)=>K.unlink(U.join(q,Y.name)).catch(()=>{})))}var Pq=/token|secret|password|passwd|credential|api[_-]?key|authorization|cookie|set-cookie/i;function D(q,H){if(Pq.test(q)&&H!==void 0&&H!==null)return"[REDACTED]";return H}var A=10240;function Wq(q){try{let H=JSON.stringify(q,function($,W){return $?D($,W):W});if(typeof H==="string"&&H.length>A)return H.slice(0,A)+`\u2026[truncated ${H.length-A} chars]`;return H}catch{return"[unserializable]"}}function o(q,H=0){let $=q.message;return q.cause instanceof Error&&H<10?$+" Caused by: "+o(q.cause,H+1):$}var u=Date.now();function I(q){q=q||{};let H=q.service;if(H&&typeof H==="string"){let j=E.get(H);if(j)return j}function $(j,P){let B=Object.entries({...q,...P}).filter(([x,V])=>V!==void 0&&V!==null).map(([x,V])=>{let b=`${x}=`;if(V instanceof Error)return b+o(V);let L=D(x,V);if(L!==V)return b+L;if(typeof V==="object"&&V!==null)return b+Wq(V);return b+V}).join(" "),Y=new Date,Z=Y.getTime()-u;return u=Y.getTime(),[Y.toISOString().split(".")[0],"+"+Z+"ms",B,j].filter(Boolean).join(" ")+`
3
+ `}let W={debug(j,P){if(F("DEBUG"))w("DEBUG "+$(j,P))},info(j,P){if(F("INFO"))w("INFO "+$(j,P))},error(j,P){if(F("ERROR"))w("ERROR "+$(j,P))},warn(j,P){if(F("WARN"))w("WARN "+$(j,P))},tag(j,P){if(q)q[j]=P;return W},clone(){return I({...q})},time(j,P){let B=Date.now();W.info(j,{status:"started",...P});function Y(){W.info(j,{status:"completed",duration:Date.now()-B,...P})}return{stop:Y,[Symbol.dispose](){Y()}}}};if(H&&typeof H==="string")E.set(H,W);return W}
4
+ export{f as Js,Mq as Ks,M as Ls,Nq as Ms,c as Ns,r as Os,qq as Ps,Hq as Qs,Jq as Rs,$q as Ss,Yq as Ts,D as Us,I as Vs,Gq as Ws};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-r9w0thdk.js";var n="./highlights-hk7bwhj4.scm";export{n as default};