@assistant-ui/react 0.15.30 → 0.15.31

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 (351) hide show
  1. package/dist/cloud-renderer/CloudRendererHost.d.ts.map +1 -1
  2. package/dist/cloud-renderer/CloudRendererHost.js +1 -2
  3. package/dist/cloud-renderer/CloudRendererHost.js.map +1 -1
  4. package/dist/context/providers/AttachmentByIndexProvider.js +1 -2
  5. package/dist/context/providers/ChainOfThoughtByIndicesProvider.js +1 -2
  6. package/dist/context/providers/MessageByIndexProvider.js +1 -2
  7. package/dist/context/providers/PartByIndexProvider.js +1 -2
  8. package/dist/context/providers/SuggestionByIndexProvider.js +1 -2
  9. package/dist/context/providers/TextMessagePartProvider.js +1 -2
  10. package/dist/context/providers/ThreadListItemProvider.js +1 -2
  11. package/dist/index.d.ts +9 -8
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +2 -9
  14. package/dist/internal.d.ts +1 -1
  15. package/dist/internal.d.ts.map +1 -1
  16. package/dist/internal.js +1 -1
  17. package/dist/internal.js.map +1 -1
  18. package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts +1 -1
  19. package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts.map +1 -1
  20. package/dist/legacy-runtime/AssistantRuntimeProvider.js.map +1 -1
  21. package/dist/primitives/actionBar/ActionBarCopy.d.ts +1 -1
  22. package/dist/primitives/actionBar/ActionBarEdit.d.ts +1 -1
  23. package/dist/primitives/actionBar/ActionBarExportMarkdown.d.ts +1 -1
  24. package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts +1 -1
  25. package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts +1 -1
  26. package/dist/primitives/actionBar/ActionBarReload.d.ts +1 -1
  27. package/dist/primitives/actionBar/ActionBarRoot.d.ts +1 -1
  28. package/dist/primitives/actionBar/ActionBarSpeak.d.ts +1 -1
  29. package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts +1 -1
  30. package/dist/primitives/attachment/AttachmentRemove.d.ts +1 -1
  31. package/dist/primitives/attachment/AttachmentRoot.d.ts +1 -1
  32. package/dist/primitives/attachment/AttachmentThumb.d.ts +1 -1
  33. package/dist/primitives/branchPicker/BranchPickerNext.d.ts +1 -1
  34. package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts +1 -1
  35. package/dist/primitives/branchPicker/BranchPickerRoot.d.ts +1 -1
  36. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts +1 -1
  37. package/dist/primitives/chainOfThought/ChainOfThoughtParts.js +1 -2
  38. package/dist/primitives/chainOfThought/ChainOfThoughtRoot.d.ts +1 -1
  39. package/dist/primitives/composer/ComposerAddAttachment.d.ts +1 -1
  40. package/dist/primitives/composer/ComposerAttachments.js +1 -2
  41. package/dist/primitives/composer/ComposerCancel.d.ts +1 -1
  42. package/dist/primitives/composer/ComposerDictate.d.ts +1 -1
  43. package/dist/primitives/composer/ComposerDictationTranscript.d.ts +1 -1
  44. package/dist/primitives/composer/ComposerIf.js +1 -2
  45. package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
  46. package/dist/primitives/composer/ComposerInput.js +3 -3
  47. package/dist/primitives/composer/ComposerInput.js.map +1 -1
  48. package/dist/primitives/composer/ComposerQueue.js +1 -2
  49. package/dist/primitives/composer/ComposerQuote.d.ts +3 -3
  50. package/dist/primitives/composer/ComposerResume.d.ts +1 -1
  51. package/dist/primitives/composer/ComposerRoot.d.ts +1 -1
  52. package/dist/primitives/composer/ComposerSend.d.ts +1 -1
  53. package/dist/primitives/composer/ComposerStopDictation.d.ts +1 -1
  54. package/dist/primitives/composer/trigger/TriggerPopover.d.ts +1 -1
  55. package/dist/primitives/composer/trigger/TriggerPopoverBack.d.ts +1 -1
  56. package/dist/primitives/composer/trigger/TriggerPopoverCategories.d.ts +2 -2
  57. package/dist/primitives/composer/trigger/TriggerPopoverItems.d.ts +2 -2
  58. package/dist/primitives/composer/trigger/index.d.ts +1 -1
  59. package/dist/primitives/composer/trigger/triggerSelectionResource.d.ts.map +1 -1
  60. package/dist/primitives/composer/trigger/triggerSelectionResource.js +2 -2
  61. package/dist/primitives/composer/trigger/triggerSelectionResource.js.map +1 -1
  62. package/dist/primitives/error/ErrorMessage.d.ts +1 -1
  63. package/dist/primitives/error/ErrorRoot.d.ts +1 -1
  64. package/dist/primitives/message/MessageAttachments.js +1 -2
  65. package/dist/primitives/message/MessageRoot.d.ts +1 -1
  66. package/dist/primitives/messagePart/MessagePartImage.d.ts +1 -1
  67. package/dist/primitives/messagePart/MessagePartInProgress.js +1 -2
  68. package/dist/primitives/messagePart/MessagePartText.d.ts +1 -1
  69. package/dist/primitives/queueItem/QueueItemRemove.d.ts +1 -1
  70. package/dist/primitives/queueItem/QueueItemSteer.d.ts +1 -1
  71. package/dist/primitives/queueItem/QueueItemText.d.ts +1 -1
  72. package/dist/primitives/selectionToolbar/SelectionToolbarQuote.d.ts +1 -1
  73. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.d.ts +1 -1
  74. package/dist/primitives/suggestion/SuggestionDescription.d.ts +1 -1
  75. package/dist/primitives/suggestion/SuggestionTitle.d.ts +1 -1
  76. package/dist/primitives/suggestion/SuggestionTrigger.d.ts +1 -1
  77. package/dist/primitives/thread/ThreadLoadEarlier.d.ts +1 -1
  78. package/dist/primitives/thread/ThreadMessages.js +1 -2
  79. package/dist/primitives/thread/ThreadRoot.d.ts +1 -1
  80. package/dist/primitives/thread/ThreadScrollToBottom.d.ts +1 -1
  81. package/dist/primitives/thread/ThreadSuggestion.d.ts +1 -1
  82. package/dist/primitives/thread/ThreadSuggestions.js +1 -2
  83. package/dist/primitives/thread/ThreadViewport.d.ts +1 -1
  84. package/dist/primitives/thread/ThreadViewportFooter.d.ts +1 -1
  85. package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts.map +1 -1
  86. package/dist/primitives/thread/useThreadViewportAutoScroll.js +6 -3
  87. package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
  88. package/dist/primitives/threadList/ThreadListItems.js +1 -2
  89. package/dist/primitives/threadList/ThreadListLoadMore.d.ts +1 -1
  90. package/dist/primitives/threadList/ThreadListNew.d.ts +1 -1
  91. package/dist/primitives/threadList/ThreadListRoot.d.ts +1 -1
  92. package/dist/primitives/threadListFocusGroup.d.ts +1 -1
  93. package/dist/primitives/threadListFocusGroup.d.ts.map +1 -1
  94. package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts +1 -1
  95. package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts +1 -1
  96. package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts +1 -1
  97. package/dist/primitives/threadListItem/ThreadListItemTitle.js +1 -2
  98. package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts +1 -1
  99. package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts +2 -2
  100. package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts.map +1 -1
  101. package/dist/primitives/threadListItem/ThreadListItemUnarchive.js +2 -2
  102. package/dist/primitives/threadListItem/ThreadListItemUnarchive.js.map +1 -1
  103. package/dist/unstable/useComposerInput.js +1 -1
  104. package/dist/unstable/useComposerInput.js.map +1 -1
  105. package/dist/unstable/useComposerInputHistory.d.ts.map +1 -1
  106. package/dist/unstable/useComposerInputHistory.js +2 -2
  107. package/dist/unstable/useComposerInputHistory.js.map +1 -1
  108. package/dist/unstable/useLiveCompletionAdapter.d.ts.map +1 -1
  109. package/dist/unstable/useLiveCompletionAdapter.js +3 -2
  110. package/dist/unstable/useLiveCompletionAdapter.js.map +1 -1
  111. package/dist/utils/Primitive.d.ts +17 -17
  112. package/dist/utils/createActionButton.d.ts +1 -1
  113. package/package.json +12 -12
  114. package/src/adapters/OpenAIRealtimeVoiceAdapter.test.ts +14 -1
  115. package/src/cloud-renderer/CloudRendererHost.tsx +4 -2
  116. package/src/index.ts +9 -8
  117. package/src/internal.ts +1 -1
  118. package/src/legacy-runtime/AssistantRuntimeProvider.tsx +1 -1
  119. package/src/primitives/actionBar/ActionBarCopy.test.tsx +57 -0
  120. package/src/primitives/actionBar/ActionBarExportMarkdown.test.tsx +24 -5
  121. package/src/primitives/assistantModal/AssistantModalRoot.test.tsx +1 -1
  122. package/src/primitives/composer/ComposerInput.focus-on-run-start.test.tsx +1 -1
  123. package/src/primitives/composer/ComposerInput.test.tsx +1 -0
  124. package/src/primitives/composer/ComposerInput.text-change.test.tsx +68 -0
  125. package/src/primitives/composer/ComposerInput.thread-scope.test.tsx +82 -0
  126. package/src/primitives/composer/ComposerInput.tsx +4 -3
  127. package/src/primitives/composer/trigger/triggerSelectionResource.test.ts +6 -4
  128. package/src/primitives/composer/trigger/triggerSelectionResource.ts +2 -0
  129. package/src/primitives/thread/ThreadRoot.test.tsx +1 -1
  130. package/src/primitives/thread/ThreadViewport.thread-scope.test.tsx +51 -0
  131. package/src/primitives/thread/useThreadViewportAutoScroll.ts +8 -2
  132. package/src/primitives/threadListItem/ThreadListItemUnarchive.test.tsx +52 -0
  133. package/src/primitives/threadListItem/ThreadListItemUnarchive.ts +2 -2
  134. package/src/tests/DataRenderers.test.tsx +1 -1
  135. package/src/tests/MessageParts.loading.test.tsx +1 -1
  136. package/src/tests/RemoteThreadListRuntime.adapterProvider.test.tsx +1 -1
  137. package/src/tests/RemoteThreadListRuntime.deferredProvider.test.tsx +4 -2
  138. package/src/tests/RemoteThreadListRuntime.reloadMainThread.test.tsx +4 -2
  139. package/src/tests/generative-ui.primitive.test.tsx +1 -1
  140. package/src/tests/local-runtime-queue.test.tsx +2 -2
  141. package/src/tests/messagePartSwitchRace.test.tsx +2 -2
  142. package/src/tests/messagePartTypeMismatch.test.tsx +1 -1
  143. package/src/tests/threadListItemIsRunning.test.tsx +5 -3
  144. package/src/tests/toolCallTiming.test.tsx +1 -1
  145. package/src/unstable/useComposerInput.test.tsx +1 -1
  146. package/src/unstable/useComposerInput.ts +1 -1
  147. package/src/unstable/useComposerInputHistory.test.tsx +10 -7
  148. package/src/unstable/useComposerInputHistory.thread-scope.test.tsx +123 -0
  149. package/src/unstable/useComposerInputHistory.ts +3 -2
  150. package/src/unstable/useLiveCompletionAdapter.test.tsx +44 -0
  151. package/src/unstable/useLiveCompletionAdapter.ts +3 -2
  152. package/src/unstable/webmcp/convertTools.test.ts +11 -1
  153. package/src/utils/hooks/useMediaQuery.test.tsx +35 -0
  154. package/src/utils/smooth/useSmooth.test.tsx +37 -10
  155. package/dist/context/providers/ChainOfThoughtPartByIndexProvider.d.ts +0 -2
  156. package/dist/context/providers/ChainOfThoughtPartByIndexProvider.d.ts.map +0 -1
  157. package/dist/context/providers/ChainOfThoughtPartByIndexProvider.js +0 -3
  158. package/dist/legacy-runtime/RuntimeAdapter.d.ts +0 -2
  159. package/dist/legacy-runtime/RuntimeAdapter.d.ts.map +0 -1
  160. package/dist/legacy-runtime/RuntimeAdapter.js +0 -2
  161. package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts +0 -2
  162. package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +0 -1
  163. package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js +0 -3
  164. package/dist/legacy-runtime/runtime/AssistantRuntime.d.ts +0 -3
  165. package/dist/legacy-runtime/runtime/AssistantRuntime.d.ts.map +0 -1
  166. package/dist/legacy-runtime/runtime/AssistantRuntime.js +0 -2
  167. package/dist/legacy-runtime/runtime/AttachmentRuntime.d.ts +0 -3
  168. package/dist/legacy-runtime/runtime/AttachmentRuntime.d.ts.map +0 -1
  169. package/dist/legacy-runtime/runtime/AttachmentRuntime.js +0 -2
  170. package/dist/legacy-runtime/runtime/ComposerRuntime.d.ts +0 -4
  171. package/dist/legacy-runtime/runtime/ComposerRuntime.d.ts.map +0 -1
  172. package/dist/legacy-runtime/runtime/ComposerRuntime.js +0 -2
  173. package/dist/legacy-runtime/runtime/RuntimeBindings.d.ts +0 -3
  174. package/dist/legacy-runtime/runtime/RuntimeBindings.d.ts.map +0 -1
  175. package/dist/legacy-runtime/runtime/RuntimeBindings.js +0 -0
  176. package/dist/legacy-runtime/runtime/RuntimePathTypes.d.ts +0 -2
  177. package/dist/legacy-runtime/runtime/RuntimePathTypes.d.ts.map +0 -1
  178. package/dist/legacy-runtime/runtime/RuntimePathTypes.js +0 -0
  179. package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts +0 -5
  180. package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts.map +0 -1
  181. package/dist/legacy-runtime/runtime/ThreadListItemRuntime.js +0 -2
  182. package/dist/legacy-runtime/runtime/ThreadRuntime.d.ts +0 -4
  183. package/dist/legacy-runtime/runtime/ThreadRuntime.d.ts.map +0 -1
  184. package/dist/legacy-runtime/runtime/ThreadRuntime.js +0 -2
  185. package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts +0 -2
  186. package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts.map +0 -1
  187. package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.js +0 -3
  188. package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts +0 -2
  189. package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts.map +0 -1
  190. package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.js +0 -3
  191. package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.d.ts +0 -2
  192. package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.d.ts.map +0 -1
  193. package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.js +0 -2
  194. package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.d.ts +0 -2
  195. package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.d.ts.map +0 -1
  196. package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.js +0 -2
  197. package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.d.ts +0 -2
  198. package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.d.ts.map +0 -1
  199. package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.js +0 -2
  200. package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.d.ts +0 -2
  201. package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.d.ts.map +0 -1
  202. package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.js +0 -0
  203. package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.d.ts +0 -2
  204. package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.d.ts.map +0 -1
  205. package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.js +0 -2
  206. package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.d.ts +0 -2
  207. package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.d.ts.map +0 -1
  208. package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.js +0 -2
  209. package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts +0 -2
  210. package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts.map +0 -1
  211. package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.js +0 -0
  212. package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.d.ts +0 -2
  213. package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.d.ts.map +0 -1
  214. package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.js +0 -0
  215. package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts +0 -2
  216. package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts.map +0 -1
  217. package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.js +0 -0
  218. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.d.ts +0 -2
  219. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.d.ts.map +0 -1
  220. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.js +0 -0
  221. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.d.ts +0 -2
  222. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.d.ts.map +0 -1
  223. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.js +0 -2
  224. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.d.ts +0 -3
  225. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.d.ts.map +0 -1
  226. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.js +0 -2
  227. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.d.ts +0 -2
  228. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.d.ts.map +0 -1
  229. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.js +0 -2
  230. package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.d.ts +0 -3
  231. package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.d.ts.map +0 -1
  232. package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.js +0 -2
  233. package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.d.ts +0 -3
  234. package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.d.ts.map +0 -1
  235. package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.js +0 -2
  236. package/dist/legacy-runtime/runtime-cores/external-store/auto-status.d.ts +0 -2
  237. package/dist/legacy-runtime/runtime-cores/external-store/auto-status.d.ts.map +0 -1
  238. package/dist/legacy-runtime/runtime-cores/external-store/auto-status.js +0 -2
  239. package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts +0 -2
  240. package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts.map +0 -1
  241. package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js +0 -3
  242. package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts +0 -2
  243. package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts.map +0 -1
  244. package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.js +0 -3
  245. package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.d.ts +0 -2
  246. package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.d.ts.map +0 -1
  247. package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.js +0 -3
  248. package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.d.ts +0 -2
  249. package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.d.ts.map +0 -1
  250. package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.js +0 -0
  251. package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.d.ts +0 -2
  252. package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.d.ts.map +0 -1
  253. package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.js +0 -2
  254. package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts +0 -4
  255. package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts.map +0 -1
  256. package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.js +0 -2
  257. package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.d.ts +0 -3
  258. package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.d.ts.map +0 -1
  259. package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.js +0 -2
  260. package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.d.ts +0 -2
  261. package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.d.ts.map +0 -1
  262. package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.js +0 -2
  263. package/dist/legacy-runtime/runtime-cores/local/shouldContinue.d.ts +0 -2
  264. package/dist/legacy-runtime/runtime-cores/local/shouldContinue.d.ts.map +0 -1
  265. package/dist/legacy-runtime/runtime-cores/local/shouldContinue.js +0 -2
  266. package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts +0 -2
  267. package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts.map +0 -1
  268. package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.js +0 -3
  269. package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.d.ts +0 -2
  270. package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.d.ts.map +0 -1
  271. package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.js +0 -2
  272. package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.d.ts +0 -2
  273. package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.d.ts.map +0 -1
  274. package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.js +0 -2
  275. package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.d.ts +0 -2
  276. package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.d.ts.map +0 -1
  277. package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.js +0 -2
  278. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts +0 -2
  279. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts.map +0 -1
  280. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js +0 -3
  281. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts +0 -2
  282. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts.map +0 -1
  283. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js +0 -3
  284. package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts +0 -2
  285. package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts.map +0 -1
  286. package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.js +0 -3
  287. package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.d.ts +0 -2
  288. package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.d.ts.map +0 -1
  289. package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.js +0 -2
  290. package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.d.ts +0 -2
  291. package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.d.ts.map +0 -1
  292. package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.js +0 -0
  293. package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.d.ts +0 -2
  294. package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.d.ts.map +0 -1
  295. package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js +0 -3
  296. package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.d.ts +0 -4
  297. package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.d.ts.map +0 -1
  298. package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.js +0 -3
  299. package/dist/utils/hooks/useOnResizeContent.d.ts +0 -2
  300. package/dist/utils/hooks/useOnResizeContent.d.ts.map +0 -1
  301. package/dist/utils/hooks/useOnResizeContent.js +0 -21
  302. package/dist/utils/hooks/useOnResizeContent.js.map +0 -1
  303. package/src/context/providers/ChainOfThoughtPartByIndexProvider.tsx +0 -3
  304. package/src/legacy-runtime/RuntimeAdapter.ts +0 -1
  305. package/src/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.ts +0 -3
  306. package/src/legacy-runtime/runtime/AssistantRuntime.ts +0 -2
  307. package/src/legacy-runtime/runtime/AttachmentRuntime.ts +0 -7
  308. package/src/legacy-runtime/runtime/ComposerRuntime.ts +0 -20
  309. package/src/legacy-runtime/runtime/RuntimeBindings.ts +0 -12
  310. package/src/legacy-runtime/runtime/RuntimePathTypes.ts +0 -8
  311. package/src/legacy-runtime/runtime/ThreadListItemRuntime.ts +0 -10
  312. package/src/legacy-runtime/runtime/ThreadRuntime.ts +0 -14
  313. package/src/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.tsx +0 -7
  314. package/src/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.ts +0 -3
  315. package/src/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.ts +0 -1
  316. package/src/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.ts +0 -1
  317. package/src/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.ts +0 -1
  318. package/src/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.ts +0 -1
  319. package/src/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.ts +0 -1
  320. package/src/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.ts +0 -1
  321. package/src/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.ts +0 -6
  322. package/src/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.ts +0 -4
  323. package/src/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.ts +0 -13
  324. package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.ts +0 -6
  325. package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.ts +0 -1
  326. package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.ts +0 -2
  327. package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.ts +0 -4
  328. package/src/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.ts +0 -2
  329. package/src/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.ts +0 -2
  330. package/src/legacy-runtime/runtime-cores/external-store/auto-status.ts +0 -1
  331. package/src/legacy-runtime/runtime-cores/external-store/createMessageConverter.ts +0 -2
  332. package/src/legacy-runtime/runtime-cores/external-store/external-message-converter.ts +0 -7
  333. package/src/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.ts +0 -3
  334. package/src/legacy-runtime/runtime-cores/local/ChatModelAdapter.ts +0 -7
  335. package/src/legacy-runtime/runtime-cores/local/LocalRuntimeCore.ts +0 -1
  336. package/src/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.ts +0 -3
  337. package/src/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.ts +0 -2
  338. package/src/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.ts +0 -1
  339. package/src/legacy-runtime/runtime-cores/local/shouldContinue.ts +0 -1
  340. package/src/legacy-runtime/runtime-cores/local/useLocalRuntime.ts +0 -3
  341. package/src/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.ts +0 -1
  342. package/src/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.ts +0 -1
  343. package/src/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.ts +0 -1
  344. package/src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.tsx +0 -3
  345. package/src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.tsx +0 -3
  346. package/src/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.tsx +0 -3
  347. package/src/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.ts +0 -1
  348. package/src/legacy-runtime/runtime-cores/remote-thread-list/types.ts +0 -7
  349. package/src/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.ts +0 -3
  350. package/src/legacy-runtime/runtime-cores/utils/MessageRepository.ts +0 -3
  351. package/src/utils/hooks/useOnResizeContent.ts +0 -15
@@ -26,7 +26,7 @@ export declare namespace ComposerPrimitiveCancel {
26
26
  * ```
27
27
  */
28
28
  export declare const ComposerPrimitiveCancel: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
29
- asChild?: boolean;
29
+ asChild?: boolean | undefined;
30
30
  }, "ref"> & {
31
31
  render?: import("react").ReactElement | undefined;
32
32
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -17,7 +17,7 @@ export declare namespace ComposerPrimitiveDictate {
17
17
  * ```
18
18
  */
19
19
  export declare const ComposerPrimitiveDictate: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
20
- asChild?: boolean;
20
+ asChild?: boolean | undefined;
21
21
  }, "ref"> & {
22
22
  render?: import("react").ReactElement | undefined;
23
23
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -20,7 +20,7 @@ export declare namespace ComposerPrimitiveDictationTranscript {
20
20
  * ```
21
21
  */
22
22
  export declare const ComposerPrimitiveDictationTranscript: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
23
- asChild?: boolean;
23
+ asChild?: boolean | undefined;
24
24
  }, "ref"> & {
25
25
  render?: import("react").ReactElement | undefined;
26
26
  } & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { ComposerPrimitiveIf } from "@assistant-ui/core/react";
3
- export { ComposerPrimitiveIf };
2
+ export { ComposerPrimitiveIf } from "@assistant-ui/core/react";
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerInput.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,YAAY,EAOlB,MAAM,OAAO,CAAC;AACf,OAAyB,EACvB,KAAK,qBAAqB,EAE3B,MAAM,yBAAyB,CAAC;AAoBjC,yBAAiB,sBAAsB,CAAC;IACtC,MAAM,MAAM,OAAO,GAAG,mBAAmB,CAAC;IAE1C,KAAK,SAAS,GAAG;QACf;;;WAGG;QACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC9B;;WAEG;QACH,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;QAClC;;;;;WAKG;QACH,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrC;;;;;;;;;WASG;QACH,wBAAwB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC/C;;;;;;WAMG;QACH,8BAA8B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrD;;;;;;WAMG;QACH,8BAA8B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrD;;;;;;;;;WASG;QACH,kCAAkC,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACzD;;;WAGG;QACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAC5C,CAAC;IAEF,KAAK,eAAe,GAChB;QACE;;;;;;WAMG;QACH,UAAU,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;QACxD;;;WAGG;QACH,aAAa,CAAC,EAAE,KAAK,CAAC;KACvB,GACD;QACE,UAAU,CAAC,EAAE,KAAK,CAAC;QACnB;;;;WAIG;QACH,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KACrC,CAAC;IAEN,MAAM,MAAM,KAAK,GAAG,qBAAqB,GAAG,SAAS,GAAG,eAAe,CAAC;;CACzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,sBAAsB,8HA0UlC,CAAC"}
1
+ {"version":3,"file":"ComposerInput.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,YAAY,EAOlB,MAAM,OAAO,CAAC;AACf,OAAyB,EACvB,KAAK,qBAAqB,EAE3B,MAAM,yBAAyB,CAAC;AAoBjC,yBAAiB,sBAAsB,CAAC;IACtC,MAAM,MAAM,OAAO,GAAG,mBAAmB,CAAC;IAE1C,KAAK,SAAS,GAAG;QACf;;;WAGG;QACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC9B;;WAEG;QACH,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;QAClC;;;;;WAKG;QACH,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrC;;;;;;;;;WASG;QACH,wBAAwB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC/C;;;;;;WAMG;QACH,8BAA8B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrD;;;;;;WAMG;QACH,8BAA8B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrD;;;;;;;;;WASG;QACH,kCAAkC,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACzD;;;WAGG;QACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAC5C,CAAC;IAEF,KAAK,eAAe,GAChB;QACE;;;;;;WAMG;QACH,UAAU,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;QACxD;;;WAGG;QACH,aAAa,CAAC,EAAE,KAAK,CAAC;KACvB,GACD;QACE,UAAU,CAAC,EAAE,KAAK,CAAC;QACnB;;;;WAIG;QACH,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KACrC,CAAC;IAEN,MAAM,MAAM,KAAK,GAAG,qBAAqB,GAAG,SAAS,GAAG,eAAe,CAAC;;CACzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,sBAAsB,8HA2UlC,CAAC"}
@@ -155,7 +155,7 @@ const ComposerPrimitiveInput = forwardRef(({ autoFocus = false, asChild, render,
155
155
  aui
156
156
  ]);
157
157
  useEffect(() => {
158
- if (aui.composer.getState().type !== "thread" || !unstable_focusOnThreadSwitched) return void 0;
158
+ if (aui.composer.getState().type !== "thread" || !unstable_focusOnThreadSwitched || !aui.optional.threads) return void 0;
159
159
  return aui.on("threads.selectionChanged", focus);
160
160
  }, [
161
161
  unstable_focusOnThreadSwitched,
@@ -179,7 +179,7 @@ const ComposerPrimitiveInput = forwardRef(({ autoFocus = false, asChild, render,
179
179
  if (compositionRef.current && !nativeIsComposing) compositionRef.current = false;
180
180
  const isComposing = nativeIsComposing || compositionRef.current;
181
181
  flushTapSync(() => {
182
- aui.composer.setText(e_2.target.value);
182
+ aui.composer.setText(e_2.target.value, { origin: "user" });
183
183
  });
184
184
  if (isComposing) return;
185
185
  const pos = e_2.target.selectionStart ?? e_2.target.value.length;
@@ -194,7 +194,7 @@ const ComposerPrimitiveInput = forwardRef(({ autoFocus = false, asChild, render,
194
194
  if (!aui.composer.getState().isEditing) return;
195
195
  const target = e_3.target;
196
196
  flushTapSync(() => {
197
- aui.composer.setText(target.value);
197
+ aui.composer.setText(target.value, { origin: "user" });
198
198
  });
199
199
  const pos_0 = target.selectionStart ?? target.value.length;
200
200
  if (pluginRegistry) for (const plugin_2 of pluginRegistry.getPlugins()) plugin_2.setCursorPosition(pos_0);
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerInput.js","names":["composeEventHandlers","useComposedRefs","Slot","ClipboardEvent","KeyboardEvent","ReactElement","ReactNode","forwardRef","useCallback","useEffect","useRef","isValidElement","TextareaAutosize","TextareaAutosizeProps","TextareaHeightChangeMeta","useEscapeKeydown","useOnScrollToBottom","useMediaQuery","renderSlot","isCompositionKey","useAui","flushTapSync","useComposerInputPluginRegistryOptional","useComposerCompactContextOptional","useComposerCancelWithFocus","useThreadRootElementRef","useComposerInputDisabled","useComposerInputValue","useTriggerPopoverAriaProps","TOUCH_PRIMARY_QUERY","ComposerPrimitiveInput","Element","HTMLTextAreaElement","BaseProps","asChild","render","cancelOnEscape","unstable_focusOnRunStart","unstable_focusOnScrollToBottom","unstable_focusOnThreadSwitched","unstable_insertNewlineOnTouchEnter","addAttachmentOnPaste","SubmitModeProps","submitMode","submitOnEnter","Props","autoFocus","disabled","disabledProp","onChange","onKeyDown","onPaste","onSelect","onHeightChange","rest","forwardedRef","aui","threadRootRef","pluginRegistry","compactContext","declaredSubmitMode","isTouchPrimary","effectiveSubmitMode","value","isDisabled","textareaRef","cancel","composer","ref","compositionRef","e","current","contains","target","Node","plugin","getPlugins","handleKeyDown","getState","canCancel","preventDefault","handleKeyPress","nativeEvent","key","threadState","thread","hasQueue","capabilities","queue","shiftKey","ctrlKey","metaKey","canSend","send","steer","isRunning","voice","undefined","shouldSubmit","closest","requestSubmit","handlePaste","threadCapabilities","files","Array","from","clipboardData","attachments","length","Promise","all","map","file","addAttachment","handleHeightChange","height","meta","el","cs","getComputedStyle","contentHeight","boxSizing","parseFloat","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","Math","round","rowHeight","setMultiline","autoFocusEnabled","focus","textarea","preventScroll","setSelectionRange","focusOnRunStart","doc","ownerDocument","active","activeElement","root","composerRoot","body","type","on","ariaComboboxProps","inputProps","name","const","React","ForwardedRef","ChangeEvent","isEditing","nativeIsComposing","isComposing","setText","pos","selectionStart","setCursorPosition","onCompositionStart","CompositionEventHandler","onCompositionEnd","CompositionEvent","SyntheticEvent","children","Component","Root","displayName"],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"radix-ui/internal\";\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport { Slot } from \"radix-ui\";\nimport {\n type ClipboardEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n isValidElement,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n type TextareaHeightChangeMeta,\n} from \"react-textarea-autosize\";\nimport { useEscapeKeydown } from \"radix-ui/internal\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useMediaQuery } from \"../../utils/hooks/useMediaQuery\";\nimport { renderSlot } from \"../../utils/Primitive\";\nimport { isCompositionKey } from \"../../utils/isCompositionKey\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { flushTapSync } from \"@assistant-ui/tap\";\nimport { useComposerInputPluginRegistryOptional } from \"./ComposerInputPluginContext\";\nimport { useComposerCompactContextOptional } from \"./ComposerCompactContext\";\nimport { useComposerCancelWithFocus } from \"./useComposerCancelWithFocus\";\nimport { useThreadRootElementRef } from \"../thread/ThreadRootElementContext\";\nimport {\n useComposerInputDisabled,\n useComposerInputValue,\n useTriggerPopoverAriaProps,\n} from \"./useComposerInputState\";\n\nconst TOUCH_PRIMARY_QUERY = \"(pointer: coarse) and (not (any-pointer: fine))\";\n\nexport namespace ComposerPrimitiveInput {\n export type Element = HTMLTextAreaElement;\n\n type BaseProps = {\n /**\n * Whether to render as a child component using Slot.\n * When true, the component will merge its props with its child.\n */\n asChild?: boolean | undefined;\n /**\n * A React element to use as the input container, with props merged in.\n */\n render?: ReactElement | undefined;\n /**\n * Whether to cancel message composition when Escape is pressed.\n * After cancelling an edit, focus returns to the main thread composer when\n * available, unless a handler has moved focus elsewhere.\n * @default true\n */\n cancelOnEscape?: boolean | undefined;\n /**\n * Whether to focus the input when a new run starts if nothing is focused\n * or focus is already inside the same thread or composer. Keeps the current\n * selection when the input is already focused. Applies when `autoFocus` is\n * enabled.\n *\n * @deprecated Experimental since 2024-10-12. Not scheduled for removal; the API may change in any release.\n *\n * @default true\n */\n unstable_focusOnRunStart?: boolean | undefined;\n /**\n * Whether to automatically focus the input when scrolling to bottom.\n *\n * @deprecated Experimental since 2024-10-12. Not scheduled for removal; the API may change in any release.\n *\n * @default true\n */\n unstable_focusOnScrollToBottom?: boolean | undefined;\n /**\n * Whether to automatically focus the input when switching threads.\n *\n * @deprecated Experimental since 2024-10-12. Not scheduled for removal; the API may change in any release.\n *\n * @default true\n */\n unstable_focusOnThreadSwitched?: boolean | undefined;\n /**\n * Whether plain Enter on a touch-primary device should insert a newline\n * instead of submitting, detected via\n * `(pointer: coarse) and (not (any-pointer: fine))`. Only takes effect\n * when `submitMode` resolves to `\"enter\"`.\n *\n * @deprecated Experimental since 2026-05-24. Not scheduled for removal; the API may change in any release.\n *\n * @default false\n */\n unstable_insertNewlineOnTouchEnter?: boolean | undefined;\n /**\n * Whether to automatically add pasted files as attachments.\n * @default true\n */\n addAttachmentOnPaste?: boolean | undefined;\n };\n\n type SubmitModeProps =\n | {\n /**\n * Controls how the Enter key submits messages.\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"ctrlEnter\": Ctrl/Cmd+Enter submits (plain Enter for newline)\n * - \"none\": Keyboard submission disabled\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"ctrlEnter\" | \"none\" | undefined;\n /**\n * @deprecated Use `submitMode` instead\n * @ignore\n */\n submitOnEnter?: never;\n }\n | {\n submitMode?: never;\n /**\n * Whether to submit the message when Enter is pressed (without Shift).\n * @default true\n * @deprecated Use `submitMode` instead. Will be removed in a future version.\n */\n submitOnEnter?: boolean | undefined;\n };\n\n export type Props = TextareaAutosizeProps & BaseProps & SubmitModeProps;\n}\n\n/**\n * A text input component for composing messages.\n *\n * This component provides a rich text input experience with automatic resizing,\n * keyboard shortcuts, file paste support, and intelligent focus management.\n * It integrates with the composer context to manage message state and submission.\n *\n * When rendered inside `TriggerPopoverRoot` and a popover is open, the\n * underlying `<textarea>` automatically receives `aria-controls`,\n * `aria-expanded`, `aria-haspopup`, and `aria-activedescendant` for the\n * combobox relationship. These computed attributes override user-provided\n * values for those four ARIA props while the popover is open.\n *\n * @example\n * ```tsx\n * // Ctrl/Cmd+Enter to submit (plain Enter inserts newline)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitMode=\"ctrlEnter\"\n * />\n *\n * // Insert a newline on Enter on touch-primary devices.\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * unstable_insertNewlineOnTouchEnter\n * />\n *\n * // Old API (deprecated, still supported)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitOnEnter={true}\n * />\n * ```\n */\nexport const ComposerPrimitiveInput = forwardRef<\n ComposerPrimitiveInput.Element,\n ComposerPrimitiveInput.Props\n>(\n (\n {\n autoFocus = false,\n asChild,\n render,\n disabled: disabledProp,\n onChange,\n onKeyDown,\n onPaste,\n onSelect,\n submitOnEnter,\n submitMode,\n cancelOnEscape = true,\n unstable_focusOnRunStart = true,\n unstable_focusOnScrollToBottom = true,\n unstable_focusOnThreadSwitched = true,\n unstable_insertNewlineOnTouchEnter = false,\n addAttachmentOnPaste = true,\n onHeightChange,\n ...rest\n },\n forwardedRef,\n ) => {\n const aui = useAui();\n const threadRootRef = useThreadRootElementRef();\n const pluginRegistry = useComposerInputPluginRegistryOptional();\n const compactContext = useComposerCompactContextOptional();\n\n const declaredSubmitMode =\n submitMode ?? (submitOnEnter === false ? \"none\" : \"enter\");\n const isTouchPrimary = useMediaQuery(\n unstable_insertNewlineOnTouchEnter ? TOUCH_PRIMARY_QUERY : null,\n );\n const effectiveSubmitMode =\n unstable_insertNewlineOnTouchEnter &&\n isTouchPrimary &&\n declaredSubmitMode === \"enter\"\n ? \"none\"\n : declaredSubmitMode;\n\n const value = useComposerInputValue();\n const isDisabled = useComposerInputDisabled(disabledProp);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const cancel = useComposerCancelWithFocus(\n useCallback(() => aui.composer.cancel(), [aui]),\n );\n const ref = useComposedRefs(forwardedRef, textareaRef);\n // suppress text/cursor broadcasts during IME composition\n const compositionRef = useRef(false);\n\n useEscapeKeydown((e) => {\n // Only handle ESC if it originated from within this input\n if (!textareaRef.current?.contains(e.target as Node)) return;\n\n // ignore IME composition events\n if (isCompositionKey(e)) return;\n\n // Let registered plugins (mention, slash command, etc.) handle Escape first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (!cancelOnEscape) return;\n\n const composer = aui.composer;\n if (composer.getState().canCancel) {\n cancel(textareaRef.current);\n e.preventDefault();\n }\n });\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (isDisabled) return;\n\n // ignore IME composition events\n if (isCompositionKey(e.nativeEvent)) return;\n\n // Let registered plugins (mention, slash command, etc.) handle keyboard events first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (e.key === \"Enter\") {\n const threadState = aui.thread.getState();\n const hasQueue = threadState.capabilities.queue;\n\n // Steer hotkey: Cmd/Ctrl+Shift+Enter (respects submitMode=\"none\" and canSend)\n if (\n e.shiftKey &&\n (e.ctrlKey || e.metaKey) &&\n hasQueue &&\n declaredSubmitMode !== \"none\" &&\n aui.composer.getState().canSend\n ) {\n e.preventDefault();\n aui.composer.send({ steer: true });\n return;\n }\n\n // Regular newline: Shift+Enter\n if (e.shiftKey) return;\n\n // Block submission when running unless queue is supported; a voice\n // session leaves the decision to canSend\n if (\n threadState.isRunning &&\n !hasQueue &&\n threadState.voice === undefined\n )\n return;\n\n let shouldSubmit = false;\n if (effectiveSubmitMode === \"ctrlEnter\") {\n shouldSubmit = e.ctrlKey || e.metaKey;\n } else if (effectiveSubmitMode === \"enter\") {\n shouldSubmit = true;\n }\n\n if (shouldSubmit) {\n e.preventDefault();\n textareaRef.current?.closest(\"form\")?.requestSubmit();\n }\n }\n };\n\n const handlePaste = async (e: ClipboardEvent<HTMLTextAreaElement>) => {\n if (!addAttachmentOnPaste) return;\n const threadCapabilities = aui.thread.getState().capabilities;\n const files = Array.from(e.clipboardData?.files || []);\n\n if (threadCapabilities.attachments && files.length > 0) {\n e.preventDefault();\n await Promise.all(\n files.map(async (file) => {\n try {\n await aui.composer.addAttachment(file);\n } catch {\n // The composer runtime emits composer.attachmentAddError before rejecting.\n }\n }),\n );\n }\n };\n\n const handleHeightChange = (\n height: number,\n meta: TextareaHeightChangeMeta,\n ) => {\n onHeightChange?.(height, meta);\n if (!compactContext) return;\n const el = textareaRef.current;\n if (!el || el.value === \"\") return;\n const cs = getComputedStyle(el);\n const contentHeight =\n cs.boxSizing === \"border-box\"\n ? height -\n parseFloat(cs.paddingTop) -\n parseFloat(cs.paddingBottom) -\n parseFloat(cs.borderTopWidth) -\n parseFloat(cs.borderBottomWidth)\n : height;\n if (Math.round(contentHeight / meta.rowHeight) > 1) {\n compactContext.setMultiline(true);\n }\n };\n\n const autoFocusEnabled = autoFocus && !isDisabled;\n const focus = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea || !autoFocusEnabled) return;\n\n textarea.focus({ preventScroll: true });\n textarea.setSelectionRange(textarea.value.length, textarea.value.length);\n }, [autoFocusEnabled]);\n\n const focusOnRunStart = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n const doc = textarea.ownerDocument;\n const active = doc.activeElement;\n if (active === textarea) return;\n\n const root = threadRootRef?.current;\n const composerRoot = textarea.closest(\"[data-aui-composer-type]\");\n if (\n active &&\n active !== doc.body &&\n !composerRoot?.contains(active) &&\n (!root?.contains(active) ||\n active.closest(\"[data-aui-thread-root]\") !== root)\n )\n return;\n\n focus();\n }, [focus, threadRootRef]);\n\n useEffect(() => focus(), [focus]);\n\n useOnScrollToBottom(() => {\n if (\n aui.composer.getState().type === \"thread\" &&\n unstable_focusOnScrollToBottom\n ) {\n focus();\n }\n });\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnRunStart\n )\n return undefined;\n\n return aui.on(\"thread.runStart\", focusOnRunStart);\n }, [unstable_focusOnRunStart, focusOnRunStart, aui]);\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnThreadSwitched\n )\n return undefined;\n\n return aui.on(\"threads.selectionChanged\", focus);\n }, [unstable_focusOnThreadSwitched, focus, aui]);\n\n useEffect(() => {\n if (value === \"\") compactContext?.setMultiline(false);\n }, [value, compactContext]);\n\n const ariaComboboxProps = useTriggerPopoverAriaProps();\n\n const inputProps = {\n name: \"input\" as const,\n value,\n ...rest,\n ...ariaComboboxProps,\n ref: ref as React.ForwardedRef<HTMLTextAreaElement>,\n disabled: isDisabled,\n onChange: composeEventHandlers(\n onChange,\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (!aui.composer.getState().isEditing) return;\n const nativeIsComposing =\n (e.nativeEvent as { isComposing?: boolean }).isComposing === true;\n // recover stuck compositionRef when the browser drops compositionend\n if (compositionRef.current && !nativeIsComposing) {\n compositionRef.current = false;\n }\n const isComposing = nativeIsComposing || compositionRef.current;\n // Standalone tap roots need a synchronous flush while the input is composing.\n flushTapSync(() => {\n aui.composer.setText(e.target.value);\n });\n if (isComposing) return;\n const pos = e.target.selectionStart ?? e.target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onKeyDown: composeEventHandlers(onKeyDown, handleKeyPress),\n onCompositionStart: composeEventHandlers(\n (rest as { onCompositionStart?: React.CompositionEventHandler })\n .onCompositionStart,\n () => {\n compositionRef.current = true;\n },\n ),\n onCompositionEnd: composeEventHandlers(\n (rest as { onCompositionEnd?: React.CompositionEventHandler })\n .onCompositionEnd,\n (e: React.CompositionEvent<HTMLTextAreaElement>) => {\n compositionRef.current = false;\n if (!aui.composer.getState().isEditing) return;\n const target = e.target as HTMLTextAreaElement;\n flushTapSync(() => {\n aui.composer.setText(target.value);\n });\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onSelect: composeEventHandlers(\n onSelect,\n (e: React.SyntheticEvent<HTMLTextAreaElement>) => {\n if (compositionRef.current) return;\n const target = e.target as HTMLTextAreaElement;\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onPaste: composeEventHandlers(onPaste, handlePaste),\n ...(compactContext\n ? { onHeightChange: handleHeightChange }\n : onHeightChange !== undefined\n ? { onHeightChange }\n : {}),\n };\n\n if (render && isValidElement(render)) {\n return renderSlot(\n render,\n (rest as { children?: ReactNode }).children,\n inputProps,\n );\n }\n\n const Component = asChild ? Slot.Root : TextareaAutosize;\n return <Component {...inputProps} />;\n },\n);\n\nComposerPrimitiveInput.displayName = \"ComposerPrimitive.Input\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqCA,MAAM6B,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkI5B,MAAaC,yBAAyBvB,YAKlC,EACEuC,YAAY,OACZZ,SACAC,QACAY,UAAUC,cACVC,UACAC,WACAC,SACAC,UACAR,eACAD,YACAP,iBAAiB,MACjBC,2BAA2B,MAC3BC,iCAAiC,MACjCC,iCAAiC,MACjCC,qCAAqC,OACrCC,uBAAuB,MACvBY,gBACA,GAAGC,QAELC,iBACG;CACH,MAAMC,MAAMpC,OAAO;CACnB,MAAMqC,gBAAgBhC,wBAAwB;CAC9C,MAAMiC,iBAAiBpC,uCAAuC;CAC9D,MAAMqC,iBAAiBpC,kCAAkC;CAEzD,MAAMqC,qBACJjB,eAAeC,kBAAkB,QAAQ,SAAS;CACpD,MAAMiB,iBAAiB5C,cACrBuB,qCAAqCX,sBAAsB,IAC7D;CACA,MAAMiC,sBACJtB,sCACAqB,kBACAD,uBA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G;EAGlC,CACF;EACAzG,UAAUpD,qBACRoD,WACCkB,QAAiD;GAChD,IAAID,eAAeE,SAAS;GAC5B,MAAME,WAASH,IAAEG;GACjB,MAAMoF,QAAMpF,SAAOqF,kBAAkBrF,SAAOV,MAAM6C;GAClD,IAAIlD,gBACF,KAAK,MAAMiB,YAAUjB,eAAekB,WAAW,GAC7CD,SAAOoF,kBAAkBF,KAAG;EAGlC,CACF;EACA1G,SAASnD,qBAAqBmD,SAASkD,WAAW;EAClD,GAAI1C,iBACA,EAAEN,gBAAgB6D,mBAAmB,IACrC7D,mBAAmB4C,KAAAA,IACjB,EAAE5C,eAAe,IACjB,CAAC;CACT;CAEA,IAAIlB,UAAUxB,eAAewB,MAAM,GACjC,OAAOjB,WACLiB,QACCmB,KAAkC+G,UACnClB,UACF;CAGF,MAAMmB,YAAYpI,UAAUhC,KAAKqK,OAAO3J;CACxC,OAAO,oBAAC,WAAD,EAAW,GAAIuI,WAAW,CAAA;AACnC,CACF;AAEArH,uBAAuB0I,cAAc"}
1
+ {"version":3,"file":"ComposerInput.js","names":["composeEventHandlers","useComposedRefs","Slot","ClipboardEvent","KeyboardEvent","ReactElement","ReactNode","forwardRef","useCallback","useEffect","useRef","isValidElement","TextareaAutosize","TextareaAutosizeProps","TextareaHeightChangeMeta","useEscapeKeydown","useOnScrollToBottom","useMediaQuery","renderSlot","isCompositionKey","useAui","flushTapSync","useComposerInputPluginRegistryOptional","useComposerCompactContextOptional","useComposerCancelWithFocus","useThreadRootElementRef","useComposerInputDisabled","useComposerInputValue","useTriggerPopoverAriaProps","TOUCH_PRIMARY_QUERY","ComposerPrimitiveInput","Element","HTMLTextAreaElement","BaseProps","asChild","render","cancelOnEscape","unstable_focusOnRunStart","unstable_focusOnScrollToBottom","unstable_focusOnThreadSwitched","unstable_insertNewlineOnTouchEnter","addAttachmentOnPaste","SubmitModeProps","submitMode","submitOnEnter","Props","autoFocus","disabled","disabledProp","onChange","onKeyDown","onPaste","onSelect","onHeightChange","rest","forwardedRef","aui","threadRootRef","pluginRegistry","compactContext","declaredSubmitMode","isTouchPrimary","effectiveSubmitMode","value","isDisabled","textareaRef","cancel","composer","ref","compositionRef","e","current","contains","target","Node","plugin","getPlugins","handleKeyDown","getState","canCancel","preventDefault","handleKeyPress","nativeEvent","key","threadState","thread","hasQueue","capabilities","queue","shiftKey","ctrlKey","metaKey","canSend","send","steer","isRunning","voice","undefined","shouldSubmit","closest","requestSubmit","handlePaste","threadCapabilities","files","Array","from","clipboardData","attachments","length","Promise","all","map","file","addAttachment","handleHeightChange","height","meta","el","cs","getComputedStyle","contentHeight","boxSizing","parseFloat","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","Math","round","rowHeight","setMultiline","autoFocusEnabled","focus","textarea","preventScroll","setSelectionRange","focusOnRunStart","doc","ownerDocument","active","activeElement","root","composerRoot","body","type","on","optional","threads","ariaComboboxProps","inputProps","name","const","React","ForwardedRef","ChangeEvent","isEditing","nativeIsComposing","isComposing","setText","origin","pos","selectionStart","setCursorPosition","onCompositionStart","CompositionEventHandler","onCompositionEnd","CompositionEvent","SyntheticEvent","children","Component","Root","displayName"],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"radix-ui/internal\";\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport { Slot } from \"radix-ui\";\nimport {\n type ClipboardEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n isValidElement,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n type TextareaHeightChangeMeta,\n} from \"react-textarea-autosize\";\nimport { useEscapeKeydown } from \"radix-ui/internal\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useMediaQuery } from \"../../utils/hooks/useMediaQuery\";\nimport { renderSlot } from \"../../utils/Primitive\";\nimport { isCompositionKey } from \"../../utils/isCompositionKey\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { flushTapSync } from \"@assistant-ui/tap\";\nimport { useComposerInputPluginRegistryOptional } from \"./ComposerInputPluginContext\";\nimport { useComposerCompactContextOptional } from \"./ComposerCompactContext\";\nimport { useComposerCancelWithFocus } from \"./useComposerCancelWithFocus\";\nimport { useThreadRootElementRef } from \"../thread/ThreadRootElementContext\";\nimport {\n useComposerInputDisabled,\n useComposerInputValue,\n useTriggerPopoverAriaProps,\n} from \"./useComposerInputState\";\n\nconst TOUCH_PRIMARY_QUERY = \"(pointer: coarse) and (not (any-pointer: fine))\";\n\nexport namespace ComposerPrimitiveInput {\n export type Element = HTMLTextAreaElement;\n\n type BaseProps = {\n /**\n * Whether to render as a child component using Slot.\n * When true, the component will merge its props with its child.\n */\n asChild?: boolean | undefined;\n /**\n * A React element to use as the input container, with props merged in.\n */\n render?: ReactElement | undefined;\n /**\n * Whether to cancel message composition when Escape is pressed.\n * After cancelling an edit, focus returns to the main thread composer when\n * available, unless a handler has moved focus elsewhere.\n * @default true\n */\n cancelOnEscape?: boolean | undefined;\n /**\n * Whether to focus the input when a new run starts if nothing is focused\n * or focus is already inside the same thread or composer. Keeps the current\n * selection when the input is already focused. Applies when `autoFocus` is\n * enabled.\n *\n * @deprecated Experimental since 2024-10-12. Not scheduled for removal; the API may change in any release.\n *\n * @default true\n */\n unstable_focusOnRunStart?: boolean | undefined;\n /**\n * Whether to automatically focus the input when scrolling to bottom.\n *\n * @deprecated Experimental since 2024-10-12. Not scheduled for removal; the API may change in any release.\n *\n * @default true\n */\n unstable_focusOnScrollToBottom?: boolean | undefined;\n /**\n * Whether to automatically focus the input when switching threads.\n *\n * @deprecated Experimental since 2024-10-12. Not scheduled for removal; the API may change in any release.\n *\n * @default true\n */\n unstable_focusOnThreadSwitched?: boolean | undefined;\n /**\n * Whether plain Enter on a touch-primary device should insert a newline\n * instead of submitting, detected via\n * `(pointer: coarse) and (not (any-pointer: fine))`. Only takes effect\n * when `submitMode` resolves to `\"enter\"`.\n *\n * @deprecated Experimental since 2026-05-24. Not scheduled for removal; the API may change in any release.\n *\n * @default false\n */\n unstable_insertNewlineOnTouchEnter?: boolean | undefined;\n /**\n * Whether to automatically add pasted files as attachments.\n * @default true\n */\n addAttachmentOnPaste?: boolean | undefined;\n };\n\n type SubmitModeProps =\n | {\n /**\n * Controls how the Enter key submits messages.\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"ctrlEnter\": Ctrl/Cmd+Enter submits (plain Enter for newline)\n * - \"none\": Keyboard submission disabled\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"ctrlEnter\" | \"none\" | undefined;\n /**\n * @deprecated Use `submitMode` instead\n * @ignore\n */\n submitOnEnter?: never;\n }\n | {\n submitMode?: never;\n /**\n * Whether to submit the message when Enter is pressed (without Shift).\n * @default true\n * @deprecated Use `submitMode` instead. Will be removed in a future version.\n */\n submitOnEnter?: boolean | undefined;\n };\n\n export type Props = TextareaAutosizeProps & BaseProps & SubmitModeProps;\n}\n\n/**\n * A text input component for composing messages.\n *\n * This component provides a rich text input experience with automatic resizing,\n * keyboard shortcuts, file paste support, and intelligent focus management.\n * It integrates with the composer context to manage message state and submission.\n *\n * When rendered inside `TriggerPopoverRoot` and a popover is open, the\n * underlying `<textarea>` automatically receives `aria-controls`,\n * `aria-expanded`, `aria-haspopup`, and `aria-activedescendant` for the\n * combobox relationship. These computed attributes override user-provided\n * values for those four ARIA props while the popover is open.\n *\n * @example\n * ```tsx\n * // Ctrl/Cmd+Enter to submit (plain Enter inserts newline)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitMode=\"ctrlEnter\"\n * />\n *\n * // Insert a newline on Enter on touch-primary devices.\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * unstable_insertNewlineOnTouchEnter\n * />\n *\n * // Old API (deprecated, still supported)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitOnEnter={true}\n * />\n * ```\n */\nexport const ComposerPrimitiveInput = forwardRef<\n ComposerPrimitiveInput.Element,\n ComposerPrimitiveInput.Props\n>(\n (\n {\n autoFocus = false,\n asChild,\n render,\n disabled: disabledProp,\n onChange,\n onKeyDown,\n onPaste,\n onSelect,\n submitOnEnter,\n submitMode,\n cancelOnEscape = true,\n unstable_focusOnRunStart = true,\n unstable_focusOnScrollToBottom = true,\n unstable_focusOnThreadSwitched = true,\n unstable_insertNewlineOnTouchEnter = false,\n addAttachmentOnPaste = true,\n onHeightChange,\n ...rest\n },\n forwardedRef,\n ) => {\n const aui = useAui();\n const threadRootRef = useThreadRootElementRef();\n const pluginRegistry = useComposerInputPluginRegistryOptional();\n const compactContext = useComposerCompactContextOptional();\n\n const declaredSubmitMode =\n submitMode ?? (submitOnEnter === false ? \"none\" : \"enter\");\n const isTouchPrimary = useMediaQuery(\n unstable_insertNewlineOnTouchEnter ? TOUCH_PRIMARY_QUERY : null,\n );\n const effectiveSubmitMode =\n unstable_insertNewlineOnTouchEnter &&\n isTouchPrimary &&\n declaredSubmitMode === \"enter\"\n ? \"none\"\n : declaredSubmitMode;\n\n const value = useComposerInputValue();\n const isDisabled = useComposerInputDisabled(disabledProp);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const cancel = useComposerCancelWithFocus(\n useCallback(() => aui.composer.cancel(), [aui]),\n );\n const ref = useComposedRefs(forwardedRef, textareaRef);\n // suppress text/cursor broadcasts during IME composition\n const compositionRef = useRef(false);\n\n useEscapeKeydown((e) => {\n // Only handle ESC if it originated from within this input\n if (!textareaRef.current?.contains(e.target as Node)) return;\n\n // ignore IME composition events\n if (isCompositionKey(e)) return;\n\n // Let registered plugins (mention, slash command, etc.) handle Escape first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (!cancelOnEscape) return;\n\n const composer = aui.composer;\n if (composer.getState().canCancel) {\n cancel(textareaRef.current);\n e.preventDefault();\n }\n });\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (isDisabled) return;\n\n // ignore IME composition events\n if (isCompositionKey(e.nativeEvent)) return;\n\n // Let registered plugins (mention, slash command, etc.) handle keyboard events first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (e.key === \"Enter\") {\n const threadState = aui.thread.getState();\n const hasQueue = threadState.capabilities.queue;\n\n // Steer hotkey: Cmd/Ctrl+Shift+Enter (respects submitMode=\"none\" and canSend)\n if (\n e.shiftKey &&\n (e.ctrlKey || e.metaKey) &&\n hasQueue &&\n declaredSubmitMode !== \"none\" &&\n aui.composer.getState().canSend\n ) {\n e.preventDefault();\n aui.composer.send({ steer: true });\n return;\n }\n\n // Regular newline: Shift+Enter\n if (e.shiftKey) return;\n\n // Block submission when running unless queue is supported; a voice\n // session leaves the decision to canSend\n if (\n threadState.isRunning &&\n !hasQueue &&\n threadState.voice === undefined\n )\n return;\n\n let shouldSubmit = false;\n if (effectiveSubmitMode === \"ctrlEnter\") {\n shouldSubmit = e.ctrlKey || e.metaKey;\n } else if (effectiveSubmitMode === \"enter\") {\n shouldSubmit = true;\n }\n\n if (shouldSubmit) {\n e.preventDefault();\n textareaRef.current?.closest(\"form\")?.requestSubmit();\n }\n }\n };\n\n const handlePaste = async (e: ClipboardEvent<HTMLTextAreaElement>) => {\n if (!addAttachmentOnPaste) return;\n const threadCapabilities = aui.thread.getState().capabilities;\n const files = Array.from(e.clipboardData?.files || []);\n\n if (threadCapabilities.attachments && files.length > 0) {\n e.preventDefault();\n await Promise.all(\n files.map(async (file) => {\n try {\n await aui.composer.addAttachment(file);\n } catch {\n // The composer runtime emits composer.attachmentAddError before rejecting.\n }\n }),\n );\n }\n };\n\n const handleHeightChange = (\n height: number,\n meta: TextareaHeightChangeMeta,\n ) => {\n onHeightChange?.(height, meta);\n if (!compactContext) return;\n const el = textareaRef.current;\n if (!el || el.value === \"\") return;\n const cs = getComputedStyle(el);\n const contentHeight =\n cs.boxSizing === \"border-box\"\n ? height -\n parseFloat(cs.paddingTop) -\n parseFloat(cs.paddingBottom) -\n parseFloat(cs.borderTopWidth) -\n parseFloat(cs.borderBottomWidth)\n : height;\n if (Math.round(contentHeight / meta.rowHeight) > 1) {\n compactContext.setMultiline(true);\n }\n };\n\n const autoFocusEnabled = autoFocus && !isDisabled;\n const focus = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea || !autoFocusEnabled) return;\n\n textarea.focus({ preventScroll: true });\n textarea.setSelectionRange(textarea.value.length, textarea.value.length);\n }, [autoFocusEnabled]);\n\n const focusOnRunStart = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n const doc = textarea.ownerDocument;\n const active = doc.activeElement;\n if (active === textarea) return;\n\n const root = threadRootRef?.current;\n const composerRoot = textarea.closest(\"[data-aui-composer-type]\");\n if (\n active &&\n active !== doc.body &&\n !composerRoot?.contains(active) &&\n (!root?.contains(active) ||\n active.closest(\"[data-aui-thread-root]\") !== root)\n )\n return;\n\n focus();\n }, [focus, threadRootRef]);\n\n useEffect(() => focus(), [focus]);\n\n useOnScrollToBottom(() => {\n if (\n aui.composer.getState().type === \"thread\" &&\n unstable_focusOnScrollToBottom\n ) {\n focus();\n }\n });\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnRunStart\n )\n return undefined;\n\n return aui.on(\"thread.runStart\", focusOnRunStart);\n }, [unstable_focusOnRunStart, focusOnRunStart, aui]);\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnThreadSwitched ||\n !aui.optional.threads\n )\n return undefined;\n\n return aui.on(\"threads.selectionChanged\", focus);\n }, [unstable_focusOnThreadSwitched, focus, aui]);\n\n useEffect(() => {\n if (value === \"\") compactContext?.setMultiline(false);\n }, [value, compactContext]);\n\n const ariaComboboxProps = useTriggerPopoverAriaProps();\n\n const inputProps = {\n name: \"input\" as const,\n value,\n ...rest,\n ...ariaComboboxProps,\n ref: ref as React.ForwardedRef<HTMLTextAreaElement>,\n disabled: isDisabled,\n onChange: composeEventHandlers(\n onChange,\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (!aui.composer.getState().isEditing) return;\n const nativeIsComposing =\n (e.nativeEvent as { isComposing?: boolean }).isComposing === true;\n // recover stuck compositionRef when the browser drops compositionend\n if (compositionRef.current && !nativeIsComposing) {\n compositionRef.current = false;\n }\n const isComposing = nativeIsComposing || compositionRef.current;\n // Standalone tap roots need a synchronous flush while the input is composing.\n flushTapSync(() => {\n aui.composer.setText(e.target.value, { origin: \"user\" });\n });\n if (isComposing) return;\n const pos = e.target.selectionStart ?? e.target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onKeyDown: composeEventHandlers(onKeyDown, handleKeyPress),\n onCompositionStart: composeEventHandlers(\n (rest as { onCompositionStart?: React.CompositionEventHandler })\n .onCompositionStart,\n () => {\n compositionRef.current = true;\n },\n ),\n onCompositionEnd: composeEventHandlers(\n (rest as { onCompositionEnd?: React.CompositionEventHandler })\n .onCompositionEnd,\n (e: React.CompositionEvent<HTMLTextAreaElement>) => {\n compositionRef.current = false;\n if (!aui.composer.getState().isEditing) return;\n const target = e.target as HTMLTextAreaElement;\n flushTapSync(() => {\n aui.composer.setText(target.value, { origin: \"user\" });\n });\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onSelect: composeEventHandlers(\n onSelect,\n (e: React.SyntheticEvent<HTMLTextAreaElement>) => {\n if (compositionRef.current) return;\n const target = e.target as HTMLTextAreaElement;\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onPaste: composeEventHandlers(onPaste, handlePaste),\n ...(compactContext\n ? { onHeightChange: handleHeightChange }\n : onHeightChange !== undefined\n ? { onHeightChange }\n : {}),\n };\n\n if (render && isValidElement(render)) {\n return renderSlot(\n render,\n (rest as { children?: ReactNode }).children,\n inputProps,\n );\n }\n\n const Component = asChild ? Slot.Root : TextareaAutosize;\n return <Component {...inputProps} />;\n },\n);\n\nComposerPrimitiveInput.displayName = \"ComposerPrimitive.Input\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqCA,MAAM6B,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkI5B,MAAaC,yBAAyBvB,YAKlC,EACEuC,YAAY,OACZZ,SACAC,QACAY,UAAUC,cACVC,UACAC,WACAC,SACAC,UACAR,eACAD,YACAP,iBAAiB,MACjBC,2BAA2B,MAC3BC,iCAAiC,MACjCC,iCAAiC,MACjCC,qCAAqC,OACrCC,uBAAuB,MACvBY,gBACA,GAAGC,QAELC,iBACG;CACH,MAAMC,MAAMpC,OAAO;CACnB,MAAMqC,gBAAgBhC,wBAAwB;CAC9C,MAAMiC,iBAAiBpC,uCAAuC;CAC9D,MAAMqC,iBAAiBpC,kCAAkC;CAEzD,MAAMqC,qBACJjB,eAAeC,kBAAkB,QAAQ,SAAS;CACpD,MAAMiB,iBAAiB5C,cACrBuB,qCAAqCX,sBAAsB,IAC7D;CACA,MAAMiC,sBACJtB,sCACAqB,kBACAD,uBAAuB,UACnB,SACAA;CAEN,MAAMG,QAAQpC,sBAAsB;CACpC,MAAMqC,aAAatC,yBAAyBsB,YAAY;CACxD,MAAMiB,cAAcvD,OAA4B,IAAI;CACpD,MAAMwD,SAAS1C,2BACbhB,kBAAkBgD,IAAIW,SAASD,OAAO,GAAG,CAACV,GAAG,CAAC,CAChD;CACA,MAAMY,MAAMnE,gBAAgBsD,cAAcU,WAAW;CAErD,MAAMI,iBAAiB3D,OAAO,KAAK;CAEnCK,kBAAkBuD,MAAM;EAEtB,IAAI,CAACL,YAAYM,SAASC,SAASF,EAAEG,MAAc,GAAG;EAGtD,IAAItD,i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,GAAI1C,iBACA,EAAEN,gBAAgB6D,mBAAmB,IACrC7D,mBAAmB4C,KAAAA,IACjB,EAAE5C,eAAe,IACjB,CAAC;CACT;CAEA,IAAIlB,UAAUxB,eAAewB,MAAM,GACjC,OAAOjB,WACLiB,QACCmB,KAAkCkH,UACnCnB,UACF;CAGF,MAAMoB,YAAYvI,UAAUhC,KAAKwK,OAAO9J;CACxC,OAAO,oBAAC,WAAD,EAAW,GAAIyI,WAAW,CAAA;AACnC,CACF;AAEAvH,uBAAuB6I,cAAc"}
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { ComposerPrimitiveQueue } from "@assistant-ui/core/react";
3
- export { ComposerPrimitiveQueue };
2
+ export { ComposerPrimitiveQueue } from "@assistant-ui/core/react";
@@ -17,7 +17,7 @@ export declare namespace ComposerPrimitiveQuote {
17
17
  * ```
18
18
  */
19
19
  export declare const ComposerPrimitiveQuote: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
20
- asChild?: boolean;
20
+ asChild?: boolean | undefined;
21
21
  }, "ref"> & {
22
22
  render?: import("react").ReactElement | undefined;
23
23
  } & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -34,7 +34,7 @@ export declare namespace ComposerPrimitiveQuoteText {
34
34
  * ```
35
35
  */
36
36
  export declare const ComposerPrimitiveQuoteText: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
37
- asChild?: boolean;
37
+ asChild?: boolean | undefined;
38
38
  }, "ref"> & {
39
39
  render?: import("react").ReactElement | undefined;
40
40
  } & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
@@ -51,7 +51,7 @@ export declare namespace ComposerPrimitiveQuoteDismiss {
51
51
  * ```
52
52
  */
53
53
  export declare const ComposerPrimitiveQuoteDismiss: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
54
- asChild?: boolean;
54
+ asChild?: boolean | undefined;
55
55
  }, "ref"> & {
56
56
  render?: import("react").ReactElement | undefined;
57
57
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -15,7 +15,7 @@ export declare namespace ComposerPrimitiveResume {
15
15
  * ```
16
16
  */
17
17
  export declare const ComposerPrimitiveResume: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
18
- asChild?: boolean;
18
+ asChild?: boolean | undefined;
19
19
  }, "ref"> & {
20
20
  render?: import("react").ReactElement | undefined;
21
21
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -39,7 +39,7 @@ export declare namespace ComposerPrimitiveRoot {
39
39
  * ```
40
40
  */
41
41
  export declare const ComposerPrimitiveRoot: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLFormElement> & import("react").FormHTMLAttributes<HTMLFormElement> & {
42
- asChild?: boolean;
42
+ asChild?: boolean | undefined;
43
43
  }, "ref"> & {
44
44
  render?: import("react").ReactElement | undefined;
45
45
  } & import("react").RefAttributes<HTMLFormElement>, "ref"> & {
@@ -23,7 +23,7 @@ export declare namespace ComposerPrimitiveSend {
23
23
  * ```
24
24
  */
25
25
  export declare const ComposerPrimitiveSend: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
26
- asChild?: boolean;
26
+ asChild?: boolean | undefined;
27
27
  }, "ref"> & {
28
28
  render?: import("react").ReactElement | undefined;
29
29
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -17,7 +17,7 @@ export declare namespace ComposerPrimitiveStopDictation {
17
17
  * ```
18
18
  */
19
19
  export declare const ComposerPrimitiveStopDictation: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
20
- asChild?: boolean;
20
+ asChild?: boolean | undefined;
21
21
  }, "ref"> & {
22
22
  render?: import("react").ReactElement | undefined;
23
23
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -53,7 +53,7 @@ export declare namespace ComposerPrimitiveTriggerPopover {
53
53
  * ```
54
54
  */
55
55
  export declare const ComposerPrimitiveTriggerPopover: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
56
- asChild?: boolean;
56
+ asChild?: boolean | undefined;
57
57
  }, "ref"> & {
58
58
  render?: import("react").ReactElement | undefined;
59
59
  } & import("react").RefAttributes<HTMLDivElement>, "ref">, "onSelect"> & {
@@ -9,7 +9,7 @@ export declare namespace ComposerPrimitiveTriggerPopoverBack {
9
9
  * Only renders when a category is active (drill-down view).
10
10
  */
11
11
  export declare const ComposerPrimitiveTriggerPopoverBack: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
12
- asChild?: boolean;
12
+ asChild?: boolean | undefined;
13
13
  }, "ref"> & {
14
14
  render?: import("react").ReactElement | undefined;
15
15
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -12,7 +12,7 @@ export declare namespace ComposerPrimitiveTriggerPopoverCategories {
12
12
  * Only renders when no category is active and search mode is off.
13
13
  */
14
14
  export declare const ComposerPrimitiveTriggerPopoverCategories: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
15
- asChild?: boolean;
15
+ asChild?: boolean | undefined;
16
16
  }, "ref"> & {
17
17
  render?: import("react").ReactElement | undefined;
18
18
  } & import("react").RefAttributes<HTMLDivElement>, "ref">, "children"> & {
@@ -29,7 +29,7 @@ export declare namespace ComposerPrimitiveTriggerPopoverCategoryItem {
29
29
  * Automatically receives `data-highlighted` when keyboard-navigated.
30
30
  */
31
31
  export declare const ComposerPrimitiveTriggerPopoverCategoryItem: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
32
- asChild?: boolean;
32
+ asChild?: boolean | undefined;
33
33
  }, "ref"> & {
34
34
  render?: import("react").ReactElement | undefined;
35
35
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & {
@@ -12,7 +12,7 @@ export declare namespace ComposerPrimitiveTriggerPopoverItems {
12
12
  * Only renders when a category is active or search mode is on.
13
13
  */
14
14
  export declare const ComposerPrimitiveTriggerPopoverItems: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
15
- asChild?: boolean;
15
+ asChild?: boolean | undefined;
16
16
  }, "ref"> & {
17
17
  render?: import("react").ReactElement | undefined;
18
18
  } & import("react").RefAttributes<HTMLDivElement>, "ref">, "children"> & {
@@ -30,7 +30,7 @@ export declare namespace ComposerPrimitiveTriggerPopoverItem {
30
30
  * Automatically receives `data-highlighted` when keyboard-navigated.
31
31
  */
32
32
  export declare const ComposerPrimitiveTriggerPopoverItem: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
33
- asChild?: boolean;
33
+ asChild?: boolean | undefined;
34
34
  }, "ref"> & {
35
35
  render?: import("react").ReactElement | undefined;
36
36
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & {
@@ -8,7 +8,7 @@ export type { TriggerMatch, TriggerMatcher } from "./detectTrigger.js";
8
8
  import { ComposerPrimitiveTriggerPopoverAction } from "./TriggerPopoverAction.js";
9
9
  import { ComposerPrimitiveTriggerPopoverDirective } from "./TriggerPopoverDirective.js";
10
10
  export declare const ComposerPrimitiveTriggerPopover: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
11
- asChild?: boolean;
11
+ asChild?: boolean | undefined;
12
12
  }, "ref"> & {
13
13
  render?: import("react").ReactElement | undefined;
14
14
  } & import("react").RefAttributes<HTMLDivElement>, "ref">, "onSelect"> & {
@@ -1 +1 @@
1
- {"version":3,"file":"triggerSelectionResource.d.ts","sourceRoot":"","sources":["../../../../src/primitives/composer/trigger/triggerSelectionResource.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,2BAA2B,EAC3B,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,sCAAmC;AAElE;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,IAAI,EAAE,oBAAoB,EAC1B,UAAU,EAAE,MAAM,IAAI,KACnB,OAAO,CAAC;AAEb,MAAM,MAAM,eAAe,GACvB;IACE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,2BAA2B,CAAC;IAChD,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAC5D,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,2BAA2B,CAAC;IAChD,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACzD,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACpC,CAAC;AAEN,MAAM,MAAM,8BAA8B,GAAG;IAC3C,qEAAqE;IACrE,UAAU,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC7C,+EAA+E;IAC/E,KAAK,IAAI,IAAI,CAAC;IACd,0EAA0E;IAC1E,0BAA0B,CAAC,EAAE,EAAE,kBAAkB,GAAG,MAAM,IAAI,CAAC;CAChE,CAAC;AA2FF,eAAO,MAAM,wBAAwB;cAjFzB,eAAe,GAAG,SAAS;aAC5B,eAAe,GAAG,IAAI;SAC1B,eAAe;iBACP,MAAM;uBACA,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI;IACxC,6EAA6E;gBACjE,MAAM,IAAI;GA2EqD,CAAC"}
1
+ {"version":3,"file":"triggerSelectionResource.d.ts","sourceRoot":"","sources":["../../../../src/primitives/composer/trigger/triggerSelectionResource.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,2BAA2B,EAC3B,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,sCAAmC;AAElE;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,IAAI,EAAE,oBAAoB,EAC1B,UAAU,EAAE,MAAM,IAAI,KACnB,OAAO,CAAC;AAEb,MAAM,MAAM,eAAe,GACvB;IACE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,2BAA2B,CAAC;IAChD,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAC5D,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,2BAA2B,CAAC;IAChD,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACzD,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACpC,CAAC;AAEN,MAAM,MAAM,8BAA8B,GAAG;IAC3C,qEAAqE;IACrE,UAAU,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC7C,+EAA+E;IAC/E,KAAK,IAAI,IAAI,CAAC;IACd,0EAA0E;IAC1E,0BAA0B,CAAC,EAAE,EAAE,kBAAkB,GAAG,MAAM,IAAI,CAAC;CAChE,CAAC;AA6FF,eAAO,MAAM,wBAAwB;cAnFzB,eAAe,GAAG,SAAS;aAC5B,eAAe,GAAG,IAAI;SAC1B,eAAe;iBACP,MAAM;uBACA,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI;IACxC,6EAA6E;gBACjE,MAAM,IAAI;GA6EqD,CAAC"}
@@ -34,7 +34,7 @@ const useTriggerSelectionResource = (t0) => {
34
34
  const after = currentText.slice(trigger.endOffset);
35
35
  const insertDirective = () => {
36
36
  const directive = behavior.formatter.serialize(item);
37
- aui.composer.setText(before + directive + (after.startsWith(" ") ? after : ` ${after}`));
37
+ aui.composer.setText(before + directive + (after.startsWith(" ") ? after : ` ${after}`), { origin: "user" });
38
38
  setCursorPosition(before.length + directive.length + 1);
39
39
  };
40
40
  if (behavior.kind === "directive") {
@@ -42,7 +42,7 @@ const useTriggerSelectionResource = (t0) => {
42
42
  behavior.onInserted?.(item);
43
43
  } else {
44
44
  if (behavior.removeOnExecute) {
45
- aui.composer.setText(before + (after.startsWith(" ") ? after.slice(1) : after));
45
+ aui.composer.setText(before + (after.startsWith(" ") ? after.slice(1) : after), { origin: "user" });
46
46
  setCursorPosition(before.length);
47
47
  } else insertDirective();
48
48
  behavior.onExecute(item);
@@ -1 +1 @@
1
- {"version":3,"file":"triggerSelectionResource.js","names":["useEffectEvent","useRef","resource","Unstable_DirectiveFormatter","Unstable_TriggerItem","AssistantClient","DetectedTrigger","SelectItemOverride","item","onInserted","TriggerBehavior","kind","formatter","onExecute","removeOnExecute","TriggerSelectionResourceOutput","selectItem","close","registerSelectItemOverride","fn","useTriggerSelectionResource","t0","$","_c","behavior","trigger","aui","setCursorPosition","onSelected","selectItemOverrideRef","t1","Symbol","for","current","t2","reportInserted","currentText","composer","getState","text","before","slice","offset","after","endOffset","insertDirective","directive","serialize","setText","startsWith","length","t3","t4","TriggerSelectionResource","_c"],"sources":["../../../../src/primitives/composer/trigger/triggerSelectionResource.ts"],"sourcesContent":["import { useEffectEvent, useRef } from \"react\";\nimport { resource } from \"@assistant-ui/tap\";\nimport type {\n Unstable_DirectiveFormatter,\n Unstable_TriggerItem,\n} from \"@assistant-ui/core\";\nimport type { AssistantClient } from \"@assistant-ui/store\";\nimport type { DetectedTrigger } from \"./triggerDetectionResource\";\n\n/**\n * External override for selection (used by Lexical's DirectivePlugin).\n * Returns whether it handled the item, and calls `onInserted` once the\n * insertion has reached the composer.\n */\nexport type SelectItemOverride = (\n item: Unstable_TriggerItem,\n onInserted: () => void,\n) => boolean;\n\nexport type TriggerBehavior =\n | {\n readonly kind: \"directive\";\n readonly formatter: Unstable_DirectiveFormatter;\n readonly onInserted?: (item: Unstable_TriggerItem) => void;\n }\n | {\n readonly kind: \"action\";\n readonly formatter: Unstable_DirectiveFormatter;\n readonly onExecute: (item: Unstable_TriggerItem) => void;\n readonly removeOnExecute?: boolean;\n };\n\nexport type TriggerSelectionResourceOutput = {\n /** Select an item — runs override (if any) then applies behavior. */\n selectItem(item: Unstable_TriggerItem): void;\n /** Close the popover (moves cursor before trigger to deactivate detection). */\n close(): void;\n /** Register a Lexical-style selection override. Returns unregister fn. */\n registerSelectItemOverride(fn: SelectItemOverride): () => void;\n};\n\n/** Owns composer text mutation + behavior dispatch on item selection. */\nconst useTriggerSelectionResource = ({\n behavior,\n trigger,\n aui,\n setCursorPosition,\n onSelected,\n}: {\n behavior: TriggerBehavior | undefined;\n trigger: DetectedTrigger | null;\n aui: AssistantClient;\n triggerChar: string;\n setCursorPosition: (pos: number) => void;\n /** Called after a successful selection so the parent can reset nav state. */\n onSelected: () => void;\n}): TriggerSelectionResourceOutput => {\n // Select-item override: lets Lexical's DirectivePlugin intercept selection\n // and drive its own node insertion.\n const selectItemOverrideRef = useRef<SelectItemOverride | null>(null);\n\n const registerSelectItemOverride = useEffectEvent(\n (fn: SelectItemOverride) => {\n selectItemOverrideRef.current = fn;\n return () => {\n if (selectItemOverrideRef.current === fn) {\n selectItemOverrideRef.current = null;\n }\n };\n },\n );\n\n const selectItem = useEffectEvent((item: Unstable_TriggerItem) => {\n if (!trigger || !behavior) return;\n\n const reportInserted = () => {\n if (behavior.kind === \"directive\") behavior.onInserted?.(item);\n };\n\n if (selectItemOverrideRef.current?.(item, reportInserted)) {\n onSelected();\n return;\n }\n\n const currentText = aui.composer.getState().text;\n const before = currentText.slice(0, trigger.offset);\n const after = currentText.slice(trigger.endOffset);\n\n const insertDirective = () => {\n const directive = behavior.formatter.serialize(item);\n aui.composer.setText(\n before + directive + (after.startsWith(\" \") ? after : ` ${after}`),\n );\n setCursorPosition(before.length + directive.length + 1);\n };\n\n if (behavior.kind === \"directive\") {\n insertDirective();\n behavior.onInserted?.(item);\n } else {\n if (behavior.removeOnExecute) {\n aui.composer.setText(\n before + (after.startsWith(\" \") ? after.slice(1) : after),\n );\n setCursorPosition(before.length);\n } else {\n // Leave directive chip in the composer as an audit trail\n insertDirective();\n }\n behavior.onExecute(item);\n }\n\n onSelected();\n });\n\n const close = useEffectEvent(() => {\n onSelected();\n // Move cursor before the trigger so trigger detection deactivates\n if (trigger) {\n setCursorPosition(trigger.offset);\n }\n });\n\n return {\n selectItem,\n close,\n registerSelectItemOverride,\n };\n};\n\nexport const TriggerSelectionResource = resource(useTriggerSelectionResource);\n"],"mappings":";;;;;AA0CA,MAAMoB,+BAA8BC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAC,MAAA,EAAAC,UAAAC,SAAAC,KAAAC,mBAAAC,eAAAP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A4B,IAArBN,MAAKF,MAAO,CAAS,IAA7CE,MACZ;KACAhB,kBAAkBa,OAAMU,MAAO;IAAC,OAGhCL,gBAAgB;IAElBrB,SAAQX,UAAWL,IAAI;GAAC;GAG1BoB,WAAW;EAAC;EACbN,EAAA,KAAAI;EAAAJ,EAAA,KAAAE;EAAAF,EAAA,KAAAM;EAAAN,EAAA,KAAAK;EAAAL,EAAA,KAAAG;EAAAH,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAzCD,MAAAN,aAAmBhB,eAAekC,EAyCjC;CAAE,IAAAiB;CAAA,IAAA7B,EAAA,OAAAM,cAAAN,EAAA,OAAAK,qBAAAL,EAAA,OAAAG,SAAA;EAE0B0B,WAAA;GAC3BvB,WAAW;GAEX,IAAIH,SACFE,kBAAkBF,QAAOiB,MAAO;EACjC;EACFpB,EAAA,KAAAM;EAAAN,EAAA,KAAAK;EAAAL,EAAA,KAAAG;EAAAH,EAAA,MAAA6B;CAAA,OAAAA,KAAA7B,EAAA;CAND,MAAAL,QAAcjB,eAAemD,EAM5B;CAAE,IAAAC;CAAA,IAAA9B,EAAA,QAAAL,SAAAK,EAAA,QAAAJ,8BAAAI,EAAA,QAAAN,YAAA;EAEIoC,KAAA;GAAApC;GAAAC;GAAAC;EAIP;EAACI,EAAA,MAAAL;EAAAK,EAAA,MAAAJ;EAAAI,EAAA,MAAAN;EAAAM,EAAA,MAAA8B;CAAA,OAAAA,KAAA9B,EAAA;CAAA,OAJM8B;AAIN;AAGH,MAAaC,2BAA2BnD,SAASkB,2BAA2B"}
1
+ {"version":3,"file":"triggerSelectionResource.js","names":["useEffectEvent","useRef","resource","Unstable_DirectiveFormatter","Unstable_TriggerItem","AssistantClient","DetectedTrigger","SelectItemOverride","item","onInserted","TriggerBehavior","kind","formatter","onExecute","removeOnExecute","TriggerSelectionResourceOutput","selectItem","close","registerSelectItemOverride","fn","useTriggerSelectionResource","t0","$","_c","behavior","trigger","aui","setCursorPosition","onSelected","selectItemOverrideRef","t1","Symbol","for","current","t2","reportInserted","currentText","composer","getState","text","before","slice","offset","after","endOffset","insertDirective","directive","serialize","setText","startsWith","origin","length","t3","t4","TriggerSelectionResource","_c"],"sources":["../../../../src/primitives/composer/trigger/triggerSelectionResource.ts"],"sourcesContent":["import { useEffectEvent, useRef } from \"react\";\nimport { resource } from \"@assistant-ui/tap\";\nimport type {\n Unstable_DirectiveFormatter,\n Unstable_TriggerItem,\n} from \"@assistant-ui/core\";\nimport type { AssistantClient } from \"@assistant-ui/store\";\nimport type { DetectedTrigger } from \"./triggerDetectionResource\";\n\n/**\n * External override for selection (used by Lexical's DirectivePlugin).\n * Returns whether it handled the item, and calls `onInserted` once the\n * insertion has reached the composer.\n */\nexport type SelectItemOverride = (\n item: Unstable_TriggerItem,\n onInserted: () => void,\n) => boolean;\n\nexport type TriggerBehavior =\n | {\n readonly kind: \"directive\";\n readonly formatter: Unstable_DirectiveFormatter;\n readonly onInserted?: (item: Unstable_TriggerItem) => void;\n }\n | {\n readonly kind: \"action\";\n readonly formatter: Unstable_DirectiveFormatter;\n readonly onExecute: (item: Unstable_TriggerItem) => void;\n readonly removeOnExecute?: boolean;\n };\n\nexport type TriggerSelectionResourceOutput = {\n /** Select an item — runs override (if any) then applies behavior. */\n selectItem(item: Unstable_TriggerItem): void;\n /** Close the popover (moves cursor before trigger to deactivate detection). */\n close(): void;\n /** Register a Lexical-style selection override. Returns unregister fn. */\n registerSelectItemOverride(fn: SelectItemOverride): () => void;\n};\n\n/** Owns composer text mutation + behavior dispatch on item selection. */\nconst useTriggerSelectionResource = ({\n behavior,\n trigger,\n aui,\n setCursorPosition,\n onSelected,\n}: {\n behavior: TriggerBehavior | undefined;\n trigger: DetectedTrigger | null;\n aui: AssistantClient;\n triggerChar: string;\n setCursorPosition: (pos: number) => void;\n /** Called after a successful selection so the parent can reset nav state. */\n onSelected: () => void;\n}): TriggerSelectionResourceOutput => {\n // Select-item override: lets Lexical's DirectivePlugin intercept selection\n // and drive its own node insertion.\n const selectItemOverrideRef = useRef<SelectItemOverride | null>(null);\n\n const registerSelectItemOverride = useEffectEvent(\n (fn: SelectItemOverride) => {\n selectItemOverrideRef.current = fn;\n return () => {\n if (selectItemOverrideRef.current === fn) {\n selectItemOverrideRef.current = null;\n }\n };\n },\n );\n\n const selectItem = useEffectEvent((item: Unstable_TriggerItem) => {\n if (!trigger || !behavior) return;\n\n const reportInserted = () => {\n if (behavior.kind === \"directive\") behavior.onInserted?.(item);\n };\n\n if (selectItemOverrideRef.current?.(item, reportInserted)) {\n onSelected();\n return;\n }\n\n const currentText = aui.composer.getState().text;\n const before = currentText.slice(0, trigger.offset);\n const after = currentText.slice(trigger.endOffset);\n\n const insertDirective = () => {\n const directive = behavior.formatter.serialize(item);\n aui.composer.setText(\n before + directive + (after.startsWith(\" \") ? after : ` ${after}`),\n { origin: \"user\" },\n );\n setCursorPosition(before.length + directive.length + 1);\n };\n\n if (behavior.kind === \"directive\") {\n insertDirective();\n behavior.onInserted?.(item);\n } else {\n if (behavior.removeOnExecute) {\n aui.composer.setText(\n before + (after.startsWith(\" \") ? after.slice(1) : after),\n { origin: \"user\" },\n );\n setCursorPosition(before.length);\n } else {\n // Leave directive chip in the composer as an audit trail\n insertDirective();\n }\n behavior.onExecute(item);\n }\n\n onSelected();\n });\n\n const close = useEffectEvent(() => {\n onSelected();\n // Move cursor before the trigger so trigger detection deactivates\n if (trigger) {\n setCursorPosition(trigger.offset);\n }\n });\n\n return {\n selectItem,\n close,\n registerSelectItemOverride,\n };\n};\n\nexport const TriggerSelectionResource = resource(useTriggerSelectionResource);\n"],"mappings":";;;;;AA0CA,MAAMoB,+BAA8BC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAC,MAAA,EAAAC,UAAAC,SAAAC,KAAAC,mBAAAC,eAAAP;CAiBnC,MAAAQ,wBAA8B5B,OAAkC,IAAI;CAAE,IAAA6B;CAAA,IAAAR,EAAA,OAAAS,OAAAC,IAAA,2BAAA,GAAA;EAGpEF,M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AAO;IAAC,OAGhCN,gBAAgB;IAElBrB,SAAQX,UAAWL,IAAI;GAAC;GAG1BoB,WAAW;EAAC;EACbN,EAAA,KAAAI;EAAAJ,EAAA,KAAAE;EAAAF,EAAA,KAAAM;EAAAN,EAAA,KAAAK;EAAAL,EAAA,KAAAG;EAAAH,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CA3CD,MAAAN,aAAmBhB,eAAekC,EA2CjC;CAAE,IAAAkB;CAAA,IAAA9B,EAAA,OAAAM,cAAAN,EAAA,OAAAK,qBAAAL,EAAA,OAAAG,SAAA;EAE0B2B,WAAA;GAC3BxB,WAAW;GAEX,IAAIH,SACFE,kBAAkBF,QAAOiB,MAAO;EACjC;EACFpB,EAAA,KAAAM;EAAAN,EAAA,KAAAK;EAAAL,EAAA,KAAAG;EAAAH,EAAA,MAAA8B;CAAA,OAAAA,KAAA9B,EAAA;CAND,MAAAL,QAAcjB,eAAeoD,EAM5B;CAAE,IAAAC;CAAA,IAAA/B,EAAA,QAAAL,SAAAK,EAAA,QAAAJ,8BAAAI,EAAA,QAAAN,YAAA;EAEIqC,KAAA;GAAArC;GAAAC;GAAAC;EAIP;EAACI,EAAA,MAAAL;EAAAK,EAAA,MAAAJ;EAAAI,EAAA,MAAAN;EAAAM,EAAA,MAAA+B;CAAA,OAAAA,KAAA/B,EAAA;CAAA,OAJM+B;AAIN;AAGH,MAAaC,2BAA2BpD,SAASkB,2BAA2B"}
@@ -5,7 +5,7 @@ export declare namespace ErrorPrimitiveMessage {
5
5
  type Props = ComponentPropsWithoutRef<typeof Primitive.span>;
6
6
  }
7
7
  export declare const ErrorPrimitiveMessage: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
8
- asChild?: boolean;
8
+ asChild?: boolean | undefined;
9
9
  }, "ref"> & {
10
10
  render?: import("react").ReactElement | undefined;
11
11
  } & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
@@ -5,7 +5,7 @@ export declare namespace ErrorPrimitiveRoot {
5
5
  type Props = ComponentPropsWithoutRef<typeof Primitive.div>;
6
6
  }
7
7
  export declare const ErrorPrimitiveRoot: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
8
- asChild?: boolean;
8
+ asChild?: boolean | undefined;
9
9
  }, "ref"> & {
10
10
  render?: import("react").ReactElement | undefined;
11
11
  } & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { MessagePrimitiveAttachmentByIndex, MessagePrimitiveAttachments } from "@assistant-ui/core/react";
3
- export { MessagePrimitiveAttachmentByIndex, MessagePrimitiveAttachments };
2
+ export { MessagePrimitiveAttachmentByIndex, MessagePrimitiveAttachments } from "@assistant-ui/core/react";
@@ -28,7 +28,7 @@ export declare namespace MessagePrimitiveRoot {
28
28
  * ```
29
29
  */
30
30
  export declare const MessagePrimitiveRoot: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
31
- asChild?: boolean;
31
+ asChild?: boolean | undefined;
32
32
  }, "ref"> & {
33
33
  render?: import("react").ReactElement | undefined;
34
34
  } & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -24,7 +24,7 @@ export declare namespace MessagePartPrimitiveImage {
24
24
  * ```
25
25
  */
26
26
  export declare const MessagePartPrimitiveImage: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & {
27
- asChild?: boolean;
27
+ asChild?: boolean | undefined;
28
28
  }, "ref"> & {
29
29
  render?: import("react").ReactElement | undefined;
30
30
  } & import("react").RefAttributes<HTMLImageElement>, "ref"> & import("react").RefAttributes<HTMLImageElement>>;
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { MessagePartPrimitiveInProgress } from "@assistant-ui/core/react";
3
- export { MessagePartPrimitiveInProgress };
2
+ export { MessagePartPrimitiveInProgress } from "@assistant-ui/core/react";
@@ -37,7 +37,7 @@ export declare namespace MessagePartPrimitiveText {
37
37
  * ```
38
38
  */
39
39
  export declare const MessagePartPrimitiveText: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
40
- asChild?: boolean;
40
+ asChild?: boolean | undefined;
41
41
  }, "ref"> & {
42
42
  render?: import("react").ReactElement | undefined;
43
43
  } & import("react").RefAttributes<HTMLSpanElement>, "ref">, "children" | "asChild"> & {
@@ -13,7 +13,7 @@ export declare namespace QueueItemPrimitiveRemove {
13
13
  * ```
14
14
  */
15
15
  export declare const QueueItemPrimitiveRemove: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
16
- asChild?: boolean;
16
+ asChild?: boolean | undefined;
17
17
  }, "ref"> & {
18
18
  render?: import("react").ReactElement | undefined;
19
19
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -13,7 +13,7 @@ export declare namespace QueueItemPrimitiveSteer {
13
13
  * ```
14
14
  */
15
15
  export declare const QueueItemPrimitiveSteer: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
16
- asChild?: boolean;
16
+ asChild?: boolean | undefined;
17
17
  }, "ref"> & {
18
18
  render?: import("react").ReactElement | undefined;
19
19
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -13,7 +13,7 @@ export declare namespace QueueItemPrimitiveText {
13
13
  * ```
14
14
  */
15
15
  export declare const QueueItemPrimitiveText: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
16
- asChild?: boolean;
16
+ asChild?: boolean | undefined;
17
17
  }, "ref"> & {
18
18
  render?: import("react").ReactElement | undefined;
19
19
  } & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
@@ -19,7 +19,7 @@ export declare namespace SelectionToolbarPrimitiveQuote {
19
19
  * ```
20
20
  */
21
21
  export declare const SelectionToolbarPrimitiveQuote: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
22
- asChild?: boolean;
22
+ asChild?: boolean | undefined;
23
23
  }, "ref"> & {
24
24
  render?: import("react").ReactElement | undefined;
25
25
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -25,7 +25,7 @@ export declare namespace SelectionToolbarPrimitiveRoot {
25
25
  * ```
26
26
  */
27
27
  export declare const SelectionToolbarPrimitiveRoot: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
28
- asChild?: boolean;
28
+ asChild?: boolean | undefined;
29
29
  }, "ref"> & {
30
30
  render?: import("react").ReactElement | undefined;
31
31
  } & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -13,7 +13,7 @@ export declare namespace SuggestionPrimitiveDescription {
13
13
  * ```
14
14
  */
15
15
  export declare const SuggestionPrimitiveDescription: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
16
- asChild?: boolean;
16
+ asChild?: boolean | undefined;
17
17
  }, "ref"> & {
18
18
  render?: import("react").ReactElement | undefined;
19
19
  } & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
@@ -13,7 +13,7 @@ export declare namespace SuggestionPrimitiveTitle {
13
13
  * ```
14
14
  */
15
15
  export declare const SuggestionPrimitiveTitle: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
16
- asChild?: boolean;
16
+ asChild?: boolean | undefined;
17
17
  }, "ref"> & {
18
18
  render?: import("react").ReactElement | undefined;
19
19
  } & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
@@ -30,7 +30,7 @@ export declare namespace SuggestionPrimitiveTrigger {
30
30
  * ```
31
31
  */
32
32
  export declare const SuggestionPrimitiveTrigger: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
33
- asChild?: boolean;
33
+ asChild?: boolean | undefined;
34
34
  }, "ref"> & {
35
35
  render?: import("react").ReactElement | undefined;
36
36
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & {
@@ -11,7 +11,7 @@ export declare namespace ThreadPrimitiveLoadEarlier {
11
11
  * focus until the page lands; read `thread.isLoadingEarlier` to show progress.
12
12
  */
13
13
  export declare const ThreadPrimitiveLoadEarlier: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
14
- asChild?: boolean;
14
+ asChild?: boolean | undefined;
15
15
  }, "ref"> & {
16
16
  render?: import("react").ReactElement | undefined;
17
17
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl, ThreadPrimitiveRow, ThreadPrimitiveUnstable_MessageById } from "@assistant-ui/core/react";
3
- export { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl, ThreadPrimitiveRow, ThreadPrimitiveUnstable_MessageById };
2
+ export { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl, ThreadPrimitiveRow, ThreadPrimitiveUnstable_MessageById } from "@assistant-ui/core/react";
@@ -30,7 +30,7 @@ export declare namespace ThreadPrimitiveRoot {
30
30
  * ```
31
31
  */
32
32
  export declare const ThreadPrimitiveRoot: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
33
- asChild?: boolean;
33
+ asChild?: boolean | undefined;
34
34
  }, "ref"> & {
35
35
  render?: import("react").ReactElement | undefined;
36
36
  } & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;