@assistant-ui/react 0.12.8 → 0.12.10

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 (303) hide show
  1. package/dist/client/ExternalThread.d.ts.map +1 -1
  2. package/dist/client/ExternalThread.js +10 -0
  3. package/dist/client/ExternalThread.js.map +1 -1
  4. package/dist/client/NoOpComposerClient.d.ts.map +1 -1
  5. package/dist/client/NoOpComposerClient.js +4 -0
  6. package/dist/client/NoOpComposerClient.js.map +1 -1
  7. package/dist/context/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -1
  8. package/dist/context/providers/ChainOfThoughtByIndicesProvider.js +1 -1
  9. package/dist/context/providers/ChainOfThoughtByIndicesProvider.js.map +1 -1
  10. package/dist/context/react/utils/ensureBinding.js +1 -1
  11. package/dist/context/react/utils/ensureBinding.js.map +1 -1
  12. package/dist/hooks/useMessageQuote.d.ts +17 -0
  13. package/dist/hooks/useMessageQuote.d.ts.map +1 -0
  14. package/dist/hooks/useMessageQuote.js +20 -0
  15. package/dist/hooks/useMessageQuote.js.map +1 -0
  16. package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts.map +1 -1
  17. package/dist/legacy-runtime/AssistantRuntimeProvider.js +1 -2
  18. package/dist/legacy-runtime/AssistantRuntimeProvider.js.map +1 -1
  19. package/dist/legacy-runtime/client/ComposerRuntimeClient.d.ts.map +1 -1
  20. package/dist/legacy-runtime/client/ComposerRuntimeClient.js +2 -0
  21. package/dist/legacy-runtime/client/ComposerRuntimeClient.js.map +1 -1
  22. package/dist/legacy-runtime/hooks/AssistantContext.d.ts +1 -1
  23. package/dist/legacy-runtime/hooks/AssistantContext.js +1 -1
  24. package/dist/legacy-runtime/hooks/AttachmentContext.d.ts +1 -1
  25. package/dist/legacy-runtime/hooks/AttachmentContext.js +1 -1
  26. package/dist/legacy-runtime/hooks/ComposerContext.d.ts +6 -6
  27. package/dist/legacy-runtime/hooks/ComposerContext.js +4 -4
  28. package/dist/legacy-runtime/hooks/MessageContext.d.ts +5 -5
  29. package/dist/legacy-runtime/hooks/MessageContext.js +5 -5
  30. package/dist/legacy-runtime/hooks/MessagePartContext.d.ts +1 -1
  31. package/dist/legacy-runtime/hooks/MessagePartContext.js +1 -1
  32. package/dist/legacy-runtime/hooks/ThreadContext.d.ts +5 -5
  33. package/dist/legacy-runtime/hooks/ThreadContext.js +4 -4
  34. package/dist/legacy-runtime/hooks/ThreadListItemContext.d.ts +1 -1
  35. package/dist/legacy-runtime/hooks/ThreadListItemContext.js +1 -1
  36. package/dist/legacy-runtime/runtime/ComposerRuntime.d.ts +12 -0
  37. package/dist/legacy-runtime/runtime/ComposerRuntime.d.ts.map +1 -1
  38. package/dist/legacy-runtime/runtime/ComposerRuntime.js +9 -0
  39. package/dist/legacy-runtime/runtime/ComposerRuntime.js.map +1 -1
  40. package/dist/legacy-runtime/runtime/ThreadRuntime.d.ts +2 -0
  41. package/dist/legacy-runtime/runtime/ThreadRuntime.d.ts.map +1 -1
  42. package/dist/legacy-runtime/runtime-cores/assistant-transport/types.d.ts +5 -0
  43. package/dist/legacy-runtime/runtime-cores/assistant-transport/types.d.ts.map +1 -1
  44. package/dist/legacy-runtime/runtime-cores/assistant-transport/types.js.map +1 -1
  45. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
  46. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js +36 -26
  47. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js.map +1 -1
  48. package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js +7 -7
  49. package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js.map +1 -1
  50. package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.d.ts +4 -0
  51. package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.d.ts.map +1 -1
  52. package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.js +16 -2
  53. package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.js.map +1 -1
  54. package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts +3 -0
  55. package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts.map +1 -1
  56. package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js +1 -1
  57. package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js.map +1 -1
  58. package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts.map +1 -1
  59. package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.js +1 -1
  60. package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.js.map +1 -1
  61. package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.d.ts.map +1 -1
  62. package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.js +4 -0
  63. package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.js.map +1 -1
  64. package/dist/primitives/actionBar/ActionBarCopy.d.ts.map +1 -1
  65. package/dist/primitives/actionBar/ActionBarCopy.js +7 -6
  66. package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
  67. package/dist/primitives/actionBar/ActionBarEdit.js +1 -1
  68. package/dist/primitives/actionBar/ActionBarEdit.js.map +1 -1
  69. package/dist/primitives/actionBar/ActionBarExportMarkdown.d.ts.map +1 -1
  70. package/dist/primitives/actionBar/ActionBarExportMarkdown.js +4 -3
  71. package/dist/primitives/actionBar/ActionBarExportMarkdown.js.map +1 -1
  72. package/dist/primitives/actionBar/ActionBarSpeak.d.ts.map +1 -1
  73. package/dist/primitives/actionBar/ActionBarSpeak.js +4 -3
  74. package/dist/primitives/actionBar/ActionBarSpeak.js.map +1 -1
  75. package/dist/primitives/actionBar/ActionBarStopSpeaking.js +1 -1
  76. package/dist/primitives/actionBar/ActionBarStopSpeaking.js.map +1 -1
  77. package/dist/primitives/actionBar/useActionBarFloatStatus.js +5 -5
  78. package/dist/primitives/actionBar/useActionBarFloatStatus.js.map +1 -1
  79. package/dist/primitives/attachment/AttachmentName.js +1 -1
  80. package/dist/primitives/attachment/AttachmentName.js.map +1 -1
  81. package/dist/primitives/attachment/AttachmentThumb.js +2 -2
  82. package/dist/primitives/attachment/AttachmentThumb.js.map +1 -1
  83. package/dist/primitives/branchPicker/BranchPickerCount.js +1 -1
  84. package/dist/primitives/branchPicker/BranchPickerCount.js.map +1 -1
  85. package/dist/primitives/branchPicker/BranchPickerNext.js +3 -3
  86. package/dist/primitives/branchPicker/BranchPickerNext.js.map +1 -1
  87. package/dist/primitives/branchPicker/BranchPickerNumber.js +1 -1
  88. package/dist/primitives/branchPicker/BranchPickerNumber.js.map +1 -1
  89. package/dist/primitives/branchPicker/BranchPickerPrevious.js +3 -3
  90. package/dist/primitives/branchPicker/BranchPickerPrevious.js.map +1 -1
  91. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts.map +1 -1
  92. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js +1 -1
  93. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js.map +1 -1
  94. package/dist/primitives/chainOfThought/ChainOfThoughtParts.d.ts +3 -1
  95. package/dist/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -1
  96. package/dist/primitives/chainOfThought/ChainOfThoughtParts.js +5 -7
  97. package/dist/primitives/chainOfThought/ChainOfThoughtParts.js.map +1 -1
  98. package/dist/primitives/composer/ComposerAddAttachment.js +1 -1
  99. package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
  100. package/dist/primitives/composer/ComposerAttachments.js +1 -1
  101. package/dist/primitives/composer/ComposerAttachments.js.map +1 -1
  102. package/dist/primitives/composer/ComposerCancel.js +1 -1
  103. package/dist/primitives/composer/ComposerCancel.js.map +1 -1
  104. package/dist/primitives/composer/ComposerDictate.js +3 -3
  105. package/dist/primitives/composer/ComposerDictate.js.map +1 -1
  106. package/dist/primitives/composer/ComposerDictationTranscript.d.ts.map +1 -1
  107. package/dist/primitives/composer/ComposerDictationTranscript.js +1 -1
  108. package/dist/primitives/composer/ComposerDictationTranscript.js.map +1 -1
  109. package/dist/primitives/composer/ComposerIf.js +4 -4
  110. package/dist/primitives/composer/ComposerIf.js.map +1 -1
  111. package/dist/primitives/composer/ComposerInput.d.ts +35 -45
  112. package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
  113. package/dist/primitives/composer/ComposerInput.js +25 -9
  114. package/dist/primitives/composer/ComposerInput.js.map +1 -1
  115. package/dist/primitives/composer/ComposerQuote.d.ts +52 -0
  116. package/dist/primitives/composer/ComposerQuote.d.ts.map +1 -0
  117. package/dist/primitives/composer/ComposerQuote.js +57 -0
  118. package/dist/primitives/composer/ComposerQuote.js.map +1 -0
  119. package/dist/primitives/composer/ComposerStopDictation.js +1 -1
  120. package/dist/primitives/composer/ComposerStopDictation.js.map +1 -1
  121. package/dist/primitives/composer/index.d.ts +3 -0
  122. package/dist/primitives/composer/index.d.ts.map +1 -1
  123. package/dist/primitives/composer/index.js +3 -0
  124. package/dist/primitives/composer/index.js.map +1 -1
  125. package/dist/primitives/error/ErrorMessage.js +4 -4
  126. package/dist/primitives/error/ErrorMessage.js.map +1 -1
  127. package/dist/primitives/index.d.ts +2 -0
  128. package/dist/primitives/index.d.ts.map +1 -1
  129. package/dist/primitives/index.js +2 -0
  130. package/dist/primitives/index.js.map +1 -1
  131. package/dist/primitives/message/MessageAttachments.js +4 -4
  132. package/dist/primitives/message/MessageAttachments.js.map +1 -1
  133. package/dist/primitives/message/MessageError.js +2 -2
  134. package/dist/primitives/message/MessageError.js.map +1 -1
  135. package/dist/primitives/message/MessageIf.js +3 -3
  136. package/dist/primitives/message/MessageIf.js.map +1 -1
  137. package/dist/primitives/message/MessageParts.d.ts +140 -133
  138. package/dist/primitives/message/MessageParts.d.ts.map +1 -1
  139. package/dist/primitives/message/MessageParts.js +7 -7
  140. package/dist/primitives/message/MessageParts.js.map +1 -1
  141. package/dist/primitives/message/MessagePartsGrouped.js +5 -5
  142. package/dist/primitives/message/MessagePartsGrouped.js.map +1 -1
  143. package/dist/primitives/message/MessageRoot.d.ts.map +1 -1
  144. package/dist/primitives/message/MessageRoot.js +6 -5
  145. package/dist/primitives/message/MessageRoot.js.map +1 -1
  146. package/dist/primitives/messagePart/MessagePartInProgress.d.ts.map +1 -1
  147. package/dist/primitives/messagePart/MessagePartInProgress.js +1 -1
  148. package/dist/primitives/messagePart/MessagePartInProgress.js.map +1 -1
  149. package/dist/primitives/messagePart/useMessagePartData.js +3 -3
  150. package/dist/primitives/messagePart/useMessagePartData.js.map +1 -1
  151. package/dist/primitives/messagePart/useMessagePartFile.js +3 -3
  152. package/dist/primitives/messagePart/useMessagePartFile.js.map +1 -1
  153. package/dist/primitives/messagePart/useMessagePartImage.js +3 -3
  154. package/dist/primitives/messagePart/useMessagePartImage.js.map +1 -1
  155. package/dist/primitives/messagePart/useMessagePartReasoning.js +3 -3
  156. package/dist/primitives/messagePart/useMessagePartReasoning.js.map +1 -1
  157. package/dist/primitives/messagePart/useMessagePartSource.js +3 -3
  158. package/dist/primitives/messagePart/useMessagePartSource.js.map +1 -1
  159. package/dist/primitives/messagePart/useMessagePartText.d.ts.map +1 -1
  160. package/dist/primitives/messagePart/useMessagePartText.js +3 -3
  161. package/dist/primitives/messagePart/useMessagePartText.js.map +1 -1
  162. package/dist/primitives/selectionToolbar/SelectionToolbarQuote.d.ts +24 -0
  163. package/dist/primitives/selectionToolbar/SelectionToolbarQuote.d.ts.map +1 -0
  164. package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js +37 -0
  165. package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js.map +1 -0
  166. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.d.ts +31 -0
  167. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.d.ts.map +1 -0
  168. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js +85 -0
  169. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js.map +1 -0
  170. package/dist/primitives/selectionToolbar/index.d.ts +3 -0
  171. package/dist/primitives/selectionToolbar/index.d.ts.map +1 -0
  172. package/dist/primitives/selectionToolbar/index.js +3 -0
  173. package/dist/primitives/selectionToolbar/index.js.map +1 -0
  174. package/dist/primitives/suggestion/SuggestionDescription.js +1 -1
  175. package/dist/primitives/suggestion/SuggestionDescription.js.map +1 -1
  176. package/dist/primitives/suggestion/SuggestionTitle.js +1 -1
  177. package/dist/primitives/suggestion/SuggestionTitle.js.map +1 -1
  178. package/dist/primitives/suggestion/SuggestionTrigger.d.ts.map +1 -1
  179. package/dist/primitives/suggestion/SuggestionTrigger.js +6 -3
  180. package/dist/primitives/suggestion/SuggestionTrigger.js.map +1 -1
  181. package/dist/primitives/thread/ThreadEmpty.js +1 -1
  182. package/dist/primitives/thread/ThreadEmpty.js.map +1 -1
  183. package/dist/primitives/thread/ThreadIf.js +7 -7
  184. package/dist/primitives/thread/ThreadIf.js.map +1 -1
  185. package/dist/primitives/thread/ThreadMessages.js +3 -3
  186. package/dist/primitives/thread/ThreadMessages.js.map +1 -1
  187. package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
  188. package/dist/primitives/thread/ThreadSuggestion.js +5 -2
  189. package/dist/primitives/thread/ThreadSuggestion.js.map +1 -1
  190. package/dist/primitives/thread/ThreadSuggestions.js +1 -1
  191. package/dist/primitives/thread/ThreadSuggestions.js.map +1 -1
  192. package/dist/primitives/thread/ThreadViewportSlack.js +4 -4
  193. package/dist/primitives/thread/ThreadViewportSlack.js.map +1 -1
  194. package/dist/primitives/threadList/ThreadListItems.js +1 -1
  195. package/dist/primitives/threadList/ThreadListItems.js.map +1 -1
  196. package/dist/primitives/threadList/ThreadListNew.js +1 -1
  197. package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
  198. package/dist/primitives/threadListItem/ThreadListItemRoot.js +1 -1
  199. package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -1
  200. package/dist/primitives/threadListItem/ThreadListItemTitle.js +1 -1
  201. package/dist/primitives/threadListItem/ThreadListItemTitle.js.map +1 -1
  202. package/dist/types/QuoteTypes.d.ts +5 -0
  203. package/dist/types/QuoteTypes.d.ts.map +1 -0
  204. package/dist/types/QuoteTypes.js +2 -0
  205. package/dist/types/QuoteTypes.js.map +1 -0
  206. package/dist/types/index.d.ts +1 -0
  207. package/dist/types/index.d.ts.map +1 -1
  208. package/dist/types/scopes/composer.d.ts +10 -0
  209. package/dist/types/scopes/composer.d.ts.map +1 -1
  210. package/dist/utils/getSelectionMessageId.d.ts +2 -0
  211. package/dist/utils/getSelectionMessageId.d.ts.map +1 -0
  212. package/dist/utils/getSelectionMessageId.js +21 -0
  213. package/dist/utils/getSelectionMessageId.js.map +1 -0
  214. package/dist/utils/smooth/useSmooth.js +1 -1
  215. package/dist/utils/smooth/useSmooth.js.map +1 -1
  216. package/dist/utils/useToolArgsFieldStatus.js +5 -5
  217. package/dist/utils/useToolArgsFieldStatus.js.map +1 -1
  218. package/package.json +7 -7
  219. package/src/client/ExternalThread.ts +12 -0
  220. package/src/client/NoOpComposerClient.tsx +4 -0
  221. package/src/context/providers/ChainOfThoughtByIndicesProvider.tsx +3 -2
  222. package/src/context/react/utils/ensureBinding.ts +1 -1
  223. package/src/hooks/useMessageQuote.ts +27 -0
  224. package/src/legacy-runtime/AssistantRuntimeProvider.tsx +1 -4
  225. package/src/legacy-runtime/client/ComposerRuntimeClient.ts +2 -0
  226. package/src/legacy-runtime/hooks/AssistantContext.ts +1 -1
  227. package/src/legacy-runtime/hooks/AttachmentContext.ts +1 -1
  228. package/src/legacy-runtime/hooks/ComposerContext.ts +6 -6
  229. package/src/legacy-runtime/hooks/MessageContext.ts +5 -5
  230. package/src/legacy-runtime/hooks/MessagePartContext.ts +1 -1
  231. package/src/legacy-runtime/hooks/ThreadContext.ts +5 -5
  232. package/src/legacy-runtime/hooks/ThreadListItemContext.ts +1 -1
  233. package/src/legacy-runtime/runtime/ComposerRuntime.ts +22 -0
  234. package/src/legacy-runtime/runtime-cores/assistant-transport/types.ts +5 -0
  235. package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.tsx +41 -31
  236. package/src/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.ts +8 -8
  237. package/src/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.tsx +21 -2
  238. package/src/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.tsx +4 -0
  239. package/src/legacy-runtime/runtime-cores/external-store/createMessageConverter.tsx +2 -2
  240. package/src/legacy-runtime/runtime-cores/local/useLocalRuntime.tsx +1 -3
  241. package/src/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.tsx +6 -0
  242. package/src/primitives/actionBar/ActionBarCopy.tsx +7 -6
  243. package/src/primitives/actionBar/ActionBarEdit.tsx +1 -1
  244. package/src/primitives/actionBar/ActionBarExportMarkdown.tsx +4 -3
  245. package/src/primitives/actionBar/ActionBarSpeak.tsx +4 -3
  246. package/src/primitives/actionBar/ActionBarStopSpeaking.tsx +1 -1
  247. package/src/primitives/actionBar/useActionBarFloatStatus.tsx +5 -5
  248. package/src/primitives/attachment/AttachmentName.tsx +1 -1
  249. package/src/primitives/attachment/AttachmentThumb.tsx +2 -2
  250. package/src/primitives/branchPicker/BranchPickerCount.tsx +1 -1
  251. package/src/primitives/branchPicker/BranchPickerNext.tsx +3 -3
  252. package/src/primitives/branchPicker/BranchPickerNumber.tsx +1 -1
  253. package/src/primitives/branchPicker/BranchPickerPrevious.tsx +3 -3
  254. package/src/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.tsx +1 -3
  255. package/src/primitives/chainOfThought/ChainOfThoughtParts.tsx +19 -11
  256. package/src/primitives/composer/ComposerAddAttachment.tsx +1 -1
  257. package/src/primitives/composer/ComposerAttachments.tsx +1 -1
  258. package/src/primitives/composer/ComposerCancel.tsx +1 -1
  259. package/src/primitives/composer/ComposerDictate.tsx +4 -4
  260. package/src/primitives/composer/ComposerDictationTranscript.tsx +1 -3
  261. package/src/primitives/composer/ComposerIf.tsx +4 -4
  262. package/src/primitives/composer/ComposerInput.tsx +57 -17
  263. package/src/primitives/composer/ComposerQuote.tsx +109 -0
  264. package/src/primitives/composer/ComposerStopDictation.tsx +1 -1
  265. package/src/primitives/composer/index.ts +3 -0
  266. package/src/primitives/error/ErrorMessage.tsx +4 -4
  267. package/src/primitives/index.ts +2 -0
  268. package/src/primitives/message/MessageAttachments.tsx +4 -4
  269. package/src/primitives/message/MessageError.tsx +3 -3
  270. package/src/primitives/message/MessageIf.tsx +3 -3
  271. package/src/primitives/message/MessageParts.tsx +156 -148
  272. package/src/primitives/message/MessagePartsGrouped.tsx +5 -5
  273. package/src/primitives/message/MessageRoot.tsx +6 -5
  274. package/src/primitives/messagePart/MessagePartInProgress.tsx +1 -3
  275. package/src/primitives/messagePart/useMessagePartData.tsx +3 -3
  276. package/src/primitives/messagePart/useMessagePartFile.tsx +3 -3
  277. package/src/primitives/messagePart/useMessagePartImage.tsx +3 -3
  278. package/src/primitives/messagePart/useMessagePartReasoning.tsx +3 -3
  279. package/src/primitives/messagePart/useMessagePartSource.tsx +3 -3
  280. package/src/primitives/messagePart/useMessagePartText.tsx +4 -3
  281. package/src/primitives/selectionToolbar/SelectionToolbarQuote.tsx +62 -0
  282. package/src/primitives/selectionToolbar/SelectionToolbarRoot.tsx +131 -0
  283. package/src/primitives/selectionToolbar/index.ts +8 -0
  284. package/src/primitives/suggestion/SuggestionDescription.tsx +1 -1
  285. package/src/primitives/suggestion/SuggestionTitle.tsx +1 -1
  286. package/src/primitives/suggestion/SuggestionTrigger.tsx +6 -3
  287. package/src/primitives/thread/ThreadEmpty.tsx +1 -1
  288. package/src/primitives/thread/ThreadIf.tsx +8 -8
  289. package/src/primitives/thread/ThreadMessages.tsx +3 -3
  290. package/src/primitives/thread/ThreadSuggestion.tsx +5 -2
  291. package/src/primitives/thread/ThreadSuggestions.tsx +1 -1
  292. package/src/primitives/thread/ThreadViewportSlack.tsx +5 -5
  293. package/src/primitives/threadList/ThreadListItems.tsx +2 -2
  294. package/src/primitives/threadList/ThreadListNew.tsx +1 -1
  295. package/src/primitives/threadListItem/ThreadListItemRoot.tsx +1 -1
  296. package/src/primitives/threadListItem/ThreadListItemTitle.tsx +1 -1
  297. package/src/types/QuoteTypes.ts +4 -0
  298. package/src/types/index.ts +2 -0
  299. package/src/types/scopes/composer.ts +12 -0
  300. package/src/utils/getSelectionMessageId.ts +20 -0
  301. package/src/utils/smooth/useSmooth.tsx +1 -1
  302. package/src/utils/useToolArgsFieldStatus.tsx +5 -5
  303. package/src/primitives/chainOfThought/CHAIN_OF_THOUGHT.spec.md +0 -68
@@ -35,6 +35,36 @@ import { InMemoryThreadListAdapter } from "../remote-thread-list/adapter/in-memo
35
35
  import { useAui, useAuiState } from "@assistant-ui/store";
36
36
  import { UserExternalState } from "../../../augmentations";
37
37
 
38
+ const convertAppendMessageToCommand = (
39
+ message: AppendMessage,
40
+ ): AddMessageCommand => {
41
+ if (message.role !== "user")
42
+ throw new Error("Only user messages are supported");
43
+
44
+ const parts: UserMessagePart[] = [];
45
+ const content = [
46
+ ...message.content,
47
+ ...(message.attachments?.flatMap((a) => a.content) ?? []),
48
+ ];
49
+ for (const contentPart of content) {
50
+ if (contentPart.type === "text") {
51
+ parts.push({ type: "text", text: contentPart.text });
52
+ } else if (contentPart.type === "image") {
53
+ parts.push({ type: "image", image: contentPart.image });
54
+ }
55
+ }
56
+
57
+ return {
58
+ type: "add-message",
59
+ message: {
60
+ role: "user",
61
+ parts,
62
+ },
63
+ parentId: message.parentId,
64
+ sourceId: message.sourceId,
65
+ };
66
+ };
67
+
38
68
  const symbolAssistantTransportExtras = Symbol("assistant-transport-extras");
39
69
  type AssistantTransportExtras = {
40
70
  [symbolAssistantTransportExtras]: true;
@@ -74,8 +104,8 @@ export function useAssistantTransportState<T>(
74
104
  export function useAssistantTransportState<T>(
75
105
  selector: (state: UserExternalState) => T = (t) => t as T,
76
106
  ): T | UserExternalState {
77
- return useAuiState(({ thread }) =>
78
- selector(asAssistantTransportExtras(thread.extras).state),
107
+ return useAuiState((s) =>
108
+ selector(asAssistantTransportExtras(s.thread.extras).state),
79
109
  );
80
110
  }
81
111
 
@@ -90,7 +120,7 @@ const useAssistantTransportThreadRuntime = <T,>(
90
120
  onQueue: () => runManager.schedule(),
91
121
  });
92
122
 
93
- const threadId = useAuiState(({ threadListItem }) => threadListItem.remoteId);
123
+ const threadId = useAuiState((s) => s.threadListItem.remoteId);
94
124
 
95
125
  const runManager = useRunManager({
96
126
  onRun: async (signal: AbortSignal) => {
@@ -254,37 +284,17 @@ const useAssistantTransportThreadRuntime = <T,>(
254
284
  state: agentStateRef.current as UserExternalState,
255
285
  } satisfies AssistantTransportExtras,
256
286
  onNew: async (message: AppendMessage): Promise<void> => {
257
- if (message.role !== "user")
258
- throw new Error("Only user messages are supported");
259
-
260
- // Store parentId for the request
261
287
  parentIdRef.current = message.parentId;
262
-
263
- // Convert AppendMessage to AddMessageCommand
264
- const parts: UserMessagePart[] = [];
265
-
266
- const content = [
267
- ...message.content,
268
- ...(message.attachments?.flatMap((a) => a.content) ?? []),
269
- ];
270
- for (const contentPart of content) {
271
- if (contentPart.type === "text") {
272
- parts.push({ type: "text", text: contentPart.text });
273
- } else if (contentPart.type === "image") {
274
- parts.push({ type: "image", image: contentPart.image });
275
- }
276
- }
277
-
278
- const command: AddMessageCommand = {
279
- type: "add-message",
280
- message: {
281
- role: "user",
282
- parts,
283
- },
284
- };
285
-
288
+ const command = convertAppendMessageToCommand(message);
286
289
  commandQueue.enqueue(command);
287
290
  },
291
+ ...(options.capabilities?.edit && {
292
+ onEdit: async (message: AppendMessage): Promise<void> => {
293
+ parentIdRef.current = message.parentId;
294
+ const command = convertAppendMessageToCommand(message);
295
+ commandQueue.enqueue(command);
296
+ },
297
+ }),
288
298
  onCancel: async () => {
289
299
  runManager.cancel();
290
300
  await toolInvocations.abort();
@@ -181,7 +181,7 @@ export function useToolInvocations({
181
181
 
182
182
  if (content.argsText !== lastState.argsText) {
183
183
  if (lastState.argsComplete) {
184
- if (process.env["NODE_ENV"] !== "production") {
184
+ if (process.env.NODE_ENV !== "production") {
185
185
  console.warn(
186
186
  "argsText updated after controller was closed:",
187
187
  {
@@ -233,6 +233,13 @@ export function useToolInvocations({
233
233
  }
234
234
 
235
235
  if (content.result !== undefined && !lastState.hasResult) {
236
+ lastToolStates.current[content.toolCallId] = {
237
+ hasResult: true,
238
+ argsComplete: true,
239
+ argsText: lastState.argsText,
240
+ controller: lastState.controller,
241
+ };
242
+
236
243
  lastState.controller.setResponse(
237
244
  new ToolResponse({
238
245
  result: content.result as ReadonlyJSONValue,
@@ -241,13 +248,6 @@ export function useToolInvocations({
241
248
  }),
242
249
  );
243
250
  lastState.controller.close();
244
-
245
- lastToolStates.current[content.toolCallId] = {
246
- hasResult: true,
247
- argsComplete: true,
248
- argsText: lastState.argsText,
249
- controller: lastState.controller,
250
- };
251
251
  }
252
252
  }
253
253
 
@@ -11,6 +11,7 @@ import type {
11
11
  DictationState,
12
12
  } from "../core/ComposerRuntimeCore";
13
13
  import type { MessageRole, RunConfig } from "../../../types/AssistantTypes";
14
+ import type { QuoteInfo } from "../../../types/QuoteTypes";
14
15
  import { BaseSubscribable } from "../remote-thread-list/BaseSubscribable";
15
16
  import type { DictationAdapter } from "../adapters/speech/SpeechAdapterTypes";
16
17
 
@@ -64,6 +65,19 @@ export abstract class BaseComposerRuntimeCore
64
65
  return this._runConfig;
65
66
  }
66
67
 
68
+ private _quote: QuoteInfo | undefined = undefined;
69
+
70
+ get quote() {
71
+ return this._quote;
72
+ }
73
+
74
+ public setQuote(quote: QuoteInfo | undefined) {
75
+ if (this._quote === quote) return;
76
+
77
+ this._quote = quote;
78
+ this._notifySubscribers();
79
+ }
80
+
67
81
  public setText(value: string) {
68
82
  if (this._text === value) return;
69
83
 
@@ -112,13 +126,15 @@ export abstract class BaseComposerRuntimeCore
112
126
  this._attachments.length === 0 &&
113
127
  this._text === "" &&
114
128
  this._role === "user" &&
115
- Object.keys(this._runConfig).length === 0
129
+ Object.keys(this._runConfig).length === 0 &&
130
+ this._quote === undefined
116
131
  ) {
117
132
  return;
118
133
  }
119
134
 
120
135
  this._role = "user";
121
136
  this._runConfig = {};
137
+ this._quote = undefined;
122
138
 
123
139
  const task = this._onClearAttachments();
124
140
  this._emptyTextAndAttachments();
@@ -151,14 +167,17 @@ export abstract class BaseComposerRuntimeCore
151
167
  : [];
152
168
 
153
169
  const text = this.text;
170
+ const quote = this._quote;
171
+ this._quote = undefined;
154
172
  this._emptyTextAndAttachments();
173
+
155
174
  const message: Omit<AppendMessage, "parentId" | "sourceId"> = {
156
175
  createdAt: new Date(),
157
176
  role: this.role,
158
177
  content: text ? [{ type: "text", text }] : [],
159
178
  attachments: await attachments,
160
179
  runConfig: this.runConfig,
161
- metadata: { custom: {} },
180
+ metadata: { custom: { ...(quote ? { quote } : {}) } },
162
181
  };
163
182
 
164
183
  this.handleSend(message);
@@ -5,6 +5,7 @@ import type {
5
5
  } from "../../../types";
6
6
  import type { MessageRole, RunConfig } from "../../../types/AssistantTypes";
7
7
  import type { DictationAdapter } from "../adapters/speech/SpeechAdapterTypes";
8
+ import type { QuoteInfo } from "../../../types/QuoteTypes";
8
9
 
9
10
  export type ComposerRuntimeEventType = "send" | "attachmentAdd";
10
11
 
@@ -49,6 +50,9 @@ export type ComposerRuntimeCore = Readonly<{
49
50
  runConfig: RunConfig;
50
51
  setRunConfig: (runConfig: RunConfig) => void;
51
52
 
53
+ quote: QuoteInfo | undefined;
54
+ setQuote: (quote: QuoteInfo | undefined) => void;
55
+
52
56
  reset: () => Promise<void>;
53
57
  clearAttachments: () => Promise<void>;
54
58
 
@@ -63,8 +63,8 @@ export const createMessageConverter = <T extends object>(
63
63
  return undefined;
64
64
  });
65
65
 
66
- const messageMessages = useAuiState<T[]>(({ message }) =>
67
- getExternalStoreMessages(message),
66
+ const messageMessages = useAuiState<T[]>((s) =>
67
+ getExternalStoreMessages(s.message),
68
68
  );
69
69
 
70
70
  const messages = partMessages ?? messageMessages;
@@ -27,9 +27,7 @@ const useLocalThreadRuntime = (
27
27
  const [runtime] = useState(() => new LocalRuntimeCore(opt, initialMessages));
28
28
 
29
29
  const threadIdRef = useRef<string | undefined>(undefined);
30
- threadIdRef.current = useAuiState(
31
- ({ threadListItem }) => threadListItem.remoteId,
32
- );
30
+ threadIdRef.current = useAuiState((s) => s.threadListItem.remoteId);
33
31
 
34
32
  useEffect(() => {
35
33
  runtime.threads
@@ -129,6 +129,12 @@ export const EMPTY_THREAD_CORE: ThreadRuntimeCore = {
129
129
  // noop
130
130
  },
131
131
 
132
+ quote: undefined,
133
+
134
+ setQuote() {
135
+ throw EMPTY_THREAD_ERROR;
136
+ },
137
+
132
138
  subscribe() {
133
139
  return () => {};
134
140
  },
@@ -37,15 +37,16 @@ const useActionBarPrimitiveCopy = ({
37
37
  copiedDuration?: number | undefined;
38
38
  } = {}) => {
39
39
  const aui = useAui();
40
- const hasCopyableContent = useAuiState(({ message }) => {
40
+ const hasCopyableContent = useAuiState((s) => {
41
41
  return (
42
- (message.role !== "assistant" || message.status?.type !== "running") &&
43
- message.parts.some((c) => c.type === "text" && c.text.length > 0)
42
+ (s.message.role !== "assistant" ||
43
+ s.message.status?.type !== "running") &&
44
+ s.message.parts.some((c) => c.type === "text" && c.text.length > 0)
44
45
  );
45
46
  });
46
47
 
47
- const isEditing = useAuiState(({ composer }) => composer.isEditing);
48
- const composerValue = useAuiState(({ composer }) => composer.text);
48
+ const isEditing = useAuiState((s) => s.composer.isEditing);
49
+ const composerValue = useAuiState((s) => s.composer.text);
49
50
 
50
51
  const callback = useCallback(() => {
51
52
  const valueToCopy = isEditing ? composerValue : aui.message().getCopyText();
@@ -89,7 +90,7 @@ export const ActionBarPrimitiveCopy = forwardRef<
89
90
  ActionBarPrimitiveCopy.Element,
90
91
  ActionBarPrimitiveCopy.Props
91
92
  >(({ copiedDuration, onClick, disabled, ...props }, forwardedRef) => {
92
- const isCopied = useAuiState(({ message }) => message.isCopied);
93
+ const isCopied = useAuiState((s) => s.message.isCopied);
93
94
  const callback = useActionBarPrimitiveCopy({ copiedDuration });
94
95
  return (
95
96
  <Primitive.button
@@ -31,7 +31,7 @@ import { useAuiState, useAui } from "@assistant-ui/store";
31
31
  */
32
32
  const useActionBarEdit = () => {
33
33
  const aui = useAui();
34
- const disabled = useAuiState(({ composer }) => composer.isEditing);
34
+ const disabled = useAuiState((s) => s.composer.isEditing);
35
35
 
36
36
  const callback = useCallback(() => {
37
37
  aui.composer().beginEdit();
@@ -14,10 +14,11 @@ const useActionBarExportMarkdown = ({
14
14
  onExport?: ((content: string) => void | Promise<void>) | undefined;
15
15
  } = {}) => {
16
16
  const aui = useAui();
17
- const hasExportableContent = useAuiState(({ message }) => {
17
+ const hasExportableContent = useAuiState((s) => {
18
18
  return (
19
- (message.role !== "assistant" || message.status?.type !== "running") &&
20
- message.parts.some((c) => c.type === "text" && c.text.length > 0)
19
+ (s.message.role !== "assistant" ||
20
+ s.message.status?.type !== "running") &&
21
+ s.message.parts.some((c) => c.type === "text" && c.text.length > 0)
21
22
  );
22
23
  });
23
24
 
@@ -14,10 +14,11 @@ const useActionBarSpeak = () => {
14
14
  aui.message().speak();
15
15
  }, [aui]);
16
16
 
17
- const hasSpeakableContent = useAuiState(({ message }) => {
17
+ const hasSpeakableContent = useAuiState((s) => {
18
18
  return (
19
- (message.role !== "assistant" || message.status?.type !== "running") &&
20
- message.parts.some((c) => c.type === "text" && c.text.length > 0)
19
+ (s.message.role !== "assistant" ||
20
+ s.message.status?.type !== "running") &&
21
+ s.message.parts.some((c) => c.type === "text" && c.text.length > 0)
21
22
  );
22
23
  });
23
24
 
@@ -10,7 +10,7 @@ import { useAuiState, useAui } from "@assistant-ui/store";
10
10
 
11
11
  const useActionBarStopSpeaking = () => {
12
12
  const aui = useAui();
13
- const isSpeaking = useAuiState(({ message }) => message.speech != null);
13
+ const isSpeaking = useAuiState((s) => s.message.speech != null);
14
14
 
15
15
  const callback = useCallback(() => {
16
16
  aui.message().stopSpeaking();
@@ -19,22 +19,22 @@ export const useActionBarFloatStatus = ({
19
19
  autohide,
20
20
  autohideFloat,
21
21
  }: UseActionBarFloatStatusProps) => {
22
- return useAuiState(({ thread, message }) => {
23
- if (hideWhenRunning && thread.isRunning) return HideAndFloatStatus.Hidden;
22
+ return useAuiState((s) => {
23
+ if (hideWhenRunning && s.thread.isRunning) return HideAndFloatStatus.Hidden;
24
24
 
25
25
  const autohideEnabled =
26
- autohide === "always" || (autohide === "not-last" && !message.isLast);
26
+ autohide === "always" || (autohide === "not-last" && !s.message.isLast);
27
27
 
28
28
  // normal status
29
29
  if (!autohideEnabled) return HideAndFloatStatus.Normal;
30
30
 
31
31
  // hidden status
32
- if (!message.isHovering) return HideAndFloatStatus.Hidden;
32
+ if (!s.message.isHovering) return HideAndFloatStatus.Hidden;
33
33
 
34
34
  // floating status
35
35
  if (
36
36
  autohideFloat === "always" ||
37
- (autohideFloat === "single-branch" && message.branchCount <= 1)
37
+ (autohideFloat === "single-branch" && s.message.branchCount <= 1)
38
38
  )
39
39
  return HideAndFloatStatus.Floating;
40
40
 
@@ -10,7 +10,7 @@ export namespace AttachmentPrimitiveName {
10
10
  export const AttachmentPrimitiveName: FC<
11
11
  AttachmentPrimitiveName.Props
12
12
  > = () => {
13
- const name = useAuiState(({ attachment }) => attachment.name);
13
+ const name = useAuiState((s) => s.attachment.name);
14
14
  return <>{name}</>;
15
15
  };
16
16
 
@@ -15,8 +15,8 @@ export const AttachmentPrimitiveThumb = forwardRef<
15
15
  AttachmentPrimitiveThumb.Element,
16
16
  AttachmentPrimitiveThumb.Props
17
17
  >((props, ref) => {
18
- const ext = useAuiState(({ attachment }) => {
19
- const parts = attachment.name.split(".");
18
+ const ext = useAuiState((s) => {
19
+ const parts = s.attachment.name.split(".");
20
20
  return parts.length > 1 ? parts.pop()! : "";
21
21
  });
22
22
  return (
@@ -4,7 +4,7 @@ import type { FC } from "react";
4
4
  import { useAuiState } from "@assistant-ui/store";
5
5
 
6
6
  const useBranchPickerCount = () => {
7
- const branchCount = useAuiState(({ message }) => message.branchCount);
7
+ const branchCount = useAuiState((s) => s.message.branchCount);
8
8
  return branchCount;
9
9
  };
10
10
 
@@ -10,12 +10,12 @@ import { useAuiState, useAui } from "@assistant-ui/store";
10
10
 
11
11
  const useBranchPickerNext = () => {
12
12
  const aui = useAui();
13
- const disabled = useAuiState(({ thread, message }) => {
13
+ const disabled = useAuiState((s) => {
14
14
  // Disabled if no next branch
15
- if (message.branchNumber >= message.branchCount) return true;
15
+ if (s.message.branchNumber >= s.message.branchCount) return true;
16
16
 
17
17
  // Disabled if running and capability not supported
18
- if (thread.isRunning && !thread.capabilities.switchBranchDuringRun) {
18
+ if (s.thread.isRunning && !s.thread.capabilities.switchBranchDuringRun) {
19
19
  return true;
20
20
  }
21
21
 
@@ -4,7 +4,7 @@ import type { FC } from "react";
4
4
  import { useAuiState } from "@assistant-ui/store";
5
5
 
6
6
  const useBranchPickerNumber = () => {
7
- const branchNumber = useAuiState(({ message }) => message.branchNumber);
7
+ const branchNumber = useAuiState((s) => s.message.branchNumber);
8
8
  return branchNumber;
9
9
  };
10
10
 
@@ -31,12 +31,12 @@ import { useAuiState, useAui } from "@assistant-ui/store";
31
31
  */
32
32
  const useBranchPickerPrevious = () => {
33
33
  const aui = useAui();
34
- const disabled = useAuiState(({ thread, message }) => {
34
+ const disabled = useAuiState((s) => {
35
35
  // Disabled if no previous branch
36
- if (message.branchNumber <= 1) return true;
36
+ if (s.message.branchNumber <= 1) return true;
37
37
 
38
38
  // Disabled if running and capability not supported
39
- if (thread.isRunning && !thread.capabilities.switchBranchDuringRun) {
39
+ if (s.thread.isRunning && !s.thread.capabilities.switchBranchDuringRun) {
40
40
  return true;
41
41
  }
42
42
 
@@ -10,9 +10,7 @@ import { useAuiState, useAui } from "@assistant-ui/store";
10
10
 
11
11
  const useChainOfThoughtAccordionTrigger = () => {
12
12
  const aui = useAui();
13
- const collapsed = useAuiState(
14
- ({ chainOfThought }) => chainOfThought.collapsed,
15
- );
13
+ const collapsed = useAuiState((s) => s.chainOfThought.collapsed);
16
14
 
17
15
  const callback = useCallback(() => {
18
16
  aui.chainOfThought().setCollapsed(!collapsed);
@@ -1,6 +1,11 @@
1
1
  "use client";
2
2
 
3
- import { type FC, useMemo } from "react";
3
+ import {
4
+ type ComponentType,
5
+ type FC,
6
+ type PropsWithChildren,
7
+ useMemo,
8
+ } from "react";
4
9
  import { useAuiState } from "@assistant-ui/store";
5
10
  import { ChainOfThoughtPartByIndexProvider } from "../../context/providers/ChainOfThoughtPartByIndexProvider";
6
11
  import { MessagePartComponent } from "../message/MessageParts";
@@ -21,6 +26,8 @@ export namespace ChainOfThoughtPrimitiveParts {
21
26
  tools?: {
22
27
  Fallback?: ToolCallMessagePartComponent | undefined;
23
28
  };
29
+ /** Layout component to wrap the rendered parts when expanded */
30
+ Layout?: ComponentType<PropsWithChildren> | undefined;
24
31
  };
25
32
  };
26
33
  }
@@ -46,12 +53,7 @@ export namespace ChainOfThoughtPrimitiveParts {
46
53
  export const ChainOfThoughtPrimitiveParts: FC<
47
54
  ChainOfThoughtPrimitiveParts.Props
48
55
  > = ({ components }) => {
49
- const collapsed = useAuiState(
50
- ({ chainOfThought }) => chainOfThought.collapsed,
51
- );
52
- const partsLength = useAuiState(
53
- ({ chainOfThought }) => chainOfThought.parts.length,
54
- );
56
+ const partsLength = useAuiState((s) => s.chainOfThought.parts.length);
55
57
 
56
58
  const messageComponents = useMemo(
57
59
  () => ({
@@ -63,15 +65,21 @@ export const ChainOfThoughtPrimitiveParts: FC<
63
65
  [components?.Reasoning, components?.tools?.Fallback],
64
66
  );
65
67
 
66
- const elements = useMemo(() => {
67
- if (collapsed) return null;
68
+ const Layout = components?.Layout;
68
69
 
70
+ const elements = useMemo(() => {
69
71
  return Array.from({ length: partsLength }, (_, index) => (
70
72
  <ChainOfThoughtPartByIndexProvider key={index} index={index}>
71
- <MessagePartComponent components={messageComponents} />
73
+ {Layout ? (
74
+ <Layout>
75
+ <MessagePartComponent components={messageComponents} />
76
+ </Layout>
77
+ ) : (
78
+ <MessagePartComponent components={messageComponents} />
79
+ )}
72
80
  </ChainOfThoughtPartByIndexProvider>
73
81
  ));
74
- }, [collapsed, partsLength, messageComponents]);
82
+ }, [partsLength, messageComponents, Layout]);
75
83
 
76
84
  return <>{elements}</>;
77
85
  };
@@ -14,7 +14,7 @@ const useComposerAddAttachment = ({
14
14
  /** allow selecting multiple files */
15
15
  multiple?: boolean | undefined;
16
16
  } = {}) => {
17
- const disabled = useAuiState(({ composer }) => !composer.isEditing);
17
+ const disabled = useAuiState((s) => !s.composer.isEditing);
18
18
  const aui = useAui();
19
19
 
20
20
  const callback = useCallback(() => {
@@ -39,7 +39,7 @@ const getComponent = (
39
39
  const AttachmentComponent: FC<{
40
40
  components: ComposerPrimitiveAttachments.Props["components"];
41
41
  }> = ({ components }) => {
42
- const attachment = useAuiState(({ attachment }) => attachment);
42
+ const attachment = useAuiState((s) => s.attachment);
43
43
  if (!attachment) return null;
44
44
 
45
45
  const Component = getComponent(components, attachment);
@@ -10,7 +10,7 @@ import { useAuiState, useAui } from "@assistant-ui/store";
10
10
 
11
11
  const useComposerCancel = () => {
12
12
  const aui = useAui();
13
- const disabled = useAuiState(({ composer }) => !composer.canCancel);
13
+ const disabled = useAuiState((s) => !s.composer.canCancel);
14
14
 
15
15
  const callback = useCallback(() => {
16
16
  aui.composer().cancel();
@@ -11,10 +11,10 @@ import { createActionButton } from "../../utils/createActionButton";
11
11
  const useComposerDictate = () => {
12
12
  const aui = useAui();
13
13
  const disabled = useAuiState(
14
- ({ thread, composer }) =>
15
- composer.dictation != null ||
16
- !thread.capabilities.dictation ||
17
- !composer.isEditing,
14
+ (s) =>
15
+ s.composer.dictation != null ||
16
+ !s.thread.capabilities.dictation ||
17
+ !s.composer.isEditing,
18
18
  );
19
19
 
20
20
  const callback = useCallback(() => {
@@ -28,9 +28,7 @@ export const ComposerPrimitiveDictationTranscript = forwardRef<
28
28
  ComposerPrimitiveDictationTranscript.Element,
29
29
  ComposerPrimitiveDictationTranscript.Props
30
30
  >(({ children, ...props }, forwardRef) => {
31
- const transcript = useAuiState(
32
- ({ composer }) => composer.dictation?.transcript,
33
- );
31
+ const transcript = useAuiState((s) => s.composer.dictation?.transcript);
34
32
 
35
33
  if (!transcript) return null;
36
34
 
@@ -14,11 +14,11 @@ type ComposerIfFilters = {
14
14
  export type UseComposerIfProps = RequireAtLeastOne<ComposerIfFilters>;
15
15
 
16
16
  const useComposerIf = (props: UseComposerIfProps) => {
17
- return useAuiState(({ composer }) => {
18
- if (props.editing === true && !composer.isEditing) return false;
19
- if (props.editing === false && composer.isEditing) return false;
17
+ return useAuiState((s) => {
18
+ if (props.editing === true && !s.composer.isEditing) return false;
19
+ if (props.editing === false && s.composer.isEditing) return false;
20
20
 
21
- const isDictating = composer.dictation != null;
21
+ const isDictating = s.composer.dictation != null;
22
22
  if (props.dictation === true && !isDictating) return false;
23
23
  if (props.dictation === false && isDictating) return false;
24
24