alchemylab-opencode 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/package.json +2 -15
  2. package/build.mjs +0 -192
  3. package/packages/opencode/package.json +0 -138
  4. package/packages/opencode/src/account/account.sql.ts +0 -39
  5. package/packages/opencode/src/account/index.ts +0 -463
  6. package/packages/opencode/src/account/repo.ts +0 -163
  7. package/packages/opencode/src/account/schema.ts +0 -91
  8. package/packages/opencode/src/acp/README.md +0 -174
  9. package/packages/opencode/src/acp/agent.ts +0 -1847
  10. package/packages/opencode/src/acp/session.ts +0 -116
  11. package/packages/opencode/src/acp/types.ts +0 -24
  12. package/packages/opencode/src/agent/agent.ts +0 -420
  13. package/packages/opencode/src/agent/generate.txt +0 -75
  14. package/packages/opencode/src/agent/prompt/compaction.txt +0 -15
  15. package/packages/opencode/src/agent/prompt/explore.txt +0 -18
  16. package/packages/opencode/src/agent/prompt/summary.txt +0 -11
  17. package/packages/opencode/src/agent/prompt/title.txt +0 -44
  18. package/packages/opencode/src/auth/index.ts +0 -110
  19. package/packages/opencode/src/bus/bus-event.ts +0 -40
  20. package/packages/opencode/src/bus/global.ts +0 -10
  21. package/packages/opencode/src/bus/index.ts +0 -185
  22. package/packages/opencode/src/cli/bootstrap.ts +0 -17
  23. package/packages/opencode/src/cli/cmd/cmd.ts +0 -7
  24. package/packages/opencode/src/cli/cmd/run.ts +0 -689
  25. package/packages/opencode/src/cli/cmd/serve.ts +0 -24
  26. package/packages/opencode/src/cli/cmd/tui/event.ts +0 -49
  27. package/packages/opencode/src/cli/effect/prompt.ts +0 -25
  28. package/packages/opencode/src/cli/error.ts +0 -46
  29. package/packages/opencode/src/cli/heap.ts +0 -59
  30. package/packages/opencode/src/cli/logo.ts +0 -6
  31. package/packages/opencode/src/cli/network.ts +0 -60
  32. package/packages/opencode/src/cli/ui.ts +0 -133
  33. package/packages/opencode/src/cli/upgrade.ts +0 -31
  34. package/packages/opencode/src/command/index.ts +0 -195
  35. package/packages/opencode/src/command/template/initialize.txt +0 -66
  36. package/packages/opencode/src/command/template/review.txt +0 -101
  37. package/packages/opencode/src/config/config.ts +0 -1599
  38. package/packages/opencode/src/config/console-state.ts +0 -15
  39. package/packages/opencode/src/config/markdown.ts +0 -99
  40. package/packages/opencode/src/config/paths.ts +0 -167
  41. package/packages/opencode/src/config/tui-migrate.ts +0 -155
  42. package/packages/opencode/src/config/tui-schema.ts +0 -37
  43. package/packages/opencode/src/config/tui.ts +0 -179
  44. package/packages/opencode/src/control-plane/adaptors/index.ts +0 -20
  45. package/packages/opencode/src/control-plane/adaptors/worktree.ts +0 -42
  46. package/packages/opencode/src/control-plane/schema.ts +0 -17
  47. package/packages/opencode/src/control-plane/sse.ts +0 -66
  48. package/packages/opencode/src/control-plane/types.ts +0 -32
  49. package/packages/opencode/src/control-plane/workspace.sql.ts +0 -17
  50. package/packages/opencode/src/control-plane/workspace.ts +0 -168
  51. package/packages/opencode/src/effect/cross-spawn-spawner.ts +0 -502
  52. package/packages/opencode/src/effect/instance-ref.ts +0 -6
  53. package/packages/opencode/src/effect/instance-registry.ts +0 -12
  54. package/packages/opencode/src/effect/instance-state.ts +0 -82
  55. package/packages/opencode/src/effect/run-service.ts +0 -33
  56. package/packages/opencode/src/effect/runner.ts +0 -216
  57. package/packages/opencode/src/env/index.ts +0 -28
  58. package/packages/opencode/src/file/ignore.ts +0 -82
  59. package/packages/opencode/src/file/index.ts +0 -686
  60. package/packages/opencode/src/file/protected.ts +0 -59
  61. package/packages/opencode/src/file/ripgrep.ts +0 -376
  62. package/packages/opencode/src/file/time.ts +0 -133
  63. package/packages/opencode/src/file/watcher.ts +0 -173
  64. package/packages/opencode/src/filesystem/index.ts +0 -236
  65. package/packages/opencode/src/flag/flag.ts +0 -156
  66. package/packages/opencode/src/format/formatter.ts +0 -413
  67. package/packages/opencode/src/format/index.ts +0 -203
  68. package/packages/opencode/src/git/index.ts +0 -303
  69. package/packages/opencode/src/global/index.ts +0 -56
  70. package/packages/opencode/src/id/id.ts +0 -85
  71. package/packages/opencode/src/ide/index.ts +0 -74
  72. package/packages/opencode/src/installation/index.ts +0 -355
  73. package/packages/opencode/src/installation/meta.ts +0 -7
  74. package/packages/opencode/src/lsp/client.ts +0 -252
  75. package/packages/opencode/src/lsp/index.ts +0 -558
  76. package/packages/opencode/src/lsp/language.ts +0 -120
  77. package/packages/opencode/src/lsp/launch.ts +0 -21
  78. package/packages/opencode/src/lsp/server.ts +0 -1968
  79. package/packages/opencode/src/mcp/auth.ts +0 -173
  80. package/packages/opencode/src/mcp/index.ts +0 -931
  81. package/packages/opencode/src/mcp/oauth-callback.ts +0 -216
  82. package/packages/opencode/src/mcp/oauth-provider.ts +0 -185
  83. package/packages/opencode/src/node-loader.mjs +0 -104
  84. package/packages/opencode/src/node-preload.mjs +0 -39
  85. package/packages/opencode/src/node.ts +0 -1
  86. package/packages/opencode/src/npm/index.ts +0 -188
  87. package/packages/opencode/src/patch/index.ts +0 -680
  88. package/packages/opencode/src/permission/arity.ts +0 -163
  89. package/packages/opencode/src/permission/evaluate.ts +0 -15
  90. package/packages/opencode/src/permission/index.ts +0 -325
  91. package/packages/opencode/src/permission/schema.ts +0 -17
  92. package/packages/opencode/src/plugin/cloudflare.ts +0 -67
  93. package/packages/opencode/src/plugin/codex.ts +0 -608
  94. package/packages/opencode/src/plugin/github-copilot/copilot.ts +0 -361
  95. package/packages/opencode/src/plugin/github-copilot/models.ts +0 -144
  96. package/packages/opencode/src/plugin/index.ts +0 -299
  97. package/packages/opencode/src/plugin/install.ts +0 -439
  98. package/packages/opencode/src/plugin/loader.ts +0 -174
  99. package/packages/opencode/src/plugin/meta.ts +0 -188
  100. package/packages/opencode/src/plugin/shared.ts +0 -323
  101. package/packages/opencode/src/project/bootstrap.ts +0 -31
  102. package/packages/opencode/src/project/instance.ts +0 -175
  103. package/packages/opencode/src/project/project.sql.ts +0 -16
  104. package/packages/opencode/src/project/project.ts +0 -519
  105. package/packages/opencode/src/project/schema.ts +0 -16
  106. package/packages/opencode/src/project/state.ts +0 -70
  107. package/packages/opencode/src/project/vcs.ts +0 -240
  108. package/packages/opencode/src/provider/auth.ts +0 -253
  109. package/packages/opencode/src/provider/error.ts +0 -197
  110. package/packages/opencode/src/provider/models.ts +0 -162
  111. package/packages/opencode/src/provider/provider.ts +0 -1709
  112. package/packages/opencode/src/provider/schema.ts +0 -38
  113. package/packages/opencode/src/provider/sdk/copilot/README.md +0 -5
  114. package/packages/opencode/src/provider/sdk/copilot/chat/convert-to-openai-compatible-chat-messages.ts +0 -170
  115. package/packages/opencode/src/provider/sdk/copilot/chat/get-response-metadata.ts +0 -15
  116. package/packages/opencode/src/provider/sdk/copilot/chat/map-openai-compatible-finish-reason.ts +0 -19
  117. package/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-api-types.ts +0 -64
  118. package/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-chat-language-model.ts +0 -815
  119. package/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-chat-options.ts +0 -28
  120. package/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-metadata-extractor.ts +0 -44
  121. package/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-prepare-tools.ts +0 -83
  122. package/packages/opencode/src/provider/sdk/copilot/copilot-provider.ts +0 -100
  123. package/packages/opencode/src/provider/sdk/copilot/index.ts +0 -2
  124. package/packages/opencode/src/provider/sdk/copilot/openai-compatible-error.ts +0 -27
  125. package/packages/opencode/src/provider/sdk/copilot/responses/convert-to-openai-responses-input.ts +0 -335
  126. package/packages/opencode/src/provider/sdk/copilot/responses/map-openai-responses-finish-reason.ts +0 -22
  127. package/packages/opencode/src/provider/sdk/copilot/responses/openai-config.ts +0 -18
  128. package/packages/opencode/src/provider/sdk/copilot/responses/openai-error.ts +0 -22
  129. package/packages/opencode/src/provider/sdk/copilot/responses/openai-responses-api-types.ts +0 -214
  130. package/packages/opencode/src/provider/sdk/copilot/responses/openai-responses-language-model.ts +0 -1769
  131. package/packages/opencode/src/provider/sdk/copilot/responses/openai-responses-prepare-tools.ts +0 -173
  132. package/packages/opencode/src/provider/sdk/copilot/responses/openai-responses-settings.ts +0 -1
  133. package/packages/opencode/src/provider/sdk/copilot/responses/tool/code-interpreter.ts +0 -87
  134. package/packages/opencode/src/provider/sdk/copilot/responses/tool/file-search.ts +0 -127
  135. package/packages/opencode/src/provider/sdk/copilot/responses/tool/image-generation.ts +0 -114
  136. package/packages/opencode/src/provider/sdk/copilot/responses/tool/local-shell.ts +0 -64
  137. package/packages/opencode/src/provider/sdk/copilot/responses/tool/web-search-preview.ts +0 -103
  138. package/packages/opencode/src/provider/sdk/copilot/responses/tool/web-search.ts +0 -102
  139. package/packages/opencode/src/provider/transform.ts +0 -1050
  140. package/packages/opencode/src/pty/index.ts +0 -397
  141. package/packages/opencode/src/pty/pty.node.ts +0 -27
  142. package/packages/opencode/src/pty/pty.ts +0 -25
  143. package/packages/opencode/src/pty/schema.ts +0 -17
  144. package/packages/opencode/src/question/index.ts +0 -224
  145. package/packages/opencode/src/question/schema.ts +0 -17
  146. package/packages/opencode/src/run.ts +0 -28
  147. package/packages/opencode/src/serve.ts +0 -45
  148. package/packages/opencode/src/server/error.ts +0 -36
  149. package/packages/opencode/src/server/event.ts +0 -7
  150. package/packages/opencode/src/server/instance.ts +0 -324
  151. package/packages/opencode/src/server/mdns.ts +0 -60
  152. package/packages/opencode/src/server/middleware.ts +0 -33
  153. package/packages/opencode/src/server/projectors.ts +0 -28
  154. package/packages/opencode/src/server/proxy.ts +0 -131
  155. package/packages/opencode/src/server/router.ts +0 -105
  156. package/packages/opencode/src/server/routes/config.ts +0 -92
  157. package/packages/opencode/src/server/routes/event.ts +0 -83
  158. package/packages/opencode/src/server/routes/experimental.ts +0 -374
  159. package/packages/opencode/src/server/routes/file.ts +0 -197
  160. package/packages/opencode/src/server/routes/global.ts +0 -312
  161. package/packages/opencode/src/server/routes/mcp.ts +0 -225
  162. package/packages/opencode/src/server/routes/permission.ts +0 -69
  163. package/packages/opencode/src/server/routes/project.ts +0 -118
  164. package/packages/opencode/src/server/routes/provider.ts +0 -171
  165. package/packages/opencode/src/server/routes/pty.ts +0 -210
  166. package/packages/opencode/src/server/routes/question.ts +0 -99
  167. package/packages/opencode/src/server/routes/session.ts +0 -1030
  168. package/packages/opencode/src/server/routes/tui.ts +0 -379
  169. package/packages/opencode/src/server/routes/workspace.ts +0 -94
  170. package/packages/opencode/src/server/server.ts +0 -353
  171. package/packages/opencode/src/session/compaction.ts +0 -428
  172. package/packages/opencode/src/session/index.ts +0 -887
  173. package/packages/opencode/src/session/instruction.ts +0 -258
  174. package/packages/opencode/src/session/llm.ts +0 -354
  175. package/packages/opencode/src/session/message-v2.ts +0 -1031
  176. package/packages/opencode/src/session/message.ts +0 -191
  177. package/packages/opencode/src/session/overflow.ts +0 -22
  178. package/packages/opencode/src/session/processor.ts +0 -523
  179. package/packages/opencode/src/session/projectors.ts +0 -135
  180. package/packages/opencode/src/session/prompt/anthropic.txt +0 -105
  181. package/packages/opencode/src/session/prompt/beast.txt +0 -147
  182. package/packages/opencode/src/session/prompt/build-switch.txt +0 -5
  183. package/packages/opencode/src/session/prompt/codex.txt +0 -79
  184. package/packages/opencode/src/session/prompt/copilot-gpt-5.txt +0 -143
  185. package/packages/opencode/src/session/prompt/default.txt +0 -105
  186. package/packages/opencode/src/session/prompt/gemini.txt +0 -155
  187. package/packages/opencode/src/session/prompt/gpt.txt +0 -107
  188. package/packages/opencode/src/session/prompt/kimi.txt +0 -95
  189. package/packages/opencode/src/session/prompt/max-steps.txt +0 -16
  190. package/packages/opencode/src/session/prompt/plan-reminder-anthropic.txt +0 -67
  191. package/packages/opencode/src/session/prompt/plan.txt +0 -26
  192. package/packages/opencode/src/session/prompt/trinity.txt +0 -97
  193. package/packages/opencode/src/session/prompt.ts +0 -1911
  194. package/packages/opencode/src/session/retry.ts +0 -106
  195. package/packages/opencode/src/session/revert.ts +0 -176
  196. package/packages/opencode/src/session/schema.ts +0 -38
  197. package/packages/opencode/src/session/session.sql.ts +0 -103
  198. package/packages/opencode/src/session/status.ts +0 -102
  199. package/packages/opencode/src/session/summary.ts +0 -177
  200. package/packages/opencode/src/session/system.ts +0 -76
  201. package/packages/opencode/src/session/todo.ts +0 -95
  202. package/packages/opencode/src/share/share-next.ts +0 -369
  203. package/packages/opencode/src/share/share.sql.ts +0 -13
  204. package/packages/opencode/src/shell/shell.ts +0 -110
  205. package/packages/opencode/src/skill/discovery.ts +0 -116
  206. package/packages/opencode/src/skill/index.ts +0 -277
  207. package/packages/opencode/src/snapshot/index.ts +0 -726
  208. package/packages/opencode/src/sql.d.ts +0 -4
  209. package/packages/opencode/src/storage/db.node.ts +0 -8
  210. package/packages/opencode/src/storage/db.ts +0 -177
  211. package/packages/opencode/src/storage/json-migration.ts +0 -425
  212. package/packages/opencode/src/storage/schema.sql.ts +0 -10
  213. package/packages/opencode/src/storage/schema.ts +0 -5
  214. package/packages/opencode/src/storage/storage.ts +0 -353
  215. package/packages/opencode/src/sync/README.md +0 -179
  216. package/packages/opencode/src/sync/event.sql.ts +0 -16
  217. package/packages/opencode/src/sync/index.ts +0 -263
  218. package/packages/opencode/src/sync/schema.ts +0 -14
  219. package/packages/opencode/src/tool/apply_patch.ts +0 -281
  220. package/packages/opencode/src/tool/apply_patch.txt +0 -33
  221. package/packages/opencode/src/tool/bash.ts +0 -496
  222. package/packages/opencode/src/tool/bash.txt +0 -117
  223. package/packages/opencode/src/tool/batch.ts +0 -183
  224. package/packages/opencode/src/tool/batch.txt +0 -24
  225. package/packages/opencode/src/tool/codesearch.ts +0 -132
  226. package/packages/opencode/src/tool/codesearch.txt +0 -12
  227. package/packages/opencode/src/tool/edit.ts +0 -667
  228. package/packages/opencode/src/tool/edit.txt +0 -10
  229. package/packages/opencode/src/tool/external-directory.ts +0 -46
  230. package/packages/opencode/src/tool/glob.ts +0 -78
  231. package/packages/opencode/src/tool/glob.txt +0 -6
  232. package/packages/opencode/src/tool/grep.ts +0 -156
  233. package/packages/opencode/src/tool/grep.txt +0 -8
  234. package/packages/opencode/src/tool/invalid.ts +0 -17
  235. package/packages/opencode/src/tool/ls.ts +0 -121
  236. package/packages/opencode/src/tool/ls.txt +0 -1
  237. package/packages/opencode/src/tool/lsp.ts +0 -97
  238. package/packages/opencode/src/tool/lsp.txt +0 -19
  239. package/packages/opencode/src/tool/multiedit.ts +0 -46
  240. package/packages/opencode/src/tool/multiedit.txt +0 -41
  241. package/packages/opencode/src/tool/plan-enter.txt +0 -14
  242. package/packages/opencode/src/tool/plan-exit.txt +0 -13
  243. package/packages/opencode/src/tool/plan.ts +0 -131
  244. package/packages/opencode/src/tool/question.ts +0 -46
  245. package/packages/opencode/src/tool/question.txt +0 -10
  246. package/packages/opencode/src/tool/read.ts +0 -332
  247. package/packages/opencode/src/tool/read.txt +0 -14
  248. package/packages/opencode/src/tool/registry.ts +0 -265
  249. package/packages/opencode/src/tool/schema.ts +0 -17
  250. package/packages/opencode/src/tool/skill.ts +0 -105
  251. package/packages/opencode/src/tool/task.ts +0 -166
  252. package/packages/opencode/src/tool/task.txt +0 -60
  253. package/packages/opencode/src/tool/todo.ts +0 -48
  254. package/packages/opencode/src/tool/todowrite.txt +0 -167
  255. package/packages/opencode/src/tool/tool.ts +0 -112
  256. package/packages/opencode/src/tool/truncate.ts +0 -144
  257. package/packages/opencode/src/tool/truncation-dir.ts +0 -4
  258. package/packages/opencode/src/tool/webfetch.ts +0 -206
  259. package/packages/opencode/src/tool/webfetch.txt +0 -13
  260. package/packages/opencode/src/tool/websearch.ts +0 -150
  261. package/packages/opencode/src/tool/websearch.txt +0 -14
  262. package/packages/opencode/src/tool/write.ts +0 -84
  263. package/packages/opencode/src/tool/write.txt +0 -8
  264. package/packages/opencode/src/util/abort.ts +0 -35
  265. package/packages/opencode/src/util/archive.ts +0 -17
  266. package/packages/opencode/src/util/color.ts +0 -19
  267. package/packages/opencode/src/util/context.ts +0 -25
  268. package/packages/opencode/src/util/data-url.ts +0 -9
  269. package/packages/opencode/src/util/defer.ts +0 -12
  270. package/packages/opencode/src/util/effect-http-client.ts +0 -11
  271. package/packages/opencode/src/util/effect-zod.ts +0 -98
  272. package/packages/opencode/src/util/error.ts +0 -77
  273. package/packages/opencode/src/util/filesystem.ts +0 -245
  274. package/packages/opencode/src/util/flock.ts +0 -333
  275. package/packages/opencode/src/util/fn.ts +0 -21
  276. package/packages/opencode/src/util/format.ts +0 -20
  277. package/packages/opencode/src/util/glob.ts +0 -34
  278. package/packages/opencode/src/util/hash.ts +0 -7
  279. package/packages/opencode/src/util/iife.ts +0 -3
  280. package/packages/opencode/src/util/keybind.ts +0 -103
  281. package/packages/opencode/src/util/lazy.ts +0 -23
  282. package/packages/opencode/src/util/locale.ts +0 -81
  283. package/packages/opencode/src/util/lock.ts +0 -98
  284. package/packages/opencode/src/util/log.ts +0 -182
  285. package/packages/opencode/src/util/network.ts +0 -9
  286. package/packages/opencode/src/util/process.ts +0 -176
  287. package/packages/opencode/src/util/queue.ts +0 -32
  288. package/packages/opencode/src/util/record.ts +0 -3
  289. package/packages/opencode/src/util/rpc.ts +0 -66
  290. package/packages/opencode/src/util/schema.ts +0 -53
  291. package/packages/opencode/src/util/scrap.ts +0 -10
  292. package/packages/opencode/src/util/signal.ts +0 -12
  293. package/packages/opencode/src/util/timeout.ts +0 -14
  294. package/packages/opencode/src/util/token.ts +0 -7
  295. package/packages/opencode/src/util/update-schema.ts +0 -13
  296. package/packages/opencode/src/util/which.ts +0 -14
  297. package/packages/opencode/src/util/wildcard.ts +0 -59
  298. package/packages/opencode/src/worktree/index.ts +0 -612
  299. package/packages/plugin/package.json +0 -38
  300. package/packages/plugin/src/example.ts +0 -18
  301. package/packages/plugin/src/index.ts +0 -282
  302. package/packages/plugin/src/shell.ts +0 -136
  303. package/packages/plugin/src/tool.ts +0 -38
  304. package/packages/plugin/src/tui.ts +0 -508
  305. package/packages/script/package.json +0 -16
  306. package/packages/script/src/index.ts +0 -77
  307. package/packages/sdk/package.json +0 -33
  308. package/packages/sdk/src/client.ts +0 -55
  309. package/packages/sdk/src/gen/client/client.gen.ts +0 -212
  310. package/packages/sdk/src/gen/client/index.ts +0 -25
  311. package/packages/sdk/src/gen/client/types.gen.ts +0 -222
  312. package/packages/sdk/src/gen/client/utils.gen.ts +0 -287
  313. package/packages/sdk/src/gen/client.gen.ts +0 -22
  314. package/packages/sdk/src/gen/core/auth.gen.ts +0 -41
  315. package/packages/sdk/src/gen/core/bodySerializer.gen.ts +0 -74
  316. package/packages/sdk/src/gen/core/params.gen.ts +0 -144
  317. package/packages/sdk/src/gen/core/pathSerializer.gen.ts +0 -167
  318. package/packages/sdk/src/gen/core/queryKeySerializer.gen.ts +0 -111
  319. package/packages/sdk/src/gen/core/serverSentEvents.gen.ts +0 -210
  320. package/packages/sdk/src/gen/core/types.gen.ts +0 -91
  321. package/packages/sdk/src/gen/core/utils.gen.ts +0 -109
  322. package/packages/sdk/src/gen/sdk.gen.ts +0 -1197
  323. package/packages/sdk/src/gen/types.gen.ts +0 -3904
  324. package/packages/sdk/src/index.ts +0 -21
  325. package/packages/sdk/src/process.ts +0 -31
  326. package/packages/sdk/src/server.ts +0 -134
  327. package/packages/sdk/src/v2/client.ts +0 -81
  328. package/packages/sdk/src/v2/gen/client/client.gen.ts +0 -285
  329. package/packages/sdk/src/v2/gen/client/index.ts +0 -25
  330. package/packages/sdk/src/v2/gen/client/types.gen.ts +0 -202
  331. package/packages/sdk/src/v2/gen/client/utils.gen.ts +0 -289
  332. package/packages/sdk/src/v2/gen/client.gen.ts +0 -18
  333. package/packages/sdk/src/v2/gen/core/auth.gen.ts +0 -41
  334. package/packages/sdk/src/v2/gen/core/bodySerializer.gen.ts +0 -82
  335. package/packages/sdk/src/v2/gen/core/params.gen.ts +0 -169
  336. package/packages/sdk/src/v2/gen/core/pathSerializer.gen.ts +0 -167
  337. package/packages/sdk/src/v2/gen/core/queryKeySerializer.gen.ts +0 -111
  338. package/packages/sdk/src/v2/gen/core/serverSentEvents.gen.ts +0 -239
  339. package/packages/sdk/src/v2/gen/core/types.gen.ts +0 -86
  340. package/packages/sdk/src/v2/gen/core/utils.gen.ts +0 -137
  341. package/packages/sdk/src/v2/gen/sdk.gen.ts +0 -4223
  342. package/packages/sdk/src/v2/gen/types.gen.ts +0 -5265
  343. package/packages/sdk/src/v2/index.ts +0 -21
  344. package/packages/sdk/src/v2/server.ts +0 -134
  345. package/packages/util/package.json +0 -20
  346. package/packages/util/src/array.ts +0 -10
  347. package/packages/util/src/binary.ts +0 -41
  348. package/packages/util/src/encode.ts +0 -51
  349. package/packages/util/src/error.ts +0 -54
  350. package/packages/util/src/fn.ts +0 -11
  351. package/packages/util/src/identifier.ts +0 -48
  352. package/packages/util/src/iife.ts +0 -3
  353. package/packages/util/src/lazy.ts +0 -11
  354. package/packages/util/src/module.ts +0 -10
  355. package/packages/util/src/path.ts +0 -37
  356. package/packages/util/src/retry.ts +0 -41
  357. package/packages/util/src/slug.ts +0 -74
  358. package/postinstall.cjs +0 -55
@@ -1,612 +0,0 @@
1
- import z from "zod"
2
- import { NamedError } from "@opencode-ai/util/error"
3
- import { Global } from "../global"
4
- import { Instance } from "../project/instance"
5
- import { InstanceBootstrap } from "../project/bootstrap"
6
- import { Project } from "../project/project"
7
- import { Database, eq } from "../storage/db"
8
- import { ProjectTable } from "../project/project.sql"
9
- import type { ProjectID } from "../project/schema"
10
- import { Log } from "../util/log"
11
- import { Slug } from "@opencode-ai/util/slug"
12
- import { errorMessage } from "../util/error"
13
- import { BusEvent } from "@/bus/bus-event"
14
- import { GlobalBus } from "@/bus/global"
15
- import { Git } from "@/git"
16
- import { Effect, Layer, Path, Scope, ServiceMap, Stream } from "effect"
17
- import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
18
- import { NodePath } from "@effect/platform-node"
19
- import { AppFileSystem } from "@/filesystem"
20
- import { makeRuntime } from "@/effect/run-service"
21
- import * as CrossSpawnSpawner from "@/effect/cross-spawn-spawner"
22
- import { InstanceState } from "@/effect/instance-state"
23
-
24
- export namespace Worktree {
25
- const log = Log.create({ service: "worktree" })
26
-
27
- export const Event = {
28
- Ready: BusEvent.define(
29
- "worktree.ready",
30
- z.object({
31
- name: z.string(),
32
- branch: z.string(),
33
- }),
34
- ),
35
- Failed: BusEvent.define(
36
- "worktree.failed",
37
- z.object({
38
- message: z.string(),
39
- }),
40
- ),
41
- }
42
-
43
- export const Info = z
44
- .object({
45
- name: z.string(),
46
- branch: z.string(),
47
- directory: z.string(),
48
- })
49
- .meta({
50
- ref: "Worktree",
51
- })
52
-
53
- export type Info = z.infer<typeof Info>
54
-
55
- export const CreateInput = z
56
- .object({
57
- name: z.string().optional(),
58
- startCommand: z
59
- .string()
60
- .optional()
61
- .describe("Additional startup script to run after the project's start command"),
62
- })
63
- .meta({
64
- ref: "WorktreeCreateInput",
65
- })
66
-
67
- export type CreateInput = z.infer<typeof CreateInput>
68
-
69
- export const RemoveInput = z
70
- .object({
71
- directory: z.string(),
72
- })
73
- .meta({
74
- ref: "WorktreeRemoveInput",
75
- })
76
-
77
- export type RemoveInput = z.infer<typeof RemoveInput>
78
-
79
- export const ResetInput = z
80
- .object({
81
- directory: z.string(),
82
- })
83
- .meta({
84
- ref: "WorktreeResetInput",
85
- })
86
-
87
- export type ResetInput = z.infer<typeof ResetInput>
88
-
89
- export const NotGitError = NamedError.create(
90
- "WorktreeNotGitError",
91
- z.object({
92
- message: z.string(),
93
- }),
94
- )
95
-
96
- export const NameGenerationFailedError = NamedError.create(
97
- "WorktreeNameGenerationFailedError",
98
- z.object({
99
- message: z.string(),
100
- }),
101
- )
102
-
103
- export const CreateFailedError = NamedError.create(
104
- "WorktreeCreateFailedError",
105
- z.object({
106
- message: z.string(),
107
- }),
108
- )
109
-
110
- export const StartCommandFailedError = NamedError.create(
111
- "WorktreeStartCommandFailedError",
112
- z.object({
113
- message: z.string(),
114
- }),
115
- )
116
-
117
- export const RemoveFailedError = NamedError.create(
118
- "WorktreeRemoveFailedError",
119
- z.object({
120
- message: z.string(),
121
- }),
122
- )
123
-
124
- export const ResetFailedError = NamedError.create(
125
- "WorktreeResetFailedError",
126
- z.object({
127
- message: z.string(),
128
- }),
129
- )
130
-
131
- function slugify(input: string) {
132
- return input
133
- .trim()
134
- .toLowerCase()
135
- .replace(/[^a-z0-9]+/g, "-")
136
- .replace(/^-+/, "")
137
- .replace(/-+$/, "")
138
- }
139
-
140
- function failedRemoves(...chunks: string[]) {
141
- return chunks.filter(Boolean).flatMap((chunk) =>
142
- chunk
143
- .split("\n")
144
- .map((line) => line.trim())
145
- .flatMap((line) => {
146
- const match = line.match(/^warning:\s+failed to remove\s+(.+):\s+/i)
147
- if (!match) return []
148
- const value = match[1]?.trim().replace(/^['"]|['"]$/g, "")
149
- if (!value) return []
150
- return [value]
151
- }),
152
- )
153
- }
154
-
155
- // ---------------------------------------------------------------------------
156
- // Effect service
157
- // ---------------------------------------------------------------------------
158
-
159
- export interface Interface {
160
- readonly makeWorktreeInfo: (name?: string) => Effect.Effect<Info>
161
- readonly createFromInfo: (info: Info, startCommand?: string) => Effect.Effect<void>
162
- readonly create: (input?: CreateInput) => Effect.Effect<Info>
163
- readonly remove: (input: RemoveInput) => Effect.Effect<boolean>
164
- readonly reset: (input: ResetInput) => Effect.Effect<boolean>
165
- }
166
-
167
- export class Service extends ServiceMap.Service<Service, Interface>()("@opencode/Worktree") {}
168
-
169
- type GitResult = { code: number; text: string; stderr: string }
170
-
171
- export const layer: Layer.Layer<
172
- Service,
173
- never,
174
- AppFileSystem.Service | Path.Path | ChildProcessSpawner.ChildProcessSpawner | Project.Service
175
- > = Layer.effect(
176
- Service,
177
- Effect.gen(function* () {
178
- const scope = yield* Scope.Scope
179
- const fs = yield* AppFileSystem.Service
180
- const pathSvc = yield* Path.Path
181
- const spawner = yield* ChildProcessSpawner.ChildProcessSpawner
182
- const project = yield* Project.Service
183
-
184
- const git = Effect.fnUntraced(
185
- function* (args: string[], opts?: { cwd?: string }) {
186
- const handle = yield* spawner.spawn(
187
- ChildProcess.make("git", args, { cwd: opts?.cwd, extendEnv: true, stdin: "ignore" }),
188
- )
189
- const [text, stderr] = yield* Effect.all(
190
- [Stream.mkString(Stream.decodeText(handle.stdout)), Stream.mkString(Stream.decodeText(handle.stderr))],
191
- { concurrency: 2 },
192
- )
193
- const code = yield* handle.exitCode
194
- return { code, text, stderr } satisfies GitResult
195
- },
196
- Effect.scoped,
197
- Effect.catch((e) =>
198
- Effect.succeed({ code: 1, text: "", stderr: e instanceof Error ? e.message : String(e) } satisfies GitResult),
199
- ),
200
- )
201
-
202
- const MAX_NAME_ATTEMPTS = 26
203
- const candidate = Effect.fn("Worktree.candidate")(function* (root: string, base?: string) {
204
- const ctx = yield* InstanceState.context
205
- for (const attempt of Array.from({ length: MAX_NAME_ATTEMPTS }, (_, i) => i)) {
206
- const name = base ? (attempt === 0 ? base : `${base}-${Slug.create()}`) : Slug.create()
207
- const branch = `opencode/${name}`
208
- const directory = pathSvc.join(root, name)
209
-
210
- if (yield* fs.exists(directory).pipe(Effect.orDie)) continue
211
-
212
- const ref = `refs/heads/${branch}`
213
- const branchCheck = yield* git(["show-ref", "--verify", "--quiet", ref], { cwd: ctx.worktree })
214
- if (branchCheck.code === 0) continue
215
-
216
- return Info.parse({ name, branch, directory })
217
- }
218
- throw new NameGenerationFailedError({ message: "Failed to generate a unique worktree name" })
219
- })
220
-
221
- const makeWorktreeInfo = Effect.fn("Worktree.makeWorktreeInfo")(function* (name?: string) {
222
- const ctx = yield* InstanceState.context
223
- if (ctx.project.vcs !== "git") {
224
- throw new NotGitError({ message: "Worktrees are only supported for git projects" })
225
- }
226
-
227
- const root = pathSvc.join(Global.Path.data, "worktree", ctx.project.id)
228
- yield* fs.makeDirectory(root, { recursive: true }).pipe(Effect.orDie)
229
-
230
- const base = name ? slugify(name) : ""
231
- return yield* candidate(root, base || undefined)
232
- })
233
-
234
- const setup = Effect.fnUntraced(function* (info: Info) {
235
- const ctx = yield* InstanceState.context
236
- const created = yield* git(["worktree", "add", "--no-checkout", "-b", info.branch, info.directory], {
237
- cwd: ctx.worktree,
238
- })
239
- if (created.code !== 0) {
240
- throw new CreateFailedError({ message: created.stderr || created.text || "Failed to create git worktree" })
241
- }
242
-
243
- yield* project.addSandbox(ctx.project.id, info.directory).pipe(Effect.catch(() => Effect.void))
244
- })
245
-
246
- const boot = Effect.fnUntraced(function* (info: Info, startCommand?: string) {
247
- const ctx = yield* InstanceState.context
248
- const projectID = ctx.project.id
249
- const extra = startCommand?.trim()
250
-
251
- const populated = yield* git(["reset", "--hard"], { cwd: info.directory })
252
- if (populated.code !== 0) {
253
- const message = populated.stderr || populated.text || "Failed to populate worktree"
254
- log.error("worktree checkout failed", { directory: info.directory, message })
255
- GlobalBus.emit("event", {
256
- directory: info.directory,
257
- payload: { type: Event.Failed.type, properties: { message } },
258
- })
259
- return
260
- }
261
-
262
- const booted = yield* Effect.promise(() =>
263
- Instance.provide({
264
- directory: info.directory,
265
- init: InstanceBootstrap,
266
- fn: () => undefined,
267
- })
268
- .then(() => true)
269
- .catch((error) => {
270
- const message = errorMessage(error)
271
- log.error("worktree bootstrap failed", { directory: info.directory, message })
272
- GlobalBus.emit("event", {
273
- directory: info.directory,
274
- payload: { type: Event.Failed.type, properties: { message } },
275
- })
276
- return false
277
- }),
278
- )
279
- if (!booted) return
280
-
281
- GlobalBus.emit("event", {
282
- directory: info.directory,
283
- payload: {
284
- type: Event.Ready.type,
285
- properties: { name: info.name, branch: info.branch },
286
- },
287
- })
288
-
289
- yield* runStartScripts(info.directory, { projectID, extra })
290
- })
291
-
292
- const createFromInfo = Effect.fn("Worktree.createFromInfo")(function* (info: Info, startCommand?: string) {
293
- yield* setup(info)
294
- yield* boot(info, startCommand)
295
- })
296
-
297
- const create = Effect.fn("Worktree.create")(function* (input?: CreateInput) {
298
- const info = yield* makeWorktreeInfo(input?.name)
299
- yield* setup(info)
300
- yield* boot(info, input?.startCommand).pipe(
301
- Effect.catchCause((cause) => Effect.sync(() => log.error("worktree bootstrap failed", { cause }))),
302
- Effect.forkIn(scope),
303
- )
304
- return info
305
- })
306
-
307
- const canonical = Effect.fnUntraced(function* (input: string) {
308
- const abs = pathSvc.resolve(input)
309
- const real = yield* fs.realPath(abs).pipe(Effect.catch(() => Effect.succeed(abs)))
310
- const normalized = pathSvc.normalize(real)
311
- return process.platform === "win32" ? normalized.toLowerCase() : normalized
312
- })
313
-
314
- function parseWorktreeList(text: string) {
315
- return text
316
- .split("\n")
317
- .map((line) => line.trim())
318
- .reduce<{ path?: string; branch?: string }[]>((acc, line) => {
319
- if (!line) return acc
320
- if (line.startsWith("worktree ")) {
321
- acc.push({ path: line.slice("worktree ".length).trim() })
322
- return acc
323
- }
324
- const current = acc[acc.length - 1]
325
- if (!current) return acc
326
- if (line.startsWith("branch ")) {
327
- current.branch = line.slice("branch ".length).trim()
328
- }
329
- return acc
330
- }, [])
331
- }
332
-
333
- const locateWorktree = Effect.fnUntraced(function* (
334
- entries: { path?: string; branch?: string }[],
335
- directory: string,
336
- ) {
337
- for (const item of entries) {
338
- if (!item.path) continue
339
- const key = yield* canonical(item.path)
340
- if (key === directory) return item
341
- }
342
- return undefined
343
- })
344
-
345
- function stopFsmonitor(target: string) {
346
- return fs.exists(target).pipe(
347
- Effect.orDie,
348
- Effect.flatMap((exists) => (exists ? git(["fsmonitor--daemon", "stop"], { cwd: target }) : Effect.void)),
349
- )
350
- }
351
-
352
- function cleanDirectory(target: string) {
353
- return Effect.promise(() =>
354
- import("fs/promises")
355
- .then((fsp) => fsp.rm(target, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 }))
356
- .catch((error) => {
357
- const message = errorMessage(error)
358
- throw new RemoveFailedError({ message: message || "Failed to remove git worktree directory" })
359
- }),
360
- )
361
- }
362
-
363
- const remove = Effect.fn("Worktree.remove")(function* (input: RemoveInput) {
364
- if (Instance.project.vcs !== "git") {
365
- throw new NotGitError({ message: "Worktrees are only supported for git projects" })
366
- }
367
-
368
- const directory = yield* canonical(input.directory)
369
-
370
- const list = yield* git(["worktree", "list", "--porcelain"], { cwd: Instance.worktree })
371
- if (list.code !== 0) {
372
- throw new RemoveFailedError({ message: list.stderr || list.text || "Failed to read git worktrees" })
373
- }
374
-
375
- const entries = parseWorktreeList(list.text)
376
- const entry = yield* locateWorktree(entries, directory)
377
-
378
- if (!entry?.path) {
379
- const directoryExists = yield* fs.exists(directory).pipe(Effect.orDie)
380
- if (directoryExists) {
381
- yield* stopFsmonitor(directory)
382
- yield* cleanDirectory(directory)
383
- }
384
- return true
385
- }
386
-
387
- yield* stopFsmonitor(entry.path)
388
- const removed = yield* git(["worktree", "remove", "--force", entry.path], { cwd: Instance.worktree })
389
- if (removed.code !== 0) {
390
- const next = yield* git(["worktree", "list", "--porcelain"], { cwd: Instance.worktree })
391
- if (next.code !== 0) {
392
- throw new RemoveFailedError({
393
- message: removed.stderr || removed.text || next.stderr || next.text || "Failed to remove git worktree",
394
- })
395
- }
396
-
397
- const stale = yield* locateWorktree(parseWorktreeList(next.text), directory)
398
- if (stale?.path) {
399
- throw new RemoveFailedError({ message: removed.stderr || removed.text || "Failed to remove git worktree" })
400
- }
401
- }
402
-
403
- yield* cleanDirectory(entry.path)
404
-
405
- const branch = entry.branch?.replace(/^refs\/heads\//, "")
406
- if (branch) {
407
- const deleted = yield* git(["branch", "-D", branch], { cwd: Instance.worktree })
408
- if (deleted.code !== 0) {
409
- throw new RemoveFailedError({
410
- message: deleted.stderr || deleted.text || "Failed to delete worktree branch",
411
- })
412
- }
413
- }
414
-
415
- return true
416
- })
417
-
418
- const gitExpect = Effect.fnUntraced(function* (
419
- args: string[],
420
- opts: { cwd: string },
421
- error: (r: GitResult) => Error,
422
- ) {
423
- const result = yield* git(args, opts)
424
- if (result.code !== 0) throw error(result)
425
- return result
426
- })
427
-
428
- const runStartCommand = Effect.fnUntraced(
429
- function* (directory: string, cmd: string) {
430
- const [shell, args] = process.platform === "win32" ? ["cmd", ["/c", cmd]] : ["bash", ["-lc", cmd]]
431
- const handle = yield* spawner.spawn(
432
- ChildProcess.make(shell, args, { cwd: directory, extendEnv: true, stdin: "ignore" }),
433
- )
434
- // Drain stdout, capture stderr for error reporting
435
- const [, stderr] = yield* Effect.all(
436
- [Stream.runDrain(handle.stdout), Stream.mkString(Stream.decodeText(handle.stderr))],
437
- { concurrency: 2 },
438
- ).pipe(Effect.orDie)
439
- const code = yield* handle.exitCode
440
- return { code, stderr }
441
- },
442
- Effect.scoped,
443
- Effect.catch(() => Effect.succeed({ code: 1, stderr: "" })),
444
- )
445
-
446
- const runStartScript = Effect.fnUntraced(function* (directory: string, cmd: string, kind: string) {
447
- const text = cmd.trim()
448
- if (!text) return true
449
- const result = yield* runStartCommand(directory, text)
450
- if (result.code === 0) return true
451
- log.error("worktree start command failed", { kind, directory, message: result.stderr })
452
- return false
453
- })
454
-
455
- const runStartScripts = Effect.fnUntraced(function* (
456
- directory: string,
457
- input: { projectID: ProjectID; extra?: string },
458
- ) {
459
- const row = yield* Effect.sync(() =>
460
- Database.use((db) => db.select().from(ProjectTable).where(eq(ProjectTable.id, input.projectID)).get()),
461
- )
462
- const project = row ? Project.fromRow(row) : undefined
463
- const startup = project?.commands?.start?.trim() ?? ""
464
- const ok = yield* runStartScript(directory, startup, "project")
465
- if (!ok) return false
466
- yield* runStartScript(directory, input.extra ?? "", "worktree")
467
- return true
468
- })
469
-
470
- const prune = Effect.fnUntraced(function* (root: string, entries: string[]) {
471
- const base = yield* canonical(root)
472
- yield* Effect.forEach(
473
- entries,
474
- (entry) =>
475
- Effect.gen(function* () {
476
- const target = yield* canonical(pathSvc.resolve(root, entry))
477
- if (target === base) return
478
- if (!target.startsWith(`${base}${pathSvc.sep}`)) return
479
- yield* fs.remove(target, { recursive: true }).pipe(Effect.ignore)
480
- }),
481
- { concurrency: "unbounded" },
482
- )
483
- })
484
-
485
- const sweep = Effect.fnUntraced(function* (root: string) {
486
- const first = yield* git(["clean", "-ffdx"], { cwd: root })
487
- if (first.code === 0) return first
488
-
489
- const entries = failedRemoves(first.stderr, first.text)
490
- if (!entries.length) return first
491
-
492
- yield* prune(root, entries)
493
- return yield* git(["clean", "-ffdx"], { cwd: root })
494
- })
495
-
496
- const reset = Effect.fn("Worktree.reset")(function* (input: ResetInput) {
497
- if (Instance.project.vcs !== "git") {
498
- throw new NotGitError({ message: "Worktrees are only supported for git projects" })
499
- }
500
-
501
- const directory = yield* canonical(input.directory)
502
- const primary = yield* canonical(Instance.worktree)
503
- if (directory === primary) {
504
- throw new ResetFailedError({ message: "Cannot reset the primary workspace" })
505
- }
506
-
507
- const list = yield* git(["worktree", "list", "--porcelain"], { cwd: Instance.worktree })
508
- if (list.code !== 0) {
509
- throw new ResetFailedError({ message: list.stderr || list.text || "Failed to read git worktrees" })
510
- }
511
-
512
- const entry = yield* locateWorktree(parseWorktreeList(list.text), directory)
513
- if (!entry?.path) {
514
- throw new ResetFailedError({ message: "Worktree not found" })
515
- }
516
-
517
- const worktreePath = entry.path
518
-
519
- const base = yield* Effect.promise(() => Git.defaultBranch(Instance.worktree))
520
- if (!base) {
521
- throw new ResetFailedError({ message: "Default branch not found" })
522
- }
523
-
524
- const sep = base.ref.indexOf("/")
525
- if (base.ref !== base.name && sep > 0) {
526
- const remote = base.ref.slice(0, sep)
527
- const branch = base.ref.slice(sep + 1)
528
- yield* gitExpect(
529
- ["fetch", remote, branch],
530
- { cwd: Instance.worktree },
531
- (r) => new ResetFailedError({ message: r.stderr || r.text || `Failed to fetch ${base.ref}` }),
532
- )
533
- }
534
-
535
- yield* gitExpect(
536
- ["reset", "--hard", base.ref],
537
- { cwd: worktreePath },
538
- (r) => new ResetFailedError({ message: r.stderr || r.text || "Failed to reset worktree to target" }),
539
- )
540
-
541
- const cleanResult = yield* sweep(worktreePath)
542
- if (cleanResult.code !== 0) {
543
- throw new ResetFailedError({ message: cleanResult.stderr || cleanResult.text || "Failed to clean worktree" })
544
- }
545
-
546
- yield* gitExpect(
547
- ["submodule", "update", "--init", "--recursive", "--force"],
548
- { cwd: worktreePath },
549
- (r) => new ResetFailedError({ message: r.stderr || r.text || "Failed to update submodules" }),
550
- )
551
-
552
- yield* gitExpect(
553
- ["submodule", "foreach", "--recursive", "git", "reset", "--hard"],
554
- { cwd: worktreePath },
555
- (r) => new ResetFailedError({ message: r.stderr || r.text || "Failed to reset submodules" }),
556
- )
557
-
558
- yield* gitExpect(
559
- ["submodule", "foreach", "--recursive", "git", "clean", "-fdx"],
560
- { cwd: worktreePath },
561
- (r) => new ResetFailedError({ message: r.stderr || r.text || "Failed to clean submodules" }),
562
- )
563
-
564
- const status = yield* git(["-c", "core.fsmonitor=false", "status", "--porcelain=v1"], { cwd: worktreePath })
565
- if (status.code !== 0) {
566
- throw new ResetFailedError({ message: status.stderr || status.text || "Failed to read git status" })
567
- }
568
-
569
- if (status.text.trim()) {
570
- throw new ResetFailedError({ message: `Worktree reset left local changes:\n${status.text.trim()}` })
571
- }
572
-
573
- yield* runStartScripts(worktreePath, { projectID: Instance.project.id }).pipe(
574
- Effect.catchCause((cause) => Effect.sync(() => log.error("worktree start task failed", { cause }))),
575
- Effect.forkIn(scope),
576
- )
577
-
578
- return true
579
- })
580
-
581
- return Service.of({ makeWorktreeInfo, createFromInfo, create, remove, reset })
582
- }),
583
- )
584
-
585
- const defaultLayer = layer.pipe(
586
- Layer.provide(CrossSpawnSpawner.defaultLayer),
587
- Layer.provide(Project.defaultLayer),
588
- Layer.provide(AppFileSystem.defaultLayer),
589
- Layer.provide(NodePath.layer),
590
- )
591
- const { runPromise } = makeRuntime(Service, defaultLayer)
592
-
593
- export async function makeWorktreeInfo(name?: string) {
594
- return runPromise((svc) => svc.makeWorktreeInfo(name))
595
- }
596
-
597
- export async function createFromInfo(info: Info, startCommand?: string) {
598
- return runPromise((svc) => svc.createFromInfo(info, startCommand))
599
- }
600
-
601
- export async function create(input?: CreateInput) {
602
- return runPromise((svc) => svc.create(input))
603
- }
604
-
605
- export async function remove(input: RemoveInput) {
606
- return runPromise((svc) => svc.remove(input))
607
- }
608
-
609
- export async function reset(input: ResetInput) {
610
- return runPromise((svc) => svc.reset(input))
611
- }
612
- }
@@ -1,38 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/package.json",
3
- "name": "@opencode-ai/plugin",
4
- "version": "1.3.17",
5
- "type": "module",
6
- "license": "MIT",
7
- "scripts": {
8
- "typecheck": "tsgo --noEmit",
9
- "build": "tsc"
10
- },
11
- "exports": {
12
- ".": "./src/index.ts",
13
- "./tool": "./src/tool.ts",
14
- "./tui": "./src/tui.ts"
15
- },
16
- "files": [
17
- "dist"
18
- ],
19
- "dependencies": {
20
- "@opencode-ai/sdk": "*",
21
- "zod": "4.1.8"
22
- },
23
- "peerDependencies": {},
24
- "peerDependenciesMeta": {
25
- "@opentui/core": {
26
- "optional": true
27
- },
28
- "@opentui/solid": {
29
- "optional": true
30
- }
31
- },
32
- "devDependencies": {
33
- "@tsconfig/node22": "22.0.2",
34
- "@types/node": "22.13.9",
35
- "typescript": "5.8.2",
36
- "@typescript/native-preview": "7.0.0-dev.20251207.1"
37
- }
38
- }
@@ -1,18 +0,0 @@
1
- import { Plugin } from "./index.js"
2
- import { tool } from "./tool.js"
3
-
4
- export const ExamplePlugin: Plugin = async (ctx) => {
5
- return {
6
- tool: {
7
- mytool: tool({
8
- description: "This is a custom tool",
9
- args: {
10
- foo: tool.schema.string().describe("foo"),
11
- },
12
- async execute(args) {
13
- return `Hello ${args.foo}!`
14
- },
15
- }),
16
- },
17
- }
18
- }