@qitqode/qitqode-android-arm64 0.1.34 → 0.1.36

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-0j6dhrew.js +2 -0
  7. package/bundle/chunk-0jrgk6vk.js +2 -0
  8. package/bundle/chunk-0qn52zsd.js +2 -0
  9. package/bundle/chunk-10accb7b.js +2 -0
  10. package/bundle/{chunk-rjy5mqwz.js → chunk-132tcp2j.js} +2 -2
  11. package/bundle/chunk-13kpdfr7.js +2 -0
  12. package/bundle/chunk-15s8zwgf.js +2 -0
  13. package/bundle/{chunk-nj4d554m.js → chunk-1bx2sjn6.js} +1 -1
  14. package/bundle/chunk-1kgyfja6.js +2 -0
  15. package/bundle/{chunk-bv29k2pf.js → chunk-1mcsf4yb.js} +2 -2
  16. package/bundle/{chunk-kwx9ewe0.js → chunk-1wpjmwnh.js} +1 -1
  17. package/bundle/chunk-1yv5h8k4.js +2 -0
  18. package/bundle/chunk-24rw1br0.js +3 -0
  19. package/bundle/{chunk-snr44en9.js → chunk-25bp7pcm.js} +2 -2
  20. package/bundle/{chunk-kmcsz8yv.js → chunk-2dkrfc1s.js} +1 -1
  21. package/bundle/chunk-364ccew0.js +3 -0
  22. package/bundle/{chunk-ppkqr9cn.js → chunk-37dvnent.js} +2 -2
  23. package/bundle/chunk-3bkdbqjj.js +2 -0
  24. package/bundle/chunk-3bnqw3xp.js +3 -0
  25. package/bundle/{chunk-08m0hkdz.js → chunk-3dr4469n.js} +1 -1
  26. package/bundle/{chunk-2fkfbdcy.js → chunk-3gw6r3hf.js} +179 -179
  27. package/bundle/{chunk-n96tvjgj.js → chunk-3mepk08v.js} +2 -2
  28. package/bundle/chunk-3sz6gw10.js +3 -0
  29. package/bundle/chunk-41x11r2s.js +3 -0
  30. package/bundle/{chunk-xqdrr7xg.js → chunk-45mjcxqk.js} +1 -1
  31. package/bundle/{chunk-qrtc3etn.js → chunk-4fa390yr.js} +2 -2
  32. package/bundle/chunk-4gs87ghj.js +3 -0
  33. package/bundle/chunk-4kqdzdv5.js +3 -0
  34. package/bundle/{chunk-3k2b05fv.js → chunk-4sazy0nq.js} +1 -1
  35. package/bundle/chunk-4tbqsrsn.js +2 -0
  36. package/bundle/{chunk-ngccf7ga.js → chunk-52b1v7mn.js} +1 -1
  37. package/bundle/chunk-53kns5wy.js +2 -0
  38. package/bundle/{chunk-11v7vz3y.js → chunk-549ptbaj.js} +1 -1
  39. package/bundle/chunk-559ek1ym.js +2 -0
  40. package/bundle/{chunk-34p46th6.js → chunk-5bate758.js} +1 -1
  41. package/bundle/{chunk-kdcnder5.js → chunk-5kmfnkzv.js} +1 -1
  42. package/bundle/{chunk-9msnx26q.js → chunk-5pkg052s.js} +2 -2
  43. package/bundle/chunk-5yfzzmv0.js +2 -0
  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-bzgj60w4.js → chunk-6sfhbckv.js} +1 -1
  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-7cbj28fp.js +2 -0
  51. package/bundle/chunk-7dep7g7c.js +2 -0
  52. package/bundle/{chunk-gj0wt0cy.js → chunk-7fawtcnn.js} +1 -1
  53. package/bundle/{chunk-zfn0z4sh.js → chunk-7gbytqkn.js} +2 -2
  54. package/bundle/{chunk-x66ycpfs.js → chunk-7jhrxzjx.js} +2 -2
  55. package/bundle/{chunk-09pkckr1.js → chunk-7vftsy04.js} +1 -1
  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-8zmreqxx.js +2 -0
  66. package/bundle/chunk-92zjark4.js +2 -0
  67. package/bundle/chunk-983rqajz.js +7 -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-9yakc5yv.js +28 -0
  75. package/bundle/{chunk-4wxxyrxn.js → chunk-9zre5e54.js} +1 -1
  76. package/bundle/chunk-a42q5mx4.js +3 -0
  77. package/bundle/{chunk-yt3f3j35.js → chunk-a9y27zd2.js} +1 -1
  78. package/bundle/{chunk-mex0fe9s.js → chunk-acyj91wq.js} +1 -1
  79. package/bundle/chunk-aq28ejhv.js +2 -0
  80. package/bundle/{chunk-pkc4ddw1.js → chunk-atpzz901.js} +1 -1
  81. package/bundle/chunk-ax1y4699.js +2 -0
  82. package/bundle/{chunk-dctj3c22.js → chunk-b0jh0rby.js} +2 -2
  83. package/bundle/chunk-b0x888w9.js +2 -0
  84. package/bundle/chunk-b10px5g4.js +2 -0
  85. package/bundle/chunk-b1qhpxee.js +2 -0
  86. package/bundle/chunk-b4ysd5b4.js +9 -0
  87. package/bundle/chunk-bcs2gvmp.js +2 -0
  88. package/bundle/{chunk-7mxt5b0h.js → chunk-bjcb9kt0.js} +1 -1
  89. package/bundle/{chunk-67d5d8mr.js → chunk-bnz0mxak.js} +1 -1
  90. package/bundle/{chunk-wwgd4rzx.js → chunk-brh35yt5.js} +2 -2
  91. package/bundle/chunk-bs020a3x.js +2 -0
  92. package/bundle/{chunk-7eexey82.js → chunk-c72jajx9.js} +1 -1
  93. package/bundle/{chunk-81trveht.js → chunk-cagk1sjd.js} +1 -1
  94. package/bundle/{chunk-1byd3wma.js → chunk-cdh26622.js} +2 -2
  95. package/bundle/chunk-cjxcnhmq.js +14 -0
  96. package/bundle/{chunk-ygjtwjnk.js → chunk-cx0j6mpq.js} +1 -1
  97. package/bundle/{chunk-zh3fny3z.js → chunk-cx7p4ezk.js} +2 -2
  98. package/bundle/chunk-d0xs3j5h.js +2 -0
  99. package/bundle/{chunk-pxmhe36r.js → chunk-d1rn44wz.js} +1 -1
  100. package/bundle/chunk-d72rty3t.js +2 -0
  101. package/bundle/{chunk-0c6ep9mc.js → chunk-d93z6hrn.js} +1 -1
  102. package/bundle/{chunk-seghf5fc.js → chunk-dgx4rq86.js} +1 -1
  103. package/bundle/{chunk-qzj6027k.js → chunk-dh1h513y.js} +1 -1
  104. package/bundle/chunk-dj951pms.js +2 -0
  105. package/bundle/chunk-dp6zktka.js +2 -0
  106. package/bundle/{chunk-ba3h1pzs.js → chunk-dshnn54c.js} +1 -1
  107. package/bundle/{chunk-73myw3bj.js → chunk-dt899wbf.js} +2 -2
  108. package/bundle/chunk-dvqdtdza.js +2 -0
  109. package/bundle/{chunk-6ynxf3q7.js → chunk-dvxk6mr6.js} +2 -2
  110. package/bundle/chunk-dx7h5r8j.js +2 -0
  111. package/bundle/{chunk-bnss5dkk.js → chunk-dykqn0nj.js} +2 -2
  112. package/bundle/chunk-e03tgfpb.js +8 -0
  113. package/bundle/chunk-e07dbha4.js +2 -0
  114. package/bundle/chunk-e88wd9ex.js +2 -0
  115. package/bundle/{chunk-y9zstzed.js → chunk-eaqfnwdj.js} +1 -1
  116. package/bundle/chunk-ebabnv33.js +3 -0
  117. package/bundle/chunk-ebdpg3cn.js +2 -0
  118. package/bundle/{chunk-w9nzsd3w.js → chunk-ebkztnpf.js} +180 -178
  119. package/bundle/chunk-ec7pznsp.js +2 -0
  120. package/bundle/chunk-et7kz7kx.js +2 -0
  121. package/bundle/{chunk-kfmz2p27.js → chunk-ev3a2sxv.js} +2 -2
  122. package/bundle/{chunk-d00c1k9w.js → chunk-ewpzqnj4.js} +1 -1
  123. package/bundle/chunk-eyc6tb5h.js +2 -0
  124. package/bundle/chunk-eywryd3k.js +2 -0
  125. package/bundle/chunk-eze57bty.js +2 -0
  126. package/bundle/{chunk-qddt2gcs.js → chunk-ezrskm25.js} +1 -1
  127. package/bundle/chunk-f36ctnbp.js +3 -0
  128. package/bundle/{chunk-q5fygrnr.js → chunk-f77nxt23.js} +2 -2
  129. package/bundle/chunk-fa47vzfc.js +2 -0
  130. package/bundle/chunk-fe397ph0.js +2 -0
  131. package/bundle/chunk-fjm9kstr.js +5 -0
  132. package/bundle/{chunk-5xq3h51b.js → chunk-fmxm4kaj.js} +2 -2
  133. package/bundle/chunk-fr75ytdr.js +2 -0
  134. package/bundle/chunk-fw2tnbt6.js +2 -0
  135. package/bundle/chunk-fwr2qgqb.js +2 -0
  136. package/bundle/chunk-g204pt98.js +2 -0
  137. package/bundle/chunk-g5prcvq2.js +14 -0
  138. package/bundle/{chunk-ggydr1ze.js → chunk-g794ey6w.js} +1 -1
  139. package/bundle/chunk-gcgmwqhh.js +2 -0
  140. package/bundle/{chunk-rmve21dh.js → chunk-gg7bg3ek.js} +1 -1
  141. package/bundle/{chunk-9x25d115.js → chunk-gkj4a27z.js} +1 -1
  142. package/bundle/chunk-gvtjxg0d.js +2 -0
  143. package/bundle/chunk-gw36mrg4.js +2 -0
  144. package/bundle/{chunk-z8gdmvgg.js → chunk-gwfx7tx7.js} +2 -2
  145. package/bundle/{chunk-q8hd01j7.js → chunk-gxmxx8jb.js} +1 -1
  146. package/bundle/{chunk-tge53d52.js → chunk-h1kg35mn.js} +1 -1
  147. package/bundle/chunk-h36qec67.js +2 -0
  148. package/bundle/{chunk-0msqaywp.js → chunk-h7w35n7w.js} +1 -1
  149. package/bundle/chunk-h9gtymfm.js +2 -0
  150. package/bundle/chunk-h9qn35pn.js +2 -0
  151. package/bundle/{chunk-mr8j7rc6.js → chunk-hb9mc5f9.js} +1 -1
  152. package/bundle/{chunk-5a7fs1hg.js → chunk-hbh2034m.js} +1 -1
  153. package/bundle/{chunk-df2aswz3.js → chunk-hcy77w6t.js} +1 -1
  154. package/bundle/{chunk-6a7c7wnf.js → chunk-hgsykghj.js} +2 -2
  155. package/bundle/chunk-hhjkezfz.js +2 -0
  156. package/bundle/chunk-hnz570f9.js +3 -0
  157. package/bundle/{chunk-0csy9x1n.js → chunk-htkwc2se.js} +2 -2
  158. package/bundle/chunk-j21dnncc.js +4 -0
  159. package/bundle/{chunk-1yt5rsew.js → chunk-j63fkt6n.js} +1 -1
  160. package/bundle/chunk-ja18tvc7.js +2 -0
  161. package/bundle/{chunk-03xppy47.js → chunk-jcjaw7tk.js} +2 -2
  162. package/bundle/{chunk-jkh6eg7d.js → chunk-jf6ry79j.js} +4 -4
  163. package/bundle/{chunk-ke7n9t5p.js → chunk-jgz1a29w.js} +3 -3
  164. package/bundle/{chunk-ebcdxmdd.js → chunk-jngchw38.js} +1 -1
  165. package/bundle/{chunk-j5ymkhry.js → chunk-jqn27885.js} +1 -1
  166. package/bundle/chunk-jr2q5295.js +3 -0
  167. package/bundle/{chunk-hj3ddt53.js → chunk-jts0dma5.js} +2 -2
  168. package/bundle/chunk-jw16f6t0.js +4 -0
  169. package/bundle/chunk-jxg15t11.js +2 -0
  170. package/bundle/{chunk-7hm0c2yg.js → chunk-kqhh2pm9.js} +1 -1
  171. package/bundle/{chunk-0h8wdch6.js → chunk-kt0ej3nq.js} +1 -1
  172. package/bundle/chunk-kwzawx7r.js +2 -0
  173. package/bundle/{chunk-n6msxne8.js → chunk-kx2dp8ch.js} +1 -1
  174. package/bundle/chunk-m0mek3es.js +2 -0
  175. package/bundle/chunk-m31d2n6h.js +2 -0
  176. package/bundle/{chunk-egn55fa2.js → chunk-mcc5ynma.js} +3 -3
  177. package/bundle/{chunk-md8161zd.js → chunk-mdzzcrf9.js} +2 -2
  178. package/bundle/{chunk-knpyt206.js → chunk-mqtqcc10.js} +2 -2
  179. package/bundle/{chunk-ynwkr3yh.js → chunk-mvnxwwe7.js} +2 -2
  180. package/bundle/{chunk-xkv3yta0.js → chunk-mvsrzvc4.js} +4 -4
  181. package/bundle/{chunk-b4knxpqh.js → chunk-mw2hr4pd.js} +1 -1
  182. package/bundle/{chunk-vszbqv24.js → chunk-mzbr0m2v.js} +1 -1
  183. package/bundle/{chunk-bj00xk8k.js → chunk-n0trgp1c.js} +2 -2
  184. package/bundle/chunk-n14qktbg.js +2 -0
  185. package/bundle/{chunk-yjk6zv2z.js → chunk-n2ygpy76.js} +1 -1
  186. package/bundle/{chunk-4ntbxet5.js → chunk-n7xgfm5x.js} +2 -2
  187. package/bundle/{chunk-06k6egt2.js → chunk-neqy8j4n.js} +1 -1
  188. package/bundle/{chunk-nj61v4n7.js → chunk-njkserae.js} +1 -1
  189. package/bundle/{chunk-n6gtdx5h.js → chunk-nq495be3.js} +1 -1
  190. package/bundle/chunk-nr4q9fv7.js +2 -0
  191. package/bundle/{chunk-p3qkexpk.js → chunk-nsjp44fp.js} +1 -1
  192. package/bundle/chunk-nzzsj54n.js +2 -0
  193. package/bundle/chunk-p19qfw59.js +2 -0
  194. package/bundle/chunk-p2yxj9s4.js +2 -0
  195. package/bundle/{chunk-1dtzxt2w.js → chunk-p3rp99na.js} +1 -1
  196. package/bundle/chunk-p8czsxp0.js +3 -0
  197. package/bundle/chunk-p8k48st6.js +5 -0
  198. package/bundle/{chunk-79agp7v3.js → chunk-p8kpqyxb.js} +2 -2
  199. package/bundle/{chunk-9fxkh84w.js → chunk-p9zrk16q.js} +1 -1
  200. package/bundle/{chunk-xhkd9yf3.js → chunk-pmv8yr8c.js} +2 -2
  201. package/bundle/{chunk-ee23d2nz.js → chunk-pnq1h5az.js} +2 -2
  202. package/bundle/chunk-pq3qwxa8.js +2 -0
  203. package/bundle/{chunk-wfd5h6ax.js → chunk-pqnbdygz.js} +2 -2
  204. package/bundle/chunk-ps9p14y6.js +2 -0
  205. package/bundle/{chunk-zfcp509b.js → chunk-pxx2hz0g.js} +2 -2
  206. package/bundle/{chunk-zpf31kxb.js → chunk-q7rt76qw.js} +1 -1
  207. package/bundle/{chunk-rq4w0by4.js → chunk-q81m4m9z.js} +1 -1
  208. package/bundle/chunk-qagc6v17.js +2 -0
  209. package/bundle/{chunk-mq6jn47r.js → chunk-qb35hqm4.js} +1 -1
  210. package/bundle/chunk-qc0zhbhm.js +2 -0
  211. package/bundle/{chunk-keveg5gx.js → chunk-qdcf1ay5.js} +2 -2
  212. package/bundle/chunk-qp9y0g73.js +3 -0
  213. package/bundle/chunk-qpd0gab8.js +2 -0
  214. package/bundle/{chunk-6b196wjz.js → chunk-qqne79vp.js} +2 -2
  215. package/bundle/{chunk-g4gjz7sq.js → chunk-qs4wef8c.js} +1 -1
  216. package/bundle/chunk-r0ewmh6f.js +2 -0
  217. package/bundle/chunk-r3df289z.js +2 -0
  218. package/bundle/{chunk-by855es0.js → chunk-r58gzg6m.js} +1 -1
  219. package/bundle/{chunk-fmq0m4k5.js → chunk-r6ndvzd0.js} +1 -1
  220. package/bundle/chunk-r78kfhvz.js +2 -0
  221. package/bundle/{chunk-dyv2hqvc.js → chunk-rcyhqkv5.js} +1 -1
  222. package/bundle/{chunk-h2m8fdqm.js → chunk-rd4x4tsv.js} +1 -1
  223. package/bundle/chunk-rebsz3bj.js +2 -0
  224. package/bundle/{chunk-yp5bypsp.js → chunk-rexdr63q.js} +2 -2
  225. package/bundle/{chunk-1me21qdc.js → chunk-rgxy4ngt.js} +1 -1
  226. package/bundle/chunk-rph5xswc.js +2 -0
  227. package/bundle/{chunk-dcndy4sr.js → chunk-rph9zj24.js} +1 -1
  228. package/bundle/chunk-rqmvj7f4.js +3 -0
  229. package/bundle/{chunk-ryfqwsft.js → chunk-rrd0jf5m.js} +1 -1
  230. package/bundle/{chunk-mpygdb5a.js → chunk-s8mghr5a.js} +2 -2
  231. package/bundle/chunk-schtpyjs.js +2 -0
  232. package/bundle/{chunk-nmehsm3w.js → chunk-shwjjrj8.js} +1 -1
  233. package/bundle/{chunk-08f4khsw.js → chunk-snt1kefv.js} +3 -3
  234. package/bundle/{chunk-s8hq6trz.js → chunk-srxx88nb.js} +1 -1
  235. package/bundle/{chunk-gy0wm7e1.js → chunk-std2bgv7.js} +2 -2
  236. package/bundle/{chunk-dffhkd30.js → chunk-swcgsrbj.js} +1 -1
  237. package/bundle/chunk-sy3n0qhc.js +800 -0
  238. package/bundle/{chunk-wgk7ynt3.js → chunk-t01bhw5h.js} +3 -3
  239. package/bundle/chunk-t0jjes17.js +2 -0
  240. package/bundle/{chunk-y370dqf3.js → chunk-t5tfppwv.js} +2 -2
  241. package/bundle/chunk-t8rke5fr.js +8 -0
  242. package/bundle/chunk-tabcpx7t.js +4 -0
  243. package/bundle/{chunk-gmzrvxnv.js → chunk-tdmn21z0.js} +2 -2
  244. package/bundle/{chunk-71zw0qhf.js → chunk-tdxbm1nd.js} +1 -1
  245. package/bundle/{chunk-p825vsjy.js → chunk-te5tfq79.js} +1 -1
  246. package/bundle/chunk-tf4xwqz7.js +2 -0
  247. package/bundle/{chunk-fg35hwa0.js → chunk-tgd5ctnt.js} +2 -2
  248. package/bundle/chunk-tqazneg6.js +2 -0
  249. package/bundle/{chunk-qa2j0qmy.js → chunk-txqc7543.js} +2 -2
  250. package/bundle/chunk-tzg4z74d.js +2 -0
  251. package/bundle/{chunk-a3a1trap.js → chunk-v3x5nrc4.js} +2 -2
  252. package/bundle/chunk-v8dd6tyn.js +2 -0
  253. package/bundle/chunk-v8ksjgc3.js +2 -0
  254. package/bundle/chunk-v8vcwx23.js +2 -0
  255. package/bundle/chunk-vc4e6xc4.js +10 -0
  256. package/bundle/chunk-vcrakhgy.js +3 -0
  257. package/bundle/{chunk-za63b5mc.js → chunk-vdpd4akk.js} +2 -2
  258. package/bundle/{chunk-6p7yg5sr.js → chunk-vftqwdpg.js} +1 -1
  259. package/bundle/chunk-vg41rtdy.js +2 -0
  260. package/bundle/{chunk-r0k21apr.js → chunk-vgaxv70x.js} +2 -2
  261. package/bundle/{chunk-nkk4fyqf.js → chunk-vgnddhdj.js} +1 -1
  262. package/bundle/{chunk-xd3xc1vv.js → chunk-vm58fkrv.js} +1 -1
  263. package/bundle/{chunk-qg2vk5fw.js → chunk-vsys768k.js} +1 -1
  264. package/bundle/{chunk-s4qtphwx.js → chunk-w03fdrxe.js} +1 -1
  265. package/bundle/chunk-w1ypf53m.js +3 -0
  266. package/bundle/chunk-w24660y4.js +3 -0
  267. package/bundle/{chunk-z1ay3qd0.js → chunk-w3bmf3zz.js} +1 -1
  268. package/bundle/{chunk-28cm7m3t.js → chunk-w57j3pgz.js} +82 -82
  269. package/bundle/{chunk-vsr8mnj6.js → chunk-w5940jxm.js} +1 -1
  270. package/bundle/chunk-w6rf2knb.js +2 -0
  271. package/bundle/chunk-w9pdvcf9.js +3 -0
  272. package/bundle/{chunk-yk97q51d.js → chunk-wev34grp.js} +2 -2
  273. package/bundle/chunk-wh7r96t3.js +2 -0
  274. package/bundle/{chunk-1pg6pv0m.js → chunk-wm77svwm.js} +1 -1
  275. package/bundle/chunk-wnjqaxze.js +2 -0
  276. package/bundle/{chunk-qkjdr337.js → chunk-x6rr6ss1.js} +1 -1
  277. package/bundle/{chunk-bbzztav6.js → chunk-xdacgfba.js} +1 -1
  278. package/bundle/{chunk-6p94fpbn.js → chunk-xdjwapwy.js} +2 -2
  279. package/bundle/chunk-xfz698bh.js +2 -0
  280. package/bundle/{chunk-zwnhf4z1.js → chunk-xhbb8b5g.js} +1 -1
  281. package/bundle/chunk-xqwvx3qq.js +2 -0
  282. package/bundle/chunk-xxj3sgd5.js +2 -0
  283. package/bundle/chunk-xyjehgzm.js +3 -0
  284. package/bundle/{chunk-cs38g1bx.js → chunk-y0ydzdfc.js} +1 -1
  285. package/bundle/{chunk-wvf5q2hz.js → chunk-y1b2h15z.js} +1 -1
  286. package/bundle/{chunk-1gf116rg.js → chunk-yacccwf6.js} +1 -1
  287. package/bundle/chunk-ydc6ypjt.js +77 -0
  288. package/bundle/{chunk-dhqaqeq6.js → chunk-yeq7b87a.js} +1 -1
  289. package/bundle/chunk-yfp9y71y.js +2 -0
  290. package/bundle/chunk-yg9c1v8v.js +2 -0
  291. package/bundle/{chunk-e6xnynaz.js → chunk-yha554nm.js} +2 -2
  292. package/bundle/{chunk-rv1stdvb.js → chunk-yj6rbe9p.js} +2 -2
  293. package/bundle/chunk-yjjh339w.js +2 -0
  294. package/bundle/{chunk-j8q252w3.js → chunk-yjp0btmq.js} +3 -3
  295. package/bundle/{chunk-c5pb87yf.js → chunk-ymtcm4xd.js} +1 -1
  296. package/bundle/chunk-yt6vd7a5.js +2 -0
  297. package/bundle/{chunk-ssk8tkwd.js → chunk-yw9pfqxt.js} +1 -1
  298. package/bundle/{chunk-g6cyhxwg.js → chunk-yykjvt7f.js} +2 -2
  299. package/bundle/{chunk-sfes6pp1.js → chunk-yzh4rmrt.js} +1 -1
  300. package/bundle/chunk-yzq3c3dq.js +2 -0
  301. package/bundle/{chunk-prh3c44x.js → chunk-yzwgvjzd.js} +1 -1
  302. package/bundle/chunk-z1j25911.js +2 -0
  303. package/bundle/{chunk-rkwrjphh.js → chunk-z1rshv6g.js} +1 -1
  304. package/bundle/chunk-z29ahthm.js +2 -0
  305. package/bundle/{chunk-jgjnz82k.js → chunk-zaan8jk6.js} +1 -1
  306. package/bundle/{chunk-6gb65bv1.js → chunk-zbqzm65q.js} +1 -1
  307. package/bundle/{chunk-bk4phk66.js → chunk-zesbm9k1.js} +1 -1
  308. package/bundle/{chunk-c6vfwjg4.js → chunk-zfcfyagt.js} +1 -1
  309. package/bundle/{chunk-ywkvq7zb.js → chunk-zfnbk5gy.js} +1 -1
  310. package/bundle/chunk-zgre4gc2.js +2 -0
  311. package/bundle/{chunk-z7430qxg.js → chunk-zrmx397j.js} +1 -1
  312. package/bundle/chunk-zthkjx33.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-0x5jn813.js +0 -2
  319. package/bundle/chunk-1hmq2fpt.js +0 -14
  320. package/bundle/chunk-28t9akfn.js +0 -2
  321. package/bundle/chunk-2h1fcqvf.js +0 -2
  322. package/bundle/chunk-2scyp9ns.js +0 -2
  323. package/bundle/chunk-2tw58kwb.js +0 -2
  324. package/bundle/chunk-2vxx0tax.js +0 -2
  325. package/bundle/chunk-2ybt3p5z.js +0 -2
  326. package/bundle/chunk-2zpkw3ge.js +0 -2
  327. package/bundle/chunk-397be2x0.js +0 -2
  328. package/bundle/chunk-3c78nkgn.js +0 -2
  329. package/bundle/chunk-3vnnxq40.js +0 -2
  330. package/bundle/chunk-425mq6k8.js +0 -2
  331. package/bundle/chunk-43yv7tz1.js +0 -2
  332. package/bundle/chunk-499gp5g5.js +0 -2
  333. package/bundle/chunk-4sw6frjt.js +0 -2
  334. package/bundle/chunk-4xw14sed.js +0 -2
  335. package/bundle/chunk-536naqqv.js +0 -2
  336. package/bundle/chunk-57najm15.js +0 -2
  337. package/bundle/chunk-5he3d7cy.js +0 -2
  338. package/bundle/chunk-5vzrn6za.js +0 -3
  339. package/bundle/chunk-696z96a6.js +0 -2
  340. package/bundle/chunk-6hybp2mt.js +0 -2
  341. package/bundle/chunk-6v9nbb4c.js +0 -3
  342. package/bundle/chunk-6y423jax.js +0 -3
  343. package/bundle/chunk-72ghkgcn.js +0 -2
  344. package/bundle/chunk-741teh8k.js +0 -2
  345. package/bundle/chunk-7b3wx6kn.js +0 -2
  346. package/bundle/chunk-7bwe0ayr.js +0 -3
  347. package/bundle/chunk-7hh0654f.js +0 -3
  348. package/bundle/chunk-891yevv2.js +0 -2
  349. package/bundle/chunk-8d5k45yj.js +0 -2
  350. package/bundle/chunk-8eje5baf.js +0 -8
  351. package/bundle/chunk-8ktgy41r.js +0 -2
  352. package/bundle/chunk-8q73cjyj.js +0 -2
  353. package/bundle/chunk-8y623qdx.js +0 -2
  354. package/bundle/chunk-921vn745.js +0 -2
  355. package/bundle/chunk-9y97bzht.js +0 -8
  356. package/bundle/chunk-a0rp7gh4.js +0 -77
  357. package/bundle/chunk-a48t0g95.js +0 -3
  358. package/bundle/chunk-a8119c3a.js +0 -2
  359. package/bundle/chunk-akk84fnc.js +0 -2
  360. package/bundle/chunk-aw7j7brm.js +0 -2
  361. package/bundle/chunk-b34t8v7x.js +0 -2
  362. package/bundle/chunk-b8hmj4jq.js +0 -2
  363. package/bundle/chunk-bja8q0ke.js +0 -3
  364. package/bundle/chunk-c5fa8cb1.js +0 -2
  365. package/bundle/chunk-cfw9pyt7.js +0 -2
  366. package/bundle/chunk-ckbwdrm3.js +0 -2
  367. package/bundle/chunk-cz3h5n1v.js +0 -3
  368. package/bundle/chunk-d80hk5x9.js +0 -3
  369. package/bundle/chunk-d8dk05kd.js +0 -2
  370. package/bundle/chunk-dwajajaq.js +0 -2
  371. package/bundle/chunk-dxcrggvq.js +0 -2
  372. package/bundle/chunk-e7ah0e61.js +0 -2
  373. package/bundle/chunk-e7v9trve.js +0 -11
  374. package/bundle/chunk-efndtzby.js +0 -2
  375. package/bundle/chunk-eq2pepce.js +0 -2
  376. package/bundle/chunk-esp6jv63.js +0 -7
  377. package/bundle/chunk-f693s9vn.js +0 -2
  378. package/bundle/chunk-f9v5n0t6.js +0 -2
  379. package/bundle/chunk-fdadk5tw.js +0 -2
  380. package/bundle/chunk-ftepqwyq.js +0 -2
  381. package/bundle/chunk-g4nq9swr.js +0 -3
  382. package/bundle/chunk-gdb67zmn.js +0 -14
  383. package/bundle/chunk-gk28ffhg.js +0 -2
  384. package/bundle/chunk-gpfc4z4v.js +0 -2
  385. package/bundle/chunk-gqvg02zp.js +0 -2
  386. package/bundle/chunk-h3k1dk9m.js +0 -2
  387. package/bundle/chunk-h8c3dcqt.js +0 -2
  388. package/bundle/chunk-hfq11w4h.js +0 -2
  389. package/bundle/chunk-hg0etbkx.js +0 -3
  390. package/bundle/chunk-hw5qyht3.js +0 -3
  391. package/bundle/chunk-hwf58w1k.js +0 -2
  392. package/bundle/chunk-j0jdkqf5.js +0 -5
  393. package/bundle/chunk-jm722vy1.js +0 -4
  394. package/bundle/chunk-kdvs4871.js +0 -2
  395. package/bundle/chunk-kk3ve911.js +0 -2
  396. package/bundle/chunk-kv72hxkp.js +0 -3
  397. package/bundle/chunk-m4j7jyrd.js +0 -3
  398. package/bundle/chunk-mdts0641.js +0 -2
  399. package/bundle/chunk-mf3sm0pk.js +0 -2
  400. package/bundle/chunk-mkng9ykt.js +0 -2
  401. package/bundle/chunk-npv80mcx.js +0 -2
  402. package/bundle/chunk-ny9hnvzy.js +0 -2
  403. package/bundle/chunk-p15sv2dg.js +0 -3
  404. package/bundle/chunk-pe98rznj.js +0 -2
  405. package/bundle/chunk-q1czj6be.js +0 -2
  406. package/bundle/chunk-q6wm9yt0.js +0 -2
  407. package/bundle/chunk-qbx70v64.js +0 -2
  408. package/bundle/chunk-qc3ce3vc.js +0 -3
  409. package/bundle/chunk-qek6a75r.js +0 -2
  410. package/bundle/chunk-qkk1as5n.js +0 -2
  411. package/bundle/chunk-qsm9xw87.js +0 -2
  412. package/bundle/chunk-qyzze0dv.js +0 -2
  413. package/bundle/chunk-r2w3gr8d.js +0 -2
  414. package/bundle/chunk-r5bqcpkz.js +0 -2
  415. package/bundle/chunk-r67c858b.js +0 -2
  416. package/bundle/chunk-r9fvfkee.js +0 -2
  417. package/bundle/chunk-rq47pn3r.js +0 -2
  418. package/bundle/chunk-rvt1tdy8.js +0 -2
  419. package/bundle/chunk-ry7q8xn6.js +0 -2
  420. package/bundle/chunk-s27xvrft.js +0 -2
  421. package/bundle/chunk-s2vasbwj.js +0 -2
  422. package/bundle/chunk-scy39p6q.js +0 -2
  423. package/bundle/chunk-shenqgrx.js +0 -2
  424. package/bundle/chunk-sz0gkx88.js +0 -5
  425. package/bundle/chunk-t5qamf96.js +0 -2
  426. package/bundle/chunk-t9mz17gb.js +0 -3
  427. package/bundle/chunk-tt8jke90.js +0 -2
  428. package/bundle/chunk-ttevj0pj.js +0 -2
  429. package/bundle/chunk-v6tgn668.js +0 -2
  430. package/bundle/chunk-v7c54cyj.js +0 -2
  431. package/bundle/chunk-vgefaens.js +0 -2
  432. package/bundle/chunk-vkq0faj8.js +0 -2
  433. package/bundle/chunk-vkqzmzpw.js +0 -2
  434. package/bundle/chunk-vv59b4re.js +0 -2
  435. package/bundle/chunk-vwqy7n3g.js +0 -2
  436. package/bundle/chunk-w5kg2yz0.js +0 -3
  437. package/bundle/chunk-wbzs30fk.js +0 -28
  438. package/bundle/chunk-wet3bnwn.js +0 -2
  439. package/bundle/chunk-wfegee41.js +0 -2
  440. package/bundle/chunk-wmaz57f6.js +0 -800
  441. package/bundle/chunk-wn076jwj.js +0 -2
  442. package/bundle/chunk-x0m1qye9.js +0 -2
  443. package/bundle/chunk-x9s90xd1.js +0 -3
  444. package/bundle/chunk-xy5cjach.js +0 -2
  445. package/bundle/chunk-y70aachh.js +0 -2
  446. package/bundle/chunk-ya8g02hv.js +0 -9
  447. package/bundle/chunk-yqk58hf6.js +0 -3
  448. package/bundle/chunk-ysgxt83y.js +0 -2
  449. package/bundle/chunk-zm5dfk2b.js +0 -3
  450. package/bundle/chunk-zph1c2q1.js +0 -3
  451. package/bundle/chunk-zwdnh860.js +0 -2
@@ -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{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
- import{rm as f,sm as Gj,tm as Rj,um as Hj,xm as s}from"./chunk-j8q252w3.js";import{Fp as xj}from"./chunk-snr44en9.js";import{$p as vj}from"./chunk-xqdrr7xg.js";import{As as P,Bs as wj,Hs as k,Is as Kj}from"./chunk-6p94fpbn.js";import{ju as Ij,ku as Jj,nu as Nj,ou as I,st as a,tt as y,xu as h}from"./chunk-x9s90xd1.js";import{Ru as i}from"./chunk-e7v9trve.js";import{Tu as j}from"./chunk-m4j7jyrd.js";import{GG as d,OI as Q,YD as Wj,lG as o,nP as l,oO as C}from"./chunk-a0rp7gh4.js";import{_P as Mj,aQ as Oj,cQ as Ej}from"./chunk-3k2b05fv.js";var tj={};Oj(tj,{stopRefresh:()=>aj,startRefresh:()=>sj,refresh:()=>jj,readModelCatalogResponse:()=>Pj,get:()=>fj,Provider:()=>cj,Model:()=>pj,MODEL_CATALOG_MAX_BYTES:()=>Aj,Data:()=>S});import hj from"path";var U={};Oj(U,{layer:()=>Bj,isPreview:()=>ij,isNewerVersion:()=>qj,isLocal:()=>mj,getReleaseType:()=>yj,defaultLayer:()=>uj,UpgradeFailedError:()=>x,USER_AGENT:()=>Sj,Service:()=>E,Installation:()=>U,Info:()=>Uj,Event:()=>Cj});var _j=(J)=>J.pipe(k.retryTransient({retryOn:"errors-and-responses",times:2,schedule:d.exponential(200).pipe(d.jittered)}));import Yj from"path";var z=Mj(xj(),1);import n from"crypto";import v from"fs";import Zj from"path";class H extends Error{constructor(J){super(J);this.name="SelfUpdateError"}}function $j(J){let V=J?.platform??process.platform,_=J?.arch??process.arch,$=J?.libc??"bionic",W=["qitqode",V==="win32"?"windows":V,_];if(_==="x64")W.push("baseline");if(V==="linux"&&$==="musl")W.push("musl");return`@qitqode/${W.join("-")}`}function kj(J,V){if(V.integrity){let _=V.integrity.match(/^(sha512|sha384|sha256)-([A-Za-z0-9+/=]+)$/);if(!_)throw new H(`registry returned an unrecognized integrity string: ${V.integrity}`);if(n.createHash(_[1]).update(J).digest("base64")!==_[2])throw new H(`checksum mismatch: downloaded tarball does not match the registry ${_[1]} integrity value; refusing to install`);return}if(V.shasum){if(n.createHash("sha1").update(J).digest("hex")!==V.shasum.toLowerCase())throw new H("checksum mismatch: downloaded tarball does not match the registry shasum; refusing to install");return}throw new H("registry provided no integrity metadata for the tarball; refusing to install")}function Qj(J,V){let _=(w,R)=>{let G=w,q=w+R;while(G<q&&J[G]!==0)G++;return new TextDecoder().decode(J.subarray(w,G))},$=0,W;while($+512<=J.length){if(J.subarray($,$+512).every((Z)=>Z===0))break;let R=_($+124,12).trim(),G=R?parseInt(R,8):0;if(!Number.isFinite(G)||G<0)throw new H("downloaded tarball is corrupt (bad tar header)");let q=String.fromCharCode(J[$+156]),B=_($,100),N=_($+345,155);if(N)B=`${N}/${B}`;if(W)B=W,W=void 0;let b=$+512,X=b+G;if(q==="L")W=new TextDecoder().decode(J.subarray(b,X)).replace(/\0+$/,"");else if((q==="0"||q==="\x00"||q==="")&&B===V)return J.slice(b,X);$=b+Math.ceil(G/512)*512}return}var A=(J)=>String(J instanceof Error?J.message:J),u=(J)=>Q.fail(new H(J)),p=(J,V)=>Q.try({try:J,catch:(_)=>new H(V(_))}),Xj=Q.fnUntraced(function*(J){let{target:V,execPath:_,packageName:$,registry:W}=J,w=J.gunzip??((K)=>Bun.gunzipSync(K)),R=Zj.dirname(_);yield*p(()=>v.accessSync(R,v.constants.W_OK),()=>`no write permission for ${R}; cannot replace ${_}. Fix the directory permissions or re-run with sufficient privileges.`);let G=`${W}/${$}/${encodeURIComponent(V)}`,B=(yield*J.fetchJson(G).pipe(Q.mapError((K)=>new H(`download failed: could not fetch ${$}@${V} from ${W} (${A(K)}). Check your network connection and that version ${V} exists.`))))?.dist;if(!B?.tarball)return yield*u(`registry response for ${$}@${V} has no tarball URL; cannot self-update`);let N=B.tarball,b=yield*J.fetchBytes(N).pipe(Q.mapError((K)=>new H(`download failed: could not download ${N} (${A(K)}). Check your network connection and try again.`)));yield*Q.try({try:()=>kj(b,B),catch:(K)=>K instanceof H?K:new H(A(K))});let X=yield*Q.try({try:()=>w(b),catch:()=>new H("downloaded tarball is corrupt (gunzip failed); try again")}),Z=Qj(X,"package/bin/qitqode")??Qj(X,"package/bin/qitqode.exe");if(!Z||Z.length===0)return yield*u(`tarball for ${$}@${V} does not contain the expected binary at bin/qitqode`);let O=Zj.join(R,`.qitqode-upgrade-${process.pid}`),Y=`${_}.backup-${process.pid}`,D=(K)=>{try{v.rmSync(K,{force:!0})}catch{}};yield*p(()=>v.writeFileSync(O,Z,{mode:493}),(K)=>{return D(O),`no write permission: could not write ${O} (${A(K)})`});let L=yield*J.runVersion(O).pipe(Q.mapError((K)=>{return D(O),new H(`downloaded binary failed its --version check (${A(K)}); keeping the current installation`)}));if(L.code!==0)return D(O),yield*u(`downloaded binary failed its --version check (exit ${L.code}); keeping the current installation`);let m=L.stdout.trim();if(m&&!m.includes(V))return D(O),yield*u(`downloaded binary reports version "${m}" instead of ${V}; keeping the current installation`);yield*p(()=>v.renameSync(_,Y),(K)=>{return D(O),`could not move the current binary aside (${A(K)}); check permissions on ${_}`}),yield*Q.try({try:()=>v.renameSync(O,_),catch:(K)=>{try{v.renameSync(Y,_)}catch{return new H(`failed to install the new binary AND failed to restore the old one; your previous binary is preserved at ${Y} \u2014 move it back to ${_} manually`)}return D(O),new H(`could not install the new binary (${A(K)}); the previous version was restored`)}}),D(Y)});var c=h.create({service:"installation"}),M="@qitqode/cli";function qj(J,V){if(!z.default.valid(J)||!z.default.valid(V))return!1;return z.default.gt(V,J)}var Cj={Updated:s.define("installation.updated",j.object({version:j.string()})),UpdateAvailable:s.define("installation.update-available",j.object({version:j.string()}))};function yj(J,V){if(!qj(J,V))throw Error(`Version ${V} is not newer than ${J}`);let _=z.default.major(J),$=z.default.minor(J),W=z.default.major(V),w=z.default.minor(V);if(W>_)return"major";if(w>$)return"minor";return"patch"}var Uj=j.object({version:j.string(),latest:j.string()}).meta({ref:"InstallationInfo"}),Sj=`qitqode/${y}/${a}/${I.QITQODE_CLIENT}`;function ij(){return y!=="latest"}function mj(){return y==="local"}class x extends C.TaggedErrorClass()("UpgradeFailedError",{stderr:C.String}){}var nj=C.Struct({version:C.String});class E extends Wj.Service()("@qitqode/Installation"){}var Bj=o.effect(E,Q.gen(function*(){let J=yield*k.HttpClient,V=k.filterStatusOk(_j(J)),_=yield*f.ChildProcessSpawner,$=(X,Z)=>Gj.make(X[0],X.slice(1),{cwd:Z?.cwd,env:Z?.env,extendEnv:!0}),W=Q.fnUntraced(function*(X){let Z=yield*Hj(_,X);return{code:Z.code,stdout:Z.text,stderr:Z.stderr}},Q.scoped),w=Q.fnUntraced(function*(X,Z){let O=yield*_.spawn($(X,Z)),Y=yield*l.mkString(l.decodeText(O.stdout));return yield*O.exitCode,Y},Q.scoped,Q.catch(()=>Q.succeed(""))),R=Q.fnUntraced(function*(X,Z){return yield*W($(X,Z))},Q.catch(()=>Q.succeed({code:f.ExitCode(1),stdout:"",stderr:""}))),G=Q.fn("Installation.method")(function*(){if(process.execPath.includes(Yj.join(".qitqode","bin")))return"curl";if(process.execPath.includes(Yj.join(".local","bin")))return"curl";let X=process.execPath.toLowerCase(),Z=[{name:"npm",command:()=>w(["npm","list","-g","--depth=0"])},{name:"pnpm",command:()=>w(["pnpm","list","-g","--depth=0"])},{name:"bun",command:()=>w(["bun","pm","ls","-g"])}];Z.sort((O,Y)=>{let D=X.includes(O.name),L=X.includes(Y.name);if(D&&!L)return-1;if(!D&&L)return 1;return 0});for(let O of Z)if((yield*O.command()).includes(M))return O.name;return"unknown"}),q=Q.fn("Installation.latest")(function*(X){let Z=X||(yield*G());if(Z==="curl"){let Y=(yield*w(["curl","-sI","https://github.com/qitqode/qitqode/releases/latest"])).match(/^location:.*\/tag\/v([0-9][^\s/]*)/im);if(Y)return Y[1];return yield*Q.die(Error("failed to resolve latest version from GitHub releases redirect"))}if(Z==="npm"||Z==="bun"||Z==="pnpm"){let Y=(yield*w(["npm","config","get","registry"])).trim()||"https://registry.npmjs.org",D=Y.endsWith("/")?Y.slice(0,-1):Y,L=yield*V.execute(P.get(`${D}/${encodeURIComponent(M)}/${y}`).pipe(P.acceptJson));return(yield*wj.schemaBodyJson(nj)(L)).version}return c.warn("unsupported update channel, skipping",{method:Z}),yield*Q.die(Error(`unsupported update channel: ${Z}`))},Q.orDie),B=Q.fnUntraced(function*(){let Z=(yield*w(["npm","config","get","registry"])).trim()||"https://registry.npmjs.org";return Z.endsWith("/")?Z.slice(0,-1):Z}),N=Q.fnUntraced(function*(X){let Z=yield*B();yield*Xj({target:X,execPath:process.env.QITQODE_SELF_UPDATE_TARGET_BINARY||process.execPath,packageName:$j(),registry:Z,fetchJson:(O)=>V.execute(P.get(O).pipe(P.acceptJson)).pipe(Q.flatMap((Y)=>Y.json)),fetchBytes:(O)=>V.execute(P.get(O)).pipe(Q.flatMap((Y)=>Y.arrayBuffer),Q.map((Y)=>new Uint8Array(Y))),runVersion:(O)=>R([O,"--version"]).pipe(Q.map((Y)=>({code:Y.code,stdout:Y.stdout})))}).pipe(Q.mapError((O)=>new x({stderr:O.message})))}),b=Q.fn("Installation.upgrade")(function*(X,Z){if(X==="curl"){yield*N(Z),c.info("upgraded",{method:X,target:Z});return}let Y=yield*(()=>{if(X==="npm")return R(["npm","install","-g",`${M}@${Z}`]);if(X==="pnpm")return R(["pnpm","install","-g",`${M}@${Z}`]);if(X==="bun")return R(["bun","install","-g",`${M}@${Z}`]);return new x({stderr:`Unknown method: ${X}`})})();if(Y.code!==0){let D=Y.stderr||"";return yield*new x({stderr:D})}c.info("upgraded",{method:X,target:Z,stdout:Y.stdout,stderr:Y.stderr}),yield*w([process.execPath,"--version"])});return E.of({info:Q.fn("Installation.info")(function*(){return{version:a,latest:yield*q()}}),method:G,latest:q,upgrade:b})})),uj=Bj.pipe(o.provide(Kj.layer),o.provide(Rj));var t=j.lazy(()=>j.union([j.string(),j.number(),j.boolean(),j.null(),j.array(t),j.record(j.string(),t)])),Dj=j.object({input:j.number(),output:j.number(),cache_read:j.number().optional(),cache_write:j.number().optional(),context_over_200k:j.object({input:j.number(),output:j.number(),cache_read:j.number().optional(),cache_write:j.number().optional()}).optional()}),r=j.object({id:j.string(),name:j.string(),family:j.string().optional(),release_date:j.string(),attachment:j.boolean(),reasoning:j.boolean(),temperature:j.boolean().optional(),tool_call:j.boolean(),interleaved:j.union([j.literal(!0),j.object({field:j.enum(["reasoning_content","reasoning_details"])}).strict()]).optional(),cost:Dj.optional(),limit:j.object({context:j.number(),input:j.number().optional(),output:j.number()}),modalities:j.object({input:j.array(j.enum(["text","audio","image","video","pdf"])),output:j.array(j.enum(["text","audio","image","video","pdf"]))}).optional(),experimental:j.object({modes:j.record(j.string(),j.object({cost:Dj.optional(),provider:j.object({body:j.record(j.string(),t).optional(),headers:j.record(j.string(),j.string()).optional()}).optional()})).optional()}).optional(),status:j.enum(["alpha","beta","deprecated"]).optional(),provider:j.object({npm:j.string().optional(),api:j.string().optional()}).optional()}),e=j.object({api:j.string().optional(),name:j.string(),env:j.array(j.string()),id:j.string(),npm:j.string().optional(),models:j.record(j.string(),r)});var Vj=h.create({service:"models.dev"}),bj=Fj(),F=hj.join(Nj.Path.cache,bj==="https://models.dev"?"models.json":`models-${Ij.fast(bj)}.json`),gj=300000,Aj=8388608,T,dj=j.record(j.string(),e),pj=r,cj=e;function Fj(){return I.QITQODE_MODELS_URL||"https://models.dev"}function lj(){return Date.now()-Number(i.stat(F)?.mtimeMs??0)<gj}function Lj(J){return!J&&lj()}function g(J){let V=dj.parse(typeof J==="string"?JSON.parse(J):J);for(let[_,$]of Object.entries(V))if($.id!==_)throw Error(`Invalid model provider: ${_}`);return V}async function zj(J){let V=await i.readJson(J).catch(()=>{return});if(!V)return;try{return g(V)}catch(_){Vj.warn("Ignoring invalid model catalog cache",{file:J,error:_});return}}async function Pj(J,V,_=Aj){let $=J.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase();if($!=="application/json"&&!$?.endsWith("+json"))throw Error(`Invalid model catalog content type: ${$||"missing"}`);let W=Number(J.headers.get("content-length"));if(Number.isFinite(W)&&W>_)throw Error("Model catalog response is too large");if(!J.body)return"";let w=J.body.getReader(),R=()=>void w.cancel(V.reason);V.addEventListener("abort",R,{once:!0});let G=new Uint8Array(_),q=0;try{for(;;){let B=await w.read();if(B.done)break;if(q+=B.value.byteLength,q>_)throw await w.cancel(),Error("Model catalog response is too large");G.set(B.value,q-B.value.byteLength)}}finally{V.removeEventListener("abort",R)}return new TextDecoder().decode(G.subarray(0,q))}var Tj=async()=>{let J=AbortSignal.timeout(1e4),V=await fetch(`${Fj()}/api.json`,{headers:{"User-Agent":U.USER_AGENT},signal:J});if(!V.ok)return;let _=g(await Pj(V,J));return JSON.stringify(_)},S=vj(async()=>{let J=await zj(I.QITQODE_MODELS_PATH??F);if(J)return J;let V=await import("./chunk-1gf116rg.js").then((_)=>g(_.snapshot)).catch(()=>{return});if(V)return V;if(I.QITQODE_DISABLE_MODELS_FETCH)return{};return Jj.withLock(`models-dev:${F}`,async()=>{let _=await zj(I.QITQODE_MODELS_PATH??F);if(_)return _;let $=await Tj();if($)return await i.write(F,$).catch((W)=>{Vj.error("Failed to write models cache",{error:W})}),g($);return{}})});async function fj(){return S()}async function jj(J=!1){if(Lj(J))return S.reset();await Jj.withLock(`models-dev:${F}`,async()=>{if(Lj(J))return S.reset();let V=await Tj();if(!V)return;await i.write(F,V),S.reset()}).catch((V)=>{Vj.error("Failed to fetch models.dev",{error:V})})}function sj(){if(T||I.QITQODE_DISABLE_MODELS_FETCH||process.argv.includes("--get-yargs-completions"))return;jj(),T=setInterval(async()=>{await jj()},3600000),T.unref()}function aj(){if(!T)return;clearInterval(T),T=void 0}
3
- export{_j as El,U as Fl,Aj as Gl,pj as Hl,cj as Il,Pj as Jl,S as Kl,fj as Ll,jj as Ml,sj as Nl,aj as Ol,tj as Pl};
@@ -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,5 +0,0 @@
1
- // @bun
2
- import{Fd as T,Hd as q,Id as N,Jd as w,Kd as X,Nd as D}from"./chunk-x66ycpfs.js";import"./chunk-03xppy47.js";import{Vf as Q}from"./chunk-p9cnzxb8.js";import{gh as A}from"./chunk-28cm7m3t.js";import"./chunk-w9nzsd3w.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-wmaz57f6.js";import{Fl as $}from"./chunk-hg0etbkx.js";import"./chunk-za63b5mc.js";import"./chunk-j8q252w3.js";import"./chunk-nj4d554m.js";import"./chunk-1hmq2fpt.js";import"./chunk-y370dqf3.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-8eje5baf.js";import"./chunk-xqdrr7xg.js";import"./chunk-6b196wjz.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-wwgd4rzx.js";import"./chunk-qc3ce3vc.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-vkqzmzpw.js";import{nu as W}from"./chunk-x9s90xd1.js";import{Gu as _,Ru as Y}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 V from"fs/promises";import L from"path";import R from"os";var g={command:"uninstall",describe:"uninstall qitqode and remove all related files",builder:(j)=>j.option("keep-config",{alias:"c",type:"boolean",describe:"keep configuration files",default:!1}).option("keep-data",{alias:"d",type:"boolean",describe:"keep session data and snapshots",default:!1}).option("dry-run",{type:"boolean",describe:"show what would be removed without removing",default:!1}).option("force",{alias:"f",type:"boolean",describe:"skip confirmation prompts",default:!1}),handler:async(j)=>{Q.empty(),Q.println(Q.logo(" ")),Q.empty(),w("Uninstall QitQode");let B=await A.runPromise($.Service.use((J)=>J.method()));N.info(`Installation method: ${B}`);let E=await v(j,B);if(await z(E,B),!j.force&&!j.dryRun){let J=await q({message:"Are you sure you want to uninstall?",initialValue:!1});if(!J||T(J)){X("Cancelled");return}}if(j.dryRun){N.warn("Dry run - no changes made"),X("Done");return}await G(B,E),X("Done")}};async function v(j,B){let E=[{path:W.Path.data,label:"Data",keep:j.keepData},{path:W.Path.cache,label:"Cache",keep:!1},{path:W.Path.config,label:"Config",keep:j.keepConfig},{path:W.Path.state,label:"State",keep:!1}],J=B==="curl"?await P():null,H=B==="curl"?process.execPath:null;return{directories:E,shellConfig:J,binary:H}}async function z(j,B){N.message("The following will be removed:");for(let E of j.directories){if(!await V.access(E.path).then(()=>!0).catch(()=>!1))continue;let H=await F(E.path),K=S(H),O=E.keep?Q.Style.TEXT_DIM+"(keeping)":"",M=E.keep?"\u25CB":"\u2713";N.info(` ${M} ${E.label}: ${Z(E.path)} ${Q.Style.TEXT_DIM}(${K})${O}`)}if(j.binary)N.info(` \u2713 Binary: ${Z(j.binary)}`);if(j.shellConfig)N.info(` \u2713 Shell PATH in ${Z(j.shellConfig)}`);if(B!=="curl"&&B!=="unknown"){let E={npm:"npm uninstall -g @qitqode/cli",pnpm:"pnpm uninstall -g @qitqode/cli",bun:"bun remove -g @qitqode/cli"};N.info(` \u2713 Package: ${E[B]||B}`)}}async function G(j,B){let E=D(),J=[];for(let H of B.directories){if(H.keep){N.step(`Skipping ${H.label} (--keep-${H.label.toLowerCase()})`);continue}if(!await V.access(H.path).then(()=>!0).catch(()=>!1))continue;E.start(`Removing ${H.label}...`);let O=await V.rm(H.path,{recursive:!0,force:!0}).catch((M)=>M);if(O){E.stop(`Failed to remove ${H.label}`,1),J.push(`${H.label}: ${O.message}`);continue}E.stop(`Removed ${H.label}`)}if(B.shellConfig){E.start("Cleaning shell config...");let H=await k(B.shellConfig).catch((K)=>K);if(H)E.stop("Failed to clean shell config",1),J.push(`Shell config: ${H.message}`);else E.stop("Cleaned shell config")}if(j!=="curl"&&j!=="unknown"){let K={npm:["npm","uninstall","-g","@qitqode/cli"],pnpm:["pnpm","uninstall","-g","@qitqode/cli"],bun:["bun","remove","-g","@qitqode/cli"]}[j];if(K){E.start(`Running ${K.join(" ")}...`);let O=await _.run(K,{nothrow:!0});if(O.code!==0)E.stop(`Package manager uninstall failed: exit code ${O.code}`,1),N.warn(`You may need to run manually: ${K.join(" ")}`);else E.stop("Package removed")}else N.warn(`Uninstall not supported for method "${j}" yet, skipping package removal`)}if(j==="curl"&&B.binary){Q.empty(),N.message("To finish removing the binary, run:"),N.info(` rm "${B.binary}"`);let H=L.dirname(B.binary);if(H.includes(".qitqode"))N.info(` rmdir "${H}" 2>/dev/null`)}if(J.length>0){Q.empty(),N.warn("Some operations failed:");for(let H of J)N.error(` ${H}`)}Q.empty(),N.success("Thank you for using QitQode!")}async function P(){let j=L.basename(process.env.SHELL||"bash"),B=R.homedir(),E=process.env.XDG_CONFIG_HOME||L.join(B,".config"),J={fish:[L.join(E,"fish","config.fish")],zsh:[L.join(B,".zshrc"),L.join(B,".zshenv"),L.join(E,"zsh",".zshrc"),L.join(E,"zsh",".zshenv")],bash:[L.join(B,".bashrc"),L.join(B,".bash_profile"),L.join(B,".profile"),L.join(E,"bash",".bashrc"),L.join(E,"bash",".bash_profile")],ash:[L.join(B,".ashrc"),L.join(B,".profile")],sh:[L.join(B,".profile")]},H=J[j]||J.bash;for(let K of H){if(!await V.access(K).then(()=>!0).catch(()=>!1))continue;let M=await Y.readText(K).catch(()=>"");if(M.includes("# qitqode")||M.includes(".qitqode/bin"))return K}return null}async function k(j){let E=(await Y.readText(j)).split(`
3
- `),J=[],H=!1;for(let O of E){let M=O.trim();if(M==="# qitqode"){H=!0;continue}if(H){if(H=!1,M.includes(".qitqode/bin")||M.includes("fish_add_path"))continue}if(M.startsWith("export PATH=")&&M.includes(".qitqode/bin")||M.startsWith("fish_add_path")&&M.includes(".qitqode"))continue;J.push(O)}while(J.length>0&&J[J.length-1].trim()==="")J.pop();let K=J.join(`
4
- `)+`
5
- `;await Y.write(j,K)}async function F(j){let B=0,E=async(J)=>{let H=await V.readdir(J,{withFileTypes:!0}).catch(()=>[]);for(let K of H){let O=L.join(J,K.name);if(K.isDirectory()){await E(O);continue}if(K.isFile()){let M=await V.stat(O).catch(()=>null);if(M)B+=M.size}}};return await E(j),B}function S(j){if(j<1024)return`${j} B`;if(j<1048576)return`${(j/1024).toFixed(1)} KB`;if(j<1073741824)return`${(j/1048576).toFixed(1)} MB`;return`${(j/1073741824).toFixed(1)} GB`}function Z(j){let B=R.homedir();if(j===B||j.startsWith(B+L.sep))return"~"+j.slice(B.length);return j}export{g as UninstallCommand};
@@ -1,4 +0,0 @@
1
- // @bun
2
- import{Cp as K,fp as j,gp as R,hp as O,ip as A,op as y,tp as q,up as M,wp as C}from"./chunk-y370dqf3.js";import{ku as v,nu as D}from"./chunk-x9s90xd1.js";import{Au as b,Gu as I,Ru as d,yu as m}from"./chunk-e7v9trve.js";import{dQ as T,eQ as _}from"./chunk-3k2b05fv.js";import P from"path";function pt(t){let e=t&&typeof t==="object"&&"cause"in t?t.cause??t:t;if(!(e instanceof I.RunFailedError))return{error:e,detail:b(e),missing:!1};let r=e.stderr.toString().split(/\r?\n/).map((o)=>o.trim()).filter(Boolean),n=r.filter((o)=>o.startsWith("error:")).map((o)=>o.replace(/^error:\s*/,""));return{error:e,detail:n[0]??r.at(-1),missing:r.some((o)=>o.includes("No version matching"))}}var $={resolve:(t)=>q(t)},z={readText:(t)=>d.readText(t),write:async(t,e)=>{await d.write(t,e)},exists:(t)=>d.exists(t),files:(t,e)=>K(t,e)},G=z;function V(t){if(typeof t==="string")return t;if(!Array.isArray(t))return;if(typeof t[0]!=="string")return;return t[0]}function H(t){if(!t||typeof t!=="object"||Array.isArray(t))return;let e=t;if(!Array.isArray(e.plugin))return;return e.plugin}function Q(t){if(typeof t==="string"){let e=t.trim();if(e)return e;return}if(!m(t))return;for(let e of["import","default"]){let r=t[e];if(typeof r!=="string")continue;let n=r.trim();if(!n)continue;return n}}function U(t){if(!m(t))return;let e=t.config;if(!m(e))return;return e}function E(t,e){let r=t.exports;if(!m(r))return;let n=r[`./${e}`];if(!Q(n))return;return{opts:U(n)}}function X(t){let e=t.main;if(typeof e!=="string")return!1;return Boolean(e.trim())}function Y(t){let e=typeof t.json.name==="string"&&t.json.name.trim().length>0?t.json.name.trim():P.basename(t.dir),r=[],n=E(t.json,"server");if(n)r.push({kind:"server",opts:n.opts});else if(X(t.json))r.push({kind:"server"});let o=E(t.json,"tui");if(o)r.push({kind:"tui",opts:o.opts});if(!r.some((c)=>c.kind==="tui")&&C(e,t).length)r.push({kind:"tui"});return r}function g(t,e,r,n=!1){return A(t,O(t,e,r,{formattingOptions:{tabSize:2,insertSpaces:!0},isArrayInsertion:n}))}function Z(t,e,r,n,o=!1){let c=y(r).pkg,u=(e??[]).map((i,p)=>({item:i,i:p,spec:V(i)})).filter((i)=>{if(!i.spec)return!1;if(i.spec===r)return!0;if(i.spec.startsWith("file://"))return!1;return y(i.spec).pkg===c});if(!u.length){if(!e)return{mode:"add",text:g(t,["plugin"],[n])};return{mode:"add",text:g(t,["plugin",e.length],n,!0)}}if(!o)return{mode:"noop",text:t};let s=u[0];if(!s)return{mode:"noop",text:t};if(u.length===1&&s.spec===r)return{mode:"noop",text:t};let a=t;if(typeof s.item==="string")a=g(a,["plugin",s.i],n);if(Array.isArray(s.item)&&typeof s.item[0]==="string")a=g(a,["plugin",s.i,0],r);let l=u.map((i)=>i.i).filter((i)=>i!==s.i).sort((i,p)=>p-i);for(let i of l)a=g(a,["plugin",i],void 0);return{mode:"replace",text:a}}async function gt(t,e=$){let r=await e.resolve(t).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!r.ok)return{ok:!1,code:"install_failed",error:r.error};return{ok:!0,target:r.item}}async function dt(t){let e=await M(t).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!e.ok)return{ok:!1,code:"manifest_read_failed",file:t,error:e.error};let r=await Promise.resolve().then(()=>Y(e.item)).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!r.ok)return{ok:!1,code:"manifest_read_failed",file:e.item.pkg,error:r.error};if(!r.item.length)return{ok:!1,code:"manifest_no_targets",file:e.item.pkg};return{ok:!0,targets:r.item}}function tt(t){if(t.global)return t.config??D.Path.config;let r=t.vcs==="git"&&t.worktree!=="/"?t.worktree:t.directory;return P.join(r,".qitqode")}function et(t){if(t==="server")return"qitqode";return"tui"}async function rt(t,e,r,n,o){let x=[];try{let c=et(e.kind);const S=T(x,await v.acquire(`plug-config:${d.resolve(P.join(t,c))}`),1);let u=o.files(t,c);let s=u[0];for(let f of u){if(!await o.exists(f))continue;s=f;break}let a=await o.readText(s).catch((f)=>{if(f.code==="ENOENT")return"{}";return f});if(a instanceof Error)return{ok:!1,code:"patch_failed",kind:e.kind,error:a};let l=a.trim()?a:"{}";let i=[];let p=j(l,i,{allowTrailingComma:!0});if(i.length){let f=i[0],h=l.substring(0,f.offset).split(`
3
- `);return{ok:!1,code:"invalid_json",kind:e.kind,file:s,line:h.length,col:h[h.length-1].length+1,parse:R(f.error)}}let N=H(p);let F=e.opts?[r,e.opts]:r;let k=Z(l,N,r,F,n);if(k.mode==="noop")return{ok:!0,item:{kind:e.kind,mode:k.mode,file:s}};let w=await o.write(s,k.text).catch((f)=>f);if(w instanceof Error)return{ok:!1,code:"patch_failed",kind:e.kind,error:w};return{ok:!0,item:{kind:e.kind,mode:k.mode,file:s}}}catch(J){var B=J,L=1}finally{var W=_(x,B,L);W&&await W}}async function mt(t,e=G){let r=tt(t),n=[];for(let o of t.targets){let c=await rt(r,o,t.spec,Boolean(t.force),e);if(!c.ok)return{...c,dir:r};n.push(c.item)}return{ok:!0,dir:r,items:n}}
4
- export{pt as p,z as q,gt as r,dt as s,mt as t};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Kg as a}from"./chunk-q5fygrnr.js";import{Xg as t,gh as c}from"./chunk-28cm7m3t.js";import"./chunk-w9nzsd3w.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-wmaz57f6.js";import"./chunk-hg0etbkx.js";import"./chunk-za63b5mc.js";import"./chunk-j8q252w3.js";import"./chunk-nj4d554m.js";import"./chunk-1hmq2fpt.js";import"./chunk-y370dqf3.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-8eje5baf.js";import"./chunk-xqdrr7xg.js";import"./chunk-6b196wjz.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-wwgd4rzx.js";import"./chunk-qc3ce3vc.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-vkqzmzpw.js";import"./chunk-x9s90xd1.js";import"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import{Tu as i}from"./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 n=i.object({name:a.shape.name,branch:a.shape.branch.unwrap(),directory:a.shape.directory.unwrap()}),d={name:"Worktree",description:"Create a git worktree",async configure(e){let r=await c.runPromise(t.Service.use((o)=>o.makeWorktreeInfo()));return{...e,name:r.name,branch:r.branch,directory:r.directory}},async create(e){let r=n.parse(e);await c.runPromise(t.Service.use((o)=>o.createFromInfo({name:r.name,directory:r.directory,branch:r.branch})))},async remove(e){let r=n.parse(e);await c.runPromise(t.Service.use((o)=>o.remove({directory:r.directory})))},target(e){return{type:"local",directory:n.parse(e).directory}}};export{d as WorktreeAdaptor};
@@ -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{h as N}from"./chunk-d80hk5x9.js";import{F as K,G as L,H as $}from"./chunk-zm5dfk2b.js";import"./chunk-t9mz17gb.js";import{Rd as X}from"./chunk-yajd975f.js";import{Vf as j}from"./chunk-p9cnzxb8.js";import{zg as H}from"./chunk-ya8g02hv.js";import{gh as Z}from"./chunk-28cm7m3t.js";import"./chunk-w9nzsd3w.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 w}from"./chunk-wmaz57f6.js";import"./chunk-hg0etbkx.js";import"./chunk-za63b5mc.js";import"./chunk-j8q252w3.js";import"./chunk-nj4d554m.js";import"./chunk-1hmq2fpt.js";import"./chunk-y370dqf3.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import{Pp as F,Up as G}from"./chunk-8eje5baf.js";import"./chunk-xqdrr7xg.js";import"./chunk-6b196wjz.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-wwgd4rzx.js";import"./chunk-qc3ce3vc.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-vkqzmzpw.js";import"./chunk-x9s90xd1.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{OI as z}from"./chunk-a0rp7gh4.js";import"./chunk-kfmz2p27.js";import"./chunk-ee23d2nz.js";import"./chunk-3k2b05fv.js";var Q="forgewise";function R(D){return z.gen(function*(){let J=yield*D.get(Q);if(!J||J.type!=="api")return;return(J.metadata??{}).sub})}var O=()=>z.gen(function*(){if((yield*N())==="revoked")return null;let D=yield*z.promise(()=>F());if(!D)return yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+"Not signed in to Forgewise. Run `qitqode auth login` first."+j.Style.TEXT_NORMAL)),null;let J=yield*w.Service,M=D.method==="sso"?yield*R(J):void 0;return{key:D.key,method:D.method,sub:M}}),q=()=>z.gen(function*(){let D=yield*O();if(!D)return;let J=yield*z.tryPromise({try:()=>H(D),catch:(P)=>P}).pipe(z.map((P)=>({ok:!0,result:P})),z.catch((P)=>z.succeed({ok:!1,error:P})));if(!J.ok){let P=J.error instanceof G?J.error.message:"Could not fetch balance.";yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+P+j.Style.TEXT_NORMAL));return}let M=J.result;if(!M){yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+"Could not fetch balance."+j.Style.TEXT_NORMAL));return}yield*z.sync(()=>j.println(j.Style.TEXT_SUCCESS+"Qredits balance: "+j.Style.TEXT_NORMAL+j.Style.TEXT_HIGHLIGHT_BOLD+$(M.balance)+j.Style.TEXT_NORMAL))}).pipe(z.withSpan("qredits.balance")),A=()=>z.gen(function*(){let D=yield*O();if(!D)return;let J=D.method==="sso"&&D.sub?{userId:D.sub,accessToken:D.key}:{},M=yield*z.tryPromise({try:()=>L({...J,limit:20}),catch:(T)=>T});if(M instanceof Error){let T=M instanceof K?M.message:String(M);yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+"Could not fetch history: "+T+j.Style.TEXT_NORMAL));return}if(M.length===0){yield*z.sync(()=>j.println("No spend history yet."));return}let P=j.Style.TEXT_DIM,V=j.Style.TEXT_NORMAL,W=j.Style.TEXT_DANGER;yield*z.sync(()=>{j.println(P+" Date Description Amount"+V),j.println(P+" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500"+V);for(let T of M){let Y=(T.date||"").slice(0,10).padEnd(18),_=(T.description||"").slice(0,32).padEnd(32),v=(T.amount<0?"-":" ")+$(Math.abs(T.amount)),x=T.amount<0?W:V;j.println(` ${P}${Y}${V} ${_} ${x}${v}${V}`)}})}).pipe(z.withSpan("qredits.history")),U=X({command:"qredits <command>",describe:"Check Qredits balance and spend history",builder:(D)=>D.command(X({command:"balance",describe:"Show current Qredits balance",builder:(J)=>J,async handler(){j.empty(),await Z.runPromise(q())}})).command(X({command:"history",describe:"Show recent Qredit spend history",builder:(J)=>J,async handler(){j.empty(),await Z.runPromise(A())}})).demandCommand(),async handler(){}});export{A as historyEffect,q as balanceEffect,U as QreditsCommand};
@@ -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{fh as a,gh as b}from"./chunk-28cm7m3t.js";import"./chunk-w9nzsd3w.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-wmaz57f6.js";import"./chunk-hg0etbkx.js";import"./chunk-za63b5mc.js";import"./chunk-j8q252w3.js";import"./chunk-nj4d554m.js";import"./chunk-1hmq2fpt.js";import"./chunk-y370dqf3.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-8eje5baf.js";import"./chunk-xqdrr7xg.js";import"./chunk-6b196wjz.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-wwgd4rzx.js";import"./chunk-qc3ce3vc.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-vkqzmzpw.js";import"./chunk-x9s90xd1.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";export{b as AppRuntime,a as AppLayer};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{p as w,q as h,r as I,s as C,t as D}from"./chunk-jm722vy1.js";import{Id as c,Jd as k,Kd as $,Nd as x}from"./chunk-x66ycpfs.js";import"./chunk-03xppy47.js";import{Rd as P}from"./chunk-yajd975f.js";import{Vf as d}from"./chunk-p9cnzxb8.js";import{lm as l}from"./chunk-za63b5mc.js";import"./chunk-j8q252w3.js";import"./chunk-nj4d554m.js";import{tp as v}from"./chunk-y370dqf3.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-xqdrr7xg.js";import"./chunk-6b196wjz.js";import"./chunk-wwgd4rzx.js";import"./chunk-qc3ce3vc.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import{nu as b}from"./chunk-x9s90xd1.js";import{Au as m}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";var j={spinner:()=>x(),log:{error:(o)=>c.error(o),info:(o)=>c.info(o),success:(o)=>c.success(o)},resolve:(o)=>v(o),...h,global:b.Path.config};function S(o){if(!o||typeof o!=="object")return;if(!("cause"in o))return;return o.cause}function _(o,e=j){let n=o.mod,a=Boolean(o.force),y=Boolean(o.global);return async(f)=>{let u=e.spinner();u.start("Installing plugin package...");let p=await I(n,e);if(!p.ok){u.stop("Install failed",1),e.log.error(`Could not install "${n}"`);let t=w(p.error);if(t.detail)e.log.error(t.detail);if(t.missing)e.log.info("This package depends on a version that is not available in your npm registry."),e.log.info("Check npm registry/auth settings and try again.");return!1}u.stop("Plugin package ready");let s=e.spinner();s.start("Reading plugin manifest...");let i=await C(p.target);if(!i.ok){if(i.code==="manifest_read_failed")return s.stop("Manifest read failed",1),e.log.error(`Installed "${n}" but failed to read ${i.file}`),e.log.error(m(S(i.error)??i.error)),!1;if(i.code==="manifest_no_targets")return s.stop("No plugin targets found",1),e.log.error(`"${n}" does not expose plugin entrypoints in package.json`),e.log.info('Expected one of: exports["./tui"], exports["./server"], package.json main for server, or package.json["oc-themes"] for tui themes.'),!1;return s.stop("Manifest read failed",1),!1}s.stop(`Detected ${i.targets.map((t)=>t.kind).join(" + ")} target${i.targets.length===1?"":"s"}`);let g=e.spinner();g.start("Updating plugin config...");let r=await D({spec:n,targets:i.targets,force:a,global:y,vcs:f.vcs,worktree:f.worktree,directory:f.directory,config:e.global},e);if(!r.ok){if(r.code==="invalid_json")return g.stop(`Failed updating ${r.kind} config`,1),e.log.error(`Invalid JSON in ${r.file} (${r.parse} at line ${r.line}, column ${r.col})`),e.log.info("Fix the config file and run the command again."),!1;return g.stop("Failed updating plugin config",1),e.log.error(m(r.error)),!1}g.stop("Plugin config updated");for(let t of r.items){if(t.mode==="noop"){e.log.info(`Already configured in ${t.file}`);continue}if(t.mode==="replace"){e.log.info(`Replaced in ${t.file}`);continue}e.log.info(`Added to ${t.file}`)}return e.log.success(`Installed ${n}`),e.log.info(y?`Scope: global (${r.dir})`:`Scope: local (${r.dir})`),!0}}var R=P({command:"plugin <module>",aliases:["plug"],describe:"install plugin and update config",builder:(o)=>{return o.positional("module",{type:"string",describe:"npm module name"}).option("global",{alias:["g"],type:"boolean",default:!1,describe:"install in global config"}).option("force",{alias:["f"],type:"boolean",default:!1,describe:"replace existing plugin version"})},handler:async(o)=>{let e=String(o.module??"").trim();if(!e){d.error("module is required"),process.exitCode=1;return}d.empty(),k(`Install plugin ${e}`);let n=_({mod:e,global:Boolean(o.global),force:Boolean(o.force)}),a=!0;if(await l.provide({directory:process.cwd(),fn:async()=>{a=await n({vcs:l.project.vcs,worktree:l.worktree,directory:l.directory})}}),$("Done"),!a)process.exitCode=1}});export{_ as createPlugTask,R as PluginCommand};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{Ed as p}from"./chunk-ppkqr9cn.js";import{Fd as x,Gd as b,Id as w,Jd as v,Kd as c}from"./chunk-x66ycpfs.js";import"./chunk-03xppy47.js";import{Rd as g}from"./chunk-yajd975f.js";import{Vf as r}from"./chunk-p9cnzxb8.js";import{gh as m}from"./chunk-28cm7m3t.js";import"./chunk-w9nzsd3w.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 f,kk as y}from"./chunk-wmaz57f6.js";import"./chunk-hg0etbkx.js";import"./chunk-za63b5mc.js";import"./chunk-j8q252w3.js";import"./chunk-nj4d554m.js";import"./chunk-1hmq2fpt.js";import"./chunk-y370dqf3.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-8eje5baf.js";import"./chunk-xqdrr7xg.js";import"./chunk-6b196wjz.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-wwgd4rzx.js";import"./chunk-qc3ce3vc.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-vkqzmzpw.js";import"./chunk-x9s90xd1.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";import{EOL as S}from"os";function s(e,t,i){return i.trim()?`[redacted:${e}:${t}]`:i}function o(e,t,i){if(!i)return i;return Object.keys(i).length?{redacted:`${e}:${t}`}:i}function a(e,t){return{...t,value:s("file-text",e,t.value)}}function l(e,t){return t?.map((i,u)=>({...i,file:s(`${e}-file`,String(u),i.file),patch:s(`${e}-patch`,String(u),i.patch)}))}function I(e){if(!e.source)return e.source;if(e.source.type==="symbol")return{...e.source,path:s("file-path",e.id,e.source.path),name:s("file-symbol",e.id,e.source.name),text:a(e.id,e.source.text)};if(e.source.type==="resource")return{...e.source,clientName:s("file-client",e.id,e.source.clientName),uri:s("file-uri",e.id,e.source.uri),text:a(e.id,e.source.text)};return{...e.source,path:s("file-path",e.id,e.source.path),text:a(e.id,e.source.text)}}function h(e){return{...e,url:s("file-url",e.id,e.url),filename:e.filename===void 0?void 0:s("file-name",e.id,e.filename),source:I(e)}}function $(e){switch(e.type){case"text":return{...e,text:s("text",e.id,e.text),metadata:o("text-metadata",e.id,e.metadata)};case"reasoning":return{...e,text:s("reasoning",e.id,e.text),metadata:o("reasoning-metadata",e.id,e.metadata)};case"file":return h(e);case"subtask":return{...e,prompt:s("subtask-prompt",e.id,e.prompt),description:s("subtask-description",e.id,e.description),command:e.command===void 0?void 0:s("subtask-command",e.id,e.command)};case"tool":return{...e,metadata:o("tool-metadata",e.id,e.metadata),state:e.state.status==="pending"?{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,raw:s("tool-raw",e.id,e.state.raw)}:e.state.status==="running"?{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,title:e.state.title===void 0?void 0:s("tool-title",e.id,e.state.title),metadata:o("tool-state-metadata",e.id,e.state.metadata)}:e.state.status==="completed"?{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,output:s("tool-output",e.id,e.state.output),title:s("tool-title",e.id,e.state.title),metadata:o("tool-state-metadata",e.id,e.state.metadata)??e.state.metadata,attachments:e.state.attachments?.map(h)}:{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,metadata:o("tool-state-metadata",e.id,e.state.metadata)}};case"patch":return{...e,hash:s("patch",e.id,e.hash),files:e.files.map((t,i)=>s("patch-file",`${e.id}-${i}`,t))};case"snapshot":return{...e,snapshot:s("snapshot",e.id,e.snapshot)};case"step-start":return{...e,snapshot:e.snapshot===void 0?void 0:s("snapshot",e.id,e.snapshot)};case"step-finish":return{...e,snapshot:e.snapshot===void 0?void 0:s("snapshot",e.id,e.snapshot)};case"agent":return{...e,source:!e.source?e.source:{...e.source,value:s("agent-source",e.id,e.source.value)}};default:return e}}var D=$;function P(e){return{info:{...e.info,title:s("session-title",e.info.id,e.info.title),directory:s("session-directory",e.info.id,e.info.directory),summary:!e.info.summary?e.info.summary:{...e.info.summary,diffs:l("session-diff",e.info.summary.diffs)},revert:!e.info.revert?e.info.revert:{...e.info.revert,snapshot:e.info.revert.snapshot===void 0?void 0:s("revert-snapshot",e.info.id,e.info.revert.snapshot),diff:e.info.revert.diff===void 0?void 0:s("revert-diff",e.info.id,e.info.revert.diff)}},messages:e.messages.map((t)=>({info:t.info.role==="user"?{...t.info,system:t.info.system===void 0?void 0:s("system",t.info.id,t.info.system),summary:!t.info.summary?t.info.summary:{...t.info.summary,title:t.info.summary.title===void 0?void 0:s("summary-title",t.info.id,t.info.summary.title),body:t.info.summary.body===void 0?void 0:s("summary-body",t.info.id,t.info.summary.body),diffs:l("message-diff",t.info.summary.diffs)}}:{...t.info,path:{cwd:s("cwd",t.info.id,t.info.path.cwd),root:s("root",t.info.id,t.info.path.root)}},parts:t.parts.map(D)}))}}var A=g({command:"export [sessionID]",describe:"export session data as JSON",builder:(e)=>{return e.positional("sessionID",{describe:"session id to export",type:"string"}).option("sanitize",{describe:"redact sensitive transcript and file data",type:"boolean"})},handler:async(e)=>{await p(process.cwd(),async()=>{let t=e.sessionID?y.make(e.sessionID):void 0;if(process.stderr.write(`Exporting session: ${t??"latest"}
3
- `),!t){r.empty(),v("Export session",{output:process.stderr});let i=[];for await(let n of f.list())i.push(n);if(i.length===0){w.error("No sessions found",{output:process.stderr}),c("Done",{output:process.stderr});return}i.sort((n,d)=>d.time.updated-n.time.updated);let u=await b({message:"Select session to export",maxItems:10,options:i.map((n)=>({label:n.title,value:n.id,hint:`${new Date(n.time.updated).toLocaleString()} \u2022 ${n.id.slice(-8)}`})),output:process.stderr});if(x(u))throw new r.CancelledError;t=u,c("Exporting session...",{output:process.stderr})}try{let i=await m.runPromise(f.Service.use((d)=>d.get(t))),u=await m.runPromise(f.Service.use((d)=>d.messages({sessionID:i.id,agentID:"*"}))),n={info:i,messages:u};process.stdout.write(JSON.stringify(e.sanitize?P(n):n,null,2)),process.stdout.write(S)}catch{r.error(`Session not found: ${t}`),process.exit(1)}})}});export{A as ExportCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{mg as a,ng as b,og as c}from"./chunk-0csy9x1n.js";import"./chunk-wmaz57f6.js";import"./chunk-hg0etbkx.js";import"./chunk-za63b5mc.js";import"./chunk-j8q252w3.js";import"./chunk-nj4d554m.js";import"./chunk-1hmq2fpt.js";import"./chunk-y370dqf3.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-8eje5baf.js";import"./chunk-xqdrr7xg.js";import"./chunk-6b196wjz.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-wwgd4rzx.js";import"./chunk-qc3ce3vc.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-vkqzmzpw.js";import"./chunk-x9s90xd1.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{i as P,j as g,k as b,l as h,m as O}from"./chunk-1pg6pv0m.js";import"./chunk-x66ycpfs.js";import"./chunk-03xppy47.js";import{Rd as u}from"./chunk-yajd975f.js";import{Vf as s}from"./chunk-p9cnzxb8.js";import{gh as f}from"./chunk-28cm7m3t.js";import"./chunk-w9nzsd3w.js";import{ai as E}from"./chunk-zfcp509b.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-md8161zd.js";import"./chunk-yk97q51d.js";import{$j as p,_j as S}from"./chunk-wmaz57f6.js";import"./chunk-hg0etbkx.js";import"./chunk-za63b5mc.js";import"./chunk-j8q252w3.js";import"./chunk-nj4d554m.js";import"./chunk-1hmq2fpt.js";import"./chunk-y370dqf3.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-8eje5baf.js";import"./chunk-xqdrr7xg.js";import"./chunk-6b196wjz.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-wwgd4rzx.js";import"./chunk-qc3ce3vc.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-vkqzmzpw.js";import"./chunk-x9s90xd1.js";import"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import{wA as I}from"./chunk-wfd5h6ax.js";import{OI as l,TC as d,iE as D}from"./chunk-a0rp7gh4.js";import"./chunk-kfmz2p27.js";import"./chunk-ee23d2nz.js";import"./chunk-3k2b05fv.js";var A=(o)=>l.promise(()=>E(o)),m=(o)=>l.sync(()=>s.println(o)),v=(o)=>s.Style.TEXT_DIM+o+s.Style.TEXT_NORMAL,L=(o)=>o?v(" (active)"):"",w=(o,e)=>`${o.email} ${v(o.url)}${L(e)}`,x=(o,e,t)=>`${e.name} (${o.email})${L(t)}`,C=(o,e,t)=>{let n=t?s.Style.TEXT_SUCCESS+"\u25CF"+s.Style.TEXT_NORMAL:" ",c=t?s.Style.TEXT_HIGHLIGHT_BOLD+e.name+s.Style.TEXT_NORMAL:e.name;return` ${n} ${c} ${v(o.email)} ${v(o.url)} ${v(e.id)}`},T=(o,e)=>d.isSome(o)&&o.value.id===e.accountID&&o.value.active_org_id===e.orgID,_=l.fn("login")(function*(o){let e=yield*p.Service;yield*P("Log in");let t=yield*e.login(o);yield*b.info("Go to: "+t.url),yield*b.info("Enter code: "+t.user),yield*A(t.url);let n=O();yield*n.start("Waiting for authorization...");let c=(r)=>l.gen(function*(){yield*l.sleep(r);let i=yield*e.poll(t);if(i._tag==="PollPending")return yield*c(r);if(i._tag==="PollSlow")return yield*c(D.sum(r,D.seconds(5)));return i}),a=yield*c(t.interval).pipe(l.timeout(t.expiry),l.catchTag("TimeoutError",()=>l.succeed(new S)));yield*I.valueTags(a,{PollSuccess:(r)=>l.gen(function*(){yield*n.stop("Logged in as "+r.email),yield*g("Done")}),PollExpired:()=>n.stop("Device code expired",1),PollDenied:()=>n.stop("Authorization denied",1),PollError:(r)=>n.stop("Error: "+String(r.cause),1),PollPending:()=>n.stop("Unexpected state",1),PollSlow:()=>n.stop("Unexpected state",1)})}),N=l.fn("logout")(function*(o){let e=yield*p.Service,t=yield*e.list();if(t.length===0)return yield*m("Not logged in");if(o){let i=t.find((y)=>y.email===o);if(!i)return yield*m("Account not found: "+o);yield*e.remove(i.id),yield*g("Logged out from "+o);return}let n=yield*e.active(),c=d.map(n,(i)=>i.id);yield*P("Log out");let a=t.map((i)=>{let y=d.isSome(c)&&c.value===i.id;return{value:i,label:w(i,y)}}),r=yield*h({message:"Select account to log out",options:a});if(d.isNone(r))return;yield*e.remove(r.value.id),yield*g("Logged out from "+r.value.email)}),$=l.fn("switch")(function*(){let o=yield*p.Service,e=yield*o.orgsByAccount();if(e.length===0)return yield*m("Not logged in");let t=yield*o.active(),n=e.flatMap((r)=>r.orgs.map((i)=>{let y=T(t,{accountID:r.account.id,orgID:i.id});return{value:{orgID:i.id,accountID:r.account.id,label:i.name},label:x(r.account,i,y)}}));if(n.length===0)return yield*m("No orgs found");yield*P("Switch org");let c=yield*h({message:"Select org",options:n});if(d.isNone(c))return;let a=c.value;yield*o.use(a.accountID,d.some(a.orgID)),yield*g("Switched to "+a.label)}),R=l.fn("orgs")(function*(){let o=yield*p.Service,e=yield*o.orgsByAccount();if(e.length===0)return yield*m("No accounts found");if(!e.some((n)=>n.orgs.length>0))return yield*m("No orgs found");let t=yield*o.active();for(let n of e)for(let c of n.orgs){let a=T(t,{accountID:n.account.id,orgID:c.id});yield*m(C(n.account,c,a))}}),M=l.fn("open")(function*(){let e=yield*(yield*p.Service).active();if(d.isNone(e))return yield*m("No active account");let t=e.value.url;yield*A(t),yield*g("Opened "+t)}),X=u({command:"login <url>",describe:!1,builder:(o)=>o.positional("url",{describe:"server URL",type:"string",demandOption:!0}),async handler(o){s.empty(),await f.runPromise(_(o.url))}}),B=u({command:"logout [email]",describe:!1,builder:(o)=>o.positional("email",{describe:"account email to log out from",type:"string"}),async handler(o){s.empty(),await f.runPromise(N(o.email))}}),U=u({command:"switch",describe:!1,async handler(){s.empty(),await f.runPromise($())}}),G=u({command:"orgs",describe:!1,async handler(){s.empty(),await f.runPromise(R())}}),H=u({command:"open",describe:!1,async handler(){s.empty(),await f.runPromise(M())}}),Y=u({command:"console",describe:!1,builder:(o)=>o.command({...X,describe:"log in to console"}).command({...B,describe:"log out from console"}).command({...U,describe:"switch active org"}).command({...G,describe:"list orgs"}).command({...H,describe:"open active console account"}).demandCommand(),async handler(){}});export{C as formatOrgLine,w as formatAccountLabel,U as SwitchCommand,G as OrgsCommand,H as OpenCommand,B as LogoutCommand,X as LoginCommand,Y as ConsoleCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Rd as b}from"./chunk-yajd975f.js";import{Vf as t}from"./chunk-p9cnzxb8.js";import{gh as u}from"./chunk-28cm7m3t.js";import"./chunk-w9nzsd3w.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{rl as y,yk as m}from"./chunk-wmaz57f6.js";import{Pl as v}from"./chunk-hg0etbkx.js";import{lm as a}from"./chunk-za63b5mc.js";import"./chunk-j8q252w3.js";import"./chunk-nj4d554m.js";import"./chunk-1hmq2fpt.js";import"./chunk-y370dqf3.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-8eje5baf.js";import"./chunk-xqdrr7xg.js";import"./chunk-6b196wjz.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-wwgd4rzx.js";import"./chunk-qc3ce3vc.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-vkqzmzpw.js";import"./chunk-x9s90xd1.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{OI as s}from"./chunk-a0rp7gh4.js";import"./chunk-kfmz2p27.js";import"./chunk-ee23d2nz.js";import"./chunk-3k2b05fv.js";import{EOL as f}from"os";var M=b({command:"models [provider]",describe:"list all available models",builder:(r)=>{return r.positional("provider",{describe:"provider ID to filter models by",type:"string",array:!1}).option("verbose",{describe:"use more verbose model output (includes metadata like costs)",type:"boolean"}).option("refresh",{describe:"refresh the models cache from models.dev",type:"boolean"})},handler:async(r)=>{if(r.refresh)await v.refresh(!0),t.println(t.Style.TEXT_SUCCESS_BOLD+"Models cache refreshed"+t.Style.TEXT_NORMAL);await a.provide({directory:process.cwd(),async fn(){await u.runPromise(s.gen(function*(){let n=yield*(yield*y.Service).list(),l=(e,o)=>{let i=n[e],d=Object.entries(i.models).sort(([c],[p])=>c.localeCompare(p));for(let[c,p]of d)if(process.stdout.write(`${e}/${c}`),process.stdout.write(f),o)process.stdout.write(JSON.stringify(p,null,2)),process.stdout.write(f)};if(r.provider){let e=m.make(r.provider);if(!n[e]){yield*s.sync(()=>t.error(`Provider not found: ${r.provider}`));return}yield*s.sync(()=>l(e,r.verbose));return}let h=Object.keys(n).sort((e,o)=>{let i=e.startsWith("opencode"),d=o.startsWith("opencode");if(i&&!d)return-1;if(!i&&d)return 1;return e.localeCompare(o)});yield*s.sync(()=>{for(let e of h)l(m.make(e),r.verbose)})}))}})}});export{M as ModelsCommand};
@@ -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-5vzrn6za.js";import"./chunk-1hmq2fpt.js";import"./chunk-y370dqf3.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-qc3ce3vc.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-kv72hxkp.js";import"./chunk-x9s90xd1.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,3 +0,0 @@
1
- // @bun
2
- import{Cs as pJ,Ds as iJ,Es as nJ,Fs as aJ,Gs as rJ,Is as AQ,ps as mJ,qs as vJ,rs as dJ,ss as lJ,vs as d,ws as l,ys as uJ,zs as cJ}from"./chunk-6p94fpbn.js";import{Xt as FQ,ou as x,st as CQ,tt as DQ,xu as GJ}from"./chunk-x9s90xd1.js";import{AI as E,CH as hJ,CM as o,DG as DJ,EG as FJ,FG as AJ,FI as yJ,GI as bJ,HP as g,IF as BQ,IP as eJ,JF as wQ,LD as $Q,LH as jJ,LP as HQ,MC as wJ,MF as $J,MP as WQ,NF as UJ,NP as R,OI as I,PC as HJ,RG as t,RH as NJ,SC as WJ,SF as zJ,SG as OJ,TD as f,UG as y,ZD as IJ,aE as PJ,aI as kJ,aK as gJ,bG as ZJ,dE as T,eI as LJ,fH as TJ,gC as tJ,gE as KJ,hI as SJ,lG as z,lI as xJ,lM as j,mF as qQ,mH as EJ,pI as fJ,qH as MJ,rG as b,tF as _J,tG as CJ,tH as oJ,vD as GQ,xH as RJ,zH as VJ}from"./chunk-a0rp7gh4.js";import{_P as zQ,aQ as u,cQ as S}from"./chunk-3k2b05fv.js";var IX={};u(IX,{resource:()=>BJ,layer:()=>EQ,enabled:()=>OQ,Observability:()=>WX});var p={};u(p,{make:()=>IQ,layer:()=>ZX});var VQ=AJ.pipe(FJ,DJ((J)=>{if(lJ(J)&&J.reason._tag==="StatusCodeError"&&J.reason.response.status===429){let Q=HJ(J.reason.response.headers["retry-after"]).pipe(WJ(CJ),wJ(()=>5));return t(T(Q))}return t(T(1))})),sJ=E(function*(J){let Q=yield*jJ(),X=f(Q,b),Y=f(Q,UJ),$=fJ(Q),G=KJ(IJ(J.exportInterval),PJ),B=void 0,C=nJ(f(Q,pJ)).pipe(iJ(NJ(rJ,!1)),aJ({schedule:VQ,times:3})),V=vJ({"user-agent":`effect-opentelemetry-${J.label}/0.0.0`});if(J.headers)V=dJ(mJ(J.headers),V);let r=uJ(J.url,{headers:V}),O=[],s=OJ(()=>{if(B!==void 0&&X.currentTimeMillisUnsafe()<B)return y;else if(B!==void 0)B=void 0;let h=O;if(J.maxBatchSize!=="disabled"){if(O.length===0)return y;O=[]}return C.execute(cJ(r,J.body(h))).pipe(EJ,SJ(!1))}).pipe(MJ((h)=>{if(B!==void 0)return y;return B=X.currentTimeMillisUnsafe()+60000,O=[],yJ("Disabling exporter for 60 seconds",h)}),bJ({package:"@effect/opentelemetry",module:J.label}));return yield*zJ(Y,s.pipe(RJ,kJ,VJ(J.shutdownTimeout))),yield*hJ(G).pipe(TJ(s),LJ,xJ(Y)),{push(h){if(B!==void 0)return;if(O.push(h),J.maxBatchSize!=="disabled"&&O.length>=J.maxBatchSize)gJ($(s),Y)}}});var jQ=(J)=>{let Q=J.attributes?e(Object.entries(J.attributes)):[];if(Q.push({key:"service.name",value:{stringValue:J.serviceName}}),J.serviceVersion)Q.push({key:"service.version",value:{stringValue:J.serviceVersion}});return{attributes:Q,droppedAttributesCount:0}},JQ=E(function*(J){let Q={...yield*g(o(eJ(j,j)),"OTEL_RESOURCE_ATTRIBUTES"),...J?.attributes},X=J?.serviceName??Q["service.name"]??(yield*g(j,"OTEL_SERVICE_NAME"));delete Q["service.name"];let Y=J?.serviceVersion??Q["service.version"]??(yield*g(o(j),"OTEL_SERVICE_VERSION"));return delete Q["service.version"],jQ({serviceName:X,serviceVersion:Y,attributes:Q})},oJ),QQ=(J)=>{let Q=J.attributes.find((X)=>X.key==="service.name");if(!Q||!Q.value.stringValue)throw Error("Resource does not contain a service name");return Q.value.stringValue},e=(J)=>{let Q=[];for(let[X,Y]of J)Q.push({key:X,value:m(Y)});return Q},m=(J)=>{if(Array.isArray(J))return{arrayValue:{values:J.map(m)}};switch(typeof J){case"string":return{stringValue:J};case"bigint":return{intValue:Number(J)};case"number":return Number.isInteger(J)?{intValue:J}:{doubleValue:J};case"boolean":return{boolValue:J};default:return{stringValue:tJ(J)}}};var c={};u(c,{layerProtobuf:()=>YX,layerJson:()=>XX,OtlpSerialization:()=>M});var N={Varint:0,Fixed64:1,LengthDelimited:2,Fixed32:5},k=(J,Q)=>J<<3|Q,D=(J)=>{let Q=[],X=typeof J==="bigint"?J:BigInt(J);while(X>0x7fn)Q.push(Number(X&0x7fn)|128),X>>=7n;return Q.push(Number(X)),new Uint8Array(Q)};var kQ=(J)=>{let Q=new Uint8Array(8);return new DataView(Q.buffer).setBigUint64(0,J,!0),Q},LQ=(J)=>{let Q=new Uint8Array(4);return new DataView(Q.buffer).setUint32(0,J,!0),Q},SQ=(J)=>{let Q=new Uint8Array(8);return new DataView(Q.buffer).setFloat64(0,J,!0),Q},xQ=(J)=>new TextEncoder().encode(J),fQ=(J)=>{let Q=new Uint8Array(J.length/2);for(let X=0;X<J.length;X+=2)Q[X/2]=parseInt(J.slice(X,X+2),16);return Q},Z=(...J)=>{let Q=J.reduce(($,G)=>$+G.length,0),X=new Uint8Array(Q),Y=0;for(let $ of J)X.set($,Y),Y+=$.length;return X},q=(J,Q)=>Z(D(k(J,N.Varint)),D(Q));var JJ=(J,Q)=>q(J,Q?1:0),W=(J,Q)=>Z(D(k(J,N.Fixed64)),kQ(Q)),v=(J,Q)=>Z(D(k(J,N.Fixed32)),LQ(Q)),F=(J,Q)=>Z(D(k(J,N.Fixed64)),SQ(Q)),L=(J,Q)=>Z(D(k(J,N.LengthDelimited)),D(Q.length),Q),K=(J,Q)=>L(J,xQ(Q)),U=(J,Q)=>L(J,fQ(Q)),w=(J,Q)=>L(J,Q),_=(J,Q,X)=>Z(...Q.map((Y)=>w(J,X(Y))));var H=(J,Q)=>Q!==void 0&&Q!==""?K(J,Q):new Uint8Array(0);var QJ=(J)=>{if(J.stringValue!==void 0&&J.stringValue!==null)return K(1,J.stringValue);if(J.boolValue!==void 0&&J.boolValue!==null)return JJ(2,J.boolValue);if(J.intValue!==void 0&&J.intValue!==null)return q(3,BigInt(J.intValue));if(J.doubleValue!==void 0&&J.doubleValue!==null)return F(4,J.doubleValue);if(J.arrayValue!==void 0)return w(5,bQ(J.arrayValue));if(J.kvlistValue!==void 0)return w(6,gQ(J.kvlistValue));if(J.bytesValue!==void 0)return L(7,J.bytesValue);return new Uint8Array(0)},bQ=(J)=>_(1,J.values,QJ),gQ=(J)=>_(1,J.values,P),P=(J)=>Z(K(1,J.key),w(2,QJ(J.value))),XJ=(J)=>Z(K(1,J.name),H(2,J.version),J.attributes?_(3,J.attributes,P):new Uint8Array(0),J.droppedAttributesCount?q(4,J.droppedAttributesCount):new Uint8Array(0)),YJ=(J)=>Z(_(1,J.attributes,P),J.droppedAttributesCount>0?q(2,J.droppedAttributesCount):new Uint8Array(0));var mQ=(J)=>Z(H(2,J.message),q(3,J.code)),vQ=(J)=>Z(W(1,BigInt(J.timeUnixNano)),K(2,J.name),_(3,J.attributes,P),J.droppedAttributesCount>0?q(4,J.droppedAttributesCount):new Uint8Array(0)),dQ=(J)=>Z(U(1,J.traceId),U(2,J.spanId),H(3,J.traceState),_(4,J.attributes,P),J.droppedAttributesCount>0?q(5,J.droppedAttributesCount):new Uint8Array(0),J.flags!==void 0?v(6,J.flags):new Uint8Array(0)),lQ=(J)=>Z(U(1,J.traceId),U(2,J.spanId),H(3,J.traceState),J.parentSpanId!==void 0?U(4,J.parentSpanId):new Uint8Array(0),K(5,J.name),q(6,J.kind),W(7,BigInt(J.startTimeUnixNano)),W(8,BigInt(J.endTimeUnixNano)),_(9,J.attributes,P),J.droppedAttributesCount>0?q(10,J.droppedAttributesCount):new Uint8Array(0),_(11,J.events,vQ),J.droppedEventsCount>0?q(12,J.droppedEventsCount):new Uint8Array(0),_(13,J.links,dQ),J.droppedLinksCount>0?q(14,J.droppedLinksCount):new Uint8Array(0),w(15,mQ(J.status)),J.flags!==void 0?v(16,J.flags):new Uint8Array(0)),uQ=(J)=>Z(w(1,XJ(J.scope)),_(2,J.spans,lQ),H(3,J.schemaUrl)),cQ=(J)=>Z(w(1,YJ(J.resource)),_(2,J.scopeSpans,uQ),H(3,J.schemaUrl)),XQ=(J)=>_(1,J.resourceSpans,cQ);var YQ=(J)=>Z(W(2,BigInt(J.startTimeUnixNano)),W(3,BigInt(J.timeUnixNano)),J.asDouble!==void 0?F(4,J.asDouble):new Uint8Array(0),J.asInt!==void 0?W(6,BigInt(J.asInt)):new Uint8Array(0),_(7,J.attributes,P),J.flags!==void 0?q(8,J.flags):new Uint8Array(0)),pQ=(J)=>{let Q=Z(...J.bucketCounts.map((Y)=>W(6,BigInt(Y)))),X=Z(...J.explicitBounds.map((Y)=>F(7,Y)));return Z(W(2,BigInt(J.startTimeUnixNano)),W(3,BigInt(J.timeUnixNano)),W(4,BigInt(J.count)),J.sum!==void 0?F(5,J.sum):new Uint8Array(0),Q,X,_(9,J.attributes,P),J.flags!==void 0?q(10,J.flags):new Uint8Array(0),J.min!==void 0?F(11,J.min):new Uint8Array(0),J.max!==void 0?F(12,J.max):new Uint8Array(0))},iQ=(J)=>_(1,J.dataPoints,YQ),nQ=(J)=>Z(_(1,J.dataPoints,YQ),q(2,J.aggregationTemporality),JJ(3,J.isMonotonic)),aQ=(J)=>Z(_(1,J.dataPoints,pQ),q(2,J.aggregationTemporality)),rQ=(J)=>Z(K(1,J.name),H(2,J.description),H(3,J.unit),J.gauge!==void 0?w(5,iQ(J.gauge)):new Uint8Array(0),J.sum!==void 0?w(7,nQ(J.sum)):new Uint8Array(0),J.histogram!==void 0?w(9,aQ(J.histogram)):new Uint8Array(0)),sQ=(J)=>Z(w(1,XJ(J.scope)),_(2,J.metrics,rQ),H(3,J.schemaUrl)),tQ=(J)=>Z(w(1,YJ(J.resource)),_(2,J.scopeMetrics,sQ),H(3,J.schemaUrl)),ZQ=(J)=>_(1,J.resourceMetrics,tQ);var oQ=(J)=>Z(W(1,BigInt(J.timeUnixNano)),J.severityNumber!==void 0?q(2,J.severityNumber):new Uint8Array(0),H(3,J.severityText),J.body!==void 0?w(5,QJ(J.body)):new Uint8Array(0),_(6,J.attributes,P),J.droppedAttributesCount!==void 0&&J.droppedAttributesCount>0?q(7,J.droppedAttributesCount):new Uint8Array(0),J.flags!==void 0?v(8,J.flags):new Uint8Array(0),J.traceId!==void 0&&J.traceId!==""?U(9,J.traceId):new Uint8Array(0),J.spanId!==void 0&&J.spanId!==""?U(10,J.spanId):new Uint8Array(0),J.observedTimeUnixNano!==void 0?W(11,BigInt(J.observedTimeUnixNano)):new Uint8Array(0)),eQ=(J)=>Z(w(1,XJ(J.scope)),_(2,J.logRecords,oQ),H(3,J.schemaUrl)),JX=(J)=>Z(w(1,YJ(J.resource)),_(2,J.scopeLogs,eQ),H(3,J.schemaUrl)),_Q=(J)=>_(1,J.resourceLogs,JX);class M extends $Q()("effect/observability/OtlpSerialization"){}var XX=ZJ(M,{traces:(J)=>l(J),metrics:(J)=>l(J),logs:(J)=>l(J)}),YX=ZJ(M,{traces:(J)=>d(XQ(J),"application/x-protobuf"),metrics:(J)=>d(ZQ(J),"application/x-protobuf"),logs:(J)=>d(_Q(J),"application/x-protobuf")});var IQ=E(function*(J){let Q=yield*M,X=yield*JQ(J.resource),Y={name:QQ(X)},$=yield*sJ({label:"OtlpLogger",url:J.url,headers:J.headers,maxBatchSize:J.maxBatchSize??1000,exportInterval:J.exportInterval??T(1),body:(B)=>Q.logs({resourceLogs:[{resource:X,scopeLogs:[{scope:Y,logRecords:B}]}]}),shutdownTimeout:J.shutdownTimeout??T(3)}),G={excludeLogSpans:J.excludeLogSpans??!1,clock:yield*b};return HQ((B)=>{$.push(_X(B,G))})}),ZX=(J)=>WQ([IQ(J)],{mergeWithExisting:J.mergeWithExisting??!0}),_X=(J,Q)=>{let Y=Q.clock.currentTimeNanosUnsafe().toString(),$=J.date.getTime(),G=e(Object.entries(J.fiber.getRef(BQ)));if(G.push({key:"fiberId",value:{intValue:J.fiber.id}}),!Q.excludeLogSpans)for(let[V,r]of J.fiber.getRef(wQ))G.push({key:`logSpan.${V}`,value:{stringValue:`${$-r}ms`}});if(J.cause.reasons.length>0)G.push({key:"log.error",value:{stringValue:qQ(J.cause)}});let B=GQ(J.message),C={severityNumber:$X(J.logLevel),severityText:J.logLevel,timeUnixNano:Y,observedTimeUnixNano:Y,attributes:G,body:m(B.length===1?B[0]:B),droppedAttributesCount:0};if(J.fiber.currentSpan)C.traceId=J.fiber.currentSpan.traceId,C.spanId=J.fiber.currentSpan.spanId;return C},$X=(J)=>{switch(J){case"Trace":return A.SEVERITY_NUMBER_TRACE;case"Debug":return A.SEVERITY_NUMBER_DEBUG;case"Info":return A.SEVERITY_NUMBER_INFO;case"Warn":return A.SEVERITY_NUMBER_WARN;case"Error":return A.SEVERITY_NUMBER_ERROR;case"Fatal":return A.SEVERITY_NUMBER_FATAL;default:return A.SEVERITY_NUMBER_UNSPECIFIED}},A={SEVERITY_NUMBER_UNSPECIFIED:0,SEVERITY_NUMBER_TRACE:1,SEVERITY_NUMBER_TRACE2:2,SEVERITY_NUMBER_TRACE3:3,SEVERITY_NUMBER_TRACE4:4,SEVERITY_NUMBER_DEBUG:5,SEVERITY_NUMBER_DEBUG2:6,SEVERITY_NUMBER_DEBUG3:7,SEVERITY_NUMBER_DEBUG4:8,SEVERITY_NUMBER_INFO:9,SEVERITY_NUMBER_INFO2:10,SEVERITY_NUMBER_INFO3:11,SEVERITY_NUMBER_INFO4:12,SEVERITY_NUMBER_WARN:13,SEVERITY_NUMBER_WARN2:14,SEVERITY_NUMBER_WARN3:15,SEVERITY_NUMBER_WARN4:16,SEVERITY_NUMBER_ERROR:17,SEVERITY_NUMBER_ERROR2:18,SEVERITY_NUMBER_ERROR3:19,SEVERITY_NUMBER_ERROR4:20,SEVERITY_NUMBER_FATAL:21,SEVERITY_NUMBER_FATAL2:22,SEVERITY_NUMBER_FATAL3:23,SEVERITY_NUMBER_FATAL4:24};var UQ={};u(UQ,{logger:()=>n,layer:()=>qJ,create:()=>KQ});var GX=(J)=>J==="sessionID"?"session.id":J,PQ=(J)=>Object.fromEntries(Object.entries(J??{}).filter((Q)=>Q[1]!==void 0&&Q[1]!==null).map(([Q,X])=>[GX(Q),X])),qX=(J)=>{if(Array.isArray(J))return J.map((Q)=>String(Q)).join(" ");return J===void 0?"":String(J)},i=(J,Q,X,Y)=>{let $=PQ({...Q,...Y}),G=J(X);return Object.keys($).length?I.annotateLogs(G,$):G},n=R.make((J)=>{let Q=PQ(J.fiber.getRef($J.CurrentLogAnnotations)),X=J.date.getTime();for(let[B,C]of J.fiber.getRef($J.CurrentLogSpans))Q[`logSpan.${B}`]=`${X-C}ms`;if(J.cause.reasons.length>0)Q.cause=_J.pretty(J.cause);let Y=typeof Q.service==="string"?Q.service:void 0;if(Y)delete Q.service;let $=Y?GJ.create({service:Y}):GJ.Default,G=qX(J.message);switch(J.logLevel){case"Trace":case"Debug":return $.debug(G,Q);case"Warn":return $.warn(G,Q);case"Error":case"Fatal":return $.error(G,Q);default:return $.info(G,Q)}}),qJ=R.layer([n],{mergeWithExisting:!1}),KQ=(J={})=>({debug:(Q,X)=>i((Y)=>I.logDebug(Y),J,Q,X),info:(Q,X)=>i((Y)=>I.logInfo(Y),J,Q,X),warn:(Q,X)=>i((Y)=>I.logWarning(Y),J,Q,X),error:(Q,X)=>i((Y)=>I.logError(Y),J,Q,X),with:(Q)=>KQ({...J,...Q})});var a=x.OTEL_EXPORTER_OTLP_ENDPOINT,OQ=!!a,BX=crypto.randomUUID(),TQ=x.OTEL_EXPORTER_OTLP_HEADERS?x.OTEL_EXPORTER_OTLP_HEADERS.split(",").reduce((J,Q)=>{let[X,...Y]=Q.split("=");return J[X]=Y.join("="),J},{}):void 0;function BJ(){let J=FQ("main"),Q=(()=>{let X=process.env.OTEL_RESOURCE_ATTRIBUTES;if(!X)return{};try{return Object.fromEntries(X.split(",").map((Y)=>{let $=Y.indexOf("=");if($<1)throw Error("Invalid OTEL_RESOURCE_ATTRIBUTES entry");return[decodeURIComponent(Y.slice(0,$)),decodeURIComponent(Y.slice($+1))]}))}catch{return{}}})();return{serviceName:"qitqode",serviceVersion:CQ,attributes:{...Q,"deployment.environment.name":DQ,"qitqode.client":x.QITQODE_CLIENT,"qitqode.process_role":J.processRole,"qitqode.run_id":J.runID,"service.instance.id":BX}}}function wX(){return R.layer([n,p.make({url:`${a}/v1/logs`,resource:BJ(),headers:TQ})],{mergeWithExisting:!1}).pipe(z.provide(c.layerJson),z.provide(AQ.layer))}var HX=async()=>{let J=await import("./chunk-71zw0qhf.js"),Q=await import("./chunk-891yevv2.js"),X=await import("./chunk-499gp5g5.js"),{AsyncLocalStorageContextManager:Y}=await import("./chunk-prh3c44x.js").then((m)=>zQ(m.default,1)),{context:$}=await import("./chunk-28t9akfn.js").then((m)=>zQ(m.default,1)),G=new Y;return G.enable(),$.setGlobalContextManager(G),J.layer(()=>({resource:BJ(),spanProcessor:new X.BatchSpanProcessor(new Q.OTLPTraceExporter({url:`${a}/v1/traces`,headers:TQ}))}))},EQ=!a?qJ:z.unwrap(I.gen(function*(){let J=yield*I.promise(HX);return z.mergeAll(J,wX())})),WX={enabled:OQ,layer:EQ};var aX=z.makeMemoMapUnsafe();
3
- export{qJ as js,UQ as ks,EQ as ls,WX as ms,IX as ns,aX as os};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{gs as a,hs as b,is as c}from"./chunk-wwgd4rzx.js";import"./chunk-qc3ce3vc.js";import"./chunk-6p94fpbn.js";import"./chunk-x9s90xd1.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{c as makeRuntime,a as attachWith,b as attach};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-3k2b05fv.js";var R="./libopentui-c8ye7mqw.dylib";export{R as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-3k2b05fv.js";var _="./libopentui-0r5w9btr.so";export{_ as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{a,b,c,d,e,f,g}from"./chunk-5xq3h51b.js";import"./chunk-d80hk5x9.js";import"./chunk-1pg6pv0m.js";import"./chunk-zm5dfk2b.js";import"./chunk-t9mz17gb.js";import"./chunk-x66ycpfs.js";import"./chunk-03xppy47.js";import"./chunk-yajd975f.js";import"./chunk-p9cnzxb8.js";import"./chunk-ya8g02hv.js";import"./chunk-28cm7m3t.js";import"./chunk-w9nzsd3w.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-wmaz57f6.js";import"./chunk-hg0etbkx.js";import"./chunk-za63b5mc.js";import"./chunk-j8q252w3.js";import"./chunk-nj4d554m.js";import"./chunk-1hmq2fpt.js";import"./chunk-y370dqf3.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-8eje5baf.js";import"./chunk-xqdrr7xg.js";import"./chunk-6b196wjz.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-wwgd4rzx.js";import"./chunk-qc3ce3vc.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-vkqzmzpw.js";import"./chunk-x9s90xd1.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";export{f as statusEffect,a as resolveApiKeyFlag,e as logoutEffect,d as loginEffect,c as interactiveLogin,b as apiKeyLoginEffect,g as AuthCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{cQ as t}from"./chunk-3k2b05fv.js";var e=await import("./chunk-43yv7tz1.js",{with:{type:"file"}}),a=e.default;export{a as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Cf as l}from"./chunk-dxcrggvq.js";import"./chunk-ywkvq7zb.js";import{Gg as q}from"./chunk-6y423jax.js";import"./chunk-nfg7nt13.js";import"./chunk-rv1stdvb.js";import{cQ as C}from"./chunk-3k2b05fv.js";function J(){return async(f,b)=>{if("_zod"in f)return l()(f,{components:b.components,options:{io:"input",...b.options}});try{let{createSchema:w}=await import("./chunk-dffhkd30.js"),{schema:B,components:k}=w(f,{schemaType:"input",...b.options});if(k)b.components.schemas={...b.components.schemas,...k};return B}catch{throw Error(q('Missing dependencies "zod-openapi v4".'))}}}export{J as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Vd as a,Wd as b}from"./chunk-d00c1k9w.js";import"./chunk-wgk7ynt3.js";import"./chunk-41v0x1jk.js";import"./chunk-a3a1trap.js";import"./chunk-3k2b05fv.js";export{a as fromWebToken,b as fromTokenFile};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Lr as a,Mr as b,Nr as c}from"./chunk-n96tvjgj.js";import"./chunk-pkc4ddw1.js";import"./chunk-3k2b05fv.js";export{a as openApp,c as default,b as apps};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-3k2b05fv.js";var L="./libopentui-430t0qv0.dylib";export{L as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-3k2b05fv.js";var a="./highlights-x6tmsnaa.scm";export{a as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{xd as a}from"./chunk-zfd70p01.js";import"./chunk-bzgj60w4.js";import"./chunk-3k2b05fv.js";export{a as dict};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{if as a}from"./chunk-08f4khsw.js";import"./chunk-3k2b05fv.js";export default a();
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{pu as a,qu as b,ru as c,su as d,tu as e,uu as f,vu as g,wu as h}from"./chunk-x9s90xd1.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{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"./chunk-3k2b05fv.js";var r="./highlights-eq9cgrbb.scm";export{r as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{mu as a,nu as b}from"./chunk-x9s90xd1.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 Path,b as Global};
@@ -1,5 +0,0 @@
1
- // @bun
2
- import{pt as w}from"./chunk-kv72hxkp.js";import{rt as z}from"./chunk-vkqzmzpw.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{yd as a}from"./chunk-j5ymkhry.js";import"./chunk-bzgj60w4.js";import"./chunk-3k2b05fv.js";export{a as dict};
@@ -1,3 +0,0 @@
1
- // @bun
2
- function E(j,z){let C={sub:j.sub,name:j.name,email:j.email,expires_at:String(j.expires_at),...z.rotateRefreshToken&&j.refresh_token?{refresh_token:j.refresh_token}:{}};return{type:"api",key:j.access_token,metadata:C}}function G(j,z){return{type:"api",key:z,metadata:{method:"api-key",sub:j.sub,name:j.name,email:j.email,access_token:j.access_token,access_token_expires_at:String(j.expires_at),...j.refresh_token?{refresh_token:j.refresh_token}:{}}}}
3
- export{E as I,G as J};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Cl as a}from"./chunk-wmaz57f6.js";import"./chunk-hg0etbkx.js";import"./chunk-za63b5mc.js";import"./chunk-j8q252w3.js";import"./chunk-nj4d554m.js";import"./chunk-1hmq2fpt.js";import"./chunk-y370dqf3.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-8eje5baf.js";import"./chunk-xqdrr7xg.js";import"./chunk-6b196wjz.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-wwgd4rzx.js";import"./chunk-qc3ce3vc.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-vkqzmzpw.js";import"./chunk-x9s90xd1.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{a as Session};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-3k2b05fv.js";var t=Object.fromEntries([]);export{t as modules};
@@ -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-28cm7m3t.js";import"./chunk-w9nzsd3w.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-wmaz57f6.js";import{Fl as C}from"./chunk-hg0etbkx.js";import"./chunk-za63b5mc.js";import"./chunk-j8q252w3.js";import"./chunk-nj4d554m.js";import"./chunk-1hmq2fpt.js";import"./chunk-y370dqf3.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-8eje5baf.js";import"./chunk-xqdrr7xg.js";import"./chunk-6b196wjz.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-wwgd4rzx.js";import"./chunk-qc3ce3vc.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-vkqzmzpw.js";import{st as J}from"./chunk-x9s90xd1.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{Qr as a,Rr as b}from"./chunk-xgr6jnd6.js";import"./chunk-3k2b05fv.js";export{a as generateSecret,b as generateCodeChallengeFromVerifier};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-3k2b05fv.js";var q="./tree-sitter-powershell-ryb2ffqs.wasm";export{q as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{aq as a}from"./chunk-6b196wjz.js";import"./chunk-79agp7v3.js";import"./chunk-x9s90xd1.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{Mt as D,Ot as h,Pt as w,Qt as M,Rt as O,St as b,Tt as y}from"./chunk-x9s90xd1.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{jf as a,kf as b,lf as c,mf as d,nf as e,of as f}from"./chunk-gy0wm7e1.js";import"./chunk-z8gdmvgg.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-3k2b05fv.js";export{f as createOpenAICompatible,e as VERSION,d as OpenAICompatibleImageModel,c as OpenAICompatibleEmbeddingModel,b as OpenAICompatibleCompletionLanguageModel,a as OpenAICompatibleChatLanguageModel};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-3k2b05fv.js";var l="./tree-sitter-javascript-nd0q4pe9.wasm";export{l as default};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{nu as p,ou as f,xu as m}from"./chunk-x9s90xd1.js";import{aQ as l}from"./chunk-3k2b05fv.js";var n={};l(n,{start:()=>I,Heap:()=>n});import h from"path";import{writeHeapSnapshot as u}from"v8";var i=m.create({service:"heap"}),g=60000,d=2147483648,o,s=!1,a=!0;function I(){if(!f.QITQODE_AUTO_HEAP_SNAPSHOT)return;if(o)return;let c=async()=>{if(s)return;let e=process.memoryUsage();if(e.rss<=d){a=!0;return}if(!a)return;s=!0,a=!1;let r=h.join(p.Path.log,`heap-${process.pid}-${new Date().toISOString().replace(/[:.]/g,"")}.heapsnapshot`);i.warn("heap usage exceeded limit",{rss:e.rss,heap:e.heapUsed,file:r}),await Promise.resolve().then(()=>u(r)).catch((t)=>{i.error("failed to write heap snapshot",{error:t instanceof Error?t.message:String(t),file:r})}),s=!1};o=setInterval(()=>{c()},g),o.unref?.()}
3
- export{I as Wf,n as Xf};
@@ -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 S}from"./chunk-vkqzmzpw.js";import{ou as g,wu as VH}from"./chunk-x9s90xd1.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]",I;function R(H){return Buffer.byteLength(JSON.stringify(H),"utf8")}function o(){return g.QITQODE_QLEX_MAX_REQUEST_BYTES??I}function p(H){let J=g.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 I=I===void 0?V:Math.min(I,V),I}function b(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++,b(Z,"assistant")&&Array.isArray(Z?.tool_calls)&&Z.tool_calls.length>0)while(V<H.length&&b(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(b(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&&b(H[0],"system"))return!1;return!0})}function c(H,J){let V=R(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=()=>R(z())<=J;{let F=$;for(let L of r(F,n(F))){let j=!1;for(let q=L.start;q<L.end;q++){let Q=F[q];if(!b(Q,"tool"))continue;let k=Q?.content;if(typeof k!=="string"||k.length<OH)continue;if(k===l)continue;F[q]={...Q,content:l},X.toolResultsElided++,j=!0}if(j&&Y())break}}if(!Y())for(;;){let F=$,j=r(F,n(F))[0];if(!j)break;if($=[...F.slice(0,j.start),...F.slice(j.end)],X.unitsDropped++,Y())break}let G=z(),D=R(G);return{body:G,bytes:D,originalBytes:V,reduced:D<V&&D<=J,actions:X}}var T=VH({service:"provider.qlex"}),LH=S.streamUrl(),QH=S.omniqueryBaseUrl()+"/runOrchestrated";function M(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(S.copy().notLoggedIn);M(this,w({category:"invalid_credentials",retryable:!1},H))}}class KH extends Error{name="QlexInsufficientBalanceError";constructor(H,J){super(S.copy().insufficientBalance(H));M(this,w({status:402,category:"billing",retryable:!1},J))}}class zH extends Error{name="QlexRateLimitError";constructor(H){super(S.copy().rateLimit);M(this,w({status:429,category:"rate_limited",retryable:!0},H))}}class YH extends Error{name="QlexInvalidCredentialsError";constructor(H,J){super(S.copy().invalidCredentials(H));M(this,w({status:401,category:"invalid_credentials",retryable:!1},J))}}class DH extends Error{name="QlexRequestRejectedError";constructor(H,J,V){super(S.copy().requestRejected(H,J));M(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"?S.copy().requestTooLargeAfterReduction(J):S.copy().requestTooLargeIrreducible(J));this.stage=H,M(this,w({status:413,category:"request_too_large",retryable:!1},V))}}class WH extends Error{name="QlexRequestNotSentError";constructor(H,J){super(S.copy().requestNotSent(H));M(this,w({category:"request_rejected",retryable:!1},J))}}class B extends Error{name="QlexGatewayError";constructor(H,J){super(S.copy().gatewayUnavailable(H));M(this,w({category:"gateway_routing",retryable:!1},J))}}var SH=60000;function tH(H){return S.sanitizeUpstreamError(H)}class x extends Error{name="QlexStreamError";constructor(H,J){super(S.copy().streamFailed(H));M(this,w({category:"unknown",retryable:!1},J))}}function PH(H){return XH(H)}function MH(H,J){let V,X,Z;try{let Y=JSON.parse(J);if(Y&&typeof Y==="object"){let G=Y.error&&typeof Y.error==="object"?Y.error:void 0;if(typeof G?.code==="string")V=G.code;else if(typeof Y.code==="string")V=Y.code;if(typeof G?.message==="string")X=G.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"||PH(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 wH=new Set(["coding","agent","research","review","chat"]);function EH(H){if(H===void 0)return;if(typeof H==="string"&&wH.has(H))return H;throw Error(`invalid Qortex posture: ${String(H)}`)}function TH(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 RH="[Tool call]",CH="[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:RH}];if(K.role==="tool"&&typeof K.tool_call_id==="string"&&K.tool_call_id.trim().length>0)return[{...K,content:CH}];return J.push({index:Z,role:typeof K.role==="string"?K.role:"unknown",reason:"empty-content"}),[]}),dropped:J}}function AH(H){return NH(H).messages}function IH(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 vH(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 BH(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 xH(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(xH).join(`
8
- `),z=f(K.content),{tool_calls:Y,...G}=K;return{...G,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=BH(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 hH(){return process.env.QITQODE_TOOL_PROTOCOL==="text"?"text":"native"}function fH(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=EH(H.posture);if(Y!==void 0)z.posture=Y;let G=TH(H.directive);if(G!==void 0)z.directive=G;if(H.modelPersona!==void 0)z.modelPersona=H.modelPersona;return{tier:X,messages:vH(AH($)),opts:Z,...z}}var i=new Map;function t(H){return typeof H==="number"&&Number.isFinite(H)&&H>0?H:void 0}function yH(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 uH(H){return i.get(H)}function sH(){i.clear()}function gH(H){let J=(V)=>typeof V==="string"&&(V.startsWith("qlex")||V.startsWith("qortex"));return J(H.id)||J(H.object)}function pH(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=$,G=typeof Y.content==="string"?Y.content:typeof Y.text==="string"?Y.text:typeof Y.delta==="string"?Y.delta:void 0;if(G!==void 0)return{kind:"token",content:G};if(gH($)){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 cH(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:cH(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 mH(H,J){let V=J?.toolProtocolEnabled===!0,X=J?.tier,Z=H.getReader(),K=new TextDecoder,$=new TextEncoder,z="",Y=!1,G=!1,D,F,L;return new ReadableStream({async start(j){let q=(W)=>{let N=Y?{content:W}:{role:"assistant",content:W};Y=!0,j.enqueue($.encode(m(N,null)))},Q=0,k=V?new GH(q,(W)=>{let N={...Y?{}:{role:"assistant"},tool_calls:[{index:Q,id:`qlexcall_${Date.now().toString(36)}_${Q}`,type:"function",function:{name:W.name,arguments:W.arguments}}]};Y=!0,Q++,j.enqueue($.encode(m(N,null)))}):void 0,_=(W)=>k?k.feed(W):q(W),P=()=>{k?.flush();let W=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,N=Q>0?"tool_calls":L??"stop";j.enqueue($.encode(m({},N,W))),j.enqueue($.encode(`data: [DONE]
19
-
20
- `)),j.close(),G=!0},u=(W)=>{let N=pH(W);switch(N.kind){case"skip":return!1;case"token":return _(N.content),!1;case"passthrough":{let U=N.chunk.choices;if(Array.isArray(U)&&U[0]&&typeof U[0]==="object"){let O=U[0].finish_reason;if(typeof O==="string")L=O}return Y=!0,j.enqueue($.encode(`data: ${JSON.stringify(N.chunk)}
21
-
22
- `)),!1}case"cost":if(N.cost.final)D=N.cost;return!1;case"usage":if(N.usage.context_window!==void 0)F=N.usage.context_window;if(N.finishReason!==void 0)L=N.finishReason;return!1;case"control":{if(N.control==="tier-output-limits"){let U=N.chunk;if(X!==void 0)yH(X,U);T.debug("qlex tier output limits",{tierOutputLimit:U.tierOutputLimit,tierRecommendedStepTokens:U.tierRecommendedStepTokens,tierStepGuidance:U.tierStepGuidance})}else T.debug("qlex control frame dropped",{id:N.chunk.id,object:N.chunk.object});return!1}case"done":return P(),!0;case"error":return j.error(new x(N.message)),G=!0,!0}};try{while(!0){let{done:N,value:U}=await Z.read();if(N)break;z+=K.decode(U,{stream:!0});let O;while((O=z.indexOf(`
23
-
24
- `))!==-1){let E=z.slice(0,O);if(z=z.slice(O+2),u(E))return}}z+=K.decode();let W=z.replace(/\r?\n$/,"");if(W.length>0&&u(W))return;if(!G)P()}catch(W){if(!G)j.error(W instanceof x?W:new x(W instanceof Error?W.message:String(W)))}finally{Z.releaseLock()}},cancel(j){Z.cancel(j).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 iH(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),G=(q,Q,k)=>{let _={id:z,object:"chat.completion.chunk",created:Y,model:"orchestrated",choices:[{index:0,delta:q,finish_reason:Q}]};if(k)_.usage=k;return`data: ${JSON.stringify(_)}
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=[G({role:"assistant",content:""},null),G({content:V},null),G({},X,D),`data: [DONE]
27
-
28
- `],L=new TextEncoder,j=new ReadableStream({start(q){for(let Q of F)q.enqueue(L.encode(Q));q.close()}});return new Response(j,{status:200,headers:{"content-type":"text/event-stream"}})}function eH(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=MH(H,J),Z=J?`HTTP ${H}: ${J}`:`HTTP ${H}`;switch(T.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=R(H);if(V<=J)return H;let X=c(H,J);return T.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=R(H),V=p(J),X=c(H,V);if(!X.reduced)throw T.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 T.warn("request too large, retrying once with reduced history",{tier:H.tier,rejectedBytes:J,ceiling:V,reducedBytes:X.bytes,...X.actions,notice:S.copy().requestTooLargeRecovering()}),X.body}function JH(H){let J=R(H);throw p(J),T.error("reduced request still too large",{tier:H.tier,rejectedBytes:J}),new y("after-reduction")}function dH(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=hH(),G=uH(z.model??"default"),D=a(z,{toolMode:Y,outputAdvisory:G});if(IH(z.messages)&&!bH(D.messages)){let{dropped:W}=NH(Y==="text"?FH(z.messages,z.tools):z.messages);throw T.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:W.length,dropped:W}),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 j=new Headers($.headers);if(L.method==="api-key")j.delete("Authorization"),j.set("x-api-key",L.key);else j.delete("x-api-key"),j.set("Authorization",`Bearer ${L.key}`);if(j.set("Content-Type","application/json"),D.tier==="orchestrated"){let W=$.signal,N=async(E)=>{let C=new AbortController,A=()=>C.abort(W?.reason);if(W)if(W.aborted)C.abort(W.reason);else W.addEventListener("abort",A,{once:!0});let d=!1,_H=setTimeout(()=>{d=!0,C.abort()},Z);try{return await J(QH,{method:"POST",headers:j,body:JSON.stringify(E),signal:C.signal})}catch(UH){if(d)throw new B(`no response within ${Math.round(Z/1000)}s`);throw UH}finally{clearTimeout(_H),W?.removeEventListener("abort",A)}},U=e(D),O=await N(U);if(O.status===413){if(await O.body?.cancel().catch(()=>{}),U=HH(U),O=await N(U),O.status===413)await O.body?.cancel().catch(()=>{}),JH(U)}if(!O.ok){let E=await O.text().catch(()=>"");throw await s(O.status,E,{onInvalidCredentials:V,tier:D.tier})}return iH(await O.json())}let q=$.signal,Q=async(W)=>{let N=new AbortController,U=()=>N.abort(q?.reason);if(q)if(q.aborted)N.abort(q.reason);else q.addEventListener("abort",U,{once:!0});let O=()=>q?.removeEventListener("abort",U),E=!1,C=setTimeout(()=>{E=!0,N.abort()},Z);try{return{res:await J(LH,{method:"POST",headers:j,body:JSON.stringify(W),signal:N.signal}),detach:O}}catch(A){if(O(),E)throw new B(`no response within ${Math.round(Z/1000)}s`);throw A}finally{clearTimeout(C)}},k=e(D),{res:_,detach:P}=await Q(k);if(_.status===400&&Y==="native"&&fH(z))P(),await _.body?.cancel().catch(()=>{}),k=a(z,{toolMode:"text",outputAdvisory:G}),{res:_,detach:P}=await Q(k);if(_.status===413){if(P(),await _.body?.cancel().catch(()=>{}),k=HH(k),{res:_,detach:P}=await Q(k),_.status===413)P(),await _.body?.cancel().catch(()=>{}),JH(k)}try{if(!_.ok){let W=await _.text().catch(()=>"");throw await s(_.status,W,{onInvalidCredentials:V,tier:D.tier})}}catch(W){throw P(),W}if(z.stream!==!1&&_.body){let W=Array.isArray(z.tools)&&z.tools.length>0;return new Response(mH(_.body,{toolProtocolEnabled:W,tier:D.tier}),{status:_.status,statusText:_.statusText,headers:{"content-type":"text/event-stream"}})}return _}return J(K,$)}}function HJ(H){let J=H.getToken??(async()=>H.bearerToken),V=dH(J,globalThis.fetch,H.onInvalidCredentials);return ZH({name:H.name??"qlex",baseURL:S.streamBaseUrl(),fetch:V})}export{mH as transformQlexStream,iH as toOrchestratedSSEStream,eH as toOpenAICompletion,tH as sanitizeUpstreamProviderError,hH as resolveToolMode,BH as renderToolProtocolPrompt,yH as recordTierOutputAdvisory,cH as partialTagSuffixLength,pH as parseQlexFrame,MH as parseQlexError,NH as normalizeQlexMessagesWithReport,AH as normalizeQlexMessages,vH as mergeLeadingSystemMessages,PH as isGatewayRequiredError,IH as hasUserRoleMessage,bH as hasUsableUserMessage,fH as hasToolContext,uH as getTierOutputAdvisory,f as flattenMessageContent,FH as encodeToolProtocolMessages,HJ as createQlexProvider,dH as createCustomFetch,sH as clearTierOutputAdvisories,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{$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-x9s90xd1.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};