@assistant-ui/core 0.2.3 → 0.2.5

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 (828) 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 +95 -90
  99. package/dist/react/index.js +88 -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 +73 -66
  288. package/dist/react/primitives/message/MessageGroupedParts.d.ts.map +1 -1
  289. package/dist/react/primitives/message/MessageGroupedParts.js +64 -60
  290. package/dist/react/primitives/message/MessageGroupedParts.js.map +1 -1
  291. package/dist/react/primitives/message/MessageParts.d.ts +147 -145
  292. package/dist/react/primitives/message/MessageParts.d.ts.map +1 -1
  293. package/dist/react/primitives/message/MessageParts.js +358 -329
  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 +29 -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 +119 -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 +147 -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 +222 -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 +65 -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 +22 -19
  439. package/dist/react/utils/groupParts.d.ts.map +1 -1
  440. package/dist/react/utils/groupParts.js +62 -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 +29 -27
  458. package/dist/runtime/api/message-part-runtime.d.ts.map +1 -1
  459. package/dist/runtime/api/message-part-runtime.js +61 -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 +278 -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 +89 -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 +149 -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 +41 -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 +100 -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 +53 -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 +212 -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 +80 -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 +342 -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 +96 -92
  578. package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts.map +1 -1
  579. package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js +164 -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 +152 -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 +95 -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 +13 -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 +42 -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 -214
  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 +3 -0
  750. package/src/react/index.ts +17 -0
  751. package/src/react/primitives/generativeUI/GenerativeUI.tsx +182 -0
  752. package/src/react/primitives/message/MessageGroupedParts.tsx +2 -1
  753. package/src/react/primitives/message/MessageParts.tsx +70 -15
  754. package/src/react/runtimes/RemoteThreadListHookInstanceManager.tsx +11 -7
  755. package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +7 -2
  756. package/src/react/runtimes/cloud/auiV0.ts +1 -1
  757. package/src/react/types/MessagePartComponentTypes.ts +26 -0
  758. package/src/runtime/api/thread-list-item-runtime.ts +3 -3
  759. package/src/runtime/api/thread-list-runtime.ts +9 -3
  760. package/src/runtime/base/base-thread-runtime-core.ts +8 -0
  761. package/src/runtime/interfaces/thread-list-runtime-core.ts +4 -1
  762. package/src/runtime/interfaces/thread-runtime-core.ts +6 -5
  763. package/src/runtime/utils/thread-message-like.ts +11 -3
  764. package/src/runtimes/external-store/external-store-thread-list-runtime-core.ts +4 -1
  765. package/src/store/runtime-clients/thread-list-runtime-client.ts +2 -2
  766. package/src/store/scopes/thread-list-item.ts +1 -1
  767. package/src/store/scopes/threads.ts +1 -1
  768. package/src/tests/RemoteThreadListThreadListRuntimeCore-switchToThread-unarchive.test.ts +88 -0
  769. package/src/tests/external-store-thread-runtime-core.test.ts +83 -0
  770. package/src/types/index.ts +3 -0
  771. package/src/types/message.ts +49 -1
  772. package/dist/adapters/feedback.js.map +0 -1
  773. package/dist/adapters/index.d.ts.map +0 -1
  774. package/dist/adapters/index.js.map +0 -1
  775. package/dist/adapters/suggestion.js.map +0 -1
  776. package/dist/adapters/thread-history.js.map +0 -1
  777. package/dist/adapters/trigger.js.map +0 -1
  778. package/dist/index.d.ts.map +0 -1
  779. package/dist/index.js.map +0 -1
  780. package/dist/internal.d.ts.map +0 -1
  781. package/dist/internal.js.map +0 -1
  782. package/dist/model-context/registry-handles.js.map +0 -1
  783. package/dist/react/index.d.ts.map +0 -1
  784. package/dist/react/index.js.map +0 -1
  785. package/dist/react/model-context/toolbox.js.map +0 -1
  786. package/dist/react/types/MessagePartComponentTypes.js.map +0 -1
  787. package/dist/react/types/scopes/dataRenderers.js.map +0 -1
  788. package/dist/react/types/scopes/interactables.js.map +0 -1
  789. package/dist/react/types/scopes/tools.js.map +0 -1
  790. package/dist/react/types/store-augmentation.js.map +0 -1
  791. package/dist/runtime/api/bindings.js.map +0 -1
  792. package/dist/runtime/api/paths.js.map +0 -1
  793. package/dist/runtime/interfaces/assistant-runtime-core.js.map +0 -1
  794. package/dist/runtime/interfaces/composer-runtime-core.js.map +0 -1
  795. package/dist/runtime/interfaces/thread-list-runtime-core.js.map +0 -1
  796. package/dist/runtime/interfaces/thread-runtime-core.js.map +0 -1
  797. package/dist/runtime/internal.d.ts.map +0 -1
  798. package/dist/runtime/internal.js.map +0 -1
  799. package/dist/runtime/utils/chat-model-adapter.js.map +0 -1
  800. package/dist/runtimes/external-store/external-store-adapter.js.map +0 -1
  801. package/dist/runtimes/internal.d.ts.map +0 -1
  802. package/dist/runtimes/internal.js.map +0 -1
  803. package/dist/runtimes/local/local-runtime-options.js.map +0 -1
  804. package/dist/runtimes/remote-thread-list/types.js.map +0 -1
  805. package/dist/store/index.d.ts.map +0 -1
  806. package/dist/store/index.js.map +0 -1
  807. package/dist/store/internal.d.ts.map +0 -1
  808. package/dist/store/internal.js.map +0 -1
  809. package/dist/store/scope-registration.js.map +0 -1
  810. package/dist/store/scopes/attachment.js.map +0 -1
  811. package/dist/store/scopes/chain-of-thought.js.map +0 -1
  812. package/dist/store/scopes/composer.js.map +0 -1
  813. package/dist/store/scopes/message.js.map +0 -1
  814. package/dist/store/scopes/model-context.js.map +0 -1
  815. package/dist/store/scopes/part.js.map +0 -1
  816. package/dist/store/scopes/queue-item.js.map +0 -1
  817. package/dist/store/scopes/suggestion.js.map +0 -1
  818. package/dist/store/scopes/suggestions.js.map +0 -1
  819. package/dist/store/scopes/thread-list-item.js.map +0 -1
  820. package/dist/store/scopes/thread.js.map +0 -1
  821. package/dist/store/scopes/threads.js.map +0 -1
  822. package/dist/types/attachment.js.map +0 -1
  823. package/dist/types/directive.js.map +0 -1
  824. package/dist/types/index.d.ts.map +0 -1
  825. package/dist/types/index.js.map +0 -1
  826. package/dist/types/quote.js.map +0 -1
  827. package/dist/types/trigger.js.map +0 -1
  828. package/dist/types/unsubscribe.js.map +0 -1
@@ -1,28 +1,32 @@
1
1
  import { useCallback, useSyncExternalStore } from "react";
2
2
  import { useAui, useAuiState } from "@assistant-ui/store";
3
- export const useVoiceState = () => {
4
- return useAuiState((s) => s.thread.voice);
3
+ //#region src/react/primitive-hooks/useVoice.ts
4
+ const useVoiceState = () => {
5
+ return useAuiState((s) => s.thread.voice);
5
6
  };
6
7
  const getServerVolume = () => 0;
7
- export const useVoiceVolume = () => {
8
- const aui = useAui();
9
- const thread = aui.thread();
10
- return useSyncExternalStore(thread.subscribeVoiceVolume, thread.getVoiceVolume, getServerVolume);
8
+ const useVoiceVolume = () => {
9
+ const thread = useAui().thread();
10
+ return useSyncExternalStore(thread.subscribeVoiceVolume, thread.getVoiceVolume, getServerVolume);
11
11
  };
12
- export const useVoiceControls = () => {
13
- const aui = useAui();
14
- const connect = useCallback(() => {
15
- aui.thread().connectVoice();
16
- }, [aui]);
17
- const disconnect = useCallback(() => {
18
- aui.thread().disconnectVoice();
19
- }, [aui]);
20
- const mute = useCallback(() => {
21
- aui.thread().muteVoice();
22
- }, [aui]);
23
- const unmute = useCallback(() => {
24
- aui.thread().unmuteVoice();
25
- }, [aui]);
26
- return { connect, disconnect, mute, unmute };
12
+ const useVoiceControls = () => {
13
+ const aui = useAui();
14
+ return {
15
+ connect: useCallback(() => {
16
+ aui.thread().connectVoice();
17
+ }, [aui]),
18
+ disconnect: useCallback(() => {
19
+ aui.thread().disconnectVoice();
20
+ }, [aui]),
21
+ mute: useCallback(() => {
22
+ aui.thread().muteVoice();
23
+ }, [aui]),
24
+ unmute: useCallback(() => {
25
+ aui.thread().unmuteVoice();
26
+ }, [aui])
27
+ };
27
28
  };
29
+ //#endregion
30
+ export { useVoiceControls, useVoiceState, useVoiceVolume };
31
+
28
32
  //# sourceMappingURL=useVoice.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useVoice.js","sourceRoot":"","sources":["../../../src/react/primitive-hooks/useVoice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAG1D,MAAM,CAAC,MAAM,aAAa,GAAG,GAAkC,EAAE;IAC/D,OAAO,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AAEhC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAW,EAAE;IACzC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;IAC5B,OAAO,oBAAoB,CACzB,MAAM,CAAC,oBAAoB,EAC3B,MAAM,CAAC,cAAc,EACrB,eAAe,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;QAC/B,GAAG,CAAC,MAAM,EAAE,CAAC,YAAY,EAAE,CAAC;IAC9B,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE;QAClC,GAAG,CAAC,MAAM,EAAE,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,EAAE;QAC5B,GAAG,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,CAAC;IAC3B,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,GAAG,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC/C,CAAC,CAAC"}
1
+ {"version":3,"file":"useVoice.js","names":[],"sources":["../../../src/react/primitive-hooks/useVoice.ts"],"sourcesContent":["import { useCallback, useSyncExternalStore } from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\nimport type { VoiceSessionState } from \"../../runtime/interfaces/thread-runtime-core\";\n\nexport const useVoiceState = (): VoiceSessionState | undefined => {\n return useAuiState((s) => s.thread.voice);\n};\n\nconst getServerVolume = () => 0;\n\nexport const useVoiceVolume = (): number => {\n const aui = useAui();\n const thread = aui.thread();\n return useSyncExternalStore(\n thread.subscribeVoiceVolume,\n thread.getVoiceVolume,\n getServerVolume,\n );\n};\n\nexport const useVoiceControls = () => {\n const aui = useAui();\n\n const connect = useCallback(() => {\n aui.thread().connectVoice();\n }, [aui]);\n\n const disconnect = useCallback(() => {\n aui.thread().disconnectVoice();\n }, [aui]);\n\n const mute = useCallback(() => {\n aui.thread().muteVoice();\n }, [aui]);\n\n const unmute = useCallback(() => {\n aui.thread().unmuteVoice();\n }, [aui]);\n\n return { connect, disconnect, mute, unmute };\n};\n"],"mappings":";;;AAIA,MAAa,sBAAqD;CAChE,OAAO,aAAa,MAAM,EAAE,OAAO,KAAK;AAC1C;AAEA,MAAM,wBAAwB;AAE9B,MAAa,uBAA+B;CAE1C,MAAM,SADM,OACK,EAAE,OAAO;CAC1B,OAAO,qBACL,OAAO,sBACP,OAAO,gBACP,eACF;AACF;AAEA,MAAa,yBAAyB;CACpC,MAAM,MAAM,OAAO;CAkBnB,OAAO;EAAE,SAhBO,kBAAkB;GAChC,IAAI,OAAO,EAAE,aAAa;EAC5B,GAAG,CAAC,GAAG,CAcQ;EAAG,YAZC,kBAAkB;GACnC,IAAI,OAAO,EAAE,gBAAgB;EAC/B,GAAG,CAAC,GAAG,CAUoB;EAAG,MARjB,kBAAkB;GAC7B,IAAI,OAAO,EAAE,UAAU;EACzB,GAAG,CAAC,GAAG,CAM0B;EAAG,QAJrB,kBAAkB;GAC/B,IAAI,OAAO,EAAE,YAAY;EAC3B,GAAG,CAAC,GAAG,CAEkC;CAAE;AAC7C"}
@@ -1,30 +1,28 @@
1
- import { type ComponentType, type FC, type PropsWithChildren, type ReactNode } from "react";
2
- import type { PartState } from "../../../store/scopes/part.js";
3
- import type { ReasoningMessagePartComponent, ToolCallMessagePartComponent } from "../../types/MessagePartComponentTypes.js";
1
+ import { ReasoningMessagePartComponent, ToolCallMessagePartComponent } from "../../types/MessagePartComponentTypes.js";
2
+ import { PartState } from "../../../store/scopes/part.js";
3
+ import { ComponentType, FC, PropsWithChildren, ReactNode } from "react";
4
+
5
+ //#region src/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts
4
6
  type ChainOfThoughtPartsComponentConfig = {
5
- /** Component for rendering reasoning parts */
6
- Reasoning?: ReasoningMessagePartComponent | undefined;
7
- /** Fallback component for tool-call parts */
8
- tools?: {
9
- Fallback?: ToolCallMessagePartComponent | undefined;
10
- };
11
- /** Layout component to wrap the rendered parts when expanded */
12
- Layout?: ComponentType<PropsWithChildren> | undefined;
7
+ /** Component for rendering reasoning parts */Reasoning?: ReasoningMessagePartComponent | undefined; /** Fallback component for tool-call parts */
8
+ tools?: {
9
+ Fallback?: ToolCallMessagePartComponent | undefined;
10
+ }; /** Layout component to wrap the rendered parts when expanded */
11
+ Layout?: ComponentType<PropsWithChildren> | undefined;
13
12
  };
14
- export declare namespace ChainOfThoughtPrimitiveParts {
15
- type Props = {
16
- /**
17
- * @deprecated Use the children render function instead.
18
- */
19
- components?: ChainOfThoughtPartsComponentConfig;
20
- children?: never;
21
- } | {
22
- /** Render function called for each part. Receives the part. */
23
- children: (value: {
24
- part: PartState;
25
- }) => ReactNode;
26
- components?: never;
27
- };
13
+ declare namespace ChainOfThoughtPrimitiveParts {
14
+ type Props = {
15
+ /**
16
+ * @deprecated Use the children render function instead.
17
+ */
18
+ components?: ChainOfThoughtPartsComponentConfig;
19
+ children?: never;
20
+ } | {
21
+ /** Render function called for each part. Receives the part. */children: (value: {
22
+ part: PartState;
23
+ }) => ReactNode;
24
+ components?: never;
25
+ };
28
26
  }
29
27
  /**
30
28
  * Renders the parts within a chain of thought, with support for collapsed/expanded states.
@@ -32,6 +30,7 @@ export declare namespace ChainOfThoughtPrimitiveParts {
32
30
  * When collapsed, no parts are shown. When expanded, all parts are rendered
33
31
  * using the provided component configuration through the part scope mechanism.
34
32
  */
35
- export declare const ChainOfThoughtPrimitiveParts: FC<ChainOfThoughtPrimitiveParts.Props>;
36
- export {};
33
+ declare const ChainOfThoughtPrimitiveParts: FC<ChainOfThoughtPrimitiveParts.Props>;
34
+ //#endregion
35
+ export { ChainOfThoughtPrimitiveParts };
37
36
  //# sourceMappingURL=ChainOfThoughtParts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChainOfThoughtParts.d.ts","sourceRoot":"","sources":["../../../../src/react/primitives/chainOfThought/ChainOfThoughtParts.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,EAAE,EACP,KAAK,iBAAiB,EACtB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,SAAS,EAAE,sCAAmC;AAG5D,OAAO,KAAK,EACV,6BAA6B,EAC7B,4BAA4B,EAC7B,iDAA8C;AAE/C,KAAK,kCAAkC,GAAG;IACxC,8CAA8C;IAC9C,SAAS,CAAC,EAAE,6BAA6B,GAAG,SAAS,CAAC;IACtD,6CAA6C;IAC7C,KAAK,CAAC,EAAE;QACN,QAAQ,CAAC,EAAE,4BAA4B,GAAG,SAAS,CAAC;KACrD,CAAC;IACF,gEAAgE;IAChE,MAAM,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAC;CACvD,CAAC;AAEF,yBAAiB,4BAA4B,CAAC;IAC5C,KAAY,KAAK,GACb;QACE;;WAEG;QACH,UAAU,CAAC,EAAE,kCAAkC,CAAC;QAChD,QAAQ,CAAC,EAAE,KAAK,CAAC;KAClB,GACD;QACE,+DAA+D;QAC/D,QAAQ,EAAE,CAAC,KAAK,EAAE;YAAE,IAAI,EAAE,SAAS,CAAA;SAAE,KAAK,SAAS,CAAC;QACpD,UAAU,CAAC,EAAE,KAAK,CAAC;KACpB,CAAC;CACP;AA8BD;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,EAAE,EAAE,CAC3C,4BAA4B,CAAC,KAAK,CAqCnC,CAAC"}
1
+ {"version":3,"file":"ChainOfThoughtParts.d.ts","names":[],"sources":["../../../../src/react/primitives/chainOfThought/ChainOfThoughtParts.tsx"],"mappings":";;;;;KAgBK,kCAAA;gDAEH,SAAA,GAAY,6BAAA,cAFyB;EAIrC,KAAA;IACE,QAAA,GAAW,4BAAA;EAAA,GAGU;EAAvB,MAAA,GAAS,aAAA,CAAc,iBAAA;AAAA;AAAA,kBAGR,4BAAA;EAAA,KACH,KAAA;IAVA;;;IAeN,UAAA,GAAa,kCAAA;IACb,QAAA;EAAA;IAViB,+DAcjB,QAAA,GAAW,KAAA;MAAS,IAAA,EAAM,SAAA;IAAA,MAAgB,SAAA;IAC1C,UAAA;EAAA;AAAA;;;;;;;cAsCK,4BAAA,EAA8B,EAAE,CAC3C,4BAAA,CAA6B,KAAA"}
@@ -1,36 +1,38 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useMemo, } from "react";
3
- import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
4
1
  import { ChainOfThoughtPartByIndexProvider } from "../../providers/ChainOfThoughtPartByIndexProvider.js";
5
2
  import { MessagePartComponent } from "../message/MessageParts.js";
3
+ import { useMemo } from "react";
4
+ import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/react/primitives/chainOfThought/ChainOfThoughtParts.tsx
6
7
  const ChainOfThoughtPrimitivePartsInner = ({ children }) => {
7
- const partsLength = useAuiState((s) => s.chainOfThought.parts.length);
8
- return useMemo(() => Array.from({ length: partsLength }, (_, index) => (_jsx(ChainOfThoughtPartByIndexProvider, { index: index, children: _jsx(RenderChildrenWithAccessor, { getItemState: (aui) => aui.chainOfThought().part({ index }).getState(), children: (getItem) => children({
9
- get part() {
10
- return getItem();
11
- },
12
- }) }) }, index))), [partsLength, children]);
8
+ const partsLength = useAuiState((s) => s.chainOfThought.parts.length);
9
+ return useMemo(() => Array.from({ length: partsLength }, (_, index) => /* @__PURE__ */ jsx(ChainOfThoughtPartByIndexProvider, {
10
+ index,
11
+ children: /* @__PURE__ */ jsx(RenderChildrenWithAccessor, {
12
+ getItemState: (aui) => aui.chainOfThought().part({ index }).getState(),
13
+ children: (getItem) => children({ get part() {
14
+ return getItem();
15
+ } })
16
+ })
17
+ }, index)), [partsLength, children]);
13
18
  };
14
19
  /**
15
- * Renders the parts within a chain of thought, with support for collapsed/expanded states.
16
- *
17
- * When collapsed, no parts are shown. When expanded, all parts are rendered
18
- * using the provided component configuration through the part scope mechanism.
19
- */
20
- export const ChainOfThoughtPrimitiveParts = ({ components, children }) => {
21
- if (children) {
22
- return (_jsx(ChainOfThoughtPrimitivePartsInner, { children: children }));
23
- }
24
- // eslint-disable-next-line react-hooks/exhaustive-deps
25
- // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage
26
- const messageComponents = useMemo(() => ({
27
- Reasoning: components?.Reasoning,
28
- tools: {
29
- Fallback: components?.tools?.Fallback,
30
- },
31
- }), [components?.Reasoning, components?.tools?.Fallback]);
32
- const Layout = components?.Layout;
33
- return (_jsx(ChainOfThoughtPrimitivePartsInner, { children: () => Layout ? (_jsx(Layout, { children: _jsx(MessagePartComponent, { components: messageComponents }) })) : (_jsx(MessagePartComponent, { components: messageComponents })) }));
20
+ * Renders the parts within a chain of thought, with support for collapsed/expanded states.
21
+ *
22
+ * When collapsed, no parts are shown. When expanded, all parts are rendered
23
+ * using the provided component configuration through the part scope mechanism.
24
+ */
25
+ const ChainOfThoughtPrimitiveParts = ({ components, children }) => {
26
+ if (children) return /* @__PURE__ */ jsx(ChainOfThoughtPrimitivePartsInner, { children });
27
+ const messageComponents = useMemo(() => ({
28
+ Reasoning: components?.Reasoning,
29
+ tools: { Fallback: components?.tools?.Fallback }
30
+ }), [components?.Reasoning, components?.tools?.Fallback]);
31
+ const Layout = components?.Layout;
32
+ return /* @__PURE__ */ jsx(ChainOfThoughtPrimitivePartsInner, { children: () => Layout ? /* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsx(MessagePartComponent, { components: messageComponents }) }) : /* @__PURE__ */ jsx(MessagePartComponent, { components: messageComponents }) });
34
33
  };
35
34
  ChainOfThoughtPrimitiveParts.displayName = "ChainOfThoughtPrimitive.Parts";
35
+ //#endregion
36
+ export { ChainOfThoughtPrimitiveParts };
37
+
36
38
  //# sourceMappingURL=ChainOfThoughtParts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChainOfThoughtParts.js","sourceRoot":"","sources":["../../../../src/react/primitives/chainOfThought/ChainOfThoughtParts.tsx"],"names":[],"mappings":";AAAA,OAAO,EAKL,OAAO,GACR,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAE,iCAAiC,EAAE,6DAA0D;AACtG,OAAO,EAAE,oBAAoB,EAAE,mCAAgC;AAiC/D,MAAM,iCAAiC,GAElC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpB,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAEtE,OAAO,OAAO,CACZ,GAAG,EAAE,CACH,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAChD,KAAC,iCAAiC,IAAa,KAAK,EAAE,KAAK,YACzD,KAAC,0BAA0B,IACzB,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CACpB,GAAG,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE,YAGhD,CAAC,OAAO,EAAE,EAAE,CACX,QAAQ,CAAC;gBACP,IAAI,IAAI;oBACN,OAAO,OAAO,EAAE,CAAC;gBACnB,CAAC;aACF,CAAC,GAEuB,IAbS,KAAK,CAcT,CACrC,CAAC,EACJ,CAAC,WAAW,EAAE,QAAQ,CAAC,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAErC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/B,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,CACL,KAAC,iCAAiC,cAC/B,QAAQ,GACyB,CACrC,CAAC;IACJ,CAAC;IAED,uDAAuD;IACvD,6FAA6F;IAC7F,MAAM,iBAAiB,GAAG,OAAO,CAC/B,GAAG,EAAE,CAAC,CAAC;QACL,SAAS,EAAE,UAAU,EAAE,SAAS;QAChC,KAAK,EAAE;YACL,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ;SACtC;KACF,CAAC,EACF,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,CACrD,CAAC;IAEF,MAAM,MAAM,GAAG,UAAU,EAAE,MAAM,CAAC;IAElC,OAAO,CACL,KAAC,iCAAiC,cAC/B,GAAG,EAAE,CACJ,MAAM,CAAC,CAAC,CAAC,CACP,KAAC,MAAM,cACL,KAAC,oBAAoB,IAAC,UAAU,EAAE,iBAAiB,GAAI,GAChD,CACV,CAAC,CAAC,CAAC,CACF,KAAC,oBAAoB,IAAC,UAAU,EAAE,iBAAiB,GAAI,CACxD,GAE+B,CACrC,CAAC;AACJ,CAAC,CAAC;AAEF,4BAA4B,CAAC,WAAW,GAAG,+BAA+B,CAAC"}
1
+ {"version":3,"file":"ChainOfThoughtParts.js","names":[],"sources":["../../../../src/react/primitives/chainOfThought/ChainOfThoughtParts.tsx"],"sourcesContent":["import {\n type ComponentType,\n type FC,\n type PropsWithChildren,\n type ReactNode,\n useMemo,\n} from \"react\";\nimport { RenderChildrenWithAccessor, useAuiState } from \"@assistant-ui/store\";\nimport type { PartState } from \"../../../store/scopes/part\";\nimport { ChainOfThoughtPartByIndexProvider } from \"../../providers/ChainOfThoughtPartByIndexProvider\";\nimport { MessagePartComponent } from \"../message/MessageParts\";\nimport type {\n ReasoningMessagePartComponent,\n ToolCallMessagePartComponent,\n} from \"../../types/MessagePartComponentTypes\";\n\ntype ChainOfThoughtPartsComponentConfig = {\n /** Component for rendering reasoning parts */\n Reasoning?: ReasoningMessagePartComponent | undefined;\n /** Fallback component for tool-call parts */\n tools?: {\n Fallback?: ToolCallMessagePartComponent | undefined;\n };\n /** Layout component to wrap the rendered parts when expanded */\n Layout?: ComponentType<PropsWithChildren> | undefined;\n};\n\nexport namespace ChainOfThoughtPrimitiveParts {\n export type Props =\n | {\n /**\n * @deprecated Use the children render function instead.\n */\n components?: ChainOfThoughtPartsComponentConfig;\n children?: never;\n }\n | {\n /** Render function called for each part. Receives the part. */\n children: (value: { part: PartState }) => ReactNode;\n components?: never;\n };\n}\n\nconst ChainOfThoughtPrimitivePartsInner: FC<{\n children: (value: { part: PartState }) => ReactNode;\n}> = ({ children }) => {\n const partsLength = useAuiState((s) => s.chainOfThought.parts.length);\n\n return useMemo(\n () =>\n Array.from({ length: partsLength }, (_, index) => (\n <ChainOfThoughtPartByIndexProvider key={index} index={index}>\n <RenderChildrenWithAccessor\n getItemState={(aui) =>\n aui.chainOfThought().part({ index }).getState()\n }\n >\n {(getItem) =>\n children({\n get part() {\n return getItem();\n },\n })\n }\n </RenderChildrenWithAccessor>\n </ChainOfThoughtPartByIndexProvider>\n )),\n [partsLength, children],\n );\n};\n\n/**\n * Renders the parts within a chain of thought, with support for collapsed/expanded states.\n *\n * When collapsed, no parts are shown. When expanded, all parts are rendered\n * using the provided component configuration through the part scope mechanism.\n */\nexport const ChainOfThoughtPrimitiveParts: FC<\n ChainOfThoughtPrimitiveParts.Props\n> = ({ components, children }) => {\n if (children) {\n return (\n <ChainOfThoughtPrimitivePartsInner>\n {children}\n </ChainOfThoughtPrimitivePartsInner>\n );\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n const messageComponents = useMemo(\n () => ({\n Reasoning: components?.Reasoning,\n tools: {\n Fallback: components?.tools?.Fallback,\n },\n }),\n [components?.Reasoning, components?.tools?.Fallback],\n );\n\n const Layout = components?.Layout;\n\n return (\n <ChainOfThoughtPrimitivePartsInner>\n {() =>\n Layout ? (\n <Layout>\n <MessagePartComponent components={messageComponents} />\n </Layout>\n ) : (\n <MessagePartComponent components={messageComponents} />\n )\n }\n </ChainOfThoughtPrimitivePartsInner>\n );\n};\n\nChainOfThoughtPrimitiveParts.displayName = \"ChainOfThoughtPrimitive.Parts\";\n"],"mappings":";;;;;;AA2CA,MAAM,qCAEA,EAAE,eAAe;CACrB,MAAM,cAAc,aAAa,MAAM,EAAE,eAAe,MAAM,MAAM;CAEpE,OAAO,cAEH,MAAM,KAAK,EAAE,QAAQ,YAAY,IAAI,GAAG,UACtC,oBAAC,mCAAD;EAAsD;YACpD,oBAAC,4BAAD;GACE,eAAe,QACb,IAAI,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,SAAS;cAG9C,YACA,SAAS,EACP,IAAI,OAAO;IACT,OAAO,QAAQ;GACjB,EACF,CAAC;EAEuB,CAAA;CACK,GAdK,KAcL,CACpC,GACH,CAAC,aAAa,QAAQ,CACxB;AACF;;;;;;;AAQA,MAAa,gCAER,EAAE,YAAY,eAAe;CAChC,IAAI,UACF,OACE,oBAAC,mCAAD,EACG,SACgC,CAAA;CAMvC,MAAM,oBAAoB,eACjB;EACL,WAAW,YAAY;EACvB,OAAO,EACL,UAAU,YAAY,OAAO,SAC/B;CACF,IACA,CAAC,YAAY,WAAW,YAAY,OAAO,QAAQ,CACrD;CAEA,MAAM,SAAS,YAAY;CAE3B,OACE,oBAAC,mCAAD,EAAA,gBAEI,SACE,oBAAC,QAAD,EAAA,UACE,oBAAC,sBAAD,EAAsB,YAAY,kBAAoB,CAAA,EAChD,CAAA,IAER,oBAAC,sBAAD,EAAsB,YAAY,kBAAoB,CAAA,EAGzB,CAAA;AAEvC;AAEA,6BAA6B,cAAc"}
@@ -1,34 +1,35 @@
1
- import type { Attachment } from "../../../types/attachment.js";
2
- import { type ComponentType, type FC, type ReactNode } from "react";
1
+ import { Attachment } from "../../../types/attachment.js";
2
+ import { ComponentType, FC, ReactNode } from "react";
3
+
4
+ //#region src/react/primitives/composer/ComposerAttachments.d.ts
3
5
  type ComposerAttachmentsComponentConfig = {
4
- Image?: ComponentType | undefined;
5
- Document?: ComponentType | undefined;
6
- File?: ComponentType | undefined;
7
- Attachment?: ComponentType | undefined;
6
+ Image?: ComponentType | undefined;
7
+ Document?: ComponentType | undefined;
8
+ File?: ComponentType | undefined;
9
+ Attachment?: ComponentType | undefined;
8
10
  };
9
- export declare namespace ComposerPrimitiveAttachments {
10
- type Props = {
11
- /** @deprecated Use the children render function instead. */
12
- components: ComposerAttachmentsComponentConfig;
13
- children?: never;
14
- } | {
15
- /** Render function called for each attachment. Receives the attachment. */
16
- children: (value: {
17
- attachment: Attachment;
18
- }) => ReactNode;
19
- components?: never;
20
- };
11
+ declare namespace ComposerPrimitiveAttachments {
12
+ type Props = {
13
+ /** @deprecated Use the children render function instead. */components: ComposerAttachmentsComponentConfig;
14
+ children?: never;
15
+ } | {
16
+ /** Render function called for each attachment. Receives the attachment. */children: (value: {
17
+ attachment: Attachment;
18
+ }) => ReactNode;
19
+ components?: never;
20
+ };
21
21
  }
22
- export declare namespace ComposerPrimitiveAttachmentByIndex {
23
- type Props = {
24
- index: number;
25
- components?: ComposerAttachmentsComponentConfig;
26
- };
22
+ declare namespace ComposerPrimitiveAttachmentByIndex {
23
+ type Props = {
24
+ index: number;
25
+ components?: ComposerAttachmentsComponentConfig;
26
+ };
27
27
  }
28
28
  /**
29
29
  * Renders a single attachment at the specified index within the composer.
30
30
  */
31
- export declare const ComposerPrimitiveAttachmentByIndex: FC<ComposerPrimitiveAttachmentByIndex.Props>;
32
- export declare const ComposerPrimitiveAttachments: FC<ComposerPrimitiveAttachments.Props>;
33
- export {};
31
+ declare const ComposerPrimitiveAttachmentByIndex: FC<ComposerPrimitiveAttachmentByIndex.Props>;
32
+ declare const ComposerPrimitiveAttachments: FC<ComposerPrimitiveAttachments.Props>;
33
+ //#endregion
34
+ export { ComposerPrimitiveAttachmentByIndex, ComposerPrimitiveAttachments };
34
35
  //# sourceMappingURL=ComposerAttachments.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerAttachments.d.ts","sourceRoot":"","sources":["../../../../src/react/primitives/composer/ComposerAttachments.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,qCAAkC;AAC5D,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,EAAE,EACP,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAIf,KAAK,kCAAkC,GAAG;IACxC,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACrC,IAAI,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CACxC,CAAC;AAEF,yBAAiB,4BAA4B,CAAC;IAC5C,KAAY,KAAK,GACb;QACE,4DAA4D;QAC5D,UAAU,EAAE,kCAAkC,CAAC;QAC/C,QAAQ,CAAC,EAAE,KAAK,CAAC;KAClB,GACD;QACE,2EAA2E;QAC3E,QAAQ,EAAE,CAAC,KAAK,EAAE;YAAE,UAAU,EAAE,UAAU,CAAA;SAAE,KAAK,SAAS,CAAC;QAC3D,UAAU,CAAC,EAAE,KAAK,CAAC;KACpB,CAAC;CACP;AA8BD,yBAAiB,kCAAkC,CAAC;IAClD,KAAY,KAAK,GAAG;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,kCAAkC,CAAC;KACjD,CAAC;CACH;AAED;;GAEG;AACH,eAAO,MAAM,kCAAkC,EAAE,EAAE,CAAC,kCAAkC,CAAC,KAAK,CAezF,CAAC;AAiCJ,eAAO,MAAM,4BAA4B,EAAE,EAAE,CAC3C,4BAA4B,CAAC,KAAK,CAkBnC,CAAC"}
1
+ {"version":3,"file":"ComposerAttachments.d.ts","names":[],"sources":["../../../../src/react/primitives/composer/ComposerAttachments.tsx"],"mappings":";;;;KAWK,kCAAA;EACH,KAAA,GAAQ,aAAA;EACR,QAAA,GAAW,aAAA;EACX,IAAA,GAAO,aAAA;EACP,UAAA,GAAa,aAAA;AAAA;AAAA,kBAGE,4BAAA;EAAA,KACH,KAAA;IAJC,4DAOP,UAAA,EAAY,kCAAA;IACZ,QAAA;EAAA;IAXE,2EAeF,QAAA,GAAW,KAAA;MAAS,UAAA,EAAY,UAAA;IAAA,MAAiB,SAAA;IACjD,UAAA;EAAA;AAAA;AAAA,kBAgCS,kCAAA;EAAA,KACH,KAAA;IACV,KAAA;IACA,UAAA,GAAa,kCAAkC;EAAA;AAAA;;;;cAOtC,kCAAA,EAAoC,EAAE,CAAC,kCAAA,CAAmC,KAAA;AAAA,cAgD1E,4BAAA,EAA8B,EAAE,CAC3C,4BAAA,CAA6B,KAAA"}
@@ -1,59 +1,55 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { memo, useMemo, } from "react";
3
- import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
4
1
  import { ComposerAttachmentByIndexProvider } from "../../providers/AttachmentByIndexProvider.js";
2
+ import { memo, useMemo } from "react";
3
+ import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/react/primitives/composer/ComposerAttachments.tsx
5
6
  const getComponent = (components, attachment) => {
6
- const type = attachment.type;
7
- switch (type) {
8
- case "image":
9
- return components?.Image ?? components?.Attachment;
10
- case "document":
11
- return components?.Document ?? components?.Attachment;
12
- case "file":
13
- return components?.File ?? components?.Attachment;
14
- default:
15
- return components?.Attachment;
16
- }
7
+ switch (attachment.type) {
8
+ case "image": return components?.Image ?? components?.Attachment;
9
+ case "document": return components?.Document ?? components?.Attachment;
10
+ case "file": return components?.File ?? components?.Attachment;
11
+ default: return components?.Attachment;
12
+ }
17
13
  };
18
14
  const AttachmentComponent = ({ components }) => {
19
- const attachment = useAuiState((s) => s.attachment);
20
- if (!attachment)
21
- return null;
22
- const Component = getComponent(components, attachment);
23
- if (!Component)
24
- return null;
25
- return _jsx(Component, {});
15
+ const attachment = useAuiState((s) => s.attachment);
16
+ if (!attachment) return null;
17
+ const Component = getComponent(components, attachment);
18
+ if (!Component) return null;
19
+ return /* @__PURE__ */ jsx(Component, {});
26
20
  };
27
21
  /**
28
- * Renders a single attachment at the specified index within the composer.
29
- */
30
- export const ComposerPrimitiveAttachmentByIndex = memo(({ index, components }) => {
31
- return (_jsx(ComposerAttachmentByIndexProvider, { index: index, children: _jsx(AttachmentComponent, { components: components }) }));
32
- }, (prev, next) => prev.index === next.index &&
33
- prev.components?.Image === next.components?.Image &&
34
- prev.components?.Document === next.components?.Document &&
35
- prev.components?.File === next.components?.File &&
36
- prev.components?.Attachment === next.components?.Attachment);
37
- ComposerPrimitiveAttachmentByIndex.displayName =
38
- "ComposerPrimitive.AttachmentByIndex";
22
+ * Renders a single attachment at the specified index within the composer.
23
+ */
24
+ const ComposerPrimitiveAttachmentByIndex = memo(({ index, components }) => {
25
+ return /* @__PURE__ */ jsx(ComposerAttachmentByIndexProvider, {
26
+ index,
27
+ children: /* @__PURE__ */ jsx(AttachmentComponent, { components })
28
+ });
29
+ }, (prev, next) => prev.index === next.index && prev.components?.Image === next.components?.Image && prev.components?.Document === next.components?.Document && prev.components?.File === next.components?.File && prev.components?.Attachment === next.components?.Attachment);
30
+ ComposerPrimitiveAttachmentByIndex.displayName = "ComposerPrimitive.AttachmentByIndex";
39
31
  const ComposerPrimitiveAttachmentsInner = ({ children }) => {
40
- const attachmentsCount = useAuiState((s) => s.composer.attachments.length);
41
- return useMemo(() => Array.from({ length: attachmentsCount }, (_, index) => (_jsx(ComposerAttachmentByIndexProvider, { index: index, children: _jsx(RenderChildrenWithAccessor, { getItemState: (aui) => aui.composer().attachment({ index }).getState(), children: (getItem) => children({
42
- get attachment() {
43
- return getItem();
44
- },
45
- }) }) }, index))), [attachmentsCount, children]);
32
+ const attachmentsCount = useAuiState((s) => s.composer.attachments.length);
33
+ return useMemo(() => Array.from({ length: attachmentsCount }, (_, index) => /* @__PURE__ */ jsx(ComposerAttachmentByIndexProvider, {
34
+ index,
35
+ children: /* @__PURE__ */ jsx(RenderChildrenWithAccessor, {
36
+ getItemState: (aui) => aui.composer().attachment({ index }).getState(),
37
+ children: (getItem) => children({ get attachment() {
38
+ return getItem();
39
+ } })
40
+ })
41
+ }, index)), [attachmentsCount, children]);
46
42
  };
47
- export const ComposerPrimitiveAttachments = ({ components, children }) => {
48
- if (components) {
49
- return (_jsx(ComposerPrimitiveAttachmentsInner, { children: ({ attachment }) => {
50
- const Component = getComponent(components, attachment);
51
- if (!Component)
52
- return null;
53
- return _jsx(Component, {});
54
- } }));
55
- }
56
- return (_jsx(ComposerPrimitiveAttachmentsInner, { children: children }));
43
+ const ComposerPrimitiveAttachments = ({ components, children }) => {
44
+ if (components) return /* @__PURE__ */ jsx(ComposerPrimitiveAttachmentsInner, { children: ({ attachment }) => {
45
+ const Component = getComponent(components, attachment);
46
+ if (!Component) return null;
47
+ return /* @__PURE__ */ jsx(Component, {});
48
+ } });
49
+ return /* @__PURE__ */ jsx(ComposerPrimitiveAttachmentsInner, { children });
57
50
  };
58
51
  ComposerPrimitiveAttachments.displayName = "ComposerPrimitive.Attachments";
52
+ //#endregion
53
+ export { ComposerPrimitiveAttachmentByIndex, ComposerPrimitiveAttachments };
54
+
59
55
  //# sourceMappingURL=ComposerAttachments.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerAttachments.js","sourceRoot":"","sources":["../../../../src/react/primitives/composer/ComposerAttachments.tsx"],"names":[],"mappings":";AACA,OAAO,EAIL,IAAI,EACJ,OAAO,GACR,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,iCAAiC,EAAE,qDAAkD;AAuB9F,MAAM,YAAY,GAAG,CACnB,UAA0D,EAC1D,UAAsB,EACtB,EAAE;IACF,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;IAC7B,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO;YACV,OAAO,UAAU,EAAE,KAAK,IAAI,UAAU,EAAE,UAAU,CAAC;QACrD,KAAK,UAAU;YACb,OAAO,UAAU,EAAE,QAAQ,IAAI,UAAU,EAAE,UAAU,CAAC;QACxD,KAAK,MAAM;YACT,OAAO,UAAU,EAAE,IAAI,IAAI,UAAU,EAAE,UAAU,CAAC;QACpD;YACE,OAAO,UAAU,EAAE,UAAU,CAAC;IAClC,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAEpB,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;IACtB,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IACpD,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAE7B,MAAM,SAAS,GAAG,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACvD,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO,KAAC,SAAS,KAAG,CAAC;AACvB,CAAC,CAAC;AASF;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAC7C,IAAI,CACF,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE;IACxB,OAAO,CACL,KAAC,iCAAiC,IAAC,KAAK,EAAE,KAAK,YAC7C,KAAC,mBAAmB,IAAC,UAAU,EAAE,UAAU,GAAI,GACb,CACrC,CAAC;AACJ,CAAC,EACD,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CACb,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK;IACzB,IAAI,CAAC,UAAU,EAAE,KAAK,KAAK,IAAI,CAAC,UAAU,EAAE,KAAK;IACjD,IAAI,CAAC,UAAU,EAAE,QAAQ,KAAK,IAAI,CAAC,UAAU,EAAE,QAAQ;IACvD,IAAI,CAAC,UAAU,EAAE,IAAI,KAAK,IAAI,CAAC,UAAU,EAAE,IAAI;IAC/C,IAAI,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE,UAAU,CAC9D,CAAC;AAEJ,kCAAkC,CAAC,WAAW;IAC5C,qCAAqC,CAAC;AAExC,MAAM,iCAAiC,GAElC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpB,MAAM,gBAAgB,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAE3E,OAAO,OAAO,CACZ,GAAG,EAAE,CACH,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CACrD,KAAC,iCAAiC,IAAa,KAAK,EAAE,KAAK,YACzD,KAAC,0BAA0B,IACzB,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CACpB,GAAG,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE,YAGhD,CAAC,OAAO,EAAE,EAAE,CACX,QAAQ,CAAC;gBACP,IAAI,UAAU;oBACZ,OAAO,OAAO,EAAE,CAAC;gBACnB,CAAC;aACF,CAAC,GAEuB,IAbS,KAAK,CAcT,CACrC,CAAC,EACJ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAC7B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAErC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/B,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,CACL,KAAC,iCAAiC,cAC/B,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;gBAClB,MAAM,SAAS,GAAG,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;gBACvD,IAAI,CAAC,SAAS;oBAAE,OAAO,IAAI,CAAC;gBAC5B,OAAO,KAAC,SAAS,KAAG,CAAC;YACvB,CAAC,GACiC,CACrC,CAAC;IACJ,CAAC;IACD,OAAO,CACL,KAAC,iCAAiC,cAC/B,QAAQ,GACyB,CACrC,CAAC;AACJ,CAAC,CAAC;AAEF,4BAA4B,CAAC,WAAW,GAAG,+BAA+B,CAAC"}
1
+ {"version":3,"file":"ComposerAttachments.js","names":[],"sources":["../../../../src/react/primitives/composer/ComposerAttachments.tsx"],"sourcesContent":["import type { Attachment } from \"../../../types/attachment\";\nimport {\n type ComponentType,\n type FC,\n type ReactNode,\n memo,\n useMemo,\n} from \"react\";\nimport { RenderChildrenWithAccessor, useAuiState } from \"@assistant-ui/store\";\nimport { ComposerAttachmentByIndexProvider } from \"../../providers/AttachmentByIndexProvider\";\n\ntype ComposerAttachmentsComponentConfig = {\n Image?: ComponentType | undefined;\n Document?: ComponentType | undefined;\n File?: ComponentType | undefined;\n Attachment?: ComponentType | undefined;\n};\n\nexport namespace ComposerPrimitiveAttachments {\n export type Props =\n | {\n /** @deprecated Use the children render function instead. */\n components: ComposerAttachmentsComponentConfig;\n children?: never;\n }\n | {\n /** Render function called for each attachment. Receives the attachment. */\n children: (value: { attachment: Attachment }) => ReactNode;\n components?: never;\n };\n}\n\nconst getComponent = (\n components: ComposerAttachmentsComponentConfig | undefined,\n attachment: Attachment,\n) => {\n const type = attachment.type;\n switch (type) {\n case \"image\":\n return components?.Image ?? components?.Attachment;\n case \"document\":\n return components?.Document ?? components?.Attachment;\n case \"file\":\n return components?.File ?? components?.Attachment;\n default:\n return components?.Attachment;\n }\n};\n\nconst AttachmentComponent: FC<{\n components: ComposerAttachmentsComponentConfig | undefined;\n}> = ({ components }) => {\n const attachment = useAuiState((s) => s.attachment);\n if (!attachment) return null;\n\n const Component = getComponent(components, attachment);\n if (!Component) return null;\n return <Component />;\n};\n\nexport namespace ComposerPrimitiveAttachmentByIndex {\n export type Props = {\n index: number;\n components?: ComposerAttachmentsComponentConfig;\n };\n}\n\n/**\n * Renders a single attachment at the specified index within the composer.\n */\nexport const ComposerPrimitiveAttachmentByIndex: FC<ComposerPrimitiveAttachmentByIndex.Props> =\n memo(\n ({ index, components }) => {\n return (\n <ComposerAttachmentByIndexProvider index={index}>\n <AttachmentComponent components={components} />\n </ComposerAttachmentByIndexProvider>\n );\n },\n (prev, next) =>\n prev.index === next.index &&\n prev.components?.Image === next.components?.Image &&\n prev.components?.Document === next.components?.Document &&\n prev.components?.File === next.components?.File &&\n prev.components?.Attachment === next.components?.Attachment,\n );\n\nComposerPrimitiveAttachmentByIndex.displayName =\n \"ComposerPrimitive.AttachmentByIndex\";\n\nconst ComposerPrimitiveAttachmentsInner: FC<{\n children: (value: { attachment: Attachment }) => ReactNode;\n}> = ({ children }) => {\n const attachmentsCount = useAuiState((s) => s.composer.attachments.length);\n\n return useMemo(\n () =>\n Array.from({ length: attachmentsCount }, (_, index) => (\n <ComposerAttachmentByIndexProvider key={index} index={index}>\n <RenderChildrenWithAccessor\n getItemState={(aui) =>\n aui.composer().attachment({ index }).getState()\n }\n >\n {(getItem) =>\n children({\n get attachment() {\n return getItem();\n },\n })\n }\n </RenderChildrenWithAccessor>\n </ComposerAttachmentByIndexProvider>\n )),\n [attachmentsCount, children],\n );\n};\n\nexport const ComposerPrimitiveAttachments: FC<\n ComposerPrimitiveAttachments.Props\n> = ({ components, children }) => {\n if (components) {\n return (\n <ComposerPrimitiveAttachmentsInner>\n {({ attachment }) => {\n const Component = getComponent(components, attachment);\n if (!Component) return null;\n return <Component />;\n }}\n </ComposerPrimitiveAttachmentsInner>\n );\n }\n return (\n <ComposerPrimitiveAttachmentsInner>\n {children}\n </ComposerPrimitiveAttachmentsInner>\n );\n};\n\nComposerPrimitiveAttachments.displayName = \"ComposerPrimitive.Attachments\";\n"],"mappings":";;;;;AAgCA,MAAM,gBACJ,YACA,eACG;CAEH,QADa,WAAW,MACxB;EACE,KAAK,SACH,OAAO,YAAY,SAAS,YAAY;EAC1C,KAAK,YACH,OAAO,YAAY,YAAY,YAAY;EAC7C,KAAK,QACH,OAAO,YAAY,QAAQ,YAAY;EACzC,SACE,OAAO,YAAY;CACvB;AACF;AAEA,MAAM,uBAEA,EAAE,iBAAiB;CACvB,MAAM,aAAa,aAAa,MAAM,EAAE,UAAU;CAClD,IAAI,CAAC,YAAY,OAAO;CAExB,MAAM,YAAY,aAAa,YAAY,UAAU;CACrD,IAAI,CAAC,WAAW,OAAO;CACvB,OAAO,oBAAC,WAAD,CAAY,CAAA;AACrB;;;;AAYA,MAAa,qCACX,MACG,EAAE,OAAO,iBAAiB;CACzB,OACE,oBAAC,mCAAD;EAA0C;YACxC,oBAAC,qBAAD,EAAiC,WAAa,CAAA;CACb,CAAA;AAEvC,IACC,MAAM,SACL,KAAK,UAAU,KAAK,SACpB,KAAK,YAAY,UAAU,KAAK,YAAY,SAC5C,KAAK,YAAY,aAAa,KAAK,YAAY,YAC/C,KAAK,YAAY,SAAS,KAAK,YAAY,QAC3C,KAAK,YAAY,eAAe,KAAK,YAAY,UACrD;AAEF,mCAAmC,cACjC;AAEF,MAAM,qCAEA,EAAE,eAAe;CACrB,MAAM,mBAAmB,aAAa,MAAM,EAAE,SAAS,YAAY,MAAM;CAEzE,OAAO,cAEH,MAAM,KAAK,EAAE,QAAQ,iBAAiB,IAAI,GAAG,UAC3C,oBAAC,mCAAD;EAAsD;YACpD,oBAAC,4BAAD;GACE,eAAe,QACb,IAAI,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,SAAS;cAG9C,YACA,SAAS,EACP,IAAI,aAAa;IACf,OAAO,QAAQ;GACjB,EACF,CAAC;EAEuB,CAAA;CACK,GAdK,KAcL,CACpC,GACH,CAAC,kBAAkB,QAAQ,CAC7B;AACF;AAEA,MAAa,gCAER,EAAE,YAAY,eAAe;CAChC,IAAI,YACF,OACE,oBAAC,mCAAD,EAAA,WACI,EAAE,iBAAiB;EACnB,MAAM,YAAY,aAAa,YAAY,UAAU;EACrD,IAAI,CAAC,WAAW,OAAO;EACvB,OAAO,oBAAC,WAAD,CAAY,CAAA;CACrB,EACiC,CAAA;CAGvC,OACE,oBAAC,mCAAD,EACG,SACgC,CAAA;AAEvC;AAEA,6BAA6B,cAAc"}
@@ -1,20 +1,19 @@
1
- import type { FC, PropsWithChildren } from "react";
1
+ import { FC, PropsWithChildren } from "react";
2
+
3
+ //#region src/react/primitives/composer/ComposerIf.d.ts
2
4
  type ComposerIfFilters = {
3
- /** Whether the composer is in editing mode */
4
- editing: boolean | undefined;
5
- /** Whether dictation is currently active */
6
- dictation: boolean | undefined;
5
+ /** Whether the composer is in editing mode */editing: boolean | undefined; /** Whether dictation is currently active */
6
+ dictation: boolean | undefined;
7
7
  };
8
- export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
9
- [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
10
- }[Keys];
11
- export type UseComposerIfProps = RequireAtLeastOne<ComposerIfFilters>;
12
- export declare namespace ComposerPrimitiveIf {
13
- type Props = PropsWithChildren<UseComposerIfProps>;
8
+ type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & { [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>> }[Keys];
9
+ type UseComposerIfProps = RequireAtLeastOne<ComposerIfFilters>;
10
+ declare namespace ComposerPrimitiveIf {
11
+ type Props = PropsWithChildren<UseComposerIfProps>;
14
12
  }
15
13
  /**
16
14
  * @deprecated Use `<AuiIf condition={(s) => s.composer...} />` instead.
17
15
  */
18
- export declare const ComposerPrimitiveIf: FC<ComposerPrimitiveIf.Props>;
19
- export {};
16
+ declare const ComposerPrimitiveIf: FC<ComposerPrimitiveIf.Props>;
17
+ //#endregion
18
+ export { ComposerPrimitiveIf, RequireAtLeastOne, UseComposerIfProps };
20
19
  //# sourceMappingURL=ComposerIf.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerIf.d.ts","sourceRoot":"","sources":["../../../../src/react/primitives/composer/ComposerIf.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGnD,KAAK,iBAAiB,GAAG;IACvB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,4CAA4C;IAC5C,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,IAAI,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,IAAI,CACrE,CAAC,EACD,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CACvB,GACC;KACG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;CACzE,CAAC,IAAI,CAAC,CAAC;AAEV,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;AAetE,yBAAiB,mBAAmB,CAAC;IACnC,KAAY,KAAK,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;CAC3D;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAM7D,CAAC"}
1
+ {"version":3,"file":"ComposerIf.d.ts","names":[],"sources":["../../../../src/react/primitives/composer/ComposerIf.tsx"],"mappings":";;;KAGK,iBAAA;gDAEH,OAAA,uBAFoB;EAIpB,SAAS;AAAA;AAAA,KAGC,iBAAA,uBAAwC,CAAA,SAAU,CAAA,IAAK,IAAA,CACjE,CAAA,EACA,OAAA,OAAc,CAAA,EAAG,IAAA,aAGT,IAAA,KAAS,QAAA,CAAS,IAAA,CAAK,CAAA,EAAG,CAAA,KAAM,OAAA,CAAQ,IAAA,CAAK,CAAA,EAAG,OAAA,CAAQ,IAAA,EAAM,CAAA,MACpE,IAAA;AAAA,KAEQ,kBAAA,GAAqB,iBAAiB,CAAC,iBAAA;AAAA,kBAelC,mBAAA;EAAA,KACH,KAAA,GAAQ,iBAAiB,CAAC,kBAAA;AAAA;;;;cAM3B,mBAAA,EAAqB,EAAE,CAAC,mBAAA,CAAoB,KAAA"}
@@ -1,24 +1,23 @@
1
1
  import { useAuiState } from "@assistant-ui/store";
2
+ //#region src/react/primitives/composer/ComposerIf.tsx
2
3
  const useComposerIf = (props) => {
3
- return useAuiState((s) => {
4
- if (props.editing === true && !s.composer.isEditing)
5
- return false;
6
- if (props.editing === false && s.composer.isEditing)
7
- return false;
8
- const isDictating = s.composer.dictation != null;
9
- if (props.dictation === true && !isDictating)
10
- return false;
11
- if (props.dictation === false && isDictating)
12
- return false;
13
- return true;
14
- });
4
+ return useAuiState((s) => {
5
+ if (props.editing === true && !s.composer.isEditing) return false;
6
+ if (props.editing === false && s.composer.isEditing) return false;
7
+ const isDictating = s.composer.dictation != null;
8
+ if (props.dictation === true && !isDictating) return false;
9
+ if (props.dictation === false && isDictating) return false;
10
+ return true;
11
+ });
15
12
  };
16
13
  /**
17
- * @deprecated Use `<AuiIf condition={(s) => s.composer...} />` instead.
18
- */
19
- export const ComposerPrimitiveIf = ({ children, ...query }) => {
20
- const result = useComposerIf(query);
21
- return result ? children : null;
14
+ * @deprecated Use `<AuiIf condition={(s) => s.composer...} />` instead.
15
+ */
16
+ const ComposerPrimitiveIf = ({ children, ...query }) => {
17
+ return useComposerIf(query) ? children : null;
22
18
  };
23
19
  ComposerPrimitiveIf.displayName = "ComposerPrimitive.If";
20
+ //#endregion
21
+ export { ComposerPrimitiveIf };
22
+
24
23
  //# sourceMappingURL=ComposerIf.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerIf.js","sourceRoot":"","sources":["../../../../src/react/primitives/composer/ComposerIf.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAmBlD,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAE,EAAE;IAClD,OAAO,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE;QACvB,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS;YAAE,OAAO,KAAK,CAAC;QAClE,IAAI,KAAK,CAAC,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS;YAAE,OAAO,KAAK,CAAC;QAElE,MAAM,WAAW,GAAG,CAAC,CAAC,QAAQ,CAAC,SAAS,IAAI,IAAI,CAAC;QACjD,IAAI,KAAK,CAAC,SAAS,KAAK,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO,KAAK,CAAC;QAC3D,IAAI,KAAK,CAAC,SAAS,KAAK,KAAK,IAAI,WAAW;YAAE,OAAO,KAAK,CAAC;QAE3D,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAMF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAkC,CAAC,EACjE,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;AAClC,CAAC,CAAC;AAEF,mBAAmB,CAAC,WAAW,GAAG,sBAAsB,CAAC"}
1
+ {"version":3,"file":"ComposerIf.js","names":[],"sources":["../../../../src/react/primitives/composer/ComposerIf.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\ntype ComposerIfFilters = {\n /** Whether the composer is in editing mode */\n editing: boolean | undefined;\n /** Whether dictation is currently active */\n dictation: boolean | undefined;\n};\n\nexport type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<\n T,\n Exclude<keyof T, Keys>\n> &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;\n }[Keys];\n\nexport type UseComposerIfProps = RequireAtLeastOne<ComposerIfFilters>;\n\nconst useComposerIf = (props: UseComposerIfProps) => {\n return useAuiState((s) => {\n if (props.editing === true && !s.composer.isEditing) return false;\n if (props.editing === false && s.composer.isEditing) return false;\n\n const isDictating = s.composer.dictation != null;\n if (props.dictation === true && !isDictating) return false;\n if (props.dictation === false && isDictating) return false;\n\n return true;\n });\n};\n\nexport namespace ComposerPrimitiveIf {\n export type Props = PropsWithChildren<UseComposerIfProps>;\n}\n\n/**\n * @deprecated Use `<AuiIf condition={(s) => s.composer...} />` instead.\n */\nexport const ComposerPrimitiveIf: FC<ComposerPrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useComposerIf(query);\n return result ? children : null;\n};\n\nComposerPrimitiveIf.displayName = \"ComposerPrimitive.If\";\n"],"mappings":";;AAoBA,MAAM,iBAAiB,UAA8B;CACnD,OAAO,aAAa,MAAM;EACxB,IAAI,MAAM,YAAY,QAAQ,CAAC,EAAE,SAAS,WAAW,OAAO;EAC5D,IAAI,MAAM,YAAY,SAAS,EAAE,SAAS,WAAW,OAAO;EAE5D,MAAM,cAAc,EAAE,SAAS,aAAa;EAC5C,IAAI,MAAM,cAAc,QAAQ,CAAC,aAAa,OAAO;EACrD,IAAI,MAAM,cAAc,SAAS,aAAa,OAAO;EAErD,OAAO;CACT,CAAC;AACH;;;;AASA,MAAa,uBAAsD,EACjE,UACA,GAAG,YACC;CAEJ,OADe,cAAc,KACjB,IAAI,WAAW;AAC7B;AAEA,oBAAoB,cAAc"}
@@ -1,12 +1,13 @@
1
- import { type ReactNode } from "react";
2
- import type { QueueItemState } from "../../../store/scopes/queue-item.js";
3
- export declare namespace ComposerPrimitiveQueue {
4
- type Props = {
5
- /** Render function called for each queue item. Receives the queue item state. */
6
- children: (value: {
7
- queueItem: QueueItemState;
8
- }) => ReactNode;
9
- };
1
+ import { QueueItemState } from "../../../store/scopes/queue-item.js";
2
+ import { ReactNode } from "react";
3
+
4
+ //#region src/react/primitives/composer/ComposerQueue.d.ts
5
+ declare namespace ComposerPrimitiveQueue {
6
+ type Props = {
7
+ /** Render function called for each queue item. Receives the queue item state. */children: (value: {
8
+ queueItem: QueueItemState;
9
+ }) => ReactNode;
10
+ };
10
11
  }
11
12
  /**
12
13
  * Renders all queue items in the composer.
@@ -23,9 +24,11 @@ export declare namespace ComposerPrimitiveQueue {
23
24
  * </ComposerPrimitive.Queue>
24
25
  * ```
25
26
  */
26
- export declare const ComposerPrimitiveQueue: import("react").NamedExoticComponent<{
27
- children: (value: {
28
- queueItem: QueueItemState;
29
- }) => ReactNode;
27
+ declare const ComposerPrimitiveQueue: import("react").NamedExoticComponent<{
28
+ children: (value: {
29
+ queueItem: QueueItemState;
30
+ }) => ReactNode;
30
31
  }>;
32
+ //#endregion
33
+ export { ComposerPrimitiveQueue };
31
34
  //# sourceMappingURL=ComposerQueue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerQueue.d.ts","sourceRoot":"","sources":["../../../../src/react/primitives/composer/ComposerQueue.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,SAAS,EAAiB,MAAM,OAAO,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,4CAAyC;AAGvE,yBAAiB,sBAAsB,CAAC;IACtC,KAAY,KAAK,GAAG;QAClB,iFAAiF;QACjF,QAAQ,EAAE,CAAC,KAAK,EAAE;YAAE,SAAS,EAAE,cAAc,CAAA;SAAE,KAAK,SAAS,CAAC;KAC/D,CAAC;CACH;AA8BD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB;cA1CvB,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,cAAc,CAAA;KAAE,KAAK,SAAS;EA0CQ,CAAC"}
1
+ {"version":3,"file":"ComposerQueue.d.ts","names":[],"sources":["../../../../src/react/primitives/composer/ComposerQueue.tsx"],"mappings":";;;;kBAKiB,sBAAA;EAAA,KACH,KAAA;IADG,iFAGb,QAAA,GAAW,KAAA;MAAS,SAAA,EAAW,cAAA;IAAA,MAAqB,SAAS;EAAA;AAAA;;;;;;AAAA;AA+CjE;;;;;;;;;cAAa,sBAAA,kBAAsB,oBAAA;aA1CtB,KAAA;IAAS,SAAA,EAAW,cAAA;EAAA,MAAqB,SAAS;AAAA"}