@qitqode/qitqode-android-arm64 0.2.7 → 0.2.8

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 (386) hide show
  1. package/bundle/{chunk-ga6wc979.js → chunk-03zpnwk2.js} +1 -1
  2. package/bundle/{chunk-qdvnscxm.js → chunk-0a4pmkc9.js} +1 -1
  3. package/bundle/chunk-0aqdzyar.js +2 -0
  4. package/bundle/{chunk-drnj1a14.js → chunk-0egrckx0.js} +1 -1
  5. package/bundle/{chunk-368jx5dp.js → chunk-0tcggtwv.js} +1 -1
  6. package/bundle/{chunk-0qpqd7nz.js → chunk-0tm6589k.js} +2 -2
  7. package/bundle/{chunk-0gsw04hw.js → chunk-0w19vmd7.js} +2 -2
  8. package/bundle/{chunk-j6xmgn63.js → chunk-0z1keh2w.js} +1 -1
  9. package/bundle/{chunk-aa2n02qk.js → chunk-1bxfzd6r.js} +2 -2
  10. package/bundle/{chunk-hrtze4c5.js → chunk-1har4t9a.js} +1 -1
  11. package/bundle/{chunk-33jcxsbe.js → chunk-1p9s5jj1.js} +1 -1
  12. package/bundle/{chunk-p40z6510.js → chunk-1v0khv7p.js} +1 -1
  13. package/bundle/{chunk-2c26kxp4.js → chunk-26cr51wa.js} +1 -1
  14. package/bundle/{chunk-eeq0krp7.js → chunk-27saej0r.js} +2 -2
  15. package/bundle/{chunk-ppy0jy6j.js → chunk-29gwtcey.js} +1 -1
  16. package/bundle/chunk-2a5gjgvp.js +2 -0
  17. package/bundle/{chunk-bn71wqqf.js → chunk-2caaqmec.js} +1 -1
  18. package/bundle/{chunk-hhk2sp5n.js → chunk-2kh0tg92.js} +1 -1
  19. package/bundle/{chunk-bd505nsd.js → chunk-2nheahmq.js} +1 -1
  20. package/bundle/chunk-2pkfphgb.js +2 -0
  21. package/bundle/{chunk-jxkrhrp0.js → chunk-2qm46qvn.js} +1 -1
  22. package/bundle/{chunk-ajp53ksp.js → chunk-2t5yh25f.js} +1 -1
  23. package/bundle/{chunk-4fy08jcj.js → chunk-2vaphpz0.js} +1 -1
  24. package/bundle/{chunk-5nhwqg7c.js → chunk-33ebjca6.js} +1 -1
  25. package/bundle/{chunk-yxttz5z5.js → chunk-35fj1sfm.js} +1 -1
  26. package/bundle/{chunk-makecdh6.js → chunk-37cbrnke.js} +5 -5
  27. package/bundle/{chunk-1vpx7szf.js → chunk-3bb4aqh9.js} +1 -1
  28. package/bundle/chunk-3cx4p07h.js +2 -0
  29. package/bundle/chunk-3f2cjzb4.js +2 -0
  30. package/bundle/chunk-3qvap1kv.js +2 -0
  31. package/bundle/{chunk-c8prg3jx.js → chunk-3va85mbe.js} +2 -2
  32. package/bundle/{chunk-wvb17w0z.js → chunk-3z2zn8rj.js} +1 -1
  33. package/bundle/{chunk-ghap1n1m.js → chunk-3zwma68w.js} +4 -4
  34. package/bundle/{chunk-abv0fskc.js → chunk-4064rbtp.js} +1 -1
  35. package/bundle/{chunk-84pjdenq.js → chunk-42hvspe7.js} +1 -1
  36. package/bundle/chunk-452tk6v3.js +2 -0
  37. package/bundle/{chunk-w3zhy5vq.js → chunk-48gap82w.js} +1 -1
  38. package/bundle/{chunk-q87fw8dk.js → chunk-4aajzxm9.js} +1 -1
  39. package/bundle/{chunk-4ftjx7ss.js → chunk-4gqb1hps.js} +1 -1
  40. package/bundle/{chunk-gww0skmn.js → chunk-4pmvxnkj.js} +1 -1
  41. package/bundle/chunk-50qgz5ka.js +2 -0
  42. package/bundle/{chunk-4zhrg3rv.js → chunk-52xvhxek.js} +1 -1
  43. package/bundle/{chunk-8hmt3avx.js → chunk-56wq8cqj.js} +1 -1
  44. package/bundle/{chunk-5r05d901.js → chunk-58f4y4b7.js} +2 -2
  45. package/bundle/{chunk-mbbxedsq.js → chunk-59csnjc3.js} +2 -2
  46. package/bundle/chunk-5b0xyq5z.js +2 -0
  47. package/bundle/{chunk-0ggvqmnm.js → chunk-5bv63rqj.js} +1 -1
  48. package/bundle/{chunk-vfb72vdy.js → chunk-5cw8235e.js} +1 -1
  49. package/bundle/{chunk-yd94wz5v.js → chunk-5f0nhthe.js} +1 -1
  50. package/bundle/chunk-5j4nxpdy.js +2 -0
  51. package/bundle/{chunk-r4kg0z96.js → chunk-5nmm1kvx.js} +1 -1
  52. package/bundle/chunk-5nxgk6hw.js +2 -0
  53. package/bundle/chunk-5qkvhr6y.js +2 -0
  54. package/bundle/{chunk-5zh91zk2.js → chunk-5r7c6vvx.js} +1 -1
  55. package/bundle/{chunk-c6cajbyj.js → chunk-5wx962mw.js} +1 -1
  56. package/bundle/{chunk-7sq5dyv1.js → chunk-5xkp27b1.js} +1 -1
  57. package/bundle/chunk-66qmmmdp.js +2 -0
  58. package/bundle/{chunk-vhzx5bxd.js → chunk-66wv82vf.js} +1 -1
  59. package/bundle/chunk-6dpdkzrk.js +2 -0
  60. package/bundle/chunk-6p6m5956.js +3 -0
  61. package/bundle/{chunk-n4qxj391.js → chunk-6ps30qax.js} +1 -1
  62. package/bundle/{chunk-gbxf6e5d.js → chunk-6qwk6z87.js} +3 -3
  63. package/bundle/{chunk-kmzpeq8k.js → chunk-6tqbnxar.js} +1 -1
  64. package/bundle/{chunk-gdew7bwm.js → chunk-6yhn9syz.js} +1 -1
  65. package/bundle/{chunk-2pex3ak9.js → chunk-72crs18f.js} +1 -1
  66. package/bundle/{chunk-mghnkwp8.js → chunk-7adsab4h.js} +1 -1
  67. package/bundle/{chunk-aqcpk2vg.js → chunk-7b60whxm.js} +1 -1
  68. package/bundle/chunk-7g59hc61.js +2 -0
  69. package/bundle/{chunk-52rdms56.js → chunk-7jy53zqy.js} +1 -1
  70. package/bundle/chunk-7p88j56s.js +2 -0
  71. package/bundle/{chunk-t4b2fm7z.js → chunk-7thhd7ds.js} +1 -1
  72. package/bundle/chunk-7trngc9g.js +2 -0
  73. package/bundle/{chunk-yjqww6ag.js → chunk-82xrfk5x.js} +2 -2
  74. package/bundle/{chunk-4fvbexr8.js → chunk-85wh85pk.js} +1 -1
  75. package/bundle/chunk-8cebbmtf.js +2 -0
  76. package/bundle/chunk-8csas2jc.js +2 -0
  77. package/bundle/chunk-8g4jdqq1.js +2 -0
  78. package/bundle/chunk-8j1xcdmd.js +2 -0
  79. package/bundle/{chunk-ntpn0w9m.js → chunk-8jmb5bd4.js} +2 -2
  80. package/bundle/{chunk-pf3nqf00.js → chunk-8ysp6vf8.js} +1 -1
  81. package/bundle/{chunk-3k7016c2.js → chunk-8yzghzjq.js} +1 -1
  82. package/bundle/{chunk-73xryfgn.js → chunk-9009v4d0.js} +2 -2
  83. package/bundle/chunk-90r2z49k.js +2 -0
  84. package/bundle/{chunk-amp6mvbp.js → chunk-92r1gw2j.js} +1 -1
  85. package/bundle/{chunk-ktp2b4t4.js → chunk-94mjwy22.js} +1 -1
  86. package/bundle/{chunk-f84hw65n.js → chunk-9cf2ktyh.js} +1 -1
  87. package/bundle/{chunk-16srrzjr.js → chunk-9cn8cmt0.js} +1 -1
  88. package/bundle/{chunk-x55h5qdc.js → chunk-a1z8rnq7.js} +3 -3
  89. package/bundle/{chunk-c3szabpf.js → chunk-a48mx917.js} +2 -2
  90. package/bundle/{chunk-prbxhnza.js → chunk-a8bjcvda.js} +1 -1
  91. package/bundle/chunk-aenrd7dk.js +2 -0
  92. package/bundle/{chunk-dw70wds9.js → chunk-afr8m0q1.js} +1 -1
  93. package/bundle/{chunk-7p6mxch0.js → chunk-ag8wxwwz.js} +1 -1
  94. package/bundle/{chunk-22qetqnp.js → chunk-ahmy80vb.js} +1 -1
  95. package/bundle/chunk-avn12jkt.js +2 -0
  96. package/bundle/{chunk-tc9xbn1t.js → chunk-ax64ngf2.js} +1 -1
  97. package/bundle/{chunk-4ngmjk8j.js → chunk-ayb3bdb7.js} +1 -1
  98. package/bundle/{chunk-0crgymtr.js → chunk-az3nss5m.js} +2 -2
  99. package/bundle/chunk-b7ncyat6.js +2 -0
  100. package/bundle/{chunk-dt1wwt7m.js → chunk-b7sr9rn3.js} +1 -1
  101. package/bundle/{chunk-9qzwmt76.js → chunk-bc2krtaf.js} +1 -1
  102. package/bundle/{chunk-0bgssfvq.js → chunk-bjv1h2dq.js} +1 -1
  103. package/bundle/{chunk-8jvfqh3b.js → chunk-bnaj2hh3.js} +1 -1
  104. package/bundle/{chunk-twvmjsxf.js → chunk-bpfq8fz4.js} +1 -1
  105. package/bundle/chunk-brk6bge4.js +3 -0
  106. package/bundle/{chunk-s06t769q.js → chunk-bwadggys.js} +1 -1
  107. package/bundle/chunk-c2a74stf.js +2 -0
  108. package/bundle/{chunk-76h0f86f.js → chunk-c3yjbent.js} +1 -1
  109. package/bundle/{chunk-spzd8rev.js → chunk-c76cjhn0.js} +1 -1
  110. package/bundle/{chunk-705xnxbc.js → chunk-ccf4pgkr.js} +1 -1
  111. package/bundle/chunk-ce5e7j62.js +2 -0
  112. package/bundle/{chunk-2bjfz4fb.js → chunk-cf9m9m9q.js} +1 -1
  113. package/bundle/{chunk-z7kswv9r.js → chunk-cfwz1hgr.js} +3 -3
  114. package/bundle/{chunk-dgva3y5v.js → chunk-cghz0855.js} +1 -1
  115. package/bundle/{chunk-a76w2jwm.js → chunk-cr5tknvb.js} +1 -1
  116. package/bundle/chunk-cw1gwjx9.js +2 -0
  117. package/bundle/chunk-czw30fjs.js +2 -0
  118. package/bundle/{chunk-x80d0zh7.js → chunk-d30k7dpf.js} +1 -1
  119. package/bundle/{chunk-x9fyt3vx.js → chunk-d839fr0w.js} +1 -1
  120. package/bundle/{chunk-n0g4983e.js → chunk-ddx2pcr4.js} +1 -1
  121. package/bundle/{chunk-4byvnx78.js → chunk-dgcannw0.js} +1 -1
  122. package/bundle/{chunk-4rpgwgx9.js → chunk-dhvx9p54.js} +1 -1
  123. package/bundle/chunk-dmkgjf1v.js +3 -0
  124. package/bundle/{chunk-z744mz4w.js → chunk-dt3bsmfe.js} +2 -2
  125. package/bundle/chunk-dwhsvpag.js +2 -0
  126. package/bundle/{chunk-4j76bf4j.js → chunk-dwkrqtbc.js} +1 -1
  127. package/bundle/chunk-e01jgnnm.js +2 -0
  128. package/bundle/chunk-e0hfpdje.js +2 -0
  129. package/bundle/{chunk-f2pv705d.js → chunk-e0vrxetq.js} +1 -1
  130. package/bundle/{chunk-59kk0mce.js → chunk-e2wfj86b.js} +1 -1
  131. package/bundle/chunk-e5jk67xh.js +2 -0
  132. package/bundle/{chunk-ae7b11np.js → chunk-eacpc64g.js} +2 -2
  133. package/bundle/{chunk-hqjc4wgg.js → chunk-eewe7tx1.js} +2 -2
  134. package/bundle/{chunk-etv6c77a.js → chunk-eg1m81ax.js} +1 -1
  135. package/bundle/chunk-eg4pq4hv.js +2 -0
  136. package/bundle/{chunk-9xxnwb33.js → chunk-ejhhrece.js} +3 -3
  137. package/bundle/{chunk-nfzpegqx.js → chunk-epmc4aht.js} +1 -1
  138. package/bundle/chunk-ew3yz97p.js +2 -0
  139. package/bundle/chunk-ezgfhy4e.js +2 -0
  140. package/bundle/{chunk-19pspc1p.js → chunk-f2v4g7t1.js} +1 -1
  141. package/bundle/chunk-f2yfyhh8.js +2 -0
  142. package/bundle/chunk-f30em1wx.js +2 -0
  143. package/bundle/{chunk-k3g28tbw.js → chunk-f81kk8ra.js} +1 -1
  144. package/bundle/{chunk-p847g35y.js → chunk-f8cae1ap.js} +1 -1
  145. package/bundle/{chunk-vp3yf46q.js → chunk-fa8pwdwv.js} +1 -1
  146. package/bundle/{chunk-dz3bec8g.js → chunk-fej5x648.js} +1 -1
  147. package/bundle/{chunk-14d301ze.js → chunk-fge37dke.js} +1 -1
  148. package/bundle/{chunk-0tqmm8b8.js → chunk-fh3d0wce.js} +1 -1
  149. package/bundle/{chunk-twd6r7nf.js → chunk-fjftb2sz.js} +1 -1
  150. package/bundle/{chunk-xhh70g8j.js → chunk-fs1vb39f.js} +2 -2
  151. package/bundle/{chunk-9g9katgy.js → chunk-ftvvm4r5.js} +2 -2
  152. package/bundle/{chunk-ptwex14s.js → chunk-fw1f47de.js} +1 -1
  153. package/bundle/{chunk-y2t5pmqw.js → chunk-g26redah.js} +1 -1
  154. package/bundle/{chunk-acd72413.js → chunk-g3n465ee.js} +1 -1
  155. package/bundle/{chunk-hfefq104.js → chunk-g4tyaj0m.js} +1 -1
  156. package/bundle/{chunk-a610qd3x.js → chunk-g6y2c5az.js} +1 -1
  157. package/bundle/{chunk-tezrgfc6.js → chunk-g7v6sp3c.js} +2 -2
  158. package/bundle/{chunk-4bewbvvr.js → chunk-g878zd6e.js} +1 -1
  159. package/bundle/{chunk-na1wr2qf.js → chunk-g9nwqwqp.js} +1 -1
  160. package/bundle/chunk-gbvm6dpv.js +2 -0
  161. package/bundle/{chunk-ns8xnkjb.js → chunk-gc5rhnht.js} +1 -1
  162. package/bundle/{chunk-q6p92zyn.js → chunk-gefx3n08.js} +1 -1
  163. package/bundle/{chunk-xcxqt8ag.js → chunk-ggncq8w8.js} +1 -1
  164. package/bundle/{chunk-gwrnxcdn.js → chunk-gsg6zn7e.js} +1 -1
  165. package/bundle/{chunk-4jpab7ag.js → chunk-gznt3dv8.js} +1 -1
  166. package/bundle/{chunk-defj5zs6.js → chunk-h1bvqstw.js} +1 -1
  167. package/bundle/{chunk-dd4qnh8s.js → chunk-h4hs2rhf.js} +1 -1
  168. package/bundle/chunk-h5w91zr4.js +2 -0
  169. package/bundle/{chunk-qp3hxqg5.js → chunk-h8mfbbjh.js} +1 -1
  170. package/bundle/{chunk-w43kmnm9.js → chunk-he9kpk9r.js} +357 -357
  171. package/bundle/chunk-hmpb3c21.js +2 -0
  172. package/bundle/{chunk-6gqs1k7m.js → chunk-hz02vrqs.js} +1 -1
  173. package/bundle/{chunk-3xdmxm5t.js → chunk-j10a984e.js} +1 -1
  174. package/bundle/chunk-j32rr7rt.js +2 -0
  175. package/bundle/chunk-j871xzr7.js +2 -0
  176. package/bundle/{chunk-kfj37631.js → chunk-jmmtcr2r.js} +1 -1
  177. package/bundle/{chunk-h7658zxy.js → chunk-jpn9zfj5.js} +1 -1
  178. package/bundle/{chunk-wgt1tqw9.js → chunk-jqj1ay7x.js} +1 -1
  179. package/bundle/{chunk-e4g4mvak.js → chunk-jr80q31w.js} +1 -1
  180. package/bundle/chunk-k3hgwszx.js +2 -0
  181. package/bundle/{chunk-k6zwfstj.js → chunk-kckr30tf.js} +1 -1
  182. package/bundle/{chunk-8rfqv5he.js → chunk-kgv68cpb.js} +1 -1
  183. package/bundle/{chunk-tkzctbxq.js → chunk-khpfseej.js} +2 -2
  184. package/bundle/{chunk-55way0em.js → chunk-kveztc6k.js} +1 -1
  185. package/bundle/{chunk-znmbfx70.js → chunk-kwfe4em6.js} +1 -1
  186. package/bundle/chunk-kx88qekb.js +2 -0
  187. package/bundle/{chunk-nbckdba0.js → chunk-m4r8sepw.js} +1 -1
  188. package/bundle/{chunk-6ychs4wx.js → chunk-m7tmgvh6.js} +1 -1
  189. package/bundle/{chunk-egkhynj5.js → chunk-makegrxs.js} +1 -1
  190. package/bundle/{chunk-438faz6b.js → chunk-mr17tppa.js} +1 -1
  191. package/bundle/{chunk-yzpc5kj2.js → chunk-mv7q6ach.js} +1 -1
  192. package/bundle/chunk-n61e0znt.js +2 -0
  193. package/bundle/{chunk-kry4vcrf.js → chunk-n6tqtk6h.js} +2 -2
  194. package/bundle/chunk-n6v36np0.js +2 -0
  195. package/bundle/chunk-ndd4cn3z.js +2 -0
  196. package/bundle/{chunk-d1tb1jd0.js → chunk-nfafk3ts.js} +1 -1
  197. package/bundle/{chunk-b6eypnbj.js → chunk-nga216dm.js} +1 -1
  198. package/bundle/{chunk-qbrj9wzd.js → chunk-njsmma3a.js} +1 -1
  199. package/bundle/{chunk-bk7f59fn.js → chunk-ntr0ezf2.js} +1 -1
  200. package/bundle/chunk-nwj6mcxz.js +2 -0
  201. package/bundle/{chunk-cth373se.js → chunk-p2fte9vz.js} +2 -2
  202. package/bundle/chunk-p5b5ekhh.js +2 -0
  203. package/bundle/chunk-pf23nw4z.js +2 -0
  204. package/bundle/{chunk-whw18cn9.js → chunk-phf37x1c.js} +1 -1
  205. package/bundle/{chunk-r73e8gsp.js → chunk-phpxxd48.js} +1 -1
  206. package/bundle/{chunk-1ay97v74.js → chunk-pqg1wjb5.js} +1 -1
  207. package/bundle/chunk-pw3cv89g.js +2 -0
  208. package/bundle/{chunk-77h8tytk.js → chunk-q3c8mfbq.js} +1 -1
  209. package/bundle/{chunk-0am156m5.js → chunk-qbnt4ynd.js} +1 -1
  210. package/bundle/chunk-qc89yj61.js +2 -0
  211. package/bundle/{chunk-mjrqhbp2.js → chunk-qgek59e6.js} +1 -1
  212. package/bundle/{chunk-npzx3yd5.js → chunk-qgfbsmsx.js} +1 -1
  213. package/bundle/{chunk-v9w88wpy.js → chunk-qgkb6n8k.js} +1 -1
  214. package/bundle/{chunk-2c41dncf.js → chunk-qk1jkc0n.js} +1 -1
  215. package/bundle/{chunk-wb1d3mqw.js → chunk-qk5vy2pr.js} +1 -1
  216. package/bundle/chunk-qn8tz704.js +2 -0
  217. package/bundle/{chunk-9a6p1gdn.js → chunk-qq9m8fxv.js} +7 -7
  218. package/bundle/{chunk-5b3v1x2c.js → chunk-qxdpgdfk.js} +2 -2
  219. package/bundle/chunk-qxre2gqn.js +2 -0
  220. package/bundle/chunk-rdk62809.js +2 -0
  221. package/bundle/chunk-rew6r516.js +2 -0
  222. package/bundle/chunk-rjhvdfn5.js +2 -0
  223. package/bundle/chunk-rmsqb6r4.js +10 -0
  224. package/bundle/{chunk-qph2c2v7.js → chunk-rva2ekrt.js} +1 -1
  225. package/bundle/{chunk-7z96r2px.js → chunk-rwnwjm82.js} +1 -1
  226. package/bundle/{chunk-tz3s8dvy.js → chunk-rye1yjnr.js} +1 -1
  227. package/bundle/{chunk-t9qyzzsz.js → chunk-ryrxgn6d.js} +1 -1
  228. package/bundle/{chunk-wjz42325.js → chunk-s2tc3qs0.js} +2 -2
  229. package/bundle/{chunk-djqxbnwc.js → chunk-s8z7v1me.js} +1 -1
  230. package/bundle/{chunk-msh249db.js → chunk-sa0rrreh.js} +2 -2
  231. package/bundle/{chunk-dbpkq7ba.js → chunk-sbjymf20.js} +2 -2
  232. package/bundle/{chunk-n5p7cn4w.js → chunk-scnbt714.js} +1 -1
  233. package/bundle/chunk-skgr9ypq.js +2 -0
  234. package/bundle/{chunk-rhrcgvb8.js → chunk-sm1g81cv.js} +1 -1
  235. package/bundle/chunk-sv40pwe2.js +2 -0
  236. package/bundle/{chunk-qprbef09.js → chunk-sy9w1t2y.js} +1 -1
  237. package/bundle/{chunk-bd84t3fb.js → chunk-sz0favtz.js} +1 -1
  238. package/bundle/{chunk-xb3sxa6f.js → chunk-t18ka1e7.js} +1 -1
  239. package/bundle/{chunk-va2qfh0x.js → chunk-t3w43rft.js} +1 -1
  240. package/bundle/{chunk-n9twhc5d.js → chunk-t6zz47zk.js} +1 -1
  241. package/bundle/{chunk-wd8hbven.js → chunk-t8fjgkp8.js} +1 -1
  242. package/bundle/{chunk-6r48fje7.js → chunk-tbx741en.js} +1 -1
  243. package/bundle/chunk-tfhpjmny.js +2 -0
  244. package/bundle/chunk-tnete6ye.js +2 -0
  245. package/bundle/{chunk-2y87m7pe.js → chunk-tpyq7ycb.js} +1 -1
  246. package/bundle/{chunk-nftbj8g9.js → chunk-trstb8ee.js} +1 -1
  247. package/bundle/chunk-tsmj98yf.js +5 -0
  248. package/bundle/{chunk-skxg3s8z.js → chunk-txkdt4ep.js} +1 -1
  249. package/bundle/chunk-v5h5wxw5.js +2 -0
  250. package/bundle/chunk-v6141yq1.js +2 -0
  251. package/bundle/{chunk-vjn54xj5.js → chunk-vbfej8ds.js} +2 -2
  252. package/bundle/{chunk-9aafddkw.js → chunk-vfd3azkp.js} +1 -1
  253. package/bundle/chunk-vjs69r6x.js +2 -0
  254. package/bundle/{chunk-ts2k13g0.js → chunk-vkjqy92f.js} +1 -1
  255. package/bundle/chunk-vmhar83s.js +2 -0
  256. package/bundle/{chunk-zp5sr5nx.js → chunk-vph4w4yy.js} +1 -1
  257. package/bundle/chunk-vqvnw12p.js +2 -0
  258. package/bundle/{chunk-0g0jpw0z.js → chunk-vr8nwzp0.js} +1 -1
  259. package/bundle/{chunk-nrk29616.js → chunk-vs3s49jw.js} +1 -1
  260. package/bundle/{chunk-v0c3k797.js → chunk-vsqvnxbz.js} +1 -1
  261. package/bundle/{chunk-rqedtjz9.js → chunk-w0nc0gcx.js} +1 -1
  262. package/bundle/{chunk-y5q9v80n.js → chunk-w0sng8a9.js} +1 -1
  263. package/bundle/chunk-w0sztk4y.js +2 -0
  264. package/bundle/chunk-w6bb320d.js +2 -0
  265. package/bundle/{chunk-t8sy5sgx.js → chunk-w7a33cwa.js} +2 -2
  266. package/bundle/{chunk-2cjfezfr.js → chunk-w9qh2479.js} +1 -1
  267. package/bundle/{chunk-42q8vj0w.js → chunk-waa1ggtj.js} +1 -1
  268. package/bundle/{chunk-v3nmnm57.js → chunk-wb05bp10.js} +2 -2
  269. package/bundle/{chunk-agqss9ga.js → chunk-wb47k8ah.js} +2 -2
  270. package/bundle/{chunk-rfzra502.js → chunk-wd8f9r4k.js} +1 -1
  271. package/bundle/chunk-wf41m019.js +2 -0
  272. package/bundle/{chunk-hwsqqkrv.js → chunk-wgkcyqn1.js} +2 -2
  273. package/bundle/{chunk-dy2k5rdx.js → chunk-wm9nh9nb.js} +2 -2
  274. package/bundle/{chunk-6nxebcf8.js → chunk-wn63q3xp.js} +1 -1
  275. package/bundle/{chunk-z6kcnpsj.js → chunk-wqk1v8t0.js} +2 -2
  276. package/bundle/chunk-wqw6yjrg.js +2 -0
  277. package/bundle/{chunk-q3pt4p9f.js → chunk-wr6rnxr5.js} +1 -1
  278. package/bundle/chunk-ws08rxge.js +2 -0
  279. package/bundle/{chunk-dw7yrk1g.js → chunk-wtt5wms9.js} +1 -1
  280. package/bundle/{chunk-93pmbdz7.js → chunk-wtxh5m6j.js} +6 -6
  281. package/bundle/chunk-wz3dvc3g.js +2 -0
  282. package/bundle/{chunk-vzrc2fmt.js → chunk-x00hwy3x.js} +1 -1
  283. package/bundle/chunk-x2pmqvdc.js +2 -0
  284. package/bundle/chunk-x4wfq39v.js +2 -0
  285. package/bundle/{chunk-q6mcnq9p.js → chunk-xs6v0r9m.js} +1 -1
  286. package/bundle/{chunk-3623jvcm.js → chunk-xy8arehp.js} +1 -1
  287. package/bundle/{chunk-mhxyv9c8.js → chunk-y3gy62q5.js} +1 -1
  288. package/bundle/chunk-yb6m08zj.js +2 -0
  289. package/bundle/{chunk-b79z8f94.js → chunk-ybcqkgs7.js} +1 -1
  290. package/bundle/{chunk-95am490c.js → chunk-ydgst3h8.js} +2 -2
  291. package/bundle/{chunk-twfvrafb.js → chunk-ykpj10nz.js} +1 -1
  292. package/bundle/{chunk-e0zb6sw6.js → chunk-ynf17943.js} +1 -1
  293. package/bundle/{chunk-yy7r3t3w.js → chunk-ytyzrqev.js} +1 -1
  294. package/bundle/{chunk-01e3v1xz.js → chunk-z0kbyr00.js} +2 -2
  295. package/bundle/{chunk-4vzjdmts.js → chunk-zfrftgcy.js} +1 -1
  296. package/bundle/chunk-zj1jc1xt.js +2 -0
  297. package/bundle/{chunk-9sv53kb4.js → chunk-zm0m0504.js} +1 -1
  298. package/bundle/{chunk-gdj7mqrd.js → chunk-zqdjk4rf.js} +1 -1
  299. package/bundle/{chunk-7x2q1w0f.js → chunk-zsg29gba.js} +1 -1
  300. package/bundle/{chunk-1c0yp2gv.js → chunk-zwhmg9dj.js} +1 -1
  301. package/bundle/index.js +3 -3
  302. package/bundle/parser.worker.js +2 -2
  303. package/bundle/worker.js +1 -1
  304. package/package.json +1 -1
  305. package/bundle/chunk-0dzpjk7x.js +0 -2
  306. package/bundle/chunk-12fwmmcp.js +0 -2
  307. package/bundle/chunk-1a95ysv3.js +0 -2
  308. package/bundle/chunk-1akh8pk2.js +0 -2
  309. package/bundle/chunk-2d2a92kj.js +0 -2
  310. package/bundle/chunk-2qrvkef8.js +0 -2
  311. package/bundle/chunk-2tppw8j9.js +0 -2
  312. package/bundle/chunk-3ft1dn9j.js +0 -2
  313. package/bundle/chunk-3rgct4bd.js +0 -11
  314. package/bundle/chunk-4656qm05.js +0 -2
  315. package/bundle/chunk-46knch5z.js +0 -2
  316. package/bundle/chunk-4sgy87h5.js +0 -2
  317. package/bundle/chunk-54hktc8h.js +0 -2
  318. package/bundle/chunk-59m55866.js +0 -2
  319. package/bundle/chunk-5js5nw7r.js +0 -2
  320. package/bundle/chunk-61jn7908.js +0 -2
  321. package/bundle/chunk-61txdqz1.js +0 -2
  322. package/bundle/chunk-668g9wkg.js +0 -2
  323. package/bundle/chunk-6frhjpmt.js +0 -2
  324. package/bundle/chunk-6k14c8x1.js +0 -5
  325. package/bundle/chunk-6r1jpj0h.js +0 -2
  326. package/bundle/chunk-73fn4dqd.js +0 -2
  327. package/bundle/chunk-78j2c2je.js +0 -2
  328. package/bundle/chunk-78jt24ht.js +0 -2
  329. package/bundle/chunk-7j2vpavd.js +0 -2
  330. package/bundle/chunk-7nkxgm72.js +0 -2
  331. package/bundle/chunk-859pkecc.js +0 -2
  332. package/bundle/chunk-8p249svd.js +0 -2
  333. package/bundle/chunk-8rqbx4jw.js +0 -2
  334. package/bundle/chunk-8s3krfsm.js +0 -2
  335. package/bundle/chunk-9wbe0dkx.js +0 -2
  336. package/bundle/chunk-aj5z8qd5.js +0 -2
  337. package/bundle/chunk-b0c2mvc0.js +0 -2
  338. package/bundle/chunk-bbwcsdy9.js +0 -2
  339. package/bundle/chunk-bbzjdbb9.js +0 -2
  340. package/bundle/chunk-bh4s1yct.js +0 -2
  341. package/bundle/chunk-crqcppwq.js +0 -2
  342. package/bundle/chunk-d09zpgj1.js +0 -2
  343. package/bundle/chunk-dexcptaz.js +0 -3
  344. package/bundle/chunk-dgqkak21.js +0 -2
  345. package/bundle/chunk-dhgvh7c3.js +0 -2
  346. package/bundle/chunk-dmd101ja.js +0 -2
  347. package/bundle/chunk-dwb39jdf.js +0 -2
  348. package/bundle/chunk-dx4zxex7.js +0 -2
  349. package/bundle/chunk-e2pqvscp.js +0 -2
  350. package/bundle/chunk-efe6kj3d.js +0 -2
  351. package/bundle/chunk-emac0dss.js +0 -2
  352. package/bundle/chunk-encfnt6w.js +0 -2
  353. package/bundle/chunk-fg2nyz2x.js +0 -2
  354. package/bundle/chunk-ge19ff9d.js +0 -2
  355. package/bundle/chunk-gt0q07xq.js +0 -2
  356. package/bundle/chunk-h4dnjfr2.js +0 -2
  357. package/bundle/chunk-h8fx619t.js +0 -2
  358. package/bundle/chunk-jnvb3s7f.js +0 -2
  359. package/bundle/chunk-jrq2xw6e.js +0 -2
  360. package/bundle/chunk-jwckmhjm.js +0 -2
  361. package/bundle/chunk-jz27ypm5.js +0 -2
  362. package/bundle/chunk-jzrs878d.js +0 -2
  363. package/bundle/chunk-jzx700tb.js +0 -2
  364. package/bundle/chunk-k1x8469r.js +0 -3
  365. package/bundle/chunk-m483jvn8.js +0 -2
  366. package/bundle/chunk-menbcmkq.js +0 -2
  367. package/bundle/chunk-np8h66t0.js +0 -2
  368. package/bundle/chunk-nwwmns3w.js +0 -2
  369. package/bundle/chunk-pe5dpzec.js +0 -2
  370. package/bundle/chunk-q8f6a074.js +0 -2
  371. package/bundle/chunk-qqaevt32.js +0 -2
  372. package/bundle/chunk-qzpvz708.js +0 -2
  373. package/bundle/chunk-reyjr2e0.js +0 -2
  374. package/bundle/chunk-t178njgb.js +0 -2
  375. package/bundle/chunk-tjpev5t6.js +0 -2
  376. package/bundle/chunk-tzq7wjgv.js +0 -3
  377. package/bundle/chunk-v1s16wwd.js +0 -2
  378. package/bundle/chunk-v6b29nx4.js +0 -2
  379. package/bundle/chunk-v6rgd1j5.js +0 -2
  380. package/bundle/chunk-v9dnetq8.js +0 -2
  381. package/bundle/chunk-vd5mpvcc.js +0 -2
  382. package/bundle/chunk-wwct4z7j.js +0 -2
  383. package/bundle/chunk-xr9wz961.js +0 -2
  384. package/bundle/chunk-zfegnt1e.js +0 -2
  385. package/bundle/chunk-zg7kesbp.js +0 -2
  386. package/bundle/chunk-zy06fe4r.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Dh as XC}from"./chunk-nrk29616.js";import{vi as _G}from"./chunk-wd8hbven.js";import{$j as F8,$k as jV,Ak as x9,Bk as NP,Cj as BY,Ck as V$,Dk as QF,Ej as yB,Ek as XF,Fj as Ag,Fk as VF,Gj as a_,Hj as L9,Hk as vL,Ij as Y4,Lj as L2,Lk as bU,Mj as YZ,Mk as KF,Nj as v0,Nk as RC,Oj as B$,Ok as OV,Pj as d0,Pk as G$,Qk as qY,Rj as EV,Rk as s0,Sj as R$,Sk as G2,Tj as JJ,Uk as o0,Vk as MA,Wj as iY,Wk as X0,Xj as nY,Xk as Dw,Yj as T8,Zj as Lj,Zk as A$,_j as j1,_k as mB,ak as h1,al as JG,bk as MP,bl as f$,ck as pX,cl as D1,dk as oX,dl as k0,ek as CP,el as H0,fk as SQ,gk as TQ,hk as _U,ik as Bd,jk as Hd,kk as mQ,lk as n1,mk as VJ,nk as HW,ok as S7,pk as dQ,qk as lU,rk as rU,sk as aU,tk as tU,uk as eU,vk as QO,wk as yj,xj as e,xk as wP,yj as E1,yk as M0,zk as hD}from"./chunk-9a6p1gdn.js";import{fl as RQ,gl as PA}from"./chunk-jxkrhrp0.js";import{Bl as s9,El as C0,Fl as q1,Gl as gJ,Hl as x6,Il as S8,Ll as MN,Ml as j6,Ol as q0,Pl as c,Ql as ZA,Rl as T$,Sl as mD,rl as S3,sl as _O,tl as HP,ul as cN,vl as J4,wl as W$,xl as v$,yl as i1,zl as y9}from"./chunk-6k14c8x1.js";import{Tl as uY,Ul as o8,Vl as p2,Wl as p1,Zl as NN,_l as y0}from"./chunk-5r05d901.js";import{Fn as H8,Gn as x8,Hm as n8,bn as F2,cn as i0,dn as I2,en as B8,fn as gU,gm as hU,hn as D0,jn as a$,kn as y7,mn as AQ,pn as yC,qn as IC,sn as XJ}from"./chunk-3rgct4bd.js";import{Qo as $J}from"./chunk-gbxf6e5d.js";import{ip as B7,jp as Rj,kp as H7,mp as W8}from"./chunk-95am490c.js";import{np as V9}from"./chunk-kmzpeq8k.js";import{op as O$}from"./chunk-0gsw04hw.js";import{eq as V0}from"./chunk-makecdh6.js";import{Jq as g8,Kq as bC,Vq as b9,Wq as AM}from"./chunk-dy2k5rdx.js";import{wr as HC,xr as $C}from"./chunk-n5p7cn4w.js";import{Qr as s7}from"./chunk-ae7b11np.js";import{$r as F7,Vr as A1,_r as DA}from"./chunk-73xryfgn.js";import{bs as S1,cs as I3,fs as R3}from"./chunk-yjqww6ag.js";import{rs as A2,ss as IX,ys as l1,zs as I8}from"./chunk-z6kcnpsj.js";import{Zs as HQ,_s as ZV,dt as HA,gt as V2}from"./chunk-ts2k13g0.js";import{ht as q7,lt as z7}from"./chunk-01e3v1xz.js";import{mt as sm}from"./chunk-dbpkq7ba.js";import{At as q$}from"./chunk-0qpqd7nz.js";import{Ct as G9}from"./chunk-gdew7bwm.js";import{Dt as x1,Gt as xX,Ht as lX,Kt as kD,Lt as bD,Nt as P6,Yt as PP,bu as h4}from"./chunk-v3nmnm57.js";import{cu as XQ,fu as Q6}from"./chunk-hwsqqkrv.js";import{lu as c0,uu as J0}from"./chunk-mbbxedsq.js";import{Au as c8,Bu as K0,Fu as D$,Ju as SJ,Ku as e0,xu as j7}from"./chunk-aa2n02qk.js";import{Lu as _}from"./chunk-k1x8469r.js";import{$u as u$,Mu as tP,Ou as m,Pu as gM,Qu as z$,Ru as L$,Su as CG,Tu as vM,Uu as B2,Vu as B0,Wu as j0,Xu as _2,Yu as E$,Zu as wG,_u as NG,av as g1,bv as A0,cv as H2,dv as eP,ev as AG,fv as fM,gv as mM,hv as H$}from"./chunk-c3szabpf.js";import{Ev as ZB,iv as hM}from"./chunk-c8prg3jx.js";import{nA as y3,yA as zG}from"./chunk-t8sy5sgx.js";import{$H as $4,CG as zN,EI as V,HL as yX,IC as cX,JG as _N,LC as S$,MJ as y8,NF as N$,OG as DN,VK as zP,WK as _P,XK as DP,YK as I6,ZC as Q0,ZK as nO,_D as K8,_K as hP,aL as R6,bG as k,cL as DQ,dH as PN,dI as Z4,dL as gP,eK as d8,gK as D7,iG as BP,jF as x0,nL as V7,oL as bB,qF as O2,qL as vP,rL as IZ,rP as I0,vL as f0,wG as k9,xF as p0,yD as qP}from"./chunk-tezrgfc6.js";import{MP as iK}from"./chunk-wjz42325.js";import{SP as J9,TP as U0,UP as R0,WP as o$,XP as Q7,YP as X7}from"./chunk-f2pv705d.js";var t4=U0((al,pY)=>{function c4($){return Array.isArray($)?$:[$]}var OL=void 0,VK="",d4=" ",XK="\\",UL=/^\s+$/,FL=/(?:[^\\]|^)\\$/,qL=/^\\!/,zL=/^\\#/,_L=/\r?\n/g,DL=/^\.{0,2}\/|^\.{1,2}$/,PL=/\/$/,J7="/",l4="node-ignore";if(typeof Symbol<"u")l4=Symbol.for("node-ignore");var p4=l4,Y7=($,Z,J)=>{return Object.defineProperty($,Z,{value:J}),J},ML=/([0-z])-([0-z])/g,o4=()=>!1,CL=($)=>$.replace(ML,(Z,J,Y)=>J.charCodeAt(0)<=Y.charCodeAt(0)?Z:VK),wL=($)=>{let{length:Z}=$;return $.slice(0,Z-Z%2)},NL=[[/^\uFEFF/,()=>VK],[/((?:\\\\)*?)(\\?\s+)$/,($,Z,J)=>Z+(J.indexOf("\\")===0?d4:VK)],[/(\\+?)\s/g,($,Z)=>{let{length:J}=Z;return Z.slice(0,J-J%2)+d4}],[/[\\$.|*+(){^]/g,($)=>`\\${$}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,($,Z,J)=>Z+6<J.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,($,Z,J)=>{let Y=J.replace(/\\\*/g,"[^\\/]*");return Z+Y}],[/\\\\\\(?=[$.|*+(){^])/g,()=>XK],[/\\\\/g,()=>XK],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,($,Z,J,Y,Q)=>Z===XK?`\\[${J}${wL(Y)}${Q}`:Q==="]"?Y.length%2===0?`[${CL(J)}${Y}]`:"[]":"[]"],[/(?:[^*])$/,($)=>/\/$/.test($)?`${$}$`:`${$}(?=$|\\/$)`]],AL=/(^|\\\/)?\\\*$/,dZ="regex",cY="checkRegex",u4="_",LL={[dZ]($,Z){return`${Z?`${Z}[^/]+`:"[^/]*"}(?=$|\\/$)`},[cY]($,Z){return`${Z?`${Z}[^/]*`:"[^/]*"}(?=$|\\/$)`}},yL=($)=>NL.reduce((Z,[J,Y])=>Z.replace(J,Y.bind($)),$),lY=($)=>typeof $==="string",IL=($)=>$&&lY($)&&!UL.test($)&&!FL.test($)&&$.indexOf("#")!==0,RL=($)=>$.split(_L).filter(Boolean);class i4{constructor($,Z,J,Y,Q,X){this.pattern=$,this.mark=Z,this.negative=Q,Y7(this,"body",J),Y7(this,"ignoreCase",Y),Y7(this,"regexPrefix",X)}get regex(){let $=u4+dZ;if(this[$])return this[$];return this._make(dZ,$)}get checkRegex(){let $=u4+cY;if(this[$])return this[$];return this._make(cY,$)}_make($,Z){let J=this.regexPrefix.replace(AL,LL[$]),Y=this.ignoreCase?new RegExp(J,"i"):new RegExp(J);return Y7(this,Z,Y)}}var SL=({pattern:$,mark:Z},J)=>{let Y=!1,Q=$;if(Q.indexOf("!")===0)Y=!0,Q=Q.substr(1);Q=Q.replace(qL,"!").replace(zL,"#");let X=yL(Q);return new i4($,Z,Q,J,Y,X)};class n4{constructor($){this._ignoreCase=$,this._rules=[]}_add($){if($&&$[p4]){this._rules=this._rules.concat($._rules._rules),this._added=!0;return}if(lY($))$={pattern:$};if(IL($.pattern)){let Z=SL($,this._ignoreCase);this._added=!0,this._rules.push(Z)}}add($){return this._added=!1,c4(lY($)?RL($):$).forEach(this._add,this),this._added}test($,Z,J){let Y=!1,Q=!1,X;this._rules.forEach((W)=>{let{negative:G}=W;if(Q===G&&Y!==Q||G&&!Y&&!Q&&!Z)return;if(!W[J].test($))return;Y=!G,Q=G,X=G?OL:W});let K={ignored:Y,unignored:Q};if(X)K.rule=X;return K}}var TL=($,Z)=>{throw new Z($)},u8=($,Z,J)=>{if(!lY($))return J(`path must be a string, but got \`${Z}\``,TypeError);if(!$)return J("path must not be empty",TypeError);if(u8.isNotRelative($))return J(`path should be a \`path.relative()\`d string, but got "${Z}"`,RangeError);return!0},s4=($)=>DL.test($);u8.isNotRelative=s4;u8.convert=($)=>$;class r4{constructor({ignorecase:$=!0,ignoreCase:Z=$,allowRelativePaths:J=!1}={}){Y7(this,p4,!0),this._rules=new n4(Z),this._strictPathCheck=!J,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add($){if(this._rules.add($))this._initCache();return this}addPattern($){return this.add($)}_test($,Z,J,Y){let Q=$&&u8.convert($);return u8(Q,$,this._strictPathCheck?TL:o4),this._t(Q,Z,J,Y)}checkIgnore($){if(!PL.test($))return this.test($);let Z=$.split(J7).filter(Boolean);if(Z.pop(),Z.length){let J=this._t(Z.join(J7)+J7,this._testCache,!0,Z);if(J.ignored)return J}return this._rules.test($,!1,cY)}_t($,Z,J,Y){if($ in Z)return Z[$];if(!Y)Y=$.split(J7).filter(Boolean);if(Y.pop(),!Y.length)return Z[$]=this._rules.test($,J,dZ);let Q=this._t(Y.join(J7)+J7,Z,J,Y);return Z[$]=Q.ignored?Q:this._rules.test($,J,dZ)}ignores($){return this._test($,this._ignoreCache,!1).ignored}createFilter(){return($)=>!this.ignores($)}filter($){return c4($).filter(this.createFilter())}test($){return this._test($,this._testCache,!0)}}var KK=($)=>new r4($),xL=($)=>u8($&&u8.convert($),$,o4),a4=()=>{let $=(J)=>/^\\\\\?\\/.test(J)||/["<>|\u0000-\u001F]+/u.test(J)?J:J.replace(/\\/g,"/");u8.convert=$;let Z=/^[a-z]:\//i;u8.isNotRelative=(J)=>Z.test(J)||s4(J)};if(typeof process<"u"&&process.platform==="win32")a4();pY.exports=KK;KK.default=KK;pY.exports.isPathValid=xL;Y7(pY.exports,Symbol.for("setupWindows"),a4)});var sY=U0((Yy)=>{Yy.isInteger=($)=>{if(typeof $==="number")return Number.isInteger($);if(typeof $==="string"&&$.trim()!=="")return Number.isInteger(Number($));return!1};Yy.find=($,Z)=>$.nodes.find((J)=>J.type===Z);Yy.exceedsLimit=($,Z,J=1,Y)=>{if(Y===!1)return!1;if(!Yy.isInteger($)||!Yy.isInteger(Z))return!1;return(Number(Z)-Number($))/Number(J)>=Y};Yy.escapeNode=($,Z=0,J)=>{let Y=$.nodes[Z];if(!Y)return;if(J&&Y.type===J||Y.type==="open"||Y.type==="close"){if(Y.escaped!==!0)Y.value="\\"+Y.value,Y.escaped=!0}};Yy.encloseBrace=($)=>{if($.type!=="brace")return!1;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;return!1};Yy.isInvalidBrace=($)=>{if($.type!=="brace")return!1;if($.invalid===!0||$.dollar)return!0;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;if($.open!==!0||$.close!==!0)return $.invalid=!0,!0;return!1};Yy.isOpenOrClose=($)=>{if($.type==="open"||$.type==="close")return!0;return $.open===!0||$.close===!0};Yy.reduce=($)=>$.reduce((Z,J)=>{if(J.type==="text")Z.push(J.value);if(J.type==="range")J.type="text";return Z},[]);Yy.flatten=(...$)=>{let Z=[],J=(Y)=>{for(let Q=0;Q<Y.length;Q++){let X=Y[Q];if(Array.isArray(X)){J(X);continue}if(X!==void 0)Z.push(X)}return Z};return J($),Z}});var rY=U0((Fp,WH)=>{var KH=sY();WH.exports=($,Z={})=>{let J=(Y,Q={})=>{let X=Z.escapeInvalid&&KH.isInvalidBrace(Q),K=Y.invalid===!0&&Z.escapeInvalid===!0,W="";if(Y.value){if((X||K)&&KH.isOpenOrClose(Y))return"\\"+Y.value;return Y.value}if(Y.value)return Y.value;if(Y.nodes)for(let G of Y.nodes)W+=J(G);return W};return J($)}});var BH=U0((qp,GH)=>{/*!
2
+ import{Dh as XC}from"./chunk-vs3s49jw.js";import{vi as _G}from"./chunk-t8fjgkp8.js";import{$j as F8,$k as jV,Ak as x9,Bk as NP,Cj as BY,Ck as V$,Dk as QF,Ej as yB,Ek as XF,Fj as Ag,Fk as VF,Gj as a_,Hj as L9,Hk as vL,Ij as Y4,Lj as L2,Lk as bU,Mj as YZ,Mk as KF,Nj as v0,Nk as RC,Oj as B$,Ok as OV,Pj as d0,Pk as G$,Qk as qY,Rj as EV,Rk as s0,Sj as R$,Sk as G2,Tj as JJ,Uk as o0,Vk as MA,Wj as iY,Wk as X0,Xj as nY,Xk as Dw,Yj as T8,Zj as Lj,Zk as A$,_j as j1,_k as mB,ak as h1,al as JG,bk as MP,bl as f$,ck as pX,cl as D1,dk as oX,dl as k0,ek as CP,el as H0,fk as SQ,gk as TQ,hk as _U,ik as Bd,jk as Hd,kk as mQ,lk as n1,mk as VJ,nk as HW,ok as S7,pk as dQ,qk as lU,rk as rU,sk as aU,tk as tU,uk as eU,vk as QO,wk as yj,xj as e,xk as wP,yj as E1,yk as M0,zk as hD}from"./chunk-qq9m8fxv.js";import{fl as RQ,gl as PA}from"./chunk-2qm46qvn.js";import{Bl as s9,El as C0,Fl as q1,Gl as gJ,Hl as x6,Il as S8,Ll as MN,Ml as j6,Ol as q0,Pl as c,Ql as ZA,Rl as T$,Sl as mD,rl as S3,sl as _O,tl as HP,ul as cN,vl as J4,wl as W$,xl as v$,yl as i1,zl as y9}from"./chunk-tsmj98yf.js";import{Tl as uY,Ul as o8,Vl as p2,Wl as p1,Zl as NN,_l as y0}from"./chunk-58f4y4b7.js";import{Bm as D0,Dm as a$,Em as y7,Gm as AQ,Jm as yC,Km as IC,Mm as XJ,Zm as H8,_m as x8,bm as hU,om as n8,vm as F2,wm as i0,xm as I2,ym as B8,zm as gU}from"./chunk-rmsqb6r4.js";import{rn as $J}from"./chunk-6qwk6z87.js";import{Ln as B7,Mn as Rj,Nn as H7,Pn as W8}from"./chunk-ydgst3h8.js";import{Qn as V9}from"./chunk-6tqbnxar.js";import{Rn as O$}from"./chunk-0w19vmd7.js";import{Ho as V0}from"./chunk-37cbrnke.js";import{kp as g8,lp as bC,wp as b9,xp as AM}from"./chunk-wm9nh9nb.js";import{Zp as HC,_p as $C}from"./chunk-scnbt714.js";import{rq as s7}from"./chunk-eacpc64g.js";import{Bq as DA,Cq as F7,wq as A1}from"./chunk-9009v4d0.js";import{Eq as S1,Fq as I3,Iq as R3}from"./chunk-82xrfk5x.js";import{$q as l1,Uq as A2,Vq as IX,ar as I8}from"./chunk-wqk1v8t0.js";import{Ar as HQ,Br as ZV,Gr as HA,Jr as V2}from"./chunk-vkjqy92f.js";import{Kr as q7,Or as z7}from"./chunk-z0kbyr00.js";import{Pr as sm}from"./chunk-sbjymf20.js";import{bs as q$}from"./chunk-0tm6589k.js";import{ds as G9}from"./chunk-6yhn9syz.js";import{Es as h4,es as x1,hs as xX,is as lX,ls as kD,ms as bD,os as P6,zs as PP}from"./chunk-wb05bp10.js";import{Fs as XQ,Is as Q6}from"./chunk-wgkcyqn1.js";import{Os as c0,Xs as J0}from"./chunk-59csnjc3.js";import{_s as j7,bt as c8,ct as K0,gt as D$,kt as SJ,lt as e0}from"./chunk-1bxfzd6r.js";import{mt as _}from"./chunk-6p6m5956.js";import{At as wG,Bt as NG,Ct as u$,Dt as g1,Et as A0,Ft as H2,Gt as eP,Ht as AG,It as fM,Jt as mM,Kt as H$,nt as tP,pt as m,qt as gM,rt as z$,st as L$,tt as CG,ut as vM,vt as B2,wt as B0,xt as j0,yt as _2,zt as E$}from"./chunk-a48mx917.js";import{Lt as hM,fu as ZB}from"./chunk-3va85mbe.js";import{$y as zG,Qy as y3}from"./chunk-w7a33cwa.js";import{$B as qP,AB as Q0,AJ as nO,BC as K8,BJ as hP,CG as $4,DJ as R6,EE as k,FJ as DQ,GF as PN,GG as Z4,GJ as gP,HI as d8,JI as D7,LE as BP,MD as x0,QJ as V7,RJ as bB,TD as O2,TJ as vP,UJ as IZ,UN as I0,YJ as f0,ZE as k9,_D as p0,dF as zN,fH as V,iK as yX,jB as cX,kF as _N,mB as S$,nI as y8,oE as N$,pF as DN,wJ as zP,xJ as _P,yJ as DP,zJ as I6}from"./chunk-g7v6sp3c.js";import{nO as iK}from"./chunk-s2tc3qs0.js";import{tO as J9,uO as U0,vO as R0,xO as o$,yO as Q7,zO as X7}from"./chunk-e0vrxetq.js";var t4=U0((al,pY)=>{function c4($){return Array.isArray($)?$:[$]}var OL=void 0,VK="",d4=" ",XK="\\",UL=/^\s+$/,FL=/(?:[^\\]|^)\\$/,qL=/^\\!/,zL=/^\\#/,_L=/\r?\n/g,DL=/^\.{0,2}\/|^\.{1,2}$/,PL=/\/$/,J7="/",l4="node-ignore";if(typeof Symbol<"u")l4=Symbol.for("node-ignore");var p4=l4,Y7=($,Z,J)=>{return Object.defineProperty($,Z,{value:J}),J},ML=/([0-z])-([0-z])/g,o4=()=>!1,CL=($)=>$.replace(ML,(Z,J,Y)=>J.charCodeAt(0)<=Y.charCodeAt(0)?Z:VK),wL=($)=>{let{length:Z}=$;return $.slice(0,Z-Z%2)},NL=[[/^\uFEFF/,()=>VK],[/((?:\\\\)*?)(\\?\s+)$/,($,Z,J)=>Z+(J.indexOf("\\")===0?d4:VK)],[/(\\+?)\s/g,($,Z)=>{let{length:J}=Z;return Z.slice(0,J-J%2)+d4}],[/[\\$.|*+(){^]/g,($)=>`\\${$}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,($,Z,J)=>Z+6<J.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,($,Z,J)=>{let Y=J.replace(/\\\*/g,"[^\\/]*");return Z+Y}],[/\\\\\\(?=[$.|*+(){^])/g,()=>XK],[/\\\\/g,()=>XK],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,($,Z,J,Y,Q)=>Z===XK?`\\[${J}${wL(Y)}${Q}`:Q==="]"?Y.length%2===0?`[${CL(J)}${Y}]`:"[]":"[]"],[/(?:[^*])$/,($)=>/\/$/.test($)?`${$}$`:`${$}(?=$|\\/$)`]],AL=/(^|\\\/)?\\\*$/,dZ="regex",cY="checkRegex",u4="_",LL={[dZ]($,Z){return`${Z?`${Z}[^/]+`:"[^/]*"}(?=$|\\/$)`},[cY]($,Z){return`${Z?`${Z}[^/]*`:"[^/]*"}(?=$|\\/$)`}},yL=($)=>NL.reduce((Z,[J,Y])=>Z.replace(J,Y.bind($)),$),lY=($)=>typeof $==="string",IL=($)=>$&&lY($)&&!UL.test($)&&!FL.test($)&&$.indexOf("#")!==0,RL=($)=>$.split(_L).filter(Boolean);class i4{constructor($,Z,J,Y,Q,X){this.pattern=$,this.mark=Z,this.negative=Q,Y7(this,"body",J),Y7(this,"ignoreCase",Y),Y7(this,"regexPrefix",X)}get regex(){let $=u4+dZ;if(this[$])return this[$];return this._make(dZ,$)}get checkRegex(){let $=u4+cY;if(this[$])return this[$];return this._make(cY,$)}_make($,Z){let J=this.regexPrefix.replace(AL,LL[$]),Y=this.ignoreCase?new RegExp(J,"i"):new RegExp(J);return Y7(this,Z,Y)}}var SL=({pattern:$,mark:Z},J)=>{let Y=!1,Q=$;if(Q.indexOf("!")===0)Y=!0,Q=Q.substr(1);Q=Q.replace(qL,"!").replace(zL,"#");let X=yL(Q);return new i4($,Z,Q,J,Y,X)};class n4{constructor($){this._ignoreCase=$,this._rules=[]}_add($){if($&&$[p4]){this._rules=this._rules.concat($._rules._rules),this._added=!0;return}if(lY($))$={pattern:$};if(IL($.pattern)){let Z=SL($,this._ignoreCase);this._added=!0,this._rules.push(Z)}}add($){return this._added=!1,c4(lY($)?RL($):$).forEach(this._add,this),this._added}test($,Z,J){let Y=!1,Q=!1,X;this._rules.forEach((W)=>{let{negative:G}=W;if(Q===G&&Y!==Q||G&&!Y&&!Q&&!Z)return;if(!W[J].test($))return;Y=!G,Q=G,X=G?OL:W});let K={ignored:Y,unignored:Q};if(X)K.rule=X;return K}}var TL=($,Z)=>{throw new Z($)},u8=($,Z,J)=>{if(!lY($))return J(`path must be a string, but got \`${Z}\``,TypeError);if(!$)return J("path must not be empty",TypeError);if(u8.isNotRelative($))return J(`path should be a \`path.relative()\`d string, but got "${Z}"`,RangeError);return!0},s4=($)=>DL.test($);u8.isNotRelative=s4;u8.convert=($)=>$;class r4{constructor({ignorecase:$=!0,ignoreCase:Z=$,allowRelativePaths:J=!1}={}){Y7(this,p4,!0),this._rules=new n4(Z),this._strictPathCheck=!J,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add($){if(this._rules.add($))this._initCache();return this}addPattern($){return this.add($)}_test($,Z,J,Y){let Q=$&&u8.convert($);return u8(Q,$,this._strictPathCheck?TL:o4),this._t(Q,Z,J,Y)}checkIgnore($){if(!PL.test($))return this.test($);let Z=$.split(J7).filter(Boolean);if(Z.pop(),Z.length){let J=this._t(Z.join(J7)+J7,this._testCache,!0,Z);if(J.ignored)return J}return this._rules.test($,!1,cY)}_t($,Z,J,Y){if($ in Z)return Z[$];if(!Y)Y=$.split(J7).filter(Boolean);if(Y.pop(),!Y.length)return Z[$]=this._rules.test($,J,dZ);let Q=this._t(Y.join(J7)+J7,Z,J,Y);return Z[$]=Q.ignored?Q:this._rules.test($,J,dZ)}ignores($){return this._test($,this._ignoreCache,!1).ignored}createFilter(){return($)=>!this.ignores($)}filter($){return c4($).filter(this.createFilter())}test($){return this._test($,this._testCache,!0)}}var KK=($)=>new r4($),xL=($)=>u8($&&u8.convert($),$,o4),a4=()=>{let $=(J)=>/^\\\\\?\\/.test(J)||/["<>|\u0000-\u001F]+/u.test(J)?J:J.replace(/\\/g,"/");u8.convert=$;let Z=/^[a-z]:\//i;u8.isNotRelative=(J)=>Z.test(J)||s4(J)};if(typeof process<"u"&&process.platform==="win32")a4();pY.exports=KK;KK.default=KK;pY.exports.isPathValid=xL;Y7(pY.exports,Symbol.for("setupWindows"),a4)});var sY=U0((Yy)=>{Yy.isInteger=($)=>{if(typeof $==="number")return Number.isInteger($);if(typeof $==="string"&&$.trim()!=="")return Number.isInteger(Number($));return!1};Yy.find=($,Z)=>$.nodes.find((J)=>J.type===Z);Yy.exceedsLimit=($,Z,J=1,Y)=>{if(Y===!1)return!1;if(!Yy.isInteger($)||!Yy.isInteger(Z))return!1;return(Number(Z)-Number($))/Number(J)>=Y};Yy.escapeNode=($,Z=0,J)=>{let Y=$.nodes[Z];if(!Y)return;if(J&&Y.type===J||Y.type==="open"||Y.type==="close"){if(Y.escaped!==!0)Y.value="\\"+Y.value,Y.escaped=!0}};Yy.encloseBrace=($)=>{if($.type!=="brace")return!1;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;return!1};Yy.isInvalidBrace=($)=>{if($.type!=="brace")return!1;if($.invalid===!0||$.dollar)return!0;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;if($.open!==!0||$.close!==!0)return $.invalid=!0,!0;return!1};Yy.isOpenOrClose=($)=>{if($.type==="open"||$.type==="close")return!0;return $.open===!0||$.close===!0};Yy.reduce=($)=>$.reduce((Z,J)=>{if(J.type==="text")Z.push(J.value);if(J.type==="range")J.type="text";return Z},[]);Yy.flatten=(...$)=>{let Z=[],J=(Y)=>{for(let Q=0;Q<Y.length;Q++){let X=Y[Q];if(Array.isArray(X)){J(X);continue}if(X!==void 0)Z.push(X)}return Z};return J($),Z}});var rY=U0((Fp,WH)=>{var KH=sY();WH.exports=($,Z={})=>{let J=(Y,Q={})=>{let X=Z.escapeInvalid&&KH.isInvalidBrace(Q),K=Y.invalid===!0&&Z.escapeInvalid===!0,W="";if(Y.value){if((X||K)&&KH.isOpenOrClose(Y))return"\\"+Y.value;return Y.value}if(Y.value)return Y.value;if(Y.nodes)for(let G of Y.nodes)W+=J(G);return W};return J($)}});var BH=U0((qp,GH)=>{/*!
3
3
  * is-number <https://github.com/jonschlinkert/is-number>
4
4
  *
5
5
  * Copyright (c) 2014-present, Jon Schlinkert.
@@ -87,7 +87,7 @@ A well-formed call looks like: ${JSON.stringify(aZ(_.toJSONSchema(Z)))}`}catch{Q
87
87
  - If there is no real choice to make \u2014 you simply need more information, context or goals \u2014 ask for it as prose in your reply. Do NOT call this tool for that.
88
88
  - The user may dismiss the prompt. You then get a "declined" result: proceed with your best judgement or stop and wait for direction. Do not re-ask the same question.`,OO=($)=>({title:`Dismissed ${$} question${$===1?"":"s"}`,output:"The user declined to answer and dismissed the question. This is final for this turn \u2014 do NOT ask again. "+"Either proceed with your best judgement using what you already know, or stop and wait for the user to give direction.",metadata:{answers:[],declined:!0}});function kR($){for(let Z=$.length-1;Z>=0;Z--){let J=$[Z]?.info;if(J?.role==="user")return J.time.created}return 0}var UO=m0("question",V.gen(function*(){let $=((yield*V0.toolDescriptionEffect("question"))??"")+xR,Z=yield*V1.Service;return{description:$,parameters:TR,execute:(J,Y)=>V.gen(function*(){if(yield*Z.neverAsk())return{title:`Auto-resolved ${J.questions.length} question${J.questions.length>1?"s":""}`,output:"[Never-Ask] No user is available to answer (never-ask mode is on). "+"Re-evaluate the options you just proposed for unattended/headless execution \u2014 "+"prefer text-only, non-interactive, minimal-scope paths and avoid anything that needs a GUI or the user to be present. Pick the best option yourself and continue. "+"IMPORTANT: You MUST explicitly state which option you chose and why in your response text (not just in thinking) \u2014 "+"the user will review the conversation history later and needs to see what you decided without expanding thinking blocks. This applies only to this question; never-ask may be turned off later, so keep using the question tool at future decision points (the user may have returned).",metadata:{answers:J.questions.map(()=>["[Never-Ask] The model will decide autonomously"])}};let Q=yield*Z.declinedAt(Y.sessionID);if(Q!==void 0&&Q>=kR(Y.messages))return OO(J.questions.length);let X=yield*Z.ask({sessionID:Y.sessionID,questions:J.questions,tool:Y.callID?{messageID:Y.messageID,callID:Y.callID}:void 0}).pipe(V.catch(()=>V.succeed(void 0)));if(X===void 0)return OO(J.questions.length);let K=J.questions.map((W,G)=>`"${W.question}"="${X[G]?.length?X[G].join(", "):"Unanswered"}"`).join(", ");return{title:`Asked ${J.questions.length} question${J.questions.length>1?"s":""}`,output:`User has answered your questions: ${K}. You can now continue with the user's answers in mind.`,metadata:{answers:X}}}).pipe(V.orDie)}}));import nK from"os";import{createWriteStream as ZS}from"fs";import{open as JS,stat as YS}from"fs/promises";import B9 from"path";import{fileURLToPath as CO}from"url";var z1={};R0(z1,{preferred:()=>lR,posix:()=>cR,name:()=>tZ,login:()=>uR,killTree:()=>vR,gitbash:()=>uK,acceptable:()=>pR,Shell:()=>z1});import OQ from"path";import{spawn as bR}from"child_process";import{setTimeout as FO}from"timers/promises";var qO=200,ER=new Set(["fish","nu"]),hR=new Set(["bash","dash","fish","ksh","sh","zsh"]),gR=new Set(["bash","dash","ksh","sh","zsh"]);async function vR($,Z){let J=$.pid;if(!J||Z?.exited?.())return;if(process.platform==="win32"){await new Promise((Y)=>{let Q=bR("taskkill",["/pid",String(J),"/f","/t"],{stdio:"ignore",windowsHide:!0});Q.once("exit",()=>Y()),Q.once("error",()=>Y())});return}try{if(process.kill(-J,"SIGTERM"),await FO(qO),!Z?.exited?.())process.kill(-J,"SIGKILL")}catch(Y){if($.kill("SIGTERM"),await FO(qO),!Z?.exited?.())$.kill("SIGKILL")}}function fR($){if(process.platform!=="win32")return $;let Z=D$.windowsPath($);if(OQ.win32.dirname(Z)!=="."){if(Z.startsWith("/")&&tZ(Z)==="bash")return uK()||Z;return Z}return O$(Z)||Z}function mR(){let $=O$("pwsh.exe");if($)return $;let Z=O$("powershell.exe");if(Z)return Z}function zO($,Z){if($&&(!Z?.acceptable||!ER.has(tZ($))))return fR($);if(process.platform==="win32"){let J=mR();if(J)return J}return dR()}function uK(){if(process.platform!=="win32")return;if(c0.QITQODE_GIT_BASH_PATH)return c0.QITQODE_GIT_BASH_PATH;let $=O$("git");if(!$)return;let Z=OQ.join($,"..","..","bin","bash.exe");if(D$.stat(Z)?.size)return Z}function dR(){if(process.platform==="win32"){let Z=uK();if(Z)return Z;return process.env.COMSPEC||"cmd.exe"}if(process.platform==="darwin")return"/bin/zsh";let $=O$("bash");if($)return $;return"/bin/sh"}function tZ($){if(process.platform==="win32")return OQ.win32.parse(D$.windowsPath($)).name.toLowerCase();return OQ.basename($).toLowerCase()}function uR($){return hR.has(tZ($))}function cR($){return gR.has(tZ($))}var lR=V9(()=>zO(process.env.SHELL)),pR=V9(()=>zO(process.env.SHELL,{acceptable:!0}));var b$={};R0(b$,{set:()=>sR,get:()=>nR,clear:()=>rR,SessionCwd:()=>b$,Event:()=>iR});var oR=1000,D6=new Map;_O(async()=>{D6.clear()});var iR={Changed:y0.define("session.cwd",_.object({sessionID:v0.zod,cwd:_.string()}))};function nR($){return D6.get($)??q0.directory}function sR($,Z){if(D6.delete($),D6.set($,Z),D6.size>oR){let J=D6.keys().next().value;if(J!==void 0)D6.delete(J)}}function rR($){D6.delete($)}var eZ={};R0(eZ,{prefixWith:()=>aR,BashArity:()=>eZ});function aR($,Z){return G9.bashPrefixWith($,Z)}import tR from"crypto";var cK=J0.create({service:"bash-interactive"}),DO={Asked:y0.define("bash.interactive.asked",_.object({id:_.string(),command:_.string(),cwd:_.string(),env:_.record(_.string(),_.string()).optional(),description:_.string()})),Replied:y0.define("bash.interactive.replied",_.object({id:_.string(),output:_.string(),exitCode:_.number()}))};class PO extends Error{constructor($){super($);this.name="BashInteractiveError"}}class UQ extends Q0.Service()("@qitqode/BashInteractive"){}var eR=k.effect(UQ,V.gen(function*(){let $=yield*e.Service,Z=yield*c.make(V.fn("BashInteractive.state")(function*(){let X={pending:new Map};return yield*V.addFinalizer(()=>V.gen(function*(){for(let K of X.pending.values())yield*p0.fail(K.deferred,new PO("Instance disposed"));X.pending.clear()})),X})),J=V.fn("BashInteractive.request")(function*(X){let K=(yield*c.get(Z)).pending,W=tR.randomUUID();cK.info("requesting interactive",{id:W,command:X.command});let G=yield*p0.make(),H={id:W,command:X.command,cwd:X.cwd,env:X.env,description:X.description};return K.set(W,{request:H,deferred:G}),yield*$.publish(DO.Asked,H),yield*HQ.awaitDeferred(G,()=>{K.delete(W)})}),Y=V.fn("BashInteractive.reply")(function*(X){let K=(yield*c.get(Z)).pending,W=K.get(X.id);if(!W){cK.warn("reply for unknown request",{id:X.id});return}K.delete(X.id),cK.info("replied",{id:X.id,exitCode:X.exitCode}),yield*$.publish(DO.Replied,{id:W.request.id,output:X.output,exitCode:X.exitCode}),yield*p0.succeed(W.deferred,{output:X.output,exitCode:X.exitCode})}),Q=V.fn("BashInteractive.list")(function*(){let X=(yield*c.get(Z)).pending;return Array.from(X.values(),(K)=>K.request)});return UQ.of({request:J,reply:Y,list:Q})})),lK=eR.pipe(k.provide(e.layer)),{runPromise:$S}=F7(UQ,lK);function MO($){return $S((Z)=>Z.request($))}var wO=30000,QS=c0.QITQODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS||120000,IO=new Set(["powershell","pwsh"]),RO=new Set(["cd","push-location","set-location"]),XS=new Set([...RO,"rm","cp","mv","mkdir","touch","chmod","chown","cat","get-content","set-content","add-content","copy-item","move-item","remove-item","new-item","rename-item"]),VS=new Set(["-destination","-literalpath","-path"]),KS=new Set(["-confirm","-debug","-force","-nonewline","-recurse","-verbose","-whatif"]),sK=J0.create({service:"bash-tool"}),oK=($)=>{if($.startsWith("file://"))return CO($);if($.startsWith("/")||/^[a-z]:/i.test($))return $;let Z=new URL($,import.meta.url);return CO(Z)};function WS($){let Z=[];for(let J=0;J<$.childCount;J++){let Y=$.child(J);if(!Y)continue;if(Y.type==="command_elements"){for(let Q=0;Q<Y.childCount;Q++){let X=Y.child(Q);if(!X||X.type==="command_argument_sep"||X.type==="redirection")continue;Z.push({type:X.type,text:X.text})}continue}if(Y.type!=="command_name"&&Y.type!=="command_name_expr"&&Y.type!=="word"&&Y.type!=="string"&&Y.type!=="raw_string"&&Y.type!=="concatenation")continue;Z.push({type:Y.type,text:Y.text})}return Z}function GS($){return($.parent?.type==="redirected_statement"?$.parent.text:$.text).trim()}function BS($){return $.descendantsOfType("command").filter((Z)=>Boolean(Z))}function SO($){if($.length<2)return $;let Z=$[0],J=$[$.length-1];if((Z==='"'||Z==="'")&&Z===J)return $.slice(1,-1);return $}function TO($){if($==="~")return nK.homedir();if($.startsWith("~/")||$.startsWith("~\\"))return B9.join(nK.homedir(),$.slice(2));return $}function NO($){if(process.platform!=="win32")return process.env[$];let Z=Object.keys(process.env).find((J)=>J.toLowerCase()===$.toLowerCase());return Z?process.env[Z]:void 0}function HS($,Z,J){let Y=$.toUpperCase();if(Y==="HOME")return nK.homedir();if(Y==="PWD")return Z;if(Y==="PSHOME")return B9.dirname(J)}function jS($,Z,J){let Y=SO($).replace(/\$\{env:([^}]+)\}/gi,(Q,X)=>NO(X)||"").replace(/\$env:([A-Za-z_][A-Za-z0-9_]*)/gi,(Q,X)=>NO(X)||"").replace(/\$(HOME|PWD|PSHOME)(?=$|[\\/])/gi,(Q,X)=>HS(X,Z,J)||"");return TO(Y)}function OS($){let Z=$.match(/^([A-Za-z]+)::(.*)$/);if(Z){if(Z[1].toLowerCase()!=="filesystem")return;return Z[2]}let J=$.match(/^([A-Za-z]+):(.*)$/);if(!J)return $;if(J[1].length===1)return $;return}function US($,Z){if($.startsWith("(")||$.startsWith("@("))return!0;if($.includes("$(")||$.includes("${")||$.includes("`"))return!0;if(Z)return/\$(?!env:)/i.test($);return $.includes("$")}function FS($){let Z=/[?*[]/.exec($);if(!Z)return $;if(Z.index===0)return;return $.slice(0,Z.index)}function qS($,Z){if(!Z)return $.slice(1).filter((Q)=>!Q.text.startsWith("-")&&!($[0]?.text==="chmod"&&Q.text.startsWith("+"))).map((Q)=>Q.text);let J=[],Y=!1;for(let Q of $.slice(1)){if(Y){J.push(Q.text),Y=!1;continue}if(Q.type==="command_parameter"){let X=Q.text.toLowerCase();if(KS.has(X))continue;Y=VS.has(X);continue}J.push(Q.text)}return J}function AO($){if($.length<=wO)return $;return`...
89
89
 
90
- `+$.slice(-wO)}var zS=/error|exception|failed|fatal|traceback|panic|exit code/i,LO=Math.floor(l8*0.7),yO=Math.floor(O7*0.7),_S=V.fn("BashTool.parse")(function*($,Z){let J=yield*V.promise(()=>MS().then((Y)=>(Z?Y.ps:Y.bash).parse($)).catch((Y)=>{return sK.warn("tree-sitter parse of command failed",{error:String(Y)}),null}));if(!J)throw Error("Failed to parse command");return J.rootNode}),DS=V.fn("BashTool.ask")(function*($,Z){if(Z.dirs.size>0){let J=Array.from(Z.dirs).map((Y)=>{if(process.platform==="win32")return K0.normalizePathPattern(B9.join(Y,"*"));return B9.join(Y,"*")});yield*$.ask({permission:"external_directory",patterns:J,always:J,metadata:{}})}if(Z.patterns.size===0)return;yield*$.ask({permission:"bash",patterns:Array.from(Z.patterns),always:Array.from(Z.always),metadata:{}})});function PS($,Z,J,Y,Q){if(process.platform==="win32"&&IO.has(Z))return p2.make($,["-NoLogo","-NoProfile","-NonInteractive","-Command",J],{cwd:Y,env:Q,stdin:"ignore",detached:!1});return p2.make(J,[],{shell:$,cwd:Y,env:Q,stdin:"ignore",detached:process.platform!=="win32"})}var MS=V9(async()=>{let{Parser:$}=await import("./chunk-59m55866.js"),{default:Z}=await import("./chunk-nwwmns3w.js",{with:{type:"wasm"}}),J=oK(Z);await $.init({locateFile(){return J}});let{default:Y}=await import("./chunk-t178njgb.js",{with:{type:"wasm"}}),{default:Q}=await import("./chunk-1a95ysv3.js",{with:{type:"wasm"}}),X=oK(Y),K=oK(Q),[W,G]=await Promise.all([iK.load(X),iK.load(K)]),H=new $;H.setLanguage(W);let B=new $;return B.setLanguage(G),{bash:H,ps:B}}),xO=m0("bash",V.gen(function*(){let $=(yield*V0.toolDescriptionEffect("bash"))??"",Z=yield*uY,J=yield*K0.Service,Y=yield*o1,Q=yield*s0.Service,X=V.fn("BashTool.cygpath")(function*(j,O){let F=(yield*Z.lines(p2.make(j,["-lc",'cygpath -w -- "$1"',"_",O])).pipe(V.catch(()=>V.succeed([]))))[0]?.trim();if(!F)return;return K0.normalizePath(F)}),K=V.fn("BashTool.resolvePath")(function*(j,O,U){if(process.platform==="win32"){if(z1.posix(U)&&j.startsWith("/")&&K0.windowsPath(j)===j){let F=yield*X(U,j);if(F)return F}return K0.normalizePath(B9.resolve(O,K0.windowsPath(j)))}return B9.resolve(O,j)}),W=V.fn("BashTool.argPath")(function*(j,O,U,F){let q=U?jS(j,O,F):TO(SO(j)),w=q&&FS(q);if(!w||US(w,U))return;let D=U?OS(w):w;if(!D)return;return yield*K(D,O,F)}),G=V.fn("BashTool.collect")(function*(j,O,U,F){let q={dirs:new Set,patterns:new Set,always:new Set},w=yield*V.promise(()=>V0.resolveBashArity());for(let D of BS(j)){let z=WS(D),C=z.map((y)=>y.text),P=U?C[0]?.toLowerCase():C[0];if(P&&XS.has(P))for(let y of qS(z,U)){let I=yield*W(y,O,U,F);if(sK.info("resolved path",{arg:y,resolved:I}),!I||q0.containsPath(I))continue;let x=(yield*J.isDir(I))?I:B9.dirname(I);q.dirs.add(x)}if(C.length&&(!P||!RO.has(P)))q.patterns.add(GS(D)),q.always.add(eZ.prefixWith(w,C).join(" ")+" *")}return q}),H=V.fn("BashTool.shellEnv")(function*(j,O){let U=yield*Q.trigger("shell.env",{cwd:O,sessionID:j.sessionID,callID:j.callID},{env:{}});return{...q7(),...U.env}}),B=V.fn("BashTool.run")(function*(j,O){let U=l8,F=O7,q=U*2,w="",D="",z=[],C=0,P="",y,I=!1,x=!1,h=!1;yield*O.metadata({metadata:{output:"",description:j.description}});let S=yield*V.scoped(V.gen(function*(){let N=yield*Z.spawn(PS(j.shell,j.name,j.command,j.cwd,j.env));yield*V.forkScoped(f0.runForEach(f0.decodeText(N.all),(l)=>{let d=Buffer.byteLength(l,"utf-8");z.push({text:l,size:d}),C+=d;while(C>q&&z.length>1){let u=z.shift();if(!u)break;C-=u.size,I=!0}if(D=AO(D+l),P)y?.write(l);else if(w+=l,Buffer.byteLength(w,"utf-8")>U)return Y.write(w).pipe(V.andThen((u)=>V.sync(()=>{P=u,I=!0,y=ZS(u,{flags:"a"}),w=""})),V.andThen(O.metadata({metadata:{output:D,description:j.description}})));return O.metadata({metadata:{output:D,description:j.description}})}));let R=V.callback((l)=>{if(O.abort.aborted)return l(V.void);let d=()=>l(V.void);if(O.abort.addEventListener("abort",d,{once:!0}),O.abort.aborted)d();return V.sync(()=>O.abort.removeEventListener("abort",d))}),b=V.sleep(`${j.timeout+100} millis`),r=yield*V.raceAll([N.exitCode.pipe(V.map((l)=>({kind:"exit",code:l}))),R.pipe(V.map(()=>({kind:"abort",code:null}))),b.pipe(V.map(()=>({kind:"timeout",code:null})))]);if(r.kind==="abort")h=!0,yield*N.kill({forceKillAfter:"3 seconds"}).pipe(V.orDie);if(r.kind==="timeout")x=!0,yield*N.kill({forceKillAfter:"3 seconds"}).pipe(V.orDie);return r.kind==="exit"?r.code:null})).pipe(V.orDie),v=[];if(x)v.push(`bash tool terminated command after exceeding timeout ${j.timeout} ms. If this command is expected to take longer and is not waiting for interactive input, retry with a larger timeout value in milliseconds.`);if(h)v.push("User aborted the command");let L=z.map((N)=>N.text).join(""),T=TK(L,F,U);if(T.cut)I=!0;if(!P&&T.cut)P=yield*Y.write(L);let E=T.text;if(!E)E="(no output)";if(I&&P){let N=T.text.length>2048?T.text.slice(-2048):T.text;if(zS.test(N)){let b=yield*V.promise(async()=>{try{let r=await YS(P),l=LO*2,d=await JS(P,"r");try{let u=Math.min(Number(r.size),l),o=Buffer.alloc(u);await d.read(o,0,u,0);let W0=o.toString("utf-8"),a=1;for(let $0=0;$0<W0.length;$0++)if(W0.charCodeAt($0)===10)a++;let f=a<=yO+F;return{text:W0,overlaps:f}}finally{await d.close()}}catch{return}});if(b){let r=b.text;if(!b.overlaps){let l=SK(r,yO,LO);E=`...output truncated (head+tail shown due to errors)...
90
+ `+$.slice(-wO)}var zS=/error|exception|failed|fatal|traceback|panic|exit code/i,LO=Math.floor(l8*0.7),yO=Math.floor(O7*0.7),_S=V.fn("BashTool.parse")(function*($,Z){let J=yield*V.promise(()=>MS().then((Y)=>(Z?Y.ps:Y.bash).parse($)).catch((Y)=>{return sK.warn("tree-sitter parse of command failed",{error:String(Y)}),null}));if(!J)throw Error("Failed to parse command");return J.rootNode}),DS=V.fn("BashTool.ask")(function*($,Z){if(Z.dirs.size>0){let J=Array.from(Z.dirs).map((Y)=>{if(process.platform==="win32")return K0.normalizePathPattern(B9.join(Y,"*"));return B9.join(Y,"*")});yield*$.ask({permission:"external_directory",patterns:J,always:J,metadata:{}})}if(Z.patterns.size===0)return;yield*$.ask({permission:"bash",patterns:Array.from(Z.patterns),always:Array.from(Z.always),metadata:{}})});function PS($,Z,J,Y,Q){if(process.platform==="win32"&&IO.has(Z))return p2.make($,["-NoLogo","-NoProfile","-NonInteractive","-Command",J],{cwd:Y,env:Q,stdin:"ignore",detached:!1});return p2.make(J,[],{shell:$,cwd:Y,env:Q,stdin:"ignore",detached:process.platform!=="win32"})}var MS=V9(async()=>{let{Parser:$}=await import("./chunk-h5w91zr4.js"),{default:Z}=await import("./chunk-f2yfyhh8.js",{with:{type:"wasm"}}),J=oK(Z);await $.init({locateFile(){return J}});let{default:Y}=await import("./chunk-2a5gjgvp.js",{with:{type:"wasm"}}),{default:Q}=await import("./chunk-hmpb3c21.js",{with:{type:"wasm"}}),X=oK(Y),K=oK(Q),[W,G]=await Promise.all([iK.load(X),iK.load(K)]),H=new $;H.setLanguage(W);let B=new $;return B.setLanguage(G),{bash:H,ps:B}}),xO=m0("bash",V.gen(function*(){let $=(yield*V0.toolDescriptionEffect("bash"))??"",Z=yield*uY,J=yield*K0.Service,Y=yield*o1,Q=yield*s0.Service,X=V.fn("BashTool.cygpath")(function*(j,O){let F=(yield*Z.lines(p2.make(j,["-lc",'cygpath -w -- "$1"',"_",O])).pipe(V.catch(()=>V.succeed([]))))[0]?.trim();if(!F)return;return K0.normalizePath(F)}),K=V.fn("BashTool.resolvePath")(function*(j,O,U){if(process.platform==="win32"){if(z1.posix(U)&&j.startsWith("/")&&K0.windowsPath(j)===j){let F=yield*X(U,j);if(F)return F}return K0.normalizePath(B9.resolve(O,K0.windowsPath(j)))}return B9.resolve(O,j)}),W=V.fn("BashTool.argPath")(function*(j,O,U,F){let q=U?jS(j,O,F):TO(SO(j)),w=q&&FS(q);if(!w||US(w,U))return;let D=U?OS(w):w;if(!D)return;return yield*K(D,O,F)}),G=V.fn("BashTool.collect")(function*(j,O,U,F){let q={dirs:new Set,patterns:new Set,always:new Set},w=yield*V.promise(()=>V0.resolveBashArity());for(let D of BS(j)){let z=WS(D),C=z.map((y)=>y.text),P=U?C[0]?.toLowerCase():C[0];if(P&&XS.has(P))for(let y of qS(z,U)){let I=yield*W(y,O,U,F);if(sK.info("resolved path",{arg:y,resolved:I}),!I||q0.containsPath(I))continue;let x=(yield*J.isDir(I))?I:B9.dirname(I);q.dirs.add(x)}if(C.length&&(!P||!RO.has(P)))q.patterns.add(GS(D)),q.always.add(eZ.prefixWith(w,C).join(" ")+" *")}return q}),H=V.fn("BashTool.shellEnv")(function*(j,O){let U=yield*Q.trigger("shell.env",{cwd:O,sessionID:j.sessionID,callID:j.callID},{env:{}});return{...q7(),...U.env}}),B=V.fn("BashTool.run")(function*(j,O){let U=l8,F=O7,q=U*2,w="",D="",z=[],C=0,P="",y,I=!1,x=!1,h=!1;yield*O.metadata({metadata:{output:"",description:j.description}});let S=yield*V.scoped(V.gen(function*(){let N=yield*Z.spawn(PS(j.shell,j.name,j.command,j.cwd,j.env));yield*V.forkScoped(f0.runForEach(f0.decodeText(N.all),(l)=>{let d=Buffer.byteLength(l,"utf-8");z.push({text:l,size:d}),C+=d;while(C>q&&z.length>1){let u=z.shift();if(!u)break;C-=u.size,I=!0}if(D=AO(D+l),P)y?.write(l);else if(w+=l,Buffer.byteLength(w,"utf-8")>U)return Y.write(w).pipe(V.andThen((u)=>V.sync(()=>{P=u,I=!0,y=ZS(u,{flags:"a"}),w=""})),V.andThen(O.metadata({metadata:{output:D,description:j.description}})));return O.metadata({metadata:{output:D,description:j.description}})}));let R=V.callback((l)=>{if(O.abort.aborted)return l(V.void);let d=()=>l(V.void);if(O.abort.addEventListener("abort",d,{once:!0}),O.abort.aborted)d();return V.sync(()=>O.abort.removeEventListener("abort",d))}),b=V.sleep(`${j.timeout+100} millis`),r=yield*V.raceAll([N.exitCode.pipe(V.map((l)=>({kind:"exit",code:l}))),R.pipe(V.map(()=>({kind:"abort",code:null}))),b.pipe(V.map(()=>({kind:"timeout",code:null})))]);if(r.kind==="abort")h=!0,yield*N.kill({forceKillAfter:"3 seconds"}).pipe(V.orDie);if(r.kind==="timeout")x=!0,yield*N.kill({forceKillAfter:"3 seconds"}).pipe(V.orDie);return r.kind==="exit"?r.code:null})).pipe(V.orDie),v=[];if(x)v.push(`bash tool terminated command after exceeding timeout ${j.timeout} ms. If this command is expected to take longer and is not waiting for interactive input, retry with a larger timeout value in milliseconds.`);if(h)v.push("User aborted the command");let L=z.map((N)=>N.text).join(""),T=TK(L,F,U);if(T.cut)I=!0;if(!P&&T.cut)P=yield*Y.write(L);let E=T.text;if(!E)E="(no output)";if(I&&P){let N=T.text.length>2048?T.text.slice(-2048):T.text;if(zS.test(N)){let b=yield*V.promise(async()=>{try{let r=await YS(P),l=LO*2,d=await JS(P,"r");try{let u=Math.min(Number(r.size),l),o=Buffer.alloc(u);await d.read(o,0,u,0);let W0=o.toString("utf-8"),a=1;for(let $0=0;$0<W0.length;$0++)if(W0.charCodeAt($0)===10)a++;let f=a<=yO+F;return{text:W0,overlaps:f}}finally{await d.close()}}catch{return}});if(b){let r=b.text;if(!b.overlaps){let l=SK(r,yO,LO);E=`...output truncated (head+tail shown due to errors)...
91
91
 
92
92
  Full output saved to: ${P}
93
93
 
@@ -639,6 +639,97 @@ A question about a UI topic is not automatically a visual question. "What does p
639
639
 
640
640
  If they agree to the companion, read the detailed guide before proceeding:
641
641
  \`<compose:brainstorm>/visual-companion.md\`
642
+ `,"scripts/helper.js":`;(function () {
643
+ const WS_URL = "ws://" + window.location.host
644
+ let ws = null
645
+ let eventQueue = []
646
+
647
+ function connect() {
648
+ ws = new WebSocket(WS_URL)
649
+
650
+ ws.onopen = () => {
651
+ eventQueue.forEach((e) => ws.send(JSON.stringify(e)))
652
+ eventQueue = []
653
+ }
654
+
655
+ ws.onmessage = (msg) => {
656
+ const data = JSON.parse(msg.data)
657
+ if (data.type === "reload") {
658
+ window.location.reload()
659
+ }
660
+ }
661
+
662
+ ws.onclose = () => {
663
+ setTimeout(connect, 1000)
664
+ }
665
+ }
666
+
667
+ function sendEvent(event) {
668
+ event.timestamp = Date.now()
669
+ if (ws && ws.readyState === WebSocket.OPEN) {
670
+ ws.send(JSON.stringify(event))
671
+ } else {
672
+ eventQueue.push(event)
673
+ }
674
+ }
675
+
676
+ // Capture clicks on choice elements
677
+ document.addEventListener("click", (e) => {
678
+ const target = e.target.closest("[data-choice]")
679
+ if (!target) return
680
+
681
+ sendEvent({
682
+ type: "click",
683
+ text: target.textContent.trim(),
684
+ choice: target.dataset.choice,
685
+ id: target.id || null,
686
+ })
687
+
688
+ // Update indicator bar (defer so toggleSelect runs first)
689
+ setTimeout(() => {
690
+ const indicator = document.getElementById("indicator-text")
691
+ if (!indicator) return
692
+ const container = target.closest(".options") || target.closest(".cards")
693
+ const selected = container ? container.querySelectorAll(".selected") : []
694
+ if (selected.length === 0) {
695
+ indicator.textContent = "Click an option above, then return to the terminal"
696
+ } else if (selected.length === 1) {
697
+ const label =
698
+ selected[0].querySelector("h3, .content h3, .card-body h3")?.textContent?.trim() || selected[0].dataset.choice
699
+ indicator.innerHTML =
700
+ '<span class="selected-text">' + label + " selected</span> \u2014 return to terminal to continue"
701
+ } else {
702
+ indicator.innerHTML =
703
+ '<span class="selected-text">' + selected.length + " selected</span> \u2014 return to terminal to continue"
704
+ }
705
+ }, 0)
706
+ })
707
+
708
+ // Frame UI: selection tracking
709
+ window.selectedChoice = null
710
+
711
+ window.toggleSelect = function (el) {
712
+ const container = el.closest(".options") || el.closest(".cards")
713
+ const multi = container && container.dataset.multiselect !== undefined
714
+ if (container && !multi) {
715
+ container.querySelectorAll(".option, .card").forEach((o) => o.classList.remove("selected"))
716
+ }
717
+ if (multi) {
718
+ el.classList.toggle("selected")
719
+ } else {
720
+ el.classList.add("selected")
721
+ }
722
+ window.selectedChoice = el.dataset.choice
723
+ }
724
+
725
+ // Expose API for explicit use
726
+ window.brainstorm = {
727
+ send: sendEvent,
728
+ choice: (value, metadata = {}) => sendEvent({ type: "choice", value, ...metadata }),
729
+ }
730
+
731
+ connect()
732
+ })()
642
733
  `,"scripts/frame-template.html":`<!doctype html>
643
734
  <html>
644
735
  <head>
@@ -1018,97 +1109,6 @@ If they agree to the companion, read the detailed guide before proceeding:
1018
1109
  </div>
1019
1110
  </body>
1020
1111
  </html>
1021
- `,"scripts/helper.js":`;(function () {
1022
- const WS_URL = "ws://" + window.location.host
1023
- let ws = null
1024
- let eventQueue = []
1025
-
1026
- function connect() {
1027
- ws = new WebSocket(WS_URL)
1028
-
1029
- ws.onopen = () => {
1030
- eventQueue.forEach((e) => ws.send(JSON.stringify(e)))
1031
- eventQueue = []
1032
- }
1033
-
1034
- ws.onmessage = (msg) => {
1035
- const data = JSON.parse(msg.data)
1036
- if (data.type === "reload") {
1037
- window.location.reload()
1038
- }
1039
- }
1040
-
1041
- ws.onclose = () => {
1042
- setTimeout(connect, 1000)
1043
- }
1044
- }
1045
-
1046
- function sendEvent(event) {
1047
- event.timestamp = Date.now()
1048
- if (ws && ws.readyState === WebSocket.OPEN) {
1049
- ws.send(JSON.stringify(event))
1050
- } else {
1051
- eventQueue.push(event)
1052
- }
1053
- }
1054
-
1055
- // Capture clicks on choice elements
1056
- document.addEventListener("click", (e) => {
1057
- const target = e.target.closest("[data-choice]")
1058
- if (!target) return
1059
-
1060
- sendEvent({
1061
- type: "click",
1062
- text: target.textContent.trim(),
1063
- choice: target.dataset.choice,
1064
- id: target.id || null,
1065
- })
1066
-
1067
- // Update indicator bar (defer so toggleSelect runs first)
1068
- setTimeout(() => {
1069
- const indicator = document.getElementById("indicator-text")
1070
- if (!indicator) return
1071
- const container = target.closest(".options") || target.closest(".cards")
1072
- const selected = container ? container.querySelectorAll(".selected") : []
1073
- if (selected.length === 0) {
1074
- indicator.textContent = "Click an option above, then return to the terminal"
1075
- } else if (selected.length === 1) {
1076
- const label =
1077
- selected[0].querySelector("h3, .content h3, .card-body h3")?.textContent?.trim() || selected[0].dataset.choice
1078
- indicator.innerHTML =
1079
- '<span class="selected-text">' + label + " selected</span> \u2014 return to terminal to continue"
1080
- } else {
1081
- indicator.innerHTML =
1082
- '<span class="selected-text">' + selected.length + " selected</span> \u2014 return to terminal to continue"
1083
- }
1084
- }, 0)
1085
- })
1086
-
1087
- // Frame UI: selection tracking
1088
- window.selectedChoice = null
1089
-
1090
- window.toggleSelect = function (el) {
1091
- const container = el.closest(".options") || el.closest(".cards")
1092
- const multi = container && container.dataset.multiselect !== undefined
1093
- if (container && !multi) {
1094
- container.querySelectorAll(".option, .card").forEach((o) => o.classList.remove("selected"))
1095
- }
1096
- if (multi) {
1097
- el.classList.toggle("selected")
1098
- } else {
1099
- el.classList.add("selected")
1100
- }
1101
- window.selectedChoice = el.dataset.choice
1102
- }
1103
-
1104
- // Expose API for explicit use
1105
- window.brainstorm = {
1106
- send: sendEvent,
1107
- choice: (value, metadata = {}) => sendEvent({ type: "choice", value, ...metadata }),
1108
- }
1109
-
1110
- connect()
1111
- })()
1112
1112
  `,"scripts/server.cjs":`const crypto = require("crypto")
1113
1113
  const http = require("http")
1114
1114
  const fs = require("fs")
@@ -3376,290 +3376,63 @@ After all tasks complete and verified:
3376
3376
  - **compose:plan** - Creates the plan this skill executes
3377
3377
  - **compose:report** - Write final report after all tasks complete
3378
3378
  - **compose:merge** - Complete development (invoked by report skill)
3379
- `},feedback:{"SKILL.md":`---
3380
- name: compose:feedback
3379
+ `},merge:{"SKILL.md":`---
3380
+ name: compose:merge
3381
3381
  hidden: true
3382
- description: Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
3382
+ description: Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
3383
3383
  ---
3384
3384
 
3385
- # Code Review Reception
3385
+ # Finishing a Development Branch
3386
3386
 
3387
3387
  ## Overview
3388
3388
 
3389
- Code review requires technical evaluation, not emotional performance.
3390
-
3391
- **Core principle:** Verify before implementing. Ask before assuming. Technical correctness over social comfort.
3389
+ Guide completion of development work by presenting clear options and handling chosen workflow.
3392
3390
 
3393
- ## The Response Pattern
3391
+ **Core principle:** Verify tests \u2192 Detect environment \u2192 Present options \u2192 Execute choice \u2192 Clean up.
3394
3392
 
3395
- \`\`\`
3396
- WHEN receiving code review feedback:
3393
+ **Announce at start:** "I'm using the compose:merge skill to complete this work."
3397
3394
 
3398
- 1. READ: Complete feedback without reacting
3399
- 2. UNDERSTAND: Restate requirement in own words (or ask)
3400
- 3. VERIFY: Check against codebase reality
3401
- 4. EVALUATE: Technically sound for THIS codebase?
3402
- 5. RESPOND: Technical acknowledgment or reasoned pushback
3403
- 6. IMPLEMENT: One item at a time, test each
3404
- \`\`\`
3395
+ ## The Process
3405
3396
 
3406
- ## Forbidden Responses
3397
+ ### Step 1: Verify Tests
3407
3398
 
3408
- **NEVER:**
3399
+ **Before presenting options, verify tests pass:**
3409
3400
 
3410
- - "You're absolutely right!" (sycophantic, not technical)
3411
- - "Great point!" / "Excellent feedback!" (performative)
3412
- - "Let me implement that now" (before verification)
3401
+ \`\`\`bash
3402
+ # Run project's test suite
3403
+ npm test / cargo test / pytest / go test ./...
3404
+ \`\`\`
3413
3405
 
3414
- **INSTEAD:**
3406
+ **If tests fail:**
3415
3407
 
3416
- - Restate the technical requirement
3417
- - Ask clarifying questions through \`compose:ask\`, presenting interpretations as options. If no user is available, take your best interpretation and proceed.
3418
- - Push back with technical reasoning if wrong
3419
- - Just start working (actions > words)
3408
+ \`\`\`
3409
+ Tests failing (<N> failures). Must fix before completing:
3420
3410
 
3421
- ## Handling Unclear Feedback
3411
+ [Show failures]
3422
3412
 
3413
+ Cannot proceed with merge/PR until tests pass.
3423
3414
  \`\`\`
3424
- IF any item is unclear:
3425
- STOP - do not implement anything yet
3426
- ASK for clarification through \`compose:ask\`, presenting your interpretations as options. If no user is available, take the most reasonable interpretation and proceed.
3427
3415
 
3428
- WHY: Items may be related. Partial understanding = wrong implementation.
3429
- \`\`\`
3416
+ Stop. Don't proceed to Step 2.
3430
3417
 
3431
- **Example:**
3418
+ **If tests pass:** Continue to Step 2.
3432
3419
 
3433
- \`\`\`
3434
- your human partner: "Fix 1-6"
3435
- You understand 1,2,3,6. Unclear on 4,5.
3420
+ ### Step 2: Detect Environment
3436
3421
 
3437
- \u274C WRONG: Implement 1,2,3,6 now, ask about 4,5 later
3438
- \u2705 RIGHT: "I understand items 1,2,3,6. Need clarification on 4 and 5 before proceeding."
3422
+ **Determine workspace state before presenting options:**
3423
+
3424
+ \`\`\`bash
3425
+ GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
3426
+ GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
3439
3427
  \`\`\`
3440
3428
 
3441
- ## Source-Specific Handling
3429
+ This determines which menu to show and how cleanup works:
3442
3430
 
3443
- ### From your human partner
3444
-
3445
- - **Trusted** - implement after understanding
3446
- - **Still ask** if scope unclear
3447
- - **No performative agreement**
3448
- - **Skip to action** or technical acknowledgment
3449
-
3450
- ### From External Reviewers
3451
-
3452
- \`\`\`
3453
- BEFORE implementing:
3454
- 1. Check: Technically correct for THIS codebase?
3455
- 2. Check: Breaks existing functionality?
3456
- 3. Check: Reason for current implementation?
3457
- 4. Check: Works on all platforms/versions?
3458
- 5. Check: Does reviewer understand full context?
3459
-
3460
- IF suggestion seems wrong:
3461
- Push back with technical reasoning
3462
-
3463
- IF can't easily verify:
3464
- Say so: "I can't verify this without [X]. Should I [investigate/ask/proceed]?"
3465
-
3466
- IF conflicts with your human partner's prior decisions:
3467
- Stop and discuss with your human partner first
3468
- \`\`\`
3469
-
3470
- **your human partner's rule:** "External feedback - be skeptical, but check carefully"
3471
-
3472
- ## YAGNI Check for "Professional" Features
3473
-
3474
- \`\`\`
3475
- IF reviewer suggests "implementing properly":
3476
- grep codebase for actual usage
3477
-
3478
- IF unused: "This endpoint isn't called. Remove it (YAGNI)?"
3479
- IF used: Then implement properly
3480
- \`\`\`
3481
-
3482
- **your human partner's rule:** "You and reviewer both report to me. If we don't need this feature, don't add it."
3483
-
3484
- ## Implementation Order
3485
-
3486
- \`\`\`
3487
- FOR multi-item feedback:
3488
- 1. Clarify anything unclear FIRST
3489
- 2. Then implement in this order:
3490
- - Blocking issues (breaks, security)
3491
- - Simple fixes (typos, imports)
3492
- - Complex fixes (refactoring, logic)
3493
- 3. Test each fix individually
3494
- 4. Verify no regressions
3495
- \`\`\`
3496
-
3497
- ## When To Push Back
3498
-
3499
- Push back when:
3500
-
3501
- - Suggestion breaks existing functionality
3502
- - Reviewer lacks full context
3503
- - Violates YAGNI (unused feature)
3504
- - Technically incorrect for this stack
3505
- - Legacy/compatibility reasons exist
3506
- - Conflicts with your human partner's architectural decisions
3507
-
3508
- **How to push back:**
3509
-
3510
- - Use technical reasoning, not defensiveness
3511
- - Ask specific questions
3512
- - Reference working tests/code
3513
- - Involve your human partner if architectural
3514
-
3515
- **Signal if uncomfortable pushing back out loud:** "Strange things are afoot at the Circle K"
3516
-
3517
- ## Acknowledging Correct Feedback
3518
-
3519
- When feedback IS correct:
3520
-
3521
- \`\`\`
3522
- \u2705 "Fixed. [Brief description of what changed]"
3523
- \u2705 "Good catch - [specific issue]. Fixed in [location]."
3524
- \u2705 [Just fix it and show in the code]
3525
-
3526
- \u274C "You're absolutely right!"
3527
- \u274C "Great point!"
3528
- \u274C "Thanks for catching that!"
3529
- \u274C "Thanks for [anything]"
3530
- \u274C ANY gratitude expression
3531
- \`\`\`
3532
-
3533
- **Why no thanks:** Actions speak. Just fix it. The code itself shows you heard the feedback.
3534
-
3535
- **If you catch yourself about to write "Thanks":** DELETE IT. State the fix instead.
3536
-
3537
- ## Gracefully Correcting Your Pushback
3538
-
3539
- If you pushed back and were wrong:
3540
-
3541
- \`\`\`
3542
- \u2705 "You were right - I checked [X] and it does [Y]. Implementing now."
3543
- \u2705 "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing."
3544
-
3545
- \u274C Long apology
3546
- \u274C Defending why you pushed back
3547
- \u274C Over-explaining
3548
- \`\`\`
3549
-
3550
- State the correction factually and move on.
3551
-
3552
- ## Common Mistakes
3553
-
3554
- | Mistake | Fix |
3555
- | ---------------------------- | ----------------------------------- |
3556
- | Performative agreement | State requirement or just act |
3557
- | Blind implementation | Verify against codebase first |
3558
- | Batch without testing | One at a time, test each |
3559
- | Assuming reviewer is right | Check if breaks things |
3560
- | Avoiding pushback | Technical correctness > comfort |
3561
- | Partial implementation | Clarify all items first |
3562
- | Can't verify, proceed anyway | State limitation, ask for direction |
3563
-
3564
- ## Real Examples
3565
-
3566
- **Performative Agreement (Bad):**
3567
-
3568
- \`\`\`
3569
- Reviewer: "Remove legacy code"
3570
- \u274C "You're absolutely right! Let me remove that..."
3571
- \`\`\`
3572
-
3573
- **Technical Verification (Good):**
3574
-
3575
- \`\`\`
3576
- Reviewer: "Remove legacy code"
3577
- \u2705 "Checking... build target is 10.15+, this API needs 13+. Need legacy for backward compat. Current impl has wrong bundle ID - fix it or drop pre-13 support?"
3578
- \`\`\`
3579
-
3580
- **YAGNI (Good):**
3581
-
3582
- \`\`\`
3583
- Reviewer: "Implement proper metrics tracking with database, date filters, CSV export"
3584
- \u2705 "Grepped codebase - nothing calls this endpoint. Remove it (YAGNI)? Or is there usage I'm missing?"
3585
- \`\`\`
3586
-
3587
- **Unclear Item (Good):**
3588
-
3589
- \`\`\`
3590
- your human partner: "Fix items 1-6"
3591
- You understand 1,2,3,6. Unclear on 4,5.
3592
- \u2705 "Understand 1,2,3,6. Need clarification on 4 and 5 before implementing."
3593
- \`\`\`
3594
-
3595
- ## GitHub Thread Replies
3596
-
3597
- When replying to inline review comments on GitHub, reply in the comment thread (\`gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies\`), not as a top-level PR comment.
3598
-
3599
- ## The Bottom Line
3600
-
3601
- **External feedback = suggestions to evaluate, not orders to follow.**
3602
-
3603
- Verify. Question. Then implement.
3604
-
3605
- No performative agreement. Technical rigor always.
3606
- `},merge:{"SKILL.md":`---
3607
- name: compose:merge
3608
- hidden: true
3609
- description: Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
3610
- ---
3611
-
3612
- # Finishing a Development Branch
3613
-
3614
- ## Overview
3615
-
3616
- Guide completion of development work by presenting clear options and handling chosen workflow.
3617
-
3618
- **Core principle:** Verify tests \u2192 Detect environment \u2192 Present options \u2192 Execute choice \u2192 Clean up.
3619
-
3620
- **Announce at start:** "I'm using the compose:merge skill to complete this work."
3621
-
3622
- ## The Process
3623
-
3624
- ### Step 1: Verify Tests
3625
-
3626
- **Before presenting options, verify tests pass:**
3627
-
3628
- \`\`\`bash
3629
- # Run project's test suite
3630
- npm test / cargo test / pytest / go test ./...
3631
- \`\`\`
3632
-
3633
- **If tests fail:**
3634
-
3635
- \`\`\`
3636
- Tests failing (<N> failures). Must fix before completing:
3637
-
3638
- [Show failures]
3639
-
3640
- Cannot proceed with merge/PR until tests pass.
3641
- \`\`\`
3642
-
3643
- Stop. Don't proceed to Step 2.
3644
-
3645
- **If tests pass:** Continue to Step 2.
3646
-
3647
- ### Step 2: Detect Environment
3648
-
3649
- **Determine workspace state before presenting options:**
3650
-
3651
- \`\`\`bash
3652
- GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
3653
- GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
3654
- \`\`\`
3655
-
3656
- This determines which menu to show and how cleanup works:
3657
-
3658
- | State | Menu | Cleanup |
3659
- | -------------------------------------- | ---------------------------- | ------------------------------- |
3660
- | \`GIT_DIR == GIT_COMMON\` (normal repo) | Standard 4 options | No worktree to clean up |
3661
- | \`GIT_DIR != GIT_COMMON\`, named branch | Standard 4 options | Provenance-based (see Step 6) |
3662
- | \`GIT_DIR != GIT_COMMON\`, detached HEAD | Reduced 3 options (no merge) | No cleanup (externally managed) |
3431
+ | State | Menu | Cleanup |
3432
+ | -------------------------------------- | ---------------------------- | ------------------------------- |
3433
+ | \`GIT_DIR == GIT_COMMON\` (normal repo) | Standard 4 options | No worktree to clean up |
3434
+ | \`GIT_DIR != GIT_COMMON\`, named branch | Standard 4 options | Provenance-based (see Step 6) |
3435
+ | \`GIT_DIR != GIT_COMMON\`, detached HEAD | Reduced 3 options (no merge) | No cleanup (externally managed) |
3663
3436
 
3664
3437
  ### Step 3: Determine Base Branch
3665
3438
 
@@ -3871,6 +3644,233 @@ git worktree prune # Self-healing: clean up any stale registrations
3871
3644
  - Clean up worktree for Options 1 & 4 only
3872
3645
  - \`cd\` to main repo root before worktree removal
3873
3646
  - Run \`git worktree prune\` after removal
3647
+ `},feedback:{"SKILL.md":`---
3648
+ name: compose:feedback
3649
+ hidden: true
3650
+ description: Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
3651
+ ---
3652
+
3653
+ # Code Review Reception
3654
+
3655
+ ## Overview
3656
+
3657
+ Code review requires technical evaluation, not emotional performance.
3658
+
3659
+ **Core principle:** Verify before implementing. Ask before assuming. Technical correctness over social comfort.
3660
+
3661
+ ## The Response Pattern
3662
+
3663
+ \`\`\`
3664
+ WHEN receiving code review feedback:
3665
+
3666
+ 1. READ: Complete feedback without reacting
3667
+ 2. UNDERSTAND: Restate requirement in own words (or ask)
3668
+ 3. VERIFY: Check against codebase reality
3669
+ 4. EVALUATE: Technically sound for THIS codebase?
3670
+ 5. RESPOND: Technical acknowledgment or reasoned pushback
3671
+ 6. IMPLEMENT: One item at a time, test each
3672
+ \`\`\`
3673
+
3674
+ ## Forbidden Responses
3675
+
3676
+ **NEVER:**
3677
+
3678
+ - "You're absolutely right!" (sycophantic, not technical)
3679
+ - "Great point!" / "Excellent feedback!" (performative)
3680
+ - "Let me implement that now" (before verification)
3681
+
3682
+ **INSTEAD:**
3683
+
3684
+ - Restate the technical requirement
3685
+ - Ask clarifying questions through \`compose:ask\`, presenting interpretations as options. If no user is available, take your best interpretation and proceed.
3686
+ - Push back with technical reasoning if wrong
3687
+ - Just start working (actions > words)
3688
+
3689
+ ## Handling Unclear Feedback
3690
+
3691
+ \`\`\`
3692
+ IF any item is unclear:
3693
+ STOP - do not implement anything yet
3694
+ ASK for clarification through \`compose:ask\`, presenting your interpretations as options. If no user is available, take the most reasonable interpretation and proceed.
3695
+
3696
+ WHY: Items may be related. Partial understanding = wrong implementation.
3697
+ \`\`\`
3698
+
3699
+ **Example:**
3700
+
3701
+ \`\`\`
3702
+ your human partner: "Fix 1-6"
3703
+ You understand 1,2,3,6. Unclear on 4,5.
3704
+
3705
+ \u274C WRONG: Implement 1,2,3,6 now, ask about 4,5 later
3706
+ \u2705 RIGHT: "I understand items 1,2,3,6. Need clarification on 4 and 5 before proceeding."
3707
+ \`\`\`
3708
+
3709
+ ## Source-Specific Handling
3710
+
3711
+ ### From your human partner
3712
+
3713
+ - **Trusted** - implement after understanding
3714
+ - **Still ask** if scope unclear
3715
+ - **No performative agreement**
3716
+ - **Skip to action** or technical acknowledgment
3717
+
3718
+ ### From External Reviewers
3719
+
3720
+ \`\`\`
3721
+ BEFORE implementing:
3722
+ 1. Check: Technically correct for THIS codebase?
3723
+ 2. Check: Breaks existing functionality?
3724
+ 3. Check: Reason for current implementation?
3725
+ 4. Check: Works on all platforms/versions?
3726
+ 5. Check: Does reviewer understand full context?
3727
+
3728
+ IF suggestion seems wrong:
3729
+ Push back with technical reasoning
3730
+
3731
+ IF can't easily verify:
3732
+ Say so: "I can't verify this without [X]. Should I [investigate/ask/proceed]?"
3733
+
3734
+ IF conflicts with your human partner's prior decisions:
3735
+ Stop and discuss with your human partner first
3736
+ \`\`\`
3737
+
3738
+ **your human partner's rule:** "External feedback - be skeptical, but check carefully"
3739
+
3740
+ ## YAGNI Check for "Professional" Features
3741
+
3742
+ \`\`\`
3743
+ IF reviewer suggests "implementing properly":
3744
+ grep codebase for actual usage
3745
+
3746
+ IF unused: "This endpoint isn't called. Remove it (YAGNI)?"
3747
+ IF used: Then implement properly
3748
+ \`\`\`
3749
+
3750
+ **your human partner's rule:** "You and reviewer both report to me. If we don't need this feature, don't add it."
3751
+
3752
+ ## Implementation Order
3753
+
3754
+ \`\`\`
3755
+ FOR multi-item feedback:
3756
+ 1. Clarify anything unclear FIRST
3757
+ 2. Then implement in this order:
3758
+ - Blocking issues (breaks, security)
3759
+ - Simple fixes (typos, imports)
3760
+ - Complex fixes (refactoring, logic)
3761
+ 3. Test each fix individually
3762
+ 4. Verify no regressions
3763
+ \`\`\`
3764
+
3765
+ ## When To Push Back
3766
+
3767
+ Push back when:
3768
+
3769
+ - Suggestion breaks existing functionality
3770
+ - Reviewer lacks full context
3771
+ - Violates YAGNI (unused feature)
3772
+ - Technically incorrect for this stack
3773
+ - Legacy/compatibility reasons exist
3774
+ - Conflicts with your human partner's architectural decisions
3775
+
3776
+ **How to push back:**
3777
+
3778
+ - Use technical reasoning, not defensiveness
3779
+ - Ask specific questions
3780
+ - Reference working tests/code
3781
+ - Involve your human partner if architectural
3782
+
3783
+ **Signal if uncomfortable pushing back out loud:** "Strange things are afoot at the Circle K"
3784
+
3785
+ ## Acknowledging Correct Feedback
3786
+
3787
+ When feedback IS correct:
3788
+
3789
+ \`\`\`
3790
+ \u2705 "Fixed. [Brief description of what changed]"
3791
+ \u2705 "Good catch - [specific issue]. Fixed in [location]."
3792
+ \u2705 [Just fix it and show in the code]
3793
+
3794
+ \u274C "You're absolutely right!"
3795
+ \u274C "Great point!"
3796
+ \u274C "Thanks for catching that!"
3797
+ \u274C "Thanks for [anything]"
3798
+ \u274C ANY gratitude expression
3799
+ \`\`\`
3800
+
3801
+ **Why no thanks:** Actions speak. Just fix it. The code itself shows you heard the feedback.
3802
+
3803
+ **If you catch yourself about to write "Thanks":** DELETE IT. State the fix instead.
3804
+
3805
+ ## Gracefully Correcting Your Pushback
3806
+
3807
+ If you pushed back and were wrong:
3808
+
3809
+ \`\`\`
3810
+ \u2705 "You were right - I checked [X] and it does [Y]. Implementing now."
3811
+ \u2705 "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing."
3812
+
3813
+ \u274C Long apology
3814
+ \u274C Defending why you pushed back
3815
+ \u274C Over-explaining
3816
+ \`\`\`
3817
+
3818
+ State the correction factually and move on.
3819
+
3820
+ ## Common Mistakes
3821
+
3822
+ | Mistake | Fix |
3823
+ | ---------------------------- | ----------------------------------- |
3824
+ | Performative agreement | State requirement or just act |
3825
+ | Blind implementation | Verify against codebase first |
3826
+ | Batch without testing | One at a time, test each |
3827
+ | Assuming reviewer is right | Check if breaks things |
3828
+ | Avoiding pushback | Technical correctness > comfort |
3829
+ | Partial implementation | Clarify all items first |
3830
+ | Can't verify, proceed anyway | State limitation, ask for direction |
3831
+
3832
+ ## Real Examples
3833
+
3834
+ **Performative Agreement (Bad):**
3835
+
3836
+ \`\`\`
3837
+ Reviewer: "Remove legacy code"
3838
+ \u274C "You're absolutely right! Let me remove that..."
3839
+ \`\`\`
3840
+
3841
+ **Technical Verification (Good):**
3842
+
3843
+ \`\`\`
3844
+ Reviewer: "Remove legacy code"
3845
+ \u2705 "Checking... build target is 10.15+, this API needs 13+. Need legacy for backward compat. Current impl has wrong bundle ID - fix it or drop pre-13 support?"
3846
+ \`\`\`
3847
+
3848
+ **YAGNI (Good):**
3849
+
3850
+ \`\`\`
3851
+ Reviewer: "Implement proper metrics tracking with database, date filters, CSV export"
3852
+ \u2705 "Grepped codebase - nothing calls this endpoint. Remove it (YAGNI)? Or is there usage I'm missing?"
3853
+ \`\`\`
3854
+
3855
+ **Unclear Item (Good):**
3856
+
3857
+ \`\`\`
3858
+ your human partner: "Fix items 1-6"
3859
+ You understand 1,2,3,6. Unclear on 4,5.
3860
+ \u2705 "Understand 1,2,3,6. Need clarification on 4 and 5 before implementing."
3861
+ \`\`\`
3862
+
3863
+ ## GitHub Thread Replies
3864
+
3865
+ When replying to inline review comments on GitHub, reply in the comment thread (\`gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies\`), not as a top-level PR comment.
3866
+
3867
+ ## The Bottom Line
3868
+
3869
+ **External feedback = suggestions to evaluate, not orders to follow.**
3870
+
3871
+ Verify. Question. Then implement.
3872
+
3873
+ No performative agreement. Technical rigor always.
3874
3874
  `},"new-skill":{"SKILL.md":`---
3875
3875
  name: compose:new-skill
3876
3876
  hidden: true
@@ -7541,7 +7541,7 @@ export const tui: TuiPlugin = async (api) => {
7541
7541
  - Use \`.tsx\` extension for JSX support
7542
7542
  - Components use Solid.js JSX (NOT React) \u2014 no useState/useEffect, use signals
7543
7543
  - Keep plugins lightweight \u2014 they run in the main rendering thread
7544
- `}}}catch($){if($ instanceof ReferenceError)return ZD();throw $}}var xg=Tg(),kg=J0.create({service:"skill.builtin"}),YD=V.fn("Skill.extractBuiltinBundle")(function*($){let Z=JD.join(SJ.data,"builtin_skills",x1),J=JD.join(Z,".extracted");return yield*SX({fsys:$,bundle:xg,root:Z,marker:J,markerContent:x1,skipIfPresent:!xX,onExtracted:(Y)=>kg.info("extracted builtin skills",{root:Y})})});var TJ=J0.create({service:"skill"}),hg=[".claude",".agents",".codex",".opencode"],QD="skills/**/SKILL.md",gg="{skill,skills}/**/SKILL.md",kX="**/SKILL.md",XD=_.object({name:_.string(),description:_.string(),location:_.string(),content:_.string(),hidden:_.boolean().optional()}),vg=q$.create("SkillInvalidError",_.object({path:_.string(),message:_.string().optional(),issues:_.custom().optional()})),fg=q$.create("SkillNameMismatchError",_.object({path:_.string(),expected:_.string(),actual:_.string()})),mg=V.fnUntraced(function*($,Z,J){let Y=yield*V.tryPromise({try:()=>L9.parse(Z),catch:(X)=>X}).pipe(V.catch(V.fnUntraced(function*(X){let K=L9.FrontmatterError.isInstance(X)?X.data.message:`Failed to parse skill ${Z}`,{Session:W}=yield*V.promise(()=>import("./chunk-4sgy87h5.js"));yield*J.publish(W.Event.Error,{error:new q$.Unknown({message:K}).toObject()}),TJ.error("failed to load skill",{skill:Z,err:X});return})));if(!Y)return;let Q=XD.pick({name:!0,description:!0,hidden:!0}).safeParse(Y.data);if(!Q.success)return;if($.skills[Q.data.name])TJ.warn("duplicate skill name",{name:Q.data.name,existing:$.skills[Q.data.name].location,duplicate:Z});$.dirs.add(n7.dirname(Z)),$.skills[Q.data.name]={name:Q.data.name,description:Q.data.description,location:Z,content:Y.content,hidden:Q.data.hidden}}),A9=V.fnUntraced(function*($,Z,J,Y){let Q=yield*V.tryPromise({try:()=>c8.scan(J,{cwd:Z,absolute:!0,include:"file",symlink:!0,dot:Y?.dot}),catch:(X)=>X}).pipe(V.catch((X)=>{if(!Y?.scope)return V.die(X);return TJ.error(`failed to scan ${Y.scope} skills`,{dir:Z,error:X}),V.succeed([])}));for(let X of Q)$.matches.add(X),$.dirs.add(n7.dirname(X))}),dg=V.fnUntraced(function*($,Z,J,Y,Q){let X={matches:new Set,dirs:new Set};if(!c0.QITQODE_DISABLE_BUILTIN_SKILLS){let G=yield*YD(J).pipe(V.catch(()=>V.succeed(void 0)));if(G&&(yield*J.isDir(G)))yield*A9(X,G,kX,{scope:"builtin"})}if(!c0.QITQODE_DISABLE_COMPOSE_SKILLS){let G=yield*e_(J).pipe(V.catch(()=>V.succeed(void 0)));if(G&&(yield*J.isDir(G)))yield*A9(X,G,kX,{scope:"compose"})}if(!c0.QITQODE_DISABLE_EXTERNAL_SKILLS){let G=hg.filter((B)=>{if(B===".claude"&&c0.QITQODE_DISABLE_CLAUDE_CODE_SKILLS)return!1;if(B===".codex"&&c0.QITQODE_DISABLE_CODEX_SKILLS)return!1;if(B===".opencode"&&c0.QITQODE_DISABLE_OPENCODE_SKILLS)return!1;return!0});for(let B of G){let j=n7.join(e0.Path.home,B);if(!(yield*J.isDir(j)))continue;yield*A9(X,j,QD,{dot:!0,scope:"global"})}let H=yield*J.up({targets:G,start:Y,stop:Q}).pipe(V.catch(()=>V.succeed([])));for(let B of H)yield*A9(X,B,QD,{dot:!0,scope:"project"})}let K=yield*$.directories();for(let G of K)yield*A9(X,G,gg);let W=yield*$.get();for(let G of W.skills?.paths??[]){let H=G.startsWith("~/")?n7.join(bg.homedir(),G.slice(2)):G,B=n7.isAbsolute(H)?H:n7.join(Y,H);if(!(yield*J.isDir(B))){TJ.warn("skill path not found",{path:B});continue}yield*A9(X,B,kX)}for(let G of W.skills?.urls??[]){let H=yield*Z.pull(G);for(let B of H)yield*A9(X,B,kX)}return{matches:Array.from(X.matches),dirs:Array.from(X.dirs)}}),ug=V.fnUntraced(function*($,Z,J){yield*V.forEach(Z.matches,(Y)=>mg($,Y,J),{concurrency:16,discard:!0}),TJ.info("init",{count:Object.keys($.skills).length})});class bX extends Q0.Service()("@qitqode/Skill"){}var VD=k.effect(bX,V.gen(function*(){let $=yield*y6.Service,Z=yield*H0.Service,J=yield*e.Service,Y=yield*K0.Service,Q=yield*c.make(V.fn("Skill.discovery")(function*(j){return yield*dg(Z,$,Y,j.directory,j.worktree)})),X=yield*c.make(V.fn("Skill.state")(function*(j){let O={skills:{},dirs:new Set};return yield*ug(O,yield*c.get(Q),J),O})),K=V.fn("Skill.get")(function*(j){return(yield*c.get(X)).skills[j]}),W=V.fn("Skill.all")(function*(){let j=yield*c.get(X);return Object.values(j.skills)}),G=V.fn("Skill.dirs")(function*(){return(yield*c.get(Q)).dirs}),H=V.fn("Skill.available")(function*(j){let O=yield*c.get(X),U=Object.values(O.skills).filter((F)=>!F.hidden);if(U=U.toSorted((F,q)=>F.name.localeCompare(q.name)),!j)return U;return U.filter((F)=>M0.evaluate("skill",F.name,j.permission).action!=="deny")}),B=V.fn("Skill.reload")(function*(){yield*c.invalidate(Q),yield*c.invalidate(X)});return bX.of({get:K,all:W,dirs:G,available:H,reload:B})})),cg=VD.pipe(k.provide(y6.defaultLayer),k.provide(H0.defaultLayer),k.provide(e.layer),k.provide(K0.defaultLayer));function lg($,Z){if($.length===0)return"No skills are currently available.";if(Z.verbose)return["<available_skills>",...$.sort((J,Y)=>J.name.localeCompare(Y.name)).flatMap((J)=>[" <skill>",` <name>${J.name}</name>`,` <description>${J.description}</description>`,` <location>${Eg(J.location).href}</location>`," </skill>"]),"</available_skills>"].join(`
7544
+ `}}}catch($){if($ instanceof ReferenceError)return ZD();throw $}}var xg=Tg(),kg=J0.create({service:"skill.builtin"}),YD=V.fn("Skill.extractBuiltinBundle")(function*($){let Z=JD.join(SJ.data,"builtin_skills",x1),J=JD.join(Z,".extracted");return yield*SX({fsys:$,bundle:xg,root:Z,marker:J,markerContent:x1,skipIfPresent:!xX,onExtracted:(Y)=>kg.info("extracted builtin skills",{root:Y})})});var TJ=J0.create({service:"skill"}),hg=[".claude",".agents",".codex",".opencode"],QD="skills/**/SKILL.md",gg="{skill,skills}/**/SKILL.md",kX="**/SKILL.md",XD=_.object({name:_.string(),description:_.string(),location:_.string(),content:_.string(),hidden:_.boolean().optional()}),vg=q$.create("SkillInvalidError",_.object({path:_.string(),message:_.string().optional(),issues:_.custom().optional()})),fg=q$.create("SkillNameMismatchError",_.object({path:_.string(),expected:_.string(),actual:_.string()})),mg=V.fnUntraced(function*($,Z,J){let Y=yield*V.tryPromise({try:()=>L9.parse(Z),catch:(X)=>X}).pipe(V.catch(V.fnUntraced(function*(X){let K=L9.FrontmatterError.isInstance(X)?X.data.message:`Failed to parse skill ${Z}`,{Session:W}=yield*V.promise(()=>import("./chunk-e01jgnnm.js"));yield*J.publish(W.Event.Error,{error:new q$.Unknown({message:K}).toObject()}),TJ.error("failed to load skill",{skill:Z,err:X});return})));if(!Y)return;let Q=XD.pick({name:!0,description:!0,hidden:!0}).safeParse(Y.data);if(!Q.success)return;if($.skills[Q.data.name])TJ.warn("duplicate skill name",{name:Q.data.name,existing:$.skills[Q.data.name].location,duplicate:Z});$.dirs.add(n7.dirname(Z)),$.skills[Q.data.name]={name:Q.data.name,description:Q.data.description,location:Z,content:Y.content,hidden:Q.data.hidden}}),A9=V.fnUntraced(function*($,Z,J,Y){let Q=yield*V.tryPromise({try:()=>c8.scan(J,{cwd:Z,absolute:!0,include:"file",symlink:!0,dot:Y?.dot}),catch:(X)=>X}).pipe(V.catch((X)=>{if(!Y?.scope)return V.die(X);return TJ.error(`failed to scan ${Y.scope} skills`,{dir:Z,error:X}),V.succeed([])}));for(let X of Q)$.matches.add(X),$.dirs.add(n7.dirname(X))}),dg=V.fnUntraced(function*($,Z,J,Y,Q){let X={matches:new Set,dirs:new Set};if(!c0.QITQODE_DISABLE_BUILTIN_SKILLS){let G=yield*YD(J).pipe(V.catch(()=>V.succeed(void 0)));if(G&&(yield*J.isDir(G)))yield*A9(X,G,kX,{scope:"builtin"})}if(!c0.QITQODE_DISABLE_COMPOSE_SKILLS){let G=yield*e_(J).pipe(V.catch(()=>V.succeed(void 0)));if(G&&(yield*J.isDir(G)))yield*A9(X,G,kX,{scope:"compose"})}if(!c0.QITQODE_DISABLE_EXTERNAL_SKILLS){let G=hg.filter((B)=>{if(B===".claude"&&c0.QITQODE_DISABLE_CLAUDE_CODE_SKILLS)return!1;if(B===".codex"&&c0.QITQODE_DISABLE_CODEX_SKILLS)return!1;if(B===".opencode"&&c0.QITQODE_DISABLE_OPENCODE_SKILLS)return!1;return!0});for(let B of G){let j=n7.join(e0.Path.home,B);if(!(yield*J.isDir(j)))continue;yield*A9(X,j,QD,{dot:!0,scope:"global"})}let H=yield*J.up({targets:G,start:Y,stop:Q}).pipe(V.catch(()=>V.succeed([])));for(let B of H)yield*A9(X,B,QD,{dot:!0,scope:"project"})}let K=yield*$.directories();for(let G of K)yield*A9(X,G,gg);let W=yield*$.get();for(let G of W.skills?.paths??[]){let H=G.startsWith("~/")?n7.join(bg.homedir(),G.slice(2)):G,B=n7.isAbsolute(H)?H:n7.join(Y,H);if(!(yield*J.isDir(B))){TJ.warn("skill path not found",{path:B});continue}yield*A9(X,B,kX)}for(let G of W.skills?.urls??[]){let H=yield*Z.pull(G);for(let B of H)yield*A9(X,B,kX)}return{matches:Array.from(X.matches),dirs:Array.from(X.dirs)}}),ug=V.fnUntraced(function*($,Z,J){yield*V.forEach(Z.matches,(Y)=>mg($,Y,J),{concurrency:16,discard:!0}),TJ.info("init",{count:Object.keys($.skills).length})});class bX extends Q0.Service()("@qitqode/Skill"){}var VD=k.effect(bX,V.gen(function*(){let $=yield*y6.Service,Z=yield*H0.Service,J=yield*e.Service,Y=yield*K0.Service,Q=yield*c.make(V.fn("Skill.discovery")(function*(j){return yield*dg(Z,$,Y,j.directory,j.worktree)})),X=yield*c.make(V.fn("Skill.state")(function*(j){let O={skills:{},dirs:new Set};return yield*ug(O,yield*c.get(Q),J),O})),K=V.fn("Skill.get")(function*(j){return(yield*c.get(X)).skills[j]}),W=V.fn("Skill.all")(function*(){let j=yield*c.get(X);return Object.values(j.skills)}),G=V.fn("Skill.dirs")(function*(){return(yield*c.get(Q)).dirs}),H=V.fn("Skill.available")(function*(j){let O=yield*c.get(X),U=Object.values(O.skills).filter((F)=>!F.hidden);if(U=U.toSorted((F,q)=>F.name.localeCompare(q.name)),!j)return U;return U.filter((F)=>M0.evaluate("skill",F.name,j.permission).action!=="deny")}),B=V.fn("Skill.reload")(function*(){yield*c.invalidate(Q),yield*c.invalidate(X)});return bX.of({get:K,all:W,dirs:G,available:H,reload:B})})),cg=VD.pipe(k.provide(y6.defaultLayer),k.provide(H0.defaultLayer),k.provide(e.layer),k.provide(K0.defaultLayer));function lg($,Z){if($.length===0)return"No skills are currently available.";if(Z.verbose)return["<available_skills>",...$.sort((J,Y)=>J.name.localeCompare(Y.name)).flatMap((J)=>[" <skill>",` <name>${J.name}</name>`,` <description>${J.description}</description>`,` <location>${Eg(J.location).href}</location>`," </skill>"]),"</available_skills>"].join(`
7545
7545
  `);return["## Available Skills",...$.toSorted((J,Y)=>J.name.localeCompare(Y.name)).map((J)=>`- **${J.name}**: ${J.description}`)].join(`
7546
7546
  `)}var c5=m0("skill",V.gen(function*(){let $=(yield*V0.toolDescriptionEffect("skill"))??"",Z=yield*W2.Service,J=yield*o2.Service;return{description:$,parameters:uj,execute:(Y,Q)=>V.gen(function*(){let X=yield*Z.get(Y.name);if(!X){let j=(yield*Z.all()).map((O)=>O.name).join(", ");throw Error(`Skill "${Y.name}" not found. Available skills: ${j||"none"}`)}yield*Q.ask({permission:"skill",patterns:[Y.name],always:[Y.name],metadata:{}});let K=KD.dirname(X.location),W=pg(K).href,G=10,H=yield*J.files({cwd:K,follow:!1,hidden:!0,signal:Q.abort}).pipe(R6((B)=>!B.includes("SKILL.md")),I6((B)=>KD.resolve(K,B)),DQ(G),V7,V.map((B)=>[...B].map((j)=>`<file>${j}</file>`).join(`
7547
7547
  `)));return{title:`Loaded skill: ${X.name}`,output:[`<skill_content name="${X.name}">`,`# Skill: ${X.name}`,"",X.content.trim(),"",`Base directory for this skill: ${W}`,"Relative paths in this skill (e.g., scripts/, reference/) are relative to this base directory.","Note: file list is sampled.","","<skill_files>",H,"</skill_files>","</skill_content>"].join(`
@@ -8148,7 +8148,7 @@ If you repeat the same output again, the session will be terminated.
8148
8148
  `):[`Your last ${SZ} steps have been identical \u2014 you appear to be`,"repeating the same action without making progress. Stop and reconsider:","the current approach is not working. Try a different strategy, use a","different tool, or if you are blocked, explain the blocker to the user","instead of repeating the same step again."].join(`
8149
8149
  `)})})}var cB=J0.create({service:"auto-dream"}),lB=86400000,au=7,tu=30,fw=1e4,pB="Auto Dream",oB="Auto Distill",gw=0,vw=0,mw=["Run one automatic dream memory consolidation pass for the current project.","","Use the memory files as the working index and the raw qitqode trajectory database as the source of truth.","Use bash for read-only SQLite and filesystem inspection. Do not modify the database.","Consolidate only durable, verified information into project memory."].join(`
8150
8150
  `),dw=["Run one automatic distill pass for the current project.","","Review the past month of sessions and identify repeated manual workflows worth packaging.","Use the raw qitqode trajectory database as the source of truth and memory files to spot cross-session patterns.","Inventory existing skills, agents, and commands first so you reuse or extend instead of duplicating.","Use bash for read-only SQLite and filesystem inspection. Do not modify the database.","Produce a compact shortlist, then create only the high-confidence missing assets."].join(`
8151
- `);function uw($){return V.gen(function*(){if(!$.enabled)return!1;let Z=$.intervalDays*lB,J=yield*V.sync(()=>C0.use((X)=>X.select({time_created:W$.time_created}).from(W$).where(D0(W$.title,$.title)).orderBy(x8(W$.time_created)).limit(1).get())),Y=Date.now(),Q=J?Y-J.time_created:1/0;if(!J){let X=yield*V.sync(()=>C0.use((K)=>K.select({time_created:W$.time_created}).from(W$).where(XJ(W$.parent_id)).orderBy(H8(W$.time_created)).limit(1).get()));if(!X||Y-X.time_created<Z)return cB.info(`auto-${$.label} skipped \u2014 project too young`,{projectAge:X?Math.round((Y-X.time_created)/lB)+"d":"empty",interval:$.intervalDays+"d"}),!1}if(Q<Z)return cB.info(`auto-${$.label} skipped \u2014 last run too recent`,{lastRunAgo:Math.round(Q/lB)+"d",interval:$.intervalDays+"d"}),!1;return cB.info(`auto-${$.label} triggering`,{lastRun:J?new Date(J.time_created).toISOString():"never",interval:$.intervalDays+"d"}),!0})}function cw($){let Z=$.dream?.auto!==!1;if(!Z)return V.succeed(!1);let J=Date.now();if(J-gw<fw)return V.succeed(!1);gw=J;let Y=$.dream?.interval_days??au;return uw({enabled:Z,intervalDays:Y,title:pB,label:"dream"})}function lw($){let Z=$.distill?.auto!==!1;if(!Z)return V.succeed(!1);let J=Date.now();if(J-vw<fw)return V.succeed(!1);vw=J;let Y=$.distill?.interval_days??tu;return uw({enabled:Z,intervalDays:Y,title:oB,label:"distill"})}var pw=V.fnUntraced(function*($){let Z=yield*$.config.get(),J=yield*cw(Z).pipe(V.catch(()=>V.succeed(!1))),Y=yield*lw(Z).pipe(V.catch(()=>V.succeed(!1))),Q={providerID:$.lastUser.model.providerID,modelID:$.lastUser.model.modelID};if(!J&&!Y)return;let{AppRuntime:X}=yield*V.promise(()=>import("./chunk-e2pqvscp.js"));if(J)X.runPromise(f$.use((K)=>V.gen(function*(){let W=yield*K.create({title:pB});yield*(yield*$.promptServiceTag).prompt({sessionID:W.id,agent:"dream",model:Q,parts:[{type:"text",text:mw}]})}))).catch((K)=>$.log.error("auto-dream prompt failed",{error:String(K)}));if(Y)X.runPromise(f$.use((K)=>V.gen(function*(){let W=yield*K.create({title:oB});yield*(yield*$.promptServiceTag).prompt({sessionID:W.id,agent:"distill",model:Q,parts:[{type:"text",text:dw}]})}))).catch((K)=>$.log.error("auto-distill prompt failed",{error:String(K)}))});var $c=($)=>$.pipe(V.catchDefect((Z)=>Z instanceof V0.BackendAuthRejectedError?V.succeed(void 0):V.die(Z))),iB=($)=>$c(V.promise(()=>V0.resolvePrompt($))).pipe(V.map((Z)=>Z??"")),ow=V.gen(function*(){let $=yield*iB("session/build-switch"),Z=yield*iB("session/max-steps"),J=yield*iB("session/compose");return{buildSwitch:$,maxSteps:Z,promptCompose:J}});var iw=S1.create({service:"session.prompt"}),Zc=J0.create({service:"session.prompt"}),Jc=/\b(implement|build|create|make|scaffold|generate|fix|repair|add|change|update|refactor|remove)\b/i,Yc=/\b(explain|review|investigate|analy[sz]e|research|inspect|tell me how|how (?:do|would|should|can))\b/i,Qc=/(?:^|\b(?:and|then)\s+)(?:please\s+)?(?:implement|build|create|make|scaffold|generate|fix|repair|add|change|update|refactor|remove)\b/i,Xc=/\b(tell me how|how (?:do|would|should|can)|read[- ]only|(?:explain|review|investigate|analy[sz]e|research|inspect)\s+only|(?:do not|don't)\s+(?:edit|change|modify|write|implement|fix|repair|remove|delete)\s+(?:anything|any\s+(?:code|files?)|the\s+(?:code|files?)|code|files?)|without\s+(?:editing|changing|modifying|writing)\s+(?:anything|any\s+(?:code|files?)|the\s+(?:code|files?)|code|files?)|no\s+(?:code|file)\s+changes?)\b/i;function Vc($,Z){if(!$||$.native!==!0||x9($)!=="interactive-build")return!1;let J=Z.filter((Y)=>Y.type==="text"&&!Y.synthetic).map((Y)=>Y.text).join(`
8151
+ `);function uw($){return V.gen(function*(){if(!$.enabled)return!1;let Z=$.intervalDays*lB,J=yield*V.sync(()=>C0.use((X)=>X.select({time_created:W$.time_created}).from(W$).where(D0(W$.title,$.title)).orderBy(x8(W$.time_created)).limit(1).get())),Y=Date.now(),Q=J?Y-J.time_created:1/0;if(!J){let X=yield*V.sync(()=>C0.use((K)=>K.select({time_created:W$.time_created}).from(W$).where(XJ(W$.parent_id)).orderBy(H8(W$.time_created)).limit(1).get()));if(!X||Y-X.time_created<Z)return cB.info(`auto-${$.label} skipped \u2014 project too young`,{projectAge:X?Math.round((Y-X.time_created)/lB)+"d":"empty",interval:$.intervalDays+"d"}),!1}if(Q<Z)return cB.info(`auto-${$.label} skipped \u2014 last run too recent`,{lastRunAgo:Math.round(Q/lB)+"d",interval:$.intervalDays+"d"}),!1;return cB.info(`auto-${$.label} triggering`,{lastRun:J?new Date(J.time_created).toISOString():"never",interval:$.intervalDays+"d"}),!0})}function cw($){let Z=$.dream?.auto!==!1;if(!Z)return V.succeed(!1);let J=Date.now();if(J-gw<fw)return V.succeed(!1);gw=J;let Y=$.dream?.interval_days??au;return uw({enabled:Z,intervalDays:Y,title:pB,label:"dream"})}function lw($){let Z=$.distill?.auto!==!1;if(!Z)return V.succeed(!1);let J=Date.now();if(J-vw<fw)return V.succeed(!1);vw=J;let Y=$.distill?.interval_days??tu;return uw({enabled:Z,intervalDays:Y,title:oB,label:"distill"})}var pw=V.fnUntraced(function*($){let Z=yield*$.config.get(),J=yield*cw(Z).pipe(V.catch(()=>V.succeed(!1))),Y=yield*lw(Z).pipe(V.catch(()=>V.succeed(!1))),Q={providerID:$.lastUser.model.providerID,modelID:$.lastUser.model.modelID};if(!J&&!Y)return;let{AppRuntime:X}=yield*V.promise(()=>import("./chunk-wf41m019.js"));if(J)X.runPromise(f$.use((K)=>V.gen(function*(){let W=yield*K.create({title:pB});yield*(yield*$.promptServiceTag).prompt({sessionID:W.id,agent:"dream",model:Q,parts:[{type:"text",text:mw}]})}))).catch((K)=>$.log.error("auto-dream prompt failed",{error:String(K)}));if(Y)X.runPromise(f$.use((K)=>V.gen(function*(){let W=yield*K.create({title:oB});yield*(yield*$.promptServiceTag).prompt({sessionID:W.id,agent:"distill",model:Q,parts:[{type:"text",text:dw}]})}))).catch((K)=>$.log.error("auto-distill prompt failed",{error:String(K)}))});var $c=($)=>$.pipe(V.catchDefect((Z)=>Z instanceof V0.BackendAuthRejectedError?V.succeed(void 0):V.die(Z))),iB=($)=>$c(V.promise(()=>V0.resolvePrompt($))).pipe(V.map((Z)=>Z??"")),ow=V.gen(function*(){let $=yield*iB("session/build-switch"),Z=yield*iB("session/max-steps"),J=yield*iB("session/compose");return{buildSwitch:$,maxSteps:Z,promptCompose:J}});var iw=S1.create({service:"session.prompt"}),Zc=J0.create({service:"session.prompt"}),Jc=/\b(implement|build|create|make|scaffold|generate|fix|repair|add|change|update|refactor|remove)\b/i,Yc=/\b(explain|review|investigate|analy[sz]e|research|inspect|tell me how|how (?:do|would|should|can))\b/i,Qc=/(?:^|\b(?:and|then)\s+)(?:please\s+)?(?:implement|build|create|make|scaffold|generate|fix|repair|add|change|update|refactor|remove)\b/i,Xc=/\b(tell me how|how (?:do|would|should|can)|read[- ]only|(?:explain|review|investigate|analy[sz]e|research|inspect)\s+only|(?:do not|don't)\s+(?:edit|change|modify|write|implement|fix|repair|remove|delete)\s+(?:anything|any\s+(?:code|files?)|the\s+(?:code|files?)|code|files?)|without\s+(?:editing|changing|modifying|writing)\s+(?:anything|any\s+(?:code|files?)|the\s+(?:code|files?)|code|files?)|no\s+(?:code|file)\s+changes?)\b/i;function Vc($,Z){if(!$||$.native!==!0||x9($)!=="interactive-build")return!1;let J=Z.filter((Y)=>Y.type==="text"&&!Y.synthetic).map((Y)=>Y.text).join(`
8152
8152
  `);if(!J||Xc.test(J))return!1;if(!Jc.test(J))return!1;return!Yc.test(J)||Qc.test(J)}function nw($,Z,J,Y){return V.gen(function*(){let{bus:Q,status:X,sessions:K,agents:W,provider:G,processor:H,prune:B,checkpoint:j,compaction:O,config:U,plugin:F,permission:q,fsys:w,registry:D,scope:z,instruction:C,state:P,goal:y,taskGateState:I,taskRegistry:x,revert:h,summary:S,sys:v,llm:L,actorRegistry:T,inbox:E}=yield*F3,N=yield*ow,R=N.buildSwitch,b=N.maxSteps,r=N.promptCompose,l=(G0,Z0,n)=>Bw(G,Q,G0,Z0,n),d=(G0,Z0)=>jw(K,G0,Z0),u=uB(K),o=1024,W0=new class extends Set{add(G0){if(super.add(G0),this.size>1024){let Z0=this.values().next().value;if(Z0!==void 0)this.delete(Z0)}return this}},a=(G0)=>EB({getOps:$,...G0}),f=zw({agents:W,provider:G,llm:L,sessions:K,elog:iw}),$0=_w({sessions:K,fsys:w,buildSwitch:R,promptCompose:r});return{runLoop:V.fn("SessionPrompt.run")(function*(G0,Z0,n){let _0=yield*c.context,i=iw.with({sessionID:G0}),t,O0=0,w0=yield*K.get(G0),N0,r0,K$=new Map,l$=Z0??"main",b2=Kw({sessionID:G0,agentID:l$,task_id:n,plugin:F,bus:Q,prune:B,scope:z}),{cancellation:P2,agentMetrics:n$,publishAgentRequest:s$,schedulePrune:$$}=b2,Y8=Vw({sessionID:G0,agentID:l$,task_id:n,session:w0,cancellation:P2,plugin:F});return yield*V.gen(function*(){yield*b2.before;let U2=(Y2,g0)=>_3(mC(Y2,g0,X0.parts(g0.id))),Y1=!1,M2=xw({sessionID:G0,bus:Q,appendSyntheticUserTurn:u,slog:i}),C8=Tw({sessionID:G0,sessions:K,bus:Q,appendSyntheticUserTurn:u,slog:i}),{autoContinueOutputLength:CY,autoRecoverOutputBudget:d1,autoContinueStreamCutoff:wY,autoContinueInvalidOutput:NY,autoRetryStructuredOutput:j$,handleTextRepeat:n0,writeContentFilterError:h$,writeModelError:F1}=C8,L1=Ow({sessionID:G0,agentID:Z0,agents:W,taskGateState:I,taskRegistry:x,appendSyntheticUserTurn:u,slog:i}),U6=Uw({sessionID:G0,agentID:Z0,session:w0,goal:y,bus:Q,appendSyntheticUserTurn:u,slog:i});while(!0){if(!Z0||Z0==="main")yield*X.set(G0,{type:"busy"});yield*E.drain(G0,Z0??"main").pipe(V.ignore),yield*i.info("loop",{step:O0});let Y2=yield*X0.filterCompactedEffect(G0,{contextFrom:w0.contextFrom,contextWatermark:w0.contextWatermark,agentID:Z0??"main"}),g0,v8,C2,EZ,w2,N2=[];for(let t0=Y2.length-1;t0>=0;t0--){let g$=Y2[t0];if(!g0&&g$.info.role==="user")g0=g$.info,v8=g$;if(!C2&&g$.info.role==="assistant")C2=g$.info,EZ=g$;if(!w2&&g$.info.role==="assistant"&&g$.info.finish)w2=g$.info;if(g0&&w2)break;if(!w2){let f8=g$.parts.filter((X8)=>X8.type==="subtask");N2.push(...f8)}}if(!g0)throw Error("No user message found in stream. This should never happen.");yield*bw({sessionID:G0,msgs:Y2,checkpoint:j,config:U});let e9=EZ?.parts.some((t0)=>t0.type==="tool"&&!t0.metadata?.providerExecuted)??!1;if(C2?.finish==="length"&&!e9&&g0.id<C2.id&&(yield*CY({lastUser:g0,assistant:C2})))continue;if(C2){if(yield*d1({lastUser:g0,assistant:C2}))continue;if(yield*wY({lastUser:g0,assistant:C2}))continue;let t0=TB({phase:"existing-assistant",lastUser:g0,assistant:C2,parts:EZ?.parts??[]});if(t0.type==="filtered"){yield*h$({assistant:C2}),yield*i.info("exiting loop",{classification:t0.type});break}if(t0.type==="failed"){yield*F1({assistant:C2,reason:t0.reason}),yield*i.info("exiting loop",{classification:t0.type,reason:t0.reason});break}if(t0.type==="think-only"||t0.type==="invalid"){let g$=t0.type==="invalid"?t0.reason:"think-only";if(yield*NY({lastUser:g0,assistant:C2,reason:g$}))continue;yield*i.info("exiting loop",{classification:t0.type});break}if(t0.type==="final"&&t0.degraded)yield*i.warn("degraded final on abnormal finish",{finish:C2.finish});if(t0.type!=="continue"){if(yield*L1(g0))continue;if(yield*U6(g0))continue;yield*i.info("exiting loop",{classification:t0.type});break}}if(O0++,O0===1)yield*f({session:w0,modelID:g0.model.modelID,providerID:g0.model.providerID,history:Y2}).pipe(V.ignore,V.forkIn(z));if(O0===1&&!w0.parentID)yield*pw({config:U,lastUser:g0,promptServiceTag:Y,log:Zc});let y1=yield*l(g0.model.providerID,g0.model.modelID,G0);r0=y1,N0=w2;let AY=N2.pop();if(AY?.type==="subtask"){yield*a({task:AY,model:y1,lastUser:g0,sessionID:G0,session:w0,msgs:Y2});continue}let N8=v8;if(N8?.parts.some((t0)=>t0.type==="compaction")){let t0=N8.parts.find((X8)=>X8.type==="compaction"),g$=yield*K.messages({sessionID:G0,agentID:g0.agentID??"main"});if((yield*O.process({parentID:g0.id,messages:g$,sessionID:G0,auto:t0?.auto??!1,overflow:t0?.overflow,agentID:g0.agentID}))==="stop")break;continue}yield*Ew({sessionID:G0,msgs:Y2,lastFinished:w2,model:y1,config:U});let P0=yield*W.get(g0.agent),a0=P0?.native===!0&&P0?.hidden===!0;if(hw({sessionID:G0,msgs:Y2,lastFinished:w2,allowDiscoveryRecovery:Vc(P0,v8?.parts??[])}),!Y1&&!a0&&w2&&w2.tokens){let t0=yield*$();yield*B.fireCheckpoints({sessionID:G0,model:y1,tokens:w2.tokens,promptOps:t0,agentID:g0.agentID}).pipe(V.ignore)}if(!Y1&&w2&&w2.tokens){if(yield*Qw({config:U,checkpoint:j,compaction:O,prune:B},{sessionID:G0,lastFinished:w2,lastUser:g0,model:y1,msgs:Y2,isBoundedComputation:a0})){Y1=!0;continue}}if(Y1=!1,!P0)throw yield*xB(W,Q,g0.agent,G0);let A8=P0.steps??1/0,s6=O0>=A8;Y2=yield*$0({messages:Y2,agent:P0,session:w0});let Q8=M3({sessionID:G0,parentID:g0.id,agentID:g0.agentID,agent:P0.name,variant:g0.model.variant,cwd:_0.directory,root:_0.worktree,modelID:y1.id,providerID:y1.providerID});yield*K.updateMessage(Q8);let w$=yield*H.create({assistantMessage:Q8,sessionID:G0,model:y1,agentMetrics:n$}),d3=yield*V.gen(function*(){let t0={value:t},g$=yield*dC({sessionID:G0,resolvedAgentID:l$,step:O0,task_id:n,lastUser:g0,lastFinished:w2,msgs:Y2,agent:P0,session:w0,model:y1,handle:w$,structured:t0,resolveTools:Z,createStructuredOutputTool:J,summary:S,scope:z,plugin:F}),{tools:f8,format:X8,query:u3}=g$,{cancelledByPlugin:c3,withUserQueryPost:l3}=uC({sessionID:G0,agentID:l$,step:O0,lastUser:g0,msgs:Y2,query:u3,handle:w$,plugin:F,sessions:K,cancellation:P2,trajectoryForStep:U2}),p3=V.fnUntraced(function*($7){if($7==="continue"&&(yield*CY({lastUser:g0,assistant:w$.message})))return"continue";if($7==="text-repeat"){if(yield*n0({lastUser:g0}))return"continue";return"break"}if(t0.value!==void 0)return t=t0.value,w$.message.structured=t0.value,w$.message.finish=w$.message.finish??"stop",yield*K.updateMessage(w$.message),"break";let Q2=TB({phase:"after-process",lastUser:g0,assistant:w$.message,parts:X0.parts(w$.message.id),processResult:$7});if(Q2.type==="filtered")return yield*h$({assistant:w$.message}),"break";if(Q2.type==="failed"){if(yield*d1({lastUser:g0,assistant:w$.message}))return"continue";if(yield*wY({lastUser:g0,assistant:w$.message}))return"continue";return yield*F1({assistant:w$.message,reason:Q2.reason}),"break"}if(Q2.type!=="continue"&&!w$.message.error&&X8.type==="json_schema"){if(yield*j$({lastUser:g0,assistant:w$.message}))return"continue";return"break"}if((Q2.type==="think-only"||Q2.type==="invalid")&&X8.type!=="json_schema"){let o3=Q2.type==="invalid"?Q2.reason:"think-only";if(yield*NY({lastUser:g0,assistant:w$.message,reason:o3}))return"continue";return"break"}if(Q2.type==="final"&&Q2.degraded)yield*i.warn("degraded final on abnormal finish",{finish:w$.message.finish});if($7==="stop")return"break";return}),r6=yield*Zw({sessionID:G0,lastUser:g0,agent:P0,session:w0,model:y1,msgs:Y2,tools:f8,format:X8,handle:w$,isLastStep:s6,task_id:n,instructionsNotified:W0,maxStepsText:b,actorRegistry:T,bus:Q,config:U,instruction:C,llm:L,provider:G,registry:D,status:X,sys:v,cancelledByPlugin:c3,withUserQueryPost:l3,slog:i,visionAnalysis:K$});if(r6.kind==="break"){if(r6.reason==="vision-unavailable")yield*F1({assistant:w$.message,reason:r6.message});return"break"}let yY=yield*p3(r6.result);if(yY)return yY;if(r6.result==="overflow")yield*Xw({config:U,checkpoint:j,compaction:O,prune:B},{sessionID:G0,lastUser:g0,model:y1,msgs:Y2,isBoundedComputation:a0});return"continue"}).pipe(V.ensuring(C.clear(w$.message.id))),LY=yield*M2.check({lastUser:g0,completedParts:X0.parts(w$.message.id)});if(LY==="terminate")break;if(LY==="recovered")continue;if(d3==="break"){if(P0.name==="build"&&!w$.message.error){let t0=yield*K.messages({sessionID:G0,agentID:l$}),g$=X0.parts(w$.message.id).findLast((X8)=>X8.type==="text"),f8=yield*V.promise(()=>qw(t0,_0.worktree,g$?.text??""));if(f8.length){if(g$&&!g$.text.startsWith("PARTIAL \u2014 automatic verification incomplete"))yield*K.updatePart({...g$,text:`PARTIAL \u2014 automatic verification incomplete. ${f8.join("; ")}. Do not treat source-only checks as proof of a completed styled build.
8153
8153
 
8154
8154
  ${g$.text}`})}}if(yield*L1(g0))continue;if(yield*U6(g0))continue;break}continue}let w8=yield*$();if(r0&&N0)yield*$$({model:r0,lastFinished:N0,promptOps:w8});let h0=yield*d(G0,Z0),a9=h0.info.role==="assistant"&&!!h0.info.error,t9=yield*K.findMessage(G0,(Y2)=>Y2.info.role==="user",{agentID:"*"});return yield*s$(a9?"error":"completed",S$.isSome(t9)?t9.value.info.agent:h0.info.agent),h0}).pipe((U2)=>kB(G0,Q,U2),V.onExit(Y8),V.orDie)}),lastAssistant:d}})}import sw from"path";var Kc=new TextEncoder,nB=new TextDecoder,Wc=($)=>`
@@ -8182,7 +8182,7 @@ ${F}
8182
8182
  `).length},wc=V.fnUntraced(function*($,Z,J){let Y=Cc.join(Z,J);if(!(yield*$.exists(Y).pipe(V.orDie)))return"";let Q=yield*$.readFile(Y).pipe(V.catch(()=>V.succeed(new Uint8Array)));if(Buffer.from(Q).includes(0))return"";return Buffer.from(Q).toString("utf8")}),BN=($)=>new Map($.map((Z)=>[Z.file,{additions:Z.additions,deletions:Z.deletions}])),Nc=(...$)=>{let Z=new Map;return $.flat().forEach((J)=>{if(!Z.has(J.file))Z.set(J.file,J)}),[...Z.values()]},aB=V.fnUntraced(function*($,Z,J,Y,Q,X){let K=Y?yield*Z.prefix(J):"",W=(H,B,j)=>nY(iY(H,H,B,j,"","",{context:Number.MAX_SAFE_INTEGER}));return(yield*V.forEach(Q,(H)=>V.gen(function*(){let B=H.status==="added"||!Y?"":yield*Z.show(J,Y,H.file,K),j=H.status==="deleted"?"":yield*wc($,J,H.file),O=X.get(H.file);return{file:H.file,patch:W(H.file,B,j),additions:O?.additions??(H.status==="added"?GN(j):0),deletions:O?.deletions??(H.status==="deleted"?GN(B):0),status:H.status}}),{concurrency:8})).toSorted((H,B)=>H.file.localeCompare(B.file))}),Ac=V.fnUntraced(function*($,Z,J,Y){if(!Y)return yield*aB($,Z,J,Y,yield*Z.status(J),new Map);let[Q,X]=yield*V.all([Z.status(J),Z.stats(J,Y)],{concurrency:2});return yield*aB($,Z,J,Y,Q,BN(X))}),Lc=V.fnUntraced(function*($,Z,J,Y){let[Q,X,K]=yield*V.all([Z.diff(J,Y),Z.stats(J,Y),Z.status(J)],{concurrency:3});return yield*aB($,Z,J,Y,Nc(Q,K.filter((W)=>W.code==="??")),BN(X))}),yc=_.enum(["git","branch"]),HN={BranchUpdated:y0.define("vcs.branch.updated",_.object({branch:_.string().optional()}))},Ic=_.object({branch:_.string().optional(),default_branch:_.string().optional()}).meta({ref:"VcsInfo"}),Rc=_.object({file:_.string(),patch:_.string(),additions:_.number(),deletions:_.number(),status:_.enum(["added","deleted","modified"]).optional()}).meta({ref:"VcsFileDiff"});class TZ extends Q0.Service()("@qitqode/Vcs"){}var jN=k.effect(TZ,V.gen(function*(){let $=yield*K0.Service,Z=yield*q1.Service,J=yield*e.Service,Y=yield*N$.Scope,Q=yield*c.make(V.fn("Vcs.state")(function*(X){if(X.project.vcs!=="git")return{current:void 0,root:void 0};let K=V.fnUntraced(function*(){return yield*Z.branch(X.directory)}),[W,G]=yield*V.all([Z.branch(X.directory),Z.defaultBranch(X.directory)],{concurrency:2}),H={current:W,root:G};return WN.info("initialized",{branch:H.current,default_branch:H.root?.name}),yield*J.subscribe(X1.Event.Updated).pipe(f0.filter((B)=>B.properties.file.endsWith("HEAD")),f0.runForEach((B)=>V.gen(function*(){let j=yield*K();if(j!==H.current)WN.info("branch changed",{from:H.current,to:j}),H.current=j,yield*J.publish(HN.BranchUpdated,{branch:j})})),V.forkScoped),H}));return TZ.of({init:V.fn("Vcs.init")(function*(){yield*c.get(Q).pipe(V.forkIn(Y))}),branch:V.fn("Vcs.branch")(function*(){return yield*c.use(Q,(X)=>X.current)}),defaultBranch:V.fn("Vcs.defaultBranch")(function*(){return yield*c.use(Q,(X)=>X.root?.name)}),diff:V.fn("Vcs.diff")(function*(X){let K=yield*c.get(Q),W=yield*c.context;if(W.project.vcs!=="git")return[];if(X==="git")return yield*Ac($,Z,W.directory,(yield*Z.hasHead(W.directory))?"HEAD":void 0);if(!K.root)return[];if(K.current&&K.current===K.root.name)return[];let G=yield*Z.mergeBase(W.directory,K.root.ref);if(!G)return[];return yield*Lc($,Z,W.directory,G)})})})),Sc=jN.pipe(k.provide(q1.defaultLayer),k.provide(K0.defaultLayer),k.provide(e.layer));var l6={};R0(l6,{layer:()=>IN,defaultLayer:()=>cc,Worktree:()=>l6,StartCommandFailedError:()=>mc,Service:()=>k3,ResetInput:()=>fc,ResetFailedError:()=>m1,RemoveInput:()=>vc,RemoveFailedError:()=>r9,NotGitError:()=>x3,NameGenerationFailedError:()=>LN,Info:()=>AN,Event:()=>T3,CreateInput:()=>gc,CreateFailedError:()=>yN});var O6={};R0(O6,{layer:()=>FN,defaultLayer:()=>eB,Service:()=>kZ});var n9=J0.create({service:"share-next"}),xZ=process.env.QITQODE_DISABLE_SHARE==="true"||process.env.QITQODE_DISABLE_SHARE==="1",Tc=I0.Struct({id:I0.String,url:I0.String,secret:I0.String});class kZ extends Q0.Service()("@qitqode/ShareNext"){}var tB=($)=>V.sync(()=>C0.use($));function UN($){return{create:`/api/${$}`,sync:(Z)=>`/api/${$}/${Z}/sync`,remove:(Z)=>`/api/${$}/${Z}`,data:(Z)=>`/api/${$}/${Z}/data`}}var xc=UN("share"),kc=UN("shares");function ON($){switch($.type){case"session":return"session";case"message":return`message/${$.data.id}`;case"part":return`part/${$.data.messageID}/${$.data.id}`;case"session_diff":return"session_diff";case"model":return"model"}}var FN=k.effect(kZ,V.gen(function*(){let $=yield*BY.Service,Z=yield*e.Service,J=yield*H0.Service,Y=yield*l1.HttpClient,Q=l1.filterStatusOk(Y),X=yield*o0.Service,K=yield*k0.Service;function W(z,C){return V.gen(function*(){if(xZ)return;if(!(yield*j(z)))return;let y=yield*c.get(G),I=y.queue.get(z);if(I){for(let h of C)I.set(ON(h),h);return}let x=new Map(C.map((h)=>[ON(h),h]));y.queue.set(z,x),yield*O(z).pipe(V.delay(1000),V.catchCause((h)=>V.sync(()=>{n9.error("share flush failed",{sessionID:z,cause:h})})),V.forkIn(y.scope))})}let G=yield*c.make(V.fn("ShareNext.state")(function*(z){let C={queue:new Map,scope:yield*N$.make(),shared:new Map};if(yield*V.addFinalizer(()=>N$.close(C.scope,O2.void).pipe(V.andThen(V.sync(()=>{C.queue.clear(),C.shared.clear()})))),xZ)return C;let P=(y,I)=>Z.subscribe(y).pipe(f0.runForEach((x)=>I(x).pipe(V.catchCause((h)=>V.sync(()=>{n9.error("share subscriber failed",{type:y.type,cause:h})})))),V.forkScoped);return yield*P(k0.Event.Updated,(y)=>V.gen(function*(){let I=yield*K.get(y.properties.sessionID);yield*W(I.id,[{type:"session",data:I}])})),yield*P(X0.Event.Updated,(y)=>V.gen(function*(){let I=y.properties.info;if(yield*W(I.sessionID,[{type:"message",data:I}]),I.role!=="user")return;let x=yield*X.getModel(I.model.providerID,I.model.modelID);yield*W(I.sessionID,[{type:"model",data:[x]}])})),yield*P(X0.Event.PartUpdated,(y)=>y.properties.part.type==="compaction"?V.void:W(y.properties.part.sessionID,[{type:"part",data:y.properties.part}])),yield*P(k0.Event.Diff,(y)=>W(y.properties.sessionID,[{type:"session_diff",data:y.properties.diff}])),yield*P(k0.Event.Deleted,(y)=>D(y.properties.sessionID)),C})),H=V.fn("ShareNext.request")(function*(){let z={},C=yield*$.active();if(S$.isNone(C)||!C.value.active_org_id){let y=(yield*J.get()).enterprise?.url??"https://opncd.ai";return{headers:z,api:xc,baseUrl:y}}let P=yield*$.token(C.value.id);if(S$.isNone(P))throw Error("No active account token available for sharing");return z.authorization=`Bearer ${P.value}`,z["x-org-id"]=C.value.active_org_id,{headers:z,api:kc,baseUrl:C.value.url}}),B=V.fnUntraced(function*(z){let C=yield*tB((P)=>P.select().from(s9).where(D0(s9.session_id,z)).get());if(!C)return;return{id:C.id,secret:C.secret,url:C.url}}),j=V.fnUntraced(function*(z){let C=yield*c.get(G);if(C.shared.has(z)){let y=C.shared.get(z);return y===null?void 0:y}let P=yield*B(z);return C.shared.set(z,P??null),P}),O=V.fn("ShareNext.flush")(function*(z){if(xZ)return;let C=yield*c.get(G),P=C.queue.get(z);if(!P)return;let y=yield*j(z);if(!y){C.queue.delete(z);return}let I=yield*H(),x=yield*A2.post(`${I.baseUrl}${I.api.sync(y.id)}`).pipe(A2.setHeaders(I.headers),A2.bodyJson({secret:y.secret,data:Array.from(P.values())}),V.flatMap((h)=>Y.execute(h)));if(x.status>=400){n9.warn("failed to sync share",{sessionID:z,shareID:y.id,status:x.status});return}C.queue.delete(z)}),U=V.fn("ShareNext.full")(function*(z){n9.info("full sync",{sessionID:z});let C=yield*K.get(z),P=yield*K.diff(z),y=yield*V.sync(()=>Array.from(X0.stream(z,{agentID:"*"}))),I=yield*V.forEach(Array.from(new Map(y.filter((x)=>x.info.role==="user").map((x)=>x.info.model).map((x)=>[`${x.providerID}/${x.modelID}`,x])).values()),(x)=>X.getModel(F8.make(x.providerID),h1.make(x.modelID)),{concurrency:8});yield*W(z,[{type:"session",data:C},...y.map((x)=>({type:"message",data:x.info})),...y.flatMap((x)=>x.parts.filter((h)=>h.type!=="compaction").map((h)=>({type:"part",data:h}))),{type:"session_diff",data:P},{type:"model",data:I}])}),F=V.fn("ShareNext.init")(function*(){if(xZ)return;yield*c.get(G)}),q=V.fn("ShareNext.url")(function*(){return(yield*H()).baseUrl}),w=V.fn("ShareNext.create")(function*(z){if(xZ)return{id:"",url:"",secret:""};n9.info("creating share",{sessionID:z});let C=yield*H(),P=yield*A2.post(`${C.baseUrl}${C.api.create}`).pipe(A2.setHeaders(C.headers),A2.bodyJson({sessionID:z}),V.flatMap((I)=>Q.execute(I)),V.flatMap(IX.schemaBodyJson(Tc)));yield*tB((I)=>I.insert(s9).values({session_id:z,id:P.id,secret:P.secret,url:P.url}).onConflictDoUpdate({target:s9.session_id,set:{id:P.id,secret:P.secret,url:P.url}}).run());let y=yield*c.get(G);return y.shared.set(z,P),yield*U(z).pipe(V.catchCause((I)=>V.sync(()=>{n9.error("share full sync failed",{sessionID:z,cause:I})})),V.forkIn(y.scope)),P}),D=V.fn("ShareNext.remove")(function*(z){if(xZ)return;n9.info("removing share",{sessionID:z});let C=yield*c.get(G),P=yield*j(z);if(!P){C.shared.delete(z),C.queue.delete(z);return}let y=yield*H();yield*A2.delete(`${y.baseUrl}${y.api.remove(P.id)}`).pipe(A2.setHeaders(y.headers),A2.bodyJson({secret:P.secret}),V.flatMap((I)=>Q.execute(I))),yield*tB((I)=>I.delete(s9).where(D0(s9.session_id,z)).run()),C.shared.delete(z),C.queue.delete(z)});return kZ.of({init:F,url:q,request:H,create:w,remove:D})})),eB=FN.pipe(k.provide(e.layer),k.provide(BY.defaultLayer),k.provide(H0.defaultLayer),k.provide(I8.layer),k.provide(o0.defaultLayer),k.provide(k0.defaultLayer));var L3={};R0(L3,{layer:()=>qN,defaultLayer:()=>bc,Service:()=>A3});class A3 extends Q0.Service()("@qitqode/SessionShare"){}var qN=k.effect(A3,V.gen(function*(){let $=yield*H0.Service,Z=yield*k0.Service,J=yield*kZ,Y=yield*N$.Scope,Q=V.fn("SessionShare.share")(function*(W){if((yield*$.get()).share==="disabled")throw Error("Sharing is disabled in configuration");let H=yield*J.create(W);return yield*V.sync(()=>YZ.run(k0.Event.Updated,{sessionID:W,info:{share:{url:H.url}}})),H}),X=V.fn("SessionShare.unshare")(function*(W){yield*J.remove(W),yield*V.sync(()=>YZ.run(k0.Event.Updated,{sessionID:W,info:{share:{url:null}}}))}),K=V.fn("SessionShare.create")(function*(W){let G=yield*Z.create(W);if(G.parentID)return G;let H=yield*$.get();if(!(c0.QITQODE_AUTO_SHARE||H.share==="auto"))return G;return yield*Q(G.id).pipe(V.ignore,V.forkIn(Y)),G});return A3.of({create:K,share:Q,unshare:X})})),bc=qN.pipe(k.provide(eB),k.provide(k0.defaultLayer),k.provide(H0.defaultLayer));var CN=DN(function*(){J0.Default.info("bootstrapping",{directory:q0.directory}),yield*H0.Service.use(($)=>$.get()),yield*s0.Service.use(($)=>$.init()),yield*zN([R$.Service,O6.Service,h2.Service,I1.Service,X1.Service,TZ,j1.Service,C7,w7].map(($)=>Z4($.use((Z)=>Z.init())))).pipe($4("InstanceBootstrap.init")),yield*R2.Service.use(($)=>$.reconcile()).pipe(PN(($)=>_N(()=>J0.Default.warn("memory reconcile failed",{error:String($)}))),Z4),yield*e.Service.use(($)=>$.subscribeCallback($1.Event.Executed,async(Z)=>{if(Z.properties.name===$1.Default.INIT)MN(q0.project.id)})),yield*d$.subscribe()}).pipe($4("InstanceBootstrap"));var hc=k.mergeAll(H0.defaultLayer,s0.defaultLayer,O6.defaultLayer,h2.defaultLayer,R$.defaultLayer,I1.defaultLayer,X1.defaultLayer,i9.defaultLayer,j1.defaultLayer,e.defaultLayer,R2.defaultLayer,k8.defaultLayer).pipe(k.provide(I3)),wN=y3.make(hc,{memoMap:R3});var HY=J0.create({service:"worktree"}),T3={Ready:y0.define("worktree.ready",_.object({name:_.string(),branch:_.string()})),Failed:y0.define("worktree.failed",_.object({message:_.string()}))},AN=_.object({name:_.string(),branch:_.string(),directory:_.string()}).meta({ref:"Worktree"}),gc=_.object({name:_.string().optional(),startCommand:_.string().optional().describe("Additional startup script to run after the project's start command")}).meta({ref:"WorktreeCreateInput"}),vc=_.object({directory:_.string()}).meta({ref:"WorktreeRemoveInput"}),fc=_.object({directory:_.string()}).meta({ref:"WorktreeResetInput"}),x3=q$.create("WorktreeNotGitError",_.object({message:_.string()})),LN=q$.create("WorktreeNameGenerationFailedError",_.object({message:_.string()})),yN=q$.create("WorktreeCreateFailedError",_.object({message:_.string()})),mc=q$.create("WorktreeStartCommandFailedError",_.object({message:_.string()})),r9=q$.create("WorktreeRemoveFailedError",_.object({message:_.string()})),m1=q$.create("WorktreeResetFailedError",_.object({message:_.string()}));function dc($){return $.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}function uc(...$){return $.filter(Boolean).flatMap((Z)=>Z.split(`
8183
8183
  `).map((J)=>J.trim()).flatMap((J)=>{let Y=J.match(/^warning:\s+failed to remove\s+(.+):\s+/i);if(!Y)return[];let Q=Y[1]?.trim().replace(/^['"]|['"]$/g,"");if(!Q)return[];return[Q]}))}class k3 extends Q0.Service()("@qitqode/Worktree"){}var IN=k.effect(k3,V.gen(function*(){let $=yield*N$.Scope,Z=yield*K0.Service,J=yield*yX.Path,Y=yield*o8.ChildProcessSpawner,Q=yield*q1.Service,X=yield*j6.Service,K=V.fnUntraced(function*(E,N){return yield*NN(Y,E,N)},V.catch((E)=>V.succeed({code:1,text:"",stderr:E instanceof Error?E.message:String(E)}))),W=26,G=V.fn("Worktree.candidate")(function*(E,N){let R=yield*c.context;for(let b of Array.from({length:26},(r,l)=>l)){let r=N?b===0?N:`${N}-${Y4.create()}`:Y4.create(),l=`qitqode/${r}`,d=J.join(E,r);if(yield*Z.exists(d).pipe(V.orDie))continue;let u=`refs/heads/${l}`;if((yield*K(["show-ref","--verify","--quiet",u],{cwd:R.worktree})).code===0)continue;return AN.parse({name:r,branch:l,directory:d})}throw new LN({message:"Failed to generate a unique worktree name"})}),H=V.fn("Worktree.makeWorktreeInfo")(function*(E){let N=yield*c.context;if(N.project.vcs!=="git")throw new x3({message:"Worktrees are only supported for git projects"});let R=J.join(e0.Path.data,"worktree",N.project.id);yield*Z.makeDirectory(R,{recursive:!0}).pipe(V.orDie);let b=E?dc(E):"";return yield*G(R,b||void 0)}),B=V.fnUntraced(function*(E){let N=yield*c.context,R=yield*K(["worktree","add","--no-checkout","-b",E.branch,E.directory],{cwd:N.worktree});if(R.code!==0)throw new yN({message:R.stderr||R.text||"Failed to create git worktree"});yield*X.addSandbox(N.project.id,E.directory).pipe(V.catch(()=>V.void))}),j=V.fnUntraced(function*(E,N){let R=yield*c.context,b=yield*c.workspaceID,r=R.project.id,l=N?.trim(),d=yield*K(["reset","--hard"],{cwd:E.directory});if(d.code!==0){let o=d.stderr||d.text||"Failed to populate worktree";HY.error("worktree checkout failed",{directory:E.directory,message:o}),S3.emit("event",{directory:E.directory,project:R.project.id,workspace:b,payload:{type:T3.Failed.type,properties:{message:o}}});return}if(!(yield*V.promise(()=>q0.provide({directory:E.directory,init:()=>wN.runPromise(CN),fn:()=>{return}}).then(()=>!0).catch((o)=>{let W0=Q6(o);return HY.error("worktree bootstrap failed",{directory:E.directory,message:W0}),S3.emit("event",{directory:E.directory,project:R.project.id,workspace:b,payload:{type:T3.Failed.type,properties:{message:W0}}}),!1}))))return;S3.emit("event",{directory:E.directory,project:R.project.id,workspace:b,payload:{type:T3.Ready.type,properties:{name:E.name,branch:E.branch}}}),yield*x(E.directory,{projectID:r,extra:l})}),O=V.fn("Worktree.createFromInfo")(function*(E,N){yield*B(E),yield*j(E,N)}),U=V.fn("Worktree.create")(function*(E){let N=yield*H(E?.name);return yield*B(N),yield*j(N,E?.startCommand).pipe(V.catchCause((R)=>V.sync(()=>HY.error("worktree bootstrap failed",{cause:R}))),V.forkIn($)),N}),F=V.fnUntraced(function*(E){let N=J.resolve(E),R=yield*Z.realPath(N).pipe(V.catch(()=>V.succeed(N))),b=J.normalize(R);return process.platform==="win32"?b.toLowerCase():b});function q(E){return E.split(`
8184
8184
  `).map((N)=>N.trim()).reduce((N,R)=>{if(!R)return N;if(R.startsWith("worktree "))return N.push({path:R.slice(9).trim()}),N;let b=N[N.length-1];if(!b)return N;if(R.startsWith("branch "))b.branch=R.slice(7).trim();return N},[])}let w=V.fnUntraced(function*(E,N){for(let R of E){if(!R.path)continue;if((yield*F(R.path))===N)return R}return});function D(E){return Z.exists(E).pipe(V.orDie,V.flatMap((N)=>N?K(["fsmonitor--daemon","stop"],{cwd:E}):V.void))}function z(E){return V.promise(()=>import("fs/promises").then((N)=>N.rm(E,{recursive:!0,force:!0,maxRetries:5,retryDelay:100})).catch((N)=>{let R=Q6(N);throw new r9({message:R||"Failed to remove git worktree directory"})}))}let C=V.fn("Worktree.remove")(function*(E){let N=yield*c.context;if(N.project.vcs!=="git")throw new x3({message:"Worktrees are only supported for git projects"});let R=yield*F(E.directory),b=yield*K(["worktree","list","--porcelain"],{cwd:N.worktree});if(b.code!==0)throw new r9({message:b.stderr||b.text||"Failed to read git worktrees"});let r=q(b.text),l=yield*w(r,R);if(!l?.path){if(!(yield*Z.exists(R).pipe(V.orDie)))return!0;let W0=yield*F(J.join(e0.Path.data,"worktree",N.project.id));if(R!==W0&&!R.startsWith(`${W0}${J.sep}`))throw new r9({message:"Directory is not a registered or managed worktree"});return yield*D(R),yield*z(R),!0}yield*D(l.path);let d=yield*K(["worktree","remove","--force",l.path],{cwd:N.worktree});if(d.code!==0){let o=yield*K(["worktree","list","--porcelain"],{cwd:N.worktree});if(o.code!==0)throw new r9({message:d.stderr||d.text||o.stderr||o.text||"Failed to remove git worktree"});if((yield*w(q(o.text),R))?.path)throw new r9({message:d.stderr||d.text||"Failed to remove git worktree"})}yield*z(l.path);let u=l.branch?.replace(/^refs\/heads\//,"");if(u){let o=yield*K(["branch","-D",u],{cwd:N.worktree});if(o.code!==0)throw new r9({message:o.stderr||o.text||"Failed to delete worktree branch"})}return!0}),P=V.fnUntraced(function*(E,N,R){let b=yield*K(E,N);if(b.code!==0)throw R(b);return b}),y=V.fnUntraced(function*(E,N){let[R,b]=process.platform==="win32"?["cmd",["/c",N]]:["bash",["-lc",N]],r=yield*Y.spawn(p2.make(R,b,{cwd:E,extendEnv:!0,stdin:"ignore"})),[,l]=yield*V.all([f0.runDrain(r.stdout),f0.mkString(f0.decodeText(r.stderr))],{concurrency:2}).pipe(V.orDie);return{code:yield*r.exitCode,stderr:l}},V.scoped,V.catch(()=>V.succeed({code:1,stderr:""}))),I=V.fnUntraced(function*(E,N,R){let b=N.trim();if(!b)return!0;let r=yield*y(E,b);if(r.code===0)return!0;return HY.error("worktree start command failed",{kind:R,directory:E,message:r.stderr}),!1}),x=V.fnUntraced(function*(E,N){let R=yield*V.sync(()=>C0.use((d)=>d.select().from(J4).where(D0(J4.id,N.projectID)).get())),r=(R?j6.fromRow(R):void 0)?.commands?.start?.trim()??"";if(!(yield*I(E,r,"project")))return!1;return yield*I(E,N.extra??"","worktree"),!0}),h=V.fnUntraced(function*(E,N){let R=yield*F(E);yield*V.forEach(N,(b)=>V.gen(function*(){let r=yield*F(J.resolve(E,b));if(r===R)return;if(!r.startsWith(`${R}${J.sep}`))return;yield*Z.remove(r,{recursive:!0}).pipe(V.ignore)}),{concurrency:8})}),S=V.fnUntraced(function*(E){let N=yield*K(["clean","-ffdx"],{cwd:E});if(N.code===0)return N;let R=uc(N.stderr,N.text);if(!R.length)return N;return yield*h(E,R),yield*K(["clean","-ffdx"],{cwd:E})}),v=V.fn("Worktree.reset")(function*(E){let N=yield*c.context;if(N.project.vcs!=="git")throw new x3({message:"Worktrees are only supported for git projects"});let R=yield*F(E.directory),b=yield*F(N.worktree);if(R===b)throw new m1({message:"Cannot reset the primary workspace"});let r=yield*K(["worktree","list","--porcelain"],{cwd:N.worktree});if(r.code!==0)throw new m1({message:r.stderr||r.text||"Failed to read git worktrees"});let l=yield*w(q(r.text),R);if(!l?.path)throw new m1({message:"Worktree not found"});let d=l.path,u=yield*Q.defaultBranch(N.worktree);if(!u)throw new m1({message:"Default branch not found"});let o=u.ref.indexOf("/");if(u.ref!==u.name&&o>0){let f=u.ref.slice(0,o),$0=u.ref.slice(o+1);yield*P(["fetch",f,$0],{cwd:N.worktree},(Y0)=>new m1({message:Y0.stderr||Y0.text||`Failed to fetch ${u.ref}`}))}yield*P(["reset","--hard",u.ref],{cwd:d},(f)=>new m1({message:f.stderr||f.text||"Failed to reset worktree to target"}));let W0=yield*S(d);if(W0.code!==0)throw new m1({message:W0.stderr||W0.text||"Failed to clean worktree"});yield*P(["submodule","update","--init","--recursive","--force"],{cwd:d},(f)=>new m1({message:f.stderr||f.text||"Failed to update submodules"})),yield*P(["submodule","foreach","--recursive","git","reset","--hard"],{cwd:d},(f)=>new m1({message:f.stderr||f.text||"Failed to reset submodules"})),yield*P(["submodule","foreach","--recursive","git","clean","-fdx"],{cwd:d},(f)=>new m1({message:f.stderr||f.text||"Failed to clean submodules"}));let a=yield*K(["-c","core.fsmonitor=false","status","--porcelain=v1"],{cwd:d});if(a.code!==0)throw new m1({message:a.stderr||a.text||"Failed to read git status"});if(a.text.trim())throw new m1({message:`Worktree reset left local changes:
8185
- ${a.text.trim()}`});return yield*x(d,{projectID:N.project.id}).pipe(V.catchCause((f)=>V.sync(()=>HY.error("worktree start task failed",{cause:f}))),V.forkIn($)),!0}),L=V.fn("Worktree.head")(function*(E){return(yield*K(["rev-parse","HEAD"],{cwd:E})).text.trim()}),T=V.fn("Worktree.isPristine")(function*(E,N){let R=yield*K(["status","--porcelain"],{cwd:E});if(R.code!==0)return!1;if(R.text.trim()!=="")return!1;let b=yield*K(["rev-parse","HEAD"],{cwd:E});return b.code===0&&b.text.trim()===N});return k3.of({makeWorktreeInfo:H,createFromInfo:O,create:U,remove:C,reset:v,head:L,isPristine:T})})),cc=IN.pipe(k.provide(q1.defaultLayer),k.provide(p1),k.provide(j6.defaultLayer),k.provide(K0.defaultLayer),k.provide(j7.layer));var FY={};R0(FY,{layer:()=>xN,defaultLayer:()=>rc,UpdateInput:()=>sc,Service:()=>b3,Pty:()=>FY,Info:()=>X4,Event:()=>UY,CreateInput:()=>nc});function RN($){let Z,J=!1;return()=>{if(J)return Z;return J=!0,Z=$(),Z}}var lc=I0.String.annotate({[H7]:L2.schema("pty")}).pipe(I0.brand("PtyID")),jY=lc.pipe(B7(($)=>({ascending:(Z)=>$.make(L2.ascending("pty",Z)),zod:L2.schema("pty").pipe(_.custom())})));var OY=J0.create({service:"pty"}),SN=2097152,TN=65536,pc=new TextEncoder,Q4=($)=>$.data&&typeof $.data==="object"?$.data:$,oc=($)=>{let Z=JSON.stringify({cursor:$}),J=pc.encode(Z),Y=new Uint8Array(J.length+1);return Y[0]=0,Y.set(J,1),Y},ic=RN(()=>import("./chunk-p40z6510.js")),X4=_.object({id:jY.zod,title:_.string(),command:_.string(),args:_.array(_.string()),cwd:_.string(),status:_.enum(["running","exited"]),pid:_.number()}).meta({ref:"Pty"}),nc=_.object({command:_.string().optional(),args:_.array(_.string()).optional(),cwd:_.string().optional(),title:_.string().optional(),env:_.record(_.string(),_.string()).optional()}),sc=_.object({title:_.string().optional(),size:_.object({rows:_.number(),cols:_.number()}).optional()}),UY={Created:y0.define("pty.created",_.object({info:X4})),Updated:y0.define("pty.updated",_.object({info:X4})),Exited:y0.define("pty.exited",_.object({id:jY.zod,exitCode:_.number()})),Deleted:y0.define("pty.deleted",_.object({id:jY.zod}))};class b3 extends Q0.Service()("@qitqode/Pty"){}var xN=k.effect(b3,V.gen(function*(){let $=yield*e.Service,Z=yield*s0.Service;function J(O){try{O.process.kill()}catch{}for(let[U,F]of O.subscribers.entries())try{if(Q4(F)===U)F.close()}catch{}O.subscribers.clear()}let Y=yield*c.make(V.fn("Pty.state")(function*(O){let U={dir:O.directory,sessions:new Map};return yield*V.addFinalizer(()=>V.sync(()=>{for(let F of U.sessions.values())J(F);U.sessions.clear()})),U})),Q=V.fn("Pty.remove")(function*(O){let U=yield*c.get(Y),F=U.sessions.get(O);if(!F)return;U.sessions.delete(O),OY.info("removing session",{id:O}),J(F),yield*$.publish(UY.Deleted,{id:F.info.id})}),X=V.fn("Pty.list")(function*(){let O=yield*c.get(Y);return Array.from(O.sessions.values()).map((U)=>U.info)}),K=V.fn("Pty.get")(function*(O){return(yield*c.get(Y)).sessions.get(O)?.info}),W=V.fn("Pty.create")(function*(O){let U=yield*c.get(Y),F=yield*T$.make(),q=jY.ascending(),w=O.command||z1.preferred(),D=O.args||[];if(z1.login(w))D.push("-l");let z=O.cwd||U.dir,C=yield*Z.trigger("shell.env",{cwd:z},{env:{}}),P={...q7(),...O.env,...C.env,TERM:"xterm-256color",QITQODE_TERMINAL:"1"};if(process.platform==="win32")P.LC_ALL="C.UTF-8",P.LC_CTYPE="C.UTF-8",P.LANG="C.UTF-8";OY.info("creating session",{id:q,cmd:w,args:D,cwd:z});let{spawn:y}=yield*V.promise(()=>ic()),I=yield*V.sync(()=>y(w,D,{name:"xterm-256color",cwd:z,env:P})),x={id:q,title:O.title||`Terminal ${q.slice(-4)}`,command:w,args:D,cwd:z,status:"running",pid:I.pid},h={info:x,process:I,buffer:"",bufferCursor:0,cursor:0,subscribers:new Map};return U.sessions.set(q,h),I.onData(q0.bind((S)=>{h.cursor+=S.length;for(let[L,T]of h.subscribers.entries()){if(T.readyState!==1){h.subscribers.delete(L);continue}if(Q4(T)!==L){h.subscribers.delete(L);continue}try{T.send(S)}catch{h.subscribers.delete(L)}}if(h.buffer+=S,h.buffer.length<=SN)return;let v=h.buffer.length-SN;h.buffer=h.buffer.slice(v),h.bufferCursor+=v})),I.onExit(q0.bind(({exitCode:S})=>{if(h.info.status==="exited")return;OY.info("session exited",{id:q,exitCode:S}),h.info.status="exited",F.fork($.publish(UY.Exited,{id:q,exitCode:S})),F.fork(Q(q))})),yield*$.publish(UY.Created,{info:x}),x}),G=V.fn("Pty.update")(function*(O,U){let q=(yield*c.get(Y)).sessions.get(O);if(!q)return;if(U.title)q.info.title=U.title;if(U.size)q.process.resize(U.size.cols,U.size.rows);return yield*$.publish(UY.Updated,{info:q.info}),q.info}),H=V.fn("Pty.resize")(function*(O,U,F){let w=(yield*c.get(Y)).sessions.get(O);if(w&&w.info.status==="running")w.process.resize(U,F)}),B=V.fn("Pty.write")(function*(O,U){let q=(yield*c.get(Y)).sessions.get(O);if(q&&q.info.status==="running")q.process.write(U)}),j=V.fn("Pty.connect")(function*(O,U,F){let w=(yield*c.get(Y)).sessions.get(O);if(!w){U.close();return}OY.info("client connected to session",{id:O});let D=Q4(U);w.subscribers.delete(D),w.subscribers.set(D,U);let z=()=>{w.subscribers.delete(D)},C=w.bufferCursor,P=w.cursor,y=F===-1?P:typeof F==="number"&&Number.isSafeInteger(F)?Math.max(0,F):0,I=(()=>{if(!w.buffer)return"";if(y>=P)return"";let x=Math.max(0,y-C);if(x>=w.buffer.length)return"";return w.buffer.slice(x)})();if(I)try{for(let x=0;x<I.length;x+=TN)U.send(I.slice(x,x+TN))}catch{z(),U.close();return}try{U.send(oc(P))}catch{z(),U.close();return}return{onMessage:(x)=>{w.process.write(typeof x==="string"?x:new TextDecoder().decode(x))},onClose:()=>{OY.info("client disconnected from session",{id:O}),z()}}});return b3.of({list:X,get:K,create:W,update:G,remove:Q,resize:H,write:B,connect:j})})),rc=xN.pipe(k.provide(e.layer),k.provide(s0.defaultLayer));var zY={};R0(zY,{layer:()=>EN,defaultLayer:()=>$l,Service:()=>g3,MAX_PRE_REACT:()=>kN,MAX_POST_REACT:()=>bN,Actor:()=>zY});var E3=($,Z,J)=>V.uninterruptible(V.gen(function*(){let Y=yield*G$.Service;yield*Y.updateStatus($,Z,{status:"running"}).pipe(V.ignore);let Q=yield*J.pipe(V.interruptible,V.exit);if(O2.isSuccess(Q))return yield*Y.updateStatus($,Z,{status:"idle",lastOutcome:"success",lastError:void 0}).pipe(V.ignore),Q.value;let X=Q.cause,K=x0.hasInterruptsOnly(X);return yield*Y.updateStatus($,Z,{status:"idle",lastOutcome:K?"cancelled":"failure",lastError:K?void 0:ac(X)}).pipe(V.ignore),yield*V.failCause(X)}));function ac($){return x0.pretty($)}var h3=J0.create({service:"actor.spawn"}),kN=3,bN=3,ec=`
8185
+ ${a.text.trim()}`});return yield*x(d,{projectID:N.project.id}).pipe(V.catchCause((f)=>V.sync(()=>HY.error("worktree start task failed",{cause:f}))),V.forkIn($)),!0}),L=V.fn("Worktree.head")(function*(E){return(yield*K(["rev-parse","HEAD"],{cwd:E})).text.trim()}),T=V.fn("Worktree.isPristine")(function*(E,N){let R=yield*K(["status","--porcelain"],{cwd:E});if(R.code!==0)return!1;if(R.text.trim()!=="")return!1;let b=yield*K(["rev-parse","HEAD"],{cwd:E});return b.code===0&&b.text.trim()===N});return k3.of({makeWorktreeInfo:H,createFromInfo:O,create:U,remove:C,reset:v,head:L,isPristine:T})})),cc=IN.pipe(k.provide(q1.defaultLayer),k.provide(p1),k.provide(j6.defaultLayer),k.provide(K0.defaultLayer),k.provide(j7.layer));var FY={};R0(FY,{layer:()=>xN,defaultLayer:()=>rc,UpdateInput:()=>sc,Service:()=>b3,Pty:()=>FY,Info:()=>X4,Event:()=>UY,CreateInput:()=>nc});function RN($){let Z,J=!1;return()=>{if(J)return Z;return J=!0,Z=$(),Z}}var lc=I0.String.annotate({[H7]:L2.schema("pty")}).pipe(I0.brand("PtyID")),jY=lc.pipe(B7(($)=>({ascending:(Z)=>$.make(L2.ascending("pty",Z)),zod:L2.schema("pty").pipe(_.custom())})));var OY=J0.create({service:"pty"}),SN=2097152,TN=65536,pc=new TextEncoder,Q4=($)=>$.data&&typeof $.data==="object"?$.data:$,oc=($)=>{let Z=JSON.stringify({cursor:$}),J=pc.encode(Z),Y=new Uint8Array(J.length+1);return Y[0]=0,Y.set(J,1),Y},ic=RN(()=>import("./chunk-1v0khv7p.js")),X4=_.object({id:jY.zod,title:_.string(),command:_.string(),args:_.array(_.string()),cwd:_.string(),status:_.enum(["running","exited"]),pid:_.number()}).meta({ref:"Pty"}),nc=_.object({command:_.string().optional(),args:_.array(_.string()).optional(),cwd:_.string().optional(),title:_.string().optional(),env:_.record(_.string(),_.string()).optional()}),sc=_.object({title:_.string().optional(),size:_.object({rows:_.number(),cols:_.number()}).optional()}),UY={Created:y0.define("pty.created",_.object({info:X4})),Updated:y0.define("pty.updated",_.object({info:X4})),Exited:y0.define("pty.exited",_.object({id:jY.zod,exitCode:_.number()})),Deleted:y0.define("pty.deleted",_.object({id:jY.zod}))};class b3 extends Q0.Service()("@qitqode/Pty"){}var xN=k.effect(b3,V.gen(function*(){let $=yield*e.Service,Z=yield*s0.Service;function J(O){try{O.process.kill()}catch{}for(let[U,F]of O.subscribers.entries())try{if(Q4(F)===U)F.close()}catch{}O.subscribers.clear()}let Y=yield*c.make(V.fn("Pty.state")(function*(O){let U={dir:O.directory,sessions:new Map};return yield*V.addFinalizer(()=>V.sync(()=>{for(let F of U.sessions.values())J(F);U.sessions.clear()})),U})),Q=V.fn("Pty.remove")(function*(O){let U=yield*c.get(Y),F=U.sessions.get(O);if(!F)return;U.sessions.delete(O),OY.info("removing session",{id:O}),J(F),yield*$.publish(UY.Deleted,{id:F.info.id})}),X=V.fn("Pty.list")(function*(){let O=yield*c.get(Y);return Array.from(O.sessions.values()).map((U)=>U.info)}),K=V.fn("Pty.get")(function*(O){return(yield*c.get(Y)).sessions.get(O)?.info}),W=V.fn("Pty.create")(function*(O){let U=yield*c.get(Y),F=yield*T$.make(),q=jY.ascending(),w=O.command||z1.preferred(),D=O.args||[];if(z1.login(w))D.push("-l");let z=O.cwd||U.dir,C=yield*Z.trigger("shell.env",{cwd:z},{env:{}}),P={...q7(),...O.env,...C.env,TERM:"xterm-256color",QITQODE_TERMINAL:"1"};if(process.platform==="win32")P.LC_ALL="C.UTF-8",P.LC_CTYPE="C.UTF-8",P.LANG="C.UTF-8";OY.info("creating session",{id:q,cmd:w,args:D,cwd:z});let{spawn:y}=yield*V.promise(()=>ic()),I=yield*V.sync(()=>y(w,D,{name:"xterm-256color",cwd:z,env:P})),x={id:q,title:O.title||`Terminal ${q.slice(-4)}`,command:w,args:D,cwd:z,status:"running",pid:I.pid},h={info:x,process:I,buffer:"",bufferCursor:0,cursor:0,subscribers:new Map};return U.sessions.set(q,h),I.onData(q0.bind((S)=>{h.cursor+=S.length;for(let[L,T]of h.subscribers.entries()){if(T.readyState!==1){h.subscribers.delete(L);continue}if(Q4(T)!==L){h.subscribers.delete(L);continue}try{T.send(S)}catch{h.subscribers.delete(L)}}if(h.buffer+=S,h.buffer.length<=SN)return;let v=h.buffer.length-SN;h.buffer=h.buffer.slice(v),h.bufferCursor+=v})),I.onExit(q0.bind(({exitCode:S})=>{if(h.info.status==="exited")return;OY.info("session exited",{id:q,exitCode:S}),h.info.status="exited",F.fork($.publish(UY.Exited,{id:q,exitCode:S})),F.fork(Q(q))})),yield*$.publish(UY.Created,{info:x}),x}),G=V.fn("Pty.update")(function*(O,U){let q=(yield*c.get(Y)).sessions.get(O);if(!q)return;if(U.title)q.info.title=U.title;if(U.size)q.process.resize(U.size.cols,U.size.rows);return yield*$.publish(UY.Updated,{info:q.info}),q.info}),H=V.fn("Pty.resize")(function*(O,U,F){let w=(yield*c.get(Y)).sessions.get(O);if(w&&w.info.status==="running")w.process.resize(U,F)}),B=V.fn("Pty.write")(function*(O,U){let q=(yield*c.get(Y)).sessions.get(O);if(q&&q.info.status==="running")q.process.write(U)}),j=V.fn("Pty.connect")(function*(O,U,F){let w=(yield*c.get(Y)).sessions.get(O);if(!w){U.close();return}OY.info("client connected to session",{id:O});let D=Q4(U);w.subscribers.delete(D),w.subscribers.set(D,U);let z=()=>{w.subscribers.delete(D)},C=w.bufferCursor,P=w.cursor,y=F===-1?P:typeof F==="number"&&Number.isSafeInteger(F)?Math.max(0,F):0,I=(()=>{if(!w.buffer)return"";if(y>=P)return"";let x=Math.max(0,y-C);if(x>=w.buffer.length)return"";return w.buffer.slice(x)})();if(I)try{for(let x=0;x<I.length;x+=TN)U.send(I.slice(x,x+TN))}catch{z(),U.close();return}try{U.send(oc(P))}catch{z(),U.close();return}return{onMessage:(x)=>{w.process.write(typeof x==="string"?x:new TextDecoder().decode(x))},onClose:()=>{OY.info("client disconnected from session",{id:O}),z()}}});return b3.of({list:X,get:K,create:W,update:G,remove:Q,resize:H,write:B,connect:j})})),rc=xN.pipe(k.provide(e.layer),k.provide(s0.defaultLayer));var zY={};R0(zY,{layer:()=>EN,defaultLayer:()=>$l,Service:()=>g3,MAX_PRE_REACT:()=>kN,MAX_POST_REACT:()=>bN,Actor:()=>zY});var E3=($,Z,J)=>V.uninterruptible(V.gen(function*(){let Y=yield*G$.Service;yield*Y.updateStatus($,Z,{status:"running"}).pipe(V.ignore);let Q=yield*J.pipe(V.interruptible,V.exit);if(O2.isSuccess(Q))return yield*Y.updateStatus($,Z,{status:"idle",lastOutcome:"success",lastError:void 0}).pipe(V.ignore),Q.value;let X=Q.cause,K=x0.hasInterruptsOnly(X);return yield*Y.updateStatus($,Z,{status:"idle",lastOutcome:K?"cancelled":"failure",lastError:K?void 0:ac(X)}).pipe(V.ignore),yield*V.failCause(X)}));function ac($){return x0.pretty($)}var h3=J0.create({service:"actor.spawn"}),kN=3,bN=3,ec=`
8186
8186
 
8187
8187
  ---
8188
8188
 
@@ -8212,7 +8212,7 @@ This format lets the spawning agent and the checkpoint writer extract your progr
8212
8212
  `).join(""))});return p6.set($,Y),Y.finally(()=>{if(p6.get($)===Y)p6.delete($)})}var Gl=/^wf_[0-9A-Za-z]+$/,oN=($)=>{if(!Gl.test($))throw Error(`invalid workflow runID: ${JSON.stringify($)}`);return $},iN=($)=>B4.join(_Y(),`${oN($)}.js`),H4=($)=>B4.join(_Y(),`${oN($)}.jsonl`);function nN($){return{runID:$.id,sessionID:$.session_id,name:$.name,status:$.status,running:$.running,succeeded:$.succeeded,failed:$.failed,...$.current_phase?{currentPhase:$.current_phase}:{},...$.parent_actor_id?{parentActorID:$.parent_actor_id}:{},...$.args!==null&&$.args!==void 0?{args:$.args}:{},...$.script_sha?{scriptSha:$.script_sha}:{},...$.agent_timeout_ms!==null&&$.agent_timeout_ms!==void 0?{agentTimeoutMs:$.agent_timeout_ms}:{},...$.error?{error:$.error}:{},createdAt:$.time_created,updatedAt:$.time_updated}}var Bl=($)=>V.sync(()=>C0.use((Z)=>Z.insert(J1).values({id:$.runID,session_id:$.sessionID,name:$.name,status:"running",running:0,succeeded:0,failed:0,parent_actor_id:$.parentActorID??null,args:$.args??null,script_sha:$.scriptSha??null,agent_timeout_ms:$.agentTimeoutMs??null}).onConflictDoUpdate({target:J1.id,set:{status:"running",running:0,succeeded:0,failed:0,script_sha:$.scriptSha??null,...$.agentTimeoutMs!==void 0?{agent_timeout_ms:$.agentTimeoutMs}:{}}}).run())),Hl=($)=>V.sync(()=>C0.use((Z)=>Z.update(J1).set({current_phase:$.phase}).where(D0(J1.id,$.runID)).run())),jl=($)=>V.sync(()=>C0.use((Z)=>Z.update(J1).set({running:$.running,succeeded:$.succeeded,failed:$.failed}).where(D0(J1.id,$.runID)).run())),Ol=($)=>V.sync(()=>C0.use((Z)=>Z.update(J1).set({status:$.status,...$.error?{error:$.error}:{}}).where(D0(J1.id,$.runID)).run())),Ul=($)=>V.sync(()=>C0.use((Z)=>{return(($?.sessionID)?Z.select().from(J1).where(D0(J1.session_id,$.sessionID)).orderBy(x8(J1.time_created)).all():Z.select().from(J1).orderBy(x8(J1.time_created)).all()).map(nN)})),Fl=($)=>V.sync(()=>C0.use((Z)=>{let J=Z.select().from(J1).where(D0(J1.id,$)).get();return J?nN(J):void 0})),ql=($,Z)=>V.promise(async()=>{await(await import("fs/promises")).mkdir(_Y(),{recursive:!0}),await Bun.write(iN($),Z)}),zl=($)=>V.promise(()=>Bun.file(iN($)).text()),_l=($,Z)=>V.promise(()=>pN($,[Z])),Dl=($,Z)=>V.promise(()=>pN($,Z)),Pl=($)=>V.promise(async()=>{let Z=Bun.file(H4($));if(!await Z.exists())return{results:new Map,pass:1};let J=await Z.text(),Y=new Map,Q=0;for(let X of J.split(`
8213
8213
  `)){if(!X)continue;let K;try{K=JSON.parse(X)}catch{continue}if(typeof K.pass==="number"&&K.pass>Q)Q=K.pass;if(K.t==="agent")Y.set(K.key,K.result)}return{results:Y,pass:Q+1}}),Ml=($)=>V.promise(async()=>{let J=(p6.get($)??Promise.resolve()).catch(()=>{}).then(async()=>{await(await import("fs/promises")).mkdir(_Y(),{recursive:!0}),await Bun.write(H4($),"")});p6.set($,J);try{await J}finally{if(p6.get($)===J)p6.delete($)}}),J2={recordStart:Bl,recordPhase:Hl,flushCounters:jl,recordTerminal:Ol,list:Ul,load:Fl,writeScript:ql,readScript:zl,appendJournal:_l,appendJournalSync:Dl,loadJournal:Pl,clearJournal:Ml};class j4{#$=new Map;get($){return this.#$.get($)}set($){return this.#$.set($.runID,$),$}values(){return this.#$.values()}clear(){this.#$.clear()}}function sN($){let Z=(X)=>V.gen(function*(){if(X.status!=="running")return;if(yield*J(X),yield*$.flushNow(X),yield*J2.recordTerminal({runID:X.runID,status:"cancelled"}).pipe(V.ignore),X.fiber)yield*y8.interrupt(X.fiber);X.status="cancelled",yield*$.bus.publish(v3,{sessionID:X.sessionID,runID:X.runID,status:"cancelled"}),yield*p0.succeed(X.deferred,{status:"cancelled"})}).pipe(V.provideService(A1,X.instance)),J=(X)=>V.gen(function*(){let K=G1.current;if(K)yield*V.forEach([...X.childActorIDs],(W)=>K.cancel(X.sessionID,W,"graceful").pipe(V.ignore),{concurrency:"unbounded",discard:!0});yield*V.forEach([...X.worktrees],(W)=>$.worktree.remove({directory:W}).pipe(V.ignore),{concurrency:"unbounded",discard:!0}),X.worktrees.clear(),yield*V.forEach([...X.childRunIDs],(W)=>V.gen(function*(){let G=$.runs.get(W);if(G&&G.status==="running")yield*Z(G)}).pipe(V.ignore),{concurrency:"unbounded",discard:!0})}).pipe(V.provideService(A1,X.instance));return{reclaim:J,cancelEntry:Z,complete:(X)=>V.gen(function*(){if(X.entry.status="completed",yield*$.flushNow(X.entry),yield*J2.recordTerminal({runID:X.entry.runID,status:"completed"}).pipe(V.ignore),yield*$.bus.publish(v3,{sessionID:X.sessionID,runID:X.entry.runID,status:"completed"}),X.notifyOnTerminal!==!1)yield*$.inbox.send({receiverSessionID:X.sessionID,receiverActorID:X.parentActorID,senderSessionID:X.sessionID,senderActorID:"workflow",type:"actor_notification",content:`Workflow completed. run_id: ${X.entry.runID}
8214
8214
  `+JSON.stringify(X.result??null).slice(0,4000)}).pipe(V.ignore);yield*p0.succeed(X.entry.deferred,{status:"completed",result:X.result})}).pipe(V.provideService(A1,X.entry.instance)),fail:(X)=>V.gen(function*(){if(yield*J(X.entry),X.entry.status="failed",yield*$.flushNow(X.entry),yield*J2.recordTerminal({runID:X.entry.runID,status:"failed",error:X.error}).pipe(V.ignore),yield*$.bus.publish(v3,{sessionID:X.sessionID,runID:X.entry.runID,status:"failed",error:X.error}),X.notifyOnTerminal!==!1)yield*$.inbox.send({receiverSessionID:X.sessionID,receiverActorID:X.parentActorID,senderSessionID:X.sessionID,senderActorID:"workflow",type:"actor_notification",content:`Workflow failed. run_id: ${X.entry.runID}
8215
- error: ${X.error}`}).pipe(V.ignore);yield*p0.succeed(X.entry.deferred,{status:"failed",error:X.error})}).pipe(V.provideService(A1,X.entry.instance))}}import Cl from"os";function O4($){let Z=0,J=[],Y=()=>{Z--;let Q=J.shift();if(Q)Q()};return{run(Q){return new Promise((X,K)=>{let W=()=>{Z++,Q().then((G)=>{Y(),X(G)},(G)=>{Y(),K(G)})};if(Z<$)W();else J.push(W)})}}}function rN(){let $=Cl.cpus().length;return Math.min(16,2*Math.max(1,$>0?$:4))}function aN($,Z){return V.gen(function*(){if(Z)yield*J2.clearJournal($).pipe(V.ignore);let J=yield*J2.loadJournal($);return{results:J.results,pass:J.pass,occurrences:new Map}})}function tN($,Z){let J=$.occurrences.get(Z)??0;return $.occurrences.set(Z,J+1),Z+":"+J}function eN($,Z,J,Y){return J2.appendJournalSync($,[{t:"agent",key:J,result:Y,pass:Z.pass}]).pipe(V.ignore)}var $A=Symbol("straggler-timeout");function JA($){let Z=(G,H,B,j)=>{let O=H.timeoutMs??$.runAgentTimeoutMs;if(!O||O<=0)return B;return V.raceFirst(B,V.sleep(`${O} millis`).pipe(V.as($A))).pipe(V.flatMap((U)=>U===$A?V.gen(function*(){let F=$.getActor();if(F)yield*F.cancel($.sessionID,G,"graceful").pipe(V.ignore);return yield*V.sync(()=>{try{j?.()}catch{}}),null}):V.succeed(U)))},J=(G,H,B={})=>{try{$.bridge.fork($.bus.publish(dN,{sessionID:$.sessionID,runID:$.runID,actorID:B.actorID,agentType:G.agentType??"general",label:G.label,phase:G.phase??$.entry.currentPhase,reason:H,errorMessage:B.errorMessage}).pipe(V.ignore))}catch{}},Y=(G)=>G.label?G.phase?`[${G.phase}] ${G.label}`:G.label:G.phase?`[${G.phase}]`:void 0,Q=(G,H,B)=>({mode:"subagent",sessionID:$.sessionID,agentType:G.agentType??"general",description:Y(G),task:H,context:"none",tools:G.tools?[...G.tools]:"INHERIT",background:!0,parentActorID:$.parentActorID,model:B,onActorID:(j)=>$.entry.childActorIDs.add(j),...G.schema?{format:{type:"json_schema",schema:G.schema,retryCount:2}}:{}}),X=async(G,H,B,j)=>{$.entry.running++,$.scheduleFlush($.entry);let O="actor-error",U,F,q=await $.bridge.promise(V.gen(function*(){let w=yield*G.spawn(Q(B,H,j));U=w.actorID;let D=yield*Z(w.actorID,B,p0.await(w.outcome).pipe(V.map((z)=>{if(z.status!=="success")return O="actor-error",F=z.error,null;let C=B.schema?z.structured??null:z.structured??z.finalText??null;if(C===null)O="no-deliverable";return C})),()=>{O="timeout"});return $.entry.childActorIDs.delete(w.actorID),D})).catch((w)=>{return O="spawn-reject",F=w instanceof Error?w.message:String(w),null});if($.entry.running--,q!==null)$.entry.succeeded++;else $.entry.failed++,J(B,O,{actorID:U,errorMessage:F});return $.scheduleFlush($.entry),q},K=async(G,H,B,j)=>{let O="actor-error",U,F,q=await $.bridge.promise(V.gen(function*(){let S=yield*$.worktree.makeWorktreeInfo();return yield*$.worktree.createFromInfo(S),S})).catch((S)=>{return F=S instanceof Error?S.message:String(S),null});if(!q)return J(B,"spawn-reject",{errorMessage:F}),null;$.entry.worktrees.add(q.directory);let w=await $.bridge.promise($.worktree.head(q.directory)).catch(()=>""),D=await q0.provide({directory:q.directory,fn:()=>Promise.resolve(q0.current)}),z=await $.bridge.promise(ZA().pipe(V.provideService(A1,D)));$.entry.running++,$.scheduleFlush($.entry);let C=await q0.provide({directory:q.directory,fn:()=>z.promise(V.gen(function*(){let S=yield*G.spawn(Q(B,H,j));U=S.actorID;let v=yield*Z(S.actorID,B,p0.await(S.outcome),()=>{O="timeout"});if($.entry.childActorIDs.delete(S.actorID),v===null)return null;if(v.status!=="success")O="actor-error",F=v.error;return{actorID:S.actorID,outcome:v}})).catch((S)=>{return O="spawn-reject",F=S instanceof Error?S.message:String(S),null})}).catch((S)=>{return O="spawn-reject",F=S instanceof Error?S.message:String(S),null}),P=!!C&&C.outcome.status==="success";if($.entry.running--,P)$.entry.succeeded++;else $.entry.failed++,J(B,O,{actorID:U,errorMessage:F});$.scheduleFlush($.entry);let y=C&&C.outcome.status==="success"?B.schema?C.outcome.structured??null:C.outcome.structured??C.outcome.finalText??null:null,I=w!==""&&await $.bridge.promise($.worktree.isPristine(q.directory,w)).catch(()=>!1);if(!(P&&!I))return await $.bridge.promise($.worktree.remove({directory:q.directory})).catch(()=>{return}),$.entry.worktrees.delete(q.directory),P?y:null;let h={branch:q.branch,directory:q.directory,changed:!0};if(y&&typeof y==="object"&&!Array.isArray(y))return{...y,_worktree:h};return{_worktree:h,result:y}},W=async(G,H,B)=>{if($.entry.agentCount>=$.lifecycleCap)return $.warnCapOnce(),J(G,"over-cap"),null;$.entry.agentCount++;let j=$.getActor();if(!j)throw Error("Actor service unavailable");let O=await $.bridge.promise($.resolveAgentModel(G.model,$.defaultModel,$.entry.warnedModelRefs));return B(j,H,G,O)};return(G,H)=>{let B=H??{},j=String(G);if(B.isolation!=="worktree"){let O=lN(j,{agentType:B.agentType,model:B.model,schema:B.schema,phase:B.phase}),U=tN($.journal,O);if($.journal.results.has(U))return $.entry.succeeded++,$.scheduleFlush($.entry),Promise.resolve($.journal.results.get(U));return(async()=>{let F=await $.semaphore.run(async()=>$.globalSemaphore.run(async()=>W(B,j,X)));if(F!==null)await V.runPromise(eN($.runID,$.journal,U,F));return F})()}return $.semaphore.run(async()=>$.globalSemaphore.run(async()=>W(B,j,K)))}}async function YA($){let Z=U4(await $),[J,Y,{QuickJSWASMModule:Q}]=await Promise.all([Z.importModuleLoader().then(U4),Z.importFFI(),import("./chunk-4ftjx7ss.js").then(U4)]),X=await J();X.type="sync";let K=new Y(X);return new Q(X,K)}function U4($){return $&&"default"in $&&$.default?$.default&&"default"in $.default&&$.default.default?$.default.default:$.default:$}function QA($){let Z=typeof $=="number"?$:$.getTime();return function(){return Date.now()>Z}}var wl={type:"sync",importFFI:()=>import("./chunk-na1wr2qf.js").then(($)=>$.QuickJSFFI),importModuleLoader:()=>import("./chunk-6r48fje7.js").then(($)=>$.default)},XA=wl;var Nl=YA(XA),VA=43200000,Al=67108864,Ll=2654435769,yl=`
8215
+ error: ${X.error}`}).pipe(V.ignore);yield*p0.succeed(X.entry.deferred,{status:"failed",error:X.error})}).pipe(V.provideService(A1,X.entry.instance))}}import Cl from"os";function O4($){let Z=0,J=[],Y=()=>{Z--;let Q=J.shift();if(Q)Q()};return{run(Q){return new Promise((X,K)=>{let W=()=>{Z++,Q().then((G)=>{Y(),X(G)},(G)=>{Y(),K(G)})};if(Z<$)W();else J.push(W)})}}}function rN(){let $=Cl.cpus().length;return Math.min(16,2*Math.max(1,$>0?$:4))}function aN($,Z){return V.gen(function*(){if(Z)yield*J2.clearJournal($).pipe(V.ignore);let J=yield*J2.loadJournal($);return{results:J.results,pass:J.pass,occurrences:new Map}})}function tN($,Z){let J=$.occurrences.get(Z)??0;return $.occurrences.set(Z,J+1),Z+":"+J}function eN($,Z,J,Y){return J2.appendJournalSync($,[{t:"agent",key:J,result:Y,pass:Z.pass}]).pipe(V.ignore)}var $A=Symbol("straggler-timeout");function JA($){let Z=(G,H,B,j)=>{let O=H.timeoutMs??$.runAgentTimeoutMs;if(!O||O<=0)return B;return V.raceFirst(B,V.sleep(`${O} millis`).pipe(V.as($A))).pipe(V.flatMap((U)=>U===$A?V.gen(function*(){let F=$.getActor();if(F)yield*F.cancel($.sessionID,G,"graceful").pipe(V.ignore);return yield*V.sync(()=>{try{j?.()}catch{}}),null}):V.succeed(U)))},J=(G,H,B={})=>{try{$.bridge.fork($.bus.publish(dN,{sessionID:$.sessionID,runID:$.runID,actorID:B.actorID,agentType:G.agentType??"general",label:G.label,phase:G.phase??$.entry.currentPhase,reason:H,errorMessage:B.errorMessage}).pipe(V.ignore))}catch{}},Y=(G)=>G.label?G.phase?`[${G.phase}] ${G.label}`:G.label:G.phase?`[${G.phase}]`:void 0,Q=(G,H,B)=>({mode:"subagent",sessionID:$.sessionID,agentType:G.agentType??"general",description:Y(G),task:H,context:"none",tools:G.tools?[...G.tools]:"INHERIT",background:!0,parentActorID:$.parentActorID,model:B,onActorID:(j)=>$.entry.childActorIDs.add(j),...G.schema?{format:{type:"json_schema",schema:G.schema,retryCount:2}}:{}}),X=async(G,H,B,j)=>{$.entry.running++,$.scheduleFlush($.entry);let O="actor-error",U,F,q=await $.bridge.promise(V.gen(function*(){let w=yield*G.spawn(Q(B,H,j));U=w.actorID;let D=yield*Z(w.actorID,B,p0.await(w.outcome).pipe(V.map((z)=>{if(z.status!=="success")return O="actor-error",F=z.error,null;let C=B.schema?z.structured??null:z.structured??z.finalText??null;if(C===null)O="no-deliverable";return C})),()=>{O="timeout"});return $.entry.childActorIDs.delete(w.actorID),D})).catch((w)=>{return O="spawn-reject",F=w instanceof Error?w.message:String(w),null});if($.entry.running--,q!==null)$.entry.succeeded++;else $.entry.failed++,J(B,O,{actorID:U,errorMessage:F});return $.scheduleFlush($.entry),q},K=async(G,H,B,j)=>{let O="actor-error",U,F,q=await $.bridge.promise(V.gen(function*(){let S=yield*$.worktree.makeWorktreeInfo();return yield*$.worktree.createFromInfo(S),S})).catch((S)=>{return F=S instanceof Error?S.message:String(S),null});if(!q)return J(B,"spawn-reject",{errorMessage:F}),null;$.entry.worktrees.add(q.directory);let w=await $.bridge.promise($.worktree.head(q.directory)).catch(()=>""),D=await q0.provide({directory:q.directory,fn:()=>Promise.resolve(q0.current)}),z=await $.bridge.promise(ZA().pipe(V.provideService(A1,D)));$.entry.running++,$.scheduleFlush($.entry);let C=await q0.provide({directory:q.directory,fn:()=>z.promise(V.gen(function*(){let S=yield*G.spawn(Q(B,H,j));U=S.actorID;let v=yield*Z(S.actorID,B,p0.await(S.outcome),()=>{O="timeout"});if($.entry.childActorIDs.delete(S.actorID),v===null)return null;if(v.status!=="success")O="actor-error",F=v.error;return{actorID:S.actorID,outcome:v}})).catch((S)=>{return O="spawn-reject",F=S instanceof Error?S.message:String(S),null})}).catch((S)=>{return O="spawn-reject",F=S instanceof Error?S.message:String(S),null}),P=!!C&&C.outcome.status==="success";if($.entry.running--,P)$.entry.succeeded++;else $.entry.failed++,J(B,O,{actorID:U,errorMessage:F});$.scheduleFlush($.entry);let y=C&&C.outcome.status==="success"?B.schema?C.outcome.structured??null:C.outcome.structured??C.outcome.finalText??null:null,I=w!==""&&await $.bridge.promise($.worktree.isPristine(q.directory,w)).catch(()=>!1);if(!(P&&!I))return await $.bridge.promise($.worktree.remove({directory:q.directory})).catch(()=>{return}),$.entry.worktrees.delete(q.directory),P?y:null;let h={branch:q.branch,directory:q.directory,changed:!0};if(y&&typeof y==="object"&&!Array.isArray(y))return{...y,_worktree:h};return{_worktree:h,result:y}},W=async(G,H,B)=>{if($.entry.agentCount>=$.lifecycleCap)return $.warnCapOnce(),J(G,"over-cap"),null;$.entry.agentCount++;let j=$.getActor();if(!j)throw Error("Actor service unavailable");let O=await $.bridge.promise($.resolveAgentModel(G.model,$.defaultModel,$.entry.warnedModelRefs));return B(j,H,G,O)};return(G,H)=>{let B=H??{},j=String(G);if(B.isolation!=="worktree"){let O=lN(j,{agentType:B.agentType,model:B.model,schema:B.schema,phase:B.phase}),U=tN($.journal,O);if($.journal.results.has(U))return $.entry.succeeded++,$.scheduleFlush($.entry),Promise.resolve($.journal.results.get(U));return(async()=>{let F=await $.semaphore.run(async()=>$.globalSemaphore.run(async()=>W(B,j,X)));if(F!==null)await V.runPromise(eN($.runID,$.journal,U,F));return F})()}return $.semaphore.run(async()=>$.globalSemaphore.run(async()=>W(B,j,K)))}}async function YA($){let Z=U4(await $),[J,Y,{QuickJSWASMModule:Q}]=await Promise.all([Z.importModuleLoader().then(U4),Z.importFFI(),import("./chunk-4gqb1hps.js").then(U4)]),X=await J();X.type="sync";let K=new Y(X);return new Q(X,K)}function U4($){return $&&"default"in $&&$.default?$.default&&"default"in $.default&&$.default.default?$.default.default:$.default:$}function QA($){let Z=typeof $=="number"?$:$.getTime();return function(){return Date.now()>Z}}var wl={type:"sync",importFFI:()=>import("./chunk-g9nwqwqp.js").then(($)=>$.QuickJSFFI),importModuleLoader:()=>import("./chunk-tbx741en.js").then(($)=>$.default)},XA=wl;var Nl=YA(XA),VA=43200000,Al=67108864,Ll=2654435769,yl=`
8216
8216
  globalThis.parallel = (thunks) =>
8217
8217
  Promise.all(thunks.map((t) => Promise.resolve().then(t)));
8218
8218
  globalThis.pipeline = (items, ...stages) =>