@kortix/sdk 0.13.47 → 0.13.48

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 (349) hide show
  1. package/README.md +49 -31
  2. package/dist/browser/session-sync/visibility.d.ts +0 -12
  3. package/dist/browser/session-sync/visibility.d.ts.map +1 -1
  4. package/dist/browser/session-sync/visibility.js +23 -2
  5. package/dist/browser/session-sync/visibility.js.map +1 -1
  6. package/dist/browser/stores/sandbox-connection-store.d.ts +8 -0
  7. package/dist/browser/stores/sandbox-connection-store.d.ts.map +1 -1
  8. package/dist/browser/stores/sandbox-connection-store.js +14 -0
  9. package/dist/browser/stores/sandbox-connection-store.js.map +1 -1
  10. package/dist/browser/stores/sync-store.d.ts.map +1 -1
  11. package/dist/browser/stores/sync-store.js +79 -60
  12. package/dist/browser/stores/sync-store.js.map +1 -1
  13. package/dist/core/agents/composer-agents.d.ts +7 -5
  14. package/dist/core/agents/composer-agents.d.ts.map +1 -1
  15. package/dist/core/agents/composer-agents.js +3 -3
  16. package/dist/core/agents/composer-agents.js.map +1 -1
  17. package/dist/core/client/binding-types.d.ts +2 -0
  18. package/dist/core/client/binding-types.d.ts.map +1 -0
  19. package/dist/core/client/binding-types.js +2 -0
  20. package/dist/core/client/binding-types.js.map +1 -0
  21. package/dist/core/client/facade-accounts.d.ts +57 -0
  22. package/dist/core/client/facade-accounts.d.ts.map +1 -0
  23. package/dist/core/client/facade-accounts.js +59 -0
  24. package/dist/core/client/facade-accounts.js.map +1 -0
  25. package/dist/core/client/facade-catalog.d.ts +58 -0
  26. package/dist/core/client/facade-catalog.d.ts.map +1 -0
  27. package/dist/core/client/facade-catalog.js +70 -0
  28. package/dist/core/client/facade-catalog.js.map +1 -0
  29. package/dist/core/client/facade-commerce.d.ts +45 -0
  30. package/dist/core/client/facade-commerce.d.ts.map +1 -0
  31. package/dist/core/client/facade-commerce.js +53 -0
  32. package/dist/core/client/facade-commerce.js.map +1 -0
  33. package/dist/core/client/facade-iam.d.ts +54 -0
  34. package/dist/core/client/facade-iam.d.ts.map +1 -0
  35. package/dist/core/client/facade-iam.js +62 -0
  36. package/dist/core/client/facade-iam.js.map +1 -0
  37. package/dist/core/client/facade-identity.d.ts +104 -0
  38. package/dist/core/client/facade-identity.d.ts.map +1 -0
  39. package/dist/core/client/facade-identity.js +36 -0
  40. package/dist/core/client/facade-identity.js.map +1 -0
  41. package/dist/core/client/facade-preview.d.ts +4 -0
  42. package/dist/core/client/facade-preview.d.ts.map +1 -0
  43. package/dist/core/client/facade-preview.js +61 -0
  44. package/dist/core/client/facade-preview.js.map +1 -0
  45. package/dist/core/client/kortix.d.ts +657 -1038
  46. package/dist/core/client/kortix.d.ts.map +1 -1
  47. package/dist/core/client/kortix.js +29 -1205
  48. package/dist/core/client/kortix.js.map +1 -1
  49. package/dist/core/client/project-access-resources.d.ts +38 -0
  50. package/dist/core/client/project-access-resources.d.ts.map +1 -0
  51. package/dist/core/client/project-access-resources.js +37 -0
  52. package/dist/core/client/project-access-resources.js.map +1 -0
  53. package/dist/core/client/project-access-security.d.ts +117 -0
  54. package/dist/core/client/project-access-security.d.ts.map +1 -0
  55. package/dist/core/client/project-access-security.js +41 -0
  56. package/dist/core/client/project-access-security.js.map +1 -0
  57. package/dist/core/client/project-connections.d.ts +34 -0
  58. package/dist/core/client/project-connections.d.ts.map +1 -0
  59. package/dist/core/client/project-connections.js +20 -0
  60. package/dist/core/client/project-connections.js.map +1 -0
  61. package/dist/core/client/project-connectors.d.ts +21 -0
  62. package/dist/core/client/project-connectors.d.ts.map +1 -0
  63. package/dist/core/client/project-connectors.js +20 -0
  64. package/dist/core/client/project-connectors.js.map +1 -0
  65. package/dist/core/client/project-core.d.ts +72 -0
  66. package/dist/core/client/project-core.d.ts.map +1 -0
  67. package/dist/core/client/project-core.js +24 -0
  68. package/dist/core/client/project-core.js.map +1 -0
  69. package/dist/core/client/project-membership.d.ts +64 -0
  70. package/dist/core/client/project-membership.d.ts.map +1 -0
  71. package/dist/core/client/project-membership.js +26 -0
  72. package/dist/core/client/project-membership.js.map +1 -0
  73. package/dist/core/client/project-operations-admin.d.ts +112 -0
  74. package/dist/core/client/project-operations-admin.d.ts.map +1 -0
  75. package/dist/core/client/project-operations-admin.js +24 -0
  76. package/dist/core/client/project-operations-admin.js.map +1 -0
  77. package/dist/core/client/project-operations-review.d.ts +44 -0
  78. package/dist/core/client/project-operations-review.d.ts.map +1 -0
  79. package/dist/core/client/project-operations-review.js +34 -0
  80. package/dist/core/client/project-operations-review.js.map +1 -0
  81. package/dist/core/client/project-operations-workspace.d.ts +91 -0
  82. package/dist/core/client/project-operations-workspace.d.ts.map +1 -0
  83. package/dist/core/client/project-operations-workspace.js +36 -0
  84. package/dist/core/client/project-operations-workspace.js.map +1 -0
  85. package/dist/core/client/project-operations.d.ts +225 -0
  86. package/dist/core/client/project-operations.d.ts.map +1 -0
  87. package/dist/core/client/project-operations.js +47 -0
  88. package/dist/core/client/project-operations.js.map +1 -0
  89. package/dist/core/client/project-platform-resources.d.ts +36 -0
  90. package/dist/core/client/project-platform-resources.d.ts.map +1 -0
  91. package/dist/core/client/project-platform-resources.js +29 -0
  92. package/dist/core/client/project-platform-resources.js.map +1 -0
  93. package/dist/core/client/project-platform-security.d.ts +83 -0
  94. package/dist/core/client/project-platform-security.d.ts.map +1 -0
  95. package/dist/core/client/project-platform-security.js +39 -0
  96. package/dist/core/client/project-platform-security.js.map +1 -0
  97. package/dist/core/client/project-platform-settings.d.ts +58 -0
  98. package/dist/core/client/project-platform-settings.d.ts.map +1 -0
  99. package/dist/core/client/project-platform-settings.js +28 -0
  100. package/dist/core/client/project-platform-settings.js.map +1 -0
  101. package/dist/core/client/session-actions-resources.d.ts +18 -0
  102. package/dist/core/client/session-actions-resources.d.ts.map +1 -0
  103. package/dist/core/client/session-actions-resources.js +31 -0
  104. package/dist/core/client/session-actions-resources.js.map +1 -0
  105. package/dist/core/client/session-actions-security.d.ts +31 -0
  106. package/dist/core/client/session-actions-security.d.ts.map +1 -0
  107. package/dist/core/client/session-actions-security.js +51 -0
  108. package/dist/core/client/session-actions-security.js.map +1 -0
  109. package/dist/core/client/session-actions-services.d.ts +64 -0
  110. package/dist/core/client/session-actions-services.d.ts.map +1 -0
  111. package/dist/core/client/session-actions-services.js +59 -0
  112. package/dist/core/client/session-actions-services.js.map +1 -0
  113. package/dist/core/client/session-context.d.ts +22 -0
  114. package/dist/core/client/session-context.d.ts.map +1 -0
  115. package/dist/core/client/session-context.js +2 -0
  116. package/dist/core/client/session-context.js.map +1 -0
  117. package/dist/core/client/session-defaults.d.ts +9 -0
  118. package/dist/core/client/session-defaults.d.ts.map +1 -0
  119. package/dist/core/client/session-defaults.js +45 -0
  120. package/dist/core/client/session-defaults.js.map +1 -0
  121. package/dist/core/client/session-files.d.ts +26 -0
  122. package/dist/core/client/session-files.d.ts.map +1 -0
  123. package/dist/core/client/session-files.js +24 -0
  124. package/dist/core/client/session-files.js.map +1 -0
  125. package/dist/core/client/session-handle.d.ts +186 -0
  126. package/dist/core/client/session-handle.d.ts.map +1 -0
  127. package/dist/core/client/session-handle.js +68 -0
  128. package/dist/core/client/session-handle.js.map +1 -0
  129. package/dist/core/client/session-lifecycle-resources.d.ts +67 -0
  130. package/dist/core/client/session-lifecycle-resources.d.ts.map +1 -0
  131. package/dist/core/client/session-lifecycle-resources.js +56 -0
  132. package/dist/core/client/session-lifecycle-resources.js.map +1 -0
  133. package/dist/core/client/session-lifecycle-security.d.ts +65 -0
  134. package/dist/core/client/session-lifecycle-security.d.ts.map +1 -0
  135. package/dist/core/client/session-lifecycle-security.js +54 -0
  136. package/dist/core/client/session-lifecycle-security.js.map +1 -0
  137. package/dist/core/client/session-preview.d.ts +26 -0
  138. package/dist/core/client/session-preview.d.ts.map +1 -0
  139. package/dist/core/client/session-preview.js +31 -0
  140. package/dist/core/client/session-preview.js.map +1 -0
  141. package/dist/core/client/session-readiness.d.ts +11 -0
  142. package/dist/core/client/session-readiness.d.ts.map +1 -0
  143. package/dist/core/client/session-readiness.js +77 -0
  144. package/dist/core/client/session-readiness.js.map +1 -0
  145. package/dist/core/client/session-runtime.d.ts +35 -0
  146. package/dist/core/client/session-runtime.d.ts.map +1 -0
  147. package/dist/core/client/session-runtime.js +30 -0
  148. package/dist/core/client/session-runtime.js.map +1 -0
  149. package/dist/core/client/session-shared.d.ts +46 -0
  150. package/dist/core/client/session-shared.d.ts.map +1 -0
  151. package/dist/core/client/session-shared.js +48 -0
  152. package/dist/core/client/session-shared.js.map +1 -0
  153. package/dist/core/client/session-start.d.ts +3 -0
  154. package/dist/core/client/session-start.d.ts.map +1 -0
  155. package/dist/core/client/session-start.js +60 -0
  156. package/dist/core/client/session-start.js.map +1 -0
  157. package/dist/core/files/client.d.ts.map +1 -1
  158. package/dist/core/files/client.js +29 -3
  159. package/dist/core/files/client.js.map +1 -1
  160. package/dist/core/http/api-client.d.ts.map +1 -1
  161. package/dist/core/http/api-client.js +2 -419
  162. package/dist/core/http/api-client.js.map +1 -1
  163. package/dist/core/http/config.d.ts +15 -0
  164. package/dist/core/http/config.d.ts.map +1 -1
  165. package/dist/core/http/config.js.map +1 -1
  166. package/dist/core/http/request.d.ts +3 -0
  167. package/dist/core/http/request.d.ts.map +1 -0
  168. package/dist/core/http/request.js +215 -0
  169. package/dist/core/http/request.js.map +1 -0
  170. package/dist/core/http/response-error.d.ts +3 -0
  171. package/dist/core/http/response-error.d.ts.map +1 -0
  172. package/dist/core/http/response-error.js +113 -0
  173. package/dist/core/http/response-error.js.map +1 -0
  174. package/dist/core/http/runtime-errors.d.ts +23 -0
  175. package/dist/core/http/runtime-errors.d.ts.map +1 -1
  176. package/dist/core/http/runtime-errors.js +39 -1
  177. package/dist/core/http/runtime-errors.js.map +1 -1
  178. package/dist/core/http/transport.d.ts +13 -1
  179. package/dist/core/http/transport.d.ts.map +1 -1
  180. package/dist/core/http/transport.js +25 -4
  181. package/dist/core/http/transport.js.map +1 -1
  182. package/dist/core/rest/projects-client/admin-providers.d.ts +64 -3
  183. package/dist/core/rest/projects-client/admin-providers.d.ts.map +1 -1
  184. package/dist/core/rest/projects-client/admin-providers.js.map +1 -1
  185. package/dist/core/rest/projects-client/apps.d.ts +30 -0
  186. package/dist/core/rest/projects-client/apps.d.ts.map +1 -1
  187. package/dist/core/rest/projects-client/apps.js +10 -0
  188. package/dist/core/rest/projects-client/apps.js.map +1 -1
  189. package/dist/core/rest/projects-client/audit.d.ts +4 -0
  190. package/dist/core/rest/projects-client/audit.d.ts.map +1 -1
  191. package/dist/core/rest/projects-client/audit.js.map +1 -1
  192. package/dist/core/rest/projects-client/channels.d.ts +19 -0
  193. package/dist/core/rest/projects-client/channels.d.ts.map +1 -1
  194. package/dist/core/rest/projects-client/channels.js.map +1 -1
  195. package/dist/core/rest/projects-client/projects.d.ts +3 -1
  196. package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
  197. package/dist/core/rest/projects-client/projects.js +0 -1
  198. package/dist/core/rest/projects-client/projects.js.map +1 -1
  199. package/dist/core/rest/projects-client/secrets.d.ts +44 -0
  200. package/dist/core/rest/projects-client/secrets.d.ts.map +1 -1
  201. package/dist/core/rest/projects-client/secrets.js +52 -0
  202. package/dist/core/rest/projects-client/secrets.js.map +1 -1
  203. package/dist/core/rest/projects-client/session-sandbox.d.ts +6 -0
  204. package/dist/core/rest/projects-client/session-sandbox.d.ts.map +1 -1
  205. package/dist/core/rest/projects-client/session-sandbox.js.map +1 -1
  206. package/dist/core/rest/projects-client/sessions.d.ts +45 -23
  207. package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
  208. package/dist/core/rest/projects-client/sessions.js +33 -4
  209. package/dist/core/rest/projects-client/sessions.js.map +1 -1
  210. package/dist/core/runtime/client.d.ts +1 -1
  211. package/dist/core/runtime/client.d.ts.map +1 -1
  212. package/dist/core/runtime/client.js +29 -3
  213. package/dist/core/runtime/client.js.map +1 -1
  214. package/dist/core/runtime/runtime-rest-client.d.ts +26 -0
  215. package/dist/core/runtime/runtime-rest-client.d.ts.map +1 -1
  216. package/dist/core/runtime/runtime-rest-client.js +67 -49
  217. package/dist/core/runtime/runtime-rest-client.js.map +1 -1
  218. package/dist/core/session/host-signals.d.ts +16 -0
  219. package/dist/core/session/host-signals.d.ts.map +1 -0
  220. package/dist/core/session/host-signals.js +20 -0
  221. package/dist/core/session/host-signals.js.map +1 -0
  222. package/dist/core/session/index.d.ts +1 -0
  223. package/dist/core/session/index.d.ts.map +1 -1
  224. package/dist/core/session/index.js +1 -0
  225. package/dist/core/session/index.js.map +1 -1
  226. package/dist/core/session/open-bundle.d.ts +16 -0
  227. package/dist/core/session/open-bundle.d.ts.map +1 -1
  228. package/dist/core/session/open-bundle.js +31 -0
  229. package/dist/core/session/open-bundle.js.map +1 -1
  230. package/dist/core/session/wake-escalation.d.ts +1 -1
  231. package/dist/core/session/wake-escalation.js +1 -1
  232. package/dist/core/session/working-evidence.d.ts +15 -0
  233. package/dist/core/session/working-evidence.d.ts.map +1 -0
  234. package/dist/core/session/working-evidence.js +27 -0
  235. package/dist/core/session/working-evidence.js.map +1 -0
  236. package/dist/core/session/working-project.d.ts +3 -0
  237. package/dist/core/session/working-project.d.ts.map +1 -0
  238. package/dist/core/session/working-project.js +187 -0
  239. package/dist/core/session/working-project.js.map +1 -0
  240. package/dist/core/session/working-runtime.d.ts +33 -0
  241. package/dist/core/session/working-runtime.d.ts.map +1 -0
  242. package/dist/core/session/working-runtime.js +46 -0
  243. package/dist/core/session/working-runtime.js.map +1 -0
  244. package/dist/core/session/working-time.d.ts +2 -0
  245. package/dist/core/session/working-time.d.ts.map +1 -0
  246. package/dist/core/session/working-time.js +7 -0
  247. package/dist/core/session/working-time.js.map +1 -0
  248. package/dist/core/session/working.d.ts.map +1 -1
  249. package/dist/core/session/working.js +2 -316
  250. package/dist/core/session/working.js.map +1 -1
  251. package/dist/core/stream/event-stream.d.ts +15 -1
  252. package/dist/core/stream/event-stream.d.ts.map +1 -1
  253. package/dist/core/stream/event-stream.js +59 -9
  254. package/dist/core/stream/event-stream.js.map +1 -1
  255. package/dist/core/turns/parts.d.ts +4 -0
  256. package/dist/core/turns/parts.d.ts.map +1 -1
  257. package/dist/core/turns/parts.js +4 -0
  258. package/dist/core/turns/parts.js.map +1 -1
  259. package/dist/core/turns/segments/turn-busy-visibility.d.ts +1 -1
  260. package/dist/core/turns/segments/turn-busy-visibility.js +1 -1
  261. package/dist/core/turns/segments/working-turn.js +1 -1
  262. package/dist/core/turns/segments/working-turn.js.map +1 -1
  263. package/dist/index.d.ts +1 -1
  264. package/dist/index.d.ts.map +1 -1
  265. package/dist/index.js.map +1 -1
  266. package/dist/kortix.esm.min.js +44 -44
  267. package/dist/kortix.global.js +44 -44
  268. package/dist/react/index.d.ts +3 -1
  269. package/dist/react/index.d.ts.map +1 -1
  270. package/dist/react/index.js +2 -0
  271. package/dist/react/index.js.map +1 -1
  272. package/dist/react/prefetch-session-open.d.ts +13 -0
  273. package/dist/react/prefetch-session-open.d.ts.map +1 -1
  274. package/dist/react/prefetch-session-open.js +22 -1
  275. package/dist/react/prefetch-session-open.js.map +1 -1
  276. package/dist/react/query-keys.d.ts +3 -2
  277. package/dist/react/query-keys.d.ts.map +1 -1
  278. package/dist/react/query-keys.js +4 -4
  279. package/dist/react/query-keys.js.map +1 -1
  280. package/dist/react/use-admin-providers.d.ts +18 -0
  281. package/dist/react/use-admin-providers.d.ts.map +1 -0
  282. package/dist/react/use-admin-providers.js +36 -0
  283. package/dist/react/use-admin-providers.js.map +1 -0
  284. package/dist/react/use-opencode-events/index.d.ts +1 -0
  285. package/dist/react/use-opencode-events/index.d.ts.map +1 -1
  286. package/dist/react/use-opencode-events/index.js +15 -0
  287. package/dist/react/use-opencode-events/index.js.map +1 -1
  288. package/dist/react/use-opencode-events/runtime-stream-signals.d.ts +45 -0
  289. package/dist/react/use-opencode-events/runtime-stream-signals.d.ts.map +1 -0
  290. package/dist/react/use-opencode-events/runtime-stream-signals.js +32 -0
  291. package/dist/react/use-opencode-events/runtime-stream-signals.js.map +1 -0
  292. package/dist/react/use-opencode-events/stream-revival.d.ts +0 -21
  293. package/dist/react/use-opencode-events/stream-revival.d.ts.map +1 -1
  294. package/dist/react/use-opencode-events/stream-revival.js +33 -2
  295. package/dist/react/use-opencode-events/stream-revival.js.map +1 -1
  296. package/dist/react/use-opencode-sessions/files.d.ts.map +1 -1
  297. package/dist/react/use-opencode-sessions/files.js +8 -33
  298. package/dist/react/use-opencode-sessions/files.js.map +1 -1
  299. package/dist/react/use-opencode-sessions/keys.d.ts +11 -0
  300. package/dist/react/use-opencode-sessions/keys.d.ts.map +1 -1
  301. package/dist/react/use-opencode-sessions/keys.js +10 -0
  302. package/dist/react/use-opencode-sessions/keys.js.map +1 -1
  303. package/dist/react/use-opencode-sessions/providers.d.ts.map +1 -1
  304. package/dist/react/use-opencode-sessions/providers.js +12 -2
  305. package/dist/react/use-opencode-sessions/providers.js.map +1 -1
  306. package/dist/react/use-opencode-sessions/sessions.d.ts +5 -0
  307. package/dist/react/use-opencode-sessions/sessions.d.ts.map +1 -1
  308. package/dist/react/use-opencode-sessions/sessions.js +9 -2
  309. package/dist/react/use-opencode-sessions/sessions.js.map +1 -1
  310. package/dist/react/use-opencode-sessions/shared.d.ts.map +1 -1
  311. package/dist/react/use-opencode-sessions/shared.js +6 -1
  312. package/dist/react/use-opencode-sessions/shared.js.map +1 -1
  313. package/dist/react/use-project-apps.d.ts +6 -0
  314. package/dist/react/use-project-apps.d.ts.map +1 -1
  315. package/dist/react/use-project-sessions.d.ts +1 -1
  316. package/dist/react/use-project-sessions.d.ts.map +1 -1
  317. package/dist/react/use-project-sessions.js +2 -3
  318. package/dist/react/use-project-sessions.js.map +1 -1
  319. package/dist/react/use-session-messages.d.ts +4 -2
  320. package/dist/react/use-session-messages.d.ts.map +1 -1
  321. package/dist/react/use-session-messages.js +1 -1
  322. package/dist/react/use-session-messages.js.map +1 -1
  323. package/dist/react/use-session-participants.d.ts +10 -0
  324. package/dist/react/use-session-participants.d.ts.map +1 -0
  325. package/dist/react/use-session-participants.js +19 -0
  326. package/dist/react/use-session-participants.js.map +1 -0
  327. package/dist/react/use-session-prompts.d.ts +6 -0
  328. package/dist/react/use-session-prompts.d.ts.map +1 -1
  329. package/dist/react/use-session-prompts.js +17 -1
  330. package/dist/react/use-session-prompts.js.map +1 -1
  331. package/dist/react/use-session-sync.d.ts.map +1 -1
  332. package/dist/react/use-session-sync.js +4 -1
  333. package/dist/react/use-session-sync.js.map +1 -1
  334. package/dist/react/use-session-transcript-history.d.ts.map +1 -1
  335. package/dist/react/use-session-transcript-history.js +14 -5
  336. package/dist/react/use-session-transcript-history.js.map +1 -1
  337. package/dist/react/use-session.d.ts +3 -1
  338. package/dist/react/use-session.d.ts.map +1 -1
  339. package/dist/react/use-session.js +8 -6
  340. package/dist/react/use-session.js.map +1 -1
  341. package/dist/react/use-tunnel.d.ts +9 -0
  342. package/dist/react/use-tunnel.d.ts.map +1 -1
  343. package/dist/react/use-tunnel.js +9 -3
  344. package/dist/react/use-tunnel.js.map +1 -1
  345. package/dist/workspace-search/core.d.ts +2 -2
  346. package/dist/workspace-search/core.d.ts.map +1 -1
  347. package/dist/workspace-search/core.js +35 -2
  348. package/dist/workspace-search/core.js.map +1 -1
  349. package/package.json +2 -2
@@ -1,48 +1,16 @@
1
+ export { SessionNotReadyError } from './session-shared.js';
2
+ export type { SessionModel } from './session-shared.js';
1
3
  import type { RuntimeClient } from '../runtime/client.js';
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
- * await s.send('what files are here?'); // through the prompt inbox
14
- * const { messages } = await s.messages(); // { info, parts }, kortix.transcript.v1
15
- *
16
- * REST methods are direct references to the platform client, so they keep their
17
- * exact types with zero re-typing. The `project()`/`session()` handles bind ids
18
- * for ergonomics. Reactive data still comes from `@kortix/sdk/react` hooks.
19
- */
20
- import * as F from '../files/client.js';
21
- import { createPromptAttachmentController } from '../attachments/prompt-attachments.js';
22
4
  import { type KortixPlatformConfig } from '../http/config.js';
23
5
  import * as P from '../rest/projects-client/index.js';
24
- import * as A from '../rest/platform-client/auth.js';
25
- import { type PendingInteractions, type TranscriptPage } from '../session/runtime-verbs.js';
26
- import type { RuntimePermissionReply, RuntimeQuestionAnswer } from '../runtime/transcript-types.js';
27
- import { type SessionRuntimeEntry } from '../session/session-runtime-registry.js';
28
- import { type EventStreamHandle, type RuntimeEvent } from '../stream/event-stream.js';
29
- /** A model the agent can run, as the opencode runtime identifies it. */
30
- export type SessionModel = {
31
- providerID: string;
32
- modelID: string;
33
- };
34
- /** The opencode runtime client for the currently-active sandbox (set by the host). */
35
6
  declare function runtime(): RuntimeClient;
36
- export declare class SessionNotReadyError extends Error {
37
- constructor(action: string);
38
- }
39
7
  export declare function createKortix(config: KortixPlatformConfig, opts?: {
40
8
  global?: boolean;
41
9
  }): {
42
10
  /** The platform config in effect (for diagnostics). */
43
11
  config: KortixPlatformConfig;
44
12
  /** Headless regular auth — see `auth` above. */
45
- auth: A.HeadlessAuthApi;
13
+ auth: import("../../index.js").HeadlessAuthApi;
46
14
  accounts: {
47
15
  list: typeof P.listAccounts;
48
16
  get: typeof P.getAccount;
@@ -57,7 +25,6 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
57
25
  setAccess: typeof P.setAccountSecretResourceAccess;
58
26
  };
59
27
  updateName: typeof P.updateAccountName;
60
- /** Organization branding (Enterprise): own logo / icon / favicon (light + dark) and product name. */
61
28
  branding: {
62
29
  get: typeof P.getAccountBranding;
63
30
  update: typeof P.updateAccountBranding;
@@ -71,22 +38,17 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
71
38
  removeMember: typeof P.removeAccountMember;
72
39
  updateMemberRole: typeof P.updateAccountMemberRole;
73
40
  invites: typeof P.listAccountInvites;
74
- /** Cancel a pending account invite (accountId still known/scoped). */
75
41
  cancelInvite: typeof P.cancelAccountInvite;
76
- /** Resend a pending account invite (accountId still known/scoped). */
77
42
  resendInvite: typeof P.resendAccountInvite;
78
- /** CLI PAT minting — account-scoped personal access tokens (`kortix_pat_...`). */
79
43
  tokens: {
80
44
  list: typeof P.listAccountTokens;
81
45
  create: typeof P.createAccountToken;
82
46
  revoke: typeof P.revokeAccountToken;
83
47
  };
84
- /** Connected apps — the OAuth / MCP clients this person approved, across all accounts. */
85
48
  connectedApps: {
86
49
  list: typeof P.listOAuthGrants;
87
50
  revoke: typeof P.revokeOAuthGrant;
88
51
  };
89
- /** Enterprise audit log — events + CSV/JSONL export + SIEM webhooks. */
90
52
  audit: {
91
53
  log: typeof P.listAccountAudit;
92
54
  export: typeof P.exportAccountAudit;
@@ -100,16 +62,13 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
100
62
  };
101
63
  /** Identity and access — assignments, roles, permissions, groups, probes. */
102
64
  iam: {
103
- /** The grant table. One row per (principal, role, scope, object). */
104
65
  assignments: {
105
66
  list: typeof P.listAssignments;
106
67
  create: typeof P.createAssignment;
107
68
  revoke: typeof P.revokeAssignment;
108
69
  };
109
- /** The permission catalog as data — action, scope, delegability, implications. */
110
70
  permissions: {
111
71
  list: typeof P.listPermissions;
112
- /** The leaves one role carries. */
113
72
  forRole: typeof P.getRolePermissions;
114
73
  };
115
74
  roles: {
@@ -132,11 +91,7 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
132
91
  remove: typeof P.removeGroupMember;
133
92
  };
134
93
  };
135
- /** Auto-provisioned agent identities — the principal picker for binding a
136
- * role to an agent. */
137
94
  agentIdentities: typeof P.listAgentIdentities;
138
- /** "Sign in with Kortix" app registry — pair a client with `createKortixAuth`
139
- * from `@kortix/sdk/server`. The secret is returned once, on create/rotate. */
140
95
  oauthClients: {
141
96
  list: typeof P.listOAuthClients;
142
97
  get: typeof P.getOAuthClient;
@@ -145,15 +100,11 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
145
100
  rotateSecret: typeof P.rotateOAuthClientSecret;
146
101
  remove: typeof P.deleteOAuthClient;
147
102
  };
148
- /** Ask the engine. This is the ONLY authorization read a client should make:
149
- * probe the LEAF a route asserts, never a role label. */
150
103
  can: typeof P.probeEffectivePermission;
151
- /** Batch probe — one roundtrip for N leaves. */
152
104
  canBatch: typeof P.probeEffectivePermissions;
153
105
  };
154
106
  /** Account-invite lifecycle reached by invite token alone (accept/decline/describe). */
155
107
  accountInvites: {
156
- /** The caller's own pending invites, matched by email. */
157
108
  listMine: typeof P.listMyAccountInvites;
158
109
  describe: typeof P.describeAccountInvite;
159
110
  accept: typeof P.acceptAccountInvite;
@@ -165,7 +116,6 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
165
116
  get: typeof P.getProject;
166
117
  detail: typeof P.getProjectDetail;
167
118
  create: typeof P.createProject;
168
- /** Create a project backed by a brand-new Kortix-managed GitHub repo. */
169
119
  createRepo: typeof P.createProjectRepo;
170
120
  provision: typeof P.provisionProject;
171
121
  update: typeof P.updateProject;
@@ -181,234 +131,407 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
181
131
  };
182
132
  /** Connector calls scoped by an agent/session token when no project id is available. */
183
133
  connectors: {
184
- /** Callable catalog for this project or token scope. */
185
134
  catalog: (options?: Parameters<typeof P.getConnectorCatalog>[1]) => Promise<P.ConnectorCatalogEntry[]>;
186
- /** Flattened `<connector>.<action>` tool list. */
187
135
  tools: () => Promise<P.ConnectorTool[]>;
188
- /** Search callable tools by id and description. */
189
136
  search: (query?: string | undefined, options?: {
190
137
  limit?: number;
191
138
  } | undefined) => Promise<P.ConnectorTool[]>;
192
- /** Describe one `<connector>.<action>` tool. */
193
139
  describe: (tool: string) => Promise<P.ConnectorTool | null>;
194
- /** Call one `<connector>.<action>` tool. */
195
140
  call: <T = unknown>(tool: string, args?: Record<string, unknown> | undefined, options?: P.ConnectorCallOptions | undefined) => Promise<P.ConnectorCallResult<T>>;
196
- /** The accounts a connector can be called as, default first. */
197
141
  accounts: (slug: string) => Promise<P.ConnectorAccount[]>;
198
- /** Upload bytes for use by a later connector call. */
199
142
  uploadAttachment: (content: Blob | ArrayBuffer | Uint8Array<ArrayBufferLike>, input: P.ConnectorAttachmentUploadInput) => Promise<P.ConnectorAttachmentUploadResult>;
200
143
  };
201
144
  project: (projectId: string) => {
202
- attachments: {
203
- upload: (file: File, options?: P.PromptAttachmentUploadOptions | undefined) => Promise<P.PromptAttachment>;
204
- delete: (attachmentId: string, options?: {
145
+ session: (sessionId: string) => {
146
+ runtime: RuntimeClient;
147
+ messages: (options?: {
148
+ conversationId?: string;
149
+ limit?: number;
150
+ before?: string;
205
151
  signal?: AbortSignal;
206
- } | undefined) => Promise<void>;
207
- createController: (options?: Parameters<typeof createPromptAttachmentController>[1]) => import("../../index.js").PromptAttachmentController;
208
- };
209
- get: (opts?: Parameters<typeof P.getProject>[1]) => Promise<P.KortixProject>;
210
- detail: () => Promise<{
211
- config: {
212
- default_agent: string | null;
213
- is_kortix_repo: boolean;
214
- signals: Record<string, boolean>;
215
- manifest_raw: string | null;
216
- open_code_raw: string | null;
217
- open_code_default_agent: string | null;
218
- agent_discovery: "opencode" | "declarative";
219
- agents: Array<{
220
- name: string;
221
- path: string;
222
- description: string | null;
223
- mode: string | null;
224
- model?: string | null;
225
- source?: "opencode" | "kortix.toml";
226
- enabled?: boolean;
227
- sandbox?: string | null;
228
- scope?: {
229
- env: string[] | "all";
230
- connectors: string[] | "all";
231
- kortix_permissions?: string[] | "all";
232
- kortix_cli: string[] | "all";
233
- apps?: string[] | "all";
234
- };
152
+ }) => Promise<import("../session/index.js").TranscriptPage>;
153
+ pending: () => Promise<import("../session/index.js").PendingInteractions>;
154
+ answerPermission: (requestId: string, reply: import("../../index.js").RuntimePermissionReply, message?: string) => Promise<void>;
155
+ answerQuestion: (requestId: string, answers: import("../../index.js").RuntimeQuestionAnswer[] | null) => Promise<void>;
156
+ compact: (model?: {
157
+ providerID: string;
158
+ modelID: string;
159
+ }) => Promise<{
160
+ providerID: string;
161
+ modelID: string;
162
+ }>;
163
+ files: {
164
+ list: (dirPath: string) => Promise<import("../../index.js").FileNode[]>;
165
+ read: (filePath: string) => Promise<import("../../index.js").FileContent>;
166
+ readBlob: (filePath: string) => Promise<Blob>;
167
+ status: () => Promise<import("../../index.js").GitFileStatus[]>;
168
+ findFiles: (query: string, options?: {
169
+ type?: "file" | "directory";
170
+ limit?: number;
171
+ }) => Promise<string[]>;
172
+ findText: (pattern: string) => Promise<import("../../index.js").FindMatch[]>;
173
+ upload: (file: File | Blob, targetPath?: string, filename?: string, options?: import("../../index.js").UploadFileOptions) => Promise<import("../../index.js").UploadResult[]>;
174
+ write: (filePath: string, content: Blob | File) => Promise<import("../../index.js").WriteFileResult>;
175
+ create: (filePath: string) => Promise<import("../../index.js").UploadResult[]>;
176
+ copy: (sourcePath: string, destPath: string) => Promise<import("../../index.js").UploadResult[]>;
177
+ remove: (filePath: string) => Promise<boolean>;
178
+ mkdir: (dirPath: string) => Promise<boolean>;
179
+ rename: (from: string, to: string) => Promise<boolean>;
180
+ };
181
+ abort: () => Promise<({
182
+ data: undefined;
183
+ error: unknown;
184
+ } | {
185
+ data: boolean;
186
+ error: undefined;
187
+ }) & {
188
+ request: Request;
189
+ response: Response;
190
+ }>;
191
+ rewind: (messageId: string) => Promise<({
192
+ data: undefined;
193
+ error: unknown;
194
+ } | {
195
+ data: import("../../index.js").Session;
196
+ error: undefined;
197
+ }) & {
198
+ request: Request;
199
+ response: Response;
200
+ }>;
201
+ restoreRewind: () => Promise<({
202
+ data: undefined;
203
+ error: unknown;
204
+ } | {
205
+ data: import("../../index.js").Session;
206
+ error: undefined;
207
+ }) & {
208
+ request: Request;
209
+ response: Response;
210
+ }>;
211
+ stream: (opts: {
212
+ onEvent: (event: import("../../index.js").RuntimeEvent) => void;
213
+ onGapRehydrate?: (gapMs: number) => void;
214
+ signal?: AbortSignal;
215
+ }) => Promise<import("../../index.js").EventStreamHandle>;
216
+ scope: () => Promise<P.SessionScope>;
217
+ providerSecretPool: {
218
+ list: () => Promise<{
219
+ pools: P.SessionProviderSecretPool[];
220
+ can_edit: boolean;
235
221
  }>;
236
- skills: Array<{
237
- name: string;
238
- path: string;
239
- description: string | null;
222
+ get: (providerId: string) => Promise<P.SessionProviderSecretPool>;
223
+ set: (providerId: string, secretIds: string[] | null) => Promise<P.SessionProviderSecretPool>;
224
+ };
225
+ rescope: (scope: P.SessionScopeInput) => Promise<P.SessionScope>;
226
+ setAgent: (agent: string | undefined) => void;
227
+ send: (text: string, opts?: {
228
+ model?: import("./session-shared.js").SessionModel;
229
+ agent?: string;
230
+ }) => Promise<P.CreateSessionPromptResult>;
231
+ setModel: (model: import("./session-shared.js").SessionModel | undefined) => void;
232
+ changeModel: (model: string) => Promise<P.SessionModelChangeResult>;
233
+ health: (init?: RequestInit) => Promise<import("../session/index.js").SessionHealthResult>;
234
+ previewUrl: (port: number, path?: string) => string;
235
+ proxyUrl: (url?: string) => string | undefined;
236
+ sandboxPortUrl: (port: number) => string;
237
+ reminders: {
238
+ list: () => Promise<{
239
+ reminders: P.SessionReminder[];
240
240
  }>;
241
- commands: Array<{
242
- name: string;
243
- path: string;
244
- description: string | null;
241
+ create: (input: Parameters<typeof P.createSessionReminder>[2]) => Promise<P.SessionReminder>;
242
+ update: (reminderId: string, input: Parameters<typeof P.updateSessionReminder>[3]) => Promise<P.SessionReminder>;
243
+ remove: (reminderId: string) => Promise<{
244
+ ok: boolean;
245
245
  }>;
246
- env: {
247
- required: string[];
248
- optional: string[];
249
- };
250
- };
251
- project: P.KortixProject;
252
- git_connection?: P.ProjectGitConnection | null;
253
- file_count: number;
254
- files: P.ProjectFileEntry[];
255
- }>;
256
- /** Canonical project-scoped audit timeline. */
257
- audit: (options?: Parameters<typeof P.listProjectAudit>[1]) => Promise<P.AuditEventList>;
258
- update: (input: Parameters<typeof P.updateProject>[1]) => Promise<P.KortixProject>;
259
- archive: () => Promise<{
260
- ok: boolean;
261
- }>;
262
- llmCatalog: () => Promise<P.ProjectLlmCatalogResponse>;
263
- modelPicker: () => Promise<P.ProjectLlmCatalogResponse>;
264
- modelAccess: () => Promise<P.ProjectModelAccess>;
265
- setModelAccess: (change: P.ProjectModelAccessChange) => Promise<P.ProjectModelAccess>;
266
- sandboxHealth: () => Promise<P.ProjectSandboxHealth>;
267
- onboardingComplete: (completed: boolean) => Promise<P.KortixProject>;
268
- /** Provider-neutral serverless Apps owned by this project. */
269
- apps: {
270
- list: () => Promise<P.App[]>;
271
- create: (input: Parameters<typeof P.createApp>[1]) => Promise<P.App>;
272
- get: (appId: string) => Promise<P.App>;
273
- update: (appId: string, input: P.UpdateAppInput) => Promise<P.App>;
274
- access: {
275
- get: (appId: string) => Promise<P.AppAccessConfig>;
276
- update: (appId: string, input: P.UpdateAppAccessInput) => Promise<P.AppAccessConfig>;
277
- session: (appId: string) => Promise<P.AppAccessSession>;
278
- /** Agents whose `kortix.yaml` `apps:` grant names this App. Read-only. */
279
- agents: (appId: string) => Promise<P.AppAgentAccess[]>;
280
246
  };
281
- remove: (appId: string) => Promise<{
282
- ok: boolean;
283
- }>;
284
- artifacts: {
285
- register: (input: Parameters<typeof P.registerAppArtifact>[1]) => Promise<P.RegisterAppArtifactResponse>;
286
- uploadArchive: (input: Blob | Uint8Array<ArrayBufferLike>, options?: P.UploadAppArtifactOptions | undefined) => Promise<P.AppArtifact>;
287
- finalize: (artifactId: string, input: P.FinalizeAppArtifactInput) => Promise<P.AppArtifact>;
247
+ audit: (limit?: number, options?: Parameters<typeof P.getSessionAudit>[3]) => Promise<P.SessionAudit>;
248
+ attachments: {
249
+ upload: (file: File, options?: Parameters<typeof P.uploadSessionAttachment>[3]) => Promise<P.SessionAttachment>;
250
+ read: (attachmentId: string, signal?: AbortSignal) => Promise<Blob>;
288
251
  };
289
- deployments: {
290
- create: (appId: string, input: P.CreateAppDeploymentInput) => Promise<P.AppDeployment>;
291
- list: (appId: string) => Promise<P.AppDeployment[]>;
292
- get: (appId: string, deploymentId: string) => Promise<P.AppDeploymentDetail>;
293
- logs: (appId: string, deploymentId: string, options?: P.AppLogsOptions | undefined) => Promise<P.AppLogsResponse>;
252
+ transcript: (options?: Parameters<typeof P.getSessionTranscript>[2]) => Promise<P.SessionTranscript>;
253
+ messageAuthors: () => Promise<P.SessionMessageAuthors>;
254
+ transcriptSync: (options?: Parameters<typeof P.getSessionTranscriptSync>[2]) => Promise<P.SessionTranscriptSyncEnvelope>;
255
+ turn: () => Promise<P.SessionTurnStatus>;
256
+ prompts: {
257
+ create: (input: P.CreateSessionPromptInput) => Promise<P.CreateSessionPromptResult>;
258
+ list: () => Promise<{
259
+ prompts: P.SessionPrompt[];
260
+ observed_at?: string;
261
+ }>;
262
+ remove: (promptId: string) => Promise<P.RemovedSessionPrompt>;
263
+ retry: (promptId: string) => Promise<P.SessionPrompt>;
264
+ edit: (promptId: string, text: string) => Promise<P.SessionPrompt>;
265
+ hold: (held: boolean) => Promise<{
266
+ prompts: P.SessionPrompt[];
267
+ observed_at?: string;
268
+ }>;
294
269
  };
295
- start: (appId: string) => Promise<P.App>;
296
- stop: (appId: string) => Promise<P.App>;
297
- rollback: (appId: string, deploymentId: string) => Promise<P.App>;
298
- };
299
- /** Project-scoped CLI PATs (auto-minted at session-create as `KORTIX_TOKEN`; can also be minted by hand). */
300
- tokens: {
301
- list: () => Promise<P.ProjectCliTokenListResponse>;
302
- create: (input?: Parameters<typeof P.createProjectCliToken>[1]) => Promise<P.CreatedProjectCliToken>;
303
- revoke: (tokenId: string) => Promise<{
270
+ ensureReady: (opts?: {
271
+ readyTimeoutMs?: number;
272
+ }) => Promise<import("../../index.js").SessionRuntimeEntry>;
273
+ get: (opts?: {
274
+ showErrors?: boolean;
275
+ }) => Promise<P.ProjectSession>;
276
+ presence: (input: {
277
+ tab_id: string;
278
+ active: boolean;
279
+ }) => Promise<import("../../index.js").ApiResponse<{
304
280
  ok: boolean;
305
- }>;
306
- };
307
- /** Agent-minted setup links — hand a human a link to enter a secret value or 1-click connect an app. */
308
- setupLinks: {
309
- requestSecret: (input: Parameters<typeof P.requestProjectSecret>[1]) => Promise<P.SecretRequestLink>;
310
- requestConnector: (input: Parameters<typeof P.requestProjectConnector>[1]) => Promise<P.ConnectorRequestLink>;
311
- };
312
- /** Validate a `kortix.yaml` (or legacy `kortix.toml`) manifest's raw text server-side — format is auto-resolved from the project's manifest path (same schema `kortix ship`/CR-merge use). */
313
- validateManifest: (raw: string) => Promise<P.ManifestValidationResult>;
314
- /** Mint a fresh scoped git push token for a managed project (409 for BYO repos). */
315
- gitToken: () => Promise<P.ProjectGitToken>;
316
- /** This project's agents as principals (service accounts), for a "Who
317
- * can use it" picker. Any project member may read it. */
318
- agentIdentities: () => Promise<P.AgentIdentity[]>;
319
- secrets: {
320
- list: () => Promise<P.ProjectSecretsResponse>;
321
- upsert: (input: Parameters<typeof P.upsertProjectSecret>[1]) => Promise<P.ProjectSecret>;
322
- setStrategy: (identifier: string, strategy: P.SecretDeliveryStrategy, options?: P.UpdateSecretStrategyOptions | undefined) => Promise<P.ProjectSecret>;
323
- broker: (identifier: string, input: P.SecretBrokerRequest) => Promise<P.SecretBrokerResponse>;
324
- remove: (name: string) => Promise<{
281
+ }>>;
282
+ cost: () => Promise<P.SessionCostDetail>;
283
+ update: (input: Parameters<typeof P.updateProjectSession>[2]) => Promise<P.ProjectSession>;
284
+ delete: () => Promise<{
325
285
  ok: boolean;
326
286
  }>;
327
- setPersonal: (name: string, input: {
328
- value?: string;
329
- active?: boolean;
330
- }) => Promise<P.ProjectSecret>;
331
- removePersonal: (name: string) => Promise<{
287
+ start: (options?: number | {
288
+ waitMs?: number;
289
+ repositoryMode?: "previous";
290
+ } | undefined) => Promise<P.SessionStartResult | null>;
291
+ restart: () => Promise<{
332
292
  ok: boolean;
293
+ session_id: string;
294
+ status: string;
333
295
  }>;
334
- setGitCredential: (input: Parameters<typeof P.upsertProjectGitCredential>[1]) => Promise<{
335
- configured: boolean;
336
- provider: string;
337
- git_connection: P.ProjectGitConnection;
338
- }>;
339
- /** The provider logins saved on this project (ChatGPT, OpenCode Zen, OpenCode Go). */
340
- listProviderOAuth: () => Promise<P.ProviderOAuthCredential[]>;
341
- /** Device-code OAuth flow to connect a subscription-backed provider (e.g. ChatGPT, opencode-go). */
342
- startProviderOAuth: (provider: string, input?: {
343
- sharing?: P.ConnectorSharing;
344
- resourceLabel?: string;
345
- resourceId?: string;
346
- } | undefined) => Promise<P.ProviderOAuthStart>;
347
- pollProviderOAuth: (provider: string, flowId: string) => Promise<P.ProviderOAuthPoll>;
348
- removeProviderOAuth: (provider: string) => Promise<{
296
+ stop: () => Promise<{
349
297
  ok: boolean;
298
+ session_id: string;
299
+ status: string;
350
300
  }>;
351
- };
352
- access: {
353
- list: () => Promise<P.ProjectAccessResponse>;
354
- invite: (email: string, role: P.ProjectRole, expiresAt?: string | null | undefined) => Promise<P.ProjectAccessMember | {
355
- status: "invited";
356
- email: string;
357
- invite_id: string;
358
- project_role: P.ProjectRole;
359
- message: string;
360
- invite_url: string;
361
- email_sent: boolean;
362
- email_skip_reason: string | null;
301
+ configState: () => Promise<P.SessionConfigState>;
302
+ reloadConfig: (input?: Parameters<typeof P.reloadProjectSessionConfig>[2]) => Promise<P.SessionReloadResult>;
303
+ reloadConfigStream: (input: {
304
+ refresh_repo?: boolean;
305
+ force?: boolean;
306
+ }, onEvent: (event: P.SessionReloadStreamEvent) => void, options?: import("../../index.js").ApiClientOptions | undefined) => Promise<P.SessionReloadResult>;
307
+ setSharing: (intent: Parameters<typeof P.setProjectSessionSharing>[2]) => Promise<P.ProjectSession>;
308
+ previews: () => Promise<{
309
+ candidates: P.SessionPreviewCandidate[];
363
310
  }>;
364
- update: (userId: string, role: P.ProjectRole) => Promise<P.ProjectAccessMember>;
365
- revoke: (userId: string) => Promise<{
311
+ participants: () => Promise<P.SessionParticipants>;
312
+ commit: (input?: Parameters<typeof P.commitSessionChanges>[2]) => Promise<P.CommitSessionResult>;
313
+ publicShares: {
314
+ list: () => Promise<{
315
+ shares: P.SessionPublicShare[];
316
+ }>;
317
+ create: (input: P.CreateSessionPublicShareInput) => Promise<{
318
+ share: P.SessionPublicShare;
319
+ }>;
320
+ revoke: (shareId: string) => Promise<{
321
+ share: P.SessionPublicShare;
322
+ }>;
323
+ };
324
+ };
325
+ modelDefaults: {
326
+ get: () => Promise<P.ModelDefaultsResponse>;
327
+ set: (input: Parameters<typeof P.setModelDefault>[1]) => Promise<{
366
328
  ok: boolean;
329
+ scope: string;
330
+ agentName?: string;
331
+ model: string;
367
332
  }>;
368
- pendingInvites: () => Promise<{
369
- pending: P.PendingProjectInvite[];
370
- }>;
371
- resendInvite: (inviteId: string) => Promise<P.ResendProjectInviteResult>;
372
- revokeInvite: (inviteId: string) => Promise<{
333
+ clear: (params: Parameters<typeof P.clearModelDefault>[1]) => Promise<{
373
334
  ok: boolean;
374
- invitation_cancelled: boolean;
375
335
  }>;
376
- requests: () => Promise<{
377
- requests: P.ProjectAccessRequest[];
336
+ };
337
+ setDefaultAgent: (agentName: string) => Promise<P.UpdateProjectDefaultAgentResponse>;
338
+ sandbox: {
339
+ list: () => Promise<P.SandboxTemplatesResponse>;
340
+ snapshots: () => Promise<P.ProjectSnapshotsResponse>;
341
+ rebuildSnapshot: (slug?: string) => Promise<P.RebuildSnapshotResponse>;
342
+ fixWithAgent: () => Promise<{
343
+ session_id: string;
378
344
  }>;
379
- approveRequest: (requestId: string, role?: P.ProjectRole | undefined) => Promise<{
380
- request: P.ProjectAccessRequest;
381
- member: P.ProjectAccessMember;
345
+ createTemplate: (input: Parameters<typeof P.createSandboxTemplate>[1]) => Promise<{
346
+ template_id: string;
347
+ slug: string;
382
348
  }>;
383
- rejectRequest: (requestId: string) => Promise<{
384
- request: P.ProjectAccessRequest;
349
+ updateTemplate: (templateId: string, input: P.UpdateSandboxTemplateInput) => Promise<{
350
+ template_id: string;
351
+ slug: string;
385
352
  }>;
386
- groupGrants: () => Promise<{
387
- grants: P.ProjectGroupGrant[];
353
+ removeTemplate: (templateId: string) => Promise<null>;
354
+ buildTemplate: (templateId: string) => Promise<{
355
+ status: "started";
356
+ template_id: string;
357
+ slug: string;
358
+ providers?: Array<"daytona" | "platinum" | "e2b">;
388
359
  }>;
389
- attachGroupGrant: (groupId: string, role: P.ProjectRole, expiresAt?: string | null | undefined) => Promise<{
390
- project_id: string;
391
- group_id: string;
392
- role: P.ProjectRole;
360
+ setProvider: (provider: Parameters<typeof P.updateProjectSandboxProvider>[1]) => Promise<P.UpdateProjectSandboxProviderResult>;
361
+ };
362
+ setAgentScope: (agentName: string, scope: {
363
+ env?: P.AgentGrantSet;
364
+ connectors?: P.AgentGrantSet;
365
+ connectors_required?: string[];
366
+ connectors_personal?: string[];
367
+ }) => Promise<{
368
+ ok: boolean;
369
+ agent: string;
370
+ env: P.AgentGrantSet;
371
+ connectors: P.AgentGrantSet;
372
+ connectors_required: string[];
373
+ }>;
374
+ channels: {
375
+ slack: {
376
+ installation: () => Promise<P.SlackInstallation | null>;
377
+ connect: (input: Parameters<typeof P.connectSlack>[1]) => Promise<P.SlackInstallation>;
378
+ mode: () => Promise<P.SlackMode>;
379
+ completeInstall: (input: Parameters<typeof P.completeSlackInstall>[1]) => Promise<P.ChannelInstallCompletion>;
380
+ manifest: () => Promise<Record<string, unknown>>;
381
+ disconnect: () => Promise<void>;
382
+ getFile: (url: string) => Promise<Blob>;
383
+ uploadFile: (input: Parameters<typeof P.uploadSlackChannelFile>[1]) => Promise<P.UploadSlackChannelFileResult>;
384
+ };
385
+ teams: {
386
+ completeInstall: (input: Parameters<typeof P.completeTeamsInstall>[1]) => Promise<P.ChannelInstallCompletion>;
387
+ };
388
+ email: {
389
+ installation: (connectorSlug?: string | null) => Promise<P.EmailInstallation | null>;
390
+ mode: () => Promise<P.EmailMode>;
391
+ connect: (input: Parameters<typeof P.connectEmail>[1]) => Promise<P.EmailInstallation>;
392
+ disconnect: (connectorSlug?: string | null) => Promise<void>;
393
+ updatePolicy: (connectorSlug: string | null | undefined, senderPolicy: P.EmailSenderPolicy) => Promise<P.EmailInstallation>;
394
+ };
395
+ };
396
+ updateFeatureFlag: (feature: P.FeatureFlagKey, enabled: boolean | null) => Promise<P.KortixProject>;
397
+ updateExperimentalFeature: (feature: P.FeatureFlagKey, enabled: boolean | null) => Promise<P.KortixProject>;
398
+ gateway: {
399
+ logs: (opts?: Parameters<typeof P.listGatewayLogs>[1]) => Promise<P.GatewayLogsResponse>;
400
+ log: (logId: string) => Promise<P.GatewayLogDetail>;
401
+ overview: (days?: number) => Promise<P.GatewayOverview>;
402
+ series: (days?: number) => Promise<P.GatewaySeries>;
403
+ breakdown: (days?: number) => Promise<P.GatewayBreakdown>;
404
+ sessions: (days?: number) => Promise<P.GatewaySessions>;
405
+ errors: (days?: number) => Promise<P.GatewayErrorsResponse>;
406
+ budgets: () => Promise<P.GatewayBudgetsResponse>;
407
+ setBudget: (input: Parameters<typeof P.setGatewayBudget>[1]) => Promise<{
408
+ ok: boolean;
393
409
  }>;
394
- updateGroupGrant: (groupId: string, role: P.ProjectRole, expiresAt?: string | null | undefined) => Promise<{
395
- project_id: string;
396
- group_id: string;
397
- role: P.ProjectRole;
410
+ deleteBudget: (budgetId: string) => Promise<{
411
+ ok: boolean;
398
412
  }>;
399
- detachGroupGrant: (groupId: string) => Promise<{
413
+ keys: () => Promise<{
414
+ keys: P.GatewayKeyRow[];
415
+ gateway_url?: string | null;
416
+ }>;
417
+ createKey: (name: string) => Promise<P.CreatedGatewayKey>;
418
+ revokeKey: (keyId: string) => Promise<{
400
419
  ok: boolean;
401
420
  }>;
402
- /** Per-resource (agent/skill/secret) grants to a member or a group. */
403
- resourceGrants: {
404
- list: () => Promise<P.ProjectResourceGrantsResponse>;
405
- create: (input: Parameters<typeof P.createProjectResourceGrant>[1]) => Promise<{
406
- grant_id: string;
407
- }>;
408
- remove: (grantId: string) => Promise<{
409
- ok: boolean;
410
- }>;
421
+ routing: {
422
+ get: () => Promise<P.GatewayRoutingPolicyDocument>;
423
+ set: (policy: Parameters<typeof P.setGatewayRoutingPolicy>[1]) => Promise<P.GatewayRoutingPolicyDocument>;
424
+ reset: () => Promise<P.GatewayRoutingPolicyDocument>;
425
+ preview: (input: Parameters<typeof P.previewGatewayRoute>[1]) => Promise<P.GatewayRoutePreview>;
411
426
  };
427
+ playground: (prompt: string, models: string[], system?: string) => Promise<P.GatewayPlaygroundResponse>;
428
+ };
429
+ sessions: {
430
+ list: (options?: Parameters<typeof P.listProjectSessions>[1]) => Promise<P.ProjectSession[]>;
431
+ listPage: (options?: Parameters<typeof P.listProjectSessionsPage>[1]) => Promise<P.ProjectSessionPage>;
432
+ create: (input?: Parameters<typeof P.createProjectSession>[1]) => Promise<P.ProjectSession>;
433
+ ensureWarm: () => Promise<P.WarmProjectSessionResult>;
434
+ claimWarm: (input: Parameters<typeof P.claimWarmProjectSession>[1]) => Promise<P.ProjectSession>;
435
+ };
436
+ review: {
437
+ list: (params?: Parameters<typeof P.listReviewItems>[1]) => Promise<{
438
+ review_items: P.ApiReviewItem[];
439
+ }>;
440
+ get: (reviewItemId: string) => Promise<{
441
+ review_item: P.ApiReviewItem;
442
+ }>;
443
+ submit: (input: Parameters<typeof P.submitReviewItem>[1]) => Promise<P.ApiReviewItem>;
444
+ act: (reviewItemId: string, input: {
445
+ verdict: P.ReviewVerdict;
446
+ feedback?: string;
447
+ }) => Promise<P.ApiReviewItem>;
448
+ bulkAct: (input: Parameters<typeof P.bulkActReviewItems>[1]) => Promise<{
449
+ updated: number;
450
+ review_items: P.ApiReviewItem[];
451
+ }>;
452
+ };
453
+ approvals: {
454
+ list: (options?: Parameters<typeof P.listPendingApprovals>[1]) => Promise<P.PendingApprovalsResponse>;
455
+ resolve: (executionId: string, decision: "deny" | "approve", options?: P.ResolveApprovalOptions | undefined) => Promise<{
456
+ ok: boolean;
457
+ }>;
458
+ sessionsNeedingInput: (options?: Parameters<typeof P.listSessionsNeedingInput>[1]) => Promise<P.SessionsNeedingInputResponse>;
459
+ };
460
+ files: {
461
+ list: (options?: Parameters<typeof P.listProjectFiles>[1]) => Promise<P.ProjectFileEntry[]>;
462
+ read: (path: string, ref?: string) => Promise<{
463
+ path: string;
464
+ ref: string;
465
+ content: string;
466
+ }>;
467
+ search: (query: string, options?: {
468
+ content?: boolean;
469
+ ref?: string;
470
+ limit?: number;
471
+ } | undefined) => Promise<P.ProjectFileSearchResponse>;
472
+ archive: (ref: string, path?: string | undefined) => Promise<Blob>;
473
+ history: (path: string, options?: {
474
+ ref?: string;
475
+ limit?: number;
476
+ skip?: number;
477
+ } | undefined) => Promise<P.ProjectFileHistoryResponse>;
478
+ };
479
+ git: {
480
+ commits: () => Promise<P.ProjectCommitsResponse>;
481
+ commit: (sha: string) => Promise<P.ProjectCommitDetail>;
482
+ commitDiff: (sha: string) => Promise<P.ProjectCommitDiffResponse>;
483
+ branches: () => Promise<P.ProjectBranchesResponse>;
484
+ versionDiff: (input: {
485
+ from: string;
486
+ into: string;
487
+ }) => Promise<P.VersionDiffPreview>;
488
+ inviteCollaborator: (githubUsername: string, permission?: "read" | "write" | undefined) => Promise<P.RepoCollaboratorInvite>;
489
+ };
490
+ changeRequests: {
491
+ list: () => Promise<{
492
+ change_requests: P.ChangeRequest[];
493
+ }>;
494
+ get: (crId: string) => Promise<P.ChangeRequestDetailResponse>;
495
+ diff: (crId: string) => Promise<P.ChangeRequestDiffResponse>;
496
+ mergePreview: (crId: string) => Promise<P.ChangeRequestMergePreview>;
497
+ open: (input: {
498
+ title: string;
499
+ description?: string;
500
+ head_ref: string;
501
+ base_ref?: string;
502
+ session_id?: string;
503
+ }) => Promise<P.ChangeRequest>;
504
+ merge: (crId: string, input?: {
505
+ message?: string;
506
+ } | undefined) => Promise<P.ChangeRequestMergeResponse>;
507
+ close: (crId: string) => Promise<P.ChangeRequest>;
508
+ reopen: (crId: string) => Promise<P.ChangeRequest>;
509
+ requestChanges: (crId: string, feedback: string) => Promise<{
510
+ change_request: P.ChangeRequest;
511
+ delivering: boolean;
512
+ }>;
513
+ };
514
+ policies: {
515
+ list: () => Promise<P.ProjectPoliciesResponse>;
516
+ set: (policies: P.ProjectPolicy[], defaultMode: P.PolicyDefaultMode) => Promise<{
517
+ ok: boolean;
518
+ sync?: P.ConnectorSyncResult;
519
+ }>;
520
+ };
521
+ reminders: {
522
+ list: () => Promise<{
523
+ reminders: P.ProjectReminder[];
524
+ }>;
525
+ };
526
+ triggers: {
527
+ list: () => Promise<P.ProjectTriggerListing>;
528
+ create: (input: P.CreateProjectTriggerInput) => Promise<P.ProjectTriggerListing>;
529
+ update: (slug: string, input: P.UpdateProjectTriggerInput) => Promise<P.ProjectTriggerListing>;
530
+ remove: (slug: string) => Promise<{
531
+ ok: boolean;
532
+ }>;
533
+ fire: (slug: string) => Promise<P.FireProjectTriggerResponse>;
534
+ setActivation: (paused: boolean) => Promise<P.ProjectTriggerListing>;
412
535
  };
413
536
  connectors: {
414
537
  list: () => Promise<P.ConnectorsResponse>;
@@ -467,7 +590,6 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
467
590
  }>;
468
591
  rename: (connectionId: string, label: string) => Promise<P.Connection>;
469
592
  share: (connectionId: string, principals?: P.ConnectionSharePrincipal[] | undefined) => Promise<P.Connection>;
470
- /** Add a machine the caller paired to this project as a `computer` account. */
471
593
  addComputer: (input: {
472
594
  tunnelId: string;
473
595
  share?: P.ConnectorConnectOwner;
@@ -487,11 +609,8 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
487
609
  sync?: P.ConnectorSyncResult;
488
610
  }>;
489
611
  };
490
- /** Easy-connect (Pipedream): app catalog + connect/finalize handshake. */
491
612
  pipedream: {
492
613
  listApps: (qOrQuery?: string | P.PipedreamCatalogQuery | undefined, cursor?: string | undefined) => Promise<P.PipedreamCatalogPage>;
493
- /** The browse page: a fixed top slice of each of the largest
494
- * categories, with each category's true total, in one request. */
495
614
  listSections: (opts?: {
496
615
  perCategory?: number;
497
616
  maxCategories?: number;
@@ -503,585 +622,354 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
503
622
  connect: (slug: string, options?: P.ConnectorConnectOptions | undefined) => Promise<P.ConnectorConnectResult>;
504
623
  finalize: (slug: string, options?: P.ConnectorFinalizeOptions | undefined) => Promise<P.ConnectorFinalizeResult>;
505
624
  };
506
- /** Direct connector catalogue and normalized domain surfaces. */
507
625
  discover: {
508
626
  list: (qOrQuery?: string | P.DiscoverConnectorsQuery | undefined, cursor?: string | undefined) => Promise<P.DiscoverConnectorsPage>;
509
- /** The browse page: Popular plus a fixed top slice of each section,
510
- * with each section's true total, in one request. */
511
627
  sections: (opts?: {
512
628
  perCategory?: number;
513
629
  maxCategories?: number;
514
630
  } | undefined) => Promise<P.DiscoverSectionsPage>;
515
631
  detail: (id: string) => Promise<P.DiscoverConnectorDetail>;
516
632
  };
517
- /** Callable catalog for this project or token scope. */
518
633
  catalog: (options?: Parameters<typeof P.getConnectorCatalog>[1]) => Promise<P.ConnectorCatalogEntry[]>;
519
- /** Flattened `<connector>.<action>` tool list. */
520
634
  tools: () => Promise<P.ConnectorTool[]>;
521
- /** Search callable tools by id and description. */
522
635
  search: (query?: string | undefined, options?: {
523
636
  limit?: number;
524
637
  } | undefined) => Promise<P.ConnectorTool[]>;
525
- /** Describe one `<connector>.<action>` tool. */
526
638
  describe: (tool: string) => Promise<P.ConnectorTool | null>;
527
- /** Call one `<connector>.<action>` tool. */
528
639
  call: <T = unknown>(tool: string, args?: Record<string, unknown> | undefined, options?: P.ConnectorCallOptions | undefined) => Promise<P.ConnectorCallResult<T>>;
529
- /** The accounts a connector can be called as, default first. */
530
640
  accounts: (slug: string) => Promise<P.ConnectorAccount[]>;
531
- /** Upload bytes for use by a later connector call. */
532
641
  uploadAttachment: (content: Blob | ArrayBuffer | Uint8Array<ArrayBufferLike>, input: P.ConnectorAttachmentUploadInput) => Promise<P.ConnectorAttachmentUploadResult>;
533
642
  };
534
- policies: {
535
- list: () => Promise<P.ProjectPoliciesResponse>;
536
- set: (policies: P.ProjectPolicy[], defaultMode: P.PolicyDefaultMode) => Promise<{
643
+ tokens: {
644
+ list: () => Promise<P.ProjectCliTokenListResponse>;
645
+ create: (input?: Parameters<typeof P.createProjectCliToken>[1]) => Promise<P.CreatedProjectCliToken>;
646
+ revoke: (tokenId: string) => Promise<{
537
647
  ok: boolean;
538
- sync?: P.ConnectorSyncResult;
539
648
  }>;
540
649
  };
541
- /** Reminders on every session the caller can open — see `listProjectReminders`. */
542
- reminders: {
543
- list: () => Promise<{
544
- reminders: P.ProjectReminder[];
545
- }>;
650
+ setupLinks: {
651
+ requestSecret: (input: Parameters<typeof P.requestProjectSecret>[1]) => Promise<P.SecretRequestLink>;
652
+ requestConnector: (input: Parameters<typeof P.requestProjectConnector>[1]) => Promise<P.ConnectorRequestLink>;
546
653
  };
547
- triggers: {
548
- list: () => Promise<P.ProjectTriggerListing>;
549
- create: (input: P.CreateProjectTriggerInput) => Promise<P.ProjectTriggerListing>;
550
- update: (slug: string, input: P.UpdateProjectTriggerInput) => Promise<P.ProjectTriggerListing>;
551
- remove: (slug: string) => Promise<{
654
+ validateManifest: (raw: string) => Promise<P.ManifestValidationResult>;
655
+ gitToken: () => Promise<P.ProjectGitToken>;
656
+ agentIdentities: () => Promise<P.AgentIdentity[]>;
657
+ secrets: {
658
+ list: () => Promise<P.ProjectSecretsResponse>;
659
+ upsert: (input: Parameters<typeof P.upsertProjectSecret>[1]) => Promise<P.ProjectSecret>;
660
+ setStrategy: (identifier: string, strategy: P.SecretDeliveryStrategy, options?: P.UpdateSecretStrategyOptions | undefined) => Promise<P.ProjectSecret>;
661
+ broker: (identifier: string, input: P.SecretBrokerRequest) => Promise<P.SecretBrokerResponse>;
662
+ remove: (name: string) => Promise<{
552
663
  ok: boolean;
553
664
  }>;
554
- fire: (slug: string) => Promise<P.FireProjectTriggerResponse>;
555
- setActivation: (paused: boolean) => Promise<P.ProjectTriggerListing>;
556
- };
557
- files: {
558
- list: (options?: Parameters<typeof P.listProjectFiles>[1]) => Promise<P.ProjectFileEntry[]>;
559
- read: (path: string, ref?: string) => Promise<{
560
- path: string;
561
- ref: string;
562
- content: string;
563
- }>;
564
- search: (query: string, options?: {
565
- content?: boolean;
566
- ref?: string;
567
- limit?: number;
568
- } | undefined) => Promise<P.ProjectFileSearchResponse>;
569
- archive: (ref: string, path?: string | undefined) => Promise<Blob>;
570
- history: (path: string, options?: {
571
- ref?: string;
572
- limit?: number;
573
- skip?: number;
574
- } | undefined) => Promise<P.ProjectFileHistoryResponse>;
575
- };
576
- git: {
577
- commits: () => Promise<P.ProjectCommitsResponse>;
578
- commit: (sha: string) => Promise<P.ProjectCommitDetail>;
579
- commitDiff: (sha: string) => Promise<P.ProjectCommitDiffResponse>;
580
- branches: () => Promise<P.ProjectBranchesResponse>;
581
- versionDiff: (input: {
582
- from: string;
583
- into: string;
584
- }) => Promise<P.VersionDiffPreview>;
585
- /** Invite a GitHub user as a collaborator on a Kortix-managed repo. */
586
- inviteCollaborator: (githubUsername: string, permission?: "read" | "write" | undefined) => Promise<P.RepoCollaboratorInvite>;
587
- };
588
- changeRequests: {
589
- list: () => Promise<{
590
- change_requests: P.ChangeRequest[];
591
- }>;
592
- get: (crId: string) => Promise<P.ChangeRequestDetailResponse>;
593
- diff: (crId: string) => Promise<P.ChangeRequestDiffResponse>;
594
- mergePreview: (crId: string) => Promise<P.ChangeRequestMergePreview>;
595
- open: (input: {
596
- title: string;
597
- description?: string;
598
- head_ref: string;
599
- base_ref?: string;
600
- session_id?: string;
601
- }) => Promise<P.ChangeRequest>;
602
- merge: (crId: string, input?: {
603
- message?: string;
604
- } | undefined) => Promise<P.ChangeRequestMergeResponse>;
605
- close: (crId: string) => Promise<P.ChangeRequest>;
606
- reopen: (crId: string) => Promise<P.ChangeRequest>;
607
- /** Request changes on a CR (Review Center) — records feedback + optionally delivers it back to the originating session. */
608
- requestChanges: (crId: string, feedback: string) => Promise<{
609
- change_request: P.ChangeRequest;
610
- delivering: boolean;
611
- }>;
612
- };
613
- sessions: {
614
- /** One page of sessions as a bare array. See `listPage` for `next_cursor`. */
615
- list: (options?: Parameters<typeof P.listProjectSessions>[1]) => Promise<P.ProjectSession[]>;
616
- /** One keyset page plus its continuation token. The list is bounded —
617
- * walk it with `next_cursor`, and use `get(sessionId)` to resolve one
618
- * session rather than paging in search of it. */
619
- listPage: (options?: Parameters<typeof P.listProjectSessionsPage>[1]) => Promise<P.ProjectSessionPage>;
620
- create: (input?: Parameters<typeof P.createProjectSession>[1]) => Promise<P.ProjectSession>;
621
- /** Pre-create the session a present user is about to start. Ordinary session; ignore failures. */
622
- ensureWarm: () => Promise<P.WarmProjectSessionResult>;
623
- /** @deprecated Navigate to `ensureWarm()`'s session and prompt it. Removed in the next major. */
624
- claimWarm: (input: Parameters<typeof P.claimWarmProjectSession>[1]) => Promise<P.ProjectSession>;
625
- };
626
- /** Review Center — the per-project human-in-the-loop inbox (change requests, tool approvals, agent outputs/decisions). */
627
- review: {
628
- list: (params?: Parameters<typeof P.listReviewItems>[1]) => Promise<{
629
- review_items: P.ApiReviewItem[];
630
- }>;
631
- get: (reviewItemId: string) => Promise<{
632
- review_item: P.ApiReviewItem;
633
- }>;
634
- submit: (input: Parameters<typeof P.submitReviewItem>[1]) => Promise<P.ApiReviewItem>;
635
- act: (reviewItemId: string, input: {
636
- verdict: P.ReviewVerdict;
637
- feedback?: string;
638
- }) => Promise<P.ApiReviewItem>;
639
- bulkAct: (input: Parameters<typeof P.bulkActReviewItems>[1]) => Promise<{
640
- updated: number;
641
- review_items: P.ApiReviewItem[];
642
- }>;
643
- };
644
- /** The manager inbox of connector-gated actions awaiting approve/deny (APPROVE / ASK / BLOCK). */
645
- approvals: {
646
- list: (options?: Parameters<typeof P.listPendingApprovals>[1]) => Promise<P.PendingApprovalsResponse>;
647
- resolve: (executionId: string, decision: "deny" | "approve", options?: P.ResolveApprovalOptions | undefined) => Promise<{
665
+ setPersonal: (name: string, input: {
666
+ value?: string;
667
+ active?: boolean;
668
+ }) => Promise<P.ProjectSecret>;
669
+ removePersonal: (name: string) => Promise<{
648
670
  ok: boolean;
649
671
  }>;
650
- sessionsNeedingInput: (options?: Parameters<typeof P.listSessionsNeedingInput>[1]) => Promise<P.SessionsNeedingInputResponse>;
651
- };
652
- /** Gateway observability — LLM request logs, cost/latency rollups, budgets, gateway API keys. */
653
- gateway: {
654
- logs: (opts?: Parameters<typeof P.listGatewayLogs>[1]) => Promise<P.GatewayLogsResponse>;
655
- log: (logId: string) => Promise<P.GatewayLogDetail>;
656
- overview: (days?: number) => Promise<P.GatewayOverview>;
657
- series: (days?: number) => Promise<P.GatewaySeries>;
658
- breakdown: (days?: number) => Promise<P.GatewayBreakdown>;
659
- sessions: (days?: number) => Promise<P.GatewaySessions>;
660
- errors: (days?: number) => Promise<P.GatewayErrorsResponse>;
661
- budgets: () => Promise<P.GatewayBudgetsResponse>;
662
- setBudget: (input: Parameters<typeof P.setGatewayBudget>[1]) => Promise<{
663
- ok: boolean;
672
+ setGitCredential: (input: Parameters<typeof P.upsertProjectGitCredential>[1]) => Promise<{
673
+ configured: boolean;
674
+ provider: string;
675
+ git_connection: P.ProjectGitConnection;
664
676
  }>;
665
- deleteBudget: (budgetId: string) => Promise<{
677
+ listProviderOAuth: () => Promise<P.ProviderOAuthCredential[]>;
678
+ startProviderOAuth: (provider: string, input?: {
679
+ sharing?: P.ConnectorSharing;
680
+ resourceLabel?: string;
681
+ resourceId?: string;
682
+ } | undefined) => Promise<P.ProviderOAuthStart>;
683
+ pollProviderOAuth: (provider: string, flowId: string) => Promise<P.ProviderOAuthPoll>;
684
+ removeProviderOAuth: (provider: string) => Promise<{
666
685
  ok: boolean;
667
686
  }>;
668
- keys: () => Promise<{
669
- keys: P.GatewayKeyRow[];
670
- gateway_url?: string | null;
687
+ };
688
+ access: {
689
+ list: () => Promise<P.ProjectAccessResponse>;
690
+ invite: (email: string, role: P.ProjectRole, expiresAt?: string | null | undefined) => Promise<P.ProjectAccessMember | {
691
+ status: "invited";
692
+ email: string;
693
+ invite_id: string;
694
+ project_role: P.ProjectRole;
695
+ message: string;
696
+ invite_url: string;
697
+ email_sent: boolean;
698
+ email_skip_reason: string | null;
671
699
  }>;
672
- createKey: (name: string) => Promise<P.CreatedGatewayKey>;
673
- revokeKey: (keyId: string) => Promise<{
700
+ update: (userId: string, role: P.ProjectRole) => Promise<P.ProjectAccessMember>;
701
+ revoke: (userId: string) => Promise<{
674
702
  ok: boolean;
675
703
  }>;
676
- routing: {
677
- get: () => Promise<P.GatewayRoutingPolicyDocument>;
678
- set: (policy: Parameters<typeof P.setGatewayRoutingPolicy>[1]) => Promise<P.GatewayRoutingPolicyDocument>;
679
- reset: () => Promise<P.GatewayRoutingPolicyDocument>;
680
- preview: (input: Parameters<typeof P.previewGatewayRoute>[1]) => Promise<P.GatewayRoutePreview>;
681
- };
682
- /** Run one prompt against up to 6 models side by side (a model-comparison playground). */
683
- playground: (prompt: string, models: string[], system?: string) => Promise<P.GatewayPlaygroundResponse>;
684
- };
685
- /** Slack + email + Meet channel connections. */
686
- channels: {
687
- slack: {
688
- installation: () => Promise<P.SlackInstallation | null>;
689
- connect: (input: Parameters<typeof P.connectSlack>[1]) => Promise<P.SlackInstallation>;
690
- mode: () => Promise<P.SlackMode>;
691
- /** Finish an "Add to Slack" install as the signed-in user (web completion page). */
692
- completeInstall: (input: Parameters<typeof P.completeSlackInstall>[1]) => Promise<P.ChannelInstallCompletion>;
693
- manifest: () => Promise<Record<string, unknown>>;
694
- disconnect: () => Promise<void>;
695
- /** Download a Slack-hosted file through the server-side proxy (bot token stays server-side). */
696
- getFile: (url: string) => Promise<Blob>;
697
- /** Upload a file to Slack through the server-side 3-step external-upload proxy. */
698
- uploadFile: (input: Parameters<typeof P.uploadSlackChannelFile>[1]) => Promise<P.UploadSlackChannelFileResult>;
699
- };
700
- teams: {
701
- /** Finish a Microsoft Teams org install as the signed-in user (web completion page). */
702
- completeInstall: (input: Parameters<typeof P.completeTeamsInstall>[1]) => Promise<P.ChannelInstallCompletion>;
703
- };
704
- email: {
705
- installation: (connectorSlug?: string | null) => Promise<P.EmailInstallation | null>;
706
- mode: () => Promise<P.EmailMode>;
707
- connect: (input: Parameters<typeof P.connectEmail>[1]) => Promise<P.EmailInstallation>;
708
- disconnect: (connectorSlug?: string | null) => Promise<void>;
709
- updatePolicy: (connectorSlug: string | null | undefined, senderPolicy: P.EmailSenderPolicy) => Promise<P.EmailInstallation>;
710
- };
711
- };
712
- /** Toggle a feature flag (Customize → Feature flags). Pass `enabled: null` to clear the override. */
713
- updateFeatureFlag: (feature: P.FeatureFlagKey, enabled: boolean | null) => Promise<P.KortixProject>;
714
- /** @deprecated Renamed to `updateFeatureFlag`. Keeps the legacy `/experimental` wire path for older deployed APIs. */
715
- updateExperimentalFeature: (feature: P.FeatureFlagKey, enabled: boolean | null) => Promise<P.KortixProject>;
716
- /** Default model preferences (account/agent/project scope, gateway-resolved). */
717
- modelDefaults: {
718
- get: () => Promise<P.ModelDefaultsResponse>;
719
- set: (input: Parameters<typeof P.setModelDefault>[1]) => Promise<{
720
- ok: boolean;
721
- scope: string;
722
- agentName?: string;
723
- model: string;
704
+ pendingInvites: () => Promise<{
705
+ pending: P.PendingProjectInvite[];
724
706
  }>;
725
- clear: (params: Parameters<typeof P.clearModelDefault>[1]) => Promise<{
707
+ resendInvite: (inviteId: string) => Promise<P.ResendProjectInviteResult>;
708
+ revokeInvite: (inviteId: string) => Promise<{
726
709
  ok: boolean;
710
+ invitation_cancelled: boolean;
727
711
  }>;
728
- };
729
- /** Set the agent used when a new project session does not name one explicitly. */
730
- setDefaultAgent: (agentName: string) => Promise<P.UpdateProjectDefaultAgentResponse>;
731
- /** Sandbox templates + snapshot builds — Dockerfile/image/warm-pool config, beyond `sandboxHealth`/`sandboxTemplates`. */
732
- sandbox: {
733
- list: () => Promise<P.SandboxTemplatesResponse>;
734
- snapshots: () => Promise<P.ProjectSnapshotsResponse>;
735
- rebuildSnapshot: (slug?: string) => Promise<P.RebuildSnapshotResponse>;
736
- fixWithAgent: () => Promise<{
737
- session_id: string;
712
+ requests: () => Promise<{
713
+ requests: P.ProjectAccessRequest[];
738
714
  }>;
739
- createTemplate: (input: Parameters<typeof P.createSandboxTemplate>[1]) => Promise<{
740
- template_id: string;
741
- slug: string;
715
+ approveRequest: (requestId: string, role?: P.ProjectRole | undefined) => Promise<{
716
+ request: P.ProjectAccessRequest;
717
+ member: P.ProjectAccessMember;
742
718
  }>;
743
- updateTemplate: (templateId: string, input: P.UpdateSandboxTemplateInput) => Promise<{
744
- template_id: string;
745
- slug: string;
719
+ rejectRequest: (requestId: string) => Promise<{
720
+ request: P.ProjectAccessRequest;
746
721
  }>;
747
- removeTemplate: (templateId: string) => Promise<null>;
748
- buildTemplate: (templateId: string) => Promise<{
749
- status: "started";
750
- template_id: string;
751
- slug: string;
752
- providers?: Array<"daytona" | "platinum" | "e2b">;
722
+ groupGrants: () => Promise<{
723
+ grants: P.ProjectGroupGrant[];
753
724
  }>;
754
- /** Pin/clear the per-project sandbox provider (null = follow the platform default). */
755
- setProvider: (provider: Parameters<typeof P.updateProjectSandboxProvider>[1]) => Promise<P.UpdateProjectSandboxProviderResult>;
756
- };
757
- /** Bind specific secrets + connectors to an agent (the inheritance pyramid's declaration step). */
758
- setAgentScope: (agentName: string, scope: {
759
- env?: P.AgentGrantSet;
760
- connectors?: P.AgentGrantSet;
761
- connectors_required?: string[];
762
- connectors_personal?: string[];
763
- }) => Promise<{
764
- ok: boolean;
765
- agent: string;
766
- env: P.AgentGrantSet;
767
- connectors: P.AgentGrantSet;
768
- connectors_required: string[];
769
- }>;
770
- session: (sessionId: string) => {
771
- get: (opts?: {
772
- showErrors?: boolean;
773
- }) => Promise<P.ProjectSession>;
774
- presence: (input: {
775
- tab_id: string;
776
- active: boolean;
777
- }) => Promise<import("../../index.js").ApiResponse<{
778
- ok: boolean;
779
- }>>;
780
- /** Unified finalized LLM and compute cost for this session. */
781
- cost: () => Promise<P.SessionCostDetail>;
782
- update: (input: Parameters<typeof P.updateProjectSession>[2]) => Promise<P.ProjectSession>;
783
- delete: () => Promise<{
784
- ok: boolean;
725
+ attachGroupGrant: (groupId: string, role: P.ProjectRole, expiresAt?: string | null | undefined) => Promise<{
726
+ project_id: string;
727
+ group_id: string;
728
+ role: P.ProjectRole;
785
729
  }>;
786
- start: (options?: number | {
787
- waitMs?: number;
788
- repositoryMode?: "previous";
789
- } | undefined) => Promise<P.SessionStartResult | null>;
790
- restart: () => Promise<{
791
- ok: boolean;
792
- session_id: string;
793
- status: string;
730
+ updateGroupGrant: (groupId: string, role: P.ProjectRole, expiresAt?: string | null | undefined) => Promise<{
731
+ project_id: string;
732
+ group_id: string;
733
+ role: P.ProjectRole;
794
734
  }>;
795
- stop: () => Promise<{
735
+ detachGroupGrant: (groupId: string) => Promise<{
796
736
  ok: boolean;
797
- session_id: string;
798
- status: string;
799
737
  }>;
800
- /** Is this session still running the config the manifest compiles to? */
801
- configState: () => Promise<P.SessionConfigState>;
802
- /**
803
- * Recompile the agent config from git into this running session.
804
- *
805
- * Restarts opencode to rebuild its config, so readiness has to be
806
- * resolved again — same reason `restart` forgets it.
807
- */
808
- reloadConfig: (input?: Parameters<typeof P.reloadProjectSessionConfig>[2]) => Promise<P.SessionReloadResult>;
809
- /** Reload config with server-observed progress events. */
810
- reloadConfigStream: (input: {
811
- refresh_repo?: boolean;
812
- force?: boolean;
813
- }, onEvent: (event: P.SessionReloadStreamEvent) => void, options?: import("../../index.js").ApiClientOptions | undefined) => Promise<P.SessionReloadResult>;
814
- setSharing: (intent: Parameters<typeof P.setProjectSessionSharing>[2]) => Promise<P.ProjectSession>;
815
- previews: () => Promise<{
816
- candidates: P.SessionPreviewCandidate[];
817
- }>;
818
- commit: (input?: Parameters<typeof P.commitSessionChanges>[2]) => Promise<P.CommitSessionResult>;
819
- publicShares: {
820
- list: () => Promise<{
821
- shares: P.SessionPublicShare[];
822
- }>;
823
- create: (input: P.CreateSessionPublicShareInput) => Promise<{
824
- share: P.SessionPublicShare;
825
- }>;
826
- revoke: (shareId: string) => Promise<{
827
- share: P.SessionPublicShare;
828
- }>;
829
- };
830
- /** Scheduled prompts into this session — see `CreateSessionReminderInput`. */
831
- reminders: {
832
- list: () => Promise<{
833
- reminders: P.SessionReminder[];
738
+ resourceGrants: {
739
+ list: () => Promise<P.ProjectResourceGrantsResponse>;
740
+ create: (input: Parameters<typeof P.createProjectResourceGrant>[1]) => Promise<{
741
+ grant_id: string;
834
742
  }>;
835
- create: (input: Parameters<typeof P.createSessionReminder>[2]) => Promise<P.SessionReminder>;
836
- update: (reminderId: string, input: Parameters<typeof P.updateSessionReminder>[3]) => Promise<P.SessionReminder>;
837
- remove: (reminderId: string) => Promise<{
743
+ remove: (grantId: string) => Promise<{
838
744
  ok: boolean;
839
745
  }>;
840
746
  };
841
- /** Per-session audit trail of connector-gated agent actions. */
842
- audit: (limit?: number, options?: Parameters<typeof P.getSessionAudit>[3]) => Promise<P.SessionAudit>;
843
- attachments: {
844
- upload: (file: File, options?: Parameters<typeof P.uploadSessionAttachment>[3]) => Promise<P.SessionAttachment>;
845
- read: (attachmentId: string, signal?: AbortSignal) => Promise<Blob>;
747
+ };
748
+ apps: {
749
+ list: () => Promise<P.App[]>;
750
+ create: (input: Parameters<typeof P.createApp>[1]) => Promise<P.App>;
751
+ get: (appId: string) => Promise<P.App>;
752
+ update: (appId: string, input: P.UpdateAppInput) => Promise<P.App>;
753
+ access: {
754
+ get: (appId: string) => Promise<P.AppAccessConfig>;
755
+ update: (appId: string, input: P.UpdateAppAccessInput) => Promise<P.AppAccessConfig>;
756
+ session: (appId: string) => Promise<P.AppAccessSession>;
757
+ agents: (appId: string) => Promise<P.AppAgentAccess[]>;
846
758
  };
847
- /** Compact server-side transcript read (text + tool calls, no tool inputs/outputs) — callable with project-scoped session tokens. */
848
- transcript: (options?: Parameters<typeof P.getSessionTranscript>[2]) => Promise<P.SessionTranscript>;
849
- /** Who wrote each message: a member, or another session's agent. */
850
- messageAuthors: () => Promise<P.SessionMessageAuthors>;
851
- /** The DURABLE server-side transcript mirror, in sync-store shape
852
- * (OpenCode message envelopes verbatim, attachment bytes and tool
853
- * inputs/outputs stripped). This is the read that answers while the
854
- * sandbox is stopped or still waking. */
855
- transcriptSync: (options?: Parameters<typeof P.getSessionTranscriptSync>[2]) => Promise<P.SessionTranscriptSyncEnvelope>;
856
- /** Which turns are running right now, and how did the last one end?
857
- * Server truth from the control plane's lifecycle authority, independent
858
- * of the live stream. */
859
- turn: () => Promise<P.SessionTurnStatus>;
860
- /** This session's SERVER-SIDE prompt inbox: the prompts it still owes the
861
- * user. Durable, so it survives a closed tab and is the same list on
862
- * every device. */
863
- prompts: {
864
- create: (input: P.CreateSessionPromptInput) => Promise<P.CreateSessionPromptResult>;
865
- list: () => Promise<{
866
- prompts: P.SessionPrompt[];
867
- observed_at?: string;
759
+ remove: (appId: string) => Promise<{
760
+ ok: boolean;
761
+ images?: P.AppImageRelease;
762
+ }>;
763
+ artifacts: {
764
+ register: (input: Parameters<typeof P.registerAppArtifact>[1]) => Promise<P.RegisterAppArtifactResponse>;
765
+ uploadArchive: (input: Blob | Uint8Array<ArrayBufferLike>, options?: P.UploadAppArtifactOptions | undefined) => Promise<P.AppArtifact>;
766
+ finalize: (artifactId: string, input: P.FinalizeAppArtifactInput) => Promise<P.AppArtifact>;
767
+ };
768
+ deployments: {
769
+ create: (appId: string, input: P.CreateAppDeploymentInput) => Promise<P.AppDeployment>;
770
+ list: (appId: string) => Promise<P.AppDeployment[]>;
771
+ get: (appId: string, deploymentId: string) => Promise<P.AppDeploymentDetail>;
772
+ logs: (appId: string, deploymentId: string, options?: P.AppLogsOptions | undefined) => Promise<P.AppLogsResponse>;
773
+ remove: (appId: string, deploymentId: string) => Promise<P.DeleteAppDeploymentResult>;
774
+ };
775
+ start: (appId: string) => Promise<P.App>;
776
+ stop: (appId: string) => Promise<P.App>;
777
+ rollback: (appId: string, deploymentId: string) => Promise<P.App>;
778
+ };
779
+ attachments: {
780
+ upload: (file: File, options?: P.PromptAttachmentUploadOptions | undefined) => Promise<P.PromptAttachment>;
781
+ delete: (attachmentId: string, options?: {
782
+ signal?: AbortSignal;
783
+ } | undefined) => Promise<void>;
784
+ createController: (options?: Parameters<typeof import("../../index.js").createPromptAttachmentController>[1]) => import("../../index.js").PromptAttachmentController;
785
+ };
786
+ get: (opts?: Parameters<typeof P.getProject>[1]) => Promise<P.KortixProject>;
787
+ detail: () => Promise<{
788
+ config: {
789
+ default_agent: string | null;
790
+ is_kortix_repo: boolean;
791
+ signals: Record<string, boolean>;
792
+ manifest_raw: string | null;
793
+ open_code_raw: string | null;
794
+ open_code_default_agent: string | null;
795
+ agent_discovery: "opencode" | "declarative";
796
+ agents: Array<{
797
+ name: string;
798
+ path: string;
799
+ description: string | null;
800
+ mode: string | null;
801
+ model?: string | null;
802
+ source?: "opencode" | "kortix.toml";
803
+ enabled?: boolean;
804
+ sandbox?: string | null;
805
+ scope?: {
806
+ env: string[] | "all";
807
+ connectors: string[] | "all";
808
+ kortix_permissions?: string[] | "all";
809
+ kortix_cli: string[] | "all";
810
+ apps?: string[] | "all";
811
+ };
868
812
  }>;
869
- remove: (promptId: string) => Promise<P.RemovedSessionPrompt>;
870
- retry: (promptId: string) => Promise<P.SessionPrompt>;
871
- /** Hold (or release) the whole queue — what the Stop button writes. */
872
- hold: (held: boolean) => Promise<{
873
- prompts: P.SessionPrompt[];
874
- observed_at?: string;
813
+ skills: Array<{
814
+ name: string;
815
+ path: string;
816
+ description: string | null;
875
817
  }>;
876
- };
877
- /**
878
- * Resolve THIS handle's own runtime (idempotent): provisions/resumes the
879
- * sandbox (long-poll until ready) and caches the resolved OpenCode session
880
- * id + runtime URL + sandbox id for every other call on this handle. Call
881
- * this (or `send`/`abort`, which call it internally) before `.runtime`,
882
- * `.health()`, `.previewUrl()`, or `.proxyUrl()` — those throw
883
- * `SessionNotReadyError` instead of falling back to whatever sandbox
884
- * happens to be globally active.
885
- */
886
- ensureReady: (opts?: {
887
- readyTimeoutMs?: number;
888
- }) => Promise<SessionRuntimeEntry>;
889
- /**
890
- * Liveness/readiness of THIS session's runtime (`GET /kortix/health`).
891
- * Unlike `.previewUrl()`/`.proxyUrl()`/`.runtime`, this never throws
892
- * `SessionNotReadyError` — a health poller (e.g. a header dot ticking
893
- * every 15s on a fresh inline handle) needs to be callable BEFORE the
894
- * session has ever resolved a runtime. It degrades to the same graceful
895
- * `{ status: 0, ok: false }` shape `getSessionHealth` already returns for
896
- * "no URL yet", instead of forcing every caller to guard with `ensureReady()`.
897
- */
898
- health: (init?: RequestInit) => Promise<import("../session/index.js").SessionHealthResult>;
899
- /** Proxy/preview URL for a port THIS session's runtime exposes. */
900
- previewUrl: (port: number, path?: string) => string;
901
- /** Rewrite a localhost URL the agent printed into a reachable proxy URL. */
902
- proxyUrl: (url?: string) => string | undefined;
903
- /**
904
- * The AUTHENTICATED backend proxy URL for a given sandbox port of THIS
905
- * session's runtime: `${backendUrl}/p/{externalId}/{port}` — no browser
906
- * preview-origin rewriting. This is the URL a local port-forward proxy
907
- * dials with the caller's own bearer token (see `getSandboxUrlForExternalId`).
908
- * Use `previewUrl()`/`proxyUrl()` instead for a browser tab.
909
- */
910
- sandboxPortUrl: (port: number) => string;
911
- /** Pick the model `send` will use for subsequent prompts (until changed). */
912
- setModel: (model: SessionModel | undefined) => void;
913
- /**
914
- * PERSIST a new model for this session server-side, re-pointing the
915
- * running sandbox. Distinct from `setModel`, which only chooses what the
916
- * NEXT local `send` asks for and never leaves this handle.
917
- *
918
- * Restarting the runtime is how the change takes effect, so an in-flight
919
- * turn ends. `applied_live` reports whether a running session took it now
920
- * or whether it applies at next start.
921
- */
922
- changeModel: (model: string) => Promise<P.SessionModelChangeResult>;
923
- /** Read the authoritative secret allowlist and connections. */
924
- scope: () => Promise<P.SessionScope>;
925
- providerSecretPool: {
926
- list: () => Promise<{
927
- pools: P.SessionProviderSecretPool[];
928
- can_edit: boolean;
818
+ commands: Array<{
819
+ name: string;
820
+ path: string;
821
+ description: string | null;
929
822
  }>;
930
- get: (providerId: string) => Promise<P.SessionProviderSecretPool>;
931
- set: (providerId: string, secretIds: string[] | null) => Promise<P.SessionProviderSecretPool>;
823
+ env: {
824
+ required: string[];
825
+ optional: string[];
826
+ };
932
827
  };
933
- /** Re-scope a running session — set semantics; see setProjectSessionScope. */
934
- rescope: (scope: P.SessionScopeInput) => Promise<P.SessionScope>;
935
- /** Pick the agent `send` will use for subsequent prompts (until changed). */
936
- setAgent: (agent: string | undefined) => void;
937
- /**
938
- * Provision/resume if needed, then put a text prompt in this session's
939
- * durable inbox (`POST .../prompts`), the path every other producer
940
- * uses. Resolves when the prompt is durable, not when the turn ends: the
941
- * reply arrives on `stream()` and in the transcript. A per-call
942
- * `{ model, agent }` overrides the sticky setModel/setAgent choices for
943
- * this message only.
944
- */
945
- send: (text: string, opts?: {
946
- model?: SessionModel;
947
- agent?: string;
948
- }) => Promise<P.CreateSessionPromptResult>;
949
- /** Abort the agent's current run in this session. */
950
- abort: () => Promise<({
951
- data: undefined;
952
- error: unknown;
953
- } | {
954
- data: boolean;
955
- error: undefined;
956
- }) & {
957
- request: Request;
958
- response: Response;
828
+ project: P.KortixProject;
829
+ git_connection?: P.ProjectGitConnection | null;
830
+ file_count: number;
831
+ files: P.ProjectFileEntry[];
832
+ }>;
833
+ audit: (options?: Parameters<typeof P.listProjectAudit>[1]) => Promise<P.AuditEventList>;
834
+ update: (input: Parameters<typeof P.updateProject>[1]) => Promise<P.KortixProject>;
835
+ archive: () => Promise<{
836
+ ok: boolean;
837
+ }>;
838
+ llmCatalog: () => Promise<P.ProjectLlmCatalogResponse>;
839
+ modelPicker: () => Promise<P.ProjectLlmCatalogResponse>;
840
+ modelAccess: () => Promise<P.ProjectModelAccess>;
841
+ setModelAccess: (change: P.ProjectModelAccessChange) => Promise<P.ProjectModelAccess>;
842
+ sandboxHealth: () => Promise<P.ProjectSandboxHealth>;
843
+ onboardingComplete: (completed: boolean) => Promise<P.KortixProject>;
844
+ };
845
+ session: (projectId: string, sessionId: string) => {
846
+ runtime: RuntimeClient;
847
+ messages: (options?: {
848
+ conversationId?: string;
849
+ limit?: number;
850
+ before?: string;
851
+ signal?: AbortSignal;
852
+ }) => Promise<import("../session/index.js").TranscriptPage>;
853
+ pending: () => Promise<import("../session/index.js").PendingInteractions>;
854
+ answerPermission: (requestId: string, reply: import("../../index.js").RuntimePermissionReply, message?: string) => Promise<void>;
855
+ answerQuestion: (requestId: string, answers: import("../../index.js").RuntimeQuestionAnswer[] | null) => Promise<void>;
856
+ compact: (model?: {
857
+ providerID: string;
858
+ modelID: string;
859
+ }) => Promise<{
860
+ providerID: string;
861
+ modelID: string;
862
+ }>;
863
+ files: {
864
+ list: (dirPath: string) => Promise<import("../../index.js").FileNode[]>;
865
+ read: (filePath: string) => Promise<import("../../index.js").FileContent>;
866
+ readBlob: (filePath: string) => Promise<Blob>;
867
+ status: () => Promise<import("../../index.js").GitFileStatus[]>;
868
+ findFiles: (query: string, options?: {
869
+ type?: "file" | "directory";
870
+ limit?: number;
871
+ }) => Promise<string[]>;
872
+ findText: (pattern: string) => Promise<import("../../index.js").FindMatch[]>;
873
+ upload: (file: File | Blob, targetPath?: string, filename?: string, options?: import("../../index.js").UploadFileOptions) => Promise<import("../../index.js").UploadResult[]>;
874
+ write: (filePath: string, content: Blob | File) => Promise<import("../../index.js").WriteFileResult>;
875
+ create: (filePath: string) => Promise<import("../../index.js").UploadResult[]>;
876
+ copy: (sourcePath: string, destPath: string) => Promise<import("../../index.js").UploadResult[]>;
877
+ remove: (filePath: string) => Promise<boolean>;
878
+ mkdir: (dirPath: string) => Promise<boolean>;
879
+ rename: (from: string, to: string) => Promise<boolean>;
880
+ };
881
+ abort: () => Promise<({
882
+ data: undefined;
883
+ error: unknown;
884
+ } | {
885
+ data: boolean;
886
+ error: undefined;
887
+ }) & {
888
+ request: Request;
889
+ response: Response;
890
+ }>;
891
+ rewind: (messageId: string) => Promise<({
892
+ data: undefined;
893
+ error: unknown;
894
+ } | {
895
+ data: import("../../index.js").Session;
896
+ error: undefined;
897
+ }) & {
898
+ request: Request;
899
+ response: Response;
900
+ }>;
901
+ restoreRewind: () => Promise<({
902
+ data: undefined;
903
+ error: unknown;
904
+ } | {
905
+ data: import("../../index.js").Session;
906
+ error: undefined;
907
+ }) & {
908
+ request: Request;
909
+ response: Response;
910
+ }>;
911
+ stream: (opts: {
912
+ onEvent: (event: import("../../index.js").RuntimeEvent) => void;
913
+ onGapRehydrate?: (gapMs: number) => void;
914
+ signal?: AbortSignal;
915
+ }) => Promise<import("../../index.js").EventStreamHandle>;
916
+ scope: () => Promise<P.SessionScope>;
917
+ providerSecretPool: {
918
+ list: () => Promise<{
919
+ pools: P.SessionProviderSecretPool[];
920
+ can_edit: boolean;
959
921
  }>;
960
- /**
961
- * Stage a reversible rollback at one user message on this same canonical
962
- * OpenCode session. The next prompt commits the new path.
963
- */
964
- rewind: (messageId: string) => Promise<({
965
- data: undefined;
966
- error: unknown;
967
- } | {
968
- data: import("../../index.js").Session;
969
- error: undefined;
970
- }) & {
971
- request: Request;
972
- response: Response;
922
+ get: (providerId: string) => Promise<P.SessionProviderSecretPool>;
923
+ set: (providerId: string, secretIds: string[] | null) => Promise<P.SessionProviderSecretPool>;
924
+ };
925
+ rescope: (scope: P.SessionScopeInput) => Promise<P.SessionScope>;
926
+ setAgent: (agent: string | undefined) => void;
927
+ send: (text: string, opts?: {
928
+ model?: import("./session-shared.js").SessionModel;
929
+ agent?: string;
930
+ }) => Promise<P.CreateSessionPromptResult>;
931
+ setModel: (model: import("./session-shared.js").SessionModel | undefined) => void;
932
+ changeModel: (model: string) => Promise<P.SessionModelChangeResult>;
933
+ health: (init?: RequestInit) => Promise<import("../session/index.js").SessionHealthResult>;
934
+ previewUrl: (port: number, path?: string) => string;
935
+ proxyUrl: (url?: string) => string | undefined;
936
+ sandboxPortUrl: (port: number) => string;
937
+ reminders: {
938
+ list: () => Promise<{
939
+ reminders: P.SessionReminder[];
973
940
  }>;
974
- /** Restore the path removed by `rewind()` before another prompt commits it. */
975
- restoreRewind: () => Promise<({
976
- data: undefined;
977
- error: unknown;
978
- } | {
979
- data: import("../../index.js").Session;
980
- error: undefined;
981
- }) & {
982
- request: Request;
983
- response: Response;
941
+ create: (input: Parameters<typeof P.createSessionReminder>[2]) => Promise<P.SessionReminder>;
942
+ update: (reminderId: string, input: Parameters<typeof P.updateSessionReminder>[3]) => Promise<P.SessionReminder>;
943
+ remove: (reminderId: string) => Promise<{
944
+ ok: boolean;
984
945
  }>;
985
- /**
986
- * Live SSE stream of THIS session's runtime events (message/part
987
- * updates, session status, permissions/questions, lsp diagnostics, …).
988
- * A thin facade over the framework-free `openEventStream` primitive
989
- * (`@kortix/sdk`'s `openEventStream`, also used verbatim by
990
- * `@kortix/sdk/react`'s `useRuntimeEventStream`): resolves THIS
991
- * handle's own runtime first (`ensureReady()`), then connects a client
992
- * bound to that runtime URL — never the module-global "active" one, so
993
- * two session handles on two different sandboxes never cross wires.
994
- * Framework-free — safe to call from a server-side "Kortix as a
995
- * Backend" wrapper (Node/Bun), a worker, a CLI, or any non-React host.
996
- *
997
- * Handles connect/reconnect/backoff, a 15s heartbeat watchdog, and
998
- * event coalescing internally. Call `handle.close()` to stop.
999
- *
1000
- * const handle = await session.stream({ onEvent: (e) => console.log(e) });
1001
- * // later
1002
- * handle.close();
1003
- */
1004
- stream: (opts: {
1005
- onEvent: (event: RuntimeEvent) => void;
1006
- onGapRehydrate?: (gapMs: number) => void;
1007
- signal?: AbortSignal;
1008
- }) => Promise<EventStreamHandle>;
1009
- /**
1010
- * A page of this session's messages, oldest first (`{ info, parts }`,
1011
- * `kortix.transcript.v1`): the root conversation, or `conversationId`
1012
- * (a subagent child). `before` pages backwards.
1013
- */
1014
- messages: (options?: {
1015
- conversationId?: string;
1016
- limit?: number;
1017
- before?: string;
1018
- signal?: AbortSignal;
1019
- }) => Promise<TranscriptPage>;
1020
- /** Conversation statuses, and the permission requests and questions waiting for an answer. */
1021
- pending: () => Promise<PendingInteractions>;
1022
- /** Answer a permission request: `once`, `always` (the capability, for this session) or `reject`. */
1023
- answerPermission: (requestId: string, reply: RuntimePermissionReply, message?: string) => Promise<void>;
1024
- /** Answer a question (one answer per question), or dismiss it with `null`. */
1025
- answerQuestion: (requestId: string, answers: RuntimeQuestionAnswer[] | null) => Promise<void>;
1026
- /**
1027
- * Summarize the conversation into a shorter context, with `model` or the
1028
- * runtime's default. Only a runtime with the `session.compact` capability
1029
- * supports it (see `health()`).
1030
- */
1031
- compact: (model?: {
1032
- providerID: string;
1033
- modelID: string;
1034
- }) => Promise<{
1035
- providerID: string;
1036
- modelID: string;
946
+ };
947
+ audit: (limit?: number, options?: Parameters<typeof P.getSessionAudit>[3]) => Promise<P.SessionAudit>;
948
+ attachments: {
949
+ upload: (file: File, options?: Parameters<typeof P.uploadSessionAttachment>[3]) => Promise<P.SessionAttachment>;
950
+ read: (attachmentId: string, signal?: AbortSignal) => Promise<Blob>;
951
+ };
952
+ transcript: (options?: Parameters<typeof P.getSessionTranscript>[2]) => Promise<P.SessionTranscript>;
953
+ messageAuthors: () => Promise<P.SessionMessageAuthors>;
954
+ transcriptSync: (options?: Parameters<typeof P.getSessionTranscriptSync>[2]) => Promise<P.SessionTranscriptSyncEnvelope>;
955
+ turn: () => Promise<P.SessionTurnStatus>;
956
+ prompts: {
957
+ create: (input: P.CreateSessionPromptInput) => Promise<P.CreateSessionPromptResult>;
958
+ list: () => Promise<{
959
+ prompts: P.SessionPrompt[];
960
+ observed_at?: string;
961
+ }>;
962
+ remove: (promptId: string) => Promise<P.RemovedSessionPrompt>;
963
+ retry: (promptId: string) => Promise<P.SessionPrompt>;
964
+ edit: (promptId: string, text: string) => Promise<P.SessionPrompt>;
965
+ hold: (held: boolean) => Promise<{
966
+ prompts: P.SessionPrompt[];
967
+ observed_at?: string;
1037
968
  }>;
1038
- /**
1039
- * The raw runtime REST client of THIS session's own sandbox.
1040
- * @deprecated Use the session verbs (`messages`, `pending`,
1041
- * `answerPermission`, `answerQuestion`, `compact`, `send`, `abort`,
1042
- * `rewind`). Removed in the next major.
1043
- */
1044
- readonly runtime: RuntimeClient;
1045
- /**
1046
- * Workspace file operations (daemon `/file` + `/find`) bound to THIS
1047
- * session's own resolved runtime — never the module-global "active"
1048
- * sandbox the top-level `@kortix/sdk` `files` export follows. Fixes a
1049
- * cross-session bleed: a host juggling multiple open sessions (e.g. a
1050
- * server wrapping several concurrent agent sessions) that called the
1051
- * global `files.list()` while a DIFFERENT session was "active" would
1052
- * silently read/write the wrong sandbox. Each call here auto-provisions
1053
- * via `ensureReady()` (same as `send`/`abort`/`stream`), then runs
1054
- * against this handle's own runtime URL. Same 12-op surface as the
1055
- * global `files` namespace, built from the same parameterized core
1056
- * (`@kortix/sdk/files`'s exports all take an optional trailing
1057
- * `baseUrl` — this just always supplies THIS session's).
1058
- */
1059
- files: {
1060
- list: (dirPath: string) => Promise<F.FileNode[]>;
1061
- read: (filePath: string) => Promise<F.FileContent>;
1062
- readBlob: (filePath: string) => Promise<Blob>;
1063
- status: () => Promise<F.GitFileStatus[]>;
1064
- findFiles: (query: string, options?: {
1065
- type?: "file" | "directory";
1066
- limit?: number;
1067
- }) => Promise<string[]>;
1068
- findText: (pattern: string) => Promise<F.FindMatch[]>;
1069
- upload: (file: File | Blob, targetPath?: string, filename?: string, options?: F.UploadFileOptions) => Promise<F.UploadResult[]>;
1070
- /**
1071
- * Overwrite `filePath` in place. The daemon's upload endpoint never
1072
- * overwrites (it uniquifies a colliding name), so a plain `upload` over
1073
- * an existing path silently writes a DIFFERENT file — see `writeFile`.
1074
- */
1075
- write: (filePath: string, content: Blob | File) => Promise<F.WriteFileResult>;
1076
- create: (filePath: string) => Promise<F.UploadResult[]>;
1077
- copy: (sourcePath: string, destPath: string) => Promise<F.UploadResult[]>;
1078
- remove: (filePath: string) => Promise<boolean>;
1079
- mkdir: (dirPath: string) => Promise<boolean>;
1080
- rename: (from: string, to: string) => Promise<boolean>;
1081
- };
1082
969
  };
1083
- };
1084
- session: (projectId: string, sessionId: string) => {
970
+ ensureReady: (opts?: {
971
+ readyTimeoutMs?: number;
972
+ }) => Promise<import("../../index.js").SessionRuntimeEntry>;
1085
973
  get: (opts?: {
1086
974
  showErrors?: boolean;
1087
975
  }) => Promise<P.ProjectSession>;
@@ -1091,7 +979,6 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
1091
979
  }) => Promise<import("../../index.js").ApiResponse<{
1092
980
  ok: boolean;
1093
981
  }>>;
1094
- /** Unified finalized LLM and compute cost for this session. */
1095
982
  cost: () => Promise<P.SessionCostDetail>;
1096
983
  update: (input: Parameters<typeof P.updateProjectSession>[2]) => Promise<P.ProjectSession>;
1097
984
  delete: () => Promise<{
@@ -1111,16 +998,8 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
1111
998
  session_id: string;
1112
999
  status: string;
1113
1000
  }>;
1114
- /** Is this session still running the config the manifest compiles to? */
1115
1001
  configState: () => Promise<P.SessionConfigState>;
1116
- /**
1117
- * Recompile the agent config from git into this running session.
1118
- *
1119
- * Restarts opencode to rebuild its config, so readiness has to be
1120
- * resolved again — same reason `restart` forgets it.
1121
- */
1122
1002
  reloadConfig: (input?: Parameters<typeof P.reloadProjectSessionConfig>[2]) => Promise<P.SessionReloadResult>;
1123
- /** Reload config with server-observed progress events. */
1124
1003
  reloadConfigStream: (input: {
1125
1004
  refresh_repo?: boolean;
1126
1005
  force?: boolean;
@@ -1129,6 +1008,7 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
1129
1008
  previews: () => Promise<{
1130
1009
  candidates: P.SessionPreviewCandidate[];
1131
1010
  }>;
1011
+ participants: () => Promise<P.SessionParticipants>;
1132
1012
  commit: (input?: Parameters<typeof P.commitSessionChanges>[2]) => Promise<P.CommitSessionResult>;
1133
1013
  publicShares: {
1134
1014
  list: () => Promise<{
@@ -1141,258 +1021,6 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
1141
1021
  share: P.SessionPublicShare;
1142
1022
  }>;
1143
1023
  };
1144
- /** Scheduled prompts into this session — see `CreateSessionReminderInput`. */
1145
- reminders: {
1146
- list: () => Promise<{
1147
- reminders: P.SessionReminder[];
1148
- }>;
1149
- create: (input: Parameters<typeof P.createSessionReminder>[2]) => Promise<P.SessionReminder>;
1150
- update: (reminderId: string, input: Parameters<typeof P.updateSessionReminder>[3]) => Promise<P.SessionReminder>;
1151
- remove: (reminderId: string) => Promise<{
1152
- ok: boolean;
1153
- }>;
1154
- };
1155
- /** Per-session audit trail of connector-gated agent actions. */
1156
- audit: (limit?: number, options?: Parameters<typeof P.getSessionAudit>[3]) => Promise<P.SessionAudit>;
1157
- attachments: {
1158
- upload: (file: File, options?: Parameters<typeof P.uploadSessionAttachment>[3]) => Promise<P.SessionAttachment>;
1159
- read: (attachmentId: string, signal?: AbortSignal) => Promise<Blob>;
1160
- };
1161
- /** Compact server-side transcript read (text + tool calls, no tool inputs/outputs) — callable with project-scoped session tokens. */
1162
- transcript: (options?: Parameters<typeof P.getSessionTranscript>[2]) => Promise<P.SessionTranscript>;
1163
- /** Who wrote each message: a member, or another session's agent. */
1164
- messageAuthors: () => Promise<P.SessionMessageAuthors>;
1165
- /** The DURABLE server-side transcript mirror, in sync-store shape
1166
- * (OpenCode message envelopes verbatim, attachment bytes and tool
1167
- * inputs/outputs stripped). This is the read that answers while the
1168
- * sandbox is stopped or still waking. */
1169
- transcriptSync: (options?: Parameters<typeof P.getSessionTranscriptSync>[2]) => Promise<P.SessionTranscriptSyncEnvelope>;
1170
- /** Which turns are running right now, and how did the last one end?
1171
- * Server truth from the control plane's lifecycle authority, independent
1172
- * of the live stream. */
1173
- turn: () => Promise<P.SessionTurnStatus>;
1174
- /** This session's SERVER-SIDE prompt inbox: the prompts it still owes the
1175
- * user. Durable, so it survives a closed tab and is the same list on
1176
- * every device. */
1177
- prompts: {
1178
- create: (input: P.CreateSessionPromptInput) => Promise<P.CreateSessionPromptResult>;
1179
- list: () => Promise<{
1180
- prompts: P.SessionPrompt[];
1181
- observed_at?: string;
1182
- }>;
1183
- remove: (promptId: string) => Promise<P.RemovedSessionPrompt>;
1184
- retry: (promptId: string) => Promise<P.SessionPrompt>;
1185
- /** Hold (or release) the whole queue — what the Stop button writes. */
1186
- hold: (held: boolean) => Promise<{
1187
- prompts: P.SessionPrompt[];
1188
- observed_at?: string;
1189
- }>;
1190
- };
1191
- /**
1192
- * Resolve THIS handle's own runtime (idempotent): provisions/resumes the
1193
- * sandbox (long-poll until ready) and caches the resolved OpenCode session
1194
- * id + runtime URL + sandbox id for every other call on this handle. Call
1195
- * this (or `send`/`abort`, which call it internally) before `.runtime`,
1196
- * `.health()`, `.previewUrl()`, or `.proxyUrl()` — those throw
1197
- * `SessionNotReadyError` instead of falling back to whatever sandbox
1198
- * happens to be globally active.
1199
- */
1200
- ensureReady: (opts?: {
1201
- readyTimeoutMs?: number;
1202
- }) => Promise<SessionRuntimeEntry>;
1203
- /**
1204
- * Liveness/readiness of THIS session's runtime (`GET /kortix/health`).
1205
- * Unlike `.previewUrl()`/`.proxyUrl()`/`.runtime`, this never throws
1206
- * `SessionNotReadyError` — a health poller (e.g. a header dot ticking
1207
- * every 15s on a fresh inline handle) needs to be callable BEFORE the
1208
- * session has ever resolved a runtime. It degrades to the same graceful
1209
- * `{ status: 0, ok: false }` shape `getSessionHealth` already returns for
1210
- * "no URL yet", instead of forcing every caller to guard with `ensureReady()`.
1211
- */
1212
- health: (init?: RequestInit) => Promise<import("../session/index.js").SessionHealthResult>;
1213
- /** Proxy/preview URL for a port THIS session's runtime exposes. */
1214
- previewUrl: (port: number, path?: string) => string;
1215
- /** Rewrite a localhost URL the agent printed into a reachable proxy URL. */
1216
- proxyUrl: (url?: string) => string | undefined;
1217
- /**
1218
- * The AUTHENTICATED backend proxy URL for a given sandbox port of THIS
1219
- * session's runtime: `${backendUrl}/p/{externalId}/{port}` — no browser
1220
- * preview-origin rewriting. This is the URL a local port-forward proxy
1221
- * dials with the caller's own bearer token (see `getSandboxUrlForExternalId`).
1222
- * Use `previewUrl()`/`proxyUrl()` instead for a browser tab.
1223
- */
1224
- sandboxPortUrl: (port: number) => string;
1225
- /** Pick the model `send` will use for subsequent prompts (until changed). */
1226
- setModel: (model: SessionModel | undefined) => void;
1227
- /**
1228
- * PERSIST a new model for this session server-side, re-pointing the
1229
- * running sandbox. Distinct from `setModel`, which only chooses what the
1230
- * NEXT local `send` asks for and never leaves this handle.
1231
- *
1232
- * Restarting the runtime is how the change takes effect, so an in-flight
1233
- * turn ends. `applied_live` reports whether a running session took it now
1234
- * or whether it applies at next start.
1235
- */
1236
- changeModel: (model: string) => Promise<P.SessionModelChangeResult>;
1237
- /** Read the authoritative secret allowlist and connections. */
1238
- scope: () => Promise<P.SessionScope>;
1239
- providerSecretPool: {
1240
- list: () => Promise<{
1241
- pools: P.SessionProviderSecretPool[];
1242
- can_edit: boolean;
1243
- }>;
1244
- get: (providerId: string) => Promise<P.SessionProviderSecretPool>;
1245
- set: (providerId: string, secretIds: string[] | null) => Promise<P.SessionProviderSecretPool>;
1246
- };
1247
- /** Re-scope a running session — set semantics; see setProjectSessionScope. */
1248
- rescope: (scope: P.SessionScopeInput) => Promise<P.SessionScope>;
1249
- /** Pick the agent `send` will use for subsequent prompts (until changed). */
1250
- setAgent: (agent: string | undefined) => void;
1251
- /**
1252
- * Provision/resume if needed, then put a text prompt in this session's
1253
- * durable inbox (`POST .../prompts`), the path every other producer
1254
- * uses. Resolves when the prompt is durable, not when the turn ends: the
1255
- * reply arrives on `stream()` and in the transcript. A per-call
1256
- * `{ model, agent }` overrides the sticky setModel/setAgent choices for
1257
- * this message only.
1258
- */
1259
- send: (text: string, opts?: {
1260
- model?: SessionModel;
1261
- agent?: string;
1262
- }) => Promise<P.CreateSessionPromptResult>;
1263
- /** Abort the agent's current run in this session. */
1264
- abort: () => Promise<({
1265
- data: undefined;
1266
- error: unknown;
1267
- } | {
1268
- data: boolean;
1269
- error: undefined;
1270
- }) & {
1271
- request: Request;
1272
- response: Response;
1273
- }>;
1274
- /**
1275
- * Stage a reversible rollback at one user message on this same canonical
1276
- * OpenCode session. The next prompt commits the new path.
1277
- */
1278
- rewind: (messageId: string) => Promise<({
1279
- data: undefined;
1280
- error: unknown;
1281
- } | {
1282
- data: import("../../index.js").Session;
1283
- error: undefined;
1284
- }) & {
1285
- request: Request;
1286
- response: Response;
1287
- }>;
1288
- /** Restore the path removed by `rewind()` before another prompt commits it. */
1289
- restoreRewind: () => Promise<({
1290
- data: undefined;
1291
- error: unknown;
1292
- } | {
1293
- data: import("../../index.js").Session;
1294
- error: undefined;
1295
- }) & {
1296
- request: Request;
1297
- response: Response;
1298
- }>;
1299
- /**
1300
- * Live SSE stream of THIS session's runtime events (message/part
1301
- * updates, session status, permissions/questions, lsp diagnostics, …).
1302
- * A thin facade over the framework-free `openEventStream` primitive
1303
- * (`@kortix/sdk`'s `openEventStream`, also used verbatim by
1304
- * `@kortix/sdk/react`'s `useRuntimeEventStream`): resolves THIS
1305
- * handle's own runtime first (`ensureReady()`), then connects a client
1306
- * bound to that runtime URL — never the module-global "active" one, so
1307
- * two session handles on two different sandboxes never cross wires.
1308
- * Framework-free — safe to call from a server-side "Kortix as a
1309
- * Backend" wrapper (Node/Bun), a worker, a CLI, or any non-React host.
1310
- *
1311
- * Handles connect/reconnect/backoff, a 15s heartbeat watchdog, and
1312
- * event coalescing internally. Call `handle.close()` to stop.
1313
- *
1314
- * const handle = await session.stream({ onEvent: (e) => console.log(e) });
1315
- * // later
1316
- * handle.close();
1317
- */
1318
- stream: (opts: {
1319
- onEvent: (event: RuntimeEvent) => void;
1320
- onGapRehydrate?: (gapMs: number) => void;
1321
- signal?: AbortSignal;
1322
- }) => Promise<EventStreamHandle>;
1323
- /**
1324
- * A page of this session's messages, oldest first (`{ info, parts }`,
1325
- * `kortix.transcript.v1`): the root conversation, or `conversationId`
1326
- * (a subagent child). `before` pages backwards.
1327
- */
1328
- messages: (options?: {
1329
- conversationId?: string;
1330
- limit?: number;
1331
- before?: string;
1332
- signal?: AbortSignal;
1333
- }) => Promise<TranscriptPage>;
1334
- /** Conversation statuses, and the permission requests and questions waiting for an answer. */
1335
- pending: () => Promise<PendingInteractions>;
1336
- /** Answer a permission request: `once`, `always` (the capability, for this session) or `reject`. */
1337
- answerPermission: (requestId: string, reply: RuntimePermissionReply, message?: string) => Promise<void>;
1338
- /** Answer a question (one answer per question), or dismiss it with `null`. */
1339
- answerQuestion: (requestId: string, answers: RuntimeQuestionAnswer[] | null) => Promise<void>;
1340
- /**
1341
- * Summarize the conversation into a shorter context, with `model` or the
1342
- * runtime's default. Only a runtime with the `session.compact` capability
1343
- * supports it (see `health()`).
1344
- */
1345
- compact: (model?: {
1346
- providerID: string;
1347
- modelID: string;
1348
- }) => Promise<{
1349
- providerID: string;
1350
- modelID: string;
1351
- }>;
1352
- /**
1353
- * The raw runtime REST client of THIS session's own sandbox.
1354
- * @deprecated Use the session verbs (`messages`, `pending`,
1355
- * `answerPermission`, `answerQuestion`, `compact`, `send`, `abort`,
1356
- * `rewind`). Removed in the next major.
1357
- */
1358
- readonly runtime: RuntimeClient;
1359
- /**
1360
- * Workspace file operations (daemon `/file` + `/find`) bound to THIS
1361
- * session's own resolved runtime — never the module-global "active"
1362
- * sandbox the top-level `@kortix/sdk` `files` export follows. Fixes a
1363
- * cross-session bleed: a host juggling multiple open sessions (e.g. a
1364
- * server wrapping several concurrent agent sessions) that called the
1365
- * global `files.list()` while a DIFFERENT session was "active" would
1366
- * silently read/write the wrong sandbox. Each call here auto-provisions
1367
- * via `ensureReady()` (same as `send`/`abort`/`stream`), then runs
1368
- * against this handle's own runtime URL. Same 12-op surface as the
1369
- * global `files` namespace, built from the same parameterized core
1370
- * (`@kortix/sdk/files`'s exports all take an optional trailing
1371
- * `baseUrl` — this just always supplies THIS session's).
1372
- */
1373
- files: {
1374
- list: (dirPath: string) => Promise<F.FileNode[]>;
1375
- read: (filePath: string) => Promise<F.FileContent>;
1376
- readBlob: (filePath: string) => Promise<Blob>;
1377
- status: () => Promise<F.GitFileStatus[]>;
1378
- findFiles: (query: string, options?: {
1379
- type?: "file" | "directory";
1380
- limit?: number;
1381
- }) => Promise<string[]>;
1382
- findText: (pattern: string) => Promise<F.FindMatch[]>;
1383
- upload: (file: File | Blob, targetPath?: string, filename?: string, options?: F.UploadFileOptions) => Promise<F.UploadResult[]>;
1384
- /**
1385
- * Overwrite `filePath` in place. The daemon's upload endpoint never
1386
- * overwrites (it uniquifies a colliding name), so a plain `upload` over
1387
- * an existing path silently writes a DIFFERENT file — see `writeFile`.
1388
- */
1389
- write: (filePath: string, content: Blob | File) => Promise<F.WriteFileResult>;
1390
- create: (filePath: string) => Promise<F.UploadResult[]>;
1391
- copy: (sourcePath: string, destPath: string) => Promise<F.UploadResult[]>;
1392
- remove: (filePath: string) => Promise<boolean>;
1393
- mkdir: (dirPath: string) => Promise<boolean>;
1394
- rename: (from: string, to: string) => Promise<boolean>;
1395
- };
1396
1024
  };
1397
1025
  /** GitHub App installation + repository linking (account-scoped). */
1398
1026
  github: {
@@ -1406,8 +1034,6 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
1406
1034
  linkInstallation: typeof P.linkGitHubInstallation;
1407
1035
  saveInstallation: typeof P.saveGitHubInstallation;
1408
1036
  deleteInstallation: typeof P.deleteGitHubInstallation;
1409
- /** Store this user's GitHub authorization — needed to create a repository
1410
- * in a personal GitHub account. */
1411
1037
  storeUserToken: typeof P.storeGitHubUserToken;
1412
1038
  };
1413
1039
  /** The instance git backend ("Kortix managed", deployment-scoped). */
@@ -1423,20 +1049,16 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
1423
1049
  transactionsSummary: typeof P.getBillingTransactionsSummary;
1424
1050
  creditBreakdown: typeof P.getBillingCreditBreakdown;
1425
1051
  usageHistory: typeof P.getBillingUsageHistory;
1426
- /** Usage rollup (/v1/usage), optionally grouped by model, provider, or day. */
1427
1052
  usageRollup: typeof P.getUsageRollup;
1428
- /** Unified finalized LLM and compute cost by session. */
1429
1053
  sessionCosts: {
1430
1054
  list: typeof P.listSessionCosts;
1431
1055
  get: typeof P.getSessionCostRecord;
1432
1056
  };
1433
1057
  tierConfigurations: typeof P.getBillingTierConfigurations;
1434
- /** Stripe checkout — start a subscription and confirm it post-redirect. */
1435
1058
  checkout: {
1436
1059
  createSession: (input: Parameters<typeof P.createCheckoutSession>[0]) => Promise<P.CheckoutSessionResult>;
1437
1060
  confirmSession: (sessionId: string, accountId?: string) => Promise<P.ConfirmCheckoutSessionResult>;
1438
1061
  };
1439
- /** Manage an existing subscription (portal, cancel/reactivate, downgrade). */
1440
1062
  subscription: {
1441
1063
  createPortalSession: (returnUrl: string, accountId?: string) => Promise<P.PortalSessionResult>;
1442
1064
  cancel: (feedback?: string, accountId?: string) => Promise<P.SubscriptionMutationResult>;
@@ -1445,7 +1067,6 @@ export declare function createKortix(config: KortixPlatformConfig, opts?: {
1445
1067
  cancelScheduledChange: (accountId?: string) => Promise<P.SubscriptionMutationResult>;
1446
1068
  prorationPreview: (newPriceId: string, accountId?: string) => Promise<P.ProrationPreviewResult>;
1447
1069
  };
1448
- /** One-off credit purchases + recurring auto-topup configuration. */
1449
1070
  credits: {
1450
1071
  purchase: (input: Parameters<typeof P.purchaseCredits>[0]) => Promise<P.PurchaseCreditsResult>;
1451
1072
  autoTopupSettings: (accountId?: string) => Promise<P.AutoTopupSettings>;
@@ -1485,6 +1106,4 @@ export type Kortix = ReturnType<typeof createKortix>;
1485
1106
  export type ProjectHandle = ReturnType<Kortix['project']>;
1486
1107
  /** The id-bound session handle returned by `kortix.session(pid, sid)`. */
1487
1108
  export type SessionHandle = ReturnType<Kortix['session']>;
1488
- type DropFirst<T extends unknown[]> = T extends [unknown, ...infer R] ? R : [];
1489
- export {};
1490
1109
  //# sourceMappingURL=kortix.d.ts.map