@opencode-ai/core 0.0.0-next-17428 → 0.0.0-next-17444

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 (748) hide show
  1. package/dist/account/sql.js +2 -2
  2. package/dist/agent.js +72 -71
  3. package/dist/aisdk-native.js +3 -3
  4. package/dist/aisdk.js +4 -4
  5. package/dist/app.js +2 -2
  6. package/dist/bus.js +70 -69
  7. package/dist/catalog.js +80 -79
  8. package/dist/chunks/{wellknown-9qang0mx.js → catalog-01ebynez.js} +4 -4
  9. package/dist/chunks/{wellknown-02dbfq60.js → catalog-02dbfq60.js} +1 -1
  10. package/dist/chunks/{wellknown-04kwjb53.js → catalog-04kwjb53.js} +2 -2
  11. package/dist/chunks/catalog-0brv01ad.js +49 -0
  12. package/dist/chunks/{wellknown-0kvmztkf.js → catalog-0kvmztkf.js} +1 -1
  13. package/dist/chunks/{wellknown-4sx1mfdx.js → catalog-0nen29yh.js} +3 -3
  14. package/dist/chunks/{wellknown-0r325ptc.js → catalog-0r325ptc.js} +2 -2
  15. package/dist/chunks/{wellknown-qb3ddt1e.js → catalog-0rbs31my.js} +6 -6
  16. package/dist/chunks/{wellknown-wk8da17y.js → catalog-10dtswrt.js} +11 -11
  17. package/dist/chunks/{wellknown-10xtr3be.js → catalog-10xtr3be.js} +2 -2
  18. package/dist/chunks/{wellknown-t30hh3v8.js → catalog-12bc2eg0.js} +9 -9
  19. package/dist/chunks/{wellknown-axyymfph.js → catalog-16ey40c1.js} +8 -8
  20. package/dist/chunks/{wellknown-18pv8fg3.js → catalog-18pv8fg3.js} +2 -2
  21. package/dist/chunks/{wellknown-1c00jchy.js → catalog-1c00jchy.js} +2 -2
  22. package/dist/chunks/{wellknown-1kvtxahz.js → catalog-1kvtxahz.js} +1 -1
  23. package/dist/chunks/{wellknown-1xksxgzs.js → catalog-1xksxgzs.js} +2 -2
  24. package/dist/chunks/{wellknown-95mjgmfz.js → catalog-1xz5sz2a.js} +114 -114
  25. package/dist/chunks/{wellknown-1r0604ha.js → catalog-23jq4zns.js} +25 -25
  26. package/dist/chunks/{wellknown-25pxtba7.js → catalog-25pxtba7.js} +1 -1
  27. package/dist/chunks/{wellknown-h23rd83w.js → catalog-2bvs565v.js} +5 -5
  28. package/dist/chunks/{wellknown-sk3rf249.js → catalog-2h1xrwab.js} +5 -5
  29. package/dist/chunks/{wellknown-2m0g72hh.js → catalog-2m0g72hh.js} +1 -1
  30. package/dist/chunks/{wellknown-2nmyybe0.js → catalog-2nmyybe0.js} +1 -1
  31. package/dist/chunks/{wellknown-9s951t4s.js → catalog-2rsenhj2.js} +4 -4
  32. package/dist/chunks/{wellknown-37rcj8p3.js → catalog-37rcj8p3.js} +3 -3
  33. package/dist/chunks/{wellknown-sxf2cmhg.js → catalog-3bw22jds.js} +5 -5
  34. package/dist/chunks/{wellknown-3mfgaav1.js → catalog-3mfgaav1.js} +4 -4
  35. package/dist/chunks/{wellknown-ptr7bqe1.js → catalog-3qccyarx.js} +6 -6
  36. package/dist/chunks/{wellknown-dfaxpxmf.js → catalog-3ryhqhr7.js} +3 -3
  37. package/dist/chunks/{wellknown-3thh6229.js → catalog-3thh6229.js} +2 -2
  38. package/dist/chunks/{wellknown-3vh42rcr.js → catalog-3vh42rcr.js} +2 -2
  39. package/dist/chunks/{wellknown-3w0f1yxt.js → catalog-3w0f1yxt.js} +3 -3
  40. package/dist/chunks/{wellknown-scpmsk9g.js → catalog-3z9y63bn.js} +5 -5
  41. package/dist/chunks/{wellknown-cdaj9a7h.js → catalog-44f2bkq5.js} +3 -3
  42. package/dist/chunks/{wellknown-xkd017fx.js → catalog-4rqaa0rr.js} +3 -3
  43. package/dist/chunks/{wellknown-4s2xwh5d.js → catalog-4s2xwh5d.js} +3 -3
  44. package/dist/chunks/{wellknown-bp2jeqhw.js → catalog-4ywcqb35.js} +6 -6
  45. package/dist/chunks/{wellknown-6sc9h3ca.js → catalog-4zg0gww9.js} +1 -62
  46. package/dist/chunks/{wellknown-4zzdwbaz.js → catalog-4zzdwbaz.js} +2 -2
  47. package/dist/chunks/{wellknown-50jxp3hw.js → catalog-50jxp3hw.js} +1 -1
  48. package/dist/chunks/{wellknown-ww5r1ab5.js → catalog-514e7nae.js} +3 -3
  49. package/dist/chunks/{wellknown-52jzav25.js → catalog-52jzav25.js} +1 -1
  50. package/dist/chunks/{wellknown-56p2m126.js → catalog-56p2m126.js} +1 -1
  51. package/dist/chunks/{wellknown-57tzwnz4.js → catalog-57tzwnz4.js} +1 -1
  52. package/dist/chunks/{wellknown-3667weqr.js → catalog-59gkvrwn.js} +10 -10
  53. package/dist/chunks/{wellknown-fqxe1avk.js → catalog-5ddq80b2.js} +10 -10
  54. package/dist/chunks/{wellknown-2m1cqesy.js → catalog-5fmasw9x.js} +3 -3
  55. package/dist/chunks/{wellknown-5fvy871a.js → catalog-5fvy871a.js} +4 -4
  56. package/dist/chunks/{wellknown-88mbd3pa.js → catalog-5j343qws.js} +6 -6
  57. package/dist/chunks/{wellknown-9md6srn9.js → catalog-5kb96x0x.js} +8 -8
  58. package/dist/chunks/{wellknown-5p2sx24b.js → catalog-5p2sx24b.js} +3 -3
  59. package/dist/chunks/{wellknown-5pfeh60c.js → catalog-5pfeh60c.js} +2 -2
  60. package/dist/chunks/{wellknown-5rs65q6p.js → catalog-5rs65q6p.js} +1 -1
  61. package/dist/chunks/{wellknown-5sgbvx3z.js → catalog-5sgbvx3z.js} +2 -2
  62. package/dist/chunks/{wellknown-45af57yr.js → catalog-5wyssej8.js} +6 -6
  63. package/dist/chunks/{wellknown-xgtvhkz1.js → catalog-60k09xg3.js} +9 -9
  64. package/dist/chunks/{wellknown-71dk037r.js → catalog-6e2p349p.js} +3 -3
  65. package/dist/chunks/{wellknown-1swmyd9s.js → catalog-6m63e6rk.js} +3 -5
  66. package/dist/chunks/{wellknown-j8ka1twd.js → catalog-6t38kx8p.js} +11 -11
  67. package/dist/chunks/{wellknown-68kcdzx8.js → catalog-6t8191pv.js} +8 -8
  68. package/dist/chunks/{wellknown-706a4azd.js → catalog-706a4azd.js} +1 -1
  69. package/dist/chunks/{wellknown-9j70epm2.js → catalog-743903h2.js} +3 -3
  70. package/dist/chunks/{wellknown-9axst7sz.js → catalog-7859pmrr.js} +18 -18
  71. package/dist/chunks/catalog-7mpw7j43.js +287 -0
  72. package/dist/chunks/{wellknown-7mrpdsq5.js → catalog-7mrpdsq5.js} +1 -1
  73. package/dist/chunks/{wellknown-xrt9v94p.js → catalog-7r1x0h9d.js} +2 -2
  74. package/dist/chunks/{wellknown-7wcmqxrc.js → catalog-7wcmqxrc.js} +1 -1
  75. package/dist/chunks/{wellknown-857g7h76.js → catalog-857g7h76.js} +1 -1
  76. package/dist/chunks/{wellknown-88jbfw8z.js → catalog-88jbfw8z.js} +2 -2
  77. package/dist/chunks/{wellknown-nv7zjdpe.js → catalog-8bkmtpp6.js} +5 -5
  78. package/dist/chunks/{wellknown-q17rnp67.js → catalog-8cyga2ha.js} +3 -3
  79. package/dist/chunks/{wellknown-q4r4pzs4.js → catalog-8k8ks5a6.js} +2 -13
  80. package/dist/chunks/{wellknown-gm8kdh5e.js → catalog-8v47shgf.js} +3 -9
  81. package/dist/chunks/catalog-8vhzxx5g.js +25 -0
  82. package/dist/chunks/{wellknown-8ywqk2j9.js → catalog-8ywqk2j9.js} +1 -1
  83. package/dist/chunks/{wellknown-ft7h7q1f.js → catalog-8zz83a7q.js} +5 -5
  84. package/dist/chunks/{wellknown-3a4qzh5k.js → catalog-91wzd76q.js} +5 -5
  85. package/dist/chunks/{wellknown-93qdgxxd.js → catalog-93qdgxxd.js} +1 -1
  86. package/dist/chunks/{wellknown-adt1c913.js → catalog-94dza2q4.js} +4 -4
  87. package/dist/chunks/{wellknown-x7rkvn5e.js → catalog-95xyfdax.js} +12 -12
  88. package/dist/chunks/{wellknown-999qd968.js → catalog-999qd968.js} +1 -1
  89. package/dist/chunks/{wellknown-r7cbhthp.js → catalog-9a767y7b.js} +5 -5
  90. package/dist/chunks/{wellknown-9d2xhdr4.js → catalog-9d2xhdr4.js} +3 -3
  91. package/dist/chunks/{wellknown-9f0rnpkn.js → catalog-9f0rnpkn.js} +1 -1
  92. package/dist/chunks/{wellknown-9q1hedyj.js → catalog-9q1hedyj.js} +2 -2
  93. package/dist/chunks/{wellknown-9r0qzhnf.js → catalog-9r0qzhnf.js} +2 -2
  94. package/dist/chunks/{wellknown-0cjwzmdv.js → catalog-9s9me6y6.js} +6 -6
  95. package/dist/chunks/{wellknown-ww5x4bmh.js → catalog-9vj26axg.js} +5 -5
  96. package/dist/chunks/{wellknown-nqyy66w8.js → catalog-9wj1vz52.js} +14 -14
  97. package/dist/chunks/{wellknown-a65h300v.js → catalog-a65h300v.js} +2 -2
  98. package/dist/chunks/{wellknown-s99aagmk.js → catalog-af5dwr8b.js} +9 -9
  99. package/dist/chunks/{wellknown-bfh4wnyx.js → catalog-agh3hf73.js} +13 -10
  100. package/dist/chunks/{wellknown-ayfwnm78.js → catalog-ayfwnm78.js} +2 -2
  101. package/dist/chunks/{wellknown-g4j6fhwe.js → catalog-bp4cmj5d.js} +2 -2
  102. package/dist/chunks/{wellknown-akkksjcs.js → catalog-br9bzwn4.js} +17 -17
  103. package/dist/chunks/{wellknown-n7fgxfv6.js → catalog-bwkeshyk.js} +5 -5
  104. package/dist/chunks/{wellknown-byab506k.js → catalog-byab506k.js} +1 -1
  105. package/dist/chunks/{wellknown-t3jbn7nf.js → catalog-c22dcebs.js} +9 -9
  106. package/dist/chunks/{wellknown-cgvnqv92.js → catalog-cgvnqv92.js} +1 -1
  107. package/dist/chunks/{wellknown-mv93rkcb.js → catalog-ct36ahd0.js} +7 -7
  108. package/dist/chunks/{wellknown-jcb8x4bq.js → catalog-ct7kkwwa.js} +4 -4
  109. package/dist/chunks/{wellknown-avq9khkd.js → catalog-cx0q29mb.js} +11 -11
  110. package/dist/chunks/{wellknown-cz3dkvcz.js → catalog-cz3dkvcz.js} +1 -1
  111. package/dist/chunks/{wellknown-d076mabj.js → catalog-d076mabj.js} +2 -2
  112. package/dist/chunks/{wellknown-b5g9y9jx.js → catalog-d6bwqrcn.js} +1 -1
  113. package/dist/chunks/{wellknown-d6vvk673.js → catalog-d6vvk673.js} +1 -1
  114. package/dist/chunks/{wellknown-4zjfew5g.js → catalog-d84mf888.js} +5 -5
  115. package/dist/chunks/{wellknown-ddn74qps.js → catalog-ddn74qps.js} +2 -2
  116. package/dist/chunks/{wellknown-dhphtf1x.js → catalog-dhphtf1x.js} +1 -1
  117. package/dist/chunks/{wellknown-w6y7qp8t.js → catalog-dktf68zy.js} +4 -22
  118. package/dist/chunks/{wellknown-6vbsjkr0.js → catalog-dt4bpbk7.js} +14 -50
  119. package/dist/chunks/{wellknown-e1z9a0ts.js → catalog-e1z9a0ts.js} +2 -2
  120. package/dist/chunks/{wellknown-30nzded7.js → catalog-e5j5xapc.js} +7 -7
  121. package/dist/chunks/{wellknown-jkrm4ad7.js → catalog-ecxv0vtt.js} +10 -0
  122. package/dist/chunks/{wellknown-ed4jjjcc.js → catalog-ed4jjjcc.js} +2 -2
  123. package/dist/chunks/{wellknown-wsddybb2.js → catalog-efscbyqy.js} +1 -1
  124. package/dist/chunks/catalog-em6xpscd.js +35 -0
  125. package/dist/chunks/{wellknown-ydpcg630.js → catalog-emgjf39t.js} +3 -3
  126. package/dist/chunks/{wellknown-erj4j75s.js → catalog-erj4j75s.js} +1 -1
  127. package/dist/chunks/{wellknown-q16dfqy6.js → catalog-ev1a59wp.js} +4 -4
  128. package/dist/chunks/{wellknown-eyk9wdct.js → catalog-eyk9wdct.js} +2 -2
  129. package/dist/chunks/{wellknown-xq9jfs3k.js → catalog-eyrqmf62.js} +8 -8
  130. package/dist/chunks/{wellknown-f05p34aa.js → catalog-f05p34aa.js} +3 -3
  131. package/dist/chunks/{wellknown-xfhg1qv2.js → catalog-f1s7006s.js} +13 -13
  132. package/dist/chunks/{wellknown-w5ywr3ab.js → catalog-f6g8t1by.js} +88 -84
  133. package/dist/chunks/{wellknown-hskb502a.js → catalog-f6k9sp1x.js} +5 -5
  134. package/dist/chunks/{wellknown-fm1nvm5g.js → catalog-fm1nvm5g.js} +1 -1
  135. package/dist/chunks/{wellknown-fmyre8m1.js → catalog-fmyre8m1.js} +1 -1
  136. package/dist/chunks/{wellknown-4hxh2c3r.js → catalog-fxmgvssp.js} +9 -9
  137. package/dist/chunks/{wellknown-4d3rgnp3.js → catalog-g1ks1p7z.js} +8 -8
  138. package/dist/chunks/{wellknown-g9yygpzr.js → catalog-g9yygpzr.js} +1 -1
  139. package/dist/chunks/{wellknown-gcay93cp.js → catalog-gcay93cp.js} +1 -1
  140. package/dist/chunks/{wellknown-gd2xppx8.js → catalog-gd2xppx8.js} +1 -1
  141. package/dist/chunks/{wellknown-pbwysafm.js → catalog-gk2phes7.js} +8 -8
  142. package/dist/chunks/{wellknown-ycvdvag8.js → catalog-gn24398s.js} +13 -13
  143. package/dist/chunks/{wellknown-vynn1k31.js → catalog-gpee7ppy.js} +3 -6
  144. package/dist/chunks/{wellknown-njsy6pae.js → catalog-gr504th9.js} +5 -5
  145. package/dist/chunks/{wellknown-at7d33az.js → catalog-h65hz4jm.js} +6 -6
  146. package/dist/chunks/{wellknown-h8ecejt5.js → catalog-h8ecejt5.js} +1 -1
  147. package/dist/chunks/{wellknown-p3e59vfk.js → catalog-hbb01ekb.js} +5 -5
  148. package/dist/chunks/{wellknown-x6fskmqx.js → catalog-hgaas1a4.js} +2 -2
  149. package/dist/chunks/{wellknown-wt1vmgpp.js → catalog-hj2tb0pc.js} +31 -31
  150. package/dist/chunks/{wellknown-tyh0a1hs.js → catalog-hkp4zrd4.js} +3 -3
  151. package/dist/chunks/{wellknown-xdyax1v4.js → catalog-j3mnn31z.js} +7 -7
  152. package/dist/chunks/{wellknown-y2kycdcv.js → catalog-j9v2c738.js} +3 -3
  153. package/dist/chunks/{wellknown-4yexey5z.js → catalog-jdqp7a75.js} +8 -8
  154. package/dist/chunks/{wellknown-2nfxgcca.js → catalog-jpd9z2va.js} +5 -5
  155. package/dist/chunks/{wellknown-659gdbm3.js → catalog-js4mhysh.js} +7 -7
  156. package/dist/chunks/{wellknown-jssy2dr3.js → catalog-jssy2dr3.js} +2 -2
  157. package/dist/chunks/{wellknown-jq70kwhh.js → catalog-jyscbp9m.js} +9 -9
  158. package/dist/chunks/{wellknown-6t3tjp1t.js → catalog-jzepdhcr.js} +2 -2
  159. package/dist/chunks/{wellknown-k6vwd7kr.js → catalog-k6vwd7kr.js} +3 -3
  160. package/dist/chunks/{wellknown-kcwh27nh.js → catalog-kcwh27nh.js} +3 -3
  161. package/dist/chunks/{wellknown-6y9cy4ak.js → catalog-keysyqq7.js} +6 -6
  162. package/dist/chunks/{wellknown-kg1345f7.js → catalog-kg1345f7.js} +1 -1
  163. package/dist/chunks/{wellknown-apayjrxn.js → catalog-kheg4nbt.js} +60 -60
  164. package/dist/chunks/{wellknown-8wgdza7z.js → catalog-knr1ecwr.js} +15 -25
  165. package/dist/chunks/{wellknown-w6jkse96.js → catalog-kysjsvk0.js} +4 -4
  166. package/dist/chunks/{wellknown-jhdzjt2r.js → catalog-kztt8qk9.js} +80 -81
  167. package/dist/chunks/{wellknown-m01ryvbe.js → catalog-m01ryvbe.js} +1 -1
  168. package/dist/chunks/{wellknown-wkc2sg7c.js → catalog-m712gcsw.js} +2 -2
  169. package/dist/chunks/{wellknown-9zy456m4.js → catalog-me6kx06r.js} +2 -2
  170. package/dist/chunks/{wellknown-mf0hyk7z.js → catalog-mf0hyk7z.js} +1 -1
  171. package/dist/chunks/catalog-mh28new4.js +17 -0
  172. package/dist/chunks/catalog-mhmd8pwt.js +252 -0
  173. package/dist/chunks/{wellknown-mwceq5am.js → catalog-mwceq5am.js} +1 -1
  174. package/dist/chunks/{wellknown-25552m23.js → catalog-n6djjn6b.js} +3 -3
  175. package/dist/chunks/{wellknown-nesb2rcz.js → catalog-nesb2rcz.js} +2 -2
  176. package/dist/chunks/{wellknown-nr76rjj3.js → catalog-nr76rjj3.js} +2 -2
  177. package/dist/chunks/{wellknown-nzrjycs5.js → catalog-nzrjycs5.js} +1 -1
  178. package/dist/chunks/{wellknown-s8da7qpe.js → catalog-p14gxk1c.js} +17 -17
  179. package/dist/chunks/{wellknown-1ne78j78.js → catalog-pcj6jaw5.js} +4 -4
  180. package/dist/chunks/{wellknown-pfqehjmy.js → catalog-pfqehjmy.js} +2 -2
  181. package/dist/chunks/{wellknown-2kz33ygq.js → catalog-pfyg00kd.js} +10 -10
  182. package/dist/chunks/{wellknown-ph1me6ah.js → catalog-ph1me6ah.js} +2 -2
  183. package/dist/chunks/{wellknown-wvfnazp2.js → catalog-pjtwvkss.js} +3 -3
  184. package/dist/chunks/{wellknown-pq4b4pqk.js → catalog-pq4b4pqk.js} +2 -2
  185. package/dist/chunks/{wellknown-prf9bavk.js → catalog-prf9bavk.js} +3 -3
  186. package/dist/chunks/{wellknown-hm63m8ez.js → catalog-q0t3sg8a.js} +82 -64
  187. package/dist/chunks/{wellknown-dkcxqm1a.js → catalog-q4rg85vt.js} +10 -10
  188. package/dist/chunks/{wellknown-99wwwqzn.js → catalog-qdshr6v9.js} +13 -9
  189. package/dist/chunks/{wellknown-qe0d689s.js → catalog-qe0d689s.js} +2 -2
  190. package/dist/chunks/{wellknown-0rnmdg6p.js → catalog-qk1q6gpy.js} +27 -27
  191. package/dist/chunks/{wellknown-ryrm2gj3.js → catalog-qkwy710h.js} +2 -2
  192. package/dist/chunks/{wellknown-hgbdyp9r.js → catalog-qtqakd8r.js} +31 -31
  193. package/dist/chunks/{wellknown-r3k9abhd.js → catalog-r3k9abhd.js} +2 -2
  194. package/dist/chunks/{wellknown-8mwggd1z.js → catalog-rh7vxbnf.js} +20 -20
  195. package/dist/chunks/{wellknown-rqswsgbs.js → catalog-rqswsgbs.js} +2 -2
  196. package/dist/chunks/{wellknown-rt6yg6j2.js → catalog-rt6yg6j2.js} +2 -2
  197. package/dist/chunks/{wellknown-ryap75b3.js → catalog-ryap75b3.js} +1 -1
  198. package/dist/chunks/{wellknown-s6by3cc4.js → catalog-s6by3cc4.js} +3 -3
  199. package/dist/chunks/{wellknown-z5wnp00d.js → catalog-s8qevcta.js} +11 -11
  200. package/dist/chunks/{wellknown-s9f13v9h.js → catalog-s9f13v9h.js} +1 -1
  201. package/dist/chunks/{wellknown-vphy579y.js → catalog-sdesqhp6.js} +4 -4
  202. package/dist/chunks/{wellknown-smpeg8c9.js → catalog-smpeg8c9.js} +2 -2
  203. package/dist/chunks/{wellknown-ppcrn5r0.js → catalog-sqrt138j.js} +26 -31
  204. package/dist/chunks/{wellknown-t8end1qd.js → catalog-sv0xzyx0.js} +4 -4
  205. package/dist/chunks/{wellknown-g2ddtk1s.js → catalog-sv2h4wvj.js} +9 -9
  206. package/dist/chunks/{wellknown-p8zd5xzf.js → catalog-sxkhxd81.js} +3 -3
  207. package/dist/chunks/{wellknown-szax8zgv.js → catalog-szax8zgv.js} +2 -2
  208. package/dist/chunks/{wellknown-szjq6xea.js → catalog-szjq6xea.js} +2 -2
  209. package/dist/chunks/{wellknown-t2j2ttmx.js → catalog-t2j2ttmx.js} +1 -1
  210. package/dist/chunks/{wellknown-f378j7vw.js → catalog-tbb4m47q.js} +7 -7
  211. package/dist/chunks/{wellknown-tcn24h1d.js → catalog-tcn24h1d.js} +1 -1
  212. package/dist/chunks/{wellknown-tenv3kfs.js → catalog-tenv3kfs.js} +2 -2
  213. package/dist/chunks/{wellknown-edpjba35.js → catalog-tggay00j.js} +4 -4
  214. package/dist/chunks/{wellknown-thstd87d.js → catalog-thstd87d.js} +1 -1
  215. package/dist/chunks/{wellknown-0f6ca4zc.js → catalog-tn256t7f.js} +2 -2
  216. package/dist/chunks/{wellknown-ts4t4v20.js → catalog-ts4t4v20.js} +2 -2
  217. package/dist/chunks/{wellknown-wr3k63ve.js → catalog-v75zhgpj.js} +5 -5
  218. package/dist/chunks/{wellknown-v972xay6.js → catalog-v972xay6.js} +1 -1
  219. package/dist/chunks/{wellknown-v9bfv94f.js → catalog-v9bfv94f.js} +1 -1
  220. package/dist/chunks/{wellknown-fzc1wfxm.js → catalog-vcem8grb.js} +2 -2
  221. package/dist/chunks/{wellknown-82vs55eb.js → catalog-vdeynkmz.js} +10 -10
  222. package/dist/chunks/{wellknown-vz89hfgr.js → catalog-vz89hfgr.js} +1 -1
  223. package/dist/chunks/{wellknown-wjrkb032.js → catalog-w49cz7xv.js} +4 -4
  224. package/dist/chunks/{wellknown-6f3c0gvx.js → catalog-w7cys7gf.js} +4 -4
  225. package/dist/chunks/{wellknown-w6055s4r.js → catalog-wady9nrb.js} +27 -27
  226. package/dist/chunks/{wellknown-wd268jeg.js → catalog-wd268jeg.js} +1 -1
  227. package/dist/chunks/{wellknown-we2zmhe4.js → catalog-we2zmhe4.js} +2 -2
  228. package/dist/chunks/{wellknown-wf37p1a1.js → catalog-wf37p1a1.js} +1 -1
  229. package/dist/chunks/{wellknown-wmxdh12w.js → catalog-wmxdh12w.js} +1 -1
  230. package/dist/chunks/{wellknown-wps8gh8n.js → catalog-wps8gh8n.js} +2 -2
  231. package/dist/chunks/{wellknown-wt193r4g.js → catalog-wt193r4g.js} +1 -1
  232. package/dist/chunks/{wellknown-54ec2rpx.js → catalog-wyzk30wf.js} +10 -10
  233. package/dist/chunks/{wellknown-bt7xmf0d.js → catalog-xc67d6rc.js} +34 -36
  234. package/dist/chunks/{wellknown-xfd1xnk3.js → catalog-xfd1xnk3.js} +2 -2
  235. package/dist/chunks/{wellknown-xfrawapx.js → catalog-xfrawapx.js} +1 -1
  236. package/dist/chunks/{wellknown-mmnmpsem.js → catalog-xgp46ta4.js} +3 -3
  237. package/dist/chunks/{wellknown-xgv25zxy.js → catalog-xgv25zxy.js} +1 -1
  238. package/dist/chunks/{wellknown-20mhz48y.js → catalog-xk5wr58k.js} +5 -5
  239. package/dist/chunks/{wellknown-tsxyhgjv.js → catalog-xrgme11k.js} +10 -10
  240. package/dist/chunks/{wellknown-xwftk1fd.js → catalog-xwftk1fd.js} +2 -2
  241. package/dist/chunks/{wellknown-k9y1gart.js → catalog-xxza29yq.js} +3 -3
  242. package/dist/chunks/{wellknown-y0x38cee.js → catalog-y0x38cee.js} +1 -1
  243. package/dist/chunks/{wellknown-2jtfzwaa.js → catalog-y23acc5q.js} +3 -3
  244. package/dist/chunks/{wellknown-y67x6rf6.js → catalog-y67x6rf6.js} +1 -1
  245. package/dist/chunks/{wellknown-tbecz2nc.js → catalog-y7nqvzgy.js} +29 -29
  246. package/dist/chunks/{wellknown-e9899ctm.js → catalog-y7qv4f0z.js} +2 -2
  247. package/dist/chunks/{wellknown-y8rs54ne.js → catalog-y8rs54ne.js} +1 -1
  248. package/dist/chunks/{wellknown-9e8aeag2.js → catalog-yc1386c7.js} +5 -5
  249. package/dist/chunks/{wellknown-f77j3bk1.js → catalog-yqwvcaka.js} +3 -3
  250. package/dist/chunks/{wellknown-yz0wm9s3.js → catalog-yz0wm9s3.js} +2 -2
  251. package/dist/chunks/{wellknown-zbqqnp0n.js → catalog-zbqqnp0n.js} +1 -1
  252. package/dist/chunks/{wellknown-zdkg1k91.js → catalog-zdkg1k91.js} +1 -1
  253. package/dist/chunks/{wellknown-zfxc0ze5.js → catalog-zfxc0ze5.js} +1 -1
  254. package/dist/chunks/{wellknown-4e4pa5kh.js → catalog-zh02cvbf.js} +23 -23
  255. package/dist/chunks/{wellknown-zthe9zqc.js → catalog-zthe9zqc.js} +1 -1
  256. package/dist/codemode/catalog.js +2 -2
  257. package/dist/codemode/instructions.js +4 -4
  258. package/dist/codemode/tool.js +3 -3
  259. package/dist/command.js +126 -129
  260. package/dist/config/markdown.js +2 -2
  261. package/dist/config/normalize.js +20 -20
  262. package/dist/config/plugin/agent.js +131 -130
  263. package/dist/config/plugin/command.js +128 -131
  264. package/dist/config/plugin/instruction.js +87 -86
  265. package/dist/config/plugin/policy.js +112 -111
  266. package/dist/config/plugin/provider.js +111 -110
  267. package/dist/config/plugin/reference.js +115 -114
  268. package/dist/config/plugin/skill-file.js +104 -103
  269. package/dist/config/plugin/skill.js +134 -133
  270. package/dist/config/plugin/source.js +111 -110
  271. package/dist/config/plugin/websearch.js +111 -110
  272. package/dist/config/variable.js +4 -4
  273. package/dist/config.js +110 -109
  274. package/dist/credential/sql.js +3 -3
  275. package/dist/credential.js +70 -69
  276. package/dist/database/database.js +67 -66
  277. package/dist/database/drizzle/effect-sqlite/driver.js +16 -16
  278. package/dist/database/drizzle/effect-sqlite/index.js +16 -16
  279. package/dist/database/drizzle/effect-sqlite/migrator.js +15 -15
  280. package/dist/database/drizzle/effect-sqlite/session.js +15 -15
  281. package/dist/database/drizzle/index.js +18 -18
  282. package/dist/database/drizzle/internal/drizzle-utils.js +2 -2
  283. package/dist/database/drizzle/sqlite-core/effect/count.js +2 -2
  284. package/dist/database/drizzle/sqlite-core/effect/db.js +11 -13
  285. package/dist/database/drizzle/sqlite-core/effect/delete.js +3 -3
  286. package/dist/database/drizzle/sqlite-core/effect/index.js +23 -25
  287. package/dist/database/drizzle/sqlite-core/effect/insert.js +3 -3
  288. package/dist/database/drizzle/sqlite-core/effect/query.js +2 -2
  289. package/dist/database/drizzle/sqlite-core/effect/raw.js +2 -2
  290. package/dist/database/drizzle/sqlite-core/effect/select.js +3 -3
  291. package/dist/database/drizzle/sqlite-core/effect/session.js +14 -14
  292. package/dist/database/drizzle/sqlite-core/effect/update.js +3 -3
  293. package/dist/database/drizzle/up-migrations/effect-sqlite.js +4 -4
  294. package/dist/database/drizzle/up-migrations/sqlite.js +3 -8
  295. package/dist/database/drizzle/up-migrations/utils.js +2 -2
  296. package/dist/database/drizzle.js +19 -19
  297. package/dist/database/migration/20260127222353_familiar_lady_ursula.js +2 -2
  298. package/dist/database/migration/20260211171708_add_project_commands.js +2 -2
  299. package/dist/database/migration/20260213144116_wakeful_the_professor.js +2 -2
  300. package/dist/database/migration/20260225215848_workspace.js +2 -2
  301. package/dist/database/migration/20260227213759_add_session_workspace_id.js +2 -2
  302. package/dist/database/migration/20260228203230_blue_harpoon.js +2 -2
  303. package/dist/database/migration/20260303231226_add_workspace_fields.js +2 -2
  304. package/dist/database/migration/20260309230000_move_org_to_state.js +2 -2
  305. package/dist/database/migration/20260312043431_session_message_cursor.js +2 -2
  306. package/dist/database/migration/20260323234822_events.js +2 -2
  307. package/dist/database/migration/20260410174513_workspace-name.js +2 -2
  308. package/dist/database/migration/20260413175956_chief_energizer.js +2 -2
  309. package/dist/database/migration/20260423070820_add_icon_url_override.js +2 -2
  310. package/dist/database/migration/20260427172553_slow_nightmare.js +2 -2
  311. package/dist/database/migration/20260428004200_add_session_path.js +2 -2
  312. package/dist/database/migration/20260501142318_next_venus.js +2 -2
  313. package/dist/database/migration/20260504145000_add_sync_owner.js +2 -2
  314. package/dist/database/migration/20260507164347_add_workspace_time.js +2 -2
  315. package/dist/database/migration/20260510033149_session_usage.js +2 -2
  316. package/dist/database/migration/20260511000411_data_migration_state.js +2 -2
  317. package/dist/database/migration/20260511173437_session-metadata.js +2 -2
  318. package/dist/database/migration/20260601010001_normalize_storage_paths.js +2 -2
  319. package/dist/database/migration/20260601202201_amazing_prowler.js +2 -2
  320. package/dist/database/migration/20260602002951_lowly_union_jack.js +2 -2
  321. package/dist/database/migration/20260602182828_add_project_directories.js +2 -2
  322. package/dist/database/migration/20260603001617_session_message_projection_indexes.js +2 -2
  323. package/dist/database/migration/20260603040000_session_message_projection_order.js +2 -2
  324. package/dist/database/migration/20260603141458_session_input_inbox.js +2 -2
  325. package/dist/database/migration/20260603160727_jittery_ezekiel_stane.js +2 -2
  326. package/dist/database/migration/20260604172448_event_sourced_session_input.js +2 -2
  327. package/dist/database/migration/20260605003541_add_session_context_snapshot.js +2 -2
  328. package/dist/database/migration/20260605042240_add_context_epoch_agent.js +2 -2
  329. package/dist/database/migration/20260611035744_credential.js +2 -2
  330. package/dist/database/migration/20260611192811_lush_chimera.js +2 -2
  331. package/dist/database/migration/20260612174303_project_dir_strategy.js +2 -2
  332. package/dist/database/migration/20260622142730_simplify_session_context_epoch.js +2 -2
  333. package/dist/database/migration/20260622170816_reset_v2_session_state.js +2 -2
  334. package/dist/database/migration/20260622202450_simplify_session_input.js +2 -2
  335. package/dist/database/migration/20260804233008_loose_psylocke.js +2 -2
  336. package/dist/database/migration/20260805200742_import_legacy_credentials.js +2 -2
  337. package/dist/database/migration/20260808023530_workspace_domain.js +2 -2
  338. package/dist/database/migration/20260811161259_execution_claim_attempts.js +2 -2
  339. package/dist/database/migration/20260812181746_session_inbox.js +2 -2
  340. package/dist/database/migration/20260812213948_worktree.js +7 -0
  341. package/dist/database/migration.gen.js +46 -45
  342. package/dist/database/migration.js +48 -47
  343. package/dist/database/path.js +3 -3
  344. package/dist/database/schema.gen.js +2 -2
  345. package/dist/database/schema.sql.js +2 -2
  346. package/dist/database/sqlite.bun.js +2 -2
  347. package/dist/database/sqlite.js +2 -2
  348. package/dist/database/sqlite.node.js +2 -2
  349. package/dist/database/sqlite.workerd.js +2 -2
  350. package/dist/database/v1-migration.bun.js +80 -79
  351. package/dist/database/v1-migration.js +2 -2
  352. package/dist/database/v1-migration.noop.js +1 -1
  353. package/dist/effect/app-node-builder.js +312 -312
  354. package/dist/effect/app-node-platform.js +2 -2
  355. package/dist/effect/keyed-mutex.js +2 -2
  356. package/dist/environment/driver.js +1 -1
  357. package/dist/environment/environment.js +88 -87
  358. package/dist/environment/exec-defaults.js +3 -3
  359. package/dist/environment/files.js +2 -2
  360. package/dist/environment/index.js +90 -89
  361. package/dist/environment/local.js +3 -3
  362. package/dist/environment/memory.js +3 -3
  363. package/dist/environment/unavailable.js +1 -1
  364. package/dist/event/sql.js +2 -2
  365. package/dist/event-logger.js +70 -69
  366. package/dist/file-mutation.js +89 -88
  367. package/dist/file.js +2 -2
  368. package/dist/filesystem/fff.bun.js +2 -2
  369. package/dist/filesystem/fff.js +2 -2
  370. package/dist/filesystem/fff.node.js +2 -2
  371. package/dist/filesystem/fff.workerd.js +2 -2
  372. package/dist/filesystem/ignore.js +1 -1
  373. package/dist/filesystem/location-watcher.js +111 -110
  374. package/dist/filesystem/protected.js +2 -2
  375. package/dist/filesystem/search.js +93 -92
  376. package/dist/filesystem/watcher-binding.js +2 -2
  377. package/dist/filesystem/watcher.js +4 -4
  378. package/dist/filesystem.js +93 -92
  379. package/dist/form.js +71 -72
  380. package/dist/formatter/builtins.js +3 -3
  381. package/dist/formatter.js +113 -112
  382. package/dist/generate.js +85 -84
  383. package/dist/git.js +5 -5
  384. package/dist/github-copilot/chat/convert-to-openai-compatible-chat-messages.js +2 -2
  385. package/dist/github-copilot/chat/get-response-metadata.js +2 -2
  386. package/dist/github-copilot/chat/map-openai-compatible-finish-reason.js +2 -2
  387. package/dist/github-copilot/chat/openai-compatible-chat-language-model.js +8 -8
  388. package/dist/github-copilot/chat/openai-compatible-chat-options.js +2 -2
  389. package/dist/github-copilot/chat/openai-compatible-prepare-tools.js +2 -2
  390. package/dist/github-copilot/copilot-provider.js +21 -21
  391. package/dist/github-copilot/models.js +4 -4
  392. package/dist/github-copilot/openai-compatible-error.js +2 -2
  393. package/dist/github-copilot/responses/convert-to-openai-responses-input.js +3 -3
  394. package/dist/github-copilot/responses/map-openai-responses-finish-reason.js +2 -2
  395. package/dist/github-copilot/responses/openai-error.js +2 -2
  396. package/dist/github-copilot/responses/openai-responses-language-model.js +12 -12
  397. package/dist/github-copilot/responses/openai-responses-prepare-tools.js +7 -7
  398. package/dist/github-copilot/responses/tool/code-interpreter.js +2 -2
  399. package/dist/github-copilot/responses/tool/file-search.js +2 -2
  400. package/dist/github-copilot/responses/tool/image-generation.js +2 -2
  401. package/dist/github-copilot/responses/tool/local-shell.js +2 -2
  402. package/dist/github-copilot/responses/tool/web-search-preview.js +2 -2
  403. package/dist/github-copilot/responses/tool/web-search.js +2 -2
  404. package/dist/id/id.js +2 -2
  405. package/dist/image/photon-wasm.bun.js +1 -1
  406. package/dist/image/photon-wasm.node.js +1 -1
  407. package/dist/image/photon-wasm.workerd.js +1 -1
  408. package/dist/image/photon.js +124 -123
  409. package/dist/image.js +124 -123
  410. package/dist/instruction-discovery.js +74 -73
  411. package/dist/instructions/builtins.js +83 -82
  412. package/dist/instructions/index.js +2 -4
  413. package/dist/integration/connection.js +2 -2
  414. package/dist/integration.js +77 -76
  415. package/dist/job.js +4 -4
  416. package/dist/kv/sql.js +3 -3
  417. package/dist/kv.js +70 -69
  418. package/dist/location-mutation.js +81 -80
  419. package/dist/location-service-map.js +81 -80
  420. package/dist/location-services.js +312 -312
  421. package/dist/location.js +80 -79
  422. package/dist/mcp/client.js +351 -93
  423. package/dist/mcp/index.js +123 -126
  424. package/dist/mcp/instructions.js +151 -154
  425. package/dist/mcp/oauth.js +173 -10
  426. package/dist/mcp/stdio.js +89 -88
  427. package/dist/mime.js +2 -2
  428. package/dist/model-resolver.js +83 -82
  429. package/dist/model.js +3 -3
  430. package/dist/models-dev.js +77 -76
  431. package/dist/oauth/page.js +2 -2
  432. package/dist/permission/saved.js +81 -80
  433. package/dist/permission/sql.js +6 -6
  434. package/dist/permission.js +101 -100
  435. package/dist/plugin/agent.js +102 -101
  436. package/dist/plugin/command.js +81 -80
  437. package/dist/plugin/hooks.js +3 -3
  438. package/dist/plugin/host.js +182 -185
  439. package/dist/plugin/internal.js +270 -272
  440. package/dist/plugin/models-dev.js +78 -77
  441. package/dist/plugin/plan.js +74 -73
  442. package/dist/plugin/promise.js +146 -145
  443. package/dist/plugin/provider/alibaba.js +3 -3
  444. package/dist/plugin/provider/amazon-bedrock.js +3 -3
  445. package/dist/plugin/provider/anthropic.js +3 -3
  446. package/dist/plugin/provider/azure.js +118 -117
  447. package/dist/plugin/provider/cerebras.js +3 -3
  448. package/dist/plugin/provider/cloudflare-ai-gateway.js +119 -118
  449. package/dist/plugin/provider/cloudflare-workers-ai.js +119 -118
  450. package/dist/plugin/provider/cohere.js +3 -3
  451. package/dist/plugin/provider/configured.js +116 -115
  452. package/dist/plugin/provider/deepinfra.js +3 -3
  453. package/dist/plugin/provider/dynamic.js +2 -2
  454. package/dist/plugin/provider/factory.js +2 -2
  455. package/dist/plugin/provider/gateway.js +3 -3
  456. package/dist/plugin/provider/github-copilot.js +84 -83
  457. package/dist/plugin/provider/gitlab.js +4 -4
  458. package/dist/plugin/provider/google-vertex.js +3 -3
  459. package/dist/plugin/provider/groq.js +3 -3
  460. package/dist/plugin/provider/kilo.js +3 -3
  461. package/dist/plugin/provider/llmgateway.js +79 -78
  462. package/dist/plugin/provider/mistral.js +3 -3
  463. package/dist/plugin/provider/nvidia.js +3 -3
  464. package/dist/plugin/provider/openai-compatible.js +2 -2
  465. package/dist/plugin/provider/openai.js +81 -80
  466. package/dist/plugin/provider/opencode.js +95 -94
  467. package/dist/plugin/provider/openrouter.js +4 -4
  468. package/dist/plugin/provider/perplexity.js +3 -3
  469. package/dist/plugin/provider/sap-ai-core.js +3 -3
  470. package/dist/plugin/provider/snowflake-cortex.js +3 -3
  471. package/dist/plugin/provider/togetherai.js +3 -3
  472. package/dist/plugin/provider/venice.js +3 -3
  473. package/dist/plugin/provider/vercel.js +3 -3
  474. package/dist/plugin/provider/xai.js +79 -78
  475. package/dist/plugin/provider/zenmux.js +3 -3
  476. package/dist/plugin/provider.js +154 -153
  477. package/dist/plugin/runtime.js +173 -176
  478. package/dist/plugin/sdk.js +71 -70
  479. package/dist/plugin/skill.js +132 -131
  480. package/dist/plugin/supervisor.js +275 -277
  481. package/dist/plugin/system-prompt.js +2 -2
  482. package/dist/plugin/variant.js +4 -4
  483. package/dist/plugin/warming.js +112 -111
  484. package/dist/plugin/websearch/exa.js +4 -4
  485. package/dist/plugin/websearch/firecrawl.js +5 -5
  486. package/dist/plugin/websearch/index.js +8 -8
  487. package/dist/plugin/websearch/mcp.js +3 -3
  488. package/dist/plugin/websearch/parallel.js +5 -5
  489. package/dist/plugin.js +183 -186
  490. package/dist/project/schema.js +3 -9
  491. package/dist/project/sql.js +5 -5
  492. package/dist/project.js +79 -84
  493. package/dist/provider.js +2 -2
  494. package/dist/pty/protocol.js +1 -1
  495. package/dist/pty/pty.bun.js +1 -1
  496. package/dist/pty/pty.node.js +1 -1
  497. package/dist/pty/pty.workerd.js +1 -1
  498. package/dist/pty/schema.js +2 -2
  499. package/dist/pty/ticket.js +72 -71
  500. package/dist/pty.js +114 -113
  501. package/dist/question.js +72 -71
  502. package/dist/reference/instructions.js +79 -78
  503. package/dist/reference.js +77 -76
  504. package/dist/repository-cache.js +7 -7
  505. package/dist/repository.js +2 -2
  506. package/dist/ripgrep/binary.js +3 -3
  507. package/dist/ripgrep.js +91 -90
  508. package/dist/schema.js +2 -2
  509. package/dist/session/compaction.js +148 -147
  510. package/dist/session/context.js +283 -285
  511. package/dist/session/error.js +4 -4
  512. package/dist/session/event.js +2 -2
  513. package/dist/session/execution/restart.js +117 -116
  514. package/dist/session/execution.js +117 -116
  515. package/dist/session/generate-node.js +289 -291
  516. package/dist/session/generate.js +2 -2
  517. package/dist/session/history.js +79 -78
  518. package/dist/session/inbox.js +81 -78
  519. package/dist/session/info.js +89 -88
  520. package/dist/session/instruction-entry.js +75 -74
  521. package/dist/session/instruction-state.js +10 -10
  522. package/dist/session/instructions.js +98 -97
  523. package/dist/session/message-updater.js +4 -4
  524. package/dist/session/message.js +2 -2
  525. package/dist/session/model-headers.js +4 -4
  526. package/dist/session/model-http.js +4 -4
  527. package/dist/session/model-request.js +291 -293
  528. package/dist/session/projector.js +91 -90
  529. package/dist/session/prompt-cache-diagnostics.js +2 -2
  530. package/dist/session/prompt-cache-key.js +3 -3
  531. package/dist/session/revert.js +116 -115
  532. package/dist/session/run-coordinator.js +2 -2
  533. package/dist/session/runner/index.js +86 -85
  534. package/dist/session/runner/llm.js +299 -301
  535. package/dist/session/runner/max-steps.js +2 -2
  536. package/dist/session/runner/model.js +85 -84
  537. package/dist/session/runner/publish-llm-event.js +4 -4
  538. package/dist/session/runner/retry.js +74 -73
  539. package/dist/session/runner/to-llm-message.js +2 -2
  540. package/dist/session/schema.js +2 -2
  541. package/dist/session/sql.js +6 -6
  542. package/dist/session/store.js +97 -96
  543. package/dist/session/title.js +114 -113
  544. package/dist/session/to-session-error.js +113 -112
  545. package/dist/session/transfer.js +176 -179
  546. package/dist/session/usage.js +2 -2
  547. package/dist/session.js +172 -175
  548. package/dist/shell/parse.js +4 -4
  549. package/dist/shell/parser-wasm.bun.js +10 -0
  550. package/dist/shell/parser-wasm.node.js +13 -0
  551. package/dist/shell/parser-wasm.workerd.js +7 -0
  552. package/dist/shell/select.js +3 -3
  553. package/dist/shell.js +123 -122
  554. package/dist/skill/discovery.js +3 -3
  555. package/dist/skill/instructions.js +103 -102
  556. package/dist/skill.js +102 -101
  557. package/dist/snapshot.js +111 -110
  558. package/dist/state.js +2 -2
  559. package/dist/tool/html-markdown.js +2 -2
  560. package/dist/tool/http-body.js +2 -2
  561. package/dist/tool/mcp.js +150 -153
  562. package/dist/tool/plugin/edit.js +141 -140
  563. package/dist/tool/plugin/file-diff.js +2 -2
  564. package/dist/tool/plugin/glob.js +113 -112
  565. package/dist/tool/plugin/grep.js +113 -112
  566. package/dist/tool/plugin/patch.js +140 -139
  567. package/dist/tool/plugin/question.js +104 -103
  568. package/dist/tool/plugin/read.js +116 -115
  569. package/dist/tool/plugin/shell.js +177 -180
  570. package/dist/tool/plugin/skill.js +103 -102
  571. package/dist/tool/plugin/subagent.js +174 -177
  572. package/dist/tool/plugin/webfetch.js +104 -103
  573. package/dist/tool/plugin/websearch.js +106 -105
  574. package/dist/tool/plugin/write.js +141 -140
  575. package/dist/tool/read-filesystem.js +95 -94
  576. package/dist/tool/runtime.js +2 -2
  577. package/dist/tool-output.js +112 -111
  578. package/dist/tool.js +145 -144
  579. package/dist/types/bus.d.ts +0 -5
  580. package/dist/types/database/drizzle/sqlite-core/effect/db.d.ts +0 -5
  581. package/dist/types/database/drizzle/up-migrations/sqlite.d.ts +0 -27
  582. package/dist/types/database/migration/20260812213948_worktree.d.ts +3 -0
  583. package/dist/types/form.d.ts +0 -1
  584. package/dist/types/instructions/index.d.ts +0 -1
  585. package/dist/types/job.d.ts +0 -1
  586. package/dist/types/location-service-map.d.ts +2 -2
  587. package/dist/types/location-services.d.ts +1 -2
  588. package/dist/types/permission.d.ts +8 -10
  589. package/dist/types/project/schema.d.ts +0 -16
  590. package/dist/types/project/sql.d.ts +1 -0
  591. package/dist/types/project.d.ts +0 -17
  592. package/dist/types/session/inbox.d.ts +5 -0
  593. package/dist/types/shell/parse.d.ts +1 -17
  594. package/dist/types/shell/parser-wasm.bun.d.ts +5 -0
  595. package/dist/types/shell/parser-wasm.node.d.ts +5 -0
  596. package/dist/types/shell/parser-wasm.workerd.d.ts +5 -0
  597. package/dist/types/util/encode.d.ts +0 -1
  598. package/dist/types/v1/config/migrate.d.ts +1 -1
  599. package/dist/types/worktree/directory.d.ts +9 -0
  600. package/dist/types/worktree/git.d.ts +22 -0
  601. package/dist/types/worktree/sql.d.ts +71 -0
  602. package/dist/types/worktree.d.ts +310 -0
  603. package/dist/util/array.js +1 -1
  604. package/dist/util/binary.js +1 -1
  605. package/dist/util/encode.js +5 -14
  606. package/dist/util/error.js +2 -2
  607. package/dist/util/identifier.js +1 -1
  608. package/dist/util/iife.js +2 -2
  609. package/dist/util/lazy.js +2 -2
  610. package/dist/util/path.js +1 -1
  611. package/dist/util/process-lock-ffi.bun.js +1 -1
  612. package/dist/util/process-lock-ffi.node.js +1 -1
  613. package/dist/util/process-lock-ffi.workerd.js +1 -1
  614. package/dist/util/process-lock.js +1 -1
  615. package/dist/util/retry.js +1 -1
  616. package/dist/util/slug.js +2 -2
  617. package/dist/util/token.js +2 -2
  618. package/dist/util/which.js +2 -2
  619. package/dist/util/wildcard.js +2 -2
  620. package/dist/v1/config/agent.js +4 -4
  621. package/dist/v1/config/attachment.js +3 -3
  622. package/dist/v1/config/command.js +2 -2
  623. package/dist/v1/config/config.js +15 -15
  624. package/dist/v1/config/error.js +3 -3
  625. package/dist/v1/config/formatter.js +2 -2
  626. package/dist/v1/config/layout.js +2 -2
  627. package/dist/v1/config/lsp.js +2 -2
  628. package/dist/v1/config/mcp.js +3 -3
  629. package/dist/v1/config/migrate.js +19 -19
  630. package/dist/v1/config/permission.js +2 -2
  631. package/dist/v1/config/plugin.js +2 -2
  632. package/dist/v1/config/provider-options.js +2 -2
  633. package/dist/v1/config/provider.js +3 -3
  634. package/dist/v1/config/server.js +3 -3
  635. package/dist/v1/config/skills.js +2 -2
  636. package/dist/v1/permission.js +1 -1
  637. package/dist/vcs/git.js +3 -3
  638. package/dist/vcs/hg.js +3 -3
  639. package/dist/vcs/patch.js +2 -2
  640. package/dist/vcs.js +84 -83
  641. package/dist/websearch.js +75 -74
  642. package/dist/wellknown/plugin.js +75 -74
  643. package/dist/wellknown.js +74 -73
  644. package/dist/workspace/driver.js +2 -2
  645. package/dist/workspace/sql.js +2 -2
  646. package/dist/workspace.js +71 -70
  647. package/dist/worktree/directory.js +12 -0
  648. package/dist/worktree/git.js +14 -0
  649. package/dist/worktree/sql.js +11 -0
  650. package/dist/worktree.js +130 -0
  651. package/package.json +16 -8
  652. package/dist/chunks/wellknown-657k7zj4.js +0 -267
  653. package/dist/chunks/wellknown-g70fvz2n.js +0 -239
  654. package/dist/chunks/wellknown-gzs1fz36.js +0 -77
  655. package/dist/chunks/wellknown-j1x99epj.js +0 -1022
  656. package/dist/chunks/wellknown-xq1vkeee.js +0 -176
  657. package/dist/project/copy-strategies.js +0 -86
  658. package/dist/project/copy.js +0 -120
  659. package/dist/project/directories.js +0 -89
  660. package/dist/types/project/copy-strategies.d.ts +0 -24
  661. package/dist/types/project/copy.d.ts +0 -96
  662. package/dist/types/project/directories.d.ts +0 -49
  663. /package/dist/chunks/{wellknown-0cgt0xh2.js → catalog-0cgt0xh2.js} +0 -0
  664. /package/dist/chunks/{wellknown-0f48qthw.js → catalog-0f48qthw.js} +0 -0
  665. /package/dist/chunks/{wellknown-0zz82cjq.js → catalog-0zz82cjq.js} +0 -0
  666. /package/dist/chunks/{wellknown-1fb7bmpf.js → catalog-1fb7bmpf.js} +0 -0
  667. /package/dist/chunks/{wellknown-1wcz8fvj.js → catalog-1wcz8fvj.js} +0 -0
  668. /package/dist/chunks/{wellknown-2qdx6zz3.js → catalog-2qdx6zz3.js} +0 -0
  669. /package/dist/chunks/{wellknown-3c4nztf9.js → catalog-3c4nztf9.js} +0 -0
  670. /package/dist/chunks/{wellknown-3g3rpp2x.js → catalog-3g3rpp2x.js} +0 -0
  671. /package/dist/chunks/{wellknown-3q6gbwmd.js → catalog-3q6gbwmd.js} +0 -0
  672. /package/dist/chunks/{wellknown-3w3ybtfd.js → catalog-3w3ybtfd.js} +0 -0
  673. /package/dist/chunks/{wellknown-47ty4mvs.js → catalog-47ty4mvs.js} +0 -0
  674. /package/dist/chunks/{wellknown-4b2tz2m9.js → catalog-4b2tz2m9.js} +0 -0
  675. /package/dist/chunks/{wellknown-5a5ch9ts.js → catalog-5a5ch9ts.js} +0 -0
  676. /package/dist/chunks/{wellknown-5va1yh78.js → catalog-5va1yh78.js} +0 -0
  677. /package/dist/chunks/{wellknown-69qrqpw0.js → catalog-69qrqpw0.js} +0 -0
  678. /package/dist/chunks/{wellknown-6jtjggv5.js → catalog-6jtjggv5.js} +0 -0
  679. /package/dist/chunks/{wellknown-6yt963b8.js → catalog-6yt963b8.js} +0 -0
  680. /package/dist/chunks/{wellknown-7n9qwqk4.js → catalog-7n9qwqk4.js} +0 -0
  681. /package/dist/chunks/{wellknown-8m0qaa0v.js → catalog-8m0qaa0v.js} +0 -0
  682. /package/dist/chunks/{wellknown-8nn8kqcn.js → catalog-8nn8kqcn.js} +0 -0
  683. /package/dist/chunks/{wellknown-8sj3ajy5.js → catalog-8sj3ajy5.js} +0 -0
  684. /package/dist/chunks/{wellknown-8w9tzfz1.js → catalog-8w9tzfz1.js} +0 -0
  685. /package/dist/chunks/{wellknown-906y0b6d.js → catalog-906y0b6d.js} +0 -0
  686. /package/dist/chunks/{wellknown-9dct5xhx.js → catalog-9dct5xhx.js} +0 -0
  687. /package/dist/chunks/{wellknown-9sdtsapf.js → catalog-9sdtsapf.js} +0 -0
  688. /package/dist/chunks/{wellknown-a02svayp.js → catalog-a02svayp.js} +0 -0
  689. /package/dist/chunks/{wellknown-a83yvq99.js → catalog-a83yvq99.js} +0 -0
  690. /package/dist/chunks/{wellknown-ayevdmef.js → catalog-ayevdmef.js} +0 -0
  691. /package/dist/chunks/{wellknown-b02txbh8.js → catalog-b02txbh8.js} +0 -0
  692. /package/dist/chunks/{wellknown-bbqs2y60.js → catalog-bbqs2y60.js} +0 -0
  693. /package/dist/chunks/{wellknown-brsh5f65.js → catalog-brsh5f65.js} +0 -0
  694. /package/dist/chunks/{wellknown-bxdhjb3y.js → catalog-bxdhjb3y.js} +0 -0
  695. /package/dist/chunks/{wellknown-c77ad0vh.js → catalog-c77ad0vh.js} +0 -0
  696. /package/dist/chunks/{wellknown-cm67rqy2.js → catalog-cm67rqy2.js} +0 -0
  697. /package/dist/chunks/{wellknown-d6s8p2vk.js → catalog-d6s8p2vk.js} +0 -0
  698. /package/dist/chunks/{wellknown-dbah77c1.js → catalog-dbah77c1.js} +0 -0
  699. /package/dist/chunks/{wellknown-df3v2q6j.js → catalog-df3v2q6j.js} +0 -0
  700. /package/dist/chunks/{wellknown-dhcq6c44.js → catalog-dhcq6c44.js} +0 -0
  701. /package/dist/chunks/{wellknown-dht5baf0.js → catalog-dht5baf0.js} +0 -0
  702. /package/dist/chunks/{wellknown-dkmkay92.js → catalog-dkmkay92.js} +0 -0
  703. /package/dist/chunks/{wellknown-dppgrtwb.js → catalog-dppgrtwb.js} +0 -0
  704. /package/dist/chunks/{wellknown-ehj9csmv.js → catalog-ehj9csmv.js} +0 -0
  705. /package/dist/chunks/{wellknown-emmqknsm.js → catalog-emmqknsm.js} +0 -0
  706. /package/dist/chunks/{wellknown-ezs3tagn.js → catalog-ezs3tagn.js} +0 -0
  707. /package/dist/chunks/{wellknown-f4cp4g4a.js → catalog-f4cp4g4a.js} +0 -0
  708. /package/dist/chunks/{wellknown-f84sxdqn.js → catalog-f84sxdqn.js} +0 -0
  709. /package/dist/chunks/{wellknown-faypg4r1.js → catalog-faypg4r1.js} +0 -0
  710. /package/dist/chunks/{wellknown-g7k9te92.js → catalog-g7k9te92.js} +0 -0
  711. /package/dist/chunks/{wellknown-gd5xeqc2.js → catalog-gd5xeqc2.js} +0 -0
  712. /package/dist/chunks/{wellknown-ghm4673n.js → catalog-ghm4673n.js} +0 -0
  713. /package/dist/chunks/{wellknown-ghwjy7my.js → catalog-ghwjy7my.js} +0 -0
  714. /package/dist/chunks/{wellknown-gy500k2r.js → catalog-gy500k2r.js} +0 -0
  715. /package/dist/chunks/{wellknown-hzeg9cfr.js → catalog-hzeg9cfr.js} +0 -0
  716. /package/dist/chunks/{wellknown-j07kk359.js → catalog-j07kk359.js} +0 -0
  717. /package/dist/chunks/{wellknown-jve7t217.js → catalog-jve7t217.js} +0 -0
  718. /package/dist/chunks/{wellknown-kpdbz7gn.js → catalog-kpdbz7gn.js} +0 -0
  719. /package/dist/chunks/{wellknown-kxy11nzk.js → catalog-kxy11nzk.js} +0 -0
  720. /package/dist/chunks/{wellknown-kyyqvx4s.js → catalog-kyyqvx4s.js} +0 -0
  721. /package/dist/chunks/{wellknown-m8cbvarh.js → catalog-m8cbvarh.js} +0 -0
  722. /package/dist/chunks/{wellknown-ma07p6tt.js → catalog-ma07p6tt.js} +0 -0
  723. /package/dist/chunks/{wellknown-ma60vzgv.js → catalog-ma60vzgv.js} +0 -0
  724. /package/dist/chunks/{wellknown-n3m50c2t.js → catalog-n3m50c2t.js} +0 -0
  725. /package/dist/chunks/{wellknown-nkm1m8dz.js → catalog-nkm1m8dz.js} +0 -0
  726. /package/dist/chunks/{wellknown-nsc0c3zb.js → catalog-nsc0c3zb.js} +0 -0
  727. /package/dist/chunks/{wellknown-qaarhjrp.js → catalog-qaarhjrp.js} +0 -0
  728. /package/dist/chunks/{wellknown-qc167nrn.js → catalog-qc167nrn.js} +0 -0
  729. /package/dist/chunks/{wellknown-qp95y4jb.js → catalog-qp95y4jb.js} +0 -0
  730. /package/dist/chunks/{wellknown-r8f4w671.js → catalog-r8f4w671.js} +0 -0
  731. /package/dist/chunks/{wellknown-rdfev9jy.js → catalog-rdfev9jy.js} +0 -0
  732. /package/dist/chunks/{wellknown-rvfvac9x.js → catalog-rvfvac9x.js} +0 -0
  733. /package/dist/chunks/{wellknown-s7whb9gt.js → catalog-s7whb9gt.js} +0 -0
  734. /package/dist/chunks/{wellknown-se76j685.js → catalog-se76j685.js} +0 -0
  735. /package/dist/chunks/{wellknown-sem2g21k.js → catalog-sem2g21k.js} +0 -0
  736. /package/dist/chunks/{wellknown-tmb1f636.js → catalog-tmb1f636.js} +0 -0
  737. /package/dist/chunks/{wellknown-ttxf0gsy.js → catalog-ttxf0gsy.js} +0 -0
  738. /package/dist/chunks/{wellknown-tvmhrvfj.js → catalog-tvmhrvfj.js} +0 -0
  739. /package/dist/chunks/{wellknown-v2adqbbe.js → catalog-v2adqbbe.js} +0 -0
  740. /package/dist/chunks/{wellknown-wj4sxzqa.js → catalog-wj4sxzqa.js} +0 -0
  741. /package/dist/chunks/{wellknown-wwntjmk1.js → catalog-wwntjmk1.js} +0 -0
  742. /package/dist/chunks/{wellknown-wx89ywv3.js → catalog-wx89ywv3.js} +0 -0
  743. /package/dist/chunks/{wellknown-wyqjaaa5.js → catalog-wyqjaaa5.js} +0 -0
  744. /package/dist/chunks/{wellknown-x4q807cx.js → catalog-x4q807cx.js} +0 -0
  745. /package/dist/chunks/{wellknown-xhz3jyrc.js → catalog-xhz3jyrc.js} +0 -0
  746. /package/dist/chunks/{wellknown-yrqrg4vp.js → catalog-yrqrg4vp.js} +0 -0
  747. /package/dist/chunks/{wellknown-z47nswr2.js → catalog-z47nswr2.js} +0 -0
  748. /package/dist/chunks/{wellknown-zsf8rs93.js → catalog-zsf8rs93.js} +0 -0
@@ -1,1022 +0,0 @@
1
- import {
2
- exports_select
3
- } from "./wellknown-04kwjb53.js";
4
- import {
5
- __export
6
- } from "./wellknown-rvfvac9x.js";
7
-
8
- // src/shell/parse.ts
9
- var exports_parse = {};
10
- __export(exports_parse, {
11
- scan: () => scan2,
12
- ShellParse: () => exports_parse
13
- });
14
- import { Effect } from "effect";
15
-
16
- // ../shell-scan/src/index.ts
17
- var exports_src = {};
18
- __export(exports_src, {
19
- scanPowerShell: () => scanPowerShell,
20
- scan: () => scan,
21
- ShellScan: () => exports_src
22
- });
23
- var BASH_COMPOUND_KEYWORDS = new Set([
24
- "if",
25
- "then",
26
- "elif",
27
- "else",
28
- "fi",
29
- "for",
30
- "while",
31
- "until",
32
- "case",
33
- "select",
34
- "function",
35
- "do",
36
- "done",
37
- "coproc"
38
- ]);
39
- var POWERSHELL_LOCATIONS = new Set(["set-location", "cd", "chdir", "sl", "push-location"]);
40
- var POWERSHELL_ALIASES = {
41
- "%": "foreach-object",
42
- "?": "where-object",
43
- ac: "add-content",
44
- asnp: "add-pssnapin",
45
- cli: "clear-item",
46
- clc: "clear-content",
47
- copy: "copy-item",
48
- cp: "copy-item",
49
- cpi: "copy-item",
50
- del: "remove-item",
51
- erase: "remove-item",
52
- etsn: "enter-pssession",
53
- foreach: "foreach-object",
54
- icm: "invoke-command",
55
- ihy: "invoke-history",
56
- ii: "invoke-item",
57
- ipal: "import-alias",
58
- ipmo: "import-module",
59
- ipsn: "import-pssession",
60
- mi: "move-item",
61
- move: "move-item",
62
- mv: "move-item",
63
- nal: "new-alias",
64
- ni: "new-item",
65
- nmo: "new-module",
66
- r: "invoke-history",
67
- rd: "remove-item",
68
- ren: "rename-item",
69
- ri: "remove-item",
70
- rm: "remove-item",
71
- rmdir: "remove-item",
72
- rni: "rename-item",
73
- rmo: "remove-module",
74
- rsnp: "remove-pssnapin",
75
- sajb: "start-job",
76
- sal: "set-alias",
77
- saps: "start-process",
78
- sbp: "set-psbreakpoint",
79
- sc: "set-content",
80
- si: "set-item",
81
- start: "start-process",
82
- pushd: "push-location",
83
- trcm: "trace-command",
84
- where: "where-object"
85
- };
86
- var MAX_BASH_INPUT_LENGTH = 64 * 1024;
87
- var MAX_SUBSTITUTION_DEPTH = 32;
88
- function scan(input) {
89
- return scanBash(input, 0);
90
- }
91
- function scanBash(input, depth) {
92
- if (input.length > MAX_BASH_INPUT_LENGTH)
93
- return { kind: "opaque", reason: "invalid-structure" };
94
- const group = bashLeadingGroup(input);
95
- if (group) {
96
- if (depth >= MAX_SUBSTITUTION_DEPTH)
97
- return { kind: "opaque", reason: "invalid-structure" };
98
- const nested = scanBash(group.source, depth + 1);
99
- if (nested.kind === "opaque")
100
- return nested;
101
- const suffix = input.slice(group.end + 1).trim();
102
- if (!suffix)
103
- return nested;
104
- const separator = /^(?:&&|\|\||\|&|[;&|])/.exec(suffix)?.[0];
105
- const remaining = separator ? suffix.slice(separator.length).trim() : suffix;
106
- if (separator && !remaining)
107
- return nested;
108
- const prefixed = separator ? remaining : /^[<>]/.test(remaining) ? `: ${remaining}` : undefined;
109
- if (!prefixed)
110
- return { kind: "opaque", reason: "compound-command" };
111
- const rest = scanBash(prefixed, depth + 1);
112
- if (rest.kind === "opaque")
113
- return rest;
114
- return {
115
- kind: "scanned",
116
- commands: nested.commands.concat(rest.commands.filter((command) => command.words[0] !== ":"))
117
- };
118
- }
119
- const commands = [];
120
- const nestedCommands = [];
121
- const words = [];
122
- const assignmentWords = [];
123
- let word = "";
124
- let wordStarted = false;
125
- let assignmentWord = false;
126
- let assignmentHeadUnsafe = false;
127
- let segment = 0;
128
- let quote;
129
- let dynamicWord = false;
130
- let compound = false;
131
- let invalidRedirect = false;
132
- let invalidStructure = false;
133
- let separated = false;
134
- let comment;
135
- let heredoc = false;
136
- let redirectTarget = false;
137
- let hasRedirect = false;
138
- let terminalBackground = false;
139
- const finishWord = () => {
140
- if (!wordStarted)
141
- return;
142
- if (!redirectTarget) {
143
- words.push(word);
144
- assignmentWords.push(assignmentWord);
145
- }
146
- redirectTarget = false;
147
- word = "";
148
- wordStarted = false;
149
- assignmentWord = false;
150
- assignmentHeadUnsafe = false;
151
- };
152
- const finishCommand = (end, boundary = false) => {
153
- finishWord();
154
- const resource = input.slice(segment, end).trim();
155
- const name = assignmentWords.findIndex((assignment) => !assignment);
156
- if (name >= 0 && /[*?[]/.test(words[name]))
157
- compound = true;
158
- if (resource && name >= 0)
159
- commands.push({
160
- resource,
161
- words: words.slice(name)
162
- });
163
- else if (!(assignmentWords.length > 0 && assignmentWords.every(Boolean)) && (hasRedirect || boundary || separated))
164
- invalidStructure = true;
165
- words.length = 0;
166
- assignmentWords.length = 0;
167
- separated = true;
168
- hasRedirect = false;
169
- };
170
- for (let index = 0;index < input.length; index++) {
171
- const char = input[index];
172
- if (quote === "single") {
173
- wordStarted = true;
174
- if (char === "'")
175
- quote = undefined;
176
- else
177
- word += char;
178
- continue;
179
- }
180
- if (quote === "double") {
181
- wordStarted = true;
182
- if (char === '"')
183
- quote = undefined;
184
- else if (char === "\\" && index + 1 < input.length)
185
- word += input[++index];
186
- else if (char === "$" && input[index + 1] === "(" || char === "`") {
187
- const substitution = bashSubstitution(input, index);
188
- if (!substitution || depth >= MAX_SUBSTITUTION_DEPTH)
189
- return { kind: "opaque", reason: "command-substitution" };
190
- const result = scanBash(substitution.source, depth + 1);
191
- if (result.kind === "opaque")
192
- return result;
193
- nestedCommands.push(...result.commands);
194
- word += input.slice(index, substitution.end + 1);
195
- index = substitution.end;
196
- } else {
197
- if (char === "$" && /^\$\{[^}:@]+@P\}/.test(input.slice(index)))
198
- return { kind: "opaque", reason: "dynamic-execution" };
199
- if (char === "$" && /^\$\{\([^)]*e[^)]*\)/.test(input.slice(index)))
200
- return { kind: "opaque", reason: "dynamic-execution" };
201
- if (char === "$")
202
- dynamicWord = true;
203
- word += char;
204
- }
205
- continue;
206
- }
207
- if (char === "'") {
208
- quote = "single";
209
- wordStarted = true;
210
- if (!assignmentWord)
211
- assignmentHeadUnsafe = true;
212
- continue;
213
- }
214
- if (char === '"') {
215
- quote = "double";
216
- wordStarted = true;
217
- if (!assignmentWord)
218
- assignmentHeadUnsafe = true;
219
- continue;
220
- }
221
- if (char === "\\") {
222
- if (index + 1 >= input.length)
223
- return { kind: "opaque", reason: "unterminated-escape" };
224
- wordStarted = true;
225
- if (input[index + 1] === `
226
- `)
227
- index++;
228
- else {
229
- if (!assignmentWord)
230
- assignmentHeadUnsafe = true;
231
- word += input[++index];
232
- }
233
- continue;
234
- }
235
- if (char === "$" && input[index + 1] === "(" || char === "`") {
236
- const substitution = bashSubstitution(input, index);
237
- if (!substitution || depth >= MAX_SUBSTITUTION_DEPTH)
238
- return { kind: "opaque", reason: "command-substitution" };
239
- const result = scanBash(substitution.source, depth + 1);
240
- if (result.kind === "opaque")
241
- return result;
242
- nestedCommands.push(...result.commands);
243
- wordStarted = true;
244
- word += input.slice(index, substitution.end + 1);
245
- index = substitution.end;
246
- continue;
247
- }
248
- if ((char === "<" || char === ">") && input[index + 1] === "(") {
249
- const substitution = bashParenthesized(input, index + 1);
250
- if (!substitution || depth >= MAX_SUBSTITUTION_DEPTH)
251
- return { kind: "opaque", reason: "command-substitution" };
252
- const result = scanBash(substitution.source, depth + 1);
253
- if (result.kind === "opaque")
254
- return result;
255
- nestedCommands.push(...result.commands);
256
- wordStarted = true;
257
- word += input.slice(index, substitution.end + 1);
258
- index = substitution.end;
259
- continue;
260
- }
261
- if (char === "$" && input[index + 1] === "{" && /^\$\{[^}:@]+@P\}/.test(input.slice(index)))
262
- return { kind: "opaque", reason: "dynamic-execution" };
263
- if (char === "$" && /^\$\{\([^)]*e[^)]*\)/.test(input.slice(index)))
264
- return { kind: "opaque", reason: "dynamic-execution" };
265
- if (char === "$" && input[index + 1] === "[")
266
- return { kind: "opaque", reason: "dynamic-execution" };
267
- if (char === "<" && input[index + 1] === "<")
268
- heredoc = true;
269
- if (char === "#" && !wordStarted) {
270
- finishCommand(index);
271
- comment = index;
272
- const newline = input.indexOf(`
273
- `, index);
274
- if (newline === -1)
275
- break;
276
- index = newline;
277
- segment = newline + 1;
278
- continue;
279
- }
280
- const redirect = /^(?:&>>?|<<<|<<-?|<>|<&|>&|>\||>>|>|<)/.exec(input.slice(index))?.[0];
281
- if (redirect) {
282
- hasRedirect = true;
283
- if (redirectTarget)
284
- invalidRedirect = true;
285
- if (wordStarted && /^\d+$/.test(word)) {
286
- word = "";
287
- wordStarted = false;
288
- } else
289
- finishWord();
290
- redirectTarget = true;
291
- index += redirect.length - 1;
292
- continue;
293
- }
294
- if ("()".includes(char) || char === "!" && !wordStarted)
295
- compound = true;
296
- if (/\s/.test(char) && char !== `
297
- `) {
298
- finishWord();
299
- continue;
300
- }
301
- const next = input[index + 1];
302
- const separator = char === "&" && next === "&" || char === "|" && (next === "|" || next === "&") ? char + next : char === ";" || char === "|" || char === "&" || char === `
303
- ` ? char : undefined;
304
- if (separator) {
305
- finishCommand(index, true);
306
- if (redirectTarget)
307
- invalidRedirect = true;
308
- terminalBackground = separator === "&" || separator === ";" || separator === `
309
- `;
310
- index += separator.length - 1;
311
- segment = index + 1;
312
- continue;
313
- }
314
- terminalBackground = false;
315
- wordStarted = true;
316
- if (char === "$")
317
- dynamicWord = true;
318
- if (char === "=" && !assignmentHeadUnsafe && /^[A-Za-z_][A-Za-z0-9_]*\+?$/.test(word))
319
- assignmentWord = true;
320
- word += char;
321
- }
322
- if (quote)
323
- return { kind: "opaque", reason: "unterminated-quote" };
324
- if (heredoc)
325
- return { kind: "opaque", reason: "heredoc" };
326
- if (!terminalBackground && (comment === undefined || input.includes(`
327
- `, comment)))
328
- finishCommand(input.length);
329
- if (redirectTarget)
330
- invalidRedirect = true;
331
- if (separated && !terminalBackground && comment === undefined && !input.slice(segment).trim())
332
- invalidStructure = true;
333
- if (invalidStructure)
334
- return { kind: "opaque", reason: "invalid-structure" };
335
- if (invalidRedirect)
336
- return { kind: "opaque", reason: "invalid-redirect" };
337
- const conditional = bashConditionalCommands(commands);
338
- if (conditional)
339
- commands.splice(0, commands.length, ...conditional);
340
- if (compound || commands.some((command) => BASH_COMPOUND_KEYWORDS.has(command.words[0] ?? "")))
341
- return { kind: "opaque", reason: "compound-command" };
342
- if (commands.some((command) => /[$`]/.test(command.words[0] ?? "")) || dynamicWord && commands[0]?.words[0]?.includes("$"))
343
- return { kind: "opaque", reason: "dynamic-command-name" };
344
- if (commands.some((command) => command.words[0]?.startsWith("=")))
345
- return { kind: "opaque", reason: "dynamic-command-name" };
346
- return { kind: "scanned", commands: commands.concat(nestedCommands) };
347
- }
348
- function bashConditionalCommands(commands) {
349
- if (commands[0]?.words[0] !== "if" || commands.at(-1)?.words[0] !== "fi")
350
- return;
351
- const keywords = new Set(["if", "then", "elif", "else", "fi"]);
352
- if (commands.some((command) => BASH_COMPOUND_KEYWORDS.has(command.words[0] ?? "") && !keywords.has(command.words[0])))
353
- return;
354
- const normalized = [];
355
- let phase = "condition";
356
- let hasCommand = false;
357
- let sawElse = false;
358
- for (const [index, command] of commands.entries()) {
359
- const keyword = command.words[0];
360
- if (!keywords.has(keyword ?? "")) {
361
- normalized.push(command);
362
- hasCommand = true;
363
- continue;
364
- }
365
- const offset = command.resource.indexOf(keyword) + keyword.length;
366
- const inline = command.words.length > 1 ? { resource: command.resource.slice(offset).trim(), words: command.words.slice(1) } : undefined;
367
- if (index === 0) {
368
- if (inline)
369
- normalized.push(inline);
370
- hasCommand = Boolean(inline);
371
- continue;
372
- }
373
- if (keyword === "then") {
374
- if (phase !== "condition" || !hasCommand)
375
- return;
376
- phase = "body";
377
- hasCommand = Boolean(inline);
378
- }
379
- if (keyword === "elif") {
380
- if (phase !== "body" || !hasCommand || sawElse)
381
- return;
382
- phase = "condition";
383
- hasCommand = Boolean(inline);
384
- }
385
- if (keyword === "else") {
386
- if (phase !== "body" || !hasCommand || sawElse)
387
- return;
388
- phase = "else";
389
- sawElse = true;
390
- hasCommand = Boolean(inline);
391
- }
392
- if (keyword === "fi") {
393
- if (index !== commands.length - 1 || phase === "condition" || !hasCommand || inline)
394
- return;
395
- continue;
396
- }
397
- if (inline)
398
- normalized.push(inline);
399
- }
400
- return normalized;
401
- }
402
- function bashLeadingGroup(input) {
403
- const start = input.search(/\S/);
404
- if (start < 0)
405
- return;
406
- if (input[start] === "{") {
407
- const group = bashBraced(input, start);
408
- if (!group)
409
- return;
410
- const source = group.source.trim();
411
- if (!source.endsWith(";"))
412
- return;
413
- return { source: source.slice(0, -1), end: group.end };
414
- }
415
- if (input[start] !== "(")
416
- return;
417
- return bashParenthesized(input, start);
418
- }
419
- function bashBraced(input, start) {
420
- let quote;
421
- let level = 1;
422
- for (let index = start + 1;index < input.length; index++) {
423
- const char = input[index];
424
- if (quote === "single") {
425
- if (char === "'")
426
- quote = undefined;
427
- continue;
428
- }
429
- if (char === "\\") {
430
- index++;
431
- continue;
432
- }
433
- if (char === "'") {
434
- quote = "single";
435
- continue;
436
- }
437
- if (char === '"') {
438
- quote = quote === "double" ? undefined : "double";
439
- continue;
440
- }
441
- if (char === "{" && quote !== "double")
442
- level++;
443
- if (char !== "}" || quote === "double" || --level)
444
- continue;
445
- return { source: input.slice(start + 1, index), end: index };
446
- }
447
- }
448
- function bashParenthesized(input, start) {
449
- let quote;
450
- let level = 1;
451
- for (let index = start + 1;index < input.length; index++) {
452
- const char = input[index];
453
- if (quote === "single") {
454
- if (char === "'")
455
- quote = undefined;
456
- continue;
457
- }
458
- if (char === "\\") {
459
- index++;
460
- continue;
461
- }
462
- if (char === "'") {
463
- quote = "single";
464
- continue;
465
- }
466
- if (char === '"') {
467
- quote = quote === "double" ? undefined : "double";
468
- continue;
469
- }
470
- if (char === "(" && quote !== "double")
471
- level++;
472
- if (char !== ")" || quote === "double" || --level)
473
- continue;
474
- return { source: input.slice(start + 1, index), end: index };
475
- }
476
- }
477
- function bashSubstitution(input, start) {
478
- if (input[start] === "`") {
479
- for (let index = start + 1;index < input.length; index++) {
480
- if (input[index] === "\\")
481
- index++;
482
- else if (input[index] === "`")
483
- return { source: input.slice(start + 1, index).replaceAll("\\`", "`"), end: index };
484
- }
485
- return;
486
- }
487
- if (input.slice(start, start + 3) === "$((")
488
- return;
489
- let quote;
490
- let level = 1;
491
- for (let index = start + 2;index < input.length; index++) {
492
- const char = input[index];
493
- if (quote === "single") {
494
- if (char === "'")
495
- quote = undefined;
496
- continue;
497
- }
498
- if (char === "\\") {
499
- index++;
500
- continue;
501
- }
502
- if (char === "'") {
503
- quote = "single";
504
- continue;
505
- }
506
- if (quote !== "double" && char === "#" && (index === start + 2 || /[\s;&|()]/.test(input[index - 1] ?? "")))
507
- return;
508
- if (char === '"') {
509
- quote = quote === "double" ? undefined : "double";
510
- continue;
511
- }
512
- if (char === "`" && quote !== "double") {
513
- const nested = bashSubstitution(input, index);
514
- if (!nested)
515
- return;
516
- index = nested.end;
517
- continue;
518
- }
519
- if (quote === "double") {
520
- if (char === "$" && input[index + 1] === "(") {
521
- level++;
522
- index++;
523
- } else if (char === ")" && level > 1)
524
- level--;
525
- continue;
526
- }
527
- if (char === "(")
528
- level++;
529
- if (char !== ")" || --level)
530
- continue;
531
- return { source: input.slice(start + 2, index), end: index };
532
- }
533
- }
534
- function scanPowerShell(input) {
535
- return scanPowerShellNested(input, 0);
536
- }
537
- function scanPowerShellNested(input, depth) {
538
- if (input.length > MAX_BASH_INPUT_LENGTH || depth >= MAX_SUBSTITUTION_DEPTH)
539
- return { kind: "opaque", reason: "invalid-structure" };
540
- const commands = [];
541
- const nestedCommands = [];
542
- const words = [];
543
- let segment = 0;
544
- let word = "";
545
- let started = false;
546
- let quote;
547
- let dynamic = false;
548
- let invalid = false;
549
- let redirectTarget = false;
550
- let comment = false;
551
- let separated = false;
552
- let dangling = false;
553
- let dynamicDirectory = false;
554
- const finishWord = () => {
555
- if (!started)
556
- return;
557
- if (!redirectTarget)
558
- words.push(word);
559
- redirectTarget = false;
560
- word = "";
561
- started = false;
562
- };
563
- const finishCommand = (end, boundary = false) => {
564
- finishWord();
565
- const resource = input.slice(segment, end).trim();
566
- if (resource)
567
- commands.push({ resource, words: [...words] });
568
- else if (boundary && separated)
569
- invalid = true;
570
- words.length = 0;
571
- separated ||= Boolean(resource);
572
- };
573
- for (let index = 0;index < input.length; index++) {
574
- const char = input[index];
575
- if (quote) {
576
- started = true;
577
- if (quote === "single" && char === "'" && input[index + 1] === "'") {
578
- word += "'";
579
- index++;
580
- } else if (quote === "single" && char === "'" || quote === "double" && char === '"')
581
- quote = undefined;
582
- else if (char === "`" && index + 1 < input.length)
583
- word += input[++index];
584
- else {
585
- if (quote === "double" && char === "$" && input[index + 1] === "(")
586
- dynamic = true;
587
- word += char;
588
- }
589
- continue;
590
- }
591
- if (char === "'" || char === '"') {
592
- quote = char === "'" ? "single" : "double";
593
- started = true;
594
- continue;
595
- }
596
- if (char === "`" && index + 1 < input.length) {
597
- if (words.length === 0)
598
- dynamic = true;
599
- started = true;
600
- if (input[index + 1] === "\r" && input[index + 2] === `
601
- `)
602
- index += 2;
603
- else if (input[index + 1] === "\r" || input[index + 1] === `
604
- `)
605
- index++;
606
- else
607
- word += input[++index];
608
- continue;
609
- }
610
- if (char === "`")
611
- return { kind: "opaque", reason: "unterminated-escape" };
612
- if (char === "<" && input[index + 1] === "#")
613
- return { kind: "opaque", reason: "dynamic-execution" };
614
- if (char === "#" && !started) {
615
- if (/^#requires\b/i.test(input.slice(index)))
616
- return { kind: "opaque", reason: "dynamic-execution" };
617
- finishCommand(index);
618
- comment = true;
619
- const endings = [input.indexOf(`
620
- `, index), input.indexOf("\r", index)].filter((ending) => ending >= 0);
621
- const newline = endings.length > 0 ? Math.min(...endings) : -1;
622
- if (newline === -1)
623
- break;
624
- comment = false;
625
- index = input[newline] === "\r" && input[newline + 1] === `
626
- ` ? newline + 1 : newline;
627
- segment = newline + 1;
628
- continue;
629
- }
630
- const redirect = powerShellRedirect(input, index);
631
- if (redirect) {
632
- finishWord();
633
- redirectTarget = !redirect.includes("&");
634
- index += redirect.length - 1;
635
- continue;
636
- }
637
- if (char === "{" && !started) {
638
- const block = powerShellBlock(input, index);
639
- if (!block)
640
- return { kind: "opaque", reason: "invalid-structure" };
641
- const result = scanPowerShellNested(block.source, depth + 1);
642
- if (result.kind === "opaque")
643
- return result;
644
- nestedCommands.push(...result.commands);
645
- started = true;
646
- word += input.slice(index, block.end + 1);
647
- index = block.end;
648
- continue;
649
- }
650
- if (char === "}")
651
- return { kind: "opaque", reason: "invalid-structure" };
652
- if ((char === "&" || char === ".") && !started && words.length === 0 && (/\s/.test(input[index + 1] ?? "") || !input[index + 1]))
653
- continue;
654
- if ("@()".includes(char))
655
- dynamic = true;
656
- if (/\s/.test(char) && char !== `
657
- ` && char !== "\r") {
658
- finishWord();
659
- continue;
660
- }
661
- const next = input[index + 1];
662
- const separator = char === "\r" && next === `
663
- ` ? char + next : char === "&" && next === "&" || char === "|" && next === "|" ? char + next : char === ";" || char === "|" || char === "&" || char === `
664
- ` || char === "\r" ? char : undefined;
665
- if (separator) {
666
- finishCommand(index, true);
667
- if (redirectTarget)
668
- invalid = true;
669
- dangling = ![";", "&", `
670
- `, "\r", `\r
671
- `].includes(separator);
672
- index += separator.length - 1;
673
- segment = index + 1;
674
- continue;
675
- }
676
- started = true;
677
- dangling = false;
678
- word += char;
679
- }
680
- if (quote)
681
- return { kind: "opaque", reason: "unterminated-quote" };
682
- if (!comment)
683
- finishCommand(input.length);
684
- if (redirectTarget || invalid || dangling)
685
- return { kind: "opaque", reason: "invalid-structure" };
686
- if (dynamic || commands.some((command) => {
687
- const head = command.words[0] ?? "";
688
- if (head.includes("\\") && !/^[A-Za-z]:\\/.test(head))
689
- return true;
690
- const rawName = shellCommandName(head);
691
- const name = POWERSHELL_ALIASES[rawName] ?? rawName;
692
- if (head.includes("$") || head.includes("@"))
693
- return true;
694
- if (["return", "throw", "exit", "break", "continue"].includes(name) && command.words.length > 1)
695
- return true;
696
- if (POWERSHELL_LOCATIONS.has(name ?? ""))
697
- return dynamicDirectory = command.words.some((word2, index) => index > 0 && (word2.includes("(") || word2.includes("$") && !knownPowerShellDirectory(word2))) || command.words.some((word2, index) => index > 0 && /^[A-Za-z]+:/.test(word2) && !/^[A-Za-z]:[\\/]/.test(word2));
698
- return false;
699
- }))
700
- return { kind: "opaque", reason: dynamicDirectory ? "dynamic-directory" : "dynamic-execution" };
701
- return { kind: "scanned", commands: commands.concat(nestedCommands) };
702
- }
703
- function powerShellBlock(input, start) {
704
- let quote;
705
- let level = 1;
706
- for (let index = start + 1;index < input.length; index++) {
707
- const char = input[index];
708
- if (quote === "single") {
709
- if (char === "'" && input[index + 1] === "'")
710
- index++;
711
- else if (char === "'")
712
- quote = undefined;
713
- continue;
714
- }
715
- if (char === "`") {
716
- index++;
717
- continue;
718
- }
719
- if (char === "#" && quote !== "double") {
720
- const newline = input.indexOf(`
721
- `, index);
722
- if (newline < 0)
723
- return;
724
- index = newline;
725
- continue;
726
- }
727
- if (char === "<" && input[index + 1] === "#" && quote !== "double") {
728
- const end = input.indexOf("#>", index + 2);
729
- if (end < 0)
730
- return;
731
- index = end + 1;
732
- continue;
733
- }
734
- if (char === "'") {
735
- quote = "single";
736
- continue;
737
- }
738
- if (char === '"') {
739
- quote = quote === "double" ? undefined : "double";
740
- continue;
741
- }
742
- if (char === "{" && quote !== "double")
743
- level++;
744
- if (char !== "}" || quote === "double" || --level)
745
- continue;
746
- return { source: input.slice(start + 1, index), end: index };
747
- }
748
- }
749
- function shellCommandName(word) {
750
- const value = (word ?? "").toLowerCase();
751
- return value.slice(Math.max(value.lastIndexOf("/"), value.lastIndexOf("\\")) + 1);
752
- }
753
- function knownPowerShellDirectory(word) {
754
- const variable = /^(?:\$(?:PWD|HOME|PSHOME)|\$env:[A-Za-z_][A-Za-z0-9_]*|\$\{env:[^}]+\})(?:[\\/]|$)/i.exec(word);
755
- return Boolean(variable) && !word.slice(variable?.[0].length).includes("$");
756
- }
757
- function powerShellRedirect(input, index) {
758
- let cursor = index;
759
- if (input[cursor] === "*")
760
- cursor++;
761
- else
762
- while (/\d/.test(input[cursor] ?? ""))
763
- cursor++;
764
- if (input[cursor] !== ">" && input[cursor] !== "<")
765
- return;
766
- cursor++;
767
- if (input[cursor] === ">")
768
- cursor++;
769
- if (input[cursor] === "&") {
770
- cursor++;
771
- while (/\d/.test(input[cursor] ?? ""))
772
- cursor++;
773
- }
774
- return input.slice(index, cursor);
775
- }
776
-
777
- // src/shell/parse.ts
778
- import os from "os";
779
- import path from "path";
780
- var CWD = new Set(["cd", "chdir", "popd", "pushd", "push-location", "set-location", "sl"]);
781
- var POWERSHELL_PATH_FLAGS = new Set(["-literalpath", "-path"]);
782
- var ARITY = {
783
- cat: 1,
784
- cd: 1,
785
- chmod: 1,
786
- chown: 1,
787
- cp: 1,
788
- echo: 1,
789
- env: 1,
790
- export: 1,
791
- grep: 1,
792
- kill: 1,
793
- killall: 1,
794
- ln: 1,
795
- ls: 1,
796
- mkdir: 1,
797
- mv: 1,
798
- ps: 1,
799
- pwd: 1,
800
- rm: 1,
801
- rmdir: 1,
802
- sleep: 1,
803
- source: 1,
804
- tail: 1,
805
- touch: 1,
806
- unset: 1,
807
- which: 1,
808
- aws: 3,
809
- az: 3,
810
- bazel: 2,
811
- brew: 2,
812
- bun: 2,
813
- "bun run": 3,
814
- "bun x": 3,
815
- cargo: 2,
816
- "cargo add": 3,
817
- "cargo run": 3,
818
- cdk: 2,
819
- cf: 2,
820
- cmake: 2,
821
- composer: 2,
822
- consul: 2,
823
- "consul kv": 3,
824
- crictl: 2,
825
- deno: 2,
826
- "deno task": 3,
827
- doctl: 3,
828
- docker: 2,
829
- "docker builder": 3,
830
- "docker compose": 3,
831
- "docker container": 3,
832
- "docker image": 3,
833
- "docker network": 3,
834
- "docker volume": 3,
835
- eksctl: 2,
836
- "eksctl create": 3,
837
- firebase: 2,
838
- flyctl: 2,
839
- gcloud: 3,
840
- gh: 3,
841
- git: 2,
842
- "git config": 3,
843
- "git remote": 3,
844
- "git stash": 3,
845
- go: 2,
846
- gradle: 2,
847
- helm: 2,
848
- heroku: 2,
849
- hugo: 2,
850
- ip: 2,
851
- "ip addr": 3,
852
- "ip link": 3,
853
- "ip netns": 3,
854
- "ip route": 3,
855
- kind: 2,
856
- "kind create": 3,
857
- kubectl: 2,
858
- "kubectl kustomize": 3,
859
- "kubectl rollout": 3,
860
- kustomize: 2,
861
- make: 2,
862
- mc: 2,
863
- "mc admin": 3,
864
- minikube: 2,
865
- mongosh: 2,
866
- mysql: 2,
867
- mvn: 2,
868
- ng: 2,
869
- npm: 2,
870
- "npm exec": 3,
871
- "npm init": 3,
872
- "npm run": 3,
873
- "npm view": 3,
874
- npx: 2,
875
- nvm: 2,
876
- nx: 2,
877
- openssl: 2,
878
- "openssl req": 3,
879
- "openssl x509": 3,
880
- pip: 2,
881
- pipenv: 2,
882
- pnpm: 2,
883
- "pnpm dlx": 3,
884
- "pnpm exec": 3,
885
- "pnpm run": 3,
886
- poetry: 2,
887
- podman: 2,
888
- "podman container": 3,
889
- "podman image": 3,
890
- psql: 2,
891
- pulumi: 2,
892
- "pulumi stack": 3,
893
- python: 2,
894
- pyenv: 2,
895
- rake: 2,
896
- rbenv: 2,
897
- "redis-cli": 2,
898
- rustup: 2,
899
- serverless: 2,
900
- sfdx: 3,
901
- skaffold: 2,
902
- sls: 2,
903
- sst: 2,
904
- swift: 2,
905
- systemctl: 2,
906
- terraform: 2,
907
- "terraform workspace": 3,
908
- tmux: 2,
909
- turbo: 2,
910
- ufw: 2,
911
- vault: 2,
912
- "vault auth": 3,
913
- "vault kv": 3,
914
- vercel: 2,
915
- volta: 2,
916
- wp: 2,
917
- yarn: 2,
918
- "yarn dlx": 3,
919
- "yarn run": 3
920
- };
921
- var scan2 = Effect.fn("ShellParse.scan")(function* (command, shell, cwd) {
922
- return scanCommands(command, cwd, shell, exports_select.ps(shell));
923
- });
924
- function scanCommands(command, cwd, shell, powershell) {
925
- const result = powershell ? exports_src.scanPowerShell(command) : exports_src.scan(command);
926
- if (result.kind === "opaque")
927
- return {
928
- commands: [{ resource: command, save: command }],
929
- directories: [],
930
- opaque: true,
931
- directoryUnknown: true
932
- };
933
- if (result.commands.some((item) => {
934
- const name = powershell ? item.words[0]?.toLowerCase() : item.words[0];
935
- if (!name || !CWD.has(name) || name === "popd" || name === "pop-location")
936
- return false;
937
- return directoryArgs(item.words, powershell, cwd, shell).length === 0;
938
- }))
939
- return { commands: [{ resource: command }], directories: [], opaque: true, directoryUnknown: true };
940
- return result.commands.reduce((output, item) => {
941
- const name = powershell ? item.words[0]?.toLowerCase() : item.words[0];
942
- if (!name)
943
- return output;
944
- if (CWD.has(name)) {
945
- output.directories.push(...directoryArgs(item.words, powershell, cwd, shell));
946
- return output;
947
- }
948
- output.commands.push({ resource: item.resource, save: `${prefix(item.words).join(" ")} *` });
949
- return output;
950
- }, {
951
- commands: [],
952
- directories: [],
953
- opaque: false
954
- });
955
- }
956
- function directoryArgs(command, powershell, cwd, shell) {
957
- if (!powershell) {
958
- const values = command.slice(1).filter((part) => !part.startsWith("-")).map((part) => directoryArgument(part, powershell, cwd, shell)).filter((part) => part !== undefined);
959
- if (command[0] === "cd" && (values.length !== 1 || !path.isAbsolute(values[0]) && Boolean(process.env.CDPATH)))
960
- return [];
961
- return values;
962
- }
963
- const directories = [];
964
- let expectsPath = false;
965
- for (const part of command.slice(1)) {
966
- if (expectsPath) {
967
- const value2 = directoryArgument(part, powershell, cwd, shell);
968
- if (value2)
969
- directories.push(value2);
970
- expectsPath = false;
971
- continue;
972
- }
973
- if (part.startsWith("-")) {
974
- expectsPath = POWERSHELL_PATH_FLAGS.has(part.toLowerCase());
975
- continue;
976
- }
977
- const value = directoryArgument(part, powershell, cwd, shell);
978
- if (value)
979
- directories.push(value);
980
- }
981
- return directories;
982
- }
983
- function directoryArgument(value, powershell, cwd, shell) {
984
- const quote = value[0];
985
- const text = (quote === '"' || quote === "'") && value.at(-1) === quote ? value.slice(1, -1) : value;
986
- if (!powershell)
987
- return expandKnownDirectory(text);
988
- return expandKnownDirectory(text.replace(/\$\{env:([^}]+)\}/gi, (_, key) => environment(key) ?? "").replace(/\$env:([A-Za-z_][A-Za-z0-9_]*)/gi, (_, key) => environment(key) ?? "").replace(/\$(HOME|PWD|PSHOME)(?=$|[\\/])/gi, (_, key) => {
989
- if (key.toUpperCase() === "HOME")
990
- return os.homedir();
991
- if (key.toUpperCase() === "PWD")
992
- return cwd;
993
- return path.dirname(shell);
994
- }));
995
- }
996
- function expandKnownDirectory(value) {
997
- if (value.includes("$") || value.includes("`") || value.startsWith("("))
998
- return;
999
- if (value === "~")
1000
- return os.homedir();
1001
- if (value.startsWith("~/") || value.startsWith("~\\"))
1002
- return path.join(os.homedir(), value.slice(2));
1003
- if (value.startsWith("~"))
1004
- return;
1005
- return value;
1006
- }
1007
- function environment(key) {
1008
- if (process.platform !== "win32")
1009
- return process.env[key];
1010
- const name = Object.keys(process.env).find((item) => item.toLowerCase() === key.toLowerCase());
1011
- return name ? process.env[name] : undefined;
1012
- }
1013
- function prefix(tokens) {
1014
- for (let length = tokens.length;length > 0; length--) {
1015
- const arity = ARITY[tokens.slice(0, length).join(" ")];
1016
- if (arity !== undefined)
1017
- return tokens.slice(0, arity);
1018
- }
1019
- return tokens.slice(0, 1);
1020
- }
1021
-
1022
- export { scan2 as scan, exports_parse };