@kortix/sdk 0.9.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (618) hide show
  1. package/README.md +313 -0
  2. package/dist/files/client.d.ts +96 -0
  3. package/dist/files/client.d.ts.map +1 -0
  4. package/dist/files/client.js +346 -0
  5. package/dist/files/client.js.map +1 -0
  6. package/dist/files/types.d.ts +82 -0
  7. package/dist/files/types.d.ts.map +1 -0
  8. package/dist/files/types.js +6 -0
  9. package/dist/files/types.js.map +1 -0
  10. package/dist/index.d.ts +119 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +93 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/kortix.d.ts +897 -0
  15. package/dist/kortix.d.ts.map +1 -0
  16. package/dist/kortix.js +772 -0
  17. package/dist/kortix.js.map +1 -0
  18. package/dist/opencode/client.d.ts +89 -0
  19. package/dist/opencode/client.d.ts.map +1 -0
  20. package/dist/opencode/client.js +191 -0
  21. package/dist/opencode/client.js.map +1 -0
  22. package/dist/opencode/env.d.ts +13 -0
  23. package/dist/opencode/env.d.ts.map +1 -0
  24. package/dist/opencode/env.js +63 -0
  25. package/dist/opencode/env.js.map +1 -0
  26. package/dist/opencode/kortix-master.d.ts +487 -0
  27. package/dist/opencode/kortix-master.d.ts.map +1 -0
  28. package/dist/opencode/kortix-master.js +313 -0
  29. package/dist/opencode/kortix-master.js.map +1 -0
  30. package/dist/opencode/triggers.d.ts +6 -0
  31. package/dist/opencode/triggers.d.ts.map +1 -0
  32. package/dist/opencode/triggers.js +34 -0
  33. package/dist/opencode/triggers.js.map +1 -0
  34. package/dist/platform/api/errors.d.ts +106 -0
  35. package/dist/platform/api/errors.d.ts.map +1 -0
  36. package/dist/platform/api/errors.js +137 -0
  37. package/dist/platform/api/errors.js.map +1 -0
  38. package/dist/platform/api-client.d.ts +35 -0
  39. package/dist/platform/api-client.d.ts.map +1 -0
  40. package/dist/platform/api-client.js +279 -0
  41. package/dist/platform/api-client.js.map +1 -0
  42. package/dist/platform/auth-core.d.ts +60 -0
  43. package/dist/platform/auth-core.d.ts.map +1 -0
  44. package/dist/platform/auth-core.js +104 -0
  45. package/dist/platform/auth-core.js.map +1 -0
  46. package/dist/platform/auth.d.ts +88 -0
  47. package/dist/platform/auth.d.ts.map +1 -0
  48. package/dist/platform/auth.js +161 -0
  49. package/dist/platform/auth.js.map +1 -0
  50. package/dist/platform/config-node.d.ts +33 -0
  51. package/dist/platform/config-node.d.ts.map +1 -0
  52. package/dist/platform/config-node.js +63 -0
  53. package/dist/platform/config-node.js.map +1 -0
  54. package/dist/platform/config.d.ts +77 -0
  55. package/dist/platform/config.d.ts.map +1 -0
  56. package/dist/platform/config.js +62 -0
  57. package/dist/platform/config.js.map +1 -0
  58. package/dist/platform/feature-flags.d.ts +25 -0
  59. package/dist/platform/feature-flags.d.ts.map +1 -0
  60. package/dist/platform/feature-flags.js +114 -0
  61. package/dist/platform/feature-flags.js.map +1 -0
  62. package/dist/platform/fresh-sessions.d.ts +4 -0
  63. package/dist/platform/fresh-sessions.d.ts.map +1 -0
  64. package/dist/platform/fresh-sessions.js +22 -0
  65. package/dist/platform/fresh-sessions.js.map +1 -0
  66. package/dist/platform/instance-routes.d.ts +17 -0
  67. package/dist/platform/instance-routes.d.ts.map +1 -0
  68. package/dist/platform/instance-routes.js +105 -0
  69. package/dist/platform/instance-routes.js.map +1 -0
  70. package/dist/platform/logger.d.ts +20 -0
  71. package/dist/platform/logger.d.ts.map +1 -0
  72. package/dist/platform/logger.js +44 -0
  73. package/dist/platform/logger.js.map +1 -0
  74. package/dist/platform/opencode-errors.d.ts +20 -0
  75. package/dist/platform/opencode-errors.d.ts.map +1 -0
  76. package/dist/platform/opencode-errors.js +71 -0
  77. package/dist/platform/opencode-errors.js.map +1 -0
  78. package/dist/platform/platform-client/backups.d.ts +22 -0
  79. package/dist/platform/platform-client/backups.d.ts.map +1 -0
  80. package/dist/platform/platform-client/backups.js +16 -0
  81. package/dist/platform/platform-client/backups.js.map +1 -0
  82. package/dist/platform/platform-client/index.d.ts +21 -0
  83. package/dist/platform/platform-client/index.d.ts.map +1 -0
  84. package/dist/platform/platform-client/index.js +21 -0
  85. package/dist/platform/platform-client/index.js.map +1 -0
  86. package/dist/platform/platform-client/instance-admin.d.ts +67 -0
  87. package/dist/platform/platform-client/instance-admin.d.ts.map +1 -0
  88. package/dist/platform/platform-client/instance-admin.js +59 -0
  89. package/dist/platform/platform-client/instance-admin.js.map +1 -0
  90. package/dist/platform/platform-client/invites.d.ts +35 -0
  91. package/dist/platform/platform-client/invites.d.ts.map +1 -0
  92. package/dist/platform/platform-client/invites.js +25 -0
  93. package/dist/platform/platform-client/invites.js.map +1 -0
  94. package/dist/platform/platform-client/lifecycle.d.ts +78 -0
  95. package/dist/platform/platform-client/lifecycle.d.ts.map +1 -0
  96. package/dist/platform/platform-client/lifecycle.js +151 -0
  97. package/dist/platform/platform-client/lifecycle.js.map +1 -0
  98. package/dist/platform/platform-client/members.d.ts +81 -0
  99. package/dist/platform/platform-client/members.d.ts.map +1 -0
  100. package/dist/platform/platform-client/members.js +59 -0
  101. package/dist/platform/platform-client/members.js.map +1 -0
  102. package/dist/platform/platform-client/shared.d.ts +44 -0
  103. package/dist/platform/platform-client/shared.d.ts.map +1 -0
  104. package/dist/platform/platform-client/shared.js +177 -0
  105. package/dist/platform/platform-client/shared.js.map +1 -0
  106. package/dist/platform/platform-client/ssh.d.ts +29 -0
  107. package/dist/platform/platform-client/ssh.d.ts.map +1 -0
  108. package/dist/platform/platform-client/ssh.js +14 -0
  109. package/dist/platform/platform-client/ssh.js.map +1 -0
  110. package/dist/platform/platform-client/types.d.ts +56 -0
  111. package/dist/platform/platform-client/types.d.ts.map +1 -0
  112. package/dist/platform/platform-client/types.js +19 -0
  113. package/dist/platform/platform-client/types.js.map +1 -0
  114. package/dist/platform/platform-client/updates.d.ts +117 -0
  115. package/dist/platform/platform-client/updates.d.ts.map +1 -0
  116. package/dist/platform/platform-client/updates.js +97 -0
  117. package/dist/platform/platform-client/updates.js.map +1 -0
  118. package/dist/platform/platform-client/urls.d.ts +18 -0
  119. package/dist/platform/platform-client/urls.d.ts.map +1 -0
  120. package/dist/platform/platform-client/urls.js +31 -0
  121. package/dist/platform/platform-client/urls.js.map +1 -0
  122. package/dist/platform/projects-client/access.d.ts +273 -0
  123. package/dist/platform/projects-client/access.d.ts.map +1 -0
  124. package/dist/platform/projects-client/access.js +89 -0
  125. package/dist/platform/projects-client/access.js.map +1 -0
  126. package/dist/platform/projects-client/accounts.d.ts +184 -0
  127. package/dist/platform/projects-client/accounts.d.ts.map +1 -0
  128. package/dist/platform/projects-client/accounts.js +78 -0
  129. package/dist/platform/projects-client/accounts.js.map +1 -0
  130. package/dist/platform/projects-client/agent-config.d.ts +58 -0
  131. package/dist/platform/projects-client/agent-config.d.ts.map +1 -0
  132. package/dist/platform/projects-client/agent-config.js +9 -0
  133. package/dist/platform/projects-client/agent-config.js.map +1 -0
  134. package/dist/platform/projects-client/agent-scope.d.ts +12 -0
  135. package/dist/platform/projects-client/agent-scope.d.ts.map +1 -0
  136. package/dist/platform/projects-client/agent-scope.js +6 -0
  137. package/dist/platform/projects-client/agent-scope.js.map +1 -0
  138. package/dist/platform/projects-client/apps.d.ts +98 -0
  139. package/dist/platform/projects-client/apps.d.ts.map +1 -0
  140. package/dist/platform/projects-client/apps.js +29 -0
  141. package/dist/platform/projects-client/apps.js.map +1 -0
  142. package/dist/platform/projects-client/audit.d.ts +85 -0
  143. package/dist/platform/projects-client/audit.d.ts.map +1 -0
  144. package/dist/platform/projects-client/audit.js +51 -0
  145. package/dist/platform/projects-client/audit.js.map +1 -0
  146. package/dist/platform/projects-client/billing.d.ts +336 -0
  147. package/dist/platform/projects-client/billing.d.ts.map +1 -0
  148. package/dist/platform/projects-client/billing.js +260 -0
  149. package/dist/platform/projects-client/billing.js.map +1 -0
  150. package/dist/platform/projects-client/change-requests.d.ts +119 -0
  151. package/dist/platform/projects-client/change-requests.d.ts.map +1 -0
  152. package/dist/platform/projects-client/change-requests.js +56 -0
  153. package/dist/platform/projects-client/change-requests.js.map +1 -0
  154. package/dist/platform/projects-client/channels.d.ts +135 -0
  155. package/dist/platform/projects-client/channels.d.ts.map +1 -0
  156. package/dist/platform/projects-client/channels.js +103 -0
  157. package/dist/platform/projects-client/channels.js.map +1 -0
  158. package/dist/platform/projects-client/connectors.d.ts +148 -0
  159. package/dist/platform/projects-client/connectors.d.ts.map +1 -0
  160. package/dist/platform/projects-client/connectors.js +66 -0
  161. package/dist/platform/projects-client/connectors.js.map +1 -0
  162. package/dist/platform/projects-client/files.d.ts +37 -0
  163. package/dist/platform/projects-client/files.d.ts.map +1 -0
  164. package/dist/platform/projects-client/files.js +58 -0
  165. package/dist/platform/projects-client/files.js.map +1 -0
  166. package/dist/platform/projects-client/gateway.d.ts +177 -0
  167. package/dist/platform/projects-client/gateway.d.ts.map +1 -0
  168. package/dist/platform/projects-client/gateway.js +59 -0
  169. package/dist/platform/projects-client/gateway.js.map +1 -0
  170. package/dist/platform/projects-client/git-history.d.ts +74 -0
  171. package/dist/platform/projects-client/git-history.d.ts.map +1 -0
  172. package/dist/platform/projects-client/git-history.js +40 -0
  173. package/dist/platform/projects-client/git-history.js.map +1 -0
  174. package/dist/platform/projects-client/github.d.ts +62 -0
  175. package/dist/platform/projects-client/github.d.ts.map +1 -0
  176. package/dist/platform/projects-client/github.js +30 -0
  177. package/dist/platform/projects-client/github.js.map +1 -0
  178. package/dist/platform/projects-client/index.d.ts +32 -0
  179. package/dist/platform/projects-client/index.d.ts.map +1 -0
  180. package/dist/platform/projects-client/index.js +34 -0
  181. package/dist/platform/projects-client/index.js.map +1 -0
  182. package/dist/platform/projects-client/marketplace-catalog.d.ts +76 -0
  183. package/dist/platform/projects-client/marketplace-catalog.d.ts.map +1 -0
  184. package/dist/platform/projects-client/marketplace-catalog.js +48 -0
  185. package/dist/platform/projects-client/marketplace-catalog.js.map +1 -0
  186. package/dist/platform/projects-client/marketplace.d.ts +80 -0
  187. package/dist/platform/projects-client/marketplace.d.ts.map +1 -0
  188. package/dist/platform/projects-client/marketplace.js +52 -0
  189. package/dist/platform/projects-client/marketplace.js.map +1 -0
  190. package/dist/platform/projects-client/model-defaults.d.ts +36 -0
  191. package/dist/platform/projects-client/model-defaults.d.ts.map +1 -0
  192. package/dist/platform/projects-client/model-defaults.js +16 -0
  193. package/dist/platform/projects-client/model-defaults.js.map +1 -0
  194. package/dist/platform/projects-client/policies.d.ts +21 -0
  195. package/dist/platform/projects-client/policies.d.ts.map +1 -0
  196. package/dist/platform/projects-client/policies.js +10 -0
  197. package/dist/platform/projects-client/policies.js.map +1 -0
  198. package/dist/platform/projects-client/projects.d.ts +235 -0
  199. package/dist/platform/projects-client/projects.d.ts.map +1 -0
  200. package/dist/platform/projects-client/projects.js +161 -0
  201. package/dist/platform/projects-client/projects.js.map +1 -0
  202. package/dist/platform/projects-client/public-session-shares.d.ts +52 -0
  203. package/dist/platform/projects-client/public-session-shares.d.ts.map +1 -0
  204. package/dist/platform/projects-client/public-session-shares.js +54 -0
  205. package/dist/platform/projects-client/public-session-shares.js.map +1 -0
  206. package/dist/platform/projects-client/review.d.ts +57 -0
  207. package/dist/platform/projects-client/review.d.ts.map +1 -0
  208. package/dist/platform/projects-client/review.js +28 -0
  209. package/dist/platform/projects-client/review.js.map +1 -0
  210. package/dist/platform/projects-client/sandbox-shares.d.ts +25 -0
  211. package/dist/platform/projects-client/sandbox-shares.d.ts.map +1 -0
  212. package/dist/platform/projects-client/sandbox-shares.js +29 -0
  213. package/dist/platform/projects-client/sandbox-shares.js.map +1 -0
  214. package/dist/platform/projects-client/sandbox.d.ts +123 -0
  215. package/dist/platform/projects-client/sandbox.d.ts.map +1 -0
  216. package/dist/platform/projects-client/sandbox.js +45 -0
  217. package/dist/platform/projects-client/sandbox.js.map +1 -0
  218. package/dist/platform/projects-client/secrets.d.ts +122 -0
  219. package/dist/platform/projects-client/secrets.d.ts.map +1 -0
  220. package/dist/platform/projects-client/secrets.js +34 -0
  221. package/dist/platform/projects-client/secrets.js.map +1 -0
  222. package/dist/platform/projects-client/session-sandbox.d.ts +61 -0
  223. package/dist/platform/projects-client/session-sandbox.d.ts.map +1 -0
  224. package/dist/platform/projects-client/session-sandbox.js +82 -0
  225. package/dist/platform/projects-client/session-sandbox.js.map +1 -0
  226. package/dist/platform/projects-client/sessions.d.ts +216 -0
  227. package/dist/platform/projects-client/sessions.d.ts.map +1 -0
  228. package/dist/platform/projects-client/sessions.js +74 -0
  229. package/dist/platform/projects-client/sessions.js.map +1 -0
  230. package/dist/platform/projects-client/setup-links.d.ts +35 -0
  231. package/dist/platform/projects-client/setup-links.d.ts.map +1 -0
  232. package/dist/platform/projects-client/setup-links.js +24 -0
  233. package/dist/platform/projects-client/setup-links.js.map +1 -0
  234. package/dist/platform/projects-client/shared.d.ts +66 -0
  235. package/dist/platform/projects-client/shared.d.ts.map +1 -0
  236. package/dist/platform/projects-client/shared.js +44 -0
  237. package/dist/platform/projects-client/shared.js.map +1 -0
  238. package/dist/platform/projects-client/tokens.d.ts +77 -0
  239. package/dist/platform/projects-client/tokens.d.ts.map +1 -0
  240. package/dist/platform/projects-client/tokens.js +43 -0
  241. package/dist/platform/projects-client/tokens.js.map +1 -0
  242. package/dist/platform/projects-client/transcription.d.ts +5 -0
  243. package/dist/platform/projects-client/transcription.d.ts.map +1 -0
  244. package/dist/platform/projects-client/transcription.js +14 -0
  245. package/dist/platform/projects-client/transcription.js.map +1 -0
  246. package/dist/platform/projects-client/triggers.d.ts +102 -0
  247. package/dist/platform/projects-client/triggers.d.ts.map +1 -0
  248. package/dist/platform/projects-client/triggers.js +27 -0
  249. package/dist/platform/projects-client/triggers.js.map +1 -0
  250. package/dist/platform/session-id.d.ts +9 -0
  251. package/dist/platform/session-id.d.ts.map +1 -0
  252. package/dist/platform/session-id.js +23 -0
  253. package/dist/platform/session-id.js.map +1 -0
  254. package/dist/platform/storage/managed-storage.d.ts +97 -0
  255. package/dist/platform/storage/managed-storage.d.ts.map +1 -0
  256. package/dist/platform/storage/managed-storage.js +271 -0
  257. package/dist/platform/storage/managed-storage.js.map +1 -0
  258. package/dist/platform/strings.d.ts +12 -0
  259. package/dist/platform/strings.d.ts.map +1 -0
  260. package/dist/platform/strings.js +17 -0
  261. package/dist/platform/strings.js.map +1 -0
  262. package/dist/platform/ui.d.ts +11 -0
  263. package/dist/platform/ui.d.ts.map +1 -0
  264. package/dist/platform/ui.js +22 -0
  265. package/dist/platform/ui.js.map +1 -0
  266. package/dist/react/chat/index.d.ts +3 -0
  267. package/dist/react/chat/index.d.ts.map +1 -0
  268. package/dist/react/chat/index.js +7 -0
  269. package/dist/react/chat/index.js.map +1 -0
  270. package/dist/react/chat/render-parts.d.ts +39 -0
  271. package/dist/react/chat/render-parts.d.ts.map +1 -0
  272. package/dist/react/chat/render-parts.js +34 -0
  273. package/dist/react/chat/render-parts.js.map +1 -0
  274. package/dist/react/chat/use-chat-turns.d.ts +19 -0
  275. package/dist/react/chat/use-chat-turns.d.ts.map +1 -0
  276. package/dist/react/chat/use-chat-turns.js +27 -0
  277. package/dist/react/chat/use-chat-turns.js.map +1 -0
  278. package/dist/react/file-keys.d.ts +18 -0
  279. package/dist/react/file-keys.d.ts.map +1 -0
  280. package/dist/react/file-keys.js +18 -0
  281. package/dist/react/file-keys.js.map +1 -0
  282. package/dist/react/index.d.ts +12 -0
  283. package/dist/react/index.d.ts.map +1 -0
  284. package/dist/react/index.js +49 -0
  285. package/dist/react/index.js.map +1 -0
  286. package/dist/react/model-flatten.d.ts +33 -0
  287. package/dist/react/model-flatten.d.ts.map +1 -0
  288. package/dist/react/model-flatten.js +59 -0
  289. package/dist/react/model-flatten.js.map +1 -0
  290. package/dist/react/opencode.d.ts +43 -0
  291. package/dist/react/opencode.d.ts.map +1 -0
  292. package/dist/react/opencode.js +100 -0
  293. package/dist/react/opencode.js.map +1 -0
  294. package/dist/react/prefetch-session-start.d.ts +10 -0
  295. package/dist/react/prefetch-session-start.d.ts.map +1 -0
  296. package/dist/react/prefetch-session-start.js +17 -0
  297. package/dist/react/prefetch-session-start.js.map +1 -0
  298. package/dist/react/provider-refresh.d.ts +7 -0
  299. package/dist/react/provider-refresh.d.ts.map +1 -0
  300. package/dist/react/provider-refresh.js +28 -0
  301. package/dist/react/provider-refresh.js.map +1 -0
  302. package/dist/react/provider-selection.d.ts +31 -0
  303. package/dist/react/provider-selection.d.ts.map +1 -0
  304. package/dist/react/provider-selection.js +135 -0
  305. package/dist/react/provider-selection.js.map +1 -0
  306. package/dist/react/route-project.d.ts +7 -0
  307. package/dist/react/route-project.d.ts.map +1 -0
  308. package/dist/react/route-project.js +19 -0
  309. package/dist/react/route-project.js.map +1 -0
  310. package/dist/react/session-start-stash.d.ts +56 -0
  311. package/dist/react/session-start-stash.d.ts.map +1 -0
  312. package/dist/react/session-start-stash.js +202 -0
  313. package/dist/react/session-start-stash.js.map +1 -0
  314. package/dist/react/use-canonical-opencode-session.d.ts +35 -0
  315. package/dist/react/use-canonical-opencode-session.d.ts.map +1 -0
  316. package/dist/react/use-canonical-opencode-session.js +52 -0
  317. package/dist/react/use-canonical-opencode-session.js.map +1 -0
  318. package/dist/react/use-change-requests.d.ts +321 -0
  319. package/dist/react/use-change-requests.d.ts.map +1 -0
  320. package/dist/react/use-change-requests.js +43 -0
  321. package/dist/react/use-change-requests.js.map +1 -0
  322. package/dist/react/use-current-runtime.d.ts +8 -0
  323. package/dist/react/use-current-runtime.d.ts.map +1 -0
  324. package/dist/react/use-current-runtime.js +12 -0
  325. package/dist/react/use-current-runtime.js.map +1 -0
  326. package/dist/react/use-gateway-catalog-sync.d.ts +2 -0
  327. package/dist/react/use-gateway-catalog-sync.d.ts.map +1 -0
  328. package/dist/react/use-gateway-catalog-sync.js +39 -0
  329. package/dist/react/use-gateway-catalog-sync.js.map +1 -0
  330. package/dist/react/use-kortix-master.d.ts +384 -0
  331. package/dist/react/use-kortix-master.d.ts.map +1 -0
  332. package/dist/react/use-kortix-master.js +958 -0
  333. package/dist/react/use-kortix-master.js.map +1 -0
  334. package/dist/react/use-model-store.d.ts +71 -0
  335. package/dist/react/use-model-store.d.ts.map +1 -0
  336. package/dist/react/use-model-store.js +411 -0
  337. package/dist/react/use-model-store.js.map +1 -0
  338. package/dist/react/use-opencode-config.d.ts +15 -0
  339. package/dist/react/use-opencode-config.d.ts.map +1 -0
  340. package/dist/react/use-opencode-config.js +79 -0
  341. package/dist/react/use-opencode-config.js.map +1 -0
  342. package/dist/react/use-opencode-events/diagnostics.d.ts +11 -0
  343. package/dist/react/use-opencode-events/diagnostics.d.ts.map +1 -0
  344. package/dist/react/use-opencode-events/diagnostics.js +58 -0
  345. package/dist/react/use-opencode-events/diagnostics.js.map +1 -0
  346. package/dist/react/use-opencode-events/handle-event.d.ts +20 -0
  347. package/dist/react/use-opencode-events/handle-event.d.ts.map +1 -0
  348. package/dist/react/use-opencode-events/handle-event.js +450 -0
  349. package/dist/react/use-opencode-events/handle-event.js.map +1 -0
  350. package/dist/react/use-opencode-events/helpers.d.ts +30 -0
  351. package/dist/react/use-opencode-events/helpers.d.ts.map +1 -0
  352. package/dist/react/use-opencode-events/helpers.js +93 -0
  353. package/dist/react/use-opencode-events/helpers.js.map +1 -0
  354. package/dist/react/use-opencode-events/index.d.ts +25 -0
  355. package/dist/react/use-opencode-events/index.d.ts.map +1 -0
  356. package/dist/react/use-opencode-events/index.js +242 -0
  357. package/dist/react/use-opencode-events/index.js.map +1 -0
  358. package/dist/react/use-opencode-events/types.d.ts +10 -0
  359. package/dist/react/use-opencode-events/types.d.ts.map +1 -0
  360. package/dist/react/use-opencode-events/types.js +2 -0
  361. package/dist/react/use-opencode-events/types.js.map +1 -0
  362. package/dist/react/use-opencode-events/use-event-stream-refs.d.ts +22 -0
  363. package/dist/react/use-opencode-events/use-event-stream-refs.d.ts.map +1 -0
  364. package/dist/react/use-opencode-events/use-event-stream-refs.js +158 -0
  365. package/dist/react/use-opencode-events/use-event-stream-refs.js.map +1 -0
  366. package/dist/react/use-opencode-local.d.ts +139 -0
  367. package/dist/react/use-opencode-local.d.ts.map +1 -0
  368. package/dist/react/use-opencode-local.js +484 -0
  369. package/dist/react/use-opencode-local.js.map +1 -0
  370. package/dist/react/use-opencode-mcp.d.ts +34 -0
  371. package/dist/react/use-opencode-mcp.d.ts.map +1 -0
  372. package/dist/react/use-opencode-mcp.js +190 -0
  373. package/dist/react/use-opencode-mcp.js.map +1 -0
  374. package/dist/react/use-opencode-pty.d.ts +30 -0
  375. package/dist/react/use-opencode-pty.d.ts.map +1 -0
  376. package/dist/react/use-opencode-pty.js +126 -0
  377. package/dist/react/use-opencode-pty.js.map +1 -0
  378. package/dist/react/use-opencode-sessions/agents.d.ts +14 -0
  379. package/dist/react/use-opencode-sessions/agents.d.ts.map +1 -0
  380. package/dist/react/use-opencode-sessions/agents.js +82 -0
  381. package/dist/react/use-opencode-sessions/agents.js.map +1 -0
  382. package/dist/react/use-opencode-sessions/commands.d.ts +8 -0
  383. package/dist/react/use-opencode-sessions/commands.d.ts.map +1 -0
  384. package/dist/react/use-opencode-sessions/commands.js +46 -0
  385. package/dist/react/use-opencode-sessions/commands.js.map +1 -0
  386. package/dist/react/use-opencode-sessions/files.d.ts +2 -0
  387. package/dist/react/use-opencode-sessions/files.d.ts.map +1 -0
  388. package/dist/react/use-opencode-sessions/files.js +181 -0
  389. package/dist/react/use-opencode-sessions/files.js.map +1 -0
  390. package/dist/react/use-opencode-sessions/index.d.ts +15 -0
  391. package/dist/react/use-opencode-sessions/index.d.ts.map +1 -0
  392. package/dist/react/use-opencode-sessions/index.js +21 -0
  393. package/dist/react/use-opencode-sessions/index.js.map +1 -0
  394. package/dist/react/use-opencode-sessions/keys.d.ts +94 -0
  395. package/dist/react/use-opencode-sessions/keys.d.ts.map +1 -0
  396. package/dist/react/use-opencode-sessions/keys.js +39 -0
  397. package/dist/react/use-opencode-sessions/keys.js.map +1 -0
  398. package/dist/react/use-opencode-sessions/mcp.d.ts +3 -0
  399. package/dist/react/use-opencode-sessions/mcp.d.ts.map +1 -0
  400. package/dist/react/use-opencode-sessions/mcp.js +23 -0
  401. package/dist/react/use-opencode-sessions/mcp.js.map +1 -0
  402. package/dist/react/use-opencode-sessions/messages.d.ts +75 -0
  403. package/dist/react/use-opencode-sessions/messages.d.ts.map +1 -0
  404. package/dist/react/use-opencode-sessions/messages.js +319 -0
  405. package/dist/react/use-opencode-sessions/messages.js.map +1 -0
  406. package/dist/react/use-opencode-sessions/parts.d.ts +23 -0
  407. package/dist/react/use-opencode-sessions/parts.d.ts.map +1 -0
  408. package/dist/react/use-opencode-sessions/parts.js +49 -0
  409. package/dist/react/use-opencode-sessions/parts.js.map +1 -0
  410. package/dist/react/use-opencode-sessions/permissions.d.ts +17 -0
  411. package/dist/react/use-opencode-sessions/permissions.d.ts.map +1 -0
  412. package/dist/react/use-opencode-sessions/permissions.js +66 -0
  413. package/dist/react/use-opencode-sessions/permissions.js.map +1 -0
  414. package/dist/react/use-opencode-sessions/projects.d.ts +5 -0
  415. package/dist/react/use-opencode-sessions/projects.d.ts.map +1 -0
  416. package/dist/react/use-opencode-sessions/projects.js +54 -0
  417. package/dist/react/use-opencode-sessions/projects.js.map +1 -0
  418. package/dist/react/use-opencode-sessions/providers.d.ts +10 -0
  419. package/dist/react/use-opencode-sessions/providers.d.ts.map +1 -0
  420. package/dist/react/use-opencode-sessions/providers.js +98 -0
  421. package/dist/react/use-opencode-sessions/providers.js.map +1 -0
  422. package/dist/react/use-opencode-sessions/sessions.d.ts +35 -0
  423. package/dist/react/use-opencode-sessions/sessions.d.ts.map +1 -0
  424. package/dist/react/use-opencode-sessions/sessions.js +380 -0
  425. package/dist/react/use-opencode-sessions/sessions.js.map +1 -0
  426. package/dist/react/use-opencode-sessions/shared.d.ts +43 -0
  427. package/dist/react/use-opencode-sessions/shared.d.ts.map +1 -0
  428. package/dist/react/use-opencode-sessions/shared.js +109 -0
  429. package/dist/react/use-opencode-sessions/shared.js.map +1 -0
  430. package/dist/react/use-opencode-sessions/sharing.d.ts +4 -0
  431. package/dist/react/use-opencode-sessions/sharing.d.ts.map +1 -0
  432. package/dist/react/use-opencode-sessions/sharing.js +57 -0
  433. package/dist/react/use-opencode-sessions/sharing.js.map +1 -0
  434. package/dist/react/use-opencode-sessions/tools.d.ts +5 -0
  435. package/dist/react/use-opencode-sessions/tools.d.ts.map +1 -0
  436. package/dist/react/use-opencode-sessions/tools.js +54 -0
  437. package/dist/react/use-opencode-sessions/tools.js.map +1 -0
  438. package/dist/react/use-permission-self-heal.d.ts +45 -0
  439. package/dist/react/use-permission-self-heal.d.ts.map +1 -0
  440. package/dist/react/use-permission-self-heal.js +144 -0
  441. package/dist/react/use-permission-self-heal.js.map +1 -0
  442. package/dist/react/use-project-config.d.ts +11 -0
  443. package/dist/react/use-project-config.d.ts.map +1 -0
  444. package/dist/react/use-project-config.js +22 -0
  445. package/dist/react/use-project-config.js.map +1 -0
  446. package/dist/react/use-project-models.d.ts +11 -0
  447. package/dist/react/use-project-models.d.ts.map +1 -0
  448. package/dist/react/use-project-models.js +25 -0
  449. package/dist/react/use-project-models.js.map +1 -0
  450. package/dist/react/use-project-secrets.d.ts +265 -0
  451. package/dist/react/use-project-secrets.d.ts.map +1 -0
  452. package/dist/react/use-project-secrets.js +41 -0
  453. package/dist/react/use-project-secrets.js.map +1 -0
  454. package/dist/react/use-project-triggers.d.ts +228 -0
  455. package/dist/react/use-project-triggers.d.ts.map +1 -0
  456. package/dist/react/use-project-triggers.js +42 -0
  457. package/dist/react/use-project-triggers.js.map +1 -0
  458. package/dist/react/use-question-self-heal.d.ts +36 -0
  459. package/dist/react/use-question-self-heal.d.ts.map +1 -0
  460. package/dist/react/use-question-self-heal.js +95 -0
  461. package/dist/react/use-question-self-heal.js.map +1 -0
  462. package/dist/react/use-runtime-phase.d.ts +9 -0
  463. package/dist/react/use-runtime-phase.d.ts.map +1 -0
  464. package/dist/react/use-runtime-phase.js +20 -0
  465. package/dist/react/use-runtime-phase.js.map +1 -0
  466. package/dist/react/use-runtime-reconnect.d.ts +90 -0
  467. package/dist/react/use-runtime-reconnect.d.ts.map +1 -0
  468. package/dist/react/use-runtime-reconnect.js +234 -0
  469. package/dist/react/use-runtime-reconnect.js.map +1 -0
  470. package/dist/react/use-session-picks.d.ts +17 -0
  471. package/dist/react/use-session-picks.d.ts.map +1 -0
  472. package/dist/react/use-session-picks.js +36 -0
  473. package/dist/react/use-session-picks.js.map +1 -0
  474. package/dist/react/use-session-prefetch.d.ts +18 -0
  475. package/dist/react/use-session-prefetch.d.ts.map +1 -0
  476. package/dist/react/use-session-prefetch.js +84 -0
  477. package/dist/react/use-session-prefetch.js.map +1 -0
  478. package/dist/react/use-session-send.d.ts +183 -0
  479. package/dist/react/use-session-send.d.ts.map +1 -0
  480. package/dist/react/use-session-send.js +287 -0
  481. package/dist/react/use-session-send.js.map +1 -0
  482. package/dist/react/use-session-sync.d.ts +24 -0
  483. package/dist/react/use-session-sync.d.ts.map +1 -0
  484. package/dist/react/use-session-sync.js +375 -0
  485. package/dist/react/use-session-sync.js.map +1 -0
  486. package/dist/react/use-session.d.ts +171 -0
  487. package/dist/react/use-session.d.ts.map +1 -0
  488. package/dist/react/use-session.js +396 -0
  489. package/dist/react/use-session.js.map +1 -0
  490. package/dist/react/use-visible-agents.d.ts +22 -0
  491. package/dist/react/use-visible-agents.d.ts.map +1 -0
  492. package/dist/react/use-visible-agents.js +45 -0
  493. package/dist/react/use-visible-agents.js.map +1 -0
  494. package/dist/server.d.ts +55 -0
  495. package/dist/server.d.ts.map +1 -0
  496. package/dist/server.js +122 -0
  497. package/dist/server.js.map +1 -0
  498. package/dist/session/health.d.ts +49 -0
  499. package/dist/session/health.d.ts.map +1 -0
  500. package/dist/session/health.js +57 -0
  501. package/dist/session/health.js.map +1 -0
  502. package/dist/session/index.d.ts +19 -0
  503. package/dist/session/index.d.ts.map +1 -0
  504. package/dist/session/index.js +19 -0
  505. package/dist/session/index.js.map +1 -0
  506. package/dist/session/preview.d.ts +24 -0
  507. package/dist/session/preview.d.ts.map +1 -0
  508. package/dist/session/preview.js +85 -0
  509. package/dist/session/preview.js.map +1 -0
  510. package/dist/session/url.d.ts +160 -0
  511. package/dist/session/url.d.ts.map +1 -0
  512. package/dist/session/url.js +522 -0
  513. package/dist/session/url.js.map +1 -0
  514. package/dist/state/chat-events.d.ts +141 -0
  515. package/dist/state/chat-events.d.ts.map +1 -0
  516. package/dist/state/chat-events.js +135 -0
  517. package/dist/state/chat-events.js.map +1 -0
  518. package/dist/state/current-runtime.d.ts +44 -0
  519. package/dist/state/current-runtime.d.ts.map +1 -0
  520. package/dist/state/current-runtime.js +44 -0
  521. package/dist/state/current-runtime.js.map +1 -0
  522. package/dist/state/diagnostics-store.d.ts +114 -0
  523. package/dist/state/diagnostics-store.d.ts.map +1 -0
  524. package/dist/state/diagnostics-store.js +319 -0
  525. package/dist/state/diagnostics-store.js.map +1 -0
  526. package/dist/state/event-stream.d.ts +134 -0
  527. package/dist/state/event-stream.d.ts.map +1 -0
  528. package/dist/state/event-stream.js +424 -0
  529. package/dist/state/event-stream.js.map +1 -0
  530. package/dist/state/idb-sync-cache.d.ts +18 -0
  531. package/dist/state/idb-sync-cache.d.ts.map +1 -0
  532. package/dist/state/idb-sync-cache.js +209 -0
  533. package/dist/state/idb-sync-cache.js.map +1 -0
  534. package/dist/state/opencode-compaction-store.d.ts +10 -0
  535. package/dist/state/opencode-compaction-store.d.ts.map +1 -0
  536. package/dist/state/opencode-compaction-store.js +32 -0
  537. package/dist/state/opencode-compaction-store.js.map +1 -0
  538. package/dist/state/opencode-pending-store.d.ts +19 -0
  539. package/dist/state/opencode-pending-store.d.ts.map +1 -0
  540. package/dist/state/opencode-pending-store.js +76 -0
  541. package/dist/state/opencode-pending-store.js.map +1 -0
  542. package/dist/state/sandbox-connection-store.d.ts +62 -0
  543. package/dist/state/sandbox-connection-store.d.ts.map +1 -0
  544. package/dist/state/sandbox-connection-store.js +290 -0
  545. package/dist/state/sandbox-connection-store.js.map +1 -0
  546. package/dist/state/server-store/active.d.ts +49 -0
  547. package/dist/state/server-store/active.d.ts.map +1 -0
  548. package/dist/state/server-store/active.js +76 -0
  549. package/dist/state/server-store/active.js.map +1 -0
  550. package/dist/state/server-store/types.d.ts +12 -0
  551. package/dist/state/server-store/types.d.ts.map +1 -0
  552. package/dist/state/server-store/types.js +2 -0
  553. package/dist/state/server-store/types.js.map +1 -0
  554. package/dist/state/server-store/url-helpers.d.ts +33 -0
  555. package/dist/state/server-store/url-helpers.d.ts.map +1 -0
  556. package/dist/state/server-store/url-helpers.js +55 -0
  557. package/dist/state/server-store/url-helpers.js.map +1 -0
  558. package/dist/state/server-store.d.ts +18 -0
  559. package/dist/state/server-store.d.ts.map +1 -0
  560. package/dist/state/server-store.js +23 -0
  561. package/dist/state/server-store.js.map +1 -0
  562. package/dist/state/session-runtime-registry.d.ts +49 -0
  563. package/dist/state/session-runtime-registry.d.ts.map +1 -0
  564. package/dist/state/session-runtime-registry.js +85 -0
  565. package/dist/state/session-runtime-registry.js.map +1 -0
  566. package/dist/state/sync-store/ascending-id.d.ts +2 -0
  567. package/dist/state/sync-store/ascending-id.d.ts.map +1 -0
  568. package/dist/state/sync-store/ascending-id.js +21 -0
  569. package/dist/state/sync-store/ascending-id.js.map +1 -0
  570. package/dist/state/sync-store/binary.d.ts +7 -0
  571. package/dist/state/sync-store/binary.d.ts.map +1 -0
  572. package/dist/state/sync-store/binary.js +21 -0
  573. package/dist/state/sync-store/binary.js.map +1 -0
  574. package/dist/state/sync-store/stream-cache.d.ts +2 -0
  575. package/dist/state/sync-store/stream-cache.d.ts.map +1 -0
  576. package/dist/state/sync-store/stream-cache.js +29 -0
  577. package/dist/state/sync-store/stream-cache.js.map +1 -0
  578. package/dist/state/sync-store/types.d.ts +29 -0
  579. package/dist/state/sync-store/types.d.ts.map +1 -0
  580. package/dist/state/sync-store/types.js +2 -0
  581. package/dist/state/sync-store/types.js.map +1 -0
  582. package/dist/state/sync-store.d.ts +39 -0
  583. package/dist/state/sync-store.d.ts.map +1 -0
  584. package/dist/state/sync-store.js +692 -0
  585. package/dist/state/sync-store.js.map +1 -0
  586. package/dist/state/tab-store.d.ts +91 -0
  587. package/dist/state/tab-store.d.ts.map +1 -0
  588. package/dist/state/tab-store.js +369 -0
  589. package/dist/state/tab-store.js.map +1 -0
  590. package/dist/transcript.d.ts +40 -0
  591. package/dist/transcript.d.ts.map +1 -0
  592. package/dist/transcript.js +126 -0
  593. package/dist/transcript.js.map +1 -0
  594. package/dist/turns/classify.d.ts +166 -0
  595. package/dist/turns/classify.d.ts.map +1 -0
  596. package/dist/turns/classify.js +259 -0
  597. package/dist/turns/classify.js.map +1 -0
  598. package/dist/turns/errors.d.ts +11 -0
  599. package/dist/turns/errors.d.ts.map +1 -0
  600. package/dist/turns/errors.js +85 -0
  601. package/dist/turns/errors.js.map +1 -0
  602. package/dist/turns/index.d.ts +264 -0
  603. package/dist/turns/index.d.ts.map +1 -0
  604. package/dist/turns/index.js +1243 -0
  605. package/dist/turns/index.js.map +1 -0
  606. package/dist/turns/tool-registry.d.ts +33 -0
  607. package/dist/turns/tool-registry.d.ts.map +1 -0
  608. package/dist/turns/tool-registry.js +108 -0
  609. package/dist/turns/tool-registry.js.map +1 -0
  610. package/dist/turns/types.d.ts +125 -0
  611. package/dist/turns/types.d.ts.map +1 -0
  612. package/dist/turns/types.js +12 -0
  613. package/dist/turns/types.js.map +1 -0
  614. package/dist/turns/view-model.d.ts +127 -0
  615. package/dist/turns/view-model.d.ts.map +1 -0
  616. package/dist/turns/view-model.js +401 -0
  617. package/dist/turns/view-model.js.map +1 -0
  618. package/package.json +155 -0
@@ -0,0 +1,22 @@
1
+ import { platformConfig } from './config.js';
2
+ /**
3
+ * UI side-effect sink. The SDK fires these during event handling; the host wires
4
+ * them to its real toast / OS-notification surfaces via `configureKortix`. No
5
+ * UI components live in the SDK — these just forward to injected callbacks.
6
+ */
7
+ export function infoToast(message, options) {
8
+ platformConfig().onToast?.('info', message, options);
9
+ }
10
+ export function notifyTaskComplete(sessionId, sessionTitle) {
11
+ platformConfig().onNotify?.({ kind: 'task-complete', sessionId, sessionTitle });
12
+ }
13
+ export function notifySessionError(sessionId, errorTitle, sessionTitle) {
14
+ platformConfig().onNotify?.({ kind: 'session-error', sessionId, errorTitle, sessionTitle });
15
+ }
16
+ export function notifyQuestion(sessionId, questionText, sessionTitle) {
17
+ platformConfig().onNotify?.({ kind: 'question', sessionId, questionText, sessionTitle });
18
+ }
19
+ export function notifyPermissionRequest(sessionId, toolName, sessionTitle) {
20
+ platformConfig().onNotify?.({ kind: 'permission', sessionId, toolName, sessionTitle });
21
+ }
22
+ //# sourceMappingURL=ui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/platform/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;GAIG;AAEH,MAAM,UAAU,SAAS,CAAC,OAAe,EAAE,OAAiB;IAC1D,cAAc,EAAE,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,SAAiB,EAAE,YAAqB;IACzE,cAAc,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,SAAiB,EACjB,UAAkB,EAClB,YAAqB;IAErB,cAAc,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAC;AAC9F,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,SAAiB,EACjB,YAAoB,EACpB,YAAqB;IAErB,cAAc,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC;AAC3F,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,SAAiB,EACjB,QAAgB,EAChB,YAAqB;IAErB,cAAc,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC;AACzF,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { useChatTurns, type TurnView } from './use-chat-turns.js';
2
+ export { renderParts, type PartRenderers } from './render-parts.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/chat/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ // Headless chat bindings — `classifyTurn`/`classifyPart`-driven view models
3
+ // for building custom chat UIs on top of `@kortix/sdk`. Re-exported from the
4
+ // main `@kortix/sdk/react` barrel; no separate subpath needed.
5
+ export { useChatTurns } from './use-chat-turns.js';
6
+ export { renderParts } from './render-parts.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/chat/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,4EAA4E;AAC5E,6EAA6E;AAC7E,+DAA+D;AAC/D,OAAO,EAAE,YAAY,EAAiB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAsB,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Generic, compile-time-exhaustive part -> T dispatcher.
3
+ *
4
+ * No React import — `T` is typically `ReactNode`, but this file stays
5
+ * framework-free (same reasoning as `classifyPart` itself) so a host isn't
6
+ * forced through React to use it. It lives under `react/chat/` because that's
7
+ * where the rest of the chat-rendering surface is, not because it needs React.
8
+ *
9
+ * `PartRenderers<T>` requires a renderer for every `ClassifiedPart['kind']`
10
+ * (an optional `fallback` covers `'unknown'`-only handling, or lets a host
11
+ * opt out of exhaustiveness during a migration) — TypeScript itself enforces
12
+ * that a host's switch-equivalent covers every part kind, closing the
13
+ * "silently drops subtask/patch/snapshot/agent/retry/compaction" bug class at
14
+ * the CALL site the same way `classifyPart` closes it at the classification
15
+ * site.
16
+ */
17
+ import type { ClassifiedPart } from '../../turns/index.js';
18
+ type PartOfKind<K extends ClassifiedPart['kind']> = Extract<ClassifiedPart, {
19
+ kind: K;
20
+ }>;
21
+ export type PartRenderers<T> = {
22
+ [K in ClassifiedPart['kind']]: (part: PartOfKind<K>) => T;
23
+ } & {
24
+ /** Escape hatch: if provided, used instead of throwing for any kind whose
25
+ * dedicated renderer is missing (only reachable if a caller constructs a
26
+ * `PartRenderers<T>` with `Partial<...>` and casts — the type normally
27
+ * requires every kind). */
28
+ fallback?: (part: ClassifiedPart) => T;
29
+ };
30
+ /**
31
+ * Render every classified part with its matching renderer, in order.
32
+ * Throws if a part's kind has no renderer AND no `fallback` was given —
33
+ * this should be unreachable given `PartRenderers<T>`'s type (every kind is
34
+ * required), so hitting it means the renderers object was built unsafely
35
+ * (e.g. via `as PartRenderers<T>`).
36
+ */
37
+ export declare function renderParts<T>(parts: ClassifiedPart[], renderers: PartRenderers<T>): T[];
38
+ export {};
39
+ //# sourceMappingURL=render-parts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-parts.d.ts","sourceRoot":"","sources":["../../../src/react/chat/render-parts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,KAAK,UAAU,CAAC,CAAC,SAAS,cAAc,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAEzF,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;KAC5B,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;CAC1D,GAAG;IACF;;;gCAG4B;IAC5B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAOxF"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Generic, compile-time-exhaustive part -> T dispatcher.
3
+ *
4
+ * No React import — `T` is typically `ReactNode`, but this file stays
5
+ * framework-free (same reasoning as `classifyPart` itself) so a host isn't
6
+ * forced through React to use it. It lives under `react/chat/` because that's
7
+ * where the rest of the chat-rendering surface is, not because it needs React.
8
+ *
9
+ * `PartRenderers<T>` requires a renderer for every `ClassifiedPart['kind']`
10
+ * (an optional `fallback` covers `'unknown'`-only handling, or lets a host
11
+ * opt out of exhaustiveness during a migration) — TypeScript itself enforces
12
+ * that a host's switch-equivalent covers every part kind, closing the
13
+ * "silently drops subtask/patch/snapshot/agent/retry/compaction" bug class at
14
+ * the CALL site the same way `classifyPart` closes it at the classification
15
+ * site.
16
+ */
17
+ /**
18
+ * Render every classified part with its matching renderer, in order.
19
+ * Throws if a part's kind has no renderer AND no `fallback` was given —
20
+ * this should be unreachable given `PartRenderers<T>`'s type (every kind is
21
+ * required), so hitting it means the renderers object was built unsafely
22
+ * (e.g. via `as PartRenderers<T>`).
23
+ */
24
+ export function renderParts(parts, renderers) {
25
+ return parts.map((part) => {
26
+ const renderer = renderers[part.kind];
27
+ if (renderer)
28
+ return renderer(part);
29
+ if (renderers.fallback)
30
+ return renderers.fallback(part);
31
+ throw new Error(`renderParts: no renderer registered for part kind "${part.kind}"`);
32
+ });
33
+ }
34
+ //# sourceMappingURL=render-parts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-parts.js","sourceRoot":"","sources":["../../../src/react/chat/render-parts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAgBH;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAI,KAAuB,EAAE,SAA2B;IACjF,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAA2C,CAAC;QAChF,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,SAAS,CAAC,QAAQ;YAAE,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,sDAAsD,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { ClassifiedPart, TurnError } from '../../turns/index.js';
2
+ import type { MessageWithParts } from '../use-opencode-sessions/index.js';
3
+ export interface TurnView {
4
+ /** The original message this view was classified from — kept around so a
5
+ * host can still read `message.info.role`, `.id`, etc. without a second
6
+ * lookup. */
7
+ message: MessageWithParts;
8
+ parts: ClassifiedPart[];
9
+ error?: TurnError;
10
+ isEmpty: boolean;
11
+ }
12
+ /**
13
+ * Classify every message in a session's message list into a `TurnView`.
14
+ * One `TurnView` per message (NOT per user/assistant turn-group — pair with
15
+ * `groupMessagesIntoTurns` from `@kortix/sdk/turns` first if a host wants
16
+ * grouped turns instead of a flat per-message list).
17
+ */
18
+ export declare function useChatTurns(messages: MessageWithParts[]): TurnView[];
19
+ //# sourceMappingURL=use-chat-turns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-chat-turns.d.ts","sourceRoot":"","sources":["../../../src/react/chat/use-chat-turns.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,MAAM,WAAW,QAAQ;IACvB;;kBAEc;IACd,OAAO,EAAE,gBAAgB,CAAC;IAC1B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,QAAQ,EAAE,CASrE"}
@@ -0,0 +1,27 @@
1
+ 'use client';
2
+ /**
3
+ * Headless React binding over `classifyTurn` (`@kortix/sdk/turns`) — the
4
+ * memoized, ready-to-render view model for a session's message list.
5
+ *
6
+ * Deliberately dumb: it holds no state of its own and renders nothing. A host
7
+ * passes it the same `messages` array `useSession()` returns; it hands back
8
+ * one `TurnView` per message, recomputed only when the `messages` reference
9
+ * changes (React Query / the sync store already give a stable reference
10
+ * between renders when nothing changed, so this is cheap in the steady
11
+ * state).
12
+ */
13
+ import { useMemo } from 'react';
14
+ import { classifyTurn } from '../../turns/index.js';
15
+ /**
16
+ * Classify every message in a session's message list into a `TurnView`.
17
+ * One `TurnView` per message (NOT per user/assistant turn-group — pair with
18
+ * `groupMessagesIntoTurns` from `@kortix/sdk/turns` first if a host wants
19
+ * grouped turns instead of a flat per-message list).
20
+ */
21
+ export function useChatTurns(messages) {
22
+ return useMemo(() => messages.map((message) => {
23
+ const { parts, error, isEmpty } = classifyTurn(message);
24
+ return { message, parts, error, isEmpty };
25
+ }), [messages]);
26
+ }
27
+ //# sourceMappingURL=use-chat-turns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-chat-turns.js","sourceRoot":"","sources":["../../../src/react/chat/use-chat-turns.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAa3C;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,QAA4B;IACvD,OAAO,OAAO,CACZ,GAAG,EAAE,CACH,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACvB,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;QACxD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAC5C,CAAC,CAAC,EACJ,CAAC,QAAQ,CAAC,CACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * React Query key factories for the workspace file/git caches. They live in the
3
+ * SDK so the live event stream can invalidate them when files change; the
4
+ * actual file-fetching hooks stay in the host app and import these keys.
5
+ */
6
+ export declare const fileContentKeys: {
7
+ all: readonly ["opencode-files", "content"];
8
+ file: (serverUrl: string, filePath: string) => readonly ["opencode-files", "content", string, string];
9
+ };
10
+ export declare const fileListKeys: {
11
+ all: readonly ["opencode-files", "list"];
12
+ dir: (serverUrl: string, dirPath: string) => readonly ["opencode-files", "list", string, string];
13
+ };
14
+ export declare const gitStatusKeys: {
15
+ all: readonly ["opencode-files", "git-status"];
16
+ status: (serverUrl: string) => readonly ["opencode-files", "git-status", string];
17
+ };
18
+ //# sourceMappingURL=file-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-keys.d.ts","sourceRoot":"","sources":["../../src/react/file-keys.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,eAAe;;sBAER,MAAM,YAAY,MAAM;CAE3C,CAAC;AAEF,eAAO,MAAM,YAAY;;qBAEN,MAAM,WAAW,MAAM;CAEzC,CAAC;AAEF,eAAO,MAAM,aAAa;;wBAEJ,MAAM;CAC3B,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * React Query key factories for the workspace file/git caches. They live in the
3
+ * SDK so the live event stream can invalidate them when files change; the
4
+ * actual file-fetching hooks stay in the host app and import these keys.
5
+ */
6
+ export const fileContentKeys = {
7
+ all: ['opencode-files', 'content'],
8
+ file: (serverUrl, filePath) => ['opencode-files', 'content', serverUrl, filePath],
9
+ };
10
+ export const fileListKeys = {
11
+ all: ['opencode-files', 'list'],
12
+ dir: (serverUrl, dirPath) => ['opencode-files', 'list', serverUrl, dirPath],
13
+ };
14
+ export const gitStatusKeys = {
15
+ all: ['opencode-files', 'git-status'],
16
+ status: (serverUrl) => ['opencode-files', 'git-status', serverUrl],
17
+ };
18
+ //# sourceMappingURL=file-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-keys.js","sourceRoot":"","sources":["../../src/react/file-keys.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAU;IAC3C,IAAI,EAAE,CAAC,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAC5C,CAAC,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAU;CAC9D,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,GAAG,EAAE,CAAC,gBAAgB,EAAE,MAAM,CAAU;IACxC,GAAG,EAAE,CAAC,SAAiB,EAAE,OAAe,EAAE,EAAE,CAC1C,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAU;CAC1D,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,CAAC,gBAAgB,EAAE,YAAY,CAAU;IAC9C,MAAM,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAC,gBAAgB,EAAE,YAAY,EAAE,SAAS,CAAU;CACpF,CAAC"}
@@ -0,0 +1,12 @@
1
+ export * from './opencode.js';
2
+ export { answerQuestion, answerPermission, rejectQuestion, classifySendError, type KortixSendError, type KortixSendErrorKind, type SendState, } from './use-session.js';
3
+ export { BillingError, RequestTooLargeError, parseBillingError, isBillingError, formatBillingErrorForUI, type BillingErrorUI, } from '../platform/api/errors.js';
4
+ export { forkDraftKey, writeForkDraft, readForkDraft, clearForkDraft, } from './session-start-stash.js';
5
+ export { openEventStream, type EventStreamClient, type EventStreamHandle, type EventStreamTimers, type OpenCodeEvent, type OpenEventStreamOptions, } from '../state/event-stream.js';
6
+ export * from './use-kortix-master.js';
7
+ export { useSessionSend, beginOptimisticSend, abandonOptimisticSend, recoverFromSendFailure, sendAndRecover, applyOptimisticAbort, replayStartStash, type OpenCodeMessagesClient, type SendRecoveryOptions, type SendAndRecoverArgs, type SendAndRecoverResult, type StashReplayTimerHandle, type StashReplayTimers, type PreparedStashSend, type StartStashReplayOptions, type StartStashReplayHandle, type UseSessionSendOptions, type SendCallOptions, type UseSessionSendResult, } from './use-session-send.js';
8
+ export { useChatTurns, type TurnView, renderParts, type PartRenderers } from './chat/index.js';
9
+ export { useProjectSecrets, projectSecretsKey } from './use-project-secrets.js';
10
+ export { useProjectTriggers, projectTriggersKey } from './use-project-triggers.js';
11
+ export { useChangeRequests, changeRequestsKey } from './use-change-requests.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAKA,cAAc,YAAY,CAAC;AAI3B,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,SAAS,GACf,MAAM,eAAe,CAAC;AAKvB,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,KAAK,cAAc,GACpB,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,cAAc,GACf,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EACL,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,sBAAsB,GAC5B,MAAM,uBAAuB,CAAC;AAO/B,cAAc,qBAAqB,CAAC;AAMpC,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EAAE,YAAY,EAAE,KAAK,QAAQ,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAOtF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,49 @@
1
+ 'use client';
2
+ // @kortix/sdk/react — the complete OpenCode React hook surface, relocated
3
+ // verbatim from apps/web (every useOpenCode* hook, query-key factory, provider,
4
+ // and type). This is the single source of truth the web UI binds to.
5
+ export * from './opencode.js';
6
+ // `useSession`'s reply/error-classification surface — not (yet) re-exported by
7
+ // `./opencode`'s explicit barrel list, so re-exported directly here.
8
+ export { answerQuestion, answerPermission, rejectQuestion, classifySendError, } from './use-session.js';
9
+ // The billing/API error classes + helpers, relocated from apps/web's
10
+ // `lib/api/errors.ts` (byte-for-byte duplicate of `platform/api/errors.ts`) —
11
+ // hosts import the one SDK copy instead of keeping a parallel fork in sync.
12
+ export { BillingError, RequestTooLargeError, parseBillingError, isBillingError, formatBillingErrorForUI, } from '../platform/api/errors.js';
13
+ // Fork-draft stash — see `session-start-stash.ts` for the full contract. Not
14
+ // (yet) re-exported by `./opencode`'s explicit barrel list, so re-exported
15
+ // directly here (same reasoning as the start-stash exports it lives beside).
16
+ export { forkDraftKey, writeForkDraft, readForkDraft, clearForkDraft, } from './session-start-stash.js';
17
+ // The framework-free SSE event-stream primitive that `useOpenCodeEventStream`
18
+ // (exported above via `./opencode`) wraps. Re-exported here too so a host
19
+ // already importing from `@kortix/sdk/react` can build its own binding
20
+ // (e.g. a non-QueryClient consumer) without a second import from
21
+ // `@kortix/sdk/event-stream`.
22
+ export { openEventStream, } from '../state/event-stream.js';
23
+ // The kortix-master React Query layer (tasks/tickets/projects/milestones/
24
+ // credentials/sandbox-services) relocated from apps/web's six
25
+ // `apps/web/src/hooks/{kortix/*,use-sandbox-services}.ts` files — see
26
+ // `use-kortix-master.ts` for the full contract, including the injectable
27
+ // `KortixMasterIdentity` seam that replaces web's direct `useAuth()` calls.
28
+ export * from './use-kortix-master.js';
29
+ // The send / stash-replay / error-recovery core extracted from apps/web's
30
+ // `session-chat.tsx` — see `use-session-send.ts` for the full contract. Not
31
+ // (yet) re-exported by `./opencode`'s explicit barrel list, so re-exported
32
+ // directly here (same reasoning as the other direct re-exports above).
33
+ export { useSessionSend, beginOptimisticSend, abandonOptimisticSend, recoverFromSendFailure, sendAndRecover, applyOptimisticAbort, replayStartStash, } from './use-session-send.js';
34
+ // The headless chat kit — `useChatTurns` (memoized `classifyTurn` over a
35
+ // message list) + `renderParts` (compile-time-exhaustive part -> T
36
+ // dispatcher). Framework-free classification lives in `@kortix/sdk/turns`;
37
+ // this is the thin React binding over it. Kept inside the `react` barrel
38
+ // rather than a new `@kortix/sdk/react/chat` subpath — no package.json
39
+ // exports-map change needed to reach it.
40
+ export { useChatTurns, renderParts } from './chat/index.js';
41
+ // Domain hooks — thin React Query bindings over `projects-client` CRUD
42
+ // surfaces (secrets, triggers, change requests) that previously had no
43
+ // SDK-owned hook (only the client fn). Each owns its own query key + the
44
+ // mutations a settings/workbench screen actually needs, with invalidation
45
+ // wired so writes reflect without a manual refetch.
46
+ export { useProjectSecrets, projectSecretsKey } from './use-project-secrets.js';
47
+ export { useProjectTriggers, projectTriggersKey } from './use-project-triggers.js';
48
+ export { useChangeRequests, changeRequestsKey } from './use-change-requests.js';
49
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,0EAA0E;AAC1E,gFAAgF;AAChF,qEAAqE;AACrE,cAAc,YAAY,CAAC;AAE3B,+EAA+E;AAC/E,qEAAqE;AACrE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,GAIlB,MAAM,eAAe,CAAC;AAEvB,qEAAqE;AACrE,8EAA8E;AAC9E,4EAA4E;AAC5E,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,uBAAuB,GAExB,MAAM,wBAAwB,CAAC;AAEhC,6EAA6E;AAC7E,2EAA2E;AAC3E,6EAA6E;AAC7E,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,cAAc,GACf,MAAM,uBAAuB,CAAC;AAE/B,8EAA8E;AAC9E,0EAA0E;AAC1E,uEAAuE;AACvE,iEAAiE;AACjE,8BAA8B;AAC9B,OAAO,EACL,eAAe,GAMhB,MAAM,uBAAuB,CAAC;AAE/B,0EAA0E;AAC1E,8DAA8D;AAC9D,sEAAsE;AACtE,yEAAyE;AACzE,4EAA4E;AAC5E,cAAc,qBAAqB,CAAC;AAEpC,0EAA0E;AAC1E,4EAA4E;AAC5E,2EAA2E;AAC3E,uEAAuE;AACvE,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,GAajB,MAAM,oBAAoB,CAAC;AAE5B,yEAAyE;AACzE,mEAAmE;AACnE,2EAA2E;AAC3E,yEAAyE;AACzE,uEAAuE;AACvE,yCAAyC;AACzC,OAAO,EAAE,YAAY,EAAiB,WAAW,EAAsB,MAAM,QAAQ,CAAC;AAEtF,uEAAuE;AACvE,uEAAuE;AACvE,yEAAyE;AACzE,0EAA0E;AAC1E,oDAAoD;AACpD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { type ProviderListResponse } from './use-opencode-sessions/index.js';
2
+ /**
3
+ * Flat model list + the flattening logic (relocated from web's session-chat-input —
4
+ * it's data, not UI). Used by the model/agent resolution hooks.
5
+ */
6
+ export interface FlatModel {
7
+ providerID: string;
8
+ providerName: string;
9
+ modelID: string;
10
+ modelName: string;
11
+ variants?: Record<string, Record<string, unknown>>;
12
+ /** Capabilities extracted from the provider API response */
13
+ capabilities?: {
14
+ reasoning?: boolean;
15
+ vision?: boolean;
16
+ toolcall?: boolean;
17
+ };
18
+ /** Context window size in tokens */
19
+ contextWindow?: number;
20
+ /** ISO date string for release date */
21
+ releaseDate?: string;
22
+ /** Model family (used for "latest" logic) */
23
+ family?: string;
24
+ /** Cost per token (input/output) */
25
+ cost?: {
26
+ input: number;
27
+ output: number;
28
+ };
29
+ /** Provider source (env, api, config, custom) */
30
+ providerSource?: string;
31
+ }
32
+ export declare function flattenModels(providers: ProviderListResponse | undefined): FlatModel[];
33
+ //# sourceMappingURL=model-flatten.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-flatten.d.ts","sourceRoot":"","sources":["../../src/react/model-flatten.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,KAAK,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AA6B1F;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,4DAA4D;IAC5D,YAAY,CAAC,EAAE;QACb,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;IACF,oCAAoC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,IAAI,CAAC,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,iDAAiD;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,oBAAoB,GAAG,SAAS,GAAG,SAAS,EAAE,CAiDtF"}
@@ -0,0 +1,59 @@
1
+ import { GATEWAY_PROVIDER_IDS } from './use-opencode-sessions/index.js';
2
+ function hasCapabilities(model) {
3
+ return 'capabilities' in model && model.capabilities != null;
4
+ }
5
+ export function flattenModels(providers) {
6
+ if (!providers)
7
+ return [];
8
+ const all = Array.isArray(providers.all) ? providers.all : [];
9
+ const connected = Array.isArray(providers.connected) ? providers.connected : [];
10
+ const result = [];
11
+ for (const p of all) {
12
+ if (!connected.includes(p.id))
13
+ continue;
14
+ // Defense in depth: the provider list is already source-filtered to the
15
+ // gateway, but never render a native (bypass) provider even if one slips in.
16
+ if (!GATEWAY_PROVIDER_IDS.has(p.id))
17
+ continue;
18
+ for (const [modelID, model] of Object.entries(p.models)) {
19
+ // Narrow `model` itself (not a copy) so the loose-shape-only fields
20
+ // (`reasoning`, `tool_call`, `modalities`) are safe to read below.
21
+ let capabilities;
22
+ if (hasCapabilities(model)) {
23
+ const caps = model.capabilities;
24
+ capabilities = {
25
+ reasoning: caps.reasoning ?? false,
26
+ vision: caps.input?.image ?? false,
27
+ toolcall: caps.toolcall ?? false,
28
+ };
29
+ }
30
+ else {
31
+ capabilities = {
32
+ reasoning: model.reasoning ?? false,
33
+ vision: model.modalities?.input?.includes('image') ?? false,
34
+ toolcall: model.tool_call ?? false,
35
+ };
36
+ }
37
+ result.push({
38
+ providerID: p.id,
39
+ providerName: p.name,
40
+ modelID,
41
+ modelName: (model.name || modelID).replace('(latest)', '').trim(),
42
+ variants: model.variants,
43
+ capabilities,
44
+ contextWindow: model.limit?.context,
45
+ releaseDate: model.release_date,
46
+ family: model.family,
47
+ cost: model.cost
48
+ ? {
49
+ input: model.cost.input ?? 0,
50
+ output: model.cost.output ?? 0,
51
+ }
52
+ : undefined,
53
+ providerSource: p.source,
54
+ });
55
+ }
56
+ }
57
+ return result;
58
+ }
59
+ //# sourceMappingURL=model-flatten.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-flatten.js","sourceRoot":"","sources":["../../src/react/model-flatten.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAA6B,MAAM,yBAAyB,CAAC;AAyB1F,SAAS,eAAe,CAAC,KAAiB;IACxC,OAAO,cAAc,IAAI,KAAK,IAAI,KAAK,CAAC,YAAY,IAAI,IAAI,CAAC;AAC/D,CAAC;AAiCD,MAAM,UAAU,aAAa,CAAC,SAA2C;IACvE,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAC1B,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9D,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IAChF,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,KAAK,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;YAAE,SAAS;QACxC,wEAAwE;QACxE,6EAA6E;QAC7E,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YAAE,SAAS;QAC9C,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAgC,EAAE,CAAC;YACvF,oEAAoE;YACpE,mEAAmE;YACnE,IAAI,YAAuC,CAAC;YAC5C,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC3B,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC;gBAChC,YAAY,GAAG;oBACb,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,KAAK;oBAClC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,IAAI,KAAK;oBAClC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,KAAK;iBACjC,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,YAAY,GAAG;oBACb,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,KAAK;oBACnC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK;oBAC3D,QAAQ,EAAE,KAAK,CAAC,SAAS,IAAI,KAAK;iBACnC,CAAC;YACJ,CAAC;YACD,MAAM,CAAC,IAAI,CAAC;gBACV,UAAU,EAAE,CAAC,CAAC,EAAE;gBAChB,YAAY,EAAE,CAAC,CAAC,IAAI;gBACpB,OAAO;gBACP,SAAS,EAAE,CAAC,KAAK,CAAC,IAAI,IAAI,OAAO,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;gBACjE,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,YAAY;gBACZ,aAAa,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO;gBACnC,WAAW,EAAE,KAAK,CAAC,YAAY;gBAC/B,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;oBACd,CAAC,CAAC;wBACE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;wBAC5B,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC;qBAC/B;oBACH,CAAC,CAAC,SAAS;gBACb,cAAc,EAAE,CAAC,CAAC,MAAM;aACzB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @kortix/sdk/react — OpenCode React hook surface.
3
+ *
4
+ * Barrel re-exporting EVERY hook, query-key factory, provider, and type from
5
+ * the ported `use-opencode-*` / `use-*` hook modules. The web UI imports these
6
+ * by exact name + return shape, so this file is the public contract — keep it
7
+ * exhaustive and in parity with the source hooks.
8
+ *
9
+ * The 4 cross-module duplicates (`McpStatus`, `useOpenCodeMcpStatus`,
10
+ * `ModelKey`, `useVisibleAgents`) are same-symbol re-exports (the secondary
11
+ * module re-exports the primary's binding), so the overlapping `export *`
12
+ * statements resolve to a single declaration with no ambiguity.
13
+ */
14
+ export { KortixProjectProvider, useKortixRouteProjectId } from './route-project.js';
15
+ export * from './use-opencode-sessions/index.js';
16
+ export * from './use-opencode-events/index.js';
17
+ export * from './use-opencode-local.js';
18
+ export * from './use-opencode-mcp.js';
19
+ export * from './use-opencode-pty.js';
20
+ export * from './use-opencode-config.js';
21
+ export * from './use-model-store.js';
22
+ export * from './use-session-sync.js';
23
+ export * from './use-runtime-reconnect.js';
24
+ export { useOpenCodePendingStore } from '../state/opencode-pending-store.js';
25
+ export { useSandboxConnectionStore, type SandboxConnectionStatus, } from '../state/sandbox-connection-store.js';
26
+ export * from './use-session-prefetch.js';
27
+ export { prefetchSessionStart } from './prefetch-session-start.js';
28
+ export * from './use-canonical-opencode-session.js';
29
+ export * from './use-gateway-catalog-sync.js';
30
+ export * from './use-visible-agents.js';
31
+ export * from './provider-refresh.js';
32
+ export { flattenModels, type FlatModel } from './model-flatten.js';
33
+ export { projectLlmCatalogToProviderList } from './provider-selection.js';
34
+ export { useProjectModels } from './use-project-models.js';
35
+ export { useProjectConfig } from './use-project-config.js';
36
+ export type { ProjectConfigSummary } from '../platform/projects-client/index.js';
37
+ export { useSession, type SessionPhase, type UseSessionResult, type UseSessionOptions, } from './use-session.js';
38
+ export { useSessionPicks, type SessionPicks } from './use-session-picks.js';
39
+ export { useRuntimePhase, type RuntimePhase } from './use-runtime-phase.js';
40
+ export { useQuestionSelfHeal, hasRunningQuestionTool, type UseQuestionSelfHealOptions, } from './use-question-self-heal.js';
41
+ export { usePermissionSelfHeal, findPermissionBlockedCandidate, hasActiveNonQuestionTool, type UsePermissionSelfHealOptions, } from './use-permission-self-heal.js';
42
+ export { startStashKey, writeStartStash, readStartStash, clearStartStash, migrateStash, migrateLegacyStash, type StartStash, } from './session-start-stash.js';
43
+ //# sourceMappingURL=opencode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../src/react/opencode.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAsBH,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACjF,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAsBnC,cAAc,yBAAyB,CAAC;AAKxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EACL,yBAAyB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,mCAAmC,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AAGvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AAKnC,OAAO,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,YAAY,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAQxE,OAAO,EACL,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,KAAK,0BAA0B,GAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,wBAAwB,EACxB,KAAK,4BAA4B,GAClC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,aAAa,EACb,eAAe,EACf,cAAc,EACd,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,KAAK,UAAU,GAChB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,100 @@
1
+ 'use client';
2
+ /**
3
+ * @kortix/sdk/react — OpenCode React hook surface.
4
+ *
5
+ * Barrel re-exporting EVERY hook, query-key factory, provider, and type from
6
+ * the ported `use-opencode-*` / `use-*` hook modules. The web UI imports these
7
+ * by exact name + return shape, so this file is the public contract — keep it
8
+ * exhaustive and in parity with the source hooks.
9
+ *
10
+ * The 4 cross-module duplicates (`McpStatus`, `useOpenCodeMcpStatus`,
11
+ * `ModelKey`, `useVisibleAgents`) are same-symbol re-exports (the secondary
12
+ * module re-exports the primary's binding), so the overlapping `export *`
13
+ * statements resolve to a single declaration with no ambiguity.
14
+ */
15
+ // ─────────────────────────────────────────────────────────────────────────────
16
+ // FINAL PUBLIC SURFACE (Phase 7). A new host should reach a session through ONE
17
+ // hook — `useSession(projectId, sessionId)` — plus the pre-runtime capability
18
+ // hooks (`useProjectModels` / `useVisibleAgents` / `useProjectConfig`) and the
19
+ // primitives (`useSessionPicks` / `useRuntimePhase` / start-stash). The golden
20
+ // reference (apps/whitelabel-demo) imports ONLY that surface — no `server-store`,
21
+ // no `OpenCodeEventStreamProvider`, no `useCanonicalOpenCodeSession`, no raw
22
+ // stores, no `getClient`.
23
+ //
24
+ // The lower-level exports below (`OpenCodeEventStreamProvider`,
25
+ // `useCanonicalOpenCodeSession`, the sandbox-connection / sync / pending stores,
26
+ // the per-sandbox session hooks) are now INTERNAL plumbing that `useSession`
27
+ // composes. They remain exported ONLY because apps/web still consumes them
28
+ // directly through its not-yet-migrated file/terminal/git hooks; once that
29
+ // migration lands they come out of the public surface. New hosts: do not import
30
+ // them — use `useSession`.
31
+ // ─────────────────────────────────────────────────────────────────────────────
32
+ // Router-agnostic route scope: the host injects "the project the user is
33
+ // looking at" here (Next hosts derive it from useParams once, near the root);
34
+ // `useOpenCodeProviders`/`useOpenCodeLocal` resolve it via this context.
35
+ export { KortixProjectProvider, useKortixRouteProjectId } from './route-project.js';
36
+ export * from './use-opencode-sessions/index.js';
37
+ export * from './use-opencode-events/index.js';
38
+ export * from './use-opencode-local.js';
39
+ export * from './use-opencode-mcp.js';
40
+ export * from './use-opencode-pty.js';
41
+ export * from './use-opencode-config.js';
42
+ export * from './use-model-store.js';
43
+ export * from './use-session-sync.js';
44
+ // Runtime health has three independent layers, each covering a failure mode
45
+ // the others can't see — do not collapse them:
46
+ // 1. Boot readiness is server-truth: `useSession`'s /start resolves
47
+ // `stage==='ready'` only once the backend reached the daemon and OpenCode
48
+ // answered, and seeds that straight into the connection store. No client
49
+ // poll is needed (or trustworthy) to *establish* the first connection.
50
+ // 2. In-stream stalls are covered by the SSE heartbeat in
51
+ // `state/event-stream.ts` (`openEventStream`) — a 15s watchdog that
52
+ // forces a reconnect if no event arrives, so a stream that goes quiet
53
+ // recovers on its own.
54
+ // 3. Neither of those promptly detects the runtime dying *mid-session* or a
55
+ // network partition: a dead sandbox's SSE connection can hang rather than
56
+ // error, and the heartbeat only fires once its own timeout elapses. That
57
+ // gap is what `useRuntimeReconnect` (`./use-runtime-reconnect`) closes —
58
+ // an independent liveness probe (`getSessionHealth`/`isRuntimeReady`)
59
+ // polled on its own cadence and written into the same connection store,
60
+ // so the reconnect/offline UI reacts even when the SSE stream itself
61
+ // never surfaces an error. The tradeoff: while healthy it only polls
62
+ // every 30s (`POLL_CONNECTED`), so a mid-session death can take up to
63
+ // ~30s to surface — traded against not hammering a healthy sandbox with a
64
+ // tight poll forever.
65
+ export * from './use-runtime-reconnect.js';
66
+ // The live pending-request store. The SSE event stream writes agent QUESTIONS
67
+ // and PERMISSION requests here (keyed by request id, each carrying sessionID);
68
+ // `useSessionSync` does NOT surface them, so a host that renders interactive
69
+ // prompts must read them from this store.
70
+ export { useOpenCodePendingStore } from '../state/opencode-pending-store.js';
71
+ export { useSandboxConnectionStore, } from '../state/sandbox-connection-store.js';
72
+ export * from './use-session-prefetch.js';
73
+ // Relocated from `platform/projects-client/session-sandbox` — it types against
74
+ // react-query's QueryClient, which the framework-free REST layer must not.
75
+ export { prefetchSessionStart } from './prefetch-session-start.js';
76
+ export * from './use-canonical-opencode-session.js';
77
+ export * from './use-gateway-catalog-sync.js';
78
+ export * from './use-visible-agents.js';
79
+ export * from './provider-refresh.js';
80
+ // Runtime-free model catalog → selectable model list. Lets a host build a model
81
+ // picker BEFORE a session runtime exists (e.g. on a "new session" screen) by
82
+ // feeding `project(id).llmCatalog()` through these, with correct provider/model
83
+ // ids — no guessing the gateway-vs-BYOK key format.
84
+ export { flattenModels } from './model-flatten.js';
85
+ export { projectLlmCatalogToProviderList } from './provider-selection.js';
86
+ export { useProjectModels } from './use-project-models.js';
87
+ export { useProjectConfig } from './use-project-config.js';
88
+ // ── The one-hook session surface ─────────────────────────────────────────────
89
+ // `useSession(projectId, sessionId)` collapses the entire runtime dance (start →
90
+ // switch → health → SSE → id-resolution → message sync) into a single hook so a
91
+ // host never touches the sandbox. The primitives below are what it composes —
92
+ // also exported standalone for hosts that want the pieces (a model picker, a boot
93
+ // pill, the new-session hand-off) without a full session.
94
+ export { useSession, } from './use-session.js';
95
+ export { useSessionPicks } from './use-session-picks.js';
96
+ export { useRuntimePhase } from './use-runtime-phase.js';
97
+ export { useQuestionSelfHeal, hasRunningQuestionTool, } from './use-question-self-heal.js';
98
+ export { usePermissionSelfHeal, findPermissionBlockedCandidate, hasActiveNonQuestionTool, } from './use-permission-self-heal.js';
99
+ export { startStashKey, writeStartStash, readStartStash, clearStartStash, migrateStash, migrateLegacyStash, } from './session-start-stash.js';
100
+ //# sourceMappingURL=opencode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../src/react/opencode.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;;;;;;;;;;GAYG;AAEH,gFAAgF;AAChF,gFAAgF;AAChF,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,kFAAkF;AAClF,6EAA6E;AAC7E,0BAA0B;AAC1B,EAAE;AACF,gEAAgE;AAChE,iFAAiF;AACjF,6EAA6E;AAC7E,2EAA2E;AAC3E,2EAA2E;AAC3E,gFAAgF;AAChF,2BAA2B;AAC3B,gFAAgF;AAChF,yEAAyE;AACzE,8EAA8E;AAC9E,yEAAyE;AACzE,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACjF,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,4EAA4E;AAC5E,+CAA+C;AAC/C,sEAAsE;AACtE,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,4DAA4D;AAC5D,yEAAyE;AACzE,2EAA2E;AAC3E,4BAA4B;AAC5B,8EAA8E;AAC9E,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,2EAA2E;AAC3E,6EAA6E;AAC7E,0EAA0E;AAC1E,0EAA0E;AAC1E,2EAA2E;AAC3E,+EAA+E;AAC/E,2BAA2B;AAC3B,cAAc,yBAAyB,CAAC;AACxC,8EAA8E;AAC9E,+EAA+E;AAC/E,6EAA6E;AAC7E,0CAA0C;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EACL,yBAAyB,GAE1B,MAAM,mCAAmC,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,+EAA+E;AAC/E,2EAA2E;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,gFAAgF;AAChF,6EAA6E;AAC7E,gFAAgF;AAChF,oDAAoD;AACpD,OAAO,EAAE,aAAa,EAAkB,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,gFAAgF;AAChF,iFAAiF;AACjF,gFAAgF;AAChF,8EAA8E;AAC9E,kFAAkF;AAClF,0DAA0D;AAC1D,OAAO,EACL,UAAU,GAIX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAqB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAqB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GAEvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,wBAAwB,GAEzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,aAAa,EACb,eAAe,EACf,cAAc,EACd,eAAe,EACf,YAAY,EACZ,kBAAkB,GAEnB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { QueryClient } from '@tanstack/react-query';
2
+ /**
3
+ * Begin the session runtime boot DURING the route transition (before the session
4
+ * page mounts), so provisioning overlaps navigation instead of starting after the
5
+ * page paints. Idempotent + fire-and-forget: React Query dedupes against the
6
+ * session page's own query (same key), and `/start` is idempotent server-side.
7
+ * Also warms the route bundle. Use at every createProjectSession→navigate site.
8
+ */
9
+ export declare function prefetchSessionStart(queryClient: QueryClient, projectId: string, sessionId: string): void;
10
+ //# sourceMappingURL=prefetch-session-start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefetch-session-start.d.ts","sourceRoot":"","sources":["../../src/react/prefetch-session-start.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,IAAI,CAMN"}
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import { sessionStartKey, startProjectSession } from '../platform/projects-client/index.js';
3
+ /**
4
+ * Begin the session runtime boot DURING the route transition (before the session
5
+ * page mounts), so provisioning overlaps navigation instead of starting after the
6
+ * page paints. Idempotent + fire-and-forget: React Query dedupes against the
7
+ * session page's own query (same key), and `/start` is idempotent server-side.
8
+ * Also warms the route bundle. Use at every createProjectSession→navigate site.
9
+ */
10
+ export function prefetchSessionStart(queryClient, projectId, sessionId) {
11
+ void queryClient.prefetchQuery({
12
+ queryKey: sessionStartKey(projectId, sessionId),
13
+ queryFn: () => startProjectSession(projectId, sessionId),
14
+ staleTime: 0,
15
+ });
16
+ }
17
+ //# sourceMappingURL=prefetch-session-start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefetch-session-start.js","sourceRoot":"","sources":["../../src/react/prefetch-session-start.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAIb,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEnF;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,WAAwB,EACxB,SAAiB,EACjB,SAAiB;IAEjB,KAAK,WAAW,CAAC,aAAa,CAAC;QAC7B,QAAQ,EAAE,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC;QAC/C,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC;QACxD,SAAS,EAAE,CAAC;KACb,CAAC,CAAC;AACL,CAAC"}