@opencode-ai/core 0.0.0-next-17317 → 0.0.0-next-17328

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 (306) hide show
  1. package/dist/agent.js +62 -62
  2. package/dist/bus.js +61 -61
  3. package/dist/catalog.js +65 -65
  4. package/dist/chunks/{app-jwc5yzxk.js → app-01echgjr.js} +6 -6
  5. package/dist/chunks/{app-b0esv13c.js → app-0vzba0gm.js} +2 -2
  6. package/dist/chunks/{app-9792gxzb.js → app-0z6xx7zx.js} +7 -7
  7. package/dist/chunks/{app-pa35b7j9.js → app-1364tz6z.js} +2 -2
  8. package/dist/chunks/{app-y4sxnhrw.js → app-13yera2y.js} +3 -3
  9. package/dist/chunks/{app-fx310v2s.js → app-1cea3yry.js} +4 -4
  10. package/dist/chunks/{app-jgbztvxz.js → app-24v9ajp8.js} +3 -3
  11. package/dist/chunks/{app-bn5ne79h.js → app-26999k0b.js} +82 -82
  12. package/dist/chunks/{app-zsy6j3xa.js → app-2h1dkq1t.js} +1 -1
  13. package/dist/chunks/{app-n6399r2z.js → app-2h381z6b.js} +1 -1
  14. package/dist/chunks/{app-zyrxys6y.js → app-2y72zxjd.js} +3 -3
  15. package/dist/chunks/{app-d8bbt2d1.js → app-35e39x37.js} +37 -37
  16. package/dist/chunks/{app-0yvmerbg.js → app-392zf20k.js} +3 -3
  17. package/dist/chunks/{app-j5g5m7ca.js → app-3df98tqf.js} +1 -1
  18. package/dist/chunks/{app-8ssvbmmf.js → app-3r3vrded.js} +7 -7
  19. package/dist/chunks/{app-0ph8kwa3.js → app-41j8x3fm.js} +3 -3
  20. package/dist/chunks/{app-eekpctba.js → app-4nn50sst.js} +8 -8
  21. package/dist/chunks/{app-wnn5g1xh.js → app-56r6c3dd.js} +2 -2
  22. package/dist/chunks/{app-heq95ef9.js → app-5esawzg6.js} +3 -3
  23. package/dist/chunks/{app-7czsgg7v.js → app-5pmgdqd5.js} +27 -27
  24. package/dist/chunks/{app-k6bbft4t.js → app-5vzbthr7.js} +3 -3
  25. package/dist/chunks/{app-bqbwc6q4.js → app-60drdhr5.js} +1 -1
  26. package/dist/chunks/{app-5fvy871a.js → app-6628r0j2.js} +1 -1
  27. package/dist/chunks/{app-3q0vncgj.js → app-6gadrcwp.js} +1 -1
  28. package/dist/chunks/{app-5tcqctjx.js → app-6hvc4gz7.js} +9 -9
  29. package/dist/chunks/{app-7899jtpg.js → app-6sbf1ars.js} +23 -23
  30. package/dist/chunks/{app-agn74pqn.js → app-6v1k7g0j.js} +4 -4
  31. package/dist/chunks/{app-cjh9716r.js → app-6yt95ytx.js} +2 -2
  32. package/dist/chunks/{app-a3kqxh9n.js → app-78ttb3tz.js} +1 -1
  33. package/dist/chunks/{app-mevft4d2.js → app-7f04kgcg.js} +1 -1
  34. package/dist/chunks/{app-34gtgtfn.js → app-7jjyp73s.js} +1 -1
  35. package/dist/chunks/{app-r3nzktek.js → app-7kx1x1kk.js} +21 -21
  36. package/dist/chunks/{app-9w6hy71j.js → app-7p9s1y4v.js} +1 -1
  37. package/dist/chunks/{app-ckssqp0a.js → app-808176hy.js} +6 -6
  38. package/dist/chunks/{app-rkn26eap.js → app-8av5zf6y.js} +2 -2
  39. package/dist/chunks/{app-5d8q6gnq.js → app-8ehgkt33.js} +1 -1
  40. package/dist/chunks/{app-m0nzfze3.js → app-93z9kmc0.js} +12 -12
  41. package/dist/chunks/{app-q8vzn7t4.js → app-99f53ew2.js} +8 -8
  42. package/dist/chunks/{app-66pzqqqb.js → app-9bx25zy3.js} +8 -8
  43. package/dist/chunks/{app-h4rc9vem.js → app-9emgh4v7.js} +4 -4
  44. package/dist/chunks/{app-824bzxpq.js → app-9hmmj0zq.js} +1 -1
  45. package/dist/chunks/{app-qdkdga7m.js → app-9paxs712.js} +58 -58
  46. package/dist/chunks/{app-d0s9tzcb.js → app-9v6v37j0.js} +8 -2
  47. package/dist/chunks/{app-2n9rqmbs.js → app-9wb2c5f7.js} +1 -1
  48. package/dist/chunks/{app-abghskf8.js → app-a86b6e0w.js} +1 -1
  49. package/dist/chunks/{app-h3qs1jxq.js → app-ac6hv4aq.js} +5 -5
  50. package/dist/chunks/{app-p1adbydn.js → app-amj8gya9.js} +6 -6
  51. package/dist/chunks/{app-821zwkre.js → app-as1gcxjf.js} +3 -3
  52. package/dist/chunks/{app-n8an51ay.js → app-b177m3gr.js} +1 -1
  53. package/dist/chunks/{app-w1c5n80y.js → app-b1mg4v3n.js} +5 -5
  54. package/dist/chunks/{app-66jss2y3.js → app-bf53s0aq.js} +1 -1
  55. package/dist/chunks/{app-qqyxzanw.js → app-bsc1fqct.js} +12 -12
  56. package/dist/chunks/{app-p2br4b3n.js → app-c0v961ga.js} +1 -1
  57. package/dist/chunks/{app-gfhy3xxc.js → app-crqzy6wa.js} +14 -14
  58. package/dist/chunks/{app-t51rfpp7.js → app-dhaac0g5.js} +1 -1
  59. package/dist/chunks/{app-j4a8y1v0.js → app-dr6tqxk6.js} +24 -24
  60. package/dist/chunks/{app-a9bmtk5v.js → app-dr8tx38x.js} +8 -8
  61. package/dist/chunks/{app-wv9c4455.js → app-dzwsz8t1.js} +11 -6
  62. package/dist/chunks/{app-a24q2n56.js → app-dzxnecs9.js} +10 -10
  63. package/dist/chunks/{app-rnxw5s75.js → app-ec4cg1te.js} +2 -2
  64. package/dist/chunks/{app-r1vj02j7.js → app-edzfe0za.js} +7 -7
  65. package/dist/chunks/{app-mqm7ppv4.js → app-eghp2syn.js} +4 -4
  66. package/dist/chunks/{app-ajp3rkge.js → app-erybna0f.js} +1 -1
  67. package/dist/chunks/{app-7a1epvt6.js → app-etdnpvpk.js} +3 -3
  68. package/dist/chunks/{app-map3fv87.js → app-f1w0zr5f.js} +1 -1
  69. package/dist/chunks/{app-xmy80gxd.js → app-f70b8x3c.js} +4 -4
  70. package/dist/chunks/{app-3gdpxg9w.js → app-fcpxqm81.js} +2 -2
  71. package/dist/chunks/{app-yqnhcm69.js → app-fnrs910x.js} +24 -20
  72. package/dist/chunks/{app-tyssacrn.js → app-fzz0qjd4.js} +2 -2
  73. package/dist/chunks/{app-n5mwvj6g.js → app-gnt4ypmb.js} +13 -5
  74. package/dist/chunks/{app-7emxxpdb.js → app-gphyg6y6.js} +1 -1
  75. package/dist/chunks/{app-cantjknx.js → app-h3pp1xs9.js} +4 -4
  76. package/dist/chunks/{app-5349rtah.js → app-h5dtgp6v.js} +8 -8
  77. package/dist/chunks/{app-tvagj5b1.js → app-h5qet3pm.js} +3 -3
  78. package/dist/chunks/{app-0ap8dsrs.js → app-h9py5h08.js} +1 -1
  79. package/dist/chunks/{app-rqmqsmfp.js → app-hg2g16e9.js} +4 -4
  80. package/dist/chunks/{app-6jwxj7fd.js → app-hqjrqb3s.js} +5 -5
  81. package/dist/chunks/{app-c6k8g8k7.js → app-j0jgvmwd.js} +2 -2
  82. package/dist/chunks/{app-08skwnb9.js → app-j2z0n2zx.js} +2 -2
  83. package/dist/chunks/{app-y1a9w4wq.js → app-jkb2hgbe.js} +1 -1
  84. package/dist/chunks/{app-3pech87g.js → app-kkybbrak.js} +7 -7
  85. package/dist/chunks/{app-s6mxj90h.js → app-kqm9j6gg.js} +7 -7
  86. package/dist/chunks/{app-trdaf16b.js → app-mdeh3t2b.js} +1 -1
  87. package/dist/chunks/{app-cnb0pc1j.js → app-p64kvp75.js} +1 -1
  88. package/dist/chunks/{app-zks6f588.js → app-pxaw7zq9.js} +3 -3
  89. package/dist/chunks/{app-tn7bcc13.js → app-q0y473a8.js} +4 -4
  90. package/dist/chunks/{app-3qdtmdys.js → app-qh3bphn0.js} +2 -2
  91. package/dist/chunks/{app-qyt1de9h.js → app-qpv5e849.js} +1 -1
  92. package/dist/chunks/{app-njv6rpr7.js → app-r0vzz6re.js} +4 -4
  93. package/dist/chunks/{app-41jac2rw.js → app-rj229tqd.js} +6 -6
  94. package/dist/chunks/{app-2r4vrveh.js → app-rqg1gxtn.js} +1 -1
  95. package/dist/chunks/{app-n4bfz6fb.js → app-s3hzaa3t.js} +7 -7
  96. package/dist/chunks/{app-kyqwgef4.js → app-s7k9hn6z.js} +1 -1
  97. package/dist/chunks/{app-88bv1cm4.js → app-sf0yme7w.js} +8 -8
  98. package/dist/chunks/{app-5gbqv329.js → app-t5wfj7d6.js} +2 -2
  99. package/dist/chunks/{app-mz2jedcq.js → app-t6b0094n.js} +2 -2
  100. package/dist/chunks/{app-0sbfjcmt.js → app-tsdzq66r.js} +3 -3
  101. package/dist/chunks/{app-r6h63zpd.js → app-v2c4n77r.js} +3 -3
  102. package/dist/chunks/{app-53xf519q.js → app-v7dtqnpx.js} +1 -1
  103. package/dist/chunks/{app-ps7cy9yh.js → app-vm2hwwwg.js} +6 -4
  104. package/dist/chunks/{app-zwxmc3bd.js → app-vmtjm3sp.js} +1 -1
  105. package/dist/chunks/{app-m3hyy9g8.js → app-w36c6x8p.js} +1 -1
  106. package/dist/chunks/{app-rckwcqa1.js → app-w463vzp4.js} +9 -9
  107. package/dist/chunks/{app-me4dyqfd.js → app-wanxk8gm.js} +2 -2
  108. package/dist/chunks/{app-pa78n45x.js → app-wdwm9p02.js} +8 -8
  109. package/dist/chunks/{app-f26x8jzg.js → app-wh1wkmqk.js} +8 -42
  110. package/dist/chunks/{app-j2zbpr2j.js → app-wq6p580q.js} +7 -7
  111. package/dist/chunks/{app-4b723tdv.js → app-wznh9f6x.js} +2 -2
  112. package/dist/chunks/{app-tvczbcs8.js → app-x4w66569.js} +4 -4
  113. package/dist/chunks/{app-dqvrt3mh.js → app-xbeqw4my.js} +6 -6
  114. package/dist/chunks/{app-fj3fqzqb.js → app-xq1vkeee.js} +3 -2
  115. package/dist/chunks/{app-sy2h18bq.js → app-xyn1e72r.js} +9 -6
  116. package/dist/chunks/{app-b9mh38wt.js → app-y41b8xx8.js} +7 -7
  117. package/dist/chunks/{app-y9gw0wvx.js → app-y7xcpxhe.js} +1 -1
  118. package/dist/chunks/{app-z28gthdp.js → app-ywrna6db.js} +2 -2
  119. package/dist/chunks/app-z8m8bq6m.js +116 -0
  120. package/dist/chunks/{app-z9rpahmp.js → app-zabzm6th.js} +1 -1
  121. package/dist/chunks/{app-gq675gkp.js → app-zcqpztye.js} +1 -1
  122. package/dist/chunks/{app-jsh3djw6.js → app-znwhcbw6.js} +109 -109
  123. package/dist/chunks/{app-dm7mk5x3.js → app-zvcp9kgf.js} +2 -2
  124. package/dist/chunks/{app-fq764adj.js → app-zvhrgghn.js} +9 -9
  125. package/dist/command.js +97 -88
  126. package/dist/config/normalize.js +11 -11
  127. package/dist/config/plugin/agent.js +93 -93
  128. package/dist/config/plugin/command.js +98 -89
  129. package/dist/config/plugin/instruction.js +65 -65
  130. package/dist/config/plugin/policy.js +81 -81
  131. package/dist/config/plugin/provider.js +81 -81
  132. package/dist/config/plugin/reference.js +83 -83
  133. package/dist/config/plugin/skill-file.js +75 -75
  134. package/dist/config/plugin/skill.js +96 -96
  135. package/dist/config/plugin/source.js +81 -81
  136. package/dist/config/plugin/websearch.js +81 -81
  137. package/dist/config.js +80 -80
  138. package/dist/credential.js +55 -55
  139. package/dist/database/database.js +56 -54
  140. package/dist/database/drizzle/effect-sqlite/driver.js +10 -10
  141. package/dist/database/drizzle/effect-sqlite/index.js +13 -11
  142. package/dist/database/drizzle/effect-sqlite/migrator.js +9 -9
  143. package/dist/database/drizzle/effect-sqlite/session.js +12 -10
  144. package/dist/database/drizzle/index.js +15 -13
  145. package/dist/database/drizzle/sqlite-core/effect/db.js +4 -4
  146. package/dist/database/drizzle/sqlite-core/effect/index.js +15 -15
  147. package/dist/database/drizzle/sqlite-core/effect/session.js +8 -8
  148. package/dist/database/drizzle.js +15 -13
  149. package/dist/database/migration.gen.js +33 -33
  150. package/dist/database/migration.js +35 -35
  151. package/dist/database/v1-migration.bun.js +61 -61
  152. package/dist/effect/app-node-builder.js +247 -246
  153. package/dist/environment/environment.js +63 -63
  154. package/dist/environment/index.js +65 -65
  155. package/dist/event-logger.js +61 -61
  156. package/dist/file-mutation.js +64 -64
  157. package/dist/filesystem/fff.workerd.js +22 -0
  158. package/dist/filesystem/location-watcher.js +81 -81
  159. package/dist/filesystem/search.js +66 -66
  160. package/dist/filesystem/watcher.js +2 -2
  161. package/dist/filesystem.js +66 -66
  162. package/dist/form.js +62 -62
  163. package/dist/formatter.js +82 -82
  164. package/dist/generate.js +68 -68
  165. package/dist/git.js +2 -2
  166. package/dist/github-copilot/chat/openai-compatible-chat-language-model.js +3 -3
  167. package/dist/github-copilot/copilot-provider.js +15 -15
  168. package/dist/github-copilot/responses/openai-responses-language-model.js +6 -6
  169. package/dist/github-copilot/responses/openai-responses-prepare-tools.js +2 -2
  170. package/dist/image/photon-wasm.workerd.js +7 -0
  171. package/dist/image/photon.js +87 -87
  172. package/dist/image.js +87 -87
  173. package/dist/instruction-discovery.js +62 -62
  174. package/dist/instructions/builtins.js +62 -62
  175. package/dist/integration.js +64 -64
  176. package/dist/kv.js +55 -55
  177. package/dist/location-mutation.js +61 -61
  178. package/dist/location-service-map.js +60 -60
  179. package/dist/location-services.js +247 -246
  180. package/dist/location.js +60 -60
  181. package/dist/mcp/client.js +85 -1
  182. package/dist/mcp/index.js +94 -85
  183. package/dist/mcp/instructions.js +115 -114
  184. package/dist/mcp/oauth.js +1 -1
  185. package/dist/mcp/stdio.js +92 -0
  186. package/dist/model-resolver.js +67 -67
  187. package/dist/models-dev.js +64 -64
  188. package/dist/permission/saved.js +60 -60
  189. package/dist/permission/sql.js +1 -1
  190. package/dist/permission.js +73 -73
  191. package/dist/plugin/agent.js +74 -74
  192. package/dist/plugin/command.js +61 -61
  193. package/dist/plugin/host.js +141 -140
  194. package/dist/plugin/internal.js +213 -212
  195. package/dist/plugin/models-dev.js +65 -65
  196. package/dist/plugin/plan.js +63 -63
  197. package/dist/plugin/promise.js +105 -105
  198. package/dist/plugin/provider/azure.js +85 -85
  199. package/dist/plugin/provider/cloudflare-ai-gateway.js +86 -86
  200. package/dist/plugin/provider/cloudflare-workers-ai.js +86 -86
  201. package/dist/plugin/provider/configured.js +84 -84
  202. package/dist/plugin/provider/github-copilot.js +68 -68
  203. package/dist/plugin/provider/llmgateway.js +65 -65
  204. package/dist/plugin/provider/openai.js +66 -66
  205. package/dist/plugin/provider/opencode.js +75 -75
  206. package/dist/plugin/provider/xai.js +66 -66
  207. package/dist/plugin/provider.js +112 -112
  208. package/dist/plugin/runtime.js +132 -131
  209. package/dist/plugin/sdk.js +62 -62
  210. package/dist/plugin/skill.js +95 -95
  211. package/dist/plugin/supervisor.js +217 -216
  212. package/dist/plugin/warming.js +81 -81
  213. package/dist/plugin/websearch/index.js +2 -2
  214. package/dist/plugin.js +142 -141
  215. package/dist/project/copy-strategies.js +62 -62
  216. package/dist/project/copy.js +62 -62
  217. package/dist/project/directories.js +56 -56
  218. package/dist/project/sql.js +1 -1
  219. package/dist/project.js +59 -59
  220. package/dist/pty/pty.workerd.js +9 -0
  221. package/dist/pty/ticket.js +56 -56
  222. package/dist/pty.js +82 -82
  223. package/dist/question.js +62 -62
  224. package/dist/reference/instructions.js +64 -64
  225. package/dist/reference.js +63 -63
  226. package/dist/repository-cache.js +3 -3
  227. package/dist/ripgrep.js +65 -65
  228. package/dist/session/compaction.js +107 -107
  229. package/dist/session/context.js +225 -224
  230. package/dist/session/execution/restart.js +85 -85
  231. package/dist/session/execution.js +85 -85
  232. package/dist/session/generate-node.js +228 -227
  233. package/dist/session/history.js +59 -59
  234. package/dist/session/info.js +65 -65
  235. package/dist/session/instruction-entry.js +57 -57
  236. package/dist/session/instruction-state.js +4 -4
  237. package/dist/session/instructions.js +71 -71
  238. package/dist/session/model-request.js +229 -228
  239. package/dist/session/pending.js +63 -63
  240. package/dist/session/projector.js +69 -69
  241. package/dist/session/revert.js +83 -83
  242. package/dist/session/runner/index.js +69 -69
  243. package/dist/session/runner/llm.js +235 -234
  244. package/dist/session/runner/model.js +69 -69
  245. package/dist/session/runner/retry.js +61 -61
  246. package/dist/session/sql.js +1 -1
  247. package/dist/session/store.js +70 -70
  248. package/dist/session/title.js +82 -82
  249. package/dist/session/to-session-error.js +84 -84
  250. package/dist/session/transfer.js +135 -134
  251. package/dist/session.js +131 -130
  252. package/dist/shell/parser-wasm.workerd.js +7 -0
  253. package/dist/shell.js +86 -86
  254. package/dist/skill/instructions.js +75 -75
  255. package/dist/skill.js +74 -74
  256. package/dist/snapshot.js +81 -81
  257. package/dist/tool/mcp.js +114 -113
  258. package/dist/tool/plugin/edit.js +103 -103
  259. package/dist/tool/plugin/glob.js +84 -84
  260. package/dist/tool/plugin/grep.js +84 -84
  261. package/dist/tool/plugin/patch.js +102 -102
  262. package/dist/tool/plugin/question.js +76 -76
  263. package/dist/tool/plugin/read.js +87 -87
  264. package/dist/tool/plugin/shell.js +135 -134
  265. package/dist/tool/plugin/skill.js +75 -75
  266. package/dist/tool/plugin/subagent.js +133 -132
  267. package/dist/tool/plugin/webfetch.js +74 -74
  268. package/dist/tool/plugin/websearch.js +78 -78
  269. package/dist/tool/plugin/write.js +103 -103
  270. package/dist/tool/read-filesystem.js +68 -68
  271. package/dist/tool-output.js +81 -81
  272. package/dist/tool.js +105 -105
  273. package/dist/types/database/database.d.ts +2 -0
  274. package/dist/types/database/drizzle/effect-sqlite/session.d.ts +10 -0
  275. package/dist/types/filesystem/fff.workerd.d.ts +4 -0
  276. package/dist/types/image/photon-wasm.workerd.d.ts +2 -0
  277. package/dist/types/location-service-map.d.ts +2 -2
  278. package/dist/types/location-services.d.ts +1 -1
  279. package/dist/types/mcp/client.d.ts +7 -2
  280. package/dist/types/mcp/index.d.ts +4 -1
  281. package/dist/types/mcp/stdio.d.ts +29 -0
  282. package/dist/types/plugin/internal.d.ts +3 -3
  283. package/dist/types/plugin/supervisor.d.ts +1 -1
  284. package/dist/types/pty/pty.workerd.d.ts +3 -0
  285. package/dist/types/shell/parser-wasm.workerd.d.ts +5 -0
  286. package/dist/types/util/process-lock-ffi.workerd.d.ts +12 -0
  287. package/dist/util/process-lock-ffi.workerd.js +12 -0
  288. package/dist/v1/config/config.js +10 -10
  289. package/dist/v1/config/migrate.js +10 -10
  290. package/dist/vcs.js +62 -62
  291. package/dist/websearch.js +64 -64
  292. package/dist/wellknown/plugin.js +65 -65
  293. package/dist/wellknown.js +64 -64
  294. package/dist/workspace.js +56 -56
  295. package/package.json +12 -7
  296. package/dist/chunks/{app-n7rn4zj5.js → app-0zebsc4z.js} +4 -4
  297. package/dist/chunks/{app-qw688rwx.js → app-a3xgesk5.js} +3 -3
  298. package/dist/chunks/{app-jjh23j6h.js → app-e9c17gqb.js} +11 -11
  299. package/dist/chunks/{app-bha9y19b.js → app-jr4jm25g.js} +3 -3
  300. package/dist/chunks/{app-zcyjs0t5.js → app-q2jhcyz2.js} +6 -6
  301. package/dist/chunks/{app-a9t6y3xq.js → app-rc9gdv79.js} +9 -9
  302. package/dist/chunks/{app-dqpmx9gf.js → app-s8g8nvd5.js} +3 -3
  303. package/dist/chunks/{app-m0j7p73q.js → app-t7614rkt.js} +3 -3
  304. package/dist/chunks/{app-5jw8v224.js → app-x3wede3v.js} +75 -75
  305. package/dist/chunks/{app-k80rxen0.js → app-xmj4ampr.js} +21 -21
  306. package/dist/chunks/{app-kcwh27nh.js → app-z66vzcey.js} +3 -3
@@ -1,42 +1,42 @@
1
1
  import {
2
2
  exports_usage
3
3
  } from "./app-8ywqk2j9.js";
4
- import {
5
- exports_model_headers
6
- } from "./app-1xksxgzs.js";
7
4
  import {
8
5
  exports_model_http
9
6
  } from "./app-93qdgxxd.js";
7
+ import {
8
+ exports_model_headers
9
+ } from "./app-1xksxgzs.js";
10
10
  import {
11
11
  llmClient
12
12
  } from "./app-m01ryvbe.js";
13
13
  import {
14
14
  exports_model
15
- } from "./app-tn7bcc13.js";
15
+ } from "./app-q0y473a8.js";
16
16
  import {
17
17
  exports_hooks
18
18
  } from "./app-t2j2ttmx.js";
19
19
  import {
20
20
  exports_store
21
- } from "./app-b9mh38wt.js";
21
+ } from "./app-y41b8xx8.js";
22
22
  import {
23
23
  exports_history
24
- } from "./app-r1vj02j7.js";
24
+ } from "./app-edzfe0za.js";
25
25
  import {
26
26
  SessionEvent
27
27
  } from "./app-a83yvq99.js";
28
28
  import {
29
29
  exports_agent
30
- } from "./app-a3kqxh9n.js";
30
+ } from "./app-78ttb3tz.js";
31
31
  import {
32
32
  exports_app
33
33
  } from "./app-50jxp3hw.js";
34
34
  import {
35
35
  exports_bus
36
- } from "./app-dm7mk5x3.js";
36
+ } from "./app-zvcp9kgf.js";
37
37
  import {
38
38
  exports_database
39
- } from "./app-n5mwvj6g.js";
39
+ } from "./app-gnt4ypmb.js";
40
40
  import {
41
41
  __export
42
42
  } from "./app-rvfvac9x.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  exports_catalog
3
- } from "./app-08skwnb9.js";
3
+ } from "./app-j2z0n2zx.js";
4
4
  import {
5
5
  exports_config
6
- } from "./app-66pzqqqb.js";
6
+ } from "./app-9bx25zy3.js";
7
7
  import {
8
8
  exports_provider
9
9
  } from "./app-d6vvk673.js";
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  exports_location_mutation
3
- } from "./app-wnn5g1xh.js";
3
+ } from "./app-56r6c3dd.js";
4
4
  import {
5
5
  exports_filesystem
6
- } from "./app-mz2jedcq.js";
7
- import {
8
- exports_permission
9
- } from "./app-a9bmtk5v.js";
6
+ } from "./app-t6b0094n.js";
10
7
  import {
11
8
  exports_ripgrep
12
- } from "./app-t51rfpp7.js";
9
+ } from "./app-dhaac0g5.js";
13
10
  import {
14
11
  exports_environment1 as exports_environment
15
- } from "./app-6jwxj7fd.js";
12
+ } from "./app-hqjrqb3s.js";
13
+ import {
14
+ exports_permission
15
+ } from "./app-dr8tx38x.js";
16
16
  import {
17
17
  exports_location
18
- } from "./app-j5g5m7ca.js";
18
+ } from "./app-3df98tqf.js";
19
19
  import {
20
20
  RelativePath
21
21
  } from "./app-j07kk359.js";
@@ -1,3 +1,6 @@
1
+ import {
2
+ exports_stdio
3
+ } from "./app-z8m8bq6m.js";
1
4
  import {
2
5
  __export
3
6
  } from "./app-rvfvac9x.js";
@@ -11,10 +14,8 @@ __export(exports_client, {
11
14
  ConnectError: () => ConnectError
12
15
  });
13
16
  import path from "node:path";
14
- import { execFile } from "node:child_process";
15
17
  import { pathToFileURL } from "node:url";
16
18
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
17
- import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
18
19
  import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
19
20
  import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js";
20
21
  import {
@@ -60,13 +61,12 @@ var connect = Effect.fnUntraced(function* (server, config, directory, authProvid
60
61
  const transport = yield* Effect.gen(function* () {
61
62
  if (config.type === "local") {
62
63
  const [command, ...args] = config.command;
63
- return new StdioClientTransport({
64
+ return yield* exports_stdio.make({
65
+ server,
64
66
  command,
65
67
  args,
66
68
  cwd: config.cwd ? path.resolve(directory, config.cwd) : directory,
67
- stderr: "pipe",
68
- env: {
69
- ...process.env,
69
+ environment: {
70
70
  ...command === "opencode" ? { BUN_BE_BUN: "1" } : {},
71
71
  ...config.environment
72
72
  }
@@ -95,7 +95,7 @@ var connect = Effect.fnUntraced(function* (server, config, directory, authProvid
95
95
  catch: (error2) => error2
96
96
  }).pipe(Effect.exit);
97
97
  if (Exit.isSuccess(exit)) {
98
- yield* Effect.addFinalizer(() => cleanupStdioDescendants(transport).pipe(Effect.andThen(Effect.promise(() => client.close())), Effect.ignore));
98
+ yield* Effect.addFinalizer(() => Effect.promise(() => client.close()).pipe(Effect.ignore));
99
99
  const catalogTimeout = config.timeout?.catalog ?? DEFAULT_CATALOG_TIMEOUT;
100
100
  const executionTimeout = config.timeout?.execution ?? DEFAULT_EXECUTION_TIMEOUT;
101
101
  return {
@@ -241,46 +241,12 @@ var connect = Effect.fnUntraced(function* (server, config, directory, authProvid
241
241
  }
242
242
  };
243
243
  }
244
- yield* cleanupStdioDescendants(transport).pipe(Effect.andThen(Effect.promise(() => transport.close())), Effect.ignore);
244
+ yield* Effect.promise(() => transport.close()).pipe(Effect.ignore);
245
245
  const error = Cause.squash(exit.cause);
246
246
  if (error instanceof UnauthorizedError)
247
247
  return yield* new NeedsAuthError({ server });
248
248
  return yield* new ConnectError({ server, message: error instanceof Error ? error.message : String(error) });
249
249
  });
250
- var cleanupStdioDescendants = (transport) => Effect.gen(function* () {
251
- if (!(transport instanceof StdioClientTransport))
252
- return;
253
- const pid = transport.pid;
254
- if (typeof pid !== "number")
255
- return;
256
- yield* Effect.forEach(yield* descendantPids(pid), (pid2) => Effect.try({
257
- try: () => process.kill(pid2, "SIGTERM"),
258
- catch: () => {
259
- return;
260
- }
261
- }).pipe(Effect.ignore), { discard: true });
262
- });
263
- var descendantPids = Effect.fnUntraced(function* (root) {
264
- if (process.platform === "win32")
265
- return [];
266
- const result = [];
267
- const queue = [root];
268
- for (let index = 0;index < queue.length; index++) {
269
- const parent = queue[index];
270
- if (parent === undefined)
271
- return result;
272
- const children = (yield* childPids(parent)).filter((pid) => !result.includes(pid));
273
- result.push(...children);
274
- queue.push(...children);
275
- }
276
- return result;
277
- });
278
- var childPids = (pid) => Effect.promise(() => new Promise((resolve) => {
279
- execFile("pgrep", ["-P", String(pid)], { encoding: "utf8" }, (_error, stdout) => {
280
- resolve(stdout.split(`
281
- `).map((line) => Number.parseInt(line, 10)).filter((pid2) => Number.isInteger(pid2)));
282
- });
283
- }));
284
250
  async function paginate(list, items) {
285
251
  const collected = [];
286
252
  const seen = new Set;
@@ -1,21 +1,21 @@
1
+ import {
2
+ exports_skill_file
3
+ } from "./app-9hmmj0zq.js";
1
4
  import {
2
5
  exports_discovery
3
6
  } from "./app-a65h300v.js";
4
- import {
5
- exports_skill_file
6
- } from "./app-824bzxpq.js";
7
7
  import {
8
8
  exports_skill
9
- } from "./app-5gbqv329.js";
9
+ } from "./app-t5wfj7d6.js";
10
10
  import {
11
11
  exports_config
12
- } from "./app-66pzqqqb.js";
12
+ } from "./app-9bx25zy3.js";
13
13
  import {
14
14
  exports_watcher
15
- } from "./app-qw688rwx.js";
15
+ } from "./app-a3xgesk5.js";
16
16
  import {
17
17
  exports_location
18
- } from "./app-j5g5m7ca.js";
18
+ } from "./app-3df98tqf.js";
19
19
  import {
20
20
  AbsolutePath
21
21
  } from "./app-j07kk359.js";
@@ -6,10 +6,10 @@ import {
6
6
  } from "./app-ph1me6ah.js";
7
7
  import {
8
8
  exports_bus
9
- } from "./app-dm7mk5x3.js";
9
+ } from "./app-zvcp9kgf.js";
10
10
  import {
11
11
  exports_location
12
- } from "./app-j5g5m7ca.js";
12
+ } from "./app-3df98tqf.js";
13
13
  import {
14
14
  __export
15
15
  } from "./app-rvfvac9x.js";
@@ -1,12 +1,12 @@
1
- import {
2
- exports_filesystem
3
- } from "./app-mz2jedcq.js";
4
1
  import {
5
2
  exports_mime
6
3
  } from "./app-dhphtf1x.js";
4
+ import {
5
+ exports_filesystem
6
+ } from "./app-t6b0094n.js";
7
7
  import {
8
8
  exports_environment1 as exports_environment
9
- } from "./app-6jwxj7fd.js";
9
+ } from "./app-hqjrqb3s.js";
10
10
  import {
11
11
  NonNegativeInt,
12
12
  PositiveInt,
@@ -3,25 +3,25 @@ import {
3
3
  } from "./app-df3v2q6j.js";
4
4
  import {
5
5
  exports_bus
6
- } from "./app-dm7mk5x3.js";
6
+ } from "./app-zvcp9kgf.js";
7
7
  import {
8
8
  exports_location
9
- } from "./app-j5g5m7ca.js";
9
+ } from "./app-3df98tqf.js";
10
10
  import {
11
11
  exports_project
12
- } from "./app-y4sxnhrw.js";
12
+ } from "./app-13yera2y.js";
13
13
  import {
14
14
  exports_directories
15
- } from "./app-mevft4d2.js";
15
+ } from "./app-7f04kgcg.js";
16
16
  import {
17
17
  exports_git
18
- } from "./app-kcwh27nh.js";
18
+ } from "./app-z66vzcey.js";
19
19
  import {
20
20
  AbsolutePath
21
21
  } from "./app-j07kk359.js";
22
22
  import {
23
23
  exports_database
24
- } from "./app-n5mwvj6g.js";
24
+ } from "./app-gnt4ypmb.js";
25
25
  import {
26
26
  __export
27
27
  } from "./app-rvfvac9x.js";
@@ -2,7 +2,8 @@ import {
2
2
  exports_page
3
3
  } from "./app-7mrpdsq5.js";
4
4
  import {
5
- __export
5
+ __export,
6
+ __require
6
7
  } from "./app-rvfvac9x.js";
7
8
 
8
9
  // src/mcp/oauth.ts
@@ -17,7 +18,6 @@ __export(exports_oauth, {
17
18
  MCPOAuth: () => exports_oauth
18
19
  });
19
20
  import { auth } from "@modelcontextprotocol/sdk/client/auth.js";
20
- import { createServer } from "node:http";
21
21
  import { Deferred, Effect } from "effect";
22
22
  import { Credential } from "@opencode-ai/schema/credential";
23
23
  var provider = (options) => {
@@ -99,6 +99,7 @@ var authorize = (input) => Effect.gen(function* () {
99
99
  const code = yield* Deferred.make();
100
100
  const redirectPath = oauth?.redirect_uri ? new URL(oauth.redirect_uri).pathname : "/callback";
101
101
  const state = Buffer.from(crypto.getRandomValues(new Uint8Array(32))).toString("base64url");
102
+ const { createServer } = yield* Effect.promise(() => import("node:http"));
102
103
  const server = createServer((request, response) => {
103
104
  const url = new URL(request.url ?? "/", "http://127.0.0.1");
104
105
  if (url.pathname !== redirectPath) {
@@ -3,22 +3,24 @@ import {
3
3
  } from "./app-7mrpdsq5.js";
4
4
  import {
5
5
  exports_integration
6
- } from "./app-tvagj5b1.js";
6
+ } from "./app-h5qet3pm.js";
7
+ import {
8
+ exports_credential
9
+ } from "./app-7p9s1y4v.js";
7
10
  import {
8
11
  exports_app
9
12
  } from "./app-50jxp3hw.js";
10
- import {
11
- exports_credential
12
- } from "./app-9w6hy71j.js";
13
13
  import {
14
14
  exports_provider
15
15
  } from "./app-d6vvk673.js";
16
16
  import {
17
17
  exports_bus
18
- } from "./app-dm7mk5x3.js";
18
+ } from "./app-zvcp9kgf.js";
19
+ import {
20
+ __require
21
+ } from "./app-rvfvac9x.js";
19
22
 
20
23
  // src/plugin/provider/openai.ts
21
- import { createServer } from "node:http";
22
24
  import { define } from "@opencode-ai/plugin/effect/plugin";
23
25
  import { Deferred, Effect, Option, Schema, Semaphore, Stream } from "effect";
24
26
  var clientID = "app_EMoamEEZ73f0CkXaXp7hrann";
@@ -48,6 +50,7 @@ var browser = (app) => ({
48
50
  const state = base64UrlEncode(crypto.getRandomValues(new Uint8Array(32)).buffer);
49
51
  const code = yield* Deferred.make();
50
52
  const redirect = `http://localhost:${callbackPort}/auth/callback`;
53
+ const { createServer } = yield* Effect.promise(() => import("node:http"));
51
54
  const server = createServer((request, response) => {
52
55
  const url = new URL(request.url ?? "/", `http://localhost:${callbackPort}`);
53
56
  if (url.pathname !== "/auth/callback") {
@@ -1,19 +1,19 @@
1
+ import {
2
+ fromRow
3
+ } from "./app-01echgjr.js";
1
4
  import {
2
5
  exports_history
3
- } from "./app-r1vj02j7.js";
6
+ } from "./app-edzfe0za.js";
4
7
  import {
5
- fromRow
6
- } from "./app-jwc5yzxk.js";
8
+ exports_message
9
+ } from "./app-25pxtba7.js";
7
10
  import {
8
11
  SessionMessageTable,
9
12
  SessionTable
10
13
  } from "./app-zvvp2xr4.js";
11
- import {
12
- exports_message
13
- } from "./app-25pxtba7.js";
14
14
  import {
15
15
  exports_database
16
- } from "./app-n5mwvj6g.js";
16
+ } from "./app-gnt4ypmb.js";
17
17
  import {
18
18
  __export
19
19
  } from "./app-rvfvac9x.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./app-q4r4pzs4.js";
4
4
  import {
5
5
  exports_location
6
- } from "./app-j5g5m7ca.js";
6
+ } from "./app-3df98tqf.js";
7
7
  import {
8
8
  __export
9
9
  } from "./app-rvfvac9x.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  exports_permission
3
- } from "./app-a9bmtk5v.js";
3
+ } from "./app-dr8tx38x.js";
4
4
  import {
5
5
  exports_agent
6
- } from "./app-a3kqxh9n.js";
6
+ } from "./app-78ttb3tz.js";
7
7
  import {
8
8
  __export
9
9
  } from "./app-rvfvac9x.js";
@@ -0,0 +1,116 @@
1
+ import {
2
+ exports_environment1 as exports_environment
3
+ } from "./app-hqjrqb3s.js";
4
+ import {
5
+ __export
6
+ } from "./app-rvfvac9x.js";
7
+
8
+ // src/mcp/stdio.ts
9
+ var exports_stdio = {};
10
+ __export(exports_stdio, {
11
+ make: () => make,
12
+ MCPStdio: () => exports_stdio
13
+ });
14
+ import { ReadBuffer, serializeMessage } from "@modelcontextprotocol/sdk/shared/stdio.js";
15
+ import { Cause, Duration, Effect, Queue, Scope, Stream } from "effect";
16
+ import { ChildProcess } from "effect/unstable/process";
17
+ var CLOSE_GRACE = Duration.seconds(2);
18
+ var FORCE_KILL_AFTER = Duration.seconds(2);
19
+ var OUTGOING_CAPACITY = 64;
20
+ var MAX_FRAME_BYTES = 16 * 1024 * 1024;
21
+ var make = Effect.fnUntraced(function* (options) {
22
+ const environment = yield* exports_environment.Service;
23
+ const scope = yield* Effect.scope;
24
+ const outgoing = yield* Queue.bounded(OUTGOING_CAPACITY);
25
+ const buffer = new ReadBuffer;
26
+ const state = { phase: "ready" };
27
+ let startup;
28
+ let closing;
29
+ let trailingBytes = 0;
30
+ const stop = (handle) => Effect.gen(function* () {
31
+ const exit = yield* Effect.timeoutOption(handle.exitCode, CLOSE_GRACE);
32
+ if (exit._tag === "Some")
33
+ return;
34
+ const terminated = yield* Effect.timeoutOption(handle.kill({ killSignal: "SIGTERM" }), FORCE_KILL_AFTER);
35
+ if (terminated._tag === "None")
36
+ yield* handle.kill({ killSignal: "SIGKILL" });
37
+ }).pipe(Effect.ignore);
38
+ const close = () => closing ??= Effect.runPromise(Effect.gen(function* () {
39
+ state.phase = "closed";
40
+ Queue.endUnsafe(outgoing);
41
+ if (startup)
42
+ yield* Effect.promise(() => startup.catch(() => {
43
+ return;
44
+ }));
45
+ const handle = state.handle;
46
+ if (!handle)
47
+ return;
48
+ state.handle = undefined;
49
+ yield* stop(handle);
50
+ }).pipe(Effect.ensuring(Queue.shutdown(outgoing)), Effect.ensuring(Effect.sync(() => buffer.clear()))));
51
+ const transport = {
52
+ start: () => {
53
+ if (state.phase !== "ready")
54
+ return Promise.reject(new Error("Stdio transport already started"));
55
+ state.phase = "starting";
56
+ startup = Effect.runPromise(Effect.gen(function* () {
57
+ const handle = yield* environment.spawner.spawn(ChildProcess.make(options.command, [...options.args], {
58
+ cwd: options.cwd,
59
+ env: options.environment,
60
+ extendEnv: true,
61
+ stdin: { stream: Stream.encodeText(Stream.fromQueue(outgoing)), endOnDone: true },
62
+ stdout: "pipe",
63
+ stderr: "pipe",
64
+ forceKillAfter: FORCE_KILL_AFTER
65
+ }));
66
+ state.handle = handle;
67
+ if (state.phase === "closed") {
68
+ state.handle = undefined;
69
+ return yield* stop(handle);
70
+ }
71
+ state.phase = "open";
72
+ yield* startOutput(handle);
73
+ }).pipe(Scope.provide(scope)));
74
+ return startup;
75
+ },
76
+ send: (message) => state.phase !== "open" ? Promise.reject(new Error("Not connected")) : Effect.runPromise(Queue.offer(outgoing, serializeMessage(message)).pipe(Effect.flatMap((offered) => offered ? Effect.void : Effect.fail(new Error("Not connected"))))),
77
+ close
78
+ };
79
+ const deliver = (chunk) => Effect.gen(function* () {
80
+ for (const byte of chunk) {
81
+ trailingBytes = byte === 10 ? 0 : trailingBytes + 1;
82
+ if (trailingBytes > MAX_FRAME_BYTES)
83
+ return yield* Effect.fail(new Error("MCP stdio frame exceeded 16 MiB"));
84
+ }
85
+ buffer.append(Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength));
86
+ while (true) {
87
+ const message = yield* Effect.try({
88
+ try: () => buffer.readMessage(),
89
+ catch: (cause) => cause instanceof Error ? cause : new Error(String(cause))
90
+ }).pipe(Effect.catch((error) => Effect.sync(() => {
91
+ transport.onerror?.(error);
92
+ return;
93
+ })));
94
+ if (message === undefined)
95
+ continue;
96
+ if (message === null)
97
+ return;
98
+ transport.onmessage?.(message);
99
+ }
100
+ });
101
+ const startOutput = (handle) => Effect.gen(function* () {
102
+ yield* Effect.forkScoped(Stream.runForEach(handle.stdout, deliver).pipe(Effect.tapCause((cause) => Effect.sync(() => {
103
+ const error = Cause.squash(cause);
104
+ transport.onerror?.(error instanceof Error ? error : new Error(String(error)));
105
+ })), Effect.ignore, Effect.ensuring(Effect.gen(function* () {
106
+ const unexpected = state.phase !== "closed";
107
+ if (unexpected)
108
+ yield* Effect.promise(close);
109
+ transport.onclose?.();
110
+ }))));
111
+ yield* Effect.forkScoped(handle.stderr.pipe(Stream.decodeText(), Stream.runForEach((output) => output.trim() === "" ? Effect.void : Effect.logDebug("mcp server stderr", { server: options.server, output })), Effect.ignore));
112
+ });
113
+ return transport;
114
+ });
115
+
116
+ export { make, exports_stdio };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  migrations
3
- } from "./app-5jw8v224.js";
3
+ } from "./app-x3wede3v.js";
4
4
  import {
5
5
  schema_gen_default
6
6
  } from "./app-hy0hzg1s.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  exports_reference
3
- } from "./app-3qdtmdys.js";
3
+ } from "./app-qh3bphn0.js";
4
4
  import {
5
5
  exports_instructions
6
6
  } from "./app-q4r4pzs4.js";