@qitqode/qitqode-android-arm64 0.2.0 → 0.2.2

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 (418) hide show
  1. package/bun +0 -0
  2. package/bundle/{chunk-cx7p4ezk.js → chunk-03mbn7nj.js} +2 -2
  3. package/bundle/{chunk-rrd0jf5m.js → chunk-07s30fpb.js} +1 -1
  4. package/bundle/{chunk-yacccwf6.js → chunk-087tnr8a.js} +1 -1
  5. package/bundle/chunk-0cdtq1r3.js +2 -0
  6. package/bundle/{chunk-kx2dp8ch.js → chunk-0f3ft9dh.js} +1 -1
  7. package/bundle/{chunk-rgxy4ngt.js → chunk-0gab4v98.js} +1 -1
  8. package/bundle/chunk-0ych0f5w.js +2 -0
  9. package/bundle/{chunk-w8d9srv7.js → chunk-0yjdatm6.js} +2 -2
  10. package/bundle/chunk-0ykeedfm.js +2 -0
  11. package/bundle/{chunk-rph9zj24.js → chunk-0zxwjsvz.js} +1 -1
  12. package/bundle/{chunk-pqnbdygz.js → chunk-1p6jjrea.js} +2 -2
  13. package/bundle/{chunk-9cw4cnz0.js → chunk-1q1cddy4.js} +1 -1
  14. package/bundle/{chunk-w9pdvcf9.js → chunk-1sfcxdbw.js} +2 -2
  15. package/bundle/chunk-22hr3ndh.js +2 -0
  16. package/bundle/chunk-23tyxyyj.js +2 -0
  17. package/bundle/chunk-2517cev8.js +2 -0
  18. package/bundle/chunk-28g1ndpx.js +2 -0
  19. package/bundle/{chunk-txqc7543.js → chunk-29zm623f.js} +2 -2
  20. package/bundle/{chunk-wm77svwm.js → chunk-2a9rzgk6.js} +1 -1
  21. package/bundle/chunk-2avxtbv3.js +2 -0
  22. package/bundle/{chunk-eaqfnwdj.js → chunk-2bgqy6z7.js} +1 -1
  23. package/bundle/{chunk-fyz7fngd.js → chunk-2faah8w1.js} +1 -1
  24. package/bundle/{chunk-9zre5e54.js → chunk-2hv2c8d5.js} +1 -1
  25. package/bundle/{chunk-swcgsrbj.js → chunk-2jpmxt4v.js} +1 -1
  26. package/bundle/chunk-2qk0k2eb.js +2 -0
  27. package/bundle/{chunk-nsjp44fp.js → chunk-2qwmrp16.js} +1 -1
  28. package/bundle/{chunk-dykqn0nj.js → chunk-2xqqkf86.js} +2 -2
  29. package/bundle/{chunk-d9x9kqvy.js → chunk-3888asr7.js} +1 -1
  30. package/bundle/chunk-3c3xzz0g.js +3 -0
  31. package/bundle/{chunk-zfcfyagt.js → chunk-3h49k2ck.js} +1 -1
  32. package/bundle/{chunk-r0g5yyhf.js → chunk-3jms025t.js} +1 -1
  33. package/bundle/{chunk-52b1v7mn.js → chunk-3qfpw8f6.js} +1 -1
  34. package/bundle/{chunk-v3x5nrc4.js → chunk-3tmq81kq.js} +2 -2
  35. package/bundle/{chunk-neqy8j4n.js → chunk-42r7z6sq.js} +1 -1
  36. package/bundle/chunk-42wdfks8.js +2 -0
  37. package/bundle/{chunk-kp8nkm3m.js → chunk-44y6dffe.js} +1 -1
  38. package/bundle/{chunk-j5kyf7vt.js → chunk-45fyv9f1.js} +2 -2
  39. package/bundle/chunk-4f19vqxf.js +2 -0
  40. package/bundle/{chunk-d93z6hrn.js → chunk-4fk46ngj.js} +1 -1
  41. package/bundle/{chunk-njkserae.js → chunk-4hd3v58j.js} +1 -1
  42. package/bundle/chunk-4m3k1atq.js +2 -0
  43. package/bundle/{chunk-1wpjmwnh.js → chunk-4mvg7jt1.js} +1 -1
  44. package/bundle/chunk-4n2ytddp.js +2 -0
  45. package/bundle/{chunk-zesbm9k1.js → chunk-4sxg9cgr.js} +1 -1
  46. package/bundle/{chunk-8fgamz4y.js → chunk-4v61ysex.js} +1 -1
  47. package/bundle/chunk-4yg42p6y.js +2 -0
  48. package/bundle/chunk-4zx3ze68.js +2 -0
  49. package/bundle/{chunk-qq2rcxv2.js → chunk-543pt030.js} +2 -2
  50. package/bundle/{chunk-rexdr63q.js → chunk-5az84brc.js} +2 -2
  51. package/bundle/{chunk-pnpre7ys.js → chunk-5js6a6gf.js} +1 -1
  52. package/bundle/{chunk-y0ydzdfc.js → chunk-5t0w9ecw.js} +1 -1
  53. package/bundle/{chunk-nq495be3.js → chunk-5wwd40t3.js} +1 -1
  54. package/bundle/chunk-637sjdzq.js +2 -0
  55. package/bundle/{chunk-snt1kefv.js → chunk-64c8q9zg.js} +3 -3
  56. package/bundle/{chunk-g794ey6w.js → chunk-6avjq7my.js} +1 -1
  57. package/bundle/{chunk-n0trgp1c.js → chunk-6dfjtzqb.js} +2 -2
  58. package/bundle/{chunk-dz3s882k.js → chunk-6f8qqbac.js} +189 -189
  59. package/bundle/chunk-6h8f89tt.js +2 -0
  60. package/bundle/{chunk-b0jh0rby.js → chunk-6j339s7a.js} +2 -2
  61. package/bundle/{chunk-8q6z6emx.js → chunk-6kf4vw2g.js} +1 -1
  62. package/bundle/{chunk-hgsykghj.js → chunk-6pcmv8vs.js} +2 -2
  63. package/bundle/chunk-6sjj203r.js +2 -0
  64. package/bundle/{chunk-kt0ej3nq.js → chunk-6ypafpg8.js} +1 -1
  65. package/bundle/{chunk-p8kpqyxb.js → chunk-732yr6qq.js} +2 -2
  66. package/bundle/{chunk-3sz6gw10.js → chunk-73fz0cf4.js} +2 -2
  67. package/bundle/chunk-79aka9xe.js +2 -0
  68. package/bundle/{chunk-s2xdf6qh.js → chunk-7ab3yw9j.js} +2 -2
  69. package/bundle/{chunk-8tp4whyw.js → chunk-7my2231h.js} +1 -1
  70. package/bundle/{chunk-vvzbfv2f.js → chunk-7njz51r4.js} +1 -1
  71. package/bundle/chunk-7nqdhe7x.js +2 -0
  72. package/bundle/{chunk-zaan8jk6.js → chunk-7ntw4rrn.js} +1 -1
  73. package/bundle/chunk-7q003wdd.js +4 -0
  74. package/bundle/chunk-7x88b2n2.js +2 -0
  75. package/bundle/{chunk-6r8pg6ma.js → chunk-7z884mz2.js} +1 -1
  76. package/bundle/{chunk-17pxm5d3.js → chunk-7zc04q43.js} +2 -2
  77. package/bundle/{chunk-v7q3d3n6.js → chunk-85xh72hk.js} +2 -2
  78. package/bundle/{chunk-jgz1a29w.js → chunk-86jsqc7d.js} +3 -3
  79. package/bundle/{chunk-zbqzm65q.js → chunk-86yk21g4.js} +1 -1
  80. package/bundle/{chunk-aj3y2e86.js → chunk-8apeexas.js} +1 -1
  81. package/bundle/{chunk-xjhezxft.js → chunk-8d6e4jg7.js} +3 -3
  82. package/bundle/{chunk-w3bmf3zz.js → chunk-8e6gx3gg.js} +1 -1
  83. package/bundle/chunk-8mthftwc.js +2 -0
  84. package/bundle/{chunk-73ckx171.js → chunk-8q5ns61h.js} +1 -1
  85. package/bundle/{chunk-549ptbaj.js → chunk-8rh0femq.js} +1 -1
  86. package/bundle/{chunk-qyjt0qnq.js → chunk-8v6x712g.js} +2 -2
  87. package/bundle/chunk-8wdara3b.js +2 -0
  88. package/bundle/chunk-8xhzpnph.js +2 -0
  89. package/bundle/{chunk-z0tfsdb9.js → chunk-91z7azf7.js} +1 -1
  90. package/bundle/{chunk-kqhh2pm9.js → chunk-94qhpkfx.js} +1 -1
  91. package/bundle/{chunk-g8cfzzrs.js → chunk-96sqbyvf.js} +1 -1
  92. package/bundle/{chunk-gxmxx8jb.js → chunk-99148b1k.js} +1 -1
  93. package/bundle/chunk-9akz8w0d.js +2 -0
  94. package/bundle/{chunk-7gbytqkn.js → chunk-9b4aqcde.js} +2 -2
  95. package/bundle/{chunk-nhwhkx62.js → chunk-9bm9z52r.js} +1 -1
  96. package/bundle/{chunk-tdmn21z0.js → chunk-9ea1n338.js} +2 -2
  97. package/bundle/chunk-9etpppyv.js +3 -0
  98. package/bundle/{chunk-vgaxv70x.js → chunk-9jrxrjzt.js} +2 -2
  99. package/bundle/{chunk-3bkdbqjj.js → chunk-9jsgs71h.js} +1 -1
  100. package/bundle/chunk-9pnpmtb2.js +2 -0
  101. package/bundle/{chunk-pxx2hz0g.js → chunk-9rxyq6f9.js} +2 -2
  102. package/bundle/chunk-9s785py4.js +28 -0
  103. package/bundle/{chunk-9fkmhmh6.js → chunk-9y15zjxa.js} +1 -1
  104. package/bundle/{chunk-mdzzcrf9.js → chunk-a2dz9nqh.js} +2 -2
  105. package/bundle/{chunk-rtdym35y.js → chunk-a550vst5.js} +149 -141
  106. package/bundle/{chunk-46ztrjw0.js → chunk-a5pbvp1f.js} +1 -1
  107. package/bundle/chunk-a7p0x4sw.js +2 -0
  108. package/bundle/{chunk-ev3a2sxv.js → chunk-a92hh67a.js} +2 -2
  109. package/bundle/chunk-ae0a496j.js +2 -0
  110. package/bundle/chunk-aq1j9y18.js +2 -0
  111. package/bundle/chunk-aq8nz9hp.js +2 -0
  112. package/bundle/{chunk-zxddasg8.js → chunk-as845ya4.js} +1 -1
  113. package/bundle/chunk-b4zy78be.js +2 -0
  114. package/bundle/{chunk-45mjcxqk.js → chunk-b50t4jc5.js} +1 -1
  115. package/bundle/chunk-basjzwqp.js +2 -0
  116. package/bundle/{chunk-d1rn44wz.js → chunk-bbbh69ys.js} +1 -1
  117. package/bundle/{chunk-mw2hr4pd.js → chunk-bcx2vkv4.js} +1 -1
  118. package/bundle/{chunk-72zxassf.js → chunk-bggybm9k.js} +1 -1
  119. package/bundle/{chunk-4gs87ghj.js → chunk-bgng3rdj.js} +2 -2
  120. package/bundle/chunk-bhetpmgq.js +3 -0
  121. package/bundle/{chunk-bnz0mxak.js → chunk-bk3z400e.js} +1 -1
  122. package/bundle/chunk-bm7xpjh6.js +2 -0
  123. package/bundle/chunk-c1bw1q75.js +2 -0
  124. package/bundle/{chunk-7fawtcnn.js → chunk-c1g8n10t.js} +1 -1
  125. package/bundle/chunk-c2k556rk.js +2 -0
  126. package/bundle/chunk-c47vp7ne.js +2 -0
  127. package/bundle/{chunk-w03fdrxe.js → chunk-cbf1y12x.js} +1 -1
  128. package/bundle/chunk-cbhgf058.js +2 -0
  129. package/bundle/{chunk-vc4e6xc4.js → chunk-cbmwhvxw.js} +2 -2
  130. package/bundle/{chunk-5bate758.js → chunk-cp39f96a.js} +1 -1
  131. package/bundle/{chunk-9nk0ts0s.js → chunk-d307vb2d.js} +1 -1
  132. package/bundle/chunk-d41mg7at.js +2 -0
  133. package/bundle/chunk-d50kpss6.js +2 -0
  134. package/bundle/chunk-day0rb5p.js +2 -0
  135. package/bundle/{chunk-ws3p9cya.js → chunk-dbztxdea.js} +2 -2
  136. package/bundle/chunk-dp7cww4v.js +2 -0
  137. package/bundle/{chunk-yeq7b87a.js → chunk-drwqag0f.js} +1 -1
  138. package/bundle/chunk-dy31mchw.js +3 -0
  139. package/bundle/{chunk-5myxjxae.js → chunk-e374shb8.js} +2 -2
  140. package/bundle/{chunk-qdcf1ay5.js → chunk-e586sjb0.js} +2 -2
  141. package/bundle/{chunk-pr1ysgr3.js → chunk-e5rda9mx.js} +1 -1
  142. package/bundle/{chunk-qs4wef8c.js → chunk-e6wp96vm.js} +1 -1
  143. package/bundle/chunk-e999xtfj.js +2 -0
  144. package/bundle/{chunk-n7d9eemn.js → chunk-ehfxypks.js} +216 -218
  145. package/bundle/{chunk-gnt982jr.js → chunk-epa576pa.js} +3 -3
  146. package/bundle/{chunk-m0xsvzyd.js → chunk-et5dnymk.js} +2 -2
  147. package/bundle/chunk-eyr0vf92.js +2 -0
  148. package/bundle/{chunk-02xcb52z.js → chunk-ezfzb8qc.js} +2 -2
  149. package/bundle/{chunk-4sazy0nq.js → chunk-f83wv08n.js} +1 -1
  150. package/bundle/{chunk-3dr4469n.js → chunk-fbm6qczy.js} +1 -1
  151. package/bundle/{chunk-0g25z230.js → chunk-fd7fmvyw.js} +1 -1
  152. package/bundle/{chunk-0z33en1a.js → chunk-fgn83bs7.js} +1 -1
  153. package/bundle/{chunk-dshnn54c.js → chunk-fpm2vgz6.js} +1 -1
  154. package/bundle/{chunk-px8vtbmr.js → chunk-frsd6e1h.js} +2 -2
  155. package/bundle/{chunk-w5940jxm.js → chunk-fvy24yhq.js} +1 -1
  156. package/bundle/{chunk-dt899wbf.js → chunk-g3kd4957.js} +2 -2
  157. package/bundle/chunk-g7k6ecb2.js +11 -0
  158. package/bundle/chunk-gbmmbhy4.js +2 -0
  159. package/bundle/chunk-gp877cq5.js +2 -0
  160. package/bundle/{chunk-tgd5ctnt.js → chunk-gr4bctqj.js} +2 -2
  161. package/bundle/{chunk-dvxk6mr6.js → chunk-grw4gg9j.js} +2 -2
  162. package/bundle/{chunk-mvnxwwe7.js → chunk-gtjn3yc4.js} +2 -2
  163. package/bundle/{chunk-m6zxr0j8.js → chunk-h10wjk96.js} +2 -2
  164. package/bundle/{chunk-cxtxvt43.js → chunk-h2bmss2m.js} +1 -1
  165. package/bundle/chunk-h4f582d6.js +2 -0
  166. package/bundle/chunk-h57c6ne3.js +2 -0
  167. package/bundle/chunk-hk8vvc10.js +2 -0
  168. package/bundle/{chunk-x42w8ewc.js → chunk-hnrqhcgq.js} +1 -1
  169. package/bundle/{chunk-hcy77w6t.js → chunk-hq9bgnqb.js} +1 -1
  170. package/bundle/{chunk-gkj4a27z.js → chunk-hrw5rmj1.js} +1 -1
  171. package/bundle/{chunk-n2ygpy76.js → chunk-hs3vfhar.js} +1 -1
  172. package/bundle/chunk-hwavzxdm.js +2 -0
  173. package/bundle/chunk-hwnc2sa5.js +2 -0
  174. package/bundle/chunk-hy86wfad.js +2 -0
  175. package/bundle/{chunk-aw8af3ky.js → chunk-j17421hz.js} +1 -1
  176. package/bundle/chunk-j2gvpa15.js +2 -0
  177. package/bundle/{chunk-te5tfq79.js → chunk-j3jqk62r.js} +1 -1
  178. package/bundle/{chunk-jqn27885.js → chunk-j5ymkhry.js} +1 -1
  179. package/bundle/chunk-j7n8khk7.js +2 -0
  180. package/bundle/chunk-jkh98wby.js +2 -0
  181. package/bundle/{chunk-h7w35n7w.js → chunk-jv4th87b.js} +1 -1
  182. package/bundle/{chunk-j63fkt6n.js → chunk-jvjq554f.js} +1 -1
  183. package/bundle/{chunk-00sr2gwz.js → chunk-jw114bbt.js} +2 -2
  184. package/bundle/{chunk-ax1y4699.js → chunk-jwph7tpc.js} +1 -1
  185. package/bundle/{chunk-xdacgfba.js → chunk-k1gddnkm.js} +1 -1
  186. package/bundle/chunk-k5a652s4.js +2 -0
  187. package/bundle/{chunk-1mcsf4yb.js → chunk-k6cbfrzc.js} +2 -2
  188. package/bundle/chunk-k6w32q2p.js +2 -0
  189. package/bundle/{chunk-5kmfnkzv.js → chunk-kdcnder5.js} +1 -1
  190. package/bundle/chunk-kghwk0yh.js +2 -0
  191. package/bundle/chunk-kh8de8re.js +2 -0
  192. package/bundle/{chunk-r6ndvzd0.js → chunk-km1n4ttr.js} +1 -1
  193. package/bundle/{chunk-tzrbb0e8.js → chunk-kmwy6c9g.js} +2 -2
  194. package/bundle/{chunk-ydc6ypjt.js → chunk-ks1cs80p.js} +2 -2
  195. package/bundle/{chunk-08q55ya0.js → chunk-kxjrrdj0.js} +1 -1
  196. package/bundle/{chunk-jts0dma5.js → chunk-kzvvvj79.js} +2 -2
  197. package/bundle/chunk-mce8aa9y.js +2 -0
  198. package/bundle/chunk-me1ja46g.js +2 -0
  199. package/bundle/chunk-mgadsp7r.js +2 -0
  200. package/bundle/{chunk-hb9mc5f9.js → chunk-mpe8zxc0.js} +1 -1
  201. package/bundle/{chunk-eb8nsk7e.js → chunk-mrn44msr.js} +2 -2
  202. package/bundle/{chunk-yykjvt7f.js → chunk-mswx4k75.js} +2 -2
  203. package/bundle/{chunk-std2bgv7.js → chunk-mxhb5adq.js} +2 -2
  204. package/bundle/{chunk-gwfx7tx7.js → chunk-my3cswnp.js} +2 -2
  205. package/bundle/chunk-n0k0pp4k.js +2 -0
  206. package/bundle/chunk-n393nnh5.js +2 -0
  207. package/bundle/chunk-n5vyed7w.js +2 -0
  208. package/bundle/{chunk-jf6ry79j.js → chunk-n7kqdqkh.js} +4 -4
  209. package/bundle/{chunk-tdxbm1nd.js → chunk-n90eh3e7.js} +1 -1
  210. package/bundle/{chunk-s8mghr5a.js → chunk-ngvp6zc2.js} +2 -2
  211. package/bundle/{chunk-mcc5ynma.js → chunk-p4ewy9xh.js} +3 -3
  212. package/bundle/{chunk-vgnddhdj.js → chunk-p635phfw.js} +1 -1
  213. package/bundle/{chunk-dgx4rq86.js → chunk-p887g1xj.js} +1 -1
  214. package/bundle/{chunk-7jhrxzjx.js → chunk-p9mj4zyk.js} +2 -2
  215. package/bundle/chunk-pasm65wq.js +2 -0
  216. package/bundle/{chunk-xdjwapwy.js → chunk-pfkm3j8g.js} +2 -2
  217. package/bundle/chunk-phpmxjf8.js +2 -0
  218. package/bundle/{chunk-9dh9bc9d.js → chunk-pp9neaaz.js} +1 -1
  219. package/bundle/{chunk-c72jajx9.js → chunk-pzefsndd.js} +1 -1
  220. package/bundle/{chunk-dh1h513y.js → chunk-q128vfc6.js} +1 -1
  221. package/bundle/chunk-q2q3dmg3.js +2 -0
  222. package/bundle/chunk-q46pzk9z.js +8 -0
  223. package/bundle/{chunk-4fa390yr.js → chunk-q4fn41ex.js} +2 -2
  224. package/bundle/{chunk-zrmx397j.js → chunk-q5abwn50.js} +1 -1
  225. package/bundle/{chunk-7vftsy04.js → chunk-qaz100ht.js} +1 -1
  226. package/bundle/{chunk-pnq1h5az.js → chunk-qhnpq5gb.js} +2 -2
  227. package/bundle/chunk-qvzvxsjw.js +2 -0
  228. package/bundle/{chunk-yzwgvjzd.js → chunk-r0s28gnb.js} +1 -1
  229. package/bundle/chunk-racrb1b3.js +2 -0
  230. package/bundle/{chunk-yj6rbe9p.js → chunk-rcyzqa3g.js} +2 -2
  231. package/bundle/{chunk-70pb4kcm.js → chunk-rdwma0de.js} +2 -2
  232. package/bundle/{chunk-25bp7pcm.js → chunk-rk2bk4s7.js} +2 -2
  233. package/bundle/{chunk-x6rr6ss1.js → chunk-rm5ntsvn.js} +1 -1
  234. package/bundle/{chunk-xhbb8b5g.js → chunk-rp8asmq7.js} +1 -1
  235. package/bundle/{chunk-z1rshv6g.js → chunk-rpfhgncs.js} +1 -1
  236. package/bundle/{chunk-gt6tgm42.js → chunk-s0c0t6qr.js} +1 -1
  237. package/bundle/{chunk-cagk1sjd.js → chunk-s0ptrw0z.js} +1 -1
  238. package/bundle/{chunk-yw9pfqxt.js → chunk-s0ty36qg.js} +1 -1
  239. package/bundle/{chunk-kb6v5hhm.js → chunk-s77qktcn.js} +2 -2
  240. package/bundle/{chunk-sxy4hyyy.js → chunk-sghy9s7m.js} +1 -1
  241. package/bundle/{chunk-k7n1csxv.js → chunk-sjreby6e.js} +1 -1
  242. package/bundle/chunk-skpkjnyy.js +2 -0
  243. package/bundle/{chunk-8r3410c2.js → chunk-skv9ww0s.js} +1 -1
  244. package/bundle/chunk-skxhg212.js +2 -0
  245. package/bundle/chunk-snt4kwab.js +2 -0
  246. package/bundle/chunk-sq47t8f1.js +2 -0
  247. package/bundle/chunk-sqhgnvvs.js +2 -0
  248. package/bundle/{chunk-ztnepaqc.js → chunk-ssdw9zre.js} +1 -1
  249. package/bundle/chunk-t114r59h.js +2 -0
  250. package/bundle/{chunk-909fp6pm.js → chunk-t1475j9f.js} +1 -1
  251. package/bundle/chunk-t1f56k0j.js +2 -0
  252. package/bundle/{chunk-9s4whpg1.js → chunk-t1jgx17a.js} +2 -2
  253. package/bundle/chunk-t69jx6fz.js +2 -0
  254. package/bundle/{chunk-srxx88nb.js → chunk-t9zbp2qw.js} +1 -1
  255. package/bundle/{chunk-jcjaw7tk.js → chunk-ta7mfkms.js} +2 -2
  256. package/bundle/{chunk-fn8191ps.js → chunk-tczbhj0e.js} +1 -1
  257. package/bundle/{chunk-h1kg35mn.js → chunk-tge53d52.js} +1 -1
  258. package/bundle/{chunk-2pzvcpv4.js → chunk-tj3rem3q.js} +2 -2
  259. package/bundle/chunk-tsb3jsx4.js +2 -0
  260. package/bundle/chunk-ttpbpzbh.js +2 -0
  261. package/bundle/{chunk-2dkrfc1s.js → chunk-v5z6sx6j.js} +1 -1
  262. package/bundle/chunk-v667egp5.js +2 -0
  263. package/bundle/{chunk-60qyqqxx.js → chunk-v9rg0a8g.js} +1 -1
  264. package/bundle/{chunk-jngchw38.js → chunk-ve3np791.js} +1 -1
  265. package/bundle/{chunk-wev34grp.js → chunk-vhe92p7a.js} +2 -2
  266. package/bundle/{chunk-ceefd2nj.js → chunk-vk88jj60.js} +1 -1
  267. package/bundle/{chunk-atpzz901.js → chunk-vm1ek7yf.js} +1 -1
  268. package/bundle/{chunk-3mepk08v.js → chunk-vqpfpmha.js} +2 -2
  269. package/bundle/{chunk-cdh26622.js → chunk-vqss3e48.js} +2 -2
  270. package/bundle/chunk-vrv67tt0.js +2 -0
  271. package/bundle/chunk-vtw0wwch.js +17 -0
  272. package/bundle/{chunk-z7vv0ngm.js → chunk-vyh300ac.js} +2 -2
  273. package/bundle/{chunk-qpzspr9z.js → chunk-w30b563s.js} +2 -2
  274. package/bundle/{chunk-ewpzqnj4.js → chunk-w79jzf8w.js} +1 -1
  275. package/bundle/{chunk-yha554nm.js → chunk-w7em72p8.js} +2 -2
  276. package/bundle/chunk-wcqfr8vr.js +3 -0
  277. package/bundle/chunk-wcx7hc2p.js +635 -0
  278. package/bundle/{chunk-r58gzg6m.js → chunk-wdaf713t.js} +1 -1
  279. package/bundle/{chunk-ymtcm4xd.js → chunk-wf4x5cjc.js} +1 -1
  280. package/bundle/{chunk-vsys768k.js → chunk-wfggztm4.js} +1 -1
  281. package/bundle/chunk-wv8qx8sa.js +2 -0
  282. package/bundle/{chunk-acyj91wq.js → chunk-x2cavpa9.js} +1 -1
  283. package/bundle/{chunk-qb35hqm4.js → chunk-x4pdpka8.js} +1 -1
  284. package/bundle/{chunk-vm58fkrv.js → chunk-xd3xc1vv.js} +1 -1
  285. package/bundle/{chunk-v0yxkq99.js → chunk-xmjntwjc.js} +2 -2
  286. package/bundle/{chunk-64s7vfj7.js → chunk-xny5ecn0.js} +2 -2
  287. package/bundle/chunk-xxrtr6sd.js +2 -0
  288. package/bundle/chunk-y287zwkr.js +10 -0
  289. package/bundle/{chunk-ypk3t1eh.js → chunk-y2ptjam9.js} +1 -1
  290. package/bundle/{chunk-ezrskm25.js → chunk-y3dfk6n5.js} +1 -1
  291. package/bundle/{chunk-t01bhw5h.js → chunk-y4e7e42x.js} +3 -3
  292. package/bundle/{chunk-98effz12.js → chunk-y6h35v4a.js} +1 -1
  293. package/bundle/chunk-y72p79v2.js +2 -0
  294. package/bundle/chunk-y8eggnrr.js +2 -0
  295. package/bundle/chunk-y9q0f9qz.js +2 -0
  296. package/bundle/{chunk-9xvctnjr.js → chunk-yajd975f.js} +1 -1
  297. package/bundle/chunk-yck5h49c.js +2 -0
  298. package/bundle/{chunk-8yr682pv.js → chunk-yd2emszh.js} +2 -2
  299. package/bundle/{chunk-p9zrk16q.js → chunk-yd8bzhv6.js} +1 -1
  300. package/bundle/chunk-yhsnmpzv.js +2 -0
  301. package/bundle/{chunk-y1b2h15z.js → chunk-ypcc3cnb.js} +1 -1
  302. package/bundle/{chunk-qy1a2tpc.js → chunk-yr35q7q1.js} +1 -1
  303. package/bundle/{chunk-rcyhqkv5.js → chunk-yrfq22a5.js} +1 -1
  304. package/bundle/{chunk-gg7bg3ek.js → chunk-yvjke593.js} +1 -1
  305. package/bundle/{chunk-871f8x99.js → chunk-ywdtp534.js} +2 -2
  306. package/bundle/{chunk-zfnbk5gy.js → chunk-ywkvq7zb.js} +1 -1
  307. package/bundle/{chunk-p3rp99na.js → chunk-yx1h0b5v.js} +1 -1
  308. package/bundle/{chunk-mzbr0m2v.js → chunk-yz0pwv2m.js} +1 -1
  309. package/bundle/{chunk-q81m4m9z.js → chunk-z2h1gxyx.js} +1 -1
  310. package/bundle/chunk-zcp0wx4j.js +5 -0
  311. package/bundle/{chunk-qqne79vp.js → chunk-zdzxsyxs.js} +2 -2
  312. package/bundle/{chunk-yzh4rmrt.js → chunk-zek5c15t.js} +1 -1
  313. package/bundle/{chunk-8dxdeksr.js → chunk-zfd70p01.js} +1 -1
  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-092bx2yw.js +0 -2
  319. package/bundle/chunk-0jrgk6vk.js +0 -2
  320. package/bundle/chunk-0ne5m1n3.js +0 -2
  321. package/bundle/chunk-0qn52zsd.js +0 -2
  322. package/bundle/chunk-10accb7b.js +0 -2
  323. package/bundle/chunk-13kpdfr7.js +0 -2
  324. package/bundle/chunk-15s8zwgf.js +0 -2
  325. package/bundle/chunk-1bx2sjn6.js +0 -11
  326. package/bundle/chunk-1kgyfja6.js +0 -2
  327. package/bundle/chunk-4dtkj9zg.js +0 -2
  328. package/bundle/chunk-4e9p3e0a.js +0 -2
  329. package/bundle/chunk-4tbqsrsn.js +0 -2
  330. package/bundle/chunk-53kns5wy.js +0 -2
  331. package/bundle/chunk-559ek1ym.js +0 -2
  332. package/bundle/chunk-55wxgsga.js +0 -2
  333. package/bundle/chunk-5ke0yqqz.js +0 -8
  334. package/bundle/chunk-5q1fz2az.js +0 -2
  335. package/bundle/chunk-5sgpjgss.js +0 -10
  336. package/bundle/chunk-88emsbaz.js +0 -2
  337. package/bundle/chunk-8yn64y27.js +0 -2
  338. package/bundle/chunk-8ywa7az5.js +0 -2
  339. package/bundle/chunk-8ywdddts.js +0 -2
  340. package/bundle/chunk-92zjark4.js +0 -2
  341. package/bundle/chunk-a6z0fhta.js +0 -2
  342. package/bundle/chunk-akpssv2d.js +0 -2
  343. package/bundle/chunk-aq28ejhv.js +0 -2
  344. package/bundle/chunk-b10px5g4.js +0 -2
  345. package/bundle/chunk-bha3sbsj.js +0 -2
  346. package/bundle/chunk-bs020a3x.js +0 -2
  347. package/bundle/chunk-bs61sezq.js +0 -2
  348. package/bundle/chunk-cmdjkx32.js +0 -2
  349. package/bundle/chunk-de2rfsaf.js +0 -2
  350. package/bundle/chunk-dncnyzaa.js +0 -2
  351. package/bundle/chunk-dp6zktka.js +0 -2
  352. package/bundle/chunk-dvqdtdza.js +0 -2
  353. package/bundle/chunk-ebabnv33.js +0 -3
  354. package/bundle/chunk-ebdpg3cn.js +0 -2
  355. package/bundle/chunk-eyc6tb5h.js +0 -2
  356. package/bundle/chunk-eze57bty.js +0 -2
  357. package/bundle/chunk-fa47vzfc.js +0 -2
  358. package/bundle/chunk-fe397ph0.js +0 -2
  359. package/bundle/chunk-fr75ytdr.js +0 -2
  360. package/bundle/chunk-fw2tnbt6.js +0 -2
  361. package/bundle/chunk-fwr2qgqb.js +0 -2
  362. package/bundle/chunk-g204pt98.js +0 -2
  363. package/bundle/chunk-gcgmwqhh.js +0 -2
  364. package/bundle/chunk-grdfpd57.js +0 -2
  365. package/bundle/chunk-gw36mrg4.js +0 -2
  366. package/bundle/chunk-h36qec67.js +0 -2
  367. package/bundle/chunk-h9gtymfm.js +0 -2
  368. package/bundle/chunk-h9qn35pn.js +0 -2
  369. package/bundle/chunk-hd8q4msp.js +0 -2
  370. package/bundle/chunk-hhjkezfz.js +0 -2
  371. package/bundle/chunk-hnz570f9.js +0 -3
  372. package/bundle/chunk-jfz8wwk9.js +0 -2
  373. package/bundle/chunk-js6hqmq7.js +0 -2
  374. package/bundle/chunk-k70x182t.js +0 -2
  375. package/bundle/chunk-kmtfdky8.js +0 -4
  376. package/bundle/chunk-kwzawx7r.js +0 -2
  377. package/bundle/chunk-m0mek3es.js +0 -2
  378. package/bundle/chunk-m31d2n6h.js +0 -2
  379. package/bundle/chunk-n14qktbg.js +0 -2
  380. package/bundle/chunk-n38h109k.js +0 -17
  381. package/bundle/chunk-nzzsj54n.js +0 -2
  382. package/bundle/chunk-p19qfw59.js +0 -2
  383. package/bundle/chunk-p2yxj9s4.js +0 -2
  384. package/bundle/chunk-ps9p14y6.js +0 -2
  385. package/bundle/chunk-qagc6v17.js +0 -2
  386. package/bundle/chunk-qc0zhbhm.js +0 -2
  387. package/bundle/chunk-r78kfhvz.js +0 -2
  388. package/bundle/chunk-rnd5mnsm.js +0 -2
  389. package/bundle/chunk-schtpyjs.js +0 -2
  390. package/bundle/chunk-sp8ek94w.js +0 -5
  391. package/bundle/chunk-sv1s1qxd.js +0 -619
  392. package/bundle/chunk-sxwqrvmy.js +0 -28
  393. package/bundle/chunk-syc4b8rt.js +0 -2
  394. package/bundle/chunk-tcs6wgna.js +0 -3
  395. package/bundle/chunk-tf4xwqz7.js +0 -2
  396. package/bundle/chunk-twhavv1m.js +0 -2
  397. package/bundle/chunk-tzg4z74d.js +0 -2
  398. package/bundle/chunk-v8vcwx23.js +0 -2
  399. package/bundle/chunk-vftqwdpg.js +0 -3
  400. package/bundle/chunk-w6rf2knb.js +0 -2
  401. package/bundle/chunk-wh7r96t3.js +0 -2
  402. package/bundle/chunk-wnjqaxze.js +0 -2
  403. package/bundle/chunk-xc9se3c8.js +0 -2
  404. package/bundle/chunk-xfz698bh.js +0 -2
  405. package/bundle/chunk-xxj3sgd5.js +0 -2
  406. package/bundle/chunk-xxvqq7kc.js +0 -2
  407. package/bundle/chunk-ye0mkqb4.js +0 -2
  408. package/bundle/chunk-yfp9y71y.js +0 -2
  409. package/bundle/chunk-yjjh339w.js +0 -2
  410. package/bundle/chunk-yt6vd7a5.js +0 -2
  411. package/bundle/chunk-yzn08nx1.js +0 -2
  412. package/bundle/chunk-yzq3c3dq.js +0 -2
  413. package/bundle/chunk-z1j25911.js +0 -2
  414. package/bundle/chunk-z210dtw1.js +0 -3
  415. package/bundle/chunk-z29ahthm.js +0 -2
  416. package/bundle/chunk-zgre4gc2.js +0 -2
  417. package/bundle/chunk-zthkjx33.js +0 -2
  418. package/bundle/chunk-zwvwbrsc.js +0 -2
@@ -1,28 +0,0 @@
1
- // @bun
2
- import{mf as GH}from"./chunk-std2bgv7.js";import{Pp as DH,Tp as a,jq as NH}from"./chunk-xjhezxft.js";import"./chunk-gwfx7tx7.js";import"./chunk-1wpjmwnh.js";import"./chunk-cqtkxwd8.js";import"./chunk-ymtcm4xd.js";import"./chunk-cxtxvt43.js";import"./chunk-871f8x99.js";import"./chunk-cx7p4ezk.js";import{Qt as S}from"./chunk-twhavv1m.js";import"./chunk-v0yxkq99.js";import{su as VH}from"./chunk-2pzvcpv4.js";import{Bu as n,Ju as WH}from"./chunk-kmtfdky8.js";import"./chunk-vc4e6xc4.js";import"./chunk-hnz570f9.js";import"./chunk-tdmn21z0.js";import"./chunk-s8mghr5a.js";import"./chunk-pqnbdygz.js";import"./chunk-ydc6ypjt.js";import"./chunk-4sazy0nq.js";var EH=0.9,RH=256,HH="[Earlier tool result removed to fit the request size limit]",y;function x(H){return Buffer.byteLength(JSON.stringify(H),"utf8")}function JH(){return n.QITQODE_QLEX_MAX_REQUEST_BYTES??y}function r(H){let Z=n.QITQODE_QLEX_MAX_REQUEST_BYTES;if(Z!==void 0)return Z;let $=Math.max(1,Math.min(Math.floor(H*EH),Math.floor(H)-1));return y=y===void 0?$:Math.min(y,$),y}function g(H,Z){return!!H&&typeof H==="object"&&H.role===Z}function ZH(H){let Z=[],$=0;while($<H.length){let J=$,X=H[$];if($++,g(X,"assistant")&&Array.isArray(X?.tool_calls)&&X.tool_calls.length>0)while($<H.length&&g(H[$],"tool"))$++;Z.push({start:J,end:$})}return Z}function $H(H,Z){if(Z.length===0)return[];let $=-1;for(let J=Z.length-1;J>=0;J--){let X=Z[J],z=!1;for(let K=X.start;K<X.end;K++)if(g(H[K],"user"))z=!0;if(z){$=J;break}}return Z.filter((J,X)=>{if(X===Z.length-1)return!1;if(X===$)return!1;if(J.start===0&&g(H[0],"system"))return!1;return!0})}function o(H,Z){let $=x(H),J={toolResultsElided:0,unitsDropped:0},X=()=>({body:H,bytes:$,originalBytes:$,reduced:!1,actions:J});if(!H||typeof H!=="object")return X();let z=H.messages;if(!Array.isArray(z))return X();let K=z.map((N)=>N&&typeof N==="object"?{...N}:N),Y=()=>({...H,messages:K}),V=()=>x(Y())<=Z;{let N=K;for(let _ of $H(N,ZH(N))){let L=!1;for(let P=_.start;P<_.end;P++){let k=N[P];if(!g(k,"tool"))continue;let C=k?.content;if(typeof C!=="string"||C.length<RH)continue;if(C===HH)continue;N[P]={...k,content:HH},J.toolResultsElided++,L=!0}if(L&&V())break}}if(!V())for(;;){let N=K,L=$H(N,ZH(N))[0];if(!L)break;if(K=[...N.slice(0,L.start),...N.slice(L.end)],J.unitsDropped++,V())break}let j=Y(),D=x(j);return{body:j,bytes:D,originalBytes:$,reduced:D<$&&D<=Z,actions:J}}var E=WH({service:"provider.qlex"}),AH=S.streamUrl(),TH=S.omniqueryBaseUrl()+"/runOrchestrated";function I(H,Z){let $=H;if(Z.status!==void 0)$.status=Z.status;if(Z.upstreamCode!==void 0)$.upstreamCode=Z.upstreamCode;if(Z.requestId!==void 0)$.requestId=Z.requestId;if($.category=Z.category,$.retryable=Z.retryable,Z.outputBudgetRecoveryAvailable!==void 0)$.outputBudgetRecoveryAvailable=Z.outputBudgetRecoveryAvailable;if(Z.outputBudgetRecoveryTokens!==void 0)$.outputBudgetRecoveryTokens=Z.outputBudgetRecoveryTokens}function B(H,Z){return{...H,...Z}}class jH extends Error{name="QlexNotLoggedInError";constructor(H){super(S.copy().notLoggedIn);I(this,B({category:"invalid_credentials",retryable:!1},H))}}class UH extends Error{name="QlexInsufficientBalanceError";constructor(H,Z){super(S.copy().insufficientBalance(H));I(this,B({status:402,category:"billing",retryable:!1},Z))}}class _H extends Error{name="QlexRateLimitError";constructor(H){super(S.copy().rateLimit);I(this,B({status:429,category:"rate_limited",retryable:!0},H))}}class FH extends Error{name="QlexInvalidCredentialsError";constructor(H,Z){super(S.copy().invalidCredentials(H));I(this,B({status:401,category:"invalid_credentials",retryable:!1},Z))}}class LH extends Error{name="QlexRequestRejectedError";constructor(H,Z,$){super(S.copy().requestRejected(H,Z));I(this,B({status:400,category:"request_rejected",retryable:!1},$))}}class d extends Error{name="QlexRequestTooLargeError";stage;constructor(H="irreducible",Z,$){super(H==="after-reduction"?S.copy().requestTooLargeAfterReduction(Z):S.copy().requestTooLargeIrreducible(Z));this.stage=H,I(this,B({status:413,category:"request_too_large",retryable:!1},$))}}class OH extends Error{name="QlexRequestNotSentError";constructor(H,Z){super(S.copy().requestNotSent(H));I(this,B({category:"request_rejected",retryable:!1},Z))}}class f extends Error{name="QlexGatewayError";constructor(H,Z){super(S.copy().gatewayUnavailable(H));I(this,B({category:"gateway_routing",retryable:!1},Z))}}var IH=60000;function QZ(H){return S.sanitizeUpstreamError(H)}class v extends Error{name="QlexStreamError";constructor(H,Z){let $=B({category:"unknown",retryable:!1},Z);super($.category==="output_budget_exhausted"?S.copy().outputBudgetExhausted():$.category==="empty_output"?S.copy().emptyOutput():$.category==="stream_truncated"?S.copy().streamCutOff():$.category==="stream_failed"?S.copy().streamFailedAfterRetries():S.copy().streamFailed(H));I(this,$),VH(this)}}var BH=[{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:/(output (?:token )?budget|maximum output tokens|max_tokens|finish[_ -]?reason.{0,20}(length|budget)|reasoning.{0,20}(budget|tokens))/i,category:"output_budget_exhausted",retryable:!1},{match:/\b(no visible output|empty output|produced no (?:visible )?(?:text|output)|nothing to display)\b/i,category:"empty_output",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}],bH={ERR_EMPTY_RESULT:{category:"empty_output",retryable:!1},ERR_TRUNCATED_OUTPUT:{category:"stream_truncated",retryable:!0},ERR_STREAM:{category:"stream_failed",retryable:!0}},xH=/^\s*(ERR_[A-Z0-9_]+)\b(?:\s*(?:[\u2014\u2013:-]\s*)?)?/i,hH=/\b(req_[A-Za-z0-9][A-Za-z0-9_-]*)\b/;function vH(H){let Z=H??"",$=xH.exec(Z),J=$?.[1]?.toUpperCase(),X=hH.exec(Z)?.[1],z=$?Z.slice($[0].length):Z;if(J!==void 0){let K=bH[J];if(K!==void 0)return{...K,upstreamCode:J,...X?{requestId:X}:{}}}for(let K of BH)if(K.match.test(z))return{category:K.category,retryable:K.retryable,...J?{upstreamCode:J}:{},...X?{requestId:X}:{}};return{category:"unknown",retryable:!1,...J?{upstreamCode:J}:{},...X?{requestId:X}:{}}}function fH(H){return DH(H)}function QH(H,Z){let $,J,X,z=!1;try{let j=JSON.parse(Z);if(j&&typeof j==="object"){let D=j.error&&typeof j.error==="object"?j.error:void 0;if(typeof D?.code==="string")$=D.code;else if(typeof j.code==="string")$=j.code;if(typeof D?.message==="string")J=D.message;else if(typeof j.message==="string")J=j.message;if(typeof j.details?.field==="string")X=j.details.field}}catch(j){z=/^\s*[\[{]/.test(Z)&&(yH(Z)||/unexpected end|end of json|unterminated string/i.test(String(j)))}let K=$?.toUpperCase()??"",Y=(()=>{if(z)return"stream_truncated";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"||fH(Z)?"gateway_routing":"invalid_credentials";if(K.includes("CONFIG"))return"configuration";if(H>=500)return"transient";if(H>=400)return"request_rejected";return"unknown"})(),V={status:H,category:Y,retryable:Y==="transient"||Y==="rate_limited"||Y==="stream_truncated"};if($!==void 0)V.upstreamCode=$;if(J!==void 0)V.upstreamMessage=J;if(X!==void 0)V.field=X;return V}function yH(H){let Z=0,$=!1,J=!1;for(let X of H){if($){if(J)J=!1;else if(X==="\\")J=!0;else if(X==='"')$=!1;continue}if(X==='"')$=!0;else if(X==="{"||X==="[")Z++;else if(X==="}"||X==="]")Z--;if(Z<0)return!1}return $||Z>0}var gH=new Set(["coding","agent","research","review","chat"]);function pH(H){if(H===void 0)return;if(typeof H==="string"&&gH.has(H))return H;throw Error(`invalid Qortex posture: ${String(H)}`)}function uH(H){if(H===void 0)return;let Z=Array.isArray(H)?H:[H];if(Z.every(($)=>typeof $==="string"&&/^[^/\s]+\/[^/\s]+$/.test($)))return Array.isArray(H)?Z:H;throw Error(`invalid Qortex directive registry key: ${String(H)}`)}function i(H){if(typeof H==="string")return H;if(Array.isArray(H))return H.map((Z)=>{if(typeof Z==="string")return Z;if(Z&&typeof Z==="object"){let $=Z;if(typeof $.text==="string")return $.text;if(typeof $.content==="string")return $.content}return""}).join("");if(H===void 0||H===null)return"";return String(H)}var cH="[Tool call]",mH="[Tool returned no output]";function qH(H){if(!Array.isArray(H))return{messages:H,dropped:[]};let Z=[];return{messages:H.flatMap((J,X)=>{if(!J||typeof J!=="object")return Z.push({index:X,role:typeof J,reason:"not-an-object"}),[];let z=J,K=i(z.content);if(K.trim().length>0)return[{...z,content:K}];if(z.role==="assistant"&&Array.isArray(z.tool_calls)&&z.tool_calls.length>0)return[{...z,content:cH}];if(z.role==="tool"&&typeof z.tool_call_id==="string"&&z.tool_call_id.trim().length>0)return[{...z,content:mH}];return Z.push({index:X,role:typeof z.role==="string"?z.role:"unknown",reason:"empty-content"}),[]}),dropped:Z}}function iH(H){return qH(H).messages}function dH(H){if(!Array.isArray(H))return!1;return H.some((Z)=>!!Z&&typeof Z==="object"&&Z.role==="user")}function lH(H){if(!Array.isArray(H))return!1;return H.some((Z)=>{if(!Z||typeof Z!=="object")return!1;let $=Z;if($.role!=="user")return!1;return i($.content).trim().length>0})}function nH(H){if(!Array.isArray(H))return H;let Z=(z)=>!!z&&typeof z==="object"&&z.role==="system",$=0;while($<H.length&&Z(H[$]))$++;if($<=1)return H;let J=H.slice(0,$),X=J.map((z)=>typeof z.content==="string"?z.content:String(z.content??"")).filter((z)=>z.length>0).join(`
3
-
4
- `);return[{...J[0],role:"system",content:X},...H.slice($)]}var p="<tool_call>",c="</tool_call>";function rH(H){if(!Array.isArray(H)||H.length===0)return;let Z=H.map(($)=>{try{return JSON.stringify($)}catch{return}}).filter(($)=>$!==void 0);if(Z.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>",...Z,"</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
- `)}var oH=3;function t(H){let Z=H;for(let $=0;$<oH;$++){if(Z!==null&&typeof Z==="object")return Z;if(typeof Z!=="string")return;try{Z=JSON.parse(Z)}catch{return}}return}function sH(H){let Z=H?.tool_calls;if(!Array.isArray(Z))return;for(let $ of Z){let J=$?.function;if(!J)continue;E.debug("tool call ingress",{tool:typeof J.name==="string"?J.name:"?",source:"native",args:e(J.arguments)})}}function e(H,Z=300){let $;try{$=typeof H==="string"?H:JSON.stringify(H)??String(H)}catch{$="<unrenderable>"}return $.length<=Z?$:`${$.slice(0,Z)}\u2026 (${$.length} chars total)`}function aH(H){let Z=H.function??{},$=typeof Z.name==="string"?Z.name:"",J=Z.arguments===void 0?{}:t(Z.arguments);if(J===void 0)E.warn("dropping unrecoverable tool-call arguments while re-encoding history",{tool:$,raw:e(Z.arguments)});return`${p}
6
- ${JSON.stringify({name:$,arguments:J??{}})}
7
- ${c}`}function MH(H,Z){if(!Array.isArray(H))return H;let $=H.map((X)=>{if(!X||typeof X!=="object")return X;let z=X;if(z.role==="assistant"&&Array.isArray(z.tool_calls)){let K=z.tool_calls.map(aH).join(`
8
- `),Y=i(z.content),{tool_calls:V,...j}=z;return{...j,content:Y.length>0?`${Y}
9
- ${K}`:K}}if(z.role==="tool"){let{tool_call_id:K,name:Y,...V}=z;return{...V,role:"user",content:`<tool_response>
10
- ${i(z.content)}
11
- </tool_response>`}}return X}),J=rH(Z);if(J){let X=0;while(X<$.length&&!!$[X]&&typeof $[X]==="object"&&$[X].role==="system")X++;$.splice(X,0,{role:"system",content:J})}return $}function tH(){return process.env.QITQODE_TOOL_PROTOCOL==="text"?"text":"native"}function eH(H){if(Array.isArray(H.tools)&&H.tools.length>0)return!0;let Z=H.messages;if(!Array.isArray(Z))return!1;return Z.some(($)=>{if(!$||typeof $!=="object")return!1;let J=$;return J.role==="tool"||J.role==="assistant"&&Array.isArray(J.tool_calls)})}function XH(H,Z){let $=Z?.toolMode??"native",J=H.model??"default",X={stream:H.stream??!0};if(H.temperature!==void 0)X.temperature=H.temperature;if(H.max_tokens!==void 0)X.max_tokens=H.max_tokens;let z=Z?.outputAdvisory;if(z){let D=z.tierOutputLimit;if(X.max_tokens!==void 0){if(D!==void 0&&X.max_tokens>D)X.max_tokens=D}else{let N=z.recommendedTotalTokens??z.tierRecommendedStepTokens??D,_=N===void 0?void 0:D===void 0?N:Math.min(N,D);if(_!==void 0)X.max_tokens=_}if(Z?.outputBudgetRecoveryTokens!==void 0){let N=typeof X.max_tokens==="number"?X.max_tokens:0,_=z.tierOutputLimit??Z.outputBudgetRecoveryTokens;if(Z.outputBudgetRecoveryTokens>N)X.max_tokens=Math.min(Z.outputBudgetRecoveryTokens,_)}}if(H.tools!==void 0)X.tools=H.tools;if(H.tool_choice!==void 0)X.tool_choice=H.tool_choice;if(H.stream_options!==void 0)X.stream_options=H.stream_options;let K=$==="text"?MH(H.messages,H.tools):H.messages,Y={},V=pH(H.posture);if(V!==void 0)Y.posture=V;let j=uH(H.directive);if(j!==void 0)Y.directive=j;if(H.modelPersona!==void 0)Y.modelPersona=H.modelPersona;return{tier:J,messages:nH(iH(K)),opts:X,...Y}}var l=new Map;function h(H){return typeof H==="number"&&Number.isFinite(H)&&H>0?H:void 0}function HZ(H,Z){let $={},J=h(Z.tierOutputLimit),X=h(Z.tierRecommendedStepTokens),z=h(Z.reasoningReserveTokens),K=h(Z.visibleOutputFloorTokens),Y=h(Z.recommendedTotalTokens),V=h(Z.viableTotalFloorTokens),j=h(Z.budgetPolicyVersion);if(J!==void 0)$.tierOutputLimit=J;if(X!==void 0)$.tierRecommendedStepTokens=X;if(z!==void 0)$.reasoningReserveTokens=z;if(K!==void 0)$.visibleOutputFloorTokens=K;if(Y!==void 0)$.recommendedTotalTokens=Y;if(V!==void 0)$.viableTotalFloorTokens=V;if(typeof Z.reasoningReported==="boolean")$.reasoningReported=Z.reasoningReported;if(j!==void 0)$.budgetPolicyVersion=j;if(Object.keys($).length===0)return;l.set(H,$)}function ZZ(H){return l.get(H)}function qZ(){l.clear()}function $Z(H){let Z=($)=>typeof $==="string"&&($.startsWith("qlex")||$.startsWith("qortex"));return Z(H.id)||Z(H.object)}function JZ(H){let Z=[],$=H.indexOf(`
12
- `)===-1?[H]:H.split(`
13
- `);for(let K of $){let Y=K.endsWith("\r")?K.slice(0,-1):K;if(!Y.startsWith("data:"))continue;let V=Y.slice(5);if(V.startsWith(" "))V=V.slice(1);Z.push(V)}if(Z.length===0)return{kind:"skip"};let J=Z.length===1?Z[0]:Z.join(`
14
- `);if(J==="")return{kind:"skip"};if(J==="[DONE]")return{kind:"done"};if(J.startsWith("[ERROR]"))return{kind:"error",message:J.slice(7).trim()||"qlex stream error"};let X=J.charCodeAt(0),z=X===123||X===91||X===32||X===9||X===10||X===13;try{if(!z)return{kind:"token",content:J};let K=JSON.parse(J);if(K&&typeof K==="object"){let Y=K.id;if(Y==="qlex-cost"||Y==="qortex-cost")return{kind:"cost",cost:K};if(Y==="qlex-stream"&&K.usage&&typeof K.usage==="object"){let D=K.choices,N;if(Array.isArray(D)&&D[0]&&typeof D[0]==="object"){let _=D[0].finish_reason;if(typeof _==="string")N=_}return{kind:"usage",usage:K.usage,finishReason:N}}if(Array.isArray(K.choices))return{kind:"passthrough",chunk:K};let V=K,j=typeof V.content==="string"?V.content:typeof V.text==="string"?V.text:typeof V.delta==="string"?V.delta:void 0;if(j!==void 0)return{kind:"token",content:j};if($Z(K)){let D=K.object;return{kind:"control",control:typeof D==="string"&&D.endsWith(".tier.outputLimits")?"tier-output-limits":"unknown",chunk:K}}}}catch{}return{kind:"token",content:J}}function XZ(H,Z){let $=Math.min(H.length,Z.length-1);for(let J=$;J>=1;J--)if(Z.startsWith(H.slice(H.length-J)))return J;return 0}function KZ(H){if(typeof H==="string"){try{let $=JSON.parse(H);if($!==null&&typeof $==="object")return H}catch{}let Z=t(H);return JSON.stringify(Z??H)}return JSON.stringify(H??{})}class SH{onText;onToolCall;pending="";inBlock=!1;constructor(H,Z){this.onText=H;this.onToolCall=Z}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 Z=this.pending.indexOf(p);if(Z===-1){let $=H?0:XZ(this.pending,p),J=this.pending.length-$;if(J>0)this.onText(this.pending.slice(0,J)),this.pending=$>0?this.pending.slice(J):"";return}if(Z>0)this.onText(this.pending.slice(0,Z));this.pending=this.pending.slice(Z+p.length),this.inBlock=!0}else{let Z=this.pending.indexOf(c);if(Z===-1)return;if(this.emitBlock(this.pending.slice(0,Z),!1),this.pending=this.pending.slice(Z+c.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,Z){try{let $=JSON.parse(H.trim());if($&&typeof $==="object"&&typeof $.name==="string"){this.onToolCall({name:$.name,arguments:KZ($.arguments)});return}}catch{}this.onText(`${p}${H}${Z?"":c}`)}}function s(H,Z,$){let J={id:"qlex-stream",object:"chat.completion.chunk",created:Math.floor(Date.now()/1000),model:"qlex",choices:[{index:0,delta:H,finish_reason:Z}]};if($)J.usage=$;return`data: ${JSON.stringify(J)}
17
-
18
- `}function zZ(H,Z){let $=Z?.toolProtocolEnabled===!0,J=Z?.tier,X=Z?.requestedOutputBudget,z=H.getReader(),K=new TextDecoder,Y=new TextEncoder,V="",j=!1,D=!1,N,_,L,P,k=!1,C=!1,T=0,b=0;return new ReadableStream({async start(Q){let M=(G)=>{if(G.length>0)k=!0;b+=G.length;let U=j?{content:G}:{role:"assistant",content:G};j=!0,Q.enqueue(Y.encode(s(U,null)))},A=0,u=$?new SH(M,(G)=>{E.debug("tool call ingress",{tool:G.name,source:"text-shim",args:e(G.arguments),objectShaped:t(G.arguments)!==void 0});let U={...j?{}:{role:"assistant"},tool_calls:[{index:A,id:`qlexcall_${Date.now().toString(36)}_${A}`,type:"function",function:{name:G.name,arguments:G.arguments}}]};j=!0,C=!0,A++,Q.enqueue(Y.encode(s(U,null)))}):void 0,O=(G)=>u?u.feed(G):M(G),q=()=>{u?.flush();let U=N||_!==void 0||L!==void 0?{prompt_tokens:N?.tokens.prompt??L?.prompt??0,completion_tokens:N?.tokens.completion??L?.completion??0,total_tokens:N?.tokens.total??(N?.tokens.prompt??L?.prompt??0)+(N?.tokens.completion??L?.completion??0),cost_usd:N?.cost_usd,cost_credits:N?.cost_credits??N?.cost_qredits,context_window:_}:void 0,W=A>0?"tool_calls":P??"stop";if(W==="length"||W==="max_tokens"){let F=m(J??"default",X),R=F!==void 0;E.debug("qlex output budget exhausted",{tier:J,contentStreamed:k,outputBudgetRecoveryAvailable:R}),Q.error(new v("output budget exhausted",{category:"output_budget_exhausted",retryable:!1,outputBudgetRecoveryAvailable:R,outputBudgetRecoveryTokens:F})),D=!0;return}if(!k&&!C&&P!=="tool_calls"){let F=m(J??"default",X),R=F!==void 0;E.debug("qlex completed without visible output",{tier:J,outputBudgetRecoveryAvailable:R}),Q.error(new v("empty output",{category:"empty_output",retryable:!1,outputBudgetRecoveryAvailable:R,outputBudgetRecoveryTokens:F})),D=!0;return}if(Q.enqueue(Y.encode(s({},W,U))),Q.enqueue(Y.encode(`data: [DONE]
19
-
20
- `)),!N&&J!==void 0)E.info("qlex cost frame absent on stream finish",{tier:J});Q.close(),D=!0},w=(G)=>{let U=JZ(G);switch(T++,U.kind){case"skip":return!1;case"token":return O(U.content),!1;case"passthrough":{let W=U.chunk.choices;if(Array.isArray(W)&&W[0]&&typeof W[0]==="object"){let F=W[0].finish_reason;if(typeof F==="string")P=F;let R=W[0].delta;if(typeof R?.content==="string"&&R.content.length>0)k=!0;if(Array.isArray(R?.tool_calls))C=!0;sH(W[0].delta)}j=!0;{let F=U.chunk.choices?.[0]?.delta?.content;if(typeof F==="string")b+=F.length}return Q.enqueue(Y.encode(`data: ${JSON.stringify(U.chunk)}
21
-
22
- `)),!1}case"cost":if(U.cost.final)N=U.cost;return!1;case"usage":if(U.usage.context_window!==void 0)_=U.usage.context_window;if(U.usage.prompt_tokens!==void 0&&U.usage.completion_tokens!==void 0)L={prompt:U.usage.prompt_tokens,completion:U.usage.completion_tokens};if(U.finishReason!==void 0)P=U.finishReason;return!1;case"control":{if(U.control==="tier-output-limits"){let W=U.chunk;if(J!==void 0)HZ(J,W);E.debug("qlex tier output limits",{tierOutputLimit:W.tierOutputLimit,tierRecommendedStepTokens:W.tierRecommendedStepTokens,tierStepGuidance:W.tierStepGuidance,reasoningReserveTokens:W.reasoningReserveTokens,visibleOutputFloorTokens:W.visibleOutputFloorTokens,recommendedTotalTokens:W.recommendedTotalTokens,viableTotalFloorTokens:W.viableTotalFloorTokens,reasoningReported:W.reasoningReported,budgetPolicyVersion:W.budgetPolicyVersion})}else E.debug("qlex control frame dropped",{id:U.chunk.id,object:U.chunk.object});return!1}case"done":return q(),!0;case"error":{let W=vH(U.message);E.warn("qlex stream error frame",{tier:J,raw:U.message,frameIndex:T,streamedContentChars:b,contentStreamed:j,upstreamCode:W.upstreamCode,requestId:W.requestId,category:W.category,retryable:W.retryable});let F=W.category==="output_budget_exhausted"||W.category==="empty_output"?m(J??"default",X):void 0;if(W.retryable===!1&&F!==void 0)W.outputBudgetRecoveryAvailable=!0,W.outputBudgetRecoveryTokens=F;return Q.error(new v(U.message,W)),D=!0,!0}}};try{while(!0){let{done:U,value:W}=await z.read();if(U)break;V+=K.decode(W,{stream:!0});let F;while((F=V.indexOf(`
23
-
24
- `))!==-1){let R=V.slice(0,F);if(V=V.slice(F+2),w(R))return}}V+=K.decode();let G=V.replace(/\r?\n$/,"");if(G.length>0&&w(G))return;if(!D)q()}catch(G){if(!D)Q.error(G instanceof v?G:new v(G instanceof Error?G.message:String(G)))}finally{z.releaseLock()}},cancel(Q){z.cancel(Q).catch(()=>{})}})}function PH(H){return{content:typeof H.content==="string"?H.content:H.choices?.[0]?.message?.content??"",finishReason:H.choices?.[0]?.finish_reason??"stop"}}function YZ(H){let Z=H??{},{content:$,finishReason:J}=PH(Z),X=Z.usage??{},z=X.prompt_tokens??0,K=X.completion_tokens??0,Y="orch-"+Date.now().toString(36),V=Math.floor(Date.now()/1000),j=(P,k,C)=>{let T={id:Y,object:"chat.completion.chunk",created:V,model:"orchestrated",choices:[{index:0,delta:P,finish_reason:k}]};if(C)T.usage=C;return`data: ${JSON.stringify(T)}
25
-
26
- `},D={prompt_tokens:z,completion_tokens:K,total_tokens:X.total_tokens??z+K};if(typeof X.cost_usd==="number")D.cost_usd=X.cost_usd;if(typeof X.cost_credits==="number")D.cost_credits=X.cost_credits;if(typeof X.context_window==="number")D.context_window=X.context_window;let N=[j({role:"assistant",content:""},null),j({content:$},null),j({},J,D),`data: [DONE]
27
-
28
- `],_=new TextEncoder,L=new ReadableStream({start(P){for(let k of N)P.enqueue(_.encode(k));P.close()}});return new Response(L,{status:200,headers:{"content-type":"text/event-stream"}})}function MZ(H){let Z=H??{},{content:$,finishReason:J}=PH(Z),X=Z.usage??{},z=X.prompt_tokens??0,K=X.completion_tokens??0,Y={id:"orch-"+Date.now(),object:"chat.completion",created:Math.floor(Date.now()/1000),model:"orchestrated",choices:[{index:0,message:{role:"assistant",content:$},finish_reason:J}],usage:{prompt_tokens:z,completion_tokens:K,total_tokens:X.total_tokens??z+K,...typeof X.cost_usd==="number"?{cost_usd:X.cost_usd}:{},...typeof X.context_window==="number"?{context_window:X.context_window}:{}}};return new Response(JSON.stringify(Y),{status:200,headers:{"content-type":"application/json"}})}async function WZ(H,Z,$){let J=QH(H,Z),X=Z?`HTTP ${H}: ${Z}`:`HTTP ${H}`;switch(E.error("gateway rejected request",{tier:$.tier,status:H,category:J.category,upstreamCode:J.upstreamCode,field:J.field,retryable:J.retryable}),J.category){case"billing":return new UH(Z||void 0,J);case"rate_limited":return new _H(J);case"gateway_routing":return new f(`HTTP ${H}`,J);case"invalid_credentials":return await $.onInvalidCredentials?.().catch(()=>{}),new FH(X,J);case"request_too_large":return new d("irreducible",J.upstreamMessage??Z??void 0,J);case"request_rejected":case"tool_protocol":return new LH(J.upstreamMessage??Z??void 0,J.field,J);case"configuration":case"transient":case"unknown":default:return new f(X,J)}}function KH(H){let Z=JH();if(Z===void 0)return H;let $=x(H);if($<=Z)return H;let J=o(H,Z);return E.warn("request over known size ceiling, reducing before send",{tier:H.tier,bytes:$,ceiling:Z,reducedBytes:J.bytes,fits:J.reduced,...J.actions}),J.bytes<$?J.body:H}function zH(H){let Z=x(H),$=r(Z),J=o(H,$);if(!J.reduced)throw E.error("request too large and cannot be reduced further",{tier:H.tier,rejectedBytes:Z,ceiling:$,reducedBytes:J.bytes,...J.actions}),new d("irreducible");return E.warn("request too large, retrying once with reduced history",{tier:H.tier,rejectedBytes:Z,ceiling:$,reducedBytes:J.bytes,...J.actions,notice:S.copy().requestTooLargeRecovering()}),J.body}function YH(H){let Z=x(H);throw r(Z),E.error("reduced request still too large",{tier:H.tier,rejectedBytes:Z}),new d("after-reduction")}function VZ(H,Z=globalThis.fetch,$,J){let X=J?.responseTimeoutMs??IH;return async(z,K)=>{if(K?.method==="POST"&&typeof K?.body==="string"){let Y;try{Y=JSON.parse(K.body)}catch{return Z(z,K)}let V=tH(),j=ZZ(Y.model??"default"),D=XH(Y,{toolMode:V,outputAdvisory:j});if(dH(Y.messages)&&!lH(D.messages)){let{dropped:O}=qH(V==="text"?MH(Y.messages,Y.tools):Y.messages);throw E.error("refusing to send: user message lost in normalization",{tier:D.tier,toolMode:V,inputRoles:Array.isArray(Y.messages)?Y.messages.map((q)=>q&&typeof q==="object"?String(q.role):"?"):"not-an-array",droppedCount:O.length,dropped:O}),new OH("your message could not be turned into sendable content")}let N=await H(),_=typeof N==="string"?{key:N,method:"sso"}:N;if(!_?.key)throw new jH;let L=new Headers(K.headers),P=()=>{if(_.method==="api-key")L.delete("Authorization"),L.set("x-api-key",_.key);else L.delete("x-api-key"),L.set("Authorization",`Bearer ${_.key}`)};P(),L.set("Content-Type","application/json");let k=!1,C=async(O,q)=>{let w=QH(O,q),G=async()=>({retry:!1,error:await WZ(O,q,{onInvalidCredentials:$,tier:D.tier})});if(w.category!=="invalid_credentials"||k)return G();k=!0;let U=a(_),W=await NH(_);if(W.kind==="recovered"&&a(W.credential)!==U)return _=W.credential,P(),{retry:!0};if(W.kind==="inconclusive")return{retry:!1,error:new f(`HTTP ${O}: ${W.reason}`,w)};return G()};if(D.tier==="orchestrated"){let O=K.signal,q=async(U)=>{let W=new AbortController,F=()=>W.abort(O?.reason);if(O)if(O.aborted)W.abort(O.reason);else O.addEventListener("abort",F,{once:!0});let R=!1,kH=setTimeout(()=>{R=!0,W.abort()},X);try{return await Z(TH,{method:"POST",headers:L,body:JSON.stringify(U),signal:W.signal})}catch(wH){if(R)throw new f(`no response within ${Math.round(X/1000)}s`);throw wH}finally{clearTimeout(kH),O?.removeEventListener("abort",F)}},w=KH(D),G=await q(w);if(G.status===413){if(await G.body?.cancel().catch(()=>{}),w=zH(w),G=await q(w),G.status===413)await G.body?.cancel().catch(()=>{}),YH(w)}while(!G.ok){let U=await G.text().catch(()=>""),W=await C(G.status,U);if(!W.retry)throw W.error;G=await q(w)}return YZ(await G.json())}let T=K.signal,b=async(O)=>{let q=new AbortController,w=()=>q.abort(T?.reason);if(T)if(T.aborted)q.abort(T.reason);else T.addEventListener("abort",w,{once:!0});let G=()=>T?.removeEventListener("abort",w),U=!1,W=setTimeout(()=>{U=!0,q.abort()},X);try{return{res:await Z(AH,{method:"POST",headers:L,body:JSON.stringify(O),signal:q.signal}),detach:G}}catch(F){if(G(),U)throw new f(`no response within ${Math.round(X/1000)}s`);throw F}finally{clearTimeout(W)}},Q=KH(D),{res:M,detach:A}=await b(Q);if(M.status===400&&V==="native"&&eH(Y))A(),await M.body?.cancel().catch(()=>{}),Q=XH(Y,{toolMode:"text",outputAdvisory:j}),{res:M,detach:A}=await b(Q);if(M.status===413){if(A(),await M.body?.cancel().catch(()=>{}),Q=zH(Q),{res:M,detach:A}=await b(Q),M.status===413)A(),await M.body?.cancel().catch(()=>{}),YH(Q)}try{while(!M.ok){let O=await M.text().catch(()=>""),q=await C(M.status,O);if(A(),!q.retry)throw q.error;({res:M,detach:A}=await b(Q))}}catch(O){throw A(),O}if(Y.stream!==!1&&M.body){let O=Array.isArray(Y.tools)&&Y.tools.length>0;return new Response(zZ(M.body,{toolProtocolEnabled:O,tier:D.tier,requestedOutputBudget:D.opts.max_tokens}),{status:M.status,statusText:M.statusText,headers:{"content-type":"text/event-stream"}})}return M}return Z(z,K)}}function SZ(H){let Z=H.getToken??(async()=>H.bearerToken),$=VZ(Z,globalThis.fetch,H.onInvalidCredentials);return GH({name:H.name??"qlex",baseURL:S.streamBaseUrl(),fetch:$})}function PZ(H,Z){return m(H,Z)!==void 0}var DZ=2;function m(H,Z){let $=l.get(H),J=$?.tierOutputLimit;if(!$||!J)return;let X=Z??$.recommendedTotalTokens??$.tierRecommendedStepTokens;if(!X||X>=J)return;let z=$.recommendedTotalTokens??$.tierRecommendedStepTokens??X,K=Math.min(J,Math.max(X+1,X*DZ,z));return K>X?K:void 0}export{zZ as transformQlexStream,YZ as toOrchestratedSSEStream,MZ as toOpenAICompletion,QZ as sanitizeUpstreamProviderError,tH as resolveToolMode,rH as renderToolProtocolPrompt,HZ as recordTierOutputAdvisory,XZ as partialTagSuffixLength,JZ as parseQlexFrame,QH as parseQlexError,qH as normalizeQlexMessagesWithReport,iH as normalizeQlexMessages,nH as mergeLeadingSystemMessages,fH as isGatewayRequiredError,dH as hasUserRoleMessage,lH as hasUsableUserMessage,eH as hasToolContext,m as getTierOutputBudgetRecovery,ZZ as getTierOutputAdvisory,i as flattenMessageContent,MH as encodeToolProtocolMessages,KZ as encodeExtractedArguments,t as decodeToolArgumentsToObject,SZ as createQlexProvider,VZ as createCustomFetch,qZ as clearTierOutputAdvisories,vH as classifyQlexStreamError,PZ as canIncreaseTierOutputBudget,XH as buildQlexBody,SH as ToolCallExtractor,p as TOOL_CALL_OPEN,c as TOOL_CALL_CLOSE,v as QlexStreamError,d as QlexRequestTooLargeError,LH as QlexRequestRejectedError,OH as QlexRequestNotSentError,_H as QlexRateLimitError,jH as QlexNotLoggedInError,FH as QlexInvalidCredentialsError,UH as QlexInsufficientBalanceError,f as QlexGatewayError,AH as QLEX_STREAM_URL,IH as QLEX_RESPONSE_TIMEOUT_MS,TH as QLEX_ORCHESTRATED_URL};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Al as f,Bl as g,Cl as h,Dl as i,vl as a,wl as b,xl as c,yl as d,zl as e}from"./chunk-5myxjxae.js";import"./chunk-gnt982jr.js";import"./chunk-25bp7pcm.js";import"./chunk-45mjcxqk.js";import"./chunk-xdjwapwy.js";import"./chunk-cxtxvt43.js";import"./chunk-871f8x99.js";import"./chunk-cx7p4ezk.js";import"./chunk-v0yxkq99.js";import"./chunk-2pzvcpv4.js";import"./chunk-kmtfdky8.js";import"./chunk-vc4e6xc4.js";import"./chunk-hnz570f9.js";import"./chunk-tdmn21z0.js";import"./chunk-s8mghr5a.js";import"./chunk-pqnbdygz.js";import"./chunk-ydc6ypjt.js";import"./chunk-4sazy0nq.js";export{i as stopRefresh,h as startRefresh,g as refresh,d as readModelCatalogResponse,f as get,c as Provider,b as Model,a as MODEL_CATALOG_MAX_BYTES,e as Data};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{Zf as E}from"./chunk-s2xdf6qh.js";import"./chunk-m0xsvzyd.js";import"./chunk-ws3p9cya.js";import"./chunk-qq2rcxv2.js";import"./chunk-ebabnv33.js";import"./chunk-nfg7nt13.js";import"./chunk-yj6rbe9p.js";import"./chunk-m6zxr0j8.js";import"./chunk-sv1s1qxd.js";import"./chunk-n7d9eemn.js";import"./chunk-pxx2hz0g.js";import"./chunk-rexdr63q.js";import"./chunk-kqhh2pm9.js";import"./chunk-7fawtcnn.js";import"./chunk-mdzzcrf9.js";import"./chunk-wev34grp.js";import"./chunk-rtdym35y.js";import"./chunk-5myxjxae.js";import"./chunk-sp8ek94w.js";import"./chunk-gnt982jr.js";import"./chunk-1bx2sjn6.js";import"./chunk-17pxm5d3.js";import"./chunk-n38h109k.js";import"./chunk-25bp7pcm.js";import"./chunk-qdcf1ay5.js";import"./chunk-45mjcxqk.js";import"./chunk-qqne79vp.js";import"./chunk-64s7vfj7.js";import"./chunk-xjhezxft.js";import"./chunk-gwfx7tx7.js";import"./chunk-1wpjmwnh.js";import"./chunk-cqtkxwd8.js";import"./chunk-ymtcm4xd.js";import"./chunk-yykjvt7f.js";import"./chunk-3mepk08v.js";import"./chunk-atpzz901.js";import"./chunk-0g25z230.js";import"./chunk-w9pdvcf9.js";import"./chunk-4gs87ghj.js";import"./chunk-kb6v5hhm.js";import"./chunk-qyjt0qnq.js";import"./chunk-xdjwapwy.js";import"./chunk-cxtxvt43.js";import"./chunk-871f8x99.js";import"./chunk-cx7p4ezk.js";import"./chunk-tgd5ctnt.js";import"./chunk-p8kpqyxb.js";import"./chunk-3sz6gw10.js";import"./chunk-twhavv1m.js";import"./chunk-v0yxkq99.js";import"./chunk-2pzvcpv4.js";import"./chunk-kmtfdky8.js";import"./chunk-vc4e6xc4.js";import"./chunk-hnz570f9.js";import"./chunk-tdmn21z0.js";import"./chunk-s8mghr5a.js";import"./chunk-pqnbdygz.js";import"./chunk-ydc6ypjt.js";import"./chunk-ev3a2sxv.js";import"./chunk-pnq1h5az.js";import{kQ as z}from"./chunk-4sazy0nq.js";var J={command:"generate",handler:async()=>{let A=await E.openapi();for(let q of Object.values(A.paths))for(let y of["get","post","put","delete","patch"]){let k=q[y];if(!k?.operationId)continue;k["x-codeSamples"]=[{lang:"js",source:['import { createQitQodeClient } from "@qitqode/sdk"',"","const client = createQitQodeClient()",`await client.${k.operationId}({`," ...","})"].join(`
3
- `)}]}let F=JSON.stringify(A,null,2),B=await import("./chunk-jgz1a29w.js"),C=await import("./chunk-kt0ej3nq.js"),D=await import("./chunk-w5940jxm.js"),G=await(B.format??B.default?.format)(F,{parser:"json",plugins:[C.default??C,D.default??D],printWidth:120});await new Promise((q,y)=>{process.stdout.write(G,(k)=>{if(k)y(k);else q()})})}};export{J as GenerateCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-4sazy0nq.js";function n(){return(e)=>JSON.parse(JSON.stringify(e.Type()))}export{n as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ju as D}from"./chunk-v0yxkq99.js";import{Au as y,vu as h,wu as w,xu as M,yu as O,zu as b}from"./chunk-kmtfdky8.js";import{iQ as N}from"./chunk-4sazy0nq.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 Pt,G as Qt};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-4sazy0nq.js";var R="./libopentui-c8ye7mqw.dylib";export{R as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{xg as o}from"./chunk-yj6rbe9p.js";import{kQ as n}from"./chunk-4sazy0nq.js";async function a(){try{let{toJsonSchema:t}=await import("./chunk-c72jajx9.js");return t}catch{throw new o("@valibot/to-json-schema")}}export{a as default};
@@ -1,3 +0,0 @@
1
- // @bun
2
- function K(q){let j=!1,z=!1,B,C=new Promise((b)=>{B=b}),D=(b)=>{let g=b;return!!g&&(g.properties?.sessionID===q.sessionID||g.properties?.part?.sessionID===q.sessionID)},E=(b)=>{let g=b;return!!g&&g.type==="session.status"&&g.properties?.sessionID===q.sessionID&&g.properties?.status?.type==="idle"},G=async()=>{if(j)return;let b;try{b=await q.query()}catch{return}if(j||!z)return;if(!b||b.type==="idle")A()},H=q.intervalMs??750,J=setInterval(()=>{G().catch(()=>{})},H),A=()=>{if(j)return;j=!0,clearInterval(J),B()};return{markStarted(){z=!0},onEvent(b){if(j)return;if(D(b))z=!0;if(E(b))A()},get done(){return j},completion:C,stop(){A()}}}
3
- export{K as M};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Qr as a,Rr as b,Sr as c}from"./chunk-3mepk08v.js";import"./chunk-atpzz901.js";import"./chunk-4sazy0nq.js";export{a as openApp,c as default,b as apps};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-4sazy0nq.js";var e="./libopentui-c48jzvfh.so";export{e as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{fQ as a}from"./chunk-pnq1h5az.js";import"./chunk-4sazy0nq.js";export default a();
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ud as a}from"./chunk-h1kg35mn.js";import"./chunk-fn8191ps.js";import"./chunk-4sazy0nq.js";export{a as dict};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Cp as a}from"./chunk-qqne79vp.js";import"./chunk-p8kpqyxb.js";import"./chunk-vc4e6xc4.js";import"./chunk-pqnbdygz.js";import"./chunk-ydc6ypjt.js";import"./chunk-4sazy0nq.js";export{a as which};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{kQ as t}from"./chunk-4sazy0nq.js";var e=await import("./chunk-yzq3c3dq.js",{with:{type:"file"}}),a=e.default;export{a as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Cu as a,Du as b,Eu as c,Fu as d,Gu as e,Hu as f,Iu as g,Ju as h}from"./chunk-kmtfdky8.js";import"./chunk-vc4e6xc4.js";import"./chunk-hnz570f9.js";import"./chunk-tdmn21z0.js";import"./chunk-s8mghr5a.js";import"./chunk-pqnbdygz.js";import"./chunk-ydc6ypjt.js";import"./chunk-4sazy0nq.js";export{g as redactValue,e as init,f as flush,d as file,b as enabled,h as create,a as Level,c as Default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{jt as e,kt as f,lt as g,nt as h,ot as i,pt as j,qt as k,rt as l,tt as m,ut as n}from"./chunk-cxtxvt43.js";import{zt as d}from"./chunk-871f8x99.js";import"./chunk-cx7p4ezk.js";import{ku as c}from"./chunk-v0yxkq99.js";import"./chunk-2pzvcpv4.js";import{Ku as b}from"./chunk-kmtfdky8.js";import{Vu as a}from"./chunk-vc4e6xc4.js";import"./chunk-hnz570f9.js";import"./chunk-tdmn21z0.js";import"./chunk-s8mghr5a.js";import"./chunk-pqnbdygz.js";import"./chunk-ydc6ypjt.js";import"./chunk-4sazy0nq.js";export{h as getEnvInfo,c as Wildcard,n as Token,m as Rpc,d as Process,b as Log,l as Lock,k as Locale,j as LocalContext,i as Keybind,a as Filesystem,g as EffectUtil,f as Color,e as Archive};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{xg as t}from"./chunk-yj6rbe9p.js";import{kQ as n}from"./chunk-4sazy0nq.js";async function a(){try{let{JSONSchema:e}=await import("./chunk-ax1y4699.js");return(r)=>e.make(r)}catch{throw new t("effect")}}export{a as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{No as a,Oo as b,Po as c,Qo as d,Ro as e}from"./chunk-1bx2sjn6.js";import"./chunk-4sazy0nq.js";export{e as drizzle,b as SQLiteBunTransaction,a as SQLiteBunSession,d as SQLiteBunDatabase,c as PreparedQuery};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-4sazy0nq.js";var A="./tree-sitter-zig-e78zbjpm.wasm";export{A as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Vf as a,Wf as b,Xf as c,Yf as d,Zf as e}from"./chunk-s2xdf6qh.js";import"./chunk-m0xsvzyd.js";import"./chunk-ws3p9cya.js";import"./chunk-qq2rcxv2.js";import"./chunk-ebabnv33.js";import"./chunk-nfg7nt13.js";import"./chunk-yj6rbe9p.js";import"./chunk-m6zxr0j8.js";import"./chunk-sv1s1qxd.js";import"./chunk-n7d9eemn.js";import"./chunk-pxx2hz0g.js";import"./chunk-rexdr63q.js";import"./chunk-kqhh2pm9.js";import"./chunk-7fawtcnn.js";import"./chunk-mdzzcrf9.js";import"./chunk-wev34grp.js";import"./chunk-rtdym35y.js";import"./chunk-5myxjxae.js";import"./chunk-sp8ek94w.js";import"./chunk-gnt982jr.js";import"./chunk-1bx2sjn6.js";import"./chunk-17pxm5d3.js";import"./chunk-n38h109k.js";import"./chunk-25bp7pcm.js";import"./chunk-qdcf1ay5.js";import"./chunk-45mjcxqk.js";import"./chunk-qqne79vp.js";import"./chunk-64s7vfj7.js";import"./chunk-xjhezxft.js";import"./chunk-gwfx7tx7.js";import"./chunk-1wpjmwnh.js";import"./chunk-cqtkxwd8.js";import"./chunk-ymtcm4xd.js";import"./chunk-yykjvt7f.js";import"./chunk-3mepk08v.js";import"./chunk-atpzz901.js";import"./chunk-0g25z230.js";import"./chunk-w9pdvcf9.js";import"./chunk-4gs87ghj.js";import"./chunk-kb6v5hhm.js";import"./chunk-qyjt0qnq.js";import"./chunk-xdjwapwy.js";import"./chunk-cxtxvt43.js";import"./chunk-871f8x99.js";import"./chunk-cx7p4ezk.js";import"./chunk-tgd5ctnt.js";import"./chunk-p8kpqyxb.js";import"./chunk-3sz6gw10.js";import"./chunk-twhavv1m.js";import"./chunk-v0yxkq99.js";import"./chunk-2pzvcpv4.js";import"./chunk-kmtfdky8.js";import"./chunk-vc4e6xc4.js";import"./chunk-hnz570f9.js";import"./chunk-tdmn21z0.js";import"./chunk-s8mghr5a.js";import"./chunk-pqnbdygz.js";import"./chunk-ydc6ypjt.js";import"./chunk-ev3a2sxv.js";import"./chunk-pnq1h5az.js";import"./chunk-4sazy0nq.js";export{c as url,b as openapi,d as listen,e as Server,a as Default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-4sazy0nq.js";var L="./opentui-c5en9p2g.dll";export{L as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$d as b,_d as a,ae as c,be as d,ce as e,de as f,ee as g,fe as h,ge as i,he as j,ie as k}from"./chunk-dykqn0nj.js";import"./chunk-8yr682pv.js";import"./chunk-v3x5nrc4.js";import"./chunk-4sazy0nq.js";export{c as providerConfigFromInit,d as httpRequest,j as getInstanceMetadataEndpoint,k as fromInstanceMetadata,h as fromContainerMetadata,i as Endpoint,f as ENV_CMDS_RELATIVE_URI,e as ENV_CMDS_FULL_URI,g as ENV_CMDS_AUTH_TOKEN,a as DEFAULT_TIMEOUT,b as DEFAULT_MAX_RETRIES};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{M as o}from"./chunk-vftqwdpg.js";import{N as i}from"./chunk-qpzspr9z.js";import{Cd as p}from"./chunk-w8d9srv7.js";import{Pd as n}from"./chunk-9xvctnjr.js";import{Sf as B}from"./chunk-9s4whpg1.js";import{Zf as l}from"./chunk-s2xdf6qh.js";import"./chunk-m0xsvzyd.js";import"./chunk-ws3p9cya.js";import"./chunk-qq2rcxv2.js";import"./chunk-ebabnv33.js";import"./chunk-nfg7nt13.js";import"./chunk-yj6rbe9p.js";import"./chunk-m6zxr0j8.js";import{Xg as g}from"./chunk-sv1s1qxd.js";import{Jh as d}from"./chunk-n7d9eemn.js";import"./chunk-pxx2hz0g.js";import"./chunk-rexdr63q.js";import"./chunk-kqhh2pm9.js";import"./chunk-7fawtcnn.js";import"./chunk-mdzzcrf9.js";import"./chunk-wev34grp.js";import{gl as f}from"./chunk-rtdym35y.js";import"./chunk-5myxjxae.js";import"./chunk-sp8ek94w.js";import"./chunk-gnt982jr.js";import"./chunk-1bx2sjn6.js";import"./chunk-17pxm5d3.js";import"./chunk-n38h109k.js";import"./chunk-25bp7pcm.js";import"./chunk-qdcf1ay5.js";import"./chunk-45mjcxqk.js";import"./chunk-qqne79vp.js";import"./chunk-64s7vfj7.js";import{Op as D}from"./chunk-xjhezxft.js";import"./chunk-gwfx7tx7.js";import"./chunk-1wpjmwnh.js";import"./chunk-cqtkxwd8.js";import"./chunk-ymtcm4xd.js";import"./chunk-yykjvt7f.js";import"./chunk-3mepk08v.js";import"./chunk-atpzz901.js";import"./chunk-0g25z230.js";import"./chunk-w9pdvcf9.js";import"./chunk-4gs87ghj.js";import"./chunk-kb6v5hhm.js";import"./chunk-qyjt0qnq.js";import"./chunk-xdjwapwy.js";import{qt as I}from"./chunk-cxtxvt43.js";import"./chunk-871f8x99.js";import"./chunk-cx7p4ezk.js";import"./chunk-tgd5ctnt.js";import"./chunk-p8kpqyxb.js";import"./chunk-3sz6gw10.js";import"./chunk-twhavv1m.js";import"./chunk-v0yxkq99.js";import"./chunk-2pzvcpv4.js";import{Bu as u,Ku as x}from"./chunk-kmtfdky8.js";import{Vu as y}from"./chunk-vc4e6xc4.js";import"./chunk-hnz570f9.js";import"./chunk-tdmn21z0.js";import"./chunk-s8mghr5a.js";import"./chunk-pqnbdygz.js";import"./chunk-ydc6ypjt.js";import"./chunk-ev3a2sxv.js";import"./chunk-pnq1h5az.js";import"./chunk-4sazy0nq.js";import Q from"path";import{pathToFileURL as a}from"url";import{EOL as O}from"os";function $(j){let K=j.state;return{input:K.input,metadata:"metadata"in K?K.metadata:{},part:j}}function C(j){let K=j.description?B.Style.TEXT_DIM+` ${j.description}`+B.Style.TEXT_NORMAL:"";B.println(B.Style.TEXT_NORMAL+j.icon,B.Style.TEXT_NORMAL+j.title+K)}function b(j,K){if(B.empty(),C(j),!K?.trim())return;B.println(K),B.empty()}function c(j){let K=j.state,V="input"in K?K.input:void 0,Y=("title"in K&&K.title?K.title:void 0)||(V&&typeof V==="object"&&Object.keys(V).length>0?JSON.stringify(V):"Unknown");C({icon:"\u2699",title:`${j.tool} ${Y}`})}function t(j){let K=j.path??"",V=`${j.kind} "${j.pattern}"`,Y=K?`in ${T(K)}`:"",H=j.count===void 0?Y:`${Y}${Y?" \xB7 ":""}${j.count} ${j.count===1?"match":"matches"}`;C({icon:"\u2731",title:V,...H&&{description:H}})}function r(j){t({kind:"Glob",pattern:j.input.pattern,path:j.input.path,count:j.metadata.count})}function jj(j){t({kind:"Grep",pattern:j.input.pattern,path:j.input.path,count:j.metadata.matches})}function Bj(j){let K=T(j.input.filePath),V=Object.entries(j.input).filter(([H,S])=>{if(H==="filePath")return!1;return typeof S==="string"||typeof S==="number"||typeof S==="boolean"}),Y=V.length?`[${V.map(([H,S])=>`${H}=${S}`).join(", ")}]`:void 0;C({icon:"\u2192",title:`Read ${K}`,...Y&&{description:Y}})}function Gj(j){b({icon:"\u2190",title:`Write ${T(j.input.filePath)}`},j.part.state.status==="completed"?j.part.state.output:void 0)}function Jj(j){C({icon:"%",title:`WebFetch ${j.input.url}`})}function Kj(j){let K=T(j.input.filePath),V=j.metadata.diff;b({icon:"\u2190",title:`Edit ${K}`},V)}function Mj(j){C({icon:"\u25C7",title:`Exa Code Search "${j.input.query}"`})}function Nj(j){C({icon:"\u25C8",title:`Web Search "${j.input.query}"`})}function k(j){let K=j.part.state.input?.operation??j.part.state.input,V=j.part.state.status,Y=typeof K?.subagent_type==="string"&&K.subagent_type.trim().length>0?K.subagent_type:"unknown",H=I.titlecase(Y),S=typeof K?.description==="string"&&K.description.trim().length>0?K.description:void 0,w=V==="error"?"\u2717":V==="running"?"\u2022":"\u2713",L=S??`${H} Task`;C({icon:w,title:L,description:S?`${H} Agent`:void 0})}function Vj(j){C({icon:"\u2192",title:`Skill "${j.input.name}"`})}function Xj(j){let K=j.part.state.status==="completed"?j.part.state.output?.trim():void 0;b({icon:"$",title:`${j.input.command}`},K)}function T(j){if(!j)return"";if(Q.isAbsolute(j))return Q.relative(process.cwd(),j)||".";return j}var Tj=n({command:"run [message..]",describe:"run qitqode with a message",builder:(j)=>{return j.positional("message",{describe:"message to send",type:"string",array:!0,default:[]}).option("command",{describe:"the command to run, use message for args",type:"string"}).option("continue",{alias:["c"],describe:"continue the last session",type:"boolean"}).option("session",{alias:["s"],describe:"session id to continue",type:"string"}).option("fork",{describe:"fork the session before continuing (requires --continue or --session)",type:"boolean"}).option("share",{type:"boolean",describe:"share the session"}).option("model",{type:"string",alias:["m"],describe:"model to use in the format of provider/model"}).option("agent",{type:"string",describe:"agent to use"}).option("format",{type:"string",choices:["default","json"],default:"default",describe:"format: default (formatted) or json (raw JSON events)"}).option("file",{alias:["f"],type:"string",array:!0,describe:"file(s) to attach to message"}).option("title",{type:"string",describe:"title for the session (uses truncated prompt if no value provided)"}).option("attach",{type:"string",describe:"attach to a running qitqode server (e.g., http://localhost:4096)"}).option("password",{alias:["p"],type:"string",describe:"basic auth password (defaults to QITQODE_SERVER_PASSWORD)"}).option("dir",{type:"string",describe:"directory to run in, path on remote server if attaching"}).option("port",{type:"number",describe:"port for the local server (defaults to random port if no value provided)"}).option("variant",{type:"string",describe:"model variant (provider-specific reasoning effort, e.g., high, max, minimal)"}).option("thinking",{type:"boolean",describe:"show thinking blocks",default:!1}).option("dangerously-skip-permissions",{type:"boolean",describe:"auto-approve permissions that are not explicitly denied (dangerous!)",default:!1})},handler:async(j)=>{let K=[...j.message,...j["--"]||[]].join(" "),V=(()=>{if(!j.dir)return;if(j.attach)return j.dir;try{return process.chdir(j.dir),process.cwd()}catch{B.error("Failed to change directory to "+j.dir),process.exit(1)}})(),Y=[];if(j.file){let M=Array.isArray(j.file)?j.file:[j.file];for(let X of M){let N=Q.resolve(process.cwd(),X);if(!await y.exists(N))B.error(`File not found: ${X}`),process.exit(1);let W=await y.isDir(N)?"application/x-directory":"text/plain";Y.push({type:"file",url:a(N).href,filename:Q.basename(N),mime:W})}}if(!process.stdin.isTTY)K+=`
3
- `+await Bun.stdin.text();if(K.trim().length===0&&!j.command)B.error("You must provide a message or a command"),process.exit(1);if(j.fork&&!j.continue&&!j.session)B.error("--fork requires --continue or --session"),process.exit(1);let H=[{permission:"question",action:"deny",pattern:"*"},{permission:"plan_enter",action:"deny",pattern:"*"},{permission:"plan_exit",action:"deny",pattern:"*"}];function S(){if(j.title===void 0)return;if(j.title!=="")return j.title;return K.slice(0,50)+(K.length>50?"...":"")}async function w(M){let X=j.continue?(await M.session.list()).data?.find((Z)=>!Z.parentID)?.id:j.session;if(X&&j.fork)return(await M.session.fork({sessionID:X})).data?.id;if(X)return X;let N=S();return(await M.session.create({title:N,permission:H})).data?.id}async function L(M,X){let N=await M.config.get();if(!N.data)return;if(N.data.share!=="auto"&&!u.QITQODE_AUTO_SHARE&&!j.share)return;let W=await M.session.share({sessionID:X}).catch((Z)=>{if(Z instanceof Error&&Z.message.includes("disabled"))B.println(B.Style.TEXT_DANGER_BOLD+"! "+Z.message);return{error:Z}});if(!W.error&&"data"in W&&W.data?.share?.url)B.println(B.Style.TEXT_INFO_BOLD+"~ "+W.data.share.url)}async function h(M){function X(G){try{if(G.tool==="bash")return Xj($(G));if(G.tool==="glob")return r($(G));if(G.tool==="grep")return jj($(G));if(G.tool==="read")return Bj($(G));if(G.tool==="write")return Gj($(G));if(G.tool==="webfetch")return Jj($(G));if(G.tool==="edit")return Kj($(G));if(G.tool==="codesearch")return Mj($(G));if(G.tool==="websearch")return Nj($(G));if(G.tool==="actor")return k($(G));if(G.tool==="skill")return Vj($(G));return c(G)}catch{return c(G)}}function N(G,q){if(j.format==="json")return process.stdout.write(JSON.stringify({type:G,timestamp:Date.now(),sessionID:A,...q})+O),!0;return!1}let W=await M.event.subscribe(),Z;async function e(G){let q=new Map,z=x.create({service:"cli.run"}),E=W.stream[Symbol.asyncIterator](),F=G.completion.then(()=>"DONE");try{while(!0){let P=await Promise.race([E.next(),F]);if(P==="DONE")break;if(P.done)break;let _=P.value;if(G.onEvent(_),z.debug("event received",{type:_.type}),_.type==="message.updated"&&_.properties.info.role==="assistant"&&j.format!=="json"&&q.get("start")!==!0)B.empty(),B.println(`> ${_.properties.info.agent} \xB7 ${_.properties.info.modelID}`),B.empty(),q.set("start",!0);if(_.type==="message.part.updated"){let J=_.properties.part;if(J.sessionID!==A)continue;if(J.type==="tool"&&(J.state.status==="completed"||J.state.status==="error")){if(N("tool_use",{part:J}))continue;if(J.state.status==="completed"){X(J);continue}C({icon:"\u2717",title:`${J.tool} failed`}),B.error(J.state.error)}if(J.type==="tool"&&J.tool==="actor"&&J.state.status==="running"&&j.format!=="json"){if(q.get(J.id)===!0)continue;k($(J)),q.set(J.id,!0)}if(J.type==="step-start"){if(N("step_start",{part:J}))continue}if(J.type==="step-finish"){if(N("step_finish",{part:J}))continue}if(J.type==="text"&&J.time?.end){if(N("text",{part:J}))continue;let R=J.text.trim();if(!R)continue;if(!process.stdout.isTTY){process.stdout.write(R+O);continue}B.empty(),B.println(R),B.empty()}if(J.type==="reasoning"&&J.time?.end&&j.thinking){if(N("reasoning",{part:J}))continue;let R=J.text.trim();if(!R)continue;let U=`Thinking: ${R}`;if(process.stdout.isTTY){B.empty(),B.println(`${B.Style.TEXT_DIM}\x1B[3m${U}\x1B[0m${B.Style.TEXT_NORMAL}`),B.empty();continue}process.stdout.write(U+O)}}if(_.type==="session.error"){let J=_.properties;if(J.sessionID!==A||!J.error)continue;let R=String(J.error.name);if("data"in J.error&&J.error.data&&"message"in J.error.data)R=String(J.error.data.message);if(Z=Z?Z+O+R:R,N("error",{error:J.error}))continue;B.error(R)}if(_.type==="permission.asked"){let J=_.properties;if(J.sessionID!==A)continue;if(j["dangerously-skip-permissions"])await M.permission.reply({requestID:J.id,reply:"once"});else B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL+`permission requested: ${J.permission} (${J.patterns.join(", ")}); auto-rejecting`),await M.permission.reply({requestID:J.id,reply:"reject"})}}}finally{G.stop(),await E.return?.(void 0).catch(()=>{})}}let v=await(async()=>{if(!j.agent)return;let G=j.agent;if(j.attach){let z=await M.app.agents(void 0,{throwOnError:!0}).then((F)=>F.data??[]).catch(()=>{return});if(!z){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`failed to list agents from ${j.attach}. Falling back to default agent`);return}let E=z.find((F)=>F.name===G);if(!E){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`agent "${G}" not found. Falling back to default agent`);return}if(E.mode==="subagent"){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`agent "${G}" is a subagent, not a primary agent. Falling back to default agent`);return}return G}let q=await g.runPromise(d.Service.use((z)=>z.get(G)));if(!q){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`agent "${G}" not found. Falling back to default agent`);return}if(q.mode==="subagent"){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`agent "${G}" is a subagent, not a primary agent. Falling back to default agent`);return}return G})(),A=await w(M);if(!A)B.error("Session not found"),process.exit(1);await L(M,A);let s=x.create({service:"cli.run.poll"}),m=o({sessionID:A,query:async()=>{try{return(await M.session.status()).data?.[A]}catch(G){throw s.debug("session.status query failed",{error:G}),G}}});if(e(m).catch((G)=>{console.error(G),process.exit(1)}),j.command)await M.session.command({sessionID:A,agent:v,model:j.model,command:j.command,arguments:K,variant:j.variant});else{let G=j.model?f.parseModel(j.model):void 0;await M.session.prompt({sessionID:A,agent:v,model:G,variant:j.variant,parts:[...Y,{type:"text",text:K}]})}m.markStarted()}if(j.attach){let M=i({password:j.password}),X=D({baseUrl:j.attach,directory:V,headers:M});return await h(X)}await p(process.cwd(),async()=>{let X=D({baseUrl:"http://qitqode.internal",fetch:async(N,W)=>{let Z=new Request(N,W);return l.Default().app.fetch(Z)}});await h(X)})}});export{Tj as RunCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Pr as a}from"./chunk-yykjvt7f.js";import"./chunk-4sazy0nq.js";export default a();
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{kQ as t}from"./chunk-4sazy0nq.js";var e=await import("./chunk-h36qec67.js",{with:{type:"file"}}),a=e.default;export{a as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{kQ as t}from"./chunk-4sazy0nq.js";var e=await import("./chunk-ps9p14y6.js",{with:{type:"file"}}),a=e.default;export{a as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Gd as q,Hd as K,Id as D,Ld as L,Md as N}from"./chunk-7jhrxzjx.js";import"./chunk-jcjaw7tk.js";import{Sf as B}from"./chunk-9s4whpg1.js";import{Xg as G}from"./chunk-sv1s1qxd.js";import"./chunk-n7d9eemn.js";import"./chunk-pxx2hz0g.js";import"./chunk-rexdr63q.js";import"./chunk-kqhh2pm9.js";import"./chunk-7fawtcnn.js";import"./chunk-mdzzcrf9.js";import"./chunk-wev34grp.js";import"./chunk-rtdym35y.js";import{ul as C}from"./chunk-5myxjxae.js";import"./chunk-sp8ek94w.js";import"./chunk-gnt982jr.js";import"./chunk-1bx2sjn6.js";import"./chunk-17pxm5d3.js";import"./chunk-n38h109k.js";import"./chunk-25bp7pcm.js";import"./chunk-qdcf1ay5.js";import"./chunk-45mjcxqk.js";import"./chunk-qqne79vp.js";import"./chunk-64s7vfj7.js";import"./chunk-xjhezxft.js";import"./chunk-gwfx7tx7.js";import"./chunk-1wpjmwnh.js";import"./chunk-cqtkxwd8.js";import"./chunk-ymtcm4xd.js";import"./chunk-yykjvt7f.js";import"./chunk-3mepk08v.js";import"./chunk-atpzz901.js";import"./chunk-0g25z230.js";import"./chunk-w9pdvcf9.js";import"./chunk-4gs87ghj.js";import"./chunk-kb6v5hhm.js";import"./chunk-qyjt0qnq.js";import"./chunk-xdjwapwy.js";import"./chunk-cxtxvt43.js";import"./chunk-871f8x99.js";import"./chunk-cx7p4ezk.js";import"./chunk-tgd5ctnt.js";import"./chunk-p8kpqyxb.js";import"./chunk-3sz6gw10.js";import"./chunk-twhavv1m.js";import{Rt as J}from"./chunk-v0yxkq99.js";import"./chunk-2pzvcpv4.js";import"./chunk-kmtfdky8.js";import"./chunk-vc4e6xc4.js";import"./chunk-hnz570f9.js";import"./chunk-tdmn21z0.js";import"./chunk-s8mghr5a.js";import"./chunk-pqnbdygz.js";import"./chunk-ydc6ypjt.js";import"./chunk-ev3a2sxv.js";import"./chunk-pnq1h5az.js";import"./chunk-4sazy0nq.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};