@assistant-ui/core 0.2.4 → 0.2.6

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 (841) hide show
  1. package/dist/adapters/attachment.d.ts +43 -39
  2. package/dist/adapters/attachment.d.ts.map +1 -1
  3. package/dist/adapters/attachment.js +148 -183
  4. package/dist/adapters/attachment.js.map +1 -1
  5. package/dist/adapters/directive-formatter.d.ts +6 -2
  6. package/dist/adapters/directive-formatter.d.ts.map +1 -1
  7. package/dist/adapters/directive-formatter.js +36 -33
  8. package/dist/adapters/directive-formatter.js.map +1 -1
  9. package/dist/adapters/feedback.d.ts +9 -6
  10. package/dist/adapters/feedback.d.ts.map +1 -1
  11. package/dist/adapters/feedback.js +0 -2
  12. package/dist/adapters/index.d.ts +9 -13
  13. package/dist/adapters/index.js +5 -6
  14. package/dist/adapters/speech.d.ts +66 -63
  15. package/dist/adapters/speech.d.ts.map +1 -1
  16. package/dist/adapters/speech.js +170 -174
  17. package/dist/adapters/speech.js.map +1 -1
  18. package/dist/adapters/suggestion.d.ts +9 -6
  19. package/dist/adapters/suggestion.d.ts.map +1 -1
  20. package/dist/adapters/suggestion.js +0 -2
  21. package/dist/adapters/thread-history.d.ts +40 -37
  22. package/dist/adapters/thread-history.d.ts.map +1 -1
  23. package/dist/adapters/thread-history.js +0 -2
  24. package/dist/adapters/trigger.d.ts +9 -8
  25. package/dist/adapters/trigger.d.ts.map +1 -1
  26. package/dist/adapters/trigger.js +0 -2
  27. package/dist/adapters/voice.d.ts +46 -42
  28. package/dist/adapters/voice.d.ts.map +1 -1
  29. package/dist/adapters/voice.js +98 -107
  30. package/dist/adapters/voice.js.map +1 -1
  31. package/dist/index.d.ts +45 -53
  32. package/dist/index.js +16 -20
  33. package/dist/internal.d.ts +37 -8
  34. package/dist/internal.js +34 -18
  35. package/dist/model-context/frame/host.d.ts +23 -19
  36. package/dist/model-context/frame/host.d.ts.map +1 -1
  37. package/dist/model-context/frame/host.js +121 -135
  38. package/dist/model-context/frame/host.js.map +1 -1
  39. package/dist/model-context/frame/provider.d.ts +20 -16
  40. package/dist/model-context/frame/provider.d.ts.map +1 -1
  41. package/dist/model-context/frame/provider.js +115 -126
  42. package/dist/model-context/frame/provider.js.map +1 -1
  43. package/dist/model-context/frame/types.d.ts +25 -22
  44. package/dist/model-context/frame/types.d.ts.map +1 -1
  45. package/dist/model-context/frame/types.js +5 -1
  46. package/dist/model-context/frame/types.js.map +1 -1
  47. package/dist/model-context/registry-handles.d.ts +13 -9
  48. package/dist/model-context/registry-handles.d.ts.map +1 -1
  49. package/dist/model-context/registry-handles.js +0 -2
  50. package/dist/model-context/registry.d.ts +19 -15
  51. package/dist/model-context/registry.d.ts.map +1 -1
  52. package/dist/model-context/registry.js +93 -107
  53. package/dist/model-context/registry.js.map +1 -1
  54. package/dist/model-context/tool.d.ts +6 -2
  55. package/dist/model-context/tool.d.ts.map +1 -1
  56. package/dist/model-context/tool.js +30 -27
  57. package/dist/model-context/tool.js.map +1 -1
  58. package/dist/model-context/types.d.ts +37 -33
  59. package/dist/model-context/types.d.ts.map +1 -1
  60. package/dist/model-context/types.js +24 -38
  61. package/dist/model-context/types.js.map +1 -1
  62. package/dist/react/AssistantProvider.d.ts +12 -8
  63. package/dist/react/AssistantProvider.d.ts.map +1 -1
  64. package/dist/react/AssistantProvider.js +16 -9
  65. package/dist/react/AssistantProvider.js.map +1 -1
  66. package/dist/react/AssistantRuntimeProvider.d.ts +26 -18
  67. package/dist/react/AssistantRuntimeProvider.d.ts.map +1 -1
  68. package/dist/react/AssistantRuntimeProvider.js +33 -25
  69. package/dist/react/AssistantRuntimeProvider.js.map +1 -1
  70. package/dist/react/RuntimeAdapter.d.ts +5 -2
  71. package/dist/react/RuntimeAdapter.d.ts.map +1 -1
  72. package/dist/react/RuntimeAdapter.js +11 -11
  73. package/dist/react/RuntimeAdapter.js.map +1 -1
  74. package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts +14 -11
  75. package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts.map +1 -1
  76. package/dist/react/adapters/LocalStorageThreadListAdapter.js +136 -147
  77. package/dist/react/adapters/LocalStorageThreadListAdapter.js.map +1 -1
  78. package/dist/react/adapters/TitleGenerationAdapter.d.ts +8 -4
  79. package/dist/react/adapters/TitleGenerationAdapter.d.ts.map +1 -1
  80. package/dist/react/adapters/TitleGenerationAdapter.js +13 -13
  81. package/dist/react/adapters/TitleGenerationAdapter.js.map +1 -1
  82. package/dist/react/client/DataRenderers.d.ts +6 -2
  83. package/dist/react/client/DataRenderers.d.ts.map +1 -1
  84. package/dist/react/client/DataRenderers.js +53 -51
  85. package/dist/react/client/DataRenderers.js.map +1 -1
  86. package/dist/react/client/Interactables.d.ts +6 -2
  87. package/dist/react/client/Interactables.d.ts.map +1 -1
  88. package/dist/react/client/Interactables.js +251 -257
  89. package/dist/react/client/Interactables.js.map +1 -1
  90. package/dist/react/client/Tools.d.ts +13 -14
  91. package/dist/react/client/Tools.d.ts.map +1 -1
  92. package/dist/react/client/Tools.js +57 -68
  93. package/dist/react/client/Tools.js.map +1 -1
  94. package/dist/react/client/interactable-model-context.d.ts +10 -6
  95. package/dist/react/client/interactable-model-context.d.ts.map +1 -1
  96. package/dist/react/client/interactable-model-context.js +51 -59
  97. package/dist/react/client/interactable-model-context.js.map +1 -1
  98. package/dist/react/index.d.ts +96 -90
  99. package/dist/react/index.js +89 -96
  100. package/dist/react/model-context/makeAssistantDataUI.d.ts +9 -6
  101. package/dist/react/model-context/makeAssistantDataUI.d.ts.map +1 -1
  102. package/dist/react/model-context/makeAssistantDataUI.js +17 -13
  103. package/dist/react/model-context/makeAssistantDataUI.js.map +1 -1
  104. package/dist/react/model-context/makeAssistantTool.d.ts +9 -6
  105. package/dist/react/model-context/makeAssistantTool.d.ts.map +1 -1
  106. package/dist/react/model-context/makeAssistantTool.js +18 -14
  107. package/dist/react/model-context/makeAssistantTool.js.map +1 -1
  108. package/dist/react/model-context/makeAssistantToolUI.d.ts +9 -6
  109. package/dist/react/model-context/makeAssistantToolUI.d.ts.map +1 -1
  110. package/dist/react/model-context/makeAssistantToolUI.js +19 -15
  111. package/dist/react/model-context/makeAssistantToolUI.js.map +1 -1
  112. package/dist/react/model-context/toolbox.d.ts +13 -11
  113. package/dist/react/model-context/toolbox.d.ts.map +1 -1
  114. package/dist/react/model-context/toolbox.js +0 -2
  115. package/dist/react/model-context/useAssistantContext.d.ts +5 -3
  116. package/dist/react/model-context/useAssistantContext.d.ts.map +1 -1
  117. package/dist/react/model-context/useAssistantContext.js +13 -14
  118. package/dist/react/model-context/useAssistantContext.js.map +1 -1
  119. package/dist/react/model-context/useAssistantDataUI.d.ts +9 -7
  120. package/dist/react/model-context/useAssistantDataUI.d.ts.map +1 -1
  121. package/dist/react/model-context/useAssistantDataUI.js +19 -12
  122. package/dist/react/model-context/useAssistantDataUI.js.map +1 -1
  123. package/dist/react/model-context/useAssistantInstructions.d.ts +5 -3
  124. package/dist/react/model-context/useAssistantInstructions.d.ts.map +1 -1
  125. package/dist/react/model-context/useAssistantInstructions.js +18 -16
  126. package/dist/react/model-context/useAssistantInstructions.js.map +1 -1
  127. package/dist/react/model-context/useAssistantInteractable.d.ts +12 -8
  128. package/dist/react/model-context/useAssistantInteractable.d.ts.map +1 -1
  129. package/dist/react/model-context/useAssistantInteractable.js +36 -26
  130. package/dist/react/model-context/useAssistantInteractable.js.map +1 -1
  131. package/dist/react/model-context/useAssistantTool.d.ts +9 -6
  132. package/dist/react/model-context/useAssistantTool.d.ts.map +1 -1
  133. package/dist/react/model-context/useAssistantTool.js +48 -47
  134. package/dist/react/model-context/useAssistantTool.js.map +1 -1
  135. package/dist/react/model-context/useAssistantToolUI.d.ts +9 -7
  136. package/dist/react/model-context/useAssistantToolUI.d.ts.map +1 -1
  137. package/dist/react/model-context/useAssistantToolUI.js +22 -15
  138. package/dist/react/model-context/useAssistantToolUI.js.map +1 -1
  139. package/dist/react/model-context/useInlineRender.d.ts +7 -3
  140. package/dist/react/model-context/useInlineRender.d.ts.map +1 -1
  141. package/dist/react/model-context/useInlineRender.js +12 -12
  142. package/dist/react/model-context/useInlineRender.js.map +1 -1
  143. package/dist/react/model-context/useInteractableState.d.ts +9 -7
  144. package/dist/react/model-context/useInteractableState.d.ts.map +1 -1
  145. package/dist/react/model-context/useInteractableState.js +29 -31
  146. package/dist/react/model-context/useInteractableState.js.map +1 -1
  147. package/dist/react/model-context/useToolArgsStatus.d.ts +7 -7
  148. package/dist/react/model-context/useToolArgsStatus.d.ts.map +1 -1
  149. package/dist/react/model-context/useToolArgsStatus.js +44 -50
  150. package/dist/react/model-context/useToolArgsStatus.js.map +1 -1
  151. package/dist/react/primitive-hooks/useActionBarCopy.d.ts +13 -7
  152. package/dist/react/primitive-hooks/useActionBarCopy.d.ts.map +1 -1
  153. package/dist/react/primitive-hooks/useActionBarCopy.js +31 -23
  154. package/dist/react/primitive-hooks/useActionBarCopy.js.map +1 -1
  155. package/dist/react/primitive-hooks/useActionBarEdit.d.ts +6 -3
  156. package/dist/react/primitive-hooks/useActionBarEdit.d.ts.map +1 -1
  157. package/dist/react/primitive-hooks/useActionBarEdit.js +13 -7
  158. package/dist/react/primitive-hooks/useActionBarEdit.js.map +1 -1
  159. package/dist/react/primitive-hooks/useActionBarFeedback.d.ts +9 -6
  160. package/dist/react/primitive-hooks/useActionBarFeedback.d.ts.map +1 -1
  161. package/dist/react/primitive-hooks/useActionBarFeedback.js +22 -14
  162. package/dist/react/primitive-hooks/useActionBarFeedback.js.map +1 -1
  163. package/dist/react/primitive-hooks/useActionBarReload.d.ts +6 -3
  164. package/dist/react/primitive-hooks/useActionBarReload.d.ts.map +1 -1
  165. package/dist/react/primitive-hooks/useActionBarReload.js +13 -9
  166. package/dist/react/primitive-hooks/useActionBarReload.js.map +1 -1
  167. package/dist/react/primitive-hooks/useActionBarSpeak.d.ts +6 -3
  168. package/dist/react/primitive-hooks/useActionBarSpeak.d.ts.map +1 -1
  169. package/dist/react/primitive-hooks/useActionBarSpeak.js +15 -11
  170. package/dist/react/primitive-hooks/useActionBarSpeak.js.map +1 -1
  171. package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts +6 -3
  172. package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts.map +1 -1
  173. package/dist/react/primitive-hooks/useActionBarStopSpeaking.js +13 -7
  174. package/dist/react/primitive-hooks/useActionBarStopSpeaking.js.map +1 -1
  175. package/dist/react/primitive-hooks/useBranchPickerNext.d.ts +6 -3
  176. package/dist/react/primitive-hooks/useBranchPickerNext.d.ts.map +1 -1
  177. package/dist/react/primitive-hooks/useBranchPickerNext.js +17 -14
  178. package/dist/react/primitive-hooks/useBranchPickerNext.js.map +1 -1
  179. package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts +6 -3
  180. package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts.map +1 -1
  181. package/dist/react/primitive-hooks/useBranchPickerPrevious.js +17 -14
  182. package/dist/react/primitive-hooks/useBranchPickerPrevious.js.map +1 -1
  183. package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts +8 -4
  184. package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts.map +1 -1
  185. package/dist/react/primitive-hooks/useComposerAddAttachment.js +13 -7
  186. package/dist/react/primitive-hooks/useComposerAddAttachment.js.map +1 -1
  187. package/dist/react/primitive-hooks/useComposerCancel.d.ts +6 -3
  188. package/dist/react/primitive-hooks/useComposerCancel.d.ts.map +1 -1
  189. package/dist/react/primitive-hooks/useComposerCancel.js +13 -7
  190. package/dist/react/primitive-hooks/useComposerCancel.js.map +1 -1
  191. package/dist/react/primitive-hooks/useComposerDictate.d.ts +6 -3
  192. package/dist/react/primitive-hooks/useComposerDictate.d.ts.map +1 -1
  193. package/dist/react/primitive-hooks/useComposerDictate.js +13 -9
  194. package/dist/react/primitive-hooks/useComposerDictate.js.map +1 -1
  195. package/dist/react/primitive-hooks/useComposerSend.d.ts +8 -4
  196. package/dist/react/primitive-hooks/useComposerSend.d.ts.map +1 -1
  197. package/dist/react/primitive-hooks/useComposerSend.js +13 -8
  198. package/dist/react/primitive-hooks/useComposerSend.js.map +1 -1
  199. package/dist/react/primitive-hooks/useEditComposerCancel.d.ts +5 -2
  200. package/dist/react/primitive-hooks/useEditComposerCancel.d.ts.map +1 -1
  201. package/dist/react/primitive-hooks/useEditComposerCancel.js +9 -6
  202. package/dist/react/primitive-hooks/useEditComposerCancel.js.map +1 -1
  203. package/dist/react/primitive-hooks/useEditComposerSend.d.ts +6 -3
  204. package/dist/react/primitive-hooks/useEditComposerSend.d.ts.map +1 -1
  205. package/dist/react/primitive-hooks/useEditComposerSend.js +13 -7
  206. package/dist/react/primitive-hooks/useEditComposerSend.js.map +1 -1
  207. package/dist/react/primitive-hooks/useMessageBranching.d.ts +8 -5
  208. package/dist/react/primitive-hooks/useMessageBranching.d.ts.map +1 -1
  209. package/dist/react/primitive-hooks/useMessageBranching.js +16 -11
  210. package/dist/react/primitive-hooks/useMessageBranching.js.map +1 -1
  211. package/dist/react/primitive-hooks/useMessageError.d.ts +4 -1
  212. package/dist/react/primitive-hooks/useMessageError.d.ts.map +1 -1
  213. package/dist/react/primitive-hooks/useMessageError.js +6 -5
  214. package/dist/react/primitive-hooks/useMessageError.js.map +1 -1
  215. package/dist/react/primitive-hooks/useMessageReload.d.ts +6 -3
  216. package/dist/react/primitive-hooks/useMessageReload.d.ts.map +1 -1
  217. package/dist/react/primitive-hooks/useMessageReload.js +13 -7
  218. package/dist/react/primitive-hooks/useMessageReload.js.map +1 -1
  219. package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts +14 -7
  220. package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts.map +1 -1
  221. package/dist/react/primitive-hooks/useSuggestionTrigger.js +33 -28
  222. package/dist/react/primitive-hooks/useSuggestionTrigger.js.map +1 -1
  223. package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts +4 -1
  224. package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts.map +1 -1
  225. package/dist/react/primitive-hooks/useThreadIsEmpty.js +6 -2
  226. package/dist/react/primitive-hooks/useThreadIsEmpty.js.map +1 -1
  227. package/dist/react/primitive-hooks/useThreadIsRunning.d.ts +4 -1
  228. package/dist/react/primitive-hooks/useThreadIsRunning.d.ts.map +1 -1
  229. package/dist/react/primitive-hooks/useThreadIsRunning.js +6 -2
  230. package/dist/react/primitive-hooks/useThreadIsRunning.js.map +1 -1
  231. package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts +5 -2
  232. package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts.map +1 -1
  233. package/dist/react/primitive-hooks/useThreadListItemArchive.js +9 -6
  234. package/dist/react/primitive-hooks/useThreadListItemArchive.js.map +1 -1
  235. package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts +5 -2
  236. package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts.map +1 -1
  237. package/dist/react/primitive-hooks/useThreadListItemDelete.js +9 -6
  238. package/dist/react/primitive-hooks/useThreadListItemDelete.js.map +1 -1
  239. package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts +5 -2
  240. package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts.map +1 -1
  241. package/dist/react/primitive-hooks/useThreadListItemTrigger.js +9 -6
  242. package/dist/react/primitive-hooks/useThreadListItemTrigger.js.map +1 -1
  243. package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts +5 -2
  244. package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts.map +1 -1
  245. package/dist/react/primitive-hooks/useThreadListItemUnarchive.js +9 -6
  246. package/dist/react/primitive-hooks/useThreadListItemUnarchive.js.map +1 -1
  247. package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts +6 -3
  248. package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts.map +1 -1
  249. package/dist/react/primitive-hooks/useThreadListLoadMore.js +13 -7
  250. package/dist/react/primitive-hooks/useThreadListLoadMore.js.map +1 -1
  251. package/dist/react/primitive-hooks/useThreadListNew.d.ts +5 -2
  252. package/dist/react/primitive-hooks/useThreadListNew.d.ts.map +1 -1
  253. package/dist/react/primitive-hooks/useThreadListNew.js +9 -6
  254. package/dist/react/primitive-hooks/useThreadListNew.js.map +1 -1
  255. package/dist/react/primitive-hooks/useThreadMessages.d.ts +6 -2
  256. package/dist/react/primitive-hooks/useThreadMessages.d.ts.map +1 -1
  257. package/dist/react/primitive-hooks/useThreadMessages.js +6 -2
  258. package/dist/react/primitive-hooks/useThreadMessages.js.map +1 -1
  259. package/dist/react/primitive-hooks/useVoice.d.ts +12 -8
  260. package/dist/react/primitive-hooks/useVoice.d.ts.map +1 -1
  261. package/dist/react/primitive-hooks/useVoice.js +25 -21
  262. package/dist/react/primitive-hooks/useVoice.js.map +1 -1
  263. package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts +26 -27
  264. package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -1
  265. package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.js +30 -28
  266. package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.js.map +1 -1
  267. package/dist/react/primitives/composer/ComposerAttachments.d.ts +27 -26
  268. package/dist/react/primitives/composer/ComposerAttachments.d.ts.map +1 -1
  269. package/dist/react/primitives/composer/ComposerAttachments.js +44 -48
  270. package/dist/react/primitives/composer/ComposerAttachments.js.map +1 -1
  271. package/dist/react/primitives/composer/ComposerIf.d.ts +12 -13
  272. package/dist/react/primitives/composer/ComposerIf.d.ts.map +1 -1
  273. package/dist/react/primitives/composer/ComposerIf.js +16 -17
  274. package/dist/react/primitives/composer/ComposerIf.js.map +1 -1
  275. package/dist/react/primitives/composer/ComposerQueue.d.ts +16 -13
  276. package/dist/react/primitives/composer/ComposerQueue.d.ts.map +1 -1
  277. package/dist/react/primitives/composer/ComposerQueue.js +31 -23
  278. package/dist/react/primitives/composer/ComposerQueue.js.map +1 -1
  279. package/dist/react/primitives/generativeUI/GenerativeUI.d.ts +64 -0
  280. package/dist/react/primitives/generativeUI/GenerativeUI.d.ts.map +1 -0
  281. package/dist/react/primitives/generativeUI/GenerativeUI.js +91 -0
  282. package/dist/react/primitives/generativeUI/GenerativeUI.js.map +1 -0
  283. package/dist/react/primitives/message/MessageAttachments.d.ts +27 -26
  284. package/dist/react/primitives/message/MessageAttachments.d.ts.map +1 -1
  285. package/dist/react/primitives/message/MessageAttachments.js +47 -52
  286. package/dist/react/primitives/message/MessageAttachments.js.map +1 -1
  287. package/dist/react/primitives/message/MessageGroupedParts.d.ts +82 -71
  288. package/dist/react/primitives/message/MessageGroupedParts.d.ts.map +1 -1
  289. package/dist/react/primitives/message/MessageGroupedParts.js +63 -61
  290. package/dist/react/primitives/message/MessageGroupedParts.js.map +1 -1
  291. package/dist/react/primitives/message/MessageParts.d.ts +148 -145
  292. package/dist/react/primitives/message/MessageParts.d.ts.map +1 -1
  293. package/dist/react/primitives/message/MessageParts.js +363 -335
  294. package/dist/react/primitives/message/MessageParts.js.map +1 -1
  295. package/dist/react/primitives/message/MessageQuote.d.ts +11 -8
  296. package/dist/react/primitives/message/MessageQuote.d.ts.map +1 -1
  297. package/dist/react/primitives/message/MessageQuote.js +24 -21
  298. package/dist/react/primitives/message/MessageQuote.js.map +1 -1
  299. package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts +8 -4
  300. package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts.map +1 -1
  301. package/dist/react/primitives/messagePart/MessagePartInProgress.js +6 -3
  302. package/dist/react/primitives/messagePart/MessagePartInProgress.js.map +1 -1
  303. package/dist/react/primitives/part/PartMessages.d.ts +16 -13
  304. package/dist/react/primitives/part/PartMessages.d.ts.map +1 -1
  305. package/dist/react/primitives/part/PartMessages.js +45 -41
  306. package/dist/react/primitives/part/PartMessages.js.map +1 -1
  307. package/dist/react/primitives/thread/ThreadMessages.d.ts +40 -55
  308. package/dist/react/primitives/thread/ThreadMessages.d.ts.map +1 -1
  309. package/dist/react/primitives/thread/ThreadMessages.js +58 -92
  310. package/dist/react/primitives/thread/ThreadMessages.js.map +1 -1
  311. package/dist/react/primitives/thread/ThreadSuggestions.d.ts +25 -25
  312. package/dist/react/primitives/thread/ThreadSuggestions.d.ts.map +1 -1
  313. package/dist/react/primitives/thread/ThreadSuggestions.js +39 -35
  314. package/dist/react/primitives/thread/ThreadSuggestions.js.map +1 -1
  315. package/dist/react/primitives/threadList/ThreadListItems.d.ts +27 -26
  316. package/dist/react/primitives/threadList/ThreadListItems.d.ts.map +1 -1
  317. package/dist/react/primitives/threadList/ThreadListItems.js +47 -23
  318. package/dist/react/primitives/threadList/ThreadListItems.js.map +1 -1
  319. package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts +10 -6
  320. package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -1
  321. package/dist/react/primitives/threadListItem/ThreadListItemTitle.js +7 -4
  322. package/dist/react/primitives/threadListItem/ThreadListItemTitle.js.map +1 -1
  323. package/dist/react/providers/AttachmentByIndexProvider.d.ts +9 -5
  324. package/dist/react/providers/AttachmentByIndexProvider.d.ts.map +1 -1
  325. package/dist/react/providers/AttachmentByIndexProvider.js +30 -20
  326. package/dist/react/providers/AttachmentByIndexProvider.js.map +1 -1
  327. package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts +8 -4
  328. package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -1
  329. package/dist/react/providers/ChainOfThoughtByIndicesProvider.js +19 -17
  330. package/dist/react/providers/ChainOfThoughtByIndicesProvider.js.map +1 -1
  331. package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts +7 -3
  332. package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts.map +1 -1
  333. package/dist/react/providers/ChainOfThoughtPartByIndexProvider.js +18 -11
  334. package/dist/react/providers/ChainOfThoughtPartByIndexProvider.js.map +1 -1
  335. package/dist/react/providers/MessageByIndexProvider.d.ts +7 -3
  336. package/dist/react/providers/MessageByIndexProvider.d.ts.map +1 -1
  337. package/dist/react/providers/MessageByIndexProvider.js +25 -16
  338. package/dist/react/providers/MessageByIndexProvider.js.map +1 -1
  339. package/dist/react/providers/PartByIndexProvider.d.ts +7 -3
  340. package/dist/react/providers/PartByIndexProvider.d.ts.map +1 -1
  341. package/dist/react/providers/PartByIndexProvider.js +18 -11
  342. package/dist/react/providers/PartByIndexProvider.js.map +1 -1
  343. package/dist/react/providers/QueueItemByIndexProvider.d.ts +8 -4
  344. package/dist/react/providers/QueueItemByIndexProvider.d.ts.map +1 -1
  345. package/dist/react/providers/QueueItemByIndexProvider.js +14 -10
  346. package/dist/react/providers/QueueItemByIndexProvider.js.map +1 -1
  347. package/dist/react/providers/ReadonlyThreadProvider.d.ts +11 -7
  348. package/dist/react/providers/ReadonlyThreadProvider.d.ts.map +1 -1
  349. package/dist/react/providers/ReadonlyThreadProvider.js +46 -42
  350. package/dist/react/providers/ReadonlyThreadProvider.js.map +1 -1
  351. package/dist/react/providers/SuggestionByIndexProvider.d.ts +8 -4
  352. package/dist/react/providers/SuggestionByIndexProvider.d.ts.map +1 -1
  353. package/dist/react/providers/SuggestionByIndexProvider.js +14 -10
  354. package/dist/react/providers/SuggestionByIndexProvider.js.map +1 -1
  355. package/dist/react/providers/TextMessagePartProvider.d.ts +8 -4
  356. package/dist/react/providers/TextMessagePartProvider.d.ts.map +1 -1
  357. package/dist/react/providers/TextMessagePartProvider.js +32 -22
  358. package/dist/react/providers/TextMessagePartProvider.js.map +1 -1
  359. package/dist/react/providers/ThreadListItemByIndexProvider.d.ts +8 -4
  360. package/dist/react/providers/ThreadListItemByIndexProvider.d.ts.map +1 -1
  361. package/dist/react/providers/ThreadListItemByIndexProvider.js +22 -11
  362. package/dist/react/providers/ThreadListItemByIndexProvider.js.map +1 -1
  363. package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts +8 -4
  364. package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
  365. package/dist/react/providers/ThreadListItemRuntimeProvider.js +12 -8
  366. package/dist/react/providers/ThreadListItemRuntimeProvider.js.map +1 -1
  367. package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts +121 -109
  368. package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
  369. package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js +123 -129
  370. package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js.map +1 -1
  371. package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +149 -135
  372. package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
  373. package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js +460 -515
  374. package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
  375. package/dist/react/runtimes/RuntimeAdapterProvider.d.ts +19 -15
  376. package/dist/react/runtimes/RuntimeAdapterProvider.d.ts.map +1 -1
  377. package/dist/react/runtimes/RuntimeAdapterProvider.js +16 -9
  378. package/dist/react/runtimes/RuntimeAdapterProvider.js.map +1 -1
  379. package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts +8 -4
  380. package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
  381. package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js +372 -485
  382. package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
  383. package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts +19 -13
  384. package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts.map +1 -1
  385. package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js +83 -80
  386. package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js.map +1 -1
  387. package/dist/react/runtimes/cloud/auiV0.d.ts +61 -58
  388. package/dist/react/runtimes/cloud/auiV0.d.ts.map +1 -1
  389. package/dist/react/runtimes/cloud/auiV0.js +80 -87
  390. package/dist/react/runtimes/cloud/auiV0.js.map +1 -1
  391. package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts +10 -7
  392. package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts.map +1 -1
  393. package/dist/react/runtimes/cloud/useCloudThreadListAdapter.js +101 -101
  394. package/dist/react/runtimes/cloud/useCloudThreadListAdapter.js.map +1 -1
  395. package/dist/react/runtimes/createMessageConverter.d.ts +23 -14
  396. package/dist/react/runtimes/createMessageConverter.d.ts.map +1 -1
  397. package/dist/react/runtimes/createMessageConverter.js +43 -46
  398. package/dist/react/runtimes/createMessageConverter.js.map +1 -1
  399. package/dist/react/runtimes/external-message-converter.d.ts +40 -31
  400. package/dist/react/runtimes/external-message-converter.d.ts.map +1 -1
  401. package/dist/react/runtimes/external-message-converter.js +226 -296
  402. package/dist/react/runtimes/external-message-converter.js.map +1 -1
  403. package/dist/react/runtimes/useExternalStoreRuntime.d.ts +7 -3
  404. package/dist/react/runtimes/useExternalStoreRuntime.d.ts.map +1 -1
  405. package/dist/react/runtimes/useExternalStoreRuntime.js +18 -15
  406. package/dist/react/runtimes/useExternalStoreRuntime.js.map +1 -1
  407. package/dist/react/runtimes/useLocalRuntime.d.ts +41 -26
  408. package/dist/react/runtimes/useLocalRuntime.d.ts.map +1 -1
  409. package/dist/react/runtimes/useLocalRuntime.js +58 -67
  410. package/dist/react/runtimes/useLocalRuntime.js.map +1 -1
  411. package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts +7 -3
  412. package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts.map +1 -1
  413. package/dist/react/runtimes/useRemoteThreadListRuntime.js +51 -62
  414. package/dist/react/runtimes/useRemoteThreadListRuntime.js.map +1 -1
  415. package/dist/react/runtimes/useToolInvocations.d.ts +39 -34
  416. package/dist/react/runtimes/useToolInvocations.d.ts.map +1 -1
  417. package/dist/react/runtimes/useToolInvocations.js +371 -481
  418. package/dist/react/runtimes/useToolInvocations.js.map +1 -1
  419. package/dist/react/types/MessagePartComponentTypes.d.ts +73 -41
  420. package/dist/react/types/MessagePartComponentTypes.d.ts.map +1 -1
  421. package/dist/react/types/MessagePartComponentTypes.js +0 -2
  422. package/dist/react/types/scopes/dataRenderers.d.ts +15 -11
  423. package/dist/react/types/scopes/dataRenderers.d.ts.map +1 -1
  424. package/dist/react/types/scopes/dataRenderers.js +0 -2
  425. package/dist/react/types/scopes/interactables.d.ts +44 -42
  426. package/dist/react/types/scopes/interactables.d.ts.map +1 -1
  427. package/dist/react/types/scopes/interactables.js +0 -2
  428. package/dist/react/types/scopes/tools.d.ts +16 -12
  429. package/dist/react/types/scopes/tools.d.ts.map +1 -1
  430. package/dist/react/types/scopes/tools.js +0 -2
  431. package/dist/react/types/store-augmentation.d.ts +11 -9
  432. package/dist/react/types/store-augmentation.d.ts.map +1 -1
  433. package/dist/react/types/store-augmentation.js +0 -2
  434. package/dist/react/utils/getMessageQuote.d.ts +9 -6
  435. package/dist/react/utils/getMessageQuote.d.ts.map +1 -1
  436. package/dist/react/utils/getMessageQuote.js +8 -5
  437. package/dist/react/utils/getMessageQuote.js.map +1 -1
  438. package/dist/react/utils/groupParts.d.ts +59 -28
  439. package/dist/react/utils/groupParts.d.ts.map +1 -1
  440. package/dist/react/utils/groupParts.js +104 -89
  441. package/dist/react/utils/groupParts.js.map +1 -1
  442. package/dist/runtime/api/assistant-runtime.d.ts +32 -28
  443. package/dist/runtime/api/assistant-runtime.d.ts.map +1 -1
  444. package/dist/runtime/api/assistant-runtime.js +25 -22
  445. package/dist/runtime/api/assistant-runtime.js.map +1 -1
  446. package/dist/runtime/api/attachment-runtime.d.ts +48 -45
  447. package/dist/runtime/api/attachment-runtime.d.ts.map +1 -1
  448. package/dist/runtime/api/attachment-runtime.js +55 -52
  449. package/dist/runtime/api/attachment-runtime.js.map +1 -1
  450. package/dist/runtime/api/bindings.d.ts +30 -25
  451. package/dist/runtime/api/bindings.d.ts.map +1 -1
  452. package/dist/runtime/api/bindings.js +0 -2
  453. package/dist/runtime/api/composer-runtime.d.ts +184 -182
  454. package/dist/runtime/api/composer-runtime.d.ts.map +1 -1
  455. package/dist/runtime/api/composer-runtime.js +239 -245
  456. package/dist/runtime/api/composer-runtime.js.map +1 -1
  457. package/dist/runtime/api/message-part-runtime.d.ts +37 -27
  458. package/dist/runtime/api/message-part-runtime.d.ts.map +1 -1
  459. package/dist/runtime/api/message-part-runtime.js +74 -65
  460. package/dist/runtime/api/message-part-runtime.js.map +1 -1
  461. package/dist/runtime/api/message-runtime.d.ts +91 -80
  462. package/dist/runtime/api/message-runtime.d.ts.map +1 -1
  463. package/dist/runtime/api/message-runtime.js +169 -194
  464. package/dist/runtime/api/message-runtime.js.map +1 -1
  465. package/dist/runtime/api/paths.d.ts +57 -54
  466. package/dist/runtime/api/paths.d.ts.map +1 -1
  467. package/dist/runtime/api/paths.js +0 -2
  468. package/dist/runtime/api/thread-list-item-runtime.d.ts +68 -61
  469. package/dist/runtime/api/thread-list-item-runtime.d.ts.map +1 -1
  470. package/dist/runtime/api/thread-list-item-runtime.js +85 -84
  471. package/dist/runtime/api/thread-list-item-runtime.js.map +1 -1
  472. package/dist/runtime/api/thread-list-runtime.d.ts +57 -48
  473. package/dist/runtime/api/thread-list-runtime.d.ts.map +1 -1
  474. package/dist/runtime/api/thread-list-runtime.js +160 -147
  475. package/dist/runtime/api/thread-list-runtime.js.map +1 -1
  476. package/dist/runtime/api/thread-runtime.d.ts +279 -272
  477. package/dist/runtime/api/thread-runtime.d.ts.map +1 -1
  478. package/dist/runtime/api/thread-runtime.js +244 -244
  479. package/dist/runtime/api/thread-runtime.js.map +1 -1
  480. package/dist/runtime/base/base-assistant-runtime-core.d.ts +13 -9
  481. package/dist/runtime/base/base-assistant-runtime-core.d.ts.map +1 -1
  482. package/dist/runtime/base/base-assistant-runtime-core.js +13 -9
  483. package/dist/runtime/base/base-assistant-runtime-core.js.map +1 -1
  484. package/dist/runtime/base/base-composer-runtime-core.d.ts +60 -57
  485. package/dist/runtime/base/base-composer-runtime-core.d.ts.map +1 -1
  486. package/dist/runtime/base/base-composer-runtime-core.js +348 -392
  487. package/dist/runtime/base/base-composer-runtime-core.js.map +1 -1
  488. package/dist/runtime/base/base-thread-runtime-core.d.ts +90 -84
  489. package/dist/runtime/base/base-thread-runtime-core.d.ts.map +1 -1
  490. package/dist/runtime/base/base-thread-runtime-core.js +349 -357
  491. package/dist/runtime/base/base-thread-runtime-core.js.map +1 -1
  492. package/dist/runtime/base/default-edit-composer-runtime-core.d.ts +37 -30
  493. package/dist/runtime/base/default-edit-composer-runtime-core.d.ts.map +1 -1
  494. package/dist/runtime/base/default-edit-composer-runtime-core.js +70 -77
  495. package/dist/runtime/base/default-edit-composer-runtime-core.js.map +1 -1
  496. package/dist/runtime/base/default-thread-composer-runtime-core.d.ts +25 -21
  497. package/dist/runtime/base/default-thread-composer-runtime-core.d.ts.map +1 -1
  498. package/dist/runtime/base/default-thread-composer-runtime-core.js +51 -48
  499. package/dist/runtime/base/default-thread-composer-runtime-core.js.map +1 -1
  500. package/dist/runtime/interfaces/assistant-runtime-core.d.ts +12 -8
  501. package/dist/runtime/interfaces/assistant-runtime-core.d.ts.map +1 -1
  502. package/dist/runtime/interfaces/assistant-runtime-core.js +0 -2
  503. package/dist/runtime/interfaces/composer-runtime-core.d.ts +70 -67
  504. package/dist/runtime/interfaces/composer-runtime-core.d.ts.map +1 -1
  505. package/dist/runtime/interfaces/composer-runtime-core.js +0 -2
  506. package/dist/runtime/interfaces/thread-list-runtime-core.d.ts +45 -39
  507. package/dist/runtime/interfaces/thread-list-runtime-core.d.ts.map +1 -1
  508. package/dist/runtime/interfaces/thread-list-runtime-core.js +0 -2
  509. package/dist/runtime/interfaces/thread-runtime-core.d.ts +155 -145
  510. package/dist/runtime/interfaces/thread-runtime-core.d.ts.map +1 -1
  511. package/dist/runtime/interfaces/thread-runtime-core.js +0 -2
  512. package/dist/runtime/internal.d.ts +19 -23
  513. package/dist/runtime/internal.js +18 -22
  514. package/dist/runtime/utils/auto-status.d.ts +8 -4
  515. package/dist/runtime/utils/auto-status.d.ts.map +1 -1
  516. package/dist/runtime/utils/auto-status.js +18 -22
  517. package/dist/runtime/utils/auto-status.js.map +1 -1
  518. package/dist/runtime/utils/chat-model-adapter.d.ts +34 -31
  519. package/dist/runtime/utils/chat-model-adapter.d.ts.map +1 -1
  520. package/dist/runtime/utils/chat-model-adapter.js +0 -2
  521. package/dist/runtime/utils/external-store-message.d.ts +9 -5
  522. package/dist/runtime/utils/external-store-message.d.ts.map +1 -1
  523. package/dist/runtime/utils/external-store-message.js +21 -21
  524. package/dist/runtime/utils/external-store-message.js.map +1 -1
  525. package/dist/runtime/utils/message-repository.d.ts +48 -42
  526. package/dist/runtime/utils/message-repository.d.ts.map +1 -1
  527. package/dist/runtime/utils/message-repository.js +213 -267
  528. package/dist/runtime/utils/message-repository.js.map +1 -1
  529. package/dist/runtime/utils/thread-message-like.d.ts +51 -39
  530. package/dist/runtime/utils/thread-message-like.d.ts.map +1 -1
  531. package/dist/runtime/utils/thread-message-like.js +125 -139
  532. package/dist/runtime/utils/thread-message-like.js.map +1 -1
  533. package/dist/runtimes/assistant-transport/utils.d.ts +4 -1
  534. package/dist/runtimes/assistant-transport/utils.d.ts.map +1 -1
  535. package/dist/runtimes/assistant-transport/utils.js +9 -5
  536. package/dist/runtimes/assistant-transport/utils.js.map +1 -1
  537. package/dist/runtimes/external-store/external-store-adapter.d.ts +101 -97
  538. package/dist/runtimes/external-store/external-store-adapter.d.ts.map +1 -1
  539. package/dist/runtimes/external-store/external-store-adapter.js +0 -2
  540. package/dist/runtimes/external-store/external-store-runtime-core.d.ts +9 -5
  541. package/dist/runtimes/external-store/external-store-runtime-core.d.ts.map +1 -1
  542. package/dist/runtimes/external-store/external-store-runtime-core.js +16 -13
  543. package/dist/runtimes/external-store/external-store-runtime-core.js.map +1 -1
  544. package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts +46 -40
  545. package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts.map +1 -1
  546. package/dist/runtimes/external-store/external-store-thread-list-runtime-core.js +141 -171
  547. package/dist/runtimes/external-store/external-store-thread-list-runtime-core.js.map +1 -1
  548. package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts +54 -47
  549. package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts.map +1 -1
  550. package/dist/runtimes/external-store/external-store-thread-runtime-core.js +216 -288
  551. package/dist/runtimes/external-store/external-store-thread-runtime-core.js.map +1 -1
  552. package/dist/runtimes/external-store/thread-message-converter.d.ts +9 -5
  553. package/dist/runtimes/external-store/thread-message-converter.d.ts.map +1 -1
  554. package/dist/runtimes/external-store/thread-message-converter.js +14 -11
  555. package/dist/runtimes/external-store/thread-message-converter.js.map +1 -1
  556. package/dist/runtimes/internal.d.ts +15 -19
  557. package/dist/runtimes/internal.js +13 -17
  558. package/dist/runtimes/local/local-runtime-core.d.ts +11 -7
  559. package/dist/runtimes/local/local-runtime-core.d.ts.map +1 -1
  560. package/dist/runtimes/local/local-runtime-core.js +18 -18
  561. package/dist/runtimes/local/local-runtime-core.js.map +1 -1
  562. package/dist/runtimes/local/local-runtime-options.d.ts +27 -23
  563. package/dist/runtimes/local/local-runtime-options.d.ts.map +1 -1
  564. package/dist/runtimes/local/local-runtime-options.js +0 -2
  565. package/dist/runtimes/local/local-thread-list-runtime-core.d.ts +46 -42
  566. package/dist/runtimes/local/local-thread-list-runtime-core.d.ts.map +1 -1
  567. package/dist/runtimes/local/local-thread-list-runtime-core.js +84 -83
  568. package/dist/runtimes/local/local-thread-list-runtime-core.js.map +1 -1
  569. package/dist/runtimes/local/local-thread-runtime-core.d.ts +81 -59
  570. package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
  571. package/dist/runtimes/local/local-thread-runtime-core.js +345 -424
  572. package/dist/runtimes/local/local-thread-runtime-core.js.map +1 -1
  573. package/dist/runtimes/local/should-continue.d.ts +6 -2
  574. package/dist/runtimes/local/should-continue.d.ts.map +1 -1
  575. package/dist/runtimes/local/should-continue.js +7 -12
  576. package/dist/runtimes/local/should-continue.js.map +1 -1
  577. package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts +97 -92
  578. package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts.map +1 -1
  579. package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js +167 -176
  580. package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js.map +1 -1
  581. package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts +15 -11
  582. package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts.map +1 -1
  583. package/dist/runtimes/remote-thread-list/adapter/in-memory.js +33 -28
  584. package/dist/runtimes/remote-thread-list/adapter/in-memory.js.map +1 -1
  585. package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts +6 -2
  586. package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts.map +1 -1
  587. package/dist/runtimes/remote-thread-list/empty-thread-core.js +155 -160
  588. package/dist/runtimes/remote-thread-list/empty-thread-core.js.map +1 -1
  589. package/dist/runtimes/remote-thread-list/optimistic-state.d.ts +27 -27
  590. package/dist/runtimes/remote-thread-list/optimistic-state.d.ts.map +1 -1
  591. package/dist/runtimes/remote-thread-list/optimistic-state.js +63 -73
  592. package/dist/runtimes/remote-thread-list/optimistic-state.js.map +1 -1
  593. package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts +46 -43
  594. package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts.map +1 -1
  595. package/dist/runtimes/remote-thread-list/remote-thread-state.js +81 -91
  596. package/dist/runtimes/remote-thread-list/remote-thread-state.js.map +1 -1
  597. package/dist/runtimes/remote-thread-list/types.d.ts +65 -61
  598. package/dist/runtimes/remote-thread-list/types.d.ts.map +1 -1
  599. package/dist/runtimes/remote-thread-list/types.js +0 -2
  600. package/dist/store/clients/chain-of-thought-client.d.ts +16 -12
  601. package/dist/store/clients/chain-of-thought-client.d.ts.map +1 -1
  602. package/dist/store/clients/chain-of-thought-client.js +24 -15
  603. package/dist/store/clients/chain-of-thought-client.js.map +1 -1
  604. package/dist/store/clients/model-context-client.d.ts +6 -2
  605. package/dist/store/clients/model-context-client.d.ts.map +1 -1
  606. package/dist/store/clients/model-context-client.js +32 -26
  607. package/dist/store/clients/model-context-client.js.map +1 -1
  608. package/dist/store/clients/no-op-composer-client.d.ts +8 -4
  609. package/dist/store/clients/no-op-composer-client.d.ts.map +1 -1
  610. package/dist/store/clients/no-op-composer-client.js +67 -63
  611. package/dist/store/clients/no-op-composer-client.js.map +1 -1
  612. package/dist/store/clients/runtime-adapter.d.ts +8 -4
  613. package/dist/store/clients/runtime-adapter.d.ts.map +1 -1
  614. package/dist/store/clients/runtime-adapter.js +33 -33
  615. package/dist/store/clients/runtime-adapter.js.map +1 -1
  616. package/dist/store/clients/suggestions.d.ts +12 -8
  617. package/dist/store/clients/suggestions.d.ts.map +1 -1
  618. package/dist/store/clients/suggestions.js +28 -32
  619. package/dist/store/clients/suggestions.js.map +1 -1
  620. package/dist/store/clients/thread-message-client.d.ts +13 -9
  621. package/dist/store/clients/thread-message-client.d.ts.map +1 -1
  622. package/dist/store/clients/thread-message-client.js +98 -105
  623. package/dist/store/clients/thread-message-client.js.map +1 -1
  624. package/dist/store/index.d.ts +18 -18
  625. package/dist/store/index.js +6 -8
  626. package/dist/store/internal.d.ts +9 -9
  627. package/dist/store/internal.js +9 -9
  628. package/dist/store/runtime-clients/attachment-runtime-client.d.ts +9 -5
  629. package/dist/store/runtime-clients/attachment-runtime-client.d.ts.map +1 -1
  630. package/dist/store/runtime-clients/attachment-runtime-client.js +12 -8
  631. package/dist/store/runtime-clients/attachment-runtime-client.js.map +1 -1
  632. package/dist/store/runtime-clients/composer-runtime-client.d.ts +14 -10
  633. package/dist/store/runtime-clients/composer-runtime-client.d.ts.map +1 -1
  634. package/dist/store/runtime-clients/composer-runtime-client.js +86 -89
  635. package/dist/store/runtime-clients/composer-runtime-client.js.map +1 -1
  636. package/dist/store/runtime-clients/message-part-runtime-client.d.ts +9 -5
  637. package/dist/store/runtime-clients/message-part-runtime-client.d.ts.map +1 -1
  638. package/dist/store/runtime-clients/message-part-runtime-client.js +14 -9
  639. package/dist/store/runtime-clients/message-part-runtime-client.js.map +1 -1
  640. package/dist/store/runtime-clients/message-runtime-client.d.ts +12 -8
  641. package/dist/store/runtime-clients/message-runtime-client.d.ts.map +1 -1
  642. package/dist/store/runtime-clients/message-runtime-client.js +66 -70
  643. package/dist/store/runtime-clients/message-runtime-client.js.map +1 -1
  644. package/dist/store/runtime-clients/tap-subscribable.d.ts +6 -2
  645. package/dist/store/runtime-clients/tap-subscribable.d.ts.map +1 -1
  646. package/dist/store/runtime-clients/tap-subscribable.js +14 -10
  647. package/dist/store/runtime-clients/tap-subscribable.js.map +1 -1
  648. package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts +9 -5
  649. package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts.map +1 -1
  650. package/dist/store/runtime-clients/thread-list-item-runtime-client.js +33 -38
  651. package/dist/store/runtime-clients/thread-list-item-runtime-client.js.map +1 -1
  652. package/dist/store/runtime-clients/thread-list-runtime-client.d.ts +12 -8
  653. package/dist/store/runtime-clients/thread-list-runtime-client.d.ts.map +1 -1
  654. package/dist/store/runtime-clients/thread-list-runtime-client.js +53 -53
  655. package/dist/store/runtime-clients/thread-list-runtime-client.js.map +1 -1
  656. package/dist/store/runtime-clients/thread-runtime-client.d.ts +9 -5
  657. package/dist/store/runtime-clients/thread-runtime-client.d.ts.map +1 -1
  658. package/dist/store/runtime-clients/thread-runtime-client.js +93 -85
  659. package/dist/store/runtime-clients/thread-runtime-client.js.map +1 -1
  660. package/dist/store/scope-registration.d.ts +29 -27
  661. package/dist/store/scope-registration.d.ts.map +1 -1
  662. package/dist/store/scope-registration.js +0 -2
  663. package/dist/store/scopes/attachment.d.ts +23 -19
  664. package/dist/store/scopes/attachment.d.ts.map +1 -1
  665. package/dist/store/scopes/attachment.js +0 -2
  666. package/dist/store/scopes/chain-of-thought.d.ts +36 -33
  667. package/dist/store/scopes/chain-of-thought.d.ts.map +1 -1
  668. package/dist/store/scopes/chain-of-thought.js +0 -2
  669. package/dist/store/scopes/composer.d.ts +118 -115
  670. package/dist/store/scopes/composer.d.ts.map +1 -1
  671. package/dist/store/scopes/composer.js +0 -2
  672. package/dist/store/scopes/message.d.ts +81 -81
  673. package/dist/store/scopes/message.d.ts.map +1 -1
  674. package/dist/store/scopes/message.js +0 -2
  675. package/dist/store/scopes/model-context.d.ts +14 -10
  676. package/dist/store/scopes/model-context.d.ts.map +1 -1
  677. package/dist/store/scopes/model-context.js +0 -2
  678. package/dist/store/scopes/part.d.ts +49 -39
  679. package/dist/store/scopes/part.d.ts.map +1 -1
  680. package/dist/store/scopes/part.js +0 -2
  681. package/dist/store/scopes/queue-item.d.ts +18 -15
  682. package/dist/store/scopes/queue-item.d.ts.map +1 -1
  683. package/dist/store/scopes/queue-item.js +0 -2
  684. package/dist/store/scopes/suggestion.d.ts +17 -14
  685. package/dist/store/scopes/suggestion.d.ts.map +1 -1
  686. package/dist/store/scopes/suggestion.js +0 -2
  687. package/dist/store/scopes/suggestions.d.ts +18 -14
  688. package/dist/store/scopes/suggestions.d.ts.map +1 -1
  689. package/dist/store/scopes/suggestions.js +0 -2
  690. package/dist/store/scopes/thread-list-item.d.ts +62 -56
  691. package/dist/store/scopes/thread-list-item.d.ts.map +1 -1
  692. package/dist/store/scopes/thread-list-item.js +0 -2
  693. package/dist/store/scopes/thread.d.ts +151 -149
  694. package/dist/store/scopes/thread.d.ts.map +1 -1
  695. package/dist/store/scopes/thread.js +0 -2
  696. package/dist/store/scopes/threads.d.ts +36 -30
  697. package/dist/store/scopes/threads.d.ts.map +1 -1
  698. package/dist/store/scopes/threads.js +0 -2
  699. package/dist/subscribable/subscribable.d.ts +62 -58
  700. package/dist/subscribable/subscribable.d.ts.map +1 -1
  701. package/dist/subscribable/subscribable.js +196 -220
  702. package/dist/subscribable/subscribable.js.map +1 -1
  703. package/dist/tests/remote-thread-list-test-helpers.d.ts +13 -9
  704. package/dist/tests/remote-thread-list-test-helpers.d.ts.map +1 -1
  705. package/dist/tests/remote-thread-list-test-helpers.js +49 -42
  706. package/dist/tests/remote-thread-list-test-helpers.js.map +1 -1
  707. package/dist/types/attachment.d.ts +35 -32
  708. package/dist/types/attachment.d.ts.map +1 -1
  709. package/dist/types/attachment.js +0 -2
  710. package/dist/types/directive.d.ts +15 -13
  711. package/dist/types/directive.d.ts.map +1 -1
  712. package/dist/types/directive.js +0 -2
  713. package/dist/types/index.d.ts +7 -7
  714. package/dist/types/index.js +0 -2
  715. package/dist/types/message.d.ts +238 -208
  716. package/dist/types/message.d.ts.map +1 -1
  717. package/dist/types/message.js +6 -2
  718. package/dist/types/message.js.map +1 -1
  719. package/dist/types/quote.d.ts +6 -3
  720. package/dist/types/quote.d.ts.map +1 -1
  721. package/dist/types/quote.js +0 -2
  722. package/dist/types/trigger.d.ts +14 -10
  723. package/dist/types/trigger.d.ts.map +1 -1
  724. package/dist/types/trigger.js +0 -2
  725. package/dist/types/unsubscribe.d.ts +4 -1
  726. package/dist/types/unsubscribe.d.ts.map +1 -1
  727. package/dist/types/unsubscribe.js +0 -2
  728. package/dist/utils/composite-context-provider.d.ts +11 -8
  729. package/dist/utils/composite-context-provider.d.ts.map +1 -1
  730. package/dist/utils/composite-context-provider.js +31 -28
  731. package/dist/utils/composite-context-provider.js.map +1 -1
  732. package/dist/utils/id.d.ts +8 -5
  733. package/dist/utils/id.d.ts.map +1 -1
  734. package/dist/utils/id.js +9 -5
  735. package/dist/utils/id.js.map +1 -1
  736. package/dist/utils/json/is-json-equal.d.ts +4 -1
  737. package/dist/utils/json/is-json-equal.d.ts.map +1 -1
  738. package/dist/utils/json/is-json-equal.js +20 -25
  739. package/dist/utils/json/is-json-equal.js.map +1 -1
  740. package/dist/utils/json/is-json.d.ts +9 -5
  741. package/dist/utils/json/is-json.d.ts.map +1 -1
  742. package/dist/utils/json/is-json.js +17 -28
  743. package/dist/utils/json/is-json.js.map +1 -1
  744. package/dist/utils/text.d.ts +6 -2
  745. package/dist/utils/text.d.ts.map +1 -1
  746. package/dist/utils/text.js +6 -3
  747. package/dist/utils/text.js.map +1 -1
  748. package/package.json +12 -12
  749. package/src/index.ts +4 -0
  750. package/src/react/index.ts +18 -0
  751. package/src/react/primitives/generativeUI/GenerativeUI.tsx +182 -0
  752. package/src/react/primitives/message/MessageGroupedParts.tsx +38 -31
  753. package/src/react/primitives/message/MessageParts.tsx +64 -2
  754. package/src/react/providers/TextMessagePartProvider.tsx +3 -0
  755. package/src/react/runtimes/RemoteThreadListHookInstanceManager.tsx +11 -7
  756. package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +7 -2
  757. package/src/react/runtimes/cloud/auiV0.ts +1 -1
  758. package/src/react/runtimes/external-message-converter.ts +25 -12
  759. package/src/react/types/MessagePartComponentTypes.ts +34 -0
  760. package/src/react/utils/groupParts.ts +67 -22
  761. package/src/runtime/api/message-part-runtime.ts +26 -0
  762. package/src/runtime/api/thread-list-item-runtime.ts +3 -3
  763. package/src/runtime/api/thread-list-runtime.ts +9 -3
  764. package/src/runtime/base/base-thread-runtime-core.ts +12 -0
  765. package/src/runtime/interfaces/thread-list-runtime-core.ts +4 -1
  766. package/src/runtime/interfaces/thread-runtime-core.ts +13 -5
  767. package/src/runtime/utils/thread-message-like.ts +18 -3
  768. package/src/runtimes/external-store/external-store-adapter.ts +4 -0
  769. package/src/runtimes/external-store/external-store-thread-list-runtime-core.ts +4 -1
  770. package/src/runtimes/external-store/external-store-thread-runtime-core.ts +7 -0
  771. package/src/runtimes/local/local-thread-runtime-core.ts +5 -0
  772. package/src/runtimes/readonly/ReadonlyThreadRuntimeCore.ts +4 -0
  773. package/src/runtimes/remote-thread-list/empty-thread-core.ts +4 -0
  774. package/src/store/clients/thread-message-client.ts +3 -0
  775. package/src/store/runtime-clients/message-part-runtime-client.ts +2 -0
  776. package/src/store/runtime-clients/thread-list-runtime-client.ts +2 -2
  777. package/src/store/scopes/part.ts +4 -0
  778. package/src/store/scopes/thread-list-item.ts +1 -1
  779. package/src/store/scopes/threads.ts +1 -1
  780. package/src/tests/RemoteThreadListThreadListRuntimeCore-switchToThread-unarchive.test.ts +88 -0
  781. package/src/tests/external-store-thread-runtime-core.test.ts +83 -0
  782. package/src/tests/groupParts.test.ts +118 -32
  783. package/src/types/index.ts +3 -0
  784. package/src/types/message.ts +56 -1
  785. package/dist/adapters/feedback.js.map +0 -1
  786. package/dist/adapters/index.d.ts.map +0 -1
  787. package/dist/adapters/index.js.map +0 -1
  788. package/dist/adapters/suggestion.js.map +0 -1
  789. package/dist/adapters/thread-history.js.map +0 -1
  790. package/dist/adapters/trigger.js.map +0 -1
  791. package/dist/index.d.ts.map +0 -1
  792. package/dist/index.js.map +0 -1
  793. package/dist/internal.d.ts.map +0 -1
  794. package/dist/internal.js.map +0 -1
  795. package/dist/model-context/registry-handles.js.map +0 -1
  796. package/dist/react/index.d.ts.map +0 -1
  797. package/dist/react/index.js.map +0 -1
  798. package/dist/react/model-context/toolbox.js.map +0 -1
  799. package/dist/react/types/MessagePartComponentTypes.js.map +0 -1
  800. package/dist/react/types/scopes/dataRenderers.js.map +0 -1
  801. package/dist/react/types/scopes/interactables.js.map +0 -1
  802. package/dist/react/types/scopes/tools.js.map +0 -1
  803. package/dist/react/types/store-augmentation.js.map +0 -1
  804. package/dist/runtime/api/bindings.js.map +0 -1
  805. package/dist/runtime/api/paths.js.map +0 -1
  806. package/dist/runtime/interfaces/assistant-runtime-core.js.map +0 -1
  807. package/dist/runtime/interfaces/composer-runtime-core.js.map +0 -1
  808. package/dist/runtime/interfaces/thread-list-runtime-core.js.map +0 -1
  809. package/dist/runtime/interfaces/thread-runtime-core.js.map +0 -1
  810. package/dist/runtime/internal.d.ts.map +0 -1
  811. package/dist/runtime/internal.js.map +0 -1
  812. package/dist/runtime/utils/chat-model-adapter.js.map +0 -1
  813. package/dist/runtimes/external-store/external-store-adapter.js.map +0 -1
  814. package/dist/runtimes/internal.d.ts.map +0 -1
  815. package/dist/runtimes/internal.js.map +0 -1
  816. package/dist/runtimes/local/local-runtime-options.js.map +0 -1
  817. package/dist/runtimes/remote-thread-list/types.js.map +0 -1
  818. package/dist/store/index.d.ts.map +0 -1
  819. package/dist/store/index.js.map +0 -1
  820. package/dist/store/internal.d.ts.map +0 -1
  821. package/dist/store/internal.js.map +0 -1
  822. package/dist/store/scope-registration.js.map +0 -1
  823. package/dist/store/scopes/attachment.js.map +0 -1
  824. package/dist/store/scopes/chain-of-thought.js.map +0 -1
  825. package/dist/store/scopes/composer.js.map +0 -1
  826. package/dist/store/scopes/message.js.map +0 -1
  827. package/dist/store/scopes/model-context.js.map +0 -1
  828. package/dist/store/scopes/part.js.map +0 -1
  829. package/dist/store/scopes/queue-item.js.map +0 -1
  830. package/dist/store/scopes/suggestion.js.map +0 -1
  831. package/dist/store/scopes/suggestions.js.map +0 -1
  832. package/dist/store/scopes/thread-list-item.js.map +0 -1
  833. package/dist/store/scopes/thread.js.map +0 -1
  834. package/dist/store/scopes/threads.js.map +0 -1
  835. package/dist/types/attachment.js.map +0 -1
  836. package/dist/types/directive.js.map +0 -1
  837. package/dist/types/index.d.ts.map +0 -1
  838. package/dist/types/index.js.map +0 -1
  839. package/dist/types/quote.js.map +0 -1
  840. package/dist/types/trigger.js.map +0 -1
  841. package/dist/types/unsubscribe.js.map +0 -1
@@ -1,4 +1,8 @@
1
- import type { ExternalStoreAdapter } from "../../runtimes/external-store/external-store-adapter.js";
2
- import type { AssistantRuntime } from "../../runtime/api/assistant-runtime.js";
3
- export declare const useExternalStoreRuntime: <T>(store: ExternalStoreAdapter<T>) => AssistantRuntime;
1
+ import { ExternalStoreAdapter } from "../../runtimes/external-store/external-store-adapter.js";
2
+ import { AssistantRuntime } from "../../runtime/api/assistant-runtime.js";
3
+
4
+ //#region src/react/runtimes/useExternalStoreRuntime.d.ts
5
+ declare const useExternalStoreRuntime: <T>(store: ExternalStoreAdapter<T>) => AssistantRuntime;
6
+ //#endregion
7
+ export { useExternalStoreRuntime };
4
8
  //# sourceMappingURL=useExternalStoreRuntime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useExternalStoreRuntime.d.ts","sourceRoot":"","sources":["../../../src/react/runtimes/useExternalStoreRuntime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,gEAA6D;AACjG,OAAO,KAAK,EAAE,gBAAgB,EAAE,+CAA4C;AAI5E,eAAO,MAAM,uBAAuB,GAAI,CAAC,EACvC,OAAO,oBAAoB,CAAC,CAAC,CAAC,KAC7B,gBAeF,CAAC"}
1
+ {"version":3,"file":"useExternalStoreRuntime.d.ts","names":[],"sources":["../../../src/react/runtimes/useExternalStoreRuntime.ts"],"mappings":";;;;cASa,uBAAA,MACX,KAAA,EAAO,oBAAA,CAAqB,CAAA,MAC3B,gBAAA"}
@@ -1,19 +1,22 @@
1
1
  "use client";
2
- import { useEffect, useMemo, useState } from "react";
3
- import { ExternalStoreRuntimeCore } from "../../runtimes/internal.js";
4
- import { AssistantRuntimeImpl } from "../../runtime/internal.js";
2
+ import { AssistantRuntimeImpl } from "../../runtime/api/assistant-runtime.js";
3
+ import { ExternalStoreRuntimeCore } from "../../runtimes/external-store/external-store-runtime-core.js";
5
4
  import { useRuntimeAdapters } from "./RuntimeAdapterProvider.js";
6
- export const useExternalStoreRuntime = (store) => {
7
- const [runtime] = useState(() => new ExternalStoreRuntimeCore(store));
8
- useEffect(() => {
9
- runtime.setAdapter(store);
10
- });
11
- const { modelContext } = useRuntimeAdapters() ?? {};
12
- useEffect(() => {
13
- if (!modelContext)
14
- return undefined;
15
- return runtime.registerModelContextProvider(modelContext);
16
- }, [modelContext, runtime]);
17
- return useMemo(() => new AssistantRuntimeImpl(runtime), [runtime]);
5
+ import { useEffect, useMemo, useState } from "react";
6
+ //#region src/react/runtimes/useExternalStoreRuntime.ts
7
+ const useExternalStoreRuntime = (store) => {
8
+ const [runtime] = useState(() => new ExternalStoreRuntimeCore(store));
9
+ useEffect(() => {
10
+ runtime.setAdapter(store);
11
+ });
12
+ const { modelContext } = useRuntimeAdapters() ?? {};
13
+ useEffect(() => {
14
+ if (!modelContext) return void 0;
15
+ return runtime.registerModelContextProvider(modelContext);
16
+ }, [modelContext, runtime]);
17
+ return useMemo(() => new AssistantRuntimeImpl(runtime), [runtime]);
18
18
  };
19
+ //#endregion
20
+ export { useExternalStoreRuntime };
21
+
19
22
  //# sourceMappingURL=useExternalStoreRuntime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useExternalStoreRuntime.js","sourceRoot":"","sources":["../../../src/react/runtimes/useExternalStoreRuntime.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,mCAAgC;AAGnE,OAAO,EAAE,oBAAoB,EAAE,kCAA+B;AAC9D,OAAO,EAAE,kBAAkB,EAAE,oCAAiC;AAE9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,KAA8B,EACZ,EAAE;IACpB,MAAM,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;IAEtE,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,MAAM,EAAE,YAAY,EAAE,GAAG,kBAAkB,EAAE,IAAI,EAAE,CAAC;IAEpD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,YAAY;YAAE,OAAO,SAAS,CAAC;QACpC,OAAO,OAAO,CAAC,4BAA4B,CAAC,YAAY,CAAC,CAAC;IAC5D,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;IAE5B,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC,CAAC"}
1
+ {"version":3,"file":"useExternalStoreRuntime.js","names":[],"sources":["../../../src/react/runtimes/useExternalStoreRuntime.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useMemo, useState } from \"react\";\nimport { ExternalStoreRuntimeCore } from \"../../runtimes/internal\";\nimport type { ExternalStoreAdapter } from \"../../runtimes/external-store/external-store-adapter\";\nimport type { AssistantRuntime } from \"../../runtime/api/assistant-runtime\";\nimport { AssistantRuntimeImpl } from \"../../runtime/internal\";\nimport { useRuntimeAdapters } from \"./RuntimeAdapterProvider\";\n\nexport const useExternalStoreRuntime = <T>(\n store: ExternalStoreAdapter<T>,\n): AssistantRuntime => {\n const [runtime] = useState(() => new ExternalStoreRuntimeCore(store));\n\n useEffect(() => {\n runtime.setAdapter(store);\n });\n\n const { modelContext } = useRuntimeAdapters() ?? {};\n\n useEffect(() => {\n if (!modelContext) return undefined;\n return runtime.registerModelContextProvider(modelContext);\n }, [modelContext, runtime]);\n\n return useMemo(() => new AssistantRuntimeImpl(runtime), [runtime]);\n};\n"],"mappings":";;;;;;AASA,MAAa,2BACX,UACqB;CACrB,MAAM,CAAC,WAAW,eAAe,IAAI,yBAAyB,KAAK,CAAC;CAEpE,gBAAgB;EACd,QAAQ,WAAW,KAAK;CAC1B,CAAC;CAED,MAAM,EAAE,iBAAiB,mBAAmB,KAAK,CAAC;CAElD,gBAAgB;EACd,IAAI,CAAC,cAAc,OAAO,KAAA;EAC1B,OAAO,QAAQ,6BAA6B,YAAY;CAC1D,GAAG,CAAC,cAAc,OAAO,CAAC;CAE1B,OAAO,cAAc,IAAI,qBAAqB,OAAO,GAAG,CAAC,OAAO,CAAC;AACnE"}
@@ -1,29 +1,44 @@
1
- import type { AssistantRuntime, ChatModelAdapter, ThreadMessageLike } from "../../index.js";
2
- import type { LocalRuntimeOptionsBase } from "../../runtimes/local/local-runtime-options.js";
3
- import type { AssistantCloud } from "assistant-cloud";
4
- export type LocalRuntimeOptions = Omit<LocalRuntimeOptionsBase, "adapters"> & {
5
- cloud?: AssistantCloud | undefined;
6
- initialMessages?: readonly ThreadMessageLike[] | undefined;
7
- adapters?: Omit<LocalRuntimeOptionsBase["adapters"], "chatModel"> | undefined;
1
+ import { AttachmentAdapter } from "../../adapters/attachment.js";
2
+ import { FeedbackAdapter } from "../../adapters/feedback.js";
3
+ import { DictationAdapter, SpeechSynthesisAdapter } from "../../adapters/speech.js";
4
+ import { RealtimeVoiceAdapter } from "../../adapters/voice.js";
5
+ import { ChatModelAdapter } from "../../runtime/utils/chat-model-adapter.js";
6
+ import { ThreadMessageLike } from "../../runtime/utils/thread-message-like.js";
7
+ import { SuggestionAdapter } from "../../adapters/suggestion.js";
8
+ import { ThreadHistoryAdapter } from "../../adapters/thread-history.js";
9
+ import { LocalRuntimeOptionsBase } from "../../runtimes/local/local-runtime-options.js";
10
+ import { AssistantRuntime } from "../../runtime/api/assistant-runtime.js";
11
+ import { AssistantCloud } from "assistant-cloud";
12
+
13
+ //#region src/react/runtimes/useLocalRuntime.d.ts
14
+ type LocalRuntimeOptions = Omit<LocalRuntimeOptionsBase, "adapters"> & {
15
+ cloud?: AssistantCloud | undefined;
16
+ initialMessages?: readonly ThreadMessageLike[] | undefined;
17
+ adapters?: Omit<LocalRuntimeOptionsBase["adapters"], "chatModel"> | undefined;
8
18
  };
9
- export declare const splitLocalRuntimeOptions: <T extends LocalRuntimeOptions>(options: T) => {
10
- localRuntimeOptions: {
11
- cloud: AssistantCloud | undefined;
12
- initialMessages: readonly ThreadMessageLike[] | undefined;
13
- maxSteps: number | undefined;
14
- adapters: Omit<{
15
- chatModel: ChatModelAdapter;
16
- history?: import("../../index").ThreadHistoryAdapter | undefined;
17
- attachments?: import("../../index").AttachmentAdapter | undefined;
18
- speech?: import("../../index").SpeechSynthesisAdapter | undefined;
19
- dictation?: import("../../index").DictationAdapter | undefined;
20
- voice?: import("../../index").RealtimeVoiceAdapter | undefined;
21
- feedback?: import("../../index").FeedbackAdapter | undefined;
22
- suggestion?: import("../../index").SuggestionAdapter | undefined;
23
- }, "chatModel"> | undefined;
24
- unstable_humanToolNames: string[] | undefined;
25
- };
26
- otherOptions: Omit<T, "adapters" | "maxSteps" | "unstable_humanToolNames" | "initialMessages" | "cloud">;
19
+ declare const splitLocalRuntimeOptions: <T extends LocalRuntimeOptions>(options: T) => {
20
+ localRuntimeOptions: {
21
+ cloud: AssistantCloud | undefined;
22
+ initialMessages: readonly ThreadMessageLike[] | undefined;
23
+ maxSteps: number | undefined;
24
+ adapters: Omit<{
25
+ chatModel: ChatModelAdapter;
26
+ history?: ThreadHistoryAdapter | undefined;
27
+ attachments?: AttachmentAdapter | undefined;
28
+ speech?: SpeechSynthesisAdapter | undefined;
29
+ dictation?: DictationAdapter | undefined;
30
+ voice?: RealtimeVoiceAdapter | undefined;
31
+ feedback?: FeedbackAdapter | undefined;
32
+ suggestion?: SuggestionAdapter | undefined;
33
+ }, "chatModel"> | undefined;
34
+ unstable_humanToolNames: string[] | undefined;
35
+ };
36
+ otherOptions: Omit<T, "adapters" | "maxSteps" | "unstable_humanToolNames" | "cloud" | "initialMessages">;
27
37
  };
28
- export declare const useLocalRuntime: (chatModel: ChatModelAdapter, { cloud, ...options }?: LocalRuntimeOptions) => AssistantRuntime;
38
+ declare const useLocalRuntime: (chatModel: ChatModelAdapter, {
39
+ cloud,
40
+ ...options
41
+ }?: LocalRuntimeOptions) => AssistantRuntime;
42
+ //#endregion
43
+ export { LocalRuntimeOptions, splitLocalRuntimeOptions, useLocalRuntime };
29
44
  //# sourceMappingURL=useLocalRuntime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocalRuntime.d.ts","sourceRoot":"","sources":["../../../src/react/runtimes/useLocalRuntime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAClB,uBAAoB;AACrB,OAAO,KAAK,EAAE,uBAAuB,EAAE,sDAAmD;AAM1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,GAAG;IAC5E,KAAK,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACnC,eAAe,CAAC,EAAE,SAAS,iBAAiB,EAAE,GAAG,SAAS,CAAC;IAC3D,QAAQ,CAAC,EAAE,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,GAAG,SAAS,CAAC;CAC/E,CAAC;AAuDF,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,mBAAmB,EACpE,SAAS,CAAC;;;;;;;;;;;;;;;;;;CAqBX,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,WAAW,gBAAgB,EAC3B,wBAAuB,mBAAwB,KAC9C,gBAUF,CAAC"}
1
+ {"version":3,"file":"useLocalRuntime.d.ts","names":[],"sources":["../../../src/react/runtimes/useLocalRuntime.ts"],"mappings":";;;;;;;;;;;;;KAcY,mBAAA,GAAsB,IAAA,CAAK,uBAAA;EACrC,KAAA,GAAQ,cAAA;EACR,eAAA,YAA2B,iBAAA;EAC3B,QAAA,GAAW,IAAA,CAAK,uBAAA;AAAA;AAAA,cAwDL,wBAAA,aAAsC,mBAAA,EACjD,OAAA,EAAS,CAAA;;;;;;;;;;;;;;;;;;;cAuBE,eAAA,GACX,SAAA,EAAW,gBAAA;EACX,KAAA;EAAA,GAAA;AAAA,IAAuB,mBAAA,KACtB,gBAAA"}
@@ -1,74 +1,65 @@
1
- import { useEffect, useMemo, useRef, useState } from "react";
2
- import { AssistantRuntimeImpl, LocalRuntimeCore } from "../../internal.js";
3
- import { useAuiState } from "@assistant-ui/store";
1
+ import { AssistantRuntimeImpl } from "../../runtime/api/assistant-runtime.js";
2
+ import { LocalRuntimeCore } from "../../runtimes/local/local-runtime-core.js";
3
+ import { useRuntimeAdapters } from "./RuntimeAdapterProvider.js";
4
4
  import { useRemoteThreadListRuntime } from "./useRemoteThreadListRuntime.js";
5
5
  import { useCloudThreadListAdapter } from "./cloud/useCloudThreadListAdapter.js";
6
- import { useRuntimeAdapters } from "./RuntimeAdapterProvider.js";
6
+ import { useEffect, useMemo, useRef, useState } from "react";
7
+ import { useAuiState } from "@assistant-ui/store";
8
+ //#region src/react/runtimes/useLocalRuntime.ts
7
9
  const useLocalThreadRuntime = (chatModel, { initialMessages, ...options }) => {
8
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
9
- const { modelContext, ...threadListAdapters } = useRuntimeAdapters() ?? {};
10
- const opt = {
11
- ...options,
12
- adapters: {
13
- ...threadListAdapters,
14
- ...options.adapters,
15
- chatModel,
16
- },
17
- };
18
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
19
- const [runtime] = useState(() => new LocalRuntimeCore(opt, initialMessages));
20
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
21
- const threadIdRef = useRef(undefined);
22
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
23
- threadIdRef.current = useAuiState((s) => s.threadListItem.remoteId);
24
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
25
- useEffect(() => {
26
- runtime.threads
27
- .getMainThreadRuntimeCore()
28
- .__internal_setGetThreadId(() => threadIdRef.current);
29
- }, [runtime]);
30
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
31
- useEffect(() => {
32
- return () => {
33
- runtime.threads.getMainThreadRuntimeCore().detach();
34
- };
35
- }, [runtime]);
36
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
37
- useEffect(() => {
38
- runtime.threads.getMainThreadRuntimeCore().__internal_setOptions(opt);
39
- runtime.threads.getMainThreadRuntimeCore().__internal_load();
40
- });
41
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
42
- useEffect(() => {
43
- if (!modelContext)
44
- return undefined;
45
- return runtime.registerModelContextProvider(modelContext);
46
- }, [modelContext, runtime]);
47
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
48
- return useMemo(() => new AssistantRuntimeImpl(runtime), [runtime]);
10
+ const { modelContext, ...threadListAdapters } = useRuntimeAdapters() ?? {};
11
+ const opt = {
12
+ ...options,
13
+ adapters: {
14
+ ...threadListAdapters,
15
+ ...options.adapters,
16
+ chatModel
17
+ }
18
+ };
19
+ const [runtime] = useState(() => new LocalRuntimeCore(opt, initialMessages));
20
+ const threadIdRef = useRef(void 0);
21
+ threadIdRef.current = useAuiState((s) => s.threadListItem.remoteId);
22
+ useEffect(() => {
23
+ runtime.threads.getMainThreadRuntimeCore().__internal_setGetThreadId(() => threadIdRef.current);
24
+ }, [runtime]);
25
+ useEffect(() => {
26
+ return () => {
27
+ runtime.threads.getMainThreadRuntimeCore().detach();
28
+ };
29
+ }, [runtime]);
30
+ useEffect(() => {
31
+ runtime.threads.getMainThreadRuntimeCore().__internal_setOptions(opt);
32
+ runtime.threads.getMainThreadRuntimeCore().__internal_load();
33
+ });
34
+ useEffect(() => {
35
+ if (!modelContext) return void 0;
36
+ return runtime.registerModelContextProvider(modelContext);
37
+ }, [modelContext, runtime]);
38
+ return useMemo(() => new AssistantRuntimeImpl(runtime), [runtime]);
49
39
  };
50
- export const splitLocalRuntimeOptions = (options) => {
51
- const { cloud, initialMessages, maxSteps, adapters, unstable_humanToolNames, ...rest } = options;
52
- return {
53
- localRuntimeOptions: {
54
- cloud,
55
- initialMessages,
56
- maxSteps,
57
- adapters,
58
- unstable_humanToolNames,
59
- },
60
- otherOptions: rest,
61
- };
40
+ const splitLocalRuntimeOptions = (options) => {
41
+ const { cloud, initialMessages, maxSteps, adapters, unstable_humanToolNames, ...rest } = options;
42
+ return {
43
+ localRuntimeOptions: {
44
+ cloud,
45
+ initialMessages,
46
+ maxSteps,
47
+ adapters,
48
+ unstable_humanToolNames
49
+ },
50
+ otherOptions: rest
51
+ };
62
52
  };
63
- export const useLocalRuntime = (chatModel, { cloud, ...options } = {}) => {
64
- const cloudAdapter = useCloudThreadListAdapter({ cloud });
65
- return useRemoteThreadListRuntime({
66
- runtimeHook: function RuntimeHook() {
67
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
68
- return useLocalThreadRuntime(chatModel, options);
69
- },
70
- adapter: cloudAdapter,
71
- allowNesting: true,
72
- });
53
+ const useLocalRuntime = (chatModel, { cloud, ...options } = {}) => {
54
+ return useRemoteThreadListRuntime({
55
+ runtimeHook: function RuntimeHook() {
56
+ return useLocalThreadRuntime(chatModel, options);
57
+ },
58
+ adapter: useCloudThreadListAdapter({ cloud }),
59
+ allowNesting: true
60
+ });
73
61
  };
62
+ //#endregion
63
+ export { splitLocalRuntimeOptions, useLocalRuntime };
64
+
74
65
  //# sourceMappingURL=useLocalRuntime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocalRuntime.js","sourceRoot":"","sources":["../../../src/react/runtimes/useLocalRuntime.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"useLocalRuntime.js","names":[],"sources":["../../../src/react/runtimes/useLocalRuntime.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from \"react\";\nimport type {\n AssistantRuntime,\n ChatModelAdapter,\n ThreadMessageLike,\n} from \"../../index\";\nimport type { LocalRuntimeOptionsBase } from \"../../runtimes/local/local-runtime-options\";\nimport { AssistantRuntimeImpl, LocalRuntimeCore } from \"../../internal\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { useRemoteThreadListRuntime } from \"./useRemoteThreadListRuntime\";\nimport { useCloudThreadListAdapter } from \"./cloud/useCloudThreadListAdapter\";\nimport { useRuntimeAdapters } from \"./RuntimeAdapterProvider\";\nimport type { AssistantCloud } from \"assistant-cloud\";\n\nexport type LocalRuntimeOptions = Omit<LocalRuntimeOptionsBase, \"adapters\"> & {\n cloud?: AssistantCloud | undefined;\n initialMessages?: readonly ThreadMessageLike[] | undefined;\n adapters?: Omit<LocalRuntimeOptionsBase[\"adapters\"], \"chatModel\"> | undefined;\n};\n\nconst useLocalThreadRuntime = (\n chatModel: ChatModelAdapter,\n { initialMessages, ...options }: LocalRuntimeOptions,\n): AssistantRuntime => {\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n const { modelContext, ...threadListAdapters } = useRuntimeAdapters() ?? {};\n const opt = {\n ...options,\n adapters: {\n ...threadListAdapters,\n ...options.adapters,\n chatModel,\n },\n };\n\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n const [runtime] = useState(() => new LocalRuntimeCore(opt, initialMessages));\n\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n const threadIdRef = useRef<string | undefined>(undefined);\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n threadIdRef.current = useAuiState((s) => s.threadListItem.remoteId);\n\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n useEffect(() => {\n runtime.threads\n .getMainThreadRuntimeCore()\n .__internal_setGetThreadId(() => threadIdRef.current);\n }, [runtime]);\n\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n useEffect(() => {\n return () => {\n runtime.threads.getMainThreadRuntimeCore().detach();\n };\n }, [runtime]);\n\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n useEffect(() => {\n runtime.threads.getMainThreadRuntimeCore().__internal_setOptions(opt);\n runtime.threads.getMainThreadRuntimeCore().__internal_load();\n });\n\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n useEffect(() => {\n if (!modelContext) return undefined;\n return runtime.registerModelContextProvider(modelContext);\n }, [modelContext, runtime]);\n\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n return useMemo(() => new AssistantRuntimeImpl(runtime), [runtime]);\n};\n\nexport const splitLocalRuntimeOptions = <T extends LocalRuntimeOptions>(\n options: T,\n) => {\n const {\n cloud,\n initialMessages,\n maxSteps,\n adapters,\n unstable_humanToolNames,\n ...rest\n } = options;\n\n return {\n localRuntimeOptions: {\n cloud,\n initialMessages,\n maxSteps,\n adapters,\n unstable_humanToolNames,\n },\n otherOptions: rest,\n };\n};\n\nexport const useLocalRuntime = (\n chatModel: ChatModelAdapter,\n { cloud, ...options }: LocalRuntimeOptions = {},\n): AssistantRuntime => {\n const cloudAdapter = useCloudThreadListAdapter({ cloud });\n return useRemoteThreadListRuntime({\n runtimeHook: function RuntimeHook() {\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n return useLocalThreadRuntime(chatModel, options);\n },\n adapter: cloudAdapter,\n allowNesting: true,\n });\n};\n"],"mappings":";;;;;;;;AAoBA,MAAM,yBACJ,WACA,EAAE,iBAAiB,GAAG,cACD;CAErB,MAAM,EAAE,cAAc,GAAG,uBAAuB,mBAAmB,KAAK,CAAC;CACzE,MAAM,MAAM;EACV,GAAG;EACH,UAAU;GACR,GAAG;GACH,GAAG,QAAQ;GACX;EACF;CACF;CAGA,MAAM,CAAC,WAAW,eAAe,IAAI,iBAAiB,KAAK,eAAe,CAAC;CAG3E,MAAM,cAAc,OAA2B,KAAA,CAAS;CAExD,YAAY,UAAU,aAAa,MAAM,EAAE,eAAe,QAAQ;CAGlE,gBAAgB;EACd,QAAQ,QACL,yBAAyB,EACzB,gCAAgC,YAAY,OAAO;CACxD,GAAG,CAAC,OAAO,CAAC;CAGZ,gBAAgB;EACd,aAAa;GACX,QAAQ,QAAQ,yBAAyB,EAAE,OAAO;EACpD;CACF,GAAG,CAAC,OAAO,CAAC;CAGZ,gBAAgB;EACd,QAAQ,QAAQ,yBAAyB,EAAE,sBAAsB,GAAG;EACpE,QAAQ,QAAQ,yBAAyB,EAAE,gBAAgB;CAC7D,CAAC;CAGD,gBAAgB;EACd,IAAI,CAAC,cAAc,OAAO,KAAA;EAC1B,OAAO,QAAQ,6BAA6B,YAAY;CAC1D,GAAG,CAAC,cAAc,OAAO,CAAC;CAG1B,OAAO,cAAc,IAAI,qBAAqB,OAAO,GAAG,CAAC,OAAO,CAAC;AACnE;AAEA,MAAa,4BACX,YACG;CACH,MAAM,EACJ,OACA,iBACA,UACA,UACA,yBACA,GAAG,SACD;CAEJ,OAAO;EACL,qBAAqB;GACnB;GACA;GACA;GACA;GACA;EACF;EACA,cAAc;CAChB;AACF;AAEA,MAAa,mBACX,WACA,EAAE,OAAO,GAAG,YAAiC,CAAC,MACzB;CAErB,OAAO,2BAA2B;EAChC,aAAa,SAAS,cAAc;GAElC,OAAO,sBAAsB,WAAW,OAAO;EACjD;EACA,SANmB,0BAA0B,EAAE,MAAM,CAMjC;EACpB,cAAc;CAChB,CAAC;AACH"}
@@ -1,4 +1,8 @@
1
- import type { RemoteThreadListOptions } from "../../runtimes/remote-thread-list/types.js";
2
- import type { AssistantRuntime } from "../../runtime/api/assistant-runtime.js";
3
- export declare const useRemoteThreadListRuntime: (options: RemoteThreadListOptions) => AssistantRuntime;
1
+ import { RemoteThreadListOptions } from "../../runtimes/remote-thread-list/types.js";
2
+ import { AssistantRuntime } from "../../runtime/api/assistant-runtime.js";
3
+
4
+ //#region src/react/runtimes/useRemoteThreadListRuntime.d.ts
5
+ declare const useRemoteThreadListRuntime: (options: RemoteThreadListOptions) => AssistantRuntime;
6
+ //#endregion
7
+ export { useRemoteThreadListRuntime };
4
8
  //# sourceMappingURL=useRemoteThreadListRuntime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRemoteThreadListRuntime.d.ts","sourceRoot":"","sources":["../../../src/react/runtimes/useRemoteThreadListRuntime.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,mDAAgD;AAEvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,+CAA4C;AAsC5E,eAAO,MAAM,0BAA0B,GACrC,SAAS,uBAAuB,KAC/B,gBAsDF,CAAC"}
1
+ {"version":3,"file":"useRemoteThreadListRuntime.d.ts","names":[],"sources":["../../../src/react/runtimes/useRemoteThreadListRuntime.ts"],"mappings":";;;;cA2Ca,0BAAA,GACX,OAAA,EAAS,uBAAA,KACR,gBAsDF"}
@@ -1,70 +1,59 @@
1
- import { useState, useEffect, useMemo, useRef, useCallback } from "react";
2
1
  import { BaseAssistantRuntimeCore } from "../../runtime/base/base-assistant-runtime-core.js";
3
2
  import { AssistantRuntimeImpl } from "../../runtime/api/assistant-runtime.js";
4
3
  import { RemoteThreadListThreadListRuntimeCore } from "./RemoteThreadListThreadListRuntimeCore.js";
4
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
5
5
  import { useAui } from "@assistant-ui/store";
6
- class RemoteThreadListRuntimeCore extends BaseAssistantRuntimeCore {
7
- threads;
8
- constructor(options) {
9
- super();
10
- this.threads = new RemoteThreadListThreadListRuntimeCore(options, this._contextProvider);
11
- }
12
- get RenderComponent() {
13
- return this.threads.__internal_RenderComponent;
14
- }
15
- }
6
+ //#region src/react/runtimes/useRemoteThreadListRuntime.ts
7
+ var RemoteThreadListRuntimeCore = class extends BaseAssistantRuntimeCore {
8
+ threads;
9
+ constructor(options) {
10
+ super();
11
+ this.threads = new RemoteThreadListThreadListRuntimeCore(options, this._contextProvider);
12
+ }
13
+ get RenderComponent() {
14
+ return this.threads.__internal_RenderComponent;
15
+ }
16
+ };
16
17
  const useRemoteThreadListRuntimeImpl = (options) => {
17
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
18
- const [runtime] = useState(() => new RemoteThreadListRuntimeCore(options));
19
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
20
- useEffect(() => {
21
- runtime.threads.__internal_setOptions(options);
22
- runtime.threads.__internal_load();
23
- }, [runtime, options]);
24
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
25
- return useMemo(() => new AssistantRuntimeImpl(runtime), [runtime]);
18
+ const [runtime] = useState(() => new RemoteThreadListRuntimeCore(options));
19
+ useEffect(() => {
20
+ runtime.threads.__internal_setOptions(options);
21
+ runtime.threads.__internal_load();
22
+ }, [runtime, options]);
23
+ return useMemo(() => new AssistantRuntimeImpl(runtime), [runtime]);
26
24
  };
27
- export const useRemoteThreadListRuntime = (options) => {
28
- const runtimeHookRef = useRef(options.runtimeHook);
29
- runtimeHookRef.current = options.runtimeHook;
30
- // threadId/initialThreadId only affect the constructor; capture once via ref
31
- const startThreadIdRef = useRef(options.threadId ?? options.initialThreadId);
32
- const stableRuntimeHook = useCallback(() => {
33
- return runtimeHookRef.current();
34
- }, []);
35
- const stableOptions = useMemo(() => ({
36
- adapter: options.adapter,
37
- allowNesting: options.allowNesting,
38
- initialThreadId: startThreadIdRef.current,
39
- runtimeHook: stableRuntimeHook,
40
- }), [options.adapter, options.allowNesting, stableRuntimeHook]);
41
- const aui = useAui();
42
- const isNested = aui.threadListItem.source !== null;
43
- if (isNested) {
44
- if (!stableOptions.allowNesting) {
45
- throw new Error("useRemoteThreadListRuntime cannot be nested inside another RemoteThreadListRuntime. " +
46
- "Set allowNesting: true to allow nesting (the inner runtime will become a no-op).");
47
- }
48
- // If allowNesting is true and already inside a thread list context,
49
- // just call the runtimeHook directly (no-op behavior)
50
- return stableRuntimeHook();
51
- }
52
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
53
- const runtime = useRemoteThreadListRuntimeImpl(stableOptions);
54
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
55
- const prevThreadIdRef = useRef(options.threadId);
56
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
57
- useEffect(() => {
58
- if (options.threadId === prevThreadIdRef.current)
59
- return;
60
- prevThreadIdRef.current = options.threadId;
61
- if (options.threadId) {
62
- runtime.threads.switchToThread(options.threadId).catch(() => { });
63
- }
64
- else {
65
- runtime.threads.switchToNewThread().catch(() => { });
66
- }
67
- }, [runtime, options.threadId]);
68
- return runtime;
25
+ const useRemoteThreadListRuntime = (options) => {
26
+ const runtimeHookRef = useRef(options.runtimeHook);
27
+ runtimeHookRef.current = options.runtimeHook;
28
+ const startThreadIdRef = useRef(options.threadId ?? options.initialThreadId);
29
+ const stableRuntimeHook = useCallback(() => {
30
+ return runtimeHookRef.current();
31
+ }, []);
32
+ const stableOptions = useMemo(() => ({
33
+ adapter: options.adapter,
34
+ allowNesting: options.allowNesting,
35
+ initialThreadId: startThreadIdRef.current,
36
+ runtimeHook: stableRuntimeHook
37
+ }), [
38
+ options.adapter,
39
+ options.allowNesting,
40
+ stableRuntimeHook
41
+ ]);
42
+ if (useAui().threadListItem.source !== null) {
43
+ if (!stableOptions.allowNesting) throw new Error("useRemoteThreadListRuntime cannot be nested inside another RemoteThreadListRuntime. Set allowNesting: true to allow nesting (the inner runtime will become a no-op).");
44
+ return stableRuntimeHook();
45
+ }
46
+ const runtime = useRemoteThreadListRuntimeImpl(stableOptions);
47
+ const prevThreadIdRef = useRef(options.threadId);
48
+ useEffect(() => {
49
+ if (options.threadId === prevThreadIdRef.current) return;
50
+ prevThreadIdRef.current = options.threadId;
51
+ if (options.threadId) runtime.threads.switchToThread(options.threadId).catch(() => {});
52
+ else runtime.threads.switchToNewThread().catch(() => {});
53
+ }, [runtime, options.threadId]);
54
+ return runtime;
69
55
  };
56
+ //#endregion
57
+ export { useRemoteThreadListRuntime };
58
+
70
59
  //# sourceMappingURL=useRemoteThreadListRuntime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRemoteThreadListRuntime.js","sourceRoot":"","sources":["../../../src/react/runtimes/useRemoteThreadListRuntime.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"useRemoteThreadListRuntime.js","names":[],"sources":["../../../src/react/runtimes/useRemoteThreadListRuntime.ts"],"sourcesContent":["import { useState, useEffect, useMemo, useRef, useCallback } from \"react\";\nimport { BaseAssistantRuntimeCore } from \"../../runtime/base/base-assistant-runtime-core\";\nimport { AssistantRuntimeImpl } from \"../../runtime/api/assistant-runtime\";\nimport type { RemoteThreadListOptions } from \"../../runtimes/remote-thread-list/types\";\nimport type { AssistantRuntimeCore } from \"../../runtime/interfaces/assistant-runtime-core\";\nimport type { AssistantRuntime } from \"../../runtime/api/assistant-runtime\";\nimport { RemoteThreadListThreadListRuntimeCore } from \"./RemoteThreadListThreadListRuntimeCore\";\nimport { useAui } from \"@assistant-ui/store\";\n\nclass RemoteThreadListRuntimeCore\n extends BaseAssistantRuntimeCore\n implements AssistantRuntimeCore\n{\n public readonly threads;\n\n constructor(options: RemoteThreadListOptions) {\n super();\n this.threads = new RemoteThreadListThreadListRuntimeCore(\n options,\n this._contextProvider,\n );\n }\n\n public get RenderComponent() {\n return this.threads.__internal_RenderComponent;\n }\n}\n\nconst useRemoteThreadListRuntimeImpl = (\n options: RemoteThreadListOptions,\n): AssistantRuntime => {\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n const [runtime] = useState(() => new RemoteThreadListRuntimeCore(options));\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n useEffect(() => {\n runtime.threads.__internal_setOptions(options);\n runtime.threads.__internal_load();\n }, [runtime, options]);\n\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n return useMemo(() => new AssistantRuntimeImpl(runtime), [runtime]);\n};\n\nexport const useRemoteThreadListRuntime = (\n options: RemoteThreadListOptions,\n): AssistantRuntime => {\n const runtimeHookRef = useRef(options.runtimeHook);\n runtimeHookRef.current = options.runtimeHook;\n\n // threadId/initialThreadId only affect the constructor; capture once via ref\n const startThreadIdRef = useRef(options.threadId ?? options.initialThreadId);\n\n const stableRuntimeHook = useCallback(() => {\n return runtimeHookRef.current();\n }, []);\n\n const stableOptions = useMemo<RemoteThreadListOptions>(\n () => ({\n adapter: options.adapter,\n allowNesting: options.allowNesting,\n initialThreadId: startThreadIdRef.current,\n runtimeHook: stableRuntimeHook,\n }),\n [options.adapter, options.allowNesting, stableRuntimeHook],\n );\n\n const aui = useAui();\n const isNested = aui.threadListItem.source !== null;\n\n if (isNested) {\n if (!stableOptions.allowNesting) {\n throw new Error(\n \"useRemoteThreadListRuntime cannot be nested inside another RemoteThreadListRuntime. \" +\n \"Set allowNesting: true to allow nesting (the inner runtime will become a no-op).\",\n );\n }\n\n // If allowNesting is true and already inside a thread list context,\n // just call the runtimeHook directly (no-op behavior)\n return stableRuntimeHook();\n }\n\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n const runtime = useRemoteThreadListRuntimeImpl(stableOptions);\n\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n const prevThreadIdRef = useRef(options.threadId);\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n useEffect(() => {\n if (options.threadId === prevThreadIdRef.current) return;\n prevThreadIdRef.current = options.threadId;\n if (options.threadId) {\n runtime.threads.switchToThread(options.threadId).catch(() => {});\n } else {\n runtime.threads.switchToNewThread().catch(() => {});\n }\n }, [runtime, options.threadId]);\n\n return runtime;\n};\n"],"mappings":";;;;;;AASA,IAAM,8BAAN,cACU,yBAEV;CACE;CAEA,YAAY,SAAkC;EAC5C,MAAM;EACN,KAAK,UAAU,IAAI,sCACjB,SACA,KAAK,gBACP;CACF;CAEA,IAAW,kBAAkB;EAC3B,OAAO,KAAK,QAAQ;CACtB;AACF;AAEA,MAAM,kCACJ,YACqB;CAErB,MAAM,CAAC,WAAW,eAAe,IAAI,4BAA4B,OAAO,CAAC;CAEzE,gBAAgB;EACd,QAAQ,QAAQ,sBAAsB,OAAO;EAC7C,QAAQ,QAAQ,gBAAgB;CAClC,GAAG,CAAC,SAAS,OAAO,CAAC;CAGrB,OAAO,cAAc,IAAI,qBAAqB,OAAO,GAAG,CAAC,OAAO,CAAC;AACnE;AAEA,MAAa,8BACX,YACqB;CACrB,MAAM,iBAAiB,OAAO,QAAQ,WAAW;CACjD,eAAe,UAAU,QAAQ;CAGjC,MAAM,mBAAmB,OAAO,QAAQ,YAAY,QAAQ,eAAe;CAE3E,MAAM,oBAAoB,kBAAkB;EAC1C,OAAO,eAAe,QAAQ;CAChC,GAAG,CAAC,CAAC;CAEL,MAAM,gBAAgB,eACb;EACL,SAAS,QAAQ;EACjB,cAAc,QAAQ;EACtB,iBAAiB,iBAAiB;EAClC,aAAa;CACf,IACA;EAAC,QAAQ;EAAS,QAAQ;EAAc;CAAiB,CAC3D;CAKA,IAHY,OACO,EAAE,eAAe,WAAW,MAEjC;EACZ,IAAI,CAAC,cAAc,cACjB,MAAM,IAAI,MACR,sKAEF;EAKF,OAAO,kBAAkB;CAC3B;CAGA,MAAM,UAAU,+BAA+B,aAAa;CAG5D,MAAM,kBAAkB,OAAO,QAAQ,QAAQ;CAE/C,gBAAgB;EACd,IAAI,QAAQ,aAAa,gBAAgB,SAAS;EAClD,gBAAgB,UAAU,QAAQ;EAClC,IAAI,QAAQ,UACV,QAAQ,QAAQ,eAAe,QAAQ,QAAQ,EAAE,YAAY,CAAC,CAAC;OAE/D,QAAQ,QAAQ,kBAAkB,EAAE,YAAY,CAAC,CAAC;CAEtD,GAAG,CAAC,SAAS,QAAQ,QAAQ,CAAC;CAE9B,OAAO;AACT"}
@@ -1,25 +1,27 @@
1
- import { type Tool, type ToolModelContentPart } from "assistant-stream";
2
- import { type ReadonlyJSONValue } from "assistant-stream/utils";
3
- import type { ThreadMessage } from "../../types/message.js";
4
- export type AssistantTransportState = {
5
- readonly messages: readonly ThreadMessage[];
6
- readonly state?: ReadonlyJSONValue;
7
- readonly isRunning: boolean;
1
+ import { ThreadMessage } from "../../types/message.js";
2
+ import { Tool, ToolModelContentPart } from "assistant-stream";
3
+ import { ReadonlyJSONValue } from "assistant-stream/utils";
4
+
5
+ //#region src/react/runtimes/useToolInvocations.d.ts
6
+ type AssistantTransportState = {
7
+ readonly messages: readonly ThreadMessage[];
8
+ readonly state?: ReadonlyJSONValue;
9
+ readonly isRunning: boolean;
8
10
  };
9
- export type AddToolResultCommand = {
10
- readonly type: "add-tool-result";
11
- readonly toolCallId: string;
12
- readonly toolName: string;
13
- readonly result: ReadonlyJSONValue;
14
- readonly isError: boolean;
15
- readonly artifact?: ReadonlyJSONValue;
16
- readonly modelContent?: readonly ToolModelContentPart[];
11
+ type AddToolResultCommand = {
12
+ readonly type: "add-tool-result";
13
+ readonly toolCallId: string;
14
+ readonly toolName: string;
15
+ readonly result: ReadonlyJSONValue;
16
+ readonly isError: boolean;
17
+ readonly artifact?: ReadonlyJSONValue;
18
+ readonly modelContent?: readonly ToolModelContentPart[];
17
19
  };
18
20
  type UseToolInvocationsParams = {
19
- state: AssistantTransportState;
20
- getTools: () => Record<string, Tool> | undefined;
21
- onResult: (command: AddToolResultCommand) => void;
22
- setToolStatuses: (updater: Record<string, ToolExecutionStatus> | ((prev: Record<string, ToolExecutionStatus>) => Record<string, ToolExecutionStatus>)) => void;
21
+ state: AssistantTransportState;
22
+ getTools: () => Record<string, Tool> | undefined;
23
+ onResult: (command: AddToolResultCommand) => void;
24
+ setToolStatuses: (updater: Record<string, ToolExecutionStatus> | ((prev: Record<string, ToolExecutionStatus>) => Record<string, ToolExecutionStatus>)) => void;
23
25
  };
24
26
  /**
25
27
  * Streaming execution state for a frontend tool.
@@ -27,22 +29,25 @@ type UseToolInvocationsParams = {
27
29
  * Custom runtime integrations use this to mirror in-flight tool calls while
28
30
  * `useToolInvocations` executes tools in the browser.
29
31
  */
30
- export type ToolExecutionStatus = {
31
- /** The tool's execute function is currently running. */
32
- type: "executing";
32
+ type ToolExecutionStatus = {
33
+ /** The tool's execute function is currently running. */type: "executing";
33
34
  } | {
34
- /** The tool is waiting for a human input payload before continuing. */
35
- type: "interrupt";
36
- /** Human input request emitted by the tool execution context. */
37
- payload: {
38
- type: "human";
39
- payload: unknown;
40
- };
35
+ /** The tool is waiting for a human input payload before continuing. */type: "interrupt"; /** Human input request emitted by the tool execution context. */
36
+ payload: {
37
+ type: "human";
38
+ payload: unknown;
39
+ };
41
40
  };
42
- export declare function useToolInvocations({ state, getTools, onResult, setToolStatuses, }: UseToolInvocationsParams): {
43
- reset: () => void;
44
- abort: () => Promise<void>;
45
- resume: (toolCallId: string, payload: unknown) => void;
41
+ declare function useToolInvocations({
42
+ state,
43
+ getTools,
44
+ onResult,
45
+ setToolStatuses
46
+ }: UseToolInvocationsParams): {
47
+ reset: () => void;
48
+ abort: () => Promise<void>;
49
+ resume: (toolCallId: string, payload: unknown) => void;
46
50
  };
47
- export {};
51
+ //#endregion
52
+ export { AddToolResultCommand, AssistantTransportState, ToolExecutionStatus, useToolInvocations };
48
53
  //# sourceMappingURL=useToolInvocations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useToolInvocations.d.ts","sourceRoot":"","sources":["../../../src/react/runtimes/useToolInvocations.ts"],"names":[],"mappings":"AAGA,OAAO,EAKL,KAAK,IAAI,EACT,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA4B;AAEzD,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IAC5C,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACzD,CAAC;AA0BF,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,uBAAuB,CAAC;IAC/B,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,SAAS,CAAC;IACjD,QAAQ,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAClD,eAAe,EAAE,CACf,OAAO,EACH,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,GACnC,CAAC,CACC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,KACtC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,KAC1C,IAAI,CAAC;CACX,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IACE,wDAAwD;IACxD,IAAI,EAAE,WAAW,CAAC;CACnB,GACD;IACE,uEAAuE;IACvE,IAAI,EAAE,WAAW,CAAC;IAClB,iEAAiE;IACjE,OAAO,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAC9C,CAAC;AAwCN,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,eAAe,GAChB,EAAE,wBAAwB;;iBA+fP,OAAO,CAAC,IAAI,CAAC;yBAkCR,MAAM,WAAW,OAAO;EAgBhD"}
1
+ {"version":3,"file":"useToolInvocations.d.ts","names":[],"sources":["../../../src/react/runtimes/useToolInvocations.ts"],"mappings":";;;;;KAkBY,uBAAA;EAAA,SACD,QAAA,WAAmB,aAAA;EAAA,SACnB,KAAA,GAAQ,iBAAiB;EAAA,SACzB,SAAA;AAAA;AAAA,KAGC,oBAAA;EAAA,SACD,IAAA;EAAA,SACA,UAAA;EAAA,SACA,QAAA;EAAA,SACA,MAAA,EAAQ,iBAAA;EAAA,SACR,OAAA;EAAA,SACA,QAAA,GAAW,iBAAA;EAAA,SACX,YAAA,YAAwB,oBAAA;AAAA;AAAA,KA2B9B,wBAAA;EACH,KAAA,EAAO,uBAAA;EACP,QAAA,QAAgB,MAAA,SAAe,IAAA;EAC/B,QAAA,GAAW,OAAA,EAAS,oBAAA;EACpB,eAAA,GACE,OAAA,EACI,MAAA,SAAe,mBAAA,MAEb,IAAA,EAAM,MAAA,SAAe,mBAAA,MAClB,MAAA,SAAe,mBAAA;AAAA;;;;;;;KAUhB,mBAAA;EA/CD,wDAkDL,IAAA;AAAA;EAjD6B,uEAqD7B,IAAA,eArDiD;EAuDjD,OAAA;IAAW,IAAA;IAAe,OAAA;EAAA;AAAA;AAAA,iBAyChB,kBAAA,CAAA;EACd,KAAA;EACA,QAAA;EACA,QAAA;EACA;AAAA,GACC,wBAAA;;eA+fiB,OAAA;+BAkCW,OAAA;AAAA"}