@slices.sh/ai-chat 0.1.0

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 (393) hide show
  1. package/LICENSE +21 -0
  2. package/dist/exports.json +794 -0
  3. package/dist/fixture/fixture-approval.d.ts +4 -0
  4. package/dist/fixture/fixture-approval.js +59 -0
  5. package/dist/fixture/fixture-artifacts.d.ts +2 -0
  6. package/dist/fixture/fixture-artifacts.js +48 -0
  7. package/dist/fixture/fixture-question.d.ts +5 -0
  8. package/dist/fixture/fixture-question.js +93 -0
  9. package/dist/fixture/fixture-script.d.ts +35 -0
  10. package/dist/fixture/fixture-script.js +280 -0
  11. package/dist/fixture/fixture-selection.d.ts +5 -0
  12. package/dist/fixture/fixture-selection.js +20 -0
  13. package/dist/fixture/fixture.d.ts +20 -0
  14. package/dist/fixture/fixture.js +75 -0
  15. package/dist/fixture/provider.d.ts +15 -0
  16. package/dist/fixture/provider.js +14 -0
  17. package/dist/headless/always-allow.d.ts +2 -0
  18. package/dist/headless/always-allow.js +24 -0
  19. package/dist/headless/answer.d.ts +6 -0
  20. package/dist/headless/answer.js +29 -0
  21. package/dist/headless/approval-error.d.ts +2 -0
  22. package/dist/headless/approval-error.js +16 -0
  23. package/dist/headless/approval-reason.d.ts +2 -0
  24. package/dist/headless/approval-reason.js +13 -0
  25. package/dist/headless/approval-receipt.d.ts +4 -0
  26. package/dist/headless/approval-receipt.js +13 -0
  27. package/dist/headless/approve.d.ts +4 -0
  28. package/dist/headless/approve.js +15 -0
  29. package/dist/headless/branch-navigation.d.ts +2 -0
  30. package/dist/headless/branch-navigation.js +11 -0
  31. package/dist/headless/branch-next.d.ts +2 -0
  32. package/dist/headless/branch-next.js +21 -0
  33. package/dist/headless/branch-page.d.ts +5 -0
  34. package/dist/headless/branch-page.js +13 -0
  35. package/dist/headless/branch-previous.d.ts +2 -0
  36. package/dist/headless/branch-previous.js +21 -0
  37. package/dist/headless/cancel-edit.d.ts +2 -0
  38. package/dist/headless/cancel-edit.js +10 -0
  39. package/dist/headless/cancel-queue-edit.d.ts +2 -0
  40. package/dist/headless/cancel-queue-edit.js +15 -0
  41. package/dist/headless/cancel-queued.d.ts +2 -0
  42. package/dist/headless/cancel-queued.js +15 -0
  43. package/dist/headless/chat-dictation/confirm.d.ts +2 -0
  44. package/dist/headless/chat-dictation/confirm.js +14 -0
  45. package/dist/headless/chat-dictation/index.d.ts +12 -0
  46. package/dist/headless/chat-dictation/index.js +9 -0
  47. package/dist/headless/chat-dictation/input.d.ts +3 -0
  48. package/dist/headless/chat-dictation/input.js +42 -0
  49. package/dist/headless/chat-dictation/root.d.ts +3 -0
  50. package/dist/headless/chat-dictation/root.js +42 -0
  51. package/dist/headless/chat-dictation/text.d.ts +3 -0
  52. package/dist/headless/chat-dictation/text.js +14 -0
  53. package/dist/headless/chat-dictation/voice.d.ts +3 -0
  54. package/dist/headless/chat-dictation/voice.js +35 -0
  55. package/dist/headless/citation-content.d.ts +3 -0
  56. package/dist/headless/citation-content.js +19 -0
  57. package/dist/headless/citation-description.d.ts +2 -0
  58. package/dist/headless/citation-description.js +12 -0
  59. package/dist/headless/citation-root.d.ts +2 -0
  60. package/dist/headless/citation-root.js +13 -0
  61. package/dist/headless/citation-title.d.ts +2 -0
  62. package/dist/headless/citation-title.js +12 -0
  63. package/dist/headless/citation-trigger.d.ts +2 -0
  64. package/dist/headless/citation-trigger.js +12 -0
  65. package/dist/headless/clear-answer.d.ts +5 -0
  66. package/dist/headless/clear-answer.js +19 -0
  67. package/dist/headless/composer-root.d.ts +14 -0
  68. package/dist/headless/composer-root.js +12 -0
  69. package/dist/headless/composer-standalone.d.ts +3 -0
  70. package/dist/headless/composer-standalone.js +10 -0
  71. package/dist/headless/composer.d.ts +3 -0
  72. package/dist/headless/composer.js +24 -0
  73. package/dist/headless/context-usage.d.ts +3 -0
  74. package/dist/headless/context-usage.js +13 -0
  75. package/dist/headless/contexts.d.ts +77 -0
  76. package/dist/headless/contexts.js +53 -0
  77. package/dist/headless/continue.d.ts +4 -0
  78. package/dist/headless/continue.js +26 -0
  79. package/dist/headless/copy.d.ts +11 -0
  80. package/dist/headless/copy.js +21 -0
  81. package/dist/headless/deny.d.ts +4 -0
  82. package/dist/headless/deny.js +15 -0
  83. package/dist/headless/edit-queued.d.ts +2 -0
  84. package/dist/headless/edit-queued.js +15 -0
  85. package/dist/headless/edit.d.ts +2 -0
  86. package/dist/headless/edit.js +17 -0
  87. package/dist/headless/edited-attachments.d.ts +5 -0
  88. package/dist/headless/edited-attachments.js +11 -0
  89. package/dist/headless/edited-input.d.ts +2 -0
  90. package/dist/headless/edited-input.js +28 -0
  91. package/dist/headless/empty.d.ts +3 -0
  92. package/dist/headless/empty.js +12 -0
  93. package/dist/headless/failed.d.ts +15 -0
  94. package/dist/headless/failed.js +17 -0
  95. package/dist/headless/feedback-error.d.ts +2 -0
  96. package/dist/headless/feedback-error.js +11 -0
  97. package/dist/headless/feedback-root.d.ts +2 -0
  98. package/dist/headless/feedback-root.js +24 -0
  99. package/dist/headless/feedback.d.ts +4 -0
  100. package/dist/headless/feedback.js +18 -0
  101. package/dist/headless/file-audio.d.ts +2 -0
  102. package/dist/headless/file-audio.js +16 -0
  103. package/dist/headless/file-context.d.ts +4 -0
  104. package/dist/headless/file-context.js +7 -0
  105. package/dist/headless/file-img.d.ts +2 -0
  106. package/dist/headless/file-img.js +21 -0
  107. package/dist/headless/file-kind-gate.d.ts +5 -0
  108. package/dist/headless/file-kind-gate.js +11 -0
  109. package/dist/headless/file-link.d.ts +3 -0
  110. package/dist/headless/file-link.js +14 -0
  111. package/dist/headless/file-root.d.ts +5 -0
  112. package/dist/headless/file-root.js +13 -0
  113. package/dist/headless/file-unavailable.d.ts +2 -0
  114. package/dist/headless/file-unavailable.js +12 -0
  115. package/dist/headless/file-video.d.ts +2 -0
  116. package/dist/headless/file-video.js +16 -0
  117. package/dist/headless/follow-ups.d.ts +5 -0
  118. package/dist/headless/follow-ups.js +20 -0
  119. package/dist/headless/forget-approval.d.ts +2 -0
  120. package/dist/headless/forget-approval.js +21 -0
  121. package/dist/headless/gate-content.d.ts +2 -0
  122. package/dist/headless/gate-content.js +6 -0
  123. package/dist/headless/index.d.ts +249 -0
  124. package/dist/headless/index.js +251 -0
  125. package/dist/headless/input.d.ts +11 -0
  126. package/dist/headless/input.js +18 -0
  127. package/dist/headless/jump-to-latest.d.ts +3 -0
  128. package/dist/headless/jump-to-latest.js +14 -0
  129. package/dist/headless/message-edit-root.d.ts +2 -0
  130. package/dist/headless/message-edit-root.js +13 -0
  131. package/dist/headless/message-editing.d.ts +2 -0
  132. package/dist/headless/message-editing.js +10 -0
  133. package/dist/headless/message-editor.d.ts +2 -0
  134. package/dist/headless/message-editor.js +19 -0
  135. package/dist/headless/message-footer.d.ts +3 -0
  136. package/dist/headless/message-footer.js +15 -0
  137. package/dist/headless/message-reading.d.ts +2 -0
  138. package/dist/headless/message-reading.js +10 -0
  139. package/dist/headless/message.d.ts +11 -0
  140. package/dist/headless/message.js +34 -0
  141. package/dist/headless/messages.d.ts +9 -0
  142. package/dist/headless/messages.js +19 -0
  143. package/dist/headless/model-picker.d.ts +2 -0
  144. package/dist/headless/model-picker.js +14 -0
  145. package/dist/headless/model.d.ts +4 -0
  146. package/dist/headless/model.js +13 -0
  147. package/dist/headless/models.d.ts +5 -0
  148. package/dist/headless/models.js +11 -0
  149. package/dist/headless/optional-tools.d.ts +7 -0
  150. package/dist/headless/optional-tools.js +12 -0
  151. package/dist/headless/other-answer.d.ts +5 -0
  152. package/dist/headless/other-answer.js +32 -0
  153. package/dist/headless/part-approval.d.ts +2 -0
  154. package/dist/headless/part-approval.js +33 -0
  155. package/dist/headless/part-file.d.ts +6 -0
  156. package/dist/headless/part-file.js +11 -0
  157. package/dist/headless/part-question.d.ts +2 -0
  158. package/dist/headless/part-question.js +57 -0
  159. package/dist/headless/part-reasoning.d.ts +15 -0
  160. package/dist/headless/part-reasoning.js +26 -0
  161. package/dist/headless/part-source.d.ts +5 -0
  162. package/dist/headless/part-source.js +20 -0
  163. package/dist/headless/part-text.d.ts +16 -0
  164. package/dist/headless/part-text.js +29 -0
  165. package/dist/headless/part-tool.d.ts +16 -0
  166. package/dist/headless/part-tool.js +14 -0
  167. package/dist/headless/parts.d.ts +11 -0
  168. package/dist/headless/parts.js +11 -0
  169. package/dist/headless/question-back.d.ts +2 -0
  170. package/dist/headless/question-back.js +16 -0
  171. package/dist/headless/question-error.d.ts +2 -0
  172. package/dist/headless/question-error.js +14 -0
  173. package/dist/headless/question-invalid.d.ts +8 -0
  174. package/dist/headless/question-invalid.js +18 -0
  175. package/dist/headless/question-item.d.ts +8 -0
  176. package/dist/headless/question-item.js +51 -0
  177. package/dist/headless/question-next.d.ts +3 -0
  178. package/dist/headless/question-next.js +16 -0
  179. package/dist/headless/question-other.d.ts +5 -0
  180. package/dist/headless/question-other.js +22 -0
  181. package/dist/headless/question-progress.d.ts +8 -0
  182. package/dist/headless/question-progress.js +14 -0
  183. package/dist/headless/question-receipt.d.ts +11 -0
  184. package/dist/headless/question-receipt.js +29 -0
  185. package/dist/headless/questions.d.ts +3 -0
  186. package/dist/headless/questions.js +13 -0
  187. package/dist/headless/queue-editing.d.ts +4 -0
  188. package/dist/headless/queue-editing.js +11 -0
  189. package/dist/headless/queue-item.d.ts +2 -0
  190. package/dist/headless/queue-item.js +10 -0
  191. package/dist/headless/queue-items.d.ts +2 -0
  192. package/dist/headless/queue-items.js +11 -0
  193. package/dist/headless/queue-preview.d.ts +6 -0
  194. package/dist/headless/queue-preview.js +11 -0
  195. package/dist/headless/queued-input.d.ts +2 -0
  196. package/dist/headless/queued-input.js +27 -0
  197. package/dist/headless/queued.d.ts +17 -0
  198. package/dist/headless/queued.js +16 -0
  199. package/dist/headless/read-aloud.d.ts +5 -0
  200. package/dist/headless/read-aloud.js +19 -0
  201. package/dist/headless/reasoning-disclosure.d.ts +3 -0
  202. package/dist/headless/reasoning-disclosure.js +17 -0
  203. package/dist/headless/reasoning-timer.d.ts +5 -0
  204. package/dist/headless/reasoning-timer.js +13 -0
  205. package/dist/headless/references.d.ts +6 -0
  206. package/dist/headless/references.js +13 -0
  207. package/dist/headless/regenerate.d.ts +3 -0
  208. package/dist/headless/regenerate.js +22 -0
  209. package/dist/headless/remembered-approval.d.ts +2 -0
  210. package/dist/headless/remembered-approval.js +14 -0
  211. package/dist/headless/root.d.ts +30 -0
  212. package/dist/headless/root.js +99 -0
  213. package/dist/headless/save-edit.d.ts +2 -0
  214. package/dist/headless/save-edit.js +16 -0
  215. package/dist/headless/save-queued.d.ts +2 -0
  216. package/dist/headless/save-queued.js +15 -0
  217. package/dist/headless/send-now.d.ts +2 -0
  218. package/dist/headless/send-now.js +17 -0
  219. package/dist/headless/settings.d.ts +2 -0
  220. package/dist/headless/settings.js +10 -0
  221. package/dist/headless/skip-questions.d.ts +6 -0
  222. package/dist/headless/skip-questions.js +18 -0
  223. package/dist/headless/source-context.d.ts +5 -0
  224. package/dist/headless/source-context.js +9 -0
  225. package/dist/headless/source-link.d.ts +2 -0
  226. package/dist/headless/source-link.js +13 -0
  227. package/dist/headless/source-primitives.d.ts +1 -0
  228. package/dist/headless/source-primitives.js +7 -0
  229. package/dist/headless/source-root.d.ts +5 -0
  230. package/dist/headless/source-root.js +9 -0
  231. package/dist/headless/source-sheet-close.d.ts +2 -0
  232. package/dist/headless/source-sheet-close.js +12 -0
  233. package/dist/headless/source-sheet-content.d.ts +3 -0
  234. package/dist/headless/source-sheet-content.js +16 -0
  235. package/dist/headless/source-sheet-description.d.ts +2 -0
  236. package/dist/headless/source-sheet-description.js +12 -0
  237. package/dist/headless/source-sheet-root.d.ts +2 -0
  238. package/dist/headless/source-sheet-root.js +13 -0
  239. package/dist/headless/source-sheet-title.d.ts +2 -0
  240. package/dist/headless/source-sheet-title.js +12 -0
  241. package/dist/headless/source-sheet-trigger.d.ts +2 -0
  242. package/dist/headless/source-sheet-trigger.js +12 -0
  243. package/dist/headless/source-unavailable.d.ts +2 -0
  244. package/dist/headless/source-unavailable.js +9 -0
  245. package/dist/headless/sources.d.ts +14 -0
  246. package/dist/headless/sources.js +12 -0
  247. package/dist/headless/speaker.d.ts +13 -0
  248. package/dist/headless/speaker.js +10 -0
  249. package/dist/headless/step-boundary.d.ts +4 -0
  250. package/dist/headless/step-boundary.js +16 -0
  251. package/dist/headless/stop.d.ts +10 -0
  252. package/dist/headless/stop.js +18 -0
  253. package/dist/headless/stopped.d.ts +11 -0
  254. package/dist/headless/stopped.js +17 -0
  255. package/dist/headless/submit-answers.d.ts +3 -0
  256. package/dist/headless/submit-answers.js +12 -0
  257. package/dist/headless/submit.d.ts +23 -0
  258. package/dist/headless/submit.js +24 -0
  259. package/dist/headless/suggestion.d.ts +10 -0
  260. package/dist/headless/suggestion.js +14 -0
  261. package/dist/headless/suggestions.d.ts +8 -0
  262. package/dist/headless/suggestions.js +12 -0
  263. package/dist/headless/thread.d.ts +3 -0
  264. package/dist/headless/thread.js +25 -0
  265. package/dist/headless/timing.d.ts +5 -0
  266. package/dist/headless/timing.js +13 -0
  267. package/dist/headless/toggle-tool.d.ts +4 -0
  268. package/dist/headless/toggle-tool.js +15 -0
  269. package/dist/headless/tool-error.d.ts +4 -0
  270. package/dist/headless/tool-error.js +13 -0
  271. package/dist/headless/tool-input.d.ts +4 -0
  272. package/dist/headless/tool-input.js +13 -0
  273. package/dist/headless/tool-output.d.ts +4 -0
  274. package/dist/headless/tool-output.js +13 -0
  275. package/dist/headless/tool-renderer.d.ts +13 -0
  276. package/dist/headless/tool-renderer.js +15 -0
  277. package/dist/headless/transcript.d.ts +23 -0
  278. package/dist/headless/transcript.js +24 -0
  279. package/dist/headless/try-again.d.ts +2 -0
  280. package/dist/headless/try-again.js +24 -0
  281. package/dist/headless/unavailable.d.ts +8 -0
  282. package/dist/headless/unavailable.js +9 -0
  283. package/dist/headless/usage.d.ts +13 -0
  284. package/dist/headless/usage.js +15 -0
  285. package/dist/headless/use-merged-ref.d.ts +2 -0
  286. package/dist/headless/use-merged-ref.js +17 -0
  287. package/dist/headless/use-question.d.ts +3 -0
  288. package/dist/headless/use-question.js +9 -0
  289. package/dist/headless/waiting.d.ts +13 -0
  290. package/dist/headless/waiting.js +12 -0
  291. package/dist/headless/writing.d.ts +13 -0
  292. package/dist/headless/writing.js +12 -0
  293. package/dist/hooks/chat-refusal.d.ts +18 -0
  294. package/dist/hooks/chat-refusal.js +44 -0
  295. package/dist/hooks/turn-mailbox.d.ts +14 -0
  296. package/dist/hooks/turn-mailbox.js +114 -0
  297. package/dist/hooks/use-branches.d.ts +10 -0
  298. package/dist/hooks/use-branches.js +69 -0
  299. package/dist/hooks/use-chat-instance.d.ts +28 -0
  300. package/dist/hooks/use-chat-instance.js +44 -0
  301. package/dist/hooks/use-chat-settings.d.ts +11 -0
  302. package/dist/hooks/use-chat-settings.js +33 -0
  303. package/dist/hooks/use-chat-sink.d.ts +19 -0
  304. package/dist/hooks/use-chat-sink.js +56 -0
  305. package/dist/hooks/use-composer.d.ts +33 -0
  306. package/dist/hooks/use-composer.js +45 -0
  307. package/dist/hooks/use-context-usage.d.ts +8 -0
  308. package/dist/hooks/use-context-usage.js +14 -0
  309. package/dist/hooks/use-copied.d.ts +14 -0
  310. package/dist/hooks/use-copied.js +22 -0
  311. package/dist/hooks/use-draft.d.ts +6 -0
  312. package/dist/hooks/use-draft.js +38 -0
  313. package/dist/hooks/use-feedback.d.ts +8 -0
  314. package/dist/hooks/use-feedback.js +28 -0
  315. package/dist/hooks/use-follow.d.ts +15 -0
  316. package/dist/hooks/use-follow.js +30 -0
  317. package/dist/hooks/use-media-load.d.ts +5 -0
  318. package/dist/hooks/use-media-load.js +12 -0
  319. package/dist/hooks/use-media.d.ts +3 -0
  320. package/dist/hooks/use-media.js +9 -0
  321. package/dist/hooks/use-question-check.d.ts +11 -0
  322. package/dist/hooks/use-question-check.js +29 -0
  323. package/dist/hooks/use-question-draft.d.ts +34 -0
  324. package/dist/hooks/use-question-draft.js +57 -0
  325. package/dist/hooks/use-question-steps.d.ts +18 -0
  326. package/dist/hooks/use-question-steps.js +31 -0
  327. package/dist/hooks/use-question-write.d.ts +8 -0
  328. package/dist/hooks/use-question-write.js +25 -0
  329. package/dist/hooks/use-read-aloud.d.ts +8 -0
  330. package/dist/hooks/use-read-aloud.js +60 -0
  331. package/dist/hooks/use-reasoning.d.ts +8 -0
  332. package/dist/hooks/use-reasoning.js +32 -0
  333. package/dist/hooks/use-remembered-approvals.d.ts +9 -0
  334. package/dist/hooks/use-remembered-approvals.js +40 -0
  335. package/dist/hooks/use-reply.d.ts +3 -0
  336. package/dist/hooks/use-reply.js +9 -0
  337. package/dist/hooks/use-report-missing-configuration.d.ts +9 -0
  338. package/dist/hooks/use-report-missing-configuration.js +14 -0
  339. package/dist/hooks/use-retry-delay.d.ts +5 -0
  340. package/dist/hooks/use-retry-delay.js +17 -0
  341. package/dist/hooks/use-sent-draft.d.ts +8 -0
  342. package/dist/hooks/use-sent-draft.js +25 -0
  343. package/dist/hooks/use-source-disclosure.d.ts +5 -0
  344. package/dist/hooks/use-source-disclosure.js +9 -0
  345. package/dist/hooks/use-sources.d.ts +3 -0
  346. package/dist/hooks/use-sources.js +9 -0
  347. package/dist/hooks/use-tool-approval-memory.d.ts +8 -0
  348. package/dist/hooks/use-tool-approval-memory.js +16 -0
  349. package/dist/hooks/use-tool-approval.d.ts +10 -0
  350. package/dist/hooks/use-tool-approval.js +26 -0
  351. package/dist/hooks/use-turn-queue.d.ts +32 -0
  352. package/dist/hooks/use-turn-queue.js +33 -0
  353. package/dist/index.d.ts +10 -0
  354. package/dist/index.js +5 -0
  355. package/dist/next.d.ts +43 -0
  356. package/dist/next.js +10 -0
  357. package/dist/services/approval-memory.d.ts +9 -0
  358. package/dist/services/approval-memory.js +32 -0
  359. package/dist/services/approval.d.ts +14 -0
  360. package/dist/services/approval.js +37 -0
  361. package/dist/services/branches.d.ts +27 -0
  362. package/dist/services/branches.js +131 -0
  363. package/dist/services/chat-session.d.ts +20 -0
  364. package/dist/services/chat-session.js +61 -0
  365. package/dist/services/choices.d.ts +31 -0
  366. package/dist/services/choices.js +39 -0
  367. package/dist/services/continue.d.ts +8 -0
  368. package/dist/services/continue.js +24 -0
  369. package/dist/services/errors.d.ts +52 -0
  370. package/dist/services/errors.js +54 -0
  371. package/dist/services/media.d.ts +9 -0
  372. package/dist/services/media.js +19 -0
  373. package/dist/services/messages.d.ts +44 -0
  374. package/dist/services/messages.js +0 -0
  375. package/dist/services/optional.d.ts +7 -0
  376. package/dist/services/optional.js +7 -0
  377. package/dist/services/ports.d.ts +31 -0
  378. package/dist/services/ports.js +0 -0
  379. package/dist/services/questions.d.ts +67 -0
  380. package/dist/services/questions.js +119 -0
  381. package/dist/services/request.d.ts +26 -0
  382. package/dist/services/request.js +85 -0
  383. package/dist/services/selection.d.ts +10 -0
  384. package/dist/services/selection.js +49 -0
  385. package/dist/services/sources.d.ts +11 -0
  386. package/dist/services/sources.js +29 -0
  387. package/dist/services/tools.d.ts +11 -0
  388. package/dist/services/tools.js +0 -0
  389. package/dist/services/turn.d.ts +84 -0
  390. package/dist/services/turn.js +0 -0
  391. package/dist/services/types.d.ts +23 -0
  392. package/dist/services/types.js +15 -0
  393. package/package.json +822 -0
@@ -0,0 +1,31 @@
1
+ import type { ChatTransport } from "ai";
2
+ import type { AiChatMessage } from "./messages";
3
+ import type { ChatChoices } from "./choices";
4
+ import type { ChatConfig } from "./turn";
5
+ /**
6
+ * Where a chat's turns go, as the AI SDK's own transport.
7
+ *
8
+ * The only thing a screen needs from the installed backend is somewhere to send the
9
+ * conversation, and the SDK already has the shape for that: a backend with a route answers
10
+ * with a `DefaultChatTransport` pointed at it. Everything else a screen reads — messages,
11
+ * status, error, stop, regenerate — comes from the SDK's `Chat` over this transport.
12
+ */
13
+ export type AiChatClient = {
14
+ choicesFor?(chat: string, signal?: AbortSignal): Promise<ChatChoices | null>;
15
+ transportFor(chat: string): ChatTransport<AiChatMessage>;
16
+ };
17
+ export type AiChatServer = {
18
+ choices?(request: Request, context: {
19
+ params: Promise<{
20
+ chat: string;
21
+ }>;
22
+ }): Promise<Response>;
23
+ /** `undefined` for a slug with no entry, which is a 404 and never a fall back to a default. */
24
+ configFor(chat: string): ChatConfig | undefined;
25
+ /** Answers with the SDK's UI message stream, or refuses with a status before one starts. */
26
+ turn(request: Request, context: {
27
+ params: Promise<{
28
+ chat: string;
29
+ }>;
30
+ }): Promise<Response>;
31
+ };
File without changes
@@ -0,0 +1,67 @@
1
+ import { z } from "zod";
2
+ import type { Chat } from "@ai-sdk/react";
3
+ import type { AiChatMessage, AiChatPart } from "./messages";
4
+ export declare const questionSchema: z.ZodObject<{
5
+ title: z.ZodString;
6
+ questions: z.ZodArray<z.ZodObject<{
7
+ name: z.ZodString;
8
+ title: z.ZodString;
9
+ description: z.ZodOptional<z.ZodString>;
10
+ multiple: z.ZodOptional<z.ZodBoolean>;
11
+ required: z.ZodOptional<z.ZodBoolean>;
12
+ choices: z.ZodArray<z.ZodObject<{
13
+ value: z.ZodString;
14
+ label: z.ZodString;
15
+ description: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>>;
17
+ other: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>>;
19
+ }, z.core.$strip>;
20
+ export type Questionnaire = z.infer<typeof questionSchema>;
21
+ export type Question = Questionnaire["questions"][number];
22
+ export type QuestionAnswers = Record<string, string | string[]>;
23
+ /** Register as tools.askQuestions. It deliberately has no server execute function. */
24
+ export declare const askQuestions: import("ai").Tool<{
25
+ title: string;
26
+ questions: {
27
+ name: string;
28
+ title: string;
29
+ choices: {
30
+ value: string;
31
+ label: string;
32
+ description?: string | undefined;
33
+ }[];
34
+ description?: string | undefined;
35
+ multiple?: boolean | undefined;
36
+ required?: boolean | undefined;
37
+ other?: string | undefined;
38
+ }[];
39
+ }, never, import("@ai-sdk/provider-utils").Context>;
40
+ export declare function questionInput(part: AiChatPart): Questionnaire | null;
41
+ export declare function validQuestionAnswer(question: Question, answer: string | string[] | undefined): boolean;
42
+ export type QuestionProblem = "required" | "other";
43
+ /**
44
+ * Why an answer cannot be sent yet, in the person's terms: an Other they chose and left empty is
45
+ * a different thing to fix than a question they never answered. Null when it can be sent.
46
+ */
47
+ export declare function questionProblem(question: Question, answer: string | string[] | undefined, blankOther: boolean): QuestionProblem | null;
48
+ /** What the model reads when the person dismissed the questions instead of answering them. */
49
+ export declare const skippedQuestion: {
50
+ readonly skipped: true;
51
+ readonly message: "The user skipped the question.";
52
+ };
53
+ export declare function isSkippedQuestion(part: AiChatPart): boolean;
54
+ export declare function answerQuestions(chat: Chat<AiChatMessage>, toolCallId: string, answers: QuestionAnswers): Promise<void>;
55
+ /**
56
+ * Resolves the open questions of the last message as skipped, without answering and without
57
+ * continuing the turn: `shouldContinueChat` ignores them, so whoever skips decides what is sent
58
+ * next. True when it wrote something.
59
+ */
60
+ export declare function skipQuestions(chat: Chat<AiChatMessage>, toolCallId?: string): Promise<boolean>;
61
+ /** A message typed while a question is open is the reply to it: the question is skipped first. */
62
+ export declare function sendPastQuestions(chat: Chat<AiChatMessage>, text: string): Promise<void>;
63
+ /**
64
+ * Only the last message can still be answered (the SDK writes tool outputs there), so a question
65
+ * left behind a newer message is history and holds nothing back.
66
+ */
67
+ export declare function awaitingQuestion(messages: AiChatMessage[]): boolean;
@@ -0,0 +1,119 @@
1
+ import { getToolName, isToolUIPart, tool } from "ai";
2
+ import { z } from "zod";
3
+ const choice = z.object({
4
+ value: z.string().min(1),
5
+ label: z.string().min(1),
6
+ description: z.string().optional()
7
+ });
8
+ const question = z.object({
9
+ name: z.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/),
10
+ title: z.string().min(1),
11
+ description: z.string().optional(),
12
+ multiple: z.boolean().optional(),
13
+ required: z.boolean().optional(),
14
+ choices: z.array(choice).max(9),
15
+ other: z.string().min(1).optional()
16
+ });
17
+ const questionSchema = z.object({
18
+ title: z.string().min(1),
19
+ questions: z.array(question).min(1).max(12)
20
+ });
21
+ const askQuestions = tool({
22
+ description: "Ask the person questions before continuing. Use unique question names and choice values. Provide choices or an other field. The client returns the person's answers.",
23
+ inputSchema: questionSchema
24
+ });
25
+ function questionInput(part) {
26
+ if (!isToolUIPart(part) || getToolName(part) !== "askQuestions") return null;
27
+ const parsed = questionSchema.safeParse(part.input);
28
+ if (!parsed.success) return null;
29
+ const questions = parsed.data.questions;
30
+ if (new Set(questions.map((q) => q.name)).size !== questions.length || questions.some(
31
+ (q) => !q.choices.length && !q.other || new Set(q.choices.map((c) => c.value)).size !== q.choices.length
32
+ ))
33
+ return null;
34
+ return parsed.data;
35
+ }
36
+ function validQuestionAnswer(question2, answer) {
37
+ if (answer !== void 0 && (question2.multiple ? !Array.isArray(answer) : typeof answer !== "string"))
38
+ return false;
39
+ const values = (Array.isArray(answer) ? answer : answer ? [answer] : []).filter((value) => value.trim());
40
+ if (question2.required && !values.length) return false;
41
+ return values.every(
42
+ (value) => question2.choices.some((choice2) => choice2.value === value) || Boolean(question2.other)
43
+ );
44
+ }
45
+ function questionProblem(question2, answer, blankOther) {
46
+ if (blankOther) return "other";
47
+ return validQuestionAnswer(question2, answer) ? null : "required";
48
+ }
49
+ const skippedQuestion = { skipped: true, message: "The user skipped the question." };
50
+ function isSkippedQuestion(part) {
51
+ if (!isToolUIPart(part) || getToolName(part) !== "askQuestions" || part.state !== "output-available")
52
+ return false;
53
+ const output = part.output;
54
+ return typeof output === "object" && output !== null && output.skipped === true;
55
+ }
56
+ const claims = /* @__PURE__ */ new WeakMap();
57
+ function claimed(chat) {
58
+ let pending = claims.get(chat);
59
+ if (!pending) {
60
+ pending = /* @__PURE__ */ new Set();
61
+ claims.set(chat, pending);
62
+ }
63
+ return pending;
64
+ }
65
+ async function answerQuestions(chat, toolCallId, answers) {
66
+ const pending = claimed(chat);
67
+ if (pending.has(toolCallId)) return;
68
+ const part = chat.messages.flatMap((message) => message.parts).find((part2) => isToolUIPart(part2) && part2.toolCallId === toolCallId && part2.state === "input-available");
69
+ const input = part && questionInput(part);
70
+ if (!input) return;
71
+ if (!input.questions.every((q) => validQuestionAnswer(q, answers[q.name])))
72
+ throw new Error("ai-chat/invalid-answers");
73
+ const output = Object.fromEntries(
74
+ input.questions.map((q) => [q.name, answers[q.name] ?? (q.multiple ? [] : "")])
75
+ );
76
+ pending.add(toolCallId);
77
+ try {
78
+ await chat.addToolOutput({ tool: "askQuestions", toolCallId, output });
79
+ } finally {
80
+ pending.delete(toolCallId);
81
+ }
82
+ }
83
+ async function skipQuestions(chat, toolCallId) {
84
+ const pending = claimed(chat);
85
+ const ids = (chat.messages.at(-1)?.parts ?? []).flatMap(
86
+ (part) => isToolUIPart(part) && part.state === "input-available" && questionInput(part) !== null && (toolCallId === void 0 || part.toolCallId === toolCallId) && !pending.has(part.toolCallId) ? [part.toolCallId] : []
87
+ );
88
+ for (const id of ids) pending.add(id);
89
+ try {
90
+ for (const id of ids)
91
+ await chat.addToolOutput({ tool: "askQuestions", toolCallId: id, output: skippedQuestion });
92
+ } finally {
93
+ for (const id of ids) pending.delete(id);
94
+ }
95
+ return ids.length > 0;
96
+ }
97
+ async function sendPastQuestions(chat, text) {
98
+ await skipQuestions(chat);
99
+ await chat.sendMessage({ text });
100
+ }
101
+ function awaitingQuestion(messages) {
102
+ const last = messages.at(-1);
103
+ return last?.role === "assistant" && last.parts.some(
104
+ (part) => isToolUIPart(part) && part.state === "input-available" && questionInput(part) !== null
105
+ );
106
+ }
107
+ export {
108
+ answerQuestions,
109
+ askQuestions,
110
+ awaitingQuestion,
111
+ isSkippedQuestion,
112
+ questionInput,
113
+ questionProblem,
114
+ questionSchema,
115
+ sendPastQuestions,
116
+ skipQuestions,
117
+ skippedQuestion,
118
+ validQuestionAnswer
119
+ };
@@ -0,0 +1,26 @@
1
+ import "server-only";
2
+ import type { AiChatMessage } from "./messages";
3
+ import type { ChatConfig, ChatRequestContext, ChatTurnEnd } from "./turn";
4
+ /**
5
+ * The conversation a turn carries, checked by the SDK's own validator.
6
+ *
7
+ * The body is what `DefaultChatTransport` posts — `{ id, messages, trigger, messageId }` —
8
+ * and `messages` is all of it a route reads: a turn is stateless, so the transcript arrives
9
+ * whole with every request and nothing here keeps it between them.
10
+ */
11
+ export declare function requestedTurn(request: Request): Promise<{
12
+ messages: AiChatMessage[];
13
+ selection: unknown;
14
+ }>;
15
+ export declare function messagesOf(request: Request): Promise<AiChatMessage[]>;
16
+ /** A turn refused before its stream starts: the status the slug decides, and the slug for the screen. */
17
+ export declare function refusal(failure: unknown): Response;
18
+ /**
19
+ * A failure once the stream is already open, as the text of the SDK's `error` chunk.
20
+ *
21
+ * The status went out with the first byte, so the refusal travels inside the stream, in the
22
+ * same words a refused request would have had. What went wrong in detail stays here: the
23
+ * SDK's default says "An error occurred." for the same reason.
24
+ */
25
+ export declare function streamRefusal(failure: unknown): string;
26
+ export declare function ended(config: ChatConfig, end: ChatTurnEnd, context: ChatRequestContext): Promise<void>;
@@ -0,0 +1,85 @@
1
+ import "server-only";
2
+ import { APICallError, safeValidateUIMessages } from "ai";
3
+ import { answerMissingConfiguration, missingConfigurationAnswer } from "@slices.sh/core/configuration/server";
4
+ import { ChatError, isChatError, refusalText, statusForChatError } from "./errors.js";
5
+ async function requestedTurn(request) {
6
+ let body;
7
+ try {
8
+ body = await request.json();
9
+ } catch {
10
+ throw new ChatError("ai-chat/invalid-request", "The turn was not JSON.");
11
+ }
12
+ const messages = body?.messages;
13
+ if (!Array.isArray(messages) || messages.length === 0) {
14
+ throw new ChatError("ai-chat/invalid-request", "A turn needs at least one message.");
15
+ }
16
+ const checked = await safeValidateUIMessages({ messages });
17
+ if (!checked.success) {
18
+ throw new ChatError(
19
+ "ai-chat/invalid-request",
20
+ "The turn's messages are not a conversation.",
21
+ checked.error.message
22
+ );
23
+ }
24
+ if (checked.data.some((message) => message.role === "system")) {
25
+ throw new ChatError(
26
+ "ai-chat/invalid-request",
27
+ "A turn's messages are a person's and a model's, never a system prompt."
28
+ );
29
+ }
30
+ return { messages: checked.data, selection: body.selection };
31
+ }
32
+ async function messagesOf(request) {
33
+ return (await requestedTurn(request)).messages;
34
+ }
35
+ function refusal(failure) {
36
+ const missing = answerMissingConfiguration(failure, "ai-chat");
37
+ if (missing) return missing;
38
+ const error = reportedFailure(failure, "ai-chat/unavailable", "The chat is unavailable.");
39
+ if (error.detail) console.error(`[ai-chat] ${error.slug}: ${error.detail}`);
40
+ return new Response(refusalText(error), {
41
+ status: statusForChatError[error.slug],
42
+ headers: {
43
+ "content-type": "application/json",
44
+ ...error.retryAt ? { "retry-after": new Date(error.retryAt).toUTCString() } : {}
45
+ }
46
+ });
47
+ }
48
+ function streamRefusal(failure) {
49
+ const missing = missingConfigurationAnswer(failure, "ai-chat");
50
+ if (missing) return JSON.stringify(missing);
51
+ const error = reportedFailure(failure, "ai-chat/model-unavailable", "The model stopped answering.");
52
+ console.error(
53
+ `[ai-chat] ${error.slug}:`,
54
+ isChatError(failure) ? failure.detail ?? failure.message : failure
55
+ );
56
+ return refusalText(error);
57
+ }
58
+ async function ended(config, end, context) {
59
+ try {
60
+ await config.onEnd?.(end, context);
61
+ } catch (failure) {
62
+ console.error("[ai-chat] onEnd failed", failure);
63
+ }
64
+ }
65
+ function reportedFailure(failure, slug, message) {
66
+ if (isChatError(failure)) return failure;
67
+ if (APICallError.isInstance(failure) && failure.statusCode === 429) {
68
+ const value = Object.entries(failure.responseHeaders ?? {}).find(([key]) => key.toLowerCase() === "retry-after")?.[1]?.trim();
69
+ const deadline = value ? /^\d+$/.test(value) ? Date.now() + Number(value) * 1e3 : Date.parse(value) : void 0;
70
+ return new ChatError(
71
+ "ai-chat/rate-limited",
72
+ "The model is receiving too many requests.",
73
+ void 0,
74
+ deadline
75
+ );
76
+ }
77
+ return new ChatError(slug, message);
78
+ }
79
+ export {
80
+ ended,
81
+ messagesOf,
82
+ refusal,
83
+ requestedTurn,
84
+ streamRefusal
85
+ };
@@ -0,0 +1,10 @@
1
+ import { type ChatSelection } from "./choices";
2
+ import type { ChatConfig } from "./turn";
3
+ /** A browser may choose only declared alternatives and may disable only optional tools. */
4
+ export declare function selectChat(config: ChatConfig, given: unknown): {
5
+ model: import("./turn").ChatModel;
6
+ modelId: string | undefined;
7
+ selection: ChatSelection;
8
+ activeTools: string[] | undefined;
9
+ contextWindow: number | null;
10
+ };
@@ -0,0 +1,49 @@
1
+ import { ChatError } from "./errors.js";
2
+ import { choicesOf, contextWindowOf } from "./choices.js";
3
+ const invalid = () => {
4
+ throw new ChatError(
5
+ "ai-chat/invalid-request",
6
+ "That model or tool selection is unavailable."
7
+ );
8
+ };
9
+ function selectChat(config, given) {
10
+ if (given !== void 0 && (!given || typeof given !== "object" || Array.isArray(given)))
11
+ invalid();
12
+ const value = given ?? {};
13
+ if (Object.keys(value).some((key) => key !== "model" && key !== "tools"))
14
+ invalid();
15
+ if (value.model !== void 0 && (typeof value.model !== "string" || value.model.length > 128))
16
+ invalid();
17
+ const modelId = value.model;
18
+ if (modelId && !Object.hasOwn(config.models ?? {}, modelId)) invalid();
19
+ const choice = modelId ? config.models[modelId] : void 0;
20
+ const available = choicesOf(config)?.tools;
21
+ if (value.tools !== void 0 && (!available || !Array.isArray(value.tools) || value.tools.length > available.length || value.tools.some(
22
+ (id) => typeof id !== "string" || !available.some((tool) => tool.id === id)
23
+ ) || new Set(value.tools).size !== value.tools.length))
24
+ invalid();
25
+ const selected = value.tools;
26
+ const optional = selected ?? available?.filter((tool) => tool.defaultEnabled).map((tool) => tool.id);
27
+ const activeTools = available ? [
28
+ ...Object.keys(config.tools ?? {}).filter(
29
+ (id) => !available.some((tool) => tool.id === id)
30
+ ),
31
+ ...optional ?? []
32
+ ] : void 0;
33
+ const selection = {
34
+ ...modelId ? { model: modelId } : {},
35
+ ...optional ? { tools: [...optional] } : {}
36
+ };
37
+ return {
38
+ model: choice?.model ?? config.model,
39
+ modelId,
40
+ selection,
41
+ activeTools,
42
+ contextWindow: contextWindowOf(
43
+ choice ? choice.contextWindow : config.contextWindow
44
+ )
45
+ };
46
+ }
47
+ export {
48
+ selectChat
49
+ };
@@ -0,0 +1,11 @@
1
+ import type { AiChatMessage } from "./messages";
2
+ export type ChatSource = {
3
+ key: string;
4
+ number: number;
5
+ title: string;
6
+ href: string | null;
7
+ detail: string;
8
+ };
9
+ /** Only web URLs are navigable citations; document references still carry useful provenance. */
10
+ export declare function sourceHref(value: string): string | null;
11
+ export declare function sourcesOf(message: AiChatMessage): ChatSource[];
@@ -0,0 +1,29 @@
1
+ function sourceHref(value) {
2
+ try {
3
+ const url = new URL(value);
4
+ return ["http:", "https:"].includes(url.protocol) && !url.username && !url.password ? url.href : null;
5
+ } catch {
6
+ return null;
7
+ }
8
+ }
9
+ function sourcesOf(message) {
10
+ const found = /* @__PURE__ */ new Map();
11
+ for (const part of message.parts) {
12
+ if (part.type !== "source-url" && part.type !== "source-document") continue;
13
+ const key = `${part.type}:${part.sourceId}`;
14
+ const previous = found.get(key);
15
+ const href = part.type === "source-url" ? sourceHref(part.url) : null;
16
+ found.set(key, {
17
+ key,
18
+ number: previous?.number ?? found.size + 1,
19
+ title: part.title?.trim() || (part.type === "source-document" ? part.filename ?? part.sourceId : href ?? part.sourceId),
20
+ href,
21
+ detail: part.type === "source-document" ? [part.filename, part.mediaType].filter(Boolean).join(" \xB7 ") : href ?? part.url
22
+ });
23
+ }
24
+ return [...found.values()];
25
+ }
26
+ export {
27
+ sourceHref,
28
+ sourcesOf
29
+ };
@@ -0,0 +1,11 @@
1
+ import type { ToolSet } from "ai";
2
+ /**
3
+ * The SDK's own tool set, so a tool is typed where it is written.
4
+ *
5
+ * `config.ts` declares tools with `tool({ description, inputSchema, execute })`, and this is
6
+ * what makes `inputSchema`'s type flow into `execute`'s argument: the contract could not
7
+ * have said it, because a structural copy of a schema type is a second definition of
8
+ * something the SDK already owns, and it would be wrong by the next release.
9
+ * → services/ai-chat/tools.ts in the contract
10
+ */
11
+ export type ChatToolSet = ToolSet;
File without changes
@@ -0,0 +1,84 @@
1
+ import type { LanguageModel, LanguageModelCallOptions, UIMessageStreamOnEndCallback } from "ai";
2
+ import type { AiChatMessage } from "./messages";
3
+ import type { ChatModelOption, ChatToolOption, ChatSelection } from "./choices";
4
+ import type { ChatToolSet } from "./tools";
5
+ /**
6
+ * The model a chat answers with.
7
+ *
8
+ * An id is plain text on purpose: a union would have to name every model every provider
9
+ * offers, and would be wrong about fine-tunes, previews and anything released after this
10
+ * file. The installed backend turns it into a model with its own provider and credentials.
11
+ * A model object built elsewhere — a test double, a provider you configured yourself — is
12
+ * used as it is, which is what the AI SDK's own `model` option accepts.
13
+ */
14
+ export type ChatModel = string | Exclude<LanguageModel, string>;
15
+ /** Who is asking, as little of them as a chat needs to decide. */
16
+ export type ChatActor = {
17
+ id: string | null;
18
+ organizationId?: string | null;
19
+ };
20
+ export type ChatRequestContext = {
21
+ chat: string;
22
+ actor: ChatActor;
23
+ /** `request.signal` carries the client's abort; a long turn has to honour it. */
24
+ request: Request;
25
+ /** The whole conversation, as the SDK's transport sent it: a turn keeps nothing between requests. */
26
+ messages: AiChatMessage[];
27
+ /** Validated choices for this turn, never the raw browser payload. */
28
+ selection?: ChatSelection;
29
+ };
30
+ /** A configured value, or one the request decides — a per-tenant system prompt, say. */
31
+ export type FromContext<T> = T | ((context: ChatRequestContext) => T | Promise<T>);
32
+ /**
33
+ * How hard a model thinks before it answers, in the AI SDK's own levels, so one chat means
34
+ * the same thing on every provider: OpenAI hears an effort, Anthropic a thinking budget.
35
+ */
36
+ export type ChatReasoning = LanguageModelCallOptions["reasoning"];
37
+ /** The SDK's own account of a finished turn: every message, the answer, and whether it was stopped. */
38
+ export type ChatTurnEnd = Parameters<UIMessageStreamOnEndCallback<AiChatMessage>>[0];
39
+ export type ChatConfig = {
40
+ model: ChatModel;
41
+ /** Explicit alternatives; omitted means the default model cannot be changed. */
42
+ models?: Readonly<Record<string, ChatModelOption>>;
43
+ /** Host-declared capacity of the default model; absent remains unknown. */
44
+ contextWindow?: number;
45
+ /** Only these configured tools can be disabled by the caller. Other tools stay required. */
46
+ toolChoices?: readonly ChatToolOption[];
47
+ system?: FromContext<string>;
48
+ temperature?: number;
49
+ /** Thinking counts against it, so a chat that reasons needs room for both. */
50
+ maxOutputTokens?: number;
51
+ /**
52
+ * Asking for a level is also asking to see the thinking. Left unset, a reasoning model
53
+ * still thinks — the tokens are spent and billed — but in silence, and `Chat.PartReasoning`
54
+ * has nothing to draw. A model that cannot reason ignores it.
55
+ */
56
+ reasoning?: ChatReasoning;
57
+ /** What this chat may call, typed by the installed backend. → services/ai-chat/tools.ts */
58
+ tools?: ChatToolSet;
59
+ /**
60
+ * How many model calls one turn may take, which is what makes a turn an agent.
61
+ *
62
+ * A number rather than the SDK's stop condition: every backend can honour a count, and a
63
+ * closure written here would be a closure only one of them understands. One, the default,
64
+ * is a chat; more than one is a loop that calls a tool and reads its output.
65
+ */
66
+ maxSteps?: number;
67
+ /**
68
+ * Where persistence and metering hang, and why this contract stores nothing.
69
+ *
70
+ * It is the SDK's `onEnd`, with who asked beside it, and it fires for stopped turns too —
71
+ * `isAborted`, and the partial answer as `responseMessage`: an app that saved only
72
+ * completed turns would lose exactly the answers someone stopped because they were
73
+ * already enough. What the turn cost is on `responseMessage.metadata.usage`, where the
74
+ * provider counted it.
75
+ */
76
+ onEnd?(end: ChatTurnEnd, context: ChatRequestContext): void | Promise<void>;
77
+ };
78
+ /**
79
+ * The chats this app has, keyed by the slug that appears in the URL.
80
+ *
81
+ * The key is the API: a screen says `name="support"`, the route answers on
82
+ * `/api/chat/support`, and `config.ts` is where you look. One name, three places.
83
+ */
84
+ export type ChatConfigMap = Record<string, ChatConfig>;
File without changes
@@ -0,0 +1,23 @@
1
+ /**
2
+ * What a chat backend is, whichever model answers.
3
+ *
4
+ * The messages, their parts and the stream that carries them are the AI SDK's own
5
+ * (`UIMessage`, `UIMessageChunk`, `ChatTransport`); what is here is only what the SDK leaves
6
+ * to an app — the metadata a route writes, the refusals it can answer with, and how a chat
7
+ * is configured — because this is the one file the layers above may read.
8
+ */
9
+ export * from "./errors";
10
+ export * from "./messages";
11
+ export * from "./ports";
12
+ export * from "./tools";
13
+ export * from "./turn";
14
+ export * from "./approval";
15
+ export * from "./approval-memory";
16
+ export * from "./questions";
17
+ export * from "./continue";
18
+ export * from "./sources";
19
+ export * from "./media";
20
+ export * from "./branches";
21
+ export * from "./chat-session";
22
+ export * from "./choices";
23
+ export * from "./selection";
@@ -0,0 +1,15 @@
1
+ export * from "./errors.js";
2
+ export * from "./messages.js";
3
+ export * from "./ports.js";
4
+ export * from "./tools.js";
5
+ export * from "./turn.js";
6
+ export * from "./approval.js";
7
+ export * from "./approval-memory.js";
8
+ export * from "./questions.js";
9
+ export * from "./continue.js";
10
+ export * from "./sources.js";
11
+ export * from "./media.js";
12
+ export * from "./branches.js";
13
+ export * from "./chat-session.js";
14
+ export * from "./choices.js";
15
+ export * from "./selection.js";