@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,108 +1,94 @@
1
- import { mergeModelContexts, } from "./types.js";
2
- export class ModelContextRegistry {
3
- _tools = new Map();
4
- _instructions = new Map();
5
- _providers = new Map();
6
- _subscribers = new Set();
7
- _providerUnsubscribes = new Map();
8
- getModelContext() {
9
- const instructions = Array.from(this._instructions.values()).filter(Boolean);
10
- const system = instructions.length > 0 ? instructions.join("\n\n") : undefined;
11
- const tools = {};
12
- for (const toolProps of this._tools.values()) {
13
- const { toolName, render, ...tool } = toolProps;
14
- tools[toolName] = tool;
15
- }
16
- const providerContexts = mergeModelContexts(new Set(this._providers.values()));
17
- const context = {
18
- system,
19
- tools: Object.keys(tools).length > 0 ? tools : undefined,
20
- };
21
- if (providerContexts.system) {
22
- context.system = context.system
23
- ? `${context.system}\n\n${providerContexts.system}`
24
- : providerContexts.system;
25
- }
26
- if (providerContexts.tools) {
27
- context.tools = { ...(context.tools || {}), ...providerContexts.tools };
28
- }
29
- if (providerContexts.callSettings) {
30
- context.callSettings = providerContexts.callSettings;
31
- }
32
- if (providerContexts.config) {
33
- context.config = providerContexts.config;
34
- }
35
- return context;
36
- }
37
- subscribe(callback) {
38
- this._subscribers.add(callback);
39
- return () => this._subscribers.delete(callback);
40
- }
41
- notifySubscribers() {
42
- for (const callback of this._subscribers) {
43
- callback();
44
- }
45
- }
46
- addTool(tool) {
47
- const id = Symbol();
48
- this._tools.set(id, tool);
49
- this.notifySubscribers();
50
- return {
51
- update: (newTool) => {
52
- if (this._tools.has(id)) {
53
- this._tools.set(id, newTool);
54
- this.notifySubscribers();
55
- }
56
- },
57
- remove: () => {
58
- this._tools.delete(id);
59
- this.notifySubscribers();
60
- },
61
- };
62
- }
63
- addInstruction(config) {
64
- const id = Symbol();
65
- const instruction = typeof config === "string" ? config : config.instruction;
66
- const disabled = typeof config === "object" ? config.disabled : false;
67
- if (!disabled) {
68
- this._instructions.set(id, instruction);
69
- this.notifySubscribers();
70
- }
71
- return {
72
- update: (newConfig) => {
73
- const newInstruction = typeof newConfig === "string" ? newConfig : newConfig.instruction;
74
- const newDisabled = typeof newConfig === "object" ? newConfig.disabled : false;
75
- if (newDisabled) {
76
- this._instructions.delete(id);
77
- }
78
- else {
79
- this._instructions.set(id, newInstruction);
80
- }
81
- this.notifySubscribers();
82
- },
83
- remove: () => {
84
- this._instructions.delete(id);
85
- this.notifySubscribers();
86
- },
87
- };
88
- }
89
- addProvider(provider) {
90
- const id = Symbol();
91
- this._providers.set(id, provider);
92
- const unsubscribe = provider.subscribe?.(() => {
93
- this.notifySubscribers();
94
- });
95
- this._providerUnsubscribes.set(id, unsubscribe);
96
- this.notifySubscribers();
97
- return {
98
- remove: () => {
99
- this._providers.delete(id);
100
- const unsubscribe = this._providerUnsubscribes.get(id);
101
- unsubscribe?.();
102
- this._providerUnsubscribes.delete(id);
103
- this.notifySubscribers();
104
- },
105
- };
106
- }
107
- }
1
+ import { mergeModelContexts } from "./types.js";
2
+ //#region src/model-context/registry.ts
3
+ var ModelContextRegistry = class {
4
+ _tools = /* @__PURE__ */ new Map();
5
+ _instructions = /* @__PURE__ */ new Map();
6
+ _providers = /* @__PURE__ */ new Map();
7
+ _subscribers = /* @__PURE__ */ new Set();
8
+ _providerUnsubscribes = /* @__PURE__ */ new Map();
9
+ getModelContext() {
10
+ const instructions = Array.from(this._instructions.values()).filter(Boolean);
11
+ const system = instructions.length > 0 ? instructions.join("\n\n") : void 0;
12
+ const tools = {};
13
+ for (const toolProps of this._tools.values()) {
14
+ const { toolName, render, ...tool } = toolProps;
15
+ tools[toolName] = tool;
16
+ }
17
+ const providerContexts = mergeModelContexts(new Set(this._providers.values()));
18
+ const context = {
19
+ system,
20
+ tools: Object.keys(tools).length > 0 ? tools : void 0
21
+ };
22
+ if (providerContexts.system) context.system = context.system ? `${context.system}\n\n${providerContexts.system}` : providerContexts.system;
23
+ if (providerContexts.tools) context.tools = {
24
+ ...context.tools || {},
25
+ ...providerContexts.tools
26
+ };
27
+ if (providerContexts.callSettings) context.callSettings = providerContexts.callSettings;
28
+ if (providerContexts.config) context.config = providerContexts.config;
29
+ return context;
30
+ }
31
+ subscribe(callback) {
32
+ this._subscribers.add(callback);
33
+ return () => this._subscribers.delete(callback);
34
+ }
35
+ notifySubscribers() {
36
+ for (const callback of this._subscribers) callback();
37
+ }
38
+ addTool(tool) {
39
+ const id = Symbol();
40
+ this._tools.set(id, tool);
41
+ this.notifySubscribers();
42
+ return {
43
+ update: (newTool) => {
44
+ if (this._tools.has(id)) {
45
+ this._tools.set(id, newTool);
46
+ this.notifySubscribers();
47
+ }
48
+ },
49
+ remove: () => {
50
+ this._tools.delete(id);
51
+ this.notifySubscribers();
52
+ }
53
+ };
54
+ }
55
+ addInstruction(config) {
56
+ const id = Symbol();
57
+ const instruction = typeof config === "string" ? config : config.instruction;
58
+ if (!(typeof config === "object" ? config.disabled : false)) {
59
+ this._instructions.set(id, instruction);
60
+ this.notifySubscribers();
61
+ }
62
+ return {
63
+ update: (newConfig) => {
64
+ const newInstruction = typeof newConfig === "string" ? newConfig : newConfig.instruction;
65
+ if (typeof newConfig === "object" ? newConfig.disabled : false) this._instructions.delete(id);
66
+ else this._instructions.set(id, newInstruction);
67
+ this.notifySubscribers();
68
+ },
69
+ remove: () => {
70
+ this._instructions.delete(id);
71
+ this.notifySubscribers();
72
+ }
73
+ };
74
+ }
75
+ addProvider(provider) {
76
+ const id = Symbol();
77
+ this._providers.set(id, provider);
78
+ const unsubscribe = provider.subscribe?.(() => {
79
+ this.notifySubscribers();
80
+ });
81
+ this._providerUnsubscribes.set(id, unsubscribe);
82
+ this.notifySubscribers();
83
+ return { remove: () => {
84
+ this._providers.delete(id);
85
+ this._providerUnsubscribes.get(id)?.();
86
+ this._providerUnsubscribes.delete(id);
87
+ this.notifySubscribers();
88
+ } };
89
+ }
90
+ };
91
+ //#endregion
92
+ export { ModelContextRegistry };
93
+
108
94
  //# sourceMappingURL=registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/model-context/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,GAGnB,mBAAgB;AAQjB,MAAM,OAAO,oBAAoB;IACvB,MAAM,GAAG,IAAI,GAAG,EAAwC,CAAC;IACzD,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC1C,UAAU,GAAG,IAAI,GAAG,EAAgC,CAAC;IACrD,YAAY,GAAG,IAAI,GAAG,EAAc,CAAC;IACrC,qBAAqB,GAAG,IAAI,GAAG,EAAmC,CAAC;IAE3E,eAAe;QACb,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAA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E;YAC5C,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;QAEhD,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAEzB,OAAO;YACL,MAAM,EAAE,GAAG,EAAE;gBACX,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBAC3B,MAAM,WAAW,GAAG,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACvD,WAAW,EAAE,EAAE,CAAC;gBAChB,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACtC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC3B,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"registry.js","names":[],"sources":["../../src/model-context/registry.ts"],"sourcesContent":["import type { Tool } from \"assistant-stream\";\nimport {\n type ModelContext,\n type ModelContextProvider,\n mergeModelContexts,\n type AssistantToolProps,\n type AssistantInstructionsConfig,\n} from \"./types\";\nimport type { Unsubscribe } from \"../types/unsubscribe\";\nimport type {\n ModelContextRegistryToolHandle,\n ModelContextRegistryInstructionHandle,\n ModelContextRegistryProviderHandle,\n} from \"./registry-handles\";\n\nexport class ModelContextRegistry implements ModelContextProvider {\n private _tools = new Map<symbol, AssistantToolProps<any, any>>();\n private _instructions = new Map<symbol, string>();\n private _providers = new Map<symbol, ModelContextProvider>();\n private _subscribers = new Set<() => void>();\n private _providerUnsubscribes = new Map<symbol, Unsubscribe | undefined>();\n\n getModelContext(): ModelContext {\n const instructions = Array.from(this._instructions.values()).filter(\n Boolean,\n );\n\n const system =\n instructions.length > 0 ? instructions.join(\"\\n\\n\") : undefined;\n\n const tools: Record<string, Tool<any, any>> = {};\n for (const toolProps of this._tools.values()) {\n const { toolName, render, ...tool } = toolProps;\n tools[toolName] = tool;\n }\n\n const providerContexts = mergeModelContexts(\n new Set(this._providers.values()),\n );\n\n const context: ModelContext = {\n system,\n tools: Object.keys(tools).length > 0 ? tools : undefined,\n };\n\n if (providerContexts.system) {\n context.system = context.system\n ? `${context.system}\\n\\n${providerContexts.system}`\n : providerContexts.system;\n }\n\n if (providerContexts.tools) {\n context.tools = { ...(context.tools || {}), ...providerContexts.tools };\n }\n\n if (providerContexts.callSettings) {\n context.callSettings = providerContexts.callSettings;\n }\n\n if (providerContexts.config) {\n context.config = providerContexts.config;\n }\n\n return context;\n }\n\n subscribe(callback: () => void): Unsubscribe {\n this._subscribers.add(callback);\n return () => this._subscribers.delete(callback);\n }\n\n private notifySubscribers(): void {\n for (const callback of this._subscribers) {\n callback();\n }\n }\n\n addTool<TArgs extends Record<string, unknown>, TResult>(\n tool: AssistantToolProps<TArgs, TResult>,\n ): ModelContextRegistryToolHandle<TArgs, TResult> {\n const id = Symbol();\n\n this._tools.set(id, tool);\n this.notifySubscribers();\n\n return {\n update: (newTool: AssistantToolProps<TArgs, TResult>) => {\n if (this._tools.has(id)) {\n this._tools.set(id, newTool);\n this.notifySubscribers();\n }\n },\n remove: () => {\n this._tools.delete(id);\n this.notifySubscribers();\n },\n };\n }\n\n addInstruction(\n config: string | AssistantInstructionsConfig,\n ): ModelContextRegistryInstructionHandle {\n const id = Symbol();\n\n const instruction =\n typeof config === \"string\" ? config : config.instruction;\n const disabled = typeof config === \"object\" ? config.disabled : false;\n\n if (!disabled) {\n this._instructions.set(id, instruction);\n this.notifySubscribers();\n }\n\n return {\n update: (newConfig: string | AssistantInstructionsConfig) => {\n const newInstruction =\n typeof newConfig === \"string\" ? newConfig : newConfig.instruction;\n const newDisabled =\n typeof newConfig === \"object\" ? newConfig.disabled : false;\n\n if (newDisabled) {\n this._instructions.delete(id);\n } else {\n this._instructions.set(id, newInstruction);\n }\n this.notifySubscribers();\n },\n remove: () => {\n this._instructions.delete(id);\n this.notifySubscribers();\n },\n };\n }\n\n addProvider(\n provider: ModelContextProvider,\n ): ModelContextRegistryProviderHandle {\n const id = Symbol();\n\n this._providers.set(id, provider);\n\n const unsubscribe = provider.subscribe?.(() => {\n this.notifySubscribers();\n });\n this._providerUnsubscribes.set(id, unsubscribe);\n\n this.notifySubscribers();\n\n return {\n remove: () => {\n this._providers.delete(id);\n const unsubscribe = this._providerUnsubscribes.get(id);\n unsubscribe?.();\n this._providerUnsubscribes.delete(id);\n this.notifySubscribers();\n },\n };\n }\n}\n"],"mappings":";;AAeA,IAAa,uBAAb,MAAkE;CAChE,yBAAiB,IAAI,IAA0C;CAC/D,gCAAwB,IAAI,IAAoB;CAChD,6BAAqB,IAAI,IAAkC;CAC3D,+BAAuB,IAAI,IAAgB;CAC3C,wCAAgC,IAAI,IAAqC;CAEzE,kBAAgC;EAC9B,MAAM,eAAe,MAAM,KAAK,KAAK,cAAc,OAAO,CAAC,EAAE,OAC3D,OACF;EAEA,MAAM,SACJ,aAAa,SAAS,IAAI,aAAa,KAAK,MAAM,IAAI,KAAA;EAExD,MAAM,QAAwC,CAAC;EAC/C,KAAK,MAAM,aAAa,KAAK,OAAO,OAAO,GAAG;GAC5C,MAAM,EAAE,UAAU,QAAQ,GAAG,SAAS;GACtC,MAAM,YAAY;EACpB;EAEA,MAAM,mBAAmB,mBACvB,IAAI,IAAI,KAAK,WAAW,OAAO,CAAC,CAClC;EAEA,MAAM,UAAwB;GAC5B;GACA,OAAO,OAAO,KAAK,KAAK,EAAE,SAAS,IAAI,QAAQ,KAAA;EACjD;EAEA,IAAI,iBAAiB,QACnB,QAAQ,SAAS,QAAQ,SACrB,GAAG,QAAQ,OAAO,MAAM,iBAAiB,WACzC,iBAAiB;EAGvB,IAAI,iBAAiB,OACnB,QAAQ,QAAQ;GAAE,GAAI,QAAQ,SAAS,CAAC;GAAI,GAAG,iBAAiB;EAAM;EAGxE,IAAI,iBAAiB,cACnB,QAAQ,eAAe,iBAAiB;EAG1C,IAAI,iBAAiB,QACnB,QAAQ,SAAS,iBAAiB;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,KAAK,WAAW,OAAO,EAAE;GAEzB,KADyB,sBAAsB,IAAI,EACzC,IAAI;GACd,KAAK,sBAAsB,OAAO,EAAE;GACpC,KAAK,kBAAkB;EACzB,EACF;CACF;AACF"}
@@ -1,4 +1,6 @@
1
- import type { Tool } from "assistant-stream";
1
+ import { Tool } from "assistant-stream";
2
+
3
+ //#region src/model-context/tool.d.ts
2
4
  /**
3
5
  * Defines a model tool with its argument schema, execution behavior, and
4
6
  * optional model-output conversion.
@@ -24,5 +26,7 @@ import type { Tool } from "assistant-stream";
24
26
  * });
25
27
  * ```
26
28
  */
27
- export declare function tool<TArgs extends Record<string, unknown>, TResult = any>(tool: Tool<TArgs, TResult>): Tool<TArgs, TResult>;
29
+ declare function tool<TArgs extends Record<string, unknown>, TResult = any>(tool: Tool<TArgs, TResult>): Tool<TArgs, TResult>;
30
+ //#endregion
31
+ export { tool };
28
32
  //# sourceMappingURL=tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/model-context/tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAI7C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,IAAI,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,GAAG,EACvE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,GACzB,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAEtB"}
1
+ {"version":3,"file":"tool.d.ts","names":[],"sources":["../../src/model-context/tool.ts"],"mappings":";;;;;AA6BA;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,IAAA,eAAmB,MAAA,iCAAA,CACjC,IAAA,EAAM,IAAA,CAAK,KAAA,EAAO,OAAA,IACjB,IAAA,CAAK,KAAA,EAAO,OAAA"}
@@ -1,30 +1,33 @@
1
- // TODO re-add the inferrence of the parameters
1
+ //#region src/model-context/tool.ts
2
2
  /**
3
- * Defines a model tool with its argument schema, execution behavior, and
4
- * optional model-output conversion.
5
- *
6
- * This helper keeps reusable tool definitions type-checked and convenient to
7
- * export for a {@link Toolkit}, {@link Tools}, or {@link useAssistantTool}.
8
- * Inference from parameter schemas is currently limited, so provide generic
9
- * arguments when you need precise args or result types.
10
- *
11
- * @param tool - Tool definition to expose to the assistant model.
12
- *
13
- * @example
14
- * ```ts
15
- * const getWeather = tool<{ city: string }, string>({
16
- * type: "frontend",
17
- * description: "Get the weather for a city.",
18
- * parameters: {
19
- * type: "object",
20
- * properties: { city: { type: "string" } },
21
- * required: ["city"],
22
- * },
23
- * execute: async ({ city }) => `Sunny in ${city}`,
24
- * });
25
- * ```
26
- */
27
- export function tool(tool) {
28
- return tool;
3
+ * Defines a model tool with its argument schema, execution behavior, and
4
+ * optional model-output conversion.
5
+ *
6
+ * This helper keeps reusable tool definitions type-checked and convenient to
7
+ * export for a {@link Toolkit}, {@link Tools}, or {@link useAssistantTool}.
8
+ * Inference from parameter schemas is currently limited, so provide generic
9
+ * arguments when you need precise args or result types.
10
+ *
11
+ * @param tool - Tool definition to expose to the assistant model.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const getWeather = tool<{ city: string }, string>({
16
+ * type: "frontend",
17
+ * description: "Get the weather for a city.",
18
+ * parameters: {
19
+ * type: "object",
20
+ * properties: { city: { type: "string" } },
21
+ * required: ["city"],
22
+ * },
23
+ * execute: async ({ city }) => `Sunny in ${city}`,
24
+ * });
25
+ * ```
26
+ */
27
+ function tool(tool) {
28
+ return tool;
29
29
  }
30
+ //#endregion
31
+ export { tool };
32
+
30
33
  //# sourceMappingURL=tool.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/model-context/tool.ts"],"names":[],"mappings":"AAEA,+CAA+C;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,IAAI,CAClB,IAA0B;IAE1B,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"tool.js","names":[],"sources":["../../src/model-context/tool.ts"],"sourcesContent":["import type { Tool } from \"assistant-stream\";\n\n// TODO re-add the inferrence of the parameters\n\n/**\n * Defines a model tool with its argument schema, execution behavior, and\n * optional model-output conversion.\n *\n * This helper keeps reusable tool definitions type-checked and convenient to\n * export for a {@link Toolkit}, {@link Tools}, or {@link useAssistantTool}.\n * Inference from parameter schemas is currently limited, so provide generic\n * arguments when you need precise args or result types.\n *\n * @param tool - Tool definition to expose to the assistant model.\n *\n * @example\n * ```ts\n * const getWeather = tool<{ city: string }, string>({\n * type: \"frontend\",\n * description: \"Get the weather for a city.\",\n * parameters: {\n * type: \"object\",\n * properties: { city: { type: \"string\" } },\n * required: [\"city\"],\n * },\n * execute: async ({ city }) => `Sunny in ${city}`,\n * });\n * ```\n */\nexport function tool<TArgs extends Record<string, unknown>, TResult = any>(\n tool: Tool<TArgs, TResult>,\n): Tool<TArgs, TResult> {\n return tool;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAgB,KACd,MACsB;CACtB,OAAO;AACT"}
@@ -1,41 +1,45 @@
1
- import type { Unsubscribe } from "../types/unsubscribe.js";
2
- import type { Tool } from "assistant-stream";
3
- export type LanguageModelV1CallSettings = {
4
- maxTokens?: number;
5
- temperature?: number;
6
- topP?: number;
7
- presencePenalty?: number;
8
- frequencyPenalty?: number;
9
- seed?: number;
10
- headers?: Record<string, string | undefined>;
1
+ import { Unsubscribe } from "../types/unsubscribe.js";
2
+ import { Tool } from "assistant-stream";
3
+
4
+ //#region src/model-context/types.d.ts
5
+ type LanguageModelV1CallSettings = {
6
+ maxTokens?: number;
7
+ temperature?: number;
8
+ topP?: number;
9
+ presencePenalty?: number;
10
+ frequencyPenalty?: number;
11
+ seed?: number;
12
+ headers?: Record<string, string | undefined>;
11
13
  };
12
- export type LanguageModelConfig = {
13
- apiKey?: string;
14
- baseUrl?: string;
15
- modelName?: string;
14
+ type LanguageModelConfig = {
15
+ apiKey?: string;
16
+ baseUrl?: string;
17
+ modelName?: string;
16
18
  };
17
- export type ModelContext = {
18
- priority?: number | undefined;
19
- system?: string | undefined;
20
- tools?: Record<string, Tool<any, any>> | undefined;
21
- callSettings?: LanguageModelV1CallSettings | undefined;
22
- config?: LanguageModelConfig | undefined;
19
+ type ModelContext = {
20
+ priority?: number | undefined;
21
+ system?: string | undefined;
22
+ tools?: Record<string, Tool<any, any>> | undefined;
23
+ callSettings?: LanguageModelV1CallSettings | undefined;
24
+ config?: LanguageModelConfig | undefined;
23
25
  };
24
- export type ModelContextProvider = {
25
- getModelContext: () => ModelContext;
26
- subscribe?: (callback: () => void) => Unsubscribe;
26
+ type ModelContextProvider = {
27
+ getModelContext: () => ModelContext;
28
+ subscribe?: (callback: () => void) => Unsubscribe;
27
29
  };
28
- export type AssistantToolProps<TArgs extends Record<string, unknown>, TResult> = Tool<TArgs, TResult> & {
29
- toolName: string;
30
- render?: unknown;
30
+ type AssistantToolProps<TArgs extends Record<string, unknown>, TResult> = Tool<TArgs, TResult> & {
31
+ toolName: string;
32
+ render?: unknown;
31
33
  };
32
- export type AssistantInstructionsConfig = {
33
- disabled?: boolean | undefined;
34
- instruction: string;
34
+ type AssistantInstructionsConfig = {
35
+ disabled?: boolean | undefined;
36
+ instruction: string;
35
37
  };
36
- export type AssistantContextConfig = {
37
- getContext: () => string;
38
- disabled?: boolean | undefined;
38
+ type AssistantContextConfig = {
39
+ getContext: () => string;
40
+ disabled?: boolean | undefined;
39
41
  };
40
- export declare const mergeModelContexts: (configSet: Set<ModelContextProvider>) => ModelContext;
42
+ declare const mergeModelContexts: (configSet: Set<ModelContextProvider>) => ModelContext;
43
+ //#endregion
44
+ export { AssistantContextConfig, AssistantInstructionsConfig, AssistantToolProps, LanguageModelConfig, LanguageModelV1CallSettings, ModelContext, ModelContextProvider, mergeModelContexts };
41
45
  //# sourceMappingURL=types.d.ts.map
@@ -1 +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,26 @@
1
- export const mergeModelContexts = (configSet) => {
2
- const configs = Array.from(configSet)
3
- .map((c) => c.getModelContext())
4
- .sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
5
- return configs.reduce((acc, config) => {
6
- if (config.system) {
7
- if (acc.system) {
8
- acc.system += `\n\n${config.system}`;
9
- }
10
- else {
11
- acc.system = config.system;
12
- }
13
- }
14
- if (config.tools) {
15
- for (const [name, tool] of Object.entries(config.tools)) {
16
- const existing = acc.tools?.[name];
17
- if (existing && existing !== tool) {
18
- throw new Error(`You tried to define a tool with the name ${name}, but it already exists.`);
19
- }
20
- if (!acc.tools)
21
- acc.tools = {};
22
- acc.tools[name] = tool;
23
- }
24
- }
25
- if (config.config) {
26
- acc.config = {
27
- ...acc.config,
28
- ...config.config,
29
- };
30
- }
31
- if (config.callSettings) {
32
- acc.callSettings = {
33
- ...acc.callSettings,
34
- ...config.callSettings,
35
- };
36
- }
37
- return acc;
38
- }, {});
1
+ //#region src/model-context/types.ts
2
+ const mergeModelContexts = (configSet) => {
3
+ return Array.from(configSet).map((c) => c.getModelContext()).sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0)).reduce((acc, config) => {
4
+ if (config.system) if (acc.system) acc.system += `\n\n${config.system}`;
5
+ else acc.system = config.system;
6
+ if (config.tools) for (const [name, tool] of Object.entries(config.tools)) {
7
+ const existing = acc.tools?.[name];
8
+ if (existing && existing !== tool) throw new Error(`You tried to define a tool with the name ${name}, but it already exists.`);
9
+ if (!acc.tools) acc.tools = {};
10
+ acc.tools[name] = tool;
11
+ }
12
+ if (config.config) acc.config = {
13
+ ...acc.config,
14
+ ...config.config
15
+ };
16
+ if (config.callSettings) acc.callSettings = {
17
+ ...acc.callSettings,
18
+ ...config.callSettings
19
+ };
20
+ return acc;
21
+ }, {});
39
22
  };
23
+ //#endregion
24
+ export { mergeModelContexts };
25
+
40
26
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../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C;YACzB,CAAC;QACH,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAClB,GAAG,CAAC,MAAM,GAAG;gBACX,GAAG,GAAG,CAAC,MAAM;gBACb,GAAG,MAAM,CAAC,MAAM;aACjB,CAAC;QACJ,CAAC;QACD,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACxB,GAAG,CAAC,YAAY,GAAG;gBACjB,GAAG,GAAG,CAAC,YAAY;gBACnB,GAAG,MAAM,CAAC,YAAY;aACvB,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAkB,CAAC,CAAC;AACzB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/model-context/types.ts"],"sourcesContent":["import type { Unsubscribe } from \"../types/unsubscribe\";\nimport type { Tool } from \"assistant-stream\";\n\nexport type LanguageModelV1CallSettings = {\n maxTokens?: number;\n temperature?: number;\n topP?: number;\n presencePenalty?: number;\n frequencyPenalty?: number;\n seed?: number;\n headers?: Record<string, string | undefined>;\n};\n\nexport type LanguageModelConfig = {\n apiKey?: string;\n baseUrl?: string;\n modelName?: string;\n};\n\nexport type ModelContext = {\n priority?: number | undefined;\n system?: string | undefined;\n tools?: Record<string, Tool<any, any>> | undefined;\n callSettings?: LanguageModelV1CallSettings | undefined;\n config?: LanguageModelConfig | undefined;\n};\n\nexport type ModelContextProvider = {\n getModelContext: () => ModelContext;\n subscribe?: (callback: () => void) => Unsubscribe;\n};\n\nexport type AssistantToolProps<\n TArgs extends Record<string, unknown>,\n TResult,\n> = Tool<TArgs, TResult> & {\n toolName: string;\n render?: unknown;\n};\n\nexport type AssistantInstructionsConfig = {\n disabled?: boolean | undefined;\n instruction: string;\n};\n\nexport type AssistantContextConfig = {\n getContext: () => string;\n disabled?: boolean | undefined;\n};\n\nexport const mergeModelContexts = (\n configSet: Set<ModelContextProvider>,\n): ModelContext => {\n const configs = Array.from(configSet)\n .map((c) => c.getModelContext())\n .sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n\n return configs.reduce((acc, config) => {\n if (config.system) {\n if (acc.system) {\n acc.system += `\\n\\n${config.system}`;\n } else {\n acc.system = config.system;\n }\n }\n if (config.tools) {\n for (const [name, tool] of Object.entries(config.tools)) {\n const existing = acc.tools?.[name];\n if (existing && existing !== tool) {\n throw new Error(\n `You tried to define a tool with the name ${name}, but it already exists.`,\n );\n }\n\n if (!acc.tools) acc.tools = {};\n acc.tools[name] = tool;\n }\n }\n if (config.config) {\n acc.config = {\n ...acc.config,\n ...config.config,\n };\n }\n if (config.callSettings) {\n acc.callSettings = {\n ...acc.callSettings,\n ...config.callSettings,\n };\n }\n return acc;\n }, {} as ModelContext);\n};\n"],"mappings":";AAkDA,MAAa,sBACX,cACiB;CAKjB,OAJgB,MAAM,KAAK,SAAS,EACjC,KAAK,MAAM,EAAE,gBAAgB,CAAC,EAC9B,MAAM,GAAG,OAAO,EAAE,YAAY,MAAM,EAAE,YAAY,EAExC,EAAE,QAAQ,KAAK,WAAW;EACrC,IAAI,OAAO,QACT,IAAI,IAAI,QACN,IAAI,UAAU,OAAO,OAAO;OAE5B,IAAI,SAAS,OAAO;EAGxB,IAAI,OAAO,OACT,KAAK,MAAM,CAAC,MAAM,SAAS,OAAO,QAAQ,OAAO,KAAK,GAAG;GACvD,MAAM,WAAW,IAAI,QAAQ;GAC7B,IAAI,YAAY,aAAa,MAC3B,MAAM,IAAI,MACR,4CAA4C,KAAK,yBACnD;GAGF,IAAI,CAAC,IAAI,OAAO,IAAI,QAAQ,CAAC;GAC7B,IAAI,MAAM,QAAQ;EACpB;EAEF,IAAI,OAAO,QACT,IAAI,SAAS;GACX,GAAG,IAAI;GACP,GAAG,OAAO;EACZ;EAEF,IAAI,OAAO,cACT,IAAI,eAAe;GACjB,GAAG,IAAI;GACP,GAAG,OAAO;EACZ;EAEF,OAAO;CACT,GAAG,CAAC,CAAiB;AACvB"}
@@ -1,10 +1,14 @@
1
- import { type ComponentType, type FC, type PropsWithChildren } from "react";
2
- import { type AssistantClient } from "@assistant-ui/store";
3
- import type { AssistantRuntime } from "../runtime/api/assistant-runtime.js";
4
- export declare const getRenderComponent: (runtime: AssistantRuntime) => ComponentType | undefined;
5
- export type AssistantProviderBaseProps = PropsWithChildren<{
6
- runtime: AssistantRuntime;
7
- aui?: AssistantClient | null;
1
+ import { AssistantRuntime } from "../runtime/api/assistant-runtime.js";
2
+ import { ComponentType, FC, PropsWithChildren } from "react";
3
+ import { AssistantClient } from "@assistant-ui/store";
4
+
5
+ //#region src/react/AssistantProvider.d.ts
6
+ declare const getRenderComponent: (runtime: AssistantRuntime) => ComponentType | undefined;
7
+ type AssistantProviderBaseProps = PropsWithChildren<{
8
+ runtime: AssistantRuntime;
9
+ aui?: AssistantClient | null;
8
10
  }>;
9
- export declare const AssistantProviderBase: FC<AssistantProviderBaseProps>;
11
+ declare const AssistantProviderBase: FC<AssistantProviderBaseProps>;
12
+ //#endregion
13
+ export { AssistantProviderBase, AssistantProviderBaseProps, getRenderComponent };
10
14
  //# sourceMappingURL=AssistantProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantProvider.d.ts","sourceRoot":"","sources":["../../src/react/AssistantProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,EAAE,EACP,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AACf,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,4CAAyC;AAIzE,eAAO,MAAM,kBAAkB,GAAI,SAAS,gBAAgB,KAEtD,aAAa,GACb,SACL,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,iBAAiB,CAAC;IACzD,OAAO,EAAE,gBAAgB,CAAC;IAC1B,GAAG,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CAC9B,CAAC,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAWhE,CAAC"}
1
+ {"version":3,"file":"AssistantProvider.d.ts","names":[],"sources":["../../src/react/AssistantProvider.tsx"],"mappings":";;;;;cAWa,kBAAA,GAAsB,OAAA,EAAS,gBAAA,KAEtC,aAAa;AAAA,KAIP,0BAAA,GAA6B,iBAAA;EACvC,OAAA,EAAS,gBAAA;EACT,GAAA,GAAM,eAAA;AAAA;AAAA,cAGK,qBAAA,EAAuB,EAAE,CAAC,0BAAA"}
@@ -1,13 +1,20 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { memo, } from "react";
3
- import { useAui, AuiProvider } from "@assistant-ui/store";
4
1
  import { RuntimeAdapter } from "./RuntimeAdapter.js";
5
- export const getRenderComponent = (runtime) => {
6
- return runtime._core?.RenderComponent;
2
+ import { memo } from "react";
3
+ import { AuiProvider, useAui } from "@assistant-ui/store";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/react/AssistantProvider.tsx
6
+ const getRenderComponent = (runtime) => {
7
+ return runtime._core?.RenderComponent;
7
8
  };
8
- export const AssistantProviderBase = memo(({ runtime, aui: parent = null, children }) => {
9
- const aui = useAui({ threads: RuntimeAdapter(runtime) }, { parent });
10
- const RenderComponent = getRenderComponent(runtime);
11
- return (_jsxs(AuiProvider, { value: aui, children: [RenderComponent && _jsx(RenderComponent, {}), children] }));
9
+ const AssistantProviderBase = memo(({ runtime, aui: parent = null, children }) => {
10
+ const aui = useAui({ threads: RuntimeAdapter(runtime) }, { parent });
11
+ const RenderComponent = getRenderComponent(runtime);
12
+ return /* @__PURE__ */ jsxs(AuiProvider, {
13
+ value: aui,
14
+ children: [RenderComponent && /* @__PURE__ */ jsx(RenderComponent, {}), children]
15
+ });
12
16
  });
17
+ //#endregion
18
+ export { AssistantProviderBase, getRenderComponent };
19
+
13
20
  //# sourceMappingURL=AssistantProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantProvider.js","sourceRoot":"","sources":["../../src/react/AssistantProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,IAAI,GAIL,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,MAAM,EAAE,WAAW,EAAwB,MAAM,qBAAqB,CAAC;AAGhF,OAAO,EAAE,cAAc,EAAE,4BAAyB;AAElD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAyB,EAAE,EAAE;IAC9D,OAAQ,OAA4C,CAAC,KAAK,EAAE,eAE/C,CAAC;AAChB,CAAC,CAAC;AAOF,MAAM,CAAC,MAAM,qBAAqB,GAAmC,IAAI,CACvE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC5C,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACrE,MAAM,eAAe,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACpD,OAAO,CACL,MAAC,WAAW,IAAC,KAAK,EAAE,GAAG,aACpB,eAAe,IAAI,KAAC,eAAe,KAAG,EACtC,QAAQ,IACG,CACf,CAAC;AACJ,CAAC,CACF,CAAC"}
1
+ {"version":3,"file":"AssistantProvider.js","names":[],"sources":["../../src/react/AssistantProvider.tsx"],"sourcesContent":["import {\n memo,\n type ComponentType,\n type FC,\n type PropsWithChildren,\n} from \"react\";\nimport { useAui, AuiProvider, type AssistantClient } from \"@assistant-ui/store\";\nimport type { AssistantRuntime } from \"../runtime/api/assistant-runtime\";\nimport type { AssistantRuntimeCore } from \"../runtime/interfaces/assistant-runtime-core\";\nimport { RuntimeAdapter } from \"./RuntimeAdapter\";\n\nexport const getRenderComponent = (runtime: AssistantRuntime) => {\n return (runtime as { _core?: AssistantRuntimeCore })._core?.RenderComponent as\n | ComponentType\n | undefined;\n};\n\nexport type AssistantProviderBaseProps = PropsWithChildren<{\n runtime: AssistantRuntime;\n aui?: AssistantClient | null;\n}>;\n\nexport const AssistantProviderBase: FC<AssistantProviderBaseProps> = memo(\n ({ runtime, aui: parent = null, children }) => {\n const aui = useAui({ threads: RuntimeAdapter(runtime) }, { parent });\n const RenderComponent = getRenderComponent(runtime);\n return (\n <AuiProvider value={aui}>\n {RenderComponent && <RenderComponent />}\n {children}\n </AuiProvider>\n );\n },\n);\n"],"mappings":";;;;;AAWA,MAAa,sBAAsB,YAA8B;CAC/D,OAAQ,QAA6C,OAAO;AAG9D;AAOA,MAAa,wBAAwD,MAClE,EAAE,SAAS,KAAK,SAAS,MAAM,eAAe;CAC7C,MAAM,MAAM,OAAO,EAAE,SAAS,eAAe,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC;CACnE,MAAM,kBAAkB,mBAAmB,OAAO;CAClD,OACE,qBAAC,aAAD;EAAa,OAAO;YAApB,CACG,mBAAmB,oBAAC,iBAAD,CAAkB,CAAA,GACrC,QACU;;AAEjB,CACF"}