alchemylab-opencode 1.0.7 → 1.0.9

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 (391) hide show
  1. package/dist/{chunk-B3FN2B2N.js → chunk-3PZZ2D23.js} +7 -3
  2. package/dist/chunk-3PZZ2D23.js.map +7 -0
  3. package/dist/{chunk-LU5XVQUD.js → chunk-EGZMJTLE.js} +7 -7
  4. package/dist/{chunk-LU5XVQUD.js.map → chunk-EGZMJTLE.js.map} +2 -2
  5. package/dist/{chunk-23UYOGZG.js → chunk-ORHZOVWK.js} +6 -6
  6. package/dist/{chunk-TASPMBUL.js → chunk-SV5NEV33.js} +5 -5
  7. package/dist/{chunk-SM6WZDN6.js → chunk-UKQIL5XA.js} +18 -12
  8. package/dist/chunk-UKQIL5XA.js.map +7 -0
  9. package/dist/{chunk-GSE2T5UY.js → chunk-ZFHDPNFZ.js} +4 -4
  10. package/dist/{mcp-XFGN3FWW.js → mcp-66BBNSWA.js} +3 -3
  11. package/dist/{registry-W4MBVBYD.js → registry-YVL3V6Z6.js} +4 -4
  12. package/dist/{run-73HUV4H3.js → run-65PIGE2A.js} +7 -7
  13. package/dist/{run-service-LHEVFBIU.js → run-service-AYATGPA6.js} +2 -2
  14. package/dist/run.js +1 -1
  15. package/dist/serve.js +1 -1
  16. package/dist/{server-2CPOG3LS.js → server-KCG3B4WQ.js} +7 -7
  17. package/dist/{session-M6HOZ56B.js → session-BR5MTI3X.js} +4 -4
  18. package/dist/{share-next-QRBVSD37.js → share-next-EPYQDJ32.js} +5 -5
  19. package/dist/{worktree-3GUHT2P7.js → worktree-PIVTZBUE.js} +6 -6
  20. package/package.json +2 -15
  21. package/packages/opencode/migration/20260409000000_add_session_metadata/migration.sql +1 -0
  22. package/build.mjs +0 -192
  23. package/dist/chunk-B3FN2B2N.js.map +0 -7
  24. package/dist/chunk-SM6WZDN6.js.map +0 -7
  25. package/packages/opencode/package.json +0 -138
  26. package/packages/opencode/src/account/account.sql.ts +0 -39
  27. package/packages/opencode/src/account/index.ts +0 -463
  28. package/packages/opencode/src/account/repo.ts +0 -163
  29. package/packages/opencode/src/account/schema.ts +0 -91
  30. package/packages/opencode/src/acp/README.md +0 -174
  31. package/packages/opencode/src/acp/agent.ts +0 -1847
  32. package/packages/opencode/src/acp/session.ts +0 -116
  33. package/packages/opencode/src/acp/types.ts +0 -24
  34. package/packages/opencode/src/agent/agent.ts +0 -420
  35. package/packages/opencode/src/agent/generate.txt +0 -75
  36. package/packages/opencode/src/agent/prompt/compaction.txt +0 -15
  37. package/packages/opencode/src/agent/prompt/explore.txt +0 -18
  38. package/packages/opencode/src/agent/prompt/summary.txt +0 -11
  39. package/packages/opencode/src/agent/prompt/title.txt +0 -44
  40. package/packages/opencode/src/auth/index.ts +0 -110
  41. package/packages/opencode/src/bus/bus-event.ts +0 -40
  42. package/packages/opencode/src/bus/global.ts +0 -10
  43. package/packages/opencode/src/bus/index.ts +0 -185
  44. package/packages/opencode/src/cli/bootstrap.ts +0 -17
  45. package/packages/opencode/src/cli/cmd/cmd.ts +0 -7
  46. package/packages/opencode/src/cli/cmd/run.ts +0 -689
  47. package/packages/opencode/src/cli/cmd/serve.ts +0 -24
  48. package/packages/opencode/src/cli/cmd/tui/event.ts +0 -49
  49. package/packages/opencode/src/cli/effect/prompt.ts +0 -25
  50. package/packages/opencode/src/cli/error.ts +0 -46
  51. package/packages/opencode/src/cli/heap.ts +0 -59
  52. package/packages/opencode/src/cli/logo.ts +0 -6
  53. package/packages/opencode/src/cli/network.ts +0 -60
  54. package/packages/opencode/src/cli/ui.ts +0 -133
  55. package/packages/opencode/src/cli/upgrade.ts +0 -31
  56. package/packages/opencode/src/command/index.ts +0 -195
  57. package/packages/opencode/src/command/template/initialize.txt +0 -66
  58. package/packages/opencode/src/command/template/review.txt +0 -101
  59. package/packages/opencode/src/config/config.ts +0 -1599
  60. package/packages/opencode/src/config/console-state.ts +0 -15
  61. package/packages/opencode/src/config/markdown.ts +0 -99
  62. package/packages/opencode/src/config/paths.ts +0 -167
  63. package/packages/opencode/src/config/tui-migrate.ts +0 -155
  64. package/packages/opencode/src/config/tui-schema.ts +0 -37
  65. package/packages/opencode/src/config/tui.ts +0 -179
  66. package/packages/opencode/src/control-plane/adaptors/index.ts +0 -20
  67. package/packages/opencode/src/control-plane/adaptors/worktree.ts +0 -42
  68. package/packages/opencode/src/control-plane/schema.ts +0 -17
  69. package/packages/opencode/src/control-plane/sse.ts +0 -66
  70. package/packages/opencode/src/control-plane/types.ts +0 -32
  71. package/packages/opencode/src/control-plane/workspace.sql.ts +0 -17
  72. package/packages/opencode/src/control-plane/workspace.ts +0 -168
  73. package/packages/opencode/src/effect/cross-spawn-spawner.ts +0 -502
  74. package/packages/opencode/src/effect/instance-ref.ts +0 -6
  75. package/packages/opencode/src/effect/instance-registry.ts +0 -12
  76. package/packages/opencode/src/effect/instance-state.ts +0 -82
  77. package/packages/opencode/src/effect/run-service.ts +0 -33
  78. package/packages/opencode/src/effect/runner.ts +0 -216
  79. package/packages/opencode/src/env/index.ts +0 -28
  80. package/packages/opencode/src/file/ignore.ts +0 -82
  81. package/packages/opencode/src/file/index.ts +0 -686
  82. package/packages/opencode/src/file/protected.ts +0 -59
  83. package/packages/opencode/src/file/ripgrep.ts +0 -376
  84. package/packages/opencode/src/file/time.ts +0 -133
  85. package/packages/opencode/src/file/watcher.ts +0 -173
  86. package/packages/opencode/src/filesystem/index.ts +0 -236
  87. package/packages/opencode/src/flag/flag.ts +0 -156
  88. package/packages/opencode/src/format/formatter.ts +0 -413
  89. package/packages/opencode/src/format/index.ts +0 -203
  90. package/packages/opencode/src/git/index.ts +0 -303
  91. package/packages/opencode/src/global/index.ts +0 -56
  92. package/packages/opencode/src/id/id.ts +0 -85
  93. package/packages/opencode/src/ide/index.ts +0 -74
  94. package/packages/opencode/src/installation/index.ts +0 -355
  95. package/packages/opencode/src/installation/meta.ts +0 -7
  96. package/packages/opencode/src/lsp/client.ts +0 -252
  97. package/packages/opencode/src/lsp/index.ts +0 -558
  98. package/packages/opencode/src/lsp/language.ts +0 -120
  99. package/packages/opencode/src/lsp/launch.ts +0 -21
  100. package/packages/opencode/src/lsp/server.ts +0 -1968
  101. package/packages/opencode/src/mcp/auth.ts +0 -173
  102. package/packages/opencode/src/mcp/index.ts +0 -931
  103. package/packages/opencode/src/mcp/oauth-callback.ts +0 -216
  104. package/packages/opencode/src/mcp/oauth-provider.ts +0 -185
  105. package/packages/opencode/src/node-loader.mjs +0 -104
  106. package/packages/opencode/src/node-preload.mjs +0 -39
  107. package/packages/opencode/src/node.ts +0 -1
  108. package/packages/opencode/src/npm/index.ts +0 -188
  109. package/packages/opencode/src/patch/index.ts +0 -680
  110. package/packages/opencode/src/permission/arity.ts +0 -163
  111. package/packages/opencode/src/permission/evaluate.ts +0 -15
  112. package/packages/opencode/src/permission/index.ts +0 -325
  113. package/packages/opencode/src/permission/schema.ts +0 -17
  114. package/packages/opencode/src/plugin/cloudflare.ts +0 -67
  115. package/packages/opencode/src/plugin/codex.ts +0 -608
  116. package/packages/opencode/src/plugin/github-copilot/copilot.ts +0 -361
  117. package/packages/opencode/src/plugin/github-copilot/models.ts +0 -144
  118. package/packages/opencode/src/plugin/index.ts +0 -299
  119. package/packages/opencode/src/plugin/install.ts +0 -439
  120. package/packages/opencode/src/plugin/loader.ts +0 -174
  121. package/packages/opencode/src/plugin/meta.ts +0 -188
  122. package/packages/opencode/src/plugin/shared.ts +0 -323
  123. package/packages/opencode/src/project/bootstrap.ts +0 -31
  124. package/packages/opencode/src/project/instance.ts +0 -175
  125. package/packages/opencode/src/project/project.sql.ts +0 -16
  126. package/packages/opencode/src/project/project.ts +0 -519
  127. package/packages/opencode/src/project/schema.ts +0 -16
  128. package/packages/opencode/src/project/state.ts +0 -70
  129. package/packages/opencode/src/project/vcs.ts +0 -240
  130. package/packages/opencode/src/provider/auth.ts +0 -253
  131. package/packages/opencode/src/provider/error.ts +0 -197
  132. package/packages/opencode/src/provider/models.ts +0 -162
  133. package/packages/opencode/src/provider/provider.ts +0 -1709
  134. package/packages/opencode/src/provider/schema.ts +0 -38
  135. package/packages/opencode/src/provider/sdk/copilot/README.md +0 -5
  136. package/packages/opencode/src/provider/sdk/copilot/chat/convert-to-openai-compatible-chat-messages.ts +0 -170
  137. package/packages/opencode/src/provider/sdk/copilot/chat/get-response-metadata.ts +0 -15
  138. package/packages/opencode/src/provider/sdk/copilot/chat/map-openai-compatible-finish-reason.ts +0 -19
  139. package/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-api-types.ts +0 -64
  140. package/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-chat-language-model.ts +0 -815
  141. package/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-chat-options.ts +0 -28
  142. package/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-metadata-extractor.ts +0 -44
  143. package/packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-prepare-tools.ts +0 -83
  144. package/packages/opencode/src/provider/sdk/copilot/copilot-provider.ts +0 -100
  145. package/packages/opencode/src/provider/sdk/copilot/index.ts +0 -2
  146. package/packages/opencode/src/provider/sdk/copilot/openai-compatible-error.ts +0 -27
  147. package/packages/opencode/src/provider/sdk/copilot/responses/convert-to-openai-responses-input.ts +0 -335
  148. package/packages/opencode/src/provider/sdk/copilot/responses/map-openai-responses-finish-reason.ts +0 -22
  149. package/packages/opencode/src/provider/sdk/copilot/responses/openai-config.ts +0 -18
  150. package/packages/opencode/src/provider/sdk/copilot/responses/openai-error.ts +0 -22
  151. package/packages/opencode/src/provider/sdk/copilot/responses/openai-responses-api-types.ts +0 -214
  152. package/packages/opencode/src/provider/sdk/copilot/responses/openai-responses-language-model.ts +0 -1769
  153. package/packages/opencode/src/provider/sdk/copilot/responses/openai-responses-prepare-tools.ts +0 -173
  154. package/packages/opencode/src/provider/sdk/copilot/responses/openai-responses-settings.ts +0 -1
  155. package/packages/opencode/src/provider/sdk/copilot/responses/tool/code-interpreter.ts +0 -87
  156. package/packages/opencode/src/provider/sdk/copilot/responses/tool/file-search.ts +0 -127
  157. package/packages/opencode/src/provider/sdk/copilot/responses/tool/image-generation.ts +0 -114
  158. package/packages/opencode/src/provider/sdk/copilot/responses/tool/local-shell.ts +0 -64
  159. package/packages/opencode/src/provider/sdk/copilot/responses/tool/web-search-preview.ts +0 -103
  160. package/packages/opencode/src/provider/sdk/copilot/responses/tool/web-search.ts +0 -102
  161. package/packages/opencode/src/provider/transform.ts +0 -1050
  162. package/packages/opencode/src/pty/index.ts +0 -397
  163. package/packages/opencode/src/pty/pty.node.ts +0 -27
  164. package/packages/opencode/src/pty/pty.ts +0 -25
  165. package/packages/opencode/src/pty/schema.ts +0 -17
  166. package/packages/opencode/src/question/index.ts +0 -224
  167. package/packages/opencode/src/question/schema.ts +0 -17
  168. package/packages/opencode/src/run.ts +0 -28
  169. package/packages/opencode/src/serve.ts +0 -45
  170. package/packages/opencode/src/server/error.ts +0 -36
  171. package/packages/opencode/src/server/event.ts +0 -7
  172. package/packages/opencode/src/server/instance.ts +0 -324
  173. package/packages/opencode/src/server/mdns.ts +0 -60
  174. package/packages/opencode/src/server/middleware.ts +0 -33
  175. package/packages/opencode/src/server/projectors.ts +0 -28
  176. package/packages/opencode/src/server/proxy.ts +0 -131
  177. package/packages/opencode/src/server/router.ts +0 -105
  178. package/packages/opencode/src/server/routes/config.ts +0 -92
  179. package/packages/opencode/src/server/routes/event.ts +0 -83
  180. package/packages/opencode/src/server/routes/experimental.ts +0 -374
  181. package/packages/opencode/src/server/routes/file.ts +0 -197
  182. package/packages/opencode/src/server/routes/global.ts +0 -312
  183. package/packages/opencode/src/server/routes/mcp.ts +0 -225
  184. package/packages/opencode/src/server/routes/permission.ts +0 -69
  185. package/packages/opencode/src/server/routes/project.ts +0 -118
  186. package/packages/opencode/src/server/routes/provider.ts +0 -171
  187. package/packages/opencode/src/server/routes/pty.ts +0 -210
  188. package/packages/opencode/src/server/routes/question.ts +0 -99
  189. package/packages/opencode/src/server/routes/session.ts +0 -1030
  190. package/packages/opencode/src/server/routes/tui.ts +0 -379
  191. package/packages/opencode/src/server/routes/workspace.ts +0 -94
  192. package/packages/opencode/src/server/server.ts +0 -353
  193. package/packages/opencode/src/session/compaction.ts +0 -428
  194. package/packages/opencode/src/session/index.ts +0 -887
  195. package/packages/opencode/src/session/instruction.ts +0 -258
  196. package/packages/opencode/src/session/llm.ts +0 -354
  197. package/packages/opencode/src/session/message-v2.ts +0 -1031
  198. package/packages/opencode/src/session/message.ts +0 -191
  199. package/packages/opencode/src/session/overflow.ts +0 -22
  200. package/packages/opencode/src/session/processor.ts +0 -523
  201. package/packages/opencode/src/session/projectors.ts +0 -135
  202. package/packages/opencode/src/session/prompt/anthropic.txt +0 -105
  203. package/packages/opencode/src/session/prompt/beast.txt +0 -147
  204. package/packages/opencode/src/session/prompt/build-switch.txt +0 -5
  205. package/packages/opencode/src/session/prompt/codex.txt +0 -79
  206. package/packages/opencode/src/session/prompt/copilot-gpt-5.txt +0 -143
  207. package/packages/opencode/src/session/prompt/default.txt +0 -105
  208. package/packages/opencode/src/session/prompt/gemini.txt +0 -155
  209. package/packages/opencode/src/session/prompt/gpt.txt +0 -107
  210. package/packages/opencode/src/session/prompt/kimi.txt +0 -95
  211. package/packages/opencode/src/session/prompt/max-steps.txt +0 -16
  212. package/packages/opencode/src/session/prompt/plan-reminder-anthropic.txt +0 -67
  213. package/packages/opencode/src/session/prompt/plan.txt +0 -26
  214. package/packages/opencode/src/session/prompt/trinity.txt +0 -97
  215. package/packages/opencode/src/session/prompt.ts +0 -1911
  216. package/packages/opencode/src/session/retry.ts +0 -106
  217. package/packages/opencode/src/session/revert.ts +0 -176
  218. package/packages/opencode/src/session/schema.ts +0 -38
  219. package/packages/opencode/src/session/session.sql.ts +0 -103
  220. package/packages/opencode/src/session/status.ts +0 -102
  221. package/packages/opencode/src/session/summary.ts +0 -177
  222. package/packages/opencode/src/session/system.ts +0 -76
  223. package/packages/opencode/src/session/todo.ts +0 -95
  224. package/packages/opencode/src/share/share-next.ts +0 -369
  225. package/packages/opencode/src/share/share.sql.ts +0 -13
  226. package/packages/opencode/src/shell/shell.ts +0 -110
  227. package/packages/opencode/src/skill/discovery.ts +0 -116
  228. package/packages/opencode/src/skill/index.ts +0 -277
  229. package/packages/opencode/src/snapshot/index.ts +0 -726
  230. package/packages/opencode/src/sql.d.ts +0 -4
  231. package/packages/opencode/src/storage/db.node.ts +0 -8
  232. package/packages/opencode/src/storage/db.ts +0 -177
  233. package/packages/opencode/src/storage/json-migration.ts +0 -425
  234. package/packages/opencode/src/storage/schema.sql.ts +0 -10
  235. package/packages/opencode/src/storage/schema.ts +0 -5
  236. package/packages/opencode/src/storage/storage.ts +0 -353
  237. package/packages/opencode/src/sync/README.md +0 -179
  238. package/packages/opencode/src/sync/event.sql.ts +0 -16
  239. package/packages/opencode/src/sync/index.ts +0 -263
  240. package/packages/opencode/src/sync/schema.ts +0 -14
  241. package/packages/opencode/src/tool/apply_patch.ts +0 -281
  242. package/packages/opencode/src/tool/apply_patch.txt +0 -33
  243. package/packages/opencode/src/tool/bash.ts +0 -496
  244. package/packages/opencode/src/tool/bash.txt +0 -117
  245. package/packages/opencode/src/tool/batch.ts +0 -183
  246. package/packages/opencode/src/tool/batch.txt +0 -24
  247. package/packages/opencode/src/tool/codesearch.ts +0 -132
  248. package/packages/opencode/src/tool/codesearch.txt +0 -12
  249. package/packages/opencode/src/tool/edit.ts +0 -667
  250. package/packages/opencode/src/tool/edit.txt +0 -10
  251. package/packages/opencode/src/tool/external-directory.ts +0 -46
  252. package/packages/opencode/src/tool/glob.ts +0 -78
  253. package/packages/opencode/src/tool/glob.txt +0 -6
  254. package/packages/opencode/src/tool/grep.ts +0 -156
  255. package/packages/opencode/src/tool/grep.txt +0 -8
  256. package/packages/opencode/src/tool/invalid.ts +0 -17
  257. package/packages/opencode/src/tool/ls.ts +0 -121
  258. package/packages/opencode/src/tool/ls.txt +0 -1
  259. package/packages/opencode/src/tool/lsp.ts +0 -97
  260. package/packages/opencode/src/tool/lsp.txt +0 -19
  261. package/packages/opencode/src/tool/multiedit.ts +0 -46
  262. package/packages/opencode/src/tool/multiedit.txt +0 -41
  263. package/packages/opencode/src/tool/plan-enter.txt +0 -14
  264. package/packages/opencode/src/tool/plan-exit.txt +0 -13
  265. package/packages/opencode/src/tool/plan.ts +0 -131
  266. package/packages/opencode/src/tool/question.ts +0 -46
  267. package/packages/opencode/src/tool/question.txt +0 -10
  268. package/packages/opencode/src/tool/read.ts +0 -332
  269. package/packages/opencode/src/tool/read.txt +0 -14
  270. package/packages/opencode/src/tool/registry.ts +0 -265
  271. package/packages/opencode/src/tool/schema.ts +0 -17
  272. package/packages/opencode/src/tool/skill.ts +0 -105
  273. package/packages/opencode/src/tool/task.ts +0 -166
  274. package/packages/opencode/src/tool/task.txt +0 -60
  275. package/packages/opencode/src/tool/todo.ts +0 -48
  276. package/packages/opencode/src/tool/todowrite.txt +0 -167
  277. package/packages/opencode/src/tool/tool.ts +0 -112
  278. package/packages/opencode/src/tool/truncate.ts +0 -144
  279. package/packages/opencode/src/tool/truncation-dir.ts +0 -4
  280. package/packages/opencode/src/tool/webfetch.ts +0 -206
  281. package/packages/opencode/src/tool/webfetch.txt +0 -13
  282. package/packages/opencode/src/tool/websearch.ts +0 -150
  283. package/packages/opencode/src/tool/websearch.txt +0 -14
  284. package/packages/opencode/src/tool/write.ts +0 -84
  285. package/packages/opencode/src/tool/write.txt +0 -8
  286. package/packages/opencode/src/util/abort.ts +0 -35
  287. package/packages/opencode/src/util/archive.ts +0 -17
  288. package/packages/opencode/src/util/color.ts +0 -19
  289. package/packages/opencode/src/util/context.ts +0 -25
  290. package/packages/opencode/src/util/data-url.ts +0 -9
  291. package/packages/opencode/src/util/defer.ts +0 -12
  292. package/packages/opencode/src/util/effect-http-client.ts +0 -11
  293. package/packages/opencode/src/util/effect-zod.ts +0 -98
  294. package/packages/opencode/src/util/error.ts +0 -77
  295. package/packages/opencode/src/util/filesystem.ts +0 -245
  296. package/packages/opencode/src/util/flock.ts +0 -333
  297. package/packages/opencode/src/util/fn.ts +0 -21
  298. package/packages/opencode/src/util/format.ts +0 -20
  299. package/packages/opencode/src/util/glob.ts +0 -34
  300. package/packages/opencode/src/util/hash.ts +0 -7
  301. package/packages/opencode/src/util/iife.ts +0 -3
  302. package/packages/opencode/src/util/keybind.ts +0 -103
  303. package/packages/opencode/src/util/lazy.ts +0 -23
  304. package/packages/opencode/src/util/locale.ts +0 -81
  305. package/packages/opencode/src/util/lock.ts +0 -98
  306. package/packages/opencode/src/util/log.ts +0 -182
  307. package/packages/opencode/src/util/network.ts +0 -9
  308. package/packages/opencode/src/util/process.ts +0 -176
  309. package/packages/opencode/src/util/queue.ts +0 -32
  310. package/packages/opencode/src/util/record.ts +0 -3
  311. package/packages/opencode/src/util/rpc.ts +0 -66
  312. package/packages/opencode/src/util/schema.ts +0 -53
  313. package/packages/opencode/src/util/scrap.ts +0 -10
  314. package/packages/opencode/src/util/signal.ts +0 -12
  315. package/packages/opencode/src/util/timeout.ts +0 -14
  316. package/packages/opencode/src/util/token.ts +0 -7
  317. package/packages/opencode/src/util/update-schema.ts +0 -13
  318. package/packages/opencode/src/util/which.ts +0 -14
  319. package/packages/opencode/src/util/wildcard.ts +0 -59
  320. package/packages/opencode/src/worktree/index.ts +0 -612
  321. package/packages/plugin/package.json +0 -38
  322. package/packages/plugin/src/example.ts +0 -18
  323. package/packages/plugin/src/index.ts +0 -282
  324. package/packages/plugin/src/shell.ts +0 -136
  325. package/packages/plugin/src/tool.ts +0 -38
  326. package/packages/plugin/src/tui.ts +0 -508
  327. package/packages/script/package.json +0 -16
  328. package/packages/script/src/index.ts +0 -77
  329. package/packages/sdk/package.json +0 -33
  330. package/packages/sdk/src/client.ts +0 -55
  331. package/packages/sdk/src/gen/client/client.gen.ts +0 -212
  332. package/packages/sdk/src/gen/client/index.ts +0 -25
  333. package/packages/sdk/src/gen/client/types.gen.ts +0 -222
  334. package/packages/sdk/src/gen/client/utils.gen.ts +0 -287
  335. package/packages/sdk/src/gen/client.gen.ts +0 -22
  336. package/packages/sdk/src/gen/core/auth.gen.ts +0 -41
  337. package/packages/sdk/src/gen/core/bodySerializer.gen.ts +0 -74
  338. package/packages/sdk/src/gen/core/params.gen.ts +0 -144
  339. package/packages/sdk/src/gen/core/pathSerializer.gen.ts +0 -167
  340. package/packages/sdk/src/gen/core/queryKeySerializer.gen.ts +0 -111
  341. package/packages/sdk/src/gen/core/serverSentEvents.gen.ts +0 -210
  342. package/packages/sdk/src/gen/core/types.gen.ts +0 -91
  343. package/packages/sdk/src/gen/core/utils.gen.ts +0 -109
  344. package/packages/sdk/src/gen/sdk.gen.ts +0 -1197
  345. package/packages/sdk/src/gen/types.gen.ts +0 -3904
  346. package/packages/sdk/src/index.ts +0 -21
  347. package/packages/sdk/src/process.ts +0 -31
  348. package/packages/sdk/src/server.ts +0 -134
  349. package/packages/sdk/src/v2/client.ts +0 -81
  350. package/packages/sdk/src/v2/gen/client/client.gen.ts +0 -285
  351. package/packages/sdk/src/v2/gen/client/index.ts +0 -25
  352. package/packages/sdk/src/v2/gen/client/types.gen.ts +0 -202
  353. package/packages/sdk/src/v2/gen/client/utils.gen.ts +0 -289
  354. package/packages/sdk/src/v2/gen/client.gen.ts +0 -18
  355. package/packages/sdk/src/v2/gen/core/auth.gen.ts +0 -41
  356. package/packages/sdk/src/v2/gen/core/bodySerializer.gen.ts +0 -82
  357. package/packages/sdk/src/v2/gen/core/params.gen.ts +0 -169
  358. package/packages/sdk/src/v2/gen/core/pathSerializer.gen.ts +0 -167
  359. package/packages/sdk/src/v2/gen/core/queryKeySerializer.gen.ts +0 -111
  360. package/packages/sdk/src/v2/gen/core/serverSentEvents.gen.ts +0 -239
  361. package/packages/sdk/src/v2/gen/core/types.gen.ts +0 -86
  362. package/packages/sdk/src/v2/gen/core/utils.gen.ts +0 -137
  363. package/packages/sdk/src/v2/gen/sdk.gen.ts +0 -4223
  364. package/packages/sdk/src/v2/gen/types.gen.ts +0 -5265
  365. package/packages/sdk/src/v2/index.ts +0 -21
  366. package/packages/sdk/src/v2/server.ts +0 -134
  367. package/packages/util/package.json +0 -20
  368. package/packages/util/src/array.ts +0 -10
  369. package/packages/util/src/binary.ts +0 -41
  370. package/packages/util/src/encode.ts +0 -51
  371. package/packages/util/src/error.ts +0 -54
  372. package/packages/util/src/fn.ts +0 -11
  373. package/packages/util/src/identifier.ts +0 -48
  374. package/packages/util/src/iife.ts +0 -3
  375. package/packages/util/src/lazy.ts +0 -11
  376. package/packages/util/src/module.ts +0 -10
  377. package/packages/util/src/path.ts +0 -37
  378. package/packages/util/src/retry.ts +0 -41
  379. package/packages/util/src/slug.ts +0 -74
  380. package/postinstall.cjs +0 -55
  381. /package/dist/{chunk-23UYOGZG.js.map → chunk-ORHZOVWK.js.map} +0 -0
  382. /package/dist/{chunk-TASPMBUL.js.map → chunk-SV5NEV33.js.map} +0 -0
  383. /package/dist/{chunk-GSE2T5UY.js.map → chunk-ZFHDPNFZ.js.map} +0 -0
  384. /package/dist/{mcp-XFGN3FWW.js.map → mcp-66BBNSWA.js.map} +0 -0
  385. /package/dist/{registry-W4MBVBYD.js.map → registry-YVL3V6Z6.js.map} +0 -0
  386. /package/dist/{run-73HUV4H3.js.map → run-65PIGE2A.js.map} +0 -0
  387. /package/dist/{run-service-LHEVFBIU.js.map → run-service-AYATGPA6.js.map} +0 -0
  388. /package/dist/{server-2CPOG3LS.js.map → server-KCG3B4WQ.js.map} +0 -0
  389. /package/dist/{session-M6HOZ56B.js.map → session-BR5MTI3X.js.map} +0 -0
  390. /package/dist/{share-next-QRBVSD37.js.map → share-next-EPYQDJ32.js.map} +0 -0
  391. /package/dist/{worktree-3GUHT2P7.js.map → worktree-PIVTZBUE.js.map} +0 -0
@@ -1,4223 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
-
3
- import { client } from "./client.gen.js"
4
- import { buildClientParams, type Client, type Options as Options2, type TDataShape } from "./client/index.js"
5
- import type {
6
- AgentPartInput,
7
- AppAgentsResponses,
8
- AppLogErrors,
9
- AppLogResponses,
10
- AppSkillsResponses,
11
- Auth as Auth3,
12
- AuthRemoveErrors,
13
- AuthRemoveResponses,
14
- AuthSetErrors,
15
- AuthSetResponses,
16
- CommandListResponses,
17
- Config as Config3,
18
- ConfigGetResponses,
19
- ConfigProvidersResponses,
20
- ConfigUpdateErrors,
21
- ConfigUpdateResponses,
22
- EventSubscribeResponses,
23
- EventTuiCommandExecute,
24
- EventTuiPromptAppend,
25
- EventTuiSessionSelect,
26
- EventTuiToastShow,
27
- ExperimentalConsoleGetResponses,
28
- ExperimentalConsoleListOrgsResponses,
29
- ExperimentalConsoleSwitchOrgResponses,
30
- ExperimentalResourceListResponses,
31
- ExperimentalSessionListResponses,
32
- ExperimentalWorkspaceCreateErrors,
33
- ExperimentalWorkspaceCreateResponses,
34
- ExperimentalWorkspaceListResponses,
35
- ExperimentalWorkspaceRemoveErrors,
36
- ExperimentalWorkspaceRemoveResponses,
37
- FileListResponses,
38
- FilePartInput,
39
- FilePartSource,
40
- FileReadResponses,
41
- FileStatusResponses,
42
- FindFilesResponses,
43
- FindSymbolsResponses,
44
- FindTextResponses,
45
- FormatterStatusResponses,
46
- GlobalConfigGetResponses,
47
- GlobalConfigUpdateErrors,
48
- GlobalConfigUpdateResponses,
49
- GlobalDisposeResponses,
50
- GlobalEventResponses,
51
- GlobalHealthResponses,
52
- GlobalSyncEventSubscribeResponses,
53
- GlobalUpgradeErrors,
54
- GlobalUpgradeResponses,
55
- InstanceDisposeResponses,
56
- LspStatusResponses,
57
- McpAddErrors,
58
- McpAddResponses,
59
- McpAuthAuthenticateErrors,
60
- McpAuthAuthenticateResponses,
61
- McpAuthCallbackErrors,
62
- McpAuthCallbackResponses,
63
- McpAuthRemoveErrors,
64
- McpAuthRemoveResponses,
65
- McpAuthStartErrors,
66
- McpAuthStartResponses,
67
- McpConnectResponses,
68
- McpDisconnectResponses,
69
- McpLocalConfig,
70
- McpRemoteConfig,
71
- McpStatusResponses,
72
- OutputFormat,
73
- Part as Part2,
74
- PartDeleteErrors,
75
- PartDeleteResponses,
76
- PartUpdateErrors,
77
- PartUpdateResponses,
78
- PathGetResponses,
79
- PermissionListResponses,
80
- PermissionReplyErrors,
81
- PermissionReplyResponses,
82
- PermissionRespondErrors,
83
- PermissionRespondResponses,
84
- PermissionRuleset,
85
- ProjectCurrentResponses,
86
- ProjectInitGitResponses,
87
- ProjectListResponses,
88
- ProjectUpdateErrors,
89
- ProjectUpdateResponses,
90
- ProviderAuthResponses,
91
- ProviderListResponses,
92
- ProviderOauthAuthorizeErrors,
93
- ProviderOauthAuthorizeResponses,
94
- ProviderOauthCallbackErrors,
95
- ProviderOauthCallbackResponses,
96
- PtyConnectErrors,
97
- PtyConnectResponses,
98
- PtyCreateErrors,
99
- PtyCreateResponses,
100
- PtyGetErrors,
101
- PtyGetResponses,
102
- PtyListResponses,
103
- PtyRemoveErrors,
104
- PtyRemoveResponses,
105
- PtyUpdateErrors,
106
- PtyUpdateResponses,
107
- QuestionAnswer,
108
- QuestionListResponses,
109
- QuestionRejectErrors,
110
- QuestionRejectResponses,
111
- QuestionReplyErrors,
112
- QuestionReplyResponses,
113
- SessionAbortErrors,
114
- SessionAbortResponses,
115
- SessionChildrenErrors,
116
- SessionChildrenResponses,
117
- SessionCommandErrors,
118
- SessionCommandResponses,
119
- SessionCreateErrors,
120
- SessionCreateResponses,
121
- SessionDeleteErrors,
122
- SessionDeleteMessageErrors,
123
- SessionDeleteMessageResponses,
124
- SessionDeleteResponses,
125
- SessionDiffResponses,
126
- SessionForkResponses,
127
- SessionGetErrors,
128
- SessionGetResponses,
129
- SessionInitErrors,
130
- SessionInitResponses,
131
- SessionListResponses,
132
- SessionMessageErrors,
133
- SessionMessageResponses,
134
- SessionMessagesErrors,
135
- SessionMessagesResponses,
136
- SessionPromptAsyncErrors,
137
- SessionPromptAsyncResponses,
138
- SessionPromptErrors,
139
- SessionPromptResponses,
140
- SessionRevertErrors,
141
- SessionRevertResponses,
142
- SessionShareErrors,
143
- SessionShareResponses,
144
- SessionShellErrors,
145
- SessionShellResponses,
146
- SessionStatusErrors,
147
- SessionStatusResponses,
148
- SessionSummarizeErrors,
149
- SessionSummarizeResponses,
150
- SessionTodoErrors,
151
- SessionTodoResponses,
152
- SessionUnrevertErrors,
153
- SessionUnrevertResponses,
154
- SessionUnshareErrors,
155
- SessionUnshareResponses,
156
- SessionUpdateErrors,
157
- SessionUpdateResponses,
158
- SubtaskPartInput,
159
- TextPartInput,
160
- ToolIdsErrors,
161
- ToolIdsResponses,
162
- ToolListErrors,
163
- ToolListResponses,
164
- TuiAppendPromptErrors,
165
- TuiAppendPromptResponses,
166
- TuiClearPromptResponses,
167
- TuiControlNextResponses,
168
- TuiControlResponseResponses,
169
- TuiExecuteCommandErrors,
170
- TuiExecuteCommandResponses,
171
- TuiOpenHelpResponses,
172
- TuiOpenModelsResponses,
173
- TuiOpenSessionsResponses,
174
- TuiOpenThemesResponses,
175
- TuiPublishErrors,
176
- TuiPublishResponses,
177
- TuiSelectSessionErrors,
178
- TuiSelectSessionResponses,
179
- TuiShowToastResponses,
180
- TuiSubmitPromptResponses,
181
- VcsDiffResponses,
182
- VcsGetResponses,
183
- WorktreeCreateErrors,
184
- WorktreeCreateInput,
185
- WorktreeCreateResponses,
186
- WorktreeListResponses,
187
- WorktreeRemoveErrors,
188
- WorktreeRemoveInput,
189
- WorktreeRemoveResponses,
190
- WorktreeResetErrors,
191
- WorktreeResetInput,
192
- WorktreeResetResponses,
193
- } from "./types.gen.js"
194
-
195
- export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<
196
- TData,
197
- ThrowOnError
198
- > & {
199
- /**
200
- * You can provide a client instance returned by `createClient()` instead of
201
- * individual options. This might be also useful if you want to implement a
202
- * custom client.
203
- */
204
- client?: Client
205
- /**
206
- * You can pass arbitrary values through the `meta` object. This can be
207
- * used to access values that aren't defined as part of the SDK function.
208
- */
209
- meta?: Record<string, unknown>
210
- }
211
-
212
- class HeyApiClient {
213
- protected client: Client
214
-
215
- constructor(args?: { client?: Client }) {
216
- this.client = args?.client ?? client
217
- }
218
- }
219
-
220
- class HeyApiRegistry<T> {
221
- private readonly defaultKey = "default"
222
-
223
- private readonly instances: Map<string, T> = new Map()
224
-
225
- get(key?: string): T {
226
- const instance = this.instances.get(key ?? this.defaultKey)
227
- if (!instance) {
228
- throw new Error(`No SDK client found. Create one with "new OpencodeClient()" to fix this error.`)
229
- }
230
- return instance
231
- }
232
-
233
- set(value: T, key?: string): void {
234
- this.instances.set(key ?? this.defaultKey, value)
235
- }
236
- }
237
-
238
- export class SyncEvent extends HeyApiClient {
239
- /**
240
- * Subscribe to global sync events
241
- *
242
- * Get global sync events
243
- */
244
- public subscribe<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
245
- return (options?.client ?? this.client).sse.get<GlobalSyncEventSubscribeResponses, unknown, ThrowOnError>({
246
- url: "/global/sync-event",
247
- ...options,
248
- })
249
- }
250
- }
251
-
252
- export class Config extends HeyApiClient {
253
- /**
254
- * Get global configuration
255
- *
256
- * Retrieve the current global OpenCode configuration settings and preferences.
257
- */
258
- public get<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
259
- return (options?.client ?? this.client).get<GlobalConfigGetResponses, unknown, ThrowOnError>({
260
- url: "/global/config",
261
- ...options,
262
- })
263
- }
264
-
265
- /**
266
- * Update global configuration
267
- *
268
- * Update global OpenCode configuration settings and preferences.
269
- */
270
- public update<ThrowOnError extends boolean = false>(
271
- parameters?: {
272
- config?: Config3
273
- },
274
- options?: Options<never, ThrowOnError>,
275
- ) {
276
- const params = buildClientParams([parameters], [{ args: [{ key: "config", map: "body" }] }])
277
- return (options?.client ?? this.client).patch<GlobalConfigUpdateResponses, GlobalConfigUpdateErrors, ThrowOnError>({
278
- url: "/global/config",
279
- ...options,
280
- ...params,
281
- headers: {
282
- "Content-Type": "application/json",
283
- ...options?.headers,
284
- ...params.headers,
285
- },
286
- })
287
- }
288
- }
289
-
290
- export class Global extends HeyApiClient {
291
- /**
292
- * Get health
293
- *
294
- * Get health information about the OpenCode server.
295
- */
296
- public health<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
297
- return (options?.client ?? this.client).get<GlobalHealthResponses, unknown, ThrowOnError>({
298
- url: "/global/health",
299
- ...options,
300
- })
301
- }
302
-
303
- /**
304
- * Get global events
305
- *
306
- * Subscribe to global events from the OpenCode system using server-sent events.
307
- */
308
- public event<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
309
- return (options?.client ?? this.client).sse.get<GlobalEventResponses, unknown, ThrowOnError>({
310
- url: "/global/event",
311
- ...options,
312
- })
313
- }
314
-
315
- /**
316
- * Dispose instance
317
- *
318
- * Clean up and dispose all OpenCode instances, releasing all resources.
319
- */
320
- public dispose<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
321
- return (options?.client ?? this.client).post<GlobalDisposeResponses, unknown, ThrowOnError>({
322
- url: "/global/dispose",
323
- ...options,
324
- })
325
- }
326
-
327
- /**
328
- * Upgrade opencode
329
- *
330
- * Upgrade opencode to the specified version or latest if not specified.
331
- */
332
- public upgrade<ThrowOnError extends boolean = false>(
333
- parameters?: {
334
- target?: string
335
- },
336
- options?: Options<never, ThrowOnError>,
337
- ) {
338
- const params = buildClientParams([parameters], [{ args: [{ in: "body", key: "target" }] }])
339
- return (options?.client ?? this.client).post<GlobalUpgradeResponses, GlobalUpgradeErrors, ThrowOnError>({
340
- url: "/global/upgrade",
341
- ...options,
342
- ...params,
343
- headers: {
344
- "Content-Type": "application/json",
345
- ...options?.headers,
346
- ...params.headers,
347
- },
348
- })
349
- }
350
-
351
- private _syncEvent?: SyncEvent
352
- get syncEvent(): SyncEvent {
353
- return (this._syncEvent ??= new SyncEvent({ client: this.client }))
354
- }
355
-
356
- private _config?: Config
357
- get config(): Config {
358
- return (this._config ??= new Config({ client: this.client }))
359
- }
360
- }
361
-
362
- export class Auth extends HeyApiClient {
363
- /**
364
- * Remove auth credentials
365
- *
366
- * Remove authentication credentials
367
- */
368
- public remove<ThrowOnError extends boolean = false>(
369
- parameters: {
370
- providerID: string
371
- },
372
- options?: Options<never, ThrowOnError>,
373
- ) {
374
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "providerID" }] }])
375
- return (options?.client ?? this.client).delete<AuthRemoveResponses, AuthRemoveErrors, ThrowOnError>({
376
- url: "/auth/{providerID}",
377
- ...options,
378
- ...params,
379
- })
380
- }
381
-
382
- /**
383
- * Set auth credentials
384
- *
385
- * Set authentication credentials
386
- */
387
- public set<ThrowOnError extends boolean = false>(
388
- parameters: {
389
- providerID: string
390
- auth?: Auth3
391
- },
392
- options?: Options<never, ThrowOnError>,
393
- ) {
394
- const params = buildClientParams(
395
- [parameters],
396
- [
397
- {
398
- args: [
399
- { in: "path", key: "providerID" },
400
- { key: "auth", map: "body" },
401
- ],
402
- },
403
- ],
404
- )
405
- return (options?.client ?? this.client).put<AuthSetResponses, AuthSetErrors, ThrowOnError>({
406
- url: "/auth/{providerID}",
407
- ...options,
408
- ...params,
409
- headers: {
410
- "Content-Type": "application/json",
411
- ...options?.headers,
412
- ...params.headers,
413
- },
414
- })
415
- }
416
- }
417
-
418
- export class App extends HeyApiClient {
419
- /**
420
- * Write log
421
- *
422
- * Write a log entry to the server logs with specified level and metadata.
423
- */
424
- public log<ThrowOnError extends boolean = false>(
425
- parameters?: {
426
- directory?: string
427
- workspace?: string
428
- service?: string
429
- level?: "debug" | "info" | "error" | "warn"
430
- message?: string
431
- extra?: {
432
- [key: string]: unknown
433
- }
434
- },
435
- options?: Options<never, ThrowOnError>,
436
- ) {
437
- const params = buildClientParams(
438
- [parameters],
439
- [
440
- {
441
- args: [
442
- { in: "query", key: "directory" },
443
- { in: "query", key: "workspace" },
444
- { in: "body", key: "service" },
445
- { in: "body", key: "level" },
446
- { in: "body", key: "message" },
447
- { in: "body", key: "extra" },
448
- ],
449
- },
450
- ],
451
- )
452
- return (options?.client ?? this.client).post<AppLogResponses, AppLogErrors, ThrowOnError>({
453
- url: "/log",
454
- ...options,
455
- ...params,
456
- headers: {
457
- "Content-Type": "application/json",
458
- ...options?.headers,
459
- ...params.headers,
460
- },
461
- })
462
- }
463
-
464
- /**
465
- * List agents
466
- *
467
- * Get a list of all available AI agents in the OpenCode system.
468
- */
469
- public agents<ThrowOnError extends boolean = false>(
470
- parameters?: {
471
- directory?: string
472
- workspace?: string
473
- },
474
- options?: Options<never, ThrowOnError>,
475
- ) {
476
- const params = buildClientParams(
477
- [parameters],
478
- [
479
- {
480
- args: [
481
- { in: "query", key: "directory" },
482
- { in: "query", key: "workspace" },
483
- ],
484
- },
485
- ],
486
- )
487
- return (options?.client ?? this.client).get<AppAgentsResponses, unknown, ThrowOnError>({
488
- url: "/agent",
489
- ...options,
490
- ...params,
491
- })
492
- }
493
-
494
- /**
495
- * List skills
496
- *
497
- * Get a list of all available skills in the OpenCode system.
498
- */
499
- public skills<ThrowOnError extends boolean = false>(
500
- parameters?: {
501
- directory?: string
502
- workspace?: string
503
- },
504
- options?: Options<never, ThrowOnError>,
505
- ) {
506
- const params = buildClientParams(
507
- [parameters],
508
- [
509
- {
510
- args: [
511
- { in: "query", key: "directory" },
512
- { in: "query", key: "workspace" },
513
- ],
514
- },
515
- ],
516
- )
517
- return (options?.client ?? this.client).get<AppSkillsResponses, unknown, ThrowOnError>({
518
- url: "/skill",
519
- ...options,
520
- ...params,
521
- })
522
- }
523
- }
524
-
525
- export class Project extends HeyApiClient {
526
- /**
527
- * List all projects
528
- *
529
- * Get a list of projects that have been opened with OpenCode.
530
- */
531
- public list<ThrowOnError extends boolean = false>(
532
- parameters?: {
533
- directory?: string
534
- workspace?: string
535
- },
536
- options?: Options<never, ThrowOnError>,
537
- ) {
538
- const params = buildClientParams(
539
- [parameters],
540
- [
541
- {
542
- args: [
543
- { in: "query", key: "directory" },
544
- { in: "query", key: "workspace" },
545
- ],
546
- },
547
- ],
548
- )
549
- return (options?.client ?? this.client).get<ProjectListResponses, unknown, ThrowOnError>({
550
- url: "/project",
551
- ...options,
552
- ...params,
553
- })
554
- }
555
-
556
- /**
557
- * Get current project
558
- *
559
- * Retrieve the currently active project that OpenCode is working with.
560
- */
561
- public current<ThrowOnError extends boolean = false>(
562
- parameters?: {
563
- directory?: string
564
- workspace?: string
565
- },
566
- options?: Options<never, ThrowOnError>,
567
- ) {
568
- const params = buildClientParams(
569
- [parameters],
570
- [
571
- {
572
- args: [
573
- { in: "query", key: "directory" },
574
- { in: "query", key: "workspace" },
575
- ],
576
- },
577
- ],
578
- )
579
- return (options?.client ?? this.client).get<ProjectCurrentResponses, unknown, ThrowOnError>({
580
- url: "/project/current",
581
- ...options,
582
- ...params,
583
- })
584
- }
585
-
586
- /**
587
- * Initialize git repository
588
- *
589
- * Create a git repository for the current project and return the refreshed project info.
590
- */
591
- public initGit<ThrowOnError extends boolean = false>(
592
- parameters?: {
593
- directory?: string
594
- workspace?: string
595
- },
596
- options?: Options<never, ThrowOnError>,
597
- ) {
598
- const params = buildClientParams(
599
- [parameters],
600
- [
601
- {
602
- args: [
603
- { in: "query", key: "directory" },
604
- { in: "query", key: "workspace" },
605
- ],
606
- },
607
- ],
608
- )
609
- return (options?.client ?? this.client).post<ProjectInitGitResponses, unknown, ThrowOnError>({
610
- url: "/project/git/init",
611
- ...options,
612
- ...params,
613
- })
614
- }
615
-
616
- /**
617
- * Update project
618
- *
619
- * Update project properties such as name, icon, and commands.
620
- */
621
- public update<ThrowOnError extends boolean = false>(
622
- parameters: {
623
- projectID: string
624
- directory?: string
625
- workspace?: string
626
- name?: string
627
- icon?: {
628
- url?: string
629
- override?: string
630
- color?: string
631
- }
632
- commands?: {
633
- /**
634
- * Startup script to run when creating a new workspace (worktree)
635
- */
636
- start?: string
637
- }
638
- },
639
- options?: Options<never, ThrowOnError>,
640
- ) {
641
- const params = buildClientParams(
642
- [parameters],
643
- [
644
- {
645
- args: [
646
- { in: "path", key: "projectID" },
647
- { in: "query", key: "directory" },
648
- { in: "query", key: "workspace" },
649
- { in: "body", key: "name" },
650
- { in: "body", key: "icon" },
651
- { in: "body", key: "commands" },
652
- ],
653
- },
654
- ],
655
- )
656
- return (options?.client ?? this.client).patch<ProjectUpdateResponses, ProjectUpdateErrors, ThrowOnError>({
657
- url: "/project/{projectID}",
658
- ...options,
659
- ...params,
660
- headers: {
661
- "Content-Type": "application/json",
662
- ...options?.headers,
663
- ...params.headers,
664
- },
665
- })
666
- }
667
- }
668
-
669
- export class Pty extends HeyApiClient {
670
- /**
671
- * List PTY sessions
672
- *
673
- * Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.
674
- */
675
- public list<ThrowOnError extends boolean = false>(
676
- parameters?: {
677
- directory?: string
678
- workspace?: string
679
- },
680
- options?: Options<never, ThrowOnError>,
681
- ) {
682
- const params = buildClientParams(
683
- [parameters],
684
- [
685
- {
686
- args: [
687
- { in: "query", key: "directory" },
688
- { in: "query", key: "workspace" },
689
- ],
690
- },
691
- ],
692
- )
693
- return (options?.client ?? this.client).get<PtyListResponses, unknown, ThrowOnError>({
694
- url: "/pty",
695
- ...options,
696
- ...params,
697
- })
698
- }
699
-
700
- /**
701
- * Create PTY session
702
- *
703
- * Create a new pseudo-terminal (PTY) session for running shell commands and processes.
704
- */
705
- public create<ThrowOnError extends boolean = false>(
706
- parameters?: {
707
- directory?: string
708
- workspace?: string
709
- command?: string
710
- args?: Array<string>
711
- cwd?: string
712
- title?: string
713
- env?: {
714
- [key: string]: string
715
- }
716
- },
717
- options?: Options<never, ThrowOnError>,
718
- ) {
719
- const params = buildClientParams(
720
- [parameters],
721
- [
722
- {
723
- args: [
724
- { in: "query", key: "directory" },
725
- { in: "query", key: "workspace" },
726
- { in: "body", key: "command" },
727
- { in: "body", key: "args" },
728
- { in: "body", key: "cwd" },
729
- { in: "body", key: "title" },
730
- { in: "body", key: "env" },
731
- ],
732
- },
733
- ],
734
- )
735
- return (options?.client ?? this.client).post<PtyCreateResponses, PtyCreateErrors, ThrowOnError>({
736
- url: "/pty",
737
- ...options,
738
- ...params,
739
- headers: {
740
- "Content-Type": "application/json",
741
- ...options?.headers,
742
- ...params.headers,
743
- },
744
- })
745
- }
746
-
747
- /**
748
- * Remove PTY session
749
- *
750
- * Remove and terminate a specific pseudo-terminal (PTY) session.
751
- */
752
- public remove<ThrowOnError extends boolean = false>(
753
- parameters: {
754
- ptyID: string
755
- directory?: string
756
- workspace?: string
757
- },
758
- options?: Options<never, ThrowOnError>,
759
- ) {
760
- const params = buildClientParams(
761
- [parameters],
762
- [
763
- {
764
- args: [
765
- { in: "path", key: "ptyID" },
766
- { in: "query", key: "directory" },
767
- { in: "query", key: "workspace" },
768
- ],
769
- },
770
- ],
771
- )
772
- return (options?.client ?? this.client).delete<PtyRemoveResponses, PtyRemoveErrors, ThrowOnError>({
773
- url: "/pty/{ptyID}",
774
- ...options,
775
- ...params,
776
- })
777
- }
778
-
779
- /**
780
- * Get PTY session
781
- *
782
- * Retrieve detailed information about a specific pseudo-terminal (PTY) session.
783
- */
784
- public get<ThrowOnError extends boolean = false>(
785
- parameters: {
786
- ptyID: string
787
- directory?: string
788
- workspace?: string
789
- },
790
- options?: Options<never, ThrowOnError>,
791
- ) {
792
- const params = buildClientParams(
793
- [parameters],
794
- [
795
- {
796
- args: [
797
- { in: "path", key: "ptyID" },
798
- { in: "query", key: "directory" },
799
- { in: "query", key: "workspace" },
800
- ],
801
- },
802
- ],
803
- )
804
- return (options?.client ?? this.client).get<PtyGetResponses, PtyGetErrors, ThrowOnError>({
805
- url: "/pty/{ptyID}",
806
- ...options,
807
- ...params,
808
- })
809
- }
810
-
811
- /**
812
- * Update PTY session
813
- *
814
- * Update properties of an existing pseudo-terminal (PTY) session.
815
- */
816
- public update<ThrowOnError extends boolean = false>(
817
- parameters: {
818
- ptyID: string
819
- directory?: string
820
- workspace?: string
821
- title?: string
822
- size?: {
823
- rows: number
824
- cols: number
825
- }
826
- },
827
- options?: Options<never, ThrowOnError>,
828
- ) {
829
- const params = buildClientParams(
830
- [parameters],
831
- [
832
- {
833
- args: [
834
- { in: "path", key: "ptyID" },
835
- { in: "query", key: "directory" },
836
- { in: "query", key: "workspace" },
837
- { in: "body", key: "title" },
838
- { in: "body", key: "size" },
839
- ],
840
- },
841
- ],
842
- )
843
- return (options?.client ?? this.client).put<PtyUpdateResponses, PtyUpdateErrors, ThrowOnError>({
844
- url: "/pty/{ptyID}",
845
- ...options,
846
- ...params,
847
- headers: {
848
- "Content-Type": "application/json",
849
- ...options?.headers,
850
- ...params.headers,
851
- },
852
- })
853
- }
854
-
855
- /**
856
- * Connect to PTY session
857
- *
858
- * Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.
859
- */
860
- public connect<ThrowOnError extends boolean = false>(
861
- parameters: {
862
- ptyID: string
863
- directory?: string
864
- workspace?: string
865
- },
866
- options?: Options<never, ThrowOnError>,
867
- ) {
868
- const params = buildClientParams(
869
- [parameters],
870
- [
871
- {
872
- args: [
873
- { in: "path", key: "ptyID" },
874
- { in: "query", key: "directory" },
875
- { in: "query", key: "workspace" },
876
- ],
877
- },
878
- ],
879
- )
880
- return (options?.client ?? this.client).get<PtyConnectResponses, PtyConnectErrors, ThrowOnError>({
881
- url: "/pty/{ptyID}/connect",
882
- ...options,
883
- ...params,
884
- })
885
- }
886
- }
887
-
888
- export class Config2 extends HeyApiClient {
889
- /**
890
- * Get configuration
891
- *
892
- * Retrieve the current OpenCode configuration settings and preferences.
893
- */
894
- public get<ThrowOnError extends boolean = false>(
895
- parameters?: {
896
- directory?: string
897
- workspace?: string
898
- },
899
- options?: Options<never, ThrowOnError>,
900
- ) {
901
- const params = buildClientParams(
902
- [parameters],
903
- [
904
- {
905
- args: [
906
- { in: "query", key: "directory" },
907
- { in: "query", key: "workspace" },
908
- ],
909
- },
910
- ],
911
- )
912
- return (options?.client ?? this.client).get<ConfigGetResponses, unknown, ThrowOnError>({
913
- url: "/config",
914
- ...options,
915
- ...params,
916
- })
917
- }
918
-
919
- /**
920
- * Update configuration
921
- *
922
- * Update OpenCode configuration settings and preferences.
923
- */
924
- public update<ThrowOnError extends boolean = false>(
925
- parameters?: {
926
- directory?: string
927
- workspace?: string
928
- config?: Config3
929
- },
930
- options?: Options<never, ThrowOnError>,
931
- ) {
932
- const params = buildClientParams(
933
- [parameters],
934
- [
935
- {
936
- args: [
937
- { in: "query", key: "directory" },
938
- { in: "query", key: "workspace" },
939
- { key: "config", map: "body" },
940
- ],
941
- },
942
- ],
943
- )
944
- return (options?.client ?? this.client).patch<ConfigUpdateResponses, ConfigUpdateErrors, ThrowOnError>({
945
- url: "/config",
946
- ...options,
947
- ...params,
948
- headers: {
949
- "Content-Type": "application/json",
950
- ...options?.headers,
951
- ...params.headers,
952
- },
953
- })
954
- }
955
-
956
- /**
957
- * List config providers
958
- *
959
- * Get a list of all configured AI providers and their default models.
960
- */
961
- public providers<ThrowOnError extends boolean = false>(
962
- parameters?: {
963
- directory?: string
964
- workspace?: string
965
- },
966
- options?: Options<never, ThrowOnError>,
967
- ) {
968
- const params = buildClientParams(
969
- [parameters],
970
- [
971
- {
972
- args: [
973
- { in: "query", key: "directory" },
974
- { in: "query", key: "workspace" },
975
- ],
976
- },
977
- ],
978
- )
979
- return (options?.client ?? this.client).get<ConfigProvidersResponses, unknown, ThrowOnError>({
980
- url: "/config/providers",
981
- ...options,
982
- ...params,
983
- })
984
- }
985
- }
986
-
987
- export class Console extends HeyApiClient {
988
- /**
989
- * Get active Console provider metadata
990
- *
991
- * Get the active Console org name and the set of provider IDs managed by that Console org.
992
- */
993
- public get<ThrowOnError extends boolean = false>(
994
- parameters?: {
995
- directory?: string
996
- workspace?: string
997
- },
998
- options?: Options<never, ThrowOnError>,
999
- ) {
1000
- const params = buildClientParams(
1001
- [parameters],
1002
- [
1003
- {
1004
- args: [
1005
- { in: "query", key: "directory" },
1006
- { in: "query", key: "workspace" },
1007
- ],
1008
- },
1009
- ],
1010
- )
1011
- return (options?.client ?? this.client).get<ExperimentalConsoleGetResponses, unknown, ThrowOnError>({
1012
- url: "/experimental/console",
1013
- ...options,
1014
- ...params,
1015
- })
1016
- }
1017
-
1018
- /**
1019
- * List switchable Console orgs
1020
- *
1021
- * Get the available Console orgs across logged-in accounts, including the current active org.
1022
- */
1023
- public listOrgs<ThrowOnError extends boolean = false>(
1024
- parameters?: {
1025
- directory?: string
1026
- workspace?: string
1027
- },
1028
- options?: Options<never, ThrowOnError>,
1029
- ) {
1030
- const params = buildClientParams(
1031
- [parameters],
1032
- [
1033
- {
1034
- args: [
1035
- { in: "query", key: "directory" },
1036
- { in: "query", key: "workspace" },
1037
- ],
1038
- },
1039
- ],
1040
- )
1041
- return (options?.client ?? this.client).get<ExperimentalConsoleListOrgsResponses, unknown, ThrowOnError>({
1042
- url: "/experimental/console/orgs",
1043
- ...options,
1044
- ...params,
1045
- })
1046
- }
1047
-
1048
- /**
1049
- * Switch active Console org
1050
- *
1051
- * Persist a new active Console account/org selection for the current local OpenCode state.
1052
- */
1053
- public switchOrg<ThrowOnError extends boolean = false>(
1054
- parameters?: {
1055
- directory?: string
1056
- workspace?: string
1057
- accountID?: string
1058
- orgID?: string
1059
- },
1060
- options?: Options<never, ThrowOnError>,
1061
- ) {
1062
- const params = buildClientParams(
1063
- [parameters],
1064
- [
1065
- {
1066
- args: [
1067
- { in: "query", key: "directory" },
1068
- { in: "query", key: "workspace" },
1069
- { in: "body", key: "accountID" },
1070
- { in: "body", key: "orgID" },
1071
- ],
1072
- },
1073
- ],
1074
- )
1075
- return (options?.client ?? this.client).post<ExperimentalConsoleSwitchOrgResponses, unknown, ThrowOnError>({
1076
- url: "/experimental/console/switch",
1077
- ...options,
1078
- ...params,
1079
- headers: {
1080
- "Content-Type": "application/json",
1081
- ...options?.headers,
1082
- ...params.headers,
1083
- },
1084
- })
1085
- }
1086
- }
1087
-
1088
- export class Workspace extends HeyApiClient {
1089
- /**
1090
- * List workspaces
1091
- *
1092
- * List all workspaces.
1093
- */
1094
- public list<ThrowOnError extends boolean = false>(
1095
- parameters?: {
1096
- directory?: string
1097
- workspace?: string
1098
- },
1099
- options?: Options<never, ThrowOnError>,
1100
- ) {
1101
- const params = buildClientParams(
1102
- [parameters],
1103
- [
1104
- {
1105
- args: [
1106
- { in: "query", key: "directory" },
1107
- { in: "query", key: "workspace" },
1108
- ],
1109
- },
1110
- ],
1111
- )
1112
- return (options?.client ?? this.client).get<ExperimentalWorkspaceListResponses, unknown, ThrowOnError>({
1113
- url: "/experimental/workspace",
1114
- ...options,
1115
- ...params,
1116
- })
1117
- }
1118
-
1119
- /**
1120
- * Create workspace
1121
- *
1122
- * Create a workspace for the current project.
1123
- */
1124
- public create<ThrowOnError extends boolean = false>(
1125
- parameters?: {
1126
- directory?: string
1127
- workspace?: string
1128
- id?: string
1129
- type?: string
1130
- branch?: string | null
1131
- extra?: unknown | null
1132
- },
1133
- options?: Options<never, ThrowOnError>,
1134
- ) {
1135
- const params = buildClientParams(
1136
- [parameters],
1137
- [
1138
- {
1139
- args: [
1140
- { in: "query", key: "directory" },
1141
- { in: "query", key: "workspace" },
1142
- { in: "body", key: "id" },
1143
- { in: "body", key: "type" },
1144
- { in: "body", key: "branch" },
1145
- { in: "body", key: "extra" },
1146
- ],
1147
- },
1148
- ],
1149
- )
1150
- return (options?.client ?? this.client).post<
1151
- ExperimentalWorkspaceCreateResponses,
1152
- ExperimentalWorkspaceCreateErrors,
1153
- ThrowOnError
1154
- >({
1155
- url: "/experimental/workspace",
1156
- ...options,
1157
- ...params,
1158
- headers: {
1159
- "Content-Type": "application/json",
1160
- ...options?.headers,
1161
- ...params.headers,
1162
- },
1163
- })
1164
- }
1165
-
1166
- /**
1167
- * Remove workspace
1168
- *
1169
- * Remove an existing workspace.
1170
- */
1171
- public remove<ThrowOnError extends boolean = false>(
1172
- parameters: {
1173
- id: string
1174
- directory?: string
1175
- workspace?: string
1176
- },
1177
- options?: Options<never, ThrowOnError>,
1178
- ) {
1179
- const params = buildClientParams(
1180
- [parameters],
1181
- [
1182
- {
1183
- args: [
1184
- { in: "path", key: "id" },
1185
- { in: "query", key: "directory" },
1186
- { in: "query", key: "workspace" },
1187
- ],
1188
- },
1189
- ],
1190
- )
1191
- return (options?.client ?? this.client).delete<
1192
- ExperimentalWorkspaceRemoveResponses,
1193
- ExperimentalWorkspaceRemoveErrors,
1194
- ThrowOnError
1195
- >({
1196
- url: "/experimental/workspace/{id}",
1197
- ...options,
1198
- ...params,
1199
- })
1200
- }
1201
- }
1202
-
1203
- export class Session extends HeyApiClient {
1204
- /**
1205
- * List sessions
1206
- *
1207
- * Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.
1208
- */
1209
- public list<ThrowOnError extends boolean = false>(
1210
- parameters?: {
1211
- directory?: string
1212
- workspace?: string
1213
- roots?: boolean
1214
- start?: number
1215
- cursor?: number
1216
- search?: string
1217
- limit?: number
1218
- archived?: boolean
1219
- },
1220
- options?: Options<never, ThrowOnError>,
1221
- ) {
1222
- const params = buildClientParams(
1223
- [parameters],
1224
- [
1225
- {
1226
- args: [
1227
- { in: "query", key: "directory" },
1228
- { in: "query", key: "workspace" },
1229
- { in: "query", key: "roots" },
1230
- { in: "query", key: "start" },
1231
- { in: "query", key: "cursor" },
1232
- { in: "query", key: "search" },
1233
- { in: "query", key: "limit" },
1234
- { in: "query", key: "archived" },
1235
- ],
1236
- },
1237
- ],
1238
- )
1239
- return (options?.client ?? this.client).get<ExperimentalSessionListResponses, unknown, ThrowOnError>({
1240
- url: "/experimental/session",
1241
- ...options,
1242
- ...params,
1243
- })
1244
- }
1245
- }
1246
-
1247
- export class Resource extends HeyApiClient {
1248
- /**
1249
- * Get MCP resources
1250
- *
1251
- * Get all available MCP resources from connected servers. Optionally filter by name.
1252
- */
1253
- public list<ThrowOnError extends boolean = false>(
1254
- parameters?: {
1255
- directory?: string
1256
- workspace?: string
1257
- },
1258
- options?: Options<never, ThrowOnError>,
1259
- ) {
1260
- const params = buildClientParams(
1261
- [parameters],
1262
- [
1263
- {
1264
- args: [
1265
- { in: "query", key: "directory" },
1266
- { in: "query", key: "workspace" },
1267
- ],
1268
- },
1269
- ],
1270
- )
1271
- return (options?.client ?? this.client).get<ExperimentalResourceListResponses, unknown, ThrowOnError>({
1272
- url: "/experimental/resource",
1273
- ...options,
1274
- ...params,
1275
- })
1276
- }
1277
- }
1278
-
1279
- export class Experimental extends HeyApiClient {
1280
- private _console?: Console
1281
- get console(): Console {
1282
- return (this._console ??= new Console({ client: this.client }))
1283
- }
1284
-
1285
- private _workspace?: Workspace
1286
- get workspace(): Workspace {
1287
- return (this._workspace ??= new Workspace({ client: this.client }))
1288
- }
1289
-
1290
- private _session?: Session
1291
- get session(): Session {
1292
- return (this._session ??= new Session({ client: this.client }))
1293
- }
1294
-
1295
- private _resource?: Resource
1296
- get resource(): Resource {
1297
- return (this._resource ??= new Resource({ client: this.client }))
1298
- }
1299
- }
1300
-
1301
- export class Tool extends HeyApiClient {
1302
- /**
1303
- * List tool IDs
1304
- *
1305
- * Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.
1306
- */
1307
- public ids<ThrowOnError extends boolean = false>(
1308
- parameters?: {
1309
- directory?: string
1310
- workspace?: string
1311
- },
1312
- options?: Options<never, ThrowOnError>,
1313
- ) {
1314
- const params = buildClientParams(
1315
- [parameters],
1316
- [
1317
- {
1318
- args: [
1319
- { in: "query", key: "directory" },
1320
- { in: "query", key: "workspace" },
1321
- ],
1322
- },
1323
- ],
1324
- )
1325
- return (options?.client ?? this.client).get<ToolIdsResponses, ToolIdsErrors, ThrowOnError>({
1326
- url: "/experimental/tool/ids",
1327
- ...options,
1328
- ...params,
1329
- })
1330
- }
1331
-
1332
- /**
1333
- * List tools
1334
- *
1335
- * Get a list of available tools with their JSON schema parameters for a specific provider and model combination.
1336
- */
1337
- public list<ThrowOnError extends boolean = false>(
1338
- parameters: {
1339
- directory?: string
1340
- workspace?: string
1341
- provider: string
1342
- model: string
1343
- },
1344
- options?: Options<never, ThrowOnError>,
1345
- ) {
1346
- const params = buildClientParams(
1347
- [parameters],
1348
- [
1349
- {
1350
- args: [
1351
- { in: "query", key: "directory" },
1352
- { in: "query", key: "workspace" },
1353
- { in: "query", key: "provider" },
1354
- { in: "query", key: "model" },
1355
- ],
1356
- },
1357
- ],
1358
- )
1359
- return (options?.client ?? this.client).get<ToolListResponses, ToolListErrors, ThrowOnError>({
1360
- url: "/experimental/tool",
1361
- ...options,
1362
- ...params,
1363
- })
1364
- }
1365
- }
1366
-
1367
- export class Worktree extends HeyApiClient {
1368
- /**
1369
- * Remove worktree
1370
- *
1371
- * Remove a git worktree and delete its branch.
1372
- */
1373
- public remove<ThrowOnError extends boolean = false>(
1374
- parameters?: {
1375
- directory?: string
1376
- workspace?: string
1377
- worktreeRemoveInput?: WorktreeRemoveInput
1378
- },
1379
- options?: Options<never, ThrowOnError>,
1380
- ) {
1381
- const params = buildClientParams(
1382
- [parameters],
1383
- [
1384
- {
1385
- args: [
1386
- { in: "query", key: "directory" },
1387
- { in: "query", key: "workspace" },
1388
- { key: "worktreeRemoveInput", map: "body" },
1389
- ],
1390
- },
1391
- ],
1392
- )
1393
- return (options?.client ?? this.client).delete<WorktreeRemoveResponses, WorktreeRemoveErrors, ThrowOnError>({
1394
- url: "/experimental/worktree",
1395
- ...options,
1396
- ...params,
1397
- headers: {
1398
- "Content-Type": "application/json",
1399
- ...options?.headers,
1400
- ...params.headers,
1401
- },
1402
- })
1403
- }
1404
-
1405
- /**
1406
- * List worktrees
1407
- *
1408
- * List all sandbox worktrees for the current project.
1409
- */
1410
- public list<ThrowOnError extends boolean = false>(
1411
- parameters?: {
1412
- directory?: string
1413
- workspace?: string
1414
- },
1415
- options?: Options<never, ThrowOnError>,
1416
- ) {
1417
- const params = buildClientParams(
1418
- [parameters],
1419
- [
1420
- {
1421
- args: [
1422
- { in: "query", key: "directory" },
1423
- { in: "query", key: "workspace" },
1424
- ],
1425
- },
1426
- ],
1427
- )
1428
- return (options?.client ?? this.client).get<WorktreeListResponses, unknown, ThrowOnError>({
1429
- url: "/experimental/worktree",
1430
- ...options,
1431
- ...params,
1432
- })
1433
- }
1434
-
1435
- /**
1436
- * Create worktree
1437
- *
1438
- * Create a new git worktree for the current project and run any configured startup scripts.
1439
- */
1440
- public create<ThrowOnError extends boolean = false>(
1441
- parameters?: {
1442
- directory?: string
1443
- workspace?: string
1444
- worktreeCreateInput?: WorktreeCreateInput
1445
- },
1446
- options?: Options<never, ThrowOnError>,
1447
- ) {
1448
- const params = buildClientParams(
1449
- [parameters],
1450
- [
1451
- {
1452
- args: [
1453
- { in: "query", key: "directory" },
1454
- { in: "query", key: "workspace" },
1455
- { key: "worktreeCreateInput", map: "body" },
1456
- ],
1457
- },
1458
- ],
1459
- )
1460
- return (options?.client ?? this.client).post<WorktreeCreateResponses, WorktreeCreateErrors, ThrowOnError>({
1461
- url: "/experimental/worktree",
1462
- ...options,
1463
- ...params,
1464
- headers: {
1465
- "Content-Type": "application/json",
1466
- ...options?.headers,
1467
- ...params.headers,
1468
- },
1469
- })
1470
- }
1471
-
1472
- /**
1473
- * Reset worktree
1474
- *
1475
- * Reset a worktree branch to the primary default branch.
1476
- */
1477
- public reset<ThrowOnError extends boolean = false>(
1478
- parameters?: {
1479
- directory?: string
1480
- workspace?: string
1481
- worktreeResetInput?: WorktreeResetInput
1482
- },
1483
- options?: Options<never, ThrowOnError>,
1484
- ) {
1485
- const params = buildClientParams(
1486
- [parameters],
1487
- [
1488
- {
1489
- args: [
1490
- { in: "query", key: "directory" },
1491
- { in: "query", key: "workspace" },
1492
- { key: "worktreeResetInput", map: "body" },
1493
- ],
1494
- },
1495
- ],
1496
- )
1497
- return (options?.client ?? this.client).post<WorktreeResetResponses, WorktreeResetErrors, ThrowOnError>({
1498
- url: "/experimental/worktree/reset",
1499
- ...options,
1500
- ...params,
1501
- headers: {
1502
- "Content-Type": "application/json",
1503
- ...options?.headers,
1504
- ...params.headers,
1505
- },
1506
- })
1507
- }
1508
- }
1509
-
1510
- export class Session2 extends HeyApiClient {
1511
- /**
1512
- * List sessions
1513
- *
1514
- * Get a list of all OpenCode sessions, sorted by most recently updated.
1515
- */
1516
- public list<ThrowOnError extends boolean = false>(
1517
- parameters?: {
1518
- directory?: string
1519
- workspace?: string
1520
- roots?: boolean
1521
- start?: number
1522
- search?: string
1523
- limit?: number
1524
- },
1525
- options?: Options<never, ThrowOnError>,
1526
- ) {
1527
- const params = buildClientParams(
1528
- [parameters],
1529
- [
1530
- {
1531
- args: [
1532
- { in: "query", key: "directory" },
1533
- { in: "query", key: "workspace" },
1534
- { in: "query", key: "roots" },
1535
- { in: "query", key: "start" },
1536
- { in: "query", key: "search" },
1537
- { in: "query", key: "limit" },
1538
- ],
1539
- },
1540
- ],
1541
- )
1542
- return (options?.client ?? this.client).get<SessionListResponses, unknown, ThrowOnError>({
1543
- url: "/session",
1544
- ...options,
1545
- ...params,
1546
- })
1547
- }
1548
-
1549
- /**
1550
- * Create session
1551
- *
1552
- * Create a new OpenCode session for interacting with AI assistants and managing conversations.
1553
- */
1554
- public create<ThrowOnError extends boolean = false>(
1555
- parameters?: {
1556
- directory?: string
1557
- workspace?: string
1558
- parentID?: string
1559
- title?: string
1560
- permission?: PermissionRuleset
1561
- workspaceID?: string
1562
- },
1563
- options?: Options<never, ThrowOnError>,
1564
- ) {
1565
- const params = buildClientParams(
1566
- [parameters],
1567
- [
1568
- {
1569
- args: [
1570
- { in: "query", key: "directory" },
1571
- { in: "query", key: "workspace" },
1572
- { in: "body", key: "parentID" },
1573
- { in: "body", key: "title" },
1574
- { in: "body", key: "permission" },
1575
- { in: "body", key: "workspaceID" },
1576
- ],
1577
- },
1578
- ],
1579
- )
1580
- return (options?.client ?? this.client).post<SessionCreateResponses, SessionCreateErrors, ThrowOnError>({
1581
- url: "/session",
1582
- ...options,
1583
- ...params,
1584
- headers: {
1585
- "Content-Type": "application/json",
1586
- ...options?.headers,
1587
- ...params.headers,
1588
- },
1589
- })
1590
- }
1591
-
1592
- /**
1593
- * Get session status
1594
- *
1595
- * Retrieve the current status of all sessions, including active, idle, and completed states.
1596
- */
1597
- public status<ThrowOnError extends boolean = false>(
1598
- parameters?: {
1599
- directory?: string
1600
- workspace?: string
1601
- },
1602
- options?: Options<never, ThrowOnError>,
1603
- ) {
1604
- const params = buildClientParams(
1605
- [parameters],
1606
- [
1607
- {
1608
- args: [
1609
- { in: "query", key: "directory" },
1610
- { in: "query", key: "workspace" },
1611
- ],
1612
- },
1613
- ],
1614
- )
1615
- return (options?.client ?? this.client).get<SessionStatusResponses, SessionStatusErrors, ThrowOnError>({
1616
- url: "/session/status",
1617
- ...options,
1618
- ...params,
1619
- })
1620
- }
1621
-
1622
- /**
1623
- * Delete session
1624
- *
1625
- * Delete a session and permanently remove all associated data, including messages and history.
1626
- */
1627
- public delete<ThrowOnError extends boolean = false>(
1628
- parameters: {
1629
- sessionID: string
1630
- directory?: string
1631
- workspace?: string
1632
- },
1633
- options?: Options<never, ThrowOnError>,
1634
- ) {
1635
- const params = buildClientParams(
1636
- [parameters],
1637
- [
1638
- {
1639
- args: [
1640
- { in: "path", key: "sessionID" },
1641
- { in: "query", key: "directory" },
1642
- { in: "query", key: "workspace" },
1643
- ],
1644
- },
1645
- ],
1646
- )
1647
- return (options?.client ?? this.client).delete<SessionDeleteResponses, SessionDeleteErrors, ThrowOnError>({
1648
- url: "/session/{sessionID}",
1649
- ...options,
1650
- ...params,
1651
- })
1652
- }
1653
-
1654
- /**
1655
- * Get session
1656
- *
1657
- * Retrieve detailed information about a specific OpenCode session.
1658
- */
1659
- public get<ThrowOnError extends boolean = false>(
1660
- parameters: {
1661
- sessionID: string
1662
- directory?: string
1663
- workspace?: string
1664
- },
1665
- options?: Options<never, ThrowOnError>,
1666
- ) {
1667
- const params = buildClientParams(
1668
- [parameters],
1669
- [
1670
- {
1671
- args: [
1672
- { in: "path", key: "sessionID" },
1673
- { in: "query", key: "directory" },
1674
- { in: "query", key: "workspace" },
1675
- ],
1676
- },
1677
- ],
1678
- )
1679
- return (options?.client ?? this.client).get<SessionGetResponses, SessionGetErrors, ThrowOnError>({
1680
- url: "/session/{sessionID}",
1681
- ...options,
1682
- ...params,
1683
- })
1684
- }
1685
-
1686
- /**
1687
- * Update session
1688
- *
1689
- * Update properties of an existing session, such as title or other metadata.
1690
- */
1691
- public update<ThrowOnError extends boolean = false>(
1692
- parameters: {
1693
- sessionID: string
1694
- directory?: string
1695
- workspace?: string
1696
- title?: string
1697
- time?: {
1698
- archived?: number
1699
- }
1700
- },
1701
- options?: Options<never, ThrowOnError>,
1702
- ) {
1703
- const params = buildClientParams(
1704
- [parameters],
1705
- [
1706
- {
1707
- args: [
1708
- { in: "path", key: "sessionID" },
1709
- { in: "query", key: "directory" },
1710
- { in: "query", key: "workspace" },
1711
- { in: "body", key: "title" },
1712
- { in: "body", key: "time" },
1713
- ],
1714
- },
1715
- ],
1716
- )
1717
- return (options?.client ?? this.client).patch<SessionUpdateResponses, SessionUpdateErrors, ThrowOnError>({
1718
- url: "/session/{sessionID}",
1719
- ...options,
1720
- ...params,
1721
- headers: {
1722
- "Content-Type": "application/json",
1723
- ...options?.headers,
1724
- ...params.headers,
1725
- },
1726
- })
1727
- }
1728
-
1729
- /**
1730
- * Get session children
1731
- *
1732
- * Retrieve all child sessions that were forked from the specified parent session.
1733
- */
1734
- public children<ThrowOnError extends boolean = false>(
1735
- parameters: {
1736
- sessionID: string
1737
- directory?: string
1738
- workspace?: string
1739
- },
1740
- options?: Options<never, ThrowOnError>,
1741
- ) {
1742
- const params = buildClientParams(
1743
- [parameters],
1744
- [
1745
- {
1746
- args: [
1747
- { in: "path", key: "sessionID" },
1748
- { in: "query", key: "directory" },
1749
- { in: "query", key: "workspace" },
1750
- ],
1751
- },
1752
- ],
1753
- )
1754
- return (options?.client ?? this.client).get<SessionChildrenResponses, SessionChildrenErrors, ThrowOnError>({
1755
- url: "/session/{sessionID}/children",
1756
- ...options,
1757
- ...params,
1758
- })
1759
- }
1760
-
1761
- /**
1762
- * Get session todos
1763
- *
1764
- * Retrieve the todo list associated with a specific session, showing tasks and action items.
1765
- */
1766
- public todo<ThrowOnError extends boolean = false>(
1767
- parameters: {
1768
- sessionID: string
1769
- directory?: string
1770
- workspace?: string
1771
- },
1772
- options?: Options<never, ThrowOnError>,
1773
- ) {
1774
- const params = buildClientParams(
1775
- [parameters],
1776
- [
1777
- {
1778
- args: [
1779
- { in: "path", key: "sessionID" },
1780
- { in: "query", key: "directory" },
1781
- { in: "query", key: "workspace" },
1782
- ],
1783
- },
1784
- ],
1785
- )
1786
- return (options?.client ?? this.client).get<SessionTodoResponses, SessionTodoErrors, ThrowOnError>({
1787
- url: "/session/{sessionID}/todo",
1788
- ...options,
1789
- ...params,
1790
- })
1791
- }
1792
-
1793
- /**
1794
- * Initialize session
1795
- *
1796
- * Analyze the current application and create an AGENTS.md file with project-specific agent configurations.
1797
- */
1798
- public init<ThrowOnError extends boolean = false>(
1799
- parameters: {
1800
- sessionID: string
1801
- directory?: string
1802
- workspace?: string
1803
- modelID?: string
1804
- providerID?: string
1805
- messageID?: string
1806
- },
1807
- options?: Options<never, ThrowOnError>,
1808
- ) {
1809
- const params = buildClientParams(
1810
- [parameters],
1811
- [
1812
- {
1813
- args: [
1814
- { in: "path", key: "sessionID" },
1815
- { in: "query", key: "directory" },
1816
- { in: "query", key: "workspace" },
1817
- { in: "body", key: "modelID" },
1818
- { in: "body", key: "providerID" },
1819
- { in: "body", key: "messageID" },
1820
- ],
1821
- },
1822
- ],
1823
- )
1824
- return (options?.client ?? this.client).post<SessionInitResponses, SessionInitErrors, ThrowOnError>({
1825
- url: "/session/{sessionID}/init",
1826
- ...options,
1827
- ...params,
1828
- headers: {
1829
- "Content-Type": "application/json",
1830
- ...options?.headers,
1831
- ...params.headers,
1832
- },
1833
- })
1834
- }
1835
-
1836
- /**
1837
- * Fork session
1838
- *
1839
- * Create a new session by forking an existing session at a specific message point.
1840
- */
1841
- public fork<ThrowOnError extends boolean = false>(
1842
- parameters: {
1843
- sessionID: string
1844
- directory?: string
1845
- workspace?: string
1846
- messageID?: string
1847
- },
1848
- options?: Options<never, ThrowOnError>,
1849
- ) {
1850
- const params = buildClientParams(
1851
- [parameters],
1852
- [
1853
- {
1854
- args: [
1855
- { in: "path", key: "sessionID" },
1856
- { in: "query", key: "directory" },
1857
- { in: "query", key: "workspace" },
1858
- { in: "body", key: "messageID" },
1859
- ],
1860
- },
1861
- ],
1862
- )
1863
- return (options?.client ?? this.client).post<SessionForkResponses, unknown, ThrowOnError>({
1864
- url: "/session/{sessionID}/fork",
1865
- ...options,
1866
- ...params,
1867
- headers: {
1868
- "Content-Type": "application/json",
1869
- ...options?.headers,
1870
- ...params.headers,
1871
- },
1872
- })
1873
- }
1874
-
1875
- /**
1876
- * Abort session
1877
- *
1878
- * Abort an active session and stop any ongoing AI processing or command execution.
1879
- */
1880
- public abort<ThrowOnError extends boolean = false>(
1881
- parameters: {
1882
- sessionID: string
1883
- directory?: string
1884
- workspace?: string
1885
- },
1886
- options?: Options<never, ThrowOnError>,
1887
- ) {
1888
- const params = buildClientParams(
1889
- [parameters],
1890
- [
1891
- {
1892
- args: [
1893
- { in: "path", key: "sessionID" },
1894
- { in: "query", key: "directory" },
1895
- { in: "query", key: "workspace" },
1896
- ],
1897
- },
1898
- ],
1899
- )
1900
- return (options?.client ?? this.client).post<SessionAbortResponses, SessionAbortErrors, ThrowOnError>({
1901
- url: "/session/{sessionID}/abort",
1902
- ...options,
1903
- ...params,
1904
- })
1905
- }
1906
-
1907
- /**
1908
- * Unshare session
1909
- *
1910
- * Remove the shareable link for a session, making it private again.
1911
- */
1912
- public unshare<ThrowOnError extends boolean = false>(
1913
- parameters: {
1914
- sessionID: string
1915
- directory?: string
1916
- workspace?: string
1917
- },
1918
- options?: Options<never, ThrowOnError>,
1919
- ) {
1920
- const params = buildClientParams(
1921
- [parameters],
1922
- [
1923
- {
1924
- args: [
1925
- { in: "path", key: "sessionID" },
1926
- { in: "query", key: "directory" },
1927
- { in: "query", key: "workspace" },
1928
- ],
1929
- },
1930
- ],
1931
- )
1932
- return (options?.client ?? this.client).delete<SessionUnshareResponses, SessionUnshareErrors, ThrowOnError>({
1933
- url: "/session/{sessionID}/share",
1934
- ...options,
1935
- ...params,
1936
- })
1937
- }
1938
-
1939
- /**
1940
- * Share session
1941
- *
1942
- * Create a shareable link for a session, allowing others to view the conversation.
1943
- */
1944
- public share<ThrowOnError extends boolean = false>(
1945
- parameters: {
1946
- sessionID: string
1947
- directory?: string
1948
- workspace?: string
1949
- },
1950
- options?: Options<never, ThrowOnError>,
1951
- ) {
1952
- const params = buildClientParams(
1953
- [parameters],
1954
- [
1955
- {
1956
- args: [
1957
- { in: "path", key: "sessionID" },
1958
- { in: "query", key: "directory" },
1959
- { in: "query", key: "workspace" },
1960
- ],
1961
- },
1962
- ],
1963
- )
1964
- return (options?.client ?? this.client).post<SessionShareResponses, SessionShareErrors, ThrowOnError>({
1965
- url: "/session/{sessionID}/share",
1966
- ...options,
1967
- ...params,
1968
- })
1969
- }
1970
-
1971
- /**
1972
- * Get message diff
1973
- *
1974
- * Get the file changes (diff) that resulted from a specific user message in the session.
1975
- */
1976
- public diff<ThrowOnError extends boolean = false>(
1977
- parameters: {
1978
- sessionID: string
1979
- directory?: string
1980
- workspace?: string
1981
- messageID?: string
1982
- },
1983
- options?: Options<never, ThrowOnError>,
1984
- ) {
1985
- const params = buildClientParams(
1986
- [parameters],
1987
- [
1988
- {
1989
- args: [
1990
- { in: "path", key: "sessionID" },
1991
- { in: "query", key: "directory" },
1992
- { in: "query", key: "workspace" },
1993
- { in: "query", key: "messageID" },
1994
- ],
1995
- },
1996
- ],
1997
- )
1998
- return (options?.client ?? this.client).get<SessionDiffResponses, unknown, ThrowOnError>({
1999
- url: "/session/{sessionID}/diff",
2000
- ...options,
2001
- ...params,
2002
- })
2003
- }
2004
-
2005
- /**
2006
- * Summarize session
2007
- *
2008
- * Generate a concise summary of the session using AI compaction to preserve key information.
2009
- */
2010
- public summarize<ThrowOnError extends boolean = false>(
2011
- parameters: {
2012
- sessionID: string
2013
- directory?: string
2014
- workspace?: string
2015
- providerID?: string
2016
- modelID?: string
2017
- auto?: boolean
2018
- },
2019
- options?: Options<never, ThrowOnError>,
2020
- ) {
2021
- const params = buildClientParams(
2022
- [parameters],
2023
- [
2024
- {
2025
- args: [
2026
- { in: "path", key: "sessionID" },
2027
- { in: "query", key: "directory" },
2028
- { in: "query", key: "workspace" },
2029
- { in: "body", key: "providerID" },
2030
- { in: "body", key: "modelID" },
2031
- { in: "body", key: "auto" },
2032
- ],
2033
- },
2034
- ],
2035
- )
2036
- return (options?.client ?? this.client).post<SessionSummarizeResponses, SessionSummarizeErrors, ThrowOnError>({
2037
- url: "/session/{sessionID}/summarize",
2038
- ...options,
2039
- ...params,
2040
- headers: {
2041
- "Content-Type": "application/json",
2042
- ...options?.headers,
2043
- ...params.headers,
2044
- },
2045
- })
2046
- }
2047
-
2048
- /**
2049
- * Get session messages
2050
- *
2051
- * Retrieve all messages in a session, including user prompts and AI responses.
2052
- */
2053
- public messages<ThrowOnError extends boolean = false>(
2054
- parameters: {
2055
- sessionID: string
2056
- directory?: string
2057
- workspace?: string
2058
- limit?: number
2059
- before?: string
2060
- },
2061
- options?: Options<never, ThrowOnError>,
2062
- ) {
2063
- const params = buildClientParams(
2064
- [parameters],
2065
- [
2066
- {
2067
- args: [
2068
- { in: "path", key: "sessionID" },
2069
- { in: "query", key: "directory" },
2070
- { in: "query", key: "workspace" },
2071
- { in: "query", key: "limit" },
2072
- { in: "query", key: "before" },
2073
- ],
2074
- },
2075
- ],
2076
- )
2077
- return (options?.client ?? this.client).get<SessionMessagesResponses, SessionMessagesErrors, ThrowOnError>({
2078
- url: "/session/{sessionID}/message",
2079
- ...options,
2080
- ...params,
2081
- })
2082
- }
2083
-
2084
- /**
2085
- * Send message
2086
- *
2087
- * Create and send a new message to a session, streaming the AI response.
2088
- */
2089
- public prompt<ThrowOnError extends boolean = false>(
2090
- parameters: {
2091
- sessionID: string
2092
- directory?: string
2093
- workspace?: string
2094
- messageID?: string
2095
- model?: {
2096
- providerID: string
2097
- modelID: string
2098
- }
2099
- agent?: string
2100
- noReply?: boolean
2101
- tools?: {
2102
- [key: string]: boolean
2103
- }
2104
- format?: OutputFormat
2105
- system?: string
2106
- variant?: string
2107
- parts?: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
2108
- },
2109
- options?: Options<never, ThrowOnError>,
2110
- ) {
2111
- const params = buildClientParams(
2112
- [parameters],
2113
- [
2114
- {
2115
- args: [
2116
- { in: "path", key: "sessionID" },
2117
- { in: "query", key: "directory" },
2118
- { in: "query", key: "workspace" },
2119
- { in: "body", key: "messageID" },
2120
- { in: "body", key: "model" },
2121
- { in: "body", key: "agent" },
2122
- { in: "body", key: "noReply" },
2123
- { in: "body", key: "tools" },
2124
- { in: "body", key: "format" },
2125
- { in: "body", key: "system" },
2126
- { in: "body", key: "variant" },
2127
- { in: "body", key: "parts" },
2128
- ],
2129
- },
2130
- ],
2131
- )
2132
- return (options?.client ?? this.client).post<SessionPromptResponses, SessionPromptErrors, ThrowOnError>({
2133
- url: "/session/{sessionID}/message",
2134
- ...options,
2135
- ...params,
2136
- headers: {
2137
- "Content-Type": "application/json",
2138
- ...options?.headers,
2139
- ...params.headers,
2140
- },
2141
- })
2142
- }
2143
-
2144
- /**
2145
- * Delete message
2146
- *
2147
- * Permanently delete a specific message (and all of its parts) from a session. This does not revert any file changes that may have been made while processing the message.
2148
- */
2149
- public deleteMessage<ThrowOnError extends boolean = false>(
2150
- parameters: {
2151
- sessionID: string
2152
- messageID: string
2153
- directory?: string
2154
- workspace?: string
2155
- },
2156
- options?: Options<never, ThrowOnError>,
2157
- ) {
2158
- const params = buildClientParams(
2159
- [parameters],
2160
- [
2161
- {
2162
- args: [
2163
- { in: "path", key: "sessionID" },
2164
- { in: "path", key: "messageID" },
2165
- { in: "query", key: "directory" },
2166
- { in: "query", key: "workspace" },
2167
- ],
2168
- },
2169
- ],
2170
- )
2171
- return (options?.client ?? this.client).delete<
2172
- SessionDeleteMessageResponses,
2173
- SessionDeleteMessageErrors,
2174
- ThrowOnError
2175
- >({
2176
- url: "/session/{sessionID}/message/{messageID}",
2177
- ...options,
2178
- ...params,
2179
- })
2180
- }
2181
-
2182
- /**
2183
- * Get message
2184
- *
2185
- * Retrieve a specific message from a session by its message ID.
2186
- */
2187
- public message<ThrowOnError extends boolean = false>(
2188
- parameters: {
2189
- sessionID: string
2190
- messageID: string
2191
- directory?: string
2192
- workspace?: string
2193
- },
2194
- options?: Options<never, ThrowOnError>,
2195
- ) {
2196
- const params = buildClientParams(
2197
- [parameters],
2198
- [
2199
- {
2200
- args: [
2201
- { in: "path", key: "sessionID" },
2202
- { in: "path", key: "messageID" },
2203
- { in: "query", key: "directory" },
2204
- { in: "query", key: "workspace" },
2205
- ],
2206
- },
2207
- ],
2208
- )
2209
- return (options?.client ?? this.client).get<SessionMessageResponses, SessionMessageErrors, ThrowOnError>({
2210
- url: "/session/{sessionID}/message/{messageID}",
2211
- ...options,
2212
- ...params,
2213
- })
2214
- }
2215
-
2216
- /**
2217
- * Send async message
2218
- *
2219
- * Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.
2220
- */
2221
- public promptAsync<ThrowOnError extends boolean = false>(
2222
- parameters: {
2223
- sessionID: string
2224
- directory?: string
2225
- workspace?: string
2226
- messageID?: string
2227
- model?: {
2228
- providerID: string
2229
- modelID: string
2230
- }
2231
- agent?: string
2232
- noReply?: boolean
2233
- tools?: {
2234
- [key: string]: boolean
2235
- }
2236
- format?: OutputFormat
2237
- system?: string
2238
- variant?: string
2239
- parts?: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
2240
- },
2241
- options?: Options<never, ThrowOnError>,
2242
- ) {
2243
- const params = buildClientParams(
2244
- [parameters],
2245
- [
2246
- {
2247
- args: [
2248
- { in: "path", key: "sessionID" },
2249
- { in: "query", key: "directory" },
2250
- { in: "query", key: "workspace" },
2251
- { in: "body", key: "messageID" },
2252
- { in: "body", key: "model" },
2253
- { in: "body", key: "agent" },
2254
- { in: "body", key: "noReply" },
2255
- { in: "body", key: "tools" },
2256
- { in: "body", key: "format" },
2257
- { in: "body", key: "system" },
2258
- { in: "body", key: "variant" },
2259
- { in: "body", key: "parts" },
2260
- ],
2261
- },
2262
- ],
2263
- )
2264
- return (options?.client ?? this.client).post<SessionPromptAsyncResponses, SessionPromptAsyncErrors, ThrowOnError>({
2265
- url: "/session/{sessionID}/prompt_async",
2266
- ...options,
2267
- ...params,
2268
- headers: {
2269
- "Content-Type": "application/json",
2270
- ...options?.headers,
2271
- ...params.headers,
2272
- },
2273
- })
2274
- }
2275
-
2276
- /**
2277
- * Send command
2278
- *
2279
- * Send a new command to a session for execution by the AI assistant.
2280
- */
2281
- public command<ThrowOnError extends boolean = false>(
2282
- parameters: {
2283
- sessionID: string
2284
- directory?: string
2285
- workspace?: string
2286
- messageID?: string
2287
- agent?: string
2288
- model?: string
2289
- arguments?: string
2290
- command?: string
2291
- variant?: string
2292
- parts?: Array<{
2293
- id?: string
2294
- type: "file"
2295
- mime: string
2296
- filename?: string
2297
- url: string
2298
- source?: FilePartSource
2299
- }>
2300
- },
2301
- options?: Options<never, ThrowOnError>,
2302
- ) {
2303
- const params = buildClientParams(
2304
- [parameters],
2305
- [
2306
- {
2307
- args: [
2308
- { in: "path", key: "sessionID" },
2309
- { in: "query", key: "directory" },
2310
- { in: "query", key: "workspace" },
2311
- { in: "body", key: "messageID" },
2312
- { in: "body", key: "agent" },
2313
- { in: "body", key: "model" },
2314
- { in: "body", key: "arguments" },
2315
- { in: "body", key: "command" },
2316
- { in: "body", key: "variant" },
2317
- { in: "body", key: "parts" },
2318
- ],
2319
- },
2320
- ],
2321
- )
2322
- return (options?.client ?? this.client).post<SessionCommandResponses, SessionCommandErrors, ThrowOnError>({
2323
- url: "/session/{sessionID}/command",
2324
- ...options,
2325
- ...params,
2326
- headers: {
2327
- "Content-Type": "application/json",
2328
- ...options?.headers,
2329
- ...params.headers,
2330
- },
2331
- })
2332
- }
2333
-
2334
- /**
2335
- * Run shell command
2336
- *
2337
- * Execute a shell command within the session context and return the AI's response.
2338
- */
2339
- public shell<ThrowOnError extends boolean = false>(
2340
- parameters: {
2341
- sessionID: string
2342
- directory?: string
2343
- workspace?: string
2344
- messageID?: string
2345
- agent?: string
2346
- model?: {
2347
- providerID: string
2348
- modelID: string
2349
- }
2350
- command?: string
2351
- },
2352
- options?: Options<never, ThrowOnError>,
2353
- ) {
2354
- const params = buildClientParams(
2355
- [parameters],
2356
- [
2357
- {
2358
- args: [
2359
- { in: "path", key: "sessionID" },
2360
- { in: "query", key: "directory" },
2361
- { in: "query", key: "workspace" },
2362
- { in: "body", key: "messageID" },
2363
- { in: "body", key: "agent" },
2364
- { in: "body", key: "model" },
2365
- { in: "body", key: "command" },
2366
- ],
2367
- },
2368
- ],
2369
- )
2370
- return (options?.client ?? this.client).post<SessionShellResponses, SessionShellErrors, ThrowOnError>({
2371
- url: "/session/{sessionID}/shell",
2372
- ...options,
2373
- ...params,
2374
- headers: {
2375
- "Content-Type": "application/json",
2376
- ...options?.headers,
2377
- ...params.headers,
2378
- },
2379
- })
2380
- }
2381
-
2382
- /**
2383
- * Revert message
2384
- *
2385
- * Revert a specific message in a session, undoing its effects and restoring the previous state.
2386
- */
2387
- public revert<ThrowOnError extends boolean = false>(
2388
- parameters: {
2389
- sessionID: string
2390
- directory?: string
2391
- workspace?: string
2392
- messageID?: string
2393
- partID?: string
2394
- },
2395
- options?: Options<never, ThrowOnError>,
2396
- ) {
2397
- const params = buildClientParams(
2398
- [parameters],
2399
- [
2400
- {
2401
- args: [
2402
- { in: "path", key: "sessionID" },
2403
- { in: "query", key: "directory" },
2404
- { in: "query", key: "workspace" },
2405
- { in: "body", key: "messageID" },
2406
- { in: "body", key: "partID" },
2407
- ],
2408
- },
2409
- ],
2410
- )
2411
- return (options?.client ?? this.client).post<SessionRevertResponses, SessionRevertErrors, ThrowOnError>({
2412
- url: "/session/{sessionID}/revert",
2413
- ...options,
2414
- ...params,
2415
- headers: {
2416
- "Content-Type": "application/json",
2417
- ...options?.headers,
2418
- ...params.headers,
2419
- },
2420
- })
2421
- }
2422
-
2423
- /**
2424
- * Restore reverted messages
2425
- *
2426
- * Restore all previously reverted messages in a session.
2427
- */
2428
- public unrevert<ThrowOnError extends boolean = false>(
2429
- parameters: {
2430
- sessionID: string
2431
- directory?: string
2432
- workspace?: string
2433
- },
2434
- options?: Options<never, ThrowOnError>,
2435
- ) {
2436
- const params = buildClientParams(
2437
- [parameters],
2438
- [
2439
- {
2440
- args: [
2441
- { in: "path", key: "sessionID" },
2442
- { in: "query", key: "directory" },
2443
- { in: "query", key: "workspace" },
2444
- ],
2445
- },
2446
- ],
2447
- )
2448
- return (options?.client ?? this.client).post<SessionUnrevertResponses, SessionUnrevertErrors, ThrowOnError>({
2449
- url: "/session/{sessionID}/unrevert",
2450
- ...options,
2451
- ...params,
2452
- })
2453
- }
2454
- }
2455
-
2456
- export class Part extends HeyApiClient {
2457
- /**
2458
- * Delete a part from a message
2459
- */
2460
- public delete<ThrowOnError extends boolean = false>(
2461
- parameters: {
2462
- sessionID: string
2463
- messageID: string
2464
- partID: string
2465
- directory?: string
2466
- workspace?: string
2467
- },
2468
- options?: Options<never, ThrowOnError>,
2469
- ) {
2470
- const params = buildClientParams(
2471
- [parameters],
2472
- [
2473
- {
2474
- args: [
2475
- { in: "path", key: "sessionID" },
2476
- { in: "path", key: "messageID" },
2477
- { in: "path", key: "partID" },
2478
- { in: "query", key: "directory" },
2479
- { in: "query", key: "workspace" },
2480
- ],
2481
- },
2482
- ],
2483
- )
2484
- return (options?.client ?? this.client).delete<PartDeleteResponses, PartDeleteErrors, ThrowOnError>({
2485
- url: "/session/{sessionID}/message/{messageID}/part/{partID}",
2486
- ...options,
2487
- ...params,
2488
- })
2489
- }
2490
-
2491
- /**
2492
- * Update a part in a message
2493
- */
2494
- public update<ThrowOnError extends boolean = false>(
2495
- parameters: {
2496
- sessionID: string
2497
- messageID: string
2498
- partID: string
2499
- directory?: string
2500
- workspace?: string
2501
- part?: Part2
2502
- },
2503
- options?: Options<never, ThrowOnError>,
2504
- ) {
2505
- const params = buildClientParams(
2506
- [parameters],
2507
- [
2508
- {
2509
- args: [
2510
- { in: "path", key: "sessionID" },
2511
- { in: "path", key: "messageID" },
2512
- { in: "path", key: "partID" },
2513
- { in: "query", key: "directory" },
2514
- { in: "query", key: "workspace" },
2515
- { key: "part", map: "body" },
2516
- ],
2517
- },
2518
- ],
2519
- )
2520
- return (options?.client ?? this.client).patch<PartUpdateResponses, PartUpdateErrors, ThrowOnError>({
2521
- url: "/session/{sessionID}/message/{messageID}/part/{partID}",
2522
- ...options,
2523
- ...params,
2524
- headers: {
2525
- "Content-Type": "application/json",
2526
- ...options?.headers,
2527
- ...params.headers,
2528
- },
2529
- })
2530
- }
2531
- }
2532
-
2533
- export class Permission extends HeyApiClient {
2534
- /**
2535
- * Respond to permission
2536
- *
2537
- * Approve or deny a permission request from the AI assistant.
2538
- *
2539
- * @deprecated
2540
- */
2541
- public respond<ThrowOnError extends boolean = false>(
2542
- parameters: {
2543
- sessionID: string
2544
- permissionID: string
2545
- directory?: string
2546
- workspace?: string
2547
- response?: "once" | "always" | "reject"
2548
- },
2549
- options?: Options<never, ThrowOnError>,
2550
- ) {
2551
- const params = buildClientParams(
2552
- [parameters],
2553
- [
2554
- {
2555
- args: [
2556
- { in: "path", key: "sessionID" },
2557
- { in: "path", key: "permissionID" },
2558
- { in: "query", key: "directory" },
2559
- { in: "query", key: "workspace" },
2560
- { in: "body", key: "response" },
2561
- ],
2562
- },
2563
- ],
2564
- )
2565
- return (options?.client ?? this.client).post<PermissionRespondResponses, PermissionRespondErrors, ThrowOnError>({
2566
- url: "/session/{sessionID}/permissions/{permissionID}",
2567
- ...options,
2568
- ...params,
2569
- headers: {
2570
- "Content-Type": "application/json",
2571
- ...options?.headers,
2572
- ...params.headers,
2573
- },
2574
- })
2575
- }
2576
-
2577
- /**
2578
- * Respond to permission request
2579
- *
2580
- * Approve or deny a permission request from the AI assistant.
2581
- */
2582
- public reply<ThrowOnError extends boolean = false>(
2583
- parameters: {
2584
- requestID: string
2585
- directory?: string
2586
- workspace?: string
2587
- reply?: "once" | "always" | "reject"
2588
- message?: string
2589
- },
2590
- options?: Options<never, ThrowOnError>,
2591
- ) {
2592
- const params = buildClientParams(
2593
- [parameters],
2594
- [
2595
- {
2596
- args: [
2597
- { in: "path", key: "requestID" },
2598
- { in: "query", key: "directory" },
2599
- { in: "query", key: "workspace" },
2600
- { in: "body", key: "reply" },
2601
- { in: "body", key: "message" },
2602
- ],
2603
- },
2604
- ],
2605
- )
2606
- return (options?.client ?? this.client).post<PermissionReplyResponses, PermissionReplyErrors, ThrowOnError>({
2607
- url: "/permission/{requestID}/reply",
2608
- ...options,
2609
- ...params,
2610
- headers: {
2611
- "Content-Type": "application/json",
2612
- ...options?.headers,
2613
- ...params.headers,
2614
- },
2615
- })
2616
- }
2617
-
2618
- /**
2619
- * List pending permissions
2620
- *
2621
- * Get all pending permission requests across all sessions.
2622
- */
2623
- public list<ThrowOnError extends boolean = false>(
2624
- parameters?: {
2625
- directory?: string
2626
- workspace?: string
2627
- },
2628
- options?: Options<never, ThrowOnError>,
2629
- ) {
2630
- const params = buildClientParams(
2631
- [parameters],
2632
- [
2633
- {
2634
- args: [
2635
- { in: "query", key: "directory" },
2636
- { in: "query", key: "workspace" },
2637
- ],
2638
- },
2639
- ],
2640
- )
2641
- return (options?.client ?? this.client).get<PermissionListResponses, unknown, ThrowOnError>({
2642
- url: "/permission",
2643
- ...options,
2644
- ...params,
2645
- })
2646
- }
2647
- }
2648
-
2649
- export class Question extends HeyApiClient {
2650
- /**
2651
- * List pending questions
2652
- *
2653
- * Get all pending question requests across all sessions.
2654
- */
2655
- public list<ThrowOnError extends boolean = false>(
2656
- parameters?: {
2657
- directory?: string
2658
- workspace?: string
2659
- },
2660
- options?: Options<never, ThrowOnError>,
2661
- ) {
2662
- const params = buildClientParams(
2663
- [parameters],
2664
- [
2665
- {
2666
- args: [
2667
- { in: "query", key: "directory" },
2668
- { in: "query", key: "workspace" },
2669
- ],
2670
- },
2671
- ],
2672
- )
2673
- return (options?.client ?? this.client).get<QuestionListResponses, unknown, ThrowOnError>({
2674
- url: "/question",
2675
- ...options,
2676
- ...params,
2677
- })
2678
- }
2679
-
2680
- /**
2681
- * Reply to question request
2682
- *
2683
- * Provide answers to a question request from the AI assistant.
2684
- */
2685
- public reply<ThrowOnError extends boolean = false>(
2686
- parameters: {
2687
- requestID: string
2688
- directory?: string
2689
- workspace?: string
2690
- answers?: Array<QuestionAnswer>
2691
- },
2692
- options?: Options<never, ThrowOnError>,
2693
- ) {
2694
- const params = buildClientParams(
2695
- [parameters],
2696
- [
2697
- {
2698
- args: [
2699
- { in: "path", key: "requestID" },
2700
- { in: "query", key: "directory" },
2701
- { in: "query", key: "workspace" },
2702
- { in: "body", key: "answers" },
2703
- ],
2704
- },
2705
- ],
2706
- )
2707
- return (options?.client ?? this.client).post<QuestionReplyResponses, QuestionReplyErrors, ThrowOnError>({
2708
- url: "/question/{requestID}/reply",
2709
- ...options,
2710
- ...params,
2711
- headers: {
2712
- "Content-Type": "application/json",
2713
- ...options?.headers,
2714
- ...params.headers,
2715
- },
2716
- })
2717
- }
2718
-
2719
- /**
2720
- * Reject question request
2721
- *
2722
- * Reject a question request from the AI assistant.
2723
- */
2724
- public reject<ThrowOnError extends boolean = false>(
2725
- parameters: {
2726
- requestID: string
2727
- directory?: string
2728
- workspace?: string
2729
- },
2730
- options?: Options<never, ThrowOnError>,
2731
- ) {
2732
- const params = buildClientParams(
2733
- [parameters],
2734
- [
2735
- {
2736
- args: [
2737
- { in: "path", key: "requestID" },
2738
- { in: "query", key: "directory" },
2739
- { in: "query", key: "workspace" },
2740
- ],
2741
- },
2742
- ],
2743
- )
2744
- return (options?.client ?? this.client).post<QuestionRejectResponses, QuestionRejectErrors, ThrowOnError>({
2745
- url: "/question/{requestID}/reject",
2746
- ...options,
2747
- ...params,
2748
- })
2749
- }
2750
- }
2751
-
2752
- export class Oauth extends HeyApiClient {
2753
- /**
2754
- * OAuth authorize
2755
- *
2756
- * Initiate OAuth authorization for a specific AI provider to get an authorization URL.
2757
- */
2758
- public authorize<ThrowOnError extends boolean = false>(
2759
- parameters: {
2760
- providerID: string
2761
- directory?: string
2762
- workspace?: string
2763
- method?: number
2764
- inputs?: {
2765
- [key: string]: string
2766
- }
2767
- },
2768
- options?: Options<never, ThrowOnError>,
2769
- ) {
2770
- const params = buildClientParams(
2771
- [parameters],
2772
- [
2773
- {
2774
- args: [
2775
- { in: "path", key: "providerID" },
2776
- { in: "query", key: "directory" },
2777
- { in: "query", key: "workspace" },
2778
- { in: "body", key: "method" },
2779
- { in: "body", key: "inputs" },
2780
- ],
2781
- },
2782
- ],
2783
- )
2784
- return (options?.client ?? this.client).post<
2785
- ProviderOauthAuthorizeResponses,
2786
- ProviderOauthAuthorizeErrors,
2787
- ThrowOnError
2788
- >({
2789
- url: "/provider/{providerID}/oauth/authorize",
2790
- ...options,
2791
- ...params,
2792
- headers: {
2793
- "Content-Type": "application/json",
2794
- ...options?.headers,
2795
- ...params.headers,
2796
- },
2797
- })
2798
- }
2799
-
2800
- /**
2801
- * OAuth callback
2802
- *
2803
- * Handle the OAuth callback from a provider after user authorization.
2804
- */
2805
- public callback<ThrowOnError extends boolean = false>(
2806
- parameters: {
2807
- providerID: string
2808
- directory?: string
2809
- workspace?: string
2810
- method?: number
2811
- code?: string
2812
- },
2813
- options?: Options<never, ThrowOnError>,
2814
- ) {
2815
- const params = buildClientParams(
2816
- [parameters],
2817
- [
2818
- {
2819
- args: [
2820
- { in: "path", key: "providerID" },
2821
- { in: "query", key: "directory" },
2822
- { in: "query", key: "workspace" },
2823
- { in: "body", key: "method" },
2824
- { in: "body", key: "code" },
2825
- ],
2826
- },
2827
- ],
2828
- )
2829
- return (options?.client ?? this.client).post<
2830
- ProviderOauthCallbackResponses,
2831
- ProviderOauthCallbackErrors,
2832
- ThrowOnError
2833
- >({
2834
- url: "/provider/{providerID}/oauth/callback",
2835
- ...options,
2836
- ...params,
2837
- headers: {
2838
- "Content-Type": "application/json",
2839
- ...options?.headers,
2840
- ...params.headers,
2841
- },
2842
- })
2843
- }
2844
- }
2845
-
2846
- export class Provider extends HeyApiClient {
2847
- /**
2848
- * List providers
2849
- *
2850
- * Get a list of all available AI providers, including both available and connected ones.
2851
- */
2852
- public list<ThrowOnError extends boolean = false>(
2853
- parameters?: {
2854
- directory?: string
2855
- workspace?: string
2856
- },
2857
- options?: Options<never, ThrowOnError>,
2858
- ) {
2859
- const params = buildClientParams(
2860
- [parameters],
2861
- [
2862
- {
2863
- args: [
2864
- { in: "query", key: "directory" },
2865
- { in: "query", key: "workspace" },
2866
- ],
2867
- },
2868
- ],
2869
- )
2870
- return (options?.client ?? this.client).get<ProviderListResponses, unknown, ThrowOnError>({
2871
- url: "/provider",
2872
- ...options,
2873
- ...params,
2874
- })
2875
- }
2876
-
2877
- /**
2878
- * Get provider auth methods
2879
- *
2880
- * Retrieve available authentication methods for all AI providers.
2881
- */
2882
- public auth<ThrowOnError extends boolean = false>(
2883
- parameters?: {
2884
- directory?: string
2885
- workspace?: string
2886
- },
2887
- options?: Options<never, ThrowOnError>,
2888
- ) {
2889
- const params = buildClientParams(
2890
- [parameters],
2891
- [
2892
- {
2893
- args: [
2894
- { in: "query", key: "directory" },
2895
- { in: "query", key: "workspace" },
2896
- ],
2897
- },
2898
- ],
2899
- )
2900
- return (options?.client ?? this.client).get<ProviderAuthResponses, unknown, ThrowOnError>({
2901
- url: "/provider/auth",
2902
- ...options,
2903
- ...params,
2904
- })
2905
- }
2906
-
2907
- private _oauth?: Oauth
2908
- get oauth(): Oauth {
2909
- return (this._oauth ??= new Oauth({ client: this.client }))
2910
- }
2911
- }
2912
-
2913
- export class Find extends HeyApiClient {
2914
- /**
2915
- * Find text
2916
- *
2917
- * Search for text patterns across files in the project using ripgrep.
2918
- */
2919
- public text<ThrowOnError extends boolean = false>(
2920
- parameters: {
2921
- directory?: string
2922
- workspace?: string
2923
- pattern: string
2924
- },
2925
- options?: Options<never, ThrowOnError>,
2926
- ) {
2927
- const params = buildClientParams(
2928
- [parameters],
2929
- [
2930
- {
2931
- args: [
2932
- { in: "query", key: "directory" },
2933
- { in: "query", key: "workspace" },
2934
- { in: "query", key: "pattern" },
2935
- ],
2936
- },
2937
- ],
2938
- )
2939
- return (options?.client ?? this.client).get<FindTextResponses, unknown, ThrowOnError>({
2940
- url: "/find",
2941
- ...options,
2942
- ...params,
2943
- })
2944
- }
2945
-
2946
- /**
2947
- * Find files
2948
- *
2949
- * Search for files or directories by name or pattern in the project directory.
2950
- */
2951
- public files<ThrowOnError extends boolean = false>(
2952
- parameters: {
2953
- directory?: string
2954
- workspace?: string
2955
- query: string
2956
- dirs?: "true" | "false"
2957
- type?: "file" | "directory"
2958
- limit?: number
2959
- },
2960
- options?: Options<never, ThrowOnError>,
2961
- ) {
2962
- const params = buildClientParams(
2963
- [parameters],
2964
- [
2965
- {
2966
- args: [
2967
- { in: "query", key: "directory" },
2968
- { in: "query", key: "workspace" },
2969
- { in: "query", key: "query" },
2970
- { in: "query", key: "dirs" },
2971
- { in: "query", key: "type" },
2972
- { in: "query", key: "limit" },
2973
- ],
2974
- },
2975
- ],
2976
- )
2977
- return (options?.client ?? this.client).get<FindFilesResponses, unknown, ThrowOnError>({
2978
- url: "/find/file",
2979
- ...options,
2980
- ...params,
2981
- })
2982
- }
2983
-
2984
- /**
2985
- * Find symbols
2986
- *
2987
- * Search for workspace symbols like functions, classes, and variables using LSP.
2988
- */
2989
- public symbols<ThrowOnError extends boolean = false>(
2990
- parameters: {
2991
- directory?: string
2992
- workspace?: string
2993
- query: string
2994
- },
2995
- options?: Options<never, ThrowOnError>,
2996
- ) {
2997
- const params = buildClientParams(
2998
- [parameters],
2999
- [
3000
- {
3001
- args: [
3002
- { in: "query", key: "directory" },
3003
- { in: "query", key: "workspace" },
3004
- { in: "query", key: "query" },
3005
- ],
3006
- },
3007
- ],
3008
- )
3009
- return (options?.client ?? this.client).get<FindSymbolsResponses, unknown, ThrowOnError>({
3010
- url: "/find/symbol",
3011
- ...options,
3012
- ...params,
3013
- })
3014
- }
3015
- }
3016
-
3017
- export class File extends HeyApiClient {
3018
- /**
3019
- * List files
3020
- *
3021
- * List files and directories in a specified path.
3022
- */
3023
- public list<ThrowOnError extends boolean = false>(
3024
- parameters: {
3025
- directory?: string
3026
- workspace?: string
3027
- path: string
3028
- },
3029
- options?: Options<never, ThrowOnError>,
3030
- ) {
3031
- const params = buildClientParams(
3032
- [parameters],
3033
- [
3034
- {
3035
- args: [
3036
- { in: "query", key: "directory" },
3037
- { in: "query", key: "workspace" },
3038
- { in: "query", key: "path" },
3039
- ],
3040
- },
3041
- ],
3042
- )
3043
- return (options?.client ?? this.client).get<FileListResponses, unknown, ThrowOnError>({
3044
- url: "/file",
3045
- ...options,
3046
- ...params,
3047
- })
3048
- }
3049
-
3050
- /**
3051
- * Read file
3052
- *
3053
- * Read the content of a specified file.
3054
- */
3055
- public read<ThrowOnError extends boolean = false>(
3056
- parameters: {
3057
- directory?: string
3058
- workspace?: string
3059
- path: string
3060
- },
3061
- options?: Options<never, ThrowOnError>,
3062
- ) {
3063
- const params = buildClientParams(
3064
- [parameters],
3065
- [
3066
- {
3067
- args: [
3068
- { in: "query", key: "directory" },
3069
- { in: "query", key: "workspace" },
3070
- { in: "query", key: "path" },
3071
- ],
3072
- },
3073
- ],
3074
- )
3075
- return (options?.client ?? this.client).get<FileReadResponses, unknown, ThrowOnError>({
3076
- url: "/file/content",
3077
- ...options,
3078
- ...params,
3079
- })
3080
- }
3081
-
3082
- /**
3083
- * Get file status
3084
- *
3085
- * Get the git status of all files in the project.
3086
- */
3087
- public status<ThrowOnError extends boolean = false>(
3088
- parameters?: {
3089
- directory?: string
3090
- workspace?: string
3091
- },
3092
- options?: Options<never, ThrowOnError>,
3093
- ) {
3094
- const params = buildClientParams(
3095
- [parameters],
3096
- [
3097
- {
3098
- args: [
3099
- { in: "query", key: "directory" },
3100
- { in: "query", key: "workspace" },
3101
- ],
3102
- },
3103
- ],
3104
- )
3105
- return (options?.client ?? this.client).get<FileStatusResponses, unknown, ThrowOnError>({
3106
- url: "/file/status",
3107
- ...options,
3108
- ...params,
3109
- })
3110
- }
3111
- }
3112
-
3113
- export class Event extends HeyApiClient {
3114
- /**
3115
- * Subscribe to events
3116
- *
3117
- * Get events
3118
- */
3119
- public subscribe<ThrowOnError extends boolean = false>(
3120
- parameters?: {
3121
- directory?: string
3122
- workspace?: string
3123
- },
3124
- options?: Options<never, ThrowOnError>,
3125
- ) {
3126
- const params = buildClientParams(
3127
- [parameters],
3128
- [
3129
- {
3130
- args: [
3131
- { in: "query", key: "directory" },
3132
- { in: "query", key: "workspace" },
3133
- ],
3134
- },
3135
- ],
3136
- )
3137
- return (options?.client ?? this.client).sse.get<EventSubscribeResponses, unknown, ThrowOnError>({
3138
- url: "/event",
3139
- ...options,
3140
- ...params,
3141
- })
3142
- }
3143
- }
3144
-
3145
- export class Auth2 extends HeyApiClient {
3146
- /**
3147
- * Remove MCP OAuth
3148
- *
3149
- * Remove OAuth credentials for an MCP server
3150
- */
3151
- public remove<ThrowOnError extends boolean = false>(
3152
- parameters: {
3153
- name: string
3154
- directory?: string
3155
- workspace?: string
3156
- },
3157
- options?: Options<never, ThrowOnError>,
3158
- ) {
3159
- const params = buildClientParams(
3160
- [parameters],
3161
- [
3162
- {
3163
- args: [
3164
- { in: "path", key: "name" },
3165
- { in: "query", key: "directory" },
3166
- { in: "query", key: "workspace" },
3167
- ],
3168
- },
3169
- ],
3170
- )
3171
- return (options?.client ?? this.client).delete<McpAuthRemoveResponses, McpAuthRemoveErrors, ThrowOnError>({
3172
- url: "/mcp/{name}/auth",
3173
- ...options,
3174
- ...params,
3175
- })
3176
- }
3177
-
3178
- /**
3179
- * Start MCP OAuth
3180
- *
3181
- * Start OAuth authentication flow for a Model Context Protocol (MCP) server.
3182
- */
3183
- public start<ThrowOnError extends boolean = false>(
3184
- parameters: {
3185
- name: string
3186
- directory?: string
3187
- workspace?: string
3188
- },
3189
- options?: Options<never, ThrowOnError>,
3190
- ) {
3191
- const params = buildClientParams(
3192
- [parameters],
3193
- [
3194
- {
3195
- args: [
3196
- { in: "path", key: "name" },
3197
- { in: "query", key: "directory" },
3198
- { in: "query", key: "workspace" },
3199
- ],
3200
- },
3201
- ],
3202
- )
3203
- return (options?.client ?? this.client).post<McpAuthStartResponses, McpAuthStartErrors, ThrowOnError>({
3204
- url: "/mcp/{name}/auth",
3205
- ...options,
3206
- ...params,
3207
- })
3208
- }
3209
-
3210
- /**
3211
- * Complete MCP OAuth
3212
- *
3213
- * Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.
3214
- */
3215
- public callback<ThrowOnError extends boolean = false>(
3216
- parameters: {
3217
- name: string
3218
- directory?: string
3219
- workspace?: string
3220
- code?: string
3221
- },
3222
- options?: Options<never, ThrowOnError>,
3223
- ) {
3224
- const params = buildClientParams(
3225
- [parameters],
3226
- [
3227
- {
3228
- args: [
3229
- { in: "path", key: "name" },
3230
- { in: "query", key: "directory" },
3231
- { in: "query", key: "workspace" },
3232
- { in: "body", key: "code" },
3233
- ],
3234
- },
3235
- ],
3236
- )
3237
- return (options?.client ?? this.client).post<McpAuthCallbackResponses, McpAuthCallbackErrors, ThrowOnError>({
3238
- url: "/mcp/{name}/auth/callback",
3239
- ...options,
3240
- ...params,
3241
- headers: {
3242
- "Content-Type": "application/json",
3243
- ...options?.headers,
3244
- ...params.headers,
3245
- },
3246
- })
3247
- }
3248
-
3249
- /**
3250
- * Authenticate MCP OAuth
3251
- *
3252
- * Start OAuth flow and wait for callback (opens browser)
3253
- */
3254
- public authenticate<ThrowOnError extends boolean = false>(
3255
- parameters: {
3256
- name: string
3257
- directory?: string
3258
- workspace?: string
3259
- },
3260
- options?: Options<never, ThrowOnError>,
3261
- ) {
3262
- const params = buildClientParams(
3263
- [parameters],
3264
- [
3265
- {
3266
- args: [
3267
- { in: "path", key: "name" },
3268
- { in: "query", key: "directory" },
3269
- { in: "query", key: "workspace" },
3270
- ],
3271
- },
3272
- ],
3273
- )
3274
- return (options?.client ?? this.client).post<McpAuthAuthenticateResponses, McpAuthAuthenticateErrors, ThrowOnError>(
3275
- {
3276
- url: "/mcp/{name}/auth/authenticate",
3277
- ...options,
3278
- ...params,
3279
- },
3280
- )
3281
- }
3282
- }
3283
-
3284
- export class Mcp extends HeyApiClient {
3285
- /**
3286
- * Get MCP status
3287
- *
3288
- * Get the status of all Model Context Protocol (MCP) servers.
3289
- */
3290
- public status<ThrowOnError extends boolean = false>(
3291
- parameters?: {
3292
- directory?: string
3293
- workspace?: string
3294
- },
3295
- options?: Options<never, ThrowOnError>,
3296
- ) {
3297
- const params = buildClientParams(
3298
- [parameters],
3299
- [
3300
- {
3301
- args: [
3302
- { in: "query", key: "directory" },
3303
- { in: "query", key: "workspace" },
3304
- ],
3305
- },
3306
- ],
3307
- )
3308
- return (options?.client ?? this.client).get<McpStatusResponses, unknown, ThrowOnError>({
3309
- url: "/mcp",
3310
- ...options,
3311
- ...params,
3312
- })
3313
- }
3314
-
3315
- /**
3316
- * Add MCP server
3317
- *
3318
- * Dynamically add a new Model Context Protocol (MCP) server to the system.
3319
- */
3320
- public add<ThrowOnError extends boolean = false>(
3321
- parameters?: {
3322
- directory?: string
3323
- workspace?: string
3324
- name?: string
3325
- config?: McpLocalConfig | McpRemoteConfig
3326
- },
3327
- options?: Options<never, ThrowOnError>,
3328
- ) {
3329
- const params = buildClientParams(
3330
- [parameters],
3331
- [
3332
- {
3333
- args: [
3334
- { in: "query", key: "directory" },
3335
- { in: "query", key: "workspace" },
3336
- { in: "body", key: "name" },
3337
- { in: "body", key: "config" },
3338
- ],
3339
- },
3340
- ],
3341
- )
3342
- return (options?.client ?? this.client).post<McpAddResponses, McpAddErrors, ThrowOnError>({
3343
- url: "/mcp",
3344
- ...options,
3345
- ...params,
3346
- headers: {
3347
- "Content-Type": "application/json",
3348
- ...options?.headers,
3349
- ...params.headers,
3350
- },
3351
- })
3352
- }
3353
-
3354
- /**
3355
- * Connect an MCP server
3356
- */
3357
- public connect<ThrowOnError extends boolean = false>(
3358
- parameters: {
3359
- name: string
3360
- directory?: string
3361
- workspace?: string
3362
- },
3363
- options?: Options<never, ThrowOnError>,
3364
- ) {
3365
- const params = buildClientParams(
3366
- [parameters],
3367
- [
3368
- {
3369
- args: [
3370
- { in: "path", key: "name" },
3371
- { in: "query", key: "directory" },
3372
- { in: "query", key: "workspace" },
3373
- ],
3374
- },
3375
- ],
3376
- )
3377
- return (options?.client ?? this.client).post<McpConnectResponses, unknown, ThrowOnError>({
3378
- url: "/mcp/{name}/connect",
3379
- ...options,
3380
- ...params,
3381
- })
3382
- }
3383
-
3384
- /**
3385
- * Disconnect an MCP server
3386
- */
3387
- public disconnect<ThrowOnError extends boolean = false>(
3388
- parameters: {
3389
- name: string
3390
- directory?: string
3391
- workspace?: string
3392
- },
3393
- options?: Options<never, ThrowOnError>,
3394
- ) {
3395
- const params = buildClientParams(
3396
- [parameters],
3397
- [
3398
- {
3399
- args: [
3400
- { in: "path", key: "name" },
3401
- { in: "query", key: "directory" },
3402
- { in: "query", key: "workspace" },
3403
- ],
3404
- },
3405
- ],
3406
- )
3407
- return (options?.client ?? this.client).post<McpDisconnectResponses, unknown, ThrowOnError>({
3408
- url: "/mcp/{name}/disconnect",
3409
- ...options,
3410
- ...params,
3411
- })
3412
- }
3413
-
3414
- private _auth?: Auth2
3415
- get auth(): Auth2 {
3416
- return (this._auth ??= new Auth2({ client: this.client }))
3417
- }
3418
- }
3419
-
3420
- export class Control extends HeyApiClient {
3421
- /**
3422
- * Get next TUI request
3423
- *
3424
- * Retrieve the next TUI (Terminal User Interface) request from the queue for processing.
3425
- */
3426
- public next<ThrowOnError extends boolean = false>(
3427
- parameters?: {
3428
- directory?: string
3429
- workspace?: string
3430
- },
3431
- options?: Options<never, ThrowOnError>,
3432
- ) {
3433
- const params = buildClientParams(
3434
- [parameters],
3435
- [
3436
- {
3437
- args: [
3438
- { in: "query", key: "directory" },
3439
- { in: "query", key: "workspace" },
3440
- ],
3441
- },
3442
- ],
3443
- )
3444
- return (options?.client ?? this.client).get<TuiControlNextResponses, unknown, ThrowOnError>({
3445
- url: "/tui/control/next",
3446
- ...options,
3447
- ...params,
3448
- })
3449
- }
3450
-
3451
- /**
3452
- * Submit TUI response
3453
- *
3454
- * Submit a response to the TUI request queue to complete a pending request.
3455
- */
3456
- public response<ThrowOnError extends boolean = false>(
3457
- parameters?: {
3458
- directory?: string
3459
- workspace?: string
3460
- body?: unknown
3461
- },
3462
- options?: Options<never, ThrowOnError>,
3463
- ) {
3464
- const params = buildClientParams(
3465
- [parameters],
3466
- [
3467
- {
3468
- args: [
3469
- { in: "query", key: "directory" },
3470
- { in: "query", key: "workspace" },
3471
- { key: "body", map: "body" },
3472
- ],
3473
- },
3474
- ],
3475
- )
3476
- return (options?.client ?? this.client).post<TuiControlResponseResponses, unknown, ThrowOnError>({
3477
- url: "/tui/control/response",
3478
- ...options,
3479
- ...params,
3480
- headers: {
3481
- "Content-Type": "application/json",
3482
- ...options?.headers,
3483
- ...params.headers,
3484
- },
3485
- })
3486
- }
3487
- }
3488
-
3489
- export class Tui extends HeyApiClient {
3490
- /**
3491
- * Append TUI prompt
3492
- *
3493
- * Append prompt to the TUI
3494
- */
3495
- public appendPrompt<ThrowOnError extends boolean = false>(
3496
- parameters?: {
3497
- directory?: string
3498
- workspace?: string
3499
- text?: string
3500
- },
3501
- options?: Options<never, ThrowOnError>,
3502
- ) {
3503
- const params = buildClientParams(
3504
- [parameters],
3505
- [
3506
- {
3507
- args: [
3508
- { in: "query", key: "directory" },
3509
- { in: "query", key: "workspace" },
3510
- { in: "body", key: "text" },
3511
- ],
3512
- },
3513
- ],
3514
- )
3515
- return (options?.client ?? this.client).post<TuiAppendPromptResponses, TuiAppendPromptErrors, ThrowOnError>({
3516
- url: "/tui/append-prompt",
3517
- ...options,
3518
- ...params,
3519
- headers: {
3520
- "Content-Type": "application/json",
3521
- ...options?.headers,
3522
- ...params.headers,
3523
- },
3524
- })
3525
- }
3526
-
3527
- /**
3528
- * Open help dialog
3529
- *
3530
- * Open the help dialog in the TUI to display user assistance information.
3531
- */
3532
- public openHelp<ThrowOnError extends boolean = false>(
3533
- parameters?: {
3534
- directory?: string
3535
- workspace?: string
3536
- },
3537
- options?: Options<never, ThrowOnError>,
3538
- ) {
3539
- const params = buildClientParams(
3540
- [parameters],
3541
- [
3542
- {
3543
- args: [
3544
- { in: "query", key: "directory" },
3545
- { in: "query", key: "workspace" },
3546
- ],
3547
- },
3548
- ],
3549
- )
3550
- return (options?.client ?? this.client).post<TuiOpenHelpResponses, unknown, ThrowOnError>({
3551
- url: "/tui/open-help",
3552
- ...options,
3553
- ...params,
3554
- })
3555
- }
3556
-
3557
- /**
3558
- * Open sessions dialog
3559
- *
3560
- * Open the session dialog
3561
- */
3562
- public openSessions<ThrowOnError extends boolean = false>(
3563
- parameters?: {
3564
- directory?: string
3565
- workspace?: string
3566
- },
3567
- options?: Options<never, ThrowOnError>,
3568
- ) {
3569
- const params = buildClientParams(
3570
- [parameters],
3571
- [
3572
- {
3573
- args: [
3574
- { in: "query", key: "directory" },
3575
- { in: "query", key: "workspace" },
3576
- ],
3577
- },
3578
- ],
3579
- )
3580
- return (options?.client ?? this.client).post<TuiOpenSessionsResponses, unknown, ThrowOnError>({
3581
- url: "/tui/open-sessions",
3582
- ...options,
3583
- ...params,
3584
- })
3585
- }
3586
-
3587
- /**
3588
- * Open themes dialog
3589
- *
3590
- * Open the theme dialog
3591
- */
3592
- public openThemes<ThrowOnError extends boolean = false>(
3593
- parameters?: {
3594
- directory?: string
3595
- workspace?: string
3596
- },
3597
- options?: Options<never, ThrowOnError>,
3598
- ) {
3599
- const params = buildClientParams(
3600
- [parameters],
3601
- [
3602
- {
3603
- args: [
3604
- { in: "query", key: "directory" },
3605
- { in: "query", key: "workspace" },
3606
- ],
3607
- },
3608
- ],
3609
- )
3610
- return (options?.client ?? this.client).post<TuiOpenThemesResponses, unknown, ThrowOnError>({
3611
- url: "/tui/open-themes",
3612
- ...options,
3613
- ...params,
3614
- })
3615
- }
3616
-
3617
- /**
3618
- * Open models dialog
3619
- *
3620
- * Open the model dialog
3621
- */
3622
- public openModels<ThrowOnError extends boolean = false>(
3623
- parameters?: {
3624
- directory?: string
3625
- workspace?: string
3626
- },
3627
- options?: Options<never, ThrowOnError>,
3628
- ) {
3629
- const params = buildClientParams(
3630
- [parameters],
3631
- [
3632
- {
3633
- args: [
3634
- { in: "query", key: "directory" },
3635
- { in: "query", key: "workspace" },
3636
- ],
3637
- },
3638
- ],
3639
- )
3640
- return (options?.client ?? this.client).post<TuiOpenModelsResponses, unknown, ThrowOnError>({
3641
- url: "/tui/open-models",
3642
- ...options,
3643
- ...params,
3644
- })
3645
- }
3646
-
3647
- /**
3648
- * Submit TUI prompt
3649
- *
3650
- * Submit the prompt
3651
- */
3652
- public submitPrompt<ThrowOnError extends boolean = false>(
3653
- parameters?: {
3654
- directory?: string
3655
- workspace?: string
3656
- },
3657
- options?: Options<never, ThrowOnError>,
3658
- ) {
3659
- const params = buildClientParams(
3660
- [parameters],
3661
- [
3662
- {
3663
- args: [
3664
- { in: "query", key: "directory" },
3665
- { in: "query", key: "workspace" },
3666
- ],
3667
- },
3668
- ],
3669
- )
3670
- return (options?.client ?? this.client).post<TuiSubmitPromptResponses, unknown, ThrowOnError>({
3671
- url: "/tui/submit-prompt",
3672
- ...options,
3673
- ...params,
3674
- })
3675
- }
3676
-
3677
- /**
3678
- * Clear TUI prompt
3679
- *
3680
- * Clear the prompt
3681
- */
3682
- public clearPrompt<ThrowOnError extends boolean = false>(
3683
- parameters?: {
3684
- directory?: string
3685
- workspace?: string
3686
- },
3687
- options?: Options<never, ThrowOnError>,
3688
- ) {
3689
- const params = buildClientParams(
3690
- [parameters],
3691
- [
3692
- {
3693
- args: [
3694
- { in: "query", key: "directory" },
3695
- { in: "query", key: "workspace" },
3696
- ],
3697
- },
3698
- ],
3699
- )
3700
- return (options?.client ?? this.client).post<TuiClearPromptResponses, unknown, ThrowOnError>({
3701
- url: "/tui/clear-prompt",
3702
- ...options,
3703
- ...params,
3704
- })
3705
- }
3706
-
3707
- /**
3708
- * Execute TUI command
3709
- *
3710
- * Execute a TUI command (e.g. agent_cycle)
3711
- */
3712
- public executeCommand<ThrowOnError extends boolean = false>(
3713
- parameters?: {
3714
- directory?: string
3715
- workspace?: string
3716
- command?: string
3717
- },
3718
- options?: Options<never, ThrowOnError>,
3719
- ) {
3720
- const params = buildClientParams(
3721
- [parameters],
3722
- [
3723
- {
3724
- args: [
3725
- { in: "query", key: "directory" },
3726
- { in: "query", key: "workspace" },
3727
- { in: "body", key: "command" },
3728
- ],
3729
- },
3730
- ],
3731
- )
3732
- return (options?.client ?? this.client).post<TuiExecuteCommandResponses, TuiExecuteCommandErrors, ThrowOnError>({
3733
- url: "/tui/execute-command",
3734
- ...options,
3735
- ...params,
3736
- headers: {
3737
- "Content-Type": "application/json",
3738
- ...options?.headers,
3739
- ...params.headers,
3740
- },
3741
- })
3742
- }
3743
-
3744
- /**
3745
- * Show TUI toast
3746
- *
3747
- * Show a toast notification in the TUI
3748
- */
3749
- public showToast<ThrowOnError extends boolean = false>(
3750
- parameters?: {
3751
- directory?: string
3752
- workspace?: string
3753
- title?: string
3754
- message?: string
3755
- variant?: "info" | "success" | "warning" | "error"
3756
- duration?: number
3757
- },
3758
- options?: Options<never, ThrowOnError>,
3759
- ) {
3760
- const params = buildClientParams(
3761
- [parameters],
3762
- [
3763
- {
3764
- args: [
3765
- { in: "query", key: "directory" },
3766
- { in: "query", key: "workspace" },
3767
- { in: "body", key: "title" },
3768
- { in: "body", key: "message" },
3769
- { in: "body", key: "variant" },
3770
- { in: "body", key: "duration" },
3771
- ],
3772
- },
3773
- ],
3774
- )
3775
- return (options?.client ?? this.client).post<TuiShowToastResponses, unknown, ThrowOnError>({
3776
- url: "/tui/show-toast",
3777
- ...options,
3778
- ...params,
3779
- headers: {
3780
- "Content-Type": "application/json",
3781
- ...options?.headers,
3782
- ...params.headers,
3783
- },
3784
- })
3785
- }
3786
-
3787
- /**
3788
- * Publish TUI event
3789
- *
3790
- * Publish a TUI event
3791
- */
3792
- public publish<ThrowOnError extends boolean = false>(
3793
- parameters?: {
3794
- directory?: string
3795
- workspace?: string
3796
- body?: EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect
3797
- },
3798
- options?: Options<never, ThrowOnError>,
3799
- ) {
3800
- const params = buildClientParams(
3801
- [parameters],
3802
- [
3803
- {
3804
- args: [
3805
- { in: "query", key: "directory" },
3806
- { in: "query", key: "workspace" },
3807
- { key: "body", map: "body" },
3808
- ],
3809
- },
3810
- ],
3811
- )
3812
- return (options?.client ?? this.client).post<TuiPublishResponses, TuiPublishErrors, ThrowOnError>({
3813
- url: "/tui/publish",
3814
- ...options,
3815
- ...params,
3816
- headers: {
3817
- "Content-Type": "application/json",
3818
- ...options?.headers,
3819
- ...params.headers,
3820
- },
3821
- })
3822
- }
3823
-
3824
- /**
3825
- * Select session
3826
- *
3827
- * Navigate the TUI to display the specified session.
3828
- */
3829
- public selectSession<ThrowOnError extends boolean = false>(
3830
- parameters?: {
3831
- directory?: string
3832
- workspace?: string
3833
- sessionID?: string
3834
- },
3835
- options?: Options<never, ThrowOnError>,
3836
- ) {
3837
- const params = buildClientParams(
3838
- [parameters],
3839
- [
3840
- {
3841
- args: [
3842
- { in: "query", key: "directory" },
3843
- { in: "query", key: "workspace" },
3844
- { in: "body", key: "sessionID" },
3845
- ],
3846
- },
3847
- ],
3848
- )
3849
- return (options?.client ?? this.client).post<TuiSelectSessionResponses, TuiSelectSessionErrors, ThrowOnError>({
3850
- url: "/tui/select-session",
3851
- ...options,
3852
- ...params,
3853
- headers: {
3854
- "Content-Type": "application/json",
3855
- ...options?.headers,
3856
- ...params.headers,
3857
- },
3858
- })
3859
- }
3860
-
3861
- private _control?: Control
3862
- get control(): Control {
3863
- return (this._control ??= new Control({ client: this.client }))
3864
- }
3865
- }
3866
-
3867
- export class Instance extends HeyApiClient {
3868
- /**
3869
- * Dispose instance
3870
- *
3871
- * Clean up and dispose the current OpenCode instance, releasing all resources.
3872
- */
3873
- public dispose<ThrowOnError extends boolean = false>(
3874
- parameters?: {
3875
- directory?: string
3876
- workspace?: string
3877
- },
3878
- options?: Options<never, ThrowOnError>,
3879
- ) {
3880
- const params = buildClientParams(
3881
- [parameters],
3882
- [
3883
- {
3884
- args: [
3885
- { in: "query", key: "directory" },
3886
- { in: "query", key: "workspace" },
3887
- ],
3888
- },
3889
- ],
3890
- )
3891
- return (options?.client ?? this.client).post<InstanceDisposeResponses, unknown, ThrowOnError>({
3892
- url: "/instance/dispose",
3893
- ...options,
3894
- ...params,
3895
- })
3896
- }
3897
- }
3898
-
3899
- export class Path extends HeyApiClient {
3900
- /**
3901
- * Get paths
3902
- *
3903
- * Retrieve the current working directory and related path information for the OpenCode instance.
3904
- */
3905
- public get<ThrowOnError extends boolean = false>(
3906
- parameters?: {
3907
- directory?: string
3908
- workspace?: string
3909
- },
3910
- options?: Options<never, ThrowOnError>,
3911
- ) {
3912
- const params = buildClientParams(
3913
- [parameters],
3914
- [
3915
- {
3916
- args: [
3917
- { in: "query", key: "directory" },
3918
- { in: "query", key: "workspace" },
3919
- ],
3920
- },
3921
- ],
3922
- )
3923
- return (options?.client ?? this.client).get<PathGetResponses, unknown, ThrowOnError>({
3924
- url: "/path",
3925
- ...options,
3926
- ...params,
3927
- })
3928
- }
3929
- }
3930
-
3931
- export class Vcs extends HeyApiClient {
3932
- /**
3933
- * Get VCS info
3934
- *
3935
- * Retrieve version control system (VCS) information for the current project, such as git branch.
3936
- */
3937
- public get<ThrowOnError extends boolean = false>(
3938
- parameters?: {
3939
- directory?: string
3940
- workspace?: string
3941
- },
3942
- options?: Options<never, ThrowOnError>,
3943
- ) {
3944
- const params = buildClientParams(
3945
- [parameters],
3946
- [
3947
- {
3948
- args: [
3949
- { in: "query", key: "directory" },
3950
- { in: "query", key: "workspace" },
3951
- ],
3952
- },
3953
- ],
3954
- )
3955
- return (options?.client ?? this.client).get<VcsGetResponses, unknown, ThrowOnError>({
3956
- url: "/vcs",
3957
- ...options,
3958
- ...params,
3959
- })
3960
- }
3961
-
3962
- /**
3963
- * Get VCS diff
3964
- *
3965
- * Retrieve the current git diff for the working tree or against the default branch.
3966
- */
3967
- public diff<ThrowOnError extends boolean = false>(
3968
- parameters: {
3969
- directory?: string
3970
- workspace?: string
3971
- mode: "git" | "branch"
3972
- },
3973
- options?: Options<never, ThrowOnError>,
3974
- ) {
3975
- const params = buildClientParams(
3976
- [parameters],
3977
- [
3978
- {
3979
- args: [
3980
- { in: "query", key: "directory" },
3981
- { in: "query", key: "workspace" },
3982
- { in: "query", key: "mode" },
3983
- ],
3984
- },
3985
- ],
3986
- )
3987
- return (options?.client ?? this.client).get<VcsDiffResponses, unknown, ThrowOnError>({
3988
- url: "/vcs/diff",
3989
- ...options,
3990
- ...params,
3991
- })
3992
- }
3993
- }
3994
-
3995
- export class Command extends HeyApiClient {
3996
- /**
3997
- * List commands
3998
- *
3999
- * Get a list of all available commands in the OpenCode system.
4000
- */
4001
- public list<ThrowOnError extends boolean = false>(
4002
- parameters?: {
4003
- directory?: string
4004
- workspace?: string
4005
- },
4006
- options?: Options<never, ThrowOnError>,
4007
- ) {
4008
- const params = buildClientParams(
4009
- [parameters],
4010
- [
4011
- {
4012
- args: [
4013
- { in: "query", key: "directory" },
4014
- { in: "query", key: "workspace" },
4015
- ],
4016
- },
4017
- ],
4018
- )
4019
- return (options?.client ?? this.client).get<CommandListResponses, unknown, ThrowOnError>({
4020
- url: "/command",
4021
- ...options,
4022
- ...params,
4023
- })
4024
- }
4025
- }
4026
-
4027
- export class Lsp extends HeyApiClient {
4028
- /**
4029
- * Get LSP status
4030
- *
4031
- * Get LSP server status
4032
- */
4033
- public status<ThrowOnError extends boolean = false>(
4034
- parameters?: {
4035
- directory?: string
4036
- workspace?: string
4037
- },
4038
- options?: Options<never, ThrowOnError>,
4039
- ) {
4040
- const params = buildClientParams(
4041
- [parameters],
4042
- [
4043
- {
4044
- args: [
4045
- { in: "query", key: "directory" },
4046
- { in: "query", key: "workspace" },
4047
- ],
4048
- },
4049
- ],
4050
- )
4051
- return (options?.client ?? this.client).get<LspStatusResponses, unknown, ThrowOnError>({
4052
- url: "/lsp",
4053
- ...options,
4054
- ...params,
4055
- })
4056
- }
4057
- }
4058
-
4059
- export class Formatter extends HeyApiClient {
4060
- /**
4061
- * Get formatter status
4062
- *
4063
- * Get formatter status
4064
- */
4065
- public status<ThrowOnError extends boolean = false>(
4066
- parameters?: {
4067
- directory?: string
4068
- workspace?: string
4069
- },
4070
- options?: Options<never, ThrowOnError>,
4071
- ) {
4072
- const params = buildClientParams(
4073
- [parameters],
4074
- [
4075
- {
4076
- args: [
4077
- { in: "query", key: "directory" },
4078
- { in: "query", key: "workspace" },
4079
- ],
4080
- },
4081
- ],
4082
- )
4083
- return (options?.client ?? this.client).get<FormatterStatusResponses, unknown, ThrowOnError>({
4084
- url: "/formatter",
4085
- ...options,
4086
- ...params,
4087
- })
4088
- }
4089
- }
4090
-
4091
- export class OpencodeClient extends HeyApiClient {
4092
- public static readonly __registry = new HeyApiRegistry<OpencodeClient>()
4093
-
4094
- constructor(args?: { client?: Client; key?: string }) {
4095
- super(args)
4096
- OpencodeClient.__registry.set(this, args?.key)
4097
- }
4098
-
4099
- private _global?: Global
4100
- get global(): Global {
4101
- return (this._global ??= new Global({ client: this.client }))
4102
- }
4103
-
4104
- private _auth?: Auth
4105
- get auth(): Auth {
4106
- return (this._auth ??= new Auth({ client: this.client }))
4107
- }
4108
-
4109
- private _app?: App
4110
- get app(): App {
4111
- return (this._app ??= new App({ client: this.client }))
4112
- }
4113
-
4114
- private _project?: Project
4115
- get project(): Project {
4116
- return (this._project ??= new Project({ client: this.client }))
4117
- }
4118
-
4119
- private _pty?: Pty
4120
- get pty(): Pty {
4121
- return (this._pty ??= new Pty({ client: this.client }))
4122
- }
4123
-
4124
- private _config?: Config2
4125
- get config(): Config2 {
4126
- return (this._config ??= new Config2({ client: this.client }))
4127
- }
4128
-
4129
- private _experimental?: Experimental
4130
- get experimental(): Experimental {
4131
- return (this._experimental ??= new Experimental({ client: this.client }))
4132
- }
4133
-
4134
- private _tool?: Tool
4135
- get tool(): Tool {
4136
- return (this._tool ??= new Tool({ client: this.client }))
4137
- }
4138
-
4139
- private _worktree?: Worktree
4140
- get worktree(): Worktree {
4141
- return (this._worktree ??= new Worktree({ client: this.client }))
4142
- }
4143
-
4144
- private _session?: Session2
4145
- get session(): Session2 {
4146
- return (this._session ??= new Session2({ client: this.client }))
4147
- }
4148
-
4149
- private _part?: Part
4150
- get part(): Part {
4151
- return (this._part ??= new Part({ client: this.client }))
4152
- }
4153
-
4154
- private _permission?: Permission
4155
- get permission(): Permission {
4156
- return (this._permission ??= new Permission({ client: this.client }))
4157
- }
4158
-
4159
- private _question?: Question
4160
- get question(): Question {
4161
- return (this._question ??= new Question({ client: this.client }))
4162
- }
4163
-
4164
- private _provider?: Provider
4165
- get provider(): Provider {
4166
- return (this._provider ??= new Provider({ client: this.client }))
4167
- }
4168
-
4169
- private _find?: Find
4170
- get find(): Find {
4171
- return (this._find ??= new Find({ client: this.client }))
4172
- }
4173
-
4174
- private _file?: File
4175
- get file(): File {
4176
- return (this._file ??= new File({ client: this.client }))
4177
- }
4178
-
4179
- private _event?: Event
4180
- get event(): Event {
4181
- return (this._event ??= new Event({ client: this.client }))
4182
- }
4183
-
4184
- private _mcp?: Mcp
4185
- get mcp(): Mcp {
4186
- return (this._mcp ??= new Mcp({ client: this.client }))
4187
- }
4188
-
4189
- private _tui?: Tui
4190
- get tui(): Tui {
4191
- return (this._tui ??= new Tui({ client: this.client }))
4192
- }
4193
-
4194
- private _instance?: Instance
4195
- get instance(): Instance {
4196
- return (this._instance ??= new Instance({ client: this.client }))
4197
- }
4198
-
4199
- private _path?: Path
4200
- get path(): Path {
4201
- return (this._path ??= new Path({ client: this.client }))
4202
- }
4203
-
4204
- private _vcs?: Vcs
4205
- get vcs(): Vcs {
4206
- return (this._vcs ??= new Vcs({ client: this.client }))
4207
- }
4208
-
4209
- private _command?: Command
4210
- get command(): Command {
4211
- return (this._command ??= new Command({ client: this.client }))
4212
- }
4213
-
4214
- private _lsp?: Lsp
4215
- get lsp(): Lsp {
4216
- return (this._lsp ??= new Lsp({ client: this.client }))
4217
- }
4218
-
4219
- private _formatter?: Formatter
4220
- get formatter(): Formatter {
4221
- return (this._formatter ??= new Formatter({ client: this.client }))
4222
- }
4223
- }