@opencode-ai/core 0.0.0-beta-19059 → 0.0.0-beta-19124

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 (856) hide show
  1. package/dist/account/sql.js +4 -5
  2. package/dist/agent.js +87 -88
  3. package/dist/aisdk-native.js +5 -6
  4. package/dist/aisdk.js +11 -13
  5. package/dist/app.js +14 -15
  6. package/dist/bus.js +88 -89
  7. package/dist/catalog.js +84 -86
  8. package/dist/chunks/event-logger-00s3pqt3.js +43 -0
  9. package/dist/chunks/event-logger-07dcg4f5.js +44 -0
  10. package/dist/chunks/{shell-rpa95wsa.js → event-logger-082zmtg6.js} +13 -13
  11. package/dist/chunks/{shell-326j4s6w.js → event-logger-0e0xafbb.js} +11 -11
  12. package/dist/chunks/{shell-29n7vfk2.js → event-logger-0fabt78z.js} +15 -15
  13. package/dist/chunks/{shell-4w0ckvbq.js → event-logger-0nhqfpxa.js} +12 -12
  14. package/dist/chunks/{shell-bnha4c96.js → event-logger-0paq2nw3.js} +6 -6
  15. package/dist/chunks/{shell-rdfev9jy.js → event-logger-0qkdqm5v.js} +2 -2
  16. package/dist/chunks/{shell-hzwx8p6y.js → event-logger-0rag4e4f.js} +7 -7
  17. package/dist/chunks/{shell-zwfcr2t4.js → event-logger-0s9ayhjt.js} +6 -6
  18. package/dist/chunks/{shell-chwz5826.js → event-logger-0v1ejg55.js} +51 -46
  19. package/dist/chunks/{shell-mv81kt5z.js → event-logger-0wc4szmq.js} +7 -9
  20. package/dist/chunks/{shell-4v6g3p22.js → event-logger-10jtetaj.js} +9 -9
  21. package/dist/chunks/{shell-wht8mw9e.js → event-logger-12m9a30f.js} +47 -47
  22. package/dist/chunks/{shell-j5vqta4j.js → event-logger-12wcht6n.js} +57 -50
  23. package/dist/chunks/{shell-dwvtf5ds.js → event-logger-14h757nk.js} +25 -20
  24. package/dist/chunks/{shell-my53s247.js → event-logger-16r38w9g.js} +4 -4
  25. package/dist/chunks/{shell-r9d3d23r.js → event-logger-1bbkgx8g.js} +5 -5
  26. package/dist/chunks/event-logger-1cngsnb6.js +41 -0
  27. package/dist/chunks/{shell-0pc4kdn1.js → event-logger-1ct4r87x.js} +4 -7
  28. package/dist/chunks/{shell-53jxjgr1.js → event-logger-1ezz2wmh.js} +7 -10
  29. package/dist/chunks/event-logger-1kg9ymc8.js +6 -0
  30. package/dist/chunks/{shell-9ak91fv3.js → event-logger-1n0se4en.js} +43 -43
  31. package/dist/chunks/{shell-dtm6fkaa.js → event-logger-1qw2s0et.js} +11 -11
  32. package/dist/chunks/event-logger-1vjz4200.js +56 -0
  33. package/dist/chunks/{shell-2q2tk9tq.js → event-logger-1xtv6dmm.js} +40 -38
  34. package/dist/chunks/{shell-c54e84vp.js → event-logger-1z80kc63.js} +52 -52
  35. package/dist/chunks/event-logger-21r38tys.js +14 -0
  36. package/dist/chunks/event-logger-22drdanb.js +76 -0
  37. package/dist/chunks/{shell-s32nnj3r.js → event-logger-2402vzrj.js} +31 -31
  38. package/dist/chunks/{shell-zsf8rs93.js → event-logger-2710q6r3.js} +4 -4
  39. package/dist/chunks/{shell-bkxmnfwx.js → event-logger-28nhnrpr.js} +49 -48
  40. package/dist/chunks/event-logger-2a5m3afh.js +36 -0
  41. package/dist/chunks/{shell-hzeg9cfr.js → event-logger-2axfhc9x.js} +8 -8
  42. package/dist/chunks/event-logger-2cvfr09c.js +31 -0
  43. package/dist/chunks/{shell-dwrevpn0.js → event-logger-2g399ttb.js} +14 -17
  44. package/dist/chunks/{shell-6dkv011c.js → event-logger-2h6s9956.js} +137 -133
  45. package/dist/chunks/{shell-k7hkdbw5.js → event-logger-2ht70gj7.js} +4 -7
  46. package/dist/chunks/{shell-r7a2r1m6.js → event-logger-2jqmte8w.js} +11 -11
  47. package/dist/chunks/event-logger-2k8khapm.js +16 -0
  48. package/dist/chunks/{shell-nbv6mqns.js → event-logger-2mqy9ydc.js} +151 -141
  49. package/dist/chunks/{shell-042q48mg.js → event-logger-2st7rw5q.js} +29 -27
  50. package/dist/chunks/{shell-55fkmd57.js → event-logger-31rwmws4.js} +26 -25
  51. package/dist/chunks/{shell-m8cbvarh.js → event-logger-3asan66x.js} +2 -2
  52. package/dist/chunks/{shell-rr7wbarq.js → event-logger-3fc6dm20.js} +13 -13
  53. package/dist/chunks/{shell-wmxdh12w.js → event-logger-3hepkmqq.js} +5 -5
  54. package/dist/chunks/{shell-7v99w5je.js → event-logger-3je9ha5z.js} +59 -50
  55. package/dist/chunks/{shell-bd2mvb8t.js → event-logger-3jj6bjb6.js} +18 -18
  56. package/dist/chunks/event-logger-3n6w8qeh.js +153 -0
  57. package/dist/chunks/{shell-4xf915ct.js → event-logger-3qzbfqsy.js} +30 -30
  58. package/dist/chunks/{shell-kq3q54gz.js → event-logger-3smtnn6g.js} +4 -4
  59. package/dist/chunks/{shell-f1jj19e8.js → event-logger-3t738kvx.js} +15 -14
  60. package/dist/chunks/event-logger-3tvqynh2.js +14 -0
  61. package/dist/chunks/{shell-jve7t217.js → event-logger-3v8g72cx.js} +2 -2
  62. package/dist/chunks/{shell-gy500k2r.js → event-logger-3wcehsnq.js} +2 -2
  63. package/dist/chunks/{shell-3ep0k87g.js → event-logger-3wgash5j.js} +14 -14
  64. package/dist/chunks/{shell-c3rqq6n4.js → event-logger-3xfkzkzd.js} +29 -29
  65. package/dist/chunks/{shell-yz2yeez5.js → event-logger-3z8dkpqv.js} +32 -30
  66. package/dist/chunks/{shell-dyhtrhy2.js → event-logger-41nvscxy.js} +2 -6
  67. package/dist/chunks/{shell-hzag9ake.js → event-logger-454k5vzh.js} +5 -5
  68. package/dist/chunks/{shell-r8f3g7x9.js → event-logger-47b3sbnz.js} +70 -62
  69. package/dist/chunks/{shell-eb87q0yv.js → event-logger-4crm0y3y.js} +7 -6
  70. package/dist/chunks/{shell-fqehnn9p.js → event-logger-4r2nyarf.js} +4 -7
  71. package/dist/chunks/event-logger-4taktcvc.js +35 -0
  72. package/dist/chunks/{shell-0ekaf5y1.js → event-logger-4ttmm7zd.js} +61 -52
  73. package/dist/chunks/{shell-t1qmyghk.js → event-logger-4vtp7hga.js} +27 -27
  74. package/dist/chunks/event-logger-4w2mg71f.js +119 -0
  75. package/dist/chunks/{shell-6hppa3xw.js → event-logger-4x0nmcjx.js} +13 -13
  76. package/dist/chunks/{shell-4b2tz2m9.js → event-logger-4y7fprxs.js} +3 -3
  77. package/dist/chunks/{shell-wm7n3k6n.js → event-logger-4yxs9dbd.js} +43 -43
  78. package/dist/chunks/{shell-gbbcs6dk.js → event-logger-50whrf1e.js} +28 -28
  79. package/dist/chunks/{shell-r8f4w671.js → event-logger-550bvhaj.js} +4 -4
  80. package/dist/chunks/{shell-a84493y6.js → event-logger-57m8p4qp.js} +13 -13
  81. package/dist/chunks/{shell-70qypj5k.js → event-logger-5c1zb16k.js} +33 -29
  82. package/dist/chunks/event-logger-5c3qnfth.js +24 -0
  83. package/dist/chunks/{shell-p5gyct0y.js → event-logger-5daktx2q.js} +10 -10
  84. package/dist/chunks/{shell-f2nhxfjt.js → event-logger-5fmxt4p5.js} +4 -7
  85. package/dist/chunks/{shell-pgrvjceq.js → event-logger-5fww7ark.js} +13 -13
  86. package/dist/chunks/{shell-e96z09t7.js → event-logger-5jayeb3j.js} +12 -12
  87. package/dist/chunks/{shell-rahat93a.js → event-logger-5jvc5tg2.js} +6 -6
  88. package/dist/chunks/{shell-sdwsqdh9.js → event-logger-5mp6hy2y.js} +21 -18
  89. package/dist/chunks/{shell-vg0pa6wg.js → event-logger-5p36vnsq.js} +23 -22
  90. package/dist/chunks/{shell-htmhxvv7.js → event-logger-5sg4xzjf.js} +15 -15
  91. package/dist/chunks/{shell-g70ev3a2.js → event-logger-5ssd2kfs.js} +38 -33
  92. package/dist/chunks/{shell-bmkvq0kr.js → event-logger-5xcxm97n.js} +9 -8
  93. package/dist/chunks/{shell-mqq97asn.js → event-logger-5ypfxmn1.js} +11 -11
  94. package/dist/chunks/{shell-dj1xm95f.js → event-logger-637qq8n2.js} +11 -11
  95. package/dist/chunks/{shell-87j79ehp.js → event-logger-65qy5zc3.js} +78 -70
  96. package/dist/chunks/{shell-ankcqpvn.js → event-logger-65rxya3j.js} +61 -55
  97. package/dist/chunks/{shell-z14yv7mw.js → event-logger-65xfkb7w.js} +27 -28
  98. package/dist/chunks/{shell-c77ad0vh.js → event-logger-6prwharc.js} +2 -2
  99. package/dist/chunks/{shell-0gpahtwn.js → event-logger-6tf8tr4v.js} +19 -19
  100. package/dist/chunks/{shell-xx7nefqn.js → event-logger-6vq97qmv.js} +20 -20
  101. package/dist/chunks/event-logger-6vtbmr7p.js +287 -0
  102. package/dist/chunks/{shell-etbnsc4s.js → event-logger-6z5bwd8g.js} +12 -12
  103. package/dist/chunks/{shell-xdb88cdw.js → event-logger-711hfp6y.js} +7 -7
  104. package/dist/chunks/{shell-hgr9y616.js → event-logger-7bmhse3q.js} +14 -14
  105. package/dist/chunks/{shell-c55cgmsp.js → event-logger-7ekmjv5k.js} +9 -8
  106. package/dist/chunks/{shell-7b5y25fs.js → event-logger-7fh311k0.js} +24 -21
  107. package/dist/chunks/{shell-jxkq3d3v.js → event-logger-7mx8k0q7.js} +15 -14
  108. package/dist/chunks/{shell-141a7zs0.js → event-logger-7tq9gac0.js} +60 -58
  109. package/dist/chunks/{shell-7rd51vdr.js → event-logger-7vg7b77p.js} +48 -46
  110. package/dist/chunks/event-logger-7zk4hah4.js +4 -0
  111. package/dist/chunks/{shell-s7whb9gt.js → event-logger-822emrt2.js} +3 -3
  112. package/dist/chunks/event-logger-825xseqb.js +87 -0
  113. package/dist/chunks/event-logger-85awaqv8.js +38 -0
  114. package/dist/chunks/{shell-8w9tzfz1.js → event-logger-88xbtdfr.js} +2 -2
  115. package/dist/chunks/{shell-wdhfb1av.js → event-logger-8ab07kvc.js} +35 -34
  116. package/dist/chunks/event-logger-8ct07e69.js +33 -0
  117. package/dist/chunks/{shell-b5jaeffq.js → event-logger-8m379ac9.js} +20 -19
  118. package/dist/chunks/{shell-nr11n6aa.js → event-logger-8p0zspew.js} +64 -64
  119. package/dist/chunks/{shell-b3v8bj34.js → event-logger-8xy158zb.js} +132 -73
  120. package/dist/chunks/{shell-vwsdy5q1.js → event-logger-92avn38j.js} +13 -13
  121. package/dist/chunks/event-logger-92g85qkt.js +115 -0
  122. package/dist/chunks/event-logger-93a8yfjt.js +25 -0
  123. package/dist/chunks/event-logger-982e01ww.js +6 -0
  124. package/dist/chunks/{shell-m3k5wttq.js → event-logger-9969c03r.js} +58 -53
  125. package/dist/chunks/{shell-1n0ft3sp.js → event-logger-9dvsnz4e.js} +20 -20
  126. package/dist/chunks/{shell-qkccxvz6.js → event-logger-9m7v4qnm.js} +85 -84
  127. package/dist/chunks/event-logger-9qm9egsn.js +41 -0
  128. package/dist/chunks/{shell-8zcrsv5t.js → event-logger-9r3tzwf8.js} +38 -34
  129. package/dist/chunks/{shell-vpjkya7h.js → event-logger-9rqn6x4v.js} +1 -4
  130. package/dist/chunks/event-logger-9s6t48vc.js +184 -0
  131. package/dist/chunks/{shell-qpxzqy01.js → event-logger-9xvrg3b1.js} +5 -5
  132. package/dist/chunks/{shell-ba33t81m.js → event-logger-9xybsmp2.js} +26 -25
  133. package/dist/chunks/event-logger-9zdhvgqs.js +18 -0
  134. package/dist/chunks/{shell-tzrgz0z8.js → event-logger-a089b8en.js} +15 -14
  135. package/dist/chunks/{shell-bybkghrn.js → event-logger-a1tpkmh4.js} +12 -12
  136. package/dist/chunks/{shell-zmvsednx.js → event-logger-aae7qk0j.js} +31 -31
  137. package/dist/chunks/{shell-jqhp3fpz.js → event-logger-aaet6srn.js} +17 -17
  138. package/dist/chunks/{shell-a02svayp.js → event-logger-af5trqkr.js} +2 -2
  139. package/dist/chunks/{shell-1wcz8fvj.js → event-logger-afrmfg78.js} +4 -4
  140. package/dist/chunks/{shell-2ax4xmn8.js → event-logger-ah7grg4z.js} +56 -52
  141. package/dist/chunks/{shell-gb1z7yet.js → event-logger-ajtjthsy.js} +8 -8
  142. package/dist/chunks/{shell-ka3gxs6j.js → event-logger-amahfvfq.js} +34 -30
  143. package/dist/chunks/event-logger-ar3vq2rb.js +49 -0
  144. package/dist/chunks/event-logger-aymbgepw.js +329 -0
  145. package/dist/chunks/{shell-ntev5d3k.js → event-logger-b1najej0.js} +12 -12
  146. package/dist/chunks/{shell-6wsfy4sp.js → event-logger-b6gygkdw.js} +14 -14
  147. package/dist/chunks/{shell-djxb2q0f.js → event-logger-b84bthst.js} +61 -58
  148. package/dist/chunks/event-logger-b9wsbatv.js +13 -0
  149. package/dist/chunks/{shell-v50xf5z2.js → event-logger-bezsr0nz.js} +62 -57
  150. package/dist/chunks/{shell-89fyhav1.js → event-logger-bphmvjfp.js} +14 -10
  151. package/dist/chunks/{shell-264e1nfp.js → event-logger-bpnz08mb.js} +13 -13
  152. package/dist/chunks/{shell-6m12vprq.js → event-logger-brevw2rp.js} +22 -22
  153. package/dist/chunks/{shell-ag4nhqj6.js → event-logger-bzrqex1b.js} +33 -29
  154. package/dist/chunks/{shell-qbfqnn1d.js → event-logger-c2khgprk.js} +26 -25
  155. package/dist/chunks/{shell-ymj89trn.js → event-logger-c4p254r2.js} +36 -32
  156. package/dist/chunks/{shell-zr29p06e.js → event-logger-c9cdp0vn.js} +26 -21
  157. package/dist/chunks/{shell-bxdhjb3y.js → event-logger-cf4snx6d.js} +6 -6
  158. package/dist/chunks/{shell-gcx27tm4.js → event-logger-cfcd82q6.js} +14 -13
  159. package/dist/chunks/{shell-fzc5n3sa.js → event-logger-cn8d14z9.js} +85 -68
  160. package/dist/chunks/{shell-hpkeh7wf.js → event-logger-cpy6gm2a.js} +14 -14
  161. package/dist/chunks/{shell-p09n0p06.js → event-logger-cw5md1zh.js} +28 -27
  162. package/dist/chunks/{shell-0kfsnc8s.js → event-logger-d3qtrs71.js} +23 -19
  163. package/dist/chunks/{shell-d4h7vwhh.js → event-logger-d72308c8.js} +8 -8
  164. package/dist/chunks/{shell-7n9qwqk4.js → event-logger-dap0rakb.js} +2 -2
  165. package/dist/chunks/event-logger-df0c2mh7.js +460 -0
  166. package/dist/chunks/{shell-f8wvq04h.js → event-logger-djtdz80w.js} +4 -4
  167. package/dist/chunks/{shell-3p7213xt.js → event-logger-dn08ahxn.js} +47 -44
  168. package/dist/chunks/{shell-9jekp4re.js → event-logger-dsf4qpn2.js} +33 -32
  169. package/dist/chunks/{shell-7jghge8q.js → event-logger-dzfg11yk.js} +32 -26
  170. package/dist/chunks/{shell-arcb009s.js → event-logger-e4x9q39t.js} +38 -38
  171. package/dist/chunks/{shell-wj4sxzqa.js → event-logger-e73j6tqm.js} +5 -5
  172. package/dist/chunks/{shell-7gcyy9x5.js → event-logger-ecjyhxv0.js} +33 -33
  173. package/dist/chunks/{shell-5a5ch9ts.js → event-logger-eh3zwz77.js} +9 -9
  174. package/dist/chunks/{shell-k8b45nas.js → event-logger-emrn6kk6.js} +13 -13
  175. package/dist/chunks/{shell-fmf73fvz.js → event-logger-erw4kpzp.js} +7 -7
  176. package/dist/chunks/{shell-pgf3e1q2.js → event-logger-f03pjn97.js} +32 -24
  177. package/dist/chunks/{shell-0f48qthw.js → event-logger-f0mxakyp.js} +3 -3
  178. package/dist/chunks/{shell-bc9tkpkc.js → event-logger-f4kct4fj.js} +161 -147
  179. package/dist/chunks/{shell-61ek4hj9.js → event-logger-faypxj3z.js} +2 -2
  180. package/dist/chunks/event-logger-fd84j5ds.js +35 -0
  181. package/dist/chunks/{shell-hc47qdwn.js → event-logger-fwv1yqzw.js} +41 -38
  182. package/dist/chunks/{shell-5y5kqjze.js → event-logger-fxbjtjnd.js} +25 -25
  183. package/dist/chunks/{shell-brsh5f65.js → event-logger-fxgpk5d8.js} +2 -2
  184. package/dist/chunks/{shell-dexm22yg.js → event-logger-fxypknc8.js} +8 -8
  185. package/dist/chunks/{shell-bbqs2y60.js → event-logger-g4wezp1m.js} +2 -2
  186. package/dist/chunks/{shell-s243tsw3.js → event-logger-g6wnemy4.js} +20 -19
  187. package/dist/chunks/{shell-xytsmcb2.js → event-logger-g8jrjr0k.js} +50 -43
  188. package/dist/chunks/{shell-p1m5qwvv.js → event-logger-gd4qta3r.js} +4 -4
  189. package/dist/chunks/{shell-df3v2q6j.js → event-logger-gebd4c9n.js} +3 -3
  190. package/dist/chunks/{shell-m6a7zjhr.js → event-logger-gf4sh87j.js} +7 -6
  191. package/dist/chunks/{shell-64hzgwtd.js → event-logger-h6qrvrep.js} +52 -49
  192. package/dist/chunks/event-logger-h6vf3j39.js +14 -0
  193. package/dist/chunks/{shell-ngzr6ypz.js → event-logger-h722e297.js} +12 -12
  194. package/dist/chunks/{shell-k1vg0xt3.js → event-logger-hc8apxh6.js} +60 -50
  195. package/dist/chunks/{shell-gmw0vgww.js → event-logger-hdqmeh3c.js} +40 -35
  196. package/dist/chunks/{shell-af42tqdk.js → event-logger-heyhwy2w.js} +4 -7
  197. package/dist/chunks/{shell-e0n16vwa.js → event-logger-hhhknvt0.js} +10 -10
  198. package/dist/chunks/event-logger-hjzj6vwa.js +38 -0
  199. package/dist/chunks/{shell-q606pcse.js → event-logger-hrvm11jt.js} +26 -26
  200. package/dist/chunks/{shell-6vbv4je1.js → event-logger-hw4pv20g.js} +7 -7
  201. package/dist/chunks/{shell-gebnmg22.js → event-logger-hz5hqkd0.js} +33 -31
  202. package/dist/chunks/{shell-44akcmh3.js → event-logger-j1py3mfn.js} +246 -173
  203. package/dist/chunks/{shell-3gmr2bxd.js → event-logger-j2sh7cb4.js} +7 -7
  204. package/dist/chunks/{shell-vac9eqd2.js → event-logger-j5zkgpj8.js} +2 -2
  205. package/dist/chunks/{shell-r7gm0yzj.js → event-logger-j6q9fy2f.js} +14 -14
  206. package/dist/chunks/{shell-x3vb5b1t.js → event-logger-j83byb14.js} +4 -4
  207. package/dist/chunks/{shell-8y5vxhk7.js → event-logger-j8nnq7em.js} +7 -6
  208. package/dist/chunks/{shell-dkmkay92.js → event-logger-j935v87r.js} +2 -2
  209. package/dist/chunks/{shell-hp004neb.js → event-logger-jasnfvjs.js} +65 -65
  210. package/dist/chunks/{shell-07b0cypv.js → event-logger-jbmjz4v3.js} +110 -110
  211. package/dist/chunks/{shell-wzz9pqkk.js → event-logger-jbxj9y91.js} +44 -39
  212. package/dist/chunks/{shell-v9qxqszp.js → event-logger-jfbh8m2n.js} +43 -43
  213. package/dist/chunks/{shell-cvj1dyzv.js → event-logger-jhaj8wq0.js} +44 -39
  214. package/dist/chunks/event-logger-jj13rngr.js +22 -0
  215. package/dist/chunks/{shell-g9dd0fv6.js → event-logger-jjzmpkqm.js} +18 -18
  216. package/dist/chunks/{shell-feq9r64e.js → event-logger-jk8v4ysk.js} +26 -25
  217. package/dist/chunks/event-logger-jqhng384.js +460 -0
  218. package/dist/chunks/{shell-5vbk082d.js → event-logger-jteae0j7.js} +13 -14
  219. package/dist/chunks/{shell-env4mczv.js → event-logger-k1fx3rh1.js} +24 -23
  220. package/dist/chunks/{shell-x4az4y7r.js → event-logger-k4bwy1x5.js} +8 -8
  221. package/dist/chunks/{shell-j2nrfc47.js → event-logger-kbg9q44r.js} +16 -16
  222. package/dist/chunks/event-logger-keawj43j.js +41 -0
  223. package/dist/chunks/{shell-dg8w2yk3.js → event-logger-kfyw9f0s.js} +79 -71
  224. package/dist/chunks/{shell-j6s3yjyb.js → event-logger-kg06axw8.js} +38 -38
  225. package/dist/chunks/{shell-3tg0cqem.js → event-logger-kkxc5154.js} +11 -8
  226. package/dist/chunks/{shell-avzsa1v3.js → event-logger-kxch3v52.js} +50 -47
  227. package/dist/chunks/{shell-pv8kr1wp.js → event-logger-m3eazqpa.js} +49 -43
  228. package/dist/chunks/{shell-nrd3ctd8.js → event-logger-m6rmdee7.js} +33 -32
  229. package/dist/chunks/{shell-j0feex7e.js → event-logger-m9w0rfyh.js} +17 -17
  230. package/dist/chunks/event-logger-mntxs535.js +5 -0
  231. package/dist/chunks/{shell-8q8h9s11.js → event-logger-mp43ttd6.js} +24 -20
  232. package/dist/chunks/event-logger-mq9r6drf.js +7 -0
  233. package/dist/chunks/{shell-rvt91wbj.js → event-logger-n600s6ej.js} +26 -24
  234. package/dist/chunks/{shell-n2g2cxnx.js → event-logger-n6g7b5d4.js} +29 -28
  235. package/dist/chunks/event-logger-n6wnzfnt.js +147 -0
  236. package/dist/chunks/{shell-q7reqpp2.js → event-logger-n9s43yzq.js} +12 -11
  237. package/dist/chunks/{shell-wcfnpn6z.js → event-logger-p08wj8bf.js} +20 -14
  238. package/dist/chunks/{shell-9dpanzbm.js → event-logger-p2k6rx42.js} +55 -48
  239. package/dist/chunks/{shell-2646kmak.js → event-logger-p8n9hqs2.js} +16 -16
  240. package/dist/chunks/event-logger-p8qxwesx.js +21 -0
  241. package/dist/chunks/{shell-w3124eb9.js → event-logger-pc12brnn.js} +45 -44
  242. package/dist/chunks/{shell-n42yafp0.js → event-logger-pg99br7g.js} +14 -13
  243. package/dist/chunks/{shell-w5r9s7kx.js → event-logger-pjvnvgmy.js} +8 -8
  244. package/dist/chunks/{shell-mf0hyk7z.js → event-logger-pknna89w.js} +5 -5
  245. package/dist/chunks/{shell-gqrtc8r6.js → event-logger-ppjnvzpn.js} +15 -14
  246. package/dist/chunks/{shell-5qp5qbt3.js → event-logger-pre7wgsd.js} +90 -90
  247. package/dist/chunks/{shell-zmbmd7xf.js → event-logger-ptcr5d7p.js} +9 -9
  248. package/dist/chunks/{shell-9xr8vq79.js → event-logger-pxhak851.js} +36 -36
  249. package/dist/chunks/{shell-xvsa7tcp.js → event-logger-q178der0.js} +57 -55
  250. package/dist/chunks/{shell-7za4nbcg.js → event-logger-q8ktfbaq.js} +94 -85
  251. package/dist/chunks/{shell-k3e42drn.js → event-logger-qaymkmh1.js} +2 -2
  252. package/dist/chunks/{shell-sem2g21k.js → event-logger-qfa1cgps.js} +2 -2
  253. package/dist/chunks/event-logger-qj716cw9.js +38 -0
  254. package/dist/chunks/{shell-qf52r0wh.js → event-logger-qja7rspw.js} +14 -14
  255. package/dist/chunks/{shell-eazsh8dz.js → event-logger-qk60q5g0.js} +49 -46
  256. package/dist/chunks/{shell-mnyszbxc.js → event-logger-qsdy395h.js} +5 -5
  257. package/dist/chunks/{shell-2kz3bygf.js → event-logger-qt60dt5t.js} +17 -19
  258. package/dist/chunks/{shell-czwwtdmj.js → event-logger-qte34krb.js} +50 -45
  259. package/dist/chunks/{shell-x1cxkrw5.js → event-logger-qz0eehcw.js} +29 -26
  260. package/dist/chunks/event-logger-r08t1rec.js +49 -0
  261. package/dist/chunks/{shell-kk74kxfs.js → event-logger-r3nfe89y.js} +81 -77
  262. package/dist/chunks/{shell-zbqqnp0n.js → event-logger-r8dhm0tv.js} +9 -9
  263. package/dist/chunks/event-logger-re7npzcd.js +134 -0
  264. package/dist/chunks/{shell-ckcq38kt.js → event-logger-redfcqdd.js} +10 -9
  265. package/dist/chunks/event-logger-rkkn0pd8.js +40 -0
  266. package/dist/chunks/{shell-47tzbbtx.js → event-logger-rt2rznzy.js} +24 -25
  267. package/dist/chunks/{shell-68yag814.js → event-logger-rwbhhn1p.js} +38 -39
  268. package/dist/chunks/{shell-42zyazrq.js → event-logger-ryr25ayn.js} +7 -7
  269. package/dist/chunks/{shell-0ag03ecw.js → event-logger-sba4qhjf.js} +4 -7
  270. package/dist/chunks/{shell-0zz82cjq.js → event-logger-se0s1eqw.js} +2 -2
  271. package/dist/chunks/{shell-9maxscqf.js → event-logger-sk3qaz4a.js} +37 -37
  272. package/dist/chunks/{shell-mjazva4s.js → event-logger-sn6d8wk1.js} +36 -28
  273. package/dist/chunks/{shell-vc6t3p1d.js → event-logger-snz9vtbe.js} +134 -114
  274. package/dist/chunks/event-logger-ssg93tm8.js +31 -0
  275. package/dist/chunks/{shell-xws7arpm.js → event-logger-t00n1yfv.js} +8 -8
  276. package/dist/chunks/{shell-xe02v0q7.js → event-logger-t15nzqa6.js} +7 -9
  277. package/dist/chunks/{shell-5p6bksbb.js → event-logger-t3daf40q.js} +15 -15
  278. package/dist/chunks/{shell-3chx3ng6.js → event-logger-tazgh4e4.js} +26 -26
  279. package/dist/chunks/{shell-7myqjfx6.js → event-logger-tcezcvh9.js} +8 -8
  280. package/dist/chunks/{shell-nn16cgj7.js → event-logger-tjykrgmx.js} +14 -14
  281. package/dist/chunks/{shell-kk70vshc.js → event-logger-tksywzaq.js} +18 -18
  282. package/dist/chunks/{shell-tfcwk9cz.js → event-logger-trpkjvmn.js} +73 -63
  283. package/dist/chunks/{shell-f92vt4xc.js → event-logger-tydrpyjm.js} +10 -9
  284. package/dist/chunks/{shell-ba72c74g.js → event-logger-v6fy9za8.js} +49 -43
  285. package/dist/chunks/{shell-jjxszdq6.js → event-logger-vd4s1zsg.js} +35 -33
  286. package/dist/chunks/{shell-n06hdswm.js → event-logger-vwbmxwbe.js} +46 -43
  287. package/dist/chunks/event-logger-vyh7b9b2.js +51 -0
  288. package/dist/chunks/{shell-pves38xm.js → event-logger-vysbh40w.js} +10 -10
  289. package/dist/chunks/{shell-vcwr2vpf.js → event-logger-w3wsvvr9.js} +9 -9
  290. package/dist/chunks/{shell-9dyp6shn.js → event-logger-w4h8rkf0.js} +12 -10
  291. package/dist/chunks/{shell-wbkt8qpj.js → event-logger-wd87259q.js} +10 -10
  292. package/dist/chunks/{shell-zn935gjz.js → event-logger-wf1mfr52.js} +8 -8
  293. package/dist/chunks/{shell-ezs3tagn.js → event-logger-x0ckcb58.js} +2 -2
  294. package/dist/chunks/{shell-snpn6bap.js → event-logger-x1b8g1yb.js} +2 -2
  295. package/dist/chunks/{shell-hbtzhcxr.js → event-logger-x1ezjp6w.js} +12 -12
  296. package/dist/chunks/{shell-z7p6fept.js → event-logger-x4kfdah3.js} +61 -49
  297. package/dist/chunks/{shell-zseh86v1.js → event-logger-x58c4bx0.js} +11 -10
  298. package/dist/chunks/{shell-0cgt0xh2.js → event-logger-x61499pn.js} +2 -2
  299. package/dist/chunks/{shell-9dbv6hqn.js → event-logger-x6a99p7m.js} +17 -18
  300. package/dist/chunks/event-logger-x6bh0d7a.js +39 -0
  301. package/dist/chunks/event-logger-x90cphh5.js +37 -0
  302. package/dist/chunks/{shell-80v4fd6z.js → event-logger-xaqvfbh0.js} +25 -24
  303. package/dist/chunks/event-logger-xf2wyvfy.js +131 -0
  304. package/dist/chunks/event-logger-xw0r27ex.js +18 -0
  305. package/dist/chunks/{shell-zdf23kgm.js → event-logger-xy8v4fm7.js} +58 -57
  306. package/dist/chunks/{shell-f8hwpd84.js → event-logger-xzz8m99m.js} +43 -39
  307. package/dist/chunks/{shell-edxnhgvj.js → event-logger-y1fvbwt7.js} +4 -4
  308. package/dist/chunks/{shell-qaarhjrp.js → event-logger-y44na4kk.js} +2 -2
  309. package/dist/chunks/{shell-66mds5ht.js → event-logger-y71avatq.js} +6 -6
  310. package/dist/chunks/{shell-jqms80b0.js → event-logger-y8cydn3q.js} +2 -2
  311. package/dist/chunks/{shell-jepqtr73.js → event-logger-yba16dxq.js} +43 -41
  312. package/dist/chunks/{shell-teseat8q.js → event-logger-ydk5gqry.js} +39 -38
  313. package/dist/chunks/event-logger-yfbd16n1.js +386 -0
  314. package/dist/chunks/event-logger-yhtqjkzd.js +20 -0
  315. package/dist/chunks/{shell-rxnz5856.js → event-logger-yj1cwwh1.js} +16 -16
  316. package/dist/chunks/{shell-s231yqcx.js → event-logger-yjj59j99.js} +43 -40
  317. package/dist/chunks/{shell-jar52fmb.js → event-logger-yn9v8pzf.js} +8 -11
  318. package/dist/chunks/{shell-4mh4bmm5.js → event-logger-ywes9ebt.js} +98 -82
  319. package/dist/chunks/{shell-yvpqrhda.js → event-logger-yzjhj2th.js} +97 -90
  320. package/dist/chunks/{shell-hvccmfya.js → event-logger-z1g5cset.js} +17 -17
  321. package/dist/chunks/{shell-hvydqsq5.js → event-logger-z1k01bn4.js} +15 -15
  322. package/dist/chunks/{shell-n8n4ktw0.js → event-logger-z54mf0m5.js} +82 -73
  323. package/dist/chunks/event-logger-z63w68vq.js +46 -0
  324. package/dist/chunks/{shell-g23fad86.js → event-logger-zbjnn3ac.js} +8 -8
  325. package/dist/chunks/event-logger-ze44yzpk.js +247 -0
  326. package/dist/chunks/{shell-pvpv4rn6.js → event-logger-zk5b56gg.js} +44 -42
  327. package/dist/chunks/{shell-51t2tyks.js → event-logger-zxq2ej10.js} +7 -7
  328. package/dist/codemode/catalog.js +10 -11
  329. package/dist/codemode/instructions.js +11 -12
  330. package/dist/codemode/tool.js +8 -10
  331. package/dist/command.js +85 -86
  332. package/dist/config/discovery.js +83 -85
  333. package/dist/config/markdown.js +8 -9
  334. package/dist/config/normalize.js +22 -23
  335. package/dist/config/plugin/agent.js +116 -133
  336. package/dist/config/plugin/command.js +207 -215
  337. package/dist/config/plugin/compaction.js +153 -170
  338. package/dist/config/plugin/entry-observer.js +4 -114
  339. package/dist/config/plugin/formatter.js +116 -118
  340. package/dist/config/plugin/image.js +114 -130
  341. package/dist/config/plugin/instruction.js +85 -87
  342. package/dist/config/plugin/location-watcher.js +116 -118
  343. package/dist/config/plugin/mcp.js +127 -130
  344. package/dist/config/plugin/policy.js +113 -115
  345. package/dist/config/plugin/provider.js +112 -114
  346. package/dist/config/plugin/reference.js +116 -118
  347. package/dist/config/plugin/shell.js +117 -119
  348. package/dist/config/plugin/skill-file.js +99 -101
  349. package/dist/config/plugin/skill.js +134 -136
  350. package/dist/config/plugin/snapshot.js +114 -116
  351. package/dist/config/plugin/source.js +119 -121
  352. package/dist/config/plugin/tool-output.js +116 -118
  353. package/dist/config/plugin/websearch.js +114 -116
  354. package/dist/config/plugin/worktree.js +122 -0
  355. package/dist/config/variable.js +6 -7
  356. package/dist/config/watch.js +4 -5
  357. package/dist/config.js +125 -127
  358. package/dist/credential/sql.js +4 -5
  359. package/dist/credential.js +87 -88
  360. package/dist/database/database.js +79 -80
  361. package/dist/database/drizzle/effect-sqlite/driver.js +20 -21
  362. package/dist/database/drizzle/effect-sqlite/index.js +26 -27
  363. package/dist/database/drizzle/effect-sqlite/session.js +17 -18
  364. package/dist/database/drizzle/index.js +30 -31
  365. package/dist/database/drizzle/internal/drizzle-utils.js +17 -18
  366. package/dist/database/drizzle/sqlite-core/effect/count.js +3 -4
  367. package/dist/database/drizzle/sqlite-core/effect/db.js +11 -12
  368. package/dist/database/drizzle/sqlite-core/effect/delete.js +4 -5
  369. package/dist/database/drizzle/sqlite-core/effect/index.js +40 -41
  370. package/dist/database/drizzle/sqlite-core/effect/insert.js +6 -7
  371. package/dist/database/drizzle/sqlite-core/effect/query.js +5 -6
  372. package/dist/database/drizzle/sqlite-core/effect/raw.js +3 -4
  373. package/dist/database/drizzle/sqlite-core/effect/select.js +6 -7
  374. package/dist/database/drizzle/sqlite-core/effect/session.js +16 -17
  375. package/dist/database/drizzle/sqlite-core/effect/update.js +6 -7
  376. package/dist/database/drizzle.js +31 -32
  377. package/dist/database/migration/20260127222353_familiar_lady_ursula.js +1 -2
  378. package/dist/database/migration/20260211171708_add_project_commands.js +1 -2
  379. package/dist/database/migration/20260213144116_wakeful_the_professor.js +1 -2
  380. package/dist/database/migration/20260225215848_workspace.js +1 -2
  381. package/dist/database/migration/20260227213759_add_session_workspace_id.js +1 -2
  382. package/dist/database/migration/20260228203230_blue_harpoon.js +1 -2
  383. package/dist/database/migration/20260303231226_add_workspace_fields.js +1 -2
  384. package/dist/database/migration/20260309230000_move_org_to_state.js +1 -2
  385. package/dist/database/migration/20260312043431_session_message_cursor.js +1 -2
  386. package/dist/database/migration/20260323234822_events.js +1 -2
  387. package/dist/database/migration/20260410174513_workspace-name.js +1 -2
  388. package/dist/database/migration/20260413175956_chief_energizer.js +1 -2
  389. package/dist/database/migration/20260423070820_add_icon_url_override.js +1 -2
  390. package/dist/database/migration/20260427172553_slow_nightmare.js +1 -2
  391. package/dist/database/migration/20260428004200_add_session_path.js +1 -2
  392. package/dist/database/migration/20260501142318_next_venus.js +1 -2
  393. package/dist/database/migration/20260504145000_add_sync_owner.js +1 -2
  394. package/dist/database/migration/20260507164347_add_workspace_time.js +1 -2
  395. package/dist/database/migration/20260510033149_session_usage.js +1 -2
  396. package/dist/database/migration/20260511000411_data_migration_state.js +1 -2
  397. package/dist/database/migration/20260511173437_session-metadata.js +1 -2
  398. package/dist/database/migration/20260601010001_normalize_storage_paths.js +1 -2
  399. package/dist/database/migration/20260601202201_amazing_prowler.js +1 -2
  400. package/dist/database/migration/20260602002951_lowly_union_jack.js +1 -2
  401. package/dist/database/migration/20260602182828_add_project_directories.js +1 -2
  402. package/dist/database/migration/20260603001617_session_message_projection_indexes.js +1 -2
  403. package/dist/database/migration/20260603040000_session_message_projection_order.js +1 -2
  404. package/dist/database/migration/20260603141458_session_input_inbox.js +1 -2
  405. package/dist/database/migration/20260603160727_jittery_ezekiel_stane.js +1 -2
  406. package/dist/database/migration/20260604172448_event_sourced_session_input.js +1 -2
  407. package/dist/database/migration/20260605003541_add_session_context_snapshot.js +1 -2
  408. package/dist/database/migration/20260605042240_add_context_epoch_agent.js +1 -2
  409. package/dist/database/migration/20260611035744_credential.js +1 -2
  410. package/dist/database/migration/20260611192811_lush_chimera.js +1 -2
  411. package/dist/database/migration/20260612174303_project_dir_strategy.js +1 -2
  412. package/dist/database/migration/20260622142730_simplify_session_context_epoch.js +1 -2
  413. package/dist/database/migration/20260622170816_reset_v2_session_state.js +1 -2
  414. package/dist/database/migration/20260622202450_simplify_session_input.js +1 -2
  415. package/dist/database/migration/20260804233008_loose_psylocke.js +1 -2
  416. package/dist/database/migration/20260805200742_import_legacy_credentials.js +4 -5
  417. package/dist/database/migration/20260808023530_workspace_domain.js +1 -2
  418. package/dist/database/migration/20260811161259_execution_claim_attempts.js +1 -2
  419. package/dist/database/migration/20260812181746_session_inbox.js +1 -2
  420. package/dist/database/migration/20260812213948_worktree.js +1 -2
  421. package/dist/database/migration/20260819222447_session_viewed_state.js +1 -2
  422. package/dist/database/migration/20260823191254_nullable_workspace_binding.js +1 -2
  423. package/dist/database/migration.gen.js +49 -50
  424. package/dist/database/migration.js +53 -54
  425. package/dist/database/path.js +10 -11
  426. package/dist/database/schema.gen.js +1 -2
  427. package/dist/database/schema.sql.js +3 -4
  428. package/dist/database/sqlite.bun.js +8 -7
  429. package/dist/database/sqlite.js +8 -9
  430. package/dist/database/sqlite.node.js +8 -7
  431. package/dist/database/sqlite.workerd.js +6 -6
  432. package/dist/database/v1-migration.bun.js +106 -109
  433. package/dist/database/v1-migration.js +3 -4
  434. package/dist/database/v1-migration.noop.js +0 -2
  435. package/dist/effect/app-node-builder.js +359 -357
  436. package/dist/effect/app-node-platform.js +9 -10
  437. package/dist/effect/keyed-mutex.js +6 -7
  438. package/dist/effect/websocket-constructor.js +3 -4
  439. package/dist/environment/driver.js +1 -1
  440. package/dist/environment/environment.js +90 -92
  441. package/dist/environment/exec-defaults.js +4 -5
  442. package/dist/environment/files.js +12 -13
  443. package/dist/environment/index.js +106 -108
  444. package/dist/environment/local.js +5 -6
  445. package/dist/environment/memory.js +5 -6
  446. package/dist/environment/unavailable.js +1 -1
  447. package/dist/event/sql.js +5 -6
  448. package/dist/event-logger.js +72 -71
  449. package/dist/file-mutation.js +94 -96
  450. package/dist/file-retention.js +3 -4
  451. package/dist/file.js +11 -4
  452. package/dist/filesystem/fff.bun.js +4 -4
  453. package/dist/filesystem/fff.js +3 -4
  454. package/dist/filesystem/fff.node.js +5 -6
  455. package/dist/filesystem/fff.workerd.js +4 -4
  456. package/dist/filesystem/ignore.js +1 -1
  457. package/dist/filesystem/location-watcher-policy.js +7 -8
  458. package/dist/filesystem/location-watcher.js +219 -224
  459. package/dist/filesystem/protected.js +8 -9
  460. package/dist/filesystem/search.js +104 -106
  461. package/dist/filesystem/watcher-binding.js +3 -4
  462. package/dist/filesystem/watcher.js +28 -29
  463. package/dist/filesystem.js +118 -120
  464. package/dist/form.js +106 -107
  465. package/dist/formatter/builtins.js +4 -5
  466. package/dist/formatter.js +84 -86
  467. package/dist/generate.js +93 -95
  468. package/dist/git.js +19 -21
  469. package/dist/github-copilot/chat/convert-to-openai-compatible-chat-messages.js +3 -4
  470. package/dist/github-copilot/chat/get-response-metadata.js +3 -4
  471. package/dist/github-copilot/chat/map-openai-compatible-finish-reason.js +3 -4
  472. package/dist/github-copilot/chat/openai-compatible-chat-language-model.js +9 -10
  473. package/dist/github-copilot/chat/openai-compatible-chat-options.js +3 -4
  474. package/dist/github-copilot/chat/openai-compatible-prepare-tools.js +3 -4
  475. package/dist/github-copilot/copilot-provider.js +21 -22
  476. package/dist/github-copilot/models.js +6 -7
  477. package/dist/github-copilot/openai-compatible-error.js +5 -6
  478. package/dist/github-copilot/responses/convert-to-openai-responses-input.js +3 -4
  479. package/dist/github-copilot/responses/map-openai-responses-finish-reason.js +3 -4
  480. package/dist/github-copilot/responses/openai-error.js +5 -6
  481. package/dist/github-copilot/responses/openai-responses-language-model.js +12 -13
  482. package/dist/github-copilot/responses/openai-responses-prepare-tools.js +10 -11
  483. package/dist/github-copilot/responses/tool/code-interpreter.js +11 -12
  484. package/dist/github-copilot/responses/tool/file-search.js +7 -8
  485. package/dist/github-copilot/responses/tool/image-generation.js +5 -6
  486. package/dist/github-copilot/responses/tool/web-search-preview.js +3 -4
  487. package/dist/github-copilot/responses/tool/web-search.js +3 -4
  488. package/dist/id/id.js +8 -9
  489. package/dist/image/photon-wasm.bun.js +0 -2
  490. package/dist/image/photon-wasm.node.js +0 -2
  491. package/dist/image/photon-wasm.workerd.js +0 -2
  492. package/dist/image/photon.js +10 -104
  493. package/dist/image.js +14 -106
  494. package/dist/instance/service.js +7 -8
  495. package/dist/instance.js +354 -355
  496. package/dist/instruction-discovery.js +86 -87
  497. package/dist/instructions/builtins.js +83 -85
  498. package/dist/instructions/index.js +39 -40
  499. package/dist/integration/connection.js +15 -6
  500. package/dist/integration.js +111 -113
  501. package/dist/job.js +78 -79
  502. package/dist/kv/sql.js +4 -5
  503. package/dist/kv.js +72 -73
  504. package/dist/location-activity.js +88 -87
  505. package/dist/location-mutation.js +90 -92
  506. package/dist/location-service-map.js +84 -86
  507. package/dist/location-services.js +348 -349
  508. package/dist/location.js +89 -91
  509. package/dist/mcp/client.js +101 -102
  510. package/dist/mcp/index.js +140 -143
  511. package/dist/mcp/instructions.js +120 -130
  512. package/dist/mcp/oauth.js +7 -7
  513. package/dist/mcp/stdio.js +88 -90
  514. package/dist/mime.js +3 -4
  515. package/dist/modal/models.js +7 -8
  516. package/dist/model-resolver.js +100 -102
  517. package/dist/model.js +26 -27
  518. package/dist/models-dev.js +90 -91
  519. package/dist/oauth/page.js +8 -9
  520. package/dist/permission/saved.js +83 -84
  521. package/dist/permission/sql.js +7 -8
  522. package/dist/permission.js +131 -133
  523. package/dist/persistent-pty/binary.bun.js +1 -2
  524. package/dist/persistent-pty/binary.node.js +0 -2
  525. package/dist/persistent-pty/binary.workerd.js +0 -2
  526. package/dist/persistent-pty/daemon.js +9 -10
  527. package/dist/persistent-pty/index.js +88 -89
  528. package/dist/persistent-pty/pty-binding.js +1 -2
  529. package/dist/persistent-pty.js +73 -74
  530. package/dist/plugin/agent.js +96 -98
  531. package/dist/plugin/command.js +93 -96
  532. package/dist/plugin/hooks.js +6 -8
  533. package/dist/plugin/host.js +218 -223
  534. package/dist/plugin/instance.js +9 -10
  535. package/dist/plugin/internal.js +325 -323
  536. package/dist/plugin/mcp-codemode-exclusion.js +3 -4
  537. package/dist/plugin/models-dev.js +77 -78
  538. package/dist/plugin/module.js +7 -8
  539. package/dist/plugin/plan.js +96 -98
  540. package/dist/plugin/promise.js +3 -4
  541. package/dist/plugin/provider/alibaba.js +4 -5
  542. package/dist/plugin/provider/amazon-bedrock.js +4 -5
  543. package/dist/plugin/provider/anthropic.js +4 -5
  544. package/dist/plugin/provider/azure.js +119 -122
  545. package/dist/plugin/provider/cerebras.js +4 -5
  546. package/dist/plugin/provider/cloudflare-ai-gateway.js +118 -121
  547. package/dist/plugin/provider/cloudflare-workers-ai.js +118 -121
  548. package/dist/plugin/provider/cohere.js +4 -5
  549. package/dist/plugin/provider/configured.js +117 -120
  550. package/dist/plugin/provider/dynamic.js +4 -5
  551. package/dist/plugin/provider/factory.js +3 -4
  552. package/dist/plugin/provider/gateway.js +4 -5
  553. package/dist/plugin/provider/github-copilot.js +89 -90
  554. package/dist/plugin/provider/gitlab.js +5 -6
  555. package/dist/plugin/provider/google-vertex.js +4 -5
  556. package/dist/plugin/provider/kilo.js +4 -5
  557. package/dist/plugin/provider/llmgateway.js +77 -79
  558. package/dist/plugin/provider/lmstudio.js +118 -121
  559. package/dist/plugin/provider/mistral.js +4 -5
  560. package/dist/plugin/provider/modal.js +80 -82
  561. package/dist/plugin/provider/nvidia.js +4 -5
  562. package/dist/plugin/provider/ollama.js +118 -121
  563. package/dist/plugin/provider/openai-compatible.js +3 -4
  564. package/dist/plugin/provider/openai.js +79 -81
  565. package/dist/plugin/provider/opencode.js +77 -79
  566. package/dist/plugin/provider/openrouter.js +5 -6
  567. package/dist/plugin/provider/perplexity.js +4 -5
  568. package/dist/plugin/provider/sap-ai-core.js +5 -6
  569. package/dist/plugin/provider/sdk-factory.js +3 -4
  570. package/dist/plugin/provider/snowflake-cortex.js +6 -7
  571. package/dist/plugin/provider/venice.js +4 -5
  572. package/dist/plugin/provider/vercel.js +4 -5
  573. package/dist/plugin/provider/vllm.js +118 -121
  574. package/dist/plugin/provider/xai.js +78 -80
  575. package/dist/plugin/provider/zenmux.js +4 -5
  576. package/dist/plugin/provider.js +156 -160
  577. package/dist/plugin/sdk.js +77 -78
  578. package/dist/plugin/service.js +5 -6
  579. package/dist/plugin/skill.js +135 -137
  580. package/dist/plugin/source-directory.js +6 -7
  581. package/dist/plugin/supervisor.js +340 -338
  582. package/dist/plugin/system-prompt.js +13 -14
  583. package/dist/plugin/update.js +7 -8
  584. package/dist/plugin/variant.js +7 -8
  585. package/dist/plugin/vcs/git.js +82 -84
  586. package/dist/plugin/vcs/hg.js +82 -84
  587. package/dist/plugin/warming.js +111 -113
  588. package/dist/plugin/websearch/exa.js +7 -8
  589. package/dist/plugin/websearch/firecrawl.js +8 -9
  590. package/dist/plugin/websearch/index.js +10 -11
  591. package/dist/plugin/websearch/mcp.js +9 -10
  592. package/dist/plugin/websearch/parallel.js +8 -9
  593. package/dist/plugin/websearch/tavily.js +6 -7
  594. package/dist/plugin.js +230 -235
  595. package/dist/project/schema.js +14 -15
  596. package/dist/project/sql.js +10 -11
  597. package/dist/project.js +94 -96
  598. package/dist/provider.js +27 -28
  599. package/dist/pty/protocol.js +1 -1
  600. package/dist/pty/pty.bun.js +0 -2
  601. package/dist/pty/pty.node.js +0 -2
  602. package/dist/pty/pty.workerd.js +0 -2
  603. package/dist/pty/schema.js +3 -4
  604. package/dist/pty/ticket.js +1 -2
  605. package/dist/pty.js +98 -100
  606. package/dist/reference/instructions.js +84 -86
  607. package/dist/reference.js +92 -94
  608. package/dist/repository-cache.js +95 -97
  609. package/dist/repository.js +24 -25
  610. package/dist/ripgrep/binary.js +4 -5
  611. package/dist/ripgrep.js +96 -98
  612. package/dist/rpc.js +83 -85
  613. package/dist/schema.js +17 -18
  614. package/dist/session/command.js +76 -77
  615. package/dist/session/compaction.js +137 -154
  616. package/dist/session/context.js +146 -155
  617. package/dist/session/environment.js +6 -8
  618. package/dist/session/error.js +39 -40
  619. package/dist/session/event.js +3 -4
  620. package/dist/session/execution/restart.js +226 -227
  621. package/dist/session/execution.js +125 -128
  622. package/dist/session/generate.js +148 -157
  623. package/dist/session/history.js +25 -90
  624. package/dist/session/inbox.js +131 -132
  625. package/dist/session/info.js +5 -6
  626. package/dist/session/instruction-entry.js +90 -92
  627. package/dist/session/instruction-state.js +29 -31
  628. package/dist/session/instructions.js +92 -94
  629. package/dist/session/message-updater.js +5 -7
  630. package/dist/session/message.js +3 -4
  631. package/dist/session/model-request.js +119 -147
  632. package/dist/session/model-transport.js +12 -14
  633. package/dist/session/move.js +131 -134
  634. package/dist/session/projector.js +87 -88
  635. package/dist/session/prompt.js +102 -118
  636. package/dist/session/revert.js +94 -96
  637. package/dist/session/run-coordinator.js +4 -5
  638. package/dist/session/runner/index.js +5 -88
  639. package/dist/session/runner/llm.js +224 -229
  640. package/dist/session/runner/max-steps.js +3 -4
  641. package/dist/session/runner/model.js +98 -100
  642. package/dist/session/runner/publish-llm-event.js +5 -6
  643. package/dist/session/runner/retry.js +9 -77
  644. package/dist/session/runner/step.js +122 -148
  645. package/dist/session/runner/to-llm-message.js +3 -4
  646. package/dist/session/schema.js +7 -8
  647. package/dist/session/session.js +169 -177
  648. package/dist/session/shell.js +134 -136
  649. package/dist/session/skill.js +101 -103
  650. package/dist/session/sql.js +19 -20
  651. package/dist/session/stats.js +86 -86
  652. package/dist/session/store.js +85 -86
  653. package/dist/session/subagent-completion.js +8 -9
  654. package/dist/session/subagent-job.js +204 -212
  655. package/dist/session/system-prompt.js +5 -6
  656. package/dist/session/title.js +152 -161
  657. package/dist/session/to-session-error.js +107 -110
  658. package/dist/session/transfer.js +241 -240
  659. package/dist/session/usage.js +10 -11
  660. package/dist/session.js +246 -254
  661. package/dist/shell/parse.js +11 -12
  662. package/dist/shell/parser-wasm.bun.js +0 -2
  663. package/dist/shell/parser-wasm.node.js +0 -2
  664. package/dist/shell/parser-wasm.workerd.js +0 -2
  665. package/dist/shell/result.js +14 -15
  666. package/dist/shell/scan.js +6 -6
  667. package/dist/shell/select.js +28 -29
  668. package/dist/shell.js +140 -143
  669. package/dist/skill/discovery.js +7 -8
  670. package/dist/skill/instructions.js +101 -103
  671. package/dist/skill.js +122 -124
  672. package/dist/snapshot.js +90 -92
  673. package/dist/state.js +14 -15
  674. package/dist/tool/html-markdown.js +5 -6
  675. package/dist/tool/http-body.js +3 -4
  676. package/dist/tool/mcp.js +123 -133
  677. package/dist/tool/plugin/edit.js +115 -117
  678. package/dist/tool/plugin/file-diff.js +3 -4
  679. package/dist/tool/plugin/glob.js +120 -122
  680. package/dist/tool/plugin/grep.js +120 -122
  681. package/dist/tool/plugin/opencode.js +5 -6
  682. package/dist/tool/plugin/patch.js +119 -121
  683. package/dist/tool/plugin/question.js +110 -112
  684. package/dist/tool/plugin/read.js +121 -123
  685. package/dist/tool/plugin/shell.js +211 -219
  686. package/dist/tool/plugin/skill.js +109 -111
  687. package/dist/tool/plugin/subagent.js +213 -221
  688. package/dist/tool/plugin/webfetch.js +115 -117
  689. package/dist/tool/plugin/websearch.js +109 -111
  690. package/dist/tool/plugin/write.js +117 -119
  691. package/dist/tool/read-filesystem.js +125 -127
  692. package/dist/tool/runtime.js +11 -12
  693. package/dist/tool-output.js +18 -19
  694. package/dist/tool.js +23 -130
  695. package/dist/types/config/plugin/worktree.d.ts +6 -0
  696. package/dist/types/instance.d.ts +2 -1
  697. package/dist/types/model-resolver.d.ts +1 -1
  698. package/dist/types/plugin/host.d.ts +3 -2
  699. package/dist/types/plugin/internal.d.ts +3 -2
  700. package/dist/types/plugin/provider/github-copilot.d.ts +2 -0
  701. package/dist/types/project/sql.d.ts +1 -1
  702. package/dist/types/provider.d.ts +1 -1
  703. package/dist/types/session/inbox.d.ts +5 -4
  704. package/dist/types/session/model-request.d.ts +3 -0
  705. package/dist/types/session/runner/retry.d.ts +7 -0
  706. package/dist/types/v1/config/migrate.d.ts +4 -1
  707. package/dist/types/worktree/git.d.ts +1 -1
  708. package/dist/types/worktree/refresh.d.ts +2 -0
  709. package/dist/types/worktree.d.ts +23 -37
  710. package/dist/util/array.js +0 -2
  711. package/dist/util/error.js +3 -4
  712. package/dist/util/identifier.js +0 -2
  713. package/dist/util/iife.js +3 -4
  714. package/dist/util/lazy.js +3 -4
  715. package/dist/util/process-lock-ffi.bun.js +0 -2
  716. package/dist/util/process-lock-ffi.node.js +0 -2
  717. package/dist/util/process-lock-ffi.workerd.js +0 -2
  718. package/dist/util/process-lock.js +0 -2
  719. package/dist/util/slug.js +3 -4
  720. package/dist/util/token.js +3 -4
  721. package/dist/util/which.js +3 -4
  722. package/dist/util/wildcard.js +4 -5
  723. package/dist/v1/config/agent.js +7 -8
  724. package/dist/v1/config/attachment.js +6 -7
  725. package/dist/v1/config/command.js +5 -6
  726. package/dist/v1/config/config.js +20 -21
  727. package/dist/v1/config/error.js +12 -13
  728. package/dist/v1/config/formatter.js +7 -8
  729. package/dist/v1/config/layout.js +3 -4
  730. package/dist/v1/config/lsp.js +12 -13
  731. package/dist/v1/config/mcp.js +12 -13
  732. package/dist/v1/config/migrate.js +19 -34
  733. package/dist/v1/config/permission.js +9 -10
  734. package/dist/v1/config/plugin.js +7 -8
  735. package/dist/v1/config/provider-options.js +6 -7
  736. package/dist/v1/config/provider.js +10 -11
  737. package/dist/v1/config/server.js +4 -5
  738. package/dist/v1/config/skills.js +3 -4
  739. package/dist/v1/permission.js +1 -1
  740. package/dist/vcs/patch.js +23 -24
  741. package/dist/vcs.js +96 -98
  742. package/dist/websearch.js +102 -103
  743. package/dist/wellknown/plugin.js +74 -75
  744. package/dist/wellknown.js +90 -91
  745. package/dist/workspace/driver.js +18 -19
  746. package/dist/workspace/sql.js +3 -4
  747. package/dist/workspace.js +83 -84
  748. package/dist/worktree/directory.js +6 -7
  749. package/dist/worktree/git.js +9 -11
  750. package/dist/worktree/refresh.js +343 -0
  751. package/dist/worktree/sql.js +7 -8
  752. package/dist/worktree.js +117 -124
  753. package/package.json +8 -8
  754. package/dist/chunks/shell-0avv30et.js +0 -22
  755. package/dist/chunks/shell-0g44et96.js +0 -118
  756. package/dist/chunks/shell-0rz7yd7x.js +0 -18
  757. package/dist/chunks/shell-1nkp2xz2.js +0 -40
  758. package/dist/chunks/shell-273erafq.js +0 -386
  759. package/dist/chunks/shell-2j9934c7.js +0 -36
  760. package/dist/chunks/shell-2sqw2jjm.js +0 -147
  761. package/dist/chunks/shell-3gt1rb2e.js +0 -239
  762. package/dist/chunks/shell-4qk8prfw.js +0 -39
  763. package/dist/chunks/shell-5dppjsbb.js +0 -451
  764. package/dist/chunks/shell-6bxzghb6.js +0 -20
  765. package/dist/chunks/shell-6qqxywp2.js +0 -42
  766. package/dist/chunks/shell-7j3d9h1a.js +0 -173
  767. package/dist/chunks/shell-89ttfx5q.js +0 -46
  768. package/dist/chunks/shell-8manx9kj.js +0 -49
  769. package/dist/chunks/shell-8rpfd2h6.js +0 -6
  770. package/dist/chunks/shell-91jk6xaw.js +0 -263
  771. package/dist/chunks/shell-a6xqkezx.js +0 -14
  772. package/dist/chunks/shell-a83yvq99.js +0 -5
  773. package/dist/chunks/shell-a8503na0.js +0 -34
  774. package/dist/chunks/shell-ask3gap1.js +0 -151
  775. package/dist/chunks/shell-bjwj8hwv.js +0 -7
  776. package/dist/chunks/shell-c8ya26sa.js +0 -41
  777. package/dist/chunks/shell-cpsjz0c7.js +0 -31
  778. package/dist/chunks/shell-ehj9csmv.js +0 -6
  779. package/dist/chunks/shell-esv5q40e.js +0 -18
  780. package/dist/chunks/shell-f16sbr11.js +0 -40
  781. package/dist/chunks/shell-gc513wew.js +0 -25
  782. package/dist/chunks/shell-grfz4hhj.js +0 -14
  783. package/dist/chunks/shell-h5f8a9ks.js +0 -319
  784. package/dist/chunks/shell-hs51b0fc.js +0 -35
  785. package/dist/chunks/shell-hy5n5jcn.js +0 -13
  786. package/dist/chunks/shell-j07kk359.js +0 -21
  787. package/dist/chunks/shell-j9a1jgvn.js +0 -55
  788. package/dist/chunks/shell-jefdyv88.js +0 -38
  789. package/dist/chunks/shell-jp46hhdm.js +0 -134
  790. package/dist/chunks/shell-kftmq20s.js +0 -24
  791. package/dist/chunks/shell-m7jtgrng.js +0 -31
  792. package/dist/chunks/shell-ms3g46s0.js +0 -85
  793. package/dist/chunks/shell-pmn2j35m.js +0 -412
  794. package/dist/chunks/shell-q1w4qb6z.js +0 -111
  795. package/dist/chunks/shell-qfvp8zq7.js +0 -41
  796. package/dist/chunks/shell-r7z6wjth.js +0 -18
  797. package/dist/chunks/shell-tde1y35v.js +0 -74
  798. package/dist/chunks/shell-tvmhrvfj.js +0 -4
  799. package/dist/chunks/shell-v63sw24f.js +0 -33
  800. package/dist/chunks/shell-vynk8zbr.js +0 -36
  801. package/dist/chunks/shell-w5r741x8.js +0 -129
  802. package/dist/chunks/shell-w7777901.js +0 -37
  803. package/dist/chunks/shell-wdqva41w.js +0 -14
  804. package/dist/chunks/shell-wf5w4wph.js +0 -16
  805. package/dist/chunks/shell-z48apzz2.js +0 -36
  806. package/dist/chunks/shell-z8c1ty6e.js +0 -14
  807. package/dist/chunks/shell-zyyhrfr9.js +0 -49
  808. /package/dist/chunks/{shell-fg7fz4q3.js → event-logger-0zkw76rk.js} +0 -0
  809. /package/dist/chunks/{shell-yrqrg4vp.js → event-logger-17cy0kzp.js} +0 -0
  810. /package/dist/chunks/{shell-nkm1m8dz.js → event-logger-1cnp2v09.js} +0 -0
  811. /package/dist/chunks/{shell-wyqjaaa5.js → event-logger-2c3vjs8z.js} +0 -0
  812. /package/dist/chunks/{shell-fgbfdq62.js → event-logger-359p4xyc.js} +0 -0
  813. /package/dist/chunks/{shell-9sdtsapf.js → event-logger-43n2bw4t.js} +0 -0
  814. /package/dist/chunks/{shell-cm67rqy2.js → event-logger-4knz6hnm.js} +0 -0
  815. /package/dist/chunks/{shell-1fb7bmpf.js → event-logger-53557ph1.js} +0 -0
  816. /package/dist/chunks/{shell-dht5baf0.js → event-logger-7akdwqpd.js} +0 -0
  817. /package/dist/chunks/{shell-z47nswr2.js → event-logger-7m9af43g.js} +0 -0
  818. /package/dist/chunks/{shell-ghm4673n.js → event-logger-8n3pysct.js} +0 -0
  819. /package/dist/chunks/{shell-f4cp4g4a.js → event-logger-9a4afbnw.js} +0 -0
  820. /package/dist/chunks/{shell-qp95y4jb.js → event-logger-aqzs7mqg.js} +0 -0
  821. /package/dist/chunks/{shell-em6xpscd.js → event-logger-atq7p7m5.js} +0 -0
  822. /package/dist/chunks/{shell-gd5xeqc2.js → event-logger-bkyjaxrp.js} +0 -0
  823. /package/dist/chunks/{shell-emmqknsm.js → event-logger-bmr6ed5q.js} +0 -0
  824. /package/dist/chunks/{shell-69qrqpw0.js → event-logger-cvy3z8tj.js} +0 -0
  825. /package/dist/chunks/{shell-qc167nrn.js → event-logger-d9fn303g.js} +0 -0
  826. /package/dist/chunks/{shell-nsc0c3zb.js → event-logger-d9jj8t3e.js} +0 -0
  827. /package/dist/chunks/{shell-sp575ygv.js → event-logger-dajrwvna.js} +0 -0
  828. /package/dist/chunks/{shell-kyyqvx4s.js → event-logger-df08tz66.js} +0 -0
  829. /package/dist/chunks/{shell-ttxf0gsy.js → event-logger-dy18nga0.js} +0 -0
  830. /package/dist/chunks/{shell-se76j685.js → event-logger-e5kj55wp.js} +0 -0
  831. /package/dist/chunks/{shell-8sj3ajy5.js → event-logger-f6n9ztr4.js} +0 -0
  832. /package/dist/chunks/{shell-ma60vzgv.js → event-logger-fd410y7t.js} +0 -0
  833. /package/dist/chunks/{shell-3g3rpp2x.js → event-logger-g86h250q.js} +0 -0
  834. /package/dist/chunks/{shell-8nn8kqcn.js → event-logger-hk9envan.js} +0 -0
  835. /package/dist/chunks/{shell-tmb1f636.js → event-logger-j2ntwpah.js} +0 -0
  836. /package/dist/chunks/{shell-n3m50c2t.js → event-logger-jr7sbwjy.js} +0 -0
  837. /package/dist/chunks/{shell-ghwjy7my.js → event-logger-jwfs4k6c.js} +0 -0
  838. /package/dist/chunks/{shell-3w3ybtfd.js → event-logger-jzg6c2d5.js} +0 -0
  839. /package/dist/chunks/{shell-5va1yh78.js → event-logger-mp448xyj.js} +0 -0
  840. /package/dist/chunks/{shell-dhcq6c44.js → event-logger-msx8hqn2.js} +0 -0
  841. /package/dist/chunks/{shell-v2adqbbe.js → event-logger-n05xt0ee.js} +0 -0
  842. /package/dist/chunks/{shell-faypg4r1.js → event-logger-n3j8tn72.js} +0 -0
  843. /package/dist/chunks/{shell-2xb0r1c6.js → event-logger-njntx4h6.js} +0 -0
  844. /package/dist/chunks/{shell-wwntjmk1.js → event-logger-q3sfg36h.js} +0 -0
  845. /package/dist/chunks/{shell-47ty4mvs.js → event-logger-q74kybfr.js} +0 -0
  846. /package/dist/chunks/{shell-6zqxzw0a.js → event-logger-qb87gjwd.js} +0 -0
  847. /package/dist/chunks/{shell-x4q807cx.js → event-logger-qrg20bc0.js} +0 -0
  848. /package/dist/chunks/{shell-9dct5xhx.js → event-logger-rcb2kzg1.js} +0 -0
  849. /package/dist/chunks/{shell-f14r7hfz.js → event-logger-sdp7kfr6.js} +0 -0
  850. /package/dist/chunks/{shell-b02txbh8.js → event-logger-ssg3fenm.js} +0 -0
  851. /package/dist/chunks/{shell-39ktntah.js → event-logger-twg0f83k.js} +0 -0
  852. /package/dist/chunks/{shell-2qdx6zz3.js → event-logger-w803qqfp.js} +0 -0
  853. /package/dist/chunks/{shell-906y0b6d.js → event-logger-wer8tq1h.js} +0 -0
  854. /package/dist/chunks/{shell-kxy11nzk.js → event-logger-wtztk69x.js} +0 -0
  855. /package/dist/chunks/{shell-ayevdmef.js → event-logger-ygaqb7jw.js} +0 -0
  856. /package/dist/chunks/{shell-kpdbz7gn.js → event-logger-z9919s4g.js} +0 -0
@@ -1,151 +0,0 @@
1
- import {
2
- CredentialTable
3
- } from "./shell-mf0hyk7z.js";
4
- import {
5
- exports_bus
6
- } from "./shell-07b0cypv.js";
7
- import {
8
- exports_database
9
- } from "./shell-t1qmyghk.js";
10
- import {
11
- __export
12
- } from "./shell-vpjkya7h.js";
13
-
14
- // src/credential.ts
15
- var exports_credential = {};
16
- __export(exports_credential, {
17
- Credential: () => exports_credential,
18
- Event: () => Event,
19
- ID: () => ID,
20
- Info: () => Info,
21
- Key: () => Key,
22
- OAuth: () => OAuth,
23
- Service: () => Service,
24
- Value: () => Value,
25
- node: () => node
26
- });
27
- import { asc, desc, eq } from "drizzle-orm";
28
- import { Context, Effect, Layer, Schema } from "effect";
29
- import { Credential } from "@opencode-ai/schema/credential";
30
- import { Integration } from "@opencode-ai/schema/integration";
31
- import { makeGlobalNode } from "@opencode-ai/util/effect/app-node";
32
- var ID = Credential.ID;
33
- var OAuth = Credential.OAuth;
34
- var Key = Credential.Key;
35
- var Value = Credential.Value;
36
- var Event = Credential.Event;
37
-
38
- class Info extends Schema.Class("Credential.Info")({
39
- id: ID,
40
- integrationID: Integration.ID,
41
- label: Schema.String,
42
- value: Value
43
- }) {
44
- }
45
-
46
- class Service extends Context.Service()("@opencode/Credential") {
47
- }
48
- var layer = Layer.effect(Service, Effect.gen(function* () {
49
- const db = (yield* exports_database.Service).db;
50
- const bus = yield* exports_bus.Service;
51
- const decode = Schema.decodeUnknownSync(Value);
52
- const stored = (row) => {
53
- if (!row.integration_id)
54
- return;
55
- return new Info({
56
- id: row.id,
57
- integrationID: row.integration_id,
58
- label: row.label,
59
- value: decode(row.value)
60
- });
61
- };
62
- const storedRows = (rows) => rows.flatMap((row) => {
63
- const credential = stored(row);
64
- return credential ? [credential] : [];
65
- });
66
- return Service.of({
67
- all: Effect.fn("Credential.all")(() => db.select().from(CredentialTable).orderBy(asc(CredentialTable.active), asc(CredentialTable.time_created), asc(CredentialTable.id)).all().pipe(Effect.orDie, Effect.map(storedRows))),
68
- list: Effect.fn("Credential.list")((integrationID) => db.select().from(CredentialTable).where(eq(CredentialTable.integration_id, integrationID)).orderBy(asc(CredentialTable.active), asc(CredentialTable.time_created), asc(CredentialTable.id)).all().pipe(Effect.orDie, Effect.map(storedRows))),
69
- get: Effect.fn("Credential.get")(function* (id) {
70
- const row = yield* db.select().from(CredentialTable).where(eq(CredentialTable.id, id)).get().pipe(Effect.orDie);
71
- return row ? stored(row) : undefined;
72
- }),
73
- create: Effect.fn("Credential.create")(function* (input) {
74
- const credential = new Info({
75
- id: ID.create(),
76
- integrationID: input.integrationID,
77
- label: input.label ?? "default",
78
- value: input.value
79
- });
80
- yield* db.transaction((tx) => Effect.gen(function* () {
81
- yield* tx.update(CredentialTable).set({ active: false }).where(eq(CredentialTable.integration_id, credential.integrationID)).run();
82
- yield* tx.insert(CredentialTable).values({
83
- id: credential.id,
84
- integration_id: credential.integrationID,
85
- label: credential.label,
86
- value: credential.value,
87
- active: true
88
- }).run();
89
- })).pipe(Effect.orDie);
90
- yield* bus.publish(Event.Updated, {}, { global: true });
91
- yield* bus.publish(Event.Switched, { integrationID: credential.integrationID, credentialID: credential.id }, { global: true });
92
- return credential;
93
- }),
94
- activate: Effect.fn("Credential.activate")(function* (id) {
95
- const integrationID = yield* db.transaction((tx) => Effect.gen(function* () {
96
- const credential = yield* tx.select().from(CredentialTable).where(eq(CredentialTable.id, id)).get();
97
- if (!credential?.integration_id)
98
- return;
99
- const active = yield* tx.select({ id: CredentialTable.id }).from(CredentialTable).where(eq(CredentialTable.integration_id, credential.integration_id)).orderBy(desc(CredentialTable.active), desc(CredentialTable.time_created), desc(CredentialTable.id)).get();
100
- if (active?.id === id)
101
- return;
102
- yield* tx.update(CredentialTable).set({ active: false }).where(eq(CredentialTable.integration_id, credential.integration_id)).run();
103
- yield* tx.update(CredentialTable).set({ active: true }).where(eq(CredentialTable.id, id)).run();
104
- return credential.integration_id;
105
- })).pipe(Effect.orDie);
106
- if (integrationID)
107
- yield* bus.publish(Event.Switched, { integrationID, credentialID: id }, { global: true });
108
- }),
109
- update: Effect.fn("Credential.update")(function* (id, updates) {
110
- if (updates.label === undefined && updates.value === undefined)
111
- return;
112
- const credential = yield* db.select({ integrationID: CredentialTable.integration_id, label: CredentialTable.label }).from(CredentialTable).where(eq(CredentialTable.id, id)).get().pipe(Effect.orDie);
113
- if (!credential?.integrationID)
114
- return;
115
- if (updates.label === credential.label && updates.value === undefined)
116
- return;
117
- yield* db.update(CredentialTable).set({ label: updates.label, value: updates.value }).where(eq(CredentialTable.id, id)).run().pipe(Effect.orDie);
118
- if (updates.label !== undefined && updates.label !== credential.label)
119
- yield* bus.publish(Event.Updated, {}, { global: true });
120
- }),
121
- remove: Effect.fn("Credential.remove")(function* (id) {
122
- const removed = yield* db.transaction((tx) => Effect.gen(function* () {
123
- const credential = yield* tx.select().from(CredentialTable).where(eq(CredentialTable.id, id)).get();
124
- if (!credential)
125
- return;
126
- const active = credential.integration_id ? yield* tx.select({ id: CredentialTable.id }).from(CredentialTable).where(eq(CredentialTable.integration_id, credential.integration_id)).orderBy(desc(CredentialTable.active), desc(CredentialTable.time_created), desc(CredentialTable.id)).get() : undefined;
127
- yield* tx.delete(CredentialTable).where(eq(CredentialTable.id, id)).run();
128
- if (!credential.integration_id || active?.id !== id)
129
- return { switched: false };
130
- const replacement = yield* tx.select({ id: CredentialTable.id }).from(CredentialTable).where(eq(CredentialTable.integration_id, credential.integration_id)).orderBy(desc(CredentialTable.time_created), desc(CredentialTable.id)).get();
131
- if (replacement) {
132
- yield* tx.update(CredentialTable).set({ active: false }).where(eq(CredentialTable.integration_id, credential.integration_id)).run();
133
- yield* tx.update(CredentialTable).set({ active: true }).where(eq(CredentialTable.id, replacement.id)).run();
134
- }
135
- return {
136
- switched: true,
137
- integrationID: credential.integration_id,
138
- credentialID: replacement?.id ?? null
139
- };
140
- })).pipe(Effect.orDie);
141
- if (!removed)
142
- return;
143
- yield* bus.publish(Event.Updated, {}, { global: true });
144
- if (removed.switched)
145
- yield* bus.publish(Event.Switched, { integrationID: removed.integrationID, credentialID: removed.credentialID }, { global: true });
146
- })
147
- });
148
- }));
149
- var node = makeGlobalNode({ service: Service, layer, deps: [exports_database.node, exports_bus.node] });
150
-
151
- export { ID, OAuth, Key, Value, Event, Info, Service, node, exports_credential };
@@ -1,7 +0,0 @@
1
- // src/session/schema.ts
2
- import * as SessionSchema from "@opencode-ai/schema/session";
3
- import { Session } from "@opencode-ai/schema/session";
4
- var ID = Session.ID;
5
- var Info = Session.Info;
6
-
7
- export { ID, Info, SessionSchema };
@@ -1,41 +0,0 @@
1
- import {
2
- absoluteArrayColumn,
3
- absoluteColumn
4
- } from "./shell-zbqqnp0n.js";
5
- import {
6
- Timestamps
7
- } from "./shell-sem2g21k.js";
8
-
9
- // src/project/sql.ts
10
- import { isNotNull, isNull, ne, or } from "drizzle-orm";
11
- import { sqliteTable, text, integer, primaryKey } from "drizzle-orm/sqlite-core";
12
- var ProjectTable = sqliteTable("project", {
13
- id: text().$type().primaryKey(),
14
- worktree: absoluteColumn().notNull(),
15
- vcs: text().$type(),
16
- name: text(),
17
- icon_url: text(),
18
- icon_url_override: text(),
19
- icon_color: text(),
20
- ...Timestamps,
21
- time_initialized: integer(),
22
- sandboxes: absoluteArrayColumn().notNull(),
23
- commands: text({ mode: "json" }).$type()
24
- });
25
- var ProjectDirectoryTable = sqliteTable("project_directory", {
26
- project_id: text().$type().notNull().references(() => ProjectTable.id, { onDelete: "cascade" }),
27
- directory: absoluteColumn().notNull(),
28
- type: text().$type(),
29
- strategy: text(),
30
- time_created: integer().notNull().$default(() => Date.now())
31
- }, (table) => [primaryKey({ columns: [table.project_id, table.directory] })]);
32
- function upsertProject(db, project) {
33
- const vcs = project.vcs?.type;
34
- return db.insert(ProjectTable).values({ id: project.id, worktree: project.canonical, vcs, sandboxes: [] }).onConflictDoUpdate({
35
- target: ProjectTable.id,
36
- set: { vcs: vcs ?? null },
37
- setWhere: vcs ? or(isNull(ProjectTable.vcs), ne(ProjectTable.vcs, vcs)) : isNotNull(ProjectTable.vcs)
38
- }).run();
39
- }
40
-
41
- export { ProjectTable, ProjectDirectoryTable, upsertProject };
@@ -1,31 +0,0 @@
1
- import {
2
- DefaultServices,
3
- EffectSQLiteDatabase,
4
- make,
5
- makeWithDefaults
6
- } from "./shell-r7gm0yzj.js";
7
- import {
8
- EffectSQLiteSession,
9
- EffectSQLiteTransaction,
10
- managesTransactionsNatively
11
- } from "./shell-kk70vshc.js";
12
- import {
13
- __export
14
- } from "./shell-vpjkya7h.js";
15
-
16
- // src/database/drizzle/index.ts
17
- var exports_drizzle = {};
18
- __export(exports_drizzle, {
19
- DefaultServices: () => DefaultServices,
20
- EffectDrizzleSqlite: () => exports_drizzle,
21
- EffectLogger: () => EffectLogger,
22
- EffectSQLiteDatabase: () => EffectSQLiteDatabase,
23
- EffectSQLiteSession: () => EffectSQLiteSession,
24
- EffectSQLiteTransaction: () => EffectSQLiteTransaction,
25
- make: () => make,
26
- makeWithDefaults: () => makeWithDefaults,
27
- managesTransactionsNatively: () => managesTransactionsNatively
28
- });
29
- import { EffectLogger } from "drizzle-orm/effect-core";
30
-
31
- export { exports_drizzle, EffectLogger };
@@ -1,6 +0,0 @@
1
- // src/util/iife.ts
2
- function iife(fn) {
3
- return fn();
4
- }
5
-
6
- export { iife };
@@ -1,18 +0,0 @@
1
- import {
2
- __export
3
- } from "./shell-vpjkya7h.js";
4
-
5
- // src/plugin/service.ts
6
- var exports_service = {};
7
- __export(exports_service, {
8
- Plugin: () => exports_service,
9
- Service: () => Service,
10
- awaitActivation: () => awaitActivation
11
- });
12
- import { Context } from "effect";
13
-
14
- class Service extends Context.Service()("@opencode/Plugin") {
15
- }
16
- var awaitActivation = Service.use((plugins) => plugins.awaitActivation);
17
-
18
- export { Service, awaitActivation, exports_service };
@@ -1,40 +0,0 @@
1
- import {
2
- exports_entry_observer
3
- } from "./shell-mnyszbxc.js";
4
- import {
5
- exports_config
6
- } from "./shell-r8f3g7x9.js";
7
- import {
8
- exports_tool_output
9
- } from "./shell-7gcyy9x5.js";
10
- import {
11
- __export
12
- } from "./shell-vpjkya7h.js";
13
-
14
- // src/config/plugin/tool-output.ts
15
- var exports_tool_output2 = {};
16
- __export(exports_tool_output2, {
17
- ConfigToolOutputPlugin: () => exports_tool_output2,
18
- Plugin: () => Plugin
19
- });
20
- import { define } from "@opencode-ai/plugin/effect/plugin";
21
- import { Effect } from "effect";
22
- var Plugin = define({
23
- id: "opencode.config.tool-output",
24
- effect: Effect.fn(function* (ctx) {
25
- const config = yield* exports_config.Service;
26
- const output = yield* exports_tool_output.Service;
27
- const loaded = yield* exports_entry_observer.observe(config, ctx.event, output.reload());
28
- yield* output.transform((editor) => {
29
- const configured = exports_config.latest(loaded.entries, "tool_output");
30
- if (!configured)
31
- return;
32
- editor.configure({
33
- ...configured.max_lines === undefined ? {} : { maxLines: configured.max_lines },
34
- ...configured.max_bytes === undefined ? {} : { maxBytes: configured.max_bytes }
35
- });
36
- });
37
- })
38
- });
39
-
40
- export { Plugin, exports_tool_output2 as exports_tool_output };
@@ -1,25 +0,0 @@
1
- import {
2
- AbsolutePath
3
- } from "./shell-j07kk359.js";
4
- import {
5
- __export
6
- } from "./shell-vpjkya7h.js";
7
-
8
- // src/worktree/directory.ts
9
- var exports_directory = {};
10
- __export(exports_directory, {
11
- DirectoryUnavailableError: () => DirectoryUnavailableError,
12
- WorktreeDirectory: () => exports_directory,
13
- canonical: () => canonical
14
- });
15
- import { Effect, Schema } from "effect";
16
- class DirectoryUnavailableError extends Schema.TaggedError()("Worktree.DirectoryUnavailableError", { directory: AbsolutePath }) {
17
- }
18
- var canonical = Effect.fnUntraced(function* (fs, input) {
19
- const resolved = AbsolutePath.make(yield* fs.resolve(input));
20
- if (!(yield* fs.isDir(resolved)))
21
- return yield* new DirectoryUnavailableError({ directory: input });
22
- return resolved;
23
- });
24
-
25
- export { DirectoryUnavailableError, canonical, exports_directory };
@@ -1,14 +0,0 @@
1
- import {
2
- __export
3
- } from "./shell-vpjkya7h.js";
4
-
5
- // src/file.ts
6
- var exports_file = {};
7
- __export(exports_file, {
8
- Diff: () => Diff,
9
- File: () => exports_file
10
- });
11
- import { FileDiff } from "@opencode-ai/schema/file-diff";
12
- var Diff = FileDiff.Info;
13
-
14
- export { Diff, exports_file };
@@ -1,319 +0,0 @@
1
- import {
2
- SessionInboxTable,
3
- SessionMessageTable
4
- } from "./shell-q606pcse.js";
5
- import {
6
- SessionEvent
7
- } from "./shell-a83yvq99.js";
8
- import {
9
- SessionMessage
10
- } from "./shell-8rpfd2h6.js";
11
- import {
12
- SessionSchema
13
- } from "./shell-bjwj8hwv.js";
14
- import {
15
- exports_bus
16
- } from "./shell-07b0cypv.js";
17
- import {
18
- exports_database
19
- } from "./shell-t1qmyghk.js";
20
- import {
21
- exports_keyed_mutex
22
- } from "./shell-66mds5ht.js";
23
- import {
24
- __export
25
- } from "./shell-vpjkya7h.js";
26
-
27
- // src/session/inbox.ts
28
- var exports_inbox = {};
29
- __export(exports_inbox, {
30
- Compaction: () => Compaction,
31
- CompactionPayload: () => CompactionPayload,
32
- Delivery: () => Delivery,
33
- Info: () => Info,
34
- Item: () => Item,
35
- LifecycleConflict: () => LifecycleConflict,
36
- Move: () => Move,
37
- MovePayload: () => MovePayload,
38
- Service: () => Service,
39
- SessionInbox: () => exports_inbox,
40
- Synthetic: () => Synthetic,
41
- SyntheticPayload: () => SyntheticPayload,
42
- User: () => User,
43
- UserPayload: () => UserPayload,
44
- find: () => find,
45
- has: () => has,
46
- layer: () => layer,
47
- list: () => list,
48
- make: () => make,
49
- moveIDs: () => moveIDs,
50
- nextPromotable: () => nextPromotable,
51
- node: () => node,
52
- projectAdmitted: () => projectAdmitted,
53
- projectCancelled: () => projectCancelled,
54
- projectDelivered: () => projectDelivered,
55
- projectDeliveryChanged: () => projectDeliveryChanged,
56
- promote: () => promote,
57
- serialized: () => serialized
58
- });
59
- import { and, asc, eq, or } from "drizzle-orm";
60
- import { Context, DateTime, Effect, Layer, Schema } from "effect";
61
- import { makeGlobalNode } from "@opencode-ai/util/effect/app-node";
62
- import {
63
- Compaction,
64
- CompactionPayload,
65
- Delivery,
66
- Info,
67
- Item,
68
- Move,
69
- MovePayload,
70
- Synthetic,
71
- SyntheticPayload,
72
- User,
73
- UserPayload
74
- } from "@opencode-ai/schema/session-inbox";
75
- var decodeUser = Schema.decodeUnknownSync(UserPayload);
76
- var encodeUser = Schema.encodeSync(UserPayload);
77
- var decodeSynthetic = Schema.decodeUnknownSync(SyntheticPayload);
78
- var encodeSynthetic = Schema.encodeSync(SyntheticPayload);
79
- var decodeCompaction = Schema.decodeUnknownSync(CompactionPayload);
80
- var encodeCompaction = Schema.encodeSync(CompactionPayload);
81
- var decodeMove = Schema.decodeUnknownSync(MovePayload);
82
- var encodeMove = Schema.encodeSync(MovePayload);
83
- var decodeMessage = Schema.decodeUnknownSync(SessionMessage.Info);
84
- var inboxLocks = exports_keyed_mutex.makeUnsafe();
85
- var serialized = (sessionID, effect) => inboxLocks.withLock(sessionID)(effect);
86
-
87
- class LifecycleConflict extends Schema.TaggedError()("SessionInbox.LifecycleConflict", {
88
- id: SessionMessage.ID
89
- }) {
90
- }
91
- function matches(stored, request) {
92
- return stored.sessionID === request.sessionID && stored.type === request.type;
93
- }
94
- var fromRow = (row) => {
95
- const base = {
96
- id: SessionMessage.ID.make(row.id),
97
- sessionID: SessionSchema.ID.make(row.session_id),
98
- timeCreated: DateTime.makeUnsafe(row.time_created)
99
- };
100
- if (row.type === "compaction")
101
- return Compaction.make({
102
- ...base,
103
- type: "compaction",
104
- payload: decodeCompaction(row.payload),
105
- delivery: row.delivery
106
- });
107
- if (row.type === "move")
108
- return Move.make({ ...base, type: "move", payload: decodeMove(row.payload), delivery: row.delivery });
109
- if (row.type === "user")
110
- return User.make({
111
- ...base,
112
- type: "user",
113
- payload: decodeUser(row.payload),
114
- delivery: row.delivery
115
- });
116
- if (row.type === "synthetic")
117
- return Synthetic.make({
118
- ...base,
119
- type: "synthetic",
120
- payload: decodeSynthetic(row.payload),
121
- delivery: row.delivery
122
- });
123
- throw new LifecycleConflict({ id: base.id });
124
- };
125
- var find = Effect.fn("SessionInbox.find")(function* (db, id) {
126
- const row = yield* db.select().from(SessionInboxTable).where(eq(SessionInboxTable.id, id)).get().pipe(Effect.orDie);
127
- return row === undefined ? undefined : fromRow(row);
128
- });
129
- var promotedFromMessage = Effect.fn("SessionInbox.promotedFromMessage")(function* (db, sessionID, id, delivery) {
130
- const row = yield* db.select().from(SessionMessageTable).where(eq(SessionMessageTable.id, id)).get().pipe(Effect.orDie);
131
- if (row === undefined)
132
- return;
133
- if (row.session_id !== sessionID || row.type !== "user" && row.type !== "synthetic")
134
- return yield* new LifecycleConflict({ id });
135
- const message = decodeMessage({ ...row.data, id: row.id, type: row.type });
136
- const base = { id, sessionID, timeCreated: message.time.created, delivery };
137
- if (message.type === "user")
138
- return User.make({
139
- ...base,
140
- type: "user",
141
- payload: decodeUser(message)
142
- });
143
- if (message.type === "synthetic")
144
- return Synthetic.make({
145
- ...base,
146
- type: "synthetic",
147
- payload: decodeSynthetic(message)
148
- });
149
- return yield* new LifecycleConflict({ id });
150
- });
151
-
152
- class Service extends Context.Service()("@opencode/SessionInbox") {
153
- }
154
- var make = Effect.fn("SessionInbox.make")(function* () {
155
- const database = yield* exports_database.Service;
156
- const db = database.db;
157
- const bus = yield* exports_bus.Service;
158
- const reconcile = Effect.fn("SessionInbox.reconcile")(function* (request) {
159
- const existing = (yield* find(db, request.id)) ?? (yield* promotedFromMessage(db, request.sessionID, request.id, request.delivery));
160
- if (existing === undefined)
161
- return;
162
- if (existing.type === "compaction" || !matches(existing, request))
163
- return yield* new LifecycleConflict({ id: request.id });
164
- return existing;
165
- });
166
- const admit = Effect.fn("SessionInbox.admit")(function* (request) {
167
- const existing = yield* reconcile({ ...request, type: request.item.type, delivery: request.item.delivery });
168
- if (existing !== undefined)
169
- return existing;
170
- const admitted = yield* bus.publish(SessionEvent.InboxEnqueued, {
171
- inboxID: request.id,
172
- sessionID: request.sessionID,
173
- item: request.item
174
- }).pipe(Effect.map((event) => Info.make({
175
- id: request.id,
176
- sessionID: request.sessionID,
177
- timeCreated: DateTime.makeUnsafe(event.created),
178
- ...request.item
179
- })), Effect.catchDefect((defect) => defect instanceof LifecycleConflict ? find(db, request.id).pipe(Effect.flatMap((stored) => stored === undefined ? Effect.fail(defect) : Effect.succeed(stored))) : Effect.die(defect)));
180
- if (!matches(admitted, { ...request, type: request.item.type }))
181
- return yield* new LifecycleConflict({ id: request.id });
182
- return admitted;
183
- });
184
- const admitCompaction = Effect.fn("SessionInbox.admitCompaction")(function* (input) {
185
- return yield* serialized(input.sessionID, Effect.gen(function* () {
186
- const exact = yield* find(db, input.id);
187
- if (exact) {
188
- if (exact.type === "compaction" && exact.sessionID === input.sessionID)
189
- return exact;
190
- return yield* new LifecycleConflict({ id: input.id });
191
- }
192
- if (yield* promotedFromMessage(db, input.sessionID, input.id, input.delivery))
193
- return yield* new LifecycleConflict({ id: input.id });
194
- const pending = (yield* list(db, input.sessionID)).find((item) => item.type === "compaction");
195
- if (pending)
196
- return pending;
197
- return yield* admit({
198
- id: input.id,
199
- sessionID: input.sessionID,
200
- item: { type: "compaction", payload: {}, delivery: Delivery.make(input.delivery) }
201
- });
202
- }));
203
- });
204
- const cancel = Effect.fn("SessionInbox.cancel")((input) => publishMutation(input, bus.publish(SessionEvent.InboxCancelled, {
205
- sessionID: input.sessionID,
206
- inboxID: input.id
207
- })));
208
- const steer = Effect.fn("SessionInbox.steer")((input) => publishMutation(input, bus.publish(SessionEvent.InboxDeliveryChanged, {
209
- sessionID: input.sessionID,
210
- inboxID: input.id,
211
- delivery: "steer"
212
- })));
213
- const queue = Effect.fn("SessionInbox.queue")((input) => publishMutation(input, bus.publish(SessionEvent.InboxDeliveryChanged, {
214
- sessionID: input.sessionID,
215
- inboxID: input.id,
216
- delivery: "queue"
217
- })));
218
- return {
219
- list: (sessionID) => list(db, sessionID),
220
- reconcile,
221
- admit,
222
- admitCompaction,
223
- cancel,
224
- steer,
225
- queue
226
- };
227
- });
228
- var layer = Layer.effect(Service, make());
229
- var node = makeGlobalNode({ service: Service, layer, deps: [exports_database.node, exports_bus.node] });
230
- var projectAdmitted = Effect.fn("SessionInbox.projectAdmitted")(function* (db, request) {
231
- const message = yield* db.select({ id: SessionMessageTable.id }).from(SessionMessageTable).where(eq(SessionMessageTable.id, request.id)).get().pipe(Effect.orDie);
232
- if (message !== undefined)
233
- return yield* Effect.die(new LifecycleConflict({ id: request.id }));
234
- const stored = yield* db.insert(SessionInboxTable).values({
235
- id: request.id,
236
- session_id: request.sessionID,
237
- type: request.item.type,
238
- payload: request.item.type === "user" ? encodeUser(request.item.payload) : request.item.type === "synthetic" ? encodeSynthetic(request.item.payload) : request.item.type === "compaction" ? encodeCompaction(request.item.payload) : encodeMove(request.item.payload),
239
- delivery: request.item.delivery,
240
- enqueued_seq: request.enqueuedSeq,
241
- time_created: request.timeCreated
242
- }).onConflictDoNothing().returning({ id: SessionInboxTable.id }).get().pipe(Effect.orDie);
243
- if (!stored)
244
- return yield* Effect.die(new LifecycleConflict({ id: request.id }));
245
- });
246
- var projectDelivered = Effect.fn("SessionInbox.projectDelivered")(function* (db, input) {
247
- const deleted = yield* db.delete(SessionInboxTable).where(and(eq(SessionInboxTable.id, input.id), eq(SessionInboxTable.session_id, input.sessionID))).returning().get().pipe(Effect.orDie);
248
- if (!deleted)
249
- return yield* Effect.die(new LifecycleConflict({ id: input.id }));
250
- return fromRow(deleted);
251
- });
252
- var projectCancelled = Effect.fn("SessionInbox.projectCancelled")(function* (db, input) {
253
- const deleted = yield* db.delete(SessionInboxTable).where(and(eq(SessionInboxTable.id, input.id), eq(SessionInboxTable.session_id, input.sessionID), or(eq(SessionInboxTable.delivery, "queue"), eq(SessionInboxTable.delivery, "steer")))).returning({ id: SessionInboxTable.id }).get().pipe(Effect.orDie);
254
- if (!deleted)
255
- return yield* Effect.die(new LifecycleConflict({ id: input.id }));
256
- });
257
- var projectDelivery = Effect.fn("SessionInbox.projectDelivery")(function* (db, input) {
258
- const updated = yield* db.update(SessionInboxTable).set({ delivery: input.to }).where(and(eq(SessionInboxTable.id, input.id), eq(SessionInboxTable.session_id, input.sessionID), eq(SessionInboxTable.delivery, input.from))).returning({ id: SessionInboxTable.id }).get().pipe(Effect.orDie);
259
- if (!updated)
260
- return yield* Effect.die(new LifecycleConflict({ id: input.id }));
261
- });
262
- var projectDeliveryChanged = Effect.fn("SessionInbox.projectDeliveryChanged")((db, input) => projectDelivery(db, {
263
- ...input,
264
- from: input.delivery === "steer" ? "queue" : "steer",
265
- to: input.delivery
266
- }));
267
- var list = Effect.fn("SessionInbox.list")(function* (db, sessionID) {
268
- const rows = yield* db.select().from(SessionInboxTable).where(eq(SessionInboxTable.session_id, sessionID)).orderBy(asc(SessionInboxTable.enqueued_seq)).all().pipe(Effect.orDie);
269
- return rows.map(fromRow);
270
- });
271
- var moveIDs = Effect.fn("SessionInbox.moveIDs")(function* (db, sessionID) {
272
- return yield* db.select({ id: SessionInboxTable.id }).from(SessionInboxTable).where(and(eq(SessionInboxTable.session_id, sessionID), eq(SessionInboxTable.type, "move"))).orderBy(asc(SessionInboxTable.enqueued_seq)).all().pipe(Effect.orDie);
273
- });
274
- var nextPromotable = Effect.fn("SessionInbox.nextPromotable")(function* (db, sessionID, promotable) {
275
- const next = (delivery) => db.select().from(SessionInboxTable).where(and(eq(SessionInboxTable.session_id, sessionID), eq(SessionInboxTable.delivery, delivery))).orderBy(asc(SessionInboxTable.enqueued_seq)).limit(1).get().pipe(Effect.orDie);
276
- const steer = yield* next("steer");
277
- if (steer)
278
- return fromRow(steer);
279
- if (promotable !== "input")
280
- return;
281
- const queued = yield* next("queue");
282
- return queued ? fromRow(queued) : undefined;
283
- });
284
- var has = Effect.fn("SessionInbox.has")(function* (db, sessionID, scope) {
285
- const row = yield* db.select({ id: SessionInboxTable.id }).from(SessionInboxTable).where(and(eq(SessionInboxTable.session_id, sessionID), scope === "input" ? or(eq(SessionInboxTable.delivery, "steer"), eq(SessionInboxTable.delivery, "queue")) : eq(SessionInboxTable.delivery, scope))).limit(1).get().pipe(Effect.orDie);
286
- return row !== undefined;
287
- });
288
- var publishMutation = (input, effect) => serialized(input.sessionID, effect).pipe(Effect.asVoid, Effect.catchDefect((defect) => defect instanceof LifecycleConflict ? Effect.fail(defect) : Effect.die(defect)));
289
- var publish = Effect.fn("SessionInbox.publish")(function* (db, bus, sessionID, rows) {
290
- yield* Effect.forEach(rows, (row) => {
291
- const entry = fromRow(row);
292
- if (entry.type === "compaction")
293
- return Effect.die(new LifecycleConflict({ id: entry.id }));
294
- return bus.publish(SessionEvent.InboxDelivered, {
295
- sessionID,
296
- inboxID: entry.id
297
- }).pipe(Effect.catchDefect((defect) => defect instanceof LifecycleConflict ? promotedFromMessage(db, sessionID, entry.id, entry.delivery).pipe(Effect.flatMap((stored) => stored !== undefined ? Effect.void : Effect.die(defect)), Effect.orDie) : Effect.die(defect)));
298
- }, { discard: true });
299
- return rows.length;
300
- });
301
- var promote = Effect.fn("SessionInbox.promote")(function* (db, bus, sessionID, scope) {
302
- return yield* serialized(sessionID, Effect.gen(function* () {
303
- const steers = yield* pendingSteers(db, sessionID);
304
- if (steers.length > 0 || scope === "steer") {
305
- const control2 = steers.findIndex((row) => row.type === "compaction" || row.type === "move");
306
- return yield* publish(db, bus, sessionID, control2 === -1 ? steers : steers.slice(0, control2));
307
- }
308
- const queued = yield* db.select().from(SessionInboxTable).where(and(eq(SessionInboxTable.session_id, sessionID), eq(SessionInboxTable.delivery, "queue"))).orderBy(asc(SessionInboxTable.enqueued_seq)).limit(1).get().pipe(Effect.orDie);
309
- if (!queued)
310
- return 0;
311
- const promoted = yield* publish(db, bus, sessionID, [queued]);
312
- const arrivedSteers = yield* pendingSteers(db, sessionID);
313
- const control = arrivedSteers.findIndex((row) => row.type === "compaction" || row.type === "move");
314
- return promoted + (yield* publish(db, bus, sessionID, control === -1 ? arrivedSteers : arrivedSteers.slice(0, control)));
315
- }));
316
- });
317
- var pendingSteers = (db, sessionID) => db.select().from(SessionInboxTable).where(and(eq(SessionInboxTable.session_id, sessionID), eq(SessionInboxTable.delivery, "steer"))).orderBy(asc(SessionInboxTable.enqueued_seq)).all().pipe(Effect.orDie);
318
-
319
- export { Compaction, CompactionPayload, Delivery, Info, Item, Move, MovePayload, Synthetic, SyntheticPayload, User, UserPayload, serialized, LifecycleConflict, find, Service, make, layer, node, projectAdmitted, projectDelivered, projectCancelled, projectDeliveryChanged, list, moveIDs, nextPromotable, has, promote, exports_inbox };