@kortix/sdk 0.9.98

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 (618) hide show
  1. package/README.md +313 -0
  2. package/dist/files/client.d.ts +96 -0
  3. package/dist/files/client.d.ts.map +1 -0
  4. package/dist/files/client.js +346 -0
  5. package/dist/files/client.js.map +1 -0
  6. package/dist/files/types.d.ts +82 -0
  7. package/dist/files/types.d.ts.map +1 -0
  8. package/dist/files/types.js +6 -0
  9. package/dist/files/types.js.map +1 -0
  10. package/dist/index.d.ts +119 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +93 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/kortix.d.ts +897 -0
  15. package/dist/kortix.d.ts.map +1 -0
  16. package/dist/kortix.js +772 -0
  17. package/dist/kortix.js.map +1 -0
  18. package/dist/opencode/client.d.ts +89 -0
  19. package/dist/opencode/client.d.ts.map +1 -0
  20. package/dist/opencode/client.js +191 -0
  21. package/dist/opencode/client.js.map +1 -0
  22. package/dist/opencode/env.d.ts +13 -0
  23. package/dist/opencode/env.d.ts.map +1 -0
  24. package/dist/opencode/env.js +63 -0
  25. package/dist/opencode/env.js.map +1 -0
  26. package/dist/opencode/kortix-master.d.ts +487 -0
  27. package/dist/opencode/kortix-master.d.ts.map +1 -0
  28. package/dist/opencode/kortix-master.js +313 -0
  29. package/dist/opencode/kortix-master.js.map +1 -0
  30. package/dist/opencode/triggers.d.ts +6 -0
  31. package/dist/opencode/triggers.d.ts.map +1 -0
  32. package/dist/opencode/triggers.js +34 -0
  33. package/dist/opencode/triggers.js.map +1 -0
  34. package/dist/platform/api/errors.d.ts +106 -0
  35. package/dist/platform/api/errors.d.ts.map +1 -0
  36. package/dist/platform/api/errors.js +137 -0
  37. package/dist/platform/api/errors.js.map +1 -0
  38. package/dist/platform/api-client.d.ts +35 -0
  39. package/dist/platform/api-client.d.ts.map +1 -0
  40. package/dist/platform/api-client.js +279 -0
  41. package/dist/platform/api-client.js.map +1 -0
  42. package/dist/platform/auth-core.d.ts +60 -0
  43. package/dist/platform/auth-core.d.ts.map +1 -0
  44. package/dist/platform/auth-core.js +104 -0
  45. package/dist/platform/auth-core.js.map +1 -0
  46. package/dist/platform/auth.d.ts +88 -0
  47. package/dist/platform/auth.d.ts.map +1 -0
  48. package/dist/platform/auth.js +161 -0
  49. package/dist/platform/auth.js.map +1 -0
  50. package/dist/platform/config-node.d.ts +33 -0
  51. package/dist/platform/config-node.d.ts.map +1 -0
  52. package/dist/platform/config-node.js +63 -0
  53. package/dist/platform/config-node.js.map +1 -0
  54. package/dist/platform/config.d.ts +77 -0
  55. package/dist/platform/config.d.ts.map +1 -0
  56. package/dist/platform/config.js +62 -0
  57. package/dist/platform/config.js.map +1 -0
  58. package/dist/platform/feature-flags.d.ts +25 -0
  59. package/dist/platform/feature-flags.d.ts.map +1 -0
  60. package/dist/platform/feature-flags.js +114 -0
  61. package/dist/platform/feature-flags.js.map +1 -0
  62. package/dist/platform/fresh-sessions.d.ts +4 -0
  63. package/dist/platform/fresh-sessions.d.ts.map +1 -0
  64. package/dist/platform/fresh-sessions.js +22 -0
  65. package/dist/platform/fresh-sessions.js.map +1 -0
  66. package/dist/platform/instance-routes.d.ts +17 -0
  67. package/dist/platform/instance-routes.d.ts.map +1 -0
  68. package/dist/platform/instance-routes.js +105 -0
  69. package/dist/platform/instance-routes.js.map +1 -0
  70. package/dist/platform/logger.d.ts +20 -0
  71. package/dist/platform/logger.d.ts.map +1 -0
  72. package/dist/platform/logger.js +44 -0
  73. package/dist/platform/logger.js.map +1 -0
  74. package/dist/platform/opencode-errors.d.ts +20 -0
  75. package/dist/platform/opencode-errors.d.ts.map +1 -0
  76. package/dist/platform/opencode-errors.js +71 -0
  77. package/dist/platform/opencode-errors.js.map +1 -0
  78. package/dist/platform/platform-client/backups.d.ts +22 -0
  79. package/dist/platform/platform-client/backups.d.ts.map +1 -0
  80. package/dist/platform/platform-client/backups.js +16 -0
  81. package/dist/platform/platform-client/backups.js.map +1 -0
  82. package/dist/platform/platform-client/index.d.ts +21 -0
  83. package/dist/platform/platform-client/index.d.ts.map +1 -0
  84. package/dist/platform/platform-client/index.js +21 -0
  85. package/dist/platform/platform-client/index.js.map +1 -0
  86. package/dist/platform/platform-client/instance-admin.d.ts +67 -0
  87. package/dist/platform/platform-client/instance-admin.d.ts.map +1 -0
  88. package/dist/platform/platform-client/instance-admin.js +59 -0
  89. package/dist/platform/platform-client/instance-admin.js.map +1 -0
  90. package/dist/platform/platform-client/invites.d.ts +35 -0
  91. package/dist/platform/platform-client/invites.d.ts.map +1 -0
  92. package/dist/platform/platform-client/invites.js +25 -0
  93. package/dist/platform/platform-client/invites.js.map +1 -0
  94. package/dist/platform/platform-client/lifecycle.d.ts +78 -0
  95. package/dist/platform/platform-client/lifecycle.d.ts.map +1 -0
  96. package/dist/platform/platform-client/lifecycle.js +151 -0
  97. package/dist/platform/platform-client/lifecycle.js.map +1 -0
  98. package/dist/platform/platform-client/members.d.ts +81 -0
  99. package/dist/platform/platform-client/members.d.ts.map +1 -0
  100. package/dist/platform/platform-client/members.js +59 -0
  101. package/dist/platform/platform-client/members.js.map +1 -0
  102. package/dist/platform/platform-client/shared.d.ts +44 -0
  103. package/dist/platform/platform-client/shared.d.ts.map +1 -0
  104. package/dist/platform/platform-client/shared.js +177 -0
  105. package/dist/platform/platform-client/shared.js.map +1 -0
  106. package/dist/platform/platform-client/ssh.d.ts +29 -0
  107. package/dist/platform/platform-client/ssh.d.ts.map +1 -0
  108. package/dist/platform/platform-client/ssh.js +14 -0
  109. package/dist/platform/platform-client/ssh.js.map +1 -0
  110. package/dist/platform/platform-client/types.d.ts +56 -0
  111. package/dist/platform/platform-client/types.d.ts.map +1 -0
  112. package/dist/platform/platform-client/types.js +19 -0
  113. package/dist/platform/platform-client/types.js.map +1 -0
  114. package/dist/platform/platform-client/updates.d.ts +117 -0
  115. package/dist/platform/platform-client/updates.d.ts.map +1 -0
  116. package/dist/platform/platform-client/updates.js +97 -0
  117. package/dist/platform/platform-client/updates.js.map +1 -0
  118. package/dist/platform/platform-client/urls.d.ts +18 -0
  119. package/dist/platform/platform-client/urls.d.ts.map +1 -0
  120. package/dist/platform/platform-client/urls.js +31 -0
  121. package/dist/platform/platform-client/urls.js.map +1 -0
  122. package/dist/platform/projects-client/access.d.ts +273 -0
  123. package/dist/platform/projects-client/access.d.ts.map +1 -0
  124. package/dist/platform/projects-client/access.js +89 -0
  125. package/dist/platform/projects-client/access.js.map +1 -0
  126. package/dist/platform/projects-client/accounts.d.ts +184 -0
  127. package/dist/platform/projects-client/accounts.d.ts.map +1 -0
  128. package/dist/platform/projects-client/accounts.js +78 -0
  129. package/dist/platform/projects-client/accounts.js.map +1 -0
  130. package/dist/platform/projects-client/agent-config.d.ts +58 -0
  131. package/dist/platform/projects-client/agent-config.d.ts.map +1 -0
  132. package/dist/platform/projects-client/agent-config.js +9 -0
  133. package/dist/platform/projects-client/agent-config.js.map +1 -0
  134. package/dist/platform/projects-client/agent-scope.d.ts +12 -0
  135. package/dist/platform/projects-client/agent-scope.d.ts.map +1 -0
  136. package/dist/platform/projects-client/agent-scope.js +6 -0
  137. package/dist/platform/projects-client/agent-scope.js.map +1 -0
  138. package/dist/platform/projects-client/apps.d.ts +98 -0
  139. package/dist/platform/projects-client/apps.d.ts.map +1 -0
  140. package/dist/platform/projects-client/apps.js +29 -0
  141. package/dist/platform/projects-client/apps.js.map +1 -0
  142. package/dist/platform/projects-client/audit.d.ts +85 -0
  143. package/dist/platform/projects-client/audit.d.ts.map +1 -0
  144. package/dist/platform/projects-client/audit.js +51 -0
  145. package/dist/platform/projects-client/audit.js.map +1 -0
  146. package/dist/platform/projects-client/billing.d.ts +336 -0
  147. package/dist/platform/projects-client/billing.d.ts.map +1 -0
  148. package/dist/platform/projects-client/billing.js +260 -0
  149. package/dist/platform/projects-client/billing.js.map +1 -0
  150. package/dist/platform/projects-client/change-requests.d.ts +119 -0
  151. package/dist/platform/projects-client/change-requests.d.ts.map +1 -0
  152. package/dist/platform/projects-client/change-requests.js +56 -0
  153. package/dist/platform/projects-client/change-requests.js.map +1 -0
  154. package/dist/platform/projects-client/channels.d.ts +135 -0
  155. package/dist/platform/projects-client/channels.d.ts.map +1 -0
  156. package/dist/platform/projects-client/channels.js +103 -0
  157. package/dist/platform/projects-client/channels.js.map +1 -0
  158. package/dist/platform/projects-client/connectors.d.ts +148 -0
  159. package/dist/platform/projects-client/connectors.d.ts.map +1 -0
  160. package/dist/platform/projects-client/connectors.js +66 -0
  161. package/dist/platform/projects-client/connectors.js.map +1 -0
  162. package/dist/platform/projects-client/files.d.ts +37 -0
  163. package/dist/platform/projects-client/files.d.ts.map +1 -0
  164. package/dist/platform/projects-client/files.js +58 -0
  165. package/dist/platform/projects-client/files.js.map +1 -0
  166. package/dist/platform/projects-client/gateway.d.ts +177 -0
  167. package/dist/platform/projects-client/gateway.d.ts.map +1 -0
  168. package/dist/platform/projects-client/gateway.js +59 -0
  169. package/dist/platform/projects-client/gateway.js.map +1 -0
  170. package/dist/platform/projects-client/git-history.d.ts +74 -0
  171. package/dist/platform/projects-client/git-history.d.ts.map +1 -0
  172. package/dist/platform/projects-client/git-history.js +40 -0
  173. package/dist/platform/projects-client/git-history.js.map +1 -0
  174. package/dist/platform/projects-client/github.d.ts +62 -0
  175. package/dist/platform/projects-client/github.d.ts.map +1 -0
  176. package/dist/platform/projects-client/github.js +30 -0
  177. package/dist/platform/projects-client/github.js.map +1 -0
  178. package/dist/platform/projects-client/index.d.ts +32 -0
  179. package/dist/platform/projects-client/index.d.ts.map +1 -0
  180. package/dist/platform/projects-client/index.js +34 -0
  181. package/dist/platform/projects-client/index.js.map +1 -0
  182. package/dist/platform/projects-client/marketplace-catalog.d.ts +76 -0
  183. package/dist/platform/projects-client/marketplace-catalog.d.ts.map +1 -0
  184. package/dist/platform/projects-client/marketplace-catalog.js +48 -0
  185. package/dist/platform/projects-client/marketplace-catalog.js.map +1 -0
  186. package/dist/platform/projects-client/marketplace.d.ts +80 -0
  187. package/dist/platform/projects-client/marketplace.d.ts.map +1 -0
  188. package/dist/platform/projects-client/marketplace.js +52 -0
  189. package/dist/platform/projects-client/marketplace.js.map +1 -0
  190. package/dist/platform/projects-client/model-defaults.d.ts +36 -0
  191. package/dist/platform/projects-client/model-defaults.d.ts.map +1 -0
  192. package/dist/platform/projects-client/model-defaults.js +16 -0
  193. package/dist/platform/projects-client/model-defaults.js.map +1 -0
  194. package/dist/platform/projects-client/policies.d.ts +21 -0
  195. package/dist/platform/projects-client/policies.d.ts.map +1 -0
  196. package/dist/platform/projects-client/policies.js +10 -0
  197. package/dist/platform/projects-client/policies.js.map +1 -0
  198. package/dist/platform/projects-client/projects.d.ts +235 -0
  199. package/dist/platform/projects-client/projects.d.ts.map +1 -0
  200. package/dist/platform/projects-client/projects.js +161 -0
  201. package/dist/platform/projects-client/projects.js.map +1 -0
  202. package/dist/platform/projects-client/public-session-shares.d.ts +52 -0
  203. package/dist/platform/projects-client/public-session-shares.d.ts.map +1 -0
  204. package/dist/platform/projects-client/public-session-shares.js +54 -0
  205. package/dist/platform/projects-client/public-session-shares.js.map +1 -0
  206. package/dist/platform/projects-client/review.d.ts +57 -0
  207. package/dist/platform/projects-client/review.d.ts.map +1 -0
  208. package/dist/platform/projects-client/review.js +28 -0
  209. package/dist/platform/projects-client/review.js.map +1 -0
  210. package/dist/platform/projects-client/sandbox-shares.d.ts +25 -0
  211. package/dist/platform/projects-client/sandbox-shares.d.ts.map +1 -0
  212. package/dist/platform/projects-client/sandbox-shares.js +29 -0
  213. package/dist/platform/projects-client/sandbox-shares.js.map +1 -0
  214. package/dist/platform/projects-client/sandbox.d.ts +123 -0
  215. package/dist/platform/projects-client/sandbox.d.ts.map +1 -0
  216. package/dist/platform/projects-client/sandbox.js +45 -0
  217. package/dist/platform/projects-client/sandbox.js.map +1 -0
  218. package/dist/platform/projects-client/secrets.d.ts +122 -0
  219. package/dist/platform/projects-client/secrets.d.ts.map +1 -0
  220. package/dist/platform/projects-client/secrets.js +34 -0
  221. package/dist/platform/projects-client/secrets.js.map +1 -0
  222. package/dist/platform/projects-client/session-sandbox.d.ts +61 -0
  223. package/dist/platform/projects-client/session-sandbox.d.ts.map +1 -0
  224. package/dist/platform/projects-client/session-sandbox.js +82 -0
  225. package/dist/platform/projects-client/session-sandbox.js.map +1 -0
  226. package/dist/platform/projects-client/sessions.d.ts +216 -0
  227. package/dist/platform/projects-client/sessions.d.ts.map +1 -0
  228. package/dist/platform/projects-client/sessions.js +74 -0
  229. package/dist/platform/projects-client/sessions.js.map +1 -0
  230. package/dist/platform/projects-client/setup-links.d.ts +35 -0
  231. package/dist/platform/projects-client/setup-links.d.ts.map +1 -0
  232. package/dist/platform/projects-client/setup-links.js +24 -0
  233. package/dist/platform/projects-client/setup-links.js.map +1 -0
  234. package/dist/platform/projects-client/shared.d.ts +66 -0
  235. package/dist/platform/projects-client/shared.d.ts.map +1 -0
  236. package/dist/platform/projects-client/shared.js +44 -0
  237. package/dist/platform/projects-client/shared.js.map +1 -0
  238. package/dist/platform/projects-client/tokens.d.ts +77 -0
  239. package/dist/platform/projects-client/tokens.d.ts.map +1 -0
  240. package/dist/platform/projects-client/tokens.js +43 -0
  241. package/dist/platform/projects-client/tokens.js.map +1 -0
  242. package/dist/platform/projects-client/transcription.d.ts +5 -0
  243. package/dist/platform/projects-client/transcription.d.ts.map +1 -0
  244. package/dist/platform/projects-client/transcription.js +14 -0
  245. package/dist/platform/projects-client/transcription.js.map +1 -0
  246. package/dist/platform/projects-client/triggers.d.ts +102 -0
  247. package/dist/platform/projects-client/triggers.d.ts.map +1 -0
  248. package/dist/platform/projects-client/triggers.js +27 -0
  249. package/dist/platform/projects-client/triggers.js.map +1 -0
  250. package/dist/platform/session-id.d.ts +9 -0
  251. package/dist/platform/session-id.d.ts.map +1 -0
  252. package/dist/platform/session-id.js +23 -0
  253. package/dist/platform/session-id.js.map +1 -0
  254. package/dist/platform/storage/managed-storage.d.ts +97 -0
  255. package/dist/platform/storage/managed-storage.d.ts.map +1 -0
  256. package/dist/platform/storage/managed-storage.js +271 -0
  257. package/dist/platform/storage/managed-storage.js.map +1 -0
  258. package/dist/platform/strings.d.ts +12 -0
  259. package/dist/platform/strings.d.ts.map +1 -0
  260. package/dist/platform/strings.js +17 -0
  261. package/dist/platform/strings.js.map +1 -0
  262. package/dist/platform/ui.d.ts +11 -0
  263. package/dist/platform/ui.d.ts.map +1 -0
  264. package/dist/platform/ui.js +22 -0
  265. package/dist/platform/ui.js.map +1 -0
  266. package/dist/react/chat/index.d.ts +3 -0
  267. package/dist/react/chat/index.d.ts.map +1 -0
  268. package/dist/react/chat/index.js +7 -0
  269. package/dist/react/chat/index.js.map +1 -0
  270. package/dist/react/chat/render-parts.d.ts +39 -0
  271. package/dist/react/chat/render-parts.d.ts.map +1 -0
  272. package/dist/react/chat/render-parts.js +34 -0
  273. package/dist/react/chat/render-parts.js.map +1 -0
  274. package/dist/react/chat/use-chat-turns.d.ts +19 -0
  275. package/dist/react/chat/use-chat-turns.d.ts.map +1 -0
  276. package/dist/react/chat/use-chat-turns.js +27 -0
  277. package/dist/react/chat/use-chat-turns.js.map +1 -0
  278. package/dist/react/file-keys.d.ts +18 -0
  279. package/dist/react/file-keys.d.ts.map +1 -0
  280. package/dist/react/file-keys.js +18 -0
  281. package/dist/react/file-keys.js.map +1 -0
  282. package/dist/react/index.d.ts +12 -0
  283. package/dist/react/index.d.ts.map +1 -0
  284. package/dist/react/index.js +49 -0
  285. package/dist/react/index.js.map +1 -0
  286. package/dist/react/model-flatten.d.ts +33 -0
  287. package/dist/react/model-flatten.d.ts.map +1 -0
  288. package/dist/react/model-flatten.js +59 -0
  289. package/dist/react/model-flatten.js.map +1 -0
  290. package/dist/react/opencode.d.ts +43 -0
  291. package/dist/react/opencode.d.ts.map +1 -0
  292. package/dist/react/opencode.js +100 -0
  293. package/dist/react/opencode.js.map +1 -0
  294. package/dist/react/prefetch-session-start.d.ts +10 -0
  295. package/dist/react/prefetch-session-start.d.ts.map +1 -0
  296. package/dist/react/prefetch-session-start.js +17 -0
  297. package/dist/react/prefetch-session-start.js.map +1 -0
  298. package/dist/react/provider-refresh.d.ts +7 -0
  299. package/dist/react/provider-refresh.d.ts.map +1 -0
  300. package/dist/react/provider-refresh.js +28 -0
  301. package/dist/react/provider-refresh.js.map +1 -0
  302. package/dist/react/provider-selection.d.ts +31 -0
  303. package/dist/react/provider-selection.d.ts.map +1 -0
  304. package/dist/react/provider-selection.js +135 -0
  305. package/dist/react/provider-selection.js.map +1 -0
  306. package/dist/react/route-project.d.ts +7 -0
  307. package/dist/react/route-project.d.ts.map +1 -0
  308. package/dist/react/route-project.js +19 -0
  309. package/dist/react/route-project.js.map +1 -0
  310. package/dist/react/session-start-stash.d.ts +56 -0
  311. package/dist/react/session-start-stash.d.ts.map +1 -0
  312. package/dist/react/session-start-stash.js +202 -0
  313. package/dist/react/session-start-stash.js.map +1 -0
  314. package/dist/react/use-canonical-opencode-session.d.ts +35 -0
  315. package/dist/react/use-canonical-opencode-session.d.ts.map +1 -0
  316. package/dist/react/use-canonical-opencode-session.js +52 -0
  317. package/dist/react/use-canonical-opencode-session.js.map +1 -0
  318. package/dist/react/use-change-requests.d.ts +321 -0
  319. package/dist/react/use-change-requests.d.ts.map +1 -0
  320. package/dist/react/use-change-requests.js +43 -0
  321. package/dist/react/use-change-requests.js.map +1 -0
  322. package/dist/react/use-current-runtime.d.ts +8 -0
  323. package/dist/react/use-current-runtime.d.ts.map +1 -0
  324. package/dist/react/use-current-runtime.js +12 -0
  325. package/dist/react/use-current-runtime.js.map +1 -0
  326. package/dist/react/use-gateway-catalog-sync.d.ts +2 -0
  327. package/dist/react/use-gateway-catalog-sync.d.ts.map +1 -0
  328. package/dist/react/use-gateway-catalog-sync.js +39 -0
  329. package/dist/react/use-gateway-catalog-sync.js.map +1 -0
  330. package/dist/react/use-kortix-master.d.ts +384 -0
  331. package/dist/react/use-kortix-master.d.ts.map +1 -0
  332. package/dist/react/use-kortix-master.js +958 -0
  333. package/dist/react/use-kortix-master.js.map +1 -0
  334. package/dist/react/use-model-store.d.ts +71 -0
  335. package/dist/react/use-model-store.d.ts.map +1 -0
  336. package/dist/react/use-model-store.js +411 -0
  337. package/dist/react/use-model-store.js.map +1 -0
  338. package/dist/react/use-opencode-config.d.ts +15 -0
  339. package/dist/react/use-opencode-config.d.ts.map +1 -0
  340. package/dist/react/use-opencode-config.js +79 -0
  341. package/dist/react/use-opencode-config.js.map +1 -0
  342. package/dist/react/use-opencode-events/diagnostics.d.ts +11 -0
  343. package/dist/react/use-opencode-events/diagnostics.d.ts.map +1 -0
  344. package/dist/react/use-opencode-events/diagnostics.js +58 -0
  345. package/dist/react/use-opencode-events/diagnostics.js.map +1 -0
  346. package/dist/react/use-opencode-events/handle-event.d.ts +20 -0
  347. package/dist/react/use-opencode-events/handle-event.d.ts.map +1 -0
  348. package/dist/react/use-opencode-events/handle-event.js +450 -0
  349. package/dist/react/use-opencode-events/handle-event.js.map +1 -0
  350. package/dist/react/use-opencode-events/helpers.d.ts +30 -0
  351. package/dist/react/use-opencode-events/helpers.d.ts.map +1 -0
  352. package/dist/react/use-opencode-events/helpers.js +93 -0
  353. package/dist/react/use-opencode-events/helpers.js.map +1 -0
  354. package/dist/react/use-opencode-events/index.d.ts +25 -0
  355. package/dist/react/use-opencode-events/index.d.ts.map +1 -0
  356. package/dist/react/use-opencode-events/index.js +242 -0
  357. package/dist/react/use-opencode-events/index.js.map +1 -0
  358. package/dist/react/use-opencode-events/types.d.ts +10 -0
  359. package/dist/react/use-opencode-events/types.d.ts.map +1 -0
  360. package/dist/react/use-opencode-events/types.js +2 -0
  361. package/dist/react/use-opencode-events/types.js.map +1 -0
  362. package/dist/react/use-opencode-events/use-event-stream-refs.d.ts +22 -0
  363. package/dist/react/use-opencode-events/use-event-stream-refs.d.ts.map +1 -0
  364. package/dist/react/use-opencode-events/use-event-stream-refs.js +158 -0
  365. package/dist/react/use-opencode-events/use-event-stream-refs.js.map +1 -0
  366. package/dist/react/use-opencode-local.d.ts +139 -0
  367. package/dist/react/use-opencode-local.d.ts.map +1 -0
  368. package/dist/react/use-opencode-local.js +484 -0
  369. package/dist/react/use-opencode-local.js.map +1 -0
  370. package/dist/react/use-opencode-mcp.d.ts +34 -0
  371. package/dist/react/use-opencode-mcp.d.ts.map +1 -0
  372. package/dist/react/use-opencode-mcp.js +190 -0
  373. package/dist/react/use-opencode-mcp.js.map +1 -0
  374. package/dist/react/use-opencode-pty.d.ts +30 -0
  375. package/dist/react/use-opencode-pty.d.ts.map +1 -0
  376. package/dist/react/use-opencode-pty.js +126 -0
  377. package/dist/react/use-opencode-pty.js.map +1 -0
  378. package/dist/react/use-opencode-sessions/agents.d.ts +14 -0
  379. package/dist/react/use-opencode-sessions/agents.d.ts.map +1 -0
  380. package/dist/react/use-opencode-sessions/agents.js +82 -0
  381. package/dist/react/use-opencode-sessions/agents.js.map +1 -0
  382. package/dist/react/use-opencode-sessions/commands.d.ts +8 -0
  383. package/dist/react/use-opencode-sessions/commands.d.ts.map +1 -0
  384. package/dist/react/use-opencode-sessions/commands.js +46 -0
  385. package/dist/react/use-opencode-sessions/commands.js.map +1 -0
  386. package/dist/react/use-opencode-sessions/files.d.ts +2 -0
  387. package/dist/react/use-opencode-sessions/files.d.ts.map +1 -0
  388. package/dist/react/use-opencode-sessions/files.js +181 -0
  389. package/dist/react/use-opencode-sessions/files.js.map +1 -0
  390. package/dist/react/use-opencode-sessions/index.d.ts +15 -0
  391. package/dist/react/use-opencode-sessions/index.d.ts.map +1 -0
  392. package/dist/react/use-opencode-sessions/index.js +21 -0
  393. package/dist/react/use-opencode-sessions/index.js.map +1 -0
  394. package/dist/react/use-opencode-sessions/keys.d.ts +94 -0
  395. package/dist/react/use-opencode-sessions/keys.d.ts.map +1 -0
  396. package/dist/react/use-opencode-sessions/keys.js +39 -0
  397. package/dist/react/use-opencode-sessions/keys.js.map +1 -0
  398. package/dist/react/use-opencode-sessions/mcp.d.ts +3 -0
  399. package/dist/react/use-opencode-sessions/mcp.d.ts.map +1 -0
  400. package/dist/react/use-opencode-sessions/mcp.js +23 -0
  401. package/dist/react/use-opencode-sessions/mcp.js.map +1 -0
  402. package/dist/react/use-opencode-sessions/messages.d.ts +75 -0
  403. package/dist/react/use-opencode-sessions/messages.d.ts.map +1 -0
  404. package/dist/react/use-opencode-sessions/messages.js +319 -0
  405. package/dist/react/use-opencode-sessions/messages.js.map +1 -0
  406. package/dist/react/use-opencode-sessions/parts.d.ts +23 -0
  407. package/dist/react/use-opencode-sessions/parts.d.ts.map +1 -0
  408. package/dist/react/use-opencode-sessions/parts.js +49 -0
  409. package/dist/react/use-opencode-sessions/parts.js.map +1 -0
  410. package/dist/react/use-opencode-sessions/permissions.d.ts +17 -0
  411. package/dist/react/use-opencode-sessions/permissions.d.ts.map +1 -0
  412. package/dist/react/use-opencode-sessions/permissions.js +66 -0
  413. package/dist/react/use-opencode-sessions/permissions.js.map +1 -0
  414. package/dist/react/use-opencode-sessions/projects.d.ts +5 -0
  415. package/dist/react/use-opencode-sessions/projects.d.ts.map +1 -0
  416. package/dist/react/use-opencode-sessions/projects.js +54 -0
  417. package/dist/react/use-opencode-sessions/projects.js.map +1 -0
  418. package/dist/react/use-opencode-sessions/providers.d.ts +10 -0
  419. package/dist/react/use-opencode-sessions/providers.d.ts.map +1 -0
  420. package/dist/react/use-opencode-sessions/providers.js +98 -0
  421. package/dist/react/use-opencode-sessions/providers.js.map +1 -0
  422. package/dist/react/use-opencode-sessions/sessions.d.ts +35 -0
  423. package/dist/react/use-opencode-sessions/sessions.d.ts.map +1 -0
  424. package/dist/react/use-opencode-sessions/sessions.js +380 -0
  425. package/dist/react/use-opencode-sessions/sessions.js.map +1 -0
  426. package/dist/react/use-opencode-sessions/shared.d.ts +43 -0
  427. package/dist/react/use-opencode-sessions/shared.d.ts.map +1 -0
  428. package/dist/react/use-opencode-sessions/shared.js +109 -0
  429. package/dist/react/use-opencode-sessions/shared.js.map +1 -0
  430. package/dist/react/use-opencode-sessions/sharing.d.ts +4 -0
  431. package/dist/react/use-opencode-sessions/sharing.d.ts.map +1 -0
  432. package/dist/react/use-opencode-sessions/sharing.js +57 -0
  433. package/dist/react/use-opencode-sessions/sharing.js.map +1 -0
  434. package/dist/react/use-opencode-sessions/tools.d.ts +5 -0
  435. package/dist/react/use-opencode-sessions/tools.d.ts.map +1 -0
  436. package/dist/react/use-opencode-sessions/tools.js +54 -0
  437. package/dist/react/use-opencode-sessions/tools.js.map +1 -0
  438. package/dist/react/use-permission-self-heal.d.ts +45 -0
  439. package/dist/react/use-permission-self-heal.d.ts.map +1 -0
  440. package/dist/react/use-permission-self-heal.js +144 -0
  441. package/dist/react/use-permission-self-heal.js.map +1 -0
  442. package/dist/react/use-project-config.d.ts +11 -0
  443. package/dist/react/use-project-config.d.ts.map +1 -0
  444. package/dist/react/use-project-config.js +22 -0
  445. package/dist/react/use-project-config.js.map +1 -0
  446. package/dist/react/use-project-models.d.ts +11 -0
  447. package/dist/react/use-project-models.d.ts.map +1 -0
  448. package/dist/react/use-project-models.js +25 -0
  449. package/dist/react/use-project-models.js.map +1 -0
  450. package/dist/react/use-project-secrets.d.ts +265 -0
  451. package/dist/react/use-project-secrets.d.ts.map +1 -0
  452. package/dist/react/use-project-secrets.js +41 -0
  453. package/dist/react/use-project-secrets.js.map +1 -0
  454. package/dist/react/use-project-triggers.d.ts +228 -0
  455. package/dist/react/use-project-triggers.d.ts.map +1 -0
  456. package/dist/react/use-project-triggers.js +42 -0
  457. package/dist/react/use-project-triggers.js.map +1 -0
  458. package/dist/react/use-question-self-heal.d.ts +36 -0
  459. package/dist/react/use-question-self-heal.d.ts.map +1 -0
  460. package/dist/react/use-question-self-heal.js +95 -0
  461. package/dist/react/use-question-self-heal.js.map +1 -0
  462. package/dist/react/use-runtime-phase.d.ts +9 -0
  463. package/dist/react/use-runtime-phase.d.ts.map +1 -0
  464. package/dist/react/use-runtime-phase.js +20 -0
  465. package/dist/react/use-runtime-phase.js.map +1 -0
  466. package/dist/react/use-runtime-reconnect.d.ts +90 -0
  467. package/dist/react/use-runtime-reconnect.d.ts.map +1 -0
  468. package/dist/react/use-runtime-reconnect.js +234 -0
  469. package/dist/react/use-runtime-reconnect.js.map +1 -0
  470. package/dist/react/use-session-picks.d.ts +17 -0
  471. package/dist/react/use-session-picks.d.ts.map +1 -0
  472. package/dist/react/use-session-picks.js +36 -0
  473. package/dist/react/use-session-picks.js.map +1 -0
  474. package/dist/react/use-session-prefetch.d.ts +18 -0
  475. package/dist/react/use-session-prefetch.d.ts.map +1 -0
  476. package/dist/react/use-session-prefetch.js +84 -0
  477. package/dist/react/use-session-prefetch.js.map +1 -0
  478. package/dist/react/use-session-send.d.ts +183 -0
  479. package/dist/react/use-session-send.d.ts.map +1 -0
  480. package/dist/react/use-session-send.js +287 -0
  481. package/dist/react/use-session-send.js.map +1 -0
  482. package/dist/react/use-session-sync.d.ts +24 -0
  483. package/dist/react/use-session-sync.d.ts.map +1 -0
  484. package/dist/react/use-session-sync.js +375 -0
  485. package/dist/react/use-session-sync.js.map +1 -0
  486. package/dist/react/use-session.d.ts +171 -0
  487. package/dist/react/use-session.d.ts.map +1 -0
  488. package/dist/react/use-session.js +396 -0
  489. package/dist/react/use-session.js.map +1 -0
  490. package/dist/react/use-visible-agents.d.ts +22 -0
  491. package/dist/react/use-visible-agents.d.ts.map +1 -0
  492. package/dist/react/use-visible-agents.js +45 -0
  493. package/dist/react/use-visible-agents.js.map +1 -0
  494. package/dist/server.d.ts +55 -0
  495. package/dist/server.d.ts.map +1 -0
  496. package/dist/server.js +122 -0
  497. package/dist/server.js.map +1 -0
  498. package/dist/session/health.d.ts +49 -0
  499. package/dist/session/health.d.ts.map +1 -0
  500. package/dist/session/health.js +57 -0
  501. package/dist/session/health.js.map +1 -0
  502. package/dist/session/index.d.ts +19 -0
  503. package/dist/session/index.d.ts.map +1 -0
  504. package/dist/session/index.js +19 -0
  505. package/dist/session/index.js.map +1 -0
  506. package/dist/session/preview.d.ts +24 -0
  507. package/dist/session/preview.d.ts.map +1 -0
  508. package/dist/session/preview.js +85 -0
  509. package/dist/session/preview.js.map +1 -0
  510. package/dist/session/url.d.ts +160 -0
  511. package/dist/session/url.d.ts.map +1 -0
  512. package/dist/session/url.js +522 -0
  513. package/dist/session/url.js.map +1 -0
  514. package/dist/state/chat-events.d.ts +141 -0
  515. package/dist/state/chat-events.d.ts.map +1 -0
  516. package/dist/state/chat-events.js +135 -0
  517. package/dist/state/chat-events.js.map +1 -0
  518. package/dist/state/current-runtime.d.ts +44 -0
  519. package/dist/state/current-runtime.d.ts.map +1 -0
  520. package/dist/state/current-runtime.js +44 -0
  521. package/dist/state/current-runtime.js.map +1 -0
  522. package/dist/state/diagnostics-store.d.ts +114 -0
  523. package/dist/state/diagnostics-store.d.ts.map +1 -0
  524. package/dist/state/diagnostics-store.js +319 -0
  525. package/dist/state/diagnostics-store.js.map +1 -0
  526. package/dist/state/event-stream.d.ts +134 -0
  527. package/dist/state/event-stream.d.ts.map +1 -0
  528. package/dist/state/event-stream.js +424 -0
  529. package/dist/state/event-stream.js.map +1 -0
  530. package/dist/state/idb-sync-cache.d.ts +18 -0
  531. package/dist/state/idb-sync-cache.d.ts.map +1 -0
  532. package/dist/state/idb-sync-cache.js +209 -0
  533. package/dist/state/idb-sync-cache.js.map +1 -0
  534. package/dist/state/opencode-compaction-store.d.ts +10 -0
  535. package/dist/state/opencode-compaction-store.d.ts.map +1 -0
  536. package/dist/state/opencode-compaction-store.js +32 -0
  537. package/dist/state/opencode-compaction-store.js.map +1 -0
  538. package/dist/state/opencode-pending-store.d.ts +19 -0
  539. package/dist/state/opencode-pending-store.d.ts.map +1 -0
  540. package/dist/state/opencode-pending-store.js +76 -0
  541. package/dist/state/opencode-pending-store.js.map +1 -0
  542. package/dist/state/sandbox-connection-store.d.ts +62 -0
  543. package/dist/state/sandbox-connection-store.d.ts.map +1 -0
  544. package/dist/state/sandbox-connection-store.js +290 -0
  545. package/dist/state/sandbox-connection-store.js.map +1 -0
  546. package/dist/state/server-store/active.d.ts +49 -0
  547. package/dist/state/server-store/active.d.ts.map +1 -0
  548. package/dist/state/server-store/active.js +76 -0
  549. package/dist/state/server-store/active.js.map +1 -0
  550. package/dist/state/server-store/types.d.ts +12 -0
  551. package/dist/state/server-store/types.d.ts.map +1 -0
  552. package/dist/state/server-store/types.js +2 -0
  553. package/dist/state/server-store/types.js.map +1 -0
  554. package/dist/state/server-store/url-helpers.d.ts +33 -0
  555. package/dist/state/server-store/url-helpers.d.ts.map +1 -0
  556. package/dist/state/server-store/url-helpers.js +55 -0
  557. package/dist/state/server-store/url-helpers.js.map +1 -0
  558. package/dist/state/server-store.d.ts +18 -0
  559. package/dist/state/server-store.d.ts.map +1 -0
  560. package/dist/state/server-store.js +23 -0
  561. package/dist/state/server-store.js.map +1 -0
  562. package/dist/state/session-runtime-registry.d.ts +49 -0
  563. package/dist/state/session-runtime-registry.d.ts.map +1 -0
  564. package/dist/state/session-runtime-registry.js +85 -0
  565. package/dist/state/session-runtime-registry.js.map +1 -0
  566. package/dist/state/sync-store/ascending-id.d.ts +2 -0
  567. package/dist/state/sync-store/ascending-id.d.ts.map +1 -0
  568. package/dist/state/sync-store/ascending-id.js +21 -0
  569. package/dist/state/sync-store/ascending-id.js.map +1 -0
  570. package/dist/state/sync-store/binary.d.ts +7 -0
  571. package/dist/state/sync-store/binary.d.ts.map +1 -0
  572. package/dist/state/sync-store/binary.js +21 -0
  573. package/dist/state/sync-store/binary.js.map +1 -0
  574. package/dist/state/sync-store/stream-cache.d.ts +2 -0
  575. package/dist/state/sync-store/stream-cache.d.ts.map +1 -0
  576. package/dist/state/sync-store/stream-cache.js +29 -0
  577. package/dist/state/sync-store/stream-cache.js.map +1 -0
  578. package/dist/state/sync-store/types.d.ts +29 -0
  579. package/dist/state/sync-store/types.d.ts.map +1 -0
  580. package/dist/state/sync-store/types.js +2 -0
  581. package/dist/state/sync-store/types.js.map +1 -0
  582. package/dist/state/sync-store.d.ts +39 -0
  583. package/dist/state/sync-store.d.ts.map +1 -0
  584. package/dist/state/sync-store.js +692 -0
  585. package/dist/state/sync-store.js.map +1 -0
  586. package/dist/state/tab-store.d.ts +91 -0
  587. package/dist/state/tab-store.d.ts.map +1 -0
  588. package/dist/state/tab-store.js +369 -0
  589. package/dist/state/tab-store.js.map +1 -0
  590. package/dist/transcript.d.ts +40 -0
  591. package/dist/transcript.d.ts.map +1 -0
  592. package/dist/transcript.js +126 -0
  593. package/dist/transcript.js.map +1 -0
  594. package/dist/turns/classify.d.ts +166 -0
  595. package/dist/turns/classify.d.ts.map +1 -0
  596. package/dist/turns/classify.js +259 -0
  597. package/dist/turns/classify.js.map +1 -0
  598. package/dist/turns/errors.d.ts +11 -0
  599. package/dist/turns/errors.d.ts.map +1 -0
  600. package/dist/turns/errors.js +85 -0
  601. package/dist/turns/errors.js.map +1 -0
  602. package/dist/turns/index.d.ts +264 -0
  603. package/dist/turns/index.d.ts.map +1 -0
  604. package/dist/turns/index.js +1243 -0
  605. package/dist/turns/index.js.map +1 -0
  606. package/dist/turns/tool-registry.d.ts +33 -0
  607. package/dist/turns/tool-registry.d.ts.map +1 -0
  608. package/dist/turns/tool-registry.js +108 -0
  609. package/dist/turns/tool-registry.js.map +1 -0
  610. package/dist/turns/types.d.ts +125 -0
  611. package/dist/turns/types.d.ts.map +1 -0
  612. package/dist/turns/types.js +12 -0
  613. package/dist/turns/types.js.map +1 -0
  614. package/dist/turns/view-model.d.ts +127 -0
  615. package/dist/turns/view-model.d.ts.map +1 -0
  616. package/dist/turns/view-model.js +401 -0
  617. package/dist/turns/view-model.js.map +1 -0
  618. package/package.json +155 -0
@@ -0,0 +1,897 @@
1
+ import type { OpencodeClient } from '@opencode-ai/sdk/v2/client';
2
+ /**
3
+ * createKortix — the single opinionated entry point to the Kortix data layer.
4
+ *
5
+ * One client. Every action a method. The host app imports ONLY from `@kortix/sdk`
6
+ * — never `@opencode-ai/sdk`, never `backendApi`/`authenticatedFetch` directly.
7
+ *
8
+ * const kortix = createKortix({ getToken });
9
+ * await kortix.projects.list();
10
+ * await kortix.project(pid).secrets.upsert({ name, value });
11
+ * const s = kortix.session(pid, sid);
12
+ * await s.start();
13
+ * s.runtime.session.prompt({ sessionID: sid, parts }); // typed opencode, via the SDK
14
+ *
15
+ * REST methods are direct references to the platform client, so they keep their
16
+ * exact types with zero re-typing. The `project()`/`session()` handles bind ids
17
+ * for ergonomics. Reactive data still comes from `@kortix/sdk/react` hooks.
18
+ */
19
+ import * as F from './files/client.js';
20
+ import { type KortixPlatformConfig } from './platform/config.js';
21
+ import * as P from './platform/projects-client/index.js';
22
+ import { type SessionRuntimeEntry } from './state/session-runtime-registry.js';
23
+ import { type EventStreamHandle, type OpenCodeEvent } from './state/event-stream.js';
24
+ /** A model the agent can run, as the opencode runtime identifies it. */
25
+ export type SessionModel = {
26
+ providerID: string;
27
+ modelID: string;
28
+ };
29
+ /** The opencode runtime client for the currently-active sandbox (set by the host). */
30
+ declare function runtime(): OpencodeClient;
31
+ export declare class SessionNotReadyError extends Error {
32
+ constructor(action: string);
33
+ }
34
+ export declare function createKortix(config: KortixPlatformConfig, opts?: {
35
+ global?: boolean;
36
+ }): {
37
+ /** The platform config in effect (for diagnostics). */
38
+ config: KortixPlatformConfig;
39
+ accounts: {
40
+ list: typeof P.listAccounts;
41
+ get: typeof P.getAccount;
42
+ create: typeof P.createAccount;
43
+ updateName: typeof P.updateAccountName;
44
+ leave: typeof P.leaveAccount;
45
+ members: typeof P.listAccountMembers;
46
+ invite: typeof P.inviteAccountMember;
47
+ removeMember: typeof P.removeAccountMember;
48
+ updateMemberRole: typeof P.updateAccountMemberRole;
49
+ invites: typeof P.listAccountInvites;
50
+ /** Cancel a pending account invite (accountId still known/scoped). */
51
+ cancelInvite: typeof P.cancelAccountInvite;
52
+ /** Resend a pending account invite (accountId still known/scoped). */
53
+ resendInvite: typeof P.resendAccountInvite;
54
+ /** CLI PAT minting — account-scoped personal access tokens (`kortix_pat_...`). */
55
+ tokens: {
56
+ list: typeof P.listAccountTokens;
57
+ create: typeof P.createAccountToken;
58
+ revoke: typeof P.revokeAccountToken;
59
+ };
60
+ /** Enterprise audit log — events + CSV/JSONL export + SIEM webhooks. */
61
+ audit: {
62
+ log: typeof P.listAccountAudit;
63
+ export: typeof P.exportAccountAudit;
64
+ webhooks: {
65
+ list: typeof P.listAccountAuditWebhooks;
66
+ create: typeof P.createAccountAuditWebhook;
67
+ update: typeof P.updateAccountAuditWebhook;
68
+ remove: typeof P.removeAccountAuditWebhook;
69
+ };
70
+ };
71
+ };
72
+ /** Account-invite lifecycle reached by invite token alone (accept/decline/describe). */
73
+ accountInvites: {
74
+ describe: typeof P.describeAccountInvite;
75
+ accept: typeof P.acceptAccountInvite;
76
+ decline: typeof P.declineAccountInvite;
77
+ };
78
+ projects: {
79
+ list: typeof P.listProjects;
80
+ listForAccount: typeof P.listProjectsForAccount;
81
+ get: typeof P.getProject;
82
+ detail: typeof P.getProjectDetail;
83
+ create: typeof P.createProject;
84
+ /** Create a project backed by a brand-new Kortix-managed GitHub repo. */
85
+ createRepo: typeof P.createProjectRepo;
86
+ provision: typeof P.provisionProject;
87
+ update: typeof P.updateProject;
88
+ archive: typeof P.archiveProject;
89
+ llmCatalog: typeof P.getProjectLlmCatalog;
90
+ sandboxHealth: typeof P.getProjectSandboxHealth;
91
+ sandboxTemplates: typeof P.listProjectSandboxTemplates;
92
+ sessions: typeof P.listProjectSessions;
93
+ createSession: typeof P.createProjectSession;
94
+ };
95
+ project: (projectId: string) => {
96
+ get: (opts?: Parameters<typeof P.getProject>[1]) => Promise<P.KortixProject>;
97
+ detail: () => Promise<P.ProjectDetail>;
98
+ update: (input: Parameters<typeof P.updateProject>[1]) => Promise<P.KortixProject>;
99
+ archive: () => Promise<{
100
+ ok: boolean;
101
+ }>;
102
+ llmCatalog: () => Promise<P.ProjectLlmCatalogResponse>;
103
+ sandboxHealth: () => Promise<P.ProjectSandboxHealth>;
104
+ onboardingComplete: (completed: boolean) => Promise<P.KortixProject>;
105
+ /** Project-scoped CLI PATs (auto-minted at session-create as `KORTIX_TOKEN`; can also be minted by hand). */
106
+ tokens: {
107
+ list: () => Promise<P.ProjectCliTokenListResponse>;
108
+ create: (input?: Parameters<typeof P.createProjectCliToken>[1]) => Promise<P.CreatedProjectCliToken>;
109
+ revoke: (tokenId: string) => Promise<{
110
+ ok: boolean;
111
+ }>;
112
+ };
113
+ /** Agent-minted setup links — hand a human a link to enter a secret value or 1-click connect an app. */
114
+ setupLinks: {
115
+ requestSecret: (input: Parameters<typeof P.requestProjectSecret>[1]) => Promise<P.SecretRequestLink>;
116
+ requestConnector: (input: Parameters<typeof P.requestProjectConnector>[1]) => Promise<P.ConnectorRequestLink>;
117
+ };
118
+ /** Validate a `kortix.toml` manifest's raw TOML text server-side (same schema `kortix ship`/CR-merge use). */
119
+ validateManifest: (raw: string) => Promise<P.ManifestValidationResult>;
120
+ /** Mint a fresh scoped git push token for a managed project (409 for BYO repos). */
121
+ gitToken: () => Promise<P.ProjectGitToken>;
122
+ /** Marketplace install/updates — commits an item's files (+ lock) straight onto the default branch. */
123
+ marketplace: {
124
+ list: () => Promise<P.MarketplaceInstalledResponse>;
125
+ install: (id: string) => Promise<P.MarketplaceInstallResult>;
126
+ updates: () => Promise<P.MarketplaceUpdatesResponse>;
127
+ update: (name: string) => Promise<P.MarketplaceUpdateResult>;
128
+ updateAll: () => Promise<P.MarketplaceUpdateAllResult>;
129
+ remove: (name: string) => Promise<P.MarketplaceRemoveResult>;
130
+ };
131
+ /** `registry.*` — compatibility alias of `marketplace.*` (identical server-side handlers). */
132
+ registry: {
133
+ list: () => Promise<P.MarketplaceInstalledResponse>;
134
+ install: (id: string) => Promise<P.MarketplaceInstallResult>;
135
+ updates: () => Promise<P.MarketplaceUpdatesResponse>;
136
+ update: (name: string) => Promise<P.MarketplaceUpdateResult>;
137
+ updateAll: () => Promise<P.MarketplaceUpdateAllResult>;
138
+ remove: (name: string) => Promise<P.MarketplaceRemoveResult>;
139
+ };
140
+ secrets: {
141
+ list: () => Promise<P.ProjectSecretsResponse>;
142
+ upsert: (input: Parameters<typeof P.upsertProjectSecret>[1]) => Promise<P.ProjectSecret>;
143
+ remove: (name: string) => Promise<{
144
+ ok: boolean;
145
+ }>;
146
+ setPersonal: (name: string, input: {
147
+ value?: string;
148
+ active?: boolean;
149
+ }) => Promise<P.ProjectSecret>;
150
+ removePersonal: (name: string) => Promise<{
151
+ ok: boolean;
152
+ }>;
153
+ setGitCredential: (input: Parameters<typeof P.upsertProjectGitCredential>[1]) => Promise<{
154
+ configured: boolean;
155
+ provider: string;
156
+ git_connection: P.ProjectGitConnection;
157
+ }>;
158
+ /** Device-code OAuth flow to connect a subscription-backed provider (e.g. ChatGPT). */
159
+ startProviderOAuth: (provider: string, input?: {
160
+ sharing?: P.ConnectorSharing;
161
+ } | undefined) => Promise<P.ProviderOAuthStart>;
162
+ pollProviderOAuth: (provider: string, flowId: string) => Promise<P.ProviderOAuthPoll>;
163
+ };
164
+ access: {
165
+ list: () => Promise<P.ProjectAccessResponse>;
166
+ invite: (email: string, role: P.ProjectRole) => Promise<P.ProjectAccessMember | {
167
+ status: "invited";
168
+ email: string;
169
+ invite_id: string;
170
+ project_role: P.ProjectRole;
171
+ message: string;
172
+ invite_url: string;
173
+ email_sent: boolean;
174
+ email_skip_reason: string | null;
175
+ }>;
176
+ update: (userId: string, role: P.ProjectRole) => Promise<P.ProjectAccessMember>;
177
+ revoke: (userId: string) => Promise<{
178
+ ok: boolean;
179
+ }>;
180
+ pendingInvites: () => Promise<{
181
+ pending: P.PendingProjectInvite[];
182
+ }>;
183
+ resendInvite: (inviteId: string) => Promise<P.ResendProjectInviteResult>;
184
+ revokeInvite: (inviteId: string) => Promise<{
185
+ ok: boolean;
186
+ invitation_cancelled: boolean;
187
+ }>;
188
+ requests: () => Promise<{
189
+ requests: P.ProjectAccessRequest[];
190
+ }>;
191
+ approveRequest: (requestId: string, role?: P.ProjectRole | undefined) => Promise<{
192
+ request: P.ProjectAccessRequest;
193
+ member: P.ProjectAccessMember;
194
+ }>;
195
+ rejectRequest: (requestId: string) => Promise<{
196
+ request: P.ProjectAccessRequest;
197
+ }>;
198
+ groupGrants: () => Promise<{
199
+ grants: P.ProjectGroupGrant[];
200
+ }>;
201
+ attachGroupGrant: (groupId: string, role: P.ProjectRole, expiresAt?: string | null | undefined) => Promise<{
202
+ project_id: string;
203
+ group_id: string;
204
+ role: P.ProjectRole;
205
+ }>;
206
+ updateGroupGrant: (groupId: string, role: P.ProjectRole, expiresAt?: string | null | undefined) => Promise<{
207
+ project_id: string;
208
+ group_id: string;
209
+ role: P.ProjectRole;
210
+ }>;
211
+ detachGroupGrant: (groupId: string) => Promise<{
212
+ ok: boolean;
213
+ }>;
214
+ /** Per-resource (agent/skill/secret) grants to a member or a group. */
215
+ resourceGrants: {
216
+ list: () => Promise<P.ProjectResourceGrantsResponse>;
217
+ create: (input: Parameters<typeof P.createProjectResourceGrant>[1]) => Promise<{
218
+ grant_id: string;
219
+ }>;
220
+ remove: (grantId: string) => Promise<{
221
+ ok: boolean;
222
+ }>;
223
+ };
224
+ };
225
+ connectors: {
226
+ list: () => Promise<P.ConnectorsResponse>;
227
+ config: (slug: string) => Promise<P.ConnectorConfig>;
228
+ create: (draft: P.ConnectorDraftInput) => Promise<{
229
+ ok: boolean;
230
+ sync?: P.ConnectorSyncResult;
231
+ }>;
232
+ remove: (slug: string) => Promise<{
233
+ ok: boolean;
234
+ }>;
235
+ sync: () => Promise<P.ConnectorSyncResult>;
236
+ setName: (slug: string, name: string) => Promise<{
237
+ ok: boolean;
238
+ sync?: P.ConnectorSyncResult;
239
+ }>;
240
+ setCredentialMode: (slug: string, mode: "shared") => Promise<{
241
+ ok: boolean;
242
+ sync?: P.ConnectorSyncResult;
243
+ }>;
244
+ setCredential: (slug: string, value: string) => Promise<{
245
+ ok: boolean;
246
+ }>;
247
+ setSensitive: (slug: string, sensitive: boolean) => Promise<{
248
+ ok: boolean;
249
+ sync?: P.ConnectorSyncResult;
250
+ }>;
251
+ policies: {
252
+ get: (slug: string) => Promise<{
253
+ policies: P.ConnectorPolicyRule[];
254
+ }>;
255
+ set: (slug: string, policies: P.ConnectorPolicyRule[]) => Promise<{
256
+ ok: boolean;
257
+ sync?: P.ConnectorSyncResult;
258
+ }>;
259
+ };
260
+ /** Easy-connect (Pipedream): app catalog + connect/finalize handshake. */
261
+ pipedream: {
262
+ listApps: (q?: string | undefined, cursor?: string | undefined) => Promise<{
263
+ apps: P.PipedreamApp[];
264
+ nextCursor?: string;
265
+ hasMore: boolean;
266
+ }>;
267
+ connect: (slug: string) => Promise<{
268
+ token?: string;
269
+ app?: string;
270
+ connectUrl?: string;
271
+ }>;
272
+ finalize: (slug: string) => Promise<{
273
+ connected: boolean;
274
+ accountId?: string;
275
+ }>;
276
+ };
277
+ };
278
+ policies: {
279
+ list: () => Promise<P.ProjectPoliciesResponse>;
280
+ set: (policies: P.ProjectPolicy[], defaultMode: P.PolicyDefaultMode) => Promise<{
281
+ ok: boolean;
282
+ sync?: P.ConnectorSyncResult;
283
+ }>;
284
+ };
285
+ triggers: {
286
+ list: () => Promise<P.ProjectTriggerListing>;
287
+ create: (input: P.CreateProjectTriggerInput) => Promise<P.ProjectTriggerListing>;
288
+ update: (slug: string, input: P.UpdateProjectTriggerInput) => Promise<P.ProjectTriggerListing>;
289
+ remove: (slug: string) => Promise<{
290
+ ok: boolean;
291
+ }>;
292
+ fire: (slug: string) => Promise<P.FireProjectTriggerResponse>;
293
+ setActivation: (paused: boolean) => Promise<P.ProjectTriggerListing>;
294
+ };
295
+ files: {
296
+ list: (options?: Parameters<typeof P.listProjectFiles>[1]) => Promise<P.ProjectFileEntry[]>;
297
+ read: (path: string, ref?: string) => Promise<{
298
+ path: string;
299
+ ref: string;
300
+ content: string;
301
+ }>;
302
+ search: (query: string, options?: {
303
+ content?: boolean;
304
+ ref?: string;
305
+ limit?: number;
306
+ } | undefined) => Promise<P.ProjectFileSearchResponse>;
307
+ archive: (ref: string, path?: string | undefined) => Promise<Blob>;
308
+ history: (path: string, options?: {
309
+ ref?: string;
310
+ limit?: number;
311
+ skip?: number;
312
+ } | undefined) => Promise<P.ProjectFileHistoryResponse>;
313
+ };
314
+ git: {
315
+ commits: () => Promise<P.ProjectCommitsResponse>;
316
+ commit: (sha: string) => Promise<P.ProjectCommitDetail>;
317
+ commitDiff: (sha: string) => Promise<P.ProjectCommitDiffResponse>;
318
+ branches: () => Promise<P.ProjectBranchesResponse>;
319
+ versionDiff: (input: {
320
+ from: string;
321
+ into: string;
322
+ }) => Promise<P.VersionDiffPreview>;
323
+ /** Invite a GitHub user as a collaborator on a Kortix-managed repo. */
324
+ inviteCollaborator: (githubUsername: string, permission?: "read" | "write" | undefined) => Promise<P.RepoCollaboratorInvite>;
325
+ };
326
+ changeRequests: {
327
+ list: () => Promise<{
328
+ change_requests: P.ChangeRequest[];
329
+ }>;
330
+ get: (crId: string) => Promise<P.ChangeRequestDetailResponse>;
331
+ diff: (crId: string) => Promise<P.ChangeRequestDiffResponse>;
332
+ mergePreview: (crId: string) => Promise<P.ChangeRequestMergePreview>;
333
+ open: (input: {
334
+ title: string;
335
+ description?: string;
336
+ head_ref: string;
337
+ base_ref?: string;
338
+ session_id?: string;
339
+ }) => Promise<P.ChangeRequest>;
340
+ merge: (crId: string, input?: {
341
+ message?: string;
342
+ } | undefined) => Promise<P.ChangeRequestMergeResponse>;
343
+ close: (crId: string) => Promise<P.ChangeRequest>;
344
+ reopen: (crId: string) => Promise<P.ChangeRequest>;
345
+ /** Request changes on a CR (Review Center) — records feedback + optionally delivers it back to the originating session. */
346
+ requestChanges: (crId: string, feedback: string) => Promise<{
347
+ change_request: P.ChangeRequest;
348
+ delivering: boolean;
349
+ }>;
350
+ };
351
+ sessions: {
352
+ list: () => Promise<P.ProjectSession[]>;
353
+ create: (input?: Parameters<typeof P.createProjectSession>[1]) => Promise<P.ProjectSession>;
354
+ };
355
+ /** Review Center — the per-project human-in-the-loop inbox (change requests, tool approvals, agent outputs/decisions). */
356
+ review: {
357
+ list: (params?: Parameters<typeof P.listReviewItems>[1]) => Promise<{
358
+ review_items: P.ApiReviewItem[];
359
+ }>;
360
+ get: (reviewItemId: string) => Promise<{
361
+ review_item: P.ApiReviewItem;
362
+ }>;
363
+ submit: (input: Parameters<typeof P.submitReviewItem>[1]) => Promise<P.ApiReviewItem>;
364
+ act: (reviewItemId: string, input: {
365
+ verdict: P.ReviewVerdict;
366
+ feedback?: string;
367
+ }) => Promise<P.ApiReviewItem>;
368
+ bulkAct: (input: Parameters<typeof P.bulkActReviewItems>[1]) => Promise<{
369
+ updated: number;
370
+ review_items: P.ApiReviewItem[];
371
+ }>;
372
+ };
373
+ /** The manager inbox of executor-gated actions awaiting approve/deny (APPROVE / ASK / BLOCK). */
374
+ approvals: {
375
+ list: (options?: Parameters<typeof P.listPendingApprovals>[1]) => Promise<P.PendingApprovalsResponse>;
376
+ resolve: (executionId: string, decision: "approve" | "deny", scope?: "session" | "once" | "session_all" | undefined) => Promise<{
377
+ ok: boolean;
378
+ scope?: "once" | "session" | "session_all";
379
+ }>;
380
+ sessionsNeedingInput: (options?: Parameters<typeof P.listSessionsNeedingInput>[1]) => Promise<P.SessionsNeedingInputResponse>;
381
+ };
382
+ /** Gateway observability — LLM request logs, cost/latency rollups, budgets, gateway API keys. */
383
+ gateway: {
384
+ logs: (opts?: Parameters<typeof P.listGatewayLogs>[1]) => Promise<P.GatewayLogsResponse>;
385
+ log: (logId: string) => Promise<P.GatewayLogDetail>;
386
+ overview: (days?: number) => Promise<P.GatewayOverview>;
387
+ series: (days?: number) => Promise<P.GatewaySeries>;
388
+ breakdown: (days?: number) => Promise<P.GatewayBreakdown>;
389
+ sessions: (days?: number) => Promise<P.GatewaySessions>;
390
+ errors: (days?: number) => Promise<P.GatewayErrorsResponse>;
391
+ budgets: () => Promise<P.GatewayBudgetsResponse>;
392
+ setBudget: (input: Parameters<typeof P.setGatewayBudget>[1]) => Promise<{
393
+ ok: boolean;
394
+ }>;
395
+ deleteBudget: (budgetId: string) => Promise<{
396
+ ok: boolean;
397
+ }>;
398
+ keys: () => Promise<{
399
+ keys: P.GatewayKeyRow[];
400
+ gateway_url?: string | null;
401
+ }>;
402
+ createKey: (name: string) => Promise<P.CreatedGatewayKey>;
403
+ revokeKey: (keyId: string) => Promise<{
404
+ ok: boolean;
405
+ }>;
406
+ /** Run one prompt against up to 6 models side by side (a model-comparison playground). */
407
+ playground: (prompt: string, models: string[]) => Promise<P.GatewayPlaygroundResponse>;
408
+ };
409
+ /** Slack + email + Meet channel integrations. */
410
+ channels: {
411
+ slack: {
412
+ installation: () => Promise<P.SlackInstallation | null>;
413
+ connect: (input: Parameters<typeof P.connectSlack>[1]) => Promise<P.SlackInstallation>;
414
+ mode: () => Promise<P.SlackMode>;
415
+ manifest: () => Promise<Record<string, unknown>>;
416
+ disconnect: () => Promise<void>;
417
+ /** Download a Slack-hosted file through the server-side proxy (bot token stays server-side). */
418
+ getFile: (url: string) => Promise<Blob>;
419
+ /** Upload a file to Slack through the server-side 3-step external-upload proxy. */
420
+ uploadFile: (input: Parameters<typeof P.uploadSlackChannelFile>[1]) => Promise<P.UploadSlackChannelFileResult>;
421
+ };
422
+ email: {
423
+ installation: (connectorSlug?: string | null) => Promise<P.EmailInstallation | null>;
424
+ mode: () => Promise<P.EmailMode>;
425
+ connect: (input: Parameters<typeof P.connectEmail>[1]) => Promise<P.EmailInstallation>;
426
+ disconnect: (connectorSlug?: string | null) => Promise<void>;
427
+ updatePolicy: (connectorSlug: string | null | undefined, senderPolicy: P.EmailSenderPolicy) => Promise<P.EmailInstallation>;
428
+ };
429
+ meet: {
430
+ voices: () => Promise<P.MeetVoicesResponse | null>;
431
+ setVoice: (voice: string) => Promise<{
432
+ selected: string;
433
+ }>;
434
+ setBotName: (name: string) => Promise<{
435
+ bot_name: string;
436
+ }>;
437
+ previewVoice: (voiceId: string) => Promise<string | null>;
438
+ /** Make the meeting bot speak text (text → ElevenLabs → Recall `output_audio`). */
439
+ speak: (botId: string, text: string, voice?: string) => Promise<P.SpeakInMeetingResult>;
440
+ };
441
+ };
442
+ /** Project apps/deployments — the `/projects/:id/apps/*` family. */
443
+ apps: {
444
+ list: () => Promise<P.ListProjectAppsResponse>;
445
+ create: (input: Parameters<typeof P.createProjectApp>[1]) => Promise<P.ListProjectAppsResponse>;
446
+ update: (slug: string, input: Partial<P.CreateOrUpdateProjectAppInput>) => Promise<P.ListProjectAppsResponse>;
447
+ remove: (slug: string) => Promise<P.ListProjectAppsResponse>;
448
+ deploy: (slug: string) => Promise<P.DeployProjectAppResponse>;
449
+ stop: (slug: string) => Promise<P.StopProjectAppResponse>;
450
+ logs: (slug: string) => Promise<P.ProjectAppLogsResponse>;
451
+ /** @deprecated Use `updateExperimentalFeature('apps', enabled)` — kept for parity with the underlying client. */
452
+ updateConfig: (input: Parameters<typeof P.updateAppsConfig>[1]) => Promise<P.KortixProject>;
453
+ };
454
+ /** Toggle an experimental feature (Customize → Settings → Experimental). Pass `enabled: null` to clear the override. */
455
+ updateExperimentalFeature: (feature: P.ExperimentalFeatureKey, enabled: boolean | null) => Promise<P.KortixProject>;
456
+ /** Default model preferences (account/agent/project scope, gateway-resolved). */
457
+ modelDefaults: {
458
+ get: () => Promise<P.ModelDefaultsResponse>;
459
+ set: (input: Parameters<typeof P.setModelDefault>[1]) => Promise<{
460
+ ok: boolean;
461
+ scope: string;
462
+ agentName?: string;
463
+ model: string;
464
+ }>;
465
+ clear: (params: Parameters<typeof P.clearModelDefault>[1]) => Promise<{
466
+ ok: boolean;
467
+ }>;
468
+ };
469
+ /** Sandbox templates + snapshot builds — Dockerfile/image/warm-pool config, beyond `sandboxHealth`/`sandboxTemplates`. */
470
+ sandbox: {
471
+ list: () => Promise<P.SandboxTemplatesResponse>;
472
+ snapshots: () => Promise<P.ProjectSnapshotsResponse>;
473
+ rebuildSnapshot: (slug?: string) => Promise<P.RebuildSnapshotResponse>;
474
+ fixWithAgent: () => Promise<{
475
+ session_id: string;
476
+ }>;
477
+ createTemplate: (input: Parameters<typeof P.createSandboxTemplate>[1]) => Promise<{
478
+ template_id: string;
479
+ slug: string;
480
+ }>;
481
+ updateTemplate: (templateId: string, input: P.UpdateSandboxTemplateInput) => Promise<{
482
+ template_id: string;
483
+ slug: string;
484
+ }>;
485
+ removeTemplate: (templateId: string) => Promise<null>;
486
+ buildTemplate: (templateId: string) => Promise<{
487
+ status: "started";
488
+ template_id: string;
489
+ slug: string;
490
+ }>;
491
+ /** Pin/clear the per-project sandbox provider (null = follow the platform default). */
492
+ setProvider: (provider: string | null) => Promise<P.KortixProject>;
493
+ };
494
+ /** Bind specific secrets + connectors to an agent (the inheritance pyramid's declaration step). */
495
+ setAgentScope: (agentName: string, scope: {
496
+ env?: P.AgentGrantSet;
497
+ connectors?: P.AgentGrantSet;
498
+ }) => Promise<{
499
+ ok: boolean;
500
+ agent: string;
501
+ env: P.AgentGrantSet;
502
+ connectors: P.AgentGrantSet;
503
+ }>;
504
+ session: (sessionId: string) => {
505
+ get: (opts?: {
506
+ showErrors?: boolean;
507
+ }) => Promise<P.ProjectSession>;
508
+ update: (input: Parameters<typeof P.updateProjectSession>[2]) => Promise<P.ProjectSession>;
509
+ delete: () => Promise<{
510
+ ok: boolean;
511
+ }>;
512
+ start: (waitMs?: number | undefined) => Promise<P.SessionStartResult | null>;
513
+ restart: () => Promise<{
514
+ ok: boolean;
515
+ session_id: string;
516
+ status: string;
517
+ }>;
518
+ stop: () => Promise<{
519
+ ok: boolean;
520
+ session_id: string;
521
+ status: string;
522
+ }>;
523
+ setSharing: (intent: Parameters<typeof P.setProjectSessionSharing>[2]) => Promise<P.ProjectSession>;
524
+ previews: () => Promise<{
525
+ candidates: P.SessionPreviewCandidate[];
526
+ }>;
527
+ commit: (input?: Parameters<typeof P.commitSessionChanges>[2]) => Promise<P.CommitSessionResult>;
528
+ publicShares: {
529
+ list: () => Promise<{
530
+ shares: P.SessionPublicShare[];
531
+ }>;
532
+ create: (input: P.CreateSessionPublicShareInput) => Promise<{
533
+ share: P.SessionPublicShare;
534
+ }>;
535
+ revoke: (shareId: string) => Promise<{
536
+ share: P.SessionPublicShare;
537
+ }>;
538
+ };
539
+ /** Per-session audit trail of executor-gated agent actions. */
540
+ audit: (limit?: number, options?: {
541
+ showErrors?: boolean;
542
+ }) => Promise<P.SessionAudit>;
543
+ /** Compact server-side transcript read (text + tool calls, no tool inputs/outputs) — callable with project-scoped session tokens. */
544
+ transcript: (options?: Parameters<typeof P.getSessionTranscript>[2]) => Promise<P.SessionTranscript>;
545
+ /**
546
+ * Resolve THIS handle's own runtime (idempotent): provisions/resumes the
547
+ * sandbox (long-poll until ready) and caches the resolved OpenCode session
548
+ * id + runtime URL + sandbox id for every other call on this handle. Call
549
+ * this (or `send`/`abort`, which call it internally) before `.runtime`,
550
+ * `.health()`, `.previewUrl()`, or `.proxyUrl()` — those throw
551
+ * `SessionNotReadyError` instead of falling back to whatever sandbox
552
+ * happens to be globally active.
553
+ */
554
+ ensureReady: () => Promise<SessionRuntimeEntry>;
555
+ /**
556
+ * Liveness/readiness of THIS session's runtime (`GET /kortix/health`).
557
+ * Unlike `.previewUrl()`/`.proxyUrl()`/`.runtime`, this never throws
558
+ * `SessionNotReadyError` — a health poller (e.g. a header dot ticking
559
+ * every 15s on a fresh inline handle) needs to be callable BEFORE the
560
+ * session has ever resolved a runtime. It degrades to the same graceful
561
+ * `{ status: 0, ok: false }` shape `getSessionHealth` already returns for
562
+ * "no URL yet", instead of forcing every caller to guard with `ensureReady()`.
563
+ */
564
+ health: (init?: RequestInit) => Promise<import("./index.js").SessionHealthResult>;
565
+ /** Proxy/preview URL for a port THIS session's runtime exposes. */
566
+ previewUrl: (port: number, path?: string) => string;
567
+ /** Rewrite a localhost URL the agent printed into a reachable proxy URL. */
568
+ proxyUrl: (url?: string) => string | undefined;
569
+ /** Pick the model `send` will use for subsequent prompts (until changed). */
570
+ setModel: (model: SessionModel | undefined) => void;
571
+ /** Pick the agent `send` will use for subsequent prompts (until changed). */
572
+ setAgent: (agent: string | undefined) => void;
573
+ /**
574
+ * Provision/resume if needed, then send a text prompt to the agent. A
575
+ * per-call `{ model, agent }` overrides the sticky setModel/setAgent
576
+ * choices for this message only.
577
+ */
578
+ send: (text: string, opts?: {
579
+ model?: SessionModel;
580
+ agent?: string;
581
+ }) => Promise<({
582
+ data: {
583
+ info: import("@opencode-ai/sdk/v2/types").AssistantMessage;
584
+ parts: Array<import("@opencode-ai/sdk/v2/types").Part>;
585
+ };
586
+ error: undefined;
587
+ } | {
588
+ data: undefined;
589
+ error: import("@opencode-ai/sdk/v2/types").EffectHttpApiErrorBadRequest | import("@opencode-ai/sdk/v2/types").InvalidRequestError | import("@opencode-ai/sdk/v2/types").NotFoundError;
590
+ }) & {
591
+ request: Request;
592
+ response: Response;
593
+ }>;
594
+ /** Abort the agent's current run in this session. */
595
+ abort: () => Promise<({
596
+ data: boolean;
597
+ error: undefined;
598
+ } | {
599
+ data: undefined;
600
+ error: import("@opencode-ai/sdk/v2/types").EffectHttpApiErrorBadRequest | import("@opencode-ai/sdk/v2/types").InvalidRequestError;
601
+ }) & {
602
+ request: Request;
603
+ response: Response;
604
+ }>;
605
+ /**
606
+ * Live SSE stream of THIS session's runtime events (message/part
607
+ * updates, session status, permissions/questions, lsp diagnostics, …).
608
+ * A thin facade over the framework-free `openEventStream` primitive
609
+ * (`@kortix/sdk`'s `openEventStream`, also used verbatim by
610
+ * `@kortix/sdk/react`'s `useOpenCodeEventStream`): resolves THIS
611
+ * handle's own runtime first (`ensureReady()`), then connects a client
612
+ * bound to that runtime URL — never the module-global "active" one, so
613
+ * two session handles on two different sandboxes never cross wires.
614
+ * Framework-free — safe to call from a server-side "Kortix as a
615
+ * Backend" wrapper (Node/Bun), a worker, a CLI, or any non-React host.
616
+ *
617
+ * Handles connect/reconnect/backoff, a 15s heartbeat watchdog, and
618
+ * event coalescing internally. Call `handle.close()` to stop.
619
+ *
620
+ * const handle = await session.stream({ onEvent: (e) => console.log(e) });
621
+ * // later
622
+ * handle.close();
623
+ */
624
+ stream: (opts: {
625
+ onEvent: (event: OpenCodeEvent) => void;
626
+ onGapRehydrate?: (gapMs: number) => void;
627
+ signal?: AbortSignal;
628
+ }) => Promise<EventStreamHandle>;
629
+ readonly runtime: OpencodeClient;
630
+ /**
631
+ * Workspace file operations (daemon `/file` + `/find`) bound to THIS
632
+ * session's own resolved runtime — never the module-global "active"
633
+ * sandbox the top-level `@kortix/sdk` `files` export follows. Fixes a
634
+ * cross-session bleed: a host juggling multiple open sessions (e.g. a
635
+ * server wrapping several concurrent agent sessions) that called the
636
+ * global `files.list()` while a DIFFERENT session was "active" would
637
+ * silently read/write the wrong sandbox. Each call here auto-provisions
638
+ * via `ensureReady()` (same as `send`/`abort`/`stream`), then runs
639
+ * against this handle's own runtime URL. Same 12-op surface as the
640
+ * global `files` namespace, built from the same parameterized core
641
+ * (`@kortix/sdk/files`'s exports all take an optional trailing
642
+ * `baseUrl` — this just always supplies THIS session's).
643
+ */
644
+ files: {
645
+ list: (dirPath: string) => Promise<F.FileNode[]>;
646
+ read: (filePath: string) => Promise<F.FileContent>;
647
+ readBlob: (filePath: string) => Promise<Blob>;
648
+ status: () => Promise<F.GitFileStatus[]>;
649
+ findFiles: (query: string, options?: {
650
+ type?: "file" | "directory";
651
+ limit?: number;
652
+ }) => Promise<string[]>;
653
+ findText: (pattern: string) => Promise<F.FindMatch[]>;
654
+ upload: (file: File | Blob, targetPath?: string, filename?: string) => Promise<F.UploadResult[]>;
655
+ create: (filePath: string) => Promise<F.UploadResult[]>;
656
+ copy: (sourcePath: string, destPath: string) => Promise<F.UploadResult[]>;
657
+ remove: (filePath: string) => Promise<boolean>;
658
+ mkdir: (dirPath: string) => Promise<boolean>;
659
+ rename: (from: string, to: string) => Promise<boolean>;
660
+ };
661
+ };
662
+ };
663
+ session: (projectId: string, sessionId: string) => {
664
+ get: (opts?: {
665
+ showErrors?: boolean;
666
+ }) => Promise<P.ProjectSession>;
667
+ update: (input: Parameters<typeof P.updateProjectSession>[2]) => Promise<P.ProjectSession>;
668
+ delete: () => Promise<{
669
+ ok: boolean;
670
+ }>;
671
+ start: (waitMs?: number | undefined) => Promise<P.SessionStartResult | null>;
672
+ restart: () => Promise<{
673
+ ok: boolean;
674
+ session_id: string;
675
+ status: string;
676
+ }>;
677
+ stop: () => Promise<{
678
+ ok: boolean;
679
+ session_id: string;
680
+ status: string;
681
+ }>;
682
+ setSharing: (intent: Parameters<typeof P.setProjectSessionSharing>[2]) => Promise<P.ProjectSession>;
683
+ previews: () => Promise<{
684
+ candidates: P.SessionPreviewCandidate[];
685
+ }>;
686
+ commit: (input?: Parameters<typeof P.commitSessionChanges>[2]) => Promise<P.CommitSessionResult>;
687
+ publicShares: {
688
+ list: () => Promise<{
689
+ shares: P.SessionPublicShare[];
690
+ }>;
691
+ create: (input: P.CreateSessionPublicShareInput) => Promise<{
692
+ share: P.SessionPublicShare;
693
+ }>;
694
+ revoke: (shareId: string) => Promise<{
695
+ share: P.SessionPublicShare;
696
+ }>;
697
+ };
698
+ /** Per-session audit trail of executor-gated agent actions. */
699
+ audit: (limit?: number, options?: {
700
+ showErrors?: boolean;
701
+ }) => Promise<P.SessionAudit>;
702
+ /** Compact server-side transcript read (text + tool calls, no tool inputs/outputs) — callable with project-scoped session tokens. */
703
+ transcript: (options?: Parameters<typeof P.getSessionTranscript>[2]) => Promise<P.SessionTranscript>;
704
+ /**
705
+ * Resolve THIS handle's own runtime (idempotent): provisions/resumes the
706
+ * sandbox (long-poll until ready) and caches the resolved OpenCode session
707
+ * id + runtime URL + sandbox id for every other call on this handle. Call
708
+ * this (or `send`/`abort`, which call it internally) before `.runtime`,
709
+ * `.health()`, `.previewUrl()`, or `.proxyUrl()` — those throw
710
+ * `SessionNotReadyError` instead of falling back to whatever sandbox
711
+ * happens to be globally active.
712
+ */
713
+ ensureReady: () => Promise<SessionRuntimeEntry>;
714
+ /**
715
+ * Liveness/readiness of THIS session's runtime (`GET /kortix/health`).
716
+ * Unlike `.previewUrl()`/`.proxyUrl()`/`.runtime`, this never throws
717
+ * `SessionNotReadyError` — a health poller (e.g. a header dot ticking
718
+ * every 15s on a fresh inline handle) needs to be callable BEFORE the
719
+ * session has ever resolved a runtime. It degrades to the same graceful
720
+ * `{ status: 0, ok: false }` shape `getSessionHealth` already returns for
721
+ * "no URL yet", instead of forcing every caller to guard with `ensureReady()`.
722
+ */
723
+ health: (init?: RequestInit) => Promise<import("./index.js").SessionHealthResult>;
724
+ /** Proxy/preview URL for a port THIS session's runtime exposes. */
725
+ previewUrl: (port: number, path?: string) => string;
726
+ /** Rewrite a localhost URL the agent printed into a reachable proxy URL. */
727
+ proxyUrl: (url?: string) => string | undefined;
728
+ /** Pick the model `send` will use for subsequent prompts (until changed). */
729
+ setModel: (model: SessionModel | undefined) => void;
730
+ /** Pick the agent `send` will use for subsequent prompts (until changed). */
731
+ setAgent: (agent: string | undefined) => void;
732
+ /**
733
+ * Provision/resume if needed, then send a text prompt to the agent. A
734
+ * per-call `{ model, agent }` overrides the sticky setModel/setAgent
735
+ * choices for this message only.
736
+ */
737
+ send: (text: string, opts?: {
738
+ model?: SessionModel;
739
+ agent?: string;
740
+ }) => Promise<({
741
+ data: {
742
+ info: import("@opencode-ai/sdk/v2/types").AssistantMessage;
743
+ parts: Array<import("@opencode-ai/sdk/v2/types").Part>;
744
+ };
745
+ error: undefined;
746
+ } | {
747
+ data: undefined;
748
+ error: import("@opencode-ai/sdk/v2/types").EffectHttpApiErrorBadRequest | import("@opencode-ai/sdk/v2/types").InvalidRequestError | import("@opencode-ai/sdk/v2/types").NotFoundError;
749
+ }) & {
750
+ request: Request;
751
+ response: Response;
752
+ }>;
753
+ /** Abort the agent's current run in this session. */
754
+ abort: () => Promise<({
755
+ data: boolean;
756
+ error: undefined;
757
+ } | {
758
+ data: undefined;
759
+ error: import("@opencode-ai/sdk/v2/types").EffectHttpApiErrorBadRequest | import("@opencode-ai/sdk/v2/types").InvalidRequestError;
760
+ }) & {
761
+ request: Request;
762
+ response: Response;
763
+ }>;
764
+ /**
765
+ * Live SSE stream of THIS session's runtime events (message/part
766
+ * updates, session status, permissions/questions, lsp diagnostics, …).
767
+ * A thin facade over the framework-free `openEventStream` primitive
768
+ * (`@kortix/sdk`'s `openEventStream`, also used verbatim by
769
+ * `@kortix/sdk/react`'s `useOpenCodeEventStream`): resolves THIS
770
+ * handle's own runtime first (`ensureReady()`), then connects a client
771
+ * bound to that runtime URL — never the module-global "active" one, so
772
+ * two session handles on two different sandboxes never cross wires.
773
+ * Framework-free — safe to call from a server-side "Kortix as a
774
+ * Backend" wrapper (Node/Bun), a worker, a CLI, or any non-React host.
775
+ *
776
+ * Handles connect/reconnect/backoff, a 15s heartbeat watchdog, and
777
+ * event coalescing internally. Call `handle.close()` to stop.
778
+ *
779
+ * const handle = await session.stream({ onEvent: (e) => console.log(e) });
780
+ * // later
781
+ * handle.close();
782
+ */
783
+ stream: (opts: {
784
+ onEvent: (event: OpenCodeEvent) => void;
785
+ onGapRehydrate?: (gapMs: number) => void;
786
+ signal?: AbortSignal;
787
+ }) => Promise<EventStreamHandle>;
788
+ readonly runtime: OpencodeClient;
789
+ /**
790
+ * Workspace file operations (daemon `/file` + `/find`) bound to THIS
791
+ * session's own resolved runtime — never the module-global "active"
792
+ * sandbox the top-level `@kortix/sdk` `files` export follows. Fixes a
793
+ * cross-session bleed: a host juggling multiple open sessions (e.g. a
794
+ * server wrapping several concurrent agent sessions) that called the
795
+ * global `files.list()` while a DIFFERENT session was "active" would
796
+ * silently read/write the wrong sandbox. Each call here auto-provisions
797
+ * via `ensureReady()` (same as `send`/`abort`/`stream`), then runs
798
+ * against this handle's own runtime URL. Same 12-op surface as the
799
+ * global `files` namespace, built from the same parameterized core
800
+ * (`@kortix/sdk/files`'s exports all take an optional trailing
801
+ * `baseUrl` — this just always supplies THIS session's).
802
+ */
803
+ files: {
804
+ list: (dirPath: string) => Promise<F.FileNode[]>;
805
+ read: (filePath: string) => Promise<F.FileContent>;
806
+ readBlob: (filePath: string) => Promise<Blob>;
807
+ status: () => Promise<F.GitFileStatus[]>;
808
+ findFiles: (query: string, options?: {
809
+ type?: "file" | "directory";
810
+ limit?: number;
811
+ }) => Promise<string[]>;
812
+ findText: (pattern: string) => Promise<F.FindMatch[]>;
813
+ upload: (file: File | Blob, targetPath?: string, filename?: string) => Promise<F.UploadResult[]>;
814
+ create: (filePath: string) => Promise<F.UploadResult[]>;
815
+ copy: (sourcePath: string, destPath: string) => Promise<F.UploadResult[]>;
816
+ remove: (filePath: string) => Promise<boolean>;
817
+ mkdir: (dirPath: string) => Promise<boolean>;
818
+ rename: (from: string, to: string) => Promise<boolean>;
819
+ };
820
+ };
821
+ /** GitHub App installation + repository linking (account-scoped). */
822
+ github: {
823
+ linkRepository: typeof P.linkRepository;
824
+ getInstallation: typeof P.getGitHubInstallation;
825
+ listInstallations: typeof P.listGitHubInstallations;
826
+ listRepositories: typeof P.listGitHubRepositories;
827
+ saveInstallation: typeof P.saveGitHubInstallation;
828
+ deleteInstallation: typeof P.deleteGitHubInstallation;
829
+ };
830
+ /** Billing read surface — credits/subscription/tier/transactions (not project-scoped). */
831
+ billing: {
832
+ accountState: typeof P.getAccountState;
833
+ accountStateMinimal: typeof P.getAccountStateMinimal;
834
+ transactions: typeof P.listBillingTransactions;
835
+ transactionsSummary: typeof P.getBillingTransactionsSummary;
836
+ creditBreakdown: typeof P.getBillingCreditBreakdown;
837
+ usageHistory: typeof P.getBillingUsageHistory;
838
+ tierConfigurations: typeof P.getBillingTierConfigurations;
839
+ /** Stripe checkout — start a subscription and confirm it post-redirect. */
840
+ checkout: {
841
+ createSession: (input: Parameters<typeof P.createCheckoutSession>[0]) => Promise<P.CheckoutSessionResult>;
842
+ confirmSession: (sessionId: string, accountId?: string) => Promise<P.ConfirmCheckoutSessionResult>;
843
+ };
844
+ /** Manage an existing subscription (portal, cancel/reactivate, downgrade). */
845
+ subscription: {
846
+ createPortalSession: (returnUrl: string, accountId?: string) => Promise<P.PortalSessionResult>;
847
+ cancel: (feedback?: string, accountId?: string) => Promise<P.SubscriptionMutationResult>;
848
+ reactivate: (accountId?: string) => Promise<P.SubscriptionMutationResult>;
849
+ scheduleDowngrade: (targetTierKey: string, commitmentType?: string, accountId?: string) => Promise<P.SubscriptionMutationResult>;
850
+ cancelScheduledChange: (accountId?: string) => Promise<P.SubscriptionMutationResult>;
851
+ prorationPreview: (newPriceId: string, accountId?: string) => Promise<P.ProrationPreviewResult>;
852
+ };
853
+ /** One-off credit purchases + recurring auto-topup configuration. */
854
+ credits: {
855
+ purchase: (input: Parameters<typeof P.purchaseCredits>[0]) => Promise<P.PurchaseCreditsResult>;
856
+ autoTopupSettings: (accountId?: string) => Promise<P.AutoTopupSettings>;
857
+ configureAutoTopup: (input: Parameters<typeof P.configureAutoTopup>[0]) => Promise<P.AutoTopupSettings>;
858
+ };
859
+ };
860
+ /** Public share links for a sandbox port (`/v1/p/share`, sandbox-scoped). */
861
+ sandboxShares: {
862
+ list: typeof P.listSandboxShares;
863
+ create: typeof P.createSandboxShare;
864
+ revoke: typeof P.revokeSandboxShare;
865
+ };
866
+ /** Speech-to-text transcription (`/transcription` — not project-scoped). */
867
+ transcribe: typeof P.transcribeAudio;
868
+ /** Deployment-wide Pipedream/easy-connect availability flag (not project-scoped). */
869
+ connectStatus: typeof P.getConnectStatus;
870
+ /** Public marketplace catalog browse + sources (`/v1/marketplace/*`, not project-scoped). */
871
+ marketplace: {
872
+ items: (options?: Parameters<typeof P.listMarketplaceCatalogItems>[0]) => Promise<P.MarketplaceItemsResponse>;
873
+ item: (id: string) => Promise<Record<string, unknown>>;
874
+ itemFile: (id: string, path: string) => Promise<P.MarketplaceItemFile>;
875
+ marketplaces: () => Promise<P.MarketplacesResponse>;
876
+ featured: () => Promise<P.FeaturedMarketplacesResponse>;
877
+ sources: {
878
+ list: () => Promise<P.MarketplaceSourcesResponse>;
879
+ add: (input: Parameters<typeof P.addMarketplaceSource>[0]) => Promise<P.AddMarketplaceSourceResponse>;
880
+ remove: (id: string) => Promise<{
881
+ ok: boolean;
882
+ }>;
883
+ };
884
+ };
885
+ /** The pasted-API-key UX check — `GET /accounts/me`, never throws. */
886
+ validateToken: typeof P.validateToken;
887
+ /** Escape hatch: the typed opencode client for the active sandbox. */
888
+ runtime: typeof runtime;
889
+ };
890
+ export type Kortix = ReturnType<typeof createKortix>;
891
+ /** The id-bound project handle returned by `kortix.project(id)`. */
892
+ export type ProjectHandle = ReturnType<Kortix['project']>;
893
+ /** The id-bound session handle returned by `kortix.session(pid, sid)`. */
894
+ export type SessionHandle = ReturnType<Kortix['session']>;
895
+ type DropFirst<T extends unknown[]> = T extends [unknown, ...infer R] ? R : [];
896
+ export {};
897
+ //# sourceMappingURL=kortix.d.ts.map