@qitqode/qitqode-android-arm64 0.1.35 → 0.2.0

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 (451) hide show
  1. package/bundle/{chunk-7311jry1.js → chunk-00sr2gwz.js} +2 -2
  2. package/bundle/{chunk-azhw650z.js → chunk-02xcb52z.js} +2 -2
  3. package/bundle/{chunk-gws1rn1v.js → chunk-08q55ya0.js} +1 -1
  4. package/bundle/chunk-092bx2yw.js +2 -0
  5. package/bundle/{chunk-xgr6jnd6.js → chunk-0g25z230.js} +1 -1
  6. package/bundle/chunk-0jrgk6vk.js +2 -0
  7. package/bundle/chunk-0ne5m1n3.js +2 -0
  8. package/bundle/chunk-0qn52zsd.js +2 -0
  9. package/bundle/{chunk-7mxt5b0h.js → chunk-0z33en1a.js} +1 -1
  10. package/bundle/chunk-10accb7b.js +2 -0
  11. package/bundle/chunk-13kpdfr7.js +2 -0
  12. package/bundle/chunk-15s8zwgf.js +2 -0
  13. package/bundle/chunk-17pxm5d3.js +14 -0
  14. package/bundle/{chunk-nj4d554m.js → chunk-1bx2sjn6.js} +1 -1
  15. package/bundle/chunk-1kgyfja6.js +2 -0
  16. package/bundle/{chunk-bv29k2pf.js → chunk-1mcsf4yb.js} +2 -2
  17. package/bundle/{chunk-kwx9ewe0.js → chunk-1wpjmwnh.js} +1 -1
  18. package/bundle/{chunk-snr44en9.js → chunk-25bp7pcm.js} +2 -2
  19. package/bundle/{chunk-kmcsz8yv.js → chunk-2dkrfc1s.js} +1 -1
  20. package/bundle/chunk-2pzvcpv4.js +3 -0
  21. package/bundle/chunk-3bkdbqjj.js +2 -0
  22. package/bundle/{chunk-08m0hkdz.js → chunk-3dr4469n.js} +1 -1
  23. package/bundle/{chunk-n96tvjgj.js → chunk-3mepk08v.js} +2 -2
  24. package/bundle/chunk-3sz6gw10.js +3 -0
  25. package/bundle/{chunk-xqdrr7xg.js → chunk-45mjcxqk.js} +1 -1
  26. package/bundle/chunk-46ztrjw0.js +7 -0
  27. package/bundle/chunk-4dtkj9zg.js +2 -0
  28. package/bundle/chunk-4e9p3e0a.js +2 -0
  29. package/bundle/{chunk-qrtc3etn.js → chunk-4fa390yr.js} +2 -2
  30. package/bundle/chunk-4gs87ghj.js +3 -0
  31. package/bundle/{chunk-3k2b05fv.js → chunk-4sazy0nq.js} +1 -1
  32. package/bundle/chunk-4tbqsrsn.js +2 -0
  33. package/bundle/{chunk-ngccf7ga.js → chunk-52b1v7mn.js} +1 -1
  34. package/bundle/chunk-53kns5wy.js +2 -0
  35. package/bundle/{chunk-11v7vz3y.js → chunk-549ptbaj.js} +1 -1
  36. package/bundle/chunk-559ek1ym.js +2 -0
  37. package/bundle/chunk-55wxgsga.js +2 -0
  38. package/bundle/{chunk-34p46th6.js → chunk-5bate758.js} +1 -1
  39. package/bundle/chunk-5ke0yqqz.js +8 -0
  40. package/bundle/{chunk-kdcnder5.js → chunk-5kmfnkzv.js} +1 -1
  41. package/bundle/chunk-5myxjxae.js +3 -0
  42. package/bundle/chunk-5q1fz2az.js +2 -0
  43. package/bundle/{chunk-txbwmwxj.js → chunk-5sgpjgss.js} +1 -1
  44. package/bundle/{chunk-rsszcqxd.js → chunk-60qyqqxx.js} +1 -1
  45. package/bundle/{chunk-94pcpztx.js → chunk-64s7vfj7.js} +2 -2
  46. package/bundle/{chunk-6ged58yw.js → chunk-6r8pg6ma.js} +2 -2
  47. package/bundle/{chunk-8762ty72.js → chunk-70pb4kcm.js} +2 -2
  48. package/bundle/{chunk-04hvaaje.js → chunk-72zxassf.js} +1 -1
  49. package/bundle/{chunk-yz6898wy.js → chunk-73ckx171.js} +1 -1
  50. package/bundle/{chunk-gj0wt0cy.js → chunk-7fawtcnn.js} +1 -1
  51. package/bundle/{chunk-zfn0z4sh.js → chunk-7gbytqkn.js} +2 -2
  52. package/bundle/{chunk-x66ycpfs.js → chunk-7jhrxzjx.js} +2 -2
  53. package/bundle/{chunk-09pkckr1.js → chunk-7vftsy04.js} +1 -1
  54. package/bundle/chunk-871f8x99.js +4 -0
  55. package/bundle/chunk-88emsbaz.js +2 -0
  56. package/bundle/{chunk-zfd70p01.js → chunk-8dxdeksr.js} +1 -1
  57. package/bundle/{chunk-6styp5dn.js → chunk-8fgamz4y.js} +1 -1
  58. package/bundle/{chunk-9qdr9t8c.js → chunk-8q6z6emx.js} +1 -1
  59. package/bundle/{chunk-4ttf9rjd.js → chunk-8r3410c2.js} +1 -1
  60. package/bundle/{chunk-3mzcr3fw.js → chunk-8tp4whyw.js} +1 -1
  61. package/bundle/chunk-8yn64y27.js +2 -0
  62. package/bundle/{chunk-41v0x1jk.js → chunk-8yr682pv.js} +2 -2
  63. package/bundle/chunk-8ywa7az5.js +2 -0
  64. package/bundle/chunk-8ywdddts.js +2 -0
  65. package/bundle/{chunk-exmw8jfa.js → chunk-909fp6pm.js} +2 -2
  66. package/bundle/chunk-92zjark4.js +2 -0
  67. package/bundle/chunk-98effz12.js +2 -0
  68. package/bundle/{chunk-kjyw00jp.js → chunk-9cw4cnz0.js} +1 -1
  69. package/bundle/{chunk-2swch6mx.js → chunk-9dh9bc9d.js} +1 -1
  70. package/bundle/{chunk-y437vyza.js → chunk-9fkmhmh6.js} +1 -1
  71. package/bundle/{chunk-7vd91wsd.js → chunk-9nk0ts0s.js} +1 -1
  72. package/bundle/{chunk-p9cnzxb8.js → chunk-9s4whpg1.js} +2 -2
  73. package/bundle/{chunk-yajd975f.js → chunk-9xvctnjr.js} +1 -1
  74. package/bundle/{chunk-4wxxyrxn.js → chunk-9zre5e54.js} +1 -1
  75. package/bundle/chunk-a6z0fhta.js +2 -0
  76. package/bundle/{chunk-yt3f3j35.js → chunk-a9y27zd2.js} +1 -1
  77. package/bundle/{chunk-mex0fe9s.js → chunk-acyj91wq.js} +1 -1
  78. package/bundle/chunk-aj3y2e86.js +3 -0
  79. package/bundle/chunk-akpssv2d.js +2 -0
  80. package/bundle/chunk-aq28ejhv.js +2 -0
  81. package/bundle/{chunk-pkc4ddw1.js → chunk-atpzz901.js} +1 -1
  82. package/bundle/chunk-aw8af3ky.js +2 -0
  83. package/bundle/chunk-ax1y4699.js +2 -0
  84. package/bundle/{chunk-dctj3c22.js → chunk-b0jh0rby.js} +2 -2
  85. package/bundle/chunk-b10px5g4.js +2 -0
  86. package/bundle/chunk-bha3sbsj.js +2 -0
  87. package/bundle/{chunk-67d5d8mr.js → chunk-bnz0mxak.js} +1 -1
  88. package/bundle/chunk-bs020a3x.js +2 -0
  89. package/bundle/chunk-bs61sezq.js +2 -0
  90. package/bundle/{chunk-7eexey82.js → chunk-c72jajx9.js} +1 -1
  91. package/bundle/{chunk-81trveht.js → chunk-cagk1sjd.js} +1 -1
  92. package/bundle/{chunk-1byd3wma.js → chunk-cdh26622.js} +2 -2
  93. package/bundle/{chunk-t2vm08v6.js → chunk-ceefd2nj.js} +1 -1
  94. package/bundle/chunk-cmdjkx32.js +2 -0
  95. package/bundle/{chunk-zh3fny3z.js → chunk-cx7p4ezk.js} +2 -2
  96. package/bundle/chunk-cxtxvt43.js +2 -0
  97. package/bundle/{chunk-pxmhe36r.js → chunk-d1rn44wz.js} +1 -1
  98. package/bundle/{chunk-0c6ep9mc.js → chunk-d93z6hrn.js} +1 -1
  99. package/bundle/{chunk-zddknkw7.js → chunk-d9x9kqvy.js} +1 -1
  100. package/bundle/chunk-de2rfsaf.js +2 -0
  101. package/bundle/{chunk-seghf5fc.js → chunk-dgx4rq86.js} +1 -1
  102. package/bundle/{chunk-qzj6027k.js → chunk-dh1h513y.js} +1 -1
  103. package/bundle/chunk-dncnyzaa.js +2 -0
  104. package/bundle/chunk-dp6zktka.js +2 -0
  105. package/bundle/{chunk-ba3h1pzs.js → chunk-dshnn54c.js} +1 -1
  106. package/bundle/{chunk-73myw3bj.js → chunk-dt899wbf.js} +2 -2
  107. package/bundle/chunk-dvqdtdza.js +2 -0
  108. package/bundle/{chunk-6ynxf3q7.js → chunk-dvxk6mr6.js} +2 -2
  109. package/bundle/{chunk-bnss5dkk.js → chunk-dykqn0nj.js} +2 -2
  110. package/bundle/{chunk-hv6eccx1.js → chunk-dz3s882k.js} +220 -220
  111. package/bundle/{chunk-y9zstzed.js → chunk-eaqfnwdj.js} +1 -1
  112. package/bundle/{chunk-54wh8b12.js → chunk-eb8nsk7e.js} +2 -2
  113. package/bundle/chunk-ebabnv33.js +3 -0
  114. package/bundle/chunk-ebdpg3cn.js +2 -0
  115. package/bundle/{chunk-kfmz2p27.js → chunk-ev3a2sxv.js} +2 -2
  116. package/bundle/{chunk-d00c1k9w.js → chunk-ewpzqnj4.js} +1 -1
  117. package/bundle/chunk-eyc6tb5h.js +2 -0
  118. package/bundle/chunk-eze57bty.js +2 -0
  119. package/bundle/{chunk-qddt2gcs.js → chunk-ezrskm25.js} +1 -1
  120. package/bundle/chunk-fa47vzfc.js +2 -0
  121. package/bundle/chunk-fe397ph0.js +2 -0
  122. package/bundle/{chunk-bzgj60w4.js → chunk-fn8191ps.js} +2 -2
  123. package/bundle/chunk-fr75ytdr.js +2 -0
  124. package/bundle/chunk-fw2tnbt6.js +2 -0
  125. package/bundle/chunk-fwr2qgqb.js +2 -0
  126. package/bundle/chunk-fyz7fngd.js +2 -0
  127. package/bundle/chunk-g204pt98.js +2 -0
  128. package/bundle/{chunk-ggydr1ze.js → chunk-g794ey6w.js} +1 -1
  129. package/bundle/chunk-g8cfzzrs.js +2 -0
  130. package/bundle/chunk-gcgmwqhh.js +2 -0
  131. package/bundle/{chunk-rmve21dh.js → chunk-gg7bg3ek.js} +1 -1
  132. package/bundle/{chunk-9x25d115.js → chunk-gkj4a27z.js} +1 -1
  133. package/bundle/{chunk-sjw56r2n.js → chunk-gnt982jr.js} +3 -3
  134. package/bundle/chunk-grdfpd57.js +2 -0
  135. package/bundle/chunk-gt6tgm42.js +5 -0
  136. package/bundle/chunk-gw36mrg4.js +2 -0
  137. package/bundle/{chunk-z8gdmvgg.js → chunk-gwfx7tx7.js} +2 -2
  138. package/bundle/{chunk-q8hd01j7.js → chunk-gxmxx8jb.js} +1 -1
  139. package/bundle/{chunk-tge53d52.js → chunk-h1kg35mn.js} +1 -1
  140. package/bundle/chunk-h36qec67.js +2 -0
  141. package/bundle/{chunk-0msqaywp.js → chunk-h7w35n7w.js} +1 -1
  142. package/bundle/chunk-h9gtymfm.js +2 -0
  143. package/bundle/chunk-h9qn35pn.js +2 -0
  144. package/bundle/{chunk-mr8j7rc6.js → chunk-hb9mc5f9.js} +1 -1
  145. package/bundle/{chunk-df2aswz3.js → chunk-hcy77w6t.js} +1 -1
  146. package/bundle/chunk-hd8q4msp.js +2 -0
  147. package/bundle/{chunk-6a7c7wnf.js → chunk-hgsykghj.js} +2 -2
  148. package/bundle/chunk-hhjkezfz.js +2 -0
  149. package/bundle/chunk-hnz570f9.js +3 -0
  150. package/bundle/chunk-j5kyf7vt.js +5 -0
  151. package/bundle/{chunk-1yt5rsew.js → chunk-j63fkt6n.js} +1 -1
  152. package/bundle/{chunk-03xppy47.js → chunk-jcjaw7tk.js} +2 -2
  153. package/bundle/{chunk-jkh6eg7d.js → chunk-jf6ry79j.js} +4 -4
  154. package/bundle/chunk-jfz8wwk9.js +2 -0
  155. package/bundle/{chunk-ke7n9t5p.js → chunk-jgz1a29w.js} +3 -3
  156. package/bundle/{chunk-ebcdxmdd.js → chunk-jngchw38.js} +1 -1
  157. package/bundle/{chunk-j5ymkhry.js → chunk-jqn27885.js} +1 -1
  158. package/bundle/chunk-js6hqmq7.js +2 -0
  159. package/bundle/{chunk-hj3ddt53.js → chunk-jts0dma5.js} +2 -2
  160. package/bundle/chunk-k70x182t.js +2 -0
  161. package/bundle/chunk-k7n1csxv.js +3 -0
  162. package/bundle/{chunk-er38zew1.js → chunk-kb6v5hhm.js} +2 -2
  163. package/bundle/chunk-kmtfdky8.js +4 -0
  164. package/bundle/chunk-kp8nkm3m.js +2 -0
  165. package/bundle/{chunk-7hm0c2yg.js → chunk-kqhh2pm9.js} +1 -1
  166. package/bundle/{chunk-0h8wdch6.js → chunk-kt0ej3nq.js} +1 -1
  167. package/bundle/chunk-kwzawx7r.js +2 -0
  168. package/bundle/{chunk-n6msxne8.js → chunk-kx2dp8ch.js} +1 -1
  169. package/bundle/chunk-m0mek3es.js +2 -0
  170. package/bundle/{chunk-tbgczapt.js → chunk-m0xsvzyd.js} +2 -2
  171. package/bundle/chunk-m31d2n6h.js +2 -0
  172. package/bundle/{chunk-9ayxg9mq.js → chunk-m6zxr0j8.js} +2 -2
  173. package/bundle/{chunk-egn55fa2.js → chunk-mcc5ynma.js} +3 -3
  174. package/bundle/{chunk-md8161zd.js → chunk-mdzzcrf9.js} +2 -2
  175. package/bundle/{chunk-ynwkr3yh.js → chunk-mvnxwwe7.js} +2 -2
  176. package/bundle/{chunk-b4knxpqh.js → chunk-mw2hr4pd.js} +1 -1
  177. package/bundle/{chunk-vszbqv24.js → chunk-mzbr0m2v.js} +1 -1
  178. package/bundle/{chunk-bj00xk8k.js → chunk-n0trgp1c.js} +2 -2
  179. package/bundle/chunk-n14qktbg.js +2 -0
  180. package/bundle/{chunk-yjk6zv2z.js → chunk-n2ygpy76.js} +1 -1
  181. package/bundle/{chunk-yprmd5b7.js → chunk-n38h109k.js} +2 -2
  182. package/bundle/{chunk-8vg4fmg2.js → chunk-n7d9eemn.js} +180 -178
  183. package/bundle/{chunk-06k6egt2.js → chunk-neqy8j4n.js} +1 -1
  184. package/bundle/chunk-nhwhkx62.js +4 -0
  185. package/bundle/{chunk-nj61v4n7.js → chunk-njkserae.js} +1 -1
  186. package/bundle/{chunk-n6gtdx5h.js → chunk-nq495be3.js} +1 -1
  187. package/bundle/{chunk-p3qkexpk.js → chunk-nsjp44fp.js} +1 -1
  188. package/bundle/chunk-nzzsj54n.js +2 -0
  189. package/bundle/chunk-p19qfw59.js +2 -0
  190. package/bundle/chunk-p2yxj9s4.js +2 -0
  191. package/bundle/{chunk-1dtzxt2w.js → chunk-p3rp99na.js} +1 -1
  192. package/bundle/{chunk-79agp7v3.js → chunk-p8kpqyxb.js} +2 -2
  193. package/bundle/{chunk-9fxkh84w.js → chunk-p9zrk16q.js} +1 -1
  194. package/bundle/chunk-pnpre7ys.js +3 -0
  195. package/bundle/{chunk-ee23d2nz.js → chunk-pnq1h5az.js} +2 -2
  196. package/bundle/{chunk-wfd5h6ax.js → chunk-pqnbdygz.js} +2 -2
  197. package/bundle/chunk-pr1ysgr3.js +2 -0
  198. package/bundle/chunk-ps9p14y6.js +2 -0
  199. package/bundle/chunk-px8vtbmr.js +3 -0
  200. package/bundle/{chunk-zfcp509b.js → chunk-pxx2hz0g.js} +2 -2
  201. package/bundle/{chunk-rq4w0by4.js → chunk-q81m4m9z.js} +1 -1
  202. package/bundle/chunk-qagc6v17.js +2 -0
  203. package/bundle/{chunk-mq6jn47r.js → chunk-qb35hqm4.js} +1 -1
  204. package/bundle/chunk-qc0zhbhm.js +2 -0
  205. package/bundle/{chunk-keveg5gx.js → chunk-qdcf1ay5.js} +2 -2
  206. package/bundle/{chunk-t3eymzg1.js → chunk-qpzspr9z.js} +2 -2
  207. package/bundle/chunk-qq2rcxv2.js +9 -0
  208. package/bundle/{chunk-axdzm75h.js → chunk-qqne79vp.js} +2 -2
  209. package/bundle/{chunk-g4gjz7sq.js → chunk-qs4wef8c.js} +1 -1
  210. package/bundle/{chunk-nmehsm3w.js → chunk-qy1a2tpc.js} +1 -1
  211. package/bundle/chunk-qyjt0qnq.js +3 -0
  212. package/bundle/{chunk-6a77w77q.js → chunk-r0g5yyhf.js} +4 -4
  213. package/bundle/{chunk-by855es0.js → chunk-r58gzg6m.js} +1 -1
  214. package/bundle/{chunk-fmq0m4k5.js → chunk-r6ndvzd0.js} +1 -1
  215. package/bundle/chunk-r78kfhvz.js +2 -0
  216. package/bundle/{chunk-dyv2hqvc.js → chunk-rcyhqkv5.js} +1 -1
  217. package/bundle/{chunk-yp5bypsp.js → chunk-rexdr63q.js} +2 -2
  218. package/bundle/{chunk-1me21qdc.js → chunk-rgxy4ngt.js} +1 -1
  219. package/bundle/chunk-rnd5mnsm.js +2 -0
  220. package/bundle/{chunk-dcndy4sr.js → chunk-rph9zj24.js} +1 -1
  221. package/bundle/{chunk-ryfqwsft.js → chunk-rrd0jf5m.js} +1 -1
  222. package/bundle/{chunk-e74efvj2.js → chunk-rtdym35y.js} +172 -172
  223. package/bundle/chunk-s2xdf6qh.js +14 -0
  224. package/bundle/{chunk-mpygdb5a.js → chunk-s8mghr5a.js} +2 -2
  225. package/bundle/chunk-schtpyjs.js +2 -0
  226. package/bundle/{chunk-08f4khsw.js → chunk-snt1kefv.js} +3 -3
  227. package/bundle/{chunk-a1hzeejj.js → chunk-sp8ek94w.js} +2 -2
  228. package/bundle/{chunk-s8hq6trz.js → chunk-srxx88nb.js} +1 -1
  229. package/bundle/{chunk-gy0wm7e1.js → chunk-std2bgv7.js} +2 -2
  230. package/bundle/chunk-sv1s1qxd.js +619 -0
  231. package/bundle/{chunk-dffhkd30.js → chunk-swcgsrbj.js} +1 -1
  232. package/bundle/chunk-sxwqrvmy.js +28 -0
  233. package/bundle/chunk-sxy4hyyy.js +2 -0
  234. package/bundle/chunk-syc4b8rt.js +2 -0
  235. package/bundle/{chunk-wgk7ynt3.js → chunk-t01bhw5h.js} +3 -3
  236. package/bundle/chunk-tcs6wgna.js +3 -0
  237. package/bundle/{chunk-gmzrvxnv.js → chunk-tdmn21z0.js} +2 -2
  238. package/bundle/{chunk-71zw0qhf.js → chunk-tdxbm1nd.js} +1 -1
  239. package/bundle/{chunk-p825vsjy.js → chunk-te5tfq79.js} +1 -1
  240. package/bundle/chunk-tf4xwqz7.js +2 -0
  241. package/bundle/{chunk-fg35hwa0.js → chunk-tgd5ctnt.js} +2 -2
  242. package/bundle/chunk-twhavv1m.js +2 -0
  243. package/bundle/{chunk-qa2j0qmy.js → chunk-txqc7543.js} +2 -2
  244. package/bundle/chunk-tzg4z74d.js +2 -0
  245. package/bundle/chunk-tzrbb0e8.js +3 -0
  246. package/bundle/chunk-v0yxkq99.js +3 -0
  247. package/bundle/{chunk-a3a1trap.js → chunk-v3x5nrc4.js} +2 -2
  248. package/bundle/chunk-v7q3d3n6.js +3 -0
  249. package/bundle/chunk-v8vcwx23.js +2 -0
  250. package/bundle/chunk-vc4e6xc4.js +10 -0
  251. package/bundle/{chunk-6p7yg5sr.js → chunk-vftqwdpg.js} +1 -1
  252. package/bundle/{chunk-r0k21apr.js → chunk-vgaxv70x.js} +2 -2
  253. package/bundle/{chunk-nkk4fyqf.js → chunk-vgnddhdj.js} +1 -1
  254. package/bundle/{chunk-xd3xc1vv.js → chunk-vm58fkrv.js} +1 -1
  255. package/bundle/{chunk-qg2vk5fw.js → chunk-vsys768k.js} +1 -1
  256. package/bundle/{chunk-5a7fs1hg.js → chunk-vvzbfv2f.js} +1 -1
  257. package/bundle/{chunk-s4qtphwx.js → chunk-w03fdrxe.js} +1 -1
  258. package/bundle/{chunk-z1ay3qd0.js → chunk-w3bmf3zz.js} +1 -1
  259. package/bundle/{chunk-vsr8mnj6.js → chunk-w5940jxm.js} +1 -1
  260. package/bundle/chunk-w6rf2knb.js +2 -0
  261. package/bundle/{chunk-aa8hymcv.js → chunk-w8d9srv7.js} +2 -2
  262. package/bundle/chunk-w9pdvcf9.js +3 -0
  263. package/bundle/{chunk-yk97q51d.js → chunk-wev34grp.js} +2 -2
  264. package/bundle/chunk-wh7r96t3.js +2 -0
  265. package/bundle/{chunk-1pg6pv0m.js → chunk-wm77svwm.js} +1 -1
  266. package/bundle/chunk-wnjqaxze.js +2 -0
  267. package/bundle/{chunk-gckgaqqr.js → chunk-ws3p9cya.js} +2 -2
  268. package/bundle/chunk-x42w8ewc.js +2 -0
  269. package/bundle/{chunk-qkjdr337.js → chunk-x6rr6ss1.js} +1 -1
  270. package/bundle/chunk-xc9se3c8.js +2 -0
  271. package/bundle/{chunk-bbzztav6.js → chunk-xdacgfba.js} +1 -1
  272. package/bundle/{chunk-6p94fpbn.js → chunk-xdjwapwy.js} +2 -2
  273. package/bundle/chunk-xfz698bh.js +2 -0
  274. package/bundle/{chunk-zwnhf4z1.js → chunk-xhbb8b5g.js} +1 -1
  275. package/bundle/chunk-xjhezxft.js +8 -0
  276. package/bundle/chunk-xxj3sgd5.js +2 -0
  277. package/bundle/chunk-xxvqq7kc.js +2 -0
  278. package/bundle/{chunk-cs38g1bx.js → chunk-y0ydzdfc.js} +1 -1
  279. package/bundle/{chunk-wvf5q2hz.js → chunk-y1b2h15z.js} +1 -1
  280. package/bundle/{chunk-1gf116rg.js → chunk-yacccwf6.js} +1 -1
  281. package/bundle/chunk-ydc6ypjt.js +77 -0
  282. package/bundle/chunk-ye0mkqb4.js +2 -0
  283. package/bundle/{chunk-dhqaqeq6.js → chunk-yeq7b87a.js} +1 -1
  284. package/bundle/chunk-yfp9y71y.js +2 -0
  285. package/bundle/{chunk-e6xnynaz.js → chunk-yha554nm.js} +2 -2
  286. package/bundle/{chunk-rv1stdvb.js → chunk-yj6rbe9p.js} +2 -2
  287. package/bundle/chunk-yjjh339w.js +2 -0
  288. package/bundle/{chunk-c5pb87yf.js → chunk-ymtcm4xd.js} +1 -1
  289. package/bundle/chunk-ypk3t1eh.js +3 -0
  290. package/bundle/chunk-yt6vd7a5.js +2 -0
  291. package/bundle/{chunk-ssk8tkwd.js → chunk-yw9pfqxt.js} +1 -1
  292. package/bundle/{chunk-g6cyhxwg.js → chunk-yykjvt7f.js} +2 -2
  293. package/bundle/{chunk-sfes6pp1.js → chunk-yzh4rmrt.js} +1 -1
  294. package/bundle/chunk-yzn08nx1.js +2 -0
  295. package/bundle/chunk-yzq3c3dq.js +2 -0
  296. package/bundle/{chunk-prh3c44x.js → chunk-yzwgvjzd.js} +1 -1
  297. package/bundle/chunk-z0tfsdb9.js +3 -0
  298. package/bundle/chunk-z1j25911.js +2 -0
  299. package/bundle/{chunk-rkwrjphh.js → chunk-z1rshv6g.js} +1 -1
  300. package/bundle/chunk-z210dtw1.js +3 -0
  301. package/bundle/chunk-z29ahthm.js +2 -0
  302. package/bundle/{chunk-w1n4rf6n.js → chunk-z7vv0ngm.js} +2 -2
  303. package/bundle/{chunk-jgjnz82k.js → chunk-zaan8jk6.js} +1 -1
  304. package/bundle/{chunk-6gb65bv1.js → chunk-zbqzm65q.js} +1 -1
  305. package/bundle/{chunk-bk4phk66.js → chunk-zesbm9k1.js} +1 -1
  306. package/bundle/{chunk-c6vfwjg4.js → chunk-zfcfyagt.js} +1 -1
  307. package/bundle/{chunk-ywkvq7zb.js → chunk-zfnbk5gy.js} +1 -1
  308. package/bundle/chunk-zgre4gc2.js +2 -0
  309. package/bundle/{chunk-z7430qxg.js → chunk-zrmx397j.js} +1 -1
  310. package/bundle/chunk-zthkjx33.js +2 -0
  311. package/bundle/chunk-ztnepaqc.js +3 -0
  312. package/bundle/chunk-zwvwbrsc.js +2 -0
  313. package/bundle/chunk-zxddasg8.js +2 -0
  314. package/bundle/index.js +3 -3
  315. package/bundle/parser.worker.js +2 -2
  316. package/bundle/worker.js +1 -1
  317. package/package.json +1 -1
  318. package/bundle/chunk-0442cmw2.js +0 -2
  319. package/bundle/chunk-085pvqr4.js +0 -2
  320. package/bundle/chunk-0x5jn813.js +0 -2
  321. package/bundle/chunk-11g2rpv8.js +0 -3
  322. package/bundle/chunk-28t9akfn.js +0 -2
  323. package/bundle/chunk-2h1fcqvf.js +0 -2
  324. package/bundle/chunk-2kens6wh.js +0 -2
  325. package/bundle/chunk-2scyp9ns.js +0 -2
  326. package/bundle/chunk-2tw58kwb.js +0 -2
  327. package/bundle/chunk-2vxx0tax.js +0 -2
  328. package/bundle/chunk-2ybt3p5z.js +0 -2
  329. package/bundle/chunk-2zpkw3ge.js +0 -2
  330. package/bundle/chunk-31g86yn6.js +0 -2
  331. package/bundle/chunk-397be2x0.js +0 -2
  332. package/bundle/chunk-3c78nkgn.js +0 -2
  333. package/bundle/chunk-3d91q2qd.js +0 -2
  334. package/bundle/chunk-43yv7tz1.js +0 -2
  335. package/bundle/chunk-496ajawz.js +0 -2
  336. package/bundle/chunk-499gp5g5.js +0 -2
  337. package/bundle/chunk-4hzm14xt.js +0 -3
  338. package/bundle/chunk-4xw14sed.js +0 -2
  339. package/bundle/chunk-536naqqv.js +0 -2
  340. package/bundle/chunk-57nvmhjq.js +0 -2
  341. package/bundle/chunk-5e4fxy99.js +0 -616
  342. package/bundle/chunk-5he3d7cy.js +0 -2
  343. package/bundle/chunk-5qr286w8.js +0 -2
  344. package/bundle/chunk-606vpgc4.js +0 -4
  345. package/bundle/chunk-6a1skxcj.js +0 -3
  346. package/bundle/chunk-6cj7cn5x.js +0 -2
  347. package/bundle/chunk-6hybp2mt.js +0 -2
  348. package/bundle/chunk-6y423jax.js +0 -3
  349. package/bundle/chunk-72ghkgcn.js +0 -2
  350. package/bundle/chunk-741teh8k.js +0 -2
  351. package/bundle/chunk-7b3wx6kn.js +0 -2
  352. package/bundle/chunk-891yevv2.js +0 -2
  353. package/bundle/chunk-8c1ypgw5.js +0 -3
  354. package/bundle/chunk-8ktgy41r.js +0 -2
  355. package/bundle/chunk-8q73cjyj.js +0 -2
  356. package/bundle/chunk-8rt63jbm.js +0 -2
  357. package/bundle/chunk-8y623qdx.js +0 -2
  358. package/bundle/chunk-921vn745.js +0 -2
  359. package/bundle/chunk-945ebhte.js +0 -2
  360. package/bundle/chunk-9548cc0c.js +0 -2
  361. package/bundle/chunk-9yrypq1r.js +0 -14
  362. package/bundle/chunk-a0rp7gh4.js +0 -77
  363. package/bundle/chunk-a48t0g95.js +0 -3
  364. package/bundle/chunk-a949at1c.js +0 -3
  365. package/bundle/chunk-akk84fnc.js +0 -2
  366. package/bundle/chunk-aw7j7brm.js +0 -2
  367. package/bundle/chunk-b6cybdj3.js +0 -2
  368. package/bundle/chunk-c5fa8cb1.js +0 -2
  369. package/bundle/chunk-ca4r31we.js +0 -2
  370. package/bundle/chunk-ckbwdrm3.js +0 -2
  371. package/bundle/chunk-cqj21rfj.js +0 -3
  372. package/bundle/chunk-cz3h5n1v.js +0 -3
  373. package/bundle/chunk-dhc6e1t7.js +0 -2
  374. package/bundle/chunk-dk6rbqvp.js +0 -2
  375. package/bundle/chunk-dk975etf.js +0 -3
  376. package/bundle/chunk-dwajajaq.js +0 -2
  377. package/bundle/chunk-dxcrggvq.js +0 -2
  378. package/bundle/chunk-dyt3n3fe.js +0 -2
  379. package/bundle/chunk-e7ah0e61.js +0 -2
  380. package/bundle/chunk-e7v9trve.js +0 -11
  381. package/bundle/chunk-e8ws454m.js +0 -2
  382. package/bundle/chunk-efndtzby.js +0 -2
  383. package/bundle/chunk-eq2pepce.js +0 -2
  384. package/bundle/chunk-eva3nqqb.js +0 -14
  385. package/bundle/chunk-f3bnn9rf.js +0 -8
  386. package/bundle/chunk-f693s9vn.js +0 -2
  387. package/bundle/chunk-ftepqwyq.js +0 -2
  388. package/bundle/chunk-g18ax6yp.js +0 -2
  389. package/bundle/chunk-gadyp6mb.js +0 -2
  390. package/bundle/chunk-ge8315te.js +0 -5
  391. package/bundle/chunk-gk28ffhg.js +0 -2
  392. package/bundle/chunk-gpfc4z4v.js +0 -2
  393. package/bundle/chunk-gqvg02zp.js +0 -2
  394. package/bundle/chunk-gsyt2sv7.js +0 -2
  395. package/bundle/chunk-h3k1dk9m.js +0 -2
  396. package/bundle/chunk-h8c3dcqt.js +0 -2
  397. package/bundle/chunk-hfq11w4h.js +0 -2
  398. package/bundle/chunk-hw5qyht3.js +0 -3
  399. package/bundle/chunk-hwf58w1k.js +0 -2
  400. package/bundle/chunk-jyczz3yh.js +0 -8
  401. package/bundle/chunk-k8k8z6b7.js +0 -3
  402. package/bundle/chunk-kk3ve911.js +0 -2
  403. package/bundle/chunk-kv72hxkp.js +0 -3
  404. package/bundle/chunk-m4j7jyrd.js +0 -3
  405. package/bundle/chunk-mf3sm0pk.js +0 -2
  406. package/bundle/chunk-mkng9ykt.js +0 -2
  407. package/bundle/chunk-mxvypy3s.js +0 -2
  408. package/bundle/chunk-n5ypgxrn.js +0 -28
  409. package/bundle/chunk-n9xw9kqc.js +0 -2
  410. package/bundle/chunk-nc4wbc89.js +0 -2
  411. package/bundle/chunk-ngk67rt3.js +0 -3
  412. package/bundle/chunk-nj2bbtmx.js +0 -2
  413. package/bundle/chunk-nr1g57b2.js +0 -2
  414. package/bundle/chunk-p0ahbpxv.js +0 -2
  415. package/bundle/chunk-p7y8z5rd.js +0 -2
  416. package/bundle/chunk-pt26gerr.js +0 -2
  417. package/bundle/chunk-qkk1as5n.js +0 -2
  418. package/bundle/chunk-qsm9xw87.js +0 -2
  419. package/bundle/chunk-qw980y8h.js +0 -2
  420. package/bundle/chunk-r2w3gr8d.js +0 -2
  421. package/bundle/chunk-r5bqcpkz.js +0 -2
  422. package/bundle/chunk-r67c858b.js +0 -2
  423. package/bundle/chunk-r9fvfkee.js +0 -2
  424. package/bundle/chunk-rcn0dhbj.js +0 -2
  425. package/bundle/chunk-rq47pn3r.js +0 -2
  426. package/bundle/chunk-rvt1tdy8.js +0 -2
  427. package/bundle/chunk-ry7q8xn6.js +0 -2
  428. package/bundle/chunk-s27xvrft.js +0 -2
  429. package/bundle/chunk-s5nde2kd.js +0 -5
  430. package/bundle/chunk-scy39p6q.js +0 -2
  431. package/bundle/chunk-srpe3v8e.js +0 -9
  432. package/bundle/chunk-st5jaszz.js +0 -3
  433. package/bundle/chunk-t5qamf96.js +0 -2
  434. package/bundle/chunk-t9mz17gb.js +0 -3
  435. package/bundle/chunk-tns5x4w0.js +0 -3
  436. package/bundle/chunk-ttevj0pj.js +0 -2
  437. package/bundle/chunk-v7c54cyj.js +0 -2
  438. package/bundle/chunk-vgefaens.js +0 -2
  439. package/bundle/chunk-vv59b4re.js +0 -2
  440. package/bundle/chunk-vwqy7n3g.js +0 -2
  441. package/bundle/chunk-vysa9hp4.js +0 -7
  442. package/bundle/chunk-wn076jwj.js +0 -2
  443. package/bundle/chunk-x0m1qye9.js +0 -2
  444. package/bundle/chunk-xvntsbb1.js +0 -3
  445. package/bundle/chunk-y70aachh.js +0 -2
  446. package/bundle/chunk-yqk58hf6.js +0 -3
  447. package/bundle/chunk-ysgxt83y.js +0 -2
  448. package/bundle/chunk-ze9e6nt3.js +0 -3
  449. package/bundle/chunk-znzan00b.js +0 -3
  450. package/bundle/chunk-zrp55k47.js +0 -2
  451. package/bundle/chunk-zwdnh860.js +0 -2
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{A as g,u as a,v as b,w as c,x as d,y as e,z as f}from"./chunk-a949at1c.js";import"./chunk-eva3nqqb.js";import"./chunk-yprmd5b7.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-dk975etf.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-kv72hxkp.js";import"./chunk-tns5x4w0.js";import"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-3k2b05fv.js";export{e as waitForDependencies,c as layer,f as get,d as defaultLayer,g as TuiConfig,b as Service,a as Info};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{cQ as t}from"./chunk-3k2b05fv.js";var e=await import("./chunk-gpfc4z4v.js",{with:{type:"file"}}),a=e.default;export{a as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{cQ as t}from"./chunk-3k2b05fv.js";var e=await import("./chunk-rq47pn3r.js",{with:{type:"file"}}),a=e.default;export{a as default};
@@ -1,14 +0,0 @@
1
- // @bun
2
- import{fp as w,gp as A,jp as U,kp as O,op as R,qp as s,rp as F}from"./chunk-yprmd5b7.js";import{Gp as G,Kp as L}from"./chunk-keveg5gx.js";import{Mu as M,Ru as k}from"./chunk-e7v9trve.js";import{oO as y}from"./chunk-a0rp7gh4.js";import{aQ as Y}from"./chunk-3k2b05fv.js";var _={};Y(_,{schema:()=>x,jsonc:()=>v,ConfigParse:()=>_});function v($,r){let E=[],J=w($,E,{allowTrailingComma:!0});if(E.length){let C=$.split(`
3
- `),T=E.map((I)=>{let Z=$.substring(0,I.offset).split(`
4
- `),H=Z.length,j=Z[Z.length-1].length+1,B=C[H-1],Q=`${A(I.error)} at line ${H}, column ${j}`;if(!B)return Q;return`${Q}
5
- Line ${H}: ${B}
6
- ${"".padStart(j+9)}^`}).join(`
7
- `);throw new U({path:r,message:`
8
- --- JSONC Input ---
9
- ${$}
10
- --- Errors ---
11
- ${T}
12
- --- End ---`})}return J}function x($,r,E){let J=$.safeParse(r);if(J.success)return J.data;throw new O({path:E,issues:J.error.issues})}var m={};Y(m,{substitute:()=>c,ConfigVariable:()=>m});import W from"path";import f from"os";function S($){return $.type==="path"?$.path:$.source}function d($){return $.type==="path"?W.dirname($.path):$.dir}async function c($){let r=$.missing??"error",E=$.text.replace(/\{env:([^}]+)\}/g,(H,j)=>{return process.env[j]||""}),J=Array.from(E.matchAll(/\{file:[^}]+\}/g));if(!J.length)return E;let C=d($),T=S($),I="",Z=0;for(let H of J){let j=H[0],B=H.index;I+=E.slice(Z,B);let Q=E.lastIndexOf(`
13
- `,B-1)+1;if(E.slice(Q,B).trimStart().startsWith("//")){I+=j,Z=B+j.length;continue}let K=j.replace(/^\{file:/,"").replace(/\}$/,"");if(K.startsWith("~/"))K=W.join(f.homedir(),K.slice(2));let b=W.isAbsolute(K)?K:W.resolve(C,K),o=(await k.readText(b).catch((X)=>{if(r==="empty")return"";let q=`bad file reference: "${j}"`;if(X.code==="ENOENT")throw new O({path:T,message:q+` ${b} does not exist`},{cause:X});throw new O({path:T,message:q},{cause:X})})).trim();I+=JSON.stringify(o).slice(1,-1),Z=B+j.length}return I+=E.slice(Z),I}var V={};Y(V,{resolvePluginSpec:()=>h,pluginSpecifier:()=>N,pluginOptions:()=>g,load:()=>a,deduplicatePluginOrigins:()=>u,Spec:()=>n,Options:()=>P,ConfigPlugin:()=>V});import{pathToFileURL as D}from"url";import z from"path";var P=y.Record(y.String,y.Unknown).pipe(G(($)=>({zod:L($)}))),n=y.Union([y.String,y.mutable(y.Tuple([y.String,P]))]).pipe(G(($)=>({zod:L($)})));async function a($){let r=[];for(let E of await M.scan("{plugin,plugins}/*.{ts,js}",{cwd:$,absolute:!0,dot:!0,symlink:!0}))r.push(D(E).href);return r}function N($){return Array.isArray($)?$[0]:$}function g($){return Array.isArray($)?$[1]:void 0}async function h($,r){let E=N($);if(!s(E))return $;let J=z.dirname(r),C=(()=>{if(E.startsWith("file://"))return E;if(z.isAbsolute(E)||/^[A-Za-z]:[\\/]/.test(E))return D(E).href;return D(z.resolve(J,E)).href})(),T=await F(C).catch(()=>C);if(Array.isArray($))return[T,$[1]];return T}function u($){let r=new Set,E=[];for(let J of $.toReversed()){let C=N(J.spec),T=C.startsWith("file://")?C:R(C).pkg;if(r.has(T))continue;r.add(T),E.push(J)}return E.toReversed()}
14
- export{_ as bp,m as cp,V as dp};
@@ -1,8 +0,0 @@
1
- // @bun
2
- import{kq as qO,lq as EO,nq as HO}from"./chunk-hw5qyht3.js";import{rt as u}from"./chunk-nj2bbtmx.js";import{ku as X$,nu as J$,ou as R,xu as FO}from"./chunk-tns5x4w0.js";import{Su as Y1}from"./chunk-zh3fny3z.js";import{OI as c}from"./chunk-a0rp7gh4.js";import{_P as J1,aQ as D1,cQ as RO}from"./chunk-3k2b05fv.js";function x$({onRequest:O,onSseError:$,onSseEvent:Z,responseTransformer:J,responseValidator:Y,sseDefaultRetryDelay:D,sseMaxRetryAttempts:W,sseMaxRetryDelay:G,sseSleepFn:V,url:K,...z}){let L,M=V??((U)=>new Promise((j)=>setTimeout(j,U)));return{stream:async function*(){let U=D??3000,j=0,B=z.signal??new AbortController().signal;while(!0){if(B.aborted)break;j++;let l=z.headers instanceof Headers?z.headers:new Headers(z.headers);if(L!==void 0)l.set("Last-Event-ID",L);try{let E={redirect:"follow",...z,body:z.serializedBody,headers:l,signal:B},A=new Request(K,E);if(O)A=await O(K,E);let Q=await(z.fetch??globalThis.fetch)(A);if(!Q.ok)throw Error(`SSE failed: ${Q.status} ${Q.statusText}`);if(!Q.body)throw Error("No body in SSE response");let w=Q.body.pipeThrough(new TextDecoderStream).getReader(),T="",T$=()=>{try{w.cancel()}catch{}};B.addEventListener("abort",T$);try{while(!0){let{done:CO,value:vO}=await w.read();if(CO)break;T+=vO,T=T.replace(/\r\n?/g,`
3
- `);let _$=T.split(`
4
-
5
- `);T=_$.pop()??"";for(let yO of _$){let cO=yO.split(`
6
- `),n=[],N$;for(let F of cO)if(F.startsWith("data:"))n.push(F.replace(/^data:\s*/,""));else if(F.startsWith("event:"))N$=F.replace(/^event:\s*/,"");else if(F.startsWith("id:"))L=F.replace(/^id:\s*/,"");else if(F.startsWith("retry:")){let R$=Number.parseInt(F.replace(/^retry:\s*/,""),10);if(!Number.isNaN(R$))U=R$}let h,B$=!1;if(n.length){let F=n.join(`
7
- `);try{h=JSON.parse(F),B$=!0}catch{h=F}}if(B$){if(Y)await Y(h);if(J)h=await J(h)}if(Z?.({data:h,event:N$,id:L,retry:U}),n.length)yield h}}}finally{B.removeEventListener("abort",T$),w.releaseLock()}break}catch(E){if($?.(E),W!==void 0&&j>=W)break;let A=Math.min(U*2**(j-1),G??30000);await M(A)}}}()}}var uO=(O)=>{switch(O){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},dO=(O)=>{switch(O){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},mO=(O)=>{switch(O){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},p=({allowReserved:O,explode:$,name:Z,style:J,value:Y})=>{if(!$){let G=(O?Y:Y.map((V)=>encodeURIComponent(V))).join(dO(J));switch(J){case"label":return`.${G}`;case"matrix":return`;${Z}=${G}`;case"simple":return G;default:return`${Z}=${G}`}}let D=uO(J),W=Y.map((G)=>{if(J==="label"||J==="simple")return O?G:encodeURIComponent(G);return f({allowReserved:O,name:Z,value:G})}).join(D);return J==="label"||J==="matrix"?D+W:W},f=({allowReserved:O,name:$,value:Z})=>{if(Z===void 0||Z===null)return"";if(typeof Z==="object")throw Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${$}=${O?Z:encodeURIComponent(Z)}`},i=({allowReserved:O,explode:$,name:Z,style:J,value:Y,valueOnly:D})=>{if(Y instanceof Date)return D?Y.toISOString():`${Z}=${Y.toISOString()}`;if(J!=="deepObject"&&!$){let V=[];Object.entries(Y).forEach(([z,L])=>{V=[...V,z,O?L:encodeURIComponent(L)]});let K=V.join(",");switch(J){case"form":return`${Z}=${K}`;case"label":return`.${K}`;case"matrix":return`;${Z}=${K}`;default:return K}}let W=mO(J),G=Object.entries(Y).map(([V,K])=>f({allowReserved:O,name:J==="deepObject"?`${Z}[${V}]`:V,value:K})).join(W);return J==="label"||J==="matrix"?W+G:G};var lO=/\{[^{}]+\}/g,nO=({path:O,url:$})=>{let Z=$,J=$.match(lO);if(J)for(let Y of J){let D=!1,W=Y.substring(1,Y.length-1),G="simple";if(W.endsWith("*"))D=!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=O[W];if(V===void 0||V===null)continue;if(Array.isArray(V)){Z=Z.replace(Y,p({explode:D,name:W,style:G,value:V}));continue}if(typeof V==="object"){Z=Z.replace(Y,i({explode:D,name:W,style:G,value:V,valueOnly:!0}));continue}if(G==="matrix"){Z=Z.replace(Y,`;${f({name:W,value:V})}`);continue}let K=encodeURIComponent(G==="label"?`.${V}`:V);Z=Z.replace(Y,K)}return Z},w$=({baseUrl:O,path:$,query:Z,querySerializer:J,url:Y})=>{let D=Y.startsWith("/")?Y:`/${Y}`,W=(O??"")+D;if($)W=nO({path:$,url:W});let G=Z?J(Z):"";if(G.startsWith("?"))G=G.substring(1);if(G)W+=`?${G}`;return W};function e(O){let $=O.body!==void 0;if($&&O.bodySerializer){if("serializedBody"in O)return O.serializedBody!==void 0&&O.serializedBody!==""?O.serializedBody:null;return O.body!==""?O.body:null}if($)return O.body;return}var F$=async(O,$)=>{let Z=typeof $==="function"?await $(O):$;if(!Z)return;if(O.scheme==="bearer")return`Bearer ${Z}`;if(O.scheme==="basic")return`Basic ${btoa(Z)}`;return Z};var $$={bodySerializer:(O)=>JSON.stringify(O,($,Z)=>typeof Z==="bigint"?Z.toString():Z)};var q$=({parameters:O={},...$}={})=>{return(J)=>{let Y=[];if(J&&typeof J==="object")for(let D in J){let W=J[D];if(W===void 0||W===null)continue;let G=O[D]||$;if(Array.isArray(W)){let V=p({allowReserved:G.allowReserved,explode:!0,name:D,style:"form",value:W,...G.array});if(V)Y.push(V)}else if(typeof W==="object"){let V=i({allowReserved:G.allowReserved,explode:!0,name:D,style:"deepObject",value:W,...G.object});if(V)Y.push(V)}else{let V=f({allowReserved:G.allowReserved,name:D,value:W});if(V)Y.push(V)}}return Y.join("&")}},E$=(O)=>{if(!O)return"stream";let $=O.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((Z)=>$.startsWith(Z)))return"blob";if($.startsWith("text/"))return"text";return},pO=(O,$)=>{if(!$)return!1;if(O.headers.has($)||O.query?.[$]||O.headers.get("Cookie")?.includes(`${$}=`))return!0;return!1};async function H$(O){for(let $ of O.security??[]){if(pO(O,$.name))continue;let Z=await F$($,O.auth);if(!Z)continue;let J=$.name??"Authorization";switch($.in){case"query":if(!O.query)O.query={};O.query[J]=Z;break;case"cookie":O.headers.append("Cookie",`${J}=${Z}`);break;case"header":default:O.headers.set(J,Z);break}}}var O$=(O)=>w$({baseUrl:O.baseUrl,path:O.path,query:O.query,querySerializer:typeof O.querySerializer==="function"?O.querySerializer:q$(O.querySerializer),url:O.url}),Z$=(O,$)=>{let Z={...O,...$};if(Z.baseUrl?.endsWith("/"))Z.baseUrl=Z.baseUrl.substring(0,Z.baseUrl.length-1);return Z.headers=s(O.headers,$.headers),Z},iO=(O)=>{let $=[];return O.forEach((Z,J)=>{$.push([J,Z])}),$},s=(...O)=>{let $=new Headers;for(let Z of O){if(!Z)continue;let J=Z instanceof Headers?iO(Z):Object.entries(Z);for(let[Y,D]of J)if(D===null)$.delete(Y);else if(Array.isArray(D))for(let W of D)$.append(Y,W);else if(D!==void 0)$.set(Y,typeof D==="object"?JSON.stringify(D):D)}return $};class r{fns=[];clear(){this.fns=[]}eject(O){let $=this.getInterceptorIndex(O);if(this.fns[$])this.fns[$]=null}exists(O){let $=this.getInterceptorIndex(O);return Boolean(this.fns[$])}getInterceptorIndex(O){if(typeof O==="number")return this.fns[O]?O:-1;return this.fns.indexOf(O)}update(O,$){let Z=this.getInterceptorIndex(O);if(this.fns[Z])return this.fns[Z]=$,O;return!1}use(O){return this.fns.push(O),this.fns.length-1}}var A$=()=>({error:new r,request:new r,response:new r}),rO=q$({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),sO={"Content-Type":"application/json"},b=(O={})=>({...$$,headers:sO,parseAs:"auto",querySerializer:rO,...O});var C=(O={})=>{let $=Z$(b(),O),Z=()=>({...$}),J=(z)=>{return $=Z$($,z),Z()},Y=A$(),D=async(z)=>{let L={...$,...z,fetch:z.fetch??$.fetch??globalThis.fetch,headers:s($.headers,z.headers),serializedBody:void 0};if(L.security)await H$(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,_=O$(M);return{opts:M,url:_}},W=async(z)=>{let L=z.throwOnError??$.throwOnError,M=z.responseStyle??$.responseStyle,_,S;try{let{opts:U,url:j}=await D(z),B={redirect:"follow",...U,body:e(U)};_=new Request(j,B);for(let Q of Y.request.fns)if(Q)_=await Q(_,U);let l=U.fetch;S=await l(_);for(let Q of Y.response.fns)if(Q)S=await Q(S,_,U);let E={request:_,response:S};if(S.ok){let Q=(U.parseAs==="auto"?E$(S.headers.get("Content-Type")):U.parseAs)??"json";if(S.status===204||S.headers.get("Content-Length")==="0"){let T;switch(Q){case"arrayBuffer":case"blob":case"text":T=await S[Q]();break;case"formData":T=new FormData;break;case"stream":T=S.body;break;case"json":default:T={};break}return U.responseStyle==="data"?T:{data:T,...E}}let w;switch(Q){case"arrayBuffer":case"blob":case"formData":case"text":w=await S[Q]();break;case"json":{let T=await S.text();w=T?JSON.parse(T):{};break}case"stream":return U.responseStyle==="data"?S.body:{data:S.body,...E}}if(Q==="json"){if(U.responseValidator)await U.responseValidator(w);if(U.responseTransformer)w=await U.responseTransformer(w)}return U.responseStyle==="data"?w:{data:w,...E}}let A=await S.text(),o;try{o=JSON.parse(A)}catch{}throw o??A}catch(U){let j=U;for(let B of Y.error.fns)if(B)j=await B(j,S,_,z);if(j=j||{},L)throw j;return M==="data"?void 0:{error:j,request:_,response:S}}},G=(z)=>(L)=>W({...L,method:z}),V=(z)=>async(L)=>{let{opts:M,url:_}=await D(L);return x$({...M,body:M.body,method:z,onRequest:async(S,U)=>{let j=new Request(S,U);for(let B of Y.request.fns)if(B)j=await B(j,M);return j},serializedBody:e(M),url:_})};return{buildUrl:(z)=>O$({...$,...z}),connect:G("CONNECT"),delete:G("DELETE"),get:G("GET"),getConfig:Z,head:G("HEAD"),interceptors:Y,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 tO={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},aO=Object.entries(tO),h$=(O,$)=>{if(!$)$=new Map;for(let Z of O)if("in"in Z){if(Z.key)$.set(Z.key,{in:Z.in,map:Z.map})}else if("key"in Z)$.set(Z.key,{map:Z.map});else if(Z.args)h$(Z.args,$);return $},oO=(O)=>{for(let[$,Z]of Object.entries(O))if(Z&&typeof Z==="object"&&!Array.isArray(Z)&&!Object.keys(Z).length)delete O[$]},X=(O,$)=>{let Z={body:Object.create(null),headers:Object.create(null),path:Object.create(null),query:Object.create(null)},J=h$($),Y;for(let[D,W]of O.entries()){if($[D])Y=$[D];if(!Y)continue;if("in"in Y)if(Y.key){let G=J.get(Y.key),V=G.map||Y.key;if(G.in)Z[G.in][V]=W}else Z.body=W;else for(let[G,V]of Object.entries(W??{})){let K=J.get(G);if(K)if(K.in){let z=K.map||G;Z[K.in][z]=V}else Z[K.map]=V;else{let z=aO.find(([L])=>G.startsWith(L));if(z){let[L,M]=z;Z[M][G.slice(L.length)]=V}else if("allowExtra"in Y&&Y.allowExtra){for(let[L,M]of Object.entries(Y.allowExtra))if(M){Z[L][G]=V;break}}}}}return oO(Z),Z};var k$=C(b({baseUrl:"http://localhost:4096"}));class I{client;constructor(O){this.client=O?.client??k$}}class P${defaultKey="default";instances=new Map;get(O){let $=this.instances.get(O??this.defaultKey);if(!$)throw Error('No SDK client found. Create one with "new QitQodeClient()" to fix this error.');return $}set(O,$){this.instances.set($??this.defaultKey,O)}}class g$ extends I{get(O){return(O?.client??this.client).get({url:"/global/config",...O})}update(O,$){let Z=X([O],[{args:[{key:"config",map:"body"}]}]);return($?.client??this.client).patch({url:"/global/config",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}}class f$ extends I{scan(O){return(O?.client??this.client).get({url:"/global/import/scan",...O})}run(O,$){let Z=X([O],[{args:[{in:"body",key:"sources"},{in:"body",key:"force"}]}]);return($?.client??this.client).post({url:"/global/import/run",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}}class b$ extends I{health(O){return(O?.client??this.client).get({url:"/global/health",...O})}event(O){return(O?.client??this.client).sse.get({url:"/global/event",...O})}dispose(O){return(O?.client??this.client).post({url:"/global/dispose",...O})}upgrade(O,$){let Z=X([O],[{args:[{in:"body",key:"target"}]}]);return($?.client??this.client).post({url:"/global/upgrade",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}_config;get config(){return this._config??=new g$({client:this.client})}_import;get import(){return this._import??=new f$({client:this.client})}}class C$ extends I{remove(O,$){let Z=X([O],[{args:[{in:"path",key:"providerID"}]}]);return($?.client??this.client).delete({url:"/auth/{providerID}",...$,...Z})}set(O,$){let Z=X([O],[{args:[{in:"path",key:"providerID"},{key:"auth",map:"body"}]}]);return($?.client??this.client).put({url:"/auth/{providerID}",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}}class v$ extends I{log(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}agents(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/agent",...$,...Z})}skills(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/skill",...$,...Z})}}class y$ extends I{list(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/workspace/adaptor",...$,...Z})}}class c$ extends I{list(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/workspace",...$,...Z})}create(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}status(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/workspace/status",...$,...Z})}remove(O,$){let Z=X([O],[{args:[{in:"path",key:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).delete({url:"/experimental/workspace/{id}",...$,...Z})}sessionRestore(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}_adaptor;get adaptor(){return this._adaptor??=new y$({client:this.client})}}class u$ extends I{get(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/console",...$,...Z})}listOrgs(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/console/orgs",...$,...Z})}switchOrg(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}}class d$ extends I{list(O,$){let Z=X([O],[{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",...$,...Z})}}class m$ extends I{list(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/resource",...$,...Z})}}class l$ extends I{_workspace;get workspace(){return this._workspace??=new c$({client:this.client})}_console;get console(){return this._console??=new u$({client:this.client})}_session;get session(){return this._session??=new d$({client:this.client})}_resource;get resource(){return this._resource??=new m$({client:this.client})}}class n$ extends I{list(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/project",...$,...Z})}current(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/project/current",...$,...Z})}initGit(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/project/git/init",...$,...Z})}update(O,$){let Z=X([O],[{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}",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}}class p$ extends I{list(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/pty",...$,...Z})}create(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}remove(O,$){let Z=X([O],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).delete({url:"/pty/{ptyID}",...$,...Z})}get(O,$){let Z=X([O],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/pty/{ptyID}",...$,...Z})}update(O,$){let Z=X([O],[{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}",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}connectToken(O,$){let Z=X([O],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/pty/{ptyID}/connect-token",...$,...Z})}connect(O,$){let Z=X([O],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/pty/{ptyID}/connect",...$,...Z})}}class i$ extends I{get(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/config",...$,...Z})}update(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"config",map:"body"}]}]);return($?.client??this.client).patch({url:"/config",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}providers(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/config/providers",...$,...Z})}}class r$ extends I{ids(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/tool/ids",...$,...Z})}list(O,$){let Z=X([O],[{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",...$,...Z})}}class s$ extends I{remove(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeRemoveInput",map:"body"}]}]);return($?.client??this.client).delete({url:"/experimental/worktree",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}list(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/experimental/worktree",...$,...Z})}create(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeCreateInput",map:"body"}]}]);return($?.client??this.client).post({url:"/experimental/worktree",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}reset(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeResetInput",map:"body"}]}]);return($?.client??this.client).post({url:"/experimental/worktree/reset",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}}class t$ extends I{list(O,$){let Z=X([O],[{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",...$,...Z})}create(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}status(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/session/status",...$,...Z})}delete(O,$){let Z=X([O],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).delete({url:"/session/{sessionID}",...$,...Z})}get(O,$){let Z=X([O],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/session/{sessionID}",...$,...Z})}update(O,$){let Z=X([O],[{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}",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}children(O,$){let Z=X([O],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/session/{sessionID}/children",...$,...Z})}init(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}fork(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}abort(O,$){let Z=X([O],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/abort",...$,...Z})}actors(O,$){let Z=X([O],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/session/{sessionID}/actors",...$,...Z})}todo(O,$){let Z=X([O],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/session/{sessionID}/todo",...$,...Z})}task(O,$){let Z=X([O],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/session/{sessionID}/task",...$,...Z})}unshare(O,$){let Z=X([O],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).delete({url:"/session/{sessionID}/share",...$,...Z})}share(O,$){let Z=X([O],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/share",...$,...Z})}diff(O,$){let Z=X([O],[{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",...$,...Z})}summarize(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}revert(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}unrevert(O,$){let Z=X([O],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/unrevert",...$,...Z})}messages(O,$){let Z=X([O],[{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",...$,...Z})}prompt(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}deleteMessage(O,$){let Z=X([O],[{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}",...$,...Z})}message(O,$){let Z=X([O],[{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}",...$,...Z})}promptAsync(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}command(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}predict(O,$){let Z=X([O],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/session/{sessionID}/predict",...$,...Z})}shell(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}}class a$ extends I{delete(O,$){let Z=X([O],[{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}",...$,...Z})}update(O,$){let Z=X([O],[{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}",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}}class o$ extends I{respond(O,$){let Z=X([O],[{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}",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}reply(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}list(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/permission",...$,...Z})}}class e$ extends I{balance(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/qredits/balance",...$,...Z})}}class $O extends I{list(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"sessionID"}]}]);return($?.client??this.client).get({url:"/workflows",...$,...Z})}resume(O,$){let Z=X([O],[{args:[{in:"path",key:"runID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/workflows/{runID}/resume",...$,...Z})}}class OO extends I{list(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/question",...$,...Z})}neverAsk(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/question/never-ask",...$,...Z})}setNeverAsk(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"enabled"}]}]);return($?.client??this.client).post({url:"/question/never-ask",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}reply(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}reject(O,$){let Z=X([O],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/question/{requestID}/reject",...$,...Z})}}class ZO extends I{list(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/bash-interactive",...$,...Z})}reply(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}}class XO extends I{_interactive;get interactive(){return this._interactive??=new ZO({client:this.client})}}class JO extends I{authorize(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}callback(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}}class YO extends I{list(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/provider",...$,...Z})}auth(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/provider/auth",...$,...Z})}_oauth;get oauth(){return this._oauth??=new JO({client:this.client})}}class WO extends I{list(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return($?.client??this.client).post({url:"/sync/history",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}}class GO extends I{start(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/sync/start",...$,...Z})}replay(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}_history;get history(){return this._history??=new WO({client:this.client})}}class VO extends I{text(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"pattern"}]}]);return($?.client??this.client).get({url:"/find",...$,...Z})}files(O,$){let Z=X([O],[{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",...$,...Z})}symbols(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"query"}]}]);return($?.client??this.client).get({url:"/find/symbol",...$,...Z})}}class DO extends I{list(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"path"}]}]);return($?.client??this.client).get({url:"/file",...$,...Z})}read(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"path"}]}]);return($?.client??this.client).get({url:"/file/content",...$,...Z})}status(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/file/status",...$,...Z})}}class zO extends I{subscribe(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).sse.get({url:"/event",...$,...Z})}}class LO extends I{remove(O,$){let Z=X([O],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).delete({url:"/mcp/{name}/auth",...$,...Z})}start(O,$){let Z=X([O],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/mcp/{name}/auth",...$,...Z})}callback(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}authenticate(O,$){let Z=X([O],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/mcp/{name}/auth/authenticate",...$,...Z})}}class IO extends I{status(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/mcp",...$,...Z})}add(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return($?.client??this.client).post({url:"/mcp",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}connect(O,$){let Z=X([O],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/mcp/{name}/connect",...$,...Z})}disconnect(O,$){let Z=X([O],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/mcp/{name}/disconnect",...$,...Z})}_auth;get auth(){return this._auth??=new LO({client:this.client})}}class KO extends I{next(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/tui/control/next",...$,...Z})}response(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return($?.client??this.client).post({url:"/tui/control/response",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}}class UO extends I{appendPrompt(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"}]}]);return($?.client??this.client).post({url:"/tui/append-prompt",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}openHelp(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/tui/open-help",...$,...Z})}openSessions(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/tui/open-sessions",...$,...Z})}openThemes(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/tui/open-themes",...$,...Z})}openModels(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/tui/open-models",...$,...Z})}submitPrompt(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/tui/submit-prompt",...$,...Z})}clearPrompt(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/tui/clear-prompt",...$,...Z})}executeCommand(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"command"}]}]);return($?.client??this.client).post({url:"/tui/execute-command",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}showToast(O,$){let Z=X([O],[{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",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}publish(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return($?.client??this.client).post({url:"/tui/publish",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}selectSession(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionID"}]}]);return($?.client??this.client).post({url:"/tui/select-session",...$,...Z,headers:{"Content-Type":"application/json",...$?.headers,...Z.headers}})}_control;get control(){return this._control??=new KO({client:this.client})}}class SO extends I{dispose(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).post({url:"/instance/dispose",...$,...Z})}}class jO extends I{get(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/path",...$,...Z})}}class MO extends I{get(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/vcs",...$,...Z})}diff(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"mode"}]}]);return($?.client??this.client).get({url:"/vcs/diff",...$,...Z})}}class QO extends I{list(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/command",...$,...Z})}}class TO extends I{status(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/lsp",...$,...Z})}}class _O extends I{status(O,$){let Z=X([O],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return($?.client??this.client).get({url:"/formatter",...$,...Z})}}class t extends I{static __registry=new P$;constructor(O){super(O);t.__registry.set(this,O?.key)}_global;get global(){return this._global??=new b$({client:this.client})}_auth;get auth(){return this._auth??=new C$({client:this.client})}_app;get app(){return this._app??=new v$({client:this.client})}_experimental;get experimental(){return this._experimental??=new l$({client:this.client})}_project;get project(){return this._project??=new n$({client:this.client})}_pty;get pty(){return this._pty??=new p$({client:this.client})}_config;get config(){return this._config??=new i$({client:this.client})}_tool;get tool(){return this._tool??=new r$({client:this.client})}_worktree;get worktree(){return this._worktree??=new s$({client:this.client})}_session;get session(){return this._session??=new t$({client:this.client})}_part;get part(){return this._part??=new a$({client:this.client})}_permission;get permission(){return this._permission??=new o$({client:this.client})}_qredits;get qredits(){return this._qredits??=new e$({client:this.client})}_workflow;get workflow(){return this._workflow??=new $O({client:this.client})}_question;get question(){return this._question??=new OO({client:this.client})}_bash;get bash(){return this._bash??=new XO({client:this.client})}_provider;get provider(){return this._provider??=new YO({client:this.client})}_sync;get sync(){return this._sync??=new GO({client:this.client})}_find;get find(){return this._find??=new VO({client:this.client})}_file;get file(){return this._file??=new DO({client:this.client})}_event;get event(){return this._event??=new zO({client:this.client})}_mcp;get mcp(){return this._mcp??=new IO({client:this.client})}_tui;get tui(){return this._tui??=new UO({client:this.client})}_instance;get instance(){return this._instance??=new SO({client:this.client})}_path;get path(){return this._path??=new jO({client:this.client})}_vcs;get vcs(){return this._vcs??=new MO({client:this.client})}_command;get command(){return this._command??=new QO({client:this.client})}_lsp;get lsp(){return this._lsp??=new TO({client:this.client})}_formatter;get formatter(){return this._formatter??=new _O({client:this.client})}}function NO(O){if(!O?.fetch)O={...O,fetch:(Z)=>{return Z.timeout=!1,fetch(Z)}};if(O?.directory)O.headers={...O.headers,"x-qitqode-directory":encodeURIComponent(O.directory)};return O}function eO(O,$,Z){if(!O)return;if(!$)return O;if(O===$)return $;if(Z&&O===Z($))return $;return O}function $1(O,$){if(O.method!=="GET"&&O.method!=="HEAD")return O;let Z=new URL(O.url),J=!1;for(let[D,W]of[["x-qitqode-directory","directory"],["x-qitqode-workspace","workspace"]]){let G=eO(O.headers.get(D),W==="directory"?$.directory:$.workspace,W==="directory"?encodeURIComponent:void 0);if(!G)continue;if(!Z.searchParams.has(W))Z.searchParams.set(W,G);J=!0}if(!J)return O;let Y=new Request(Z,O);return Y.headers.delete("x-qitqode-directory"),Y.headers.delete("x-qitqode-workspace"),Y}function O1(O){if(O=NO(O),O?.experimental_workspaceID)O.headers={...O.headers,"x-qitqode-workspace":O.experimental_workspaceID};let $=C(O);return $.interceptors.request.use((Z)=>$1(Z,{directory:O?.directory,workspace:O?.experimental_workspaceID})),$.interceptors.response.use((Z)=>{if(Z.headers.get("content-type")==="text/html")throw Error("Request is not supported by this version of QitQode Server (Server responded with text/html)");return Z}),new t({client:$})}var W1=J1(Y1(),1);import xO from"path";var V1="QITQODE_KEY was rejected by the server (401/403). Check that the key is correct and has not expired.",Y$=`[qitqode] ${V1}`;function BO(O){if(O?.type!=="api"||typeof O.key!=="string")return;let Z=O.metadata?.method==="api-key"?"api-key":"sso";return{key:O.key,method:Z}}async function v(){if(process.env.QITQODE_KEY)return{key:process.env.QITQODE_KEY,method:"api-key"};let O=xO.join(J$.Path.data,"auth.json");try{let{readFile:$}=await import("fs/promises"),Z=await X$.withLock("auth-file",async()=>{let J=await $(O,"utf8"),Y=JSON.parse(J);return BO(Y?.forgewise)});if(Z)return Z}catch{}if(process.env.QITQODE_AUTH_CONTENT)try{let $=JSON.parse(process.env.QITQODE_AUTH_CONTENT);return BO($?.forgewise)}catch{}return}async function a(){if(process.env.QITQODE_KEY)return;let O=xO.join(J$.Path.data,"auth.json"),{readFile:$,writeFile:Z,chmod:J,rename:Y}=await import("fs/promises");await X$.withLock("auth-file",async()=>{let D=await $(O,"utf8"),W=JSON.parse(D);if(!("forgewise"in W))return;delete W.forgewise;let G=O+".tmp";await Z(G,JSON.stringify(W,null,2),"utf8"),await J(G,384),await Y(G,O)})}function y(O){return O.method==="api-key"?{"x-api-key":O.key}:{authorization:`Bearer ${O.key}`}}var Q$={};D1(Q$,{toolDescriptionEffect:()=>T1,resolveWorkflowSummaries:()=>j1,resolveWorkflowSpec:()=>M1,resolveToolManifest:()=>fO,resolveToolDescription:()=>bO,resolveTierRatings:()=>F1,resolveSubmitBatch:()=>b1,resolveRetrieveBatch:()=>C1,resolvePrompt:()=>kO,resolveListTiers:()=>w1,resolveGetHistory:()=>H1,resolveGenerateInlineComments:()=>P1,resolveGenerateDocumentation:()=>k1,resolveForgewiseConfig:()=>x1,resolveFetchQreditsBalance:()=>A1,resolveCompressTrajectorySafe:()=>q1,resolveChatCompletion:()=>f1,resolveChatBoolean:()=>g1,resolveBraveSearch:()=>E1,resolveBashArity:()=>Q1,resolveAnalyzeCodeForIssues:()=>h1,resolveAgentPrompt:()=>U1,remoteStats:()=>x,isBackendBillingError:()=>z1,clearRemoteCache:()=>K1,beginIdempotentAttempt:()=>hO,BackendRemote:()=>Q$,BackendRateLimitError:()=>m,BackendInsufficientBalanceError:()=>d,BackendAuthRejectedError:()=>H,BackendAccountNotLinkedError:()=>U$});import{createHash as AO,randomUUID as wO}from"crypto";var N=FO.create({service:"backend.remote"}),I$=30000,K$=5000,P=new Map,x={failures:0,authRejections:0,missingPrompts:0,missingToolDescriptions:0},W$=new Set,G$=new Set;class H extends Error{name="BackendAuthRejectedError";constructor(O){super(u.copy().invalidCredentials(O))}}class d extends Error{name="BackendInsufficientBalanceError";status=402;code;constructor(O,$){super(u.copy().insufficientBalance(O));this.code=$}}class m extends Error{name="BackendRateLimitError";status=429;retryAfterMs;constructor(O,$){let Z=O!==void 0?` Retry in about ${Math.max(1,Math.round(O/1000))}s.`:"";super(u.copy().rateLimit+Z+($?` (${$})`:""));this.retryAfterMs=O}}class U$ extends Error{name="BackendAccountNotLinkedError";status=409;constructor(O){super(u.copy().accountNotLinked(O))}}function z1(O){return O instanceof d||O instanceof m}var L1=600000,k=new Map;function I1(O,$){try{return AO("sha256").update(`${O}\x00${JSON.stringify($)}`).digest("hex").slice(0,16)}catch{return"unscoped"}}function hO(O,$,Z){let J=Date.now(),Y;try{Y=AO("sha256").update(`${O}\x00${$}\x00${JSON.stringify(Z)??""}`).digest("hex")}catch{return{key:`${$}-${wO()}`,settle:()=>{}}}let D=()=>k.delete(Y),W=k.get(Y);if(W&&W.expires>J)return{key:W.key,settle:D};if(k.size>256){for(let[V,K]of k)if(K.expires<=J)k.delete(V)}let G=`${$}-${Y.slice(0,16)}-${wO()}`;return k.set(Y,{key:G,expires:J+L1}),{key:G,settle:D}}function K1(){P.clear(),z$.clear(),V$.clear(),W$.clear(),G$.clear(),k.clear()}async function g(O,$){let Z=R.QITQODE_BACKEND_URL,J=Date.now(),Y=`${Z}::${O}`,D=P.get(Y);if(D&&D.expires>J)return D.value;try{let W=await v(),G=W?y(W):void 0,K=await $(HO({baseUrl:Z,headers:G,fetch:(z,L)=>fetch(z,{...L,signal:L?.signal??AbortSignal.timeout(K$)})}));return P.set(Y,{value:K,expires:J+I$}),K}catch(W){if(W instanceof EO){if(x.authRejections++,await a().catch(()=>{}),N.warn("backend rejected the credential; prompting re-auth",{cacheKey:O,baseUrl:Z,status:W.status}),process.env.QITQODE_KEY)N.error(Y$),console.error(Y$);throw new H(`HTTP ${W.status}`)}throw x.failures++,N.warn("backend request failed; surfacing error",{cacheKey:O,baseUrl:Z,error:W instanceof Error?W.message:String(W)}),W}}async function kO(O){if(O.indexOf("/")<=0)return;return g(`prompt:${O}`,($)=>$.prompt(O).then((Z)=>Z??void 0))}async function U1(O){let $=`agent/${O}`,Z=await kO($);if(Z===void 0||Z===""){if(!W$.has(O))W$.add(O),x.missingPrompts++,N.warn("backend served no content for agent prompt; running with an empty prompt",{prompt:$,baseUrl:R.QITQODE_BACKEND_URL,missingPrompts:x.missingPrompts})}return Z}var V$=new Map;function D$(O){let $=V$.get(O);if(!$)$={unsupported:!1},V$.set(O,$);return $}async function S1(){let O=D$(R.QITQODE_BACKEND_URL);if(O.inFlight)return O.inFlight;let $=g("workflow.catalog",(Z)=>Z.workflowSpecs().then((J)=>J??void 0)).then((Z)=>{let J=new Map;for(let Y of Z??[])if(Y&&typeof Y.name==="string"&&typeof Y.script==="string")J.set(Y.name,Y);return J});O.inFlight=$;try{return await $}finally{if(O.inFlight===$)O.inFlight=void 0}}async function PO(O,$){let Z=R.QITQODE_BACKEND_URL;if(!D$(Z).unsupported)try{return O(await S1())}catch(J){if(!gO(J))throw J;D$(Z).unsupported=!0,N.warn("backend has no workflowSpecs route; falling back to per-name workflow lookups",{baseUrl:Z})}return $()}async function j1(){return PO((O)=>[...O.values()].map(({script:$,...Z})=>Z),()=>g("workflow.list",(O)=>O.workflowSummaries()))}async function M1(O){return PO(($)=>$.get(O),()=>g(`workflow.get:${O}`,($)=>$.workflowSpec(O).then((Z)=>Z??void 0)))}async function Q1(){return g("permission.arity",(O)=>O.bashArity())}var z$=new Map;function L$(O){let $=z$.get(O);if(!$)$={unsupported:!1},z$.set(O,$);return $}function gO(O){return O instanceof qO&&(O.status===404||O.status===501)}async function fO(){let O=L$(R.QITQODE_BACKEND_URL);if(O.inFlight)return O.inFlight;let $=g("tool.manifest",(Z)=>Z.toolManifest().then((J)=>J??void 0)).then((Z)=>{let J=new Map;for(let Y of Z??[])if(Y&&typeof Y.id==="string"&&typeof Y.description==="string")J.set(Y.id,Y.description);return J});O.inFlight=$;try{return await $}finally{if(O.inFlight===$)O.inFlight=void 0}}async function bO(O){let $=R.QITQODE_BACKEND_URL,Z;if(!L$($).unsupported)try{Z=(await fO()).get(O)}catch(J){if(!gO(J))throw J;L$($).unsupported=!0,N.warn("backend has no toolManifest route; falling back to one request per tool description",{baseUrl:$})}if(Z===void 0||Z==="")Z=await g(`tool.description:${O}`,(J)=>J.toolDescription(O).then((Y)=>Y??void 0));if(Z===void 0||Z===""){if(!G$.has(O))G$.add(O),x.missingToolDescriptions++,N.warn("backend served no content for tool description; running with an empty description",{tool:O,baseUrl:R.QITQODE_BACKEND_URL,missingToolDescriptions:x.missingToolDescriptions})}return Z}function T1(O){return c.promise(()=>bO(O)).pipe(c.catchDefect(($)=>$ instanceof H?c.succeed(void 0):c.die($)))}function _1(O){if(!O)return{};try{let $=JSON.parse(O);if($&&typeof $==="object")return{code:typeof $.error==="string"?$.error:void 0,detail:typeof $.message==="string"?$.message:void 0}}catch{}return{detail:O.slice(0,300)}}function N1(O){let $=O.headers?.get?.("retry-after-ms");if($){let J=Number.parseFloat($);if(!Number.isNaN(J))return J}let Z=O.headers?.get?.("retry-after");if(Z){let J=Number.parseFloat(Z);if(!Number.isNaN(J))return Math.ceil(J*1000);let Y=Date.parse(Z)-Date.now();if(!Number.isNaN(Y)&&Y>0)return Math.ceil(Y)}return}async function S$(O,$){let Z=await O.text().catch(()=>""),{code:J,detail:Y}=_1(Z);if(O.status===402)return new d(Y,J);if(O.status===409)return new U$(Y);if(O.status===429)return new m(N1(O),Y);let D=Y?`: ${Y}`:J?`: ${J}`:"";return Error(`${$} failed: ${O.status}${D}`)}function B1(O){if(O===null||typeof O!=="object")return O;if(O.data!==void 0)return O.data;let $={};for(let[Z,J]of Object.entries(O)){if(Z==="success"||Z==="data"||Z==="error"||Z==="message")continue;$[Z]=J}return Object.keys($).length>0?$:void 0}function j$(O,$){let{error:Z,message:J}=O;if(Z==="insufficient_balance")return new d(J,Z);if(Z==="rate_limited"||Z==="too_many_requests")return new m(void 0,J);return Error(`${$} returned failure: ${Z??"unknown error"}${J?` \u2014 ${J}`:""}`)}async function q(O,$,Z,J={}){let Y=R.QITQODE_BACKEND_URL,D=`${Y}::post:${O}`;if(!J.noCache){let W=Date.now(),G=P.get(D);if(G&&G.expires>W)return G.value}try{let W=await v(),G=W?y(W):{},V=J.billable?hO(I1(Y,G),$,Z):void 0,K=V?{"x-idempotency-key":V.key}:{},z=await fetch(`${Y}/${$}`,{method:"POST",headers:{"Content-Type":"application/json",...G,...K},body:JSON.stringify(Z),signal:J.signal});if(z.status===401||z.status===403){V?.settle();let U=await z.text().catch(()=>"");if(U.includes("ERR_GATEWAY_REQUIRED"))throw Error(`Backend routing error: ${U}`);throw x.authRejections++,await a().catch(()=>{}),N.warn("backend rejected the credential; prompting re-auth",{fnName:$,baseUrl:Y,status:z.status}),new H(`HTTP ${z.status}`)}if(!z.ok){let U=await S$(z,`Backend POST /${$}`);if(z.status<500)V?.settle();throw U}let L=await z.json(),M=L!==null&&typeof L==="object"&&typeof L.error==="string";if((!J.acceptTopLevel||typeof L?.success==="boolean"||M)&&!L.success)throw V?.settle(),j$(L,`Backend POST /${$}`);V?.settle();let S=J.acceptTopLevel?B1(L):L.data;if(!J.noCache)P.set(D,{value:S,expires:Date.now()+I$});return S}catch(W){if(W instanceof H)throw W;throw x.failures++,N.warn("backend POST request failed; surfacing error",{fnName:$,baseUrl:Y,error:W instanceof Error?W.message:String(W)}),W}}async function M$(O,$,Z={}){let J=R.QITQODE_BACKEND_URL;try{let Y=await v(),D=Y?y(Y):{},W=new URLSearchParams(Object.entries($).map(([z,L])=>[z,String(L)])).toString(),G=W?`${J}/${O}?${W}`:`${J}/${O}`,V=await fetch(G,{method:"GET",headers:{...D},signal:Z.signal});if(V.status===401||V.status===403){let z=await V.text().catch(()=>"");if(z.includes("ERR_GATEWAY_REQUIRED"))throw Error(`Backend routing error: ${z}`);throw x.authRejections++,await a().catch(()=>{}),N.warn("backend rejected the credential; prompting re-auth",{fnName:O,baseUrl:J,status:V.status}),new H(`HTTP ${V.status}`)}if(!V.ok)throw await S$(V,`Backend GET /${O}`);let K=await V.json();if(!K.success)throw j$(K,`Backend GET /${O}`);return K.data}catch(Y){if(Y instanceof H)throw Y;throw x.failures++,N.warn("backend GET request failed; surfacing error",{fnName:O,baseUrl:J,error:Y instanceof Error?Y.message:String(Y)}),Y}}async function R1(O,$,Z){let J=R.QITQODE_BACKEND_URL,Y=`${J}::public:${O}`,D=Date.now(),W=P.get(Y);if(W&&W.expires>D)return W.value;try{let G=await fetch(`${J}/${$}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Z),signal:AbortSignal.timeout(K$)});if(!G.ok)throw await S$(G,`Backend public POST /${$}`);let V=await G.json();if(!V.success)throw j$(V,`Backend public POST /${$}`);let K=V.data;return P.set(Y,{value:K,expires:D+I$}),K}catch(G){throw x.failures++,N.warn("backend public request failed; surfacing error",{fnName:$,baseUrl:J,error:G instanceof Error?G.message:String(G)}),G}}async function x1(){try{return await R1("forgewise.config","forgewiseConfig",{})}catch(O){let $=await v().catch(()=>null);if(!$)throw O;let Z=R.QITQODE_BACKEND_URL,J=await fetch(`${Z}/forgewiseConfig`,{method:"POST",headers:{"Content-Type":"application/json",...y($)},body:JSON.stringify({}),signal:AbortSignal.timeout(K$)}).catch(()=>null);if(!J?.ok)throw O;let Y=await J.json().catch(()=>null);if(!Y?.success)throw O;return Y.data}}async function w1(){return M$("listTiers",{}).then((O)=>{if(!Array.isArray(O))return[];return O.flatMap(($)=>{if(typeof $==="string")return[{id:$}];if(!$||typeof $!=="object"||Array.isArray($))return[];let Z=$;return typeof Z.id==="string"?[{id:Z.id,...typeof Z.label==="string"?{label:Z.label}:{},...typeof Z.providerID==="string"?{providerID:Z.providerID}:{},...typeof Z.modelID==="string"?{modelID:Z.modelID}:{}}]:[]})}).catch((O)=>{return N.warn("listTiers fetch failed; using hardcoded tier fallback",{error:O instanceof Error?O.message:String(O)}),[]})}async function F1(){return M$("TIER_RATINGS",{}).catch((O)=>{N.warn("TIER_RATINGS fetch failed; no tier ratings will be shown",{error:O instanceof Error?O.message:String(O)});return})}async function q1(O){return q("compaction.trajectory","compressTrajectorySafe",O,{noCache:!0,billable:!0,signal:AbortSignal.timeout(120000)})}async function E1(O,$){let Z=$?.timeoutMs??30000,J={query:O};if($?.numResults)J.options={count:$.numResults};return q("brave.search","braveSearch",J,{noCache:!0,signal:AbortSignal.timeout(Z)})}async function H1(O){return q("qredits.history","getHistory",O,{noCache:!0})}async function A1(O){return q("forgewise.qredits.balance","fetchQreditsBalance",O,{noCache:!0,acceptTopLevel:!0})}async function h1(O){return q(`code.analyze:${O.filePath}`,"analyzeCodeForIssues",O,{noCache:!0,billable:!0,signal:AbortSignal.timeout(60000)})}async function k1(O){return q(`code.docs:${O.filePath}:${O.functionName??""}`,"generateDocumentation",O,{noCache:!0,billable:!0,signal:AbortSignal.timeout(60000)})}async function P1(O){return q(`code.comments:${O.filePath}`,"generateInlineComments",O,{noCache:!0,billable:!0,signal:AbortSignal.timeout(60000)})}async function g1(O,$,Z){return q("chat.boolean","chatBoolean",{sample:O,test:$},{noCache:!0,billable:!0,signal:AbortSignal.timeout(Z?.timeoutMs??30000)})}async function f1(O,$){let Z={message:O},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)Z.options=J;return q("chat.completion","chatCompletion",Z,{noCache:!0,billable:!0,signal:AbortSignal.timeout($?.timeoutMs??30000)})}async function b1(O){return q("batch.submit","submitBatch",O,{noCache:!0,billable:!0,signal:AbortSignal.timeout(60000)})}async function C1(O){return M$("retrieveBatch",{batchId:O.batchId},{signal:AbortSignal.timeout(30000)})}
8
- export{NO as Lp,O1 as Mp,V1 as Np,Y$ as Op,v as Pp,a as Qp,H as Rp,d as Sp,m as Tp,U$ as Up,x1 as Vp,w1 as Wp,F1 as Xp,H1 as Yp,A1 as Zp,Q$ as _p};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{le as a,me as b,ne as c,oe as d,pe as e,qe as f,re as g}from"./chunk-dcndy4sr.js";import"./chunk-wgk7ynt3.js";import"./chunk-41v0x1jk.js";import"./chunk-a3a1trap.js";import"./chunk-3k2b05fv.js";export{g as fromEnv,c as ENV_SESSION,b as ENV_SECRET,a as ENV_KEY,d as ENV_EXPIRATION,e as ENV_CREDENTIAL_SCOPE,f as ENV_ACCOUNT_ID};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-3k2b05fv.js";var t="./highlights-r812a2qc.scm";export{t as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Id as q,Jd as K,Kd as D,Nd as L,Od as N}from"./chunk-x66ycpfs.js";import"./chunk-03xppy47.js";import{Vf as B}from"./chunk-p9cnzxb8.js";import{gh as G}from"./chunk-5e4fxy99.js";import"./chunk-8vg4fmg2.js";import"./chunk-zfcp509b.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-md8161zd.js";import"./chunk-yk97q51d.js";import"./chunk-e74efvj2.js";import{Fl as C}from"./chunk-st5jaszz.js";import"./chunk-a1hzeejj.js";import"./chunk-sjw56r2n.js";import"./chunk-nj4d554m.js";import"./chunk-eva3nqqb.js";import"./chunk-yprmd5b7.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-f3bnn9rf.js";import"./chunk-xqdrr7xg.js";import"./chunk-axdzm75h.js";import"./chunk-94pcpztx.js";import"./chunk-hw5qyht3.js";import"./chunk-z8gdmvgg.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import"./chunk-g6cyhxwg.js";import"./chunk-n96tvjgj.js";import"./chunk-pkc4ddw1.js";import"./chunk-xgr6jnd6.js";import"./chunk-a48t0g95.js";import"./chunk-yqk58hf6.js";import"./chunk-er38zew1.js";import"./chunk-dk975etf.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-nj2bbtmx.js";import{st as J}from"./chunk-tns5x4w0.js";import"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-kfmz2p27.js";import"./chunk-ee23d2nz.js";import"./chunk-3k2b05fv.js";var X={command:"upgrade [target]",describe:"upgrade qitqode to the latest or a specific version",builder:(z)=>{return z.positional("target",{describe:"version to upgrade to, for ex '0.1.48' or 'v0.1.48'",type:"string"}).option("method",{alias:"m",describe:"installation method to use",type:"string",choices:["curl","npm","pnpm","bun","brew","choco","scoop"]})},handler:async(z)=>{B.empty(),B.println(B.logo(" ")),B.empty(),K("Upgrade");let O=await G.runPromise(C.Service.use((j)=>j.method())),E=z.method??O;if(E==="unknown"){if(q.error(`qitqode is installed to ${process.execPath} and may be managed by a package manager`),!await N({message:"Install anyways?",options:[{label:"Yes",value:!0},{label:"No",value:!1}],initialValue:!1})){D("Done");return}}q.info("Using method: "+E);let F=z.target?z.target.replace(/^v/,""):await G.runPromise(C.Service.use((j)=>j.latest()));if(J===F){q.warn(`qitqode upgrade skipped: ${F} is already installed`),D("Done");return}q.info(`From ${J} \u2192 ${F}`);let H=L();H.start("Upgrading...");let x=await G.runPromise(C.Service.use((j)=>j.upgrade(E,F))).catch((j)=>j);if(x){if(H.stop("Upgrade failed",1),x instanceof C.UpgradeFailedError)if(E==="choco"&&x.stderr.includes("not running from an elevated command shell"))q.error("Please run the terminal as Administrator and try again");else q.error(x.stderr);else if(x instanceof Error)q.error(x.message);D("Done");return}H.stop("Upgrade complete"),D("Done")}};export{X as UpgradeCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$t as e,Nt as a,Zt as c,_t as d,bu as f,cu as h,du as i,eu as j,fu as k,hu as l,iu as m,xu as n}from"./chunk-tns5x4w0.js";import{Gu as b,Ru as g}from"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-3k2b05fv.js";export{f as getEnvInfo,a as Wildcard,m as Token,l as Rpc,b as Process,n as Log,k as Lock,j as Locale,i as LocalContext,h as Keybind,g as Filesystem,e as EffectUtil,d as Color,c as Archive};
@@ -1,5 +0,0 @@
1
- // @bun
2
- import{pt as w}from"./chunk-kv72hxkp.js";import{rt as z}from"./chunk-nj2bbtmx.js";import{zu as J}from"./chunk-e7v9trve.js";function H(j,v){return typeof j==="object"&&j!==null&&"_tag"in j&&j._tag===v}function V(j){if(w.hasName(j,"MCPFailed"))return`MCP server "${j.data?.name}" failed. Note, qitqode does not support MCP authentication yet.`;if(H(j,"AccountServiceError")||H(j,"AccountTransportError"))return j.message??"";if(w.hasName(j,"ProviderModelNotFoundError")){let k=j.data,A=Array.isArray(k?.suggestions)?k.suggestions:[];return[`Model not found: ${k?.providerID}/${k?.modelID}`,...A.length?["Did you mean: "+A.join(", ")]:[],"Try: `qitqode models` to list available models","Or check your config (qitqode.json) provider/model names"].join(`
3
- `)}if(w.hasName(j,"ProviderInitError"))return`Failed to initialize provider "${j.data?.providerID}". Check credentials and configuration.`;if(w.hasName(j,"ConfigJsonError")){let k=j.data;return`Config file at ${k?.path} is not valid JSON(C)`+(k?.message?`: ${k.message}`:"")}if(w.hasName(j,"ConfigDirectoryTypoError")){let k=j.data;return`Directory "${k?.dir}" in ${k?.path} is not valid. Rename the directory to "${k?.suggestion}" or remove it. This is a common typo.`}if(w.hasName(j,"ConfigFrontmatterError"))return j.data?.message??"";if(w.hasName(j,"ConfigInvalidError")){let k=j.data,A=k?.path,B=k?.message,K=Array.isArray(k?.issues)?k.issues:[];return[`Configuration is invalid${A&&A!=="config"?` at ${A}`:""}`+(B?`: ${B}`:""),...K.map((G)=>"\u21B3 "+G.message+" "+G.path.join("."))].join(`
4
- `)}if(w.hasName(j,"UICancelledError"))return"";let v=typeof j==="object"&&j!==null&&"name"in j?j.name:void 0;if(v==="QlexNotLoggedInError")return z.copy().notLoggedIn;if(v==="QlexInsufficientBalanceError")return(j.message??z.copy().insufficientBalanceFallback)+z.copy().insufficientBalanceCliSuffix;if(v==="QlexRateLimitError")return z.copy().rateLimit;if(v==="BackendInsufficientBalanceError")return(j.message??z.copy().insufficientBalanceFallback)+z.copy().insufficientBalanceCliSuffix;if(v==="BackendRateLimitError")return j.message??z.copy().rateLimit;if(v==="QlexInvalidCredentialsError")return j.message??z.copy().invalidCredentialsFallback}function W(j){return J(j)}function D({onlyFirst:j=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",j?void 0:"g")}var L=D();function M(j){if(typeof j!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof j}\``);return j.replace(L,"")}
5
- export{M as Jf,V as Kf,W as Lf};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ig as r}from"./chunk-rv1stdvb.js";import{cQ as o}from"./chunk-3k2b05fv.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-kjyw00jp.js")).toJSONSchema}catch{throw c}else try{t=(await import("./chunk-mq6jn47r.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"./chunk-3k2b05fv.js";var _="./libopentui-smaejjb8.so";export{_ as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{bq as a,cq as b,dq as c,eq as d,fq as e,gq as f,hq as g,iq as h,jq as i}from"./chunk-94pcpztx.js";import"./chunk-z8gdmvgg.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import"./chunk-g6cyhxwg.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-3k2b05fv.js";export{i as gateway,h as createGatewayProvider,h as createGateway,g as GatewayResponseError,d as GatewayRateLimitError,e as GatewayModelNotFoundError,c as GatewayInvalidRequestError,f as GatewayInternalServerError,a as GatewayError,b as GatewayAuthenticationError};
@@ -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-a1hzeejj.js";import"./chunk-sjw56r2n.js";import{Gn as b,Hn as c,In as d,Jn as e,Kn as f,Ln as g,Mn as h,Nn as i,On as j,Pn as k,Rn as l,Sn as m,Tn as n,Vn as o,Xn as p,co as q,do as r,en as a}from"./chunk-nj4d554m.js";import"./chunk-keveg5gx.js";import"./chunk-xqdrr7xg.js";import"./chunk-axdzm75h.js";import"./chunk-er38zew1.js";import"./chunk-dk975etf.js";import"./chunk-6p94fpbn.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-tns5x4w0.js";import"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-3k2b05fv.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{zd as a}from"./chunk-xd3xc1vv.js";import"./chunk-bzgj60w4.js";import"./chunk-3k2b05fv.js";export{a as dict};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ig as o}from"./chunk-rv1stdvb.js";import{cQ as n}from"./chunk-3k2b05fv.js";async function a(){try{let{toJsonSchema:t}=await import("./chunk-7eexey82.js");return t}catch{throw new o("@valibot/to-json-schema")}}export{a as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-3k2b05fv.js";var k="./opentui-drfwd3v7.dll";export{k as default};
@@ -1,3 +0,0 @@
1
- // @bun
2
- class M extends Error{name="BackendCallError";status;fn;constructor(j,x,I){super(`backend function call failed (${j}): ${x}${I?` ${I}`:""}`);this.status=j,this.fn=x}}class N extends Error{name="BackendAuthError";status;constructor(j,x){super(`backend authentication rejected (${j})${x?`: ${x}`:""}`);this.status=j}}function Q(j){if(!j)return!1;try{let x=JSON.parse(j);if(x&&x.code==="ERR_GATEWAY_REQUIRED")return!0}catch{}return j.includes("ERR_GATEWAY_REQUIRED")}function S(j){let x=j.fetch??fetch,I=j.baseUrl.replace(/\/+$/,"");async function z(D,P={}){let L=new Headers(j.headers);L.set("content-type","application/json");let H=await x(`${I}/${D}`,{method:"POST",headers:L,body:JSON.stringify(P)});if(!H.ok){let K=await H.text().catch(()=>"");if((H.status===401||H.status===403)&&!Q(K))throw new N(H.status,K||void 0);throw new M(H.status,D,K||void 0)}let J=await H.json();if(!J.success)throw Error(`backend function call returned failure: ${D} \u2014 ${J.error??"unknown error"}`);return J.data}return{promptNames:()=>z("promptNames"),prompt:(D)=>z("prompt",{name:D}),tiers:()=>z("tiers"),workflowSummaries:()=>z("workflowSummaries"),workflowSpec:(D)=>z("workflowSpec",{name:D}),workflowSpecs:()=>z("workflowSpecs"),bashArity:()=>z("bashArity"),toolManifest:()=>z("toolManifest"),toolDescription:(D)=>z("toolDescription",{id:D})}}
3
- export{M as kq,N as lq,Q as mq,S as nq};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{cQ as t}from"./chunk-3k2b05fv.js";var e=await import("./chunk-qsm9xw87.js",{with:{type:"file"}}),a=e.default;export{a as default};
@@ -1,8 +0,0 @@
1
- // @bun
2
- import{a as ZB,b as $B}from"./chunk-exmw8jfa.js";import"./chunk-8c1ypgw5.js";import"./chunk-1pg6pv0m.js";import{B as XB}from"./chunk-gsez13bg.js";import{C as BB,E as JB}from"./chunk-c8k32724.js";import"./chunk-11g2rpv8.js";import{I as VB}from"./chunk-t9mz17gb.js";import{O as YB}from"./chunk-6p7yg5sr.js";import"./chunk-x66ycpfs.js";import"./chunk-03xppy47.js";import{Rd as e}from"./chunk-yajd975f.js";import{Of as n,Pf as D,Qf as w,Rf as i}from"./chunk-w1n4rf6n.js";import{Vf as H}from"./chunk-p9cnzxb8.js";import{Cg as s}from"./chunk-srpe3v8e.js";import{gh as U}from"./chunk-5e4fxy99.js";import"./chunk-8vg4fmg2.js";import"./chunk-zfcp509b.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-md8161zd.js";import"./chunk-yk97q51d.js";import{Xj as R,ok as o,rl as r}from"./chunk-e74efvj2.js";import"./chunk-st5jaszz.js";import{km as O}from"./chunk-a1hzeejj.js";import"./chunk-sjw56r2n.js";import"./chunk-nj4d554m.js";import"./chunk-eva3nqqb.js";import"./chunk-yprmd5b7.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import{Mp as a,Pp as t}from"./chunk-f3bnn9rf.js";import"./chunk-xqdrr7xg.js";import"./chunk-axdzm75h.js";import"./chunk-94pcpztx.js";import"./chunk-hw5qyht3.js";import"./chunk-z8gdmvgg.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import"./chunk-g6cyhxwg.js";import"./chunk-n96tvjgj.js";import"./chunk-pkc4ddw1.js";import"./chunk-xgr6jnd6.js";import"./chunk-a48t0g95.js";import"./chunk-yqk58hf6.js";import"./chunk-er38zew1.js";import"./chunk-dk975etf.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import{qt as v}from"./chunk-nj2bbtmx.js";import{Ut as f,Vt as c,Wt as u,Yt as l,gu as g,ru as x}from"./chunk-tns5x4w0.js";import{Au as N,Ou as p,Qu as _}from"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import{OI as S}from"./chunk-a0rp7gh4.js";import"./chunk-kfmz2p27.js";import"./chunk-ee23d2nz.js";import{cQ as I}from"./chunk-3k2b05fv.js";import E from"path";import{fileURLToPath as HB}from"url";import{writeHeapSnapshot as KB}from"v8";import MB,{EOL as M}from"os";var zB={free:"free",default:"default",fast:"fast",economy:"economical",power:"power",orchestrated:"orchestrated"},T="build";function h(B){if(B.agent)return B.agent;if(B.headless||B.fullauto)return T;return}function jB(B){for(let[V,X]of Object.entries(zB))if(B[V]){let Z=v[X];if(Z)return`${Z.providerID}/${Z.modelID}`}return}function GB(B){return async(X,Z)=>{let Y=new Request(X,Z),W=Y.body?await Y.text():void 0,$=await B.call("fetch",{url:Y.url,method:Y.method,headers:Object.fromEntries(Y.headers.entries()),body:W});return new Response($.body,{status:$.status,headers:$.headers})}}function QB(B){return{subscribe:async(V)=>{return B.on("global.event",(X)=>{V(X)})}}}async function bB(){if(typeof globalThis.QITQODE_WORKER_PATH<"u")return globalThis.QITQODE_WORKER_PATH;let B=new URL("./cli/cmd/tui/worker.js",import.meta.url);if(await p(HB(B)))return B;return new URL("./worker.ts",import.meta.url)}async function PB(B){let V=process.stdin.isTTY?void 0:await Bun.stdin.text();if(!B)return V;if(!V)return B;return V+`
3
- `+B}async function d(B){let V=a({baseUrl:B.url,fetch:B.fetch,directory:B.directory}),X=[{permission:"question",action:"deny",pattern:"*"},{permission:"plan_enter",action:"deny",pattern:"*"},{permission:"plan_exit",action:"deny",pattern:"*"}],Y=(await V.session.create({permission:X})).data?.id;if(!Y){H.error("headless: failed to create session");return}let W=await V.event.subscribe(),$=YB({sessionID:Y,query:async()=>{return(await V.session.status()).data?.[Y]}}),A=W.stream[Symbol.asyncIterator](),P=$.completion.then(()=>"DONE");(async()=>{try{while(!0){let z=await Promise.race([A.next(),P]);if(z==="DONE")break;let y=z;if(y.done)break;let j=y.value;$.onEvent(j);let K=j.properties;if(j.type==="message.part.updated"){let J=K?.part;if(!J||J.sessionID!==Y)continue;if(J.type==="text"&&J.time?.end){let C=String(J.text??"").trim();if(C)process.stdout.write(C+M)}}if(j.type==="permission.asked"){if(!K||K.sessionID!==Y)continue;await V.permission.reply({requestID:String(K.id),reply:"once"})}if(j.type==="session.error"){if(!K||K.sessionID!==Y||!K.error)continue;let J=K.error,C=J?.data!==null&&typeof J?.data==="object"&&"message"in J.data?String(J.data.message):String(J?.name??J);H.error(C)}}}finally{$.stop(),await A.return?.(void 0).catch(()=>{})}})().catch((z)=>{console.error(z),process.exit(1)});let q=B.model?r.parseModel(B.model):void 0;await V.session.prompt({sessionID:Y,agent:B.agent,model:q,parts:[{type:"text",text:B.prompt}]}),$.markStarted(),await $.completion}var nB=e({command:"$0 [project]",describe:"start qitqode tui",builder:(B)=>n(B).positional("project",{type:"string",describe:"path to start qitqode in"}).options(i).option("never-ask",{type:"boolean",describe:"start in never-ask mode \u2014 auto-decide without asking (permissions excluded), toggle at runtime with /never-ask",default:!1}).check((V)=>{if(V.dark&&V.light)throw Error("--dark and --light are mutually exclusive");if(V.sso&&!V.headless)throw Error("--sso requires --headless");if(V.sso&&V["api-key"]!==void 0)throw Error("--sso and --api-key are mutually exclusive");let X=Object.keys(zB).filter((Z)=>V[Z]);if(X.length>1)throw Error(`${X.map((Z)=>`--${Z}`).join(" and ")} are mutually exclusive \u2014 choose one tier flag`);if(X.length===1&&V.model)throw Error(`--${X[0]} and --model are mutually exclusive \u2014 use one or the other`);return!0}),handler:async(B)=>{if(B.monochrome)process.env.QITQODE_TUI_ACCESSIBLE="1",process.env.NO_COLOR="1";let V=JB();try{BB();let X=XB(B);if(X){H.error(X),process.exitCode=1;return}let Z=jB(B)??B.model,Y=_(process.env.PWD??process.cwd()),W=B.project?_(E.isAbsolute(B.project)?B.project:E.join(Y,B.project)):_(process.cwd()),$=O(W);if($){if(B.project){H.error("Cannot start in "+W+": "+$),process.exitCode=1;return}let J=_(MB.homedir());if(O(J)){H.error("Cannot start in "+W+": "+$),process.exitCode=1;return}x.warn("unsafe start directory, falling back to home",{requested:W,home:J}),W=J}let A=await bB();try{process.chdir(W)}catch{H.error("Failed to change directory to "+W);return}let P=_(process.cwd()),k=l({[c]:"worker",[f]:u()}),q=new Worker(A,{env:k});q.onerror=(J)=>{x.error("thread error",{message:J.message,filename:J.filename,lineno:J.lineno,colno:J.colno,error:J.error})};let z=g(q),y=()=>{z.call("reload",void 0).catch((J)=>{x.warn("worker reload failed",{error:N(J)})})};process.on("SIGUSR2",y);let j=!1,K=async()=>{if(j)return;j=!0,process.off("SIGUSR2",y),await o(z.call("shutdown",void 0),5000).catch((J)=>{x.warn("worker shutdown failed",{error:N(J)})}),q.terminate()};try{let J=import("./chunk-496ajawz.js"),C=import("./chunk-e8ws454m.js").then(({TuiConfig:F})=>F.get()),L=await PB(B.prompt),WB=await C;if(B.headless&&D(w(B))){H.error("--headless cannot be combined with network-listener flags (--port, --hostname, --mdns)"),process.exitCode=1;return}let m=w(B),b=D(m)?{url:(await z.call("server",m)).url,fetch:void 0,events:void 0}:{url:"http://qitqode.internal",fetch:GB(z),events:QB(z)};if(setTimeout(()=>{z.call("checkUpgrade",{directory:P}).catch(()=>{})},1000).unref?.(),B.headless){if(!L){H.error("--headless requires a prompt: pass --prompt or pipe input via stdin"),process.exitCode=1;return}if(B.sso){try{let G=await s({tryOpen:!1,onCode:(Q)=>{if(process.stdout.write(M),process.stdout.write(" To sign in, open: "+Q.verificationUri+M),process.stdout.write(" and enter code: "+Q.userCode+M),Q.verificationUriComplete)process.stdout.write(M+" Or open this link directly:"+M+" "+Q.verificationUriComplete+M);process.stdout.write(M+" Waiting for approval... (ctrl+c to cancel)"+M)}});await U.runPromise(S.gen(function*(){yield*(yield*R.Service).set("forgewise",VB(G,{rotateRefreshToken:!0}))})),process.stdout.write(" Signed in as "+(G.name||G.email)+M)}catch(G){H.error("SSO sign-in failed: "+N(G)),process.exitCode=1;return}await d({url:b.url,fetch:b.fetch,prompt:L,model:Z,agent:h(B)??T,directory:P});return}let F=ZB(typeof B["api-key"]==="string"?String(B["api-key"]):"");if(F)await U.runPromise($B(F));else if(!await U.runPromise(S.gen(function*(){if(yield*S.promise(()=>t()))return!0;return!!(yield*(yield*R.Service).get("forgewise"))}))){H.error(`Not signed in. Use one of:
4
- qode auth login (browser / device-code flow)
5
- qode auth login --api-key (paste a Qortex API key)
6
- --api-key <key> (inline for this run)
7
- $QLEX_API_KEY (environment variable)
8
- $QITQODE_KEY (environment variable)`),process.exitCode=1;return}await d({url:b.url,fetch:b.fetch,prompt:L,model:Z,agent:h(B)??T,directory:P})}else{let{tui:F}=await J;await F({url:b.url,async onSnapshot(){let G=KB("tui.heapsnapshot"),Q=await z.call("snapshot",void 0);return[G,Q]},config:WB,directory:P,fetch:b.fetch,events:b.events,args:{continue:B.continue,sessionID:B.session,agent:h(B),model:Z,prompt:L,fork:B.fork,neverAsk:B["never-ask"]||B.fullauto||!1,fullauto:B.fullauto||!1,themeMode:B.dark?"dark":B.light?"light":void 0,monochrome:B.monochrome||!1,headless:!1}})}}finally{await K()}}finally{V?.()}process.exit(0)}});export{h as resolveStartupAgent,nB as TuiThreadCommand};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{ru as c,uu as i}from"./chunk-tns5x4w0.js";import{Au as s}from"./chunk-e7v9trve.js";function f(u){let n=!1,o=(e,a)=>{if(n)return;n=!0,process.exitCode=1,c.error(e,{error:s(a),process_role:u});let l=setTimeout(()=>process.exit(1),1000);i().finally(()=>{clearTimeout(l),process.exit(1)})},t=(e)=>o("unhandled rejection",e),r=(e)=>o("uncaught exception",e);return process.on("unhandledRejection",t),process.on("uncaughtException",r),()=>{process.off("unhandledRejection",t),process.off("uncaughtException",r)}}
3
- export{f as ot};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ig as t}from"./chunk-rv1stdvb.js";import{cQ as o}from"./chunk-3k2b05fv.js";async function e(){try{let{toJSONSchema:r}=await import("./chunk-7vd91wsd.js");return r}catch{throw new t("sury")}}export{e as default};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{Tu as e}from"./chunk-m4j7jyrd.js";class s extends Error{static hasName(t,n){return typeof t==="object"&&t!==null&&"name"in t&&t.name===n}static create(t,n){let r=e.object({name:e.literal(t),data:n}).meta({ref:t}),c=class extends s{data;static Schema=r;name=t;constructor(a,o){super(t,o);this.data=a;this.name=t}static isInstance(a){return typeof a==="object"&&"name"in a&&a.name===t}schema(){return r}toObject(){return{name:t,data:this.data}}};return Object.defineProperty(c,"name",{value:t}),c}static Unknown=s.create("UnknownError",e.object({message:e.string()}))}
3
- export{s as pt};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{pv as o}from"./chunk-gmzrvxnv.js";var e=o;
3
- export{e as Tu};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$A as yb,AA as bb,BA as cb,CA as db,DA as eb,GA as fb,HA as gb,IA as hb,JA as ib,KA as jb,LA as kb,OA as lb,PA as mb,QA as nb,RA as ob,SA as pb,TA as qb,UA as rb,VA as sb,WA as tb,XA as ub,YA as vb,ZA as wb,_A as xb,aB as zb,bB as Ab,cB as Bb,dB as Cb,eB as Db,fB as Eb,gA as A,gB as Fb,hA as ga,iA as Ba,jA as Ma,kA as Na,mA as Oa,nA as Pa,oA as Qa,pA as Ra,qA as Sa,rA as Ta,sA as Ua,tA as Va,uA as Wa,vA as Ya,wA as Za,xA as _a,yA as $a,zA as ab}from"./chunk-wfd5h6ax.js";import{$B as m,$I as aa,AF as I,AL as ua,AO as Ea,AP as Ja,BG as T,BO as Fa,CL as va,DP as Ka,FJ as fa,FK as qa,FL as wa,GC as s,GG as U,HF as J,HG as V,ID as y,JD as z,KB as i,KD as B,KG as W,KP as La,MF as K,ML as xa,NP as Xa,OI as X,PL as ya,QI as Y,RI as Z,RL as za,SB as j,TC as t,TI as _,VB as k,VJ as ha,WI as $,XB as l,XF as L,YD as C,bD as u,bK as ia,cC as n,cJ as ba,dD as v,dK as ja,eK as ka,eL as ra,fC as o,fJ as ca,hK as la,iB as a,iC as p,iE as D,kB as b,kD as w,kK as ma,lB as c,lG as M,mE as E,mG as N,nE as F,nP as Ga,oC as q,oO as Aa,pC as r,qG as O,rJ as da,sB as d,sD as x,sG as P,sO as Ca,tB as e,tE as G,tF as H,tJ as ea,uB as f,uG as Q,vB as g,vG as R,vK as na,vP as Ha,wB as h,wG as S,wL as sa,wO as Da,xK as oa,xL as ta,yK as pa,zP as Ia}from"./chunk-a0rp7gh4.js";import"./chunk-3k2b05fv.js";export{e as pipe,b as identity,g as hole,f as flow,c as cast,d as absurd,r as Utils,Fb as Unify,ua as UndefinedOr,Eb as Types,Db as TxSubscriptionRef,Cb as TxSemaphore,tb as TxRef,Bb as TxReentrantLock,zb as TxQueue,Ab as TxPubSub,yb as TxPriorityQueue,xb as TxHashSet,wb as TxHashMap,vb as TxDeferred,ub as TxChunk,v as Tuple,sb as Trie,G as Tracer,rb as Terminal,pa as Take,hb as SynchronizedRef,qb as Symbol,pb as SubscriptionRef,ta as Struct,R as String,Ga as Stream,ob as Stdio,Da as Sink,oa as Semaphore,ib as ScopedRef,nb as ScopedCache,L as Scope,mb as SchemaUtils,ca as SchemaTransformation,lb as SchemaRepresentation,va as SchemaParser,aa as SchemaIssue,ba as SchemaGetter,da as SchemaAST,Aa as Schema,F as Scheduler,U as Schedule,kb as Runtime,u as Result,jb as Resource,gb as RequestResolver,V as Request,Y as RegExp,K as References,fb as Ref,l as Reducer,$ as Redacted,o as Redactable,x as Record,Fa as RcRef,Ea as RcMap,eb as Random,na as Queue,T as Pull,ma as PubSub,Ta as PrimaryKey,i as Predicate,db as Pool,Ca as PlatformError,a as Pipeable,Ia as Path,cb as PartitionedSemaphore,bb as Ordering,s as Order,t as Option,za as Optic,Q as Number,ab as NonEmptyIterable,$a as Newtype,la as MutableRef,ka as MutableList,_a as MutableHashSet,fa as MutableHashMap,W as Metric,Za as Match,Ya as ManagedRuntime,Xa as Logger,Ka as LogLevel,Wa as LayerMap,M as Layer,ja as Latch,ya as JsonSchema,wa as JsonPointer,xa as JsonPatch,w as Iterable,q as Inspectable,sa as HashSet,Ua as HashRing,ra as HashMap,j as Hash,Va as HKT,Sa as Graph,h as Function,p as Formatter,E as Filter,Ha as FileSystem,Ra as FiberSet,Qa as FiberMap,Pa as FiberHandle,ia as Fiber,I as Exit,N as ExecutionPlan,Oa as ErrorReporter,m as Equivalence,k as Equal,_ as Encoding,X as Effect,D as Duration,Na as Differ,J as Deferred,Z as DateTime,O as Data,S as Cron,C as Context,Ma as Console,Ja as ConfigProvider,La as Config,n as Combiner,P as Clock,ha as Chunk,Ba as ChannelSchema,qa as Channel,H as Cause,ga as Cache,ea as Brand,B as Boolean,A as BigInt,z as BigDecimal,y as Array};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{cQ as t}from"./chunk-3k2b05fv.js";var e=await import("./chunk-e7ah0e61.js",{with:{type:"file"}}),a=e.default;export{a as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ed as j}from"./chunk-aa8hymcv.js";import{Rd as Q}from"./chunk-yajd975f.js";import{Vf as M}from"./chunk-p9cnzxb8.js";import{og as N}from"./chunk-tbgczapt.js";import{gh as $}from"./chunk-5e4fxy99.js";import"./chunk-8vg4fmg2.js";import"./chunk-zfcp509b.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-md8161zd.js";import"./chunk-yk97q51d.js";import{Cl as X,kk as J}from"./chunk-e74efvj2.js";import"./chunk-st5jaszz.js";import"./chunk-a1hzeejj.js";import"./chunk-sjw56r2n.js";import"./chunk-nj4d554m.js";import"./chunk-eva3nqqb.js";import"./chunk-yprmd5b7.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-f3bnn9rf.js";import"./chunk-xqdrr7xg.js";import{aq as _}from"./chunk-axdzm75h.js";import"./chunk-94pcpztx.js";import"./chunk-hw5qyht3.js";import"./chunk-z8gdmvgg.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import"./chunk-g6cyhxwg.js";import"./chunk-n96tvjgj.js";import"./chunk-pkc4ddw1.js";import"./chunk-xgr6jnd6.js";import"./chunk-a48t0g95.js";import"./chunk-yqk58hf6.js";import"./chunk-er38zew1.js";import"./chunk-dk975etf.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-nj2bbtmx.js";import{eu as Y,ou as Z}from"./chunk-tns5x4w0.js";import{Gu as E,Ru as V}from"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-kfmz2p27.js";import"./chunk-ee23d2nz.js";import"./chunk-3k2b05fv.js";import{EOL as L}from"os";import k from"path";function P(){let q=["-R","-S"];if(process.platform!=="win32")return["less",...q];let z=_("less");if(z){if(V.stat(z)?.size)return[z,...q]}if(Z.QITQODE_GIT_BASH_PATH){let G=k.join(Z.QITQODE_GIT_BASH_PATH,"..","..","usr","bin","less.exe");if(V.stat(G)?.size)return[G,...q]}let B=_("git");if(B){let G=k.join(B,"..","..","usr","bin","less.exe");if(V.stat(G)?.size)return[G,...q]}return["cmd","/c","more"]}var g=Q({command:"session",describe:"manage sessions",builder:(q)=>q.command(T).command(D).command(v).demandCommand(),async handler(){}}),v=Q({command:"import-claude",describe:"import Claude Code sessions (~/.claude/projects) into qitqode",builder:(q)=>q.option("force",{describe:"re-sync every session, ignoring the mtime cache",type:"boolean",default:!1}),handler:async(q)=>{let z=await N.run({force:q.force});M.println(`Claude import: scanned ${z.scanned}, imported ${z.imported}, resynced ${z.resynced}, skipped ${z.skipped}`+(z.errors.length?`, errors ${z.errors.length}`:""));for(let B of z.errors)M.error(B)}}),D=Q({command:"delete <sessionID>",describe:"delete a session",builder:(q)=>{return q.positional("sessionID",{describe:"session ID to delete",type:"string",demandOption:!0})},handler:async(q)=>{await j(process.cwd(),async()=>{let z=J.make(q.sessionID);try{await $.runPromise(X.Service.use((B)=>B.get(z)))}catch{M.error(`Session not found: ${q.sessionID}`),process.exit(1)}await $.runPromise(X.Service.use((B)=>B.remove(z))),M.println(M.Style.TEXT_SUCCESS_BOLD+`Session ${q.sessionID} deleted`+M.Style.TEXT_NORMAL)})}}),T=Q({command:"list",describe:"list sessions",builder:(q)=>{return q.option("max-count",{alias:"n",describe:"limit to N most recent sessions",type:"number"}).option("format",{describe:"output format",type:"string",choices:["table","json"],default:"table"})},handler:async(q)=>{await j(process.cwd(),async()=>{let z=[...X.list({roots:!0,limit:q.maxCount})];if(z.length===0)return;let B;if(q.format==="json")B=f(z);else B=b(z);if(process.stdout.isTTY&&!q.maxCount&&q.format==="table"){let H=E.spawn(P(),{stdin:"pipe",stdout:"inherit",stderr:"inherit"});if(!H.stdin){console.log(B);return}H.stdin.write(B),H.stdin.end(),await H.exited}else console.log(B)})}});function b(q){let z=[],B=Math.max(20,...q.map((K)=>K.id.length)),G=Math.max(25,...q.map((K)=>K.title.length)),H=`Session ID${" ".repeat(B-10)} Title${" ".repeat(G-5)} Updated`;z.push(H),z.push("\u2500".repeat(H.length));for(let K of q){let A=Y.truncate(K.title,G),R=Y.todayTimeOrDateTime(K.time.updated),w=`${K.id.padEnd(B)} ${A.padEnd(G)} ${R}`;z.push(w)}return z.join(L)}function f(q){let z=q.map((B)=>({id:B.id,title:B.title,updated:B.time.updated,created:B.time.created,projectId:B.projectID,directory:B.directory}));return JSON.stringify(z,null,2)}export{T as SessionListCommand,v as SessionImportClaudeCommand,D as SessionDeleteCommand,g as SessionCommand};
@@ -1,28 +0,0 @@
1
- // @bun
2
- import{of as ZH}from"./chunk-gy0wm7e1.js";import{mq as XH}from"./chunk-hw5qyht3.js";import"./chunk-z8gdmvgg.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import{rt as Q}from"./chunk-nj2bbtmx.js";import{ou as u,wu as VH}from"./chunk-tns5x4w0.js";import"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-3k2b05fv.js";var qH=0.9,OH=256,l="[Earlier tool result removed to fit the request size limit]",b;function C(H){return Buffer.byteLength(JSON.stringify(H),"utf8")}function o(){return u.QITQODE_QLEX_MAX_REQUEST_BYTES??b}function p(H){let J=u.QITQODE_QLEX_MAX_REQUEST_BYTES;if(J!==void 0)return J;let V=Math.max(1,Math.min(Math.floor(H*qH),Math.floor(H)-1));return b=b===void 0?V:Math.min(b,V),b}function I(H,J){return!!H&&typeof H==="object"&&H.role===J}function n(H){let J=[],V=0;while(V<H.length){let X=V,Z=H[V];if(V++,I(Z,"assistant")&&Array.isArray(Z?.tool_calls)&&Z.tool_calls.length>0)while(V<H.length&&I(H[V],"tool"))V++;J.push({start:X,end:V})}return J}function r(H,J){if(J.length===0)return[];let V=-1;for(let X=J.length-1;X>=0;X--){let Z=J[X],K=!1;for(let $=Z.start;$<Z.end;$++)if(I(H[$],"user"))K=!0;if(K){V=X;break}}return J.filter((X,Z)=>{if(Z===J.length-1)return!1;if(Z===V)return!1;if(X.start===0&&I(H[0],"system"))return!1;return!0})}function c(H,J){let V=C(H),X={toolResultsElided:0,unitsDropped:0},Z=()=>({body:H,bytes:V,originalBytes:V,reduced:!1,actions:X});if(!H||typeof H!=="object")return Z();let K=H.messages;if(!Array.isArray(K))return Z();let $=K.map((F)=>F&&typeof F==="object"?{...F}:F),z=()=>({...H,messages:$}),Y=()=>C(z())<=J;{let F=$;for(let L of r(F,n(F))){let O=!1;for(let _=L.start;_<L.end;_++){let S=F[_];if(!I(S,"tool"))continue;let k=S?.content;if(typeof k!=="string"||k.length<OH)continue;if(k===l)continue;F[_]={...S,content:l},X.toolResultsElided++,O=!0}if(O&&Y())break}}if(!Y())for(;;){let F=$,O=r(F,n(F))[0];if(!O)break;if($=[...F.slice(0,O.start),...F.slice(O.end)],X.unitsDropped++,Y())break}let j=z(),D=C(j);return{body:j,bytes:D,originalBytes:V,reduced:D<V&&D<=J,actions:X}}var M=VH({service:"provider.qlex"}),LH=Q.streamUrl(),QH=Q.omniqueryBaseUrl()+"/runOrchestrated";function E(H,J){let V=H;if(J.status!==void 0)V.status=J.status;if(J.upstreamCode!==void 0)V.upstreamCode=J.upstreamCode;V.category=J.category,V.retryable=J.retryable}function w(H,J){return{...H,...J}}class $H extends Error{name="QlexNotLoggedInError";constructor(H){super(Q.copy().notLoggedIn);E(this,w({category:"invalid_credentials",retryable:!1},H))}}class KH extends Error{name="QlexInsufficientBalanceError";constructor(H,J){super(Q.copy().insufficientBalance(H));E(this,w({status:402,category:"billing",retryable:!1},J))}}class zH extends Error{name="QlexRateLimitError";constructor(H){super(Q.copy().rateLimit);E(this,w({status:429,category:"rate_limited",retryable:!0},H))}}class YH extends Error{name="QlexInvalidCredentialsError";constructor(H,J){super(Q.copy().invalidCredentials(H));E(this,w({status:401,category:"invalid_credentials",retryable:!1},J))}}class DH extends Error{name="QlexRequestRejectedError";constructor(H,J,V){super(Q.copy().requestRejected(H,J));E(this,w({status:400,category:"request_rejected",retryable:!1},V))}}class y extends Error{name="QlexRequestTooLargeError";stage;constructor(H="irreducible",J,V){super(H==="after-reduction"?Q.copy().requestTooLargeAfterReduction(J):Q.copy().requestTooLargeIrreducible(J));this.stage=H,E(this,w({status:413,category:"request_too_large",retryable:!1},V))}}class WH extends Error{name="QlexRequestNotSentError";constructor(H,J){super(Q.copy().requestNotSent(H));E(this,w({category:"request_rejected",retryable:!1},J))}}class B extends Error{name="QlexGatewayError";constructor(H,J){super(Q.copy().gatewayUnavailable(H));E(this,w({category:"gateway_routing",retryable:!1},J))}}var SH=60000;function eH(H){return Q.sanitizeUpstreamError(H)}class x extends Error{name="QlexStreamError";constructor(H,J){let V=w({category:"unknown",retryable:!1},J);super(V.category==="stream_truncated"?Q.copy().streamCutOff():Q.copy().streamFailed(H));E(this,V)}}var PH=[{match:/\b(unauthori[sz]ed|forbidden|invalid[ _-]?(api[ _-]?key|token|credential)|expired[ _-]?token|authentication[ _-]?(failed|error)|401|403)\b/i,category:"invalid_credentials",retryable:!1},{match:/\b(insufficient[ _-]?(credits?|qredits?|balance|funds)|payment[ _-]?required|quota[ _-]?exceeded|out[ _-]?of[ _-]?(credits?|qredits?)|402)\b/i,category:"billing",retryable:!1},{match:/\b(rate[ _-]?limit(ed|s)?|too[ _-]?many[ _-]?requests|429)\b/i,category:"rate_limited",retryable:!0},{match:/(unexpected end of (json|input|stream|data)|premature (close|end)|socket hang ?up|incomplete (response|output|json|message)|truncated|stream (ended|closed|terminated) (early|unexpectedly|prematurely)|\bECONNRESET\b|\bEPIPE\b)/i,category:"stream_truncated",retryable:!0},{match:/\b(overloaded|at capacity|service[ _-]?unavailable|temporarily[ _-]?unavailable|bad[ _-]?gateway|gateway[ _-]?time(d[ _-]?out|out)|timed[ _-]?out|502|503|504)\b/i,category:"transient",retryable:!0}];function MH(H){let J=H??"";for(let V of PH)if(V.match.test(J))return{category:V.category,retryable:V.retryable};return{category:"unknown",retryable:!1}}function EH(H){return XH(H)}function wH(H,J){let V,X,Z;try{let Y=JSON.parse(J);if(Y&&typeof Y==="object"){let j=Y.error&&typeof Y.error==="object"?Y.error:void 0;if(typeof j?.code==="string")V=j.code;else if(typeof Y.code==="string")V=Y.code;if(typeof j?.message==="string")X=j.message;else if(typeof Y.message==="string")X=Y.message;if(typeof Y.details?.field==="string")Z=Y.details.field}}catch{}let K=V?.toUpperCase()??"",$=(()=>{if(H===402)return"billing";if(H===413)return"request_too_large";if(H===429)return"rate_limited";if(H===401||H===403)return K==="ERR_GATEWAY_REQUIRED"||EH(J)?"gateway_routing":"invalid_credentials";if(K.includes("CONFIG"))return"configuration";if(H>=500)return"transient";if(H>=400)return"request_rejected";return"unknown"})(),z={status:H,category:$,retryable:$==="transient"||$==="rate_limited"};if(V!==void 0)z.upstreamCode=V;if(X!==void 0)z.upstreamMessage=X;if(Z!==void 0)z.field=Z;return z}var TH=new Set(["coding","agent","research","review","chat"]);function RH(H){if(H===void 0)return;if(typeof H==="string"&&TH.has(H))return H;throw Error(`invalid Qortex posture: ${String(H)}`)}function CH(H){if(H===void 0)return;let J=Array.isArray(H)?H:[H];if(J.every((V)=>typeof V==="string"&&/^[^/\s]+\/[^/\s]+$/.test(V)))return Array.isArray(H)?J:H;throw Error(`invalid Qortex directive registry key: ${String(H)}`)}function f(H){if(typeof H==="string")return H;if(Array.isArray(H))return H.map((J)=>{if(typeof J==="string")return J;if(J&&typeof J==="object"){let V=J;if(typeof V.text==="string")return V.text;if(typeof V.content==="string")return V.content}return""}).join("");if(H===void 0||H===null)return"";return String(H)}var AH="[Tool call]",bH="[Tool returned no output]";function NH(H){if(!Array.isArray(H))return{messages:H,dropped:[]};let J=[];return{messages:H.flatMap((X,Z)=>{if(!X||typeof X!=="object")return J.push({index:Z,role:typeof X,reason:"not-an-object"}),[];let K=X,$=f(K.content);if($.trim().length>0)return[{...K,content:$}];if(K.role==="assistant"&&Array.isArray(K.tool_calls)&&K.tool_calls.length>0)return[{...K,content:AH}];if(K.role==="tool"&&typeof K.tool_call_id==="string"&&K.tool_call_id.trim().length>0)return[{...K,content:bH}];return J.push({index:Z,role:typeof K.role==="string"?K.role:"unknown",reason:"empty-content"}),[]}),dropped:J}}function IH(H){return NH(H).messages}function vH(H){if(!Array.isArray(H))return!1;return H.some((J)=>!!J&&typeof J==="object"&&J.role==="user")}function BH(H){if(!Array.isArray(H))return!1;return H.some((J)=>{if(!J||typeof J!=="object")return!1;let V=J;if(V.role!=="user")return!1;return f(V.content).trim().length>0})}function xH(H){if(!Array.isArray(H))return H;let J=(K)=>!!K&&typeof K==="object"&&K.role==="system",V=0;while(V<H.length&&J(H[V]))V++;if(V<=1)return H;let X=H.slice(0,V),Z=X.map((K)=>typeof K.content==="string"?K.content:String(K.content??"")).filter((K)=>K.length>0).join(`
3
-
4
- `);return[{...X[0],role:"system",content:Z},...H.slice(V)]}var v="<tool_call>",h="</tool_call>";function hH(H){if(!Array.isArray(H)||H.length===0)return;let J=H.map((V)=>{try{return JSON.stringify(V)}catch{return}}).filter((V)=>V!==void 0);if(J.length===0)return;return["# Tools","","You may call one or more functions to assist with the user query.","","You are provided with function signatures within <tools></tools> XML tags:","<tools>",...J,"</tools>","","For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:","<tool_call>",'{"name": <function-name>, "arguments": <args-json-object>}',"</tool_call>","","Function results will be provided within <tool_response></tool_response> XML tags. Do not write <tool_response> blocks yourself.","Only use the functions declared above. Never invent function names, and never write out a function-call-like block in any other format."].join(`
5
- `)}function fH(H){let J=H.function??{},V=typeof J.name==="string"?J.name:"",X={};if(typeof J.arguments==="string")try{X=JSON.parse(J.arguments)}catch{X=J.arguments}else if(J.arguments!==void 0)X=J.arguments;return`${v}
6
- ${JSON.stringify({name:V,arguments:X})}
7
- ${h}`}function FH(H,J){if(!Array.isArray(H))return H;let V=H.map((Z)=>{if(!Z||typeof Z!=="object")return Z;let K=Z;if(K.role==="assistant"&&Array.isArray(K.tool_calls)){let $=K.tool_calls.map(fH).join(`
8
- `),z=f(K.content),{tool_calls:Y,...j}=K;return{...j,content:z.length>0?`${z}
9
- ${$}`:$}}if(K.role==="tool"){let{tool_call_id:$,name:z,...Y}=K;return{...Y,role:"user",content:`<tool_response>
10
- ${f(K.content)}
11
- </tool_response>`}}return Z}),X=hH(J);if(X){let Z=0;while(Z<V.length&&!!V[Z]&&typeof V[Z]==="object"&&V[Z].role==="system")Z++;V.splice(Z,0,{role:"system",content:X})}return V}function yH(){return process.env.QITQODE_TOOL_PROTOCOL==="text"?"text":"native"}function gH(H){if(Array.isArray(H.tools)&&H.tools.length>0)return!0;let J=H.messages;if(!Array.isArray(J))return!1;return J.some((V)=>{if(!V||typeof V!=="object")return!1;let X=V;return X.role==="tool"||X.role==="assistant"&&Array.isArray(X.tool_calls)})}function a(H,J){let V=J?.toolMode??"native",X=H.model??"default",Z={stream:H.stream??!0};if(H.temperature!==void 0)Z.temperature=H.temperature;if(H.max_tokens!==void 0)Z.max_tokens=H.max_tokens;let K=J?.outputAdvisory;if(K){let D=K.tierOutputLimit;if(Z.max_tokens!==void 0){if(D!==void 0&&Z.max_tokens>D)Z.max_tokens=D}else{let F=K.tierRecommendedStepTokens??D;if(F!==void 0)Z.max_tokens=F}}if(H.tools!==void 0)Z.tools=H.tools;if(H.tool_choice!==void 0)Z.tool_choice=H.tool_choice;if(H.stream_options!==void 0)Z.stream_options=H.stream_options;let $=V==="text"?FH(H.messages,H.tools):H.messages,z={},Y=RH(H.posture);if(Y!==void 0)z.posture=Y;let j=CH(H.directive);if(j!==void 0)z.directive=j;if(H.modelPersona!==void 0)z.modelPersona=H.modelPersona;return{tier:X,messages:xH(IH($)),opts:Z,...z}}var i=new Map;function t(H){return typeof H==="number"&&Number.isFinite(H)&&H>0?H:void 0}function uH(H,J){let V={},X=t(J.tierOutputLimit),Z=t(J.tierRecommendedStepTokens);if(X!==void 0)V.tierOutputLimit=X;if(Z!==void 0)V.tierRecommendedStepTokens=Z;if(V.tierOutputLimit===void 0&&V.tierRecommendedStepTokens===void 0)return;i.set(H,V)}function pH(H){return i.get(H)}function HJ(){i.clear()}function cH(H){let J=(V)=>typeof V==="string"&&(V.startsWith("qlex")||V.startsWith("qortex"));return J(H.id)||J(H.object)}function mH(H){let J=[],V=H.indexOf(`
12
- `)===-1?[H]:H.split(`
13
- `);for(let $ of V){let z=$.endsWith("\r")?$.slice(0,-1):$;if(!z.startsWith("data:"))continue;let Y=z.slice(5);if(Y.startsWith(" "))Y=Y.slice(1);J.push(Y)}if(J.length===0)return{kind:"skip"};let X=J.length===1?J[0]:J.join(`
14
- `);if(X==="")return{kind:"skip"};if(X==="[DONE]")return{kind:"done"};if(X.startsWith("[ERROR]"))return{kind:"error",message:X.slice(7).trim()||"qlex stream error"};let Z=X.charCodeAt(0),K=Z===123||Z===91||Z===32||Z===9||Z===10||Z===13;try{if(!K)return{kind:"token",content:X};let $=JSON.parse(X);if($&&typeof $==="object"){let z=$.id;if(z==="qlex-cost"||z==="qortex-cost")return{kind:"cost",cost:$};if(z==="qlex-stream"&&$.usage&&typeof $.usage==="object"){let D=$.choices,F;if(Array.isArray(D)&&D[0]&&typeof D[0]==="object"){let L=D[0].finish_reason;if(typeof L==="string")F=L}return{kind:"usage",usage:$.usage,finishReason:F}}if(Array.isArray($.choices))return{kind:"passthrough",chunk:$};let Y=$,j=typeof Y.content==="string"?Y.content:typeof Y.text==="string"?Y.text:typeof Y.delta==="string"?Y.delta:void 0;if(j!==void 0)return{kind:"token",content:j};if(cH($)){let D=$.object;return{kind:"control",control:typeof D==="string"&&D.endsWith(".tier.outputLimits")?"tier-output-limits":"unknown",chunk:$}}}}catch{}return{kind:"token",content:X}}function iH(H,J){let V=Math.min(H.length,J.length-1);for(let X=V;X>=1;X--)if(J.startsWith(H.slice(H.length-X)))return X;return 0}class GH{onText;onToolCall;pending="";inBlock=!1;constructor(H,J){this.onText=H;this.onToolCall=J}feed(H){this.pending+=H,this.drain(!1)}flush(){if(this.drain(!0),this.inBlock)this.emitBlock(this.pending,!0),this.inBlock=!1;else if(this.pending.length>0)this.onText(this.pending);this.pending=""}drain(H){while(!0)if(!this.inBlock){let J=this.pending.indexOf(v);if(J===-1){let V=H?0:iH(this.pending,v),X=this.pending.length-V;if(X>0)this.onText(this.pending.slice(0,X)),this.pending=V>0?this.pending.slice(X):"";return}if(J>0)this.onText(this.pending.slice(0,J));this.pending=this.pending.slice(J+v.length),this.inBlock=!0}else{let J=this.pending.indexOf(h);if(J===-1)return;if(this.emitBlock(this.pending.slice(0,J),!1),this.pending=this.pending.slice(J+h.length),this.pending.startsWith(`\r
15
- `))this.pending=this.pending.slice(2);else if(this.pending.startsWith(`
16
- `))this.pending=this.pending.slice(1);this.inBlock=!1}}emitBlock(H,J){try{let V=JSON.parse(H.trim());if(V&&typeof V==="object"&&typeof V.name==="string"){let X=V.arguments;this.onToolCall({name:V.name,arguments:typeof X==="string"?X:JSON.stringify(X??{})});return}}catch{}this.onText(`${v}${H}${J?"":h}`)}}function m(H,J,V){let X={id:"qlex-stream",object:"chat.completion.chunk",created:Math.floor(Date.now()/1000),model:"qlex",choices:[{index:0,delta:H,finish_reason:J}]};if(V)X.usage=V;return`data: ${JSON.stringify(X)}
17
-
18
- `}function dH(H,J){let V=J?.toolProtocolEnabled===!0,X=J?.tier,Z=H.getReader(),K=new TextDecoder,$=new TextEncoder,z="",Y=!1,j=!1,D,F,L,O=0;return new ReadableStream({async start(_){let S=(N)=>{let W=Y?{content:N}:{role:"assistant",content:N};Y=!0,_.enqueue($.encode(m(W,null)))},k=0,U=V?new GH(S,(N)=>{let W={...Y?{}:{role:"assistant"},tool_calls:[{index:k,id:`qlexcall_${Date.now().toString(36)}_${k}`,type:"function",function:{name:N.name,arguments:N.arguments}}]};Y=!0,k++,_.enqueue($.encode(m(W,null)))}):void 0,T=(N)=>U?U.feed(N):S(N),g=()=>{U?.flush();let N=D||F!==void 0?{prompt_tokens:D?.tokens.prompt??0,completion_tokens:D?.tokens.completion??0,total_tokens:D?.tokens.total??(D?.tokens.prompt??0)+(D?.tokens.completion??0),cost_usd:D?.cost_usd,cost_credits:D?.cost_credits??D?.cost_qredits,context_window:F}:void 0,W=k>0?"tool_calls":L??"stop";_.enqueue($.encode(m({},W,N))),_.enqueue($.encode(`data: [DONE]
19
-
20
- `)),_.close(),j=!0},q=(N)=>{let W=mH(N);switch(O++,W.kind){case"skip":return!1;case"token":return T(W.content),!1;case"passthrough":{let G=W.chunk.choices;if(Array.isArray(G)&&G[0]&&typeof G[0]==="object"){let P=G[0].finish_reason;if(typeof P==="string")L=P}return Y=!0,_.enqueue($.encode(`data: ${JSON.stringify(W.chunk)}
21
-
22
- `)),!1}case"cost":if(W.cost.final)D=W.cost;return!1;case"usage":if(W.usage.context_window!==void 0)F=W.usage.context_window;if(W.finishReason!==void 0)L=W.finishReason;return!1;case"control":{if(W.control==="tier-output-limits"){let G=W.chunk;if(X!==void 0)uH(X,G);M.debug("qlex tier output limits",{tierOutputLimit:G.tierOutputLimit,tierRecommendedStepTokens:G.tierRecommendedStepTokens,tierStepGuidance:G.tierStepGuidance})}else M.debug("qlex control frame dropped",{id:W.chunk.id,object:W.chunk.object});return!1}case"done":return g(),!0;case"error":{let G=MH(W.message);return M.debug("qlex stream error frame",{tier:X,raw:W.message,frameIndex:O,contentStreamed:Y,category:G.category,retryable:G.retryable}),_.error(new x(W.message,G)),j=!0,!0}}};try{while(!0){let{done:W,value:G}=await Z.read();if(W)break;z+=K.decode(G,{stream:!0});let P;while((P=z.indexOf(`
23
-
24
- `))!==-1){let R=z.slice(0,P);if(z=z.slice(P+2),q(R))return}}z+=K.decode();let N=z.replace(/\r?\n$/,"");if(N.length>0&&q(N))return;if(!j)g()}catch(N){if(!j)_.error(N instanceof x?N:new x(N instanceof Error?N.message:String(N)))}finally{Z.releaseLock()}},cancel(_){Z.cancel(_).catch(()=>{})}})}function jH(H){return{content:typeof H.content==="string"?H.content:H.choices?.[0]?.message?.content??"",finishReason:H.choices?.[0]?.finish_reason??"stop"}}function lH(H){let J=H??{},{content:V,finishReason:X}=jH(J),Z=J.usage??{},K=Z.prompt_tokens??0,$=Z.completion_tokens??0,z="orch-"+Date.now().toString(36),Y=Math.floor(Date.now()/1000),j=(_,S,k)=>{let U={id:z,object:"chat.completion.chunk",created:Y,model:"orchestrated",choices:[{index:0,delta:_,finish_reason:S}]};if(k)U.usage=k;return`data: ${JSON.stringify(U)}
25
-
26
- `},D={prompt_tokens:K,completion_tokens:$,total_tokens:Z.total_tokens??K+$};if(typeof Z.cost_usd==="number")D.cost_usd=Z.cost_usd;if(typeof Z.cost_credits==="number")D.cost_credits=Z.cost_credits;if(typeof Z.context_window==="number")D.context_window=Z.context_window;let F=[j({role:"assistant",content:""},null),j({content:V},null),j({},X,D),`data: [DONE]
27
-
28
- `],L=new TextEncoder,O=new ReadableStream({start(_){for(let S of F)_.enqueue(L.encode(S));_.close()}});return new Response(O,{status:200,headers:{"content-type":"text/event-stream"}})}function JJ(H){let J=H??{},{content:V,finishReason:X}=jH(J),Z=J.usage??{},K=Z.prompt_tokens??0,$=Z.completion_tokens??0,z={id:"orch-"+Date.now(),object:"chat.completion",created:Math.floor(Date.now()/1000),model:"orchestrated",choices:[{index:0,message:{role:"assistant",content:V},finish_reason:X}],usage:{prompt_tokens:K,completion_tokens:$,total_tokens:Z.total_tokens??K+$,...typeof Z.cost_usd==="number"?{cost_usd:Z.cost_usd}:{},...typeof Z.context_window==="number"?{context_window:Z.context_window}:{}}};return new Response(JSON.stringify(z),{status:200,headers:{"content-type":"application/json"}})}async function s(H,J,V){let X=wH(H,J),Z=J?`HTTP ${H}: ${J}`:`HTTP ${H}`;switch(M.error("gateway rejected request",{tier:V.tier,status:H,category:X.category,upstreamCode:X.upstreamCode,field:X.field,retryable:X.retryable}),X.category){case"billing":return new KH(J||void 0,X);case"rate_limited":return new zH(X);case"gateway_routing":return new B(`HTTP ${H}`,X);case"invalid_credentials":return await V.onInvalidCredentials?.().catch(()=>{}),new YH(Z,X);case"request_too_large":return new y("irreducible",X.upstreamMessage??J??void 0,X);case"request_rejected":case"tool_protocol":return new DH(X.upstreamMessage??J??void 0,X.field,X);case"configuration":case"transient":case"unknown":default:return new B(Z,X)}}function e(H){let J=o();if(J===void 0)return H;let V=C(H);if(V<=J)return H;let X=c(H,J);return M.warn("request over known size ceiling, reducing before send",{tier:H.tier,bytes:V,ceiling:J,reducedBytes:X.bytes,fits:X.reduced,...X.actions}),X.bytes<V?X.body:H}function HH(H){let J=C(H),V=p(J),X=c(H,V);if(!X.reduced)throw M.error("request too large and cannot be reduced further",{tier:H.tier,rejectedBytes:J,ceiling:V,reducedBytes:X.bytes,...X.actions}),new y("irreducible");return M.warn("request too large, retrying once with reduced history",{tier:H.tier,rejectedBytes:J,ceiling:V,reducedBytes:X.bytes,...X.actions,notice:Q.copy().requestTooLargeRecovering()}),X.body}function JH(H){let J=C(H);throw p(J),M.error("reduced request still too large",{tier:H.tier,rejectedBytes:J}),new y("after-reduction")}function nH(H,J=globalThis.fetch,V,X){let Z=X?.responseTimeoutMs??SH;return async(K,$)=>{if($?.method==="POST"&&typeof $?.body==="string"){let z;try{z=JSON.parse($.body)}catch{return J(K,$)}let Y=yH(),j=pH(z.model??"default"),D=a(z,{toolMode:Y,outputAdvisory:j});if(vH(z.messages)&&!BH(D.messages)){let{dropped:q}=NH(Y==="text"?FH(z.messages,z.tools):z.messages);throw M.error("refusing to send: user message lost in normalization",{tier:D.tier,toolMode:Y,inputRoles:Array.isArray(z.messages)?z.messages.map((N)=>N&&typeof N==="object"?String(N.role):"?"):"not-an-array",droppedCount:q.length,dropped:q}),new WH("your message could not be turned into sendable content")}let F=await H(),L=typeof F==="string"?{key:F,method:"sso"}:F;if(!L?.key)throw new $H;let O=new Headers($.headers);if(L.method==="api-key")O.delete("Authorization"),O.set("x-api-key",L.key);else O.delete("x-api-key"),O.set("Authorization",`Bearer ${L.key}`);if(O.set("Content-Type","application/json"),D.tier==="orchestrated"){let q=$.signal,N=async(P)=>{let R=new AbortController,A=()=>R.abort(q?.reason);if(q)if(q.aborted)R.abort(q.reason);else q.addEventListener("abort",A,{once:!0});let d=!1,_H=setTimeout(()=>{d=!0,R.abort()},Z);try{return await J(QH,{method:"POST",headers:O,body:JSON.stringify(P),signal:R.signal})}catch(UH){if(d)throw new B(`no response within ${Math.round(Z/1000)}s`);throw UH}finally{clearTimeout(_H),q?.removeEventListener("abort",A)}},W=e(D),G=await N(W);if(G.status===413){if(await G.body?.cancel().catch(()=>{}),W=HH(W),G=await N(W),G.status===413)await G.body?.cancel().catch(()=>{}),JH(W)}if(!G.ok){let P=await G.text().catch(()=>"");throw await s(G.status,P,{onInvalidCredentials:V,tier:D.tier})}return lH(await G.json())}let _=$.signal,S=async(q)=>{let N=new AbortController,W=()=>N.abort(_?.reason);if(_)if(_.aborted)N.abort(_.reason);else _.addEventListener("abort",W,{once:!0});let G=()=>_?.removeEventListener("abort",W),P=!1,R=setTimeout(()=>{P=!0,N.abort()},Z);try{return{res:await J(LH,{method:"POST",headers:O,body:JSON.stringify(q),signal:N.signal}),detach:G}}catch(A){if(G(),P)throw new B(`no response within ${Math.round(Z/1000)}s`);throw A}finally{clearTimeout(R)}},k=e(D),{res:U,detach:T}=await S(k);if(U.status===400&&Y==="native"&&gH(z))T(),await U.body?.cancel().catch(()=>{}),k=a(z,{toolMode:"text",outputAdvisory:j}),{res:U,detach:T}=await S(k);if(U.status===413){if(T(),await U.body?.cancel().catch(()=>{}),k=HH(k),{res:U,detach:T}=await S(k),U.status===413)T(),await U.body?.cancel().catch(()=>{}),JH(k)}try{if(!U.ok){let q=await U.text().catch(()=>"");throw await s(U.status,q,{onInvalidCredentials:V,tier:D.tier})}}catch(q){throw T(),q}if(z.stream!==!1&&U.body){let q=Array.isArray(z.tools)&&z.tools.length>0;return new Response(dH(U.body,{toolProtocolEnabled:q,tier:D.tier}),{status:U.status,statusText:U.statusText,headers:{"content-type":"text/event-stream"}})}return U}return J(K,$)}}function VJ(H){let J=H.getToken??(async()=>H.bearerToken),V=nH(J,globalThis.fetch,H.onInvalidCredentials);return ZH({name:H.name??"qlex",baseURL:Q.streamBaseUrl(),fetch:V})}export{dH as transformQlexStream,lH as toOrchestratedSSEStream,JJ as toOpenAICompletion,eH as sanitizeUpstreamProviderError,yH as resolveToolMode,hH as renderToolProtocolPrompt,uH as recordTierOutputAdvisory,iH as partialTagSuffixLength,mH as parseQlexFrame,wH as parseQlexError,NH as normalizeQlexMessagesWithReport,IH as normalizeQlexMessages,xH as mergeLeadingSystemMessages,EH as isGatewayRequiredError,vH as hasUserRoleMessage,BH as hasUsableUserMessage,gH as hasToolContext,pH as getTierOutputAdvisory,f as flattenMessageContent,FH as encodeToolProtocolMessages,VJ as createQlexProvider,nH as createCustomFetch,HJ as clearTierOutputAdvisories,MH as classifyQlexStreamError,a as buildQlexBody,GH as ToolCallExtractor,v as TOOL_CALL_OPEN,h as TOOL_CALL_CLOSE,x as QlexStreamError,y as QlexRequestTooLargeError,DH as QlexRequestRejectedError,WH as QlexRequestNotSentError,zH as QlexRateLimitError,$H as QlexNotLoggedInError,YH as QlexInvalidCredentialsError,KH as QlexInsufficientBalanceError,B as QlexGatewayError,LH as QLEX_STREAM_URL,SH as QLEX_RESPONSE_TIMEOUT_MS,QH as QLEX_ORCHESTRATED_URL};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ed as b}from"./chunk-aa8hymcv.js";import{Rd as f}from"./chunk-yajd975f.js";import{gh as S}from"./chunk-5e4fxy99.js";import"./chunk-8vg4fmg2.js";import"./chunk-zfcp509b.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-md8161zd.js";import"./chunk-yk97q51d.js";import{Cl as v}from"./chunk-e74efvj2.js";import"./chunk-st5jaszz.js";import{Vl as U,bm as R,lm as k}from"./chunk-a1hzeejj.js";import"./chunk-sjw56r2n.js";import"./chunk-nj4d554m.js";import"./chunk-eva3nqqb.js";import"./chunk-yprmd5b7.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-f3bnn9rf.js";import"./chunk-xqdrr7xg.js";import"./chunk-axdzm75h.js";import"./chunk-94pcpztx.js";import"./chunk-hw5qyht3.js";import"./chunk-z8gdmvgg.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import"./chunk-g6cyhxwg.js";import"./chunk-n96tvjgj.js";import"./chunk-pkc4ddw1.js";import"./chunk-xgr6jnd6.js";import"./chunk-a48t0g95.js";import"./chunk-yqk58hf6.js";import"./chunk-er38zew1.js";import"./chunk-dk975etf.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-nj2bbtmx.js";import{eu as Z}from"./chunk-tns5x4w0.js";import"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-kfmz2p27.js";import"./chunk-ee23d2nz.js";import"./chunk-3k2b05fv.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{Ed as y}from"./chunk-aa8hymcv.js";import{Rd as L}from"./chunk-yajd975f.js";import{Ug as N,gh as w}from"./chunk-5e4fxy99.js";import"./chunk-8vg4fmg2.js";import"./chunk-zfcp509b.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-md8161zd.js";import"./chunk-yk97q51d.js";import{Cl as v,tl as q}from"./chunk-e74efvj2.js";import"./chunk-st5jaszz.js";import{Vl as V,Wl as A,Xl as E,bm as k,lm as O}from"./chunk-a1hzeejj.js";import"./chunk-sjw56r2n.js";import"./chunk-nj4d554m.js";import"./chunk-eva3nqqb.js";import"./chunk-yprmd5b7.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-f3bnn9rf.js";import"./chunk-xqdrr7xg.js";import"./chunk-axdzm75h.js";import"./chunk-94pcpztx.js";import"./chunk-hw5qyht3.js";import"./chunk-z8gdmvgg.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import"./chunk-g6cyhxwg.js";import"./chunk-n96tvjgj.js";import"./chunk-pkc4ddw1.js";import"./chunk-xgr6jnd6.js";import"./chunk-a48t0g95.js";import"./chunk-yqk58hf6.js";import"./chunk-er38zew1.js";import"./chunk-dk975etf.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-nj2bbtmx.js";import"./chunk-tns5x4w0.js";import{Ru as P}from"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-kfmz2p27.js";import"./chunk-ee23d2nz.js";import"./chunk-3k2b05fv.js";import{EOL as X}from"os";function U(C){let G=C.match(/^https?:\/\/[^/]+\/share\/([a-zA-Z0-9_-]+)$/);return G?G[1]:null}function M(C,G){try{return new URL(C).origin===new URL(G).origin}catch{return!1}}function S(C){let G=C.find((z)=>z.type==="session");if(!G)return null;let Z=new Map,Q=new Map;for(let z of C)if(z.type==="message")Z.set(z.data.id,z.data);else if(z.type==="part"){if(!Q.has(z.data.messageID))Q.set(z.data.messageID,[]);Q.get(z.data.messageID).push(z.data)}if(Z.size===0)return null;return{info:G.data,messages:Array.from(Z.values()).map((z)=>({info:z,parts:Q.get(z.id)??[]}))}}var m=L({command:"import <file>",describe:"import session data from JSON file or URL",builder:(C)=>{return C.positional("file",{describe:"path to JSON file or share URL",type:"string",demandOption:!0})},handler:async(C)=>{await y(process.cwd(),async()=>{let G;if(C.file.startsWith("http://")||C.file.startsWith("https://")){let J=U(C.file);if(!J){let Y=await w.runPromise(N.Service.use((R)=>R.url()));process.stdout.write(`Invalid URL format. Expected: ${Y}/share/<slug>`),process.stdout.write(X);return}let _=new URL(C.file).origin,$=await w.runPromise(N.Service.use((Y)=>Y.request())),j=M(C.file,$.baseUrl)?$.headers:{},W=$.api.data(J),K=await fetch(`${_}${W}`,{headers:j});if(!K.ok&&W!==`/api/share/${J}/data`)K=await fetch(`${_}/api/share/${J}/data`,{headers:j});if(!K.ok){process.stdout.write(`Failed to fetch share data: ${K.statusText}`),process.stdout.write(X);return}let H=await K.json(),B=S(H);if(!B){process.stdout.write(`Share not found or empty: ${J}`),process.stdout.write(X);return}G=B}else if(G=await P.readJson(C.file).catch(()=>{return}),!G){process.stdout.write(`File not found: ${C.file}`),process.stdout.write(X);return}if(!G){process.stdout.write("Failed to read session data"),process.stdout.write(X);return}let Q=v.Info.parse({...G.info,projectID:O.project.id}),z=v.toRow(Q);k.use((J)=>J.insert(V).values(z).onConflictDoUpdate({target:V.id,set:{project_id:z.project_id}}).run());for(let J of G.messages){let F=q.Info.parse(J.info),{id:_,sessionID:$,...j}=F;k.use((W)=>W.insert(A).values({id:_,session_id:z.id,time_created:F.time?.created??Date.now(),data:j}).onConflictDoNothing().run());for(let W of J.parts){let K=q.Part.parse(W),{id:H,sessionID:B,messageID:Y,...R}=K;k.use((T)=>T.insert(E).values({id:H,message_id:Y,session_id:z.id,data:R}).onConflictDoNothing().run())}}process.stdout.write(`Imported session: ${G.info.id}`),process.stdout.write(X)})}});export{S as transformShareData,M as shouldAttachShareAuthHeaders,U as parseShareUrl,m as ImportCommand};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{Rd as q}from"./chunk-yajd975f.js";import{Vf as v}from"./chunk-p9cnzxb8.js";import{gh as S}from"./chunk-5e4fxy99.js";import"./chunk-8vg4fmg2.js";import"./chunk-zfcp509b.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-md8161zd.js";import"./chunk-yk97q51d.js";import"./chunk-e74efvj2.js";import"./chunk-st5jaszz.js";import{cm as Q,lm as H}from"./chunk-a1hzeejj.js";import"./chunk-sjw56r2n.js";import"./chunk-nj4d554m.js";import"./chunk-eva3nqqb.js";import"./chunk-yprmd5b7.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-f3bnn9rf.js";import"./chunk-xqdrr7xg.js";import"./chunk-axdzm75h.js";import"./chunk-94pcpztx.js";import"./chunk-hw5qyht3.js";import"./chunk-z8gdmvgg.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import"./chunk-g6cyhxwg.js";import"./chunk-n96tvjgj.js";import"./chunk-pkc4ddw1.js";import"./chunk-xgr6jnd6.js";import"./chunk-a48t0g95.js";import"./chunk-yqk58hf6.js";import"./chunk-er38zew1.js";import"./chunk-dk975etf.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-nj2bbtmx.js";import"./chunk-tns5x4w0.js";import{Gu as K}from"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-kfmz2p27.js";import"./chunk-ee23d2nz.js";import"./chunk-3k2b05fv.js";var P=q({command:"pr <number>",describe:"fetch and checkout a GitHub PR branch, then run qitqode",builder:(Y)=>Y.positional("number",{type:"number",describe:"PR number to checkout",demandOption:!0}),async handler(Y){await H.provide({directory:process.cwd(),async fn(){if(H.project.vcs!=="git")v.error("Could not find git repository. Please run this command from a git repository."),process.exit(1);let J=Y.number,Z=`pr/${J}`;if(v.println(`Fetching and checking out PR #${J}...`),(await K.run(["gh","pr","checkout",`${J}`,"--branch",Z,"--force"],{nothrow:!0})).code!==0)v.error(`Failed to checkout PR #${J}. Make sure you have gh CLI installed and authenticated.`),process.exit(1);let _=await K.text(["gh","pr","view",`${J}`,"--json","headRepository,headRepositoryOwner,isCrossRepository,headRefName,body"],{nothrow:!0}),V;if(_.code===0){let j=_.text;if(j.trim()){let z=JSON.parse(j);if(z&&z.isCrossRepository&&z.headRepository&&z.headRepositoryOwner){let L=z.headRepositoryOwner.login,W=z.headRepository.name,C=L;if(!(await S.runPromise(Q.Service.use((F)=>F.run(["remote"],{cwd:H.worktree}))).then((F)=>F.text().trim())).split(`
3
- `).includes(C))await S.runPromise(Q.Service.use((F)=>F.run(["remote","add",C,`https://github.com/${L}/${W}.git`],{cwd:H.worktree}))),v.println(`Added fork remote: ${C}`);let X=z.headRefName;await S.runPromise(Q.Service.use((F)=>F.run(["branch",`--set-upstream-to=${C}/${X}`,Z],{cwd:H.worktree})))}if(z&&z.body){let L=z.body.match(/https:\/\/opncd\.ai\/s\/([a-zA-Z0-9_-]+)/);if(L){let W=L[0];v.println(`Found qitqode session: ${W}`),v.println("Importing session...");let C=await K.text(["qitqode","import",W],{nothrow:!0});if(C.code===0){let X=C.text.trim().match(/Imported session: ([a-zA-Z0-9_-]+)/);if(X)V=X[1],v.println(`Session imported: ${V}`)}}}}}v.println(`Successfully checked out PR #${J} as branch '${Z}'`),v.println(),v.println("Starting qitqode..."),v.println();let D=V?["-s",V]:[],$=await K.spawn(["qitqode",...D],{stdin:"inherit",stdout:"inherit",stderr:"inherit",cwd:process.cwd()}).exited;if($!==0)throw Error(`qitqode exited with code ${$}`)}})}});export{P as PrCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Mt as D,Ot as h,Pt as w,Qt as M,Rt as O,St as b,Tt as y}from"./chunk-tns5x4w0.js";import{aQ as N}from"./chunk-3k2b05fv.js";var H={free:{providerID:"qlex",modelID:"free"},default:{providerID:"qlex",modelID:"default"},fast:{providerID:"qlex",modelID:"fast"},economical:{providerID:"qlex",modelID:"economical"},power:{providerID:"qlex",modelID:"power"},orchestrated:{providerID:"qlex",modelID:"orchestrated"}},V={free:"Free (no cost)",default:"Default",fast:"Fast",economical:"Economy",power:"Power",orchestrated:"Orchestrated"},Z={},c="pending",Q=new Set;function F(){return c}function Y(){c="pending",X()}function f(x){return Q.add(x),()=>Q.delete(x)}function X(){for(let x of[...Q])try{x()}catch{}}function q(){for(let x of Object.keys(Z))delete Z[x];c="unavailable",X()}function P(x){return typeof x==="number"&&Number.isFinite(x)&&x>=0&&x<=10}function C(x){if(x===void 0){q();return}let K=x!==null&&typeof x==="object"&&!Array.isArray(x)?x:void 0;if(K?.success===!1){q();return}let J=K?.success===!0&&Object.prototype.hasOwnProperty.call(K,"data")?K.data:x,j={};if(J===null||typeof J!=="object"||Array.isArray(J)){q();return}for(let[W,$]of Object.entries(J)){if(!$||typeof $!=="object"||Array.isArray($)){q();return}let z=$;if(!P(z.intelligence)||!P(z.speed)||!P(z.cost)){q();return}j[W]={intelligence:z.intelligence,speed:z.speed,cost:z.cost}}for(let W of Object.keys(Z))delete Z[W];Object.assign(Z,j),c="live",X()}function B(x){if(!Array.isArray(x)||x.length===0)return;let K={},J={};for(let j of x){let W=H[j.id];K[j.id]={providerID:j.providerID??W?.providerID??"qlex",modelID:j.modelID??W?.modelID??j.id},J[j.id]=j.label??V[j.id]??j.id}for(let j of Object.keys(H))delete H[j];Object.assign(H,K);for(let j of Object.keys(V))delete V[j];Object.assign(V,J)}var G={};N(G,{tiers:()=>A,tierRatingsState:()=>F,tierRatings:()=>L,streamUrl:()=>_,streamBaseUrl:()=>I,sanitizeUpstreamError:()=>g,qlexProviderMeta:()=>E,onTierRatingsChange:()=>f,omniqueryBaseUrl:()=>o,mergeLiveTiers:()=>k,mergeLiveTierRatings:()=>u,markTierRatingsUnavailable:()=>q,loadLiveRatings:()=>m,evaluatePermission:()=>S,copy:()=>v,beginTierRatingsLoad:()=>Y,bashPrefixWith:()=>d,TIER_RATINGS:()=>Z,AGENT_PROMPT_NAMES:()=>T});var p=3,U=[250,750];async function m(x){for(let K=0;K<p;K++){let J=await x();if(J!==void 0)return J;let j=U[K];if(j!==void 0)await new Promise((W)=>setTimeout(W,j))}return}function k(x){B(x)}function u(x){C(x)}function A(){return Object.entries(H).map(([x,K])=>({id:x,label:V[x]??x,providerID:K.providerID,modelID:K.modelID}))}function L(){return Z}function S(x,K,...J){return J.flat().findLast(($)=>D(x,$.permission)&&D(K,$.pattern))??{action:"ask",permission:x,pattern:"*"}}function d(x,K){for(let J=K.length;J>0;J--){let j=K.slice(0,J).join(" "),W=x[j];if(W!==void 0)return K.slice(0,W)}if(K.length===0)return[];return K.slice(0,1)}function _(){return h}function I(){return w}function o(){return M}function E(){return O}function g(x){return b(x)}function v(){return y}var T=["generate","explore","dream","distill","summary","compaction","title"];export{H as qt,G as rt};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{aq as a}from"./chunk-axdzm75h.js";import"./chunk-79agp7v3.js";import"./chunk-tns5x4w0.js";import"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-3k2b05fv.js";export{a as which};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Wf as a,Xf as b}from"./chunk-xvntsbb1.js";import"./chunk-tns5x4w0.js";import"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-3k2b05fv.js";export{a as start,b as Heap};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{mg as a,ng as b,og as c}from"./chunk-tbgczapt.js";import"./chunk-e74efvj2.js";import"./chunk-st5jaszz.js";import"./chunk-a1hzeejj.js";import"./chunk-sjw56r2n.js";import"./chunk-nj4d554m.js";import"./chunk-eva3nqqb.js";import"./chunk-yprmd5b7.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-f3bnn9rf.js";import"./chunk-xqdrr7xg.js";import"./chunk-axdzm75h.js";import"./chunk-94pcpztx.js";import"./chunk-hw5qyht3.js";import"./chunk-z8gdmvgg.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import"./chunk-g6cyhxwg.js";import"./chunk-n96tvjgj.js";import"./chunk-pkc4ddw1.js";import"./chunk-xgr6jnd6.js";import"./chunk-er38zew1.js";import"./chunk-dk975etf.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-nj2bbtmx.js";import"./chunk-tns5x4w0.js";import"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-ee23d2nz.js";import"./chunk-3k2b05fv.js";export{b as run,a as encodeDir,c as ClaudeImport};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ud as a,vd as b}from"./chunk-4hzm14xt.js";import"./chunk-xqdrr7xg.js";import"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-3k2b05fv.js";export{a as read,b as copy};