@qitqode/qitqode-android-arm64 0.1.29 → 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. package/bundle/{chunk-g06rv5fq.js → chunk-01my2y0c.js} +1 -1
  2. package/bundle/chunk-04n2ycg5.js +800 -0
  3. package/bundle/{chunk-k7dcfqjs.js → chunk-05mce0j3.js} +1 -1
  4. package/bundle/{chunk-3q6650we.js → chunk-0bbs01f0.js} +1 -1
  5. package/bundle/{chunk-1rn0vmvv.js → chunk-0dt0bxz6.js} +2 -2
  6. package/bundle/{chunk-x6nbck7p.js → chunk-0mx2psfc.js} +1 -1
  7. package/bundle/chunk-0p27fvfr.js +2 -0
  8. package/bundle/chunk-0qs1vx97.js +2 -0
  9. package/bundle/{chunk-8kz3n8ye.js → chunk-0v0vqbn5.js} +1 -1
  10. package/bundle/chunk-0w0ctb90.js +2 -0
  11. package/bundle/chunk-0yt5njh7.js +8 -0
  12. package/bundle/{chunk-fsy279s5.js → chunk-10bjs581.js} +2 -2
  13. package/bundle/{chunk-z29fwg61.js → chunk-11x3t2tt.js} +1 -1
  14. package/bundle/{chunk-qzjpea91.js → chunk-12vef2pr.js} +1 -1
  15. package/bundle/{chunk-kkae8ead.js → chunk-15hw2z9t.js} +1 -1
  16. package/bundle/chunk-1f7ajq8s.js +2 -0
  17. package/bundle/chunk-1fswr17z.js +2 -0
  18. package/bundle/{chunk-yt2k9ga8.js → chunk-1gx18dm5.js} +1 -1
  19. package/bundle/chunk-1rhhhm88.js +2 -0
  20. package/bundle/{chunk-b4qd109w.js → chunk-1sgahe1s.js} +1 -1
  21. package/bundle/{chunk-74zgcxeg.js → chunk-1vb79bw1.js} +1 -1
  22. package/bundle/chunk-1wbjh23g.js +2 -0
  23. package/bundle/chunk-20f83ca0.js +2 -0
  24. package/bundle/{chunk-ed723mw1.js → chunk-24jg9d61.js} +1 -1
  25. package/bundle/{chunk-csdm3n24.js → chunk-2hc5z7b5.js} +1 -1
  26. package/bundle/{chunk-bzrsnv2k.js → chunk-2maqde7w.js} +2 -2
  27. package/bundle/{chunk-awav98j0.js → chunk-2vn41ecx.js} +1 -1
  28. package/bundle/{chunk-50w28xj1.js → chunk-2zq4k837.js} +1 -1
  29. package/bundle/chunk-31mnd3ph.js +3 -0
  30. package/bundle/{chunk-a2qerqgd.js → chunk-31qrzrwy.js} +1 -1
  31. package/bundle/{chunk-abtn6nec.js → chunk-326p5b10.js} +2 -2
  32. package/bundle/{chunk-2p2ch1k2.js → chunk-33e9y2aw.js} +1 -1
  33. package/bundle/{chunk-asmfntjm.js → chunk-35xk4g91.js} +1 -1
  34. package/bundle/{chunk-n86s4fw4.js → chunk-3632wgg1.js} +1 -1
  35. package/bundle/{chunk-tqsx2m1j.js → chunk-3bxg5bta.js} +1 -1
  36. package/bundle/{chunk-6bsgrr5h.js → chunk-3c6p8tm3.js} +1 -1
  37. package/bundle/chunk-3h9rq2wq.js +2 -0
  38. package/bundle/{chunk-7wthn44y.js → chunk-3ytjm3az.js} +1 -1
  39. package/bundle/{chunk-2mjc44ev.js → chunk-40efytmk.js} +1 -1
  40. package/bundle/chunk-42p59wm4.js +2 -0
  41. package/bundle/{chunk-09j71kp6.js → chunk-44a82dg0.js} +4 -4
  42. package/bundle/chunk-4512pvca.js +2 -0
  43. package/bundle/chunk-456bmaww.js +2 -0
  44. package/bundle/{chunk-s6me101a.js → chunk-48ge2ryx.js} +1 -1
  45. package/bundle/chunk-48pajrnt.js +2 -0
  46. package/bundle/{chunk-hn1f6rne.js → chunk-4cnwn1rh.js} +2 -2
  47. package/bundle/chunk-4d87mhwn.js +3 -0
  48. package/bundle/chunk-4fy9c54h.js +2 -0
  49. package/bundle/{chunk-43ae3chd.js → chunk-4gkk28xk.js} +2 -2
  50. package/bundle/{chunk-bsf6n350.js → chunk-4jtxtkj7.js} +2 -2
  51. package/bundle/{chunk-pq2prhb2.js → chunk-50sv6y2e.js} +1 -1
  52. package/bundle/chunk-50tb3g5x.js +2 -0
  53. package/bundle/chunk-52bam8g7.js +2 -0
  54. package/bundle/{chunk-zqxmr01r.js → chunk-53bqcctj.js} +1 -1
  55. package/bundle/chunk-53w4zqps.js +2 -0
  56. package/bundle/chunk-59y8q9m5.js +2 -0
  57. package/bundle/chunk-5eq1fft9.js +3 -0
  58. package/bundle/{chunk-8f0g7d7k.js → chunk-5hw6xa49.js} +2 -2
  59. package/bundle/{chunk-9epjgend.js → chunk-5q4harvc.js} +2 -2
  60. package/bundle/chunk-5tray1fw.js +3 -0
  61. package/bundle/{chunk-a2g69pv6.js → chunk-5v0xjs3x.js} +1 -1
  62. package/bundle/{chunk-ce5t444d.js → chunk-60v5jvgt.js} +1 -1
  63. package/bundle/chunk-64ezpbwt.js +2 -0
  64. package/bundle/{chunk-b9hstp7h.js → chunk-68yw2hk9.js} +1 -1
  65. package/bundle/{chunk-hhgjbag9.js → chunk-69nzndk7.js} +1 -1
  66. package/bundle/chunk-6bpe215q.js +2 -0
  67. package/bundle/chunk-6bphjajd.js +2 -0
  68. package/bundle/{chunk-qredfmch.js → chunk-6d5rrre9.js} +1 -1
  69. package/bundle/{chunk-mb4wvwfw.js → chunk-6hpgb8h4.js} +3 -3
  70. package/bundle/{chunk-88dhcv37.js → chunk-6kp07m7p.js} +1 -1
  71. package/bundle/{chunk-csyw14fj.js → chunk-6phh70sp.js} +1 -1
  72. package/bundle/chunk-6t1ehq36.js +2 -0
  73. package/bundle/{chunk-hgbkg85g.js → chunk-70ck4v3t.js} +1 -1
  74. package/bundle/{chunk-3n49y4kh.js → chunk-71sjjjr8.js} +1 -1
  75. package/bundle/{chunk-geccvf9d.js → chunk-71xz70r9.js} +1 -1
  76. package/bundle/{chunk-9kjj44cr.js → chunk-73e409hd.js} +1 -1
  77. package/bundle/{chunk-1xw68zak.js → chunk-78ymd20x.js} +1 -1
  78. package/bundle/{chunk-n4gjpgnk.js → chunk-7avcnwv8.js} +1 -1
  79. package/bundle/{chunk-z8v2tsz2.js → chunk-7hm0c2yg.js} +1 -1
  80. package/bundle/{chunk-kfgn4apg.js → chunk-7mke41x0.js} +1 -1
  81. package/bundle/chunk-7pfj4x1a.js +2 -0
  82. package/bundle/chunk-7ry9cvby.js +2 -0
  83. package/bundle/chunk-7wczs9mx.js +2 -0
  84. package/bundle/{chunk-yjj4cvqg.js → chunk-7xm75w1e.js} +1 -1
  85. package/bundle/{chunk-y212x7ws.js → chunk-7z5jh4ra.js} +1 -1
  86. package/bundle/{chunk-98vfbn0h.js → chunk-81qwdg5s.js} +1 -1
  87. package/bundle/{chunk-r4mnbhe1.js → chunk-83gqkmth.js} +1 -1
  88. package/bundle/chunk-873skv7w.js +2 -0
  89. package/bundle/{chunk-ndmrg80b.js → chunk-8hytwgwf.js} +1 -1
  90. package/bundle/{chunk-0wdtbn59.js → chunk-8n20thvd.js} +2 -2
  91. package/bundle/{chunk-xn61fgrh.js → chunk-8qswepp2.js} +1 -1
  92. package/bundle/chunk-8v96pmqn.js +2 -0
  93. package/bundle/chunk-8y2scz6z.js +2 -0
  94. package/bundle/{chunk-7mc8nxve.js → chunk-8ymffyep.js} +1 -1
  95. package/bundle/chunk-8zx7vnx6.js +2 -0
  96. package/bundle/{chunk-8k55xz7z.js → chunk-93p131d5.js} +1 -1
  97. package/bundle/chunk-94a76f8w.js +2 -0
  98. package/bundle/{chunk-3h4y7n1a.js → chunk-9emq67vc.js} +1 -1
  99. package/bundle/{chunk-ypthfv6d.js → chunk-9f1z9xce.js} +1 -1
  100. package/bundle/chunk-9mjz6e27.js +2 -0
  101. package/bundle/chunk-9ng7jjp7.js +2 -0
  102. package/bundle/chunk-9tpgnjy8.js +2 -0
  103. package/bundle/{chunk-f29n7826.js → chunk-9x5232dw.js} +1 -1
  104. package/bundle/{chunk-t3tkp1em.js → chunk-a1wdeapb.js} +1 -1
  105. package/bundle/{chunk-b20xjnpw.js → chunk-a7amey9s.js} +1 -1
  106. package/bundle/chunk-a7ym9f0v.js +2 -0
  107. package/bundle/chunk-a8f2xvy3.js +2 -0
  108. package/bundle/chunk-a99cvwta.js +2 -0
  109. package/bundle/chunk-abd1cfpg.js +2 -0
  110. package/bundle/{chunk-yn576pje.js → chunk-ag8kz1e7.js} +2 -2
  111. package/bundle/chunk-anwnwfjf.js +2 -0
  112. package/bundle/chunk-avys5mnz.js +2 -0
  113. package/bundle/chunk-axvjd10y.js +2 -0
  114. package/bundle/{chunk-4vze3djr.js → chunk-ay8emwym.js} +1 -1
  115. package/bundle/chunk-b4pphqab.js +2 -0
  116. package/bundle/chunk-b6087ak4.js +2 -0
  117. package/bundle/{chunk-qje3683x.js → chunk-b8gjz6bk.js} +1 -1
  118. package/bundle/chunk-bgw4fvg2.js +2 -0
  119. package/bundle/{chunk-q0xzbad1.js → chunk-bh53dz71.js} +1 -1
  120. package/bundle/chunk-brkqxbjy.js +2 -0
  121. package/bundle/{chunk-j2zay4da.js → chunk-c11d28qn.js} +2 -2
  122. package/bundle/{chunk-hd2kb05a.js → chunk-c14s0kxq.js} +1 -1
  123. package/bundle/{chunk-qsszerj7.js → chunk-c1bdzxbx.js} +2 -2
  124. package/bundle/{chunk-v9xnk9pz.js → chunk-c1vnp55z.js} +1 -1
  125. package/bundle/chunk-c26qxt5g.js +2 -0
  126. package/bundle/chunk-c6zscb38.js +2 -0
  127. package/bundle/{chunk-g0mbbysk.js → chunk-cfgvm15x.js} +1 -1
  128. package/bundle/{chunk-jntqzhxr.js → chunk-chpr8ekb.js} +1 -1
  129. package/bundle/chunk-cjww2jmv.js +3 -0
  130. package/bundle/{chunk-hbtd620x.js → chunk-ck2gfaba.js} +1 -1
  131. package/bundle/chunk-cmbh77cs.js +7 -0
  132. package/bundle/{chunk-eqcd9k9p.js → chunk-cnmq5xtq.js} +218 -218
  133. package/bundle/{chunk-azx0zxnx.js → chunk-cphrgyp6.js} +1 -1
  134. package/bundle/chunk-csz0dgyp.js +2 -0
  135. package/bundle/{chunk-fhdpp77n.js → chunk-ctaze2hn.js} +1 -1
  136. package/bundle/{chunk-n5sh2790.js → chunk-cxnfy6qk.js} +1 -1
  137. package/bundle/{chunk-yn05n0az.js → chunk-d07p6fpk.js} +2 -2
  138. package/bundle/{chunk-kw09hbrb.js → chunk-d65qs4d0.js} +1 -1
  139. package/bundle/{chunk-xk1nh1ay.js → chunk-d68fzyw7.js} +2 -2
  140. package/bundle/{chunk-6hdjkvr1.js → chunk-d6ry9418.js} +2 -2
  141. package/bundle/{chunk-zbq60sw6.js → chunk-dactgryw.js} +1 -1
  142. package/bundle/chunk-dafmkrhn.js +2 -0
  143. package/bundle/{chunk-qzcfjz9g.js → chunk-db405hjg.js} +1 -1
  144. package/bundle/chunk-dgprdym0.js +2 -0
  145. package/bundle/{chunk-v7deh7aj.js → chunk-dnwefyhv.js} +1 -1
  146. package/bundle/{chunk-scqxmv8k.js → chunk-drvkj3xg.js} +1 -1
  147. package/bundle/chunk-dryzt12j.js +2 -0
  148. package/bundle/chunk-dsamees2.js +2 -0
  149. package/bundle/{chunk-bv8pf0m1.js → chunk-dxpj0cxh.js} +2 -2
  150. package/bundle/{chunk-nv2r4cns.js → chunk-dynv30gm.js} +1 -1
  151. package/bundle/chunk-dyqpxx3b.js +2 -0
  152. package/bundle/{chunk-pg8dz1rq.js → chunk-e01wnqvc.js} +1 -1
  153. package/bundle/{chunk-z160s5p5.js → chunk-e10py6yr.js} +1 -1
  154. package/bundle/{chunk-xk7je9y8.js → chunk-e7ny0b3x.js} +1 -1
  155. package/bundle/{chunk-2w20mhch.js → chunk-eh7e49k4.js} +1 -1
  156. package/bundle/{chunk-6jewfaqa.js → chunk-ehhas0ew.js} +2 -2
  157. package/bundle/{chunk-6scqd8fh.js → chunk-ejrhvy38.js} +1 -1
  158. package/bundle/{chunk-sv48x9h8.js → chunk-enpzvmtc.js} +1 -1
  159. package/bundle/chunk-excnptfy.js +2 -0
  160. package/bundle/chunk-ez8vkgfz.js +2 -0
  161. package/bundle/chunk-f2btnww9.js +2 -0
  162. package/bundle/chunk-f8eter69.js +5 -0
  163. package/bundle/{chunk-7926bzm7.js → chunk-fgg9txzb.js} +1 -1
  164. package/bundle/chunk-fjq3a347.js +2 -0
  165. package/bundle/{chunk-6528bthc.js → chunk-fn9h4ync.js} +1 -1
  166. package/bundle/{chunk-m2ny1en7.js → chunk-fq0x3esz.js} +5 -5
  167. package/bundle/{chunk-h8chkene.js → chunk-fvzwbjh8.js} +1 -1
  168. package/bundle/chunk-fxdtq2ed.js +2 -0
  169. package/bundle/{chunk-sbx9z70j.js → chunk-fyqjm5fv.js} +1 -1
  170. package/bundle/{chunk-t35n89t9.js → chunk-g10d6x57.js} +1 -1
  171. package/bundle/{chunk-1d9f53sk.js → chunk-g5rabwre.js} +2 -2
  172. package/bundle/{chunk-4fk4se02.js → chunk-g7ccdh7r.js} +1 -1
  173. package/bundle/{chunk-0yqbyres.js → chunk-g9cjsfvg.js} +1 -1
  174. package/bundle/{chunk-yvqbewmc.js → chunk-gagtmjmp.js} +2 -2
  175. package/bundle/{chunk-4fspp5fg.js → chunk-gb00fh4z.js} +3 -3
  176. package/bundle/{chunk-44jpsp97.js → chunk-gbpvs0fx.js} +1 -1
  177. package/bundle/{chunk-v9bmpndq.js → chunk-gbrnn2dk.js} +1 -1
  178. package/bundle/chunk-gcw4rn10.js +2 -0
  179. package/bundle/{chunk-j8efst22.js → chunk-gj0wt0cy.js} +1 -1
  180. package/bundle/{chunk-rptvpa1v.js → chunk-gsar6xda.js} +1 -1
  181. package/bundle/{chunk-nxn4arcf.js → chunk-gt31468k.js} +1 -1
  182. package/bundle/{chunk-c19t7e8s.js → chunk-gwp17r03.js} +1 -1
  183. package/bundle/chunk-gwzw92jt.js +2 -0
  184. package/bundle/{chunk-z5yrvg40.js → chunk-h2afsbm1.js} +1 -1
  185. package/bundle/{chunk-d86ma6zk.js → chunk-h4j5xzc8.js} +1 -1
  186. package/bundle/{chunk-hevb7k95.js → chunk-hbbsbyyq.js} +1 -1
  187. package/bundle/chunk-hnctaq8s.js +3 -0
  188. package/bundle/{chunk-g3ch14a1.js → chunk-hnzegjgv.js} +1 -1
  189. package/bundle/chunk-hp7tssgv.js +2 -0
  190. package/bundle/chunk-ht0hbdmx.js +2 -0
  191. package/bundle/{chunk-ekndhwnn.js → chunk-ht5w06x7.js} +2 -2
  192. package/bundle/{chunk-a8p9aggx.js → chunk-htz93dsd.js} +1 -1
  193. package/bundle/{chunk-svrxk3vf.js → chunk-jbx3s7nw.js} +2 -2
  194. package/bundle/chunk-jcjbr3q7.js +2 -0
  195. package/bundle/{chunk-yyqrbv2f.js → chunk-jef04wyf.js} +1 -1
  196. package/bundle/{chunk-b1ntb3dh.js → chunk-jh0bw59r.js} +1 -1
  197. package/bundle/{chunk-b73s2h43.js → chunk-jrqb0jwy.js} +1 -1
  198. package/bundle/{chunk-3rt2k5sc.js → chunk-js1n8tgv.js} +1 -1
  199. package/bundle/chunk-jxswwvr3.js +2 -0
  200. package/bundle/{chunk-0626rvy2.js → chunk-kf167jw7.js} +1 -1
  201. package/bundle/{chunk-byc7ev8p.js → chunk-kfxv5rfg.js} +1 -1
  202. package/bundle/{chunk-d0qqgxs4.js → chunk-kj20f048.js} +1 -1
  203. package/bundle/{chunk-cd867geb.js → chunk-kq6b222y.js} +1 -1
  204. package/bundle/{chunk-6hmj972a.js → chunk-ktzq4ha1.js} +1 -1
  205. package/bundle/chunk-m5m448mg.js +3 -0
  206. package/bundle/{chunk-dfja6dj6.js → chunk-mcg24gkb.js} +1 -1
  207. package/bundle/chunk-mh0j6dzy.js +2 -0
  208. package/bundle/{chunk-p7h2qd7z.js → chunk-mk1bfzg5.js} +1 -1
  209. package/bundle/chunk-mxzceza9.js +2 -0
  210. package/bundle/{chunk-4vemws1t.js → chunk-mzs2pjyc.js} +2 -2
  211. package/bundle/chunk-n0dy98h2.js +2 -0
  212. package/bundle/{chunk-jwtev7b7.js → chunk-n9xns8by.js} +2 -2
  213. package/bundle/chunk-ngm6pqyt.js +2 -0
  214. package/bundle/chunk-ngtavamt.js +2 -0
  215. package/bundle/chunk-nkhc32s3.js +2 -0
  216. package/bundle/chunk-npse2xrd.js +2 -0
  217. package/bundle/{chunk-3vmh2ge6.js → chunk-nsk8dkwp.js} +1 -1
  218. package/bundle/{chunk-1fz0383p.js → chunk-nv3eyyaj.js} +1 -1
  219. package/bundle/{chunk-az9hsk6z.js → chunk-p18axz0m.js} +1 -1
  220. package/bundle/{chunk-2p9py4rw.js → chunk-p62gb4wj.js} +1 -1
  221. package/bundle/chunk-p6e4vqy7.js +2 -0
  222. package/bundle/{chunk-ktqrbbkh.js → chunk-p9qfbr02.js} +1 -1
  223. package/bundle/chunk-pctt1qv8.js +14 -0
  224. package/bundle/{chunk-gd45tjbd.js → chunk-pe29yy6s.js} +1 -1
  225. package/bundle/chunk-pf9g671w.js +2 -0
  226. package/bundle/chunk-phv9kdq6.js +3 -0
  227. package/bundle/{chunk-k095hd3c.js → chunk-pp2eqkse.js} +1 -1
  228. package/bundle/{chunk-gjvymdhp.js → chunk-pp6vhqrr.js} +1 -1
  229. package/bundle/chunk-ppjnqexm.js +2 -0
  230. package/bundle/chunk-pqkjhn8h.js +2 -0
  231. package/bundle/{chunk-yj73ehjd.js → chunk-pxvk3syj.js} +1 -1
  232. package/bundle/{chunk-tsb9g1nz.js → chunk-qbc36nbb.js} +2 -2
  233. package/bundle/{chunk-xhncwg5v.js → chunk-qc8rsn4v.js} +1 -1
  234. package/bundle/chunk-qd8w2gkd.js +2 -0
  235. package/bundle/{chunk-k16s2dnx.js → chunk-qrsveve6.js} +1 -1
  236. package/bundle/chunk-qvnb3j71.js +3 -0
  237. package/bundle/{chunk-q5363rr9.js → chunk-r4ndwym0.js} +1 -1
  238. package/bundle/chunk-r78czx4d.js +8 -0
  239. package/bundle/{chunk-cjfgs1x8.js → chunk-rbk8seme.js} +1 -1
  240. package/bundle/{chunk-n34y5gp6.js → chunk-redjxn13.js} +2 -2
  241. package/bundle/chunk-rf12t4n5.js +2 -0
  242. package/bundle/{chunk-fj7kd4gc.js → chunk-rg0mrprz.js} +1 -1
  243. package/bundle/{chunk-2xxefrps.js → chunk-rjd8gbs5.js} +1 -1
  244. package/bundle/chunk-rpgne7xh.js +2 -0
  245. package/bundle/chunk-rvgj1vky.js +2 -0
  246. package/bundle/{chunk-bx6kyvg7.js → chunk-rvkrgkeq.js} +1 -1
  247. package/bundle/{chunk-2hw0jzv4.js → chunk-rzhdkkpz.js} +1 -1
  248. package/bundle/{chunk-45jqjyk9.js → chunk-s9ntkjz3.js} +1 -1
  249. package/bundle/{chunk-81h5f8ev.js → chunk-skqbaadf.js} +1 -1
  250. package/bundle/chunk-ss2jvqrg.js +2 -0
  251. package/bundle/{chunk-61yatzp8.js → chunk-ss2ms1r3.js} +1 -1
  252. package/bundle/chunk-ssajqv72.js +2 -0
  253. package/bundle/{chunk-xn5v8wgh.js → chunk-t56r99hp.js} +1 -1
  254. package/bundle/{chunk-s1sepxdp.js → chunk-t8m74g39.js} +1 -1
  255. package/bundle/{chunk-s6bar2f9.js → chunk-t9mz17gb.js} +2 -2
  256. package/bundle/chunk-takew94z.js +9 -0
  257. package/bundle/{chunk-yp3dj4wh.js → chunk-tq0239xp.js} +1 -1
  258. package/bundle/{chunk-20d0cd1j.js → chunk-tqj69nh6.js} +2 -2
  259. package/bundle/{chunk-hpfqnjfz.js → chunk-tt30dybd.js} +1 -1
  260. package/bundle/{chunk-thk93j3e.js → chunk-tvdmnee6.js} +1 -1
  261. package/bundle/chunk-tvwwq4b3.js +2 -0
  262. package/bundle/{chunk-18vygvnc.js → chunk-v1xjc3s8.js} +1 -1
  263. package/bundle/chunk-v2n26eg4.js +2 -0
  264. package/bundle/chunk-vb286b31.js +2 -0
  265. package/bundle/chunk-vbeb74ny.js +11 -0
  266. package/bundle/chunk-vcw00k0n.js +3 -0
  267. package/bundle/{chunk-cfxjwfn4.js → chunk-vhe0tth1.js} +1 -1
  268. package/bundle/{chunk-z4nay2ef.js → chunk-vvxmwyrw.js} +1 -1
  269. package/bundle/{chunk-js9wdh67.js → chunk-vxyy2dp3.js} +2 -2
  270. package/bundle/{chunk-qk9vccja.js → chunk-vywnd5sf.js} +1 -1
  271. package/bundle/{chunk-gd5stg49.js → chunk-w18xs2h5.js} +1 -1
  272. package/bundle/{chunk-5n4hpc4f.js → chunk-wfb608qf.js} +3 -3
  273. package/bundle/chunk-x24y7qyd.js +2 -0
  274. package/bundle/{chunk-jkm54mha.js → chunk-x3y2xzhn.js} +1 -1
  275. package/bundle/{chunk-n3t52cz2.js → chunk-x4sp99g6.js} +1 -1
  276. package/bundle/{chunk-ef2b07fm.js → chunk-x562b0xk.js} +1 -1
  277. package/bundle/{chunk-zasd8cz8.js → chunk-x7k5yeey.js} +1 -1
  278. package/bundle/{chunk-v00cptj6.js → chunk-x9rbv6p6.js} +1 -1
  279. package/bundle/{chunk-m6wceqay.js → chunk-xcmgkc57.js} +1 -1
  280. package/bundle/{chunk-pycjksh4.js → chunk-xm7wascx.js} +1 -1
  281. package/bundle/{chunk-yaj9ywvz.js → chunk-xthkjax9.js} +1 -1
  282. package/bundle/{chunk-ps6jk326.js → chunk-xvwvd4kq.js} +2 -2
  283. package/bundle/{chunk-31wxbws4.js → chunk-xzrb857v.js} +1 -1
  284. package/bundle/chunk-y2d0w09y.js +2 -0
  285. package/bundle/{chunk-cev2qj7w.js → chunk-y3b4k38p.js} +1 -1
  286. package/bundle/{chunk-b9nwaaqs.js → chunk-y9q0hb7b.js} +2 -2
  287. package/bundle/chunk-yb79f79m.js +2 -0
  288. package/bundle/{chunk-8d2ddmf0.js → chunk-yek0sk2q.js} +1 -1
  289. package/bundle/{chunk-9atkgkaq.js → chunk-yhbcbjfk.js} +1 -1
  290. package/bundle/{chunk-k20nrwbg.js → chunk-yjf3kyej.js} +1 -1
  291. package/bundle/chunk-yjnyzpmt.js +2 -0
  292. package/bundle/{chunk-0a0vat1h.js → chunk-yp5bypsp.js} +2 -2
  293. package/bundle/{chunk-89f8v2y8.js → chunk-yp8wyzzm.js} +1 -1
  294. package/bundle/chunk-yqbcnsa1.js +2 -0
  295. package/bundle/{chunk-qtsmgjk7.js → chunk-yv0xrnn9.js} +1 -1
  296. package/bundle/chunk-z3mra3nm.js +2 -0
  297. package/bundle/{chunk-7m8fdp5p.js → chunk-z6pwkwdr.js} +1 -1
  298. package/bundle/{chunk-t299e2aw.js → chunk-zs8kqdsf.js} +2 -2
  299. package/bundle/{chunk-6saj1dhz.js → chunk-zscer8rc.js} +1 -1
  300. package/bundle/{chunk-4mrz9b6d.js → chunk-zw815d68.js} +2 -2
  301. package/bundle/chunk-zy9w1vkc.js +2 -0
  302. package/bundle/index.js +3 -3
  303. package/bundle/parser.worker.js +2 -2
  304. package/bundle/worker.js +1 -1
  305. package/package.json +1 -1
  306. package/bundle/chunk-07c1mvy1.js +0 -2
  307. package/bundle/chunk-0p7qcm51.js +0 -2
  308. package/bundle/chunk-0pmb7zzh.js +0 -2
  309. package/bundle/chunk-0xm85ayc.js +0 -3
  310. package/bundle/chunk-11d987sj.js +0 -11
  311. package/bundle/chunk-19sa03c1.js +0 -3
  312. package/bundle/chunk-1s9ctg0d.js +0 -2
  313. package/bundle/chunk-2f9fn9xr.js +0 -2
  314. package/bundle/chunk-2fhcvfyg.js +0 -2
  315. package/bundle/chunk-2ztdqtnk.js +0 -3
  316. package/bundle/chunk-3mfj0x4p.js +0 -2
  317. package/bundle/chunk-3shnje9k.js +0 -2
  318. package/bundle/chunk-3tz1qhpt.js +0 -2
  319. package/bundle/chunk-4dtbdycg.js +0 -2
  320. package/bundle/chunk-4kpvceap.js +0 -2
  321. package/bundle/chunk-4pz8av2y.js +0 -2
  322. package/bundle/chunk-4r4xh8a6.js +0 -2
  323. package/bundle/chunk-5hpq59t1.js +0 -2
  324. package/bundle/chunk-5s90ehww.js +0 -2
  325. package/bundle/chunk-5z7mjwwa.js +0 -14
  326. package/bundle/chunk-63kcg127.js +0 -2
  327. package/bundle/chunk-6fejrpht.js +0 -2
  328. package/bundle/chunk-6zzdw7q1.js +0 -2
  329. package/bundle/chunk-71pmrpkc.js +0 -2
  330. package/bundle/chunk-78m8rayq.js +0 -2
  331. package/bundle/chunk-7j6p5j2g.js +0 -2
  332. package/bundle/chunk-7tjd6ba1.js +0 -2
  333. package/bundle/chunk-8d8efdry.js +0 -2
  334. package/bundle/chunk-8jzjvmaz.js +0 -2
  335. package/bundle/chunk-93jxndr8.js +0 -2
  336. package/bundle/chunk-94qmhz2p.js +0 -3
  337. package/bundle/chunk-95qs7wnz.js +0 -2
  338. package/bundle/chunk-97h0jx8y.js +0 -5
  339. package/bundle/chunk-99ve54r6.js +0 -2
  340. package/bundle/chunk-9ksaqyb2.js +0 -2
  341. package/bundle/chunk-9p7t748e.js +0 -2
  342. package/bundle/chunk-a69jgepp.js +0 -2
  343. package/bundle/chunk-a94s0jks.js +0 -2
  344. package/bundle/chunk-ar310tc3.js +0 -2
  345. package/bundle/chunk-at03h9eq.js +0 -2
  346. package/bundle/chunk-ay9p70xx.js +0 -2
  347. package/bundle/chunk-b6dsv601.js +0 -3
  348. package/bundle/chunk-bajtytm5.js +0 -2
  349. package/bundle/chunk-bh8v3mfg.js +0 -2
  350. package/bundle/chunk-bp8sxnrm.js +0 -2
  351. package/bundle/chunk-bw5e8thn.js +0 -2
  352. package/bundle/chunk-c8ajbhv3.js +0 -2
  353. package/bundle/chunk-c8n72r2k.js +0 -8
  354. package/bundle/chunk-ccddzk10.js +0 -2
  355. package/bundle/chunk-ch8cx9jn.js +0 -2
  356. package/bundle/chunk-cm4jtnkg.js +0 -2
  357. package/bundle/chunk-cq7j5tv5.js +0 -2
  358. package/bundle/chunk-cttqh20d.js +0 -2
  359. package/bundle/chunk-cvvfa1jf.js +0 -2
  360. package/bundle/chunk-d7t0bcvk.js +0 -800
  361. package/bundle/chunk-dd3m74rc.js +0 -3
  362. package/bundle/chunk-e3qtndrt.js +0 -2
  363. package/bundle/chunk-e8cac405.js +0 -2
  364. package/bundle/chunk-ez92ah9y.js +0 -2
  365. package/bundle/chunk-fazvedgy.js +0 -2
  366. package/bundle/chunk-gf5pwww1.js +0 -2
  367. package/bundle/chunk-gtzcm5sb.js +0 -2
  368. package/bundle/chunk-j0znryc6.js +0 -9
  369. package/bundle/chunk-kzrw6h8t.js +0 -2
  370. package/bundle/chunk-ma0m6kpj.js +0 -2
  371. package/bundle/chunk-mjrvj2cg.js +0 -2
  372. package/bundle/chunk-mpebdv59.js +0 -2
  373. package/bundle/chunk-n20v44zr.js +0 -2
  374. package/bundle/chunk-nfzmvy30.js +0 -2
  375. package/bundle/chunk-nksathh4.js +0 -2
  376. package/bundle/chunk-p5360c2q.js +0 -2
  377. package/bundle/chunk-q14890p6.js +0 -2
  378. package/bundle/chunk-q4n02cwv.js +0 -2
  379. package/bundle/chunk-q7s17j1b.js +0 -2
  380. package/bundle/chunk-qm07wesh.js +0 -2
  381. package/bundle/chunk-qrrg9v3d.js +0 -2
  382. package/bundle/chunk-rdqgss38.js +0 -2
  383. package/bundle/chunk-rf524gez.js +0 -3
  384. package/bundle/chunk-rqgcz2zr.js +0 -2
  385. package/bundle/chunk-rs1698xs.js +0 -3
  386. package/bundle/chunk-rzc528ym.js +0 -2
  387. package/bundle/chunk-s2za1n7h.js +0 -8
  388. package/bundle/chunk-sbv96mj0.js +0 -3
  389. package/bundle/chunk-t3q7qakr.js +0 -2
  390. package/bundle/chunk-th78zcds.js +0 -2
  391. package/bundle/chunk-tj00kzk4.js +0 -2
  392. package/bundle/chunk-tv26mwx5.js +0 -2
  393. package/bundle/chunk-v69n6mef.js +0 -2
  394. package/bundle/chunk-vegwb3t0.js +0 -2
  395. package/bundle/chunk-w9seyn69.js +0 -2
  396. package/bundle/chunk-wanf4se3.js +0 -2
  397. package/bundle/chunk-wdhzmk1b.js +0 -2
  398. package/bundle/chunk-wnwesaap.js +0 -2
  399. package/bundle/chunk-wxqtda70.js +0 -2
  400. package/bundle/chunk-wzb6s9rk.js +0 -2
  401. package/bundle/chunk-x0dg9rg6.js +0 -2
  402. package/bundle/chunk-xmnzrzbs.js +0 -2
  403. package/bundle/chunk-xzf62kc6.js +0 -2
  404. package/bundle/chunk-yk8kk25c.js +0 -3
  405. package/bundle/chunk-yned6vmd.js +0 -3
  406. package/bundle/chunk-yra49yga.js +0 -2
  407. package/bundle/chunk-ytye0p7f.js +0 -2
  408. package/bundle/chunk-yv2mxxbq.js +0 -2
  409. package/bundle/chunk-z2fqqer0.js +0 -2
  410. package/bundle/chunk-z3qanc8m.js +0 -2
  411. package/bundle/chunk-z44m19vm.js +0 -2
  412. package/bundle/chunk-zcagdtab.js +0 -2
  413. package/bundle/chunk-zervk6c5.js +0 -2
  414. package/bundle/chunk-zqjp7jdd.js +0 -7
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{O as o}from"./chunk-6p7yg5sr.js";import{P as i}from"./chunk-scqxmv8k.js";import{Ed as p}from"./chunk-sbx9z70j.js";import{Rd as n}from"./chunk-yajd975f.js";import{Vf as B}from"./chunk-cjfgs1x8.js";import{ag as l}from"./chunk-5z7mjwwa.js";import"./chunk-z29fwg61.js";import"./chunk-b9hstp7h.js";import"./chunk-j0znryc6.js";import"./chunk-sbv96mj0.js";import"./chunk-nfg7nt13.js";import"./chunk-ps6jk326.js";import"./chunk-tsb9g1nz.js";import{hh as g}from"./chunk-m2ny1en7.js";import{Vh as d}from"./chunk-09j71kp6.js";import"./chunk-js9wdh67.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-8f0g7d7k.js";import"./chunk-abtn6nec.js";import{rl as f}from"./chunk-d7t0bcvk.js";import"./chunk-7mc8nxve.js";import"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import"./chunk-bn0h9dny.js";import"./chunk-q5363rr9.js";import"./chunk-7wthn44y.js";import"./chunk-a8p9aggx.js";import"./chunk-0xm85ayc.js";import{mo as D}from"./chunk-s2za1n7h.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-bsf6n350.js";import"./chunk-4vze3djr.js";import"./chunk-bzrsnv2k.js";import"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import"./chunk-1d9f53sk.js";import"./chunk-svrxk3vf.js";import"./chunk-kkae8ead.js";import"./chunk-s6me101a.js";import"./chunk-jwtev7b7.js";import"./chunk-b9nwaaqs.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-1rn0vmvv.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-4kpvceap.js";import{$s as x,Is as u,Ss as I}from"./chunk-94qmhz2p.js";import{tt as y}from"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import"./chunk-t299e2aw.js";import"./chunk-bv8pf0m1.js";import"./chunk-4mrz9b6d.js";import"./chunk-yjj4cvqg.js";import Q from"path";import{pathToFileURL as a}from"url";import{EOL as O}from"os";function $(j){let K=j.state;return{input:K.input,metadata:"metadata"in K?K.metadata:{},part:j}}function C(j){let K=j.description?B.Style.TEXT_DIM+` ${j.description}`+B.Style.TEXT_NORMAL:"";B.println(B.Style.TEXT_NORMAL+j.icon,B.Style.TEXT_NORMAL+j.title+K)}function b(j,K){if(B.empty(),C(j),!K?.trim())return;B.println(K),B.empty()}function c(j){let K=j.state,V="input"in K?K.input:void 0,Y=("title"in K&&K.title?K.title:void 0)||(V&&typeof V==="object"&&Object.keys(V).length>0?JSON.stringify(V):"Unknown");C({icon:"\u2699",title:`${j.tool} ${Y}`})}function t(j){let K=j.path??"",V=`${j.kind} "${j.pattern}"`,Y=K?`in ${T(K)}`:"",H=j.count===void 0?Y:`${Y}${Y?" \xB7 ":""}${j.count} ${j.count===1?"match":"matches"}`;C({icon:"\u2731",title:V,...H&&{description:H}})}function r(j){t({kind:"Glob",pattern:j.input.pattern,path:j.input.path,count:j.metadata.count})}function jj(j){t({kind:"Grep",pattern:j.input.pattern,path:j.input.path,count:j.metadata.matches})}function Bj(j){let K=T(j.input.filePath),V=Object.entries(j.input).filter(([H,S])=>{if(H==="filePath")return!1;return typeof S==="string"||typeof S==="number"||typeof S==="boolean"}),Y=V.length?`[${V.map(([H,S])=>`${H}=${S}`).join(", ")}]`:void 0;C({icon:"\u2192",title:`Read ${K}`,...Y&&{description:Y}})}function Gj(j){b({icon:"\u2190",title:`Write ${T(j.input.filePath)}`},j.part.state.status==="completed"?j.part.state.output:void 0)}function Jj(j){C({icon:"%",title:`WebFetch ${j.input.url}`})}function Kj(j){let K=T(j.input.filePath),V=j.metadata.diff;b({icon:"\u2190",title:`Edit ${K}`},V)}function Mj(j){C({icon:"\u25C7",title:`Exa Code Search "${j.input.query}"`})}function Nj(j){C({icon:"\u25C8",title:`Web Search "${j.input.query}"`})}function k(j){let K=j.part.state.input?.operation??j.part.state.input,V=j.part.state.status,Y=typeof K?.subagent_type==="string"&&K.subagent_type.trim().length>0?K.subagent_type:"unknown",H=u.titlecase(Y),S=typeof K?.description==="string"&&K.description.trim().length>0?K.description:void 0,w=V==="error"?"\u2717":V==="running"?"\u2022":"\u2713",L=S??`${H} Task`;C({icon:w,title:L,description:S?`${H} Agent`:void 0})}function Vj(j){C({icon:"\u2192",title:`Skill "${j.input.name}"`})}function Xj(j){let K=j.part.state.status==="completed"?j.part.state.output?.trim():void 0;b({icon:"$",title:`${j.input.command}`},K)}function T(j){if(!j)return"";if(Q.isAbsolute(j))return Q.relative(process.cwd(),j)||".";return j}var Tj=n({command:"run [message..]",describe:"run qitqode with a message",builder:(j)=>{return j.positional("message",{describe:"message to send",type:"string",array:!0,default:[]}).option("command",{describe:"the command to run, use message for args",type:"string"}).option("continue",{alias:["c"],describe:"continue the last session",type:"boolean"}).option("session",{alias:["s"],describe:"session id to continue",type:"string"}).option("fork",{describe:"fork the session before continuing (requires --continue or --session)",type:"boolean"}).option("share",{type:"boolean",describe:"share the session"}).option("model",{type:"string",alias:["m"],describe:"model to use in the format of provider/model"}).option("agent",{type:"string",describe:"agent to use"}).option("format",{type:"string",choices:["default","json"],default:"default",describe:"format: default (formatted) or json (raw JSON events)"}).option("file",{alias:["f"],type:"string",array:!0,describe:"file(s) to attach to message"}).option("title",{type:"string",describe:"title for the session (uses truncated prompt if no value provided)"}).option("attach",{type:"string",describe:"attach to a running qitqode server (e.g., http://localhost:4096)"}).option("password",{alias:["p"],type:"string",describe:"basic auth password (defaults to QITQODE_SERVER_PASSWORD)"}).option("dir",{type:"string",describe:"directory to run in, path on remote server if attaching"}).option("port",{type:"number",describe:"port for the local server (defaults to random port if no value provided)"}).option("variant",{type:"string",describe:"model variant (provider-specific reasoning effort, e.g., high, max, minimal)"}).option("thinking",{type:"boolean",describe:"show thinking blocks",default:!1}).option("dangerously-skip-permissions",{type:"boolean",describe:"auto-approve permissions that are not explicitly denied (dangerous!)",default:!1})},handler:async(j)=>{let K=[...j.message,...j["--"]||[]].join(" "),V=(()=>{if(!j.dir)return;if(j.attach)return j.dir;try{return process.chdir(j.dir),process.cwd()}catch{B.error("Failed to change directory to "+j.dir),process.exit(1)}})(),Y=[];if(j.file){let M=Array.isArray(j.file)?j.file:[j.file];for(let X of M){let N=Q.resolve(process.cwd(),X);if(!await y.exists(N))B.error(`File not found: ${X}`),process.exit(1);let W=await y.isDir(N)?"application/x-directory":"text/plain";Y.push({type:"file",url:a(N).href,filename:Q.basename(N),mime:W})}}if(!process.stdin.isTTY)K+=`
3
- `+await Bun.stdin.text();if(K.trim().length===0&&!j.command)B.error("You must provide a message or a command"),process.exit(1);if(j.fork&&!j.continue&&!j.session)B.error("--fork requires --continue or --session"),process.exit(1);let H=[{permission:"question",action:"deny",pattern:"*"},{permission:"plan_enter",action:"deny",pattern:"*"},{permission:"plan_exit",action:"deny",pattern:"*"}];function S(){if(j.title===void 0)return;if(j.title!=="")return j.title;return K.slice(0,50)+(K.length>50?"...":"")}async function w(M){let X=j.continue?(await M.session.list()).data?.find((Z)=>!Z.parentID)?.id:j.session;if(X&&j.fork)return(await M.session.fork({sessionID:X})).data?.id;if(X)return X;let N=S();return(await M.session.create({title:N,permission:H})).data?.id}async function L(M,X){let N=await M.config.get();if(!N.data)return;if(N.data.share!=="auto"&&!I.QITQODE_AUTO_SHARE&&!j.share)return;let W=await M.session.share({sessionID:X}).catch((Z)=>{if(Z instanceof Error&&Z.message.includes("disabled"))B.println(B.Style.TEXT_DANGER_BOLD+"! "+Z.message);return{error:Z}});if(!W.error&&"data"in W&&W.data?.share?.url)B.println(B.Style.TEXT_INFO_BOLD+"~ "+W.data.share.url)}async function h(M){function X(G){try{if(G.tool==="bash")return Xj($(G));if(G.tool==="glob")return r($(G));if(G.tool==="grep")return jj($(G));if(G.tool==="read")return Bj($(G));if(G.tool==="write")return Gj($(G));if(G.tool==="webfetch")return Jj($(G));if(G.tool==="edit")return Kj($(G));if(G.tool==="codesearch")return Mj($(G));if(G.tool==="websearch")return Nj($(G));if(G.tool==="actor")return k($(G));if(G.tool==="skill")return Vj($(G));return c(G)}catch{return c(G)}}function N(G,q){if(j.format==="json")return process.stdout.write(JSON.stringify({type:G,timestamp:Date.now(),sessionID:A,...q})+O),!0;return!1}let W=await M.event.subscribe(),Z;async function e(G){let q=new Map,z=x.create({service:"cli.run"}),E=W.stream[Symbol.asyncIterator](),F=G.completion.then(()=>"DONE");try{while(!0){let P=await Promise.race([E.next(),F]);if(P==="DONE")break;if(P.done)break;let _=P.value;if(G.onEvent(_),z.debug("event received",{type:_.type}),_.type==="message.updated"&&_.properties.info.role==="assistant"&&j.format!=="json"&&q.get("start")!==!0)B.empty(),B.println(`> ${_.properties.info.agent} \xB7 ${_.properties.info.modelID}`),B.empty(),q.set("start",!0);if(_.type==="message.part.updated"){let J=_.properties.part;if(J.sessionID!==A)continue;if(J.type==="tool"&&(J.state.status==="completed"||J.state.status==="error")){if(N("tool_use",{part:J}))continue;if(J.state.status==="completed"){X(J);continue}C({icon:"\u2717",title:`${J.tool} failed`}),B.error(J.state.error)}if(J.type==="tool"&&J.tool==="actor"&&J.state.status==="running"&&j.format!=="json"){if(q.get(J.id)===!0)continue;k($(J)),q.set(J.id,!0)}if(J.type==="step-start"){if(N("step_start",{part:J}))continue}if(J.type==="step-finish"){if(N("step_finish",{part:J}))continue}if(J.type==="text"&&J.time?.end){if(N("text",{part:J}))continue;let R=J.text.trim();if(!R)continue;if(!process.stdout.isTTY){process.stdout.write(R+O);continue}B.empty(),B.println(R),B.empty()}if(J.type==="reasoning"&&J.time?.end&&j.thinking){if(N("reasoning",{part:J}))continue;let R=J.text.trim();if(!R)continue;let U=`Thinking: ${R}`;if(process.stdout.isTTY){B.empty(),B.println(`${B.Style.TEXT_DIM}\x1B[3m${U}\x1B[0m${B.Style.TEXT_NORMAL}`),B.empty();continue}process.stdout.write(U+O)}}if(_.type==="session.error"){let J=_.properties;if(J.sessionID!==A||!J.error)continue;let R=String(J.error.name);if("data"in J.error&&J.error.data&&"message"in J.error.data)R=String(J.error.data.message);if(Z=Z?Z+O+R:R,N("error",{error:J.error}))continue;B.error(R)}if(_.type==="permission.asked"){let J=_.properties;if(J.sessionID!==A)continue;if(j["dangerously-skip-permissions"])await M.permission.reply({requestID:J.id,reply:"once"});else B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL+`permission requested: ${J.permission} (${J.patterns.join(", ")}); auto-rejecting`),await M.permission.reply({requestID:J.id,reply:"reject"})}}}finally{G.stop(),await E.return?.(void 0).catch(()=>{})}}let v=await(async()=>{if(!j.agent)return;let G=j.agent;if(j.attach){let z=await M.app.agents(void 0,{throwOnError:!0}).then((F)=>F.data??[]).catch(()=>{return});if(!z){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`failed to list agents from ${j.attach}. Falling back to default agent`);return}let E=z.find((F)=>F.name===G);if(!E){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`agent "${G}" not found. Falling back to default agent`);return}if(E.mode==="subagent"){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`agent "${G}" is a subagent, not a primary agent. Falling back to default agent`);return}return G}let q=await g.runPromise(d.Service.use((z)=>z.get(G)));if(!q){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`agent "${G}" not found. Falling back to default agent`);return}if(q.mode==="subagent"){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`agent "${G}" is a subagent, not a primary agent. Falling back to default agent`);return}return G})(),A=await w(M);if(!A)B.error("Session not found"),process.exit(1);await L(M,A);let s=x.create({service:"cli.run.poll"}),m=o({sessionID:A,query:async()=>{try{return(await M.session.status()).data?.[A]}catch(G){throw s.debug("session.status query failed",{error:G}),G}}});if(e(m).catch((G)=>{console.error(G),process.exit(1)}),j.command)await M.session.command({sessionID:A,agent:v,model:j.model,command:j.command,arguments:K,variant:j.variant});else{let G=j.model?f.parseModel(j.model):void 0;await M.session.prompt({sessionID:A,agent:v,model:G,variant:j.variant,parts:[...Y,{type:"text",text:K}]})}m.markStarted()}if(j.attach){let M=i({password:j.password}),X=D({baseUrl:j.attach,directory:V,headers:M});return await h(X)}await p(process.cwd(),async()=>{let X=D({baseUrl:"http://qitqode.internal",fetch:async(N,W)=>{let Z=new Request(N,W);return l.Default().app.fetch(Z)}});await h(X)})}});export{Tj as RunCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{a,b,c,d,e,f,g}from"./chunk-11d987sj.js";import"./chunk-2ztdqtnk.js";import"./chunk-bx6kyvg7.js";import"./chunk-0yqbyres.js";import"./chunk-s6bar2f9.js";import"./chunk-2p9py4rw.js";import"./chunk-n3t52cz2.js";import"./chunk-yajd975f.js";import"./chunk-cjfgs1x8.js";import"./chunk-j0znryc6.js";import"./chunk-m2ny1en7.js";import"./chunk-09j71kp6.js";import"./chunk-js9wdh67.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-8f0g7d7k.js";import"./chunk-abtn6nec.js";import"./chunk-d7t0bcvk.js";import"./chunk-7mc8nxve.js";import"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import"./chunk-bn0h9dny.js";import"./chunk-q5363rr9.js";import"./chunk-7wthn44y.js";import"./chunk-a8p9aggx.js";import"./chunk-0xm85ayc.js";import"./chunk-s2za1n7h.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-bsf6n350.js";import"./chunk-4vze3djr.js";import"./chunk-bzrsnv2k.js";import"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import"./chunk-1d9f53sk.js";import"./chunk-svrxk3vf.js";import"./chunk-kkae8ead.js";import"./chunk-s6me101a.js";import"./chunk-jwtev7b7.js";import"./chunk-b9nwaaqs.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-1rn0vmvv.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-4kpvceap.js";import"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import"./chunk-t299e2aw.js";import"./chunk-bv8pf0m1.js";import"./chunk-4mrz9b6d.js";import"./chunk-yjj4cvqg.js";export{f as statusEffect,a as resolveApiKeyFlag,e as logoutEffect,d as loginEffect,c as interactiveLogin,b as apiKeyLoginEffect,g as AuthCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Vd as a,Wd as b}from"./chunk-fj7kd4gc.js";import"./chunk-ekndhwnn.js";import"./chunk-sv48x9h8.js";import"./chunk-yp3dj4wh.js";import"./chunk-yjj4cvqg.js";export{a as fromWebToken,b as fromTokenFile};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-yjj4cvqg.js";var t="./injections-73j83es3.scm";export{t as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-yjj4cvqg.js";var l="./tree-sitter-javascript-nd0q4pe9.wasm";export{l as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{h as T}from"./chunk-2ztdqtnk.js";import{F as K,G as O,H as Z}from"./chunk-0yqbyres.js";import"./chunk-s6bar2f9.js";import{Rd as V}from"./chunk-yajd975f.js";import{Vf as j}from"./chunk-cjfgs1x8.js";import{Cg as H,zg as G}from"./chunk-j0znryc6.js";import{hh as X}from"./chunk-m2ny1en7.js";import"./chunk-09j71kp6.js";import"./chunk-js9wdh67.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-8f0g7d7k.js";import"./chunk-abtn6nec.js";import"./chunk-d7t0bcvk.js";import"./chunk-7mc8nxve.js";import"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import"./chunk-bn0h9dny.js";import"./chunk-q5363rr9.js";import"./chunk-7wthn44y.js";import"./chunk-a8p9aggx.js";import"./chunk-0xm85ayc.js";import{ko as $,po as F}from"./chunk-s2za1n7h.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-bsf6n350.js";import"./chunk-4vze3djr.js";import"./chunk-bzrsnv2k.js";import"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import"./chunk-1d9f53sk.js";import"./chunk-svrxk3vf.js";import"./chunk-kkae8ead.js";import"./chunk-s6me101a.js";import"./chunk-jwtev7b7.js";import"./chunk-b9nwaaqs.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-1rn0vmvv.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-4kpvceap.js";import"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import{qH as z}from"./chunk-t299e2aw.js";import"./chunk-bv8pf0m1.js";import"./chunk-4mrz9b6d.js";import"./chunk-yjj4cvqg.js";var A="forgewise";function B(D){return z.gen(function*(){let J=yield*D.get(A);if(!J||J.type!=="api")return;return(J.metadata??{}).sub})}var W=()=>z.gen(function*(){if((yield*T())==="revoked")return null;let D=yield*z.promise(()=>F());if(!D)return yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+"Not signed in to Forgewise. Run `qitqode auth login` first."+j.Style.TEXT_NORMAL)),null;let J=yield*$.Service,M=D.method==="sso"?yield*B(J):void 0;return{...yield*H(D),sub:M}}),Q=()=>z.gen(function*(){let D=yield*W();if(!D)return;let J=yield*z.tryPromise({try:()=>G(D),catch:()=>null}).pipe(z.orElseSucceed(()=>null));if(!J){yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+"Could not fetch balance."+j.Style.TEXT_NORMAL));return}yield*z.sync(()=>j.println(j.Style.TEXT_SUCCESS+"Qredits balance: "+j.Style.TEXT_NORMAL+j.Style.TEXT_HIGHLIGHT_BOLD+Z(J.balance)+j.Style.TEXT_NORMAL))}).pipe(z.withSpan("qredits.balance")),b=()=>z.gen(function*(){let D=yield*W();if(!D)return;let J=D.method==="sso"&&D.sub?{userId:D.sub,accessToken:D.key}:{},M=yield*z.tryPromise({try:()=>O({...J,limit:20}),catch:(L)=>L});if(M instanceof Error){let L=M instanceof K?M.message:String(M);yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+"Could not fetch history: "+L+j.Style.TEXT_NORMAL));return}if(M.length===0){yield*z.sync(()=>j.println("No spend history yet."));return}let P=j.Style.TEXT_DIM,N=j.Style.TEXT_NORMAL,Y=j.Style.TEXT_DANGER;yield*z.sync(()=>{j.println(P+" Date Description Amount"+N),j.println(P+" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500"+N);for(let L of M){let _=(L.date||"").slice(0,10).padEnd(18),v=(L.description||"").slice(0,32).padEnd(32),x=(L.amount<0?"-":" ")+Z(Math.abs(L.amount)),w=L.amount<0?Y:N;j.println(` ${P}${_}${N} ${v} ${w}${x}${N}`)}})}).pipe(z.withSpan("qredits.history")),U=V({command:"qredits <command>",describe:"Check Qredits balance and spend history",builder:(D)=>D.command(V({command:"balance",describe:"Show current Qredits balance",builder:(J)=>J,async handler(){j.empty(),await X.runPromise(Q())}})).command(V({command:"history",describe:"Show recent Qredit spend history",builder:(J)=>J,async handler(){j.empty(),await X.runPromise(b())}})).demandCommand(),async handler(){}});export{b as historyEffect,Q as balanceEffect,U as QreditsCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-yjj4cvqg.js";var G="./tree-sitter-bash-hq5s6fxb.wasm";export{G as default};
@@ -1,9 +0,0 @@
1
- // @bun
2
- import{bi as P}from"./chunk-js9wdh67.js";import{ko as o,uo as k,yo as u}from"./chunk-s2za1n7h.js";import{$s as L,Ss as t}from"./chunk-94qmhz2p.js";import{qH as j}from"./chunk-t299e2aw.js";class Q extends Error{cause;constructor(J,Z){super(J);this.name="ForgewiseError",this.cause=Z}}class K extends Q{constructor(J="Device flow is not supported by this issuer."){super(J);this.name="DeviceFlowUnsupportedError"}}var e=L.create({service:"forgewise.config"}),J1="https://accounts.forgewise.tech",Z1="forgewise-cli",b=!1,$1={defaultFallbacks:0};function D(...J){return J.find((Z)=>Z!==void 0&&Z.trim().length>0)}function X1(){return!!process.env.REPLIT_DEV_DOMAIN}async function H(){let J=process.env.ACCOUNTS_ISSUER,Z=process.env.FORGEWISE_CLIENT_ID;if(J&&Z)return{issuer:J.replace(/\/+$/,""),clientId:Z};let $,X;try{$=await k()}catch(N){$=void 0,X=N}let Y=D(J,$?.issuer,J1).replace(/\/+$/,""),V=D(Z,$?.clientId,Z1),x=D(J,$?.issuer)===void 0,G=D(Z,$?.clientId)===void 0;if((x||G)&&!b)b=!0,$1.defaultFallbacks++,e.warn("remote Forgewise coordinate lookup unavailable; falling back to baked-in defaults",{issuer:Y,clientId:V,usedDefaultIssuer:x,usedDefaultClientId:G,remoteError:X instanceof Error?X.message:X?String(X):void 0});return{issuer:Y,clientId:V}}function C(J,Z,$){if(J>=200&&J<300)return{kind:"success"};let X=Z?.error??"";if(X==="authorization_pending")return{kind:"wait",intervalMs:$};if(X==="slow_down")return{kind:"wait",intervalMs:$+5000};if(X==="access_denied")return{kind:"fatal",message:"Sign-in was denied in the browser."};if(X==="expired_token")return{kind:"fatal",message:"The sign-in code expired before it was approved. Try again."};return{kind:"fatal",message:`Device sign-in failed: ${Z?.error_description||X||`HTTP ${J}`}`}}import v from"http";var g="/callback",E=[51737,51738],_=new Set;function h(J){return J.replace(/[&<>\"']/g,(Z)=>{switch(Z){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return"&#39;"}})}function R(J){return`http://127.0.0.1:${J}${g}`}async function V1(J){return new Promise((Z,$)=>{let X=v.createServer();X.listen(J,"127.0.0.1",()=>{X.close(()=>Z(J))}),X.on("error",$)})}async function d(){for(let J of E){if(_.has(J))continue;_.add(J);try{return await V1(J)}catch{_.delete(J)}}throw new Q(`Could not bind to any loopback port (tried ${E.join(", ")}). Free one of those ports and retry.`)}function m(J,Z,$,X){return new Promise((Y,V)=>{let x=()=>_.delete(J),G=v.createServer((q,W)=>{try{let z=new URL(q.url??"/",`http://localhost:${J}`);if(z.pathname!==g){W.writeHead(404),W.end();return}let B=z.searchParams.get("code"),M=z.searchParams.get("state"),O=z.searchParams.get("error"),U=z.searchParams.get("error_description");if(O){let r=`${h(O)}${U?": "+h(U):""}`;W.writeHead(200,{"Content-Type":"text/html"}),W.end(`<html><body style="font-family:sans-serif;padding:2rem"><h2>Authorization failed</h2><p>${r}</p><p>You can close this tab.</p></body></html>`),G.close(),V(new Q(`Authorization error: ${O}${U?" \u2014 "+U:""}`));return}if(!B||M!==Z){W.writeHead(400),W.end("Invalid request");return}W.writeHead(200,{"Content-Type":"text/html"}),W.end('<html><body style="font-family:sans-serif;padding:2rem"><h2>Signed in! You can close this tab.</h2><p>Return to your terminal to continue.</p></body></html>'),G.close(),Y({code:B})}catch(z){G.close(),V(z)}});if($?.aborted){x(),V(new Q("Login cancelled"));return}let N=()=>{x(),G.close(()=>V(new Q("Login cancelled")))};if($?.addEventListener("abort",N,{once:!0}),$?.aborted){N();return}G.listen(J,"127.0.0.1",()=>{x(),X?.()}),G.on("error",(q)=>{x(),V(q)})})}function p(J,Z){return new Promise(($,X)=>{if(Z?.aborted){X(new Q("Login cancelled"));return}let Y,V=()=>{clearTimeout(Y),Z?.removeEventListener("abort",V),X(new Q("Login cancelled"))};if(Y=setTimeout(()=>{Z?.removeEventListener("abort",V),$()},J),Z?.addEventListener("abort",V,{once:!0}),Z?.aborted)V()})}function T(J,Z=300000){if(!J)return!1;return Date.now()>=J-Z}async function Y1(J){let{issuer:Z}=await H();return u({issuer:Z,...J.accessToken?{accessToken:J.accessToken}:{}})}import F from"crypto";var c="openid profile email",w=(J)=>J.toString("base64url");function i(){let J=w(F.randomBytes(32)),Z=w(F.createHash("sha256").update(J).digest()),$=w(F.randomBytes(16));return{verifier:J,challenge:Z,state:$}}function l(J){let Z=new URL(`${J.issuer}/api/oauth/authorize`);return Z.searchParams.set("response_type","code"),Z.searchParams.set("client_id",J.clientId),Z.searchParams.set("redirect_uri",J.redirectUri),Z.searchParams.set("scope",c),Z.searchParams.set("state",J.state),Z.searchParams.set("code_challenge",J.challenge),Z.searchParams.set("code_challenge_method","S256"),Z.toString()}async function A(J,Z){let $=await fetch(`${J}/api/oauth/userinfo`,{headers:{Authorization:`Bearer ${Z.access_token}`}});if(!$.ok)throw new Q(`Failed to fetch user profile (${$.status})`);let X=await $.json();if(!X.sub)throw new Q("Userinfo response is missing required 'sub' field \u2014 the server returned an invalid user profile.");return{sub:X.sub,name:X.name??"",email:X.email??"",access_token:Z.access_token,expires_at:Date.now()+(Z.expires_in??3600)*1000,...Z.refresh_token?{refresh_token:Z.refresh_token}:{}}}async function y(J){let Z=await fetch(`${J.issuer}/api/oauth/token`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:J.code,redirect_uri:J.redirectUri,client_id:J.clientId,code_verifier:J.verifier}).toString(),signal:J.signal??null});if(!Z.ok){let X=await Z.text().catch(()=>"");throw new Q(`Token exchange failed (${Z.status}): ${X}`)}let $=await Z.json();return A(J.issuer,$)}async function x1(J,Z,$=5000){let X=new AbortController,Y=setTimeout(()=>X.abort(),$);try{let V=await fetch(`${J}/api/oauth/userinfo`,{headers:{Authorization:`Bearer ${Z}`},signal:X.signal});if(V.status===401||V.status===403)return!1;if(!V.ok)return null;return!0}catch{return null}finally{clearTimeout(Y)}}async function f(J){let{issuer:Z,clientId:$}=await H(),X;try{X=await fetch(`${Z}/api/oauth/token`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",client_id:$,refresh_token:J}).toString()})}catch(V){throw new Q(`Could not reach the sign-in server to refresh the session: ${V instanceof Error?V.message:String(V)}`,V)}if(!X.ok){let V=await X.json().catch(()=>{return});if(V?.error==="invalid_grant")return"invalid_grant";throw new Q(`Token refresh failed (${X.status}): ${V?.error??""}`)}let Y=await X.json();return A(Z,Y)}async function a(J){let Z;try{Z=await fetch(`${J.issuer}/api/oauth/device_authorization`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:J.clientId,scope:c}).toString(),signal:J.signal??null})}catch{if(J.signal?.aborted)throw new Q("Login cancelled");throw new K}if(Z.status===404||Z.status===405||Z.status===501)throw new K;if(!Z.ok){let X=await Z.text().catch(()=>"");throw new Q(`Device authorization failed (${Z.status}): ${X}`)}let $;try{$=await Z.json()}catch{throw new K}if(!$.device_code||!$.user_code||!$.verification_uri)throw new K;return{deviceCode:$.device_code,info:{userCode:$.user_code,verificationUri:$.verification_uri,verificationUriComplete:$.verification_uri_complete,expiresAt:Date.now()+($.expires_in??900)*1000},intervalMs:Math.max(1,$.interval??5)*1000}}async function n(J){let Z;try{Z=await fetch(`${J.issuer}/api/oauth/token`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:J.deviceCode,client_id:J.clientId}).toString(),signal:J.signal??null})}catch{if(J.signal?.aborted)throw new Q("Login cancelled");return{kind:"wait",intervalMs:J.currentIntervalMs}}let $;try{$=await Z.json()}catch{$=void 0}let X=C(Z.status,$,J.currentIntervalMs);if(X.kind==="success"){if(!$?.access_token)throw new Q("Token endpoint returned success without an access_token.");return{kind:"success",profile:await A(J.issuer,{access_token:$.access_token,expires_in:$.expires_in})}}if(X.kind==="fatal")throw new Q(X.message);return{kind:"wait",intervalMs:X.intervalMs}}var I="forgewise",G1=()=>j.gen(function*(){let J=yield*o.Service,Z=yield*J.get(I);if(!Z||Z.type!=="api")return;let $=Z.metadata??{},X=$.access_token;if(!X)return;let Y=Number($.access_token_expires_at??0);if(!T(Y))return X;let V=$.refresh_token;if(!V)return;let x=yield*j.promise(()=>f(V).catch(()=>null));if(!x||x==="invalid_grant")return;let G=yield*J.get(I);if(!G||G.type!=="api"||G.key!==Z.key)return x.access_token;let N={...G,metadata:{...G.metadata??{},access_token:x.access_token,access_token_expires_at:String(x.expires_at),...x.refresh_token?{refresh_token:x.refresh_token}:{}}};return yield*j.orElseSucceed(J.set(I,N),()=>{return}),x.access_token}),Q1=(J)=>j.gen(function*(){if(J.method==="sso")return{key:J.key,method:"sso",accessToken:J.key};let Z=yield*G1();return{key:J.key,method:"api-key",accessToken:Z}});var W1=300000;async function s(){let{issuer:J,clientId:Z}=await H(),{verifier:$,challenge:X,state:Y}=i(),V=await d(),x=R(V),G=l({issuer:J,clientId:Z,redirectUri:x,challenge:X,state:Y});return{issuer:J,clientId:Z,verifier:$,port:V,redirectUri:x,authorizeStr:G,state:Y}}async function z1(J){let{issuer:Z,clientId:$}=await H(),{deviceCode:X,info:Y,intervalMs:V}=await a({issuer:Z,clientId:$,signal:J.signal});if(J.onCode(Y),J.tryOpen){let G=Y.verificationUriComplete??Y.verificationUri;P(G)}let x=V;while(Date.now()<Y.expiresAt){await p(x,J.signal);let G=await n({issuer:Z,clientId:$,deviceCode:X,currentIntervalMs:x,signal:J.signal});if(G.kind==="success")return G.profile;x=G.intervalMs}throw new Q("The sign-in code expired before it was approved. Try again.")}async function N1(){let{issuer:J,clientId:Z,verifier:$,port:X,redirectUri:Y,authorizeStr:V,state:x}=await s();process.stdout.write(`
3
- `),process.stdout.write(` Opening Forgewise sign-in in your browser...
4
- `),process.stdout.write(" Sign-in URL: "+V+`
5
- `),process.stdout.write(`
6
- `),process.stdout.write(` Waiting for the browser to complete sign-in... (ctrl+c to cancel)
7
- `);let{code:G}=await m(X,x,void 0,()=>{P(V)});return process.stdout.write(`
8
- Exchanging authorization code...
9
- `),y({issuer:J,clientId:Z,code:G,redirectUri:Y,verifier:$})}async function q1(J={}){if(J.signal?.aborted)throw new Q("Login cancelled");let{issuer:Z,clientId:$,verifier:X,port:Y,redirectUri:V,authorizeStr:x,state:G}=await s(),N=()=>{if(J.onUrl?.(x),J.tryOpen!==!1)P(x)},q=new AbortController,W=()=>q.abort();J.signal?.addEventListener("abort",W,{once:!0});let z=!1,B=setTimeout(()=>{z=!0,q.abort()},W1);try{let{code:M}=await m(Y,G,q.signal,N);return await y({issuer:Z,clientId:$,code:M,redirectUri:V,verifier:X,signal:q.signal})}catch(M){if(z)throw new Q("Sign-in timed out. Run login again to retry.");throw M}finally{clearTimeout(B),J.signal?.removeEventListener("abort",W)}}var S=L.create({service:"auth.forgewise.checkout"}),K1="qitqode",H1=5000;async function M1(J){let $=`${new URL(t.QITQODE_BACKEND_URL).origin}/auth/keys/checkout`;try{let X=await fetch($,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${J}`},body:JSON.stringify({app:K1}),signal:AbortSignal.timeout(H1)});if(!X.ok)return S.warn("API key checkout returned non-200; falling back to Bearer credential",{status:X.status,url:$}),null;let Y=await X.json();if(typeof Y?.key!=="string"||!Y.key)return S.warn("API key checkout response missing key field; falling back to Bearer credential",{url:$}),null;return S.info("API key checkout succeeded; credential upgraded to api-key method",{url:$}),Y.key}catch(X){return S.warn("API key checkout failed; falling back to Bearer credential",{url:$,error:X instanceof Error?X.message:String(X)}),null}}export{Q as sg,K as tg,X1 as ug,H as vg,C as wg,R as xg,T as yg,Y1 as zg,x1 as Ag,f as Bg,Q1 as Cg,z1 as Dg,N1 as Eg,q1 as Fg,M1 as Gg};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Hf as a}from"./chunk-zasd8cz8.js";import"./chunk-z160s5p5.js";import"./chunk-yjj4cvqg.js";export default a();
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ed as s}from"./chunk-sbx9z70j.js";import{Rd as r}from"./chunk-yajd975f.js";import{hh as i}from"./chunk-m2ny1en7.js";import{Uh as z,Vh as B,jh as u,kh as g,oh as q}from"./chunk-09j71kp6.js";import"./chunk-js9wdh67.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-8f0g7d7k.js";import"./chunk-abtn6nec.js";import{Cl as K,Dl as J,Xk as f,lk as G,mk as V,pk as S,rl as x,xk as $}from"./chunk-d7t0bcvk.js";import"./chunk-7mc8nxve.js";import{jm as R,lm as p}from"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import"./chunk-bn0h9dny.js";import"./chunk-q5363rr9.js";import"./chunk-7wthn44y.js";import"./chunk-a8p9aggx.js";import"./chunk-0xm85ayc.js";import"./chunk-s2za1n7h.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-bsf6n350.js";import"./chunk-4vze3djr.js";import"./chunk-bzrsnv2k.js";import"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import"./chunk-1d9f53sk.js";import"./chunk-svrxk3vf.js";import"./chunk-kkae8ead.js";import"./chunk-s6me101a.js";import"./chunk-jwtev7b7.js";import"./chunk-b9nwaaqs.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-1rn0vmvv.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-4kpvceap.js";import{$s as w,Rs as U}from"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import{RN as A,qH as c}from"./chunk-t299e2aw.js";import"./chunk-bv8pf0m1.js";import"./chunk-4mrz9b6d.js";import{HO as v,IO as P}from"./chunk-yjj4cvqg.js";import{EOL as X}from"os";var k=r({command:"config",describe:"show resolved configuration",builder:(e)=>e,async handler(){await s(process.cwd(),async()=>{let e=await i.runPromise(J.Service.use((o)=>o.get()));process.stdout.write(JSON.stringify(e,null,2)+X)})}});import{EOL as y}from"os";var Y=r({command:"search <query>",describe:"search files by query",builder:(e)=>e.positional("query",{type:"string",demandOption:!0,description:"Search query"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(g.Service.use((t)=>t.search({query:e.query})));process.stdout.write(o.join(y)+y)})}}),Z=r({command:"read <path>",describe:"read file contents as JSON",builder:(e)=>e.positional("path",{type:"string",demandOption:!0,description:"File path to read"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(g.Service.use((t)=>t.read(e.path)));process.stdout.write(JSON.stringify(o,null,2)+y)})}}),H=r({command:"status",describe:"show file status information",builder:(e)=>e,async handler(){await s(process.cwd(),async()=>{let e=await i.runPromise(g.Service.use((o)=>o.status()));process.stdout.write(JSON.stringify(e,null,2)+y)})}}),ee=r({command:"list <path>",describe:"list files in a directory",builder:(e)=>e.positional("path",{type:"string",demandOption:!0,description:"File path to list"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(g.Service.use((t)=>t.list(e.path)));process.stdout.write(JSON.stringify(o,null,2)+y)})}}),oe=r({command:"tree [dir]",describe:"show directory tree",builder:(e)=>e.positional("dir",{type:"string",description:"Directory to tree",default:process.cwd()}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(u.Service.use((t)=>t.tree({cwd:e.dir,limit:200})));console.log(JSON.stringify(o,null,2))})}}),L=r({command:"file",describe:"file system debugging utilities",builder:(e)=>e.command(Z).command(H).command(ee).command(Y).command(oe).demandCommand(),async handler(){}});import{EOL as D}from"os";var E=r({command:"lsp",describe:"LSP debugging utilities",builder:(e)=>e.command(te).command(re).command(ie).demandCommand(),async handler(){}}),te=r({command:"diagnostics <file>",describe:"get diagnostics for a file",builder:(e)=>e.positional("file",{type:"string",demandOption:!0}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(S.Service.use((t)=>c.gen(function*(){return yield*t.touchFile(e.file,!0),yield*c.sleep(1000),yield*t.diagnostics()})));process.stdout.write(JSON.stringify(o,null,2)+D)})}}),re=r({command:"symbols <query>",describe:"search workspace symbols",builder:(e)=>e.positional("query",{type:"string",demandOption:!0}),async handler(e){await s(process.cwd(),async()=>{let n=[];try{const o=v(n,w.Default.time("symbols"),0);let t=await i.runPromise(S.Service.use((d)=>d.workspaceSymbol(e.query)));process.stdout.write(JSON.stringify(t,null,2)+D)}catch(a){var m=a,l=1}finally{P(n,m,l)}})}}),ie=r({command:"document-symbols <uri>",describe:"get symbols from a document",builder:(e)=>e.positional("uri",{type:"string",demandOption:!0}),async handler(e){await s(process.cwd(),async()=>{let n=[];try{const o=v(n,w.Default.time("document-symbols"),0);let t=await i.runPromise(S.Service.use((d)=>d.documentSymbol(e.uri)));process.stdout.write(JSON.stringify(t,null,2)+D)}catch(a){var m=a,l=1}finally{P(n,m,l)}})}});import{EOL as C}from"os";var F=r({command:"rg",describe:"ripgrep debugging utilities",builder:(e)=>e.command(se).command(ne).command(ae).demandCommand(),async handler(){}}),se=r({command:"tree",describe:"show file tree using ripgrep",builder:(e)=>e.option("limit",{type:"number"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(u.Service.use((t)=>t.tree({cwd:p.directory,limit:e.limit})));process.stdout.write(o+C)})}}),ne=r({command:"files",describe:"list files using ripgrep",builder:(e)=>e.option("query",{type:"string",description:"Filter files by query"}).option("glob",{type:"string",description:"Glob pattern to match files"}).option("limit",{type:"number",description:"Limit number of results"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(c.gen(function*(){return yield*(yield*u.Service).files({cwd:p.directory,glob:e.glob?[e.glob]:void 0}).pipe(A.take(e.limit??1/0),A.runCollect,c.map((n)=>[...n]))}));process.stdout.write(o.join(C)+C)})}}),ae=r({command:"search <pattern>",describe:"search file contents using ripgrep",builder:(e)=>e.positional("pattern",{type:"string",demandOption:!0,description:"Search pattern"}).option("glob",{type:"array",description:"File glob patterns"}).option("limit",{type:"number",description:"Limit number of results"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(u.Service.use((t)=>t.search({cwd:p.directory,pattern:e.pattern,glob:e.glob,limit:e.limit})));process.stdout.write(JSON.stringify(o.items,null,2)+C)})}});import{EOL as me}from"os";var T=r({command:"scrap",describe:"list all known projects",builder:(e)=>e,async handler(){let e=w.Default.time("scrap"),o=await R.list();process.stdout.write(JSON.stringify(o,null,2)+me),e.stop()}});import{EOL as ce}from"os";var j=r({command:"skill",describe:"list all available skills",builder:(e)=>e,async handler(){await s(process.cwd(),async()=>{let e=await i.runPromise(c.gen(function*(){return yield*(yield*q.Service).all()}));process.stdout.write(JSON.stringify(e,null,2)+ce)})}});var M=r({command:"snapshot",describe:"snapshot debugging utilities",builder:(e)=>e.command(de).command(le).command(pe).demandCommand(),async handler(){}}),I=(e)=>s(process.cwd(),async()=>{console.log(await i.runPromise($.Service.use(e)))}),_=(e)=>e.positional("hash",{type:"string",description:"hash",demandOption:!0}),de=r({command:"track",describe:"track current snapshot state",async handler(){await I((e)=>e.track())}}),le=r({command:"patch <hash>",describe:"show patch for a snapshot hash",builder:_,async handler(e){await I((o)=>o.patch(e.hash))}}),pe=r({command:"diff <hash>",describe:"show diff for a snapshot hash",builder:_,async handler(e){await I((o)=>o.diff(e.hash))}});import{EOL as b}from"os";import{basename as ue}from"path";var Q=r({command:"agent <name>",describe:"show agent configuration details",builder:(e)=>e.positional("name",{type:"string",demandOption:!0,description:"Agent name"}).option("tool",{type:"string",description:"Tool id to execute"}).option("params",{type:"string",description:"Tool params as a JSON object"}),async handler(e){await s(process.cwd(),async()=>{let o=e.name,t=await i.runPromise(B.Service.use((d)=>d.get(o)));if(!t)process.stderr.write(`Agent ${o} not found, run '${ue(process.execPath)} agent list' to get an agent list`+b),process.exit(1);let n=await fe(t),a=await ye(t,n),m=e.tool;if(m){let d=n.find((W)=>W.id===m);if(!d)process.stderr.write(`Tool ${m} not found for agent ${o}`+b),process.exit(1);if(a[m]===!1)process.stderr.write(`Tool ${m} is disabled for agent ${o}`+b),process.exit(1);let h=ge(e.params),O=await we(t),N=await d.execute(h,O);process.stdout.write(JSON.stringify({tool:m,input:h,result:N},null,2)+b);return}let l={...t,tools:a};process.stdout.write(JSON.stringify(l,null,2)+b)})}});async function fe(e){return i.runPromise(c.gen(function*(){let o=yield*x.Service,t=yield*z.Service,n=e.model??(yield*o.defaultModel());return yield*t.tools({...n,agent:e})}))}async function ye(e,o){let t=f.disabled(o.map((a)=>a.id),e.permission),n={};for(let a of o)n[a.id]=!t.has(a.id);return n}function ge(e){if(!e)return{};let o=e.trim();if(o.length===0)return{};let t=(()=>{try{return JSON.parse(o)}catch{throw Error("Failed to parse --params. Provide a valid JSON object.")}})();if(!t||typeof t!=="object"||Array.isArray(t))throw Error("Tool params must be an object.");return t}async function we(e){let{session:o,messageID:t}=await i.runPromise(c.gen(function*(){let a=yield*K.Service,m=yield*a.create({title:`Debug tool run (${e.name})`}),l=G.ascending(),d=e.model?e.model:yield*c.gen(function*(){return yield*(yield*x.Service).defaultModel()}),h=Date.now(),O={id:l,sessionID:m.id,role:"assistant",time:{created:h},parentID:l,modelID:d.modelID,providerID:d.providerID,mode:"debug",agent:e.name,path:{cwd:p.directory,root:p.worktree},cost:0,tokens:{input:0,output:0,reasoning:0,cache:{read:0,write:0}}};return yield*a.updateMessage(O),{session:m,messageID:l}})),n=f.merge(e.permission,o.permission??[]);return{sessionID:o.id,messageID:t,callID:V.ascending(),agent:e.name,abort:new AbortController().signal,messages:[],metadata:()=>c.void,ask(a){return c.sync(()=>{for(let m of a.patterns)if(f.evaluate(a.permission,m,n).action==="deny")throw new f.DeniedError({ruleset:n})})}}}var jo=r({command:"debug",describe:"debugging and troubleshooting tools",builder:(e)=>e.command(k).command(E).command(F).command(L).command(T).command(j).command(M).command(Q).command(be).command({command:"wait",describe:"wait indefinitely (for debugging)",async handler(){await s(process.cwd(),async()=>{await new Promise((o)=>setTimeout(o,86400000))})}}).demandCommand(),async handler(){}}),be=r({command:"paths",describe:"show global paths (data, config, cache, state)",handler(){for(let[e,o]of Object.entries(U.Path))console.log(e.padEnd(10),o)}});export{jo as DebugCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-yjj4cvqg.js";var h="./tree-sitter-typescript-zxjzwt75.wasm";export{h as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{gh as a,hh as b}from"./chunk-m2ny1en7.js";import"./chunk-09j71kp6.js";import"./chunk-js9wdh67.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-8f0g7d7k.js";import"./chunk-abtn6nec.js";import"./chunk-d7t0bcvk.js";import"./chunk-7mc8nxve.js";import"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import"./chunk-bn0h9dny.js";import"./chunk-q5363rr9.js";import"./chunk-7wthn44y.js";import"./chunk-a8p9aggx.js";import"./chunk-0xm85ayc.js";import"./chunk-s2za1n7h.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-bsf6n350.js";import"./chunk-4vze3djr.js";import"./chunk-bzrsnv2k.js";import"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import"./chunk-1d9f53sk.js";import"./chunk-svrxk3vf.js";import"./chunk-kkae8ead.js";import"./chunk-s6me101a.js";import"./chunk-jwtev7b7.js";import"./chunk-b9nwaaqs.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-1rn0vmvv.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-4kpvceap.js";import"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import"./chunk-t299e2aw.js";import"./chunk-bv8pf0m1.js";import"./chunk-4mrz9b6d.js";import"./chunk-yjj4cvqg.js";export{b as AppRuntime,a as AppLayer};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Jg as r}from"./chunk-ps6jk326.js";import{GO as o}from"./chunk-yjj4cvqg.js";var c=new r("zod v4");async function m(){return async(n,e)=>{let t;if("_zod"in n)try{t=(await import("./chunk-pycjksh4.js")).toJSONSchema}catch{throw c}else try{t=(await import("./chunk-98vfbn0h.js")).zodToJsonSchema}catch{throw new r("zod-to-json-schema")}return t(n,e)}}export{m as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{i as P,j as g,k as b,l as h,m as O}from"./chunk-bx6kyvg7.js";import"./chunk-2p9py4rw.js";import"./chunk-n3t52cz2.js";import{Rd as u}from"./chunk-yajd975f.js";import{Vf as s}from"./chunk-cjfgs1x8.js";import{hh as f}from"./chunk-m2ny1en7.js";import"./chunk-09j71kp6.js";import{bi as E}from"./chunk-js9wdh67.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-8f0g7d7k.js";import"./chunk-abtn6nec.js";import{$j as p,_j as S}from"./chunk-d7t0bcvk.js";import"./chunk-7mc8nxve.js";import"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import"./chunk-bn0h9dny.js";import"./chunk-q5363rr9.js";import"./chunk-7wthn44y.js";import"./chunk-a8p9aggx.js";import"./chunk-0xm85ayc.js";import"./chunk-s2za1n7h.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-bsf6n350.js";import"./chunk-4vze3djr.js";import"./chunk-bzrsnv2k.js";import"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import"./chunk-1d9f53sk.js";import"./chunk-svrxk3vf.js";import"./chunk-kkae8ead.js";import"./chunk-s6me101a.js";import"./chunk-jwtev7b7.js";import"./chunk-b9nwaaqs.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-1rn0vmvv.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-4kpvceap.js";import"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import{_y as I}from"./chunk-yvqbewmc.js";import{MC as D,qH as l,vB as d}from"./chunk-t299e2aw.js";import"./chunk-bv8pf0m1.js";import"./chunk-4mrz9b6d.js";import"./chunk-yjj4cvqg.js";var A=(o)=>l.promise(()=>E(o)),m=(o)=>l.sync(()=>s.println(o)),v=(o)=>s.Style.TEXT_DIM+o+s.Style.TEXT_NORMAL,L=(o)=>o?v(" (active)"):"",w=(o,e)=>`${o.email} ${v(o.url)}${L(e)}`,x=(o,e,t)=>`${e.name} (${o.email})${L(t)}`,C=(o,e,t)=>{let n=t?s.Style.TEXT_SUCCESS+"\u25CF"+s.Style.TEXT_NORMAL:" ",c=t?s.Style.TEXT_HIGHLIGHT_BOLD+e.name+s.Style.TEXT_NORMAL:e.name;return` ${n} ${c} ${v(o.email)} ${v(o.url)} ${v(e.id)}`},T=(o,e)=>d.isSome(o)&&o.value.id===e.accountID&&o.value.active_org_id===e.orgID,_=l.fn("login")(function*(o){let e=yield*p.Service;yield*P("Log in");let t=yield*e.login(o);yield*b.info("Go to: "+t.url),yield*b.info("Enter code: "+t.user),yield*A(t.url);let n=O();yield*n.start("Waiting for authorization...");let c=(r)=>l.gen(function*(){yield*l.sleep(r);let i=yield*e.poll(t);if(i._tag==="PollPending")return yield*c(r);if(i._tag==="PollSlow")return yield*c(D.sum(r,D.seconds(5)));return i}),a=yield*c(t.interval).pipe(l.timeout(t.expiry),l.catchTag("TimeoutError",()=>l.succeed(new S)));yield*I.valueTags(a,{PollSuccess:(r)=>l.gen(function*(){yield*n.stop("Logged in as "+r.email),yield*g("Done")}),PollExpired:()=>n.stop("Device code expired",1),PollDenied:()=>n.stop("Authorization denied",1),PollError:(r)=>n.stop("Error: "+String(r.cause),1),PollPending:()=>n.stop("Unexpected state",1),PollSlow:()=>n.stop("Unexpected state",1)})}),N=l.fn("logout")(function*(o){let e=yield*p.Service,t=yield*e.list();if(t.length===0)return yield*m("Not logged in");if(o){let i=t.find((y)=>y.email===o);if(!i)return yield*m("Account not found: "+o);yield*e.remove(i.id),yield*g("Logged out from "+o);return}let n=yield*e.active(),c=d.map(n,(i)=>i.id);yield*P("Log out");let a=t.map((i)=>{let y=d.isSome(c)&&c.value===i.id;return{value:i,label:w(i,y)}}),r=yield*h({message:"Select account to log out",options:a});if(d.isNone(r))return;yield*e.remove(r.value.id),yield*g("Logged out from "+r.value.email)}),$=l.fn("switch")(function*(){let o=yield*p.Service,e=yield*o.orgsByAccount();if(e.length===0)return yield*m("Not logged in");let t=yield*o.active(),n=e.flatMap((r)=>r.orgs.map((i)=>{let y=T(t,{accountID:r.account.id,orgID:i.id});return{value:{orgID:i.id,accountID:r.account.id,label:i.name},label:x(r.account,i,y)}}));if(n.length===0)return yield*m("No orgs found");yield*P("Switch org");let c=yield*h({message:"Select org",options:n});if(d.isNone(c))return;let a=c.value;yield*o.use(a.accountID,d.some(a.orgID)),yield*g("Switched to "+a.label)}),R=l.fn("orgs")(function*(){let o=yield*p.Service,e=yield*o.orgsByAccount();if(e.length===0)return yield*m("No accounts found");if(!e.some((n)=>n.orgs.length>0))return yield*m("No orgs found");let t=yield*o.active();for(let n of e)for(let c of n.orgs){let a=T(t,{accountID:n.account.id,orgID:c.id});yield*m(C(n.account,c,a))}}),M=l.fn("open")(function*(){let e=yield*(yield*p.Service).active();if(d.isNone(e))return yield*m("No active account");let t=e.value.url;yield*A(t),yield*g("Opened "+t)}),X=u({command:"login <url>",describe:!1,builder:(o)=>o.positional("url",{describe:"server URL",type:"string",demandOption:!0}),async handler(o){s.empty(),await f.runPromise(_(o.url))}}),B=u({command:"logout [email]",describe:!1,builder:(o)=>o.positional("email",{describe:"account email to log out from",type:"string"}),async handler(o){s.empty(),await f.runPromise(N(o.email))}}),U=u({command:"switch",describe:!1,async handler(){s.empty(),await f.runPromise($())}}),G=u({command:"orgs",describe:!1,async handler(){s.empty(),await f.runPromise(R())}}),H=u({command:"open",describe:!1,async handler(){s.empty(),await f.runPromise(M())}}),Y=u({command:"console",describe:!1,builder:(o)=>o.command({...X,describe:"log in to console"}).command({...B,describe:"log out from console"}).command({...U,describe:"switch active org"}).command({...G,describe:"list orgs"}).command({...H,describe:"open active console account"}).demandCommand(),async handler(){}});export{C as formatOrgLine,w as formatAccountLabel,U as SwitchCommand,G as OrgsCommand,H as OpenCommand,B as LogoutCommand,X as LoginCommand,Y as ConsoleCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{sq as a,tq as b}from"./chunk-s6me101a.js";import"./chunk-yjj4cvqg.js";export{a as generateSecret,b as generateCodeChallengeFromVerifier};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ed as d}from"./chunk-sbx9z70j.js";import{Rd as f}from"./chunk-yajd975f.js";import{Vf as e}from"./chunk-cjfgs1x8.js";import{hh as l}from"./chunk-m2ny1en7.js";import"./chunk-09j71kp6.js";import"./chunk-js9wdh67.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-8f0g7d7k.js";import"./chunk-abtn6nec.js";import{Cl as u,kk as m}from"./chunk-d7t0bcvk.js";import"./chunk-7mc8nxve.js";import"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import"./chunk-bn0h9dny.js";import"./chunk-q5363rr9.js";import"./chunk-7wthn44y.js";import"./chunk-a8p9aggx.js";import"./chunk-0xm85ayc.js";import"./chunk-s2za1n7h.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-bsf6n350.js";import"./chunk-4vze3djr.js";import"./chunk-bzrsnv2k.js";import"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import"./chunk-1d9f53sk.js";import"./chunk-svrxk3vf.js";import"./chunk-kkae8ead.js";import"./chunk-s6me101a.js";import"./chunk-jwtev7b7.js";import"./chunk-b9nwaaqs.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-1rn0vmvv.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-4kpvceap.js";import"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import"./chunk-t299e2aw.js";import"./chunk-bv8pf0m1.js";import"./chunk-4mrz9b6d.js";import"./chunk-yjj4cvqg.js";var v=f({command:"usage [sessionID]",describe:"show per-turn token/cost breakdown for a session (debug/verification tool)",builder:(o)=>{return o.positional("sessionID",{describe:"session ID to inspect (default: most recently updated session)",type:"string"}).option("format",{describe:"output format",type:"string",choices:["table","json"],default:"table"}).option("limit",{describe:"number of most recent turns to show (default: all)",type:"number"})},handler:async(o)=>{await d(process.cwd(),async()=>{let a=o.sessionID?m.make(o.sessionID):[...u.list({roots:!1,limit:1})][0]?.id;if(!a)e.error("No sessions found"),process.exit(1);let p=(await l.runPromise(u.Service.use((s)=>s.messages({sessionID:a,agentID:"*"})))).filter((s)=>s.info.role==="assistant").map((s)=>{let t=s.info,c=s.parts.filter((n)=>n.type==="step-finish");return{messageID:t.id,provider:t.providerID,model:t.modelID,finish:t.finish,cost:t.cost??0,tokens:t.tokens??{input:0,output:0,reasoning:0,cache:{read:0,write:0}},steps:c.map((n)=>({cost:n.cost,tokens:n.tokens}))}}),r=o.limit?p.slice(-o.limit):p;if(r.length===0){e.println("No assistant turns found for this session");return}if(o.format==="json"){console.log(JSON.stringify({sessionID:a,turns:r},null,2));return}e.println(`Session ${a} \u2014 ${r.length} turn(s)`),e.println("");for(let s of r){let t=s.tokens,c=t.input+t.cache.read+t.cache.write,n=t.output+t.reasoning;if(e.println(`${s.messageID} ${s.provider}/${s.model} finish=${s.finish??"-"}`),e.println(` tokens input=${t.input} cache.read=${t.cache.read} cache.write=${t.cache.write} output=${t.output} reasoning=${t.reasoning} (in=${c} out=${n})`),e.println(` cost $${s.cost.toFixed(6)}`),s.steps.length>1)e.println(` steps ${s.steps.length}`),s.steps.forEach((i,g)=>{e.println(` [${g}] input=${i.tokens.input} output=${i.tokens.output} cache.read=${i.tokens.cache.read} cache.write=${i.tokens.cache.write} reasoning=${i.tokens.reasoning} cost=$${i.cost.toFixed(6)}`)});e.println("")}let h=r.reduce((s,t)=>s+t.cost,0);e.println(`Total cost for shown turns: $${h.toFixed(6)}`),e.println("(source: Session.getUsage(), same numbers persisted to the message record \u2014 see session.usage log tag)")})}});export{v as UsageCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-yjj4cvqg.js";var A="./tree-sitter-zig-e78zbjpm.wasm";export{A as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-yjj4cvqg.js";var t="./highlights-ghv9g403.scm";export{t as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$l as s,am as t,bm as u,dm as v,em as w}from"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import{$m as c,Nm as a,_m as b,an as d,bn as e,cn as f,dn as g,en as h,fn as i,gn as j,hn as k,jn as l,kn as m,ln as n,nn as o,pn as p,wn as q,xn as r}from"./chunk-bn0h9dny.js";import"./chunk-0xm85ayc.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import"./chunk-t299e2aw.js";import"./chunk-yjj4cvqg.js";export{a as sql,e as or,f as not,c as ne,j as lte,i as lt,p as like,l as isNull,m as isNotNull,k as inArray,h as gte,g as gt,n as exists,b as eq,r as desc,t as count,o as between,q as asc,d as and,w as Storage,v as NotFoundError,s as JsonMigration,u as Database};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{n as a,o as b}from"./chunk-eqcd9k9p.js";import"./chunk-kw09hbrb.js";import"./chunk-r4mnbhe1.js";import"./chunk-c8k32724.js";import"./chunk-0yqbyres.js";import"./chunk-s6bar2f9.js";import"./chunk-yt3f3j35.js";import"./chunk-pq2prhb2.js";import"./chunk-5n4hpc4f.js";import"./chunk-2w20mhch.js";import"./chunk-bzgj60w4.js";import"./chunk-kdcnder5.js";import"./chunk-n3t52cz2.js";import"./chunk-h8chkene.js";import"./chunk-z160s5p5.js";import"./chunk-yj73ehjd.js";import"./chunk-cjfgs1x8.js";import"./chunk-b9hstp7h.js";import"./chunk-j0znryc6.js";import"./chunk-09j71kp6.js";import"./chunk-js9wdh67.js";import"./chunk-d7t0bcvk.js";import"./chunk-7mc8nxve.js";import"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import"./chunk-bn0h9dny.js";import"./chunk-q5363rr9.js";import"./chunk-7wthn44y.js";import"./chunk-a8p9aggx.js";import"./chunk-0xm85ayc.js";import"./chunk-s2za1n7h.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-bsf6n350.js";import"./chunk-4vze3djr.js";import"./chunk-bzrsnv2k.js";import"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import"./chunk-1d9f53sk.js";import"./chunk-svrxk3vf.js";import"./chunk-kkae8ead.js";import"./chunk-s6me101a.js";import"./chunk-jwtev7b7.js";import"./chunk-b9nwaaqs.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-1rn0vmvv.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-4kpvceap.js";import"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import"./chunk-t299e2aw.js";import"./chunk-bv8pf0m1.js";import"./chunk-4mrz9b6d.js";import"./chunk-yjj4cvqg.js";export{b as tui,a as rendererConfig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-yjj4cvqg.js";var R="./libopentui-c8ye7mqw.dylib";export{R as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-yjj4cvqg.js";var L="./opentui-c5en9p2g.dll";export{L as default};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{Ed as p}from"./chunk-sbx9z70j.js";import{Fd as x,Gd as b,Id as w,Jd as v,Kd as c}from"./chunk-2p9py4rw.js";import"./chunk-n3t52cz2.js";import{Rd as g}from"./chunk-yajd975f.js";import{Vf as r}from"./chunk-cjfgs1x8.js";import{hh as m}from"./chunk-m2ny1en7.js";import"./chunk-09j71kp6.js";import"./chunk-js9wdh67.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-8f0g7d7k.js";import"./chunk-abtn6nec.js";import{Cl as f,kk as y}from"./chunk-d7t0bcvk.js";import"./chunk-7mc8nxve.js";import"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import"./chunk-bn0h9dny.js";import"./chunk-q5363rr9.js";import"./chunk-7wthn44y.js";import"./chunk-a8p9aggx.js";import"./chunk-0xm85ayc.js";import"./chunk-s2za1n7h.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-bsf6n350.js";import"./chunk-4vze3djr.js";import"./chunk-bzrsnv2k.js";import"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import"./chunk-1d9f53sk.js";import"./chunk-svrxk3vf.js";import"./chunk-kkae8ead.js";import"./chunk-s6me101a.js";import"./chunk-jwtev7b7.js";import"./chunk-b9nwaaqs.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-1rn0vmvv.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-4kpvceap.js";import"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import"./chunk-t299e2aw.js";import"./chunk-bv8pf0m1.js";import"./chunk-4mrz9b6d.js";import"./chunk-yjj4cvqg.js";import{EOL as S}from"os";function s(e,t,i){return i.trim()?`[redacted:${e}:${t}]`:i}function o(e,t,i){if(!i)return i;return Object.keys(i).length?{redacted:`${e}:${t}`}:i}function a(e,t){return{...t,value:s("file-text",e,t.value)}}function l(e,t){return t?.map((i,u)=>({...i,file:s(`${e}-file`,String(u),i.file),patch:s(`${e}-patch`,String(u),i.patch)}))}function I(e){if(!e.source)return e.source;if(e.source.type==="symbol")return{...e.source,path:s("file-path",e.id,e.source.path),name:s("file-symbol",e.id,e.source.name),text:a(e.id,e.source.text)};if(e.source.type==="resource")return{...e.source,clientName:s("file-client",e.id,e.source.clientName),uri:s("file-uri",e.id,e.source.uri),text:a(e.id,e.source.text)};return{...e.source,path:s("file-path",e.id,e.source.path),text:a(e.id,e.source.text)}}function h(e){return{...e,url:s("file-url",e.id,e.url),filename:e.filename===void 0?void 0:s("file-name",e.id,e.filename),source:I(e)}}function $(e){switch(e.type){case"text":return{...e,text:s("text",e.id,e.text),metadata:o("text-metadata",e.id,e.metadata)};case"reasoning":return{...e,text:s("reasoning",e.id,e.text),metadata:o("reasoning-metadata",e.id,e.metadata)};case"file":return h(e);case"subtask":return{...e,prompt:s("subtask-prompt",e.id,e.prompt),description:s("subtask-description",e.id,e.description),command:e.command===void 0?void 0:s("subtask-command",e.id,e.command)};case"tool":return{...e,metadata:o("tool-metadata",e.id,e.metadata),state:e.state.status==="pending"?{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,raw:s("tool-raw",e.id,e.state.raw)}:e.state.status==="running"?{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,title:e.state.title===void 0?void 0:s("tool-title",e.id,e.state.title),metadata:o("tool-state-metadata",e.id,e.state.metadata)}:e.state.status==="completed"?{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,output:s("tool-output",e.id,e.state.output),title:s("tool-title",e.id,e.state.title),metadata:o("tool-state-metadata",e.id,e.state.metadata)??e.state.metadata,attachments:e.state.attachments?.map(h)}:{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,metadata:o("tool-state-metadata",e.id,e.state.metadata)}};case"patch":return{...e,hash:s("patch",e.id,e.hash),files:e.files.map((t,i)=>s("patch-file",`${e.id}-${i}`,t))};case"snapshot":return{...e,snapshot:s("snapshot",e.id,e.snapshot)};case"step-start":return{...e,snapshot:e.snapshot===void 0?void 0:s("snapshot",e.id,e.snapshot)};case"step-finish":return{...e,snapshot:e.snapshot===void 0?void 0:s("snapshot",e.id,e.snapshot)};case"agent":return{...e,source:!e.source?e.source:{...e.source,value:s("agent-source",e.id,e.source.value)}};default:return e}}var D=$;function P(e){return{info:{...e.info,title:s("session-title",e.info.id,e.info.title),directory:s("session-directory",e.info.id,e.info.directory),summary:!e.info.summary?e.info.summary:{...e.info.summary,diffs:l("session-diff",e.info.summary.diffs)},revert:!e.info.revert?e.info.revert:{...e.info.revert,snapshot:e.info.revert.snapshot===void 0?void 0:s("revert-snapshot",e.info.id,e.info.revert.snapshot),diff:e.info.revert.diff===void 0?void 0:s("revert-diff",e.info.id,e.info.revert.diff)}},messages:e.messages.map((t)=>({info:t.info.role==="user"?{...t.info,system:t.info.system===void 0?void 0:s("system",t.info.id,t.info.system),summary:!t.info.summary?t.info.summary:{...t.info.summary,title:t.info.summary.title===void 0?void 0:s("summary-title",t.info.id,t.info.summary.title),body:t.info.summary.body===void 0?void 0:s("summary-body",t.info.id,t.info.summary.body),diffs:l("message-diff",t.info.summary.diffs)}}:{...t.info,path:{cwd:s("cwd",t.info.id,t.info.path.cwd),root:s("root",t.info.id,t.info.path.root)}},parts:t.parts.map(D)}))}}var A=g({command:"export [sessionID]",describe:"export session data as JSON",builder:(e)=>{return e.positional("sessionID",{describe:"session id to export",type:"string"}).option("sanitize",{describe:"redact sensitive transcript and file data",type:"boolean"})},handler:async(e)=>{await p(process.cwd(),async()=>{let t=e.sessionID?y.make(e.sessionID):void 0;if(process.stderr.write(`Exporting session: ${t??"latest"}
3
- `),!t){r.empty(),v("Export session",{output:process.stderr});let i=[];for await(let n of f.list())i.push(n);if(i.length===0){w.error("No sessions found",{output:process.stderr}),c("Done",{output:process.stderr});return}i.sort((n,d)=>d.time.updated-n.time.updated);let u=await b({message:"Select session to export",maxItems:10,options:i.map((n)=>({label:n.title,value:n.id,hint:`${new Date(n.time.updated).toLocaleString()} \u2022 ${n.id.slice(-8)}`})),output:process.stderr});if(x(u))throw new r.CancelledError;t=u,c("Exporting session...",{output:process.stderr})}try{let i=await m.runPromise(f.Service.use((d)=>d.get(t))),u=await m.runPromise(f.Service.use((d)=>d.messages({sessionID:i.id,agentID:"*"}))),n={info:i,messages:u};process.stdout.write(JSON.stringify(e.sanitize?P(n):n,null,2)),process.stdout.write(S)}catch{r.error(`Session not found: ${t}`),process.exit(1)}})}});export{A as ExportCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ci as b}from"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-yjj4cvqg.js";export{b as QuickJSAsyncWASMModule};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{Rd as a}from"./chunk-yajd975f.js";import{Sf as d}from"./chunk-v9xnk9pz.js";import{Vf as i}from"./chunk-cjfgs1x8.js";import{$l as p,bm as n}from"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import{Dn as f}from"./chunk-bn0h9dny.js";import"./chunk-0xm85ayc.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-94qmhz2p.js";import{ct as m}from"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import"./chunk-t299e2aw.js";import"./chunk-yjj4cvqg.js";import{spawn as y}from"child_process";import{Database as g}from"bun:sqlite";import{EOL as l}from"os";var b=a({command:"$0 [query]",describe:"open an interactive sqlite3 shell or run a query",builder:(t)=>{return t.positional("query",{type:"string",describe:"SQL query to execute"}).option("format",{type:"string",choices:["json","tsv"],default:"tsv",describe:"Output format"})},handler:async(t)=>{let o=t.query;if(o){let r=new g(n.Path,{readonly:!0});try{let e=r.query(o).all();if(t.format==="json")console.log(JSON.stringify(e,null,2));else if(e.length>0){let s=Object.keys(e[0]);console.log(s.join("\t"));for(let u of e)console.log(s.map((h)=>u[h]).join("\t"))}}catch(e){i.error(m(e)),process.exit(1)}r.close();return}let c=y("sqlite3",[n.Path],{stdio:"inherit"});await new Promise((r)=>c.on("close",r))}}),w=a({command:"path",describe:"print the database path",handler:()=>{console.log(n.Path)}}),q=a({command:"migrate",describe:"migrate JSON data to SQLite (merges with existing data)",handler:async()=>{let t=new g(n.Path),o=process.stderr.isTTY,c=-1;if(o)process.stderr.write("\x1B[?25l");try{let r=await p.run(f({client:t}),{progress:(e)=>{let s=Math.floor(e.current/e.total*100);if(s===c)return;if(c=s,o)process.stderr.write(d(s,`${e.current}/${e.total}`)+" ");else process.stderr.write(`sqlite-migration:${s}${l}`)}});if(o)process.stderr.write(`
3
- `);if(o)process.stderr.write("\x1B[?25h");else process.stderr.write(`sqlite-migration:done${l}`);if(i.println(`Migration complete: ${r.projects} projects, ${r.sessions} sessions, ${r.messages} messages`),r.errors.length>0)i.println(`${r.errors.length} errors occurred during migration`)}catch(r){if(o)process.stderr.write("\x1B[?25h");i.error(`Migration failed: ${m(r)}`),process.exit(1)}finally{t.close()}}}),v=a({command:"db",describe:"database tools",builder:(t)=>{return t.command(b).command(w).command(q).demandCommand()},handler:()=>{}});export{v as DbCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{o as L}from"./chunk-eqcd9k9p.js";import"./chunk-kw09hbrb.js";import{A as K}from"./chunk-r4mnbhe1.js";import{B as N}from"./chunk-gsez13bg.js";import{C as F,E as J}from"./chunk-c8k32724.js";import"./chunk-0yqbyres.js";import"./chunk-s6bar2f9.js";import"./chunk-yt3f3j35.js";import"./chunk-pq2prhb2.js";import{P as M}from"./chunk-scqxmv8k.js";import"./chunk-5n4hpc4f.js";import"./chunk-2w20mhch.js";import"./chunk-bzgj60w4.js";import"./chunk-kdcnder5.js";import"./chunk-n3t52cz2.js";import{Rd as B}from"./chunk-yajd975f.js";import"./chunk-h8chkene.js";import"./chunk-z160s5p5.js";import"./chunk-yj73ehjd.js";import{Vf as z}from"./chunk-cjfgs1x8.js";import"./chunk-b9hstp7h.js";import"./chunk-j0znryc6.js";import"./chunk-09j71kp6.js";import"./chunk-js9wdh67.js";import"./chunk-d7t0bcvk.js";import"./chunk-7mc8nxve.js";import"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import"./chunk-bn0h9dny.js";import"./chunk-q5363rr9.js";import"./chunk-7wthn44y.js";import"./chunk-a8p9aggx.js";import"./chunk-0xm85ayc.js";import"./chunk-s2za1n7h.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-bsf6n350.js";import"./chunk-4vze3djr.js";import"./chunk-bzrsnv2k.js";import"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import"./chunk-1d9f53sk.js";import"./chunk-svrxk3vf.js";import"./chunk-kkae8ead.js";import"./chunk-s6me101a.js";import"./chunk-jwtev7b7.js";import"./chunk-b9nwaaqs.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-1rn0vmvv.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-4kpvceap.js";import"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import"./chunk-t299e2aw.js";import"./chunk-bv8pf0m1.js";import"./chunk-4mrz9b6d.js";import"./chunk-yjj4cvqg.js";var x=B({command:"attach <url>",describe:"attach to a running qitqode server",builder:(j)=>j.positional("url",{type:"string",describe:"http://localhost:4096",demandOption:!0}).option("dir",{type:"string",description:"directory to run in"}).option("continue",{alias:["c"],describe:"continue the last session",type:"boolean"}).option("session",{alias:["s"],type:"string",describe:"session id to continue"}).option("fork",{type:"boolean",describe:"fork the session when continuing (use with --continue or --session)"}).option("password",{alias:["p"],type:"string",describe:"basic auth password (defaults to QITQODE_SERVER_PASSWORD)"}),handler:async(j)=>{let Q=J();try{F();let q=N(j);if(q){z.error(q),process.exitCode=1;return}let R=(()=>{if(!j.dir)return;try{return process.chdir(j.dir),process.cwd()}catch{return j.dir}})(),S=M({password:j.password}),V=await K.get();await L({url:j.url,config:V,args:{continue:j.continue,sessionID:j.session,fork:j.fork},directory:R,headers:S})}finally{Q?.()}}});export{x as AttachCommand};
@@ -1,8 +0,0 @@
1
- // @bun
2
- import{Co as s$}from"./chunk-19sa03c1.js";import{Oo as Z2,Po as X2,Ro as J2}from"./chunk-4vze3djr.js";import{Vr as L$}from"./chunk-4kpvceap.js";import{$s as $2,Os as g,Rs as l,Ss as F}from"./chunk-94qmhz2p.js";import{pt as B$}from"./chunk-20d0cd1j.js";import{ut as p2}from"./chunk-yn576pje.js";import{AC as r$,FB as M$,PE as K$,SM as Q,WB as Q$,qH as U}from"./chunk-t299e2aw.js";import{CO as n2,EO as j$,GO as U$}from"./chunk-yjj4cvqg.js";var _$={};j$(_$,{sweepStaleAuthTmp:()=>o$,layer:()=>a$,defaultLayer:()=>q2,WellKnown:()=>x$,Service:()=>J$,Oauth:()=>N$,OAUTH_DUMMY_KEY:()=>F2,Info:()=>t$,AuthError:()=>Y$,Auth:()=>_$,Api:()=>T$});import R2 from"path";var A={};j$(A,{setKeySequenceForTest:()=>x2,setKeyForTest:()=>T2,resetForTest:()=>N2,isEnvelope:()=>U2,encryptionKey:()=>B2,encrypt:()=>_2,decrypt:()=>w2,AuthKeyring:()=>A});import e from"crypto";import{execFile as Q2}from"child_process";var y="qitqode",m="auth-encryption-key",p$="__qitqode_encrypted__";function U2(Z){return typeof Z==="object"&&Z!==null&&Z[p$]===1&&Z.alg==="aes-256-gcm"}function c(Z,$,X){return new Promise((J)=>{let O=Q2(Z,$,{timeout:5000},(z,W)=>{let G=z?z.code??1:0;J({code:typeof G==="number"?G:1,stdout:W??""})});if(X!==void 0)O.stdin?.write(X),O.stdin?.end()})}async function n$(Z,$){return(await c(Z,$)).code===0}async function K2(){if(process.env.QITQODE_DISABLE_KEYRING)return;if(process.platform==="darwin"){if(!await n$("security",["help"]))return;return{async get(){let Z=await c("security",["find-generic-password","-s",y,"-a",m,"-w"]);return Z.code===0?Z.stdout.trim():void 0},async set(Z){return(await c("security",["add-generic-password","-U","-s",y,"-a",m,"-w",Z])).code===0}}}if(process.platform==="linux"){if(!await n$("secret-tool",["search","service",y])){let Z=await c("secret-tool",["lookup","service",y,"account",m]);if(Z.code!==0&&Z.code!==1)return}return{async get(){let Z=await c("secret-tool",["lookup","service",y,"account",m]);return Z.code===0&&Z.stdout.trim()?Z.stdout.trim():void 0},async set(Z){return(await c("secret-tool",["store","--label","QitQode auth encryption key","service",y,"account",m],Z)).code===0}}}return}var $$,u;function B2(){if(u!==void 0&&u.length>0)return Promise.resolve(u.shift());return $$??=(async()=>{let Z=await K2();if(!Z)return;let $=await Z.get();if($){let X=Buffer.from($,"base64");if(X.length===32)return X;return}return g.withLock("auth-keyring-init",async()=>{let X=await Z.get();if(X){let W=Buffer.from(X,"base64");return W.length===32?W:void 0}let J=e.randomBytes(32);if(!await Z.set(J.toString("base64")))return;let O=await Z.get();if(!O)return;let z=Buffer.from(O,"base64");return z.length===32?z:void 0})})(),$$}function N2(){$$=void 0,u=void 0}function T2(Z){$$=Promise.resolve(Z),u=void 0}function x2(Z){u=[...Z]}function _2(Z,$){let X=e.randomBytes(12),J=e.createCipheriv("aes-256-gcm",$,X),O=Buffer.concat([J.update(Z,"utf8"),J.final()]);return{[p$]:1,alg:"aes-256-gcm",iv:X.toString("base64"),tag:J.getAuthTag().toString("base64"),data:O.toString("base64")}}function w2(Z,$){let X=e.createDecipheriv("aes-256-gcm",$,Buffer.from(Z.iv,"base64"));return X.setAuthTag(Buffer.from(Z.tag,"base64")),Buffer.concat([X.update(Buffer.from(Z.data,"base64")),X.final()]).toString("utf8")}var F2="qitqode-oauth-dummy-key",X$=R2.join(l.Path.data,"auth.json"),S2=60000;async function o$(){let Z=X$+".tmp";try{let{stat:$,unlink:X}=await import("fs/promises"),J=await $(Z);if(Date.now()-J.mtimeMs>=S2)await X(Z).catch(()=>{return})}catch{}}var Z$=(Z)=>($)=>new Y$({message:Z,cause:$});class N$ extends Q.Class("OAuth")({type:Q.Literal("oauth"),refresh:Q.String,access:Q.String,expires:Q.Number,accountId:Q.optional(Q.String),enterpriseUrl:Q.optional(Q.String)}){}class T$ extends Q.Class("ApiAuth")({type:Q.Literal("api"),key:Q.String,metadata:Q.optional(Q.Record(Q.String,Q.String))}){}class x$ extends Q.Class("WellKnownAuth")({type:Q.Literal("wellknown"),key:Q.String,token:Q.String}){}var i$=Q.Union([N$,T$,x$]).annotate({discriminator:"type",identifier:"Auth"}),t$=Object.assign(i$,{zod:s$(i$)});class Y$ extends Q.TaggedErrorClass()("AuthError",{message:Q.String,cause:Q.optional(Q.Defect)}){}class J$ extends r$.Service()("@qitqode/Auth"){}var a$=K$.effect(J$,U.gen(function*(){let Z=yield*B$.Service,$=Q.decodeUnknownOption(t$);yield*U.promise(()=>o$());let X=U.fn("Auth.readFile")(function*(){let I=yield*Z.readJson(X$).pipe(U.orElseSucceed(()=>({})));if(!A.isEnvelope(I))return I;let D=yield*U.promise(()=>A.encryptionKey());if(!D)return yield*U.fail(new Y$({message:"auth.json is encrypted but the OS keyring is unavailable. Restore keyring access or delete auth.json and log in again."}));return yield*U.try({try:()=>JSON.parse(A.decrypt(I,D)),catch:Z$("Failed to decrypt auth data (keyring key mismatch?)")})}),J=U.fn("Auth.writeFile")(function*(I){let D=yield*U.promise(()=>A.encryptionKey()),L=D?A.encrypt(JSON.stringify(I),D):I,M=X$+".tmp";yield*Z.writeJson(M,L).pipe(U.mapError(Z$("Failed to write auth data"))),yield*Z.chmod(M,384).pipe(U.mapError(Z$("Failed to set auth file permissions"))),yield*Z.rename(M,X$).pipe(U.mapError(Z$("Failed to atomically replace auth data")))}),O=U.fn("Auth.all")(function*(){let I=yield*X(),D=Q$.filterMap(I,(L)=>M$.fromOption($(L),()=>{return}));if(process.env.QITQODE_AUTH_CONTENT)try{let L=JSON.parse(process.env.QITQODE_AUTH_CONTENT);return{...Q$.filterMap(L,(B)=>M$.fromOption($(B),()=>{return})),...D}}catch(L){console.error("[Auth] Failed to parse QITQODE_AUTH_CONTENT env var:",L)}return D}),z=U.fn("Auth.get")(function*(I){return(yield*O())[I]}),W="auth-file",G=U.fn("Auth.set")(function*(I,D){yield*U.scoped(U.gen(function*(){yield*g.effect(W);let L=I.replace(/\/+$/,""),M=yield*O();if(L!==I)delete M[I];delete M[L+"/"],yield*J({...M,[L]:D})}))}),V=U.fn("Auth.remove")(function*(I){yield*U.scoped(U.gen(function*(){yield*g.effect(W);let D=I.replace(/\/+$/,""),L=yield*O();delete L[I],delete L[D],yield*J(L)}))});return J$.of({get:z,all:O,set:G,remove:V})})),q2=a$.pipe(K$.provide(B$.defaultLayer));function e$({onRequest:Z,onSseError:$,onSseEvent:X,responseTransformer:J,responseValidator:O,sseDefaultRetryDelay:z,sseMaxRetryAttempts:W,sseMaxRetryDelay:G,sseSleepFn:V,url:I,...D}){let L,M=V??((K)=>new Promise((T)=>setTimeout(T,K)));return{stream:async function*(){let K=z??3000,T=0,R=D.signal??new AbortController().signal;while(!0){if(R.aborted)break;T++;let t=D.headers instanceof Headers?D.headers:new Headers(D.headers);if(L!==void 0)t.set("Last-Event-ID",L);try{let P={redirect:"follow",...D,body:D.serializedBody,headers:t,signal:R},h=new Request(I,P);if(Z)h=await Z(I,P);let x=await(D.fetch??globalThis.fetch)(h);if(!x.ok)throw Error(`SSE failed: ${x.status} ${x.statusText}`);if(!x.body)throw Error("No body in SSE response");let q=x.body.pipeThrough(new TextDecoderStream).getReader(),_="",c$=()=>{try{q.cancel()}catch{}};R.addEventListener("abort",c$);try{while(!0){let{done:L2,value:I2}=await q.read();if(L2)break;_+=I2,_=_.replace(/\r\n?/g,`
3
- `);let u$=_.split(`
4
-
5
- `);_=u$.pop()??"";for(let j2 of u$){let M2=j2.split(`
6
- `),a=[],d$;for(let H of M2)if(H.startsWith("data:"))a.push(H.replace(/^data:\s*/,""));else if(H.startsWith("event:"))d$=H.replace(/^event:\s*/,"");else if(H.startsWith("id:"))L=H.replace(/^id:\s*/,"");else if(H.startsWith("retry:")){let l$=Number.parseInt(H.replace(/^retry:\s*/,""),10);if(!Number.isNaN(l$))K=l$}let b,m$=!1;if(a.length){let H=a.join(`
7
- `);try{b=JSON.parse(H),m$=!0}catch{b=H}}if(m$){if(O)await O(b);if(J)b=await J(b)}if(X?.({data:b,event:d$,id:L,retry:K}),a.length)yield b}}}finally{R.removeEventListener("abort",c$),q.releaseLock()}break}catch(P){if($?.(P),W!==void 0&&T>=W)break;let h=Math.min(K*2**(T-1),G??30000);await M(h)}}}()}}var H2=(Z)=>{switch(Z){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},E2=(Z)=>{switch(Z){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},A2=(Z)=>{switch(Z){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},O$=({allowReserved:Z,explode:$,name:X,style:J,value:O})=>{if(!$){let G=(Z?O:O.map((V)=>encodeURIComponent(V))).join(E2(J));switch(J){case"label":return`.${G}`;case"matrix":return`;${X}=${G}`;case"simple":return G;default:return`${X}=${G}`}}let z=H2(J),W=O.map((G)=>{if(J==="label"||J==="simple")return Z?G:encodeURIComponent(G);return d({allowReserved:Z,name:X,value:G})}).join(z);return J==="label"||J==="matrix"?z+W:W},d=({allowReserved:Z,name:$,value:X})=>{if(X===void 0||X===null)return"";if(typeof X==="object")throw Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${$}=${Z?X:encodeURIComponent(X)}`},W$=({allowReserved:Z,explode:$,name:X,style:J,value:O,valueOnly:z})=>{if(O instanceof Date)return z?O.toISOString():`${X}=${O.toISOString()}`;if(J!=="deepObject"&&!$){let V=[];Object.entries(O).forEach(([D,L])=>{V=[...V,D,Z?L:encodeURIComponent(L)]});let I=V.join(",");switch(J){case"form":return`${X}=${I}`;case"label":return`.${I}`;case"matrix":return`;${X}=${I}`;default:return I}}let W=A2(J),G=Object.entries(O).map(([V,I])=>d({allowReserved:Z,name:J==="deepObject"?`${X}[${V}]`:V,value:I})).join(W);return J==="label"||J==="matrix"?W+G:G};var P2=/\{[^{}]+\}/g,g2=({path:Z,url:$})=>{let X=$,J=$.match(P2);if(J)for(let O of J){let z=!1,W=O.substring(1,O.length-1),G="simple";if(W.endsWith("*"))z=!0,W=W.substring(0,W.length-1);if(W.startsWith("."))W=W.substring(1),G="label";else if(W.startsWith(";"))W=W.substring(1),G="matrix";let V=Z[W];if(V===void 0||V===null)continue;if(Array.isArray(V)){X=X.replace(O,O$({explode:z,name:W,style:G,value:V}));continue}if(typeof V==="object"){X=X.replace(O,W$({explode:z,name:W,style:G,value:V,valueOnly:!0}));continue}if(G==="matrix"){X=X.replace(O,`;${d({name:W,value:V})}`);continue}let I=encodeURIComponent(G==="label"?`.${V}`:V);X=X.replace(O,I)}return X},$1=({baseUrl:Z,path:$,query:X,querySerializer:J,url:O})=>{let z=O.startsWith("/")?O:`/${O}`,W=(Z??"")+z;if($)W=g2({path:$,url:W});let G=X?J(X):"";if(G.startsWith("?"))G=G.substring(1);if(G)W+=`?${G}`;return W};function w$(Z){let $=Z.body!==void 0;if($&&Z.bodySerializer){if("serializedBody"in Z)return Z.serializedBody!==void 0&&Z.serializedBody!==""?Z.serializedBody:null;return Z.body!==""?Z.body:null}if($)return Z.body;return}var Z1=async(Z,$)=>{let X=typeof $==="function"?await $(Z):$;if(!X)return;if(Z.scheme==="bearer")return`Bearer ${X}`;if(Z.scheme==="basic")return`Basic ${btoa(X)}`;return X};var R$={bodySerializer:(Z)=>JSON.stringify(Z,($,X)=>typeof X==="bigint"?X.toString():X)};var X1=({parameters:Z={},...$}={})=>{return(J)=>{let O=[];if(J&&typeof J==="object")for(let z in J){let W=J[z];if(W===void 0||W===null)continue;let G=Z[z]||$;if(Array.isArray(W)){let V=O$({allowReserved:G.allowReserved,explode:!0,name:z,style:"form",value:W,...G.array});if(V)O.push(V)}else if(typeof W==="object"){let V=W$({allowReserved:G.allowReserved,explode:!0,name:z,style:"deepObject",value:W,...G.object});if(V)O.push(V)}else{let V=d({allowReserved:G.allowReserved,name:z,value:W});if(V)O.push(V)}}return O.join("&")}},J1=(Z)=>{if(!Z)return"stream";let $=Z.split(";")[0]?.trim();if(!$)return;if($.startsWith("application/json")||$.endsWith("+json"))return"json";if($==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((X)=>$.startsWith(X)))return"blob";if($.startsWith("text/"))return"text";return},k2=(Z,$)=>{if(!$)return!1;if(Z.headers.has($)||Z.query?.[$]||Z.headers.get("Cookie")?.includes(`${$}=`))return!0;return!1};async function Y1(Z){for(let $ of Z.security??[]){if(k2(Z,$.name))continue;let X=await Z1($,Z.auth);if(!X)continue;let J=$.name??"Authorization";switch($.in){case"query":if(!Z.query)Z.query={};Z.query[J]=X;break;case"cookie":Z.headers.append("Cookie",`${J}=${X}`);break;case"header":default:Z.headers.set(J,X);break}}}var F$=(Z)=>$1({baseUrl:Z.baseUrl,path:Z.path,query:Z.query,querySerializer:typeof Z.querySerializer==="function"?Z.querySerializer:X1(Z.querySerializer),url:Z.url}),S$=(Z,$)=>{let X={...Z,...$};if(X.baseUrl?.endsWith("/"))X.baseUrl=X.baseUrl.substring(0,X.baseUrl.length-1);return X.headers=V$(Z.headers,$.headers),X},h2=(Z)=>{let $=[];return Z.forEach((X,J)=>{$.push([J,X])}),$},V$=(...Z)=>{let $=new Headers;for(let X of Z){if(!X)continue;let J=X instanceof Headers?h2(X):Object.entries(X);for(let[O,z]of J)if(z===null)$.delete(O);else if(Array.isArray(z))for(let W of z)$.append(O,W);else if(z!==void 0)$.set(O,typeof z==="object"?JSON.stringify(z):z)}return $};class G${fns=[];clear(){this.fns=[]}eject(Z){let $=this.getInterceptorIndex(Z);if(this.fns[$])this.fns[$]=null}exists(Z){let $=this.getInterceptorIndex(Z);return Boolean(this.fns[$])}getInterceptorIndex(Z){if(typeof Z==="number")return this.fns[Z]?Z:-1;return this.fns.indexOf(Z)}update(Z,$){let X=this.getInterceptorIndex(Z);if(this.fns[X])return this.fns[X]=$,Z;return!1}use(Z){return this.fns.push(Z),this.fns.length-1}}var O1=()=>({error:new G$,request:new G$,response:new G$}),b2=X1({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),C2={"Content-Type":"application/json"},n=(Z={})=>({...R$,headers:C2,parseAs:"auto",querySerializer:b2,...Z});var p=(Z={})=>{let $=S$(n(),Z),X=()=>({...$}),J=(D)=>{return $=S$($,D),X()},O=O1(),z=async(D)=>{let L={...$,...D,fetch:D.fetch??$.fetch??globalThis.fetch,headers:V$($.headers,D.headers),serializedBody:void 0};if(L.security)await Y1(L);if(L.requestValidator)await L.requestValidator(L);if(L.body!==void 0&&L.bodySerializer)L.serializedBody=L.bodySerializer(L.body);if(L.body===void 0||L.serializedBody==="")L.headers.delete("Content-Type");let M=L,B=F$(M);return{opts:M,url:B}},W=async(D)=>{let L=D.throwOnError??$.throwOnError,M=D.responseStyle??$.responseStyle,B,N;try{let{opts:K,url:T}=await z(D),R={redirect:"follow",...K,body:w$(K)};B=new Request(T,R);for(let x of O.request.fns)if(x)B=await x(B,K);let t=K.fetch;N=await t(B);for(let x of O.response.fns)if(x)N=await x(N,B,K);let P={request:B,response:N};if(N.ok){let x=(K.parseAs==="auto"?J1(N.headers.get("Content-Type")):K.parseAs)??"json";if(N.status===204||N.headers.get("Content-Length")==="0"){let _;switch(x){case"arrayBuffer":case"blob":case"text":_=await N[x]();break;case"formData":_=new FormData;break;case"stream":_=N.body;break;case"json":default:_={};break}return K.responseStyle==="data"?_:{data:_,...P}}let q;switch(x){case"arrayBuffer":case"blob":case"formData":case"text":q=await N[x]();break;case"json":{let _=await N.text();q=_?JSON.parse(_):{};break}case"stream":return K.responseStyle==="data"?N.body:{data:N.body,...P}}if(x==="json"){if(K.responseValidator)await K.responseValidator(q);if(K.responseTransformer)q=await K.responseTransformer(q)}return K.responseStyle==="data"?q:{data:q,...P}}let h=await N.text(),I$;try{I$=JSON.parse(h)}catch{}throw I$??h}catch(K){let T=K;for(let R of O.error.fns)if(R)T=await R(T,N,B,D);if(T=T||{},L)throw T;return M==="data"?void 0:{error:T,request:B,response:N}}},G=(D)=>(L)=>W({...L,method:D}),V=(D)=>async(L)=>{let{opts:M,url:B}=await z(L);return e$({...M,body:M.body,method:D,onRequest:async(N,K)=>{let T=new Request(N,K);for(let R of O.request.fns)if(R)T=await R(T,M);return T},serializedBody:w$(M),url:B})};return{buildUrl:(D)=>F$({...$,...D}),connect:G("CONNECT"),delete:G("DELETE"),get:G("GET"),getConfig:X,head:G("HEAD"),interceptors:O,options:G("OPTIONS"),patch:G("PATCH"),post:G("POST"),put:G("PUT"),request:W,setConfig:J,sse:{connect:V("CONNECT"),delete:V("DELETE"),get:V("GET"),head:V("HEAD"),options:V("OPTIONS"),patch:V("PATCH"),post:V("POST"),put:V("PUT"),trace:V("TRACE")},trace:G("TRACE")}};var v2={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},f2=Object.entries(v2),W1=(Z,$)=>{if(!$)$=new Map;for(let X of Z)if("in"in X){if(X.key)$.set(X.key,{in:X.in,map:X.map})}else if("key"in X)$.set(X.key,{map:X.map});else if(X.args)W1(X.args,$);return $},y2=(Z)=>{for(let[$,X]of Object.entries(Z))if(X&&typeof X==="object"&&!Array.isArray(X)&&!Object.keys(X).length)delete Z[$]},Y=(Z,$)=>{let X={body:Object.create(null),headers:Object.create(null),path:Object.create(null),query:Object.create(null)},J=W1($),O;for(let[z,W]of Z.entries()){if($[z])O=$[z];if(!O)continue;if("in"in O)if(O.key){let G=J.get(O.key),V=G.map||O.key;if(G.in)X[G.in][V]=W}else X.body=W;else for(let[G,V]of Object.entries(W??{})){let I=J.get(G);if(I)if(I.in){let D=I.map||G;X[I.in][D]=V}else X[I.map]=V;else{let D=f2.find(([L])=>G.startsWith(L));if(D){let[L,M]=D;X[M][G.slice(L.length)]=V}else if("allowExtra"in O&&O.allowExtra){for(let[L,M]of Object.entries(O.allowExtra))if(M){X[L][G]=V;break}}}}}return y2(X),X};var G1=p(n({baseUrl:"http://localhost:4096"}));class j{client;constructor(Z){this.client=Z?.client??G1}}class V1{defaultKey="default";instances=new Map;get(Z){let $=this.instances.get(Z??this.defaultKey);if(!$)throw Error('No SDK client found. Create one with "new QitQodeClient()" to fix this error.');return $}set(Z,$){this.instances.set($??this.defaultKey,Z)}}class z1 extends j{get(Z){return(Z?.client??this.client).get({url:"/global/config",...Z})}update(Z,$){let X=Y([Z],[{args:[{key:"config",map:"body"}]}]);return($?.client??this.client).patch({url:"/global/config",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}}class D1 extends j{scan(Z){return(Z?.client??this.client).get({url:"/global/import/scan",...Z})}run(Z,$){let X=Y([Z],[{args:[{in:"body",key:"sources"},{in:"body",key:"force"}]}]);return($?.client??this.client).post({url:"/global/import/run",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}}class L1 extends j{health(Z){return(Z?.client??this.client).get({url:"/global/health",...Z})}event(Z){return(Z?.client??this.client).sse.get({url:"/global/event",...Z})}dispose(Z){return(Z?.client??this.client).post({url:"/global/dispose",...Z})}upgrade(Z,$){let X=Y([Z],[{args:[{in:"body",key:"target"}]}]);return($?.client??this.client).post({url:"/global/upgrade",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}_config;get config(){return this._config??=new z1({client:this.client})}_import;get import(){return this._import??=new D1({client:this.client})}}class I1 extends j{remove(Z,$){let X=Y([Z],[{args:[{in:"path",key:"providerID"}]}]);return($?.client??this.client).delete({url:"/auth/{providerID}",...$,...X})}set(Z,$){let X=Y([Z],[{args:[{in:"path",key:"providerID"},{key:"auth",map:"body"}]}]);return($?.client??this.client).put({url:"/auth/{providerID}",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}}class j1 extends j{log(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"service"},{in:"body",key:"level"},{in:"body",key:"message"},{in:"body",key:"extra"}]}]);return($?.client??this.client).post({url:"/log",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}agents(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/agent",...$,...X})}skills(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/skill",...$,...X})}}class M1 extends j{list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/workspace/adaptor",...$,...X})}}class Q1 extends j{list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/workspace",...$,...X})}create(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"type"},{in:"body",key:"branch"},{in:"body",key:"extra"}]}]);return($?.client??this.client).post({url:"/experimental/workspace",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}status(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/workspace/status",...$,...X})}remove(Z,$){let X=Y([Z],[{args:[{in:"path",key:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).delete({url:"/experimental/workspace/{id}",...$,...X})}sessionRestore(Z,$){let X=Y([Z],[{args:[{in:"path",key:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionID"}]}]);return($?.client??this.client).post({url:"/experimental/workspace/{id}/session-restore",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}_adaptor;get adaptor(){return this._adaptor??=new M1({client:this.client})}}class U1 extends j{get(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/console",...$,...X})}listOrgs(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/console/orgs",...$,...X})}switchOrg(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"accountID"},{in:"body",key:"orgID"}]}]);return($?.client??this.client).post({url:"/experimental/console/switch",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}}class K1 extends j{list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"cursor"},{in:"query",key:"search"},{in:"query",key:"limit"},{in:"query",key:"archived"}]}]);return($?.client??this.client).get({url:"/experimental/session",...$,...X})}}class B1 extends j{list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/resource",...$,...X})}}class N1 extends j{_workspace;get workspace(){return this._workspace??=new Q1({client:this.client})}_console;get console(){return this._console??=new U1({client:this.client})}_session;get session(){return this._session??=new K1({client:this.client})}_resource;get resource(){return this._resource??=new B1({client:this.client})}}class T1 extends j{list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/project",...$,...X})}current(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/project/current",...$,...X})}initGit(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/project/git/init",...$,...X})}update(Z,$){let X=Y([Z],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"},{in:"body",key:"icon"},{in:"body",key:"commands"}]}]);return($?.client??this.client).patch({url:"/project/{projectID}",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}}class x1 extends j{list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/pty",...$,...X})}create(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"}]}]);return($?.client??this.client).post({url:"/pty",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}remove(Z,$){let X=Y([Z],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).delete({url:"/pty/{ptyID}",...$,...X})}get(Z,$){let X=Y([Z],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/pty/{ptyID}",...$,...X})}update(Z,$){let X=Y([Z],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"size"}]}]);return($?.client??this.client).put({url:"/pty/{ptyID}",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}connectToken(Z,$){let X=Y([Z],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/pty/{ptyID}/connect-token",...$,...X})}connect(Z,$){let X=Y([Z],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/pty/{ptyID}/connect",...$,...X})}}class _1 extends j{get(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/config",...$,...X})}update(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"config",map:"body"}]}]);return($?.client??this.client).patch({url:"/config",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}providers(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/config/providers",...$,...X})}}class w1 extends j{ids(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/tool/ids",...$,...X})}list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"provider"},{in:"query",key:"model"}]}]);return($?.client??this.client).get({url:"/experimental/tool",...$,...X})}}class R1 extends j{remove(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeRemoveInput",map:"body"}]}]);return($?.client??this.client).delete({url:"/experimental/worktree",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/worktree",...$,...X})}create(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeCreateInput",map:"body"}]}]);return($?.client??this.client).post({url:"/experimental/worktree",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}reset(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeResetInput",map:"body"}]}]);return($?.client??this.client).post({url:"/experimental/worktree/reset",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}}class F1 extends j{list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"search"},{in:"query",key:"limit"}]}]);return($?.client??this.client).get({url:"/session",...$,...X})}create(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"parentID"},{in:"body",key:"contextFrom"},{in:"body",key:"contextWatermark"},{in:"body",key:"title"},{in:"body",key:"permission"},{in:"body",key:"workspaceID"}]}]);return($?.client??this.client).post({url:"/session",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}status(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/session/status",...$,...X})}delete(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).delete({url:"/session/{sessionID}",...$,...X})}get(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/session/{sessionID}",...$,...X})}update(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"permission"},{in:"body",key:"time"}]}]);return($?.client??this.client).patch({url:"/session/{sessionID}",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}children(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/session/{sessionID}/children",...$,...X})}init(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"modelID"},{in:"body",key:"providerID"},{in:"body",key:"messageID"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/init",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}fork(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/fork",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}abort(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/abort",...$,...X})}actors(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/session/{sessionID}/actors",...$,...X})}todo(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/session/{sessionID}/todo",...$,...X})}task(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/session/{sessionID}/task",...$,...X})}unshare(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).delete({url:"/session/{sessionID}/share",...$,...X})}share(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/share",...$,...X})}diff(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"messageID"}]}]);return($?.client??this.client).get({url:"/session/{sessionID}/diff",...$,...X})}summarize(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"providerID"},{in:"body",key:"modelID"},{in:"body",key:"auto"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/summarize",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}revert(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"partID"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/revert",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}unrevert(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/unrevert",...$,...X})}messages(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"limit"},{in:"query",key:"before"},{in:"query",key:"agent_id"}]}]);return($?.client??this.client).get({url:"/session/{sessionID}/message",...$,...X})}prompt(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"modelRef"},{in:"body",key:"agent"},{in:"body",key:"agentID"},{in:"body",key:"task_id"},{in:"body",key:"source"},{in:"body",key:"provenance"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/message",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}deleteMessage(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}",...$,...X})}message(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/session/{sessionID}/message/{messageID}",...$,...X})}promptAsync(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"modelRef"},{in:"body",key:"agent"},{in:"body",key:"agentID"},{in:"body",key:"task_id"},{in:"body",key:"source"},{in:"body",key:"provenance"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/prompt_async",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}command(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"arguments"},{in:"body",key:"command"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/command",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}predict(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/predict",...$,...X})}shell(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"modelRef"},{in:"body",key:"command"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/shell",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}}class S1 extends j{delete(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...$,...X})}update(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"part",map:"body"}]}]);return($?.client??this.client).patch({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}}class q1 extends j{respond(Z,$){let X=Y([Z],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"permissionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"response"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/permissions/{permissionID}",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}reply(Z,$){let X=Y([Z],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"reply"},{in:"body",key:"message"}]}]);return($?.client??this.client).post({url:"/permission/{requestID}/reply",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/permission",...$,...X})}}class H1 extends j{balance(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/qredits/balance",...$,...X})}}class E1 extends j{list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"sessionID"}]}]);return($?.client??this.client).get({url:"/workflows",...$,...X})}resume(Z,$){let X=Y([Z],[{args:[{in:"path",key:"runID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/workflows/{runID}/resume",...$,...X})}}class A1 extends j{list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/question",...$,...X})}neverAsk(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/question/never-ask",...$,...X})}setNeverAsk(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"enabled"}]}]);return($?.client??this.client).post({url:"/question/never-ask",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}reply(Z,$){let X=Y([Z],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"answers"}]}]);return($?.client??this.client).post({url:"/question/{requestID}/reply",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}reject(Z,$){let X=Y([Z],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/question/{requestID}/reject",...$,...X})}}class P1 extends j{list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/bash-interactive",...$,...X})}reply(Z,$){let X=Y([Z],[{args:[{in:"path",key:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"output"},{in:"body",key:"exitCode"}]}]);return($?.client??this.client).post({url:"/bash-interactive/{id}/reply",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}}class g1 extends j{_interactive;get interactive(){return this._interactive??=new P1({client:this.client})}}class k1 extends j{authorize(Z,$){let X=Y([Z],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"method"},{in:"body",key:"inputs"}]}]);return($?.client??this.client).post({url:"/provider/{providerID}/oauth/authorize",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}callback(Z,$){let X=Y([Z],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"method"},{in:"body",key:"code"}]}]);return($?.client??this.client).post({url:"/provider/{providerID}/oauth/callback",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}}class h1 extends j{list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/provider",...$,...X})}auth(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/provider/auth",...$,...X})}_oauth;get oauth(){return this._oauth??=new k1({client:this.client})}}class b1 extends j{list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return($?.client??this.client).post({url:"/sync/history",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}}class C1 extends j{start(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/sync/start",...$,...X})}replay(Z,$){let X=Y([Z],[{args:[{in:"query",key:"query_directory",map:"directory"},{in:"query",key:"workspace"},{in:"body",key:"body_directory",map:"directory"},{in:"body",key:"events"}]}]);return($?.client??this.client).post({url:"/sync/replay",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}_history;get history(){return this._history??=new b1({client:this.client})}}class v1 extends j{text(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"pattern"}]}]);return($?.client??this.client).get({url:"/find",...$,...X})}files(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"query"},{in:"query",key:"dirs"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return($?.client??this.client).get({url:"/find/file",...$,...X})}symbols(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"query"}]}]);return($?.client??this.client).get({url:"/find/symbol",...$,...X})}}class f1 extends j{list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"path"}]}]);return($?.client??this.client).get({url:"/file",...$,...X})}read(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"path"}]}]);return($?.client??this.client).get({url:"/file/content",...$,...X})}status(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/file/status",...$,...X})}}class y1 extends j{subscribe(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).sse.get({url:"/event",...$,...X})}}class c1 extends j{remove(Z,$){let X=Y([Z],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).delete({url:"/mcp/{name}/auth",...$,...X})}start(Z,$){let X=Y([Z],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/mcp/{name}/auth",...$,...X})}callback(Z,$){let X=Y([Z],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"code"}]}]);return($?.client??this.client).post({url:"/mcp/{name}/auth/callback",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}authenticate(Z,$){let X=Y([Z],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/mcp/{name}/auth/authenticate",...$,...X})}}class u1 extends j{status(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/mcp",...$,...X})}add(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return($?.client??this.client).post({url:"/mcp",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}connect(Z,$){let X=Y([Z],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/mcp/{name}/connect",...$,...X})}disconnect(Z,$){let X=Y([Z],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/mcp/{name}/disconnect",...$,...X})}_auth;get auth(){return this._auth??=new c1({client:this.client})}}class d1 extends j{next(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/tui/control/next",...$,...X})}response(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return($?.client??this.client).post({url:"/tui/control/response",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}}class m1 extends j{appendPrompt(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"}]}]);return($?.client??this.client).post({url:"/tui/append-prompt",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}openHelp(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/tui/open-help",...$,...X})}openSessions(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/tui/open-sessions",...$,...X})}openThemes(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/tui/open-themes",...$,...X})}openModels(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/tui/open-models",...$,...X})}submitPrompt(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/tui/submit-prompt",...$,...X})}clearPrompt(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/tui/clear-prompt",...$,...X})}executeCommand(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"command"}]}]);return($?.client??this.client).post({url:"/tui/execute-command",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}showToast(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"message"},{in:"body",key:"variant"},{in:"body",key:"duration"}]}]);return($?.client??this.client).post({url:"/tui/show-toast",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}publish(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return($?.client??this.client).post({url:"/tui/publish",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}selectSession(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionID"}]}]);return($?.client??this.client).post({url:"/tui/select-session",...$,...X,headers:{"Content-Type":"application/json",...$?.headers,...X.headers}})}_control;get control(){return this._control??=new d1({client:this.client})}}class l1 extends j{dispose(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/instance/dispose",...$,...X})}}class n1 extends j{get(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/path",...$,...X})}}class p1 extends j{get(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/vcs",...$,...X})}diff(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"mode"}]}]);return($?.client??this.client).get({url:"/vcs/diff",...$,...X})}}class i1 extends j{list(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/command",...$,...X})}}class r1 extends j{status(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/lsp",...$,...X})}}class s1 extends j{status(Z,$){let X=Y([Z],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/formatter",...$,...X})}}class z$ extends j{static __registry=new V1;constructor(Z){super(Z);z$.__registry.set(this,Z?.key)}_global;get global(){return this._global??=new L1({client:this.client})}_auth;get auth(){return this._auth??=new I1({client:this.client})}_app;get app(){return this._app??=new j1({client:this.client})}_experimental;get experimental(){return this._experimental??=new N1({client:this.client})}_project;get project(){return this._project??=new T1({client:this.client})}_pty;get pty(){return this._pty??=new x1({client:this.client})}_config;get config(){return this._config??=new _1({client:this.client})}_tool;get tool(){return this._tool??=new w1({client:this.client})}_worktree;get worktree(){return this._worktree??=new R1({client:this.client})}_session;get session(){return this._session??=new F1({client:this.client})}_part;get part(){return this._part??=new S1({client:this.client})}_permission;get permission(){return this._permission??=new q1({client:this.client})}_qredits;get qredits(){return this._qredits??=new H1({client:this.client})}_workflow;get workflow(){return this._workflow??=new E1({client:this.client})}_question;get question(){return this._question??=new A1({client:this.client})}_bash;get bash(){return this._bash??=new g1({client:this.client})}_provider;get provider(){return this._provider??=new h1({client:this.client})}_sync;get sync(){return this._sync??=new C1({client:this.client})}_find;get find(){return this._find??=new v1({client:this.client})}_file;get file(){return this._file??=new f1({client:this.client})}_event;get event(){return this._event??=new y1({client:this.client})}_mcp;get mcp(){return this._mcp??=new u1({client:this.client})}_tui;get tui(){return this._tui??=new m1({client:this.client})}_instance;get instance(){return this._instance??=new l1({client:this.client})}_path;get path(){return this._path??=new n1({client:this.client})}_vcs;get vcs(){return this._vcs??=new p1({client:this.client})}_command;get command(){return this._command??=new i1({client:this.client})}_lsp;get lsp(){return this._lsp??=new r1({client:this.client})}_formatter;get formatter(){return this._formatter??=new s1({client:this.client})}}function o1(Z){if(!Z?.fetch)Z={...Z,fetch:(X)=>{return X.timeout=!1,fetch(X)}};if(Z?.directory)Z.headers={...Z.headers,"x-qitqode-directory":encodeURIComponent(Z.directory)};return Z}function c2(Z,$,X){if(!Z)return;if(!$)return Z;if(Z===$)return $;if(X&&Z===X($))return $;return Z}function u2(Z,$){if(Z.method!=="GET"&&Z.method!=="HEAD")return Z;let X=new URL(Z.url),J=!1;for(let[z,W]of[["x-qitqode-directory","directory"],["x-qitqode-workspace","workspace"]]){let G=c2(Z.headers.get(z),W==="directory"?$.directory:$.workspace,W==="directory"?encodeURIComponent:void 0);if(!G)continue;if(!X.searchParams.has(W))X.searchParams.set(W,G);J=!0}if(!J)return Z;let O=new Request(X,Z);return O.headers.delete("x-qitqode-directory"),O.headers.delete("x-qitqode-workspace"),O}function d2(Z){if(Z=o1(Z),Z?.experimental_workspaceID)Z.headers={...Z.headers,"x-qitqode-workspace":Z.experimental_workspaceID};let $=p(Z);return $.interceptors.request.use((X)=>u2(X,{directory:Z?.directory,workspace:Z?.experimental_workspaceID})),$.interceptors.response.use((X)=>{if(X.headers.get("content-type")==="text/html")throw Error("Request is not supported by this version of QitQode Server (Server responded with text/html)");return X}),new z$({client:$})}var i2=n2(p2(),1);import a1 from"path";var s2="QITQODE_KEY was rejected by the server (401/403). Check that the key is correct and has not expired.",q$=`[qitqode] ${s2}`;function t1(Z){if(Z?.type!=="api"||typeof Z.key!=="string")return;let X=Z.metadata?.method==="api-key"?"api-key":"sso";return{key:Z.key,method:X}}async function i(){if(process.env.QITQODE_KEY)return{key:process.env.QITQODE_KEY,method:"api-key"};let Z=a1.join(l.Path.data,"auth.json");try{let{readFile:$}=await import("fs/promises"),X=await g.withLock("auth-file",async()=>{let J=await $(Z,"utf8"),O=JSON.parse(J);return t1(O?.forgewise)});if(X)return X}catch{}if(process.env.QITQODE_AUTH_CONTENT)try{let $=JSON.parse(process.env.QITQODE_AUTH_CONTENT);return t1($?.forgewise)}catch{}return}async function D$(){if(process.env.QITQODE_KEY)return;let Z=a1.join(l.Path.data,"auth.json"),{readFile:$,writeFile:X,chmod:J,rename:O}=await import("fs/promises");await g.withLock("auth-file",async()=>{let z=await $(Z,"utf8"),W=JSON.parse(z);if(!("forgewise"in W))return;delete W.forgewise;let G=Z+".tmp";await X(G,JSON.stringify(W,null,2),"utf8"),await J(G,384),await O(G,Z)})}function r(Z){return Z.method==="api-key"?{"x-api-key":Z.key}:{authorization:`Bearer ${Z.key}`}}var y$={};j$(y$,{toolDescriptionEffect:()=>OZ,resolveWorkflowSummaries:()=>XZ,resolveWorkflowSpec:()=>JZ,resolveToolManifest:()=>z2,resolveToolDescription:()=>D2,resolveTierRatings:()=>LZ,resolveSubmitBatch:()=>xZ,resolveRetrieveBatch:()=>_Z,resolvePrompt:()=>W2,resolveListTiers:()=>DZ,resolveGetHistory:()=>MZ,resolveGenerateInlineComments:()=>BZ,resolveGenerateDocumentation:()=>KZ,resolveForgewiseConfig:()=>zZ,resolveFetchQreditsBalance:()=>QZ,resolveCompressTrajectorySafe:()=>IZ,resolveChatCompletion:()=>TZ,resolveChatBoolean:()=>NZ,resolveBraveSearch:()=>jZ,resolveBashArity:()=>YZ,resolveAnalyzeCodeForIssues:()=>UZ,resolveAgentPrompt:()=>$Z,remoteStats:()=>S,isBackendBillingError:()=>o2,clearRemoteCache:()=>e2,beginIdempotentAttempt:()=>O2,BackendRemote:()=>y$,BackendRateLimitError:()=>o,BackendInsufficientBalanceError:()=>s,BackendAuthRejectedError:()=>k});import{createHash as Y2,randomUUID as e1}from"crypto";var w=$2.create({service:"backend.remote"}),h$=30000,b$=5000,v=new Map,S={failures:0,authRejections:0,missingPrompts:0,missingToolDescriptions:0},H$=new Set,E$=new Set;class k extends Error{name="BackendAuthRejectedError";constructor(Z){super(L$.copy().invalidCredentials(Z))}}class s extends Error{name="BackendInsufficientBalanceError";status=402;code;constructor(Z,$){super(L$.copy().insufficientBalance(Z));this.code=$}}class o extends Error{name="BackendRateLimitError";status=429;retryAfterMs;constructor(Z,$){let X=Z!==void 0?` Retry in about ${Math.max(1,Math.round(Z/1000))}s.`:"";super(L$.copy().rateLimit+X+($?` (${$})`:""));this.retryAfterMs=Z}}function o2(Z){return Z instanceof s||Z instanceof o}var t2=600000,C=new Map;function a2(Z,$){try{return Y2("sha256").update(`${Z}\x00${JSON.stringify($)}`).digest("hex").slice(0,16)}catch{return"unscoped"}}function O2(Z,$,X){let J=Date.now(),O;try{O=Y2("sha256").update(`${Z}\x00${$}\x00${JSON.stringify(X)??""}`).digest("hex")}catch{return{key:`${$}-${e1()}`,settle:()=>{}}}let z=()=>C.delete(O),W=C.get(O);if(W&&W.expires>J)return{key:W.key,settle:z};if(C.size>256){for(let[V,I]of C)if(I.expires<=J)C.delete(V)}let G=`${$}-${O.slice(0,16)}-${e1()}`;return C.set(O,{key:G,expires:J+t2}),{key:G,settle:z}}function e2(){v.clear(),g$.clear(),A$.clear(),H$.clear(),E$.clear(),C.clear()}async function f(Z,$){let X=F.QITQODE_BACKEND_URL,J=Date.now(),O=`${X}::${Z}`,z=v.get(O);if(z&&z.expires>J)return z.value;try{let W=await i(),G=W?r(W):void 0,I=await $(J2({baseUrl:X,headers:G,fetch:(D,L)=>fetch(D,{...L,signal:L?.signal??AbortSignal.timeout(b$)})}));return v.set(O,{value:I,expires:J+h$}),I}catch(W){if(W instanceof X2){if(S.authRejections++,await D$().catch(()=>{}),w.warn("backend rejected the credential; prompting re-auth",{cacheKey:Z,baseUrl:X,status:W.status}),process.env.QITQODE_KEY)w.error(q$),console.error(q$);throw new k(`HTTP ${W.status}`)}throw S.failures++,w.warn("backend request failed; surfacing error",{cacheKey:Z,baseUrl:X,error:W instanceof Error?W.message:String(W)}),W}}async function W2(Z){if(Z.indexOf("/")<=0)return;return f(`prompt:${Z}`,($)=>$.prompt(Z).then((X)=>X??void 0))}async function $Z(Z){let $=`agent/${Z}`,X=await W2($);if(X===void 0||X===""){if(!H$.has(Z))H$.add(Z),S.missingPrompts++,w.warn("backend served no content for agent prompt; running with an empty prompt",{prompt:$,baseUrl:F.QITQODE_BACKEND_URL,missingPrompts:S.missingPrompts})}return X}var A$=new Map;function P$(Z){let $=A$.get(Z);if(!$)$={unsupported:!1},A$.set(Z,$);return $}async function ZZ(){let Z=P$(F.QITQODE_BACKEND_URL);if(Z.inFlight)return Z.inFlight;let $=f("workflow.catalog",(X)=>X.workflowSpecs().then((J)=>J??void 0)).then((X)=>{let J=new Map;for(let O of X??[])if(O&&typeof O.name==="string"&&typeof O.script==="string")J.set(O.name,O);return J});Z.inFlight=$;try{return await $}finally{if(Z.inFlight===$)Z.inFlight=void 0}}async function G2(Z,$){let X=F.QITQODE_BACKEND_URL;if(!P$(X).unsupported)try{return Z(await ZZ())}catch(J){if(!V2(J))throw J;P$(X).unsupported=!0,w.warn("backend has no workflowSpecs route; falling back to per-name workflow lookups",{baseUrl:X})}return $()}async function XZ(){return G2((Z)=>[...Z.values()].map(({script:$,...X})=>X),()=>f("workflow.list",(Z)=>Z.workflowSummaries()))}async function JZ(Z){return G2(($)=>$.get(Z),()=>f(`workflow.get:${Z}`,($)=>$.workflowSpec(Z).then((X)=>X??void 0)))}async function YZ(){return f("permission.arity",(Z)=>Z.bashArity())}var g$=new Map;function k$(Z){let $=g$.get(Z);if(!$)$={unsupported:!1},g$.set(Z,$);return $}function V2(Z){return Z instanceof Z2&&(Z.status===404||Z.status===501)}async function z2(){let Z=k$(F.QITQODE_BACKEND_URL);if(Z.inFlight)return Z.inFlight;let $=f("tool.manifest",(X)=>X.toolManifest().then((J)=>J??void 0)).then((X)=>{let J=new Map;for(let O of X??[])if(O&&typeof O.id==="string"&&typeof O.description==="string")J.set(O.id,O.description);return J});Z.inFlight=$;try{return await $}finally{if(Z.inFlight===$)Z.inFlight=void 0}}async function D2(Z){let $=F.QITQODE_BACKEND_URL,X;if(!k$($).unsupported)try{X=(await z2()).get(Z)}catch(J){if(!V2(J))throw J;k$($).unsupported=!0,w.warn("backend has no toolManifest route; falling back to one request per tool description",{baseUrl:$})}if(X===void 0||X==="")X=await f(`tool.description:${Z}`,(J)=>J.toolDescription(Z).then((O)=>O??void 0));if(X===void 0||X===""){if(!E$.has(Z))E$.add(Z),S.missingToolDescriptions++,w.warn("backend served no content for tool description; running with an empty description",{tool:Z,baseUrl:F.QITQODE_BACKEND_URL,missingToolDescriptions:S.missingToolDescriptions})}return X}function OZ(Z){return U.promise(()=>D2(Z)).pipe(U.catchDefect(($)=>$ instanceof k?U.succeed(void 0):U.die($)))}function WZ(Z){if(!Z)return{};try{let $=JSON.parse(Z);if($&&typeof $==="object")return{code:typeof $.error==="string"?$.error:void 0,detail:typeof $.message==="string"?$.message:void 0}}catch{}return{detail:Z.slice(0,300)}}function GZ(Z){let $=Z.headers?.get?.("retry-after-ms");if($){let J=Number.parseFloat($);if(!Number.isNaN(J))return J}let X=Z.headers?.get?.("retry-after");if(X){let J=Number.parseFloat(X);if(!Number.isNaN(J))return Math.ceil(J*1000);let O=Date.parse(X)-Date.now();if(!Number.isNaN(O)&&O>0)return Math.ceil(O)}return}async function C$(Z,$){let X=await Z.text().catch(()=>""),{code:J,detail:O}=WZ(X);if(Z.status===402)return new s(O,J);if(Z.status===429)return new o(GZ(Z),O);let z=O?`: ${O}`:J?`: ${J}`:"";return Error(`${$} failed: ${Z.status}${z}`)}function v$(Z,$){let{error:X,message:J}=Z;if(X==="insufficient_balance")return new s(J,X);if(X==="rate_limited"||X==="too_many_requests")return new o(void 0,J);return Error(`${$} returned failure: ${X??"unknown error"}${J?` \u2014 ${J}`:""}`)}async function E(Z,$,X,J={}){let O=F.QITQODE_BACKEND_URL,z=`${O}::post:${Z}`;if(!J.noCache){let W=Date.now(),G=v.get(z);if(G&&G.expires>W)return G.value}try{let W=await i(),G=W?r(W):{},V=J.billable?O2(a2(O,G),$,X):void 0,I=V?{"x-idempotency-key":V.key}:{},D=await fetch(`${O}/${$}`,{method:"POST",headers:{"Content-Type":"application/json",...G,...I},body:JSON.stringify(X),signal:J.signal});if(D.status===401||D.status===403){V?.settle();let B=await D.text().catch(()=>"");if(B.includes("ERR_GATEWAY_REQUIRED"))throw Error(`Backend routing error: ${B}`);throw S.authRejections++,await D$().catch(()=>{}),w.warn("backend rejected the credential; prompting re-auth",{fnName:$,baseUrl:O,status:D.status}),new k(`HTTP ${D.status}`)}if(!D.ok){let B=await C$(D,`Backend POST /${$}`);if(D.status<500)V?.settle();throw B}let L=await D.json();if(!L.success)throw V?.settle(),v$(L,`Backend POST /${$}`);V?.settle();let M=L.data;if(!J.noCache)v.set(z,{value:M,expires:Date.now()+h$});return M}catch(W){if(W instanceof k)throw W;throw S.failures++,w.warn("backend POST request failed; surfacing error",{fnName:$,baseUrl:O,error:W instanceof Error?W.message:String(W)}),W}}async function f$(Z,$,X={}){let J=F.QITQODE_BACKEND_URL;try{let O=await i(),z=O?r(O):{},W=new URLSearchParams(Object.entries($).map(([D,L])=>[D,String(L)])).toString(),G=W?`${J}/${Z}?${W}`:`${J}/${Z}`,V=await fetch(G,{method:"GET",headers:{...z},signal:X.signal});if(V.status===401||V.status===403){let D=await V.text().catch(()=>"");if(D.includes("ERR_GATEWAY_REQUIRED"))throw Error(`Backend routing error: ${D}`);throw S.authRejections++,await D$().catch(()=>{}),w.warn("backend rejected the credential; prompting re-auth",{fnName:Z,baseUrl:J,status:V.status}),new k(`HTTP ${V.status}`)}if(!V.ok)throw await C$(V,`Backend GET /${Z}`);let I=await V.json();if(!I.success)throw v$(I,`Backend GET /${Z}`);return I.data}catch(O){if(O instanceof k)throw O;throw S.failures++,w.warn("backend GET request failed; surfacing error",{fnName:Z,baseUrl:J,error:O instanceof Error?O.message:String(O)}),O}}async function VZ(Z,$,X){let J=F.QITQODE_BACKEND_URL,O=`${J}::public:${Z}`,z=Date.now(),W=v.get(O);if(W&&W.expires>z)return W.value;try{let G=await fetch(`${J}/${$}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(X),signal:AbortSignal.timeout(b$)});if(!G.ok)throw await C$(G,`Backend public POST /${$}`);let V=await G.json();if(!V.success)throw v$(V,`Backend public POST /${$}`);let I=V.data;return v.set(O,{value:I,expires:z+h$}),I}catch(G){throw S.failures++,w.warn("backend public request failed; surfacing error",{fnName:$,baseUrl:J,error:G instanceof Error?G.message:String(G)}),G}}async function zZ(){try{return await VZ("forgewise.config","forgewiseConfig",{})}catch(Z){let $=await i().catch(()=>null);if(!$)throw Z;let X=F.QITQODE_BACKEND_URL,J=await fetch(`${X}/forgewiseConfig`,{method:"POST",headers:{"Content-Type":"application/json",...r($)},body:JSON.stringify({}),signal:AbortSignal.timeout(b$)}).catch(()=>null);if(!J?.ok)throw Z;let O=await J.json().catch(()=>null);if(!O?.success)throw Z;return O.data}}async function DZ(){return f$("listTiers",{}).then((Z)=>{if(!Array.isArray(Z))return[];return Z.flatMap(($)=>{if(typeof $==="string")return[{id:$}];if(!$||typeof $!=="object"||Array.isArray($))return[];let X=$;return typeof X.id==="string"?[{id:X.id,...typeof X.label==="string"?{label:X.label}:{},...typeof X.providerID==="string"?{providerID:X.providerID}:{},...typeof X.modelID==="string"?{modelID:X.modelID}:{}}]:[]})}).catch((Z)=>{return w.warn("listTiers fetch failed; using hardcoded tier fallback",{error:Z instanceof Error?Z.message:String(Z)}),[]})}async function LZ(){return f$("TIER_RATINGS",{}).catch((Z)=>{w.warn("TIER_RATINGS fetch failed; using hardcoded rating fallback",{error:Z instanceof Error?Z.message:String(Z)});return})}async function IZ(Z){return E("compaction.trajectory","compressTrajectorySafe",Z,{noCache:!0,billable:!0,signal:AbortSignal.timeout(120000)})}async function jZ(Z,$){let X=$?.timeoutMs??30000,J={query:Z};if($?.numResults)J.options={count:$.numResults};return E("brave.search","braveSearch",J,{noCache:!0,signal:AbortSignal.timeout(X)})}async function MZ(Z){return E("qredits.history","getHistory",Z,{noCache:!0})}async function QZ(Z){return E("forgewise.qredits.balance","fetchQreditsBalance",Z,{noCache:!0})}async function UZ(Z){return E(`code.analyze:${Z.filePath}`,"analyzeCodeForIssues",Z,{noCache:!0,billable:!0,signal:AbortSignal.timeout(60000)})}async function KZ(Z){return E(`code.docs:${Z.filePath}:${Z.functionName??""}`,"generateDocumentation",Z,{noCache:!0,billable:!0,signal:AbortSignal.timeout(60000)})}async function BZ(Z){return E(`code.comments:${Z.filePath}`,"generateInlineComments",Z,{noCache:!0,billable:!0,signal:AbortSignal.timeout(60000)})}async function NZ(Z,$,X){return E("chat.boolean","chatBoolean",{sample:Z,test:$},{noCache:!0,billable:!0,signal:AbortSignal.timeout(X?.timeoutMs??30000)})}async function TZ(Z,$){let X={message:Z},J={};if($?.provider!==void 0)J.provider=$.provider;if($?.temperature!==void 0)J.temperature=$.temperature;if($?.maxTokens!==void 0)J.maxTokens=$.maxTokens;if(Object.keys(J).length>0)X.options=J;return E("chat.completion","chatCompletion",X,{noCache:!0,billable:!0,signal:AbortSignal.timeout($?.timeoutMs??30000)})}async function xZ(Z){return E("batch.submit","submitBatch",Z,{noCache:!0,billable:!0,signal:AbortSignal.timeout(60000)})}async function _Z(Z){return f$("retrieveBatch",{batchId:Z.batchId},{signal:AbortSignal.timeout(30000)})}
8
- export{F2 as jo,_$ as ko,o1 as lo,d2 as mo,s2 as no,q$ as oo,i as po,D$ as qo,k as ro,s as so,o as to,zZ as uo,DZ as vo,LZ as wo,MZ as xo,QZ as yo,y$ as zo};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{GO as o}from"./chunk-yjj4cvqg.js";var i=(t)=>`standard-openapi: ${t}`,s=new Map,r=async(t)=>{let e=s.get(t);if(e)return e;let a;switch(t){case"valibot":a=(await import("./chunk-b73s2h43.js")).default();break;case"zod":a=(await import("./chunk-5hpq59t1.js")).default();break;default:a=(await import("./chunk-th78zcds.js")).default()}return s.set(t,a),a},d=async(t,e={})=>{let a=await r(t["~standard"].vendor),{components:n={},options:c}=e;return{schema:await a(t,{components:n,options:c}),components:Object.keys(n).length>0?n:void 0}};
3
- export{i as Hg,d as Ig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ed as b}from"./chunk-sbx9z70j.js";import{Rd as f}from"./chunk-yajd975f.js";import{hh as S}from"./chunk-m2ny1en7.js";import"./chunk-09j71kp6.js";import"./chunk-js9wdh67.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-8f0g7d7k.js";import"./chunk-abtn6nec.js";import{Cl as v}from"./chunk-d7t0bcvk.js";import"./chunk-7mc8nxve.js";import{Vl as U,bm as R,lm as k}from"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import"./chunk-bn0h9dny.js";import"./chunk-q5363rr9.js";import"./chunk-7wthn44y.js";import"./chunk-a8p9aggx.js";import"./chunk-0xm85ayc.js";import"./chunk-s2za1n7h.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-bsf6n350.js";import"./chunk-4vze3djr.js";import"./chunk-bzrsnv2k.js";import"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import"./chunk-1d9f53sk.js";import"./chunk-svrxk3vf.js";import"./chunk-kkae8ead.js";import"./chunk-s6me101a.js";import"./chunk-jwtev7b7.js";import"./chunk-b9nwaaqs.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-1rn0vmvv.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-4kpvceap.js";import{Is as Z}from"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import"./chunk-t299e2aw.js";import"./chunk-bv8pf0m1.js";import"./chunk-4mrz9b6d.js";import"./chunk-yjj4cvqg.js";var i=f({command:"stats",describe:"show token usage and cost statistics",builder:(z)=>{return z.option("days",{describe:"show stats for the last N days (default: all time)",type:"number"}).option("tools",{describe:"number of tools to show (default: all)",type:"number"}).option("models",{describe:"show model statistics (default: hidden). Pass a number to show top N, otherwise shows all"}).option("project",{describe:"filter by project (default: all projects, empty string: current project)",type:"string"})},handler:async(z)=>{await b(process.cwd(),async()=>{let E=await y(z.days,z.project),_;if(z.models===!0)_=1/0;else if(typeof z.models==="number")_=z.models;u(E,z.tools,_)})}});async function w(){return k.project}async function p(){return R.use((E)=>E.select().from(U).all()).map((E)=>v.fromRow(E))}async function y(z,E){let _=await p(),L=86400000,J=(()=>{if(z===void 0)return 0;if(z===0){let V=new Date;return V.setHours(0,0,0,0),V.getTime()}return Date.now()-z*86400000})(),K=(()=>{if(z===void 0)return;if(z===0)return 1;return z})(),Y=J>0?_.filter((V)=>V.time.updated>=J):_;if(E!==void 0)if(E===""){let V=await w();Y=Y.filter((F)=>F.projectID===V.id)}else Y=Y.filter((V)=>V.projectID===E);let G={totalSessions:Y.length,totalMessages:0,totalCost:0,totalTokens:{input:0,output:0,reasoning:0,cache:{read:0,write:0}},toolUsage:{},modelUsage:{},dateRange:{earliest:Date.now(),latest:Date.now()},days:0,costPerDay:0,tokensPerSession:0,medianTokensPerSession:0};if(Y.length>1000)console.log(`Large dataset detected (${Y.length} sessions). This may take a while...`);if(Y.length===0)return G.days=K??0,G;let C=Date.now(),x=0,X=[],h=20;for(let V=0;V<Y.length;V+=h){let D=Y.slice(V,V+h).map(async(Q)=>{let W=await S.runPromise(v.Service.use((O)=>O.messages({sessionID:Q.id,agentID:"*"}))),N=0,H={input:0,output:0,reasoning:0,cache:{read:0,write:0}},j={},A={};for(let O of W){if(O.info.role==="assistant"){N+=O.info.cost||0;let B=`${O.info.providerID}/${O.info.modelID}`;if(!A[B])A[B]={messages:0,tokens:{input:0,output:0,cache:{read:0,write:0}},cost:0};if(A[B].messages++,A[B].cost+=O.info.cost||0,O.info.tokens)H.input+=O.info.tokens.input||0,H.output+=O.info.tokens.output||0,H.reasoning+=O.info.tokens.reasoning||0,H.cache.read+=O.info.tokens.cache?.read||0,H.cache.write+=O.info.tokens.cache?.write||0,A[B].tokens.input+=O.info.tokens.input||0,A[B].tokens.output+=(O.info.tokens.output||0)+(O.info.tokens.reasoning||0),A[B].tokens.cache.read+=O.info.tokens.cache?.read||0,A[B].tokens.cache.write+=O.info.tokens.cache?.write||0}for(let B of O.parts)if(B.type==="tool"&&B.tool)j[B.tool]=(j[B.tool]||0)+1}return{messageCount:W.length,sessionCost:N,sessionTokens:H,sessionTotalTokens:H.input+H.output+H.reasoning+H.cache.read+H.cache.write,sessionToolUsage:j,sessionModelUsage:A,earliestTime:J>0?Q.time.updated:Q.time.created,latestTime:Q.time.updated}}),M=await Promise.all(D);for(let Q of M){C=Math.min(C,Q.earliestTime),x=Math.max(x,Q.latestTime),X.push(Q.sessionTotalTokens),G.totalMessages+=Q.messageCount,G.totalCost+=Q.sessionCost,G.totalTokens.input+=Q.sessionTokens.input,G.totalTokens.output+=Q.sessionTokens.output,G.totalTokens.reasoning+=Q.sessionTokens.reasoning,G.totalTokens.cache.read+=Q.sessionTokens.cache.read,G.totalTokens.cache.write+=Q.sessionTokens.cache.write;for(let[W,N]of Object.entries(Q.sessionToolUsage))G.toolUsage[W]=(G.toolUsage[W]||0)+N;for(let[W,N]of Object.entries(Q.sessionModelUsage)){if(!G.modelUsage[W])G.modelUsage[W]={messages:0,tokens:{input:0,output:0,cache:{read:0,write:0}},cost:0};G.modelUsage[W].messages+=N.messages,G.modelUsage[W].tokens.input+=N.tokens.input,G.modelUsage[W].tokens.output+=N.tokens.output,G.modelUsage[W].tokens.cache.read+=N.tokens.cache.read,G.modelUsage[W].tokens.cache.write+=N.tokens.cache.write,G.modelUsage[W].cost+=N.cost}}}let $=Math.max(1,Math.ceil((x-C)/86400000)),q=K??$;G.dateRange={earliest:C,latest:x},G.days=q,G.costPerDay=G.totalCost/q;let I=G.totalTokens.input+G.totalTokens.output+G.totalTokens.reasoning+G.totalTokens.cache.read+G.totalTokens.cache.write;G.tokensPerSession=Y.length>0?I/Y.length:0,X.sort((V,F)=>V-F);let P=Math.floor(X.length/2);return G.medianTokensPerSession=X.length===0?0:X.length%2===0?(X[P-1]+X[P])/2:X[P],G}function u(z,E,_){function J(x,X){let $=55-x.length-X.length,q=Math.max(0,$);return`\u2502${x}${" ".repeat(q)}${X} \u2502`}console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 OVERVIEW \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log(J("Sessions",z.totalSessions.toLocaleString())),console.log(J("Messages",z.totalMessages.toLocaleString())),console.log(J("Days",z.days.toString())),console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),console.log(),console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 COST & TOKENS \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");let K=isNaN(z.totalCost)?0:z.totalCost,Y=isNaN(z.costPerDay)?0:z.costPerDay,G=isNaN(z.tokensPerSession)?0:z.tokensPerSession;console.log(J("Total Cost",`$${K.toFixed(2)}`)),console.log(J("Avg Cost/Day",`$${Y.toFixed(2)}`)),console.log(J("Avg Tokens/Session",Z.number(Math.round(G))));let C=isNaN(z.medianTokensPerSession)?0:z.medianTokensPerSession;if(console.log(J("Median Tokens/Session",Z.number(Math.round(C)))),console.log(J("Input",Z.number(z.totalTokens.input))),console.log(J("Output",Z.number(z.totalTokens.output))),console.log(J("Cache Read",Z.number(z.totalTokens.cache.read))),console.log(J("Cache Write",Z.number(z.totalTokens.cache.write))),console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),console.log(),_!==void 0&&Object.keys(z.modelUsage).length>0){let x=Object.entries(z.modelUsage).sort(([,h],[,$])=>$.messages-h.messages),X=_===1/0?x:x.slice(0,_);console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 MODEL USAGE \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");for(let[h,$]of X)console.log(`\u2502 ${h.padEnd(54)} \u2502`),console.log(J(" Messages",$.messages.toLocaleString())),console.log(J(" Input Tokens",Z.number($.tokens.input))),console.log(J(" Output Tokens",Z.number($.tokens.output))),console.log(J(" Cache Read",Z.number($.tokens.cache.read))),console.log(J(" Cache Write",Z.number($.tokens.cache.write))),console.log(J(" Cost",`$${$.cost.toFixed(4)}`)),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");process.stdout.write("\x1B[1A"),console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")}if(console.log(),Object.keys(z.toolUsage).length>0){let x=Object.entries(z.toolUsage).sort(([,q],[,I])=>I-q),X=E?x.slice(0,E):x;console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 TOOL USAGE \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");let h=Math.max(...X.map(([,q])=>q)),$=Object.values(z.toolUsage).reduce((q,I)=>q+I,0);for(let[q,I]of X){let P=Math.max(1,Math.floor(I/h*20)),V="\u2588".repeat(P),F=(I/$*100).toFixed(1),D=18,W=` ${(q.length>18?q.substring(0,16)+"..":q).padEnd(18)} ${V.padEnd(20)} ${I.toString().padStart(3)} (${F.padStart(4)}%)`,N=Math.max(0,56-W.length-1);console.log(`\u2502${W}${" ".repeat(N)} \u2502`)}console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")}console.log()}export{u as displayStats,y as aggregateSessionStats,i as StatsCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Cf as a}from"./chunk-95qs7wnz.js";import"./chunk-ywkvq7zb.js";import"./chunk-nfg7nt13.js";import"./chunk-ps6jk326.js";import"./chunk-yjj4cvqg.js";export{a as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ki as f,li as q,mi as w,ni as x}from"./chunk-z8v2tsz2.js";import"./chunk-yjj4cvqg.js";export{w as applyModuleEvalRuntimeOptions,q as applyBaseRuntimeOptions,x as QuickJSWASMModule,f as QuickJSModuleCallbacks};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-yjj4cvqg.js";var F="./tree-sitter-markdown-411r6y9b.wasm";export{F as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{jf as a,kf as b,lf as c,mf as d,nf as e,of as f}from"./chunk-g3ch14a1.js";import"./chunk-bzrsnv2k.js";import"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yjj4cvqg.js";export{f as createOpenAICompatible,e as VERSION,d as OpenAICompatibleImageModel,c as OpenAICompatibleEmbeddingModel,b as OpenAICompatibleCompletionLanguageModel,a as OpenAICompatibleChatLanguageModel};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-yjj4cvqg.js";var E="./tree-sitter-markdown_inline-j5349f42.wasm";export{E as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ts as a,Us as b,Vs as c,Ws as d,Xs as e,Ys as f,Zs as g,_s as h}from"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import"./chunk-t299e2aw.js";import"./chunk-yjj4cvqg.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,2 +0,0 @@
1
- // @bun
2
- import{Eo as a}from"./chunk-xk1nh1ay.js";import"./chunk-fsy279s5.js";import"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import"./chunk-t299e2aw.js";import"./chunk-yjj4cvqg.js";export{a as which};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{GO as t}from"./chunk-yjj4cvqg.js";var e=await import("./chunk-4pz8av2y.js",{with:{type:"file"}}),a=e.default;export{a as default};